1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX
10 #define INCLUDED_UCB_SOURCE_UCP_CMIS_AUTH_PROVIDER_HXX
12 #if defined __GNUC__ && !defined __clang__
13 #pragma GCC diagnostic push
14 #pragma GCC diagnostic ignored "-Wdeprecated"
15 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
17 #include <libcmis/libcmis.hxx>
18 #if defined __GNUC__ && !defined __clang__
19 #pragma GCC diagnostic pop
22 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
23 #include <cppuhelper/weakref.hxx>
27 class AuthProvider
: public libcmis::AuthProvider
29 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& m_xEnv
;
30 static css::uno::WeakReference
< css::ucb::XCommandEnvironment
> sm_xEnv
;
31 OUString
const m_sUrl
;
32 OUString
const m_sBindingUrl
;
35 AuthProvider ( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
,
37 const OUString
& sBindingUrl
):
38 m_xEnv( xEnv
), m_sUrl( sUrl
), m_sBindingUrl( sBindingUrl
) { }
40 bool authenticationQuery( std::string
& username
, std::string
& password
) override
;
42 static char* onedriveAuthCodeFallback( const char* url
,
43 const char* /*username*/,
44 const char* /*password*/ );
46 static char* gdriveAuthCodeFallback( const char* /*url*/,
47 const char* /*username*/,
48 const char* /*password*/ );
50 static void setXEnv( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
);
51 static css::uno::Reference
< css::ucb::XCommandEnvironment
> getXEnv();
58 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */