LibreOffice Module framework (master) 1
|
internal helper to bind e.g. More...
#include <windowcommanddispatch.hxx>
Public Member Functions | |
WindowCommandDispatch (css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< css::frame::XFrame > &xFrame) | |
creates a new instance and initialize it with all necessary parameters. More... | |
~WindowCommandDispatch () | |
used to free internal resources. More... | |
Private Member Functions | |
void | impl_startListening () |
establish all listener connections we need. More... | |
void | impl_stopListening () |
drop all listener connections we need. More... | |
DECL_LINK (impl_notifyCommand, VclWindowEvent &, void) | |
callback from VCL to notify new commands More... | |
Private Attributes | |
std::mutex | m_mutex |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
can be used to create own needed services on demand. More... | |
css::uno::WeakReference< css::frame::XFrame > | m_xFrame |
knows the frame, where we dispatch our commands as weak reference More... | |
css::uno::WeakReference< css::awt::XWindow > | m_xWindow |
knows the VCL window (where the hard coded commands occurred) as weak XWindow reference More... | |
internal helper to bind e.g.
MAC-Menu events to our internal dispatch API.
@descr On e.g. MAC platform system menus are merged together with some fix entries as e.g. "Pereferences" or "About". These menu entries trigger hard coded commands. Here we map these commands to the right URLs and dispatch them.
This helper knows a frame and its container window (where VCL provide the hard coded commands). We hold those objects weak so there is no need to react for complex UNO dispose/ing() scenarios. On the other side VCL does not hold us alive (because it doesn't know our UNO reference). So we register at the VCL level as an event listener and
Definition at line 47 of file windowcommanddispatch.hxx.
framework::WindowCommandDispatch::WindowCommandDispatch | ( | css::uno::Reference< css::uno::XComponentContext > | xContext, |
const css::uno::Reference< css::frame::XFrame > & | xFrame | ||
) |
creates a new instance and initialize it with all necessary parameters.
@descr Every instance of such MACDispatch can be used for the specified context only. Means: 1 MACDispatch object is bound to 1 Frame/Window pair in which context the detected commands will be executed.
xContext | will be used to create own needed services on demand. |
xFrame | used as for new detected commands. |
Definition at line 36 of file windowcommanddispatch.cxx.
References impl_startListening(), m_xFrame, and xFrame.
framework::WindowCommandDispatch::~WindowCommandDispatch | ( | ) |
used to free internal resources.
Definition at line 45 of file windowcommanddispatch.cxx.
References impl_stopListening(), and m_xContext.
|
private |
callback from VCL to notify new commands
|
private |
establish all listener connections we need.
@descr Those listener connections will be created one times only (see ctor). Afterwards we listen for incoming events till our referred frame/window pair will be closed.
Definition at line 51 of file windowcommanddispatch.cxx.
References VCLUnoHelper::GetWindow(), LINK, m_mutex, and m_xWindow.
Referenced by WindowCommandDispatch().
|
private |
drop all listener connections we need.
Definition at line 71 of file windowcommanddispatch.cxx.
References VCLUnoHelper::GetWindow(), LINK, m_mutex, and m_xWindow.
Referenced by ~WindowCommandDispatch().
|
private |
Definition at line 50 of file windowcommanddispatch.hxx.
Referenced by impl_startListening(), and impl_stopListening().
|
private |
can be used to create own needed services on demand.
Definition at line 53 of file windowcommanddispatch.hxx.
Referenced by ~WindowCommandDispatch().
|
private |
knows the frame, where we dispatch our commands as weak reference
Definition at line 56 of file windowcommanddispatch.hxx.
|
private |
knows the VCL window (where the hard coded commands occurred) as weak XWindow reference
Definition at line 59 of file windowcommanddispatch.hxx.
Referenced by impl_startListening(), and impl_stopListening().