LibreOffice Module vcl (master)  1
weld.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_VCL_WELD_HXX
11 #define INCLUDED_VCL_WELD_HXX
12 
14 #include <rtl/ustring.hxx>
15 #include <tools/color.hxx>
16 #include <tools/date.hxx>
17 #include <tools/fldunit.hxx>
18 #include <tools/gen.hxx>
19 #include <tools/link.hxx>
20 #include <vcl/dllapi.h>
21 #include <vcl/vclenum.hxx>
22 #include <vcl/font.hxx>
23 #include <vcl/vclptr.hxx>
24 #include <vcl/uitest/factory.hxx>
25 
26 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
27 #include <com/sun/star/accessibility/XAccessible.hpp>
28 
29 #include <assert.h>
30 #include <memory>
31 #include <vector>
32 
33 namespace com::sun::star::awt
34 {
35 class XWindow;
36 }
38 {
39 class XDropTarget;
40 }
42 {
43 class XGraphic;
44 }
45 typedef css::uno::Reference<css::accessibility::XAccessible> a11yref;
46 typedef css::uno::Reference<css::accessibility::XAccessibleRelationSet> a11yrelationset;
47 enum class PointerStyle;
48 class CommandEvent;
49 class Formatter;
50 class InputContext;
51 class KeyEvent;
52 class MouseEvent;
53 class SvNumberFormatter;
55 class OutputDevice;
56 class VirtualDevice;
57 struct SystemEnvData;
58 
59 namespace vcl
60 {
61 class ILibreOfficeKitNotifier;
63 }
64 namespace tools
65 {
66 class JsonWriter;
67 }
68 
69 class LOKTrigger;
70 
71 namespace weld
72 {
73 class Container;
74 class DialogController;
75 
77 {
78 protected:
88 
89 public:
90  virtual void set_sensitive(bool sensitive) = 0;
91  virtual bool get_sensitive() const = 0;
92  virtual void show() = 0;
93  virtual void hide() = 0;
94  // This function simply calls show() or hide() but is convenient when the
95  // visibility depends on some condition
96  virtual void set_visible(bool visible)
97  {
98  if (visible)
99  show();
100  else
101  hide();
102  }
103  virtual bool get_visible() const = 0; //if this widget visibility is true
104  virtual bool is_visible() const = 0; //if this widget visibility and all parents is true
105  virtual void set_can_focus(bool bCanFocus) = 0;
106  virtual void grab_focus() = 0;
107  virtual bool has_focus() const = 0;
108  virtual bool is_active() const = 0; //if this widget has the focus within the active window
109  virtual void set_has_default(bool has_default) = 0;
110  virtual bool get_has_default() const = 0;
111  virtual void set_size_request(int nWidth, int nHeight) = 0;
112  virtual Size get_size_request() const = 0;
113  virtual Size get_preferred_size() const = 0;
114  virtual float get_approximate_digit_width() const = 0;
115  virtual int get_text_height() const = 0;
116  virtual Size get_pixel_size(const OUString& rText) const = 0;
117 
118  // The name of the widget in the GtkBuilder UI definition used to construct it.
119  virtual OString get_buildable_name() const = 0;
120 
121  /* The help id of the widget used to identify help for this widget.
122  *
123  * By default the help id of a widget is a path-like sequence of
124  * buildable-names from the widgets UI definition ancestor to this
125  * widget, e.g. grandparent/parent/widget.
126  *
127  * The default can be overwritten with set_help_id
128  */
129  virtual OString get_help_id() const = 0;
130  virtual void set_help_id(const OString& rName) = 0;
131 
132  virtual void set_grid_left_attach(int nAttach) = 0;
133  virtual int get_grid_left_attach() const = 0;
134  virtual void set_grid_width(int nCols) = 0;
135  virtual void set_grid_top_attach(int nAttach) = 0;
136  virtual int get_grid_top_attach() const = 0;
137 
138  virtual void set_hexpand(bool bExpand) = 0;
139  virtual bool get_hexpand() const = 0;
140  virtual void set_vexpand(bool bExpand) = 0;
141  virtual bool get_vexpand() const = 0;
142 
143  virtual void set_secondary(bool bSecondary) = 0;
144 
145  virtual void set_margin_top(int nMargin) = 0;
146  virtual void set_margin_bottom(int nMargin) = 0;
147  virtual void set_margin_left(int nMargin) = 0;
148  virtual void set_margin_right(int nMargin) = 0;
149 
150  virtual int get_margin_top() const = 0;
151  virtual int get_margin_bottom() const = 0;
152  virtual int get_margin_left() const = 0;
153  virtual int get_margin_right() const = 0;
154 
155  /*
156  * Report the extents of this widget relative to the rRelative target widget.
157  *
158  * To succeed, both widgets must be realized, and must share a common toplevel.
159  *
160  * returns false if the relative extents could not be determined, e.g. if
161  * either widget was not realized, or there was no common ancestor.
162  * Otherwise true.
163  */
164  virtual bool get_extents_relative_to(const Widget& rRelative, int& x, int& y, int& width,
165  int& height) const = 0;
166 
167  virtual void set_accessible_name(const OUString& rName) = 0;
168  virtual OUString get_accessible_name() const = 0;
169 
170  virtual OUString get_accessible_description() const = 0;
171 
172  virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) = 0;
173  virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) = 0;
174 
175  virtual void set_tooltip_text(const OUString& rTip) = 0;
176  virtual OUString get_tooltip_text() const = 0;
177 
178  virtual void connect_focus_in(const Link<Widget&, void>& rLink)
179  {
180  assert(!m_aFocusInHdl.IsSet() || !rLink.IsSet());
181  m_aFocusInHdl = rLink;
182  }
183 
184  virtual void connect_focus_out(const Link<Widget&, void>& rLink)
185  {
186  assert(!m_aFocusOutHdl.IsSet() || !rLink.IsSet());
187  m_aFocusOutHdl = rLink;
188  }
189 
190  // rLink is called when the mnemonic for the Widget is called.
191  // If rLink returns true the Widget will not automatically gain
192  // focus as normally occurs
194  {
195  assert(!m_aMnemonicActivateHdl.IsSet() || !rLink.IsSet());
196  m_aMnemonicActivateHdl = rLink;
197  }
198 
200  {
201  assert(!m_aSizeAllocateHdl.IsSet() || !rLink.IsSet());
202  m_aSizeAllocateHdl = rLink;
203  }
204 
206  {
207  assert(!m_aKeyPressHdl.IsSet() || !rLink.IsSet());
208  m_aKeyPressHdl = rLink;
209  }
210 
212  {
213  assert(!m_aKeyReleaseHdl.IsSet() || !rLink.IsSet());
214  m_aKeyReleaseHdl = rLink;
215  }
216 
218  {
219  assert(!m_aMousePressHdl.IsSet() || !rLink.IsSet());
220  m_aMousePressHdl = rLink;
221  }
222 
224  {
225  assert(!m_aMouseMotionHdl.IsSet() || !rLink.IsSet());
226  m_aMouseMotionHdl = rLink;
227  }
228 
230  {
231  assert(!m_aMouseReleaseHdl.IsSet() || !rLink.IsSet());
232  m_aMouseReleaseHdl = rLink;
233  }
234 
235  virtual void grab_add() = 0;
236  virtual bool has_grab() const = 0;
237  virtual void grab_remove() = 0;
238 
239  // font size is in points, not pixels, e.g. see Window::[G]etPointFont
240  virtual vcl::Font get_font() = 0;
241 
242  //true for rtl, false otherwise
243  virtual bool get_direction() const = 0;
244  virtual void set_direction(bool bRTL) = 0;
245 
246  virtual void freeze() = 0;
247  virtual void thaw() = 0;
248 
249  virtual std::unique_ptr<Container> weld_parent() const = 0;
250 
251  //iterate upwards through the hierarchy starting at this widgets parent,
252  //calling func with their helpid until func returns true or we run out of
253  //parents
254  virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) = 0;
255 
256  virtual OUString strip_mnemonic(const OUString& rLabel) const = 0;
257 
258  virtual VclPtr<VirtualDevice> create_virtual_device() const = 0;
259 
260  //make this widget look like a page in a notebook
261  virtual void set_stack_background() = 0;
262  //make this widget look like it has a highlighted background
263  virtual void set_highlight_background() = 0;
264  //make this widget suitable as parent for a title
265  virtual void set_title_background() = 0;
266  //make this widget suitable for use in a toolbar
267  virtual void set_toolbar_background() = 0;
268  //trying to use a custom color for a background is generally a bad idea. If your need
269  //fits one of the above categories then that's a somewhat better choice
270  virtual void set_background(const Color& rBackColor) = 0;
271 
272  virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() = 0;
273 
274  virtual void connect_get_property_tree(const Link<tools::JsonWriter&, void>& rLink) = 0;
275 
276  // render the widget to an output device
277  virtual void draw(OutputDevice& rOutput, const tools::Rectangle& rRect) = 0;
278 
279  virtual ~Widget() {}
280 };
281 
282 class VCL_DLLPUBLIC Container : virtual public Widget
283 {
284 public:
285  // remove and add in one go
286  virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) = 0;
287  // recursively unset has-default on any buttons in the widget hierarchy
288  virtual void recursively_unset_default_buttons() = 0;
289  // create an XWindow as a child of this container. The XWindow is
290  // suitable to contain css::awt::XControl items
291  virtual css::uno::Reference<css::awt::XWindow> CreateChildFrame() = 0;
292 };
293 
294 class VCL_DLLPUBLIC Box : virtual public Container
295 {
296 public:
297  // Moves child to a new position in the list of children
298  virtual void reorder_child(weld::Widget* pWidget, int position) = 0;
299  // Sort ok/cancel etc buttons in platform order
300  virtual void sort_native_button_order() = 0;
301 };
302 
303 class VCL_DLLPUBLIC Paned : virtual public Container
304 {
305 public:
306  // set pixel position of divider
307  virtual void set_position(int nPos) = 0;
308  // get pixel position of divider
309  virtual int get_position() const = 0;
310 };
311 
312 class VCL_DLLPUBLIC ScrolledWindow : virtual public Container
313 {
314 protected:
317 
318  void signal_vadjustment_changed() { m_aVChangeHdl.Call(*this); }
319  void signal_hadjustment_changed() { m_aHChangeHdl.Call(*this); }
320 
321 public:
322  virtual void hadjustment_configure(int value, int lower, int upper, int step_increment,
323  int page_increment, int page_size)
324  = 0;
325  virtual int hadjustment_get_value() const = 0;
326  virtual void hadjustment_set_value(int value) = 0;
327  virtual int hadjustment_get_upper() const = 0;
328  virtual void hadjustment_set_upper(int upper) = 0;
329  virtual int hadjustment_get_page_size() const = 0;
330  virtual void hadjustment_set_page_size(int size) = 0;
331  virtual void hadjustment_set_page_increment(int size) = 0;
332  virtual void hadjustment_set_step_increment(int size) = 0;
333  virtual void set_hpolicy(VclPolicyType eHPolicy) = 0;
334  virtual VclPolicyType get_hpolicy() const = 0;
336  {
337  m_aHChangeHdl = rLink;
338  }
339  virtual int get_hscroll_height() const = 0;
340 
341  virtual void vadjustment_configure(int value, int lower, int upper, int step_increment,
342  int page_increment, int page_size)
343  = 0;
344  virtual int vadjustment_get_value() const = 0;
345  virtual void vadjustment_set_value(int value) = 0;
346  virtual int vadjustment_get_upper() const = 0;
347  virtual void vadjustment_set_upper(int upper) = 0;
348  virtual int vadjustment_get_page_size() const = 0;
349  virtual void vadjustment_set_page_size(int size) = 0;
350  virtual void vadjustment_set_page_increment(int size) = 0;
351  virtual void vadjustment_set_step_increment(int size) = 0;
352  virtual int vadjustment_get_lower() const = 0;
353  virtual void vadjustment_set_lower(int upper) = 0;
354  virtual void set_vpolicy(VclPolicyType eVPolicy) = 0;
355  virtual VclPolicyType get_vpolicy() const = 0;
357  {
358  m_aVChangeHdl = rLink;
359  }
360  virtual int get_vscroll_width() const = 0;
361 };
362 
363 class Label;
364 
365 class VCL_DLLPUBLIC Frame : virtual public Container
366 {
367 public:
368  virtual void set_label(const OUString& rText) = 0;
369  virtual OUString get_label() const = 0;
370  virtual std::unique_ptr<Label> weld_label_widget() const = 0;
371 };
372 
373 class VCL_DLLPUBLIC Notebook : virtual public Container
374 {
375 protected:
378 
379 public:
380  virtual int get_current_page() const = 0;
381  virtual int get_page_index(const OString& rIdent) const = 0;
382  virtual OString get_page_ident(int nPage) const = 0;
383  virtual OString get_current_page_ident() const = 0;
384  virtual void set_current_page(int nPage) = 0;
385  virtual void set_current_page(const OString& rIdent) = 0;
386  virtual void remove_page(const OString& rIdent) = 0;
387  virtual void insert_page(const OString& rIdent, const OUString& rLabel, int nPos) = 0;
388  void append_page(const OString& rIdent, const OUString& rLabel)
389  {
390  insert_page(rIdent, rLabel, -1);
391  }
392  virtual void set_tab_label_text(const OString& rIdent, const OUString& rLabel) = 0;
393  virtual OUString get_tab_label_text(const OString& rIdent) const = 0;
394  virtual int get_n_pages() const = 0;
395  virtual weld::Container* get_page(const OString& rIdent) const = 0;
396 
397  void connect_leave_page(const Link<const OString&, bool>& rLink) { m_aLeavePageHdl = rLink; }
398 
399  void connect_enter_page(const Link<const OString&, void>& rLink) { m_aEnterPageHdl = rLink; }
400 };
401 
403 {
404 public:
405  ScreenShotEntry(const OString& rHelpId, const basegfx::B2IRange& rB2IRange)
406  : msHelpId(rHelpId)
407  , maB2IRange(rB2IRange)
408  {
409  }
410 
411  const basegfx::B2IRange& getB2IRange() const { return maB2IRange; }
412 
413  const OString& GetHelpId() const { return msHelpId; }
414 
415 private:
416  OString msHelpId;
418 };
419 
420 typedef std::vector<ScreenShotEntry> ScreenShotCollection;
421 
422 class VCL_DLLPUBLIC Window : virtual public Container
423 {
424 protected:
427 
428  void signal_toplevel_focus_changed() { m_aTopLevelFocusChangedHdl.Call(*this); }
429 
430 public:
431  virtual void set_title(const OUString& rTitle) = 0;
432  virtual OUString get_title() const = 0;
433  virtual void set_busy_cursor(bool bBusy) = 0;
434  virtual void window_move(int x, int y) = 0;
435  virtual void set_modal(bool bModal) = 0;
436  virtual bool get_modal() const = 0;
437  virtual bool get_resizable() const = 0;
438  virtual Size get_size() const = 0;
439  virtual Point get_position() const = 0;
440  virtual tools::Rectangle get_monitor_workarea() const = 0;
441  // center window on is parent
442  //
443  // bTrackGeometryRequests set to true tries to ensure the window will end
444  // up still centered on its parent windows final size, taking into account
445  // that there may currently be pending geometry requests for the parent not
446  // yet processed by the underlying toolkit
447  //
448  // for e.g gtk this will means the window is always centered even when
449  // resized, calling set_centered_on_parent with false will turn this
450  // off again.
451  virtual void set_centered_on_parent(bool bTrackGeometryRequests) = 0;
452  virtual bool has_toplevel_focus() const = 0;
453  virtual void present() = 0;
454  virtual void set_window_state(const OString& rStr) = 0;
455  virtual OString get_window_state(WindowStateMask nMask) const = 0;
456 
457  virtual css::uno::Reference<css::awt::XWindow> GetXWindow() = 0;
458 
459  void connect_help(const Link<Widget&, bool>& rLink) { m_aHelpRequestHdl = rLink; }
461  {
462  m_aTopLevelFocusChangedHdl = rLink;
463  }
464 
465  virtual SystemEnvData get_system_data() const = 0;
466 
467  virtual void resize_to_request() = 0;
468 
469  // collect positions of widgets and their help ids for screenshot purposes
470  virtual ScreenShotCollection collect_screenshot_data() = 0;
471 
472  // render the widget to an output device
473  virtual VclPtr<VirtualDevice> screenshot() = 0;
474 };
475 
477 {
478 private:
480 
481 public:
483  : m_pWindow(pWindow)
484  {
485  if (m_pWindow)
486  m_pWindow->set_busy_cursor(true);
487  }
489  {
490  if (m_pWindow)
491  m_pWindow->set_busy_cursor(false);
492  }
493 };
494 
495 class Button;
496 
497 class VCL_DLLPUBLIC Dialog : virtual public Window
498 {
499 private:
501  virtual bool runAsync(std::shared_ptr<DialogController>,
502  const std::function<void(sal_Int32)>& func)
503  = 0;
504 
505 public:
506  virtual int run() = 0;
507  // Run async without a controller
508  // @param self - must point to this, to enforce that the dialog was created/held by a shared_ptr
509  virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf,
510  const std::function<void(sal_Int32)>& func)
511  = 0;
512  virtual void response(int response) = 0;
513  virtual void add_button(const OUString& rText, int response, const OString& rHelpId = OString())
514  = 0;
515  virtual void set_default_response(int response) = 0;
516  virtual Button* weld_widget_for_response(int response) = 0;
517  virtual Container* weld_content_area() = 0;
518 
519  // shrink the dialog down to shown just these widgets
520  virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) = 0;
521  // undo previous dialog collapse
522  virtual void undo_collapse() = 0;
523 
524  virtual void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink)
525  = 0;
526 };
527 
528 class VCL_DLLPUBLIC MessageDialog : virtual public Dialog
529 {
530 public:
531  virtual void set_primary_text(const OUString& rText) = 0;
532  virtual OUString get_primary_text() const = 0;
533  virtual void set_secondary_text(const OUString& rText) = 0;
534  virtual OUString get_secondary_text() const = 0;
535  virtual Container* weld_message_area() = 0;
536 };
537 
538 class VCL_DLLPUBLIC Assistant : virtual public Dialog
539 {
540 protected:
542 
543  bool signal_jump_page(const OString& rIdent) { return m_aJumpPageHdl.Call(rIdent); }
544 
545 public:
546  virtual int get_current_page() const = 0;
547  virtual int get_n_pages() const = 0;
548  virtual OString get_page_ident(int nPage) const = 0;
549  virtual OString get_current_page_ident() const = 0;
550  virtual void set_current_page(int nPage) = 0;
551  virtual void set_current_page(const OString& rIdent) = 0;
552  // move the page rIdent to position nIndex
553  virtual void set_page_index(const OString& rIdent, int nIndex) = 0;
554  virtual void set_page_title(const OString& rIdent, const OUString& rTitle) = 0;
555  virtual OUString get_page_title(const OString& rIdent) const = 0;
556  virtual void set_page_sensitive(const OString& rIdent, bool bSensitive) = 0;
557  virtual weld::Container* append_page(const OString& rIdent) = 0;
558 
559  virtual void set_page_side_help_id(const OString& rHelpId) = 0;
560 
561  void connect_jump_page(const Link<const OString&, bool>& rLink) { m_aJumpPageHdl = rLink; }
562 };
563 
565 {
566  OUString sString;
567  OUString sId;
568  OUString sImage;
569  ComboBoxEntry(const OUString& rString)
570  : sString(rString)
571  {
572  }
573  ComboBoxEntry(const OUString& rString, const OUString& rId)
574  : sString(rString)
575  , sId(rId)
576  {
577  }
578  ComboBoxEntry(const OUString& rString, const OUString& rId, const OUString& rImage)
579  : sString(rString)
580  , sId(rId)
581  , sImage(rImage)
582  {
583  }
584 };
585 
587 {
588  Normal,
589  Warning,
590  Error,
591 };
592 
593 class Menu;
594 
596 class VCL_DLLPUBLIC ComboBox : virtual public Container
597 {
598 private:
599  OUString m_sSavedValue;
600 
601 public:
602  // OUString is the id of the row, it may be null to measure the height of a generic line
603  typedef std::tuple<vcl::RenderContext&, const tools::Rectangle&, bool, const OUString&>
605 
606 protected:
611 
612  friend class ::LOKTrigger;
613 
614  void signal_changed() { m_aChangeHdl.Call(*this); }
615 
616  virtual void signal_popup_toggled() { m_aPopupToggledHdl.Call(*this); }
617 
620  bool bSelected, const OUString& rId)
621  {
622  m_aRenderHdl.Call(render_args(rDevice, rRect, bSelected, rId));
623  }
624 
626  Size signal_custom_get_size(vcl::RenderContext& rDevice) { return m_aGetSizeHdl.Call(rDevice); }
627 
628 public:
629  virtual void insert(int pos, const OUString& rStr, const OUString* pId,
630  const OUString* pIconName, VirtualDevice* pImageSurface)
631  = 0;
632  virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems, bool bKeepExisting)
633  = 0;
634  void insert_text(int pos, const OUString& rStr)
635  {
636  insert(pos, rStr, nullptr, nullptr, nullptr);
637  }
638  void append_text(const OUString& rStr) { insert(-1, rStr, nullptr, nullptr, nullptr); }
639  void append(const OUString& rId, const OUString& rStr)
640  {
641  insert(-1, rStr, &rId, nullptr, nullptr);
642  }
643  void append(const OUString& rId, const OUString& rStr, const OUString& rImage)
644  {
645  insert(-1, rStr, &rId, &rImage, nullptr);
646  }
647  void append(const OUString& rId, const OUString& rStr, VirtualDevice& rImage)
648  {
649  insert(-1, rStr, &rId, nullptr, &rImage);
650  }
651  virtual void insert_separator(int pos, const OUString& rId) = 0;
652  void append_separator(const OUString& rId) { insert_separator(-1, rId); }
653 
654  virtual int get_count() const = 0;
655  virtual void make_sorted() = 0;
656  virtual void clear() = 0;
657 
658  //by index
659  virtual int get_active() const = 0;
660  virtual void set_active(int pos) = 0;
661  virtual void remove(int pos) = 0;
662 
663  //by text
664  virtual OUString get_active_text() const = 0;
665  void set_active_text(const OUString& rStr) { set_active(find_text(rStr)); }
666  virtual OUString get_text(int pos) const = 0;
667  virtual int find_text(const OUString& rStr) const = 0;
668  void remove_text(const OUString& rText) { remove(find_text(rText)); }
669 
670  //by id
671  virtual OUString get_active_id() const = 0;
672  virtual void set_active_id(const OUString& rStr) = 0;
673  virtual OUString get_id(int pos) const = 0;
674  virtual void set_id(int row, const OUString& rId) = 0;
675  virtual int find_id(const OUString& rId) const = 0;
676  void remove_id(const OUString& rId) { remove(find_id(rId)); }
677 
678  /* m_aChangeHdl is called when the active item is changed. The can be due
679  to the user selecting a different item from the list or while typing
680  into the entry of a combo box with an entry.
681 
682  Use changed_by_direct_pick() to discover whether an item was actually explicitly
683  selected, e.g. from the menu.
684  */
685  void connect_changed(const Link<ComboBox&, void>& rLink) { m_aChangeHdl = rLink; }
686 
687  virtual bool changed_by_direct_pick() const = 0;
688 
689  virtual void connect_popup_toggled(const Link<ComboBox&, void>& rLink)
690  {
691  m_aPopupToggledHdl = rLink;
692  }
693 
694  //entry related
695  virtual bool has_entry() const = 0;
696  virtual void set_entry_message_type(EntryMessageType eType) = 0;
697  virtual void set_entry_text(const OUString& rStr) = 0;
698  virtual void set_entry_width_chars(int nChars) = 0;
699  virtual void set_entry_max_length(int nChars) = 0;
700  virtual void select_entry_region(int nStartPos, int nEndPos) = 0;
701  virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) = 0;
702  virtual void set_entry_completion(bool bEnable, bool bCaseSensitive = false) = 0;
703  virtual void set_entry_placeholder_text(const OUString& rText) = 0;
704  virtual void set_entry_editable(bool bEditable) = 0;
705  virtual void cut_entry_clipboard() = 0;
706  virtual void copy_entry_clipboard() = 0;
707  virtual void paste_entry_clipboard() = 0;
708 
709  // font size is in points, not pixels, e.g. see Window::[G]etPointFont
710  virtual void set_entry_font(const vcl::Font& rFont) = 0;
711  virtual vcl::Font get_entry_font() = 0;
712 
713  virtual bool get_popup_shown() const = 0;
714 
716  {
717  m_aEntryInsertTextHdl = rLink;
718  }
719 
720  // callback returns true to indicated no further processing of activate wanted
721  void connect_entry_activate(const Link<ComboBox&, bool>& rLink) { m_aEntryActivateHdl = rLink; }
722 
723  void save_value() { m_sSavedValue = get_active_text(); }
724  OUString const& get_saved_value() const { return m_sSavedValue; }
725  bool get_value_changed_from_saved() const { return m_sSavedValue != get_active_text(); }
726 
727  // for custom rendering a row
729  {
730  m_aGetSizeHdl = rLink;
731  }
732  void connect_custom_render(const Link<render_args, void>& rLink) { m_aRenderHdl = rLink; }
733  // call set_custom_renderer after setting custom callbacks
734  virtual void set_custom_renderer(bool bOn) = 0;
735  // create a virtual device compatible with the device passed in render_args wrt alpha
736  virtual VclPtr<VirtualDevice> create_render_virtual_device() const = 0;
737  // set a sub menu for a entry, only works with custom rendering
738  virtual void set_item_menu(const OString& rIdent, weld::Menu* pMenu) = 0;
739  // get the width needed to show the menu launcher in a custom row
740  virtual int get_menu_button_width() const = 0;
741 
742  // for mru support
743  virtual int get_max_mru_count() const = 0;
744  virtual void set_max_mru_count(int nCount) = 0;
745  virtual OUString get_mru_entries() const = 0;
746  virtual void set_mru_entries(const OUString& rEntries) = 0;
747 };
748 
750 {
751  Check,
752  Radio
753 };
754 
756 {
757 private:
758  TreeIter(const TreeIter&) = delete;
759  TreeIter& operator=(const TreeIter&) = delete;
760 
761 public:
762  TreeIter() {}
763  virtual bool equal(const TreeIter& rOther) const = 0;
764  virtual ~TreeIter() {}
765 };
766 
767 /* Model column indexes are considered to begin at 0, but with special columns
768  before index 0. A expander image column (and an additional optional toggle
769  button column when enable_toggle_buttons is used). Column index -1 is
770  reserved to access those columns.
771 */
772 class VCL_DLLPUBLIC TreeView : virtual public Container
773 {
774 public:
775  typedef std::pair<const TreeIter&, int> iter_col;
776  typedef std::pair<const TreeIter&, OUString> iter_string;
777  // OUString is the id of the row, it may be null to measure the height of a generic line
778  typedef std::pair<vcl::RenderContext&, const OUString&> get_size_args;
779  typedef std::tuple<vcl::RenderContext&, const tools::Rectangle&, bool, const OUString&>
781 
782 private:
783  OUString m_sSavedValue;
784 
785 protected:
792  // if handler returns false, the expansion of the row is refused
794  // if handler returns false, the collapse of the row is refused
798  // if handler returns true, then menu has been show and event is consumed
800  // if handler returns true, drag is disallowed, consumer can change bool
801  // arg to false to disable the treeview default dnd icon
803  std::function<int(const weld::TreeIter&, const weld::TreeIter&)> m_aCustomSort;
804 
805 protected:
806  void signal_changed() { m_aChangeHdl.Call(*this); }
807  bool signal_row_activated() { return m_aRowActivatedHdl.Call(*this); }
808  void signal_column_clicked(int nColumn) { m_aColumnClickedHdl.Call(nColumn); }
809  bool signal_expanding(const TreeIter& rIter)
810  {
811  return !m_aExpandingHdl.IsSet() || m_aExpandingHdl.Call(rIter);
812  }
813  bool signal_collapsing(const TreeIter& rIter)
814  {
815  return !m_aCollapsingHdl.IsSet() || m_aCollapsingHdl.Call(rIter);
816  }
817  void signal_visible_range_changed() { m_aVisibleRangeChangedHdl.Call(*this); }
818  void signal_model_changed() { m_aModelChangedHdl.Call(*this); }
819 
820  void signal_toggled(const iter_col& rIterCol) { m_aRadioToggleHdl.Call(rIterCol); }
821 
822  bool signal_editing_started(const TreeIter& rIter) { return m_aEditingStartedHdl.Call(rIter); }
823 
824  bool signal_editing_done(const iter_string& rIterText)
825  {
826  return m_aEditingDoneHdl.Call(rIterText);
827  }
828 
830  OUString signal_query_tooltip(const TreeIter& rIter) { return m_aQueryTooltipHdl.Call(rIter); }
831 
834  bool bSelected, const OUString& rId)
835  {
836  m_aRenderHdl.Call(render_args(rDevice, rRect, bSelected, rId));
837  }
838 
840  Size signal_custom_get_size(vcl::RenderContext& rDevice, const OUString& rId)
841  {
842  return m_aGetSizeHdl.Call(get_size_args(rDevice, rId));
843  }
844 
845 public:
847  {
848  assert(!m_aQueryTooltipHdl.IsSet() || !rLink.IsSet());
849  m_aQueryTooltipHdl = rLink;
850  }
851 
852  virtual void insert(const TreeIter* pParent, int pos, const OUString* pStr, const OUString* pId,
853  const OUString* pIconName, VirtualDevice* pImageSurface,
854  bool bChildrenOnDemand, TreeIter* pRet)
855  = 0;
856 
857  void insert(int nRow, TreeIter* pRet = nullptr)
858  {
859  insert(nullptr, nRow, nullptr, nullptr, nullptr, nullptr, false, pRet);
860  }
861 
862  void append(TreeIter* pRet = nullptr) { insert(-1, pRet); }
863 
864  void insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName,
865  VirtualDevice* pImageSurface)
866  {
867  insert(nullptr, pos, &rStr, pId, pIconName, pImageSurface, false, nullptr);
868  }
869  void insert_text(int pos, const OUString& rStr)
870  {
871  insert(nullptr, pos, &rStr, nullptr, nullptr, nullptr, false, nullptr);
872  }
873  void append_text(const OUString& rStr)
874  {
875  insert(nullptr, -1, &rStr, nullptr, nullptr, nullptr, false, nullptr);
876  }
877  void append(const OUString& rId, const OUString& rStr)
878  {
879  insert(nullptr, -1, &rStr, &rId, nullptr, nullptr, false, nullptr);
880  }
881  void append(const OUString& rId, const OUString& rStr, const OUString& rImage)
882  {
883  insert(nullptr, -1, &rStr, &rId, &rImage, nullptr, false, nullptr);
884  }
885  void append(const TreeIter* pParent, const OUString& rStr)
886  {
887  insert(pParent, -1, &rStr, nullptr, nullptr, nullptr, false, nullptr);
888  }
889 
890  virtual void insert_separator(int pos, const OUString& rId) = 0;
891  void append_separator(const OUString& rId) { insert_separator(-1, rId); }
892 
893  void connect_changed(const Link<TreeView&, void>& rLink) { m_aChangeHdl = rLink; }
894 
895  /* A row is "activated" when the user double clicks a treeview row. It may
896  also be emitted when a row is selected and Space or Enter is pressed.
897 
898  a return of "true" means the activation has been handled, a "false" propagates
899  the activation to the default handler which expands/collapses the row, if possible.
900  */
901  void connect_row_activated(const Link<TreeView&, bool>& rLink) { m_aRowActivatedHdl = rLink; }
902 
903  // Argument is a pair of iter, col describing the toggled node
904  void connect_toggled(const Link<const iter_col&, void>& rLink) { m_aRadioToggleHdl = rLink; }
905 
906  void connect_column_clicked(const Link<int, void>& rLink) { m_aColumnClickedHdl = rLink; }
907  void connect_model_changed(const Link<TreeView&, void>& rLink) { m_aModelChangedHdl = rLink; }
908 
909  virtual OUString get_selected_text() const = 0;
910  virtual OUString get_selected_id() const = 0;
911 
912  // call before inserting any content and connecting to toggle signals,
913  // an pre-inserted checkbutton column will exist at the start of every row
914  // inserted after this call which can be accessed with col index -1
915  virtual void enable_toggle_buttons(ColumnToggleType eType) = 0;
916 
917  //by index
918  virtual int get_selected_index() const = 0;
919  //Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
920  virtual void select(int pos) = 0;
921  virtual void unselect(int pos) = 0;
922  virtual void remove(int pos) = 0;
923  // col index -1 gets the first text column
924  virtual OUString get_text(int row, int col = -1) const = 0;
925  // col index -1 sets the first text column
926  virtual void set_text(int row, const OUString& rText, int col = -1) = 0;
927  // col index -1 sets the first text column
928  virtual void set_sensitive(int row, bool bSensitive, int col = -1) = 0;
929  virtual void set_id(int row, const OUString& rId) = 0;
930  // col index -1 sets the expander toggle, enable_toggle_buttons must have been called to create that column
931  virtual void set_toggle(int row, TriState eState, int col = -1) = 0;
932  // col index -1 gets the expander toggle, enable_toggle_buttons must have been called to create that column
933  virtual TriState get_toggle(int row, int col = -1) const = 0;
934  // col index -1 sets the expander image
935  virtual void set_image(int row, const OUString& rImage, int col = -1) = 0;
936  // col index -1 sets the expander image
937  virtual void set_image(int row, VirtualDevice& rImage, int col = -1) = 0;
938  // col index -1 sets the expander image
939  virtual void set_image(int row, const css::uno::Reference<css::graphic::XGraphic>& rImage,
940  int col = -1)
941  = 0;
942  virtual void set_text_emphasis(int row, bool bOn, int col) = 0;
943  virtual bool get_text_emphasis(int row, int col) const = 0;
944  virtual void set_text_align(int row, double fAlign, int col) = 0;
945  virtual void swap(int pos1, int pos2) = 0;
946  virtual std::vector<int> get_selected_rows() const = 0;
947  virtual void set_font_color(int pos, const Color& rColor) = 0;
948  // scroll to make 'row' visible, this will also expand all parent rows of 'row' as necessary to
949  // make 'row' visible
950  virtual void scroll_to_row(int row) = 0;
951  virtual bool is_selected(int pos) const = 0;
952  virtual int get_cursor_index() const = 0;
953  virtual void set_cursor(int pos) = 0;
954 
955  //by text
956  virtual int find_text(const OUString& rText) const = 0;
957  //Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
958  void select_text(const OUString& rText) { select(find_text(rText)); }
959  void remove_text(const OUString& rText) { remove(find_text(rText)); }
960  std::vector<OUString> get_selected_rows_text() const
961  {
962  std::vector<int> aRows(get_selected_rows());
963  std::vector<OUString> aRet;
964  aRet.reserve(aRows.size());
965  for (auto a : aRows)
966  aRet.push_back(get_text(a));
967  return aRet;
968  }
969 
970  //by id
971  virtual OUString get_id(int pos) const = 0;
972  virtual int find_id(const OUString& rId) const = 0;
973  //Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
974  void select_id(const OUString& rId) { select(find_id(rId)); }
975  void remove_id(const OUString& rText) { remove(find_id(rText)); }
976 
977  //via iter
978  virtual std::unique_ptr<TreeIter> make_iterator(const TreeIter* pOrig = nullptr) const = 0;
979  virtual void copy_iterator(const TreeIter& rSource, TreeIter& rDest) const = 0;
980  virtual bool get_selected(TreeIter* pIter) const = 0;
981  virtual bool get_cursor(TreeIter* pIter) const = 0;
982  virtual void set_cursor(const TreeIter& rIter) = 0;
983  virtual bool get_iter_first(TreeIter& rIter) const = 0;
984  // set iter to point to next node at the current level
985  virtual bool iter_next_sibling(TreeIter& rIter) const = 0;
986  // set iter to point to previous node at the current level
987  virtual bool iter_previous_sibling(TreeIter& rIter) const = 0;
988  // set iter to point to next node, depth first, then sibling
989  virtual bool iter_next(TreeIter& rIter) const = 0;
990  // set iter to point to previous node, sibling first then depth
991  virtual bool iter_previous(TreeIter& rIter) const = 0;
992  // set iter to point to first child node
993  virtual bool iter_children(TreeIter& rIter) const = 0;
994  bool iter_nth_sibling(TreeIter& rIter, int nChild) const
995  {
996  bool bRet = true;
997  for (int i = 0; i < nChild && bRet; ++i)
998  bRet = iter_next_sibling(rIter);
999  return bRet;
1000  }
1001  bool iter_nth_child(TreeIter& rIter, int nChild) const
1002  {
1003  if (!iter_children(rIter))
1004  return false;
1005  return iter_nth_sibling(rIter, nChild);
1006  }
1007  virtual bool iter_parent(TreeIter& rIter) const = 0;
1008  virtual int get_iter_depth(const TreeIter& rIter) const = 0;
1009  virtual int get_iter_index_in_parent(const TreeIter& rIter) const = 0;
1010  /* Compares two paths. If a appears before b in a tree, then -1 is returned.
1011  If b appears before a , then 1 is returned. If the two nodes are equal,
1012  then 0 is returned.
1013  */
1014  virtual int iter_compare(const TreeIter& a, const TreeIter& b) const = 0;
1015  virtual bool iter_has_child(const TreeIter& rIter) const = 0;
1016  // returns the number of direct children rIter has
1017  virtual int iter_n_children(const TreeIter& rIter) const = 0;
1018  virtual void remove(const TreeIter& rIter) = 0;
1019  //Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
1020  virtual void select(const TreeIter& rIter) = 0;
1021  virtual void unselect(const TreeIter& rIter) = 0;
1022  virtual bool get_row_expanded(const TreeIter& rIter) const = 0;
1023  virtual bool get_children_on_demand(const TreeIter& rIter) const = 0;
1024  virtual void set_children_on_demand(const TreeIter& rIter, bool bChildrenOnDemand) = 0;
1025  //visually indent this row as if it was at get_iter_depth() + nIndentLevel
1026  virtual void set_extra_row_indent(const TreeIter& rIter, int nIndentLevel) = 0;
1027  virtual void expand_row(const TreeIter& rIter) = 0;
1028  virtual void collapse_row(const TreeIter& rIter) = 0;
1029  // col index -1 sets the first text column
1030  virtual void set_text(const TreeIter& rIter, const OUString& rStr, int col = -1) = 0;
1031  // col index -1 sets the first text column
1032  virtual void set_sensitive(const TreeIter& rIter, bool bSensitive, int col = -1) = 0;
1033  virtual void set_text_emphasis(const TreeIter& rIter, bool bOn, int col) = 0;
1034  virtual bool get_text_emphasis(const TreeIter& rIter, int col) const = 0;
1035  virtual void set_text_align(const TreeIter& rIter, double fAlign, int col) = 0;
1036  // col index -1 sets the expander toggle, enable_toggle_buttons must have been called to create that column
1037  virtual void set_toggle(const TreeIter& rIter, TriState bOn, int col = -1) = 0;
1038  // col index -1 gets the expander toggle, enable_toggle_buttons must have been called to create that column
1039  virtual TriState get_toggle(const TreeIter& rIter, int col = -1) const = 0;
1040  // col index -1 gets the first text column
1041  virtual OUString get_text(const TreeIter& rIter, int col = -1) const = 0;
1042  virtual void set_id(const TreeIter& rIter, const OUString& rId) = 0;
1043  virtual OUString get_id(const TreeIter& rIter) const = 0;
1044  // col index -1 sets the expander image
1045  virtual void set_image(const TreeIter& rIter, const OUString& rImage, int col = -1) = 0;
1046  // col index -1 sets the expander image
1047  virtual void set_image(const TreeIter& rIter, VirtualDevice& rImage, int col = -1) = 0;
1048  // col index -1 sets the expander image
1049  virtual void set_image(const TreeIter& rIter,
1050  const css::uno::Reference<css::graphic::XGraphic>& rImage, int col = -1)
1051  = 0;
1052  virtual void set_font_color(const TreeIter& rIter, const Color& rColor) = 0;
1053  // scroll to make rIter visible, this will also expand all parent rows of rIter as necessary to
1054  // make rIter visible
1055  virtual void scroll_to_row(const TreeIter& rIter) = 0;
1056  virtual bool is_selected(const TreeIter& rIter) const = 0;
1057 
1058  virtual void move_subtree(TreeIter& rNode, const TreeIter* pNewParent, int nIndexInNewParent)
1059  = 0;
1060 
1061  // call func on each element until func returns true or we run out of elements
1062  virtual void all_foreach(const std::function<bool(TreeIter&)>& func) = 0;
1063  // call func on each selected element until func returns true or we run out of elements
1064  virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) = 0;
1065  // call func on each visible element until func returns true or we run out of elements
1066  virtual void visible_foreach(const std::function<bool(TreeIter&)>& func) = 0;
1067  // clear the tree, then add nSourceCount rows, call func on each row
1068  // inserted with an arg of the index that this row will be when bulk insert
1069  // ends.
1070  //
1071  // this enables inserting the entries backwards in models where that is faster,
1072  //
1073  // pFixedWidths is optional, when present each matching entry col text
1074  // width will not be measured, and the fixed width used instead. Use
1075  // sparingly because wider text than the fixed width is clipped and cannot
1076  // be scrolled into view horizontally.
1077  virtual void bulk_insert_for_each(int nSourceCount,
1078  const std::function<void(TreeIter&, int nSourceIndex)>& func,
1079  const std::vector<int>* pFixedWidths = nullptr)
1080  = 0;
1081 
1082  void connect_expanding(const Link<const TreeIter&, bool>& rLink) { m_aExpandingHdl = rLink; }
1083  void connect_collapsing(const Link<const TreeIter&, bool>& rLink) { m_aCollapsingHdl = rLink; }
1084 
1085  // rStartLink returns true to allow editing, false to disallow
1086  // rEndLink returns true to accept the edit, false to reject
1087  virtual void connect_editing(const Link<const TreeIter&, bool>& rStartLink,
1088  const Link<const iter_string&, bool>& rEndLink)
1089  {
1090  assert(rStartLink.IsSet() == rEndLink.IsSet() && "should be both on or both off");
1091  m_aEditingStartedHdl = rStartLink;
1092  m_aEditingDoneHdl = rEndLink;
1093  }
1094 
1095  virtual void start_editing(const weld::TreeIter& rEntry) = 0;
1096  virtual void end_editing() = 0;
1097 
1099  {
1100  assert(!m_aVisibleRangeChangedHdl.IsSet() || !rLink.IsSet());
1101  m_aVisibleRangeChangedHdl = rLink;
1102  }
1103 
1105  {
1106  m_aPopupMenuHdl = rLink;
1107  }
1108 
1109  virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferrable,
1110  sal_uInt8 eDNDConstants)
1111  = 0;
1112 
1113  void connect_drag_begin(const Link<bool&, bool>& rLink) { m_aDragBeginHdl = rLink; }
1114 
1115  //all of them. Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
1116  void select_all() { unselect(-1); }
1117  void unselect_all() { select(-1); }
1118 
1119  // return the number of toplevel nodes
1120  virtual int n_children() const = 0;
1121 
1122  // afterwards, entries will be in default ascending sort order
1123  virtual void make_sorted() = 0;
1124  virtual void make_unsorted() = 0;
1125  virtual bool get_sort_order() const = 0;
1126  virtual void set_sort_order(bool bAscending) = 0;
1127 
1128  // TRUE ascending, FALSE, descending, INDET, neither (off)
1129  virtual void set_sort_indicator(TriState eState, int nColumn) = 0;
1130  virtual TriState get_sort_indicator(int nColumn) const = 0;
1131 
1132  virtual int get_sort_column() const = 0;
1133  virtual void set_sort_column(int nColumn) = 0;
1134 
1135  virtual void
1136  set_sort_func(const std::function<int(const weld::TreeIter&, const weld::TreeIter&)>& func)
1137  {
1138  m_aCustomSort = func;
1139  }
1140 
1141  virtual void clear() = 0;
1142  virtual int get_height_rows(int nRows) const = 0;
1143 
1144  virtual void columns_autosize() = 0;
1145  virtual void set_column_fixed_widths(const std::vector<int>& rWidths) = 0;
1146  virtual void set_column_editables(const std::vector<bool>& rEditables) = 0;
1147  virtual int get_column_width(int nCol) const = 0;
1148  virtual void set_centered_column(int nCol) = 0;
1149  virtual OUString get_column_title(int nColumn) const = 0;
1150  virtual void set_column_title(int nColumn, const OUString& rTitle) = 0;
1151 
1152  int get_checkbox_column_width() const { return get_approximate_digit_width() * 3 + 6; }
1153 
1154  virtual void set_selection_mode(SelectionMode eMode) = 0;
1155  virtual int count_selected_rows() const = 0;
1156  // remove the selected nodes
1157  virtual void remove_selection() = 0;
1158 
1159  virtual void vadjustment_set_value(int value) = 0;
1160  virtual int vadjustment_get_value() const = 0;
1161 
1162  void save_value() { m_sSavedValue = get_selected_text(); }
1163  OUString const& get_saved_value() const { return m_sSavedValue; }
1164  bool get_value_changed_from_saved() const { return m_sSavedValue != get_selected_text(); }
1165 
1166  virtual void set_show_expanders(bool bShow) = 0;
1167 
1168  // for custom rendering a cell
1169  void connect_custom_get_size(const Link<get_size_args, Size>& rLink) { m_aGetSizeHdl = rLink; }
1170  void connect_custom_render(const Link<render_args, void>& rLink) { m_aRenderHdl = rLink; }
1171  // call set_column_custom_renderer after setting custom callbacks
1172  virtual void set_column_custom_renderer(int nColumn, bool bEnable) = 0;
1173  // redraw all rows, typically only useful with custom rendering to redraw due to external
1174  // state change
1175  virtual void queue_draw() = 0;
1176 
1177  /* with bDnDMode false simply return the row under the point
1178  *
1179  * with bDnDMode true:
1180  * a) return the row which should be dropped on, which may
1181  * be different from the row the mouse is over in some backends where
1182  * positioning the mouse on the bottom half of a row indicates to drop
1183  * after the row
1184  * b) dnd highlight the dest row
1185  */
1186  virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult, bool bDnDMode) = 0;
1187  virtual void unset_drag_dest_row() = 0;
1188  virtual tools::Rectangle get_row_area(const weld::TreeIter& rIter) const = 0;
1189  // for dragging and dropping between TreeViews, return the active source
1190  virtual TreeView* get_drag_source() const = 0;
1191 
1192  using Widget::set_sensitive;
1193 };
1194 
1195 class VCL_DLLPUBLIC IconView : virtual public Container
1196 {
1197 private:
1198  OUString m_sSavedValue;
1199 
1200 protected:
1203 
1204  void signal_selection_changed() { m_aSelectionChangeHdl.Call(*this); }
1205  bool signal_item_activated() { return m_aItemActivatedHdl.Call(*this); }
1206 
1207 public:
1208  virtual void insert(int pos, const OUString* pStr, const OUString* pId,
1209  const OUString* pIconName, TreeIter* pRet)
1210  = 0;
1211 
1212  void append(const OUString& rId, const OUString& rStr, const OUString& rImage)
1213  {
1214  insert(-1, &rStr, &rId, &rImage, nullptr);
1215  }
1216 
1218  {
1219  m_aSelectionChangeHdl = rLink;
1220  }
1221 
1222  /* A row is "activated" when the user double clicks a treeview row. It may
1223  also be emitted when a row is selected and Space or Enter is pressed.
1224 
1225  a return of "true" means the activation has been handled, a "false" propagates
1226  the activation to the default handler which expands/collapses the row, if possible.
1227  */
1228  void connect_item_activated(const Link<IconView&, bool>& rLink) { m_aItemActivatedHdl = rLink; }
1229 
1230  virtual OUString get_selected_id() const = 0;
1231 
1232  virtual void clear() = 0;
1233 
1234  virtual int count_selected_items() const = 0;
1235 
1236  virtual OUString get_selected_text() const = 0;
1237 
1238  //by index. Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
1239  virtual void select(int pos) = 0;
1240  virtual void unselect(int pos) = 0;
1241 
1242  //via iter
1243  virtual std::unique_ptr<TreeIter> make_iterator(const TreeIter* pOrig = nullptr) const = 0;
1244  virtual bool get_selected(TreeIter* pIter) const = 0;
1245  virtual bool get_cursor(TreeIter* pIter) const = 0;
1246  virtual void set_cursor(const TreeIter& rIter) = 0;
1247  virtual bool get_iter_first(TreeIter& rIter) const = 0;
1248  virtual OUString get_id(const TreeIter& rIter) const = 0;
1249  virtual void scroll_to_item(const TreeIter& rIter) = 0;
1250 
1251  // call func on each selected element until func returns true or we run out of elements
1252  virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) = 0;
1253 
1254  //all of them. Don't select when frozen, select after thaw. Note selection doesn't survive a freeze.
1255  void select_all() { unselect(-1); }
1256  void unselect_all() { select(-1); }
1257 
1258  // return the number of toplevel nodes
1259  virtual int n_children() const = 0;
1260 
1261  void save_value() { m_sSavedValue = get_selected_text(); }
1262  OUString const& get_saved_value() const { return m_sSavedValue; }
1263  bool get_value_changed_from_saved() const { return m_sSavedValue != get_selected_text(); }
1264 };
1265 
1266 class VCL_DLLPUBLIC Button : virtual public Container
1267 {
1268 protected:
1270 
1271  void signal_clicked() { m_aClickHdl.Call(*this); }
1272 
1273 public:
1274  virtual void set_label(const OUString& rText) = 0;
1275  // pDevice, the image for the button, or nullptr to unset
1276  virtual void set_image(VirtualDevice* pDevice) = 0;
1277  virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) = 0;
1278  virtual void set_from_icon_name(const OUString& rIconName) = 0;
1279  virtual OUString get_label() const = 0;
1280  virtual void set_label_line_wrap(bool wrap) = 0;
1281  void clicked() { signal_clicked(); }
1282 
1283  // font size is in points, not pixels, e.g. see Window::[G]etPointFont
1284  virtual void set_font(const vcl::Font& rFont) = 0;
1285 
1286  void connect_clicked(const Link<Button&, void>& rLink) { m_aClickHdl = rLink; }
1287 };
1288 
1289 class VCL_DLLPUBLIC ToggleButton : virtual public Button
1290 {
1291 protected:
1293  TriState m_eSavedValue = TRISTATE_FALSE;
1294 
1295  void signal_toggled() { m_aToggleHdl.Call(*this); }
1296 
1297 public:
1298  virtual void set_active(bool active) = 0;
1299  virtual bool get_active() const = 0;
1300 
1301  virtual void set_inconsistent(bool inconsistent) = 0;
1302  virtual bool get_inconsistent() const = 0;
1303 
1305  {
1306  if (get_inconsistent())
1307  return TRISTATE_INDET;
1308  else if (get_active())
1309  return TRISTATE_TRUE;
1310  return TRISTATE_FALSE;
1311  }
1312 
1313  void set_state(TriState eState)
1314  {
1315  switch (eState)
1316  {
1317  case TRISTATE_INDET:
1318  set_inconsistent(true);
1319  break;
1320  case TRISTATE_TRUE:
1321  set_inconsistent(false);
1322  set_active(true);
1323  break;
1324  case TRISTATE_FALSE:
1325  set_inconsistent(false);
1326  set_active(false);
1327  break;
1328  }
1329  }
1330 
1331  void save_state() { m_eSavedValue = get_state(); }
1332  TriState get_saved_state() const { return m_eSavedValue; }
1333  bool get_state_changed_from_saved() const { return m_eSavedValue != get_state(); }
1334 
1335  virtual void connect_toggled(const Link<ToggleButton&, void>& rLink) { m_aToggleHdl = rLink; }
1336 };
1337 
1339 {
1343  : eState(TRISTATE_INDET)
1344  , bTriStateEnabled(true)
1345  {
1346  }
1347  void ButtonToggled(ToggleButton& rToggle);
1348 };
1349 
1350 class VCL_DLLPUBLIC MenuButton : virtual public ToggleButton
1351 {
1352 protected:
1354 
1355  void signal_selected(const OString& rIdent) { m_aSelectHdl.Call(rIdent); }
1356 
1357 public:
1358  void connect_selected(const Link<const OString&, void>& rLink) { m_aSelectHdl = rLink; }
1359 
1360  virtual void insert_item(int pos, const OUString& rId, const OUString& rStr,
1361  const OUString* pIconName, VirtualDevice* pImageSurface,
1362  TriState eCheckRadioFalse)
1363  = 0;
1364  void append_item(const OUString& rId, const OUString& rStr)
1365  {
1366  insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_INDET);
1367  }
1368  void append_item_check(const OUString& rId, const OUString& rStr)
1369  {
1370  insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_TRUE);
1371  }
1372  void append_item_radio(const OUString& rId, const OUString& rStr)
1373  {
1374  insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_FALSE);
1375  }
1376  void append_item(const OUString& rId, const OUString& rStr, const OUString& rImage)
1377  {
1378  insert_item(-1, rId, rStr, &rImage, nullptr, TRISTATE_INDET);
1379  }
1380  void append_item(const OUString& rId, const OUString& rStr, VirtualDevice& rImage)
1381  {
1382  insert_item(-1, rId, rStr, nullptr, &rImage, TRISTATE_INDET);
1383  }
1384  virtual void insert_separator(int pos, const OUString& rId) = 0;
1385  void append_separator(const OUString& rId) { insert_separator(-1, rId); }
1386  virtual void remove_item(const OString& rId) = 0;
1387  virtual void clear() = 0;
1388  virtual void set_item_sensitive(const OString& rIdent, bool bSensitive) = 0;
1389  virtual void set_item_active(const OString& rIdent, bool bActive) = 0;
1390  virtual void set_item_label(const OString& rIdent, const OUString& rLabel) = 0;
1391  virtual OUString get_item_label(const OString& rIdent) const = 0;
1392  virtual void set_item_help_id(const OString& rIdent, const OString& rHelpId) = 0;
1393  virtual void set_item_visible(const OString& rIdent, bool bVisible) = 0;
1394  virtual OString get_item_help_id(const OString& rIdent) const = 0;
1395 
1396  virtual void set_popover(weld::Widget* pPopover) = 0;
1397 };
1398 
1400 {
1401 };
1402 
1404 {
1405 };
1406 
1407 class VCL_DLLPUBLIC LinkButton : virtual public Container
1408 {
1409 protected:
1411 
1412  bool signal_activate_link() { return m_aActivateLinkHdl.Call(*this); }
1413 
1414 public:
1415  virtual void set_label(const OUString& rText) = 0;
1416  virtual OUString get_label() const = 0;
1417  virtual void set_uri(const OUString& rUri) = 0;
1418  virtual OUString get_uri() const = 0;
1419 
1420  void connect_activate_link(const Link<LinkButton&, bool>& rLink) { m_aActivateLinkHdl = rLink; }
1421 };
1422 
1423 class VCL_DLLPUBLIC Scale : virtual public Widget
1424 {
1425 protected:
1427 
1428  void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
1429 
1430 public:
1431  virtual void set_value(int value) = 0;
1432  virtual int get_value() const = 0;
1433  virtual void set_range(int min, int max) = 0;
1434 
1435  virtual void set_increments(int step, int page) = 0;
1436  virtual void get_increments(int& step, int& page) const = 0;
1437 
1438  void connect_value_changed(const Link<Scale&, void>& rLink) { m_aValueChangedHdl = rLink; }
1439 };
1440 
1441 class VCL_DLLPUBLIC Spinner : virtual public Widget
1442 {
1443 public:
1444  virtual void start() = 0;
1445  virtual void stop() = 0;
1446 };
1447 
1448 class VCL_DLLPUBLIC ProgressBar : virtual public Widget
1449 {
1450 public:
1451  //0-100
1452  virtual void set_percentage(int value) = 0;
1453  virtual OUString get_text() const = 0;
1454  virtual void set_text(const OUString& rText) = 0;
1455 };
1456 
1457 class VCL_DLLPUBLIC Entry : virtual public Widget
1458 {
1459 private:
1460  OUString m_sSavedValue;
1461 
1462 protected:
1467 
1468  friend class ::LOKTrigger;
1469 
1470  void signal_changed() { m_aChangeHdl.Call(*this); }
1471  void signal_cursor_position() { m_aCursorPositionHdl.Call(*this); }
1472 
1473 public:
1474  virtual void set_text(const OUString& rText) = 0;
1475  virtual OUString get_text() const = 0;
1476  virtual void set_width_chars(int nChars) = 0;
1477  virtual int get_width_chars() const = 0;
1478  // The maximum length of the entry. Use 0 for no maximum
1479  virtual void set_max_length(int nChars) = 0;
1480  // nEndPos can be -1 in order to select all text
1481  virtual void select_region(int nStartPos, int nEndPos) = 0;
1482  // returns true if the selection has nonzero length
1483  virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0;
1484  virtual void replace_selection(const OUString& rText) = 0;
1485  // nCursorPos can be -1 to set to the end
1486  virtual void set_position(int nCursorPos) = 0;
1487  virtual int get_position() const = 0;
1488  virtual void set_editable(bool bEditable) = 0;
1489  virtual bool get_editable() const = 0;
1490  virtual void set_message_type(EntryMessageType eType) = 0;
1491  virtual void set_placeholder_text(const OUString& rText) = 0;
1492 
1493  virtual void set_overwrite_mode(bool bOn) = 0;
1494  virtual bool get_overwrite_mode() const = 0;
1495 
1496  // font size is in points, not pixels, e.g. see Window::[G]etPointFont
1497  virtual void set_font(const vcl::Font& rFont) = 0;
1498 
1499  /*
1500  If you want to set a warning or error state, see set_message_type
1501  instead where, if the toolkit supports it, a specific warning/error
1502  indicator is shown.
1503 
1504  This explicit text color method exists to support rendering the
1505  SvNumberformat color feature.
1506  */
1507  virtual void set_font_color(const Color& rColor) = 0;
1508 
1509  virtual void connect_changed(const Link<Entry&, void>& rLink) { m_aChangeHdl = rLink; }
1510  void connect_insert_text(const Link<OUString&, bool>& rLink) { m_aInsertTextHdl = rLink; }
1511  // callback returns true to indicated no further processing of activate wanted
1512  void connect_activate(const Link<Entry&, bool>& rLink) { m_aActivateHdl = rLink; }
1513  virtual void connect_cursor_position(const Link<Entry&, void>& rLink)
1514  {
1515  m_aCursorPositionHdl = rLink;
1516  }
1517 
1518  virtual void cut_clipboard() = 0;
1519  virtual void copy_clipboard() = 0;
1520  virtual void paste_clipboard() = 0;
1521 
1522  virtual void set_alignment(TxtAlign eXAlign) = 0;
1523 
1524  void save_value() { m_sSavedValue = get_text(); }
1525  OUString const& get_saved_value() const { return m_sSavedValue; }
1526  bool get_value_changed_from_saved() const { return m_sSavedValue != get_text(); }
1527 };
1528 
1529 class VCL_DLLPUBLIC SpinButton : virtual public Entry
1530 {
1531 protected:
1535 
1536  void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
1537 
1539  {
1540  if (!m_aOutputHdl.IsSet())
1541  return false;
1542  m_aOutputHdl.Call(*this);
1543  return true;
1544  }
1545 
1546  TriState signal_input(int* result)
1547  {
1548  if (!m_aInputHdl.IsSet())
1549  return TRISTATE_INDET;
1550  return m_aInputHdl.Call(result) ? TRISTATE_TRUE : TRISTATE_FALSE;
1551  }
1552 
1553 public:
1554  virtual void set_value(int value) = 0;
1555  virtual int get_value() const = 0;
1556  virtual void set_range(int min, int max) = 0;
1557  virtual void get_range(int& min, int& max) const = 0;
1558  void set_min(int min)
1559  {
1560  int dummy, max;
1561  get_range(dummy, max);
1562  set_range(min, max);
1563  }
1564  void set_max(int max)
1565  {
1566  int min, dummy;
1567  get_range(min, dummy);
1568  set_range(min, max);
1569  }
1570  int get_min() const
1571  {
1572  int min, dummy;
1573  get_range(min, dummy);
1574  return min;
1575  }
1576  int get_max() const
1577  {
1578  int dummy, max;
1579  get_range(dummy, max);
1580  return max;
1581  }
1582  virtual void set_increments(int step, int page) = 0;
1583  virtual void get_increments(int& step, int& page) const = 0;
1584  virtual void set_digits(unsigned int digits) = 0;
1585  virtual unsigned int get_digits() const = 0;
1586 
1587  void connect_value_changed(const Link<SpinButton&, void>& rLink) { m_aValueChangedHdl = rLink; }
1588 
1589  void connect_output(const Link<SpinButton&, void>& rLink) { m_aOutputHdl = rLink; }
1590  void connect_input(const Link<int*, bool>& rLink) { m_aInputHdl = rLink; }
1591 
1592  int normalize(int nValue) const { return (nValue * Power10(get_digits())); }
1593 
1594  int denormalize(int nValue) const;
1595 
1596  static unsigned int Power10(unsigned int n);
1597 };
1598 
1599 class EntryFormatter;
1600 
1601 // Similar to a SpinButton, but input and output formatting and range/value
1602 // are managed by a more complex Formatter which can support doubles.
1604 {
1605 protected:
1607 
1608  void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
1609 
1610 public:
1611  virtual Formatter& GetFormatter() = 0;
1612  // does not take ownership, and so must be deregistered if pFormatter
1613  // is destroyed
1614  virtual void SetFormatter(weld::EntryFormatter* pFormatter) = 0;
1615 
1617  {
1618  m_aValueChangedHdl = rLink;
1619  }
1620 
1621 private:
1622  friend class EntryFormatter;
1623  virtual void sync_range_from_formatter() = 0;
1624  virtual void sync_value_from_formatter() = 0;
1625  virtual void sync_increments_from_formatter() = 0;
1626 };
1627 
1628 class VCL_DLLPUBLIC Image : virtual public Widget
1629 {
1630 public:
1631  virtual void set_from_icon_name(const OUString& rIconName) = 0;
1632  virtual void set_image(VirtualDevice* pDevice) = 0;
1633  virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) = 0;
1634 };
1635 
1636 class VCL_DLLPUBLIC Calendar : virtual public Widget
1637 {
1638 protected:
1641 
1642  void signal_selected() { m_aSelectedHdl.Call(*this); }
1643  void signal_activated() { m_aActivatedHdl.Call(*this); }
1644 
1645 public:
1646  void connect_selected(const Link<Calendar&, void>& rLink) { m_aSelectedHdl = rLink; }
1647  void connect_activated(const Link<Calendar&, void>& rLink) { m_aActivatedHdl = rLink; }
1648 
1649  virtual void set_date(const Date& rDate) = 0;
1650  virtual Date get_date() const = 0;
1651 };
1652 
1653 // an entry + treeview pair, where the entry autocompletes from the
1654 // treeview list, and selecting something in the list sets the
1655 // entry to that text, i.e. a visually exploded ComboBox
1656 class VCL_DLLPUBLIC EntryTreeView : virtual public ComboBox
1657 {
1658 private:
1659  DECL_DLLPRIVATE_LINK(ClickHdl, weld::TreeView&, void);
1660  DECL_DLLPRIVATE_LINK(ModifyHdl, weld::Entry&, void);
1661  void EntryModifyHdl(const weld::Entry& rEntry);
1662 
1663 protected:
1664  std::unique_ptr<Entry> m_xEntry;
1665  std::unique_ptr<TreeView> m_xTreeView;
1666 
1667 public:
1668  EntryTreeView(std::unique_ptr<Entry> xEntry, std::unique_ptr<TreeView> xTreeView);
1669 
1670  virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems,
1671  bool bKeepExisting) override
1672  {
1673  m_xTreeView->freeze();
1674  if (!bKeepExisting)
1675  m_xTreeView->clear();
1676  for (const auto& rItem : rItems)
1677  {
1678  m_xTreeView->insert(-1, rItem.sString, rItem.sId.isEmpty() ? nullptr : &rItem.sId,
1679  rItem.sImage.isEmpty() ? nullptr : &rItem.sImage, nullptr);
1680  }
1681  m_xTreeView->thaw();
1682  }
1683 
1684  virtual void insert(int pos, const OUString& rStr, const OUString* pId,
1685  const OUString* pIconName, VirtualDevice* pImageSurface) override
1686  {
1687  m_xTreeView->insert(pos, rStr, pId, pIconName, pImageSurface);
1688  }
1689 
1690  virtual int get_count() const override { return m_xTreeView->n_children(); }
1691  virtual void clear() override { m_xTreeView->clear(); }
1692 
1693  //by index
1694  virtual int get_active() const override { return m_xTreeView->get_selected_index(); }
1695  virtual void set_active(int pos) override
1696  {
1697  m_xTreeView->set_cursor(pos);
1698  m_xTreeView->select(pos);
1699  m_xEntry->set_text(m_xTreeView->get_selected_text());
1700  }
1701  virtual void remove(int pos) override { m_xTreeView->remove(pos); }
1702 
1703  //by text
1704  virtual OUString get_active_text() const override { return m_xEntry->get_text(); }
1705  virtual OUString get_text(int pos) const override { return m_xTreeView->get_text(pos); }
1706  virtual int find_text(const OUString& rStr) const override
1707  {
1708  return m_xTreeView->find_text(rStr);
1709  }
1710 
1711  //by id
1712  virtual OUString get_active_id() const override { return m_xTreeView->get_selected_id(); }
1713  virtual void set_active_id(const OUString& rStr) override
1714  {
1715  m_xTreeView->select_id(rStr);
1716  m_xEntry->set_text(m_xTreeView->get_selected_text());
1717  }
1718  virtual OUString get_id(int pos) const override { return m_xTreeView->get_id(pos); }
1719  virtual void set_id(int pos, const OUString& rId) override { m_xTreeView->set_id(pos, rId); }
1720  virtual int find_id(const OUString& rId) const override { return m_xTreeView->find_id(rId); }
1721 
1722  //entry related
1723  virtual bool has_entry() const override { return true; }
1724  virtual void set_entry_message_type(EntryMessageType eType) override
1725  {
1726  m_xEntry->set_message_type(eType);
1727  }
1728  virtual void set_entry_text(const OUString& rStr) override { m_xEntry->set_text(rStr); }
1729  virtual void set_entry_width_chars(int nChars) override { m_xEntry->set_width_chars(nChars); }
1730  virtual void set_entry_max_length(int nChars) override { m_xEntry->set_max_length(nChars); }
1731  virtual void select_entry_region(int nStartPos, int nEndPos) override
1732  {
1733  m_xEntry->select_region(nStartPos, nEndPos);
1734  }
1735  //if no text was selected, both rStartPos and rEndPos will be identical
1736  //and false will be returned
1737  virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) override
1738  {
1739  return m_xEntry->get_selection_bounds(rStartPos, rEndPos);
1740  }
1742  {
1743  m_xTreeView->connect_row_activated(rLink);
1744  }
1745 
1746  virtual bool get_popup_shown() const override { return false; }
1747 
1748  void set_height_request_by_rows(int nRows);
1749 };
1750 
1752 {
1754  std::unique_ptr<weld::SpinButton> m_xSpinButton;
1756 
1757  DECL_LINK(spin_button_value_changed, weld::SpinButton&, void);
1758  DECL_LINK(spin_button_output, weld::SpinButton&, void);
1759  DECL_LINK(spin_button_input, int* result, bool);
1760 
1761  void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
1762 
1763  int ConvertValue(int nValue, FieldUnit eInUnit, FieldUnit eOutUnit) const;
1764  OUString format_number(int nValue) const;
1765  void update_width_chars();
1766 
1767 public:
1768  MetricSpinButton(std::unique_ptr<SpinButton> pSpinButton, FieldUnit eSrcUnit)
1769  : m_eSrcUnit(eSrcUnit)
1770  , m_xSpinButton(std::move(pSpinButton))
1771  {
1772  update_width_chars();
1773  m_xSpinButton->connect_output(LINK(this, MetricSpinButton, spin_button_output));
1774  m_xSpinButton->connect_input(LINK(this, MetricSpinButton, spin_button_input));
1775  m_xSpinButton->connect_value_changed(
1776  LINK(this, MetricSpinButton, spin_button_value_changed));
1777  spin_button_output(*m_xSpinButton);
1778  }
1779 
1780  static OUString MetricToString(FieldUnit rUnit);
1781 
1782  FieldUnit get_unit() const { return m_eSrcUnit; }
1783 
1784  void set_unit(FieldUnit eUnit);
1785 
1786  int convert_value_to(int nValue, FieldUnit eValueUnit) const
1787  {
1788  return ConvertValue(nValue, m_eSrcUnit, eValueUnit);
1789  }
1790 
1791  int convert_value_from(int nValue, FieldUnit eValueUnit) const
1792  {
1793  return ConvertValue(nValue, eValueUnit, m_eSrcUnit);
1794  }
1795 
1796  void set_value(int nValue, FieldUnit eValueUnit)
1797  {
1798  m_xSpinButton->set_value(convert_value_from(nValue, eValueUnit));
1799  }
1800 
1801  int get_value(FieldUnit eDestUnit) const
1802  {
1803  return convert_value_to(m_xSpinButton->get_value(), eDestUnit);
1804  }
1805 
1806  // typically you only need to call this if set_text (e.g. with "") was
1807  // previously called to display some arbitrary text instead of the
1808  // formatted value and now you want to show it as formatted again
1809  void reformat() { spin_button_output(*m_xSpinButton); }
1810 
1811  void set_range(int min, int max, FieldUnit eValueUnit)
1812  {
1813  min = convert_value_from(min, eValueUnit);
1814  max = convert_value_from(max, eValueUnit);
1815  m_xSpinButton->set_range(min, max);
1816  update_width_chars();
1817  }
1818 
1819  void get_range(int& min, int& max, FieldUnit eDestUnit) const
1820  {
1821  m_xSpinButton->get_range(min, max);
1822  min = convert_value_to(min, eDestUnit);
1823  max = convert_value_to(max, eDestUnit);
1824  }
1825 
1826  void set_min(int min, FieldUnit eValueUnit)
1827  {
1828  int dummy, max;
1829  get_range(dummy, max, eValueUnit);
1830  set_range(min, max, eValueUnit);
1831  }
1832 
1833  void set_max(int max, FieldUnit eValueUnit)
1834  {
1835  int min, dummy;
1836  get_range(min, dummy, eValueUnit);
1837  set_range(min, max, eValueUnit);
1838  }
1839 
1840  int get_min(FieldUnit eValueUnit) const
1841  {
1842  int min, dummy;
1843  get_range(min, dummy, eValueUnit);
1844  return min;
1845  }
1846 
1847  int get_max(FieldUnit eValueUnit) const
1848  {
1849  int dummy, max;
1850  get_range(dummy, max, eValueUnit);
1851  return max;
1852  }
1853 
1854  void set_increments(int step, int page, FieldUnit eValueUnit)
1855  {
1856  step = convert_value_from(step, eValueUnit);
1857  page = convert_value_from(page, eValueUnit);
1858  m_xSpinButton->set_increments(step, page);
1859  }
1860 
1861  void get_increments(int& step, int& page, FieldUnit eDestUnit) const
1862  {
1863  m_xSpinButton->get_increments(step, page);
1864  step = convert_value_to(step, eDestUnit);
1865  page = convert_value_to(page, eDestUnit);
1866  }
1867 
1869  {
1870  m_aValueChangedHdl = rLink;
1871  }
1872 
1873  int normalize(int nValue) const { return m_xSpinButton->normalize(nValue); }
1874  int denormalize(int nValue) const { return m_xSpinButton->denormalize(nValue); }
1875  void set_sensitive(bool sensitive) { m_xSpinButton->set_sensitive(sensitive); }
1876  bool get_sensitive() const { return m_xSpinButton->get_sensitive(); }
1877  bool get_visible() const { return m_xSpinButton->get_visible(); }
1878  void grab_focus() { m_xSpinButton->grab_focus(); }
1879  bool has_focus() const { return m_xSpinButton->has_focus(); }
1880  void show() { m_xSpinButton->show(); }
1881  void set_visible(bool bShow) { m_xSpinButton->set_visible(bShow); }
1882  void hide() { m_xSpinButton->hide(); }
1883  void set_digits(unsigned int digits);
1884  void set_accessible_name(const OUString& rName) { m_xSpinButton->set_accessible_name(rName); }
1885  unsigned int get_digits() const { return m_xSpinButton->get_digits(); }
1886  void save_value() { m_xSpinButton->save_value(); }
1888  {
1889  return m_xSpinButton->get_value_changed_from_saved();
1890  }
1891  void set_text(const OUString& rText) { m_xSpinButton->set_text(rText); }
1892  OUString get_text() const { return m_xSpinButton->get_text(); }
1893  void set_size_request(int nWidth, int nHeight)
1894  {
1895  m_xSpinButton->set_size_request(nWidth, nHeight);
1896  }
1897  Size get_size_request() const { return m_xSpinButton->get_size_request(); }
1898  Size get_preferred_size() const { return m_xSpinButton->get_preferred_size(); }
1900  {
1901  m_xSpinButton->connect_focus_in(rLink);
1902  }
1904  {
1905  m_xSpinButton->connect_focus_out(rLink);
1906  }
1907  OString get_buildable_name() const { return m_xSpinButton->get_buildable_name(); }
1908  void set_help_id(const OString& rName) { m_xSpinButton->set_help_id(rName); }
1909  void set_position(int nCursorPos) { m_xSpinButton->set_position(nCursorPos); }
1910  // set the width of the underlying widget in characters, this setting is
1911  // invalidated when changing the units, range or digits, so to have effect
1912  // must come after changing those values
1913  void set_width_chars(int nChars) { m_xSpinButton->set_width_chars(nChars); }
1914  weld::SpinButton& get_widget() { return *m_xSpinButton; }
1915 };
1916 
1917 enum class LabelType
1918 {
1919  Normal,
1920  Warning,
1921  Error,
1922  Title, // this is intended to be used against the background set by set_title_background
1923 };
1924 
1925 class VCL_DLLPUBLIC Label : virtual public Widget
1926 {
1927 public:
1928  virtual void set_label(const OUString& rText) = 0;
1929  virtual OUString get_label() const = 0;
1930  virtual void set_mnemonic_widget(Widget* pTarget) = 0;
1931  // font size is in points, not pixels, e.g. see Window::[G]etPointFont
1932  virtual void set_font(const vcl::Font& rFont) = 0;
1933  virtual void set_label_type(LabelType eType) = 0;
1934  /*
1935  If you want to set a warning or error state, see set_label_type
1936  instead.
1937  */
1938  virtual void set_font_color(const Color& rColor) = 0;
1939 };
1940 
1941 class VCL_DLLPUBLIC TextView : virtual public Container
1942 {
1943  friend class ::LOKTrigger;
1944 
1945 private:
1946  OUString m_sSavedValue;
1947 
1948 protected:
1952 
1953  void signal_changed() { m_aChangeHdl.Call(*this); }
1954  void signal_cursor_position() { m_aCursorPositionHdl.Call(*this); }
1955  void signal_vadjustment_changed() { m_aVChangeHdl.Call(*this); }
1956 
1957 public:
1958  virtual void set_text(const OUString& rText) = 0;
1959  virtual OUString get_text() const = 0;
1960  // if nStartPos or nEndPos is -1 the max available text pos will be used
1961  virtual void select_region(int nStartPos, int nEndPos) = 0;
1962  // returns true if the selection has nonzero length
1963  virtual bool get_selection_bounds(int& rStartPos, int& rEndPos) = 0;
1964  virtual void replace_selection(const OUString& rText) = 0;
1965  virtual void set_editable(bool bEditable) = 0;
1966  virtual bool get_editable() const = 0;
1967  virtual void set_monospace(bool bMonospace) = 0;
1968  // The maximum length of the entry. Use 0 for no maximum
1969  virtual void set_max_length(int nChars) = 0;
1970  int get_height_rows(int nRows) const
1971  {
1972  //can improve this if needed
1973  return get_text_height() * nRows;
1974  }
1975 
1976  /*
1977  Typically you want to avoid the temptation of customizing
1978  font colors
1979  */
1980  virtual void set_font_color(const Color& rColor) = 0;
1981 
1982  void save_value() { m_sSavedValue = get_text(); }
1983  bool get_value_changed_from_saved() const { return m_sSavedValue != get_text(); }
1984 
1985  void connect_changed(const Link<TextView&, void>& rLink) { m_aChangeHdl = rLink; }
1987  {
1988  m_aCursorPositionHdl = rLink;
1989  }
1990 
1991  // returns true if pressing up would move the cursor
1992  // doesn't matter if that move is to a previous line or to the start of the
1993  // current line just so long as the cursor would move
1994  virtual bool can_move_cursor_with_up() const = 0;
1995 
1996  // returns true if pressing down would move the cursor
1997  // doesn't matter if that move is to a next line or to the end of the
1998  // current line just so long as the cursor would move
1999  virtual bool can_move_cursor_with_down() const = 0;
2000 
2001  virtual void cut_clipboard() = 0;
2002  virtual void copy_clipboard() = 0;
2003  virtual void paste_clipboard() = 0;
2004 
2005  virtual void set_alignment(TxtAlign eXAlign) = 0;
2006 
2007  virtual int vadjustment_get_value() const = 0;
2008  virtual int vadjustment_get_upper() const = 0;
2009  virtual int vadjustment_get_lower() const = 0;
2010  virtual int vadjustment_get_page_size() const = 0;
2011  virtual void vadjustment_set_value(int value) = 0;
2012  void connect_vadjustment_changed(const Link<TextView&, void>& rLink) { m_aVChangeHdl = rLink; }
2013 };
2014 
2015 class VCL_DLLPUBLIC Expander : virtual public Container
2016 {
2017 protected:
2019 
2020  void signal_expanded() { m_aExpandedHdl.Call(*this); }
2021 
2022 public:
2023  virtual bool get_expanded() const = 0;
2024  virtual void set_expanded(bool bExpand) = 0;
2025 
2026  void connect_expanded(const Link<Expander&, void>& rLink) { m_aExpandedHdl = rLink; }
2027 };
2028 
2029 class VCL_DLLPUBLIC DrawingArea : virtual public Widget
2030 {
2031 public:
2032  typedef std::pair<vcl::RenderContext&, const tools::Rectangle&> draw_args;
2033 
2034 protected:
2040  // if handler returns true, drag is disallowed
2042  // return position of cursor, fill OUString& with surrounding text
2044  // attempt to delete the range, return true if successful
2046 
2048  {
2049  return m_aQueryTooltipHdl.Call(rHelpArea);
2050  }
2051 
2052  int signal_im_context_get_surrounding(OUString& rSurroundingText)
2053  {
2054  if (!m_aGetSurroundingHdl.IsSet())
2055  return -1;
2056  return m_aGetSurroundingHdl.Call(rSurroundingText);
2057  }
2058 
2060  {
2061  return m_aDeleteSurroundingHdl.Call(rRange);
2062  }
2063 
2064 public:
2065  void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; }
2066  void connect_style_updated(const Link<Widget&, void>& rLink) { m_aStyleUpdatedHdl = rLink; }
2067  void connect_command(const Link<const CommandEvent&, bool>& rLink) { m_aCommandHdl = rLink; }
2069  {
2070  m_aGetFocusRectHdl = rLink;
2071  }
2073  {
2074  m_aQueryTooltipHdl = rLink;
2075  }
2076  void connect_drag_begin(const Link<DrawingArea&, bool>& rLink) { m_aDragBeginHdl = rLink; }
2078  {
2079  m_aGetSurroundingHdl = rLink;
2080  }
2082  {
2083  m_aDeleteSurroundingHdl = rLink;
2084  }
2085  virtual void queue_draw() = 0;
2086  virtual void queue_draw_area(int x, int y, int width, int height) = 0;
2087  virtual void queue_resize() = 0;
2088 
2089  virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferrable,
2090  sal_uInt8 eDNDConstants)
2091  = 0;
2092 
2093  virtual void set_cursor(PointerStyle ePointerStyle) = 0;
2094 
2095  virtual void set_input_context(const InputContext& rInputContext) = 0;
2096  virtual void im_context_set_cursor_location(const tools::Rectangle& rCursorRect,
2097  int nExtTextInputWidth)
2098  = 0;
2099 
2100  // use return here just to generate matching VirtualDevices
2101  virtual OutputDevice& get_ref_device() = 0;
2102 
2103  virtual a11yref get_accessible_parent() = 0;
2104  virtual a11yrelationset get_accessible_relation_set() = 0;
2105  virtual Point get_accessible_location() = 0;
2106 
2107 private:
2108  friend class ::LOKTrigger;
2109 
2110  virtual void click(const Point& rPos) = 0;
2111 };
2112 
2114 {
2115 protected:
2117 
2118  void signal_activate(const OString& rIdent) { m_aActivateHdl.Call(rIdent); }
2119 
2120 public:
2121  virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) = 0;
2122 
2123  void connect_activate(const Link<const OString&, void>& rLink) { m_aActivateHdl = rLink; }
2124 
2125  virtual void set_sensitive(const OString& rIdent, bool bSensitive) = 0;
2126  virtual void set_label(const OString& rIdent, const OUString& rLabel) = 0;
2127  virtual OUString get_label(const OString& rIdent) const = 0;
2128  virtual void set_active(const OString& rIdent, bool bActive) = 0;
2129  virtual bool get_active(const OString& rIdent) const = 0;
2130  virtual void set_visible(const OString& rIdent, bool bVisible) = 0;
2131 
2132  virtual void insert(int pos, const OUString& rId, const OUString& rStr,
2133  const OUString* pIconName, VirtualDevice* pImageSurface,
2134  TriState eCheckRadioFalse)
2135  = 0;
2136 
2137  virtual void remove(const OString& rId) = 0;
2138 
2139  virtual void clear() = 0;
2140 
2141  virtual void insert_separator(int pos, const OUString& rId) = 0;
2142  void append_separator(const OUString& rId) { insert_separator(-1, rId); }
2143 
2144  void append(const OUString& rId, const OUString& rStr)
2145  {
2146  insert(-1, rId, rStr, nullptr, nullptr, TRISTATE_INDET);
2147  }
2148  void append_check(const OUString& rId, const OUString& rStr)
2149  {
2150  insert(-1, rId, rStr, nullptr, nullptr, TRISTATE_TRUE);
2151  }
2152  void append_radio(const OUString& rId, const OUString& rStr)
2153  {
2154  insert(-1, rId, rStr, nullptr, nullptr, TRISTATE_FALSE);
2155  }
2156  void append(const OUString& rId, const OUString& rStr, const OUString& rImage)
2157  {
2158  insert(-1, rId, rStr, &rImage, nullptr, TRISTATE_INDET);
2159  }
2160  void append(const OUString& rId, const OUString& rStr, VirtualDevice& rImage)
2161  {
2162  insert(-1, rId, rStr, nullptr, &rImage, TRISTATE_INDET);
2163  }
2164 
2165  // return the number of toplevel nodes
2166  virtual int n_children() const = 0;
2167 
2168  virtual ~Menu() {}
2169 };
2170 
2171 class VCL_DLLPUBLIC Toolbar : virtual public Widget
2172 {
2173 protected:
2176 
2177  friend class ::LOKTrigger;
2178 
2179  virtual void signal_clicked(const OString& rIdent) { m_aClickHdl.Call(rIdent); }
2180  void signal_toggle_menu(const OString& rIdent) { m_aToggleMenuHdl.Call(rIdent); }
2181 
2182 public:
2183  virtual void set_item_sensitive(const OString& rIdent, bool bSensitive) = 0;
2184  virtual bool get_item_sensitive(const OString& rIdent) const = 0;
2185  virtual void set_item_active(const OString& rIdent, bool bActive) = 0;
2186  virtual bool get_item_active(const OString& rIdent) const = 0;
2187  virtual void set_menu_item_active(const OString& rIdent, bool bActive) = 0;
2188  virtual bool get_menu_item_active(const OString& rIdent) const = 0;
2189  virtual void set_item_menu(const OString& rIdent, weld::Menu* pMenu) = 0;
2190  virtual void set_item_popover(const OString& rIdent, weld::Widget* pPopover) = 0;
2191  virtual void set_item_visible(const OString& rIdent, bool bVisible) = 0;
2192  virtual void set_item_help_id(const OString& rIdent, const OString& rHelpId) = 0;
2193  virtual bool get_item_visible(const OString& rIdent) const = 0;
2194  virtual void set_item_label(const OString& rIdent, const OUString& rLabel) = 0;
2195  virtual OUString get_item_label(const OString& rIdent) const = 0;
2196  virtual void set_item_tooltip_text(const OString& rIdent, const OUString& rTip) = 0;
2197  virtual OUString get_item_tooltip_text(const OString& rIdent) const = 0;
2198  virtual void set_item_icon_name(const OString& rIdent, const OUString& rIconName) = 0;
2199  virtual void set_item_image(const OString& rIdent,
2200  const css::uno::Reference<css::graphic::XGraphic>& rIcon)
2201  = 0;
2202  virtual void set_item_image(const OString& rIdent, VirtualDevice* pDevice) = 0;
2203 
2204  virtual void insert_separator(int pos, const OUString& rId) = 0;
2205  void append_separator(const OUString& rId) { insert_separator(-1, rId); }
2206 
2207  virtual int get_n_items() const = 0;
2208  virtual OString get_item_ident(int nIndex) const = 0;
2209  virtual void set_item_ident(int nIndex, const OString& rIdent) = 0;
2210  virtual void set_item_label(int nIndex, const OUString& rLabel) = 0;
2211  virtual void set_item_image(int nIndex,
2212  const css::uno::Reference<css::graphic::XGraphic>& rIcon)
2213  = 0;
2214  virtual void set_item_tooltip_text(int nIndex, const OUString& rTip) = 0;
2215 
2216  virtual vcl::ImageType get_icon_size() const = 0;
2217  virtual void set_icon_size(vcl::ImageType eType) = 0;
2218 
2219  // return what modifiers are held
2220  virtual sal_uInt16 get_modifier_state() const = 0;
2221 
2222  // This function returns the position a new item should be inserted if dnd
2223  // is dropped at rPoint
2224  virtual int get_drop_index(const Point& rPoint) const = 0;
2225 
2226  void connect_clicked(const Link<const OString&, void>& rLink) { m_aClickHdl = rLink; }
2227  void connect_menu_toggled(const Link<const OString&, void>& rLink) { m_aToggleMenuHdl = rLink; }
2228 };
2229 
2231 {
2232 public:
2233  virtual void add_widget(weld::Widget* pWidget) = 0;
2234  // the default mode is VclSizeGroupMode::Horizontal
2235  virtual void set_mode(VclSizeGroupMode eMode) = 0;
2236  virtual ~SizeGroup() {}
2237 };
2238 
2240 {
2241 public:
2242  virtual std::unique_ptr<MessageDialog> weld_message_dialog(const OString& id) = 0;
2243  virtual std::unique_ptr<Dialog> weld_dialog(const OString& id) = 0;
2244  virtual std::unique_ptr<Assistant> weld_assistant(const OString& id) = 0;
2245  virtual std::unique_ptr<Widget> weld_widget(const OString& id) = 0;
2246  virtual std::unique_ptr<Container> weld_container(const OString& id) = 0;
2247  virtual std::unique_ptr<Box> weld_box(const OString& id) = 0;
2248  virtual std::unique_ptr<Paned> weld_paned(const OString& id) = 0;
2249  virtual std::unique_ptr<Button> weld_button(const OString& id) = 0;
2250  virtual std::unique_ptr<MenuButton> weld_menu_button(const OString& id) = 0;
2251  virtual std::unique_ptr<Frame> weld_frame(const OString& id) = 0;
2252  /* bUserManagedScrolling of true means that the automatic scrolling of the window is disabled
2253  and the owner must specifically listen to adjustment changes and react appropriately to them.
2254  */
2255  virtual std::unique_ptr<ScrolledWindow> weld_scrolled_window(const OString& id,
2256  bool bUserManagedScrolling = false)
2257  = 0;
2258  virtual std::unique_ptr<Notebook> weld_notebook(const OString& id) = 0;
2259  virtual std::unique_ptr<ToggleButton> weld_toggle_button(const OString& id) = 0;
2260  virtual std::unique_ptr<RadioButton> weld_radio_button(const OString& id) = 0;
2261  virtual std::unique_ptr<CheckButton> weld_check_button(const OString& id) = 0;
2262  virtual std::unique_ptr<LinkButton> weld_link_button(const OString& id) = 0;
2263  virtual std::unique_ptr<SpinButton> weld_spin_button(const OString& id) = 0;
2264  virtual std::unique_ptr<MetricSpinButton> weld_metric_spin_button(const OString& id,
2265  FieldUnit eUnit)
2266  = 0;
2267  virtual std::unique_ptr<FormattedSpinButton> weld_formatted_spin_button(const OString& id) = 0;
2268  virtual std::unique_ptr<ComboBox> weld_combo_box(const OString& id) = 0;
2269  virtual std::unique_ptr<TreeView> weld_tree_view(const OString& id) = 0;
2270  virtual std::unique_ptr<IconView> weld_icon_view(const OString& id) = 0;
2271  virtual std::unique_ptr<Label> weld_label(const OString& id) = 0;
2272  virtual std::unique_ptr<TextView> weld_text_view(const OString& id) = 0;
2273  virtual std::unique_ptr<Expander> weld_expander(const OString& id) = 0;
2274  virtual std::unique_ptr<Entry> weld_entry(const OString& id) = 0;
2275  virtual std::unique_ptr<Scale> weld_scale(const OString& id) = 0;
2276  virtual std::unique_ptr<ProgressBar> weld_progress_bar(const OString& id) = 0;
2277  virtual std::unique_ptr<Spinner> weld_spinner(const OString& id) = 0;
2278  virtual std::unique_ptr<Image> weld_image(const OString& id) = 0;
2279  virtual std::unique_ptr<Calendar> weld_calendar(const OString& id) = 0;
2280  virtual std::unique_ptr<DrawingArea>
2281  weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr,
2282  FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr)
2283  = 0;
2284  virtual std::unique_ptr<EntryTreeView> weld_entry_tree_view(const OString& containerid,
2285  const OString& entryid,
2286  const OString& treeviewid)
2287  = 0;
2288  virtual std::unique_ptr<Menu> weld_menu(const OString& id) = 0;
2289  virtual std::unique_ptr<Toolbar> weld_toolbar(const OString& id) = 0;
2290  virtual std::unique_ptr<SizeGroup> create_size_group() = 0;
2291  /* return a Dialog suitable to take a screenshot of containing the contents of the .ui file.
2292 
2293  If the toplevel element is a dialog, that will be returned
2294  If the toplevel is not a dialog, a dialog will be created and the contents of the .ui
2295  inserted into it
2296  */
2297  virtual std::unique_ptr<Window> create_screenshot_window() = 0;
2298  virtual ~Builder() {}
2299 };
2300 
2301 class VCL_DLLPUBLIC DialogController : public std::enable_shared_from_this<DialogController>
2302 {
2303 public:
2304  virtual Dialog* getDialog() = 0;
2305  const Dialog* getConstDialog() const
2306  {
2307  return const_cast<DialogController*>(this)->getDialog();
2308  }
2309  virtual short run() { return getDialog()->run(); }
2310  static bool runAsync(const std::shared_ptr<DialogController>& rController,
2311  const std::function<void(sal_Int32)>&);
2312  void set_title(const OUString& rTitle) { getDialog()->set_title(rTitle); }
2313  OUString get_title() const { return getConstDialog()->get_title(); }
2314  void set_help_id(const OString& rHelpId) { getDialog()->set_help_id(rHelpId); }
2315  OString get_help_id() const { return getConstDialog()->get_help_id(); }
2316  void response(int nResponse) { getDialog()->response(nResponse); }
2317  virtual ~DialogController() COVERITY_NOEXCEPT_FALSE;
2318 };
2319 
2321 {
2322 protected:
2323  std::unique_ptr<weld::Builder> m_xBuilder;
2324  std::shared_ptr<weld::Dialog> m_xDialog;
2325 
2326 public:
2327  GenericDialogController(weld::Widget* pParent, const OUString& rUIFile,
2328  const OString& rDialogId, bool bMobile = false);
2329  virtual Dialog* getDialog() override;
2330  virtual ~GenericDialogController() COVERITY_NOEXCEPT_FALSE override;
2331 };
2332 
2333 class VCL_DLLPUBLIC MessageDialogController : public DialogController
2334 {
2335 protected:
2336  std::unique_ptr<weld::Builder> m_xBuilder;
2337  std::unique_ptr<weld::MessageDialog> m_xDialog;
2338  std::unique_ptr<weld::Container> m_xContentArea;
2339  std::unique_ptr<weld::Widget> m_xRelocate;
2340  std::unique_ptr<weld::Container> m_xOrigParent;
2341 
2342 public:
2343  /* @param rRelocateId - optional argument of the name of a widget in the .ui file
2344  which should be relocated into the content area of the dialog.
2345 
2346  e.g. a checkbox for a "Never show this again" option.
2347 
2348  This results in the named widget relocating to the same container
2349  as the messages. This enables aligning the extra widget with the
2350  message labels in the content area container which doesn't
2351  explicitly exist in the ui description, but is only implied.
2352  */
2353  MessageDialogController(weld::Widget* pParent, const OUString& rUIFile,
2354  const OString& rDialogId, const OString& rRelocateId = OString());
2355  virtual Dialog* getDialog() override;
2356  virtual ~MessageDialogController() override;
2357  void set_primary_text(const OUString& rText) { m_xDialog->set_primary_text(rText); }
2358  OUString get_primary_text() const { return m_xDialog->get_primary_text(); }
2359  void set_default_response(int nResponse) { m_xDialog->set_default_response(nResponse); }
2360 };
2361 
2362 class VCL_DLLPUBLIC AssistantController : public DialogController
2363 {
2364 protected:
2365  std::unique_ptr<weld::Builder> m_xBuilder;
2366  std::unique_ptr<weld::Assistant> m_xAssistant;
2367 
2368 public:
2369  AssistantController(weld::Widget* pParent, const OUString& rUIFile, const OString& rDialogId);
2370  virtual Dialog* getDialog() override;
2371  virtual ~AssistantController() override;
2372 };
2373 }
2374 #endif
2375 
2376 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void append_item_check(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:1368
OUString const & get_saved_value() const
Definition: weld.hxx:1262
Link< const Size &, void > m_aSizeAllocateHdl
Definition: weld.hxx:82
std::shared_ptr< weld::Dialog > m_xDialog
Definition: weld.hxx:2324
void remove_text(const OUString &rText)
Definition: weld.hxx:959
void append(const OUString &rId, const OUString &rStr, VirtualDevice &rImage)
Definition: weld.hxx:2160
virtual void connect_changed(const Link< Entry &, void > &rLink)
Definition: weld.hxx:1509
void connect_activate_link(const Link< LinkButton &, bool > &rLink)
Definition: weld.hxx:1420
void set_size_request(int nWidth, int nHeight)
Definition: weld.hxx:1893
void connect_row_activated(const Link< TreeView &, bool > &rLink)
Definition: weld.hxx:1741
virtual void signal_clicked(const OString &rIdent)
Definition: weld.hxx:2179
int get_min() const
Definition: weld.hxx:1570
FieldUnit
rEdit set_text(aStr)
virtual void set_sort_func(const std::function< int(const weld::TreeIter &, const weld::TreeIter &)> &func)
Definition: weld.hxx:1136
Link< const OString &, void > m_aClickHdl
Definition: weld.hxx:2174
Link< ComboBox &, bool > m_aEntryActivateHdl
Definition: weld.hxx:609
std::tuple< vcl::RenderContext &, const tools::Rectangle &, bool, const OUString & > render_args
Definition: weld.hxx:604
void sort_native_button_order(const VclBox &rContainer)
Definition: layout.cxx:796
OUString get_primary_text() const
Definition: weld.hxx:2358
virtual OUString get_text(int pos) const override
Definition: weld.hxx:1705
virtual void connect_focus_out(const Link< Widget &, void > &rLink)
Definition: weld.hxx:184
void set_title(const OUString &rTitle)
Definition: weld.hxx:2312
void signal_custom_render(vcl::RenderContext &rDevice, const tools::Rectangle &rRect, bool bSelected, const OUString &rId)
Definition: weld.hxx:833
OUString const & get_saved_value() const
Definition: weld.hxx:724
std::vector< OUString > get_selected_rows_text() const
Definition: weld.hxx:960
void connect_im_context_get_surrounding(const Link< OUString &, int > &rLink)
Definition: weld.hxx:2077
Link< Button &, void > m_aClickHdl
Definition: weld.hxx:1269
int convert_value_to(int nValue, FieldUnit eValueUnit) const
Definition: weld.hxx:1786
const OString & GetHelpId() const
Definition: weld.hxx:413
void connect_column_clicked(const Link< int, void > &rLink)
Definition: weld.hxx:906
void append_separator(const OUString &rId)
Definition: weld.hxx:891
Link< Widget &, void > m_aFocusOutHdl
Definition: weld.hxx:80
std::unique_ptr< weld::Builder > m_xBuilder
Definition: weld.hxx:2323
void connect_entry_activate(const Link< ComboBox &, bool > &rLink)
Definition: weld.hxx:721
css::uno::Reference< css::accessibility::XAccessibleRelationSet > a11yrelationset
Definition: weld.hxx:46
void append(const OUString &rId, const OUString &rStr, const OUString &rImage)
Definition: weld.hxx:881
virtual void connect_editing(const Link< const TreeIter &, bool > &rStartLink, const Link< const iter_string &, bool > &rEndLink)
Definition: weld.hxx:1087
OUString sId
Definition: weld.hxx:567
void insert_text(int pos, const OUString &rStr)
Definition: weld.hxx:634
void connect_style_updated(const Link< Widget &, void > &rLink)
Definition: weld.hxx:2066
void remove_id(const OUString &rText)
Definition: weld.hxx:975
void unselect_all()
Definition: weld.hxx:1117
void append_page(const OString &rIdent, const OUString &rLabel)
Definition: weld.hxx:388
void signal_cursor_position()
Definition: weld.hxx:1954
void append_separator(const OUString &rId)
Definition: weld.hxx:652
Link< const CommandEvent &, bool > m_aPopupMenuHdl
Definition: weld.hxx:799
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
bool get_visible() const
Definition: weld.hxx:1877
void insert_text(int pos, const OUString &rStr)
Definition: weld.hxx:869
std::vector< ScreenShotEntry > ScreenShotCollection
Definition: weld.hxx:420
css::uno::Reference< css::accessibility::XAccessible > a11yref
Definition: weld.hxx:45
OUString m_sSavedValue
Definition: weld.hxx:1946
bool get_value_changed_from_saved() const
Definition: weld.hxx:725
bool get_state_changed_from_saved() const
Definition: weld.hxx:1333
OUString m_sSavedValue
Definition: weld.hxx:783
Link< Calendar &, void > m_aSelectedHdl
Definition: weld.hxx:1639
virtual OUString get_id(int pos) const override
Definition: weld.hxx:1718
void append(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:877
virtual OUString get_active_text() const override
Definition: weld.hxx:1704
Link< Widget &, void > m_aStyleUpdatedHdl
Definition: weld.hxx:2036
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual void connect_popup_toggled(const Link< ComboBox &, void > &rLink)
Definition: weld.hxx:689
void connect_help(const Link< Widget &, bool > &rLink)
Definition: weld.hxx:459
#define max(a, b)
void connect_toggled(const Link< const iter_col &, void > &rLink)
Definition: weld.hxx:904
virtual ~Builder()
Definition: weld.hxx:2298
std::unique_ptr< weld::Builder > m_xBuilder
Definition: weld.hxx:2336
void select_all()
Definition: weld.hxx:1255
std::unique_ptr< weld::Widget > m_xRelocate
Definition: weld.hxx:2339
virtual void set_active_id(const OUString &rStr) override
Definition: weld.hxx:1713
OUString get_text() const
Definition: weld.hxx:1892
Link< const Selection &, bool > m_aDeleteSurroundingHdl
Definition: weld.hxx:2045
SelectionMode
Definition: vclenum.hxx:26
virtual void clear() override
Definition: weld.hxx:1691
void connect_model_changed(const Link< TreeView &, void > &rLink)
Definition: weld.hxx:907
void connect_focus_rect(const Link< Widget &, tools::Rectangle > &rLink)
Definition: weld.hxx:2068
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
Definition: weld.hxx:1684
Link< SpinButton &, void > m_aOutputHdl
Definition: weld.hxx:1533
Size signal_custom_get_size(vcl::RenderContext &rDevice, const OUString &rId)
Definition: weld.hxx:840
virtual void connect_visible_range_changed(const Link< TreeView &, void > &rLink)
Definition: weld.hxx:1098
int normalize(int nValue) const
Definition: weld.hxx:1592
Link< get_size_args, Size > m_aGetSizeHdl
Definition: weld.hxx:839
void signal_vadjustment_changed()
Definition: weld.hxx:318
void connect_insert_text(const Link< OUString &, bool > &rLink)
Definition: weld.hxx:1510
virtual void signal_popup_toggled()
Definition: weld.hxx:616
void append(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:639
Link< OUString &, bool > m_aInsertTextHdl
Definition: weld.hxx:1464
void connect_custom_render(const Link< render_args, void > &rLink)
Definition: weld.hxx:1170
void append(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:2144
ComboBoxEntry(const OUString &rString, const OUString &rId, const OUString &rImage)
Definition: weld.hxx:578
std::pair< vcl::RenderContext &, const tools::Rectangle & > draw_args
Definition: weld.hxx:2032
void set_max(int max, FieldUnit eValueUnit)
Definition: weld.hxx:1833
weld::SpinButton & get_widget()
Definition: weld.hxx:1914
void signal_changed()
Definition: weld.hxx:1953
Link< const TreeIter &, bool > m_aCollapsingHdl
Definition: weld.hxx:795
Link< TextView &, void > m_aChangeHdl
Definition: weld.hxx:1949
void set_width_chars(int nChars)
Definition: weld.hxx:1913
virtual void connect_query_tooltip(const Link< const TreeIter &, OUString > &rLink)
Definition: weld.hxx:846
TRISTATE_TRUE
void get_range(int &min, int &max, FieldUnit eDestUnit) const
Definition: weld.hxx:1819
void connect_focus_out(const Link< Widget &, void > &rLink)
Definition: weld.hxx:1903
Link< TextView &, void > m_aCursorPositionHdl
Definition: weld.hxx:1951
virtual void connect_toggled(const Link< ToggleButton &, void > &rLink)
Definition: weld.hxx:1335
void insert(int nRow, TreeIter *pRet=nullptr)
Definition: weld.hxx:857
MetricSpinButton(std::unique_ptr< SpinButton > pSpinButton, FieldUnit eSrcUnit)
Definition: weld.hxx:1768
Link< const CommandEvent &, bool > m_aCommandHdl
Definition: weld.hxx:2037
std::unique_ptr< weld::Builder > m_xBuilder
Definition: weld.hxx:2365
int normalize(int nValue) const
Definition: weld.hxx:1873
std::unique_ptr< weld::Container > m_xOrigParent
Definition: weld.hxx:2340
Link< IconView &, bool > m_aItemActivatedHdl
Definition: weld.hxx:1202
def position
void connect_selected(const Link< const OString &, void > &rLink)
Definition: weld.hxx:1358
Link< const OString &, void > m_aSelectHdl
Definition: weld.hxx:1353
void connect_value_changed(const Link< MetricSpinButton &, void > &rLink)
Definition: weld.hxx:1868
void connect_changed(const Link< TreeView &, void > &rLink)
Definition: weld.hxx:893
bool signal_jump_page(const OString &rIdent)
Definition: weld.hxx:543
void append_item(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:1364
int get_max(FieldUnit eValueUnit) const
Definition: weld.hxx:1847
#define min(a, b)
Link< IconView &, void > m_aSelectionChangeHdl
Definition: weld.hxx:1201
void append_text(const OUString &rStr)
Definition: weld.hxx:873
EntryMessageType
Definition: weld.hxx:586
void get_increments(int &step, int &page, FieldUnit eDestUnit) const
Definition: weld.hxx:1861
void signal_vadjustment_changed()
Definition: weld.hxx:1955
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
size_t pos
Link< const MouseEvent &, bool > m_aMousePressHdl
Definition: weld.hxx:85
ComboBoxEntry(const OUString &rString)
Definition: weld.hxx:569
std::pair< const TreeIter &, int > iter_col
Definition: weld.hxx:775
Link< OUString &, bool > m_aEntryInsertTextHdl
Definition: weld.hxx:610
std::unique_ptr< weld::SpinButton > m_xSpinButton
Definition: weld.hxx:1754
virtual void connect_mouse_release(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:229
LabelType
Definition: weld.hxx:1917
Link< vcl::RenderContext &, Size > m_aGetSizeHdl
Definition: weld.hxx:625
Link< TreeView &, void > m_aVisibleRangeChangedHdl
Definition: weld.hxx:796
VclSizeGroupMode
Definition: vclenum.hxx:265
OUString sImage
Definition: weld.hxx:568
void set_accessible_name(const OUString &rName)
Definition: weld.hxx:1884
Link< const iter_col &, void > m_aRadioToggleHdl
Definition: weld.hxx:789
void connect_selection_changed(const Link< IconView &, void > &rLink)
Definition: weld.hxx:1217
WindowStateMask
Definition: vclenum.hxx:123
void connect_custom_get_size(const Link< get_size_args, Size > &rLink)
Definition: weld.hxx:1169
void connect_entry_insert_text(const Link< OUString &, bool > &rLink)
Definition: weld.hxx:715
OUString sString
Definition: weld.hxx:566
Mode eMode
void signal_selected(const OString &rIdent)
Definition: weld.hxx:1355
bool signal_im_context_delete_surrounding(const Selection &rRange)
Definition: weld.hxx:2059
OUString signal_query_tooltip(const TreeIter &rIter)
Definition: weld.hxx:830
std::unique_ptr< TreeView > m_xTreeView
Definition: weld.hxx:1665
void save_value()
Definition: weld.hxx:1162
virtual ~Widget()
Definition: weld.hxx:279
def run
VclPolicyType
Definition: vclenum.hxx:273
Link< const MouseEvent &, bool > m_aMouseMotionHdl
Definition: weld.hxx:86
virtual void connect_mouse_move(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:223
Link< TextView &, void > m_aVChangeHdl
Definition: weld.hxx:1950
virtual void set_active(int pos) override
Definition: weld.hxx:1695
bool signal_collapsing(const TreeIter &rIter)
Definition: weld.hxx:813
Link< OUString &, int > m_aGetSurroundingHdl
Definition: weld.hxx:2043
TRISTATE_INDET
void set_position(int nCursorPos)
Definition: weld.hxx:1909
void signal_clicked()
Definition: weld.hxx:1271
void save_value()
Definition: weld.hxx:1982
basegfx::B2IRange maB2IRange
Definition: weld.hxx:417
void save_value()
Definition: weld.hxx:723
void connect_row_activated(const Link< TreeView &, bool > &rLink)
Definition: weld.hxx:901
Link< const TreeIter &, bool > m_aEditingStartedHdl
Definition: weld.hxx:790
void connect_enter_page(const Link< const OString &, void > &rLink)
Definition: weld.hxx:399
void connect_drag_begin(const Link< DrawingArea &, bool > &rLink)
Definition: weld.hxx:2076
void set_text(const OUString &rText)
Definition: weld.hxx:1891
DocumentType eType
Link< draw_args, void > m_aDrawHdl
Definition: weld.hxx:2035
void signal_toggled()
Definition: weld.hxx:1295
void connect_vadjustment_changed(const Link< TextView &, void > &rLink)
Definition: weld.hxx:2012
void connect_im_context_delete_surrounding(const Link< const Selection &, bool > &rLink)
Definition: weld.hxx:2081
void swap(cow_wrapper< T, P > &a, cow_wrapper< T, P > &b)
void append(const OUString &rId, const OUString &rStr, VirtualDevice &rImage)
Definition: weld.hxx:647
void set_range(int min, int max, FieldUnit eValueUnit)
Definition: weld.hxx:1811
Size get_preferred_size() const
Definition: weld.hxx:1898
void connect_clicked(const Link< Button &, void > &rLink)
Definition: weld.hxx:1286
void set_active_text(const OUString &rStr)
Definition: weld.hxx:665
Link< MetricSpinButton &, void > m_aValueChangedHdl
Definition: weld.hxx:1755
void signal_expanded()
Definition: weld.hxx:2020
Link< TreeView &, void > m_aChangeHdl
Definition: weld.hxx:786
virtual int find_id(const OUString &rId) const override
Definition: weld.hxx:1720
virtual void insert_vector(const std::vector< weld::ComboBoxEntry > &rItems, bool bKeepExisting) override
Definition: weld.hxx:1670
Link< SpinButton &, void > m_aValueChangedHdl
Definition: weld.hxx:1532
void set_min(int min)
Definition: weld.hxx:1558
int i
bool get_value_changed_from_saved() const
Definition: weld.hxx:1983
void signal_activate(const OString &rIdent)
Definition: weld.hxx:2118
uno_Any a
virtual int get_count() const override
Definition: weld.hxx:1690
ImageType
Definition: vclenum.hxx:326
void connect_changed(const Link< ComboBox &, void > &rLink)
Definition: weld.hxx:685
bool signal_output()
Definition: weld.hxx:1538
void signal_changed()
Definition: weld.hxx:1470
Link< Widget &, void > m_aTopLevelFocusChangedHdl
Definition: weld.hxx:426
void append_item(const OUString &rId, const OUString &rStr, VirtualDevice &rImage)
Definition: weld.hxx:1380
void unselect_all()
Definition: weld.hxx:1256
TriState get_saved_state() const
Definition: weld.hxx:1332
OUString const & get_saved_value() const
Definition: weld.hxx:1163
Link< Entry &, void > m_aCursorPositionHdl
Definition: weld.hxx:1465
virtual void connect_cursor_position(const Link< Entry &, void > &rLink)
Definition: weld.hxx:1513
void connect_expanding(const Link< const TreeIter &, bool > &rLink)
Definition: weld.hxx:1082
void connect_custom_get_size(const Link< vcl::RenderContext &, Size > &rLink)
Definition: weld.hxx:728
void append_item(const OUString &rId, const OUString &rStr, const OUString &rImage)
Definition: weld.hxx:1376
void signal_cursor_position()
Definition: weld.hxx:1471
TRISTATE_FALSE
void remove_text(const OUString &rText)
Definition: weld.hxx:668
Link< ScrolledWindow &, void > m_aVChangeHdl
Definition: weld.hxx:315
virtual ~TreeIter()
Definition: weld.hxx:764
void connect_selected(const Link< Calendar &, void > &rLink)
Definition: weld.hxx:1646
void connect_item_activated(const Link< IconView &, bool > &rLink)
Definition: weld.hxx:1228
std::unique_ptr< weld::Container > m_xContentArea
Definition: weld.hxx:2338
void append_radio(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:2152
void append(const OUString &rId, const OUString &rStr, const OUString &rImage)
Definition: weld.hxx:1212
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:302
void connect_leave_page(const Link< const OString &, bool > &rLink)
Definition: weld.hxx:397
void signal_toplevel_focus_changed()
Definition: weld.hxx:428
void signal_model_changed()
Definition: weld.hxx:818
virtual void select_entry_region(int nStartPos, int nEndPos) override
Definition: weld.hxx:1731
Link< Entry &, void > m_aChangeHdl
Definition: weld.hxx:1463
virtual bool get_popup_shown() const override
Definition: weld.hxx:1746
Link< const OString &, void > m_aEnterPageHdl
Definition: weld.hxx:377
bool get_value_changed_from_saved() const
Definition: weld.hxx:1263
void signal_toggle_menu(const OString &rIdent)
Definition: weld.hxx:2180
Size get_size_request() const
Definition: weld.hxx:1897
void connect_jump_page(const Link< const OString &, bool > &rLink)
Definition: weld.hxx:561
Link< int, void > m_aColumnClickedHdl
Definition: weld.hxx:788
const basegfx::B2IRange & getB2IRange() const
Definition: weld.hxx:411
void connect_collapsing(const Link< const TreeIter &, bool > &rLink)
Definition: weld.hxx:1083
Link< bool &, bool > m_aDragBeginHdl
Definition: weld.hxx:802
void signal_changed()
Definition: weld.hxx:806
Link< ComboBox &, void > m_aChangeHdl
Definition: weld.hxx:607
ScreenShotEntry(const OString &rHelpId, const basegfx::B2IRange &rB2IRange)
Definition: weld.hxx:405
virtual ~Menu()
Definition: weld.hxx:2168
void set_value(int nValue, FieldUnit eValueUnit)
Definition: weld.hxx:1796
Link< ToggleButton &, void > m_aToggleHdl
Definition: weld.hxx:1292
void connect_value_changed(const Link< Scale &, void > &rLink)
Definition: weld.hxx:1438
void signal_selected()
Definition: weld.hxx:1642
def stop
weld::Window * m_pWindow
Definition: weld.hxx:479
virtual void connect_focus_in(const Link< Widget &, void > &rLink)
Definition: weld.hxx:178
void set_help_id(const OString &rHelpId)
Definition: weld.hxx:2314
Link< ScrolledWindow &, void > m_aHChangeHdl
Definition: weld.hxx:316
OUString m_sSavedValue
Definition: weld.hxx:1198
Link< const KeyEvent &, bool > m_aKeyPressHdl
Definition: weld.hxx:83
void set_default_response(int nResponse)
Definition: weld.hxx:2359
void append_separator(const OUString &rId)
Definition: weld.hxx:1385
virtual int get_active() const override
Definition: weld.hxx:1694
virtual void connect_cursor_position(const Link< TextView &, void > &rLink)
Definition: weld.hxx:1986
bool get_sensitive() const
Definition: weld.hxx:1876
OUString m_sSavedValue
Definition: weld.hxx:599
int signal_im_context_get_surrounding(OUString &rSurroundingText)
Definition: weld.hxx:2052
Link< const MouseEvent &, bool > m_aMouseReleaseHdl
Definition: weld.hxx:87
Link< Widget &, tools::Rectangle > m_aGetFocusRectHdl
Definition: weld.hxx:2038
void signal_hadjustment_changed()
Definition: weld.hxx:319
void save_value()
Definition: weld.hxx:1261
Link< TreeView &, bool > m_aRowActivatedHdl
Definition: weld.hxx:787
bool get_value_changed_from_saved() const
Definition: weld.hxx:1887
bool signal_expanding(const TreeIter &rIter)
Definition: weld.hxx:809
void connect_custom_render(const Link< render_args, void > &rLink)
Definition: weld.hxx:732
Link< Widget &, bool > m_aHelpRequestHdl
Definition: weld.hxx:425
void save_state()
Definition: weld.hxx:1331
bool has_focus() const
Definition: weld.hxx:1879
void connect_drag_begin(const Link< bool &, bool > &rLink)
Definition: weld.hxx:1113
virtual void connect_key_press(const Link< const KeyEvent &, bool > &rLink)
Definition: weld.hxx:205
void set_visible(bool bShow)
Definition: weld.hxx:1881
void connect_activate(const Link< const OString &, void > &rLink)
Definition: weld.hxx:2123
Link< Entry &, bool > m_aActivateHdl
Definition: weld.hxx:1466
Link< TreeView &, void > m_aModelChangedHdl
Definition: weld.hxx:797
void response(int nResponse)
Definition: weld.hxx:2316
void set_increments(int step, int page, FieldUnit eValueUnit)
Definition: weld.hxx:1854
bool signal_activate_link()
Definition: weld.hxx:1412
void set_primary_text(const OUString &rText)
Definition: weld.hxx:2357
int get_min(FieldUnit eValueUnit) const
Definition: weld.hxx:1840
void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface)
Definition: weld.hxx:864
Link< FormattedSpinButton &, void > m_aValueChangedHdl
Definition: weld.hxx:1606
ColumnToggleType
Definition: weld.hxx:749
OUString signal_query_tooltip(tools::Rectangle &rHelpArea)
Definition: weld.hxx:2047
void set_help_id(const OString &rName)
Definition: weld.hxx:1908
void select_all()
Definition: weld.hxx:1116
void connect_query_tooltip(const Link< tools::Rectangle &, OUString > &rLink)
Definition: weld.hxx:2072
void signal_changed()
Definition: weld.hxx:614
int convert_value_from(int nValue, FieldUnit eValueUnit) const
Definition: weld.hxx:1791
int get_checkbox_column_width() const
Definition: weld.hxx:1152
void append_separator(const OUString &rId)
Definition: weld.hxx:2205
bool equal(Pair const &p1, Pair const &p2)
void signal_value_changed()
Definition: weld.hxx:1761
Link< const KeyEvent &, bool > m_aKeyReleaseHdl
Definition: weld.hxx:84
bool get_value_changed_from_saved() const
Definition: weld.hxx:1164
void signal_custom_render(vcl::RenderContext &rDevice, const tools::Rectangle &rRect, bool bSelected, const OUString &rId)
Definition: weld.hxx:619
void signal_visible_range_changed()
Definition: weld.hxx:817
WaitObject(weld::Window *pWindow)
Definition: weld.hxx:482
OString get_help_id() const
Definition: weld.hxx:2315
Link< const OString &, bool > m_aJumpPageHdl
Definition: weld.hxx:541
void connect_changed(const Link< TextView &, void > &rLink)
Definition: weld.hxx:1985
Link< DrawingArea &, bool > m_aDragBeginHdl
Definition: weld.hxx:2041
Size signal_custom_get_size(vcl::RenderContext &rDevice)
Definition: weld.hxx:626
Definition: menu.hxx:118
virtual void connect_key_release(const Link< const KeyEvent &, bool > &rLink)
Definition: weld.hxx:211
A widget used to choose from a list of items.
Definition: weld.hxx:596
OString get_buildable_name() const
Definition: weld.hxx:1907
void remove_id(const OUString &rId)
Definition: weld.hxx:676
ComboBoxEntry(const OUString &rString, const OUString &rId)
Definition: weld.hxx:573
void append_check(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:2148
virtual void set_busy_cursor(bool bBusy)=0
void select_text(const OUString &rText)
Definition: weld.hxx:958
Link< const iter_string &, bool > m_aEditingDoneHdl
Definition: weld.hxx:791
bool iter_nth_child(TreeIter &rIter, int nChild) const
Definition: weld.hxx:1001
void signal_activated()
Definition: weld.hxx:1643
std::tuple< vcl::RenderContext &, const tools::Rectangle &, bool, const OUString & > render_args
Definition: weld.hxx:780
virtual bool get_entry_selection_bounds(int &rStartPos, int &rEndPos) override
Definition: weld.hxx:1737
void connect_input(const Link< int *, bool > &rLink)
Definition: weld.hxx:1590
unsigned char sal_uInt8
OutputDevice RenderContext
Definition: outdev.hxx:290
OUString const & get_saved_value() const
Definition: weld.hxx:1525
virtual void connect_size_allocate(const Link< const Size &, void > &rLink)
Definition: weld.hxx:199
void connect_vadjustment_changed(const Link< ScrolledWindow &, void > &rLink)
Definition: weld.hxx:356
virtual void set_entry_width_chars(int nChars) override
Definition: weld.hxx:1729
void clicked()
Definition: weld.hxx:1281
virtual void set_entry_message_type(EntryMessageType eType) override
Definition: weld.hxx:1724
TriState get_state() const
Definition: weld.hxx:1304
bool signal_editing_started(const TreeIter &rIter)
Definition: weld.hxx:822
virtual void connect_mouse_press(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:217
bool signal_row_activated()
Definition: weld.hxx:807
bool get_value_changed_from_saved() const
Definition: weld.hxx:1526
virtual void set_entry_max_length(int nChars) override
Definition: weld.hxx:1730
void append(const OUString &rId, const OUString &rStr, const OUString &rImage)
Definition: weld.hxx:2156
void connect_menu_toggled(const Link< const OString &, void > &rLink)
Definition: weld.hxx:2227
void connect_command(const Link< const CommandEvent &, bool > &rLink)
Definition: weld.hxx:2067
std::function< int(const weld::TreeIter &, const weld::TreeIter &)> m_aCustomSort
Definition: weld.hxx:803
friend DialogController
Definition: weld.hxx:500
virtual ~SizeGroup()
Definition: weld.hxx:2236
void set_min(int min, FieldUnit eValueUnit)
Definition: weld.hxx:1826
void signal_value_changed()
Definition: weld.hxx:1428
void connect_value_changed(const Link< FormattedSpinButton &, void > &rLink)
Definition: weld.hxx:1616
void set_sensitive(bool sensitive)
Definition: weld.hxx:1875
TxtAlign
Definition: vclenum.hxx:362
void save_value()
Definition: weld.hxx:1524
virtual short run()
Definition: weld.hxx:2309
Link< render_args, void > m_aRenderHdl
Definition: weld.hxx:832
void signal_toggled(const iter_col &rIterCol)
Definition: weld.hxx:820
bool signal_item_activated()
Definition: weld.hxx:1205
Link< Scale &, void > m_aValueChangedHdl
Definition: weld.hxx:1426
Any value
virtual void connect_toplevel_focus_changed(const Link< Widget &, void > &rLink)
Definition: weld.hxx:460
PointerStyle
Definition: ptrstyle.hxx:25
bool iter_nth_sibling(TreeIter &rIter, int nChild) const
Definition: weld.hxx:994
void connect_activate(const Link< Entry &, bool > &rLink)
Definition: weld.hxx:1512
void append_separator(const OUString &rId)
Definition: weld.hxx:2142
virtual void set_id(int pos, const OUString &rId) override
Definition: weld.hxx:1719
Link< const TreeIter &, bool > m_aExpandingHdl
Definition: weld.hxx:793
OUString get_title() const
Definition: weld.hxx:2313
void append(TreeIter *pRet=nullptr)
Definition: weld.hxx:862
void select_id(const OUString &rId)
Definition: weld.hxx:974
void connect_draw(const Link< draw_args, void > &rLink)
Definition: weld.hxx:2065
sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
Definition: field.cxx:1047
void connect_activated(const Link< Calendar &, void > &rLink)
Definition: weld.hxx:1647
void signal_selection_changed()
Definition: weld.hxx:1204
virtual void set_entry_text(const OUString &rStr) override
Definition: weld.hxx:1728
void connect_clicked(const Link< const OString &, void > &rLink)
Definition: weld.hxx:2226
int get_value(FieldUnit eDestUnit) const
Definition: weld.hxx:1801
Link< const OString &, void > m_aToggleMenuHdl
Definition: weld.hxx:2175
Link< const OString &, bool > m_aLeavePageHdl
Definition: weld.hxx:376
int get_max() const
Definition: weld.hxx:1576
void append_text(const OUString &rStr)
Definition: weld.hxx:638
FieldUnit m_eSrcUnit
Definition: weld.hxx:1753
void set_state(TriState eState)
Definition: weld.hxx:1313
Link< int *, bool > m_aInputHdl
Definition: weld.hxx:1534
TriState signal_input(int *result)
Definition: weld.hxx:1546
Link< const TreeIter &, OUString > m_aQueryTooltipHdl
Definition: weld.hxx:829
std::pair< vcl::RenderContext &, const OUString & > get_size_args
Definition: weld.hxx:778
unsigned int get_digits() const
Definition: weld.hxx:1885
Link< Expander &, void > m_aExpandedHdl
Definition: weld.hxx:2018
Link< Widget &, void > m_aFocusInHdl
Definition: weld.hxx:79
void append_item_radio(const OUString &rId, const OUString &rStr)
Definition: weld.hxx:1372
void set_max(int max)
Definition: weld.hxx:1564
OUString m_sSavedValue
Definition: weld.hxx:1460
FieldUnit get_unit() const
Definition: weld.hxx:1782
void connect_expanded(const Link< Expander &, void > &rLink)
Definition: weld.hxx:2026
Link< ComboBox &, void > m_aPopupToggledHdl
Definition: weld.hxx:608
virtual OUString get_active_id() const override
Definition: weld.hxx:1712
TriState
int get_height_rows(int nRows) const
Definition: weld.hxx:1970
void signal_value_changed()
Definition: weld.hxx:1536
void connect_output(const Link< SpinButton &, void > &rLink)
Definition: weld.hxx:1589
void append(const OUString &rId, const OUString &rStr, const OUString &rImage)
Definition: weld.hxx:643
void connect_hadjustment_changed(const Link< ScrolledWindow &, void > &rLink)
Definition: weld.hxx:335
virtual void connect_popup_menu(const Link< const CommandEvent &, bool > &rLink)
Definition: weld.hxx:1104
std::unique_ptr< weld::Assistant > m_xAssistant
Definition: weld.hxx:2366
Link< const OString &, void > m_aActivateHdl
Definition: weld.hxx:2116
Link< Calendar &, void > m_aActivatedHdl
Definition: weld.hxx:1640
std::pair< const TreeIter &, OUString > iter_string
Definition: weld.hxx:776
std::unique_ptr< Entry > m_xEntry
Definition: weld.hxx:1664
std::unique_ptr< weld::MessageDialog > m_xDialog
Definition: weld.hxx:2337
void connect_focus_in(const Link< Widget &, void > &rLink)
Definition: weld.hxx:1899
const Dialog * getConstDialog() const
Definition: weld.hxx:2305
int denormalize(int nValue) const
Definition: weld.hxx:1874
void signal_column_clicked(int nColumn)
Definition: weld.hxx:808
Link< LinkButton &, bool > m_aActivateLinkHdl
Definition: weld.hxx:1410
Link< Widget &, bool > m_aMnemonicActivateHdl
Definition: weld.hxx:81
virtual void set_visible(bool visible)
Definition: weld.hxx:96
void append(const TreeIter *pParent, const OUString &rStr)
Definition: weld.hxx:885
virtual int find_text(const OUString &rStr) const override
Definition: weld.hxx:1706
void connect_value_changed(const Link< SpinButton &, void > &rLink)
Definition: weld.hxx:1587
sal_uInt16 nPos
virtual void set_sensitive(bool sensitive)=0
Link< render_args, void > m_aRenderHdl
Definition: weld.hxx:618
virtual void connect_mnemonic_activate(const Link< Widget &, bool > &rLink)
Definition: weld.hxx:193
Link< tools::Rectangle &, OUString > m_aQueryTooltipHdl
Definition: weld.hxx:2039
virtual bool has_entry() const override
Definition: weld.hxx:1723
bool signal_editing_done(const iter_string &rIterText)
Definition: weld.hxx:824