Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
21 : #define INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
22 :
23 : #include "dbadllapi.hxx"
24 :
25 : #include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp>
26 : #include <com/sun/star/ucb/RememberAuthentication.hpp>
27 : #include <com/sun/star/uno/Sequence.hxx>
28 :
29 : #include <rtl/ustring.hxx>
30 : #include <comphelper/interaction.hxx>
31 :
32 : namespace dbaccess
33 : {
34 :
35 0 : class OOO_DLLPUBLIC_DBA OAuthenticationContinuation :
36 : public comphelper::OInteraction< com::sun::star::ucb::XInteractionSupplyAuthentication >
37 : {
38 : sal_Bool m_bRemberPassword : 1; // remember the password for this session ?
39 :
40 : sal_Bool m_bCanSetUserName;
41 : OUString m_sUser; // the user
42 : OUString m_sPassword; // the user's password
43 :
44 : public:
45 : OAuthenticationContinuation();
46 :
47 : sal_Bool SAL_CALL canSetRealm( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
48 : void SAL_CALL setRealm( const OUString& Realm ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
49 : sal_Bool SAL_CALL canSetUserName( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
50 : void SAL_CALL setUserName( const OUString& UserName ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
51 : sal_Bool SAL_CALL canSetPassword( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
52 : void SAL_CALL setPassword( const OUString& Password ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
53 : 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, std::exception) SAL_OVERRIDE;
54 : void SAL_CALL setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
55 : sal_Bool SAL_CALL canSetAccount( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
56 : void SAL_CALL setAccount( const OUString& Account ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
57 : 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, std::exception) SAL_OVERRIDE;
58 : void SAL_CALL setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
59 :
60 0 : void setCanChangeUserName( sal_Bool bVal ) { m_bCanSetUserName = bVal; }
61 0 : OUString getUser() const { return m_sUser; }
62 0 : OUString getPassword() const { return m_sPassword; }
63 0 : sal_Bool getRememberPassword() const { return m_bRemberPassword; }
64 : };
65 :
66 : } // namespace dbaccess
67 :
68 : #endif // INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
69 :
70 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|