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