summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-04-14 12:09:38 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-04-23 08:31:18 +0200
commitc257a5d0ec204d926239e2f1b2bcc50d511aea2b (patch)
tree8719fccbfba7189d98d004087f550aed622b41f3 /include
parenta62325fd06777b188b84d8e6df94a79a1fbbbade (diff)
jsdialog: handle formulabar as textinput
mostly boilerplate code jsdialog changes: - added force parameter to sendAction - added support for key press/release and command events - moved ActionDataMap to jsdialog namespace for sharing formulabar changes: - added calls to send jsdialog messages with formula - added cursor moving support - on command event Change-Id: I714715133901941ba0758655e2d5907a3bae79f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133010 Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/jsdialog/executor.hxx24
-rw-r--r--include/vcl/weld.hxx2
2 files changed, 26 insertions, 0 deletions
diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx
index 0f8fb821e2bd..6e388a6a3f79 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -12,6 +12,7 @@
#include <vcl/dllapi.h>
#include <vcl/uitest/uiobject.hxx>
#include <vcl/weld.hxx>
+#include <unordered_map>
class LOKTrigger
{
@@ -56,13 +57,36 @@ public:
}
static void trigger_closed(weld::Popover& rPopover) { rPopover.popdown(); }
+
+ static void trigger_key_press(weld::Widget& rWidget, const KeyEvent& rEvent)
+ {
+ rWidget.m_aKeyPressHdl.Call(rEvent);
+ }
+
+ static void trigger_key_release(weld::Widget& rWidget, const KeyEvent& rEvent)
+ {
+ rWidget.m_aKeyReleaseHdl.Call(rEvent);
+ }
+
+ static void command(weld::DrawingArea& rArea, const CommandEvent& rCmd)
+ {
+ rArea.m_aCommandHdl.Call(rCmd);
+ }
};
namespace jsdialog
{
+// type used to store key-value pairs to put in the generated messages
+typedef std::unordered_map<std::string, OUString> ActionDataMap;
+
+/// execute action on a widget
VCL_DLLPUBLIC bool ExecuteAction(const std::string& nWindowId, const OString& rWidget,
StringMap& rData);
+/// send full update message to the client
VCL_DLLPUBLIC void SendFullUpdate(const std::string& nWindowId, const OString& rWidget);
+/// send action message to the client
+VCL_DLLPUBLIC void SendAction(const std::string& nWindowId, const OString& rWidget,
+ std::unique_ptr<ActionDataMap> pData);
VCL_DLLPUBLIC StringMap jsonToStringMap(const char* pJSON);
};
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 561baaaa256b..5fab9b459a8b 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -79,6 +79,8 @@ class DialogController;
class VCL_DLLPUBLIC Widget
{
+ friend class ::LOKTrigger;
+
protected:
Link<Widget&, void> m_aFocusInHdl;
Link<Widget&, void> m_aFocusOutHdl;