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 
27 #include <cppuhelper/implbase.hxx>
29 
30 namespace com::sun::star::task { class XInteractionRequest; }
31 
32 
33 namespace ucbhelper{
34 
35 
44 class UCBHELPER_DLLPUBLIC InterceptedInteraction : public ::cppu::WeakImplHelper< css::task::XInteractionHandler >
45 {
46 
47  // types
48  public:
49 
51  {
52 
55  static const sal_Int32 INVALID_HANDLE = -1;
56 
57 
59  css::uno::Any Request;
60 
61 
65  css::uno::Type Continuation;
66 
67 
74  sal_Int32 Handle;
75 
76 
84  {
85  Handle = INVALID_HANDLE;
86  }
87 
88  };
89 
90 
97  {
105  E_INTERCEPTED
106  };
107 
108 
109  // member
110  protected:
111 
112 
120  css::uno::Reference< css::task::XInteractionHandler > m_xInterceptedHandler;
121 
122 
125  ::std::vector< InterceptedRequest > m_lInterceptions;
126 
127 
128  // native interface
129  public:
130 
131 
135 
136 
148  void setInterceptedHandler(const css::uno::Reference< css::task::XInteractionHandler >& xInterceptedHandler);
149 
150 
160  void setInterceptions(const ::std::vector< InterceptedRequest >& lInterceptions);
161 
162 
175  static css::uno::Reference< css::task::XInteractionContinuation > extractContinuation(
176  const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& lContinuations,
177  const css::uno::Type& aType );
178 
179 
180  // usable for derived classes
181  protected:
182 
183 
212  virtual EInterceptionState intercepted(const InterceptedRequest& rRequest ,
213  const css::uno::Reference< css::task::XInteractionRequest >& xOrgRequest);
214 
215 
216  // uno interface
217  public:
218 
219 
237  virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest) override;
238 
239 
240  // helper
241  private:
242 
243 
247  UCBHELPER_DLLPRIVATE void impl_handleDefault(const css::uno::Reference< css::task::XInteractionRequest >& xRequest);
248 
249 
267  UCBHELPER_DLLPRIVATE EInterceptionState impl_interceptRequest(const css::uno::Reference< css::task::XInteractionRequest >& xRequest);
268 };
269 
270 } // namespace ucbhelper
271 
272 #endif // INCLUDED_UCBHELPER_INTERCEPTEDINTERACTION_HXX
273 
274 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define UCBHELPER_DLLPRIVATE
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.
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.
none of the specified interceptions match the incoming request
the request could be intercepted - but the specified continuation could not be located.
EInterceptionState
represent the different states, which can occur as result of an interception.
css::uno::Type Continuation
specify the fix continuation, which must be selected, if the interaction could be intercepted success...
#define UCBHELPER_DLLPUBLIC