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_TABLESSINGLEDLG_HXX_
29 #define _DBAUI_TABLESSINGLEDLG_HXX_
30 
31 #ifndef _BASEDLGS_HXX
32 #include <sfx2/basedlgs.hxx>
33 #endif
34 #ifndef DBAUI_ITEMSETHELPER_HXX
35 #include "IItemSetHelper.hxx"
36 #endif
37 #ifndef _COMPHELPER_UNO3_HXX_
38 #include <comphelper/uno3.hxx>
39 #endif
40 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
41 #include <com/sun/star/beans/PropertyValue.hpp>
42 #endif
43 
44 #include <memory>
45 
46 FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
47 FORWARD_DECLARE_INTERFACE(sdbc,XConnection)
48 FORWARD_DECLARE_INTERFACE(lang,XMultiServiceFactory)
49 
50 //.........................................................................
51 namespace dbaui
52 {
53 //.........................................................................
54 class ODbDataSourceAdministrationHelper;
55 	//========================================================================
56 	//= OTableSubscriptionDialog
57 	//========================================================================
58 	class OTableSubscriptionDialog : public SfxSingleTabDialog, public IItemSetHelper
59 	{
60 		::std::auto_ptr<ODbDataSourceAdministrationHelper>	m_pImpl;
61 		sal_Bool m_bStopExecution; // set when the dialog should not be executed
62 
63 		DECL_LINK( OKClickHdl, OKButton* );
64 		SfxItemSet*				m_pOutSet;
65 	public:
66 
67 		OTableSubscriptionDialog(Window* pParent
68 			,SfxItemSet* _pItems
69 			,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
70 			,const ::com::sun::star::uno::Any& _aDataSourceName
71 		);
72 		virtual ~OTableSubscriptionDialog();
73 
74 		// forwards from ODbDataSourceAdministrationHelper
75 		void		successfullyConnected();
76 		sal_Bool	getCurrentSettings(::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rDriverParams);
77 		void		clearPassword();
78 		String		getConnectionURL() const;
79 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >	getCurrentDataSource();
80 		inline void endExecution() { m_bStopExecution = sal_True; }
81 
82 		virtual const SfxItemSet* getOutputSet() const;
83 		virtual SfxItemSet* getWriteOutputSet();
84 
85 		virtual short	Execute();
86 	};
87 
88 //.........................................................................
89 }	// namespace dbaui
90 //.........................................................................
91 
92 #endif // _DBAUI_TABLESSINGLEDLG_HXX_
93 
94