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