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