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