update dev300-m58
[ooovba.git] / uui / source / iahndl.hxx
blob9475e7227d38ae4c0343feee5d36e0dfdf3ce239
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/beans/Optional.hpp"
40 #include "com/sun/star/uno/Reference.hxx"
41 #include "com/sun/star/uno/Sequence.hxx"
42 #include "com/sun/star/task/InteractionClassification.hpp"
43 #include "com/sun/star/task/PasswordRequestMode.hpp"
44 #include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
45 #include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp"
46 #include "tools/solar.h"
47 #include "tools/errcode.hxx"
48 #include "vcl/wintypes.hxx"
49 #include "fltdlg.hxx"
50 #include <com/sun/star/security/XCertificate.hpp>
51 #ifndef _COM_SUN_STAR_XML_CRYPTO_XXSECURITYENVIRONMENT_HPP_
52 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
53 #endif
55 class Window;
56 class LoginErrorInfo;
57 struct CntHTTPCookieRequest;
59 #define DESCRIPTION_1 1
60 #define DESCRIPTION_2 2
61 #define TITLE 3
63 #define UUI_DOC_LOAD_LOCK 0
64 #define UUI_DOC_OWN_LOAD_LOCK 1
65 #define UUI_DOC_SAVE_LOCK 2
66 #define UUI_DOC_OWN_SAVE_LOCK 3
68 //============================================================================
69 /** Information about a InteractionHandler
71 struct InteractionHandlerData
73 /** The UNO service name to use to instanciate the content provider.
75 rtl::OUString ServiceName;
77 InteractionHandlerData() {};
78 InteractionHandlerData( const rtl::OUString & rService)
79 : ServiceName( rService ){}
82 typedef std::vector< InteractionHandlerData > InteractionHandlerDataList;
84 namespace cssu = com::sun::star::uno;
85 namespace dcss = ::com::sun::star;
87 namespace com { namespace sun { namespace star {
88 namespace document {
89 class AmbigousFilterRequest;
90 class FilterOptionsRequest;
91 class NoSuchFilterRequest;
93 namespace lang {
94 class XMultiServiceFactory;
96 namespace task {
97 class XInteractionContinuation;
98 class XInteractionHandler;
99 class XInteractionRequest;
100 class XPasswordContainer;
102 namespace ucb {
103 class AuthenticationRequest;
104 class HandleCookiesRequest;
105 class NameClashResolveRequest;
106 class CertificateValidationRequest;
108 namespace uno {
109 class RuntimeException;
111 } } }
113 class UUIInteractionHelper
115 private:
116 osl::Mutex m_aPropertyMutex;
117 com::sun::star::uno::Reference<
118 com::sun::star::lang::XMultiServiceFactory >
119 m_xServiceFactory;
120 com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties;
122 UUIInteractionHelper(UUIInteractionHelper &); // not implemented
123 void operator =(UUIInteractionHelper); // not implemented
125 public:
126 UUIInteractionHelper(com::sun::star::uno::Reference<
127 com::sun::star::lang::XMultiServiceFactory >
128 const & rServiceFactory,
129 com::sun::star::uno::Sequence<
130 com::sun::star::uno::Any > const & rArguments)
131 SAL_THROW(());
132 UUIInteractionHelper(com::sun::star::uno::Reference<
133 com::sun::star::lang::XMultiServiceFactory >
134 const & rServiceFactory)
135 SAL_THROW(());
137 ~UUIInteractionHelper() SAL_THROW(());
139 void
140 handleRequest(com::sun::star::uno::Reference<
141 com::sun::star::task::XInteractionRequest > const &
142 rRequest)
143 throw (com::sun::star::uno::RuntimeException);
145 com::sun::star::beans::Optional< rtl::OUString >
146 getStringFromRequest(com::sun::star::uno::Reference<
147 com::sun::star::task::XInteractionRequest > const &
148 rRequest)
149 throw (com::sun::star::uno::RuntimeException);
151 private:
152 void
153 handle_impl(com::sun::star::uno::Reference<
154 com::sun::star::task::XInteractionRequest > const &
155 rRequest)
156 throw (com::sun::star::uno::RuntimeException);
158 void
159 GetInteractionHandlerList(InteractionHandlerDataList &rdataList);
161 sal_Bool
162 isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName);
163 static long
164 handlerequest(void* pHandleData, void* pInteractionHandler);
166 com::sun::star::beans::Optional< rtl::OUString >
167 getStringFromRequest_impl(com::sun::star::uno::Reference<
168 com::sun::star::task::XInteractionRequest > const &
169 rRequest)
170 throw (com::sun::star::uno::RuntimeException);
172 static long
173 getstringfromrequest(void* pHandleData, void* pInteractionHandler);
175 Window * getParentProperty() SAL_THROW(());
177 rtl::OUString getContextProperty() SAL_THROW(());
179 bool
180 initPasswordContainer(com::sun::star::uno::Reference<
181 com::sun::star::task::XPasswordContainer > *
182 pContainer)
183 const SAL_THROW(());
185 com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >
186 getInteractionHandler() const
187 SAL_THROW((com::sun::star::uno::RuntimeException));
189 void executeLoginDialog(LoginErrorInfo & rInfo,
190 rtl::OUString const & rRealm)
191 SAL_THROW((com::sun::star::uno::RuntimeException));
193 void
194 executeMasterPasswordDialog(LoginErrorInfo & rInfo,
195 com::sun::star::task::PasswordRequestMode nMode)
196 SAL_THROW((com::sun::star::uno::RuntimeException));
198 void
199 executePasswordDialog(LoginErrorInfo & rInfo,
200 com::sun::star::task::PasswordRequestMode nMode,
201 ::rtl::OUString aDocumentName)
202 SAL_THROW((com::sun::star::uno::RuntimeException));
204 void
205 executeMSPasswordDialog(LoginErrorInfo & rInfo,
206 com::sun::star::task::PasswordRequestMode nMode,
207 ::rtl::OUString aDocumentName)
208 SAL_THROW((com::sun::star::uno::RuntimeException));
210 void executeCookieDialog(CntHTTPCookieRequest & rRequest)
211 SAL_THROW((com::sun::star::uno::RuntimeException));
213 void executeFilterDialog(rtl::OUString const & rURL ,
214 uui::FilterNameList const & rFilters,
215 rtl::OUString & rFilter )
216 SAL_THROW((com::sun::star::uno::RuntimeException));
218 sal_Bool executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert )
219 SAL_THROW((com::sun::star::uno::RuntimeException));
221 sal_Bool executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert,
222 sal_Int32 const & failures,
223 const rtl::OUString & hostName)
224 SAL_THROW((com::sun::star::uno::RuntimeException));
226 rtl::OUString
227 getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime );
229 USHORT
230 executeErrorDialog(com::sun::star::task::InteractionClassification
231 eClassification,
232 rtl::OUString const & rContext,
233 rtl::OUString const & rMessage,
234 WinBits nButtonMask )
235 SAL_THROW((com::sun::star::uno::RuntimeException));
237 USHORT
238 executeMessageBox( rtl::OUString const & rTitle,
239 rtl::OUString const & rMessage,
240 WinBits nButtonMask )
241 SAL_THROW((com::sun::star::uno::RuntimeException));
243 void
244 handleAuthenticationRequest(
245 com::sun::star::ucb::AuthenticationRequest const & rRequest,
246 com::sun::star::uno::Sequence<
247 com::sun::star::uno::Reference<
248 com::sun::star::task::XInteractionContinuation > > const &
249 rContinuations)
250 SAL_THROW((com::sun::star::uno::RuntimeException));
252 void
253 handleCertificateValidationRequest(
254 com::sun::star::ucb::CertificateValidationRequest const & rRequest,
255 com::sun::star::uno::Sequence<
256 com::sun::star::uno::Reference<
257 com::sun::star::task::XInteractionContinuation > > const &
258 rContinuations)
259 SAL_THROW((com::sun::star::uno::RuntimeException));
261 void
262 handleNameClashResolveRequest(
263 com::sun::star::ucb::NameClashResolveRequest const & rRequest,
264 com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
265 com::sun::star::task::XInteractionContinuation > > const &
266 rContinuations)
267 SAL_THROW((com::sun::star::uno::RuntimeException));
269 void
270 handleMasterPasswordRequest(
271 com::sun::star::task::PasswordRequestMode nMode,
272 com::sun::star::uno::Sequence<
273 com::sun::star::uno::Reference<
274 com::sun::star::task::XInteractionContinuation > > const &
275 rContinuations)
276 SAL_THROW((com::sun::star::uno::RuntimeException));
279 void
280 handlePasswordRequest(
281 com::sun::star::task::PasswordRequestMode nMode,
282 com::sun::star::uno::Sequence<
283 com::sun::star::uno::Reference<
284 com::sun::star::task::XInteractionContinuation > > const &
285 rContinuations,
286 ::rtl::OUString aDocumentName = ::rtl::OUString())
287 SAL_THROW((com::sun::star::uno::RuntimeException));
289 void
290 handleMSPasswordRequest(
291 com::sun::star::task::PasswordRequestMode nMode,
292 com::sun::star::uno::Sequence<
293 com::sun::star::uno::Reference<
294 com::sun::star::task::XInteractionContinuation > > const &
295 rContinuations,
296 ::rtl::OUString aDocumentName = ::rtl::OUString())
297 SAL_THROW((com::sun::star::uno::RuntimeException));
299 void
300 handleCookiesRequest(
301 com::sun::star::ucb::HandleCookiesRequest const & rRequest,
302 com::sun::star::uno::Sequence<
303 com::sun::star::uno::Reference<
304 com::sun::star::task::XInteractionContinuation > > const &
305 rContinuations)
306 SAL_THROW((com::sun::star::uno::RuntimeException));
308 void
309 handleNoSuchFilterRequest(
310 com::sun::star::document::NoSuchFilterRequest 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 handleAmbigousFilterRequest(
319 com::sun::star::document::AmbigousFilterRequest 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 handleFilterOptionsRequest(
328 com::sun::star::document::FilterOptionsRequest 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 handleErrorRequest(
337 com::sun::star::task::InteractionClassification eClassification,
338 ErrCode nErrorCode,
339 std::vector< rtl::OUString > const & rArguments,
340 com::sun::star::uno::Sequence<
341 com::sun::star::uno::Reference<
342 com::sun::star::task::XInteractionContinuation > > const &
343 rContinuations,
344 bool bObtainErrorStringOnly,
345 bool & bHasErrorString,
346 rtl::OUString & rErrorString)
347 SAL_THROW((com::sun::star::uno::RuntimeException));
349 void
350 handleGenericErrorRequest(
351 sal_Int32 nErrorCode,
352 com::sun::star::uno::Sequence<
353 com::sun::star::uno::Reference<
354 com::sun::star::task::XInteractionContinuation > > const &
355 rContinuations,
356 bool bObtainErrorStringOnly,
357 bool & bHasErrorString,
358 rtl::OUString & rErrorString)
359 SAL_THROW((com::sun::star::uno::RuntimeException));
361 void
362 handleMacroConfirmRequest(
363 const ::com::sun::star::task::DocumentMacroConfirmationRequest& _rRequest,
364 com::sun::star::uno::Sequence<
365 com::sun::star::uno::Reference<
366 com::sun::star::task::XInteractionContinuation > > const &
367 rContinuations
369 SAL_THROW((com::sun::star::uno::RuntimeException));
371 void
372 handleFutureDocumentVersionUpdateRequest(
373 const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& _rRequest,
374 com::sun::star::uno::Sequence<
375 com::sun::star::uno::Reference<
376 com::sun::star::task::XInteractionContinuation > > const &
377 rContinuations
379 SAL_THROW((com::sun::star::uno::RuntimeException));
381 void
382 handleBrokenPackageRequest(
383 std::vector< rtl::OUString > const & rArguments,
384 ::com::sun::star::uno::Sequence<
385 ::com::sun::star::uno::Reference<
386 ::com::sun::star::task::XInteractionContinuation > > const &
387 rContinuations,
388 bool bObtainErrorStringOnly,
389 bool & bHasErrorString,
390 rtl::OUString & rErrorString)
391 SAL_THROW((::com::sun::star::uno::RuntimeException));
393 bool handleMessageboxRequests(
394 ::com::sun::star::uno::Reference<
395 ::com::sun::star::task::XInteractionRequest > const &
396 rRequest,
397 bool bObtainErrorStringOnly,
398 bool & bHasErrorString,
399 rtl::OUString & rErrorString);
401 bool handleDialogRequests(
402 ::com::sun::star::uno::Reference<
403 ::com::sun::star::task::XInteractionRequest > const &
404 rRequest);
406 bool handleErrorHandlerRequests(
407 ::com::sun::star::uno::Reference<
408 ::com::sun::star::task::XInteractionRequest > const &
409 rRequest,
410 bool bObtainErrorStringOnly,
411 bool & bHasErrorString,
412 rtl::OUString & rErrorString);
414 void handleLockedDocumentRequest(
415 const ::rtl::OUString& aDocumentURL,
416 const ::rtl::OUString& aInfo,
417 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
418 ::com::sun::star::task::XInteractionContinuation > > const &
419 rContinuations,
420 sal_uInt16 nMode )
421 SAL_THROW((::com::sun::star::uno::RuntimeException));
423 void handleChangedByOthersRequest(
424 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
425 ::com::sun::star::task::XInteractionContinuation > > const &
426 rContinuations )
427 SAL_THROW((::com::sun::star::uno::RuntimeException));
429 void handleLockFileIgnoreRequest(
430 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
431 ::com::sun::star::task::XInteractionContinuation > > const &
432 rContinuations )
433 SAL_THROW((::com::sun::star::uno::RuntimeException));
437 #endif // UUI_IAHNDL_HXX