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 _DBACCESS_OAUTHENTICATIONCONTINUATION_HXX_ 29 #define _DBACCESS_OAUTHENTICATIONCONTINUATION_HXX_ 30 31 #include "dbadllapi.hxx" 32 33 #include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp> 34 #include <com/sun/star/ucb/RememberAuthentication.hpp> 35 #include <com/sun/star/uno/Sequence.hxx> 36 37 #include <tools/string.hxx> 38 #include <comphelper/interaction.hxx> 39 40 41 //........................................................................ 42 namespace dbaccess 43 { 44 //........................................................................ 45 46 class OOO_DLLPUBLIC_DBA OAuthenticationContinuation : 47 public comphelper::OInteraction< com::sun::star::ucb::XInteractionSupplyAuthentication > 48 { 49 sal_Bool m_bRemberPassword : 1; // remember the password for this session ? 50 51 sal_Bool m_bCanSetUserName; 52 ::rtl::OUString m_sUser; // the user 53 ::rtl::OUString m_sPassword; // the user's password 54 55 public: 56 OAuthenticationContinuation(); 57 58 sal_Bool SAL_CALL canSetRealm( ) throw(com::sun::star::uno::RuntimeException); 59 void SAL_CALL setRealm( const ::rtl::OUString& Realm ) throw(com::sun::star::uno::RuntimeException); 60 sal_Bool SAL_CALL canSetUserName( ) throw(com::sun::star::uno::RuntimeException); 61 void SAL_CALL setUserName( const ::rtl::OUString& UserName ) throw(com::sun::star::uno::RuntimeException); 62 sal_Bool SAL_CALL canSetPassword( ) throw(com::sun::star::uno::RuntimeException); 63 void SAL_CALL setPassword( const ::rtl::OUString& Password ) throw(com::sun::star::uno::RuntimeException); 64 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); 65 void SAL_CALL setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember ) throw(com::sun::star::uno::RuntimeException); 66 sal_Bool SAL_CALL canSetAccount( ) throw(com::sun::star::uno::RuntimeException); 67 void SAL_CALL setAccount( const ::rtl::OUString& Account ) throw(com::sun::star::uno::RuntimeException); 68 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); 69 void SAL_CALL setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember ) throw(com::sun::star::uno::RuntimeException); 70 71 void setCanChangeUserName( sal_Bool bVal ) { m_bCanSetUserName = bVal; } 72 ::rtl::OUString getUser() const { return m_sUser; } 73 ::rtl::OUString getPassword() const { return m_sPassword; } 74 sal_Bool getRememberPassword() const { return m_bRemberPassword; } 75 }; 76 77 //........................................................................ 78 } // namespace dbaccess 79 //........................................................................ 80 81 #endif // _DBACCESS_OAUTHENTICATIONCONTINUATION_HXX_ 82 83