LibreOffice Module sfx2 (master) 1
|
#include <lokhelper.hxx>
Static Public Member Functions | |
static std::unordered_map< OUString, css::uno::Reference< com::sun::star::ui::XAcceleratorConfiguration > > & | getAcceleratorConfs () |
Gets the short cut accelerators. More... | |
static int | createView () |
Create a new view shell from the current view frame. More... | |
static int | createView (int nDocId) |
Create a new view shell for the given DocId, for multi-document support. More... | |
static void | destroyView (int nId) |
Destroy a view shell from the global shell list. More... | |
static void | setView (int nId) |
Set a view shell as current one. More... | |
static void | setEditMode (int nMode, vcl::ITiledRenderable *pDoc) |
Set the edit mode for a document with callbacks disabled. More... | |
static SfxViewShell * | getViewOfId (int nId) |
Get view shell with id. More... | |
static int | getView (const SfxViewShell *pViewShell=nullptr) |
Get the currently active view. More... | |
static std::size_t | getViewsCount (int nDocId) |
Get the number of views of the current DocId. More... | |
static bool | getViewIds (int nDocId, int *pArray, size_t nSize) |
Get viewIds of views of the current DocId. More... | |
static void | setBlockedCommandList (int nViewId, const char *blockedCommandList) |
Set View Blocked for some uno commands. More... | |
static int | getDocumentIdOfView (int nViewId) |
Get the document id for a view. More... | |
static const LanguageTag & | getDefaultLanguage () |
Get the default language that should be used for views. More... | |
static void | setViewLanguage (int nId, const OUString &rBcp47LanguageTag) |
Set language of the given view. More... | |
static void | setDefaultLanguage (const OUString &rBcp47LanguageTag) |
Set the default language for views. More... | |
static void | setAccessibilityState (int nId, bool nEnabled) |
Enable/Disable AT support for the given view. More... | |
static const LanguageTag & | getLoadLanguage () |
Get the language used by the loading view (used for all save operations). More... | |
static void | setLoadLanguage (const OUString &rBcp47LanguageTag) |
Set the language used by the loading view (used for all save operations). More... | |
static void | setViewLocale (int nId, const OUString &rBcp47LanguageTag) |
Set the locale for the given view. More... | |
static LOKDeviceFormFactor | getDeviceFormFactor () |
Get the device form factor that should be used for a new view. More... | |
static void | setDeviceFormFactor (std::u16string_view rDeviceFormFactor) |
Set the device form factor that should be used for a new view. More... | |
static void | setDefaultTimezone (bool isSet, const OUString &rTimezone) |
Set timezone of the given view. More... | |
static std::pair< bool, OUString > | getDefaultTimezone () |
Get timezone of the given view. See @setDefaultTimezone. More... | |
static void | setViewTimezone (int nId, bool isSet, const OUString &rTimezone) |
Set the timezone of the given view. More... | |
static std::pair< bool, OUString > | getViewTimezone (int nId) |
Get the timezone of the given view. More... | |
template<typename ViewShellType , typename FunctionType > | |
static void | forEachOtherView (ViewShellType *pThisViewShell, FunctionType f) |
Iterate over any view shell, except pThisViewShell, passing it to the f function. More... | |
static void | notifyOtherViews (const SfxViewShell *pThisView, int nType, std::string_view rKey, const OString &rPayload) |
Invoke the LOK callback of all other views showing the same document as pThisView, with a payload of rKey-rPayload. More... | |
static void | notifyOtherViews (const SfxViewShell *pThisView, int nType, const boost::property_tree::ptree &rTree) |
Invoke the LOK callback of all views except pThisView, with a JSON payload created from the given property tree. More... | |
static void | notifyOtherView (const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, std::string_view rKey, const OString &rPayload) |
Same as notifyOtherViews(), but works on a selected "other" view, not on all of them. More... | |
static void | notifyOtherView (const SfxViewShell *pThisView, SfxViewShell const *pOtherView, int nType, const boost::property_tree::ptree &rTree) |
Same as notifyOtherViews(), the property-tree version, but works on a selected "other" view, not on all of them. More... | |
static void | sendUnoStatus (const SfxViewShell *pShell, const SfxPoolItem *pItem) |
Emits a LOK_CALLBACK_STATE_CHANGED. More... | |
static void | notifyWindow (const SfxViewShell *pThisView, vcl::LOKWindowId nWindowId, std::u16string_view rAction, const std::vector< vcl::LOKPayloadItem > &rPayload=std::vector< vcl::LOKPayloadItem >()) |
Emits a LOK_CALLBACK_WINDOW. More... | |
static void | notifyDocumentSizeChanged (SfxViewShell const *pThisView, const OString &rPayload, vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true) |
Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED - if @bInvalidateAll - first invalidates all parts. More... | |
static void | notifyDocumentSizeChangedAllViews (vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true) |
Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document - if @bInvalidateAll - first invalidates all parts. More... | |
static void | notifyPartSizeChangedAllViews (vcl::ITiledRenderable *pDoc, int nPart) |
Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document with the same part. More... | |
static void | notifyInvalidation (SfxViewShell const *pThisView, tools::Rectangle const *) |
Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed. More... | |
static void | notifyAllViews (int nType, const OString &rPayload) |
Notifies all views with the given type and payload. More... | |
static void | notifyContextChange (const css::ui::ContextChangeEventObject &rEvent) |
Notify about the editing context change. More... | |
static void | notifyViewRenderState (SfxViewShell const *pViewShell, vcl::ITiledRenderable *pDoc) |
Emits an LOK_CALLBACK_VIEW_RENDER_STATE. More... | |
static void | notifyUpdate (SfxViewShell const *pViewShell, int nType) |
static void | notifyUpdatePerViewId (SfxViewShell const *pViewShell, int nType) |
static void | notifyUpdatePerViewId (SfxViewShell const *pTargetShell, SfxViewShell const *pViewShell, SfxViewShell const *pSourceShell, int nType) |
Same as notifyUpdatePerViewId(), pTargetShell will be notified, relevant viewId in pViewShell, pSourceView->getLOKPayload() will be called to get the data. More... | |
static void | notifyOtherViewsUpdatePerViewId (SfxViewShell const *pViewShell, int nType) |
static OString | makePayloadJSON (const SfxViewShell *pThisView, int nViewId, std::string_view rKey, const OString &rPayload) |
static OString | makeVisCursorInvalidation (int nViewId, const OString &rRectangle, bool bMispelledWord=false, const OString &rHyperlink="") |
Makes a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR payload, but tweaks it according to setOptionalFeatures() if needed. More... | |
static void | postKeyEventAsync (const VclPtr< vcl::Window > &xWindow, int nType, int nCharCode, int nKeyCode, int nRepeat=0) |
Helper for posting async key event. More... | |
static void | postExtTextEventAsync (const VclPtr< vcl::Window > &xWindow, int nType, const OUString &rText) |
Helper for posting input event. More... | |
static void | postMouseEventAsync (const VclPtr< vcl::Window > &xWindow, LokMouseEventData const &rLokMouseEventData) |
Helper for posting async mouse event. More... | |
static void | dumpState (rtl::OStringBuffer &rState) |
Helper for diagnosing run-time problems. More... | |
static bool | testInPlaceComponentMouseEventHit (SfxViewShell *pViewShell, int nType, int nX, int nY, int nCount, int nButtons, int nModifier, double fScaleX, double fScaleY, bool bNegativeX=false) |
Process the mouse event in the currently active in-place component (if any). More... | |
static VclPtr< vcl::Window > | getInPlaceDocWindow (SfxViewShell *pViewShell) |
Static Public Attributes | |
static const tools::Long | MaxTwips = 1e9 |
A special value to signify 'infinity'. More... | |
Static Private Member Functions | |
static int | createView (SfxViewFrame &rViewFrame, ViewShellDocId docId) |
Definition at line 52 of file lokhelper.hxx.
|
static |
Create a new view shell from the current view frame.
This assumes a single document is ever loaded.
Definition at line 98 of file lokhelper.cxx.
References createView(), SfxViewShell::Current(), SfxViewShell::GetDocId(), and SfxViewShell::GetViewFrame().
Referenced by createView().
Create a new view shell for the given DocId, for multi-document support.
Definition at line 115 of file lokhelper.cxx.
References createView(), SfxApplication::Get(), and SfxApplication::GetViewShells_Impl().
|
staticprivate |
Definition at line 83 of file lokhelper.cxx.
References SfxViewShell::Current(), SfxViewFrame::ExecView_Impl(), SfxViewShell::GetDocId(), SfxViewShell::GetViewShellId(), and SfxViewShell::SetCurrentDocId().
|
static |
Destroy a view shell from the global shell list.
Definition at line 139 of file lokhelper.cxx.
References SfxViewFrame::Exec_Impl(), SfxApplication::Get(), SfxApplication::GetViewShells_Impl(), and nId.
|
static |
Helper for diagnosing run-time problems.
Definition at line 961 of file lokhelper.cxx.
References SfxViewShell::Current(), SfxViewShell::dumpLibreOfficeKitViewState(), o3tl::strong_int< typename UNDERLYING_TYPE, typename PHANTOM_TYPE >::get(), SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), and getViewsCount().
|
static |
Iterate over any view shell, except pThisViewShell, passing it to the f function.
Definition at line 199 of file lokhelper.hxx.
References SfxViewShell::GetFirst(), and SfxViewShell::GetNext().
|
static |
Gets the short cut accelerators.
Definition at line 110 of file lokhelper.cxx.
References SfxApplication::GetAcceleratorConfs_Impl(), and SfxApplication::GetOrCreate().
|
static |
Get the default language that should be used for views.
Definition at line 285 of file lokhelper.cxx.
Referenced by SfxViewShell::SfxViewShell().
|
static |
Get timezone of the given view. See @setDefaultTimezone.
Definition at line 367 of file lokhelper.cxx.
Referenced by SfxViewShell::SfxViewShell().
|
static |
Get the device form factor that should be used for a new view.
Definition at line 344 of file lokhelper.cxx.
Referenced by SfxViewShell::SfxViewShell().
Get the document id for a view.
Definition at line 273 of file lokhelper.cxx.
References SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), and SfxViewShell::GetViewShellId().
|
static |
Definition at line 1016 of file lokhelper.cxx.
|
static |
Get the language used by the loading view (used for all save operations).
Definition at line 295 of file lokhelper.cxx.
Referenced by SfxObjectShell::SaveAsOwnFormat().
|
static |
Get the currently active view.
Definition at line 213 of file lokhelper.cxx.
References SfxViewShell::Current(), and SfxViewShell::GetViewShellId().
Referenced by lcl_generateJSON(), notifyOtherView(), notifyOtherViews(), notifyOtherViewsUpdatePerViewId(), and notifyUpdatePerViewId().
Get viewIds of views of the current DocId.
Definition at line 245 of file lokhelper.cxx.
References SfxApplication::Get(), SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), SfxViewShell::GetViewShellId(), and n.
|
static |
Get view shell with id.
Definition at line 196 of file lokhelper.cxx.
References SfxApplication::Get(), SfxApplication::GetViewShells_Impl(), and nId.
Referenced by setBlockedCommandList().
|
static |
Get the number of views of the current DocId.
Definition at line 224 of file lokhelper.cxx.
References SfxApplication::Get(), SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), and n.
Referenced by dumpState().
|
static |
Get the timezone of the given view.
Definition at line 386 of file lokhelper.cxx.
References SfxApplication::GetViewShells_Impl(), nId, and SfxGetpApp().
|
static |
Definition at line 535 of file lokhelper.cxx.
References lcl_generateJSON().
|
static |
Makes a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR payload, but tweaks it according to setOptionalFeatures() if needed.
Definition at line 676 of file lokhelper.cxx.
References comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation().
|
static |
Notifies all views with the given type and payload.
Definition at line 693 of file lokhelper.cxx.
References SfxViewShell::Current(), SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), SfxViewShell::libreOfficeKitViewCallback(), and nType.
Referenced by SfxClipboardChangeListener::ChangedContents().
|
static |
Notify about the editing context change.
Definition at line 711 of file lokhelper.cxx.
References aBuffer, SfxViewShell::Get(), and SfxViewShell::libreOfficeKitViewCallback().
Referenced by sfx2::sidebar::ContextChangeBroadcaster::BroadcastContextChange().
|
static |
Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED - if @bInvalidateAll - first invalidates all parts.
Definition at line 623 of file lokhelper.cxx.
References SfxViewShell::getEditMode(), i, SfxViewShell::libreOfficeKitViewCallback(), and SfxViewShell::libreOfficeKitViewInvalidateTilesCallback().
Referenced by notifyDocumentSizeChangedAllViews(), and notifyPartSizeChangedAllViews().
|
static |
Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document - if @bInvalidateAll - first invalidates all parts.
Definition at line 640 of file lokhelper.cxx.
References SfxViewShell::Current(), SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), and notifyDocumentSizeChanged().
|
static |
Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
Definition at line 612 of file lokhelper.cxx.
References SfxViewShell::getEditMode(), SfxViewShell::getPart(), comphelper::LibreOfficeKit::isPartInInvalidation(), and SfxViewShell::libreOfficeKitViewInvalidateTilesCallback().
Referenced by SfxViewShell::notifyInvalidation().
|
static |
Same as notifyOtherViews(), the property-tree version, but works on a selected "other" view, not on all of them.
Definition at line 462 of file lokhelper.cxx.
References getView(), lcl_generateJSON(), SfxViewShell::libreOfficeKitViewCallbackWithViewId(), and nType.
|
static |
Same as notifyOtherViews(), but works on a selected "other" view, not on all of them.
Definition at line 450 of file lokhelper.cxx.
References getView(), lcl_generateJSON(), SfxViewShell::libreOfficeKitViewCallbackWithViewId(), and nType.
Referenced by SfxViewShell::NotifyOtherView().
|
static |
Invoke the LOK callback of all views except pThisView, with a JSON payload created from the given property tree.
Definition at line 504 of file lokhelper.cxx.
References SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), getView(), lcl_generateJSON(), SfxViewShell::libreOfficeKitViewCallbackWithViewId(), and nType.
|
static |
Invoke the LOK callback of all other views showing the same document as pThisView, with a payload of rKey-rPayload.
Definition at line 473 of file lokhelper.cxx.
References SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), getView(), lcl_generateJSON(), SfxViewShell::libreOfficeKitViewCallbackWithViewId(), and nType.
Referenced by SfxViewShell::NotifyOtherViews().
|
static |
Definition at line 751 of file lokhelper.cxx.
References SfxViewShell::GetDocId(), SfxViewShell::GetFirst(), SfxViewShell::GetNext(), getView(), SfxViewShell::libreOfficeKitViewUpdatedCallbackPerViewId(), and nType.
|
static |
Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same document with the same part.
Definition at line 662 of file lokhelper.cxx.
References SfxViewShell::GetFirst(), SfxViewShell::GetNext(), SfxViewShell::getPart(), and notifyDocumentSizeChanged().
|
static |
Definition at line 727 of file lokhelper.cxx.
References SfxViewShell::libreOfficeKitViewUpdatedCallback(), and nType.
|
static |
Same as notifyUpdatePerViewId(), pTargetShell will be notified, relevant viewId in pViewShell, pSourceView->getLOKPayload() will be called to get the data.
Definition at line 740 of file lokhelper.cxx.
References getView(), SfxViewShell::libreOfficeKitViewUpdatedCallbackPerViewId(), and nType.
|
static |
Definition at line 735 of file lokhelper.cxx.
References notifyUpdatePerViewId(), and nType.
Referenced by notifyUpdatePerViewId().
|
static |
Emits an LOK_CALLBACK_VIEW_RENDER_STATE.
Definition at line 578 of file lokhelper.cxx.
References SfxViewShell::libreOfficeKitViewCallback().
|
static |
Emits a LOK_CALLBACK_WINDOW.
Definition at line 583 of file lokhelper.cxx.
References SfxViewShell::libreOfficeKitViewCallback(), and OUStringToOString().
Referenced by SfxViewShell::notifyWindow().
|
static |
|
static |
Helper for posting async mouse event.
Definition at line 929 of file lokhelper.cxx.
References LokMouseEventData::maLogicPosition, LokMouseEventData::maPosition, LokMouseEventData::meModifiers, LokMouseEventData::mnButtons, LokMouseEventData::mnCount, LokMouseEventData::mnModifier, and LokMouseEventData::mnType.
Referenced by LokControlHandler::postMouseEvent(), LokStarMathHelper::postMouseEvent(), and LokChartHelper::postMouseEvent().
|
static |
Emits a LOK_CALLBACK_STATE_CHANGED.
Definition at line 559 of file lokhelper.cxx.
References SfxPoolItem::dumpAsJSON(), INVALID_POOL_ITEM, SfxViewShell::libreOfficeKitViewCallback(), and SfxPoolItem::Which().
Referenced by InterceptLOKStateChangeEvent().
|
static |
Enable/Disable AT support for the given view.
Definition at line 316 of file lokhelper.cxx.
References SfxApplication::GetViewShells_Impl(), nId, and SfxGetpApp().
|
static |
Set View Blocked for some uno commands.
Definition at line 898 of file lokhelper.cxx.
References getViewOfId(), and SfxViewShell::setBlockedCommandList().
|
static |
Set the default language for views.
Definition at line 290 of file lokhelper.cxx.
|
static |
Set timezone of the given view.
@isSet true to use @rTimezone, even if it's empty. Otherwise, no timezone. @rTimezone the value to set (which could be empty).
Definition at line 361 of file lokhelper.cxx.
|
static |
|
static |
Set the edit mode for a document with callbacks disabled.
Definition at line 133 of file lokhelper.cxx.
|
static |
Set the language used by the loading view (used for all save operations).
Definition at line 297 of file lokhelper.cxx.
|
static |
Set a view shell as current one.
Definition at line 161 of file lokhelper.cxx.
References SfxViewShell::Current(), SfxApplication::Get(), SfxViewFrame::GetFrame(), SfxFrame::GetFrameInterface(), comphelper::getProcessComponentContext(), SfxApplication::GetViewShells_Impl(), SfxViewFrame::MakeActive_Impl(), nId, comphelper::LibreOfficeKit::setLanguageTag(), comphelper::LibreOfficeKit::setLocale(), and xFrame.
|
static |
Set language of the given view.
Definition at line 302 of file lokhelper.cxx.
References SfxApplication::GetViewShells_Impl(), nId, and SfxGetpApp().
|
static |
Set the locale for the given view.
Definition at line 330 of file lokhelper.cxx.
References SfxApplication::GetViewShells_Impl(), nId, and SfxGetpApp().
|
static |
Set the timezone of the given view.
Definition at line 372 of file lokhelper.cxx.
References SfxApplication::GetViewShells_Impl(), nId, and SfxGetpApp().
|
static |
Process the mouse event in the currently active in-place component (if any).
Returns true if the event has been processed, and no further processing is necessary.
Definition at line 986 of file lokhelper.cxx.
References LokChartHelper::HitAny(), nCount, nType, LokStarMathHelper::postMouseEvent(), and LokChartHelper::postMouseEvent().
|
static |
A special value to signify 'infinity'.
This value is chosen such that sal_Int32 will not overflow when manipulated.
Definition at line 180 of file lokhelper.hxx.