bump product version to 7.2.5.1
[LibreOffice.git] / ucb / source / ucp / cmis / auth_provider.hxx
blob9092f3c6bd25c8fb690242a64f215403548af344
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/.
8 */
9 #pragma once
11 #if defined __GNUC__ && !defined __clang__
12 #pragma GCC diagnostic push
13 #pragma GCC diagnostic ignored "-Wdeprecated"
14 #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
15 #endif
16 #include <libcmis/libcmis.hxx>
17 #if defined __GNUC__ && !defined __clang__
18 #pragma GCC diagnostic pop
19 #endif
21 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
22 #include <cppuhelper/weakref.hxx>
24 namespace cmis
26 class AuthProvider : public libcmis::AuthProvider
28 const css::uno::Reference< css::ucb::XCommandEnvironment>& m_xEnv;
29 static css::uno::WeakReference< css::ucb::XCommandEnvironment> sm_xEnv;
30 OUString m_sUrl;
31 OUString m_sBindingUrl;
33 public:
34 AuthProvider ( const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv,
35 const OUString& sUrl,
36 const OUString& sBindingUrl ):
37 m_xEnv( xEnv ), m_sUrl( sUrl ), m_sBindingUrl( sBindingUrl ) { }
39 bool authenticationQuery( std::string& username, std::string& password ) override;
41 std::string getRefreshToken( std::string& username );
42 bool storeRefreshToken(const std::string& username, const std::string& password,
43 const std::string& refreshToken);
45 static char* copyWebAuthCodeFallback( const char* url,
46 const char* /*username*/,
47 const char* /*password*/ );
49 static void setXEnv( const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv );
50 static css::uno::Reference< css::ucb::XCommandEnvironment> getXEnv();
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */