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