LibreOffice Module sfx2 (master) 1
|
Prevent us from showing the same interaction more than once during the same transaction. More...
#include <preventduplicateinteraction.hxx>
Classes | |
struct | InteractionInfo |
Public Member Functions | |
virtual void SAL_CALL | initialize (const css::uno::Sequence< css::uno::Any > &rArguments) override |
virtual void SAL_CALL | handle (const css::uno::Reference< css::task::XInteractionRequest > &xRequest) override |
virtual sal_Bool SAL_CALL | handleInteractionRequest (const css::uno::Reference< css::task::XInteractionRequest > &xRequest) override |
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 manager to create the global generic UI interaction handler for later internal using. More... | |
virtual | ~PreventDuplicateInteraction () override |
dtor to free used memory. More... | |
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 blocked by the set list of rules. More... | |
void | useDefaultUUIHandler () |
instead of setting an outside interaction handler, this method make sure the default UUI interaction handler of the office is used. More... | |
void | addInteractionRule (const PreventDuplicateInteraction::InteractionInfo &aInteractionInfo) |
add a new interaction to the list of interactions, which must be handled by this helper. More... | |
bool | getInteractionInfo (const css::uno::Type &aInteraction, PreventDuplicateInteraction::InteractionInfo *pReturn) const |
return the info struct for the specified interaction. More... | |
Private Attributes | |
std::mutex | m_aLock |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
Used to create needed uno services at runtime. More... | |
css::uno::Reference< css::task::XInteractionHandler > | m_xHandler |
The outside interaction handler, which is used to handle every incoming interaction, if it's not blocked. More... | |
std::unique_ptr< WarningDialogsParentScope > | m_xWarningDialogsParent |
std::vector< InteractionInfo > | m_lInteractionRules |
This list describe which and how incoming interactions must be handled. More... | |
Prevent us from showing the same interaction more than once during the same transaction.
@descr Every interaction provided to this helper will be safed ... handled by the internal used UUIInteractionHandler (!) and never be handled a second time!
On the other side there exists some interactions, which allow a retry. So this helper allow to set a list of interactions combined with a retry value.
Definition at line 153 of file preventduplicateinteraction.hxx.
sfx2::PreventDuplicateInteraction::PreventDuplicateInteraction | ( | css::uno::Reference< css::uno::XComponentContext > | xContext | ) |
ctor to guarantee right initialized instances of this class @descr It uses the given uno service manager to create the global generic UI interaction handler for later internal using.
xSMGR | uno service manager for creating services internally |
@threadsafe not necessary
Definition at line 31 of file preventduplicateinteraction.cxx.
References m_xContext.
|
overridevirtual |
dtor to free used memory.
Definition at line 36 of file preventduplicateinteraction.cxx.
void sfx2::PreventDuplicateInteraction::addInteractionRule | ( | const PreventDuplicateInteraction::InteractionInfo & | aInteractionInfo | ) |
add a new interaction to the list of interactions, which must be handled by this helper.
@descr This method must be called immediately after a new instance of this helper was created. Without such list of InteractionRules, this instances does nothing! On the other side there is no possibility to remove rules. So the same instance can't be used within different transactions. It's a OneWay-object .-)
aInteractionInfo | describe the type of interaction, hos often it can be called etcpp. |
@threadsafe yes
Definition at line 164 of file preventduplicateinteraction.cxx.
References m_aLock, m_lInteractionRules, sfx2::PreventDuplicateInteraction::InteractionInfo::m_nCallCount, and sfx2::PreventDuplicateInteraction::InteractionInfo::m_nMaxCount.
bool sfx2::PreventDuplicateInteraction::getInteractionInfo | ( | const css::uno::Type & | aInteraction, |
PreventDuplicateInteraction::InteractionInfo * | pReturn | ||
) | const |
return the info struct for the specified interaction.
aInteraction | specify the interaction. |
pReturn | provides information about:
|
@threadsafe yes
Definition at line 183 of file preventduplicateinteraction.cxx.
References m_aLock, and m_lInteractionRules.
|
overridevirtual |
Definition at line 75 of file preventduplicateinteraction.cxx.
References m_aLock, m_lInteractionRules, sfx2::PreventDuplicateInteraction::InteractionInfo::m_nCallCount, sfx2::PreventDuplicateInteraction::InteractionInfo::m_nMaxCount, m_xHandler, and sfx2::PreventDuplicateInteraction::InteractionInfo::m_xRequest.
|
overridevirtual |
Definition at line 118 of file preventduplicateinteraction.cxx.
References m_aLock, m_lInteractionRules, sfx2::PreventDuplicateInteraction::InteractionInfo::m_nCallCount, sfx2::PreventDuplicateInteraction::InteractionInfo::m_nMaxCount, m_xHandler, and sfx2::PreventDuplicateInteraction::InteractionInfo::m_xRequest.
|
overridevirtual |
Definition at line 201 of file preventduplicateinteraction.cxx.
References m_xHandler, and m_xWarningDialogsParent.
|
overridevirtual |
Definition at line 63 of file preventduplicateinteraction.cxx.
References m_aLock, and m_xHandler.
void sfx2::PreventDuplicateInteraction::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 blocked by the set list of rules.
xHandler | the new interaction handler |
Definition at line 40 of file preventduplicateinteraction.cxx.
References m_aLock, m_xHandler, and m_xWarningDialogsParent.
void sfx2::PreventDuplicateInteraction::useDefaultUUIHandler | ( | ) |
instead of setting an outside interaction handler, this method make sure the default UUI interaction handler of the office is used.
Definition at line 49 of file preventduplicateinteraction.cxx.
References m_aLock, m_xContext, m_xHandler, and m_xWarningDialogsParent.
|
mutableprivate |
Definition at line 156 of file preventduplicateinteraction.hxx.
Referenced by addInteractionRule(), getInteractionInfo(), handle(), handleInteractionRequest(), queryInterface(), setHandler(), and useDefaultUUIHandler().
|
private |
This list describe which and how incoming interactions must be handled.
Further it contains all collected information after this interaction object was used.
Definition at line 198 of file preventduplicateinteraction.hxx.
Referenced by addInteractionRule(), getInteractionInfo(), handle(), and handleInteractionRequest().
|
private |
Used to create needed uno services at runtime.
Definition at line 187 of file preventduplicateinteraction.hxx.
Referenced by useDefaultUUIHandler().
|
private |
The outside interaction handler, which is used to handle every incoming interaction, if it's not blocked.
Definition at line 191 of file preventduplicateinteraction.hxx.
Referenced by handle(), handleInteractionRequest(), initialize(), queryInterface(), setHandler(), and useDefaultUUIHandler().
|
private |
Definition at line 193 of file preventduplicateinteraction.hxx.
Referenced by initialize(), setHandler(), and useDefaultUUIHandler().