-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinterceptor.hxx
117 lines (94 loc) · 3.67 KB
/
interceptor.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef INCO_NIOCS_TEST_INTERCEPTOREXTENSION_HXX
#define INCO_NIOCS_TEST_INTERCEPTOREXTENSION_HXX
#include <stdio.h>
#include <com/sun/star/task/XAsyncJob.hpp>
#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase1.hxx>
#include <osl/mutex.hxx>
#define IMPLEMENTATION_NAME "inco.niocs.test.RegisterInterceptorJobImpl"
namespace com
{
namespace sun
{
namespace star
{
namespace frame
{
class XFrame;
}
namespace uno
{
class XComponentContext;
}
namespace beans
{
struct NamedValue;
}
namespace task
{
class XJobListener;
}
namespace ui
{
enum ContextMenuInterceptorAction;
struct ContextMenuExecuteEvent;
}
}
}
}
// XContextMenuInterceptor implementer class
class ContextMenuInterceptorImpl : public cppu::WeakImplHelper1< ::com::sun::star::ui::XContextMenuInterceptor >
{
public:
ContextMenuInterceptorImpl()
{
printf("DEBUG>>> Created ContextMenuInterceptorImpl object : %p\n", this); fflush(stdout);
}
virtual ::com::sun::star::ui::ContextMenuInterceptorAction SAL_CALL notifyContextMenuExecute(
const ::com::sun::star::ui::ContextMenuExecuteEvent& rEvent )
throw ( ::com::sun::star::uno::RuntimeException );
};
class RegisterInterceptorJobImpl : public cppu::WeakImplHelper2
<
com::sun::star::task::XAsyncJob,
com::sun::star::lang::XServiceInfo
>
{
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
public:
RegisterInterceptorJobImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
: mxContext( rxContext )
{
printf("DEBUG>>> Created RegisterInterceptorJobImpl object : %p\n", this); fflush(stdout);
}
// XAsyncJob methods
virtual void SAL_CALL executeAsync( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rArgs,
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XJobListener >& rxListener )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException) override;
// XServiceInfo methods
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& aServiceName )
throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw (::com::sun::star::uno::RuntimeException);
private:
static ::com::sun::star::uno::Reference< ::com::sun::star::ui::XContextMenuInterceptor >& getInterceptor(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
sal_Int32& rCalls );
};
::rtl::OUString RegisterInterceptorJobImpl_getImplementationName()
throw ( ::com::sun::star::uno::RuntimeException );
sal_Bool SAL_CALL RegisterInterceptorJobImpl_supportsService( const ::rtl::OUString& ServiceName )
throw ( ::com::sun::star::uno::RuntimeException );
::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL RegisterInterceptorJobImpl_getSupportedServiceNames()
throw ( ::com::sun::star::uno::RuntimeException );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
SAL_CALL RegisterInterceptorJobImpl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext)
throw ( ::com::sun::star::uno::Exception );
#endif