enable route to get ParentWindow from an existing UUIInteractionHelper
Change-Id: I550f99fa4a5db41cdad0b4d60ca02866835d7ae2
This commit is contained in:
@@ -74,10 +74,10 @@ typedef std::unordered_map< OUString, OUString > StringHashMap;
|
|||||||
class UUIInteractionHelper
|
class UUIInteractionHelper
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
css::uno::Reference< css::awt::XWindow > m_xWindowParam;
|
css::uno::Reference< css::awt::XWindow > m_xWindowParam;
|
||||||
const OUString m_aContextParam;
|
const OUString m_aContextParam;
|
||||||
StringHashMap m_aTypedCustomHandlers;
|
StringHashMap m_aTypedCustomHandlers;
|
||||||
UUIInteractionHelper(UUIInteractionHelper const &) = delete;
|
UUIInteractionHelper(UUIInteractionHelper const &) = delete;
|
||||||
UUIInteractionHelper& operator =(UUIInteractionHelper const &) = delete;
|
UUIInteractionHelper& operator =(UUIInteractionHelper const &) = delete;
|
||||||
|
|
||||||
@@ -89,6 +89,9 @@ public:
|
|||||||
explicit UUIInteractionHelper(
|
explicit UUIInteractionHelper(
|
||||||
css::uno::Reference< css::uno::XComponentContext > const & rxContext);
|
css::uno::Reference< css::uno::XComponentContext > const & rxContext);
|
||||||
|
|
||||||
|
css::uno::Reference<css::awt::XWindow> GetParentWindow() const { return m_xWindowParam; }
|
||||||
|
void SetParentWindow(css::uno::Reference<css::awt::XWindow>& rWindow) { m_xWindowParam = rWindow; }
|
||||||
|
|
||||||
~UUIInteractionHelper();
|
~UUIInteractionHelper();
|
||||||
|
|
||||||
bool handleRequest( css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
|
bool handleRequest( css::uno::Reference< css::task::XInteractionRequest > const & rRequest);
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
|
|
||||||
#include <com/sun/star/awt/XWindow.hpp>
|
#include <com/sun/star/awt/XWindow.hpp>
|
||||||
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
|
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
@@ -38,9 +39,10 @@ using namespace com::sun::star;
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class UUIInteractionHandler:
|
class UUIInteractionHandler:
|
||||||
public cppu::WeakImplHelper< css::lang::XServiceInfo,
|
public cppu::WeakImplHelper<css::lang::XServiceInfo,
|
||||||
css::lang::XInitialization,
|
css::lang::XInitialization,
|
||||||
css::task::XInteractionHandler2 >
|
css::task::XInteractionHandler2,
|
||||||
|
css::beans::XPropertySet>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<UUIInteractionHelper> m_pImpl;
|
std::unique_ptr<UUIInteractionHelper> m_pImpl;
|
||||||
@@ -69,6 +71,58 @@ public:
|
|||||||
handleInteractionRequest(
|
handleInteractionRequest(
|
||||||
const css::uno::Reference< css::task::XInteractionRequest >& Request
|
const css::uno::Reference< css::task::XInteractionRequest >& Request
|
||||||
) override;
|
) override;
|
||||||
|
|
||||||
|
virtual void SAL_CALL
|
||||||
|
addPropertyChangeListener( const OUString& /*aPropertyName*/, const css::uno::Reference< css::beans::XPropertyChangeListener >& /*xListener*/ ) override
|
||||||
|
{
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SAL_CALL
|
||||||
|
removePropertyChangeListener( const OUString& /*aPropertyName*/, const css::uno::Reference< css::beans::XPropertyChangeListener >& /*xListener*/ ) override
|
||||||
|
{
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SAL_CALL
|
||||||
|
addVetoableChangeListener( const OUString& /*aPropertyName*/, const css::uno::Reference< css::beans::XVetoableChangeListener >& /*xListener*/ ) override
|
||||||
|
{
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SAL_CALL
|
||||||
|
removeVetoableChangeListener( const OUString& /*aPropertyName*/, const css::uno::Reference< css::beans::XVetoableChangeListener >& /*xListener*/ ) override
|
||||||
|
{
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
|
||||||
|
getPropertySetInfo() override
|
||||||
|
{
|
||||||
|
assert(false);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void SAL_CALL setPropertyValue(const OUString& rPropertyName, const css::uno::Any& rValue) override
|
||||||
|
{
|
||||||
|
if (rPropertyName == "ParentWindow")
|
||||||
|
{
|
||||||
|
css::uno::Reference<css::awt::XWindow> xWindow;
|
||||||
|
rValue >>= xWindow;
|
||||||
|
m_pImpl->SetParentWindow(xWindow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw css::beans::UnknownPropertyException();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& rPropertyName) override
|
||||||
|
{
|
||||||
|
if (rPropertyName == "ParentWindow")
|
||||||
|
{
|
||||||
|
return uno::Any(m_pImpl->GetParentWindow());
|
||||||
|
}
|
||||||
|
throw css::beans::UnknownPropertyException();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
UUIInteractionHandler::UUIInteractionHandler(
|
UUIInteractionHandler::UUIInteractionHandler(
|
||||||
|
Reference in New Issue
Block a user