20#ifndef INCLUDED_FRAMEWORK_PREVENTDUPLICATEINTERACTION_HXX
21#define INCLUDED_FRAMEWORK_PREVENTDUPLICATEINTERACTION_HXX
25#include <com/sun/star/frame/Desktop.hpp>
26#include <com/sun/star/frame/TerminationVetoException.hpp>
27#include <com/sun/star/lang/XInitialization.hpp>
28#include <com/sun/star/task/XInteractionHandler2.hpp>
29#include <com/sun/star/task/XInteractionRequest.hpp>
40 class XComponentContext;
47 for (
vcl::Window *pChild = rTopLevel.
GetWindow(GetWindowType::FirstTopWindowChild); pChild; pChild = rTopLevel.
GetWindow(GetWindowType::NextTopWindowSibling))
81 virtual void SAL_CALL
disposing(
const css::lang::EventObject&)
override
90 throw css::frame::TerminationVetoException();
102 m_xWin->SetText(
"dialog parent for warning dialogs during load");
154 public ::cppu::WeakImplHelper<css::lang::XInitialization, css::task::XInteractionHandler2>
172 css::uno::Reference< css::task::XInteractionRequest >
m_xRequest;
187 css::uno::Reference< css::uno::XComponentContext >
m_xContext;
191 css::uno::Reference< css::task::XInteractionHandler >
m_xHandler;
204 virtual void SAL_CALL
initialize(
const css::uno::Sequence<css::uno::Any>& rArguments)
override;
216 virtual void SAL_CALL
handle(
const css::uno::Reference< css::task::XInteractionRequest >& xRequest)
override;
239 virtual css::uno::Any SAL_CALL
queryInterface(
const css::uno::Type& aType )
override;
273 void setHandler(
const css::uno::Reference< css::task::XInteractionHandler >& xHandler);
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static VclPtr< reference_type > Create(Arg &&... arg)
virtual void disposing(std::unique_lock< std::mutex > &)
Prevent us from showing the same interaction more than once during the same transaction.
std::vector< InteractionInfo > m_lInteractionRules
This list describe which and how incoming interactions must be handled.
std::unique_ptr< WarningDialogsParentScope > m_xWarningDialogsParent
css::uno::Reference< css::uno::XComponentContext > m_xContext
Used to create needed uno services at runtime.
bool getInteractionInfo(const css::uno::Type &aInteraction, PreventDuplicateInteraction::InteractionInfo *pReturn) const
return the info struct for the specified interaction.
virtual ~PreventDuplicateInteraction() override
dtor to free used memory.
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
virtual sal_Bool SAL_CALL handleInteractionRequest(const css::uno::Reference< css::task::XInteractionRequest > &xRequest) override
css::uno::Reference< css::task::XInteractionHandler > m_xHandler
The outside interaction handler, which is used to handle every incoming interaction,...
void useDefaultUUIHandler()
instead of setting an outside interaction handler, this method make sure the default UUI interaction ...
void addInteractionRule(const PreventDuplicateInteraction::InteractionInfo &aInteractionInfo)
add a new interaction to the list of interactions, which must be handled by this helper.
virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest > &xRequest) override
void setHandler(const css::uno::Reference< css::task::XInteractionHandler > &xHandler)
set the outside interaction handler, which must be used internally if the interaction will not be blo...
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
PreventDuplicateInteraction(css::uno::Reference< css::uno::XComponentContext > xContext)
ctor to guarantee right initialized instances of this class @descr It uses the given uno service mana...
~WarningDialogsParentScope()
css::uno::Reference< css::frame::XDesktop > m_xDesktop
const css::uno::Reference< css::awt::XWindow > & GetDialogParent() const
WarningDialogsParentScope(const css::uno::Reference< css::uno::XComponentContext > &rContext)
rtl::Reference< WarningDialogsParent > m_xListener
DECL_STATIC_LINK(WarningDialogsParent, TerminateDesktop, void *, void)
css::uno::Reference< css::awt::XWindow > m_xInterface
VclPtr< WorkWindow > m_xWin
virtual void SAL_CALL queryTermination(const css::lang::EventObject &) override
virtual void SAL_CALL notifyTermination(const css::lang::EventObject &) override
const css::uno::Reference< css::awt::XWindow > & GetDialogParent() const
void closewarningdialogs()
virtual ~WarningDialogsParent() override
virtual void SAL_CALL disposing(const css::lang::EventObject &) override
vcl::Window * GetWindow(GetWindowType nType) const
#define LINK(Instance, Class, Member)
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
void closedialogs(SystemWindow &rTopLevel, bool bCloseRoot)
sal_Int32 m_nCallCount
count how often this interaction was called.
sal_Int32 m_nMaxCount
after max count was reached this interaction will be blocked.
css::uno::Reference< css::task::XInteractionRequest > m_xRequest
hold the last intercepted request (matching the set interaction type) alive so it can be used for fur...
css::uno::Type m_aInteraction
describe the interaction.
InteractionInfo(const css::uno::Type &aInteraction)