xref: /AOO41X/main/framework/inc/recording/dispatchrecordersupplier.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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 __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
29 #define __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
30 
31 //_________________________________________________________________________________________________________________
32 // include own things
33 
34 #include <threadhelp/threadhelpbase.hxx>
35 #include <macros/xinterface.hxx>
36 #include <macros/xtypeprovider.hxx>
37 #include <macros/xserviceinfo.hxx>
38 #include <macros/debug.hxx>
39 #include <macros/generic.hxx>
40 #include <general.h>
41 #include <stdtypes.h>
42 
43 //_________________________________________________________________________________________________________________
44 // include interfaces
45 #include <com/sun/star/lang/XTypeProvider.hpp>
46 #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
47 
48 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
49 #include <com/sun/star/util/URL.hpp>
50 #include <com/sun/star/beans/PropertyValue.hpp>
51 
52 //_________________________________________________________________________________________________________________
53 // include other projects
54 #include <cppuhelper/weak.hxx>
55 
56 //_________________________________________________________________________________________________________________
57 //	namespace
58 
59 namespace framework{
60 
61 //_________________________________________________________________________________________________________________
62 //	exported const
63 
64 //_________________________________________________________________________________________________________________
65 //	exported definitions
66 
67 //_______________________________________________
68 
69 /** @short          implement a supplier for dispatch recorder
70     @descr          This supplier can be set on property "DispatchRecorderSupplier" on a frame.
71                     By using of this supplier and his internal XDispatchRecorder it's possible to
72                     record XDispatch::dispatch() requests.
73 
74     @threadsafe     yes
75  */
76 class DispatchRecorderSupplier  :   // interfaces
77                                     public  css::lang::XTypeProvider                ,
78                                     public  css::lang::XServiceInfo                 ,
79                                     public  css::frame::XDispatchRecorderSupplier   ,
80                                     // baseclasses
81                                     // Order is neccessary for right initialization!
82                                     private ThreadHelpBase                          ,
83                                     public  ::cppu::OWeakObject
84 {
85     //___________________________________________
86     // member
87 
88 	private:
89 
90         //_______________________________________
91         /** provided dispatch recorder of this supplier instance
92 
93             @life   Is controled from outside. Because this variable is setted
94                     from there and not created internaly. But we release our
95                     reference to it if we die.
96          */
97         css::uno::Reference< css::frame::XDispatchRecorder > m_xDispatchRecorder;
98 
99         //_______________________________________
100         /** reference to the global uno service manager
101          */
102         css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
103 
104     //___________________________________________
105     // uno interface
106 
107     public:
108 
109         //_______________________________________
110         // XInterface, XTypeProvider, XServiceInfo
111 
112         FWK_DECLARE_XINTERFACE
113         FWK_DECLARE_XTYPEPROVIDER
114         DECLARE_XSERVICEINFO
115 
116         //_______________________________________
117         // XDispatchRecorderSupplier
118 
119         virtual void                                                 SAL_CALL setDispatchRecorder( const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder   ) throw (css::uno::RuntimeException);
120         virtual css::uno::Reference< css::frame::XDispatchRecorder > SAL_CALL getDispatchRecorder(                                                                         ) throw (css::uno::RuntimeException);
121         virtual void                                                 SAL_CALL dispatchAndRecord  ( const css::util::URL&                                       aURL        ,
122                                                                                                    const css::uno::Sequence< css::beans::PropertyValue >&      lArguments  ,
123                                                                                                    const css::uno::Reference< css::frame::XDispatch >&         xDispatcher ) throw (css::uno::RuntimeException);
124 
125     //___________________________________________
126     // native interface
127 
128     public:
129 
130          DispatchRecorderSupplier( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
131         ~DispatchRecorderSupplier();
132 
133 };      //  class DispatchRecorderSupplier
134 
135 }		//	namespace framework
136 
137 #endif  //  #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
138