LibreOffice Module comphelper (master)  1
interaction.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_COMPHELPER_INTERACTION_HXX
21 #define INCLUDED_COMPHELPER_INTERACTION_HXX
22 
23 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/task/XInteractionApprove.hpp>
25 #include <com/sun/star/task/XInteractionDisapprove.hpp>
26 #include <com/sun/star/task/XInteractionAbort.hpp>
27 #include <com/sun/star/task/XInteractionRetry.hpp>
28 #include <com/sun/star/task/XInteractionPassword.hpp>
29 #include <com/sun/star/task/XInteractionRequest.hpp>
31 #include <vector>
32 
33 
34 namespace comphelper
35 {
36 
37 
38  //= OInteraction
39 
43  template <class INTERACTION>
45  : public ::cppu::WeakImplHelper< INTERACTION >
46  {
47  public:
48  OInteraction() : m_bSelected(false) {}
49 
51  bool wasSelected() const { return m_bSelected; }
52 
53  // XInteractionContinuation
54  virtual void SAL_CALL select() override;
55  private:
56  bool m_bSelected : 1;
57  };
58 
59 
60  template <class INTERACTION>
62  {
63  m_bSelected = true;
64  }
65 
66 
67  //= OInteractionApprove
68 
70 
71 
72  //= OInteractionDisapprove
73 
75 
76 
77  //= OInteractionAbort
78 
80 
81 
82  //= OInteractionRetry
83 
85 
86 
87  //= OInteractionRequest
88 
89  typedef ::cppu::WeakImplHelper < css::task::XInteractionRequest
95  {
96  css::uno::Any const
98  std::vector< css::uno::Reference< css::task::XInteractionContinuation > >
100 
101  public:
102  OInteractionRequest(const css::uno::Any& _rRequestDescription);
103  OInteractionRequest(const css::uno::Any& rRequestDescription,
104  std::vector<css::uno::Reference<css::task::XInteractionContinuation>> const& rContinuations);
105 
107  void addContinuation(const css::uno::Reference< css::task::XInteractionContinuation >& _rxContinuation);
108 
109  // XInteractionRequest
110  virtual css::uno::Any SAL_CALL getRequest( ) override;
111  virtual css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > SAL_CALL getContinuations( ) override;
112  };
113 
114 } // namespace comphelper
115 
116 
117 #endif // INCLUDED_COMPHELPER_INTERACTION_HXX
118 
119 
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OInteraction< css::task::XInteractionRetry > OInteractionRetry
Definition: interaction.hxx:84
::cppu::WeakImplHelper< css::task::XInteractionRequest > OInteractionRequest_Base
Definition: interaction.hxx:90
OInteraction< css::task::XInteractionAbort > OInteractionAbort
Definition: interaction.hxx:79
OInteraction< css::task::XInteractionDisapprove > OInteractionDisapprove
Definition: interaction.hxx:74
virtual void SAL_CALL select() override
Definition: interaction.hxx:61
template for instantiating concrete interaction handlersthe template argument must be an interface de...
Definition: interaction.hxx:44
css::uno::Any const m_aRequest
Definition: interaction.hxx:97
implements an interaction request (com.sun.star.task::XInteractionRequest)at run time, you can freely add any interaction continuation objects
Definition: interaction.hxx:94
#define COMPHELPER_DLLPUBLIC
std::vector< css::uno::Reference< css::task::XInteractionContinuation > > m_aContinuations
the request we represent
Definition: interaction.hxx:99
void getContinuations(css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const &rContinuations, css::uno::Reference< t1 > *pContinuation1, css::uno::Reference< t2 > *pContinuation2)
bool wasSelected() const
determines whether or not this handler was selected
Definition: interaction.hxx:51
OInteraction< css::task::XInteractionApprove > OInteractionApprove
Definition: interaction.hxx:69