Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / inc / OAuthenticationContinuation.hxx
blobcdb7b4055a31028666578ebced74f5c0f139acc3
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_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
21 #define INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
23 #include "dbadllapi.hxx"
25 #include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp>
26 #include <com/sun/star/ucb/RememberAuthentication.hpp>
27 #include <com/sun/star/uno/Sequence.hxx>
29 #include <rtl/ustring.hxx>
30 #include <comphelper/interaction.hxx>
32 namespace dbaccess
35 class OOO_DLLPUBLIC_DBA OAuthenticationContinuation :
36 public comphelper::OInteraction< css::ucb::XInteractionSupplyAuthentication >
38 bool m_bRemberPassword : 1; // remember the password for this session ?
40 bool m_bCanSetUserName;
41 OUString m_sUser; // the user
42 OUString m_sPassword; // the user's password
44 public:
45 OAuthenticationContinuation();
47 sal_Bool SAL_CALL canSetRealm( ) throw(css::uno::RuntimeException, std::exception) override;
48 void SAL_CALL setRealm( const OUString& Realm ) throw(css::uno::RuntimeException, std::exception) override;
49 sal_Bool SAL_CALL canSetUserName( ) throw(css::uno::RuntimeException, std::exception) override;
50 void SAL_CALL setUserName( const OUString& UserName ) throw(css::uno::RuntimeException, std::exception) override;
51 sal_Bool SAL_CALL canSetPassword( ) throw(css::uno::RuntimeException, std::exception) override;
52 void SAL_CALL setPassword( const OUString& Password ) throw(css::uno::RuntimeException, std::exception) override;
53 css::uno::Sequence< css::ucb::RememberAuthentication > SAL_CALL getRememberPasswordModes( css::ucb::RememberAuthentication& Default ) throw(css::uno::RuntimeException, std::exception) override;
54 void SAL_CALL setRememberPassword( css::ucb::RememberAuthentication Remember ) throw(css::uno::RuntimeException, std::exception) override;
55 sal_Bool SAL_CALL canSetAccount( ) throw(css::uno::RuntimeException, std::exception) override;
56 void SAL_CALL setAccount( const OUString& Account ) throw(css::uno::RuntimeException, std::exception) override;
57 css::uno::Sequence< css::ucb::RememberAuthentication > SAL_CALL getRememberAccountModes( css::ucb::RememberAuthentication& Default ) throw(css::uno::RuntimeException, std::exception) override;
58 void SAL_CALL setRememberAccount( css::ucb::RememberAuthentication Remember ) throw(css::uno::RuntimeException, std::exception) override;
60 void setCanChangeUserName( bool bVal ) { m_bCanSetUserName = bVal; }
61 const OUString& getUser() const { return m_sUser; }
62 const OUString& getPassword() const { return m_sPassword; }
63 bool getRememberPassword() const { return m_bRemberPassword; }
66 } // namespace dbaccess
68 #endif // INCLUDED_DBACCESS_SOURCE_INC_OAUTHENTICATIONCONTINUATION_HXX
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */