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 _BIB_FRAMECTR_HXX 25 #define _BIB_FRAMECTR_HXX 26 #include <com/sun/star/beans/XPropertyChangeListener.hpp> 27 #include <com/sun/star/frame/XDispatchProvider.hpp> 28 #include <com/sun/star/frame/XController.hpp> 29 #include <com/sun/star/frame/XDispatch.hpp> 30 #include <com/sun/star/form/XLoadable.hpp> 31 #include <com/sun/star/lang/XServiceInfo.hpp> 32 #include <com/sun/star/frame/XDispatchInformationProvider.hpp> 33 #include <cppuhelper/implbase5.hxx> 34 #include <svl/svarray.hxx> 35 36 #include "bibmod.hxx" 37 class BibDataManager; 38 class BibFrameCtrl_Impl; 39 namespace com{namespace sun{namespace star{ 40 namespace form { namespace runtime { 41 class XFormController; 42 } } 43 }}} 44 class BibStatusDispatch 45 { 46 public: 47 ::com::sun::star::util::URL aURL; 48 ::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)49 BibStatusDispatch( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef ) 50 : aURL( rURL ) 51 , xListener( xRef ) 52 {} 53 }; 54 55 typedef BibStatusDispatch* BibStatusDispatchPtr; 56 SV_DECL_PTRARR_DEL( BibStatusDispatchArr, BibStatusDispatchPtr, 4, 4 ) 57 58 class BibFrameController_Impl : public cppu::WeakImplHelper5 < 59 ::com::sun::star::lang::XServiceInfo, 60 ::com::sun::star::frame::XController, 61 ::com::sun::star::frame::XDispatch, 62 ::com::sun::star::frame::XDispatchProvider, 63 ::com::sun::star::frame::XDispatchInformationProvider 64 > 65 { 66 friend class BibFrameCtrl_Impl; 67 BibFrameCtrl_Impl* pImp; 68 BibStatusDispatchArr aStatusListeners; 69 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow; 70 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame; 71 sal_Bool bDisposing; 72 sal_Bool bHierarchical; 73 ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > m_xDatMan; 74 BibDataManager* pDatMan; 75 HdlBibModul pBibMod; 76 77 DECL_STATIC_LINK( BibFrameController_Impl, DisposeHdl, void* ); 78 79 sal_Bool SaveModified(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& xController); 80 public: 81 BibFrameController_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > & xComponent, 82 BibDataManager* pDatMan); 83 ~BibFrameController_Impl(); 84 85 86 void activate(); 87 void deactivate(); 88 89 void ChangeDataSource(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs); 90 void RemoveFilter(); 91 92 // ::com::sun::star::lang::XServiceInfo 93 virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); 94 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName ) throw (::com::sun::star::uno::RuntimeException); 95 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); 96 97 // ::com::sun::star::frame::XController 98 virtual void SAL_CALL attachFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame ) throw (::com::sun::star::uno::RuntimeException); 99 virtual sal_Bool SAL_CALL attachModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel ) throw (::com::sun::star::uno::RuntimeException); 100 virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) throw (::com::sun::star::uno::RuntimeException); 101 virtual ::com::sun::star::uno::Any SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException); 102 virtual void SAL_CALL restoreViewData( const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::uno::RuntimeException); 103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException); 104 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel() throw (::com::sun::star::uno::RuntimeException); 105 106 // ::com::sun::star::lang::XComponent 107 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException); 108 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException); 109 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException); 110 111 // ::com::sun::star::frame::XDispatchProvider 112 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); 113 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); 114 115 //class ::com::sun::star::frame::XDispatch 116 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); 117 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); 118 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); 119 120 // ::com::sun::star::frame::XDispatchInformationProvider 121 virtual ::com::sun::star::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups( ) throw (::com::sun::star::uno::RuntimeException); 122 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (::com::sun::star::uno::RuntimeException); 123 }; 124 125 #endif 126 127