1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dispatchrecordersupplier.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
32 #define __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
34 //_________________________________________________________________________________________________________________
37 #include <threadhelp/threadhelpbase.hxx>
38 #include <macros/xinterface.hxx>
39 #include <macros/xtypeprovider.hxx>
40 #include <macros/xserviceinfo.hxx>
41 #include <macros/debug.hxx>
42 #include <macros/generic.hxx>
46 //_________________________________________________________________________________________________________________
48 #include <com/sun/star/lang/XTypeProvider.hpp>
49 #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
51 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
52 #include <com/sun/star/util/URL.hpp>
53 #include <com/sun/star/beans/PropertyValue.hpp>
55 //_________________________________________________________________________________________________________________
56 // include other projects
57 #include <cppuhelper/weak.hxx>
59 //_________________________________________________________________________________________________________________
64 //_________________________________________________________________________________________________________________
67 //_________________________________________________________________________________________________________________
68 // exported definitions
70 //_______________________________________________
72 /** @short implement a supplier for dispatch recorder
73 @descr This supplier can be set on property "DispatchRecorderSupplier" on a frame.
74 By using of this supplier and his internal XDispatchRecorder it's possible to
75 record XDispatch::dispatch() requests.
79 class DispatchRecorderSupplier
: // interfaces
80 public css::lang::XTypeProvider
,
81 public css::lang::XServiceInfo
,
82 public css::frame::XDispatchRecorderSupplier
,
84 // Order is neccessary for right initialization!
85 private ThreadHelpBase
,
86 public ::cppu::OWeakObject
88 //___________________________________________
93 //_______________________________________
94 /** provided dispatch recorder of this supplier instance
96 @life Is controled from outside. Because this variable is setted
97 from there and not created internaly. But we release our
98 reference to it if we die.
100 css::uno::Reference
< css::frame::XDispatchRecorder
> m_xDispatchRecorder
;
102 //_______________________________________
103 /** reference to the global uno service manager
105 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
;
107 //___________________________________________
112 //_______________________________________
113 // XInterface, XTypeProvider, XServiceInfo
115 FWK_DECLARE_XINTERFACE
116 FWK_DECLARE_XTYPEPROVIDER
119 //_______________________________________
120 // XDispatchRecorderSupplier
122 virtual void SAL_CALL
setDispatchRecorder( const css::uno::Reference
< css::frame::XDispatchRecorder
>& xRecorder
) throw (css::uno::RuntimeException
);
123 virtual css::uno::Reference
< css::frame::XDispatchRecorder
> SAL_CALL
getDispatchRecorder( ) throw (css::uno::RuntimeException
);
124 virtual void SAL_CALL
dispatchAndRecord ( const css::util::URL
& aURL
,
125 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
,
126 const css::uno::Reference
< css::frame::XDispatch
>& xDispatcher
) throw (css::uno::RuntimeException
);
128 //___________________________________________
133 DispatchRecorderSupplier( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xFactory
);
134 ~DispatchRecorderSupplier();
136 }; // class DispatchRecorderSupplier
138 } // namespace framework
140 #endif // #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_