LibreOffice Module vcl (master)  1
jsdialogbuilder.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/weld.hxx>
14 #include <comphelper/string.hxx>
15 #include <vcl/sysdata.hxx>
16 #include <vcl/virdev.hxx>
17 #include <vcl/builder.hxx>
18 #include <salvtables.hxx>
19 #include <vcl/toolkit/button.hxx>
20 #include <vcl/toolkit/fmtfield.hxx>
21 
22 #include <com/sun/star/lang/XInitialization.hpp>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
25 #include <cppuhelper/compbase.hxx>
26 
27 #include <deque>
28 
29 class ToolBox;
30 class ComboBox;
31 class VclMultiLineEdit;
32 class SvTabListBox;
33 class IconView;
34 
35 typedef std::map<OString, weld::Widget*> WidgetMap;
36 
37 namespace jsdialog
38 {
40 {
44 };
45 }
46 
47 class JSDialogNotifyIdle : public Idle
48 {
49  // used to send message
51  // used to generate JSON
53  std::string m_sTypeOfJSON;
55  bool m_bForce;
56 
57  std::deque<std::pair<jsdialog::MessageType, VclPtr<vcl::Window>>> m_aMessageQueue;
58 
59 public:
60  JSDialogNotifyIdle(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
61  std::string sTypeOfJSON);
62 
63  void Invoke() override;
64 
65  void forceUpdate();
67 
68 private:
69  void send(tools::JsonWriter& aJsonWriter);
70  std::unique_ptr<tools::JsonWriter> generateFullUpdate() const;
71  std::unique_ptr<tools::JsonWriter> generateWidgetUpdate(VclPtr<vcl::Window> pWindow) const;
72  std::unique_ptr<tools::JsonWriter> generateCloseMessage() const;
73 };
74 
76 {
77  std::unique_ptr<JSDialogNotifyIdle> mpIdleNotify;
78 
79 public:
80  JSDialogSender() = default;
81  JSDialogSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
82  std::string sTypeOfJSON)
83  {
84  initializeSender(aNotifierWindow, aContentWindow, sTypeOfJSON);
85  }
86 
87  virtual ~JSDialogSender() = default;
88 
89  virtual void sendFullUpdate(bool bForce = false);
90  void sendClose();
91  virtual void sendUpdate(VclPtr<vcl::Window> pWindow);
92  void flush() { mpIdleNotify->Invoke(); }
93 
94 protected:
95  void initializeSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
96  std::string sTypeOfJSON)
97  {
98  mpIdleNotify.reset(new JSDialogNotifyIdle(aNotifierWindow, aContentWindow, sTypeOfJSON));
99  }
100 };
101 
102 class JSDropTarget final
103  : public cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDropTarget,
104  css::lang::XInitialization, css::lang::XServiceInfo>
105 {
106  osl::Mutex m_aMutex;
107  std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners;
108 
109 public:
110  JSDropTarget();
111 
112  // XInitialization
113  virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArgs) override;
114 
115  // XDropTarget
116  virtual void SAL_CALL addDropTargetListener(
117  const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>&) override;
118  virtual void SAL_CALL removeDropTargetListener(
119  const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>&) override;
120  virtual sal_Bool SAL_CALL isActive() override;
121  virtual void SAL_CALL setActive(sal_Bool active) override;
122  virtual sal_Int8 SAL_CALL getDefaultActions() override;
123  virtual void SAL_CALL setDefaultActions(sal_Int8 actions) override;
124 
125  OUString SAL_CALL getImplementationName() override;
126 
127  sal_Bool SAL_CALL supportsService(OUString const& ServiceName) override;
128 
129  css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
130 
131  void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde);
132 
133  void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde);
134 };
135 
137 {
138  sal_uInt64 m_nWindowId;
142  std::list<std::string> m_aRememberedWidgets;
143  std::string m_sTypeOfJSON;
146 
147  friend VCL_DLLPUBLIC bool jsdialog::ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget,
148  StringMap& rData);
149 
150  static std::map<sal_uInt64, WidgetMap>& GetLOKWeldWidgetsMap();
151  static void InsertWindowToMap(sal_uInt64 nWindowId);
152  void RememberWidget(const OString& id, weld::Widget* pWidget);
153  static weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget);
154 
156  JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
158  JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
159  const css::uno::Reference<css::frame::XFrame>& rFrame,
160  sal_uInt64 nWindowId = 0);
162  JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile);
163 
164 public:
165  static JSInstanceBuilder* CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot,
166  const OUString& rUIFile);
167  static JSInstanceBuilder*
168  CreateNotebookbarBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
169  const css::uno::Reference<css::frame::XFrame>& rFrame,
170  sal_uInt64 nWindowId = 0);
172  const OUString& rUIRoot,
173  const OUString& rUIFile);
174 
175  virtual ~JSInstanceBuilder() override;
176  virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString& id) override;
177  virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id) override;
178  virtual std::unique_ptr<weld::Label> weld_label(const OString& id) override;
179  virtual std::unique_ptr<weld::Button> weld_button(const OString& id) override;
180  virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id) override;
181  virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id) override;
182  virtual std::unique_ptr<weld::Notebook> weld_notebook(const OString& id) override;
183  virtual std::unique_ptr<weld::SpinButton> weld_spin_button(const OString& id) override;
184  virtual std::unique_ptr<weld::CheckButton> weld_check_button(const OString& id) override;
185  virtual std::unique_ptr<weld::DrawingArea>
186  weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr,
187  FactoryFunction pUITestFactoryFunction = nullptr,
188  void* pUserData = nullptr) override;
189  virtual std::unique_ptr<weld::Toolbar> weld_toolbar(const OString& id) override;
190  virtual std::unique_ptr<weld::TextView> weld_text_view(const OString& id) override;
191  virtual std::unique_ptr<weld::TreeView> weld_tree_view(const OString& id) override;
192  virtual std::unique_ptr<weld::Expander> weld_expander(const OString& id) override;
193  virtual std::unique_ptr<weld::IconView> weld_icon_view(const OString& id) override;
194  virtual std::unique_ptr<weld::RadioButton> weld_radio_button(const OString& id) override;
195 
197  VclMessageType eMessageType,
198  VclButtonsType eButtonType,
199  const OUString& rPrimaryMessage);
200 
201 private:
202  const std::string& GetTypeOfJSON();
205 };
206 
207 template <class BaseInstanceClass, class VclClass> class JSWidget : public BaseInstanceClass
208 {
209 protected:
212 
214 
215 public:
216  JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* pBuilder,
217  bool bTakeOwnership)
218  : BaseInstanceClass(pObject, pBuilder, bTakeOwnership)
219  , m_bIsFreezed(false)
220  , m_pSender(pSender)
221  {
222  }
223 
224  JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* pBuilder,
225  const a11yref& rAlly, FactoryFunction pUITestFactoryFunction, void* pUserData,
226  bool bTakeOwnership)
227  : BaseInstanceClass(pObject, pBuilder, rAlly, pUITestFactoryFunction, pUserData,
228  bTakeOwnership)
229  , m_bIsFreezed(false)
230  , m_pSender(pSender)
231  {
232  }
233 
234  virtual void show() override
235  {
236  BaseInstanceClass::show();
237  sendFullUpdate();
238  }
239 
240  virtual void hide() override
241  {
242  BaseInstanceClass::hide();
243  sendFullUpdate();
244  }
245 
246  using BaseInstanceClass::set_sensitive;
247  virtual void set_sensitive(bool sensitive) override
248  {
249  bool bIsSensitive = BaseInstanceClass::get_sensitive();
250  BaseInstanceClass::set_sensitive(sensitive);
251  if (bIsSensitive != sensitive)
252  sendUpdate();
253  }
254 
255  virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override
256  {
257  if (!m_xDropTarget)
258  m_xDropTarget.set(new JSDropTarget);
259 
260  return m_xDropTarget.get();
261  }
262 
263  virtual void freeze() override
264  {
265  BaseInstanceClass::freeze();
266  m_bIsFreezed = true;
267  }
268 
269  virtual void thaw() override
270  {
271  BaseInstanceClass::thaw();
272  m_bIsFreezed = false;
273  }
274 
275  void sendClose()
276  {
277  if (m_pSender)
278  m_pSender->sendClose();
279  }
280 
281  void sendUpdate()
282  {
283  if (!m_bIsFreezed && m_pSender)
284  m_pSender->sendUpdate(BaseInstanceClass::m_xWidget);
285  }
286 
287  void sendFullUpdate(bool bForce = false)
288  {
289  if ((!m_bIsFreezed || bForce) && m_pSender)
290  m_pSender->sendFullUpdate(bForce);
291  }
292 };
293 
294 class JSDialog : public JSWidget<SalInstanceDialog, ::Dialog>
295 {
296 public:
297  JSDialog(JSDialogSender* pSender, ::Dialog* pDialog, SalInstanceBuilder* pBuilder,
298  bool bTakeOwnership);
299 
300  virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) override;
301  virtual void undo_collapse() override;
302  virtual void response(int response) override;
303 };
304 
305 class JSLabel : public JSWidget<SalInstanceLabel, FixedText>
306 {
307 public:
308  JSLabel(JSDialogSender* pSender, FixedText* pLabel, SalInstanceBuilder* pBuilder,
309  bool bTakeOwnership);
310  virtual void set_label(const OUString& rText) override;
311 };
312 
313 class JSButton : public JSWidget<SalInstanceButton, ::Button>
314 {
315 public:
316  JSButton(JSDialogSender* pSender, ::Button* pButton, SalInstanceBuilder* pBuilder,
317  bool bTakeOwnership);
318 };
319 
320 class JSEntry : public JSWidget<SalInstanceEntry, ::Edit>
321 {
322 public:
323  JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* pBuilder,
324  bool bTakeOwnership);
325  virtual void set_text(const OUString& rText) override;
326  void set_text_without_notify(const OUString& rText);
327 };
328 
329 class JSListBox : public JSWidget<SalInstanceComboBoxWithoutEdit, ::ListBox>
330 {
331 public:
332  JSListBox(JSDialogSender* pSender, ::ListBox* pListBox, SalInstanceBuilder* pBuilder,
333  bool bTakeOwnership);
334  virtual void insert(int pos, const OUString& rStr, const OUString* pId,
335  const OUString* pIconName, VirtualDevice* pImageSurface) override;
336  virtual void remove(int pos) override;
337  virtual void set_active(int pos) override;
338 };
339 
340 class JSComboBox : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox>
341 {
342 public:
343  JSComboBox(JSDialogSender* pSender, ::ComboBox* pComboBox, SalInstanceBuilder* pBuilder,
344  bool bTakeOwnership);
345  virtual void insert(int pos, const OUString& rStr, const OUString* pId,
346  const OUString* pIconName, VirtualDevice* pImageSurface) override;
347  virtual void remove(int pos) override;
348  virtual void set_entry_text(const OUString& rText) override;
349  virtual void set_active(int pos) override;
350 };
351 
352 class JSNotebook : public JSWidget<SalInstanceNotebook, ::TabControl>
353 {
354 public:
355  JSNotebook(JSDialogSender* pSender, ::TabControl* pControl, SalInstanceBuilder* pBuilder,
356  bool bTakeOwnership);
357 
358  virtual void set_current_page(int nPage) override;
359 
360  virtual void set_current_page(const OString& rIdent) override;
361 
362  virtual void remove_page(const OString& rIdent) override;
363 
364  virtual void insert_page(const OString& rIdent, const OUString& rLabel, int nPos) override;
365 };
366 
367 class JSSpinButton : public JSWidget<SalInstanceSpinButton, ::FormattedField>
368 {
369 public:
370  JSSpinButton(JSDialogSender* pSender, ::FormattedField* pSpin, SalInstanceBuilder* pBuilder,
371  bool bTakeOwnership);
372 
373  virtual void set_value(int value) override;
374 };
375 
376 class JSMessageDialog : public JSWidget<SalInstanceMessageDialog, ::MessageDialog>
377 {
378  std::unique_ptr<JSDialogSender> m_pOwnedSender;
379 
380 public:
381  JSMessageDialog(JSDialogSender* pSender, ::MessageDialog* pDialog, SalInstanceBuilder* pBuilder,
382  bool bTakeOwnership);
383  JSMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
384 
385  virtual void set_primary_text(const OUString& rText) override;
386 
387  virtual void set_secondary_text(const OUString& rText) override;
388 };
389 
390 class JSCheckButton : public JSWidget<SalInstanceCheckButton, ::CheckBox>
391 {
392 public:
393  JSCheckButton(JSDialogSender* pSender, ::CheckBox* pCheckBox, SalInstanceBuilder* pBuilder,
394  bool bTakeOwnership);
395 
396  virtual void set_active(bool active) override;
397 };
398 
399 class JSDrawingArea : public JSWidget<SalInstanceDrawingArea, VclDrawingArea>
400 {
401 public:
402  JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingArea,
403  SalInstanceBuilder* pBuilder, const a11yref& rAlly,
404  FactoryFunction pUITestFactoryFunction, void* pUserData);
405 
406  virtual void queue_draw() override;
407  virtual void queue_draw_area(int x, int y, int width, int height) override;
408 };
409 
410 class JSToolbar : public JSWidget<SalInstanceToolbar, ::ToolBox>
411 {
412 public:
413  JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder,
414  bool bTakeOwnership);
415 };
416 
417 class JSTextView : public JSWidget<SalInstanceTextView, ::VclMultiLineEdit>
418 {
419 public:
420  JSTextView(JSDialogSender* pSender, ::VclMultiLineEdit* pTextView, SalInstanceBuilder* pBuilder,
421  bool bTakeOwnership);
422  virtual void set_text(const OUString& rText) override;
423 };
424 
425 class JSTreeView : public JSWidget<SalInstanceTreeView, ::SvTabListBox>
426 {
427 public:
428  JSTreeView(JSDialogSender* pSender, ::SvTabListBox* pTextView, SalInstanceBuilder* pBuilder,
429  bool bTakeOwnership);
430 
433  virtual void set_toggle(int pos, TriState eState, int col = -1) override;
434 
437  virtual void select(int pos) override;
438 
439  virtual weld::TreeView* get_drag_source() const override;
440 
442  virtual void insert(const weld::TreeIter* pParent, int pos, const OUString* pStr,
443  const OUString* pId, const OUString* pIconName,
444  VirtualDevice* pImageSurface, bool bChildrenOnDemand,
445  weld::TreeIter* pRet) override;
446 
447  virtual void set_text(int row, const OUString& rText, int col = -1) override;
448  virtual void set_text(const weld::TreeIter& rIter, const OUString& rStr, int col = -1) override;
449 
450  virtual void expand_row(const weld::TreeIter& rIter) override;
451  virtual void collapse_row(const weld::TreeIter& rIter) override;
452 
453  void drag_start();
454  void drag_end();
455 };
456 
457 class JSExpander : public JSWidget<SalInstanceExpander, ::VclExpander>
458 {
459 public:
460  JSExpander(JSDialogSender* pSender, ::VclExpander* pExpander, SalInstanceBuilder* pBuilder,
461  bool bTakeOwnership);
462 
463  virtual void set_expanded(bool bExpand) override;
464 };
465 
466 class JSIconView : public JSWidget<SalInstanceIconView, ::IconView>
467 {
468 public:
469  JSIconView(JSDialogSender* pSender, ::IconView* pIconView, SalInstanceBuilder* pBuilder,
470  bool bTakeOwnership);
471 
472  virtual void insert(int pos, const OUString* pStr, const OUString* pId,
473  const OUString* pIconName, weld::TreeIter* pRet) override;
474 
475  virtual void insert(int pos, const OUString* pStr, const OUString* pId,
476  const VirtualDevice* pIcon, weld::TreeIter* pRet) override;
477  virtual void clear() override;
478  virtual void select(int pos) override;
479  virtual void unselect(int pos) override;
480 };
481 
482 class JSRadioButton : public JSWidget<SalInstanceRadioButton, ::RadioButton>
483 {
484 public:
485  JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButton,
486  SalInstanceBuilder* pBuilder, bool bTakeOwnership);
487 
488  virtual void set_active(bool active) override;
489 };
490 
491 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual void set_value(int value) override
osl::Mutex m_aMutex
void sendFullUpdate(bool bForce=false)
JSIconView(JSDialogSender *pSender,::IconView *pIconView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
std::string m_LastNotificationMessage
VclPtr< vcl::Window > m_aNotifierWindow
virtual void sendFullUpdate(bool bForce=false)
VclButtonsType
Definition: vclenum.hxx:246
static JSInstanceBuilder * CreateAutofilterWindowBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile)
signed char sal_Int8
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:83
virtual std::unique_ptr< weld::Button > weld_button(const OString &id) override
virtual void set_toggle(int pos, TriState eState, int col=-1) override
pos is used differently here, it defines how many steps of iterator we need to perform to take entry ...
JSLabel(JSDialogSender *pSender, FixedText *pLabel, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
virtual sal_Bool SAL_CALL isActive() override
css::uno::Reference< css::accessibility::XAccessible > a11yref
Definition: weld.hxx:45
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual void thaw() override
JSCheckButton(JSDialogSender *pSender,::CheckBox *pCheckBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
JSRadioButton(JSDialogSender *pSender,::RadioButton *pRadioButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_active(int pos) override
virtual void sendUpdate(VclPtr< vcl::Window > pWindow)
JSNotebook(JSDialogSender *pSender,::TabControl *pControl, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void initializeSender(VclPtr< vcl::Window > aNotifierWindow, VclPtr< vcl::Window > aContentWindow, std::string sTypeOfJSON)
virtual void hide() override
std::unique_ptr< tools::JsonWriter > generateCloseMessage() const
std::unique_ptr< tools::JsonWriter > generateWidgetUpdate(VclPtr< vcl::Window > pWindow) const
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
float x
virtual void set_secondary_text(const OUString &rText) override
virtual void set_current_page(int nPage) override
virtual sal_Int8 SAL_CALL getDefaultActions() override
void send(tools::JsonWriter &aJsonWriter)
VclPtr< vcl::Window > m_aContentWindow
virtual std::unique_ptr< weld::RadioButton > weld_radio_button(const OString &id) override
virtual std::unique_ptr< weld::Entry > weld_entry(const OString &id) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArgs) override
static void InsertWindowToMap(sal_uInt64 nWindowId)
virtual std::unique_ptr< weld::Dialog > weld_dialog(const OString &id) override
static std::map< sal_uInt64, WidgetMap > & GetLOKWeldWidgetsMap()
size_t pos
JSTextView(JSDialogSender *pSender,::VclMultiLineEdit *pTextView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent &dtde)
VCL_DLLPUBLIC bool ExecuteAction(sal_uInt64 nWindowId, const OString &rWidget, StringMap &rData)
virtual std::unique_ptr< weld::TextView > weld_text_view(const OString &id) override
virtual css::uno::Reference< css::datatransfer::dnd::XDropTarget > get_drop_target() override
virtual void show() override
void set_toggle(SvTreeListEntry *pEntry, TriState eState, int col)
OUString SAL_CALL getImplementationName() override
JSDialog(JSDialogSender *pSender,::Dialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
JSExpander(JSDialogSender *pSender,::VclExpander *pExpander, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual std::unique_ptr< weld::DrawingArea > weld_drawing_area(const OString &id, const a11yref &rA11yImpl=nullptr, FactoryFunction pUITestFactoryFunction=nullptr, void *pUserData=nullptr) override
virtual void SAL_CALL setDefaultActions(sal_Int8 actions) override
VclMessageType
Definition: vclenum.hxx:256
Definition: edit.hxx:55
virtual std::unique_ptr< weld::CheckButton > weld_check_button(const OString &id) override
std::deque< std::pair< jsdialog::MessageType, VclPtr< vcl::Window > > > m_aMessageQueue
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
virtual void insert(const weld::TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, weld::TreeIter *pRet) override
virtual void select(int pos) override
virtual void collapse(weld::Widget *pEdit, weld::Widget *pButton) override
VclPtr< vcl::Window > & GetContentWindow()
float y
virtual void set_expanded(bool bExpand) override
virtual ~JSDialogSender()=default
void sendClose()
virtual void set_label(const OUString &rText) override
JSInstanceBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
used for dialogs
JSDialogSender * m_pSender
virtual std::unique_ptr< weld::Expander > weld_expander(const OString &id) override
static weld::Widget * FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString &rWidget)
JSTreeView(JSDialogSender *pSender,::SvTabListBox *pTextView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void remove_page(const OString &rIdent) override
JSWidget(JSDialogSender *pSender, VclClass *pObject, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent &dtde)
JSDialogNotifyIdle(VclPtr< vcl::Window > aNotifierWindow, VclPtr< vcl::Window > aContentWindow, std::string sTypeOfJSON)
virtual std::unique_ptr< weld::IconView > weld_icon_view(const OString &id) override
JSDrawingArea(JSDialogSender *pSender, VclDrawingArea *pDrawingArea, SalInstanceBuilder *pBuilder, const a11yref &rAlly, FactoryFunction pUITestFactoryFunction, void *pUserData)
std::string m_sTypeOfJSON
virtual void insert_page(const OString &rIdent, const OUString &rLabel, int nPos) override
VclPtr< vcl::Window > m_aParentDialog
used in case of tab pages where dialog is not a direct top level
JSToolbar(JSDialogSender *pSender,::ToolBox *pToolbox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
unsigned char sal_Bool
virtual void queue_draw() override
VclPtr< vcl::Window > m_aContentWindow
JSSpinButton(JSDialogSender *pSender,::FormattedField *pSpin, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void clear() override
void drag_start()
virtual void undo_collapse() override
virtual std::unique_ptr< weld::Notebook > weld_notebook(const OString &id) override
virtual void select(int pos) override
pos is used differently here, it defines how many steps of iterator we need to perform to take entry ...
VclPtr< vcl::Window > & GetNotifierWindow()
std::unique_ptr< JSDialogNotifyIdle > mpIdleNotify
std::list< std::string > m_aRememberedWidgets
void sendMessage(jsdialog::MessageType eType, VclPtr< vcl::Window > pWindow)
virtual void set_sensitive(bool sensitive) override
virtual std::unique_ptr< weld::ComboBox > weld_combo_box(const OString &id) override
virtual void set_text(int row, const OUString &rText, int col=-1) override
virtual void set_entry_text(const OUString &rText) override
JSComboBox(JSDialogSender *pSender,::ComboBox *pComboBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void response(int response) override
virtual void SAL_CALL setActive(sal_Bool active) override
void set_text_without_notify(const OUString &rText)
virtual void set_active(int pos) override
virtual void set_active(bool active) override
virtual ~JSInstanceBuilder() override
virtual void SAL_CALL removeDropTargetListener(const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > &) override
JSMessageDialog(JSDialogSender *pSender,::MessageDialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void drag_end()
std::map< OString, weld::Widget * > WidgetMap
virtual void freeze() override
virtual std::unique_ptr< weld::TreeView > weld_tree_view(const OString &id) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void sendUpdate()
JSEntry(JSDialogSender *pSender,::Edit *pEntry, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void queue_draw_area(int x, int y, int width, int height) override
virtual std::unique_ptr< weld::Toolbar > weld_toolbar(const OString &id) override
std::string m_sTypeOfJSON
std::vector< css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > > m_aListeners
std::map< OUString, OUString > StringMap
void RememberWidget(const OString &id, weld::Widget *pWidget)
std::unique_ptr< JSDialogSender > m_pOwnedSender
JSDialogSender(VclPtr< vcl::Window > aNotifierWindow, VclPtr< vcl::Window > aContentWindow, std::string sTypeOfJSON)
virtual std::unique_ptr< weld::MessageDialog > weld_message_dialog(const OString &id) override
virtual void set_text(const OUString &rText) override
virtual void collapse_row(const weld::TreeIter &rIter) override
virtual void SAL_CALL addDropTargetListener(const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > &) override
virtual void set_text(const OUString &rText) override
virtual void select(int pos) override
Any value
virtual void unselect(int pos) override
const std::string & GetTypeOfJSON()
static JSInstanceBuilder * CreateDialogBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:38
JSDialogSender()=default
rtl::Reference< JSDropTarget > m_xDropTarget
virtual void insert(const weld::TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, weld::TreeIter *pRet) override
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
JSWidget(JSDialogSender *pSender, VclClass *pObject, SalInstanceBuilder *pBuilder, const a11yref &rAlly, FactoryFunction pUITestFactoryFunction, void *pUserData, bool bTakeOwnership)
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
virtual std::unique_ptr< weld::SpinButton > weld_spin_button(const OString &id) override
virtual weld::TreeView * get_drag_source() const override
JSButton(JSDialogSender *pSender,::Button *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
TriState
virtual void expand_row(const weld::TreeIter &rIter) override
void Invoke() override
Calls the maInvokeHandler with the parameter this.
static JSInstanceBuilder * CreateNotebookbarBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, const css::uno::Reference< css::frame::XFrame > &rFrame, sal_uInt64 nWindowId=0)
virtual std::unique_ptr< weld::Label > weld_label(const OString &id) override
virtual void insert(int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, weld::TreeIter *pRet) override
JSListBox(JSDialogSender *pSender,::ListBox *pListBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_active(bool active) override
std::unique_ptr< tools::JsonWriter > generateFullUpdate() const
An idle is a timer to be scheduled immediately.
Definition: idle.hxx:30
sal_uInt16 nPos
virtual void set_primary_text(const OUString &rText) override