bump product version to 6.3.0.0.beta1
[LibreOffice.git] / uui / source / iahndl.hxx
blob4feb98d3fa5d2d746f2fecf9563bad555727b078
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_UUI_SOURCE_IAHNDL_HXX
21 #define INCLUDED_UUI_SOURCE_IAHNDL_HXX
23 #include <rtl/ustring.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <com/sun/star/beans/Optional.hpp>
30 #include <com/sun/star/task/InteractionClassification.hpp>
32 #include <vcl/errcode.hxx>
33 #include <tools/wintypes.hxx>
35 #include <unordered_map>
36 #include <vector>
38 namespace com { namespace sun { namespace star {
39 namespace awt {
40 class XWindow;
42 namespace embed {
43 class XStorage;
45 namespace lang {
46 class XMultiServiceFactory;
48 namespace security {
49 struct DocumentSignatureInformation;
51 namespace task {
52 class XInteractionContinuation;
53 class XInteractionHandler2;
54 class XInteractionRequest;
56 namespace ucb {
57 class NameClashResolveRequest;
59 } } }
61 namespace vcl { class Window; }
63 struct InteractionHandlerData
65 /** The UNO service name to use to instantiate the content provider.
67 OUString ServiceName;
70 typedef std::vector< InteractionHandlerData > InteractionHandlerDataList;
72 typedef std::unordered_map< OUString, OUString > StringHashMap;
74 class UUIInteractionHelper
76 private:
77 css::uno::Reference< css::uno::XComponentContext > m_xContext;
78 css::uno::Reference< css::awt::XWindow > m_xWindowParam;
79 const OUString m_aContextParam;
80 StringHashMap m_aTypedCustomHandlers;
81 UUIInteractionHelper(UUIInteractionHelper const &) = delete;
82 UUIInteractionHelper& operator =(UUIInteractionHelper const &) = delete;
84 public:
85 UUIInteractionHelper(
86 css::uno::Reference< css::uno::XComponentContext > const & rxContext,
87 css::uno::Reference< css::awt::XWindow > const & rxWindow,
88 const OUString & rContextParam);
89 explicit UUIInteractionHelper(
90 css::uno::Reference< css::uno::XComponentContext > const & rxContext);
92 ~UUIInteractionHelper();
94 bool handleRequest( css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
96 css::beans::Optional< OUString >
97 getStringFromRequest(
98 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
100 // Helper.
101 static OUString
102 replaceMessageWithArguments(
103 const OUString& aMessage,
104 std::vector< OUString > const & rArguments );
106 const css::uno::Reference< css::uno::XComponentContext >&
107 getORB() const
108 { return m_xContext; }
109 private:
110 bool
111 handleRequest_impl(
112 css::uno::Reference< css::task::XInteractionRequest > const & rRequest,
113 bool bObtainErrorStringOnly,
114 bool & bHasErrorString,
115 OUString & rErrorString);
117 static void handlerequest(void* pHandleData, void* pInteractionHandler);
119 css::beans::Optional< OUString >
120 getStringFromRequest_impl(
121 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
123 static void getstringfromrequest(void* pHandleData, void* pInteractionHandler);
125 const css::uno::Reference< css::awt::XWindow>&
126 getParentXWindow() const;
128 css::uno::Reference< css::task::XInteractionHandler2 >
129 getInteractionHandler();
131 bool handleTypedHandlerImplementations(
132 css::uno::Reference< css::task::XInteractionRequest > const & rRequest
135 bool
136 tryOtherInteractionHandler(
137 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
139 void
140 getInteractionHandlerList(InteractionHandlerDataList &rdataList);
142 static bool
143 isInformationalErrorMessageRequest(
144 css::uno::Sequence<
145 css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations);
147 bool
148 handleInteractiveIOException(
149 css::uno::Reference< css::task::XInteractionRequest > const & rRequest,
150 bool bObtainErrorStringOnly,
151 bool & bHasErrorString,
152 OUString & rErrorString);
154 bool
155 handleAuthenticationRequest(
156 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
158 bool
159 handleCertificateValidationRequest(
160 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
162 void
163 handleNameClashResolveRequest(
164 css::ucb::NameClashResolveRequest const & rRequest,
165 css::uno::Sequence<
166 css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations);
168 bool
169 handleMasterPasswordRequest(
170 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
172 bool
173 handlePasswordRequest(
174 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
176 bool
177 handleNoSuchFilterRequest(
178 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
180 bool
181 handleFilterOptionsRequest(
182 css::uno::Reference<
183 css::task::XInteractionRequest > const & rRequest);
185 void
186 handleErrorHandlerRequest(
187 css::task::InteractionClassification eClassification,
188 ErrCode nErrorCode,
189 std::vector< OUString > const & rArguments,
190 css::uno::Sequence<
191 css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations,
192 bool bObtainErrorStringOnly,
193 bool & bHasErrorString,
194 OUString & rErrorString);
196 void
197 handleGenericErrorRequest(
198 ErrCode nErrorCode,
199 css::uno::Sequence<
200 css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations,
201 bool bObtainErrorStringOnly,
202 bool & bHasErrorString,
203 OUString & rErrorString);
205 void
206 handleMacroConfirmRequest(
207 const OUString& aDocumentURL,
208 const css::uno::Reference< css::embed::XStorage >& xZipStorage,
209 const OUString& aDocumentVersion,
210 const css::uno::Sequence< css::security::DocumentSignatureInformation >& aSignInfo,
211 css::uno::Sequence<
212 css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations);
214 void
215 handleBrokenPackageRequest(
216 std::vector< OUString > const & rArguments,
217 css::uno::Sequence<
218 css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations,
219 bool bObtainErrorStringOnly,
220 bool & bHasErrorString,
221 OUString & rErrorString);
223 bool handleLockedDocumentRequest(
224 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
226 bool handleChangedByOthersRequest(
227 css::uno::Reference<
228 css::task::XInteractionRequest > const & rRequest);
230 bool handleLockFileProblemRequest(
231 css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
233 bool handleCustomRequest(
234 const css::uno::Reference< css::task::XInteractionRequest >& i_rRequest,
235 const OUString& i_rServiceName
236 ) const;
238 void
239 handleAuthFallbackRequest(
240 const OUString & instructions,
241 const OUString & url,
242 css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations );
245 class ErrorResource
247 const std::pair<const char*, ErrCode>* m_pStringArray;
248 const std::locale& m_rResLocale;
249 public:
250 explicit ErrorResource(const std::pair<const char*, ErrCode>* pStringArray, const std::locale& rResLocale)
251 : m_pStringArray(pStringArray)
252 , m_rResLocale(rResLocale)
255 bool getString(ErrCode nErrorCode, OUString &rString) const;
258 #endif // INCLUDED_UUI_SOURCE_IAHNDL_HXX
260 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */