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_scrollv(weld::ScrolledWindow& rScrolledWindow)
31 {
32 rScrolledWindow.signal_vadjustment_changed();
33 }
34
35 static void trigger_scrollh(weld::ScrolledWindow& rScrolledWindow)
36 {
37 rScrolledWindow.signal_hadjustment_changed();
38 }
39
40 static void trigger_toggled(weld::Toggleable& rButton) { rButton.signal_toggled(); }
41
42 static void trigger_row_activated(weld::TreeView& rTreeView)
43 {
44 rTreeView.signal_row_activated();
45 }
46
47 static void trigger_item_activated(weld::IconView& rIconView)
48 {
49 rIconView.signal_item_activated();
50 }
51
52 static void trigger_clicked(weld::Toolbar& rToolbar, const OUString& rIdent)
53 {
54 rToolbar.signal_clicked(rIdent);
55 }
56
57 static void trigger_clicked(weld::Button& rButton) { rButton.signal_clicked(); }
58
59 static void trigger_click(weld::DrawingArea& rDrawingArea, const Point& rPos)
60 {
61 rDrawingArea.click(rPos);
62 }
63
64 static void trigger_dblclick(weld::DrawingArea& rDrawingArea, const Point& rPos)
65 {
66 rDrawingArea.dblclick(rPos);
67 }
68
69 static void trigger_mouse_up(weld::DrawingArea& rDrawingArea, const Point& rPos)
70 {
71 rDrawingArea.mouse_up(rPos);
72 }
73
74 static void trigger_mouse_down(weld::DrawingArea& rDrawingArea, const Point& rPos)
75 {
76 rDrawingArea.mouse_down(rPos);
77 }
78
79 static void trigger_mouse_move(weld::DrawingArea& rDrawingArea, const Point& rPos)
80 {
81 rDrawingArea.mouse_move(rPos);
82 }
83
84 static void trigger_selected(weld::MenuButton& rButton, const OUString& rIdent)
85 {
86 rButton.signal_selected(rIdent);
87 }
88
89 static void trigger_selected(weld::Calendar& rCalendar) { rCalendar.signal_selected(); }
90
91 static void trigger_activated(weld::Calendar& rCalendar) { rCalendar.signal_activated(); }
92
93 static void trigger_value_changed(weld::SpinButton& rSpinButton)
94 {
95 rSpinButton.signal_value_changed();
96 }
97
99 {
100 rSpinButton.signal_value_changed();
101 }
102
103 static void trigger_closed(weld::Popover& rPopover) { rPopover.popdown(); }
104
105 static void trigger_key_press(weld::Widget& rWidget, const KeyEvent& rEvent)
106 {
107 rWidget.m_aKeyPressHdl.Call(rEvent);
108 }
109
110 static void trigger_key_release(weld::Widget& rWidget, const KeyEvent& rEvent)
111 {
112 rWidget.m_aKeyReleaseHdl.Call(rEvent);
113 }
114
115 static void command(weld::DrawingArea& rArea, const CommandEvent& rCmd)
116 {
117 rArea.m_aCommandHdl.Call(rCmd);
118 }
119
120 static void enter_page(weld::Notebook& rNotebook, const OUString& rPage)
121 {
122 rNotebook.m_aEnterPageHdl.Call(rPage);
123 }
124
125 static void leave_page(weld::Notebook& rNotebook, const OUString& rPage)
126 {
127 rNotebook.m_aLeavePageHdl.Call(rPage);
128 }
129};
130
131namespace jsdialog
132{
133// type used to store key-value pairs to put in the generated messages
134typedef std::unordered_map<OString, OUString> ActionDataMap;
135
137VCL_DLLPUBLIC bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget,
138 StringMap& rData);
140VCL_DLLPUBLIC void SendFullUpdate(const OUString& nWindowId, const OUString& rWidget);
142VCL_DLLPUBLIC void SendAction(const OUString& nWindowId, const OUString& rWidget,
143 std::unique_ptr<ActionDataMap> pData);
145};
146
147/* 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:42
static void leave_page(weld::Notebook &rNotebook, const OUString &rPage)
Definition: executor.hxx:125
static void trigger_changed(weld::TextView &rView)
Definition: executor.hxx:20
static void trigger_closed(weld::Popover &rPopover)
Definition: executor.hxx:103
static void trigger_dblclick(weld::DrawingArea &rDrawingArea, const Point &rPos)
Definition: executor.hxx:64
static void trigger_selected(weld::Calendar &rCalendar)
Definition: executor.hxx:89
static void trigger_scrollv(weld::ScrolledWindow &rScrolledWindow)
Definition: executor.hxx:30
static void trigger_changed(weld::TreeView &rTreeView)
Definition: executor.hxx:26
static void trigger_mouse_down(weld::DrawingArea &rDrawingArea, const Point &rPos)
Definition: executor.hxx:74
static void trigger_changed(weld::IconView &rIconView)
Definition: executor.hxx:28
static void enter_page(weld::Notebook &rNotebook, const OUString &rPage)
Definition: executor.hxx:120
static void trigger_activated(weld::Calendar &rCalendar)
Definition: executor.hxx:91
static void trigger_key_release(weld::Widget &rWidget, const KeyEvent &rEvent)
Definition: executor.hxx:110
static void trigger_value_changed(weld::SpinButton &rSpinButton)
Definition: executor.hxx:93
static void trigger_mouse_up(weld::DrawingArea &rDrawingArea, const Point &rPos)
Definition: executor.hxx:69
static void command(weld::DrawingArea &rArea, const CommandEvent &rCmd)
Definition: executor.hxx:115
static void trigger_value_changed(weld::FormattedSpinButton &rSpinButton)
Definition: executor.hxx:98
static void trigger_click(weld::DrawingArea &rDrawingArea, const Point &rPos)
Definition: executor.hxx:59
static void trigger_clicked(weld::Toolbar &rToolbar, const OUString &rIdent)
Definition: executor.hxx:52
static void trigger_toggled(weld::Toggleable &rButton)
Definition: executor.hxx:40
static void trigger_scrollh(weld::ScrolledWindow &rScrolledWindow)
Definition: executor.hxx:35
static void trigger_clicked(weld::Button &rButton)
Definition: executor.hxx:57
static void trigger_item_activated(weld::IconView &rIconView)
Definition: executor.hxx:47
static void trigger_key_press(weld::Widget &rWidget, const KeyEvent &rEvent)
Definition: executor.hxx:105
static void trigger_selected(weld::MenuButton &rButton, const OUString &rIdent)
Definition: executor.hxx:84
static void trigger_mouse_move(weld::DrawingArea &rDrawingArea, const Point &rPos)
Definition: executor.hxx:79
void signal_clicked()
Definition: weld.hxx:1504
void signal_activated()
Definition: weld.hxx:1909
void signal_selected()
Definition: weld.hxx:1908
A widget used to choose from a list of items.
Definition: weld.hxx:713
void signal_changed()
Definition: weld.hxx:731
Link< const CommandEvent &, bool > m_aCommandHdl
Definition: weld.hxx:2305
virtual void click(const Point &)=0
virtual void mouse_down(const Point &)
Definition: weld.hxx:2384
virtual void mouse_move(const Point &)
Definition: weld.hxx:2386
virtual void dblclick(const Point &)
Definition: weld.hxx:2380
virtual void mouse_up(const Point &)
Definition: weld.hxx:2382
void signal_changed()
Definition: weld.hxx:1730
void signal_selection_changed()
Definition: weld.hxx:1401
bool signal_item_activated()
Definition: weld.hxx:1402
void signal_selected(const OUString &rIdent)
Definition: weld.hxx:1606
Link< const OUString &, bool > m_aLeavePageHdl
Definition: weld.hxx:478
Link< const OUString &, void > m_aEnterPageHdl
Definition: weld.hxx:479
virtual void popdown()=0
void signal_vadjustment_changed()
Definition: weld.hxx:413
void signal_hadjustment_changed()
Definition: weld.hxx:414
void signal_value_changed()
Definition: weld.hxx:1798
void signal_changed()
Definition: weld.hxx:2217
void signal_toggled()
Definition: weld.hxx:1539
void signal_clicked(const OUString &rIdent)
Definition: weld.hxx:2489
bool signal_row_activated()
Definition: weld.hxx:954
void signal_changed()
Definition: weld.hxx:953
Link< const KeyEvent &, bool > m_aKeyPressHdl
Definition: weld.hxx:92
Link< const KeyEvent &, bool > m_aKeyReleaseHdl
Definition: weld.hxx:93
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
VCL_DLLPUBLIC bool ExecuteAction(const OUString &nWindowId, const OUString &rWidget, StringMap &rData)
execute action on a widget
VCL_DLLPUBLIC StringMap jsonToStringMap(const char *pJSON)
VCL_DLLPUBLIC void SendFullUpdate(const OUString &nWindowId, const OUString &rWidget)
send full update message to the client
std::unordered_map< OString, OUString > ActionDataMap
Definition: executor.hxx:134
VCL_DLLPUBLIC void SendAction(const OUString &nWindowId, const OUString &rWidget, std::unique_ptr< ActionDataMap > pData)
send action message to the client
std::map< OUString, OUString > StringMap