merge the formfield patch from ooo-build
[ooovba.git] / uui / source / iahndl.hxx
blob177273a0325a13bc8a148d803d92ebb1ce5ddf60
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: iahndl.hxx,v $
10 * $Revision: 1.21.22.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef UUI_IAHNDL_HXX
32 #define UUI_IAHNDL_HXX
34 #ifndef INCLUDED_VECTOR
35 #include <vector>
36 #define INCLUDED_VECTOR
37 #endif
38 #include "osl/mutex.hxx"
39 #include "com/sun/star/uno/Reference.hxx"
40 #include "com/sun/star/uno/Sequence.hxx"
42 #include "com/sun/star/beans/Optional.hpp"
43 #include "com/sun/star/embed/XStorage.hpp"
44 #include "com/sun/star/task/InteractionClassification.hpp"
45 #include "com/sun/star/task/PasswordRequestMode.hpp"
46 #include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp"
47 #include "com/sun/star/security/DocumentSignatureInformation.hpp"
48 #include "tools/solar.h"
49 #include "tools/errcode.hxx"
50 #include "vcl/wintypes.hxx"
51 #include "fltdlg.hxx"
52 #include <com/sun/star/security/XCertificate.hpp>
53 #ifndef _COM_SUN_STAR_XML_CRYPTO_XXSECURITYENVIRONMENT_HPP_
54 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
55 #endif
57 class Window;
58 class LoginErrorInfo;
59 struct CntHTTPCookieRequest;
61 #define DESCRIPTION_1 1
62 #define DESCRIPTION_2 2
63 #define TITLE 3
65 #define UUI_DOC_LOAD_LOCK 0
66 #define UUI_DOC_OWN_LOAD_LOCK 1
67 #define UUI_DOC_SAVE_LOCK 2
68 #define UUI_DOC_OWN_SAVE_LOCK 3
70 //============================================================================
71 /** Information about a InteractionHandler
73 struct InteractionHandlerData
75 /** The UNO service name to use to instanciate the content provider.
77 rtl::OUString ServiceName;
79 InteractionHandlerData() {};
80 InteractionHandlerData( const rtl::OUString & rService)
81 : ServiceName( rService ){}
84 typedef std::vector< InteractionHandlerData > InteractionHandlerDataList;
86 namespace cssu = com::sun::star::uno;
87 namespace dcss = ::com::sun::star;
89 namespace com { namespace sun { namespace star {
90 namespace document {
91 class AmbigousFilterRequest;
92 class FilterOptionsRequest;
93 class NoSuchFilterRequest;
95 namespace lang {
96 class XMultiServiceFactory;
98 namespace task {
99 class XInteractionContinuation;
100 class XInteractionHandler;
101 class XInteractionRequest;
102 class XPasswordContainer;
103 class XUrlContainer;
105 namespace ucb {
106 class AuthenticationRequest;
107 class HandleCookiesRequest;
108 class NameClashResolveRequest;
109 class CertificateValidationRequest;
111 namespace uno {
112 class RuntimeException;
114 } } }
116 class UUIInteractionHelper
118 private:
119 osl::Mutex m_aPropertyMutex;
120 com::sun::star::uno::Reference<
121 com::sun::star::lang::XMultiServiceFactory >
122 m_xServiceFactory;
123 com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties;
125 UUIInteractionHelper(UUIInteractionHelper &); // not implemented
126 void operator =(UUIInteractionHelper); // not implemented
128 public:
129 UUIInteractionHelper(com::sun::star::uno::Reference<
130 com::sun::star::lang::XMultiServiceFactory >
131 const & rServiceFactory,
132 com::sun::star::uno::Sequence<
133 com::sun::star::uno::Any > const & rArguments)
134 SAL_THROW(());
135 UUIInteractionHelper(com::sun::star::uno::Reference<
136 com::sun::star::lang::XMultiServiceFactory >
137 const & rServiceFactory)
138 SAL_THROW(());
140 ~UUIInteractionHelper() SAL_THROW(());
142 bool
143 handleRequest(com::sun::star::uno::Reference<
144 com::sun::star::task::XInteractionRequest > const &
145 rRequest)
146 throw (com::sun::star::uno::RuntimeException);
148 com::sun::star::beans::Optional< rtl::OUString >
149 getStringFromRequest(com::sun::star::uno::Reference<
150 com::sun::star::task::XInteractionRequest > const &
151 rRequest)
152 throw (com::sun::star::uno::RuntimeException);
154 private:
155 bool
156 handle_impl(com::sun::star::uno::Reference<
157 com::sun::star::task::XInteractionRequest > const &
158 rRequest)
159 throw (com::sun::star::uno::RuntimeException);
161 void
162 GetInteractionHandlerList(InteractionHandlerDataList &rdataList);
164 sal_Bool
165 isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName);
166 static long
167 handlerequest(void* pHandleData, void* pInteractionHandler);
169 com::sun::star::beans::Optional< rtl::OUString >
170 getStringFromRequest_impl(com::sun::star::uno::Reference<
171 com::sun::star::task::XInteractionRequest > const &
172 rRequest)
173 throw (com::sun::star::uno::RuntimeException);
175 static long
176 getstringfromrequest(void* pHandleData, void* pInteractionHandler);
178 Window * getParentProperty() SAL_THROW(());
180 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getParentXWindow() SAL_THROW(());
182 rtl::OUString getContextProperty() SAL_THROW(());
184 bool
185 initPasswordContainer(com::sun::star::uno::Reference<
186 com::sun::star::task::XPasswordContainer > *
187 pContainer,
188 com::sun::star::uno::Reference<
189 com::sun::star::task::XUrlContainer > *
190 pUrlContainer)
191 const SAL_THROW(());
193 com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >
194 getInteractionHandler() const
195 SAL_THROW((com::sun::star::uno::RuntimeException));
197 void executeLoginDialog(LoginErrorInfo & rInfo,
198 rtl::OUString const & rRealm)
199 SAL_THROW((com::sun::star::uno::RuntimeException));
201 void
202 executeMasterPasswordDialog(LoginErrorInfo & rInfo,
203 com::sun::star::task::PasswordRequestMode nMode)
204 SAL_THROW((com::sun::star::uno::RuntimeException));
206 void
207 executePasswordDialog(LoginErrorInfo & rInfo,
208 com::sun::star::task::PasswordRequestMode nMode,
209 ::rtl::OUString aDocumentName)
210 SAL_THROW((com::sun::star::uno::RuntimeException));
212 void
213 executeMSPasswordDialog(LoginErrorInfo & rInfo,
214 com::sun::star::task::PasswordRequestMode nMode,
215 ::rtl::OUString aDocumentName)
216 SAL_THROW((com::sun::star::uno::RuntimeException));
218 void executeCookieDialog(CntHTTPCookieRequest & rRequest)
219 SAL_THROW((com::sun::star::uno::RuntimeException));
221 void executeFilterDialog(rtl::OUString const & rURL ,
222 uui::FilterNameList const & rFilters,
223 rtl::OUString & rFilter )
224 SAL_THROW((com::sun::star::uno::RuntimeException));
226 sal_Bool executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert )
227 SAL_THROW((com::sun::star::uno::RuntimeException));
229 sal_Bool executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert,
230 sal_Int32 const & failures,
231 const rtl::OUString & hostName)
232 SAL_THROW((com::sun::star::uno::RuntimeException));
234 rtl::OUString
235 getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime );
237 USHORT
238 executeErrorDialog(com::sun::star::task::InteractionClassification
239 eClassification,
240 rtl::OUString const & rContext,
241 rtl::OUString const & rMessage,
242 WinBits nButtonMask )
243 SAL_THROW((com::sun::star::uno::RuntimeException));
245 USHORT
246 executeMessageBox( rtl::OUString const & rTitle,
247 rtl::OUString const & rMessage,
248 WinBits nButtonMask )
249 SAL_THROW((com::sun::star::uno::RuntimeException));
251 void
252 handleAuthenticationRequest(
253 com::sun::star::ucb::AuthenticationRequest const & rRequest,
254 com::sun::star::uno::Sequence<
255 com::sun::star::uno::Reference<
256 com::sun::star::task::XInteractionContinuation > > const &
257 rContinuations,
258 rtl::OUString const & rURL)
259 SAL_THROW((com::sun::star::uno::RuntimeException));
261 void
262 handleCertificateValidationRequest(
263 com::sun::star::ucb::CertificateValidationRequest const & rRequest,
264 com::sun::star::uno::Sequence<
265 com::sun::star::uno::Reference<
266 com::sun::star::task::XInteractionContinuation > > const &
267 rContinuations)
268 SAL_THROW((com::sun::star::uno::RuntimeException));
270 void
271 handleNameClashResolveRequest(
272 com::sun::star::ucb::NameClashResolveRequest const & rRequest,
273 com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
274 com::sun::star::task::XInteractionContinuation > > const &
275 rContinuations)
276 SAL_THROW((com::sun::star::uno::RuntimeException));
278 void
279 handleMasterPasswordRequest(
280 com::sun::star::task::PasswordRequestMode nMode,
281 com::sun::star::uno::Sequence<
282 com::sun::star::uno::Reference<
283 com::sun::star::task::XInteractionContinuation > > const &
284 rContinuations)
285 SAL_THROW((com::sun::star::uno::RuntimeException));
288 void
289 handlePasswordRequest(
290 com::sun::star::task::PasswordRequestMode nMode,
291 com::sun::star::uno::Sequence<
292 com::sun::star::uno::Reference<
293 com::sun::star::task::XInteractionContinuation > > const &
294 rContinuations,
295 ::rtl::OUString aDocumentName = ::rtl::OUString())
296 SAL_THROW((com::sun::star::uno::RuntimeException));
298 void
299 handleMSPasswordRequest(
300 com::sun::star::task::PasswordRequestMode nMode,
301 com::sun::star::uno::Sequence<
302 com::sun::star::uno::Reference<
303 com::sun::star::task::XInteractionContinuation > > const &
304 rContinuations,
305 ::rtl::OUString aDocumentName = ::rtl::OUString())
306 SAL_THROW((com::sun::star::uno::RuntimeException));
308 void
309 handleCookiesRequest(
310 com::sun::star::ucb::HandleCookiesRequest const & rRequest,
311 com::sun::star::uno::Sequence<
312 com::sun::star::uno::Reference<
313 com::sun::star::task::XInteractionContinuation > > const &
314 rContinuations)
315 SAL_THROW((com::sun::star::uno::RuntimeException));
317 void
318 handleNoSuchFilterRequest(
319 com::sun::star::document::NoSuchFilterRequest const & rRequest,
320 com::sun::star::uno::Sequence<
321 com::sun::star::uno::Reference<
322 com::sun::star::task::XInteractionContinuation > > const &
323 rContinuations)
324 SAL_THROW((com::sun::star::uno::RuntimeException));
326 void
327 handleAmbigousFilterRequest(
328 com::sun::star::document::AmbigousFilterRequest const & rRequest,
329 com::sun::star::uno::Sequence<
330 com::sun::star::uno::Reference<
331 com::sun::star::task::XInteractionContinuation > > const &
332 rContinuations)
333 SAL_THROW((com::sun::star::uno::RuntimeException));
335 void
336 handleFilterOptionsRequest(
337 com::sun::star::document::FilterOptionsRequest const & rRequest,
338 com::sun::star::uno::Sequence<
339 com::sun::star::uno::Reference<
340 com::sun::star::task::XInteractionContinuation > > const &
341 rContinuations)
342 SAL_THROW((com::sun::star::uno::RuntimeException));
344 void
345 handleErrorRequest(
346 com::sun::star::task::InteractionClassification eClassification,
347 ErrCode nErrorCode,
348 std::vector< rtl::OUString > const & rArguments,
349 com::sun::star::uno::Sequence<
350 com::sun::star::uno::Reference<
351 com::sun::star::task::XInteractionContinuation > > const &
352 rContinuations,
353 bool bObtainErrorStringOnly,
354 bool & bHasErrorString,
355 rtl::OUString & rErrorString)
356 SAL_THROW((com::sun::star::uno::RuntimeException));
358 void
359 handleGenericErrorRequest(
360 sal_Int32 nErrorCode,
361 com::sun::star::uno::Sequence<
362 com::sun::star::uno::Reference<
363 com::sun::star::task::XInteractionContinuation > > const &
364 rContinuations,
365 bool bObtainErrorStringOnly,
366 bool & bHasErrorString,
367 rtl::OUString & rErrorString)
368 SAL_THROW((com::sun::star::uno::RuntimeException));
370 void
371 handleMacroConfirmRequest(
372 const ::rtl::OUString& aDocumentURL,
373 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage,
374 const ::rtl::OUString& aDocumentVersion,
375 const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo,
376 com::sun::star::uno::Sequence<
377 com::sun::star::uno::Reference<
378 com::sun::star::task::XInteractionContinuation > > const &
379 rContinuations
381 SAL_THROW((com::sun::star::uno::RuntimeException));
383 void
384 handleFutureDocumentVersionUpdateRequest(
385 const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& _rRequest,
386 com::sun::star::uno::Sequence<
387 com::sun::star::uno::Reference<
388 com::sun::star::task::XInteractionContinuation > > const &
389 rContinuations
391 SAL_THROW((com::sun::star::uno::RuntimeException));
393 void
394 handleBrokenPackageRequest(
395 std::vector< rtl::OUString > const & rArguments,
396 ::com::sun::star::uno::Sequence<
397 ::com::sun::star::uno::Reference<
398 ::com::sun::star::task::XInteractionContinuation > > const &
399 rContinuations,
400 bool bObtainErrorStringOnly,
401 bool & bHasErrorString,
402 rtl::OUString & rErrorString)
403 SAL_THROW((::com::sun::star::uno::RuntimeException));
405 bool handleMessageboxRequests(
406 ::com::sun::star::uno::Reference<
407 ::com::sun::star::task::XInteractionRequest > const &
408 rRequest,
409 bool bObtainErrorStringOnly,
410 bool & bHasErrorString,
411 rtl::OUString & rErrorString);
413 bool handleDialogRequests(
414 ::com::sun::star::uno::Reference<
415 ::com::sun::star::task::XInteractionRequest > const &
416 rRequest);
418 bool handleErrorHandlerRequests(
419 ::com::sun::star::uno::Reference<
420 ::com::sun::star::task::XInteractionRequest > const &
421 rRequest,
422 bool bObtainErrorStringOnly,
423 bool & bHasErrorString,
424 rtl::OUString & rErrorString);
426 void handleLockedDocumentRequest(
427 const ::rtl::OUString& aDocumentURL,
428 const ::rtl::OUString& aInfo,
429 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
430 ::com::sun::star::task::XInteractionContinuation > > const &
431 rContinuations,
432 sal_uInt16 nMode )
433 SAL_THROW((::com::sun::star::uno::RuntimeException));
435 void handleChangedByOthersRequest(
436 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
437 ::com::sun::star::task::XInteractionContinuation > > const &
438 rContinuations )
439 SAL_THROW((::com::sun::star::uno::RuntimeException));
441 void handleLockFileIgnoreRequest(
442 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
443 ::com::sun::star::task::XInteractionContinuation > > const &
444 rContinuations )
445 SAL_THROW((::com::sun::star::uno::RuntimeException));
449 #endif // UUI_IAHNDL_HXX