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 DBAUI_USERADMINDLG_HXX
25 #define DBAUI_USERADMINDLG_HXX
26 
27 #ifndef _SFXTABDLG_HXX
28 #include <sfx2/tabdlg.hxx>
29 #endif
30 #ifndef _DBAUI_DSNTYPES_HXX_
31 #include "dsntypes.hxx"
32 #endif
33 #ifndef DBAUI_ITEMSETHELPER_HXX
34 #include "IItemSetHelper.hxx"
35 #endif
36 #ifndef _COMPHELPER_UNO3_HXX_
37 #include <comphelper/uno3.hxx>
38 #endif
39 #ifndef _DBAUI_MODULE_DBU_HXX_
40 #include "moduledbu.hxx"
41 #endif
42 #include <memory>
43 
44 FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
45 FORWARD_DECLARE_INTERFACE(sdbc,XConnection)
46 FORWARD_DECLARE_INTERFACE(lang,XMultiServiceFactory)
47 
48 //.........................................................................
49 namespace dbaui
50 {
51 //.........................................................................
52 	class ODbDataSourceAdministrationHelper;
53 	//=========================================================================
54 	//= OUserAdminDlg
55 	//=========================================================================
56 
57 	/** implements the user adin dialog
58 	*/
59 	class OUserAdminDlg : public SfxTabDialog, public IItemSetHelper, public IDatabaseSettingsDialog,public dbaui::OModuleClient
60 	{
61 		OModuleClient m_aModuleClient;
62 		::std::auto_ptr<ODbDataSourceAdministrationHelper>	m_pImpl;
63 		SfxItemSet* m_pItemSet;
64 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>			m_xConnection;
65 		sal_Bool	m_bOwnConnection;
66 	protected:
67 		virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage);
68 	public:
69 		OUserAdminDlg( Window* _pParent
70 							,SfxItemSet* _pItems
71 							,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
72 							,const ::com::sun::star::uno::Any& _aDataSourceName
73 							,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection);
74 
75 		virtual ~OUserAdminDlg();
76 
77 		virtual const SfxItemSet* getOutputSet() const;
78 		virtual SfxItemSet* getWriteOutputSet();
79 
80 		virtual short	Execute();
81 
82 		// forwards to ODbDataSourceAdministrationHelper
83 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const;
84 		virtual ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >,sal_Bool> createConnection();
85 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >	getDriver();
86 		virtual ::rtl::OUString getDatasourceType(const SfxItemSet& _rSet) const;
87 		virtual void clearPassword();
88 		virtual sal_Bool saveDatasource();
89 		virtual void setTitle(const ::rtl::OUString& _sTitle);
90         virtual void enableConfirmSettings( bool _bEnable );
91 	};
92 //.........................................................................
93 }	// namespace dbaui
94 //.........................................................................
95 
96 #endif // DBAUI_USERADMINDLG_HXX
97