1*46dbaceeSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*46dbaceeSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*46dbaceeSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*46dbaceeSAndrew Rist * distributed with this work for additional information 6*46dbaceeSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*46dbaceeSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*46dbaceeSAndrew Rist * "License"); you may not use this file except in compliance 9*46dbaceeSAndrew Rist * with the License. You may obtain a copy of the License at 10*46dbaceeSAndrew Rist * 11*46dbaceeSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*46dbaceeSAndrew Rist * 13*46dbaceeSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*46dbaceeSAndrew Rist * software distributed under the License is distributed on an 15*46dbaceeSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*46dbaceeSAndrew Rist * KIND, either express or implied. See the License for the 17*46dbaceeSAndrew Rist * specific language governing permissions and limitations 18*46dbaceeSAndrew Rist * under the License. 19*46dbaceeSAndrew Rist * 20*46dbaceeSAndrew Rist *************************************************************/ 21*46dbaceeSAndrew Rist 22*46dbaceeSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _BIB_FRAMECTR_HXX 25cdf0e10cSrcweir #define _BIB_FRAMECTR_HXX 26cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyChangeListener.hpp> 27cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchProvider.hpp> 28cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp> 29cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp> 30cdf0e10cSrcweir #include <com/sun/star/form/XLoadable.hpp> 31cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 32cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchInformationProvider.hpp> 33cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 34cdf0e10cSrcweir #include <svl/svarray.hxx> 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include "bibmod.hxx" 37cdf0e10cSrcweir class BibDataManager; 38cdf0e10cSrcweir class BibFrameCtrl_Impl; 39cdf0e10cSrcweir namespace com{namespace sun{namespace star{ 40cdf0e10cSrcweir namespace form { namespace runtime { 41cdf0e10cSrcweir class XFormController; 42cdf0e10cSrcweir } } 43cdf0e10cSrcweir }}} 44cdf0e10cSrcweir class BibStatusDispatch 45cdf0e10cSrcweir { 46cdf0e10cSrcweir public: 47cdf0e10cSrcweir ::com::sun::star::util::URL aURL; 48cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xListener; BibStatusDispatch(const::com::sun::star::util::URL & rURL,const::com::sun::star::uno::Reference<::com::sun::star::frame::XStatusListener> xRef)49cdf0e10cSrcweir BibStatusDispatch( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef ) 50cdf0e10cSrcweir : aURL( rURL ) 51cdf0e10cSrcweir , xListener( xRef ) 52cdf0e10cSrcweir {} 53cdf0e10cSrcweir }; 54cdf0e10cSrcweir 55cdf0e10cSrcweir typedef BibStatusDispatch* BibStatusDispatchPtr; 56cdf0e10cSrcweir SV_DECL_PTRARR_DEL( BibStatusDispatchArr, BibStatusDispatchPtr, 4, 4 ) 57cdf0e10cSrcweir 58cdf0e10cSrcweir class BibFrameController_Impl : public cppu::WeakImplHelper5 < 59cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 60cdf0e10cSrcweir ::com::sun::star::frame::XController, 61cdf0e10cSrcweir ::com::sun::star::frame::XDispatch, 62cdf0e10cSrcweir ::com::sun::star::frame::XDispatchProvider, 63cdf0e10cSrcweir ::com::sun::star::frame::XDispatchInformationProvider 64cdf0e10cSrcweir > 65cdf0e10cSrcweir { 66cdf0e10cSrcweir friend class BibFrameCtrl_Impl; 67cdf0e10cSrcweir BibFrameCtrl_Impl* pImp; 68cdf0e10cSrcweir BibStatusDispatchArr aStatusListeners; 69cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow; 70cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; 71cdf0e10cSrcweir sal_Bool bDisposing; 72cdf0e10cSrcweir sal_Bool bHierarchical; 73cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > m_xDatMan; 74cdf0e10cSrcweir BibDataManager* pDatMan; 75cdf0e10cSrcweir HdlBibModul pBibMod; 76cdf0e10cSrcweir 77cdf0e10cSrcweir DECL_STATIC_LINK( BibFrameController_Impl, DisposeHdl, void* ); 78cdf0e10cSrcweir 79cdf0e10cSrcweir sal_Bool SaveModified(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& xController); 80cdf0e10cSrcweir public: 81cdf0e10cSrcweir BibFrameController_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > & xComponent, 82cdf0e10cSrcweir BibDataManager* pDatMan); 83cdf0e10cSrcweir ~BibFrameController_Impl(); 84cdf0e10cSrcweir 85cdf0e10cSrcweir 86cdf0e10cSrcweir void activate(); 87cdf0e10cSrcweir void deactivate(); 88cdf0e10cSrcweir 89cdf0e10cSrcweir void ChangeDataSource(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs); 90cdf0e10cSrcweir void RemoveFilter(); 91cdf0e10cSrcweir 92cdf0e10cSrcweir // ::com::sun::star::lang::XServiceInfo 93cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName ) throw (::com::sun::star::uno::RuntimeException); 95cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); 96cdf0e10cSrcweir 97cdf0e10cSrcweir // ::com::sun::star::frame::XController 98cdf0e10cSrcweir virtual void SAL_CALL attachFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame ) throw (::com::sun::star::uno::RuntimeException); 99cdf0e10cSrcweir virtual sal_Bool SAL_CALL attachModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel ) throw (::com::sun::star::uno::RuntimeException); 100cdf0e10cSrcweir virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException); 102cdf0e10cSrcweir virtual void SAL_CALL restoreViewData( const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::uno::RuntimeException); 103cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException); 104cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel() throw (::com::sun::star::uno::RuntimeException); 105cdf0e10cSrcweir 106cdf0e10cSrcweir // ::com::sun::star::lang::XComponent 107cdf0e10cSrcweir virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException); 109cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException); 110cdf0e10cSrcweir 111cdf0e10cSrcweir // ::com::sun::star::frame::XDispatchProvider 112cdf0e10cSrcweir 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); 113cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw (::com::sun::star::uno::RuntimeException); 114cdf0e10cSrcweir 115cdf0e10cSrcweir //class ::com::sun::star::frame::XDispatch 116cdf0e10cSrcweir 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); 117cdf0e10cSrcweir virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw (::com::sun::star::uno::RuntimeException); 118cdf0e10cSrcweir virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw (::com::sun::star::uno::RuntimeException); 119cdf0e10cSrcweir 120cdf0e10cSrcweir // ::com::sun::star::frame::XDispatchInformationProvider 121cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups( ) throw (::com::sun::star::uno::RuntimeException); 122cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (::com::sun::star::uno::RuntimeException); 123cdf0e10cSrcweir }; 124cdf0e10cSrcweir 125cdf0e10cSrcweir #endif 126cdf0e10cSrcweir 127