1*f8e07b45SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f8e07b45SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f8e07b45SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f8e07b45SAndrew Rist * distributed with this work for additional information 6*f8e07b45SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f8e07b45SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f8e07b45SAndrew Rist * "License"); you may not use this file except in compliance 9*f8e07b45SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*f8e07b45SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*f8e07b45SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f8e07b45SAndrew Rist * software distributed under the License is distributed on an 15*f8e07b45SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f8e07b45SAndrew Rist * KIND, either express or implied. See the License for the 17*f8e07b45SAndrew Rist * specific language governing permissions and limitations 18*f8e07b45SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*f8e07b45SAndrew Rist *************************************************************/ 21*f8e07b45SAndrew Rist 22*f8e07b45SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_ 25cdf0e10cSrcweir #define __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 28cdf0e10cSrcweir // include own things 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx> 31cdf0e10cSrcweir #include <macros/xinterface.hxx> 32cdf0e10cSrcweir #include <macros/xtypeprovider.hxx> 33cdf0e10cSrcweir #include <macros/xserviceinfo.hxx> 34cdf0e10cSrcweir #include <macros/debug.hxx> 35cdf0e10cSrcweir #include <macros/generic.hxx> 36cdf0e10cSrcweir #include <general.h> 37cdf0e10cSrcweir #include <stdtypes.h> 38cdf0e10cSrcweir 39cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 40cdf0e10cSrcweir // include interfaces 41cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 42cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp> 43cdf0e10cSrcweir 44cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 45cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp> 46cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 47cdf0e10cSrcweir 48cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 49cdf0e10cSrcweir // include other projects 50cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 51cdf0e10cSrcweir 52cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 53cdf0e10cSrcweir // namespace 54cdf0e10cSrcweir 55cdf0e10cSrcweir namespace framework{ 56cdf0e10cSrcweir 57cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 58cdf0e10cSrcweir // exported const 59cdf0e10cSrcweir 60cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 61cdf0e10cSrcweir // exported definitions 62cdf0e10cSrcweir 63cdf0e10cSrcweir //_______________________________________________ 64cdf0e10cSrcweir 65cdf0e10cSrcweir /** @short implement a supplier for dispatch recorder 66cdf0e10cSrcweir @descr This supplier can be set on property "DispatchRecorderSupplier" on a frame. 67cdf0e10cSrcweir By using of this supplier and his internal XDispatchRecorder it's possible to 68cdf0e10cSrcweir record XDispatch::dispatch() requests. 69cdf0e10cSrcweir 70cdf0e10cSrcweir @threadsafe yes 71cdf0e10cSrcweir */ 72cdf0e10cSrcweir class DispatchRecorderSupplier : // interfaces 73cdf0e10cSrcweir public css::lang::XTypeProvider , 74cdf0e10cSrcweir public css::lang::XServiceInfo , 75cdf0e10cSrcweir public css::frame::XDispatchRecorderSupplier , 76cdf0e10cSrcweir // baseclasses 77cdf0e10cSrcweir // Order is neccessary for right initialization! 78cdf0e10cSrcweir private ThreadHelpBase , 79cdf0e10cSrcweir public ::cppu::OWeakObject 80cdf0e10cSrcweir { 81cdf0e10cSrcweir //___________________________________________ 82cdf0e10cSrcweir // member 83cdf0e10cSrcweir 84cdf0e10cSrcweir private: 85cdf0e10cSrcweir 86cdf0e10cSrcweir //_______________________________________ 87cdf0e10cSrcweir /** provided dispatch recorder of this supplier instance 88cdf0e10cSrcweir 89cdf0e10cSrcweir @life Is controled from outside. Because this variable is setted 90cdf0e10cSrcweir from there and not created internaly. But we release our 91cdf0e10cSrcweir reference to it if we die. 92cdf0e10cSrcweir */ 93cdf0e10cSrcweir css::uno::Reference< css::frame::XDispatchRecorder > m_xDispatchRecorder; 94cdf0e10cSrcweir 95cdf0e10cSrcweir //_______________________________________ 96cdf0e10cSrcweir /** reference to the global uno service manager 97cdf0e10cSrcweir */ 98cdf0e10cSrcweir css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; 99cdf0e10cSrcweir 100cdf0e10cSrcweir //___________________________________________ 101cdf0e10cSrcweir // uno interface 102cdf0e10cSrcweir 103cdf0e10cSrcweir public: 104cdf0e10cSrcweir 105cdf0e10cSrcweir //_______________________________________ 106cdf0e10cSrcweir // XInterface, XTypeProvider, XServiceInfo 107cdf0e10cSrcweir 108cdf0e10cSrcweir FWK_DECLARE_XINTERFACE 109cdf0e10cSrcweir FWK_DECLARE_XTYPEPROVIDER 110cdf0e10cSrcweir DECLARE_XSERVICEINFO 111cdf0e10cSrcweir 112cdf0e10cSrcweir //_______________________________________ 113cdf0e10cSrcweir // XDispatchRecorderSupplier 114cdf0e10cSrcweir 115cdf0e10cSrcweir virtual void SAL_CALL setDispatchRecorder( const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder ) throw (css::uno::RuntimeException); 116cdf0e10cSrcweir virtual css::uno::Reference< css::frame::XDispatchRecorder > SAL_CALL getDispatchRecorder( ) throw (css::uno::RuntimeException); 117cdf0e10cSrcweir virtual void SAL_CALL dispatchAndRecord ( const css::util::URL& aURL , 118cdf0e10cSrcweir const css::uno::Sequence< css::beans::PropertyValue >& lArguments , 119cdf0e10cSrcweir const css::uno::Reference< css::frame::XDispatch >& xDispatcher ) throw (css::uno::RuntimeException); 120cdf0e10cSrcweir 121cdf0e10cSrcweir //___________________________________________ 122cdf0e10cSrcweir // native interface 123cdf0e10cSrcweir 124cdf0e10cSrcweir public: 125cdf0e10cSrcweir 126cdf0e10cSrcweir DispatchRecorderSupplier( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); 127cdf0e10cSrcweir ~DispatchRecorderSupplier(); 128cdf0e10cSrcweir 129cdf0e10cSrcweir }; // class DispatchRecorderSupplier 130cdf0e10cSrcweir 131cdf0e10cSrcweir } // namespace framework 132cdf0e10cSrcweir 133cdf0e10cSrcweir #endif // #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_ 134