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