xref: /aoo4110/main/dbaccess/source/ui/inc/exsrcbrw.hxx (revision b1cdbd2c)
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 _SBA_EXTCTRLR_HXX
25 #define _SBA_EXTCTRLR_HXX
26 
27 #include "brwctrlr.hxx"
28 
29 #include <comphelper/uno3.hxx>
30 #include <cppuhelper/implbase2.hxx>
31 
32 //==============================================================================
33 //= SbaExternalSourceBrowser
34 //==============================================================================
35 
36 namespace dbaui
37 {
38 	class SbaXFormAdapter;
39 	class SbaExternalSourceBrowser
40 				:public SbaXDataBrowserController
41 				,public ::com::sun::star::util::XModifyBroadcaster
42 	{
43 		::cppu::OInterfaceContainerHelper	m_aModifyListeners;
44 			// for multiplexing the modify events
45 		SbaXFormAdapter*					m_pDataSourceImpl;
46 		sal_Bool							m_bInQueryDispatch;
47 			// our queryDispatch will ask our frame, which first will ask our queryDispatch, so we need to protect against
48 			// recursion
49 
50 	public:
51 		SbaExternalSourceBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM);
52 
53 		static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
54 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
55 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
56 				SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
57 
58 		// UNO
59 		DECLARE_UNO3_DEFAULTS(SbaExternalSourceBrowser, OGenericUnoController);
60 		virtual ::com::sun::star::uno::Any	SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
61 		//	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > >	getIdlClasses(void);
62 
63 		//	static ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >  getStaticIdlClass();
64 
65 		// ::com::sun::star::frame::XDispatch
66 		virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) throw(::com::sun::star::uno::RuntimeException);
67 
68 		// ::com::sun::star::frame::XDispatchProvider
69 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >  SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( ::com::sun::star::uno::RuntimeException );
70 
71 		// ::com::sun::star::util::XModifyListener
72 		virtual void SAL_CALL modified(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
73 
74 		// ::com::sun::star::util::XModifyBroadcaster
75 		virtual void SAL_CALL addModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
76 		virtual void SAL_CALL removeModifyListener(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
77 
78 		// ::com::sun::star::lang::XComponent
79 		virtual void SAL_CALL disposing();
80 
81 		// ::com::sun::star::form::XLoadListener
82 		virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
83 
84 		// ::com::sun::star::lang::XEventListener
85 		virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
86 
87 		// XServiceInfo
88 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
89 		virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
90 
91 	protected:
92 		~SbaExternalSourceBrowser();
93 
94 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >  CreateForm();
95 		virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties );
96 
97 		virtual sal_Bool LoadForm();
98 
99 		void Attach(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xMaster);
100 
101 		void ClearView();
102 
103 		void startListening();
104 		void stopListening();
105 	};
106 }
107 
108 #endif // _SBA_EXTCTRLR_HXX
109