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