1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DBACCESS_ADVANCEDSETTINGSDLG_HXX
25 #define DBACCESS_ADVANCEDSETTINGSDLG_HXX
26 
27 #include "IItemSetHelper.hxx"
28 #include "moduledbu.hxx"
29 
30  /** === begin UNO includes === **/
31 /** === end UNO includes === **/
32 
33 #include <sfx2/tabdlg.hxx>
34 
35 #include <memory>
36 
37 //........................................................................
38 namespace dbaui
39 {
40 //........................................................................
41 
42 	//=========================================================================
43 	//= AdvancedSettingsDialog
44 	//=========================================================================
45 	class ODbDataSourceAdministrationHelper;
46 	/** implements the advanced page dlg of the data source properties.
47 	*/
48 	class AdvancedSettingsDialog    :public SfxTabDialog
49                                     ,public IItemSetHelper
50                                     ,public IDatabaseSettingsDialog
51 	{
52 		OModuleClient                                       m_aModuleClient;
53 		::std::auto_ptr<ODbDataSourceAdministrationHelper>	m_pImpl;
54 		SfxItemSet*                                         m_pItemSet;
55 
56     protected:
57 		virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage);
58 
59     public:
60 		AdvancedSettingsDialog( Window* _pParent
61 							,SfxItemSet* _pItems
62 							,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
63 							,const ::com::sun::star::uno::Any& _aDataSourceName);
64 
65 		virtual ~AdvancedSettingsDialog();
66 
67         /// determines whether or not the given data source type has any advanced setting
68         static  bool    doesHaveAnyAdvancedSettings( const ::rtl::OUString& _sURL );
69 
70 		virtual const SfxItemSet* getOutputSet() const;
71 		virtual SfxItemSet* getWriteOutputSet();
72 
73 		virtual short	Execute();
74 
75 		// forwards to ODbDataSourceAdministrationHelper
76 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
77 		virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
78 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >	getDriver();
79 		virtual ::rtl::OUString getDatasourceType(const SfxItemSet& _rSet) const;
80 		virtual void clearPassword();
81 		virtual sal_Bool saveDatasource();
82 		virtual void setTitle(const ::rtl::OUString& _sTitle);
83         virtual void enableConfirmSettings( bool _bEnable );
84 	};
85 
86 //........................................................................
87 } // namespace dbaui
88 //........................................................................
89 
90 #endif // DBACCESS_ADVANCEDSETTINGSDLG_HXX
91