10#ifndef INCLUDED_SFX2_LOKHELPER_HXX
11#define INCLUDED_SFX2_LOKHELPER_HXX
22#include <rtl/strbuf.hxx>
23#include <rtl/string.hxx>
42 , meModifiers(eModifiers)
44 , mnModifier(nModifier)
48#include <boost/property_tree/ptree_fwd.hpp>
56 static std::unordered_map<OUString, css::uno::Reference<com::sun::star::ui::XAcceleratorConfiguration>>& getAcceleratorConfs();
63 static void destroyView(
int nId);
65 static void setView(
int nId);
67 static void setEditMode(
int nMode, vcl::ITiledRenderable* pDoc);
73 static std::size_t getViewsCount(
int nDocId);
75 static bool getViewIds(
int nDocId,
int* pArray,
size_t nSize);
79 static int getDocumentIdOfView(
int nViewId);
83 static void setViewLanguage(
int nId,
const OUString& rBcp47LanguageTag);
85 static void setDefaultLanguage(
const OUString& rBcp47LanguageTag);
87 static void setAccessibilityState(
int nId,
bool nEnabled);
91 static void setLoadLanguage(
const OUString& rBcp47LanguageTag);
93 static void setViewLocale(
int nId,
const OUString& rBcp47LanguageTag);
97 static void setDeviceFormFactor(std::u16string_view rDeviceFormFactor);
102 static void setDefaultTimezone(
bool isSet,
const OUString& rTimezone);
104 static std::pair<bool, OUString> getDefaultTimezone();
106 static void setViewTimezone(
int nId,
bool isSet,
const OUString& rTimezone);
108 static std::pair<bool, OUString> getViewTimezone(
int nId);
111 template<
typename ViewShellType,
typename FunctionType>
112 static void forEachOtherView(ViewShellType* pThisViewShell, FunctionType f);
115 static void notifyOtherViews(
const SfxViewShell* pThisView,
int nType, std::string_view rKey,
116 const OString& rPayload);
119 const boost::property_tree::ptree& rTree);
122 int nType, std::string_view rKey,
const OString& rPayload);
125 int nType,
const boost::property_tree::ptree& rTree);
132 std::u16string_view rAction,
133 const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>());
135 static void notifyDocumentSizeChanged(
SfxViewShell const* pThisView,
const OString& rPayload, vcl::ITiledRenderable* pDoc,
bool bInvalidateAll =
true);
137 static void notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc,
bool bInvalidateAll =
true);
139 static void notifyPartSizeChangedAllViews(vcl::ITiledRenderable* pDoc,
int nPart);
143 static void notifyAllViews(
int nType,
const OString& rPayload);
146 static void notifyContextChange(
const css::ui::ContextChangeEventObject& rEvent);
149 static void notifyViewRenderState(
SfxViewShell const* pViewShell, vcl::ITiledRenderable* pDoc);
160 static void notifyOtherViewsUpdatePerViewId(
SfxViewShell const* pViewShell,
int nType);
162 static OString makePayloadJSON(
const SfxViewShell* pThisView,
int nViewId, std::string_view rKey,
const OString& rPayload);
164 static OString makeVisCursorInvalidation(
int nViewId,
const OString& rRectangle,
165 bool bMispelledWord =
false,
const OString& rHyperlink =
"");
169 int nType,
int nCharCode,
int nKeyCode,
int nRepeat = 0);
173 int nType,
const OUString &rText);
183 static void dumpState(rtl::OStringBuffer &rState);
187 static bool testInPlaceComponentMouseEventHit(
SfxViewShell* pViewShell,
int nType,
int nX,
188 int nY,
int nCount,
int nButtons,
int nModifier,
189 double fScaleX,
double fScaleY,
190 bool bNegativeX =
false);
198template<
typename ViewShellType,
typename FunctionType>
204 auto pOtherViewShell =
dynamic_cast<ViewShellType*
>(pViewShell);
205 if (pOtherViewShell !=
nullptr && pOtherViewShell != pThisViewShell && pOtherViewShell->GetDocId() == pThisViewShell->GetDocId())
geometry::RealPoint2D maPosition
static void forEachOtherView(ViewShellType *pThisViewShell, FunctionType f)
Iterate over any view shell, except pThisViewShell, passing it to the f function.
One SfxViewShell more or less represents one edit window for a document, there can be multiple ones f...
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
COMPHELPER_DLLPUBLIC void setBlockedCommandList(const char *blockedCommandList)
css::uno::Reference< css::beans::XPropertySet > createView(const OUString &_sName, const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::beans::XPropertySet > &_xSourceObject)
SwView * getView(const uno::Reference< frame::XModel > &xModel)
void dumpState(rtl::OStringBuffer &rState)
std::optional< Point > maLogicPosition
MouseEventModifiers meModifiers
LokMouseEventData(int nType, Point aPosition, int nCount, MouseEventModifiers eModifiers, int nButtons, int nModifier)