[Libreoffice-commits] core.git: Branch 'feature/gsoc14-libcmis2' - include/ucbhelper offapi/com offapi/UnoApi_offapi.mk ucbhelper/source
Mihai Varga
mihai.mv13 at gmail.com
Fri Aug 1 02:50:47 PDT 2014
include/ucbhelper/interactionrequest.hxx | 34 +++++++++++
offapi/UnoApi_offapi.mk | 1
offapi/com/sun/star/ucb/XInteractionAuthFallback.idl | 42 ++++++++++++++
ucbhelper/source/provider/interactionrequest.cxx | 56 +++++++++++++++++++
4 files changed, 133 insertions(+)
New commits:
commit 140937ccdf8e797f984e95242428402698aa54bb
Author: Mihai Varga <mihai.mv13 at gmail.com>
Date: Fri Aug 1 12:50:23 2014 +0300
OneDrive auth fallback dialog interaction continuation
Change-Id: I8dbb8dd96eef504cc7fb8d3b21ac9770ad421459
diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx
index a6d0447..3d894c9 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 */
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index e720630..38779f8 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3939,6 +3939,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/ucb,\
XFetchProvider \
XFetchProviderForContentAccess \
XFileIdentifierConverter \
+ XInteractionAuthFallback \
XInteractionHandlerSupplier \
XInteractionReplaceExistingData \
XInteractionSupplyAuthentication \
diff --git a/offapi/com/sun/star/ucb/XInteractionAuthFallback.idl b/offapi/com/sun/star/ucb/XInteractionAuthFallback.idl
new file mode 100644
index 0000000..0cb9038
--- /dev/null
+++ b/offapi/com/sun/star/ucb/XInteractionAuthFallback.idl
@@ -0,0 +1,42 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_task_XInteractionApprove_idl__
+#define __com_sun_star_task_XInteractionApprove_idl__
+
+#include <com/sun/star/task/XInteractionContinuation.idl>
+
+
+
+ module com { module sun { module star { module ucb {
+
+/** An interaction continuation specifying authentication success.
+ */
+published interface XInteractionAuthFallback: com::sun::star::task::XInteractionContinuation
+{
+ /* Authentication code submited by the user */
+ void setCode( [in] string code );
+ string getCode( );
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx
index 18f15e1..64bfacb 100644
--- a/ucbhelper/source/provider/interactionrequest.cxx
+++ b/ucbhelper/source/provider/interactionrequest.cxx
@@ -937,4 +937,60 @@ void SAL_CALL InteractionReplaceExistingData::select()
recordSelection();
}
+// InteractionAuthFallback Implementation
+
+// XInterface methods.
+
+// virtual
+void SAL_CALL InteractionAuthFallback::acquire()
+ throw()
+{
+ OWeakObject::acquire();
+}
+
+// virtual
+void SAL_CALL InteractionAuthFallback::release()
+ throw()
+{
+ OWeakObject::release();
+}
+
+// virtual
+uno::Any SAL_CALL
+InteractionAuthFallback::queryInterface( const uno::Type & rType )
+ throw ( uno::RuntimeException, std::exception )
+{
+ uno::Any aRet = cppu::queryInterface( rType,
+ static_cast< task::XInteractionContinuation * >( this ),
+ static_cast< ucb::XInteractionAuthFallback * >( this ));
+
+ return aRet.hasValue()
+ ? aRet : InteractionContinuation::queryInterface( rType );
+}
+
+// XInteractionContinuation methods.
+
+// virtual
+void SAL_CALL InteractionAuthFallback::select()
+ throw( uno::RuntimeException, std::exception )
+{
+ recordSelection();
+}
+
+// XInteractionAuthFallback methods
+
+// virtual
+void SAL_CALL InteractionAuthFallback::setCode( const OUString& code )
+ throw ( uno::RuntimeException, std::exception )
+{
+ m_aCode = code;
+}
+
+// virtual
+OUString SAL_CALL InteractionAuthFallback::getCode( )
+ throw ( uno::RuntimeException, std::exception )
+{
+ return m_aCode;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list