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