1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
21 #define __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
23 #include <threadhelp/threadhelpbase.hxx>
24 #include <macros/xinterface.hxx>
25 #include <macros/xtypeprovider.hxx>
26 #include <macros/xserviceinfo.hxx>
27 #include <macros/debug.hxx>
28 #include <macros/generic.hxx>
32 #include <com/sun/star/lang/XTypeProvider.hpp>
33 #include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/util/URL.hpp>
36 #include <com/sun/star/beans/PropertyValue.hpp>
38 #include <cppuhelper/weak.hxx>
42 /** @short implement a supplier for dispatch recorder
43 @descr This supplier can be set on property "DispatchRecorderSupplier" on a frame.
44 By using of this supplier and his internal XDispatchRecorder it's possible to
45 record XDispatch::dispatch() requests.
49 class DispatchRecorderSupplier
: // interfaces
50 public css::lang::XTypeProvider
,
51 public css::lang::XServiceInfo
,
52 public css::frame::XDispatchRecorderSupplier
,
54 // Order is necessary for right initialization!
55 private ThreadHelpBase
,
56 public ::cppu::OWeakObject
58 //___________________________________________
63 //_______________________________________
64 /** provided dispatch recorder of this supplier instance
66 @life Is controled from outside. Because this variable is setted
67 from there and not created internaly. But we release our
68 reference to it if we die.
70 css::uno::Reference
< css::frame::XDispatchRecorder
> m_xDispatchRecorder
;
72 //_______________________________________
73 /** reference to the global uno service manager
75 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
;
77 //___________________________________________
82 //_______________________________________
83 // XInterface, XTypeProvider, XServiceInfo
85 FWK_DECLARE_XINTERFACE
86 FWK_DECLARE_XTYPEPROVIDER
89 //_______________________________________
90 // XDispatchRecorderSupplier
92 virtual void SAL_CALL
setDispatchRecorder( const css::uno::Reference
< css::frame::XDispatchRecorder
>& xRecorder
) throw (css::uno::RuntimeException
);
93 virtual css::uno::Reference
< css::frame::XDispatchRecorder
> SAL_CALL
getDispatchRecorder( ) throw (css::uno::RuntimeException
);
94 virtual void SAL_CALL
dispatchAndRecord ( const css::util::URL
& aURL
,
95 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
,
96 const css::uno::Reference
< css::frame::XDispatch
>& xDispatcher
) throw (css::uno::RuntimeException
);
98 //___________________________________________
103 DispatchRecorderSupplier( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xFactory
);
104 ~DispatchRecorderSupplier();
106 }; // class DispatchRecorderSupplier
108 } // namespace framework
110 #endif // #ifndef __FRAMEWORK_RECORDING_DISPATCHRECORDERSUPPLIER_HXX_
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */