Branch libreoffice-5-0-4
[LibreOffice.git] / include / ucbhelper / interactionrequest.hxx
blobca86acfb6525ff7b9342fbc96848feb1232d272d
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_UCBHELPER_INTERACTIONREQUEST_HXX
21 #define INCLUDED_UCBHELPER_INTERACTIONREQUEST_HXX
23 #include <com/sun/star/lang/XTypeProvider.hpp>
24 #include <com/sun/star/task/XInteractionRequest.hpp>
25 #include <com/sun/star/task/XInteractionAbort.hpp>
26 #include <com/sun/star/task/XInteractionRetry.hpp>
27 #include <com/sun/star/task/XInteractionApprove.hpp>
28 #include <com/sun/star/task/XInteractionDisapprove.hpp>
29 #include <com/sun/star/ucb/XInteractionAuthFallback.hpp>
30 #include <com/sun/star/ucb/XInteractionReplaceExistingData.hpp>
31 #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
32 #include <rtl/ref.hxx>
33 #include <cppuhelper/weak.hxx>
34 #include <ucbhelper/ucbhelperdllapi.h>
36 namespace ucbhelper {
38 class InteractionContinuation;
41 struct InteractionRequest_Impl;
43 /**
44 * This class implements the interface XInteractionRequest. Instances can
45 * be passed directly to XInteractionHandler::handle(...). Each interaction
46 * request contains an exception describing the error and a number of
47 * interaction continuations describing the possible "answers" for the request.
48 * After the request was passed to XInteractionHandler::handle(...) the method
49 * getSelection() returns the continuation chosen by the interaction handler.
51 * The typical usage of this class would be:
53 * 1) Create exception object that shall be handled by the interaction handler.
54 * 2) Create InteractionRequest, supply exception as ctor parameter
55 * 3) Create continuations needed and add them to a sequence
56 * 4) Supply the continuations to the InteractionRequest by calling
57 * setContinuations(...)
59 * This class can also be used as base class for more specialized requests,
60 * like authentication requests.
62 class UCBHELPER_DLLPUBLIC InteractionRequest : public cppu::OWeakObject,
63 public com::sun::star::lang::XTypeProvider,
64 public com::sun::star::task::XInteractionRequest
66 InteractionRequest_Impl * m_pImpl;
68 protected:
69 void setRequest( const com::sun::star::uno::Any & rRequest );
71 InteractionRequest();
72 virtual ~InteractionRequest();
74 public:
75 /**
76 * Constructor.
78 * @param rRequest is the exception describing the error.
80 InteractionRequest( const com::sun::star::uno::Any & rRequest );
82 /**
83 * This method sets the continuations for the request.
85 * @param rContinuations contains the possible continuations.
87 void setContinuations(
88 const com::sun::star::uno::Sequence<
89 com::sun::star::uno::Reference<
90 com::sun::star::task::XInteractionContinuation > > &
91 rContinuations );
93 // XInterface
94 virtual com::sun::star::uno::Any SAL_CALL
95 queryInterface( const com::sun::star::uno::Type & rType )
96 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
97 virtual void SAL_CALL acquire()
98 throw() SAL_OVERRIDE;
99 virtual void SAL_CALL release()
100 throw() SAL_OVERRIDE;
102 // XTypeProvider
103 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
104 getTypes()
105 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
106 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
107 getImplementationId()
108 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
110 // XInteractionRequest
111 virtual com::sun::star::uno::Any SAL_CALL
112 getRequest()
113 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
114 virtual com::sun::star::uno::Sequence<
115 com::sun::star::uno::Reference<
116 com::sun::star::task::XInteractionContinuation > > SAL_CALL
117 getContinuations()
118 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
120 // Non-interface methods.
123 * After passing this request to XInteractionHandler::handle, this method
124 * returns the continuation that was chosen by the interaction handler.
126 * @return the continuation chosen by an interaction handler or an empty
127 * reference, if the request was not (yet) handled.
129 rtl::Reference< InteractionContinuation > getSelection() const;
132 * This method sets a continuation for the request. It also can be used
133 * to reset the continuation set by a previous XInteractionHandler::handle
134 * call in order to use this request object more than once.
136 * @param rxSelection is the interaction continuation to activate for
137 * the request or an empty reference in order to reset the
138 * current selection.
140 void
141 setSelection(
142 const rtl::Reference< InteractionContinuation > & rxSelection );
146 struct InteractionContinuation_Impl;
149 * This class is the base for implementations of the interface
150 * XInteractionContinuation. Classes derived from this bas class work together
151 * with class InteractionRequest.
153 * Derived classes must implement their XInteractionContinuation::select()
154 * method the way that they simply call recordSelection() which is provided by
155 * this class.
157 class UCBHELPER_DLLPUBLIC InteractionContinuation : public cppu::OWeakObject
159 InteractionContinuation_Impl * m_pImpl;
161 protected:
163 * This method marks this continuation as "selected" at the request it
164 * belongs to.
166 * Derived classes must implement their XInteractionContinuation::select()
167 * method the way that they call this method.
169 void recordSelection();
170 virtual ~InteractionContinuation();
172 public:
173 InteractionContinuation( InteractionRequest * pRequest );
178 * This class implements a standard interaction continuation, namely the
179 * interface XInteractionAbort. Instances of this class can be passed
180 * along with an interaction request to indicate the possibility to abort
181 * the operation that caused the request.
183 class UCBHELPER_DLLPUBLIC InteractionAbort : public InteractionContinuation,
184 public com::sun::star::lang::XTypeProvider,
185 public com::sun::star::task::XInteractionAbort
187 public:
188 InteractionAbort( InteractionRequest * pRequest )
189 : InteractionContinuation( pRequest ) {}
191 // XInterface
192 virtual com::sun::star::uno::Any SAL_CALL
193 queryInterface( const com::sun::star::uno::Type & rType )
194 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
195 virtual void SAL_CALL acquire()
196 throw() SAL_OVERRIDE;
197 virtual void SAL_CALL release()
198 throw() SAL_OVERRIDE;
200 // XTypeProvider
201 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
202 getTypes()
203 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
204 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
205 getImplementationId()
206 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
208 // XInteractionContinuation
209 virtual void SAL_CALL select()
210 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
215 * This class implements a standard interaction continuation, namely the
216 * interface XInteractionRetry. Instances of this class can be passed
217 * along with an interaction request to indicate the possibility to retry
218 * the operation that caused the request.
220 class UCBHELPER_DLLPUBLIC InteractionRetry : public InteractionContinuation,
221 public com::sun::star::lang::XTypeProvider,
222 public com::sun::star::task::XInteractionRetry
224 public:
225 InteractionRetry( InteractionRequest * pRequest )
226 : InteractionContinuation( pRequest ) {}
228 // XInterface
229 virtual com::sun::star::uno::Any SAL_CALL
230 queryInterface( const com::sun::star::uno::Type & rType )
231 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
232 virtual void SAL_CALL acquire()
233 throw() SAL_OVERRIDE;
234 virtual void SAL_CALL release()
235 throw() SAL_OVERRIDE;
237 // XTypeProvider
238 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
239 getTypes()
240 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
241 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
242 getImplementationId()
243 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
245 // XInteractionContinuation
246 virtual void SAL_CALL select()
247 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
252 * This class implements a standard interaction continuation, namely the
253 * interface XInteractionApprove. Instances of this class can be passed
254 * along with an interaction request to indicate the possibility to approve
255 * the request.
257 class UCBHELPER_DLLPUBLIC InteractionApprove : public InteractionContinuation,
258 public com::sun::star::lang::XTypeProvider,
259 public com::sun::star::task::XInteractionApprove
261 public:
262 InteractionApprove( InteractionRequest * pRequest )
263 : InteractionContinuation( pRequest ) {}
265 // XInterface
266 virtual com::sun::star::uno::Any SAL_CALL
267 queryInterface( const com::sun::star::uno::Type & rType )
268 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
269 virtual void SAL_CALL acquire()
270 throw() SAL_OVERRIDE;
271 virtual void SAL_CALL release()
272 throw() SAL_OVERRIDE;
274 // XTypeProvider
275 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
276 getTypes()
277 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
278 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
279 getImplementationId()
280 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
282 // XInteractionContinuation
283 virtual void SAL_CALL select()
284 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
289 * This class implements a standard interaction continuation, namely the
290 * interface XInteractionDisapprove. Instances of this class can be passed
291 * along with an interaction request to indicate the possibility to disapprove
292 * the request.
294 class UCBHELPER_DLLPUBLIC InteractionDisapprove : public InteractionContinuation,
295 public com::sun::star::lang::XTypeProvider,
296 public com::sun::star::task::XInteractionDisapprove
298 public:
299 InteractionDisapprove( InteractionRequest * pRequest )
300 : InteractionContinuation( pRequest ) {}
302 // XInterface
303 virtual com::sun::star::uno::Any SAL_CALL
304 queryInterface( const com::sun::star::uno::Type & rType )
305 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
306 virtual void SAL_CALL acquire()
307 throw() SAL_OVERRIDE;
308 virtual void SAL_CALL release()
309 throw() SAL_OVERRIDE;
311 // XTypeProvider
312 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
313 getTypes()
314 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
315 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
316 getImplementationId()
317 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
319 // XInteractionContinuation
320 virtual void SAL_CALL select()
321 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
326 * This class implements a standard interaction continuation, namely the
327 * interface XInteractionSupplyAuthentication. Instances of this class can be
328 * passed along with an authentication interaction request to enable the
329 * interaction handler to supply the missing authentication data.
331 class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
332 public InteractionContinuation,
333 public com::sun::star::lang::XTypeProvider,
334 public com::sun::star::ucb::XInteractionSupplyAuthentication2
336 com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
337 m_aRememberPasswordModes;
338 com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
339 m_aRememberAccountModes;
340 OUString m_aRealm;
341 OUString m_aUserName;
342 OUString m_aPassword;
343 OUString m_aAccount;
344 com::sun::star::ucb::RememberAuthentication m_eRememberPasswordMode;
345 com::sun::star::ucb::RememberAuthentication m_eDefaultRememberPasswordMode;
346 com::sun::star::ucb::RememberAuthentication m_eRememberAccountMode;
347 com::sun::star::ucb::RememberAuthentication m_eDefaultRememberAccountMode;
348 bool m_bCanSetRealm : 1;
349 bool m_bCanSetUserName : 1;
350 bool m_bCanSetPassword : 1;
351 bool m_bCanSetAccount : 1;
352 bool m_bCanUseSystemCredentials : 1;
353 bool m_bDefaultUseSystemCredentials : 1;
354 bool m_bUseSystemCredentials : 1;
356 public:
358 * Constructor.
360 * @param rxRequest is the interaction request that owns this continuation.
361 * @param bCanSetRealm indicates, whether the realm given with the
362 * authentication request is read-only.
363 * @param bCanSetUserName indicates, whether the username given with the
364 * authentication request is read-only.
365 * @param bCanSetPassword indicates, whether the password given with the
366 * authentication request is read-only.
367 * @param bCanSetAccount indicates, whether the account given with the
368 * authentication request is read-only.
370 * @see com::sun::star::ucb::AuthenticationRequest
372 inline InteractionSupplyAuthentication(
373 InteractionRequest * pRequest,
374 bool bCanSetRealm,
375 bool bCanSetUserName,
376 bool bCanSetPassword,
377 bool bCanSetAccount);
379 * Constructor.
381 * Note: The remember-authentication stuff is interesting only for
382 * clients implementing own password storage functionality.
384 * @param rxRequest is the interaction request that owns this continuation.
385 * @param bCanSetRealm indicates, whether the realm given with the
386 * authentication request is read-only.
387 * @param bCanSetUserName indicates, whether the username given with the
388 * authentication request is read-only.
389 * @param bCanSetPassword indicates, whether the password given with the
390 * authentication request is read-only.
391 * @param bCanSetAccount indicates, whether the account given with the
392 * authentication request is read-only.
393 * @param rRememberPasswordModes specifies the authentication-remember-
394 * modes for passwords supported by the requesting client.
395 * @param eDefaultRememberPasswordMode specifies the default
396 * authentication-remember-mode for passwords preferred by the
397 * requesting client.
398 * @param rRememberAccountModes specifies the authentication-remember-
399 * modes for accounts supported by the requesting client.
400 * @param eDefaultRememberAccountMode specifies the default
401 * authentication-remember-mode for accounts preferred by the
402 * requesting client.
403 * @param bCanUseSystemCredentials indicates whether issuer of the
404 * authetication request can obtain and use system credentials
405 * for authentication.
406 * @param bDefaultUseSystemCredentials specifies the default system
407 * credentials usage preferred by the requesting client
409 * @see com::sun::star::ucb::AuthenticationRequest
410 * @see com::sun::star::ucb::RememberAuthentication
412 inline InteractionSupplyAuthentication(
413 InteractionRequest * pRequest,
414 bool bCanSetRealm,
415 bool bCanSetUserName,
416 bool bCanSetPassword,
417 bool bCanSetAccount,
418 const com::sun::star::uno::Sequence<
419 com::sun::star::ucb::RememberAuthentication > &
420 rRememberPasswordModes,
421 const com::sun::star::ucb::RememberAuthentication
422 eDefaultRememberPasswordMode,
423 const com::sun::star::uno::Sequence<
424 com::sun::star::ucb::RememberAuthentication > &
425 rRememberAccountModes,
426 const com::sun::star::ucb::RememberAuthentication
427 eDefaultRememberAccountMode,
428 bool bCanUseSystemCredentials,
429 bool bDefaultUseSystemCredentials );
431 // XInterface
432 virtual com::sun::star::uno::Any SAL_CALL
433 queryInterface( const com::sun::star::uno::Type & rType )
434 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
435 virtual void SAL_CALL acquire()
436 throw() SAL_OVERRIDE;
437 virtual void SAL_CALL release()
438 throw() SAL_OVERRIDE;
440 // XTypeProvider
441 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
442 getTypes()
443 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
444 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
445 getImplementationId()
446 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
448 // XInteractionContinuation
449 virtual void SAL_CALL select()
450 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
452 // XInteractionSupplyAuthentication
453 virtual sal_Bool SAL_CALL
454 canSetRealm()
455 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
456 virtual void SAL_CALL
457 setRealm( const OUString& Realm )
458 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
460 virtual sal_Bool SAL_CALL
461 canSetUserName()
462 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
463 virtual void SAL_CALL
464 setUserName( const OUString& UserName )
465 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
467 virtual sal_Bool SAL_CALL
468 canSetPassword()
469 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
470 virtual void SAL_CALL
471 setPassword( const OUString& Password )
472 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
474 virtual com::sun::star::uno::Sequence<
475 com::sun::star::ucb::RememberAuthentication > SAL_CALL
476 getRememberPasswordModes(
477 com::sun::star::ucb::RememberAuthentication& Default )
478 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
479 virtual void SAL_CALL
480 setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember )
481 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
483 virtual sal_Bool SAL_CALL
484 canSetAccount()
485 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
486 virtual void SAL_CALL
487 setAccount( const OUString& Account )
488 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
490 virtual com::sun::star::uno::Sequence<
491 com::sun::star::ucb::RememberAuthentication > SAL_CALL
492 getRememberAccountModes(
493 com::sun::star::ucb::RememberAuthentication& Default )
494 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
495 virtual void SAL_CALL
496 setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember )
497 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
499 // XInteractionSupplyAuthentication2
500 virtual sal_Bool SAL_CALL canUseSystemCredentials( sal_Bool& Default )
501 throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
502 virtual void SAL_CALL setUseSystemCredentials( sal_Bool UseSystemCredentials )
503 throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
505 // Non-interface methods.
508 * This method returns the realm that was supplied by the interaction
509 * handler.
511 * @return the realm.
513 const OUString & getRealm() const { return m_aRealm; }
516 * This method returns the username that was supplied by the interaction
517 * handler.
519 * @return the username.
521 const OUString & getUserName() const { return m_aUserName; }
524 * This method returns the password that was supplied by the interaction
525 * handler.
527 * @return the password.
529 const OUString & getPassword() const { return m_aPassword; }
532 * This method returns the account that was supplied by the interaction
533 * handler.
535 * @return the account.
537 const OUString & getAccount() const { return m_aAccount; }
540 * This method returns the authentication remember-mode for the password
541 * that was supplied by the interaction handler.
543 * @return the remember-mode for the password.
545 const com::sun::star::ucb::RememberAuthentication &
546 getRememberPasswordMode() const { return m_eRememberPasswordMode; }
549 * This method returns the authentication remember-mode for the account
550 * that was supplied by the interaction handler.
552 * @return the remember-mode for the account.
554 const com::sun::star::ucb::RememberAuthentication &
555 getRememberAccountMode() const { return m_eRememberAccountMode; }
557 bool getUseSystemCredentials() const { return m_bUseSystemCredentials; }
561 inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
562 InteractionRequest * pRequest,
563 bool bCanSetRealm,
564 bool bCanSetUserName,
565 bool bCanSetPassword,
566 bool bCanSetAccount )
567 : InteractionContinuation( pRequest ),
568 m_aRememberPasswordModes( com::sun::star::uno::Sequence<
569 com::sun::star::ucb::RememberAuthentication >( 1 ) ),
570 m_aRememberAccountModes( com::sun::star::uno::Sequence<
571 com::sun::star::ucb::RememberAuthentication >( 1 ) ),
572 m_eRememberPasswordMode( com::sun::star::ucb::RememberAuthentication_NO ),
573 m_eDefaultRememberPasswordMode(
574 com::sun::star::ucb::RememberAuthentication_NO ),
575 m_eRememberAccountMode( com::sun::star::ucb::RememberAuthentication_NO ),
576 m_eDefaultRememberAccountMode(
577 com::sun::star::ucb::RememberAuthentication_NO ),
578 m_bCanSetRealm( bCanSetRealm ),
579 m_bCanSetUserName( bCanSetUserName ),
580 m_bCanSetPassword( bCanSetPassword ),
581 m_bCanSetAccount( bCanSetAccount ),
582 m_bCanUseSystemCredentials( false ),
583 m_bDefaultUseSystemCredentials( false ),
584 m_bUseSystemCredentials( false )
586 m_aRememberPasswordModes[ 0 ]
587 = com::sun::star::ucb::RememberAuthentication_NO;
588 m_aRememberAccountModes [ 0 ]
589 = com::sun::star::ucb::RememberAuthentication_NO;
593 inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
594 InteractionRequest * pRequest,
595 bool bCanSetRealm,
596 bool bCanSetUserName,
597 bool bCanSetPassword,
598 bool bCanSetAccount,
599 const com::sun::star::uno::Sequence<
600 com::sun::star::ucb::RememberAuthentication > & rRememberPasswordModes,
601 const com::sun::star::ucb::RememberAuthentication
602 eDefaultRememberPasswordMode,
603 const com::sun::star::uno::Sequence<
604 com::sun::star::ucb::RememberAuthentication > & rRememberAccountModes,
605 const com::sun::star::ucb::RememberAuthentication
606 eDefaultRememberAccountMode,
607 bool bCanUseSystemCredentials,
608 bool bDefaultUseSystemCredentials )
609 : InteractionContinuation( pRequest ),
610 m_aRememberPasswordModes( rRememberPasswordModes ),
611 m_aRememberAccountModes( rRememberAccountModes ),
612 m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
613 m_eDefaultRememberPasswordMode( eDefaultRememberPasswordMode ),
614 m_eRememberAccountMode( eDefaultRememberAccountMode ),
615 m_eDefaultRememberAccountMode( eDefaultRememberAccountMode ),
616 m_bCanSetRealm( bCanSetRealm ),
617 m_bCanSetUserName( bCanSetUserName ),
618 m_bCanSetPassword( bCanSetPassword ),
619 m_bCanSetAccount( bCanSetAccount ),
620 m_bCanUseSystemCredentials( bCanUseSystemCredentials ),
621 m_bDefaultUseSystemCredentials( bDefaultUseSystemCredentials ),
622 m_bUseSystemCredentials( bDefaultUseSystemCredentials && bCanUseSystemCredentials )
628 * This class implements a standard interaction continuation, namely the
629 * interface XInteractionReplaceExistingData. Instances of this class can be
630 * passed along with an interaction request to indicate the possibility to
631 * replace existing data.
633 class InteractionReplaceExistingData :
634 public InteractionContinuation,
635 public com::sun::star::lang::XTypeProvider,
636 public com::sun::star::ucb::XInteractionReplaceExistingData
638 public:
639 InteractionReplaceExistingData( InteractionRequest * pRequest )
640 : InteractionContinuation( pRequest ) {}
642 // XInterface
643 virtual com::sun::star::uno::Any SAL_CALL
644 queryInterface( const com::sun::star::uno::Type & rType )
645 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
646 virtual void SAL_CALL acquire()
647 throw() SAL_OVERRIDE;
648 virtual void SAL_CALL release()
649 throw() SAL_OVERRIDE;
651 // XTypeProvider
652 virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
653 getTypes()
654 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
655 virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
656 getImplementationId()
657 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
659 // XInteractionContinuation
660 virtual void SAL_CALL select()
661 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
664 class UCBHELPER_DLLPUBLIC InteractionAuthFallback:
665 public InteractionContinuation,
666 public com::sun::star::ucb::XInteractionAuthFallback
668 OUString m_aCode;
670 public:
671 InteractionAuthFallback( InteractionRequest * pRequest )
672 : InteractionContinuation( pRequest ) {}
674 // XInterface
675 virtual com::sun::star::uno::Any SAL_CALL
676 queryInterface( const com::sun::star::uno::Type & rType )
677 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
678 virtual void SAL_CALL acquire()
679 throw() SAL_OVERRIDE;
680 virtual void SAL_CALL release()
681 throw() SAL_OVERRIDE;
683 // XInteractionContinuation
684 virtual void SAL_CALL select()
685 throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
687 // XAuthFallback
688 virtual void SAL_CALL setCode( const OUString& code )
689 throw (::css::uno::RuntimeException, ::std::exception) SAL_OVERRIDE;
690 OUString SAL_CALL getCode()
691 throw (::css::uno::RuntimeException, ::std::exception);
697 } // namespace ucbhelper
699 #endif /* ! INCLUDED_UCBHELPER_INTERACTIONREQUEST_HXX */
701 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */