summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMihai Varga <mihai.mv13@gmail.com>2014-07-31 11:33:02 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-16 09:29:09 +0100
commitd82976726b8f9f26f1c9bfbe199f57b147e71c65 (patch)
tree5f6efc6acf4a8529c786334eb7c02c7d350b0fa2 /include
parentda07f40189ca5b36826c2e135622974cc556000d (diff)
Authentication fallback request for the OneDrive connection
To fix build, also squashed in: Author: Mihai Varga <mihai.mv13@gmail.com> Date: Fri Aug 1 12:50:23 2014 +0300 OneDrive auth fallback dialog interaction continuation Change-Id: Id37f502217da3fde55ae93a6e1c01409509d657c (cherry picked from commit 4998e6a361252529cabcaac37b0f03bbed173544)
Diffstat (limited to 'include')
-rw-r--r--include/ucbhelper/authenticationfallback.hxx52
-rw-r--r--include/ucbhelper/interactionrequest.hxx34
2 files changed, 86 insertions, 0 deletions
diff --git a/include/ucbhelper/authenticationfallback.hxx b/include/ucbhelper/authenticationfallback.hxx
new file mode 100644
index 000000000000..5e7bb4732e2f
--- /dev/null
+++ b/include/ucbhelper/authenticationfallback.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_UCBHELPER_AUTHENTICATIONFALLBACK_HXX
+#define INCLUDED_UCBHELPER_AUTHENTICATIONFALLBACK_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include <ucbhelper/ucbhelperdllapi.h>
+#include <com/sun/star/ucb/AuthenticationFallbackRequest.hpp>
+
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple authentication interaction request used
+ * when programmatically authentication cannot succeed.
+ *
+ * Read-only values : instructions, url
+ * Read-write values: code
+ */
+class UCBHELPER_DLLPUBLIC AuthenticationFallbackRequest : public ucbhelper::InteractionRequest
+{
+private:
+ rtl::Reference< ucbhelper::InteractionAuthFallback > m_xAuthFallback;
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rInstructions instructions to be followed by the user
+ * @param rURL contains a URL for which authentication is requested.
+ */
+ AuthenticationFallbackRequest( const OUString & rInstructions,
+ const OUString & rURL );
+
+ const rtl::Reference< ucbhelper::InteractionAuthFallback >&
+ getAuthFallbackInter( ) const { return m_xAuthFallback; }
+
+};
+
+} // namespace ucbhelper
+
+#endif /* ! INCLUDED_UCBHELPER_AUTHENTICATIONFALLBACK_HXX*/
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx
index 84e0ca5f4694..213898353d12 100644
--- a/include/ucbhelper/interactionrequest.hxx
+++ b/include/ucbhelper/interactionrequest.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/task/XInteractionRetry.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/task/XInteractionDisapprove.hpp>
+#include <com/sun/star/ucb/XInteractionAuthFallback.hpp>
#include <com/sun/star/ucb/XInteractionReplaceExistingData.hpp>
#include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
#include <rtl/ref.hxx>
@@ -660,6 +661,39 @@ public:
throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
};
+class UCBHELPER_DLLPUBLIC InteractionAuthFallback:
+ public InteractionContinuation,
+ public com::sun::star::ucb::XInteractionAuthFallback
+{
+ OUString m_aCode;
+
+public:
+ InteractionAuthFallback( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual void SAL_CALL acquire()
+ throw() SAL_OVERRIDE;
+ virtual void SAL_CALL release()
+ throw() SAL_OVERRIDE;
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ // XAuthFallback
+ virtual void SAL_CALL setCode( const OUString& code )
+ throw (::css::uno::RuntimeException, ::std::exception);
+ virtual OUString SAL_CALL getCode()
+ throw (::css::uno::RuntimeException, ::std::exception);
+
+
+};
+
+
} // namespace ucbhelper
#endif /* ! INCLUDED_UCBHELPER_INTERACTIONREQUEST_HXX */