1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _DBACCESS_OAUTHENTICATIONCONTINUATION_HXX_
25 #define _DBACCESS_OAUTHENTICATIONCONTINUATION_HXX_
26 
27 #include "dbadllapi.hxx"
28 
29 #include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp>
30 #include <com/sun/star/ucb/RememberAuthentication.hpp>
31 #include <com/sun/star/uno/Sequence.hxx>
32 
33 #include <tools/string.hxx>
34 #include <comphelper/interaction.hxx>
35 
36 
37 //........................................................................
38 namespace dbaccess
39 {
40 //........................................................................
41 
42 class OOO_DLLPUBLIC_DBA OAuthenticationContinuation :
43     public comphelper::OInteraction< com::sun::star::ucb::XInteractionSupplyAuthentication >
44 {
45     sal_Bool    m_bRemberPassword : 1;      // remember the password for this session ?
46 
47     sal_Bool            m_bCanSetUserName;
48     ::rtl::OUString     m_sUser;            // the user
49     ::rtl::OUString     m_sPassword;        // the user's password
50 
51 public:
52     OAuthenticationContinuation();
53 
54     sal_Bool SAL_CALL canSetRealm(  ) throw(com::sun::star::uno::RuntimeException);
55     void SAL_CALL setRealm( const ::rtl::OUString& Realm ) throw(com::sun::star::uno::RuntimeException);
56     sal_Bool SAL_CALL canSetUserName(  ) throw(com::sun::star::uno::RuntimeException);
57     void SAL_CALL setUserName( const ::rtl::OUString& UserName ) throw(com::sun::star::uno::RuntimeException);
58     sal_Bool SAL_CALL canSetPassword(  ) throw(com::sun::star::uno::RuntimeException);
59     void SAL_CALL setPassword( const ::rtl::OUString& Password ) throw(com::sun::star::uno::RuntimeException);
60     com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication > SAL_CALL getRememberPasswordModes( com::sun::star::ucb::RememberAuthentication& Default ) throw(com::sun::star::uno::RuntimeException);
61     void SAL_CALL setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember ) throw(com::sun::star::uno::RuntimeException);
62     sal_Bool SAL_CALL canSetAccount(  ) throw(com::sun::star::uno::RuntimeException);
63     void SAL_CALL setAccount( const ::rtl::OUString& Account ) throw(com::sun::star::uno::RuntimeException);
64     com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication > SAL_CALL getRememberAccountModes( com::sun::star::ucb::RememberAuthentication& Default ) throw(com::sun::star::uno::RuntimeException);
65     void SAL_CALL setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember ) throw(com::sun::star::uno::RuntimeException);
66 
setCanChangeUserName(sal_Bool bVal)67     void            setCanChangeUserName( sal_Bool bVal )  { m_bCanSetUserName = bVal; }
getUser() const68     ::rtl::OUString getUser() const             { return m_sUser; }
getPassword() const69     ::rtl::OUString getPassword() const         { return m_sPassword; }
getRememberPassword() const70     sal_Bool        getRememberPassword() const { return m_bRemberPassword; }
71 };
72 
73 //........................................................................
74 }   // namespace dbaccess
75 //........................................................................
76 
77 #endif // _DBACCESS_OAUTHENTICATIONCONTINUATION_HXX_
78 
79