xref: /trunk/main/dbaccess/source/ui/inc/advancedsettingsdlg.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef DBACCESS_ADVANCEDSETTINGSDLG_HXX
29 #define DBACCESS_ADVANCEDSETTINGSDLG_HXX
30 
31 #include "IItemSetHelper.hxx"
32 #include "moduledbu.hxx"
33 
34  /** === begin UNO includes === **/
35 /** === end UNO includes === **/
36 
37 #include <sfx2/tabdlg.hxx>
38 
39 #include <memory>
40 
41 //........................................................................
42 namespace dbaui
43 {
44 //........................................................................
45 
46     //=========================================================================
47     //= AdvancedSettingsDialog
48     //=========================================================================
49     class ODbDataSourceAdministrationHelper;
50     /** implements the advanced page dlg of the data source properties.
51     */
52     class AdvancedSettingsDialog    :public SfxTabDialog
53                                     ,public IItemSetHelper
54                                     ,public IDatabaseSettingsDialog
55     {
56         OModuleClient                                       m_aModuleClient;
57         ::std::auto_ptr<ODbDataSourceAdministrationHelper>  m_pImpl;
58         SfxItemSet*                                         m_pItemSet;
59 
60     protected:
61         virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage);
62 
63     public:
64         AdvancedSettingsDialog( Window* _pParent
65                             ,SfxItemSet* _pItems
66                             ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
67                             ,const ::com::sun::star::uno::Any& _aDataSourceName);
68 
69         virtual ~AdvancedSettingsDialog();
70 
71         /// determines whether or not the given data source type has any advanced setting
72         static  bool    doesHaveAnyAdvancedSettings( const ::rtl::OUString& _sURL );
73 
74         virtual const SfxItemSet* getOutputSet() const;
75         virtual SfxItemSet* getWriteOutputSet();
76 
77         virtual short   Execute();
78 
79         // forwards to ODbDataSourceAdministrationHelper
80         virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
81         virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
82         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver();
83         virtual ::rtl::OUString getDatasourceType(const SfxItemSet& _rSet) const;
84         virtual void clearPassword();
85         virtual sal_Bool saveDatasource();
86         virtual void setTitle(const ::rtl::OUString& _sTitle);
87         virtual void enableConfirmSettings( bool _bEnable );
88     };
89 
90 //........................................................................
91 } // namespace dbaui
92 //........................................................................
93 
94 #endif // DBACCESS_ADVANCEDSETTINGSDLG_HXX
95