xref: /trunk/main/ucbhelper/inc/ucbhelper/interactionrequest.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _UCBHELPER_INTERATIONREQUEST_HXX
29 #define _UCBHELPER_INTERATIONREQUEST_HXX
30 
31 #include <com/sun/star/lang/XTypeProvider.hpp>
32 #include <com/sun/star/task/XInteractionRequest.hpp>
33 #include <com/sun/star/task/XInteractionAbort.hpp>
34 #include <com/sun/star/task/XInteractionRetry.hpp>
35 #include <com/sun/star/task/XInteractionApprove.hpp>
36 #include <com/sun/star/task/XInteractionDisapprove.hpp>
37 #include <com/sun/star/ucb/XInteractionReplaceExistingData.hpp>
38 #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
39 #include <com/sun/star/ucb/XInteractionSupplyName.hpp>
40 #include <rtl/ref.hxx>
41 #include <cppuhelper/weak.hxx>
42 #include "ucbhelper/ucbhelperdllapi.h"
43 
44 namespace ucbhelper {
45 
46 class InteractionContinuation;
47 
48 //============================================================================
49 struct InteractionRequest_Impl;
50 
51 /**
52   * This class implements the interface XInteractionRequest. Instances can
53   * be passed directly to XInteractionHandler::handle(...). Each interaction
54   * request contains an exception describing the error and a number of
55   * interaction continuations describing the possible "answers" for the request.
56   * After the request was passed to XInteractionHandler::handle(...) the method
57   * getSelection() returns the continuation choosen by the interaction handler.
58   *
59   * The typical usage of this class would be:
60   *
61   * 1) Create exception object that shall be handled by the interaction handler.
62   * 2) Create InteractionRequest, supply exception as ctor parameter
63   * 3) Create continuations needed and add them to a sequence
64   * 4) Supply the continuations to the InteractionRequest by calling
65   *    setContinuations(...)
66   *
67   * This class can also be used as base class for more specialized requests,
68   * like authentication requests.
69   */
70 class UCBHELPER_DLLPUBLIC InteractionRequest : public cppu::OWeakObject,
71                            public com::sun::star::lang::XTypeProvider,
72                            public com::sun::star::task::XInteractionRequest
73 {
74     InteractionRequest_Impl * m_pImpl;
75 
76 protected:
77     void setRequest( const com::sun::star::uno::Any & rRequest );
78 
79     InteractionRequest();
80     virtual ~InteractionRequest();
81 
82 public:
83     /**
84       * Constructor.
85       *
86       * @param rRequest is the exception describing the error.
87       */
88     InteractionRequest( const com::sun::star::uno::Any & rRequest );
89 
90     /**
91       * This method sets the continuations for the request.
92       *
93       * @param rContinuations contains the possible continuations.
94       */
95     void setContinuations(
96         const com::sun::star::uno::Sequence<
97             com::sun::star::uno::Reference<
98                 com::sun::star::task::XInteractionContinuation > > &
99                     rContinuations );
100 
101     // XInterface
102     virtual com::sun::star::uno::Any SAL_CALL
103     queryInterface( const com::sun::star::uno::Type & rType )
104         throw( com::sun::star::uno::RuntimeException );
105     virtual void SAL_CALL acquire()
106         throw();
107     virtual void SAL_CALL release()
108         throw();
109 
110     // XTypeProvider
111     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
112     getTypes()
113         throw( com::sun::star::uno::RuntimeException );
114     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
115     getImplementationId()
116         throw( com::sun::star::uno::RuntimeException );
117 
118     // XInteractionRequest
119     virtual com::sun::star::uno::Any SAL_CALL
120     getRequest()
121         throw( com::sun::star::uno::RuntimeException );
122     virtual com::sun::star::uno::Sequence<
123                 com::sun::star::uno::Reference<
124                     com::sun::star::task::XInteractionContinuation > > SAL_CALL
125     getContinuations()
126         throw( com::sun::star::uno::RuntimeException );
127 
128     // Non-interface methods.
129 
130     /**
131       * After passing this request to XInteractionHandler::handle, this method
132       * returns the continuation that was choosen by the interaction handler.
133       *
134       * @return the continuation choosen by an interaction handler or an empty
135       *         reference, if the request was not (yet) handled.
136       */
137     rtl::Reference< InteractionContinuation > getSelection() const;
138 
139     /**
140       * This method sets a continuation for the request. It also can be used
141       * to reset the continuation set by a previous XInteractionHandler::handle
142       * call in order to use this request object more then once.
143       *
144       * @param rxSelection is the interaction continuation to activate for
145       *        the request or an empty reference in order to reset the
146       *        current selection.
147       */
148     void
149     setSelection(
150         const rtl::Reference< InteractionContinuation > & rxSelection );
151 };
152 
153 //============================================================================
154 struct InteractionContinuation_Impl;
155 
156 /**
157   * This class is the base for implementations of the interface
158   * XInteractionContinuation. Classes derived from this bas class work together
159   * with class InteractionRequest.
160   *
161   * Derived classes must implement their XInteractionContinuation::select()
162   * method the way that they simply call recordSelection() which is provided by
163   * this class.
164   */
165 class UCBHELPER_DLLPUBLIC InteractionContinuation : public cppu::OWeakObject
166 {
167     InteractionContinuation_Impl * m_pImpl;
168 
169 protected:
170     /**
171       * This method marks this continuation as "selected" at the request it
172       * belongs to.
173       *
174       * Derived classes must implement their XInteractionContinuation::select()
175       * method the way that they call this method.
176       */
177     void recordSelection();
178     virtual ~InteractionContinuation();
179 
180 public:
181     InteractionContinuation( InteractionRequest * pRequest );
182 };
183 
184 //============================================================================
185 /**
186   * This class implements a standard interaction continuation, namely the
187   * interface XInteractionAbort. Instances of this class can be passed
188   * along with an interaction request to indicate the possiblity to abort
189   * the operation that caused the request.
190   */
191 class UCBHELPER_DLLPUBLIC InteractionAbort : public InteractionContinuation,
192                          public com::sun::star::lang::XTypeProvider,
193                          public com::sun::star::task::XInteractionAbort
194 {
195 public:
196     InteractionAbort( InteractionRequest * pRequest )
197     : InteractionContinuation( pRequest ) {}
198 
199     // XInterface
200     virtual com::sun::star::uno::Any SAL_CALL
201     queryInterface( const com::sun::star::uno::Type & rType )
202         throw( com::sun::star::uno::RuntimeException );
203     virtual void SAL_CALL acquire()
204         throw();
205     virtual void SAL_CALL release()
206         throw();
207 
208     // XTypeProvider
209     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
210     getTypes()
211         throw( com::sun::star::uno::RuntimeException );
212     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
213     getImplementationId()
214         throw( com::sun::star::uno::RuntimeException );
215 
216     // XInteractionContinuation
217     virtual void SAL_CALL select()
218         throw( com::sun::star::uno::RuntimeException );
219 };
220 
221 //============================================================================
222 /**
223   * This class implements a standard interaction continuation, namely the
224   * interface XInteractionRetry. Instances of this class can be passed
225   * along with an interaction request to indicate the possiblity to retry
226   * the operation that caused the request.
227   */
228 class UCBHELPER_DLLPUBLIC InteractionRetry : public InteractionContinuation,
229                          public com::sun::star::lang::XTypeProvider,
230                          public com::sun::star::task::XInteractionRetry
231 {
232 public:
233     InteractionRetry( InteractionRequest * pRequest )
234     : InteractionContinuation( pRequest ) {}
235 
236     // XInterface
237     virtual com::sun::star::uno::Any SAL_CALL
238     queryInterface( const com::sun::star::uno::Type & rType )
239         throw( com::sun::star::uno::RuntimeException );
240     virtual void SAL_CALL acquire()
241         throw();
242     virtual void SAL_CALL release()
243         throw();
244 
245     // XTypeProvider
246     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
247     getTypes()
248         throw( com::sun::star::uno::RuntimeException );
249     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
250     getImplementationId()
251         throw( com::sun::star::uno::RuntimeException );
252 
253     // XInteractionContinuation
254     virtual void SAL_CALL select()
255         throw( com::sun::star::uno::RuntimeException );
256 };
257 
258 //============================================================================
259 /**
260   * This class implements a standard interaction continuation, namely the
261   * interface XInteractionApprove. Instances of this class can be passed
262   * along with an interaction request to indicate the possiblity to approve
263   * the request.
264   */
265 class UCBHELPER_DLLPUBLIC InteractionApprove : public InteractionContinuation,
266                            public com::sun::star::lang::XTypeProvider,
267                            public com::sun::star::task::XInteractionApprove
268 {
269 public:
270     InteractionApprove( InteractionRequest * pRequest )
271     : InteractionContinuation( pRequest ) {}
272 
273     // XInterface
274     virtual com::sun::star::uno::Any SAL_CALL
275     queryInterface( const com::sun::star::uno::Type & rType )
276         throw( com::sun::star::uno::RuntimeException );
277     virtual void SAL_CALL acquire()
278         throw();
279     virtual void SAL_CALL release()
280         throw();
281 
282     // XTypeProvider
283     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
284     getTypes()
285         throw( com::sun::star::uno::RuntimeException );
286     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
287     getImplementationId()
288         throw( com::sun::star::uno::RuntimeException );
289 
290     // XInteractionContinuation
291     virtual void SAL_CALL select()
292         throw( com::sun::star::uno::RuntimeException );
293 };
294 
295 //============================================================================
296 /**
297   * This class implements a standard interaction continuation, namely the
298   * interface XInteractionDisapprove. Instances of this class can be passed
299   * along with an interaction request to indicate the possiblity to disapprove
300   * the request.
301   */
302 class UCBHELPER_DLLPUBLIC InteractionDisapprove : public InteractionContinuation,
303                               public com::sun::star::lang::XTypeProvider,
304                               public com::sun::star::task::XInteractionDisapprove
305 {
306 public:
307     InteractionDisapprove( InteractionRequest * pRequest )
308     : InteractionContinuation( pRequest ) {}
309 
310     // XInterface
311     virtual com::sun::star::uno::Any SAL_CALL
312     queryInterface( const com::sun::star::uno::Type & rType )
313         throw( com::sun::star::uno::RuntimeException );
314     virtual void SAL_CALL acquire()
315         throw();
316     virtual void SAL_CALL release()
317         throw();
318 
319     // XTypeProvider
320     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
321     getTypes()
322         throw( com::sun::star::uno::RuntimeException );
323     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
324     getImplementationId()
325         throw( com::sun::star::uno::RuntimeException );
326 
327     // XInteractionContinuation
328     virtual void SAL_CALL select()
329         throw( com::sun::star::uno::RuntimeException );
330 };
331 
332 //============================================================================
333 /**
334   * This class implements a standard interaction continuation, namely the
335   * interface XInteractionSupplyAuthentication. Instances of this class can be
336   * passed along with an authentication interaction request to enable the
337   * interaction handler to supply the missing authentication data.
338   */
339 class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
340                   public InteractionContinuation,
341                   public com::sun::star::lang::XTypeProvider,
342                   public com::sun::star::ucb::XInteractionSupplyAuthentication2
343 {
344     com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
345                   m_aRememberPasswordModes;
346     com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
347                   m_aRememberAccountModes;
348     rtl::OUString m_aRealm;
349     rtl::OUString m_aUserName;
350     rtl::OUString m_aPassword;
351     rtl::OUString m_aAccount;
352     com::sun::star::ucb::RememberAuthentication m_eRememberPasswordMode;
353     com::sun::star::ucb::RememberAuthentication m_eDefaultRememberPasswordMode;
354     com::sun::star::ucb::RememberAuthentication m_eRememberAccountMode;
355     com::sun::star::ucb::RememberAuthentication m_eDefaultRememberAccountMode;
356     unsigned m_bCanSetRealm    : 1;
357     unsigned m_bCanSetUserName : 1;
358     unsigned m_bCanSetPassword : 1;
359     unsigned m_bCanSetAccount  : 1;
360     unsigned m_bCanUseSystemCredentials     : 1;
361     unsigned m_bDefaultUseSystemCredentials : 1;
362     unsigned m_bUseSystemCredentials        : 1;
363 
364 public:
365     /**
366       * Constructor.
367       *
368       * @param rxRequest is the interaction request that owns this continuation.
369       * @param bCanSetRealm indicates, whether the realm given with the
370       *        authentication request is read-only.
371       * @param bCanSetUserName indicates, whether the username given with the
372       *        authentication request is read-only.
373       * @param bCanSetPassword indicates, whether the password given with the
374       *        authentication request is read-only.
375       * @param bCanSetAccount indicates, whether the account given with the
376       *        authentication request is read-only.
377       *
378       * @see com::sun::star::ucb::AuthenticationRequest
379       */
380     inline InteractionSupplyAuthentication(
381                     InteractionRequest * pRequest,
382                     sal_Bool bCanSetRealm,
383                     sal_Bool bCanSetUserName,
384                     sal_Bool bCanSetPassword,
385                     sal_Bool bCanSetAccount);
386     /**
387       * Constructor.
388       *
389       * Note: The remember-authentication stuff is interesting only for
390       *       clients implementing own password storage functionality.
391       *
392       * @param rxRequest is the interaction request that owns this continuation.
393       * @param bCanSetRealm indicates, whether the realm given with the
394       *        authentication request is read-only.
395       * @param bCanSetUserName indicates, whether the username given with the
396       *        authentication request is read-only.
397       * @param bCanSetPassword indicates, whether the password given with the
398       *        authentication request is read-only.
399       * @param bCanSetAccount indicates, whether the account given with the
400       *        authentication request is read-only.
401       * @param rRememberPasswordModes specifies the authentication-remember-
402       *        modes for passwords supported by the requesting client.
403       * @param eDefaultRememberPasswordMode specifies the default
404       *        authentication-remember-mode for passwords preferred by the
405       *        requesting client.
406       * @param rRememberAccountModes specifies the authentication-remember-
407       *        modes for accounts supported by the requesting client.
408       * @param eDefaultRememberAccountMode specifies the default
409       *        authentication-remember-mode for accounts preferred by the
410       *        requesting client.
411       * @param bCanUseSystemCredentials indicates whether issuer of the
412       *        authetication request can obtain and use system credentials
413       *        for authentication.
414       * @param bDefaultUseSystemCredentials specifies the default system
415       *        credentials usage preferred by the requesting client
416       *
417       * @see com::sun::star::ucb::AuthenticationRequest
418       * @see com::sun::star::ucb::RememberAuthentication
419       */
420     inline InteractionSupplyAuthentication(
421                     InteractionRequest * pRequest,
422                     sal_Bool bCanSetRealm,
423                     sal_Bool bCanSetUserName,
424                     sal_Bool bCanSetPassword,
425                     sal_Bool bCanSetAccount,
426                     const com::sun::star::uno::Sequence<
427                         com::sun::star::ucb::RememberAuthentication > &
428                             rRememberPasswordModes,
429                     const com::sun::star::ucb::RememberAuthentication
430                         eDefaultRememberPasswordMode,
431                     const com::sun::star::uno::Sequence<
432                         com::sun::star::ucb::RememberAuthentication > &
433                             rRememberAccountModes,
434                     const com::sun::star::ucb::RememberAuthentication
435                         eDefaultRememberAccountMode,
436                     sal_Bool bCanUseSystemCredentials,
437                     sal_Bool bDefaultUseSystemCredentials );
438 
439     // XInterface
440     virtual com::sun::star::uno::Any SAL_CALL
441     queryInterface( const com::sun::star::uno::Type & rType )
442         throw( com::sun::star::uno::RuntimeException );
443     virtual void SAL_CALL acquire()
444         throw();
445     virtual void SAL_CALL release()
446         throw();
447 
448     // XTypeProvider
449     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
450     getTypes()
451         throw( com::sun::star::uno::RuntimeException );
452     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
453     getImplementationId()
454         throw( com::sun::star::uno::RuntimeException );
455 
456     // XInteractionContinuation
457     virtual void SAL_CALL select()
458         throw( com::sun::star::uno::RuntimeException );
459 
460     // XInteractionSupplyAuthentication
461     virtual sal_Bool SAL_CALL
462     canSetRealm()
463         throw( com::sun::star::uno::RuntimeException );
464     virtual void SAL_CALL
465     setRealm( const rtl::OUString& Realm )
466         throw( com::sun::star::uno::RuntimeException );
467 
468     virtual sal_Bool SAL_CALL
469     canSetUserName()
470         throw( com::sun::star::uno::RuntimeException );
471     virtual void SAL_CALL
472     setUserName( const rtl::OUString& UserName )
473         throw( com::sun::star::uno::RuntimeException );
474 
475     virtual sal_Bool SAL_CALL
476     canSetPassword()
477         throw( com::sun::star::uno::RuntimeException );
478     virtual void SAL_CALL
479     setPassword( const rtl::OUString& Password )
480         throw( com::sun::star::uno::RuntimeException );
481 
482     virtual com::sun::star::uno::Sequence<
483                 com::sun::star::ucb::RememberAuthentication > SAL_CALL
484     getRememberPasswordModes(
485             com::sun::star::ucb::RememberAuthentication& Default )
486         throw( com::sun::star::uno::RuntimeException );
487     virtual void SAL_CALL
488     setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember )
489         throw( com::sun::star::uno::RuntimeException );
490 
491     virtual sal_Bool SAL_CALL
492     canSetAccount()
493         throw( com::sun::star::uno::RuntimeException );
494     virtual void SAL_CALL
495     setAccount( const rtl::OUString& Account )
496         throw( com::sun::star::uno::RuntimeException );
497 
498     virtual com::sun::star::uno::Sequence<
499                 com::sun::star::ucb::RememberAuthentication > SAL_CALL
500     getRememberAccountModes(
501             com::sun::star::ucb::RememberAuthentication& Default )
502         throw( com::sun::star::uno::RuntimeException );
503     virtual void SAL_CALL
504     setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember )
505         throw( com::sun::star::uno::RuntimeException );
506 
507     // XInteractionSupplyAuthentication2
508     virtual ::sal_Bool SAL_CALL canUseSystemCredentials( ::sal_Bool& Default )
509         throw ( ::com::sun::star::uno::RuntimeException );
510     virtual void SAL_CALL setUseSystemCredentials( ::sal_Bool UseSystemCredentials )
511         throw ( ::com::sun::star::uno::RuntimeException );
512 
513     // Non-interface methods.
514 
515     /**
516       * This method returns the realm that was supplied by the interaction
517       * handler.
518       *
519       * @return the realm.
520       */
521     const rtl::OUString & getRealm()    const { return m_aRealm; }
522 
523     /**
524       * This method returns the username that was supplied by the interaction
525       * handler.
526       *
527       * @return the username.
528       */
529     const rtl::OUString & getUserName() const { return m_aUserName; }
530 
531     /**
532       * This method returns the password that was supplied by the interaction
533       * handler.
534       *
535       * @return the password.
536       */
537     const rtl::OUString & getPassword() const { return m_aPassword; }
538 
539     /**
540       * This method returns the account that was supplied by the interaction
541       * handler.
542       *
543       * @return the account.
544       */
545     const rtl::OUString & getAccount()  const { return m_aAccount; }
546 
547     /**
548       * This method returns the authentication remember-mode for the password
549       * that was supplied by the interaction handler.
550       *
551       * @return the remember-mode for the password.
552       */
553     const com::sun::star::ucb::RememberAuthentication &
554     getRememberPasswordMode() const { return m_eRememberPasswordMode; }
555 
556     /**
557       * This method returns the authentication remember-mode for the account
558       * that was supplied by the interaction handler.
559       *
560       * @return the remember-mode for the account.
561       */
562     const com::sun::star::ucb::RememberAuthentication &
563     getRememberAccountMode() const { return m_eRememberAccountMode; }
564 
565     sal_Bool getUseSystemCredentials() const { return m_bUseSystemCredentials; }
566 };
567 
568 //============================================================================
569 inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
570                     InteractionRequest * pRequest,
571                     sal_Bool bCanSetRealm,
572                     sal_Bool bCanSetUserName,
573                     sal_Bool bCanSetPassword,
574                     sal_Bool bCanSetAccount )
575 : InteractionContinuation( pRequest ),
576   m_aRememberPasswordModes( com::sun::star::uno::Sequence<
577                 com::sun::star::ucb::RememberAuthentication >( 1 ) ),
578   m_aRememberAccountModes( com::sun::star::uno::Sequence<
579                 com::sun::star::ucb::RememberAuthentication >( 1 ) ),
580   m_eRememberPasswordMode( com::sun::star::ucb::RememberAuthentication_NO ),
581   m_eDefaultRememberPasswordMode(
582                 com::sun::star::ucb::RememberAuthentication_NO ),
583   m_eRememberAccountMode( com::sun::star::ucb::RememberAuthentication_NO ),
584   m_eDefaultRememberAccountMode(
585                 com::sun::star::ucb::RememberAuthentication_NO ),
586   m_bCanSetRealm( bCanSetRealm ),
587   m_bCanSetUserName( bCanSetUserName ),
588   m_bCanSetPassword( bCanSetPassword ),
589   m_bCanSetAccount( bCanSetAccount ),
590   m_bCanUseSystemCredentials( sal_False ),
591   m_bDefaultUseSystemCredentials( sal_False ),
592   m_bUseSystemCredentials( sal_False )
593 {
594     m_aRememberPasswordModes[ 0 ]
595         = com::sun::star::ucb::RememberAuthentication_NO;
596     m_aRememberAccountModes [ 0 ]
597         = com::sun::star::ucb::RememberAuthentication_NO;
598 }
599 
600 //============================================================================
601 inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
602     InteractionRequest * pRequest,
603     sal_Bool bCanSetRealm,
604     sal_Bool bCanSetUserName,
605     sal_Bool bCanSetPassword,
606     sal_Bool bCanSetAccount,
607     const com::sun::star::uno::Sequence<
608         com::sun::star::ucb::RememberAuthentication > & rRememberPasswordModes,
609     const com::sun::star::ucb::RememberAuthentication
610         eDefaultRememberPasswordMode,
611     const com::sun::star::uno::Sequence<
612         com::sun::star::ucb::RememberAuthentication > & rRememberAccountModes,
613     const com::sun::star::ucb::RememberAuthentication
614         eDefaultRememberAccountMode,
615     sal_Bool bCanUseSystemCredentials,
616     sal_Bool bDefaultUseSystemCredentials )
617 : InteractionContinuation( pRequest ),
618   m_aRememberPasswordModes( rRememberPasswordModes ),
619   m_aRememberAccountModes( rRememberAccountModes ),
620   m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
621   m_eDefaultRememberPasswordMode( eDefaultRememberPasswordMode ),
622   m_eRememberAccountMode( eDefaultRememberAccountMode ),
623   m_eDefaultRememberAccountMode( eDefaultRememberAccountMode ),
624   m_bCanSetRealm( bCanSetRealm ),
625   m_bCanSetUserName( bCanSetUserName ),
626   m_bCanSetPassword( bCanSetPassword ),
627   m_bCanSetAccount( bCanSetAccount ),
628   m_bCanUseSystemCredentials( bCanUseSystemCredentials ),
629   m_bDefaultUseSystemCredentials( bDefaultUseSystemCredentials ),
630   m_bUseSystemCredentials( bDefaultUseSystemCredentials & bCanUseSystemCredentials )
631 {
632 }
633 
634 //============================================================================
635 /**
636   * This class implements a standard interaction continuation, namely the
637   * interface XInteractionSupplyName. Instances of this class can be passed
638   * along with an interaction request to indicate the possiblity to
639   * supply a new name.
640   */
641 class InteractionSupplyName : public InteractionContinuation,
642                               public com::sun::star::lang::XTypeProvider,
643                               public com::sun::star::ucb::XInteractionSupplyName
644 {
645     rtl::OUString m_aName;
646 
647 public:
648     InteractionSupplyName( InteractionRequest * pRequest )
649     : InteractionContinuation( pRequest ) {}
650 
651     // XInterface
652     virtual com::sun::star::uno::Any SAL_CALL
653     queryInterface( const com::sun::star::uno::Type & rType )
654         throw( com::sun::star::uno::RuntimeException );
655     virtual void SAL_CALL acquire()
656         throw();
657     virtual void SAL_CALL release()
658         throw();
659 
660     // XTypeProvider
661     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
662     getTypes()
663         throw( com::sun::star::uno::RuntimeException );
664     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
665     getImplementationId()
666         throw( com::sun::star::uno::RuntimeException );
667 
668     // XInteractionContinuation
669     virtual void SAL_CALL select()
670         throw( com::sun::star::uno::RuntimeException );
671 
672     // XInteractionSupplyName
673     virtual void SAL_CALL setName( const ::rtl::OUString& Name )
674         throw ( com::sun::star::uno::RuntimeException );
675 
676     // Non-interface methods.
677 
678     /**
679       * This method returns the name that was supplied by the interaction
680       * handler.
681       *
682       * @return the name.
683       */
684     const rtl::OUString & getName() const { return m_aName; }
685 };
686 
687 //============================================================================
688 /**
689   * This class implements a standard interaction continuation, namely the
690   * interface XInteractionReplaceExistingData. Instances of this class can be
691   * passed along with an interaction request to indicate the possiblity to
692   * replace existing data.
693   */
694 class InteractionReplaceExistingData :
695                   public InteractionContinuation,
696                   public com::sun::star::lang::XTypeProvider,
697                   public com::sun::star::ucb::XInteractionReplaceExistingData
698 {
699 public:
700     InteractionReplaceExistingData( InteractionRequest * pRequest )
701     : InteractionContinuation( pRequest ) {}
702 
703     // XInterface
704     virtual com::sun::star::uno::Any SAL_CALL
705     queryInterface( const com::sun::star::uno::Type & rType )
706         throw( com::sun::star::uno::RuntimeException );
707     virtual void SAL_CALL acquire()
708         throw();
709     virtual void SAL_CALL release()
710         throw();
711 
712     // XTypeProvider
713     virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
714     getTypes()
715         throw( com::sun::star::uno::RuntimeException );
716     virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
717     getImplementationId()
718         throw( com::sun::star::uno::RuntimeException );
719 
720     // XInteractionContinuation
721     virtual void SAL_CALL select()
722         throw( com::sun::star::uno::RuntimeException );
723 };
724 
725 } // namespace ucbhelper
726 
727 #endif /* !_UCBHELPER_INTERATIONREQUEST_HXX */
728