/src/libreoffice/include/comphelper/interaction.hxx
Line | Count | Source |
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/XInteractionRequest.hpp> |
29 | | #include <comphelper/comphelperdllapi.h> |
30 | | #include <vector> |
31 | | |
32 | | |
33 | | namespace comphelper |
34 | | { |
35 | | |
36 | | |
37 | | //= OInteraction |
38 | | |
39 | | /** template for instantiating concrete interaction handlers<p/> |
40 | | the template argument must be an interface derived from XInteractionContinuation |
41 | | */ |
42 | | template <class INTERACTION> |
43 | | class OInteraction |
44 | | : public ::cppu::WeakImplHelper< INTERACTION > |
45 | | { |
46 | | public: |
47 | 0 | OInteraction() : m_bSelected(false) {}Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionApprove>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionDisapprove>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::document::XInteractionFilterOptions>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionAbort>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionRetry>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::sdb::XInteractionSupplyParameters>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::ucb::XInteractionSupplyAuthentication>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::sdb::XInteractionDocumentSave>::OInteraction() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::document::XInteractionFilterSelect>::OInteraction() |
48 | | |
49 | | /// determines whether or not this handler was selected |
50 | 0 | bool wasSelected() const { return m_bSelected; }Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionApprove>::wasSelected() const Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionAbort>::wasSelected() const Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionRetry>::wasSelected() const Unexecuted instantiation: comphelper::OInteraction<com::sun::star::sdb::XInteractionSupplyParameters>::wasSelected() const Unexecuted instantiation: comphelper::OInteraction<com::sun::star::ucb::XInteractionSupplyAuthentication>::wasSelected() const Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionDisapprove>::wasSelected() const Unexecuted instantiation: comphelper::OInteraction<com::sun::star::sdb::XInteractionDocumentSave>::wasSelected() const |
51 | | |
52 | | // XInteractionContinuation |
53 | | virtual void SAL_CALL select() override; |
54 | | private: |
55 | | bool m_bSelected : 1; /// indicates if the select event occurred |
56 | | }; |
57 | | |
58 | | |
59 | | template <class INTERACTION> |
60 | | void SAL_CALL OInteraction< INTERACTION >::select( ) |
61 | 0 | { |
62 | 0 | m_bSelected = true; |
63 | 0 | } Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionApprove>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionDisapprove>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionAbort>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::document::XInteractionFilterOptions>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::task::XInteractionRetry>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::sdb::XInteractionSupplyParameters>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::ucb::XInteractionSupplyAuthentication>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::sdb::XInteractionDocumentSave>::select() Unexecuted instantiation: comphelper::OInteraction<com::sun::star::document::XInteractionFilterSelect>::select() |
64 | | |
65 | | |
66 | | //= OInteractionApprove |
67 | | |
68 | | typedef OInteraction< css::task::XInteractionApprove > OInteractionApprove; |
69 | | |
70 | | |
71 | | //= OInteractionDisapprove |
72 | | |
73 | | typedef OInteraction< css::task::XInteractionDisapprove > OInteractionDisapprove; |
74 | | |
75 | | |
76 | | //= OInteractionAbort |
77 | | |
78 | | typedef OInteraction< css::task::XInteractionAbort > OInteractionAbort; |
79 | | |
80 | | |
81 | | //= OInteractionRetry |
82 | | |
83 | | typedef OInteraction< css::task::XInteractionRetry > OInteractionRetry; |
84 | | |
85 | | |
86 | | //= OInteractionRequest |
87 | | |
88 | | typedef ::cppu::WeakImplHelper < css::task::XInteractionRequest |
89 | | > OInteractionRequest_Base; |
90 | | /** implements an interaction request (com.sun.star.task::XInteractionRequest)<p/> |
91 | | at run time, you can freely add any interaction continuation objects |
92 | | */ |
93 | | class COMPHELPER_DLLPUBLIC OInteractionRequest final : public OInteractionRequest_Base |
94 | | { |
95 | | css::uno::Any const |
96 | | m_aRequest; /// the request we represent |
97 | | std::vector< css::uno::Reference< css::task::XInteractionContinuation > > |
98 | | m_aContinuations; /// all registered continuations |
99 | | |
100 | | public: |
101 | | OInteractionRequest(css::uno::Any aRequestDescription); |
102 | | OInteractionRequest(css::uno::Any aRequestDescription, |
103 | | std::vector<css::uno::Reference<css::task::XInteractionContinuation>>&& rContinuations); |
104 | | |
105 | | /// add a new continuation |
106 | | void addContinuation(const css::uno::Reference< css::task::XInteractionContinuation >& _rxContinuation); |
107 | | |
108 | | // XInteractionRequest |
109 | | virtual css::uno::Any SAL_CALL getRequest( ) override; |
110 | | virtual css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > SAL_CALL getContinuations( ) override; |
111 | | }; |
112 | | |
113 | | } // namespace comphelper |
114 | | |
115 | | |
116 | | #endif // INCLUDED_COMPHELPER_INTERACTION_HXX |
117 | | |
118 | | |
119 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |