LibreOffice Module vcl (master) 1
executor.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#pragma once
11
12#include <vcl/dllapi.h>
14#include <vcl/weld.hxx>
15#include <unordered_map>
16
18{
19public:
20 static void trigger_changed(weld::TextView& rView) { rView.signal_changed(); }
21
22 static void trigger_changed(weld::Entry& rEdit) { rEdit.signal_changed(); }
23
24 static void trigger_changed(weld::ComboBox& rComboBox) { rComboBox.signal_changed(); }
25
26 static void trigger_changed(weld::TreeView& rTreeView) { rTreeView.signal_changed(); }
27
28 static void trigger_changed(weld::IconView& rIconView) { rIconView.signal_selection_changed(); }
29
30 static void trigger_toggled(weld::Toggleable& rButton) { rButton.signal_toggled(); }
31
32 static void trigger_row_activated(weld::TreeView& rTreeView)
33 {
34 rTreeView.signal_row_activated();
35 }
36
37 static void trigger_item_activated(weld::IconView& rIconView)
38 {
39 rIconView.signal_item_activated();
40 }
41
42 static void trigger_clicked(weld::Toolbar& rToolbar, const OString& rIdent)
43 {
44 rToolbar.signal_clicked(rIdent);
45 }
46
47 static void trigger_clicked(weld::Button& rButton) { rButton.signal_clicked(); }
48
49 static void trigger_click(weld::DrawingArea& rDrawingArea, const Point& rPos)
50 {
51 rDrawingArea.click(rPos);
52 }
53
54 static void trigger_value_changed(weld::SpinButton& rSpinButton)
55 {
56 rSpinButton.signal_value_changed();
57 }
58
59 static void trigger_closed(weld::Popover& rPopover) { rPopover.popdown(); }
60
61 static void trigger_key_press(weld::Widget& rWidget, const KeyEvent& rEvent)
62 {
63 rWidget.m_aKeyPressHdl.Call(rEvent);
64 }
65
66 static void trigger_key_release(weld::Widget& rWidget, const KeyEvent& rEvent)
67 {
68 rWidget.m_aKeyReleaseHdl.Call(rEvent);
69 }
70
71 static void command(weld::DrawingArea& rArea, const CommandEvent& rCmd)
72 {
73 rArea.m_aCommandHdl.Call(rCmd);
74 }
75};
76
77namespace jsdialog
78{
79// type used to store key-value pairs to put in the generated messages
80typedef std::unordered_map<std::string, OUString> ActionDataMap;
81
83VCL_DLLPUBLIC bool ExecuteAction(const std::string& nWindowId, const OString& rWidget,
84 StringMap& rData);
86VCL_DLLPUBLIC void SendFullUpdate(const std::string& nWindowId, const OString& rWidget);
88VCL_DLLPUBLIC void SendAction(const std::string& nWindowId, const OString& rWidget,
89 std::unique_ptr<ActionDataMap> pData);
91};
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
static void trigger_changed(weld::Entry &rEdit)
Definition: executor.hxx:22
static void trigger_changed(weld::ComboBox &rComboBox)
Definition: executor.hxx:24
static void trigger_row_activated(weld::TreeView &rTreeView)
Definition: executor.hxx:32
static void trigger_changed(weld::TextView &rView)
Definition: executor.hxx:20
static void trigger_closed(weld::Popover &rPopover)
Definition: executor.hxx:59
static void trigger_changed(weld::TreeView &rTreeView)
Definition: executor.hxx:26
static void trigger_changed(weld::IconView &rIconView)
Definition: executor.hxx:28
static void trigger_key_release(weld::Widget &rWidget, const KeyEvent &rEvent)
Definition: executor.hxx:66
static void trigger_value_changed(weld::SpinButton &rSpinButton)
Definition: executor.hxx:54
static void command(weld::DrawingArea &rArea, const CommandEvent &rCmd)
Definition: executor.hxx:71
static void trigger_click(weld::DrawingArea &rDrawingArea, const Point &rPos)
Definition: executor.hxx:49
static void trigger_toggled(weld::Toggleable &rButton)
Definition: executor.hxx:30
static void trigger_clicked(weld::Button &rButton)
Definition: executor.hxx:47
static void trigger_clicked(weld::Toolbar &rToolbar, const OString &rIdent)
Definition: executor.hxx:42
static void trigger_item_activated(weld::IconView &rIconView)
Definition: executor.hxx:37
static void trigger_key_press(weld::Widget &rWidget, const KeyEvent &rEvent)
Definition: executor.hxx:61
void signal_clicked()
Definition: weld.hxx:1471
A widget used to choose from a list of items.
Definition: weld.hxx:698
void signal_changed()
Definition: weld.hxx:716
Link< const CommandEvent &, bool > m_aCommandHdl
Definition: weld.hxx:2268
virtual void click(const Point &rPos)=0
void signal_changed()
Definition: weld.hxx:1693
void signal_selection_changed()
Definition: weld.hxx:1375
bool signal_item_activated()
Definition: weld.hxx:1376
virtual void popdown()=0
void signal_value_changed()
Definition: weld.hxx:1761
void signal_changed()
Definition: weld.hxx:2179
void signal_toggled()
Definition: weld.hxx:1505
void signal_clicked(const OString &rIdent)
Definition: weld.hxx:2444
bool signal_row_activated()
Definition: weld.hxx:933
void signal_changed()
Definition: weld.hxx:932
Link< const KeyEvent &, bool > m_aKeyPressHdl
Definition: weld.hxx:91
Link< const KeyEvent &, bool > m_aKeyReleaseHdl
Definition: weld.hxx:92
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
VCL_DLLPUBLIC void SendFullUpdate(const std::string &nWindowId, const OString &rWidget)
send full update message to the client
std::unordered_map< std::string, OUString > ActionDataMap
Definition: executor.hxx:80
VCL_DLLPUBLIC void SendAction(const std::string &nWindowId, const OString &rWidget, std::unique_ptr< ActionDataMap > pData)
send action message to the client
VCL_DLLPUBLIC StringMap jsonToStringMap(const char *pJSON)
VCL_DLLPUBLIC bool ExecuteAction(const std::string &nWindowId, const OString &rWidget, StringMap &rData)
execute action on a widget
std::map< OUString, OUString > StringMap