LibreOffice Module ucbhelper (master) 1
interceptedinteraction.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_UCBHELPER_INTERCEPTEDINTERACTION_HXX
21#define INCLUDED_UCBHELPER_INTERCEPTEDINTERACTION_HXX
22
23#include <vector>
24
25#include <com/sun/star/task/XInteractionHandler.hpp>
26
29
30namespace com::sun::star::task { class XInteractionRequest; }
31
32
33namespace ucbhelper{
34
35
44// extra struct to work around MSVC linking issue
45struct InterceptedInteraction_Base : public ::cppu::WeakImplHelper< css::task::XInteractionHandler > {};
46
48{
49
50 // types
51 public:
52
54 {
55
58 static const sal_Int32 INVALID_HANDLE = -1;
59
60
62 css::uno::Any Request;
63
64
68 css::uno::Type Continuation;
69
70
77 sal_Int32 Handle;
78
79
87 {
88 Handle = INVALID_HANDLE;
89 }
90 InterceptedRequest(css::uno::Any Request_, css::uno::Type Continuation_, sal_Int32 Handle_)
91 : Request(std::move(Request_)), Continuation(std::move(Continuation_)), Handle(Handle_)
92 {
93 }
94
95 };
96
97
104 {
112 E_INTERCEPTED
113 };
114
115
116 // member
117 protected:
118
119
127 css::uno::Reference< css::task::XInteractionHandler > m_xInterceptedHandler;
128
129
132 ::std::vector< InterceptedRequest > m_lInterceptions;
133
134
135 // native interface
136 public:
137
138
142
143
155 void setInterceptedHandler(const css::uno::Reference< css::task::XInteractionHandler >& xInterceptedHandler);
156
157
167 void setInterceptions(::std::vector< InterceptedRequest >&& lInterceptions);
168
169
182 static css::uno::Reference< css::task::XInteractionContinuation > extractContinuation(
183 const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& lContinuations,
184 const css::uno::Type& aType );
185
186
187 // usable for derived classes
188 protected:
189
190
219 virtual EInterceptionState intercepted(const InterceptedRequest& rRequest ,
220 const css::uno::Reference< css::task::XInteractionRequest >& xOrgRequest);
221
222
223 // uno interface
224 public:
225
226
244 virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest) override;
245
246
247 // helper
248 private:
249
250
254 UCBHELPER_DLLPRIVATE void impl_handleDefault(const css::uno::Reference< css::task::XInteractionRequest >& xRequest);
255
256
274 UCBHELPER_DLLPRIVATE EInterceptionState impl_interceptRequest(const css::uno::Reference< css::task::XInteractionRequest >& xRequest);
275};
276
277} // namespace ucbhelper
278
279#endif // INCLUDED_UCBHELPER_INTERCEPTEDINTERACTION_HXX
280
281/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::task::XInteractionHandler > m_xInterceptedHandler
reference to the intercepted interaction handler.
::std::vector< InterceptedRequest > m_lInterceptions
these list contains the requests, which should be intercepted.
EInterceptionState
represent the different states, which can occur as result of an interception.
@ E_NOT_INTERCEPTED
none of the specified interceptions match the incoming request
@ E_NO_CONTINUATION_FOUND
the request could be intercepted - but the specified continuation could not be located.
InterceptedRequest(css::uno::Any Request_, css::uno::Type Continuation_, sal_Int32 Handle_)
css::uno::Type Continuation
specify the fix continuation, which must be selected, if the interaction could be intercepted success...
css::uno::Any Request
contains the interaction request, which should be intercepted.
sal_Int32 Handle
it's a unique identifier, which must be managed by the outside code.
it wraps any other interaction handler and intercept its handle() requests.
#define UCBHELPER_DLLPUBLIC
#define UCBHELPER_DLLPRIVATE