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