LibreOffice Module vcl (master) 1
salvtables.cxx
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <limits>
23#include <string_view>
24
25#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
26#include <com/sun/star/awt/XWindow.hpp>
27#include <com/sun/star/awt/XVclWindowPeer.hpp>
28#include <o3tl/safeint.hxx>
30#include <o3tl/string_view.hxx>
31#include <officecfg/Office/Common.hxx>
32#include <salframe.hxx>
33#include <salinst.hxx>
34#include <salvd.hxx>
35#include <salprn.hxx>
36#include <saltimer.hxx>
37#include <salsession.hxx>
38#include <salsys.hxx>
39#include <salbmp.hxx>
40#include <salobj.hxx>
41#include <salmenu.hxx>
42#include <strings.hrc>
43#include <svdata.hxx>
44#include <svimpbox.hxx>
45#include <messagedialog.hxx>
46#include <treeglue.hxx>
49#include <utility>
50#include <tools/helpers.hxx>
51#include <vcl/abstdlg.hxx>
52#include <vcl/builder.hxx>
55#include <vcl/toolkit/fixed.hxx>
57#include <vcl/headbar.hxx>
59#include <vcl/layout.hxx>
62#include <vcl/ptrstyle.hxx>
63#include <slider.hxx>
64#include <vcl/sysdata.hxx>
67#include <vcl/tabctrl.hxx>
68#include <vcl/tabpage.hxx>
69#include <vcl/toolbox.hxx>
73#include <vcl/weld.hxx>
74#include <vcl/weldutils.hxx>
77#include <vcl/virdev.hxx>
78#include <bitmaps.hlst>
79#include <menutogglebutton.hxx>
80#include <verticaltabctrl.hxx>
81#include <window.h>
82#include <wizdlg.hxx>
83#include <salvtables.hxx>
84#include <comphelper/lok.hxx>
85
87 : m_pWindow(nullptr)
88 , m_pProc(nullptr)
89{
90}
91
92// this file contains the virtual destructors of the sal interface
93// compilers usually put their vtables where the destructor is
94
96
98{
99 m_pWindow = pWindow;
100 m_pProc = pProc;
101}
102
103// default to full-frame flushes
104// on ports where partial-flushes are much cheaper this method should be overridden
106
107void SalFrame::SetRepresentedURL(const OUString&)
108{
109 // currently this is Mac only functionality
110}
111
113 tools::Long nHeight, sal_uInt16 nFlags)
114{
115 // assuming the 4 integers normally don't have more than 4 digits, but might be negative
116 OUStringBuffer aBuffer(4 * 5 + 5);
117 if (nFlags & SAL_FRAME_POSSIZE_WIDTH)
118 aBuffer << nWidth << "x";
119 else
120 aBuffer << "?x";
121 if (nFlags & SAL_FRAME_POSSIZE_HEIGHT)
122 aBuffer << nHeight << "@(";
123 else
124 aBuffer << "?@(";
125 if (nFlags & SAL_FRAME_POSSIZE_X)
126 aBuffer << nX << ",";
127 else
128 aBuffer << "?,";
129 if (nFlags & SAL_FRAME_POSSIZE_Y)
130 aBuffer << nY << ")";
131 else
132 aBuffer << "?)";
133 return aBuffer.makeStringAndClear();
134}
135
136SalInstance::SalInstance(std::unique_ptr<comphelper::SolarMutex> pMutex)
137 : m_pYieldMutex(std::move(pMutex))
138{
139}
140
142
144
145sal_uInt32 SalInstance::ReleaseYieldMutexAll() { return m_pYieldMutex->release(true); }
146
147void SalInstance::AcquireYieldMutex(sal_uInt32 nCount) { m_pYieldMutex->acquire(nCount); }
148
149std::unique_ptr<SalSession> SalInstance::CreateSalSession() { return nullptr; }
150
152{
153 assert(!m_bSupportsOpenGL);
154 std::abort();
155}
156
157std::unique_ptr<SalMenu> SalInstance::CreateMenu(bool, Menu*)
158{
159 // default: no native menus
160 return nullptr;
161}
162
163std::unique_ptr<SalMenuItem> SalInstance::CreateMenuItem(const SalItemParams&) { return nullptr; }
164
165bool SalInstance::CallEventCallback(void const* pEvent, int nBytes)
166{
167 return m_pEventInst.is() && m_pEventInst->dispatchEvent(pEvent, nBytes);
168}
169
171{
172 // can't run on system event loop without implementing DoExecute and DoQuit
174 std::abort();
175 return false;
176}
177
179{
181 std::abort();
182}
183
184SalTimer::~SalTimer() COVERITY_NOEXCEPT_FALSE {}
185
187{
188 if (ImplSVData* pSVData = ImplGetSVData())
189 {
190 auto& rCache = pSVData->maGDIData.maScaleCache;
191
192 rCache.remove_if([this](const lru_scale_cache::key_value_pair_t& rKeyValuePair) {
193 return rKeyValuePair.first.mpBitmap == this;
194 });
195 }
196}
197
199
201
203
204bool SalPrinter::StartJob(const OUString*, const OUString&, const OUString&, ImplJobSetup*,
206{
207 return false;
208}
209
211
213
215
217
219{
220 return false;
221}
222
224
225bool SalMenu::AddMenuBarButton(const SalMenuButtonItem&) { return false; }
226
228
230{
231 return tools::Rectangle();
232}
233
234int SalMenu::GetMenuBarHeight() const { return 0; }
235
237
239
241{
242private:
249
250 void SetFlash()
251 {
252 Color aColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
254 }
255
257 {
260 else
262 }
263
264 void Flash()
265 {
266 constexpr int FlashesWanted = 1;
267
268 if (m_nFlashCount % 2 == 0)
269 ClearFlash();
270 else
271 SetFlash();
272
273 if (m_nFlashCount == FlashesWanted * 2)
274 return;
275
277
279 }
280
281 DECL_LINK(FlashTimeout, Timer*, void);
282
283public:
285 : m_xWidget(std::move(xWidget))
286 , m_aFlashTimer("SalFlashAttention")
288 , m_nFlashCount(1)
289 {
292 }
293
294 void Start()
295 {
300 }
301
303};
304
305IMPL_LINK_NOARG(SalFlashAttention, FlashTimeout, Timer*, void) { Flash(); }
306
308{
309 if (!m_bEventListener)
310 {
311 m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, EventListener));
312 m_bEventListener = true;
313 }
314}
315
316// we want the ability to mark key events as handled, so use this variant
317// for those, we get all keystrokes in this case, so we will need to filter
318// them later
320{
322 {
323 Application::AddKeyListener(LINK(this, SalInstanceWidget, KeyEventListener));
324 m_bKeyEventListener = true;
325 }
326}
327
328// we want the ability to know about mouse events that happen in our children
329// so use this variant, we will need to filter them later
331{
333 {
334 m_xWidget->AddChildEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
336 }
337}
338
340{
344 {
345 // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under"
346 // transparent children of the widget e.g. expander in sidebar panel header
348 // and toggle mbClipChildren on instead otherwise the bg won't fill e.g.
349 // deck titlebar header when its width is stretched
351 pImpl->mbClipChildren = true;
352 }
353}
354
356 bool bTakeOwnership)
357 : m_xWidget(pWidget)
358 , m_pBuilder(pBuilder)
359 , m_bTakeOwnership(bTakeOwnership)
360 , m_bEventListener(false)
361 , m_bKeyEventListener(false)
362 , m_bMouseEventListener(false)
363 , m_nBlockNotify(0)
364 , m_nFreezeCount(0)
365{
366}
367
368void SalInstanceWidget::set_sensitive(bool sensitive) { m_xWidget->Enable(sensitive); }
369
371
373
375
377{
378 auto nStyle = m_xWidget->GetStyle() & ~(WB_TABSTOP | WB_NOTABSTOP);
379 if (bCanFocus)
380 nStyle |= WB_TABSTOP;
381 else
382 nStyle |= WB_NOTABSTOP;
383 m_xWidget->SetStyle(nStyle);
384}
385
387{
388 if (has_focus())
389 return;
391}
392
394
396
398
400
402
403void SalInstanceWidget::set_size_request(int nWidth, int nHeight)
404{
407}
408
410{
412}
413
415
417{
419}
420
422
423Size SalInstanceWidget::get_pixel_size(const OUString& rText) const
424{
425 //TODO, or do I want GetTextBoundRect ?, just using width at the moment anyway
427}
428
430
432
433void SalInstanceWidget::set_buildable_name(const OUString& rId) { return m_xWidget->set_id(rId); }
434
435void SalInstanceWidget::set_help_id(const OUString& rId) { return m_xWidget->SetHelpId(rId); }
436
438
440{
442}
443
445
447
449{
451}
452
454
455void SalInstanceWidget::set_hexpand(bool bExpand) { m_xWidget->set_hexpand(bExpand); }
456
458
459void SalInstanceWidget::set_vexpand(bool bExpand) { m_xWidget->set_vexpand(bExpand); }
460
462
464
466
468
470
472
474
476
478
479void SalInstanceWidget::set_accessible_name(const OUString& rName)
480{
482}
483
484void SalInstanceWidget::set_accessible_description(const OUString& rDescription)
485{
486 m_xWidget->SetAccessibleDescription(rDescription);
487}
488
490
492{
494}
495
497{
499 pOldLabel->SetAccessibleRelationLabelFor(nullptr);
500 vcl::Window* pA11yLabel
501 = pLabel ? dynamic_cast<SalInstanceWidget&>(*pLabel).getWidget() : nullptr;
503 if (pA11yLabel)
505}
506
507void SalInstanceWidget::set_tooltip_text(const OUString& rTip)
508{
510}
511
513
515{
516 vcl::Cursor* pCursor = static_cast<vcl::Cursor*>(pData);
517 if (!pCursor)
518 return;
519
520 m_xWidget->SetCursor(pCursor);
521}
522
524{
527}
528
530{
531 m_xWidget->SetMnemonicActivateHdl(LINK(this, SalInstanceWidget, MnemonicActivateHdl));
533}
534
536{
539}
540
542{
545}
546
548{
551}
552
554{
557}
558
560{
563}
564
566{
569}
570
572{
575}
576
577IMPL_LINK(SalInstanceWidget, SettingsChangedHdl, VclWindowEvent&, rEvent, void)
578{
579 if (rEvent.GetId() != VclEventId::WindowDataChanged)
580 return;
581
582 DataChangedEvent* pData = static_cast<DataChangedEvent*>(rEvent.GetData());
583 if (pData->GetType() == DataChangedEventType::SETTINGS)
584 m_aStyleUpdatedHdl.Call(*this);
585}
586
588{
589 if (m_aStyleUpdatedHdl.IsSet())
590 m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl));
592 if (m_aStyleUpdatedHdl.IsSet())
593 m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl));
594}
595
596bool SalInstanceWidget::get_extents_relative_to(const Widget& rRelative, int& x, int& y, int& width,
597 int& height) const
598{
600 *dynamic_cast<const SalInstanceWidget&>(rRelative).getWidget()));
601 x = aRect.Left();
602 y = aRect.Top();
603 width = aRect.GetWidth();
604 height = aRect.GetHeight();
605 return true;
606}
607
609
611
613
615
617
619{
620 if (m_nFreezeCount == 0)
621 m_xWidget->SetUpdateMode(false);
623}
624
626{
628 if (m_nFreezeCount == 0)
630}
631
633{
634 if (!m_xWidget)
635 {
636 return;
637 }
638
639 if (bBusy)
641 else
643}
644
646
648{
649 if (m_aStyleUpdatedHdl.IsSet())
650 m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl));
651 if (m_aMnemonicActivateHdl.IsSet())
654 m_xWidget->RemoveChildEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
656 Application::RemoveKeyListener(LINK(this, SalInstanceWidget, KeyEventListener));
658 m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, EventListener));
661}
662
664
666
668
670
671OUString SalInstanceWidget::strip_mnemonic(const OUString& rLabel) const
672{
673 return rLabel.replaceFirst("~", "");
674}
675
677{
678 // create with (annoying) separate alpha layer that LibreOffice itself uses
681}
682
684{
686 m_xFlashAttention->Start();
687}
688
689css::uno::Reference<css::datatransfer::dnd::XDropTarget> SalInstanceWidget::get_drop_target()
690{
691 return m_xWidget->GetDropTarget();
692}
693
694css::uno::Reference<css::datatransfer::clipboard::XClipboard>
696{
697 return m_xWidget->GetClipboard();
698}
699
701{
703}
704
706{
707 m_xWidget->DumpAsPropertyTree(rJsonWriter);
708}
709
711{
713}
714
716{
718}
719
721{
724}
725
727{
729}
730
732
734{
735 if (rEvent.GetId() == VclEventId::WindowGetFocus)
736 m_aFocusInHdl.Call(*this);
737 else if (rEvent.GetId() == VclEventId::WindowLoseFocus)
738 m_aFocusOutHdl.Call(*this);
739 else if (rEvent.GetId() == VclEventId::WindowResize)
741}
742
743namespace
744{
745MouseEvent TransformEvent(const MouseEvent& rEvent, const vcl::Window* pParent,
746 const vcl::Window* pChild)
747{
748 return MouseEvent(
749 pParent->ScreenToOutputPixel(pChild->OutputToScreenPixel(rEvent.GetPosPixel())),
750 rEvent.GetClicks(), rEvent.GetMode(), rEvent.GetButtons(), rEvent.GetModifier());
751}
752}
753
755{
756 if (rWinEvent.GetId() == VclEventId::WindowMouseButtonDown)
757 {
758 if (m_xWidget == rWinEvent.GetWindow())
759 {
760 const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
761 m_aMousePressHdl.Call(*pMouseEvent);
762 }
763 else if (m_xWidget->ImplIsChild(rWinEvent.GetWindow()))
764 {
765 const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
766 const MouseEvent aTransformedEvent(
767 TransformEvent(*pMouseEvent, m_xWidget, rWinEvent.GetWindow()));
768 m_aMousePressHdl.Call(aTransformedEvent);
769 }
770 }
771 else if (rWinEvent.GetId() == VclEventId::WindowMouseButtonUp)
772 {
773 if (m_xWidget == rWinEvent.GetWindow())
774 {
775 const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
776 m_aMouseReleaseHdl.Call(*pMouseEvent);
777 }
778 else if (m_xWidget->ImplIsChild(rWinEvent.GetWindow()))
779 {
780 const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
781 const MouseEvent aTransformedEvent(
782 TransformEvent(*pMouseEvent, m_xWidget, rWinEvent.GetWindow()));
783 m_aMouseReleaseHdl.Call(aTransformedEvent);
784 }
785 }
786 else if (rWinEvent.GetId() == VclEventId::WindowMouseMove)
787 {
788 if (m_xWidget == rWinEvent.GetWindow())
789 {
790 const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
791 m_aMouseMotionHdl.Call(*pMouseEvent);
792 }
793 else if (m_xWidget->ImplIsChild(rWinEvent.GetWindow()))
794 {
795 const MouseEvent* pMouseEvent = static_cast<const MouseEvent*>(rWinEvent.GetData());
796 const MouseEvent aTransformedEvent(
797 TransformEvent(*pMouseEvent, m_xWidget, rWinEvent.GetWindow()));
798 m_aMouseMotionHdl.Call(aTransformedEvent);
799 }
800 }
801}
802
804{
805 // we get all key events here, ignore them unless we have focus
807 return false;
808 if (rEvent.GetId() == VclEventId::WindowKeyInput)
809 {
810 const KeyEvent* pKeyEvent = static_cast<const KeyEvent*>(rEvent.GetData());
811 return m_aKeyPressHdl.Call(*pKeyEvent);
812 }
813 else if (rEvent.GetId() == VclEventId::WindowKeyUp)
814 {
815 const KeyEvent* pKeyEvent = static_cast<const KeyEvent*>(rEvent.GetData());
816 return m_aKeyReleaseHdl.Call(*pKeyEvent);
817 }
818 return false;
819}
820
821IMPL_LINK(SalInstanceWidget, EventListener, VclWindowEvent&, rEvent, void)
822{
823 HandleEventListener(rEvent);
824}
825
826IMPL_LINK(SalInstanceWidget, KeyEventListener, VclWindowEvent&, rEvent, bool)
827{
828 return HandleKeyEventListener(rEvent);
829}
830
831IMPL_LINK(SalInstanceWidget, MouseEventListener, VclWindowEvent&, rEvent, void)
832{
833 HandleMouseEventListener(rEvent);
834}
835
836IMPL_LINK_NOARG(SalInstanceWidget, MnemonicActivateHdl, vcl::Window&, bool)
837{
838 return m_aMnemonicActivateHdl.Call(*this);
839}
840
841namespace
842{
843Image createImage(const OUString& rImage)
844{
845 if (rImage.isEmpty())
846 return Image();
847 if (rImage.lastIndexOf('.') != rImage.getLength() - 4)
848 {
849 assert((rImage == "dialog-warning" || rImage == "dialog-error"
850 || rImage == "dialog-information")
851 && "unknown stock image");
852 if (rImage == "dialog-warning")
853 return Image(StockImage::Yes, IMG_WARN);
854 else if (rImage == "dialog-error")
855 return Image(StockImage::Yes, IMG_ERROR);
856 else if (rImage == "dialog-information")
857 return Image(StockImage::Yes, IMG_INFO);
858 }
859 return Image(StockImage::Yes, rImage);
860}
861
862Image createImage(const VirtualDevice& rDevice)
863{
864 return Image(rDevice.GetBitmapEx(Point(), rDevice.GetOutputSizePixel()));
865}
866
867sal_uInt16 insert_to_menu(sal_uInt16 nLastId, PopupMenu* pMenu, int pos, const OUString& rId,
868 const OUString& rStr, const OUString* pIconName,
869 const VirtualDevice* pImageSurface,
870 const css::uno::Reference<css::graphic::XGraphic>& rImage,
871 TriState eCheckRadioFalse)
872{
873 const sal_uInt16 nNewid = nLastId + 1;
874
875 MenuItemBits nBits;
876 if (eCheckRadioFalse == TRISTATE_TRUE)
878 else if (eCheckRadioFalse == TRISTATE_FALSE)
880 else
881 nBits = MenuItemBits::NONE;
882
883 pMenu->InsertItem(nNewid, rStr, nBits, rId, pos == -1 ? MENU_APPEND : pos);
884 if (pIconName)
885 {
886 pMenu->SetItemImage(nNewid, createImage(*pIconName));
887 }
888 else if (pImageSurface)
889 {
890 pMenu->SetItemImage(nNewid, createImage(*pImageSurface));
891 }
892 else if (rImage)
893 {
894 pMenu->SetItemImage(nNewid, Image(rImage));
895 }
896 return nNewid;
897}
898}
899
900SalInstanceMenu::SalInstanceMenu(PopupMenu* pMenu, bool bTakeOwnership)
901 : m_xMenu(pMenu)
902 , m_bTakeOwnership(bTakeOwnership)
903{
904 const auto nCount = m_xMenu->GetItemCount();
905 m_nLastId = nCount ? pMenu->GetItemId(nCount - 1) : 0;
906 m_xMenu->SetSelectHdl(LINK(this, SalInstanceMenu, SelectMenuHdl));
907}
909 weld::Placement ePlace)
910{
911 SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pParent);
912 assert(pVclWidget);
914 if (ePlace == weld::Placement::Under)
915 eFlags = eFlags | PopupMenuFlags::ExecuteDown;
916 else
917 eFlags = eFlags | PopupMenuFlags::ExecuteRight;
918 m_xMenu->Execute(pVclWidget->getWidget(), rRect, eFlags);
919 return m_xMenu->GetCurItemIdent();
920}
921void SalInstanceMenu::set_sensitive(const OUString& rIdent, bool bSensitive)
922{
923 m_xMenu->EnableItem(rIdent, bSensitive);
924}
925bool SalInstanceMenu::get_sensitive(const OUString& rIdent) const
926{
927 return m_xMenu->IsItemEnabled(m_xMenu->GetItemId(rIdent));
928}
929void SalInstanceMenu::set_active(const OUString& rIdent, bool bActive)
930{
931 m_xMenu->CheckItem(rIdent, bActive);
932}
933bool SalInstanceMenu::get_active(const OUString& rIdent) const
934{
935 return m_xMenu->IsItemChecked(m_xMenu->GetItemId(rIdent));
936}
937void SalInstanceMenu::set_label(const OUString& rIdent, const OUString& rLabel)
938{
939 m_xMenu->SetItemText(m_xMenu->GetItemId(rIdent), rLabel);
940}
941OUString SalInstanceMenu::get_label(const OUString& rIdent) const
942{
943 return m_xMenu->GetItemText(m_xMenu->GetItemId(rIdent));
944}
945void SalInstanceMenu::set_visible(const OUString& rIdent, bool bShow)
946{
947 m_xMenu->ShowItem(m_xMenu->GetItemId(rIdent), bShow);
948}
950void SalInstanceMenu::insert(int pos, const OUString& rId, const OUString& rStr,
951 const OUString* pIconName, VirtualDevice* pImageSurface,
952 const css::uno::Reference<css::graphic::XGraphic>& rImage,
953 TriState eCheckRadioFalse)
954{
955 m_nLastId = insert_to_menu(m_nLastId, m_xMenu, pos, rId, rStr, pIconName, pImageSurface, rImage,
956 eCheckRadioFalse);
957}
958void SalInstanceMenu::insert_separator(int pos, const OUString& rId)
959{
960 auto nInsertPos = pos == -1 ? MENU_APPEND : pos;
961 m_xMenu->InsertSeparator(rId, nInsertPos);
962}
963
964// Defines the help id of the item in a given position
965void SalInstanceMenu::set_item_help_id(const OUString& rIdent, const OUString& rHelpId)
966{
967 m_xMenu->SetHelpId(m_xMenu->GetItemId(rIdent), rHelpId);
968}
969
970void SalInstanceMenu::remove(const OUString& rId)
971{
973}
975OUString SalInstanceMenu::get_id(int pos) const
976{
978}
981{
985}
986
988{
989 signal_activate(m_xMenu->GetCurItemIdent());
990 /* tdf#131333 Menu::Select depends on a false here to allow
991 propagating a submens's selected id to its parent menu to become its
992 selected id.
993
994 without this, while gen menus already have propagated this to its parent
995 in MenuFloatingWindow::EndExecute, SalMenus as used under kf5/macOS
996 won't propagate the selected id
997 */
998 return false;
999}
1000
1002 bool bTakeOwnership)
1003 : SalInstanceWidget(pToolBox, pBuilder, bTakeOwnership)
1004 , m_xToolBox(pToolBox)
1005{
1007 m_xToolBox->SetDropdownClickHdl(LINK(this, SalInstanceToolbar, DropdownClick));
1008}
1009
1010void SalInstanceToolbar::set_item_sensitive(const OUString& rIdent, bool bSensitive)
1011{
1012 m_xToolBox->EnableItem(m_xToolBox->GetItemId(rIdent), bSensitive);
1013}
1014
1015bool SalInstanceToolbar::get_item_sensitive(const OUString& rIdent) const
1016{
1017 return m_xToolBox->IsItemEnabled(m_xToolBox->GetItemId(rIdent));
1018}
1019
1020void SalInstanceToolbar::set_item_visible(const OUString& rIdent, bool bVisible)
1021{
1023}
1024
1025void SalInstanceToolbar::set_item_help_id(const OUString& rIdent, const OUString& rHelpId)
1026{
1027 m_xToolBox->SetHelpId(m_xToolBox->GetItemId(rIdent), rHelpId);
1028}
1029
1030bool SalInstanceToolbar::get_item_visible(const OUString& rIdent) const
1031{
1032 return m_xToolBox->IsItemVisible(m_xToolBox->GetItemId(rIdent));
1033}
1034
1035void SalInstanceToolbar::set_item_active(const OUString& rIdent, bool bActive)
1036{
1037 ToolBoxItemId nItemId = m_xToolBox->GetItemId(rIdent);
1038 m_xToolBox->CheckItem(nItemId, bActive);
1039}
1040
1041bool SalInstanceToolbar::get_item_active(const OUString& rIdent) const
1042{
1043 return m_xToolBox->IsItemChecked(m_xToolBox->GetItemId(rIdent));
1044}
1045
1046void SalInstanceToolbar::set_menu_item_active(const OUString& rIdent, bool bActive)
1047{
1048 ToolBoxItemId nItemId = m_xToolBox->GetItemId(rIdent);
1050
1051 if (bActive)
1052 {
1055 }
1056
1057 auto pFloat = m_aFloats[nItemId];
1058 if (pFloat)
1059 {
1060 if (bActive)
1063 else
1065 }
1066 auto pPopup = m_aMenus[nItemId];
1067 if (pPopup)
1068 {
1069 if (bActive)
1070 {
1071 tools::Rectangle aRect = m_xToolBox->GetItemRect(nItemId);
1072 pPopup->Execute(m_xToolBox, aRect, PopupMenuFlags::ExecuteDown);
1073 }
1074 else
1075 pPopup->EndExecute();
1076 }
1077
1078 m_sStartShowIdent.clear();
1079}
1080
1081bool SalInstanceToolbar::get_menu_item_active(const OUString& rIdent) const
1082{
1083 ToolBoxItemId nItemId = m_xToolBox->GetItemId(rIdent);
1085
1086 if (rIdent == m_sStartShowIdent)
1087 return true;
1088
1089 auto aFloat = m_aFloats.find(nItemId);
1090 if (aFloat != m_aFloats.end())
1091 {
1092 return vcl::Window::GetDockingManager()->IsInPopupMode(aFloat->second);
1093 }
1094
1095 auto aPopup = m_aMenus.find(nItemId);
1096 if (aPopup != m_aMenus.end())
1097 {
1098 return PopupMenu::GetActivePopupMenu() == aPopup->second;
1099 }
1100
1101 return false;
1102}
1103
1104void SalInstanceToolbar::set_item_popover(const OUString& rIdent, weld::Widget* pPopover)
1105{
1106 SalInstanceWidget* pPopoverWidget = dynamic_cast<SalInstanceWidget*>(pPopover);
1107
1108 vcl::Window* pFloat = pPopoverWidget ? pPopoverWidget->getWidget() : nullptr;
1109 if (pFloat)
1110 {
1111 pFloat->AddEventListener(LINK(this, SalInstanceToolbar, MenuToggleListener));
1112 pFloat->EnableDocking();
1113 }
1114
1116 auto xOldFloat = m_aFloats[nId];
1117 if (xOldFloat)
1118 {
1119 xOldFloat->RemoveEventListener(LINK(this, SalInstanceToolbar, MenuToggleListener));
1120 }
1121 m_aFloats[nId] = pFloat;
1122 m_aMenus[nId] = nullptr;
1123}
1124
1125void SalInstanceToolbar::set_item_menu(const OUString& rIdent, weld::Menu* pMenu)
1126{
1127 SalInstanceMenu* pInstanceMenu = dynamic_cast<SalInstanceMenu*>(pMenu);
1128
1129 PopupMenu* pPopup = pInstanceMenu ? pInstanceMenu->getMenu() : nullptr;
1130
1132 m_aMenus[nId] = pPopup;
1133 m_aFloats[nId] = nullptr;
1134}
1135
1136void SalInstanceToolbar::insert_item(int pos, const OUString& rId)
1137{
1140}
1141
1142void SalInstanceToolbar::insert_separator(int pos, const OUString& /*rId*/)
1143{
1144 auto nInsertPos = pos == -1 ? ToolBox::APPEND : pos;
1145 m_xToolBox->InsertSeparator(nInsertPos, 5);
1146}
1147
1149
1150OUString SalInstanceToolbar::get_item_ident(int nIndex) const
1151{
1153}
1154
1155void SalInstanceToolbar::set_item_ident(int nIndex, const OUString& rIdent)
1156{
1158}
1159
1160void SalInstanceToolbar::set_item_label(int nIndex, const OUString& rLabel)
1161{
1163}
1164
1165OUString SalInstanceToolbar::get_item_label(const OUString& rIdent) const
1166{
1167 return m_xToolBox->GetItemText(m_xToolBox->GetItemId(rIdent));
1168}
1169
1170void SalInstanceToolbar::set_item_label(const OUString& rIdent, const OUString& rLabel)
1171{
1172 m_xToolBox->SetItemText(m_xToolBox->GetItemId(rIdent), rLabel);
1173}
1174
1175void SalInstanceToolbar::set_item_icon_name(const OUString& rIdent, const OUString& rIconName)
1176{
1178}
1179
1180void SalInstanceToolbar::set_item_image_mirrored(const OUString& rIdent, bool bMirrored)
1181{
1183}
1184
1185void SalInstanceToolbar::set_item_image(const OUString& rIdent,
1186 const css::uno::Reference<css::graphic::XGraphic>& rIcon)
1187{
1189}
1190
1191void SalInstanceToolbar::set_item_image(const OUString& rIdent, VirtualDevice* pDevice)
1192{
1193 if (pDevice)
1194 m_xToolBox->SetItemImage(m_xToolBox->GetItemId(rIdent), createImage(*pDevice));
1195 else
1197}
1198
1200 const css::uno::Reference<css::graphic::XGraphic>& rIcon)
1201{
1203}
1204
1205void SalInstanceToolbar::set_item_tooltip_text(int nIndex, const OUString& rTip)
1206{
1208}
1209
1210void SalInstanceToolbar::set_item_tooltip_text(const OUString& rIdent, const OUString& rTip)
1211{
1213}
1214
1215OUString SalInstanceToolbar::get_item_tooltip_text(const OUString& rIdent) const
1216{
1218}
1219
1221
1223{
1225 switch (eType)
1226 {
1228 eButtonSize = ToolBoxButtonSize::Small;
1229 break;
1231 eButtonSize = ToolBoxButtonSize::Large;
1232 break;
1234 eButtonSize = ToolBoxButtonSize::Size32;
1235 break;
1236 }
1237 if (m_xToolBox->GetToolboxButtonSize() != eButtonSize)
1238 {
1239 m_xToolBox->SetToolboxButtonSize(eButtonSize);
1241 }
1242}
1243
1245
1247{
1248 auto nRet = m_xToolBox->GetItemPos(rPoint);
1249 if (nRet == ToolBox::ITEM_NOTFOUND)
1250 return 0;
1251 return nRet;
1252}
1253
1255{
1258}
1259
1261{
1262 ToolBoxItemId nItemId = m_xToolBox->GetCurItemId();
1263 signal_clicked(m_xToolBox->GetItemCommand(nItemId));
1264}
1265
1267{
1268 ToolBoxItemId nItemId = m_xToolBox->GetCurItemId();
1269 set_menu_item_active(m_xToolBox->GetItemCommand(nItemId), true);
1270}
1271
1272IMPL_LINK(SalInstanceToolbar, MenuToggleListener, VclWindowEvent&, rEvent, void)
1273{
1274 if (rEvent.GetId() == VclEventId::WindowEndPopupMode)
1275 {
1276 for (const auto& rFloat : m_aFloats)
1277 {
1278 if (rEvent.GetWindow() == rFloat.second)
1279 {
1280 ToolBoxItemId nItemId = rFloat.first;
1281 signal_toggle_menu(m_xToolBox->GetItemCommand(nItemId));
1282 break;
1283 }
1284 }
1285 }
1286}
1287
1288namespace
1289{
1290class SalInstanceSizeGroup : public weld::SizeGroup
1291{
1292private:
1293 std::shared_ptr<VclSizeGroup> m_xGroup;
1294
1295public:
1296 SalInstanceSizeGroup()
1297 : m_xGroup(std::make_shared<VclSizeGroup>())
1298 {
1299 }
1300 virtual void add_widget(weld::Widget* pWidget) override
1301 {
1302 SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pWidget);
1303 assert(pVclWidget && pVclWidget->getWidget());
1304 pVclWidget->getWidget()->add_to_size_group(m_xGroup);
1305 }
1306 virtual void set_mode(VclSizeGroupMode eMode) override { m_xGroup->set_mode(eMode); }
1307};
1308}
1309
1311{
1314}
1315
1317{
1318 if (rEvent.GetId() == VclEventId::WindowActivate
1319 || rEvent.GetId() == VclEventId::WindowDeactivate)
1320 {
1322 return;
1323 }
1325}
1326
1328 bool bTakeOwnership)
1329 : SalInstanceWidget(pContainer, pBuilder, bTakeOwnership)
1330 , m_xContainer(pContainer)
1331{
1332}
1333
1335{
1336 SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pWidget);
1337 assert(pVclWidget);
1338 SalInstanceContainer* pNewVclParent = dynamic_cast<SalInstanceContainer*>(pNewParent);
1339 assert(!pNewParent || pNewVclParent);
1340 vcl::Window* pVclWindow = pVclWidget->getWidget();
1341 if (pNewVclParent)
1342 {
1343 vcl::Window* pNew = pNewVclParent->getWidget();
1344 if (!pNew->isDisposed())
1345 pVclWindow->SetParent(pNewVclParent->getWidget());
1346 else
1347 SAL_WARN("vcl", "ignoring move because new parent is already disposed");
1348 }
1349 else
1350 {
1351 pVclWindow->Hide();
1352 pVclWindow->SetParent(ImplGetDefaultWindow());
1353 }
1354}
1355
1357{
1360 pFirstChild->ImplControlFocus();
1361}
1362
1363css::uno::Reference<css::awt::XWindow> SalInstanceContainer::CreateChildFrame()
1364{
1365 auto xPage = VclPtr<VclBin>::Create(m_xContainer.get());
1366 xPage->set_expand(true);
1367 xPage->Show();
1368 return css::uno::Reference<css::awt::XWindow>(xPage->GetComponentInterface(),
1369 css::uno::UNO_QUERY);
1370}
1371
1372std::unique_ptr<weld::Container> SalInstanceWidget::weld_parent() const
1373{
1374 vcl::Window* pParent = m_xWidget->GetParent();
1375 if (!pParent)
1376 return nullptr;
1377 return std::make_unique<SalInstanceContainer>(pParent, m_pBuilder, false);
1378}
1379
1380void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRenderLogicPos,
1381 OutputDevice& rOutput)
1382{
1383 rOutput.Push();
1384 bool bOldMapModeEnabled = pWindow->IsMapModeEnabled();
1385
1386 if (pWindow->GetMapMode().GetMapUnit() != rOutput.GetMapMode().GetMapUnit())
1387 {
1388 // This is needed for e.g. the scrollbar in writer comments in margins that has its map unit in pixels
1389 // as seen with bin/run gtktiledviewer --enable-tiled-annotations on a document containing a comment
1390 // long enough to need a scrollbar
1391 pWindow->EnableMapMode();
1392 MapMode aMapMode = pWindow->GetMapMode();
1393 aMapMode.SetMapUnit(rOutput.GetMapMode().GetMapUnit());
1394 aMapMode.SetScaleX(rOutput.GetMapMode().GetScaleX());
1395 aMapMode.SetScaleY(rOutput.GetMapMode().GetScaleY());
1396 pWindow->SetMapMode(aMapMode);
1397 }
1398
1400 Size aChildSizePixel(pWindow->GetSizePixel());
1401 xOutput->SetOutputSizePixel(aChildSizePixel);
1402
1403 MapMode aMapMode(xOutput->GetMapMode());
1404 aMapMode.SetMapUnit(rOutput.GetMapMode().GetMapUnit());
1405 aMapMode.SetScaleX(rOutput.GetMapMode().GetScaleX());
1406 aMapMode.SetScaleY(rOutput.GetMapMode().GetScaleY());
1407 xOutput->SetMapMode(aMapMode);
1408
1409 Size aTempLogicSize(xOutput->PixelToLogic(aChildSizePixel));
1410 Size aRenderLogicSize(rOutput.PixelToLogic(aChildSizePixel));
1411
1412 switch (rOutput.GetOutDevType())
1413 {
1414 case OUTDEV_WINDOW:
1415 case OUTDEV_VIRDEV:
1416 xOutput->DrawOutDev(Point(), aTempLogicSize, rRenderLogicPos, aRenderLogicSize,
1417 rOutput);
1418 break;
1419 case OUTDEV_PRINTER:
1420 case OUTDEV_PDF:
1421 xOutput->SetBackground(rOutput.GetBackground());
1422 xOutput->Erase();
1423 break;
1424 }
1425
1426 //set ReallyVisible to match Visible, we restore the original state after Paint
1427 WindowImpl* pImpl = pWindow->ImplGetWindowImpl();
1428 bool bRVisible = pImpl->mbReallyVisible;
1429 pImpl->mbReallyVisible = pWindow->IsVisible();
1430
1431 pWindow->ApplySettings(*xOutput);
1432 pWindow->Paint(*xOutput, tools::Rectangle(Point(), pWindow->PixelToLogic(aChildSizePixel)));
1433
1434 pImpl->mbReallyVisible = bRVisible;
1435
1436 switch (rOutput.GetOutDevType())
1437 {
1438 case OUTDEV_WINDOW:
1439 case OUTDEV_VIRDEV:
1440 rOutput.DrawOutDev(rRenderLogicPos, aRenderLogicSize, Point(), aTempLogicSize,
1441 *xOutput);
1442 break;
1443 case OUTDEV_PRINTER:
1444 case OUTDEV_PDF:
1445 rOutput.DrawBitmapEx(rRenderLogicPos, aRenderLogicSize,
1446 xOutput->GetBitmapEx(Point(), aTempLogicSize));
1447 break;
1448 }
1449
1450 bool bHasMirroredGraphics = pWindow->GetOutDev()->HasMirroredGraphics();
1451
1452 xOutput.disposeAndClear();
1453
1454 pWindow->EnableMapMode(bOldMapModeEnabled);
1455 rOutput.Pop();
1456
1457 for (vcl::Window* pChild = pWindow->GetWindow(GetWindowType::FirstChild); pChild;
1458 pChild = pChild->GetWindow(GetWindowType::Next))
1459 {
1460 if (!pChild->IsVisible())
1461 continue;
1462
1463 tools::Long nDeltaX
1464 = pChild->GetOutDev()->GetOutOffXPixel() - pWindow->GetOutDev()->GetOutOffXPixel();
1465 if (bHasMirroredGraphics)
1466 nDeltaX = pWindow->GetOutDev()->GetOutputWidthPixel() - nDeltaX
1467 - pChild->GetOutDev()->GetOutputWidthPixel();
1468
1469 tools::Long nDeltaY
1470 = pChild->GetOutDev()->GetOutOffYPixel() - pWindow->GetOutDev()->GetOutOffYPixel();
1471
1472 Point aPos(rRenderLogicPos);
1473 aPos += Point(nDeltaX, nDeltaY);
1474
1475 DoRecursivePaint(pChild, aPos, rOutput);
1476 }
1477}
1478
1479void SalInstanceWidget::draw(OutputDevice& rOutput, const Point& rPos, const Size& rSizePixel)
1480{
1481 Size aOrigSize(m_xWidget->GetSizePixel());
1482 bool bChangeSize = aOrigSize != rSizePixel;
1483 if (bChangeSize)
1484 m_xWidget->SetSizePixel(rSizePixel);
1485
1486 DoRecursivePaint(m_xWidget, rPos, rOutput);
1487
1488 if (bChangeSize)
1489 m_xWidget->SetSizePixel(aOrigSize);
1490}
1491
1493 bool bTakeOwnership)
1494 : SalInstanceContainer(pContainer, pBuilder, bTakeOwnership)
1495 , m_xBox(pContainer)
1496{
1497}
1498void SalInstanceBox::reorder_child(weld::Widget* pWidget, int nNewPosition)
1499{
1500 SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pWidget);
1501 assert(pVclWidget);
1502 pVclWidget->getWidget()->reorderWithinParent(nNewPosition);
1503}
1504
1506
1507namespace
1508{
1509void CollectChildren(const vcl::Window& rCurrent, const basegfx::B2IPoint& rTopLeft,
1510 weld::ScreenShotCollection& rControlDataCollection)
1511{
1512 if (!rCurrent.IsVisible())
1513 return;
1514
1515 const Point aCurrentPos(rCurrent.GetPosPixel());
1516 const Size aCurrentSize(rCurrent.GetSizePixel());
1517 const basegfx::B2IPoint aCurrentTopLeft(rTopLeft.getX() + aCurrentPos.X(),
1518 rTopLeft.getY() + aCurrentPos.Y());
1519 const basegfx::B2IRange aCurrentRange(
1520 aCurrentTopLeft,
1521 aCurrentTopLeft + basegfx::B2IPoint(aCurrentSize.Width(), aCurrentSize.Height()));
1522
1523 if (!aCurrentRange.isEmpty())
1524 {
1525 rControlDataCollection.emplace_back(rCurrent.GetHelpId(), aCurrentRange);
1526 }
1527
1528 for (sal_uInt16 a(0); a < rCurrent.GetChildCount(); a++)
1529 {
1530 vcl::Window* pChild = rCurrent.GetChild(a);
1531 if (nullptr != pChild)
1532 {
1533 CollectChildren(*pChild, aCurrentTopLeft, rControlDataCollection);
1534 }
1535 }
1536}
1537}
1538
1540{
1541 for (vcl::Window* pChild = pParent->GetWindow(GetWindowType::FirstChild); pChild;
1542 pChild = pChild->GetWindow(GetWindowType::Next))
1543 override_child_help(pChild);
1544 pParent->SetHelpHdl(LINK(this, SalInstanceWindow, HelpHdl));
1545}
1546
1548{
1549 for (vcl::Window* pChild = pParent->GetWindow(GetWindowType::FirstChild); pChild;
1550 pChild = pChild->GetWindow(GetWindowType::Next))
1551 clear_child_help(pChild);
1553}
1554
1556 bool bTakeOwnership)
1557 : SalInstanceContainer(pWindow, pBuilder, bTakeOwnership)
1558 , m_xWindow(pWindow)
1559{
1560 // tdf#129745 only override child help for the normal case, not for
1561 // m_pBuilder of null which is the toplevel application frame case.
1562 if (m_pBuilder)
1564}
1565
1566void SalInstanceWindow::set_title(const OUString& rTitle) { m_xWindow->SetText(rTitle); }
1567
1568OUString SalInstanceWindow::get_title() const { return m_xWindow->GetText(); }
1569
1570css::uno::Reference<css::awt::XWindow> SalInstanceWindow::GetXWindow()
1571{
1572 css::uno::Reference<css::awt::XWindow> xWindow(m_xWindow->GetComponentInterface(),
1573 css::uno::UNO_QUERY);
1574 return xWindow;
1575}
1576
1577namespace
1578{
1579void resize_to_request(vcl::Window* pWindow)
1580{
1581 if (SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(pWindow))
1582 {
1583 pSysWin->setOptimalLayoutSize(true);
1584 return;
1586 if (DockingWindow* pDockWin = dynamic_cast<DockingWindow*>(pWindow))
1587 {
1588 pDockWin->setOptimalLayoutSize();
1589 return;
1590 }
1591 assert(false && "must be system or docking window");
1592}
1593}
1594
1596
1598
1600
1602
1604
1606
1608{
1610}
1611
1612void SalInstanceWindow::set_centered_on_parent(bool /*bTrackGeometryRequests*/)
1613{
1614 if (vcl::Window* pParent = m_xWidget->GetParent())
1615 {
1616 Size aParentGeometry(pParent->GetSizePixel());
1617 Size aGeometry(m_xWidget->get_preferred_size());
1618 auto nX = (aParentGeometry.Width() - aGeometry.Width()) / 2;
1619 auto nY = (aParentGeometry.Height() - aGeometry.Height()) / 2;
1620 m_xWidget->SetPosPixel(Point(nX, nY));
1621 }
1623
1625
1627
1629{
1631}
1632
1634{
1635 vcl::Window* pChildLoop = _pWindow->GetWindow(GetWindowType::FirstChild);
1636 while (pChildLoop)
1637 {
1638 // does the window participate in the tabbing order?
1639 if (pChildLoop->GetStyle() & WB_DIALOGCONTROL)
1640 implResetDefault(pChildLoop);
1641
1642 // is it a button?
1643 WindowType eType = pChildLoop->GetType();
1644 if ((WindowType::PUSHBUTTON == eType) || (WindowType::OKBUTTON == eType)
1645 || (WindowType::CANCELBUTTON == eType) || (WindowType::HELPBUTTON == eType)
1646 || (WindowType::IMAGEBUTTON == eType) || (WindowType::MENUBUTTON == eType)
1647 || (WindowType::MOREBUTTON == eType))
1648 {
1649 pChildLoop->SetStyle(pChildLoop->GetStyle() & ~WB_DEFBUTTON);
1650 }
1651
1652 // the next one ...
1653 pChildLoop = pChildLoop->GetWindow(GetWindowType::Next);
1654 }
1655}
1656
1658
1660{
1661 SalInstanceWidget* pVclNew = dynamic_cast<SalInstanceWidget*>(pNew);
1662 vcl::Window* pWidgetNew = pVclNew ? pVclNew->getWidget() : nullptr;
1663 SalInstanceWidget* pVclOld = dynamic_cast<SalInstanceWidget*>(pOld);
1664 vcl::Window* pWidgetOld = pVclOld ? pVclOld->getWidget() : nullptr;
1665 if (pWidgetOld)
1666 pWidgetOld->set_property("has-default", OUString::boolean(false));
1667 else
1669 if (pWidgetNew)
1670 pWidgetNew->set_property("has-default", OUString::boolean(true));
1671}
1672
1674{
1675 const SalInstanceWidget* pVclCandidate = dynamic_cast<const SalInstanceWidget*>(pCandidate);
1676 vcl::Window* pWidget = pVclCandidate ? pVclCandidate->getWidget() : nullptr;
1677 return pWidget && pWidget->GetStyle() & WB_DEFBUTTON;
1678}
1679
1680void SalInstanceWindow::set_window_state(const OUString& rStr)
1681{
1682 SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_xWindow.get());
1683 assert(pSysWin);
1684 pSysWin->SetWindowState(rStr);
1685}
1686
1688{
1689 SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_xWindow.get());
1690 assert(pSysWin);
1691 return pSysWin->GetWindowState(nMask);
1692}
1693
1698 SystemWindow* pSysWin = dynamic_cast<SystemWindow*>(m_xWindow.get());
1699 assert(pSysWin);
1700 return pSysWin->createScreenshot();
1701}
1702
1704{
1706
1707 // collect all children. Choose start pos to be negative
1708 // of target dialog's position to get all positions relative to (0,0)
1709 const Point aParentPos(m_xWindow->GetPosPixel());
1710 const basegfx::B2IPoint aTopLeft(-aParentPos.X(), -aParentPos.Y());
1711 CollectChildren(*m_xWindow, aTopLeft, aRet);
1712
1713 return aRet;
1714}
1715
1717{
1718 return m_xWindow ? m_xWindow->GetLOKNotifier() : nullptr;
1719}
1720
1722{
1723 // tdf#129745 only undo overriding child help for the normal case, not for
1724 // m_pBuilder of null which is the toplevel application frame case.
1725 if (m_pBuilder)
1727}
1728
1730{
1731 help();
1732 return false;
1733}
1734
1735typedef std::set<VclPtr<vcl::Window>> winset;
1736
1737namespace
1738{
1739void hideUnless(const vcl::Window* pTop, const winset& rVisibleWidgets,
1740 std::vector<VclPtr<vcl::Window>>& rWasVisibleWidgets)
1741{
1742 for (vcl::Window* pChild = pTop->GetWindow(GetWindowType::FirstChild); pChild;
1743 pChild = pChild->GetWindow(GetWindowType::Next))
1744 {
1745 if (!pChild->IsVisible())
1746 continue;
1747 if (rVisibleWidgets.find(pChild) == rVisibleWidgets.end())
1748 {
1749 rWasVisibleWidgets.emplace_back(pChild);
1750 pChild->Hide();
1751 }
1752 else if (isContainerWindow(pChild))
1753 {
1754 hideUnless(pChild, rVisibleWidgets, rWasVisibleWidgets);
1755 }
1756 }
1757}
1758}
1759
1761 bool bTakeOwnership)
1762 : SalInstanceWindow(pDialog, pBuilder, bTakeOwnership)
1763 , m_xDialog(pDialog)
1764 , m_nOldEditWidthReq(0)
1765 , m_nOldBorderWidth(0)
1766{
1767 const bool bScreenshotMode(officecfg::Office::Common::Misc::ScreenshotMode::get());
1768 if (bScreenshotMode)
1769 {
1770 m_xDialog->SetPopupMenuHdl(LINK(this, SalInstanceDialog, PopupScreenShotMenuHdl));
1771 }
1772}
1773
1774bool SalInstanceDialog::runAsync(std::shared_ptr<weld::DialogController> aOwner,
1775 const std::function<void(sal_Int32)>& rEndDialogFn)
1776{
1778 aCtx.mxOwnerDialogController = aOwner;
1779 aCtx.maEndDialogFn = rEndDialogFn;
1780 VclButtonBox* pActionArea = m_xDialog->get_action_area();
1781 if (pActionArea)
1782 sort_native_button_order(*pActionArea);
1783 return m_xDialog->StartExecuteAsync(aCtx);
1784}
1785
1786bool SalInstanceDialog::runAsync(std::shared_ptr<Dialog> const& rxSelf,
1787 const std::function<void(sal_Int32)>& rEndDialogFn)
1789 assert(rxSelf.get() == this);
1791 // In order to store a shared_ptr to ourself, we have to have been constructed by make_shared,
1792 // which is that rxSelf enforces.
1793 aCtx.mxOwnerSelf = rxSelf;
1794 aCtx.maEndDialogFn = rEndDialogFn;
1795 VclButtonBox* pActionArea = m_xDialog->get_action_area();
1796 if (pActionArea)
1797 sort_native_button_order(*pActionArea);
1798 return m_xDialog->StartExecuteAsync(aCtx);
1799}
1800
1802{
1803 SalInstanceWidget* pVclEdit = dynamic_cast<SalInstanceWidget*>(pEdit);
1804 assert(pVclEdit);
1805 SalInstanceWidget* pVclButton = dynamic_cast<SalInstanceWidget*>(pButton);
1806
1807 vcl::Window* pRefEdit = pVclEdit->getWidget();
1808 vcl::Window* pRefBtn = pVclButton ? pVclButton->getWidget() : nullptr;
1809
1810 auto nOldEditWidth = pRefEdit->GetSizePixel().Width();
1812
1813 //We want just pRefBtn and pRefEdit to be shown
1814 //mark widgets we want to be visible, starting with pRefEdit
1815 //and all its direct parents.
1816 winset aVisibleWidgets;
1817 vcl::Window* pContentArea = m_xDialog->get_content_area();
1818 for (vcl::Window* pCandidate = pRefEdit;
1819 pCandidate && (pCandidate != pContentArea && pCandidate->IsVisible());
1820 pCandidate = pCandidate->GetWindow(GetWindowType::RealParent))
1821 {
1822 aVisibleWidgets.insert(pCandidate);
1823 }
1824 //same again with pRefBtn, except stop if there's a
1825 //shared parent in the existing widgets
1826 for (vcl::Window* pCandidate = pRefBtn;
1827 pCandidate && (pCandidate != pContentArea && pCandidate->IsVisible());
1828 pCandidate = pCandidate->GetWindow(GetWindowType::RealParent))
1829 {
1830 if (aVisibleWidgets.insert(pCandidate).second)
1831 break;
1832 }
1833
1834 //hide everything except the aVisibleWidgets
1835 hideUnless(pContentArea, aVisibleWidgets, m_aHiddenWidgets);
1836
1837 // the insert function case has an initially hidden edit widget, so it has
1838 // not start size, so take larger of actual size and size request
1839 pRefEdit->set_width_request(std::max(nOldEditWidth, m_nOldEditWidthReq));
1840 m_nOldBorderWidth = m_xDialog->get_border_width();
1841 m_xDialog->set_border_width(0);
1842 if (vcl::Window* pActionArea = m_xDialog->get_action_area())
1843 pActionArea->Hide();
1844 m_xDialog->setOptimalLayoutSize(true);
1845 m_xRefEdit = pRefEdit;
1846}
1847
1849{
1850 // All others: Show();
1851 for (VclPtr<vcl::Window> const& pWindow : m_aHiddenWidgets)
1852 {
1853 pWindow->Show();
1854 }
1855 m_aHiddenWidgets.clear();
1856
1858 m_xRefEdit.clear();
1859 m_xDialog->set_border_width(m_nOldBorderWidth);
1860 if (vcl::Window* pActionArea = m_xDialog->get_action_area())
1861 pActionArea->Show();
1862 m_xDialog->setOptimalLayoutSize(true);
1863}
1864
1867{
1868 m_xDialog->SetInstallLOKNotifierHdl(rLink);
1869}
1870
1872{
1873 VclButtonBox* pActionArea = m_xDialog->get_action_area();
1874 if (pActionArea)
1875 sort_native_button_order(*pActionArea);
1876 return m_xDialog->Execute();
1877}
1878
1879void SalInstanceDialog::response(int nResponse) { m_xDialog->EndDialog(nResponse); }
1880
1881void SalInstanceDialog::add_button(const OUString& rText, int nResponse, const OUString& rHelpId)
1882{
1883 VclButtonBox* pBox = m_xDialog->get_action_area();
1884 VclPtr<PushButton> xButton(
1886 xButton->SetText(rText);
1887 xButton->SetHelpId(rHelpId);
1888
1889 switch (nResponse)
1890 {
1891 case RET_OK:
1892 xButton->set_id("ok");
1893 break;
1894 case RET_CLOSE:
1895 xButton->set_id("close");
1896 break;
1897 case RET_CANCEL:
1898 xButton->set_id("cancel");
1899 break;
1900 case RET_YES:
1901 xButton->set_id("yes");
1902 break;
1903 case RET_NO:
1904 xButton->set_id("no");
1905 break;
1906 }
1907
1908 xButton->Show();
1909 m_xDialog->add_button(xButton, nResponse, true);
1910}
1911
1913{
1914 if (get_modal() == bModal)
1915 return;
1916 m_xDialog->SetModalInputMode(bModal);
1917}
1918
1919bool SalInstanceDialog::get_modal() const { return m_xDialog->IsModalInputMode(); }
1920
1922{
1923 m_xDialog->set_default_response(nResponse);
1924}
1925
1927{
1928 return new SalInstanceContainer(m_xDialog->get_content_area(), m_pBuilder, false);
1929}
1930
1931IMPL_LINK(SalInstanceDialog, PopupScreenShotMenuHdl, const CommandEvent&, rCEvt, bool)
1932{
1933 if (CommandEventId::ContextMenu == rCEvt.GetCommand())
1934 {
1935 const Point aMenuPos(rCEvt.GetMousePosPixel());
1937 sal_uInt16 nLocalID(1);
1938
1939 aMenu->InsertItem(nLocalID, VclResId(SV_BUTTONTEXT_SCREENSHOT));
1940 aMenu->SetHelpText(nLocalID, VclResId(SV_HELPTEXT_SCREENSHOT));
1941 aMenu->SetHelpId(nLocalID, "InteractiveScreenshotMode");
1942 aMenu->EnableItem(nLocalID);
1943
1944 const sal_uInt16 nId(aMenu->Execute(m_xDialog, aMenuPos));
1945
1946 // 0 == no selection (so not usable as ID)
1947 if (0 != nId)
1948 {
1949 // open screenshot annotation dialog
1952 = pFact->CreateScreenshotAnnotationDlg(*this);
1954
1955 if (pDialog)
1956 {
1957 // currently just execute the dialog, no need to do
1958 // different things for ok/cancel. This may change later,
1959 // for that case use 'if (pDlg->Execute() == RET_OK)'
1960 pDialog->Execute();
1961 }
1962 }
1963
1964 // consume event when:
1965 // - CommandEventId::ContextMenu
1966 // - bScreenshotMode
1967 return true;
1968 }
1969
1970 return false;
1971}
1972
1974 SalInstanceBuilder* pBuilder,
1975 bool bTakeOwnership)
1976 : SalInstanceDialog(pDialog, pBuilder, bTakeOwnership)
1977 , m_xMessageDialog(pDialog)
1978{
1979}
1980
1982{
1983 m_xMessageDialog->set_primary_text(rText);
1984}
1985
1987{
1988 return m_xMessageDialog->get_primary_text();
1989}
1990
1992{
1993 m_xMessageDialog->set_secondary_text(rText);
1994}
1995
1997{
1998 return m_xMessageDialog->get_secondary_text();
1999}
2000
2002{
2003 return new SalInstanceContainer(m_xMessageDialog->get_message_area(), m_pBuilder, false);
2004}
2005
2006int SalInstanceAssistant::find_page(std::u16string_view rIdent) const
2007{
2008 for (size_t i = 0; i < m_aAddedPages.size(); ++i)
2009 {
2010 if (m_aAddedPages[i]->get_id() == rIdent)
2011 return i;
2012 }
2013 return -1;
2014}
2015
2017{
2018 for (size_t i = 0; i < m_aIds.size(); ++i)
2019 {
2020 if (nId == m_aIds[i])
2021 return i;
2022 }
2023 return -1;
2024}
2025
2027 SalInstanceBuilder* pBuilder, bool bTakeOwnership)
2028 : SalInstanceDialog(pDialog, pBuilder, bTakeOwnership)
2029 , m_xWizard(pDialog)
2030 , m_aUpdateRoadmapIdle("SalInstanceAssistant m_aUpdateRoadmapIdle")
2031{
2032 m_xWizard->SetItemSelectHdl(LINK(this, SalInstanceAssistant, OnRoadmapItemSelected));
2033
2036}
2037
2039
2041
2043{
2044 return m_aAddedPages[nPage]->get_id();
2045}
2046
2048{
2050}
2051
2053{
2055
2056 // take the first shown page as the size for all pages
2057 if (m_xWizard->GetPageSizePixel().Width() == 0)
2058 {
2059 Size aFinalSize;
2060 for (int i = 0, nPages = get_n_pages(); i < nPages; ++i)
2061 {
2062 TabPage* pPage = m_xWizard->GetPage(m_aIds[i]);
2063 assert(pPage);
2064 Size aPageSize(pPage->get_preferred_size());
2065 if (aPageSize.Width() > aFinalSize.Width())
2066 aFinalSize.setWidth(aPageSize.Width());
2067 if (aPageSize.Height() > aFinalSize.Height())
2068 aFinalSize.setHeight(aPageSize.Height());
2069 }
2070 m_xWizard->SetPageSizePixel(aFinalSize);
2071 }
2072
2073 (void)m_xWizard->ShowPage(m_aIds[nPage]);
2075}
2076
2077void SalInstanceAssistant::set_current_page(const OUString& rIdent)
2078{
2079 int nIndex = find_page(rIdent);
2080 if (nIndex == -1)
2081 return;
2083}
2084
2085void SalInstanceAssistant::set_page_index(const OUString& rIdent, int nNewIndex)
2086{
2087 int nOldIndex = find_page(rIdent);
2088
2089 if (nOldIndex == -1)
2090 return;
2091
2092 if (nOldIndex == nNewIndex)
2093 return;
2094
2096
2097 auto entry = std::move(m_aAddedPages[nOldIndex]);
2098 m_aAddedPages.erase(m_aAddedPages.begin() + nOldIndex);
2099 m_aAddedPages.insert(m_aAddedPages.begin() + nNewIndex, std::move(entry));
2100
2101 int nId = m_aIds[nOldIndex];
2102 m_aIds.erase(m_aIds.begin() + nOldIndex);
2103 m_aIds.insert(m_aIds.begin() + nNewIndex, nId);
2104
2106
2108}
2109
2111{
2113 VclPtrInstance<VclGrid> xGrid(xPage);
2114 xPage->set_id(rIdent);
2115 xPage->Show();
2116 xGrid->set_hexpand(true);
2117 xGrid->set_vexpand(true);
2118 xGrid->Show();
2119 m_xWizard->AddPage(xPage);
2120 m_aIds.push_back(m_aAddedPages.size());
2121 m_xWizard->SetPage(m_aIds.back(), xPage);
2122 m_aAddedPages.push_back(xPage);
2123 m_aAddedGrids.push_back(xGrid);
2124
2126
2127 m_aPages.emplace_back(new SalInstanceContainer(xGrid, m_pBuilder, false));
2128 return m_aPages.back().get();
2129}
2130
2131OUString SalInstanceAssistant::get_page_title(const OUString& rIdent) const
2132{
2133 int nIndex = find_page(rIdent);
2134 if (nIndex == -1)
2135 return OUString();
2136 return m_aAddedPages[nIndex]->GetText();
2137}
2138
2139void SalInstanceAssistant::set_page_title(const OUString& rIdent, const OUString& rTitle)
2140{
2141 int nIndex = find_page(rIdent);
2142 if (nIndex == -1)
2143 return;
2144 if (m_aAddedPages[nIndex]->GetText() != rTitle)
2145 {
2147 m_aAddedPages[nIndex]->SetText(rTitle);
2150 }
2151}
2152
2153void SalInstanceAssistant::set_page_sensitive(const OUString& rIdent, bool bSensitive)
2154{
2155 int nIndex = find_page(rIdent);
2156 if (nIndex == -1)
2157 return;
2158 if (m_aAddedPages[nIndex]->IsEnabled() != bSensitive)
2159 {
2161 m_aAddedPages[nIndex]->Enable(bSensitive);
2164 }
2165}
2166
2168{
2169 m_xWizard->SetRoadmapHelpId(rHelpId);
2170}
2171
2173{
2174 m_xWizard->SetRoadmapBitmap(createImage(rImage).GetBitmapEx());
2175}
2176
2178{
2179 for (auto& rGrid : m_aAddedGrids)
2180 rGrid.disposeAndClear();
2181 for (auto& rPage : m_aAddedPages)
2182 rPage.disposeAndClear();
2183}
2184
2186{
2187 if (notify_events_disabled())
2188 return;
2189 auto nCurItemId = m_xWizard->GetCurrentRoadmapItemID();
2190 int nPageIndex(find_id(nCurItemId));
2191 if (!signal_jump_page(get_page_ident(nPageIndex)) && nCurItemId != m_xWizard->GetCurLevel())
2192 m_xWizard->SelectRoadmapItemByID(m_xWizard->GetCurLevel());
2193}
2194
2195IMPL_LINK_NOARG(SalInstanceAssistant, UpdateRoadmap_Hdl, Timer*, void)
2196{
2197 disable_notify_events();
2198
2199 m_xWizard->DeleteRoadmapItems();
2200
2201 int nPos = 0;
2202 for (size_t i = 0; i < m_aAddedPages.size(); ++i)
2203 {
2204 const OUString& rLabel = m_aAddedPages[i]->GetText();
2205 bool bSensitive = m_aAddedPages[i]->IsEnabled();
2206 if (rLabel.isEmpty())
2207 continue;
2208 m_xWizard->InsertRoadmapItem(nPos++, rLabel, m_aIds[i], bSensitive);
2209 }
2210
2211 m_xWizard->SelectRoadmapItemByID(m_aIds[get_current_page()], false);
2212
2213 m_xWizard->ShowRoadmap(nPos != 0);
2214
2215 enable_notify_events();
2216}
2217
2219 bool bTakeOwnership)
2220 : SalInstanceContainer(pFrame, pBuilder, bTakeOwnership)
2221 , m_xFrame(pFrame)
2222{
2223}
2224
2225void SalInstanceFrame::set_label(const OUString& rText) { m_xFrame->set_label(rText); }
2226
2227OUString SalInstanceFrame::get_label() const { return m_xFrame->get_label(); }
2228
2229namespace
2230{
2231class SalInstancePaned : public SalInstanceContainer, public virtual weld::Paned
2232{
2233private:
2234 VclPtr<VclPaned> m_xPaned;
2235
2236public:
2237 SalInstancePaned(VclPaned* pPaned, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
2238 : SalInstanceContainer(pPaned, pBuilder, bTakeOwnership)
2239 , m_xPaned(pPaned)
2240 {
2241 }
2242
2243 virtual void set_position(int nPos) override { m_xPaned->set_position(nPos); }
2244
2245 virtual int get_position() const override { return m_xPaned->get_position(); }
2246};
2247}
2248
2250 const Color& rButtonTextColor,
2251 const Color& rBackgroundColor,
2252 const Color& rShadowColor,
2253 const Color& rFaceColor)
2254{
2255 rScrollBar.EnableNativeWidget(false);
2256 AllSettings aSettings = rScrollBar.GetSettings();
2257 StyleSettings aStyleSettings = aSettings.GetStyleSettings();
2258 aStyleSettings.SetButtonTextColor(rButtonTextColor);
2259 aStyleSettings.SetCheckedColor(rBackgroundColor); // background
2260 aStyleSettings.SetShadowColor(rShadowColor);
2261 aStyleSettings.SetFaceColor(rFaceColor);
2262 aSettings.SetStyleSettings(aStyleSettings);
2263 rScrollBar.SetSettings(aSettings);
2264}
2265
2267 SalInstanceBuilder* pBuilder,
2268 bool bTakeOwnership,
2269 bool bUserManagedScrolling)
2270 : SalInstanceContainer(pScrolledWindow, pBuilder, bTakeOwnership)
2271 , m_xScrolledWindow(pScrolledWindow)
2272 , m_bUserManagedScrolling(bUserManagedScrolling)
2273{
2274 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2275 m_aOrigVScrollHdl = rVertScrollBar.GetScrollHdl();
2276 rVertScrollBar.SetScrollHdl(LINK(this, SalInstanceScrolledWindow, VscrollHdl));
2277 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2278 m_aOrigHScrollHdl = rHorzScrollBar.GetScrollHdl();
2279 rHorzScrollBar.SetScrollHdl(LINK(this, SalInstanceScrolledWindow, HscrollHdl));
2281}
2282
2283void SalInstanceScrolledWindow::hadjustment_configure(int value, int lower, int upper,
2284 int step_increment, int page_increment,
2285 int page_size)
2286{
2287 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2288 rHorzScrollBar.SetRangeMin(lower);
2289 rHorzScrollBar.SetRangeMax(upper);
2290 rHorzScrollBar.SetLineSize(step_increment);
2291 rHorzScrollBar.SetPageSize(page_increment);
2292 rHorzScrollBar.SetThumbPos(value);
2293 rHorzScrollBar.SetVisibleSize(page_size);
2294}
2295
2297{
2298 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2299 return rHorzScrollBar.GetThumbPos();
2300}
2301
2303{
2304 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2305 rHorzScrollBar.SetThumbPos(value);
2307 m_aOrigHScrollHdl.Call(&rHorzScrollBar);
2308}
2309
2311{
2312 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2313 return rHorzScrollBar.GetRangeMax();
2314}
2315
2317{
2318 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2319 rHorzScrollBar.SetRangeMax(upper);
2320}
2321
2323{
2324 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2325 return rHorzScrollBar.GetVisibleSize();
2326}
2327
2329{
2330 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2331 return rHorzScrollBar.SetVisibleSize(size);
2332}
2333
2335{
2336 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2337 return rHorzScrollBar.SetPageSize(size);
2338}
2339
2341{
2342 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2343 return rHorzScrollBar.SetLineSize(size);
2344}
2345
2347{
2348 WinBits nWinBits = m_xScrolledWindow->GetStyle() & ~(WB_AUTOHSCROLL | WB_HSCROLL);
2349 if (eHPolicy == VclPolicyType::ALWAYS)
2350 nWinBits |= WB_HSCROLL;
2351 else if (eHPolicy == VclPolicyType::AUTOMATIC)
2352 nWinBits |= WB_AUTOHSCROLL;
2353 m_xScrolledWindow->SetStyle(nWinBits);
2354 m_xScrolledWindow->queue_resize();
2355}
2356
2358{
2359 WinBits nWinBits = m_xScrolledWindow->GetStyle();
2360 if (nWinBits & WB_AUTOHSCROLL)
2362 else if (nWinBits & WB_HSCROLL)
2363 return VclPolicyType::ALWAYS;
2364 return VclPolicyType::NEVER;
2365}
2366
2367void SalInstanceScrolledWindow::vadjustment_configure(int value, int lower, int upper,
2368 int step_increment, int page_increment,
2369 int page_size)
2370{
2371 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2372 rVertScrollBar.SetRangeMin(lower);
2373 rVertScrollBar.SetRangeMax(upper);
2374 rVertScrollBar.SetLineSize(step_increment);
2375 rVertScrollBar.SetPageSize(page_increment);
2376 rVertScrollBar.SetThumbPos(value);
2377 rVertScrollBar.SetVisibleSize(page_size);
2378}
2379
2381{
2382 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2383 return rVertScrollBar.GetThumbPos();
2384}
2385
2387{
2388 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2389 rVertScrollBar.SetThumbPos(value);
2391 m_aOrigVScrollHdl.Call(&rVertScrollBar);
2392}
2393
2395{
2396 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2397 return rVertScrollBar.GetRangeMax();
2398}
2399
2401{
2402 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2403 rVertScrollBar.SetRangeMax(upper);
2404}
2405
2407{
2408 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2409 return rVertScrollBar.GetRangeMin();
2410}
2411
2413{
2414 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2415 rVertScrollBar.SetRangeMin(lower);
2416}
2417
2419{
2420 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2421 return rVertScrollBar.GetVisibleSize();
2422}
2423
2425{
2426 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2427 return rVertScrollBar.SetVisibleSize(size);
2428}
2429
2431{
2432 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2433 return rVertScrollBar.SetPageSize(size);
2434}
2435
2437{
2438 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2439 return rVertScrollBar.SetLineSize(size);
2440}
2441
2443{
2444 WinBits nWinBits = m_xScrolledWindow->GetStyle() & ~(WB_AUTOVSCROLL | WB_VSCROLL);
2445 if (eVPolicy == VclPolicyType::ALWAYS)
2446 nWinBits |= WB_VSCROLL;
2447 else if (eVPolicy == VclPolicyType::AUTOMATIC)
2448 nWinBits |= WB_AUTOVSCROLL;
2449 m_xScrolledWindow->SetStyle(nWinBits);
2450 m_xScrolledWindow->queue_resize();
2451}
2452
2454{
2455 WinBits nWinBits = m_xScrolledWindow->GetStyle();
2456 if (nWinBits & WB_AUTOVSCROLL)
2458 else if (nWinBits & WB_VSCROLL)
2459 return VclPolicyType::ALWAYS;
2460 return VclPolicyType::NEVER;
2461}
2462
2464{
2466}
2467
2469{
2470 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2471 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2472 rHorzScrollBar.set_height_request(nThickness);
2473 rVertScrollBar.set_width_request(nThickness);
2474}
2475
2477 const Color& rShadowColor,
2478 const Color& rFaceColor)
2479{
2480 ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar();
2481 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2482 customize_scrollbars(rHorzScrollBar, Color(0, 0, 0), rBackgroundColor, rShadowColor,
2483 rFaceColor);
2484 customize_scrollbars(rVertScrollBar, Color(0, 0, 0), rBackgroundColor, rShadowColor,
2485 rFaceColor);
2486}
2487
2489{
2490 ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar();
2491 rVertScrollBar.SetScrollHdl(m_aOrigVScrollHdl);
2492}
2493
2494IMPL_LINK(SalInstanceScrolledWindow, VscrollHdl, ScrollBar*, pScrollBar, void)
2495{
2496 signal_vadjustment_changed();
2497 if (!m_bUserManagedScrolling)
2498 m_aOrigVScrollHdl.Call(pScrollBar);
2499}
2500
2502{
2503 signal_hadjustment_changed();
2504 if (!m_bUserManagedScrolling)
2505 m_aOrigHScrollHdl.Call(&m_xScrolledWindow->getHorzScrollBar());
2506}
2507
2508namespace
2509{
2510class SalInstanceScrollbar : public SalInstanceWidget, public virtual weld::Scrollbar
2511{
2512private:
2513 VclPtr<ScrollBar> m_xScrollBar;
2514
2515 DECL_LINK(ScrollHdl, ScrollBar*, void);
2516
2517public:
2518 SalInstanceScrollbar(ScrollBar* pScrollbar, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
2519 : SalInstanceWidget(pScrollbar, pBuilder, bTakeOwnership)
2520 , m_xScrollBar(pScrollbar)
2521 {
2522 m_xScrollBar->SetScrollHdl(LINK(this, SalInstanceScrollbar, ScrollHdl));
2523 m_xScrollBar->EnableDrag();
2524 }
2525
2526 virtual void adjustment_configure(int value, int lower, int upper, int step_increment,
2527 int page_increment, int page_size) override
2528 {
2529 m_xScrollBar->SetRangeMin(lower);
2530 m_xScrollBar->SetRangeMax(upper);
2531 m_xScrollBar->SetLineSize(step_increment);
2532 m_xScrollBar->SetPageSize(page_increment);
2533 m_xScrollBar->SetThumbPos(value);
2534 m_xScrollBar->SetVisibleSize(page_size);
2535 }
2536
2537 virtual int adjustment_get_value() const override { return m_xScrollBar->GetThumbPos(); }
2538
2539 virtual void adjustment_set_value(int value) override { m_xScrollBar->SetThumbPos(value); }
2540
2541 virtual int adjustment_get_upper() const override { return m_xScrollBar->GetRangeMax(); }
2542
2543 virtual void adjustment_set_upper(int upper) override { m_xScrollBar->SetRangeMax(upper); }
2544
2545 virtual int adjustment_get_lower() const override { return m_xScrollBar->GetRangeMin(); }
2546
2547 virtual void adjustment_set_lower(int lower) override { m_xScrollBar->SetRangeMin(lower); }
2548
2549 virtual int adjustment_get_page_size() const override { return m_xScrollBar->GetVisibleSize(); }
2550
2551 virtual void adjustment_set_page_size(int size) override { m_xScrollBar->SetVisibleSize(size); }
2552
2553 virtual int adjustment_get_page_increment() const override
2554 {
2555 return m_xScrollBar->GetPageSize();
2556 }
2557
2558 virtual void adjustment_set_page_increment(int size) override
2559 {
2560 m_xScrollBar->SetPageSize(size);
2561 }
2562
2563 virtual int adjustment_get_step_increment() const override
2564 {
2565 return m_xScrollBar->GetLineSize();
2566 }
2567
2568 virtual void adjustment_set_step_increment(int size) override
2569 {
2570 m_xScrollBar->SetLineSize(size);
2571 }
2572
2573 virtual ScrollType get_scroll_type() const override { return m_xScrollBar->GetType(); }
2574
2575 virtual int get_scroll_thickness() const override
2576 {
2577 if (m_xScrollBar->GetStyle() & WB_HORZ)
2578 return m_xScrollBar->get_preferred_size().Height();
2579 return m_xScrollBar->get_preferred_size().Width();
2580 }
2581
2582 virtual void set_scroll_thickness(int nThickness) override
2583 {
2584 if (m_xScrollBar->GetStyle() & WB_HORZ)
2585 m_xScrollBar->set_height_request(nThickness);
2586 else
2587 m_xScrollBar->set_width_request(nThickness);
2588 }
2589};
2590}
2591
2592IMPL_LINK_NOARG(SalInstanceScrollbar, ScrollHdl, ScrollBar*, void) { signal_adjustment_changed(); }
2593
2595 bool bTakeOwnership)
2596 : SalInstanceWidget(pNotebook, pBuilder, bTakeOwnership)
2597 , m_xNotebook(pNotebook)
2598{
2599 m_xNotebook->SetActivatePageHdl(LINK(this, SalInstanceNotebook, ActivatePageHdl));
2600 m_xNotebook->SetDeactivatePageHdl(LINK(this, SalInstanceNotebook, DeactivatePageHdl));
2601}
2602
2604{
2606}
2607
2609{
2611}
2612
2614{
2616}
2617
2618int SalInstanceNotebook::get_page_index(const OUString& rIdent) const
2619{
2620 sal_uInt16 nPageId = m_xNotebook->GetPageId(rIdent);
2621 sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(nPageId);
2622 if (nPageIndex == TAB_PAGE_NOTFOUND)
2623 return -1;
2624 return nPageIndex;
2625}
2626
2628{
2629 int nPageIndex = get_page_index(rIdent);
2630 if (nPageIndex == -1)
2631 return nullptr;
2632 sal_uInt16 nPageId = m_xNotebook->GetPageId(rIdent);
2634 vcl::Window* pChild = pPage->GetChild(0);
2635 if (m_aPages.size() < nPageIndex + 1U)
2636 m_aPages.resize(nPageIndex + 1U);
2637 if (!m_aPages[nPageIndex])
2638 m_aPages[nPageIndex] = std::make_shared<SalInstanceContainer>(pChild, m_pBuilder, false);
2639 return m_aPages[nPageIndex].get();
2640}
2641
2643{
2645}
2646
2647void SalInstanceNotebook::set_current_page(const OUString& rIdent)
2648{
2650}
2651
2652void SalInstanceNotebook::remove_page(const OUString& rIdent)
2653{
2654 sal_uInt16 nPageId = m_xNotebook->GetPageId(rIdent);
2655 sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(nPageId);
2656 if (nPageIndex == TAB_PAGE_NOTFOUND)
2657 return;
2658
2660 if (nPageIndex < m_aPages.size())
2661 m_aPages.erase(m_aPages.begin() + nPageIndex);
2662
2663 auto iter = m_aAddedPages.find(rIdent);
2664 if (iter != m_aAddedPages.end())
2665 {
2666 iter->second.second.disposeAndClear();
2667 iter->second.first.disposeAndClear();
2668 m_aAddedPages.erase(iter);
2669 }
2670}
2671
2672void SalInstanceNotebook::insert_page(const OUString& rIdent, const OUString& rLabel, int nPos)
2673{
2674 sal_uInt16 nPageCount = m_xNotebook->GetPageCount();
2675 sal_uInt16 nLastPageId = nPageCount ? m_xNotebook->GetPageId(nPageCount - 1) : 0;
2676 sal_uInt16 nNewPageId = nLastPageId + 1;
2677 while (m_xNotebook->GetPagePos(nNewPageId) != TAB_PAGE_NOTFOUND)
2678 ++nNewPageId;
2679 m_xNotebook->InsertPage(nNewPageId, rLabel, nPos == -1 ? TAB_APPEND : nPos);
2681 VclPtrInstance<VclGrid> xGrid(xPage);
2682 xPage->Show();
2683 xGrid->set_hexpand(true);
2684 xGrid->set_vexpand(true);
2685 xGrid->Show();
2686 m_xNotebook->SetTabPage(nNewPageId, xPage);
2687 m_xNotebook->SetPageName(nNewPageId, rIdent);
2688 m_aAddedPages.try_emplace(rIdent, xPage, xGrid);
2689
2690 if (nPos != -1)
2691 {
2692 unsigned int nPageIndex = static_cast<unsigned int>(nPos);
2693 if (nPageIndex < m_aPages.size())
2694 m_aPages.insert(m_aPages.begin() + nPageIndex, nullptr);
2695 }
2696}
2697
2699
2700OUString SalInstanceNotebook::get_tab_label_text(const OUString& rIdent) const
2701{
2702 return m_xNotebook->GetPageText(m_xNotebook->GetPageId(rIdent));
2703}
2704
2705void SalInstanceNotebook::set_tab_label_text(const OUString& rIdent, const OUString& rText)
2706{
2707 return m_xNotebook->SetPageText(m_xNotebook->GetPageId(rIdent), rText);
2708}
2709
2711{
2712 m_xNotebook->set_property("show-tabs", OUString::boolean(bShow));
2713}
2714
2716{
2717 for (auto& rItem : m_aAddedPages)
2718 {
2719 rItem.second.second.disposeAndClear();
2720 rItem.second.first.disposeAndClear();
2721 }
2724}
2725
2727{
2728 return !m_aLeavePageHdl.IsSet() || m_aLeavePageHdl.Call(get_current_page_ident());
2729}
2730
2732{
2733 m_aEnterPageHdl.Call(get_current_page_ident());
2734}
2735
2736namespace
2737{
2738class SalInstanceVerticalNotebook : public SalInstanceWidget, public virtual weld::Notebook
2739{
2740private:
2741 VclPtr<VerticalTabControl> m_xNotebook;
2742 mutable std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages;
2743
2744 DECL_LINK(DeactivatePageHdl, VerticalTabControl*, bool);
2745 DECL_LINK(ActivatePageHdl, VerticalTabControl*, void);
2746
2747public:
2748 SalInstanceVerticalNotebook(VerticalTabControl* pNotebook, SalInstanceBuilder* pBuilder,
2749 bool bTakeOwnership)
2750 : SalInstanceWidget(pNotebook, pBuilder, bTakeOwnership)
2751 , m_xNotebook(pNotebook)
2752 {
2753 m_xNotebook->SetActivatePageHdl(LINK(this, SalInstanceVerticalNotebook, ActivatePageHdl));
2754 m_xNotebook->SetDeactivatePageHdl(
2755 LINK(this, SalInstanceVerticalNotebook, DeactivatePageHdl));
2756 }
2757
2758 virtual int get_current_page() const override
2759 {
2760 return m_xNotebook->GetPagePos(m_xNotebook->GetCurPageId());
2761 }
2762
2763 virtual OUString get_page_ident(int nPage) const override
2764 {
2765 return m_xNotebook->GetPageId(nPage);
2766 }
2767
2768 virtual OUString get_current_page_ident() const override { return m_xNotebook->GetCurPageId(); }
2769
2770 virtual int get_page_index(const OUString& rIdent) const override
2771 {
2772 sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(rIdent);
2773 if (nPageIndex == TAB_PAGE_NOTFOUND)
2774 return -1;
2775 return nPageIndex;
2776 }
2777
2778 virtual weld::Container* get_page(const OUString& rIdent) const override
2779 {
2780 int nPageIndex = get_page_index(rIdent);
2781 if (nPageIndex == -1)
2782 return nullptr;
2783 auto pChild = m_xNotebook->GetPage(rIdent);
2784 if (m_aPages.size() < nPageIndex + 1U)
2785 m_aPages.resize(nPageIndex + 1U);
2786 if (!m_aPages[nPageIndex])
2787 m_aPages[nPageIndex].reset(new SalInstanceContainer(pChild, m_pBuilder, false));
2788 return m_aPages[nPageIndex].get();
2789 }
2790
2791 virtual void set_current_page(int nPage) override
2792 {
2793 m_xNotebook->SetCurPageId(m_xNotebook->GetPageId(nPage));
2794 }
2795
2796 virtual void set_current_page(const OUString& rIdent) override
2797 {
2798 m_xNotebook->SetCurPageId(rIdent);
2799 }
2800
2801 virtual void remove_page(const OUString& rIdent) override
2802 {
2803 sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(rIdent);
2804 if (nPageIndex == TAB_PAGE_NOTFOUND)
2805 return;
2806 m_xNotebook->RemovePage(rIdent);
2807 if (nPageIndex < m_aPages.size())
2808 m_aPages.erase(m_aPages.begin() + nPageIndex);
2809 }
2810
2811 virtual void insert_page(const OUString& rIdent, const OUString& rLabel, int nPos) override
2812 {
2813 VclPtrInstance<VclGrid> xGrid(m_xNotebook->GetPageParent());
2814 xGrid->set_hexpand(true);
2815 xGrid->set_vexpand(true);
2816 m_xNotebook->InsertPage(rIdent, rLabel, Image(), "", xGrid, nPos);
2817
2818 if (nPos != -1)
2819 {
2820 unsigned int nPageIndex = static_cast<unsigned int>(nPos);
2821 if (nPageIndex < m_aPages.size())
2822 m_aPages.insert(m_aPages.begin() + nPageIndex, nullptr);
2823 }
2824 }
2825
2826 virtual int get_n_pages() const override { return m_xNotebook->GetPageCount(); }
2827
2828 virtual void set_tab_label_text(const OUString& rIdent, const OUString& rText) override
2829 {
2830 return m_xNotebook->SetPageText(rIdent, rText);
2831 }
2832
2833 virtual OUString get_tab_label_text(const OUString& rIdent) const override
2834 {
2835 return m_xNotebook->GetPageText(rIdent);
2836 }
2837
2838 virtual void set_show_tabs(bool /*bShow*/) override
2839 {
2840 // if someone needs this they will have to implement it in VerticalTabControl
2841 assert(false && "not implemented");
2842 }
2843
2844 virtual ~SalInstanceVerticalNotebook() override
2845 {
2848 }
2849};
2850}
2851
2852IMPL_LINK_NOARG(SalInstanceVerticalNotebook, DeactivatePageHdl, VerticalTabControl*, bool)
2853{
2854 return !m_aLeavePageHdl.IsSet() || m_aLeavePageHdl.Call(get_current_page_ident());
2855}
2856
2857IMPL_LINK_NOARG(SalInstanceVerticalNotebook, ActivatePageHdl, VerticalTabControl*, void)
2858{
2859 m_aEnterPageHdl.Call(get_current_page_ident());
2860}
2861
2863 bool bTakeOwnership)
2864 : SalInstanceWidget(pButton, pBuilder, bTakeOwnership)
2865 , m_xButton(pButton)
2866 , m_aOldClickHdl(pButton->GetClickHdl())
2867{
2868 m_xButton->SetClickHdl(LINK(this, SalInstanceButton, ClickHdl));
2869}
2870
2871void SalInstanceButton::set_label(const OUString& rText) { m_xButton->SetText(rText); }
2872
2874{
2875 m_xButton->SetImageAlign(ImageAlign::Left);
2876 if (pDevice)
2877 m_xButton->SetModeImage(createImage(*pDevice));
2878 else
2879 m_xButton->SetModeImage(Image());
2880}
2881
2882void SalInstanceButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage)
2883{
2884 m_xButton->SetImageAlign(ImageAlign::Left);
2885 m_xButton->SetModeImage(Image(rImage));
2886}
2887
2888void SalInstanceButton::set_from_icon_name(const OUString& rIconName)
2889{
2890 m_xButton->SetModeImage(Image(StockImage::Yes, rIconName));
2891}
2892
2893static void set_label_wrap(Control& rWidget, bool wrap)
2894{
2895 WinBits nBits = rWidget.GetStyle();
2896 nBits &= ~WB_WORDBREAK;
2897 if (wrap)
2898 nBits |= WB_WORDBREAK;
2899 rWidget.SetStyle(nBits);
2900 rWidget.queue_resize();
2901}
2902
2904{
2905 m_xButton->SetControlFont(rFont);
2906 m_xButton->Invalidate();
2907}
2908
2910{
2911 if (pDevice)
2912 m_xButton->SetCustomButtonImage(createImage(*pDevice));
2913 else
2914 m_xButton->SetCustomButtonImage(Image());
2915 m_xButton->Invalidate();
2916}
2917
2918OUString SalInstanceButton::get_label() const { return m_xButton->GetText(); }
2919
2921
2922IMPL_LINK(SalInstanceButton, ClickHdl, ::Button*, pButton, void)
2923{
2924 //if there's no handler set, disengage our intercept and
2925 //run the click again to get default behaviour for cancel/ok
2926 //etc buttons.
2927 if (!m_aClickHdl.IsSet())
2928 {
2929 pButton->SetClickHdl(m_aOldClickHdl);
2930 pButton->Click();
2931 pButton->SetClickHdl(LINK(this, SalInstanceButton, ClickHdl));
2932 return;
2933 }
2934 signal_clicked();
2935}
2936
2938{
2939 PushButton* pButton = dynamic_cast<PushButton*>(m_xDialog->get_widget_for_response(nResponse));
2940 return pButton ? new SalInstanceButton(pButton, nullptr, false) : nullptr;
2941}
2942
2944{
2945 PushButton* pButton = nullptr;
2946 if (nResponse == RET_YES)
2947 pButton = m_xWizard->m_pNextPage;
2948 else if (nResponse == RET_NO)
2949 pButton = m_xWizard->m_pPrevPage;
2950 else if (nResponse == RET_OK)
2951 pButton = m_xWizard->m_pFinish;
2952 else if (nResponse == RET_CANCEL)
2953 pButton = m_xWizard->m_pCancel;
2954 else if (nResponse == RET_HELP)
2955 pButton = m_xWizard->m_pHelp;
2956 if (pButton)
2957 return new SalInstanceButton(pButton, nullptr, false);
2958 return nullptr;
2959}
2960
2962 bool bTakeOwnership)
2963 : SalInstanceButton(pButton, pBuilder, bTakeOwnership)
2964 , m_xMenuButton(pButton)
2965 , m_nLastId(0)
2966{
2967 m_xMenuButton->SetActivateHdl(LINK(this, SalInstanceMenuButton, ActivateHdl));
2968 m_xMenuButton->SetSelectHdl(LINK(this, SalInstanceMenuButton, MenuSelectHdl));
2969 if (PopupMenu* pMenu = m_xMenuButton->GetPopupMenu())
2970 {
2972 const auto nCount = pMenu->GetItemCount();
2973 m_nLastId = nCount ? pMenu->GetItemId(nCount - 1) : 0;
2974 }
2975}
2976
2978{
2979 if (active == get_active())
2980 return;
2981 if (active)
2982 m_xMenuButton->ExecuteMenu();
2983 else
2984 m_xMenuButton->CancelMenu();
2985}
2986
2987bool SalInstanceMenuButton::get_active() const { return m_xMenuButton->InPopupMode(); }
2988
2990{
2991 //not available
2992}
2993
2994bool SalInstanceMenuButton::get_inconsistent() const { return false; }
2995
2996void SalInstanceMenuButton::insert_item(int pos, const OUString& rId, const OUString& rStr,
2997 const OUString* pIconName, VirtualDevice* pImageSurface,
2998 TriState eCheckRadioFalse)
2999{
3000 m_nLastId = insert_to_menu(m_nLastId, m_xMenuButton->GetPopupMenu(), pos, rId, rStr, pIconName,
3001 pImageSurface, nullptr, eCheckRadioFalse);
3002}
3003
3004void SalInstanceMenuButton::insert_separator(int pos, const OUString& rId)
3005{
3006 auto nInsertPos = pos == -1 ? MENU_APPEND : pos;
3007 m_xMenuButton->GetPopupMenu()->InsertSeparator(rId, nInsertPos);
3008}
3009
3010void SalInstanceMenuButton::set_item_sensitive(const OUString& rIdent, bool bSensitive)
3011{
3012 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3013 pMenu->EnableItem(rIdent, bSensitive);
3014}
3015
3016void SalInstanceMenuButton::remove_item(const OUString& rId)
3017{
3018 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3019 pMenu->RemoveItem(pMenu->GetItemPos(pMenu->GetItemId(rId)));
3020}
3021
3023{
3024 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3025 pMenu->Clear();
3026}
3027
3028void SalInstanceMenuButton::set_item_active(const OUString& rIdent, bool bActive)
3029{
3030 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3031 pMenu->CheckItem(rIdent, bActive);
3032}
3033
3034void SalInstanceMenuButton::set_item_label(const OUString& rIdent, const OUString& rText)
3035{
3036 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3037 pMenu->SetItemText(pMenu->GetItemId(rIdent), rText);
3038}
3039
3040OUString SalInstanceMenuButton::get_item_label(const OUString& rIdent) const
3041{
3042 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3043 return pMenu->GetItemText(pMenu->GetItemId(rIdent));
3044}
3045
3046void SalInstanceMenuButton::set_item_visible(const OUString& rIdent, bool bShow)
3047{
3048 PopupMenu* pMenu = m_xMenuButton->GetPopupMenu();
3049 pMenu->ShowItem(pMenu->GetItemId(rIdent), bShow);
3050}
3051
3053{
3054 SalInstanceWidget* pPopoverWidget = dynamic_cast<SalInstanceWidget*>(pPopover);
3055 m_xMenuButton->SetPopover(pPopoverWidget ? pPopoverWidget->getWidget() : nullptr);
3056}
3057
3059{
3061 m_xMenuButton->SetActivateHdl(Link<::MenuButton*, void>());
3062}
3063
3065{
3066 signal_selected(m_xMenuButton->GetCurItemIdent());
3067}
3068
3070{
3071 if (notify_events_disabled())
3072 return;
3073 signal_toggled();
3074}
3075
3076namespace
3077{
3078class SalInstanceMenuToggleButton : public SalInstanceMenuButton,
3079 public virtual weld::MenuToggleButton
3080{
3081private:
3082 VclPtr<::MenuToggleButton> m_xMenuToggleButton;
3083
3084public:
3085 SalInstanceMenuToggleButton(::MenuToggleButton* pButton, SalInstanceBuilder* pBuilder,
3086 bool bTakeOwnership)
3087 : SalInstanceMenuButton(pButton, pBuilder, bTakeOwnership)
3088 , m_xMenuToggleButton(pButton)
3089 {
3090 m_xMenuToggleButton->SetDelayMenu(true);
3091 m_xMenuToggleButton->SetDropDown(PushButtonDropdownStyle::SplitMenuButton);
3092 }
3093
3094 virtual void set_active(bool active) override
3095 {
3097 m_xMenuToggleButton->SetActive(active);
3099 }
3100
3101 virtual bool get_active() const override { return m_xMenuToggleButton->GetActive(); }
3102};
3103}
3104
3105IMPL_LINK(SalInstanceLinkButton, ClickHdl, FixedHyperlink&, rButton, void)
3106{
3107 bool bConsumed = signal_activate_link();
3108 if (!bConsumed)
3109 m_aOrigClickHdl.Call(rButton);
3110}
3111
3113
3115 bool bTakeOwnership)
3116 : SalInstanceButton(pButton, pBuilder, bTakeOwnership)
3117 , m_xRadioButton(pButton)
3118{
3119 m_xRadioButton->SetToggleHdl(LINK(this, SalInstanceRadioButton, ToggleHdl));
3120}
3121
3123{
3125 m_xRadioButton->Check(active);
3127}
3128
3129bool SalInstanceRadioButton::get_active() const { return m_xRadioButton->IsChecked(); }
3130
3132{
3133 m_xRadioButton->SetImageAlign(ImageAlign::Center);
3134 if (pDevice)
3135 m_xRadioButton->SetModeImage(createImage(*pDevice));
3136 else
3137 m_xRadioButton->SetModeImage(Image());
3138}
3139
3140void SalInstanceRadioButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage)
3141{
3142 m_xRadioButton->SetImageAlign(ImageAlign::Center);
3143 m_xRadioButton->SetModeImage(Image(rImage));
3144}
3145
3146void SalInstanceRadioButton::set_from_icon_name(const OUString& rIconName)
3147{
3148 m_xRadioButton->SetModeRadioImage(Image(StockImage::Yes, rIconName));
3149}
3150
3152{
3153 //not available
3154}
3155
3156bool SalInstanceRadioButton::get_inconsistent() const { return false; }
3157
3159{
3161}
3162
3164{
3166}
3167
3169{
3170 if (notify_events_disabled())
3171 return;
3172 signal_toggled();
3173}
3174
3175IMPL_LINK(SalInstanceToggleButton, ToggleListener, VclWindowEvent&, rEvent, void)
3176{
3177 if (notify_events_disabled())
3178 return;
3179 if (rEvent.GetId() == VclEventId::PushbuttonToggle)
3180 signal_toggled();
3181}
3182
3184 bool bTakeOwnership)
3185 : SalInstanceButton(pButton, pBuilder, bTakeOwnership)
3186 , m_xCheckButton(pButton)
3187{
3189}
3190
3192{
3195 m_xCheckButton->Check(active);
3197}
3198
3200
3202{
3207}
3208
3210{
3212}
3213
3215{
3217}
3218
3220{
3222}
3223
3225{
3226 if (notify_events_disabled())
3227 return;
3228 m_xCheckButton->EnableTriState(false);
3229 signal_toggled();
3230}
3231
3232namespace
3233{
3234class SalInstanceScale : public SalInstanceWidget, public virtual weld::Scale
3235{
3236private:
3237 VclPtr<Slider> m_xScale;
3238
3239 DECL_LINK(SlideHdl, Slider*, void);
3240
3241public:
3242 SalInstanceScale(Slider* pScale, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
3243 : SalInstanceWidget(pScale, pBuilder, bTakeOwnership)
3244 , m_xScale(pScale)
3245 {
3246 m_xScale->SetSlideHdl(LINK(this, SalInstanceScale, SlideHdl));
3247 }
3248
3249 virtual void set_value(int value) override { m_xScale->SetThumbPos(value); }
3250
3251 virtual void set_range(int min, int max) override
3252 {
3253 m_xScale->SetRangeMin(min);
3254 m_xScale->SetRangeMax(max);
3255 }
3256
3257 virtual int get_value() const override { return m_xScale->GetThumbPos(); }
3258
3259 virtual void set_increments(int step, int page) override
3260 {
3261 m_xScale->SetLineSize(step);
3262 m_xScale->SetPageSize(page);
3263 }
3264
3265 virtual void get_increments(int& step, int& page) const override
3266 {
3267 step = m_xScale->GetLineSize();
3268 page = m_xScale->GetPageSize();
3269 }
3270
3271 virtual ~SalInstanceScale() override { m_xScale->SetSlideHdl(Link<Slider*, void>()); }
3272};
3273}
3274
3275IMPL_LINK_NOARG(SalInstanceScale, SlideHdl, Slider*, void) { signal_value_changed(); }
3276
3277namespace
3278{
3279class SalInstanceSpinner : public SalInstanceWidget, public virtual weld::Spinner
3280{
3281private:
3282 VclPtr<Throbber> m_xThrobber;
3283
3284public:
3285 SalInstanceSpinner(Throbber* pThrobber, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
3286 : SalInstanceWidget(pThrobber, pBuilder, bTakeOwnership)
3287 , m_xThrobber(pThrobber)
3288 {
3289 }
3290
3291 virtual void start() override { m_xThrobber->start(); }
3292
3293 virtual void stop() override { m_xThrobber->stop(); }
3294};
3295
3296class SalInstanceProgressBar : public SalInstanceWidget, public virtual weld::ProgressBar
3297{
3298private:
3299 VclPtr<::ProgressBar> m_xProgressBar;
3300
3301public:
3302 SalInstanceProgressBar(::ProgressBar* pProgressBar, SalInstanceBuilder* pBuilder,
3303 bool bTakeOwnership)
3304 : SalInstanceWidget(pProgressBar, pBuilder, bTakeOwnership)
3305 , m_xProgressBar(pProgressBar)
3306 {
3307 }
3308
3309 virtual void set_percentage(int value) override { m_xProgressBar->SetValue(value); }
3310
3311 virtual OUString get_text() const override { return m_xProgressBar->GetText(); }
3312
3313 virtual void set_text(const OUString& rText) override { m_xProgressBar->SetText(rText); }
3314};
3315}
3316
3318{
3319 if (notify_events_disabled())
3320 return;
3321 signal_selected();
3322}
3323
3325{
3326 if (notify_events_disabled())
3327 return;
3328 signal_activated();
3329}
3330
3332 bool bTakeOwnership)
3333 : SalInstanceWidget(pImage, pBuilder, bTakeOwnership)
3334 , m_xImage(pImage)
3335{
3336}
3337
3338void SalInstanceImage::set_from_icon_name(const OUString& rIconName)
3339{
3341}
3342
3344{
3345 if (pDevice)
3346 m_xImage->SetImage(createImage(*pDevice));
3347 else
3349}
3350
3351void SalInstanceImage::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage)
3352{
3353 m_xImage->SetImage(::Image(rImage));
3354}
3355
3357 : TextFilter(OUString())
3358 , m_rInsertTextHdl(rInsertTextHdl)
3359{
3360}
3361
3362OUString WeldTextFilter::filter(const OUString& rText)
3363{
3364 if (!m_rInsertTextHdl.IsSet())
3365 return rText;
3366 OUString sText(rText);
3367 const bool bContinue = m_rInsertTextHdl.Call(sText);
3368 if (!bContinue)
3369 return OUString();
3370 return sText;
3371}
3372
3373SalInstanceEntry::SalInstanceEntry(Edit* pEntry, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
3374 : SalInstanceWidget(pEntry, pBuilder, bTakeOwnership)
3375 , m_xEntry(pEntry)
3376 , m_aTextFilter(m_aInsertTextHdl)
3377{
3378 m_xEntry->SetModifyHdl(LINK(this, SalInstanceEntry, ChangeHdl));
3379 m_xEntry->SetActivateHdl(LINK(this, SalInstanceEntry, ActivateHdl));
3380 m_xEntry->SetTextFilter(&m_aTextFilter);
3381}
3382
3383void SalInstanceEntry::set_text(const OUString& rText)
3384{
3386 m_xEntry->SetText(rText);
3388}
3389
3390OUString SalInstanceEntry::get_text() const { return m_xEntry->GetText(); }
3391
3392void SalInstanceEntry::set_width_chars(int nChars) { m_xEntry->SetWidthInChars(nChars); }
3393
3394int SalInstanceEntry::get_width_chars() const { return m_xEntry->GetWidthInChars(); }
3395
3396void SalInstanceEntry::set_max_length(int nChars) { m_xEntry->SetMaxTextLen(nChars); }
3397
3398void SalInstanceEntry::select_region(int nStartPos, int nEndPos)
3399{
3401 tools::Long nStart = nStartPos < 0 ? SELECTION_MAX : nStartPos;
3402 tools::Long nEnd = nEndPos < 0 ? SELECTION_MAX : nEndPos;
3403 m_xEntry->SetSelection(Selection(nStart, nEnd));
3405}
3406
3407bool SalInstanceEntry::get_selection_bounds(int& rStartPos, int& rEndPos)
3408{
3409 const Selection& rSelection = m_xEntry->GetSelection();
3410 rStartPos = rSelection.Min();
3411 rEndPos = rSelection.Max();
3412 return rSelection.Len();
3413}
3414
3415void SalInstanceEntry::replace_selection(const OUString& rText)
3416{
3417 m_xEntry->ReplaceSelected(rText);
3418}
3419
3421{
3423 if (nCursorPos < 0)
3424 m_xEntry->SetCursorAtLast();
3425 else
3426 m_xEntry->SetSelection(Selection(nCursorPos, nCursorPos));
3428}
3429
3430int SalInstanceEntry::get_position() const { return m_xEntry->GetSelection().Max(); }
3431
3432void SalInstanceEntry::set_editable(bool bEditable) { m_xEntry->SetReadOnly(!bEditable); }
3433
3434bool SalInstanceEntry::get_editable() const { return !m_xEntry->IsReadOnly(); }
3435
3436void SalInstanceEntry::set_overwrite_mode(bool bOn) { m_xEntry->SetInsertMode(!bOn); }
3437
3438bool SalInstanceEntry::get_overwrite_mode() const { return !m_xEntry->IsInsertMode(); }
3439
3440namespace
3441{
3442void set_message_type(Edit* pEntry, weld::EntryMessageType eType)
3443{
3444 switch (eType)
3445 {
3447 pEntry->SetForceControlBackground(false);
3448 pEntry->SetControlForeground();
3449 pEntry->SetControlBackground();
3450 break;
3452 // tdf#114603: enable setting the background to a different color;
3453 // relevant for GTK; see also #i75179#
3454 pEntry->SetForceControlBackground(true);
3455 pEntry->SetControlForeground(COL_BLACK);
3456 pEntry->SetControlBackground(0xffff38); // "light yellow 1"
3457 break;
3459 // tdf#114603: enable setting the background to a different color;
3460 // relevant for GTK; see also #i75179#
3461 pEntry->SetForceControlBackground(true);
3462 pEntry->SetControlForeground(COL_BLACK); // contrast of 5.87 to the red background
3463 pEntry->SetControlBackground(0xff3838); // "light red 1"
3464 break;
3465 }
3466}
3467}
3468
3470{
3472}
3473
3475{
3476 m_xEntry->SetControlFont(rFont);
3477 m_xEntry->Invalidate();
3478}
3479
3481{
3482 if (rColor == COL_AUTO)
3483 m_xEntry->SetControlForeground();
3484 else
3485 m_xEntry->SetControlForeground(rColor);
3486}
3487
3489{
3490 assert(!m_aCursorPositionHdl.IsSet());
3491 m_xEntry->AddEventListener(LINK(this, SalInstanceEntry, CursorListener));
3493}
3494
3496{
3497 m_xEntry->SetPlaceholderText(rText);
3498}
3499
3501
3503
3505{
3506 m_xEntry->Cut();
3507 m_xEntry->Modify();
3508}
3509
3511
3513{
3514 m_xEntry->Paste();
3515 m_xEntry->Modify();
3516}
3517
3518namespace
3519{
3520void set_alignment(Edit& rEntry, TxtAlign eXAlign)
3521{
3522 WinBits nAlign(0);
3523 switch (eXAlign)
3524 {
3525 case TxtAlign::Left:
3526 nAlign = WB_LEFT;
3527 break;
3528 case TxtAlign::Center:
3529 nAlign = WB_CENTER;
3530 break;
3531 case TxtAlign::Right:
3532 nAlign = WB_RIGHT;
3533 break;
3534 }
3535 WinBits nBits = rEntry.GetStyle();
3536 nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT);
3537 rEntry.SetStyle(nBits | nAlign);
3538}
3539}
3540
3542
3544{
3545 if (m_aCursorPositionHdl.IsSet())
3546 m_xEntry->RemoveEventListener(LINK(this, SalInstanceEntry, CursorListener));
3547 m_xEntry->SetTextFilter(nullptr);
3548 m_xEntry->SetActivateHdl(Link<Edit&, bool>());
3549 m_xEntry->SetModifyHdl(Link<Edit&, void>());
3550}
3551
3552IMPL_LINK_NOARG(SalInstanceEntry, ChangeHdl, Edit&, void) { signal_changed(); }
3553
3554IMPL_LINK(SalInstanceEntry, CursorListener, VclWindowEvent&, rEvent, void)
3555{
3556 if (notify_events_disabled())
3557 return;
3558 if (rEvent.GetId() == VclEventId::EditSelectionChanged
3559 || rEvent.GetId() == VclEventId::EditCaretChanged)
3560 signal_cursor_position();
3561}
3562
3563IMPL_LINK_NOARG(SalInstanceEntry, ActivateHdl, Edit&, bool) { return m_aActivateHdl.Call(*this); }
3564
3566
3568
3569namespace
3570{
3571// tdf#131581 if the TreeView is hidden then there are possibly additional
3572// optimizations available
3573class UpdateGuardIfHidden
3574{
3575private:
3576 SvTabListBox& m_rTreeView;
3577 bool m_bOrigUpdate;
3578 bool m_bOrigEnableInvalidate;
3579
3580public:
3581 UpdateGuardIfHidden(SvTabListBox& rTreeView)
3582 : m_rTreeView(rTreeView)
3583 // tdf#136962 only do SetUpdateMode(false) optimization if the widget is currently hidden
3584 , m_bOrigUpdate(!m_rTreeView.IsVisible() && m_rTreeView.IsUpdateMode())
3585 // tdf#137432 only do EnableInvalidate(false) optimization if the widget is currently hidden
3586 , m_bOrigEnableInvalidate(!m_rTreeView.IsVisible()
3587 && m_rTreeView.GetModel()->IsEnableInvalidate())
3588 {
3589 if (m_bOrigUpdate)
3590 m_rTreeView.SetUpdateMode(false);
3591 if (m_bOrigEnableInvalidate)
3592 m_rTreeView.GetModel()->EnableInvalidate(false);
3593 }
3594
3595 ~UpdateGuardIfHidden()
3596 {
3597 if (m_bOrigEnableInvalidate)
3598 m_rTreeView.GetModel()->EnableInvalidate(true);
3599 if (m_bOrigUpdate)
3600 m_rTreeView.SetUpdateMode(true);
3601 }
3602};
3603}
3604
3605// Each row has a cell for the expander image, (and an optional cell for a
3606// checkbutton if enable_toggle_buttons has been called) which precede
3607// index 0
3609{
3611 ++col; // skip checkbutton column
3612 ++col; //skip expander column
3613 return col;
3614}
3615
3617{
3619 --col; // skip checkbutton column
3620 --col; //skip expander column
3621 return col;
3622}
3623
3625{
3626 return o3tl::trim(m_xTreeView->GetEntryText(pEntry)) == u"<dummy>";
3627}
3628
3630{
3631 if (pEntry->HasChildren())
3632 {
3633 auto pChild = m_xTreeView->FirstChild(pEntry);
3634 assert(pChild);
3635 if (IsDummyEntry(pChild))
3636 return pChild;
3637 }
3638 return nullptr;
3639}
3640
3642{
3643 if (rColor == COL_AUTO)
3644 pEntry->SetTextColor(std::optional<Color>());
3645 else
3646 pEntry->SetTextColor(rColor);
3647}
3648
3649void SalInstanceTreeView::AddStringItem(SvTreeListEntry* pEntry, const OUString& rStr, int nCol)
3650{
3651 auto xCell = std::make_unique<SvLBoxString>(rStr);
3652 if (m_aCustomRenders.count(nCol))
3653 xCell->SetCustomRender();
3654 pEntry->AddItem(std::move(xCell));
3655}
3656
3657void SalInstanceTreeView::do_insert(const weld::TreeIter* pParent, int pos, const OUString* pStr,
3658 const OUString* pId, const OUString* pIconName,
3659 const VirtualDevice* pImageSurface, bool bChildrenOnDemand,
3660 weld::TreeIter* pRet, bool bIsSeparator)
3661{
3663 const SalInstanceTreeIter* pVclIter = static_cast<const SalInstanceTreeIter*>(pParent);
3664 SvTreeListEntry* iter = pVclIter ? pVclIter->iter : nullptr;
3665 auto nInsertPos = pos == -1 ? TREELIST_APPEND : pos;
3666 void* pUserData;
3667 if (pId)
3668 {
3669 m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
3670 pUserData = m_aUserData.back().get();
3671 }
3672 else
3673 pUserData = nullptr;
3674
3675 SvTreeListEntry* pEntry = new SvTreeListEntry;
3676 if (bIsSeparator)
3677 pEntry->SetFlags(pEntry->GetFlags() | SvTLEntryFlags::IS_SEPARATOR);
3678
3680 AddStringItem(pEntry, "", -1);
3681
3682 if (pIconName || pImageSurface)
3683 {
3684 Image aImage(pIconName ? createImage(*pIconName) : createImage(*pImageSurface));
3685 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aImage, aImage, false));
3686 }
3687 else
3688 {
3689 Image aDummy;
3690 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aDummy, aDummy, false));
3691 }
3692 if (pStr)
3693 AddStringItem(pEntry, *pStr, pEntry->ItemCount());
3694 pEntry->SetUserData(pUserData);
3695 m_xTreeView->Insert(pEntry, iter, nInsertPos);
3696
3697 if (pRet)
3698 {
3699 SalInstanceTreeIter* pVclRetIter = static_cast<SalInstanceTreeIter*>(pRet);
3700 pVclRetIter->iter = pEntry;
3701 }
3702
3703 if (bChildrenOnDemand)
3704 {
3705 SvTreeListEntry* pPlaceHolder
3706 = m_xTreeView->InsertEntry("<dummy>", pEntry, false, 0, nullptr);
3707 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pPlaceHolder);
3708 pViewData->SetSelectable(false);
3709 }
3710
3711 if (bIsSeparator)
3712 {
3713 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pEntry);
3714 pViewData->SetSelectable(false);
3715 }
3716
3718}
3719
3721{
3722 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pEntry);
3723 m_xTreeView->InitViewData(pViewData, pEntry);
3725}
3726
3728{
3730 return;
3732}
3733
3735{
3736 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
3737 // if it's the placeholder to allow a blank column, replace it now
3738 if (pEntry->GetItem(col).GetType() != SvLBoxItemType::Button)
3739 {
3741 pEntry->ReplaceItem(std::make_unique<SvLBoxButton>(pData), 0);
3743 }
3744 SvLBoxItem& rItem = pEntry->GetItem(col);
3745 assert(dynamic_cast<SvLBoxButton*>(&rItem));
3746 switch (eState)
3747 {
3748 case TRISTATE_TRUE:
3749 static_cast<SvLBoxButton&>(rItem).SetStateChecked();
3750 break;
3751 case TRISTATE_FALSE:
3752 static_cast<SvLBoxButton&>(rItem).SetStateUnchecked();
3753 break;
3754 case TRISTATE_INDET:
3755 static_cast<SvLBoxButton&>(rItem).SetStateTristate();
3756 break;
3757 }
3758
3759 InvalidateModelEntry(pEntry);
3760}
3761
3763{
3764 if (static_cast<size_t>(col) == pEntry->ItemCount())
3765 return TRISTATE_FALSE;
3766
3767 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
3768 SvLBoxItem& rItem = pEntry->GetItem(col);
3769 assert(dynamic_cast<SvLBoxButton*>(&rItem));
3770 SvLBoxButton& rToggle = static_cast<SvLBoxButton&>(rItem);
3771 if (rToggle.IsStateTristate())
3772 return TRISTATE_INDET;
3773 else if (rToggle.IsStateChecked())
3774 return TRISTATE_TRUE;
3775 return TRISTATE_FALSE;
3776}
3777
3779{
3780 if (col == -1)
3781 {
3783 return do_get_toggle(pEntry, 0);
3784 }
3786 return do_get_toggle(pEntry, col);
3787}
3788
3790{
3791 if (col == -1)
3792 {
3794 do_set_toggle(pEntry, eState, 0);
3795 return;
3796 }
3797
3799
3800 // blank out missing entries
3801 for (int i = pEntry->ItemCount(); i < col; ++i)
3802 AddStringItem(pEntry, "", i - 1);
3803
3804 if (static_cast<size_t>(col) == pEntry->ItemCount())
3805 {
3807 pEntry->AddItem(std::make_unique<SvLBoxButton>(pData));
3809 }
3810
3811 do_set_toggle(pEntry, eState, col);
3812}
3813
3815{
3817
3818 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
3819 SvLBoxItem& rItem = pEntry->GetItem(col);
3820 assert(dynamic_cast<SvLBoxString*>(&rItem));
3821 return static_cast<SvLBoxString&>(rItem).IsEmphasized();
3822}
3823
3824void SalInstanceTreeView::set_header_item_width(const std::vector<int>& rWidths)
3825{
3826 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
3827 if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
3828 {
3829 for (size_t i = 0; i < rWidths.size(); ++i)
3830 pHeaderBar->SetItemSize(pHeaderBar->GetItemId(i), rWidths[i]);
3831 }
3832}
3833
3835 bool bTakeOwnership)
3836 : SalInstanceWidget(pTreeView, pBuilder, bTakeOwnership)
3837 , m_xTreeView(pTreeView)
3838 , m_aCheckButtonData(pTreeView, false)
3839 , m_aRadioButtonData(pTreeView, true)
3840 , m_bTogglesAsRadio(false)
3841 , m_nSortColumn(-1)
3842{
3846 m_xTreeView->SetDeselectHdl(LINK(this, SalInstanceTreeView, DeSelectHdl));
3847 m_xTreeView->SetDoubleClickHdl(LINK(this, SalInstanceTreeView, DoubleClickHdl));
3848 m_xTreeView->SetExpandingHdl(LINK(this, SalInstanceTreeView, ExpandingHdl));
3849 m_xTreeView->SetPopupMenuHdl(LINK(this, SalInstanceTreeView, PopupMenuHdl));
3850 m_xTreeView->SetCustomRenderHdl(LINK(this, SalInstanceTreeView, CustomRenderHdl));
3851 m_xTreeView->SetCustomMeasureHdl(LINK(this, SalInstanceTreeView, CustomMeasureHdl));
3852 const tools::Long aTabPositions[] = { 0 };
3853 m_xTreeView->SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions);
3854 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
3855
3856 if (pHeaderBox)
3857 {
3858 if (HeaderBar* pHeaderBar = pHeaderBox->GetHeaderBar())
3859 {
3860 //make the last entry fill available space
3861 pHeaderBar->SetItemSize(pHeaderBar->GetItemId(pHeaderBar->GetItemCount() - 1),
3863 pHeaderBar->SetEndDragHdl(LINK(this, SalInstanceTreeView, EndDragHdl));
3864 pHeaderBar->SetSelectHdl(LINK(this, SalInstanceTreeView, HeaderBarClickedHdl));
3865 }
3866 pHeaderBox->SetEditingEntryHdl(LINK(this, SalInstanceTreeView, EditingEntryHdl));
3867 pHeaderBox->SetEditedEntryHdl(LINK(this, SalInstanceTreeView, EditedEntryHdl));
3868 }
3869 else
3870 {
3871 static_cast<LclTabListBox&>(*m_xTreeView)
3872 .SetModelChangedHdl(LINK(this, SalInstanceTreeView, ModelChangedHdl));
3873 static_cast<LclTabListBox&>(*m_xTreeView)
3874 .SetStartDragHdl(LINK(this, SalInstanceTreeView, StartDragHdl));
3875 static_cast<LclTabListBox&>(*m_xTreeView)
3876 .SetEndDragHdl(LINK(this, SalInstanceTreeView, FinishDragHdl));
3877 static_cast<LclTabListBox&>(*m_xTreeView)
3878 .SetEditingEntryHdl(LINK(this, SalInstanceTreeView, EditingEntryHdl));
3879 static_cast<LclTabListBox&>(*m_xTreeView)
3880 .SetEditedEntryHdl(LINK(this, SalInstanceTreeView, EditedEntryHdl));
3881 }
3884}
3885
3887{
3890}
3891
3893{
3894 std::vector<tools::Long> aWidths;
3896 if (aWidths.size() > 2)
3897 {
3898 std::vector<int> aColWidths;
3899 for (size_t i = 1; i < aWidths.size() - 1; ++i)
3900 aColWidths.push_back(aWidths[i] - aWidths[i - 1]);
3901 set_column_fixed_widths(aColWidths);
3902 }
3903}
3904
3906{
3907 bool bIsFirstFreeze = IsFirstFreeze();
3909 if (bIsFirstFreeze)
3910 {
3911 m_xTreeView->SetUpdateMode(false);
3913 }
3914}
3915
3917{
3918 bool bIsLastThaw = IsLastThaw();
3919 if (bIsLastThaw)
3920 {
3923 }
3925}
3926
3927void SalInstanceTreeView::set_column_fixed_widths(const std::vector<int>& rWidths)
3928{
3929 std::vector<tools::Long> aTabPositions{ 0 };
3930 for (size_t i = 0; i < rWidths.size(); ++i)
3931 aTabPositions.push_back(aTabPositions[i] + rWidths[i]);
3932 m_xTreeView->SetTabs(aTabPositions.size(), aTabPositions.data(), MapUnit::MapPixel);
3933 set_header_item_width(rWidths);
3934 // call Resize to recalculate based on the new tabs
3936}
3937
3938void SalInstanceTreeView::set_column_editables(const std::vector<bool>& rEditables)
3939{
3940 size_t nTabCount = rEditables.size();
3941 for (size_t i = 0; i < nTabCount; ++i)
3942 m_xTreeView->SetTabEditable(i, rEditables[i]);
3943}
3944
3946{
3948}
3949
3951{
3952 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
3953 if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
3954 return pHeaderBar->GetItemSize(pHeaderBar->GetItemId(nColumn));
3955 // GetTab(0) gives the position of the bitmap which is automatically inserted by the TabListBox.
3956 // So the first text column's width is Tab(2)-Tab(1).
3957 auto nWidthPixel
3958 = m_xTreeView->GetLogicTab(nColumn + 2) - m_xTreeView->GetLogicTab(nColumn + 1);
3959 nWidthPixel -= SV_TAB_BORDER;
3960 return nWidthPixel;
3961}
3962
3963OUString SalInstanceTreeView::get_column_title(int nColumn) const
3964{
3965 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
3966 if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
3967 {
3968 return pHeaderBar->GetItemText(pHeaderBar->GetItemId(nColumn));
3969 }
3970 return OUString();
3971}
3972
3973void SalInstanceTreeView::set_column_title(int nColumn, const OUString& rTitle)
3974{
3975 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
3976 if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
3977 {
3978 return pHeaderBar->SetItemText(pHeaderBar->GetItemId(nColumn), rTitle);
3979 }
3980}
3981
3983{
3984 assert(n_children() == 0 && "tree must be empty");
3985 if (bEnable)
3986 m_aCustomRenders.insert(nColumn);
3987 else
3988 m_aCustomRenders.erase(nColumn);
3989}
3990
3992{
3993 // invalidate the entries
3994 SvTreeList* pModel = m_xTreeView->GetModel();
3995 for (SvTreeListEntry* pEntry = m_xTreeView->First(); pEntry; pEntry = m_xTreeView->Next(pEntry))
3996 pModel->InvalidateEntry(pEntry);
3997}
3998
4000{
4001 if (LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get()))
4002 pHeaderBox->GetParent()->Show();
4004}
4005
4007{
4008 if (LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get()))
4009 pHeaderBox->GetParent()->Hide();
4011}
4012
4013void SalInstanceTreeView::insert(const weld::TreeIter* pParent, int pos, const OUString* pStr,
4014 const OUString* pId, const OUString* pIconName,
4015 VirtualDevice* pImageSurface, bool bChildrenOnDemand,
4016 weld::TreeIter* pRet)
4017{
4018 do_insert(pParent, pos, pStr, pId, pIconName, pImageSurface, bChildrenOnDemand, pRet, false);
4019}
4020
4021void SalInstanceTreeView::insert_separator(int pos, const OUString& /*rId*/)
4022{
4023 OUString sSep(VclResId(STR_SEPARATOR));
4024 do_insert(nullptr, pos, &sSep, nullptr, nullptr, nullptr, false, nullptr, true);
4025}
4026
4028 int nSourceCount, const std::function<void(weld::TreeIter&, int nSourceIndex)>& func,
4029 const weld::TreeIter* pParent, const std::vector<int>* pFixedWidths)
4030{
4031 const SalInstanceTreeIter* pVclIter = static_cast<const SalInstanceTreeIter*>(pParent);
4032 SvTreeListEntry* pVclParent = pVclIter ? pVclIter->iter : nullptr;
4033
4034 freeze();
4035 if (!pVclParent)
4036 clear();
4037 else
4038 {
4039 while (SvTreeListEntry* pChild = m_xTreeView->FirstChild(pVclParent))
4040 m_xTreeView->RemoveEntry(pChild);
4041 }
4042 SalInstanceTreeIter aVclIter(static_cast<SvTreeListEntry*>(nullptr));
4043
4045
4046 if (pFixedWidths)
4047 set_header_item_width(*pFixedWidths);
4048
4049 bool bHasAutoCheckButton(m_xTreeView->nTreeFlags & SvTreeFlags::CHKBTN);
4050 size_t nExtraCols = bHasAutoCheckButton ? 2 : 1;
4051
4052 Image aDummy;
4053 for (int i = 0; i < nSourceCount; ++i)
4054 {
4055 aVclIter.iter = new SvTreeListEntry;
4056 if (bHasAutoCheckButton)
4057 AddStringItem(aVclIter.iter, "", -1);
4058 aVclIter.iter->AddItem(std::make_unique<SvLBoxContextBmp>(aDummy, aDummy, false));
4059 m_xTreeView->Insert(aVclIter.iter, pVclParent, TREELIST_APPEND);
4060 func(aVclIter, i);
4061
4062 if (!pFixedWidths)
4063 continue;
4064
4065 size_t nFixedWidths = std::min(pFixedWidths->size(), aVclIter.iter->ItemCount());
4066 for (size_t j = 0; j < nFixedWidths; ++j)
4067 {
4068 SvLBoxItem& rItem = aVclIter.iter->GetItem(j + nExtraCols);
4069 SvViewDataItem* pViewDataItem = m_xTreeView->GetViewDataItem(aVclIter.iter, &rItem);
4070 pViewDataItem->mnWidth = (*pFixedWidths)[j];
4071 }
4072 }
4073
4075
4076 thaw();
4077}
4078
4079void SalInstanceTreeView::set_font_color(int pos, const Color& rColor)
4080{
4081 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4082 set_font_color(pEntry, rColor);
4083}
4084
4086{
4087 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4088 set_font_color(rVclIter.iter, rColor);
4089}
4090
4092{
4094 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4095 m_xTreeView->RemoveEntry(pEntry);
4097}
4098
4099int SalInstanceTreeView::find_text(const OUString& rText) const
4100{
4101 for (SvTreeListEntry* pEntry = m_xTreeView->First(); pEntry; pEntry = m_xTreeView->Next(pEntry))
4102 {
4103 if (SvTabListBox::GetEntryText(pEntry, 0) == rText)
4104 return SvTreeList::GetRelPos(pEntry);
4105 }
4106 return -1;
4107}
4108
4109int SalInstanceTreeView::find_id(const OUString& rId) const
4110{
4111 for (SvTreeListEntry* pEntry = m_xTreeView->First(); pEntry; pEntry = m_xTreeView->Next(pEntry))
4112 {
4113 const OUString* pId = static_cast<const OUString*>(pEntry->GetUserData());
4114 if (!pId)
4115 continue;
4116 if (rId == *pId)
4117 return SvTreeList::GetRelPos(pEntry);
4118 }
4119 return -1;
4120}
4121
4122void SalInstanceTreeView::swap(int pos1, int pos2)
4123{
4124 int min = std::min(pos1, pos2);
4125 int max = std::max(pos1, pos2);
4126 SvTreeList* pModel = m_xTreeView->GetModel();
4127 SvTreeListEntry* pEntry1 = pModel->GetEntry(nullptr, min);
4128 SvTreeListEntry* pEntry2 = pModel->GetEntry(nullptr, max);
4129 pModel->Move(pEntry1, pEntry2);
4130}
4131
4133{
4135 m_xTreeView->Clear();
4136 m_aUserData.clear();
4138}
4139
4141{
4142 return m_xTreeView->GetModel()->GetChildList(nullptr).size();
4143}
4144
4146{
4147 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4148 return m_xTreeView->GetModel()->GetChildList(rVclIter.iter).size();
4149}
4150
4152{
4153 assert(m_xTreeView->IsUpdateMode()
4154 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
4155 "freeze");
4157 if (pos == -1 || (pos == 0 && n_children() == 0))
4158 m_xTreeView->SelectAll(false);
4159 else
4160 {
4161 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4162 assert(pEntry && "bad pos?");
4163 m_xTreeView->Select(pEntry, true);
4164 m_xTreeView->MakeVisible(pEntry);
4165 }
4167}
4168
4170{
4172 if (!pEntry)
4173 return -1;
4174 return SvTreeList::GetRelPos(pEntry);
4175}
4176
4178{
4180 if (pos == -1)
4181 m_xTreeView->SetCurEntry(nullptr);
4182 else
4183 {
4184 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4185 m_xTreeView->SetCurEntry(pEntry);
4186 }
4188}
4189
4191{
4192 assert(m_xTreeView->IsUpdateMode()
4193 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
4194 "freeze");
4196 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4197 m_xTreeView->MakeVisible(pEntry);
4199}
4200
4202{
4203 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4204 return m_xTreeView->IsSelected(pEntry);
4205}
4206
4208{
4209 assert(m_xTreeView->IsUpdateMode()
4210 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
4211 "freeze");
4213 if (pos == -1)
4214 m_xTreeView->SelectAll(true);
4215 else
4216 {
4217 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4218 m_xTreeView->Select(pEntry, false);
4219 }
4221}
4222
4224{
4225 std::vector<int> aRows;
4226
4227 aRows.reserve(m_xTreeView->GetSelectionCount());
4228 for (SvTreeListEntry* pEntry = m_xTreeView->FirstSelected(); pEntry;
4229 pEntry = m_xTreeView->NextSelected(pEntry))
4230 aRows.push_back(SvTreeList::GetRelPos(pEntry));
4231
4232 return aRows;
4233}
4234
4235OUString SalInstanceTreeView::get_text(SvTreeListEntry* pEntry, int col) const
4236{
4237 if (col == -1)
4238 return SvTabListBox::GetEntryText(pEntry, 0);
4239
4241
4242 if (static_cast<size_t>(col) == pEntry->ItemCount())
4243 return OUString();
4244
4245 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4246 SvLBoxItem& rItem = pEntry->GetItem(col);
4247 assert(dynamic_cast<SvLBoxString*>(&rItem));
4248 return static_cast<SvLBoxString&>(rItem).GetText();
4249}
4250
4251OUString SalInstanceTreeView::get_text(int pos, int col) const
4252{
4253 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4254 return get_text(pEntry, col);
4255}
4256
4257void SalInstanceTreeView::set_text(SvTreeListEntry* pEntry, const OUString& rText, int col)
4258{
4259 if (col == -1)
4260 {
4261 m_xTreeView->SetEntryText(pEntry, rText);
4262 return;
4263 }
4264
4266
4267 // blank out missing entries
4268 for (int i = pEntry->ItemCount(); i < col; ++i)
4269 AddStringItem(pEntry, "", i - 1);
4270
4271 if (static_cast<size_t>(col) == pEntry->ItemCount())
4272 {
4273 AddStringItem(pEntry, rText, col - 1);
4274 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pEntry);
4275 m_xTreeView->InitViewData(pViewData, pEntry);
4276 }
4277 else
4278 {
4279 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4280 SvLBoxItem& rItem = pEntry->GetItem(col);
4281 assert(dynamic_cast<SvLBoxString*>(&rItem));
4282 static_cast<SvLBoxString&>(rItem).SetText(rText);
4283 }
4284
4285 InvalidateModelEntry(pEntry);
4286}
4287
4288void SalInstanceTreeView::set_text(int pos, const OUString& rText, int col)
4289{
4290 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4291 set_text(pEntry, rText, col);
4292}
4293
4294void SalInstanceTreeView::set_sensitive(SvTreeListEntry* pEntry, bool bSensitive, int col)
4295{
4296 if (col == -1)
4297 {
4298 auto nFlags = pEntry->GetFlags() & ~SvTLEntryFlags::SEMITRANSPARENT;
4299 if (!bSensitive)
4300 nFlags = nFlags | SvTLEntryFlags::SEMITRANSPARENT;
4301 pEntry->SetFlags(nFlags);
4302 const sal_uInt16 nCount = pEntry->ItemCount();
4303 for (sal_uInt16 nCur = 0; nCur < nCount; ++nCur)
4304 {
4305 SvLBoxItem& rItem = pEntry->GetItem(nCur);
4306 if (rItem.GetType() == SvLBoxItemType::String
4307 || rItem.GetType() == SvLBoxItemType::Button
4308 || rItem.GetType() == SvLBoxItemType::ContextBmp)
4309 {
4310 rItem.Enable(bSensitive);
4311 InvalidateModelEntry(pEntry);
4312 }
4313 }
4314 return;
4315 }
4316
4318
4319 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4320 SvLBoxItem& rItem = pEntry->GetItem(col);
4321 rItem.Enable(bSensitive);
4322
4323 InvalidateModelEntry(pEntry);
4324}
4325
4327{
4328 if (static_cast<size_t>(col) == pEntry->ItemCount())
4329 return false;
4330
4331 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4332 SvLBoxItem& rItem = pEntry->GetItem(col);
4333 return rItem.isEnable();
4334}
4335
4337{
4339 return do_get_sensitive(pEntry, col);
4340}
4341
4342void SalInstanceTreeView::set_sensitive(int pos, bool bSensitive, int col)
4343{
4344 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4345 set_sensitive(pEntry, bSensitive, col);
4346}
4347
4348bool SalInstanceTreeView::get_sensitive(int pos, int col) const
4349{
4350 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4351 return get_sensitive(pEntry, col);
4352}
4353
4354void SalInstanceTreeView::set_sensitive(const weld::TreeIter& rIter, bool bSensitive, int col)
4355{
4356 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4357 set_sensitive(rVclIter.iter, bSensitive, col);
4358}
4359
4361{
4362 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4363 return get_sensitive(rVclIter.iter, col);
4364}
4365
4367{
4368 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4369 return get_toggle(pEntry, col);
4370}
4371
4373{
4374 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4375 return get_toggle(rVclIter.iter, col);
4376}
4377
4379{
4380 assert(n_children() == 0 && "tree must be empty");
4382
4385 // EnableCheckButton clobbered this, restore it
4386 pData->SetLink(LINK(this, SalInstanceTreeView, ToggleHdl));
4387}
4388
4389void SalInstanceTreeView::set_toggle(int pos, TriState eState, int col)
4390{
4391 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4392 set_toggle(pEntry, eState, col);
4393}
4394
4396{
4397 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4398 set_toggle(rVclIter.iter, eState, col);
4399}
4400
4402{
4403 m_xTreeView->SetClicksToToggle(nToggleBehavior);
4404}
4405
4407{
4408 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4409 rVclIter.iter->SetExtraIndent(nIndentLevel);
4410}
4411
4413{
4415
4416 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4417 SvLBoxItem& rItem = pEntry->GetItem(col);
4418 assert(dynamic_cast<SvLBoxString*>(&rItem));
4419 static_cast<SvLBoxString&>(rItem).Emphasize(bOn);
4420
4421 InvalidateModelEntry(pEntry);
4422}
4423
4424void SalInstanceTreeView::set_text_emphasis(const weld::TreeIter& rIter, bool bOn, int col)
4425{
4426 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4427 set_text_emphasis(rVclIter.iter, bOn, col);
4428}
4429
4430void SalInstanceTreeView::set_text_emphasis(int pos, bool bOn, int col)
4431{
4432 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4433 set_text_emphasis(pEntry, bOn, col);
4434}
4435
4437{
4438 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4439 return get_text_emphasis(rVclIter.iter, col);
4440}
4441
4442bool SalInstanceTreeView::get_text_emphasis(int pos, int col) const
4443{
4444 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4445 return get_text_emphasis(pEntry, col);
4446}
4447
4448void SalInstanceTreeView::set_text_align(SvTreeListEntry* pEntry, double fAlign, int col)
4449{
4451
4452 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4453 SvLBoxItem& rItem = pEntry->GetItem(col);
4454 assert(dynamic_cast<SvLBoxString*>(&rItem));
4455 static_cast<SvLBoxString&>(rItem).Align(fAlign);
4456
4457 InvalidateModelEntry(pEntry);
4458}
4459
4460void SalInstanceTreeView::set_text_align(const weld::TreeIter& rIter, double fAlign, int col)
4461{
4462 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4463 set_text_align(rVclIter.iter, fAlign, col);
4464}
4465
4466void SalInstanceTreeView::set_text_align(int pos, double fAlign, int col)
4467{
4468 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4469 set_text_align(pEntry, fAlign, col);
4470}
4471
4473 const Link<const iter_string&, bool>& rEndLink)
4474{
4475 m_xTreeView->EnableInplaceEditing(rStartLink.IsSet() || rEndLink.IsSet());
4476 weld::TreeView::connect_editing(rStartLink, rEndLink);
4477}
4478
4480{
4481 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4482 m_xTreeView->EditEntry(rVclIter.iter);
4483}
4484
4486
4487void SalInstanceTreeView::set_image(SvTreeListEntry* pEntry, const Image& rImage, int col)
4488{
4489 if (col == -1)
4490 {
4491 m_xTreeView->SetExpandedEntryBmp(pEntry, rImage);
4492 m_xTreeView->SetCollapsedEntryBmp(pEntry, rImage);
4493 return;
4494 }
4495
4497
4498 // blank out missing entries
4499 for (int i = pEntry->ItemCount(); i < col; ++i)
4500 AddStringItem(pEntry, "", i - 1);
4501
4502 if (static_cast<size_t>(col) == pEntry->ItemCount())
4503 {
4504 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(rImage, rImage, false));
4505 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pEntry);
4506 m_xTreeView->InitViewData(pViewData, pEntry);
4507 }
4508 else
4509 {
4510 assert(col >= 0 && o3tl::make_unsigned(col) < pEntry->ItemCount());
4511 SvLBoxItem& rItem = pEntry->GetItem(col);
4512 assert(dynamic_cast<SvLBoxContextBmp*>(&rItem));
4513 static_cast<SvLBoxContextBmp&>(rItem).SetBitmap1(rImage);
4514 static_cast<SvLBoxContextBmp&>(rItem).SetBitmap2(rImage);
4515 }
4516
4518 InvalidateModelEntry(pEntry);
4519}
4520
4521void SalInstanceTreeView::set_image(int pos, const OUString& rImage, int col)
4522{
4523 set_image(m_xTreeView->GetEntry(nullptr, pos), createImage(rImage), col);
4524}
4525
4527 const css::uno::Reference<css::graphic::XGraphic>& rImage,
4528 int col)
4529{
4530 set_image(m_xTreeView->GetEntry(nullptr, pos), Image(rImage), col);
4531}
4532
4533void SalInstanceTreeView::set_image(int pos, VirtualDevice& rImage, int col)
4534{
4535 set_image(m_xTreeView->GetEntry(nullptr, pos), createImage(rImage), col);
4536}
4537
4538void SalInstanceTreeView::set_image(const weld::TreeIter& rIter, const OUString& rImage, int col)
4539{
4540 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4541 set_image(rVclIter.iter, createImage(rImage), col);
4542}
4543
4545 const css::uno::Reference<css::graphic::XGraphic>& rImage,
4546 int col)
4547{
4548 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4549 set_image(rVclIter.iter, Image(rImage), col);
4550}
4551
4553{
4554 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4555 set_image(rVclIter.iter, createImage(rImage), col);
4556}
4557
4558const OUString* SalInstanceTreeView::getEntryData(int index) const
4559{
4560 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, index);
4561 return pEntry ? static_cast<const OUString*>(pEntry->GetUserData()) : nullptr;
4562}
4563
4564OUString SalInstanceTreeView::get_id(int pos) const
4565{
4566 const OUString* pRet = getEntryData(pos);
4567 if (!pRet)
4568 return OUString();
4569 return *pRet;
4570}
4571
4572void SalInstanceTreeView::set_id(SvTreeListEntry* pEntry, const OUString& rId)
4573{
4574 m_aUserData.emplace_back(std::make_unique<OUString>(rId));
4575 pEntry->SetUserData(m_aUserData.back().get());
4576}
4577
4578void SalInstanceTreeView::set_id(int pos, const OUString& rId)
4579{
4580 SvTreeListEntry* pEntry = m_xTreeView->GetEntry(nullptr, pos);
4581 set_id(pEntry, rId);
4582}
4583
4585{
4586 assert(m_xTreeView->IsUpdateMode() && "don't request selection when frozen");
4588 if (!pEntry)
4589 return -1;
4590 return SvTreeList::GetRelPos(pEntry);
4591}
4592
4594{
4595 assert(m_xTreeView->IsUpdateMode() && "don't request selection when frozen");
4596 if (SvTreeListEntry* pEntry = m_xTreeView->FirstSelected())
4597 return SvTabListBox::GetEntryText(pEntry, 0);
4598 return OUString();
4599}
4600
4602{
4603 assert(m_xTreeView->IsUpdateMode() && "don't request selection when frozen");
4604 if (SvTreeListEntry* pEntry = m_xTreeView->FirstSelected())
4605 {
4606 if (const OUString* pStr = static_cast<const OUString*>(pEntry->GetUserData()))
4607 return *pStr;
4608 }
4609 return OUString();
4610}
4611
4612std::unique_ptr<weld::TreeIter>
4614{
4615 return std::unique_ptr<weld::TreeIter>(
4616 new SalInstanceTreeIter(static_cast<const SalInstanceTreeIter*>(pOrig)));
4617}
4618
4620{
4621 const SalInstanceTreeIter& rVclSource(static_cast<const SalInstanceTreeIter&>(rSource));
4622 SalInstanceTreeIter& rVclDest(static_cast<SalInstanceTreeIter&>(rDest));
4623 rVclDest.iter = rVclSource.iter;
4624}
4625
4627{
4629 auto pVclIter = static_cast<SalInstanceTreeIter*>(pIter);
4630 if (pVclIter)
4631 pVclIter->iter = pEntry;
4632 return pEntry != nullptr;
4633}
4634
4636{
4638 auto pVclIter = static_cast<SalInstanceTreeIter*>(pIter);
4639 if (pVclIter)
4640 pVclIter->iter = pEntry;
4641 return pEntry != nullptr;
4642}
4643
4645{
4646 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4648 m_xTreeView->SetCurEntry(rVclIter.iter);
4650}
4651
4653{
4654 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4655 rVclIter.iter = m_xTreeView->GetEntry(0);
4656 return rVclIter.iter != nullptr;
4657}
4658
4660{
4661 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4662 rVclIter.iter = m_xTreeView->GetEntryAtAbsPos(nAbsPos);
4663 return rVclIter.iter != nullptr;
4664}
4665
4667{
4668 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4669 rVclIter.iter = rVclIter.iter->NextSibling();
4670 return rVclIter.iter != nullptr;
4671}
4672
4674{
4675 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4676 rVclIter.iter = rVclIter.iter->PrevSibling();
4677 return rVclIter.iter != nullptr;
4678}
4679
4681{
4682 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4683 rVclIter.iter = m_xTreeView->Next(rVclIter.iter);
4684 if (rVclIter.iter && IsDummyEntry(rVclIter.iter))
4685 return iter_next(rVclIter);
4686 return rVclIter.iter != nullptr;
4687}
4688
4690{
4691 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4692 rVclIter.iter = m_xTreeView->Prev(rVclIter.iter);
4693 if (rVclIter.iter && IsDummyEntry(rVclIter.iter))
4694 return iter_previous(rVclIter);
4695 return rVclIter.iter != nullptr;
4696}
4697
4699{
4700 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4701 rVclIter.iter = m_xTreeView->FirstChild(rVclIter.iter);
4702 bool bRet = rVclIter.iter != nullptr;
4703 if (bRet)
4704 {
4705 //on-demand dummy entry doesn't count
4706 return !IsDummyEntry(rVclIter.iter);
4707 }
4708 return bRet;
4709}
4710
4712{
4713 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
4714 rVclIter.iter = m_xTreeView->GetParent(rVclIter.iter);
4715 return rVclIter.iter != nullptr;
4716}
4717
4719{
4721 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4722 m_xTreeView->RemoveEntry(rVclIter.iter);
4724}
4725
4727{
4728 assert(m_xTreeView->IsUpdateMode()
4729 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
4730 "freeze");
4732 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4733 m_xTreeView->Select(rVclIter.iter, true);
4735}
4736
4738{
4739 assert(m_xTreeView->IsUpdateMode()
4740 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
4741 "freeze");
4743 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4744 m_xTreeView->MakeVisible(rVclIter.iter);
4746}
4747
4749{
4750 assert(m_xTreeView->IsUpdateMode() && "don't unselect when frozen");
4752 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4753 m_xTreeView->Select(rVclIter.iter, false);
4755}
4756
4758{
4759 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4760 return m_xTreeView->GetModel()->GetDepth(rVclIter.iter);
4761}
4762
4764{
4765 SalInstanceTreeIter aTempCopy(static_cast<const SalInstanceTreeIter*>(&rIter));
4766 return iter_children(aTempCopy);
4767}
4768
4770{
4771 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4772 return m_xTreeView->IsExpanded(rVclIter.iter);
4773}
4774
4776{
4777 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4779 return true;
4780 return GetPlaceHolderChild(rVclIter.iter) != nullptr;
4781}
4782
4784 bool bChildrenOnDemand)
4785{
4787
4788 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4789
4790 SvTreeListEntry* pPlaceHolder = GetPlaceHolderChild(rVclIter.iter);
4791
4792 if (bChildrenOnDemand && !pPlaceHolder)
4793 {
4794 pPlaceHolder = m_xTreeView->InsertEntry("<dummy>", rVclIter.iter, false, 0, nullptr);
4795 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pPlaceHolder);
4796 pViewData->SetSelectable(false);
4797 }
4798 else if (!bChildrenOnDemand && pPlaceHolder)
4799 m_xTreeView->RemoveEntry(pPlaceHolder);
4800
4802}
4803
4805{
4806 assert(m_xTreeView->IsUpdateMode() && "don't expand when frozen");
4807 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4808 if (!m_xTreeView->IsExpanded(rVclIter.iter) && ExpandRow(rVclIter))
4809 m_xTreeView->Expand(rVclIter.iter);
4810}
4811
4813{
4814 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4815 if (m_xTreeView->IsExpanded(rVclIter.iter) && signal_collapsing(rIter))
4816 m_xTreeView->Collapse(rVclIter.iter);
4817}
4818
4819OUString SalInstanceTreeView::get_text(const weld::TreeIter& rIter, int col) const
4820{
4821 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4822 return get_text(rVclIter.iter, col);
4823}
4824
4825void SalInstanceTreeView::set_text(const weld::TreeIter& rIter, const OUString& rText, int col)
4826{
4827 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4828 set_text(rVclIter.iter, rText, col);
4829}
4830
4832{
4833 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4834 const OUString* pStr = static_cast<const OUString*>(rVclIter.iter->GetUserData());
4835 if (pStr)
4836 return *pStr;
4837 return OUString();
4838}
4839
4840void SalInstanceTreeView::set_id(const weld::TreeIter& rIter, const OUString& rId)
4841{
4842 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4843 set_id(rVclIter.iter, rId);
4844}
4845
4847 sal_uInt8 eDNDConstants)
4848{
4849 m_xTreeView->SetDragHelper(rHelper, eDNDConstants);
4850}
4851
4853{
4855}
4856
4857void SalInstanceTreeView::all_foreach(const std::function<bool(weld::TreeIter&)>& func)
4858{
4859 UpdateGuardIfHidden aGuard(*m_xTreeView);
4860
4862 while (aVclIter.iter)
4863 {
4864 if (func(aVclIter))
4865 return;
4866 iter_next(aVclIter);
4867 }
4868}
4869
4870void SalInstanceTreeView::selected_foreach(const std::function<bool(weld::TreeIter&)>& func)
4871{
4872 UpdateGuardIfHidden aGuard(*m_xTreeView);
4873
4875 while (aVclIter.iter)
4876 {
4877 if (func(aVclIter))
4878 return;
4879 aVclIter.iter = m_xTreeView->NextSelected(aVclIter.iter);
4880 }
4881}
4882
4883void SalInstanceTreeView::visible_foreach(const std::function<bool(weld::TreeIter&)>& func)
4884{
4885 UpdateGuardIfHidden aGuard(*m_xTreeView);
4886
4888 while (aVclIter.iter)
4889 {
4890 if (func(aVclIter))
4891 return;
4892 aVclIter.iter = m_xTreeView->GetNextEntryInView(aVclIter.iter);
4893 }
4894}
4895
4897{
4899 m_xTreeView->SetScrolledHdl(LINK(this, SalInstanceTreeView, VisibleRangeChangedHdl));
4900}
4901
4903{
4906 while (pSelected)
4907 {
4908 SvTreeListEntry* pNextSelected = m_xTreeView->NextSelected(pSelected);
4909 m_xTreeView->RemoveEntry(pSelected);
4910 pSelected = pNextSelected;
4911 }
4913}
4914
4916{
4917 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4918 return m_xTreeView->IsSelected(rVclIter.iter);
4919}
4920
4922{
4923 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
4924 return SvTreeList::GetRelPos(rVclIter.iter);
4925}
4926
4928{
4929 const SalInstanceTreeIter& rVclIterA = static_cast<const SalInstanceTreeIter&>(a);
4930 const SalInstanceTreeIter& rVclIterB = static_cast<const SalInstanceTreeIter&>(b);
4931 const SvTreeList* pModel = m_xTreeView->GetModel();
4932 auto nAbsPosA = pModel->GetAbsPos(rVclIterA.iter);
4933 auto nAbsPosB = pModel->GetAbsPos(rVclIterB.iter);
4934 if (nAbsPosA < nAbsPosB)
4935 return -1;
4936 if (nAbsPosA > nAbsPosB)
4937 return 1;
4938 return 0;
4939}
4940
4942 int nIndexInNewParent)
4943{
4944 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rNode);
4945 const SalInstanceTreeIter* pVclParentIter = static_cast<const SalInstanceTreeIter*>(pNewParent);
4946 m_xTreeView->GetModel()->Move(rVclIter.iter, pVclParentIter ? pVclParentIter->iter : nullptr,
4947 nIndexInNewParent);
4948}
4949
4951
4953{
4954 int nHeight = m_xTreeView->GetEntryHeight() * nRows;
4955
4956 sal_Int32 nLeftBorder(0), nTopBorder(0), nRightBorder(0), nBottomBorder(0);
4957 m_xTreeView->GetBorder(nLeftBorder, nTopBorder, nRightBorder, nBottomBorder);
4958 nHeight += nTopBorder + nBottomBorder;
4959
4960 return nHeight;
4961}
4962
4964{
4965 assert(m_xTreeView->IsUpdateMode() && "don't sort when frozen");
4968 set_sort_order(true);
4969}
4970
4972 const std::function<int(const weld::TreeIter&, const weld::TreeIter&)>& func)
4973{
4975 SvTreeList* pListModel = m_xTreeView->GetModel();
4976 pListModel->Resort();
4977}
4978
4980{
4982}
4983
4985{
4986 SvTreeList* pListModel = m_xTreeView->GetModel();
4987 pListModel->SetSortMode(bAscending ? SvSortMode::Ascending : SvSortMode::Descending);
4988 pListModel->Resort();
4989}
4990
4992{
4994}
4995
4997{
4998 assert(col >= 0 && "cannot sort on expander column");
4999
5000 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
5001 HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr;
5002 if (!pHeaderBar)
5003 return;
5004
5005 sal_uInt16 nTextId = pHeaderBar->GetItemId(col);
5006 HeaderBarItemBits nBits = pHeaderBar->GetItemBits(nTextId);
5009 if (eState != TRISTATE_INDET)
5010 {
5011 if (eState == TRISTATE_TRUE)
5013 else
5015 }
5016 pHeaderBar->SetItemBits(nTextId, nBits);
5017}
5018
5020{
5021 assert(col >= 0 && "cannot sort on expander column");
5022
5023 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
5024 if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
5025 {
5026 sal_uInt16 nTextId = pHeaderBar->GetItemId(col);
5027 HeaderBarItemBits nBits = pHeaderBar->GetItemBits(nTextId);
5028 if (nBits & HeaderBarItemBits::DOWNARROW)
5029 return TRISTATE_TRUE;
5030 if (nBits & HeaderBarItemBits::UPARROW)
5031 return TRISTATE_FALSE;
5032 }
5033
5034 return TRISTATE_INDET;
5035}
5036
5038
5040{
5041 if (nColumn == -1)
5042 {
5043 make_unsorted();
5044 m_nSortColumn = -1;
5045 return;
5046 }
5047
5048 if (nColumn != m_nSortColumn)
5049 {
5050 m_nSortColumn = nColumn;
5052 }
5053}
5054
5056
5058 bool bDnDMode, bool bAutoScroll)
5059{
5060 LclTabListBox* pTreeView
5061 = !bDnDMode ? dynamic_cast<LclTabListBox*>(m_xTreeView.get()) : nullptr;
5062 SvTreeListEntry* pTarget = pTreeView ? pTreeView->GetTargetAtPoint(rPos, false, bAutoScroll)
5063 : m_xTreeView->GetDropTarget(rPos);
5064
5065 if (pTarget && pResult)
5066 {
5067 SalInstanceTreeIter& rSalIter = static_cast<SalInstanceTreeIter&>(*pResult);
5068 rSalIter.iter = pTarget;
5069 }
5070
5071 return pTarget != nullptr;
5072}
5073
5075
5077{
5078 return m_xTreeView->GetBoundingRect(static_cast<const SalInstanceTreeIter&>(rIter).iter);
5079}
5080
5082
5084{
5085 int nValue = -1;
5087 if (pEntry)
5088 nValue = m_xTreeView->GetAbsPos(pEntry);
5089 return nValue;
5090}
5091
5093{
5094 if (nValue == -1)
5095 return;
5096 bool bUpdate = m_xTreeView->IsUpdateMode();
5097 if (bUpdate)
5098 m_xTreeView->SetUpdateMode(false);
5100 if (bUpdate)
5102}
5103
5105{
5106 m_xTreeView->set_property("show-expanders", OUString::boolean(bShow));
5107}
5108
5110
5112{
5113 LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
5114 if (pHeaderBox)
5115 {
5116 if (HeaderBar* pHeaderBar = pHeaderBox->GetHeaderBar())
5117 {
5118 pHeaderBar->SetSelectHdl(Link<HeaderBar*, void>());
5119 pHeaderBar->SetEndDragHdl(Link<HeaderBar*, void>());
5120 }
5121 }
5122 else
5123 {
5124 static_cast<LclTabListBox&>(*m_xTreeView).SetEndDragHdl(Link<SvTreeListBox*, void>());
5125 static_cast<LclTabListBox&>(*m_xTreeView).SetStartDragHdl(Link<SvTreeListBox*, bool>());
5126 static_cast<LclTabListBox&>(*m_xTreeView).SetModelChangedHdl(Link<SvTreeListBox*, void>());
5127 }
5137}
5138
5139IMPL_LINK(SalInstanceTreeView, TooltipHdl, SvTreeListEntry*, pEntry, OUString)
5140{
5141 if (pEntry && !notify_events_disabled())
5142 return signal_query_tooltip(SalInstanceTreeIter(pEntry));
5143
5144 return {};
5145}
5146
5147IMPL_LINK(SalInstanceTreeView, CustomRenderHdl, svtree_render_args, payload, void)
5148{
5149 vcl::RenderContext& rRenderDevice = std::get<0>(payload);
5150 const tools::Rectangle& rRect = std::get<1>(payload);
5151 const SvTreeListEntry& rEntry = std::get<2>(payload);
5152 const OUString* pId = static_cast<const OUString*>(rEntry.GetUserData());
5153 if (!pId)
5154 return;
5155 signal_custom_render(rRenderDevice, rRect, m_xTreeView->IsSelected(&rEntry), *pId);
5156}
5157
5159{
5160 vcl::RenderContext& rRenderDevice = payload.first;
5161 const SvTreeListEntry& rEntry = payload.second;
5162 const OUString* pId = static_cast<const OUString*>(rEntry.GetUserData());
5163 if (!pId)
5164 return Size();
5165 return signal_custom_get_size(rRenderDevice, *pId);
5166}
5167
5168IMPL_LINK(SalInstanceTreeView, CompareHdl, const SvSortData&, rSortData, sal_Int32)
5169{
5170 const SvTreeListEntry* pLHS = rSortData.pLeft;
5171 const SvTreeListEntry* pRHS = rSortData.pRight;
5172 assert(pLHS && pRHS);
5173
5174 if (m_aCustomSort)
5175 return m_aCustomSort(SalInstanceTreeIter(const_cast<SvTreeListEntry*>(pLHS)),
5176 SalInstanceTreeIter(const_cast<SvTreeListEntry*>(pRHS)));
5177
5178 const SvLBoxString* pLeftTextItem;
5179 const SvLBoxString* pRightTextItem;
5180
5181 if (m_nSortColumn != -1)
5182 {
5183 size_t col = to_internal_model(m_nSortColumn);
5184
5185 if (col < pLHS->ItemCount())
5186 {
5187 const SvLBoxString& rLeftTextItem
5188 = static_cast<const SvLBoxString&>(pLHS->GetItem(col));
5189 pLeftTextItem = &rLeftTextItem;
5190 }
5191 else
5192 pLeftTextItem = nullptr;
5193 if (col < pRHS->ItemCount())
5194 {
5195 const SvLBoxString& rRightTextItem
5196 = static_cast<const SvLBoxString&>(pRHS->GetItem(col));
5197 pRightTextItem = &rRightTextItem;
5198 }
5199 else
5200 pRightTextItem = nullptr;
5201 }
5202 else
5203 {
5204 pLeftTextItem
5205 = static_cast<const SvLBoxString*>(pLHS->GetFirstItem(SvLBoxItemType::String));
5206 pRightTextItem
5207 = static_cast<const SvLBoxString*>(pRHS->GetFirstItem(SvLBoxItemType::String));
5208 }
5209
5210 return m_xTreeView->DefaultCompare(pLeftTextItem, pRightTextItem);
5211}
5212
5213IMPL_LINK_NOARG(SalInstanceTreeView, VisibleRangeChangedHdl, SvTreeListBox*, void)
5214{
5215 if (notify_events_disabled())
5216 return;
5217 signal_visible_range_changed();
5218}
5219
5221{
5222 if (notify_events_disabled())
5223 return;
5224 signal_model_changed();
5225}
5226
5228{
5229 bool bUnsetDragIcon(false); // ignored for vcl
5230 if (m_aDragBeginHdl.Call(bUnsetDragIcon))
5231 return true;
5232 g_DragSource = this;
5233 return false;
5234}
5235
5237{
5238 g_DragSource = nullptr;
5239}
5240
5242{
5243 SvTreeListEntry* pEntry = pData->GetActEntry();
5244 SvLBoxButton* pBox = pData->GetActBox();
5245
5246 // tdf#122874 Select the row, calling SelectHdl, before handling
5247 // the toggle
5248 if (!m_xTreeView->IsSelected(pEntry))
5249 {
5250 m_xTreeView->SelectAll(false);
5251 m_xTreeView->Select(pEntry, true);
5252 }
5253
5254 // additionally set the cursor into the row the toggled element is in
5255 m_xTreeView->pImpl->m_pCursor = pEntry;
5256
5257 for (int i = 0, nCount = pEntry->ItemCount(); i < nCount; ++i)
5258 {
5259 SvLBoxItem& rItem = pEntry->GetItem(i);
5260 if (&rItem == pBox)
5261 {
5262 int nCol = to_external_model(i);
5263 signal_toggled(iter_col(SalInstanceTreeIter(pEntry), nCol));
5264 break;
5265 }
5266 }
5267}
5268
5270{
5271 if (notify_events_disabled())
5272 return;
5273 signal_changed();
5274}
5275
5277{
5278 if (notify_events_disabled())
5279 return;
5280 if (m_xTreeView->GetSelectionMode() == SelectionMode::Single
5281 && !m_xTreeView->GetHoverSelection())
5282 return;
5283 signal_changed();
5284}
5285
5287{
5288 if (notify_events_disabled())
5289 return false;
5290 return !signal_row_activated();
5291}
5292
5293IMPL_LINK(SalInstanceTreeView, EndDragHdl, HeaderBar*, pHeaderBar, void)
5294{
5295 std::vector<tools::Long> aTabPositions{ 0 };
5296 for (int i = 0; i < pHeaderBar->GetItemCount() - 1; ++i)
5297 aTabPositions.push_back(aTabPositions[i]
5298 + pHeaderBar->GetItemSize(pHeaderBar->GetItemId(i)));
5299 m_xTreeView->SetTabs(aTabPositions.size(), aTabPositions.data(), MapUnit::MapPixel);
5300}
5301
5302IMPL_LINK(SalInstanceTreeView, HeaderBarClickedHdl, HeaderBar*, pHeaderBar, void)
5303{
5304 sal_uInt16 nId = pHeaderBar->GetCurItemId();
5305 if (!(pHeaderBar->GetItemBits(nId) & HeaderBarItemBits::CLICKABLE))
5306 return;
5307 signal_column_clicked(pHeaderBar->GetItemPos(nId));
5308}
5309
5311{
5312 SvTreeListEntry* pEntry = m_xTreeView->GetHdlEntry();
5313 SalInstanceTreeIter aIter(pEntry);
5314
5315 if (m_xTreeView->IsExpanded(pEntry))
5316 {
5317 //collapsing;
5318 return signal_collapsing(aIter);
5319 }
5320
5321 // expanding
5322 return ExpandRow(aIter);
5323}
5324
5326{
5327 SvTreeListEntry* pEntry = rIter.iter;
5328 // if there's a preexisting placeholder child, required to make this
5329 // potentially expandable in the first place, now we remove it
5330 SvTreeListEntry* pPlaceHolder = GetPlaceHolderChild(pEntry);
5331 if (pPlaceHolder)
5332 {
5334 m_xTreeView->RemoveEntry(pPlaceHolder);
5335 }
5336
5337 bool bRet = signal_expanding(rIter);
5338
5339 if (pPlaceHolder)
5340 {
5341 //expand disallowed, restore placeholder
5342 if (!bRet)
5343 {
5344 pPlaceHolder = m_xTreeView->InsertEntry("<dummy>", pEntry, false, 0, nullptr);
5345 SvViewDataEntry* pViewData = m_xTreeView->GetViewDataEntry(pPlaceHolder);
5346 pViewData->SetSelectable(false);
5347 }
5349 }
5350
5351 return bRet;
5352}
5353
5354IMPL_LINK(SalInstanceTreeView, PopupMenuHdl, const CommandEvent&, rEvent, bool)
5355{
5356 return m_aPopupMenuHdl.Call(rEvent);
5357}
5358
5359IMPL_LINK(SalInstanceTreeView, EditingEntryHdl, SvTreeListEntry*, pEntry, bool)
5360{
5361 return signal_editing_started(SalInstanceTreeIter(pEntry));
5362}
5363
5364IMPL_LINK(SalInstanceTreeView, EditedEntryHdl, IterString, rIterString, bool)
5365{
5366 return signal_editing_done(
5367 iter_string(SalInstanceTreeIter(rIterString.first), rIterString.second));
5368}
5369
5371 bool bTakeOwnership)
5372 : SalInstanceWidget(pIconView, pBuilder, bTakeOwnership)
5373 , m_xIconView(pIconView)
5374{
5375 m_xIconView->SetSelectHdl(LINK(this, SalInstanceIconView, SelectHdl));
5376 m_xIconView->SetDeselectHdl(LINK(this, SalInstanceIconView, DeSelectHdl));
5377 m_xIconView->SetDoubleClickHdl(LINK(this, SalInstanceIconView, DoubleClickHdl));
5378 m_xIconView->SetPopupMenuHdl(LINK(this, SalInstanceIconView, CommandHdl));
5379
5380 m_xIconView->SetEntryAccessibleDescriptionHdl(
5381 LINK(this, SalInstanceIconView, EntryAccessibleDescriptionHdl));
5382 m_xIconView->SetAccessible(m_xIconView->CreateAccessible());
5383}
5384
5385int SalInstanceIconView::get_item_width() const { return m_xIconView->GetEntryWidth(); }
5387{
5388 m_xIconView->SetEntryWidth(width);
5389 m_xIconView->Resize();
5390}
5391
5393{
5394 bool bIsFirstFreeze = IsFirstFreeze();
5396 if (bIsFirstFreeze)
5397 m_xIconView->SetUpdateMode(false);
5398}
5399
5401{
5402 bool bIsLastThaw = IsLastThaw();
5403 if (bIsLastThaw)
5404 m_xIconView->SetUpdateMode(true);
5406}
5407
5408void SalInstanceIconView::insert(int pos, const OUString* pStr, const OUString* pId,
5409 const OUString* pIconName, weld::TreeIter* pRet)
5410{
5412 auto nInsertPos = pos == -1 ? TREELIST_APPEND : pos;
5413 void* pUserData;
5414 if (pId)
5415 {
5416 m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
5417 pUserData = m_aUserData.back().get();
5418 }
5419 else
5420 pUserData = nullptr;
5421
5422 SvTreeListEntry* pEntry = new SvTreeListEntry;
5423 if (pIconName)
5424 {
5425 Image aImage(createImage(*pIconName));
5426 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aImage, aImage, false));
5427 }
5428 else
5429 {
5430 Image aDummy;
5431 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aDummy, aDummy, false));
5432 }
5433 if (pStr)
5434 pEntry->AddItem(std::make_unique<SvLBoxString>(*pStr));
5435 pEntry->SetUserData(pUserData);
5436 m_xIconView->Insert(pEntry, nullptr, nInsertPos);
5437
5438 if (pRet)
5439 {
5440 SalInstanceTreeIter* pVclRetIter = static_cast<SalInstanceTreeIter*>(pRet);
5441 pVclRetIter->iter = pEntry;
5442 }
5443
5445}
5446
5447void SalInstanceIconView::insert(int pos, const OUString* pStr, const OUString* pId,
5448 const VirtualDevice* pIcon, weld::TreeIter* pRet)
5449{
5451 auto nInsertPos = pos == -1 ? TREELIST_APPEND : pos;
5452 void* pUserData;
5453 if (pId)
5454 {
5455 m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
5456 pUserData = m_aUserData.back().get();
5457 }
5458 else
5459 pUserData = nullptr;
5460
5461 SvTreeListEntry* pEntry = new SvTreeListEntry;
5462 if (pIcon)
5463 {
5464 const Point aNull(0, 0);
5465 const Size aSize = pIcon->GetOutputSize();
5466 Image aImage(pIcon->GetBitmapEx(aNull, aSize));
5467 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aImage, aImage, false));
5468 }
5469 else
5470 {
5471 Image aDummy;
5472 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aDummy, aDummy, false));
5473 }
5474 if (pStr)
5475 pEntry->AddItem(std::make_unique<SvLBoxString>(*pStr));
5476 pEntry->SetUserData(pUserData);
5477 m_xIconView->Insert(pEntry, nullptr, nInsertPos);
5478
5479 if (pRet)
5480 {
5481 SalInstanceTreeIter* pVclRetIter = static_cast<SalInstanceTreeIter*>(pRet);
5482 pVclRetIter->iter = pEntry;
5483 }
5484
5486}
5487
5488void SalInstanceIconView::insert_separator(int pos, const OUString* /* pId */)
5489{
5490 const auto nInsertPos = pos == -1 ? TREELIST_APPEND : pos;
5491 const OUString sSep(VclResId(STR_SEPARATOR));
5492 SvTreeListEntry* pEntry = new SvTreeListEntry;
5493 pEntry->SetFlags(pEntry->GetFlags() | SvTLEntryFlags::IS_SEPARATOR);
5494 const Image aDummy;
5495 pEntry->AddItem(std::make_unique<SvLBoxContextBmp>(aDummy, aDummy, false));
5496 pEntry->AddItem(std::make_unique<SvLBoxString>(sSep));
5497 pEntry->SetUserData(nullptr);
5498 m_xIconView->Insert(pEntry, nullptr, nInsertPos);
5499 SvViewDataEntry* pViewData = m_xIconView->GetViewDataEntry(pEntry);
5500 pViewData->SetSelectable(false);
5501}
5502
5503IMPL_LINK(SalInstanceIconView, TooltipHdl, SvTreeListEntry*, pEntry, OUString)
5504{
5505 if (pEntry && !notify_events_disabled())
5506 return signal_query_tooltip(SalInstanceTreeIter(pEntry));
5507
5508 return {};
5509}
5510
5511IMPL_LINK(SalInstanceIconView, EntryAccessibleDescriptionHdl, SvTreeListEntry*, pEntry, OUString)
5512{
5514 if (s.isEmpty())
5515 s = signal_query_tooltip(SalInstanceTreeIter(pEntry));
5516 return s;
5517}
5518
5520{
5522 m_xIconView->SetTooltipHdl(LINK(this, SalInstanceIconView, TooltipHdl));
5523}
5524
5526 rQuery, bool)
5527{
5528 SvTreeListEntry* pEntry = std::get<1>(rQuery);
5529 return m_aGetPropertyTreeElemHdl.Call(weld::json_prop_query(
5530 std::get<0>(rQuery), SalInstanceTreeIter(pEntry), std::get<2>(rQuery)));
5531}
5532
5535{
5537 m_xIconView->SetDumpElemToPropertyTreeHdl(
5538 LINK(this, SalInstanceIconView, DumpElemToPropertyTreeHdl));
5539}
5540
5542{
5543 assert(m_xIconView->IsUpdateMode() && "don't request selection when frozen");
5544 if (SvTreeListEntry* pEntry = m_xIconView->FirstSelected())
5545 {
5546 if (const OUString* pStr = static_cast<const OUString*>(pEntry->GetUserData()))
5547 return *pStr;
5548 }
5549 return OUString();
5550}
5551
5553{
5554 assert(m_xIconView->IsUpdateMode() && "don't request selection when frozen");
5555 if (SvTreeListEntry* pEntry = m_xIconView->FirstSelected())
5556 return m_xIconView->GetEntryText(pEntry);
5557 return OUString();
5558}
5559
5560int SalInstanceIconView::count_selected_items() const { return m_xIconView->GetSelectionCount(); }
5561
5563{
5564 assert(m_xIconView->IsUpdateMode()
5565 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
5566 "freeze");
5568 if (pos == -1 || (pos == 0 && n_children() == 0))
5569 m_xIconView->SelectAll(false);
5570 else
5571 {
5572 SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, pos);
5573 m_xIconView->Select(pEntry, true);
5574 m_xIconView->MakeVisible(pEntry);
5575 }
5577}
5578
5580{
5581 assert(m_xIconView->IsUpdateMode()
5582 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
5583 "freeze");
5585 if (pos == -1)
5586 m_xIconView->SelectAll(true);
5587 else
5588 {
5589 SvTreeListEntry* pEntry = m_xIconView->GetEntry(nullptr, pos);
5590 m_xIconView->Select(pEntry, false);
5591 }
5593}
5594
5596{
5597 return m_xIconView->GetModel()->GetChildList(nullptr).size();
5598}
5599
5600std::unique_ptr<weld::TreeIter>
5602{
5603 return std::unique_ptr<weld::TreeIter>(
5604 new SalInstanceTreeIter(static_cast<const SalInstanceTreeIter*>(pOrig)));
5605}
5606
5608{
5609 SvTreeListEntry* pEntry = m_xIconView->FirstSelected();
5610 auto pVclIter = static_cast<SalInstanceTreeIter*>(pIter);
5611 if (pVclIter)
5612 pVclIter->iter = pEntry;
5613 return pEntry != nullptr;
5614}
5615
5617{
5618 SvTreeListEntry* pEntry = m_xIconView->GetCurEntry();
5619 auto pVclIter = static_cast<SalInstanceTreeIter*>(pIter);
5620 if (pVclIter)
5621 pVclIter->iter = pEntry;
5622 return pEntry != nullptr;
5623}
5624
5626{
5627 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
5629 m_xIconView->SetCurEntry(rVclIter.iter);
5631}
5632
5634{
5635 SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter);
5636 rVclIter.iter = m_xIconView->GetEntry(0);
5637 return rVclIter.iter != nullptr;
5638}
5639
5641{
5642 assert(m_xIconView->IsUpdateMode()
5643 && "don't select when frozen, select after thaw. Note selection doesn't survive a "
5644 "freeze");
5646 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
5647 m_xIconView->MakeVisible(rVclIter.iter);
5649}
5650
5651void SalInstanceIconView::selected_foreach(const std::function<bool(weld::TreeIter&)>& func)
5652{
5653 SalInstanceTreeIter aVclIter(m_xIconView->FirstSelected());
5654 while (aVclIter.iter)
5655 {
5656 if (func(aVclIter))
5657 return;
5658 aVclIter.iter = m_xIconView->NextSelected(aVclIter.iter);
5659 }
5660}
5661
5663{
5664 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
5665 const OUString* pStr = static_cast<const OUString*>(rVclIter.iter->GetUserData());
5666 if (pStr)
5667 return *pStr;
5668 return OUString();
5669}
5670
5672{
5673 const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
5674 return SvTabListBox::GetEntryText(rVclIter.iter, 0);
5675}
5676
5678{
5680 m_xIconView->Clear();
5681 m_aUserData.clear();
5683}
5684
5686{
5687 m_xIconView->SetDoubleClickHdl(Link<SvTreeListBox*, bool>());
5688 m_xIconView->SetSelectHdl(Link<SvTreeListBox*, void>());
5689 m_xIconView->SetDeselectHdl(Link<SvTreeListBox*, void>());
5690}
5691
5693{
5694 if (notify_events_disabled())
5695 return;
5696 signal_selection_changed();
5697}
5698
5700{
5701 if (notify_events_disabled())
5702 return;
5703 if (m_xIconView->GetSelectionMode() == SelectionMode::Single)
5704 return;
5705 signal_selection_changed();
5706}
5707
5709{
5710 if (notify_events_disabled())
5711 return false;
5712 return !signal_item_activated();
5713}
5714
5715IMPL_LINK(SalInstanceIconView, CommandHdl, const CommandEvent&, rEvent, bool)
5716{
5717 return m_aCommandHdl.Call(rEvent);
5718}
5719
5720double SalInstanceSpinButton::toField(sal_Int64 nValue) const
5721{
5722 return static_cast<double>(nValue) / Power10(get_digits());
5723}
5724
5725sal_Int64 SalInstanceSpinButton::fromField(double fValue) const
5726{
5727 auto const x = fValue * Power10(get_digits());
5728 return x == double(std::numeric_limits<sal_Int64>::max())
5729 ? std::numeric_limits<sal_Int64>::max()
5730 : sal_Int64(std::round(x));
5731}
5732
5734 bool bTakeOwnership)
5735 : SalInstanceEntry(pButton, pBuilder, bTakeOwnership)
5736 , m_xButton(pButton)
5737 , m_rFormatter(m_xButton->GetFormatter())
5738{
5739 m_rFormatter.SetThousandsSep(false); //off by default, MetricSpinButton enables it
5740 m_xButton->SetUpHdl(LINK(this, SalInstanceSpinButton, UpDownHdl));
5741 m_xButton->SetDownHdl(LINK(this, SalInstanceSpinButton, UpDownHdl));
5742 m_xButton->SetLoseFocusHdl(LINK(this, SalInstanceSpinButton, LoseFocusHdl));
5745 if (Edit* pEdit = m_xButton->GetSubEdit())
5746 pEdit->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl));
5747 else
5748 m_xButton->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl));
5749}
5750
5752
5754
5755void SalInstanceSpinButton::set_range(sal_Int64 min, sal_Int64 max)
5756{
5759}
5760
5761void SalInstanceSpinButton::get_range(sal_Int64& min, sal_Int64& max) const
5762{
5765}
5766
5767void SalInstanceSpinButton::set_increments(int step, int /*page*/)
5768{
5770}
5771
5772void SalInstanceSpinButton::get_increments(int& step, int& page) const
5773{
5776}
5777
5778void SalInstanceSpinButton::set_digits(unsigned int digits)
5779{
5781}
5782
5783// SpinButton may be comprised of multiple subwidgets, consider the lot as
5784// one thing for focus
5786
5787//off by default for direct SpinButtons, MetricSpinButton enables it
5789
5791
5793{
5794 if (Edit* pEdit = m_xButton->GetSubEdit())
5795 pEdit->SetActivateHdl(Link<Edit&, bool>());
5796 else
5803}
5804
5806{
5807 // tdf#122348 return pressed to end dialog
5808 signal_value_changed();
5809 return m_aActivateHdl.Call(*this);
5810}
5811
5812IMPL_LINK_NOARG(SalInstanceSpinButton, UpDownHdl, SpinField&, void) { signal_value_changed(); }
5813
5814IMPL_LINK_NOARG(SalInstanceSpinButton, LoseFocusHdl, Control&, void) { signal_value_changed(); }
5815
5816IMPL_LINK_NOARG(SalInstanceSpinButton, OutputHdl, LinkParamNone*, bool) { return signal_output(); }
5817
5818IMPL_LINK(SalInstanceSpinButton, InputHdl, sal_Int64*, pResult, TriState)
5819{
5820 int nResult;
5821 TriState eRet = signal_input(&nResult);
5822 if (eRet == TRISTATE_TRUE)
5823 *pResult = nResult;
5824 return eRet;
5825}
5826
5828 SalInstanceBuilder* pBuilder,
5829 bool bTakeOwnership)
5830 : SalInstanceEntry(pButton, pBuilder, bTakeOwnership)
5831 , m_xButton(pButton)
5832 , m_pFormatter(nullptr)
5833{
5837}
5838
5840{
5842 m_xButton->SpinField::SetText(rText);
5844}
5845
5847{
5848 if (!m_pFormatter) // once a formatter is set, it takes over "changed"
5849 {
5851 return;
5852 }
5854}
5855
5857{
5858 if (!m_pFormatter) // once a formatter is set, it takes over "focus-out"
5859 {
5860 m_aLoseFocusHdl = rLink;
5861 return;
5862 }
5864}
5865
5867{
5868 m_pFormatter = pFormatter;
5869 m_xButton->SetFormatter(pFormatter);
5870}
5871
5873
5875{
5879}
5880
5882{
5883 signal_value_changed();
5884}
5885
5887{
5888 if (!m_pFormatter)
5889 signal_value_changed();
5890 m_aLoseFocusHdl.Call(*this);
5891}
5892
5894 bool bTakeOwnership)
5895 : SalInstanceWidget(pLabel, pBuilder, bTakeOwnership)
5896 , m_xLabel(pLabel)
5897{
5898}
5899
5900void SalInstanceLabel::set_label(const OUString& rText) { m_xLabel->SetText(rText); }
5901
5902OUString SalInstanceLabel::get_label() const { return m_xLabel->GetText(); }
5903
5905{
5906 FixedText* pLabel = dynamic_cast<FixedText*>(m_xLabel.get());
5907 assert(pLabel && "can't use set_mnemonic_widget on SelectableFixedText");
5908 SalInstanceWidget* pTargetWidget = dynamic_cast<SalInstanceWidget*>(pTarget);
5909 pLabel->set_mnemonic_widget(pTargetWidget ? pTargetWidget->getWidget() : nullptr);
5910}
5911
5913{
5914 switch (eType)
5915 {
5919 break;
5924 break;
5929 break;
5934 break;
5935 }
5936}
5937
5939{
5940 if (rColor != COL_AUTO)
5942 else
5944}
5945
5947{
5948 m_xLabel->SetControlFont(rFont);
5950}
5951
5952std::unique_ptr<weld::Label> SalInstanceFrame::weld_label_widget() const
5953{
5954 FixedText* pLabel = dynamic_cast<FixedText*>(m_xFrame->get_label_widget());
5955 if (!pLabel)
5956 return nullptr;
5957 return std::make_unique<SalInstanceLabel>(pLabel, m_pBuilder, false);
5958}
5959
5961 bool bTakeOwnership)
5962 : SalInstanceWidget(pTextView, pBuilder, bTakeOwnership)
5963 , m_xTextView(pTextView)
5964{
5966 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
5967 m_aOrigVScrollHdl = rVertScrollBar.GetScrollHdl();
5968 rVertScrollBar.SetScrollHdl(LINK(this, SalInstanceTextView, VscrollHdl));
5969}
5970
5971void SalInstanceTextView::set_text(const OUString& rText)
5972{
5974 m_xTextView->SetText(rText);
5976}
5977
5979{
5983}
5984
5986
5987bool SalInstanceTextView::get_selection_bounds(int& rStartPos, int& rEndPos)
5988{
5989 const Selection& rSelection = m_xTextView->GetSelection();
5990 rStartPos = rSelection.Min();
5991 rEndPos = rSelection.Max();
5992 return rSelection.Len();
5993}
5994
5995void SalInstanceTextView::select_region(int nStartPos, int nEndPos)
5996{
5998 tools::Long nStart = nStartPos < 0 ? SELECTION_MAX : nStartPos;
5999 tools::Long nEnd = nEndPos < 0 ? SELECTION_MAX : nEndPos;
6000 m_xTextView->SetSelection(Selection(nStart, nEnd));
6002}
6003
6004void SalInstanceTextView::set_editable(bool bEditable) { m_xTextView->SetReadOnly(!bEditable); }
6007
6009{
6010 vcl::Font aOrigFont = m_xTextView->GetControlFont();
6011 vcl::Font aFont;
6012 if (bMonospace)
6013 aFont
6014 = OutputDevice::GetDefaultFont(DefaultFontType::UI_FIXED, LANGUAGE_DONTKNOW,
6016 else
6018 aFont.SetFontHeight(aOrigFont.GetFontHeight());
6019 set_font(aFont);
6020}
6021
6023{
6024 if (rColor != COL_AUTO)
6026 else
6028}
6029
6031{
6032 m_xTextView->SetFont(rFont);
6035}
6036
6038{
6039 assert(!m_aCursorPositionHdl.IsSet());
6040 m_xTextView->AddEventListener(LINK(this, SalInstanceTextView, CursorListener));
6042}
6043
6045{
6046 bool bNoSelection = !m_xTextView->GetSelection();
6047 return !bNoSelection || m_xTextView->CanUp();
6048}
6049
6051{
6052 bool bNoSelection = !m_xTextView->GetSelection();
6053 return !bNoSelection || m_xTextView->CanDown();
6054}
6055
6057
6059
6061
6063{
6064 ::set_alignment(*m_xTextView, eXAlign);
6065}
6066
6068{
6069 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
6070 return rVertScrollBar.GetThumbPos();
6071}
6072
6074{
6075 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
6076 rVertScrollBar.SetThumbPos(value);
6077 m_aOrigVScrollHdl.Call(&rVertScrollBar);
6078}
6079
6081{
6082 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
6083 return rVertScrollBar.GetRangeMax();
6084}
6085
6087{
6088 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
6089 return rVertScrollBar.GetRangeMin();
6090}
6091
6093{
6094 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
6095 return rVertScrollBar.GetVisibleSize();
6096}
6097
6099
6101{
6102 if (!m_xTextView->isDisposed())
6103 {
6104 if (m_aCursorPositionHdl.IsSet())
6107 ScrollBar& rVertScrollBar = m_xTextView->GetVScrollBar();
6108 rVertScrollBar.SetScrollHdl(m_aOrigVScrollHdl);
6109 }
6110}
6111
6112IMPL_LINK(SalInstanceTextView, VscrollHdl, ScrollBar*, pScrollBar, void)
6113{
6114 signal_vadjustment_changed();
6115 m_aOrigVScrollHdl.Call(pScrollBar);
6116}
6117
6118IMPL_LINK_NOARG(SalInstanceTextView, ChangeHdl, Edit&, void) { signal_changed(); }
6119
6120IMPL_LINK(SalInstanceTextView, CursorListener, VclWindowEvent&, rEvent, void)
6121{
6122 if (notify_events_disabled())
6123 return;
6124 if (rEvent.GetId() == VclEventId::EditSelectionChanged
6125 || rEvent.GetId() == VclEventId::EditCaretChanged)
6126 signal_cursor_position();
6127}
6128
6130 bool bTakeOwnership)
6131 : SalInstanceWidget(pExpander, pBuilder, bTakeOwnership)
6132 , m_xExpander(pExpander)
6133{
6134 m_xExpander->SetExpandedHdl(LINK(this, SalInstanceExpander, ExpandedHdl));
6135}
6136
6137void SalInstanceExpander::set_label(const OUString& rText) { m_xExpander->set_label(rText); }
6138
6140
6142
6144
6146{
6148}
6149
6151
6153{
6155}
6156
6157IMPL_LINK_NOARG(SalInstanceExpander, ExpandedHdl, VclExpander&, void) { signal_expanded(); }
6158
6159// SalInstanceWidget has a generic listener for all these
6160// events, ignore the ones we have specializations for
6161// in VclDrawingArea
6163{
6164 if (rEvent.GetId() == VclEventId::WindowResize)
6165 return;
6167}
6168
6170{
6173 || rEvent.GetId() == VclEventId::WindowMouseMove)
6174 {
6175 return;
6176 }
6178}
6179
6181
6183 SalInstanceBuilder* pBuilder, const a11yref& rAlly,
6184 FactoryFunction pUITestFactoryFunction,
6185 void* pUserData, bool bTakeOwnership)
6186 : SalInstanceWidget(pDrawingArea, pBuilder, bTakeOwnership)
6187 , m_xDrawingArea(pDrawingArea)
6188{
6190 m_xDrawingArea->SetUITestFactory(std::move(pUITestFactoryFunction), pUserData);
6203 LINK(this, SalInstanceDrawingArea, DeleteSurroundingHdl));
6205}
6206
6208
6209void SalInstanceDrawingArea::queue_draw_area(int x, int y, int width, int height)
6210{
6211 m_xDrawingArea->Invalidate(tools::Rectangle(Point(x, y), Size(width, height)));
6212}
6213
6215{
6217}
6218
6220{
6222}
6223
6225{
6227}
6228
6230{
6232}
6233
6235{
6236 m_xDrawingArea->SetPointer(ePointerStyle);
6237}
6238
6240{
6241 m_xDrawingArea->SetInputContext(rInputContext);
6242}
6243
6245 int nExtTextInputWidth)
6246{
6247 tools::Rectangle aCursorRect = m_xDrawingArea->PixelToLogic(rCursorRect);
6249 &aCursorRect, m_xDrawingArea->PixelToLogic(Size(nExtTextInputWidth, 0)).Width());
6250}
6251
6253{
6254 vcl::Window* pParent = m_xDrawingArea->GetParent();
6255 if (pParent)
6256 return pParent->GetAccessible();
6257 return css::uno::Reference<css::accessibility::XAccessible>();
6258}
6259
6261{
6264 vcl::Window* pWindow = m_xDrawingArea.get();
6265 if (pWindow)
6266 {
6267 vcl::Window* pLabeledBy = pWindow->GetAccessibleRelationLabeledBy();
6268 if (pLabeledBy && pLabeledBy != pWindow)
6269 {
6270 css::uno::Sequence<css::uno::Reference<css::uno::XInterface>> aSequence{
6271 pLabeledBy->GetAccessible()
6272 };
6273 pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation(
6274 css::accessibility::AccessibleRelationType::LABELED_BY, aSequence));
6275 }
6276 vcl::Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf();
6277 if (pMemberOf && pMemberOf != pWindow)
6278 {
6279 css::uno::Sequence<css::uno::Reference<css::uno::XInterface>> aSequence{
6280 pMemberOf->GetAccessible()
6281 };
6282 pRelationSetHelper->AddRelation(css::accessibility::AccessibleRelation(
6283 css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence));
6284 }
6285 }
6286 return pRelationSetHelper;
6287}
6288
6290{
6292}
6293
6295{
6297}
6298
6300 sal_uInt8 eDNDConstants)
6301{
6302 m_xDrawingArea->SetDragHelper(rHelper, eDNDConstants);
6303}
6304
6306{
6319 Link<std::pair<vcl::RenderContext&, const tools::Rectangle&>, void>());
6320}
6321
6323
6325{
6329}
6330
6332{
6336}
6337
6339{
6342}
6343
6345{
6348}
6349
6351{
6354}
6355
6356IMPL_LINK(SalInstanceDrawingArea, PaintHdl, target_and_area, aPayload, void)
6357{
6358 m_aDrawHdl.Call(aPayload);
6359 tools::Rectangle aFocusRect(m_aGetFocusRectHdl.Call(*this));
6360 if (!aFocusRect.IsEmpty())
6361 InvertFocusRect(aPayload.first, aFocusRect);
6362}
6363
6364IMPL_LINK(SalInstanceDrawingArea, ResizeHdl, const Size&, rSize, void)
6365{
6366 m_aSizeAllocateHdl.Call(rSize);
6367}
6368
6369IMPL_LINK(SalInstanceDrawingArea, MousePressHdl, const MouseEvent&, rEvent, bool)
6370{
6371 return m_aMousePressHdl.Call(rEvent);
6372}
6373
6374IMPL_LINK(SalInstanceDrawingArea, MouseMoveHdl, const MouseEvent&, rEvent, bool)
6375{
6376 return m_aMouseMotionHdl.Call(rEvent);
6377}
6378
6379IMPL_LINK(SalInstanceDrawingArea, MouseReleaseHdl, const MouseEvent&, rEvent, bool)
6380{
6381 return m_aMouseReleaseHdl.Call(rEvent);
6382}
6383
6384IMPL_LINK(SalInstanceDrawingArea, KeyPressHdl, const KeyEvent&, rEvent, bool)
6385{
6386 return m_aKeyPressHdl.Call(rEvent);
6387}
6388
6389IMPL_LINK(SalInstanceDrawingArea, KeyReleaseHdl, const KeyEvent&, rEvent, bool)
6390{
6391 return m_aKeyReleaseHdl.Call(rEvent);
6392}
6393
6395{
6396 m_aStyleUpdatedHdl.Call(*this);
6397}
6398
6399IMPL_LINK(SalInstanceDrawingArea, CommandHdl, const CommandEvent&, rEvent, bool)
6400{
6401 return m_aCommandHdl.Call(rEvent);
6402}
6403
6404IMPL_LINK(SalInstanceDrawingArea, GetSurroundingHdl, OUString&, rSurrounding, int)
6405{
6406 return m_aGetSurroundingHdl.Call(rSurrounding);
6407}
6408
6409IMPL_LINK(SalInstanceDrawingArea, DeleteSurroundingHdl, const Selection&, rSelection, bool)
6410{
6411 return m_aDeleteSurroundingHdl.Call(rSelection);
6412}
6413
6414IMPL_LINK(SalInstanceDrawingArea, QueryTooltipHdl, tools::Rectangle&, rHelpArea, OUString)
6415{
6416 return m_aQueryTooltipHdl.Call(rHelpArea);
6417}
6418
6420{
6421 if (m_aDragBeginHdl.Call(*this))
6422 return true;
6423 return false;
6424}
6425
6427 SalInstanceBuilder* pBuilder,
6428 bool bTakeOwnership)
6429 : SalInstanceComboBox<ListBox>(pListBox, pBuilder, bTakeOwnership)
6430{
6432}
6433
6435{
6436 return m_xComboBox->GetSelectedEntry();
6437}
6438
6440
6441void SalInstanceComboBoxWithoutEdit::insert(int pos, const OUString& rStr, const OUString* pId,
6442 const OUString* pIconName, VirtualDevice* pImageSurface)
6443{
6444 auto nInsertPos = pos == -1 ? COMBOBOX_APPEND : pos;
6445 sal_Int32 nInsertedAt;
6446 if (!pIconName && !pImageSurface)
6447 nInsertedAt = m_xComboBox->InsertEntry(rStr, nInsertPos);
6448 else if (pIconName)
6449 nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pIconName), nInsertPos);
6450 else
6451 nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pImageSurface), nInsertPos);
6452 if (pId)
6453 {
6454 m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
6455 m_xComboBox->SetEntryData(nInsertedAt, m_aUserData.back().get());
6456 }
6457}
6458
6459void SalInstanceComboBoxWithoutEdit::insert_separator(int pos, const OUString& /*rId*/)
6460{
6461 auto nInsertPos = pos == -1 ? m_xComboBox->GetEntryCount() : pos;
6462 m_xComboBox->AddSeparator(nInsertPos - 1);
6463}
6464
6465bool SalInstanceComboBoxWithoutEdit::has_entry() const { return false; }
6466
6468
6470{
6471 assert(false);
6472}
6473
6474void SalInstanceComboBoxWithoutEdit::set_entry_text(const OUString& /*rText*/) { assert(false); }
6475
6476void SalInstanceComboBoxWithoutEdit::select_entry_region(int /*nStartPos*/, int /*nEndPos*/)
6477{
6478 assert(false);
6479}
6480
6482 int& /*rEndPos*/)
6483{
6484 assert(false);
6485 return false;
6486}
6487
6488void SalInstanceComboBoxWithoutEdit::set_entry_width_chars(int /*nChars*/) { assert(false); }
6489
6490void SalInstanceComboBoxWithoutEdit::set_entry_max_length(int /*nChars*/) { assert(false); }
6491
6493
6495
6496void SalInstanceComboBoxWithoutEdit::set_entry_editable(bool /*bEditable*/) { assert(false); }
6497
6499
6501
6503
6505{
6508}
6509
6511
6513{
6514 assert(false);
6515 return vcl::Font();
6516}
6517
6519{
6520 assert(false && "not implemented");
6521}
6522
6524{
6525 assert(false && "not implemented");
6526 return 0;
6527}
6528
6529void SalInstanceComboBoxWithoutEdit::set_max_mru_count(int) { assert(false && "not implemented"); }
6530
6532{
6533 assert(false && "not implemented");
6534 return OUString();
6535}
6536
6538{
6539 assert(false && "not implemented");
6540}
6541
6543{
6545}
6546
6548{
6550}
6551
6553{
6554 return signal_changed();
6555}
6556
6558 SalInstanceBuilder* pBuilder,
6559 bool bTakeOwnership)
6560 : SalInstanceComboBox<::ComboBox>(pComboBox, pBuilder, bTakeOwnership)
6561 , m_aTextFilter(m_aEntryInsertTextHdl)
6562 , m_bInSelect(false)
6563{
6568}
6569
6570bool SalInstanceComboBoxWithEdit::has_entry() const { return true; }
6571
6573{
6574 Edit* pEdit = m_xComboBox->GetSubEdit();
6575 assert(pEdit);
6576 m_xFlashAttention.reset(new SalFlashAttention(pEdit));
6577 m_xFlashAttention->Start();
6578}
6579
6581{
6583}
6584
6586{
6587 Edit* pEdit = m_xComboBox->GetSubEdit();
6588 assert(pEdit);
6589 ::set_message_type(pEdit, eType);
6590}
6591
6593
6595
6596void SalInstanceComboBoxWithEdit::insert(int pos, const OUString& rStr, const OUString* pId,
6597 const OUString* pIconName, VirtualDevice* pImageSurface)
6598{
6599 auto nInsertPos = pos == -1 ? COMBOBOX_APPEND : pos;
6600 sal_Int32 nInsertedAt;
6601 if (!pIconName && !pImageSurface)
6602 nInsertedAt = m_xComboBox->InsertEntry(rStr, nInsertPos);
6603 else if (pIconName)
6604 nInsertedAt = m_xComboBox->InsertEntryWithImage(rStr, createImage(*pIconName), nInsertPos);
6605 else
6606 nInsertedAt
6607 = m_xComboBox->InsertEntryWithImage(rStr, createImage(*pImageSurface), nInsertPos);
6608 if (pId)
6609 {
6610 m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
6611 m_xComboBox->SetEntryData(nInsertedAt, m_aUserData.back().get());
6612 }
6613}
6614
6615void SalInstanceComboBoxWithEdit::insert_separator(int pos, const OUString& /*rId*/)
6616{
6617 auto nInsertPos = pos == -1 ? m_xComboBox->GetEntryCount() : pos;
6618 m_xComboBox->AddSeparator(nInsertPos - 1);
6619}
6620
6622{
6623 m_xComboBox->SetText(rText);
6624}
6625
6627{
6629}
6630
6632{
6633 m_xComboBox->SetMaxTextLen(nChars);
6634}
6635
6636void SalInstanceComboBoxWithEdit::set_entry_completion(bool bEnable, bool bCaseSensitive)
6637{
6638 m_xComboBox->EnableAutocomplete(bEnable, bCaseSensitive);
6639}
6640
6642{
6644}
6645
6647{
6648 m_xComboBox->SetReadOnly(!bEditable);
6649}
6650
6652
6654
6656
6658{
6659 m_xComboBox->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos));
6660}
6661
6663{
6664 const Selection& rSelection = m_xComboBox->GetSelection();
6665 rStartPos = rSelection.Min();
6666 rEndPos = rSelection.Max();
6667 return rSelection.Len();
6668}
6669
6671{
6674}
6675
6677{
6678 Edit* pEdit = m_xComboBox->GetSubEdit();
6679 assert(pEdit);
6680 pEdit->SetControlFont(rFont); // tdf#134601 set it as control font to take effect properly
6681 pEdit->Invalidate();
6682}
6683
6685{
6686 Edit* pEdit = m_xComboBox->GetSubEdit();
6687 assert(pEdit);
6688 return pEdit->GetPointFont(*pEdit->GetOutDev());
6689}
6690
6692{
6693 if (m_xComboBox->IsUserDrawEnabled() == bOn)
6694 return;
6695
6696 auto nOldEntryHeight = m_xComboBox->GetDropDownEntryHeight();
6697 auto nDropDownLineCount = m_xComboBox->GetDropDownLineCount();
6698
6700 if (bOn)
6702 else
6704
6705 // adjust the line count to fit approx the height it would have been before
6706 // changing the renderer
6707 auto nNewEntryHeight = m_xComboBox->GetDropDownEntryHeight();
6708 double fRatio = nOldEntryHeight / static_cast<double>(nNewEntryHeight);
6709 m_xComboBox->SetDropDownLineCount(nDropDownLineCount * fRatio);
6710}
6711
6713
6715{
6717}
6718
6720{
6721 return m_xComboBox->GetMRUEntries();
6722}
6723
6725{
6726 m_xComboBox->SetMRUEntries(rEntries);
6727}
6728
6730{
6731 if (rEvent.GetId() == VclEventId::DropdownPreOpen)
6732 {
6734 m_xComboBox->SetUserItemSize(aRowSize);
6735 }
6737}
6738
6740{
6741 m_xComboBox->SetTextFilter(nullptr);
6745}
6746
6748{
6749 if (!m_xComboBox->IsSyntheticModify()) // SelectHdl will be called
6750 signal_changed();
6751}
6752
6754{
6755 m_bInSelect = true;
6756 signal_changed();
6757 m_bInSelect = false;
6758}
6759
6761{
6762 return m_aEntryActivateHdl.Call(*this);
6763}
6764
6766{
6767 call_signal_custom_render(pEvent);
6768}
6769
6771{
6772private:
6773 DECL_LINK(AutocompleteHdl, Edit&, void);
6774 DECL_LINK(KeyPressListener, VclWindowEvent&, void);
6778
6779public:
6781 bool bTakeOwnership, std::unique_ptr<weld::Entry> xEntry,
6782 std::unique_ptr<weld::TreeView> xTreeView)
6783 : EntryTreeView(std::move(xEntry), std::move(xTreeView))
6784 , SalInstanceContainer(pContainer, pBuilder, bTakeOwnership)
6785 , m_pEntry(dynamic_cast<SalInstanceEntry*>(m_xEntry.get()))
6786 , m_pTreeView(dynamic_cast<SalInstanceTreeView*>(m_xTreeView.get()))
6787 , m_bTreeChange(false)
6788 {
6789 assert(m_pEntry && m_pTreeView);
6790
6791 Edit& rEntry = m_pEntry->getEntry();
6792 rEntry.SetAutocompleteHdl(LINK(this, SalInstanceEntryTreeView, AutocompleteHdl));
6793 rEntry.AddEventListener(LINK(this, SalInstanceEntryTreeView, KeyPressListener));
6794 }
6795
6796 virtual void insert_separator(int /*pos*/, const OUString& /*rId*/) override { assert(false); }
6797
6798 virtual void make_sorted() override
6799 {
6800 vcl::Window* pTreeView = m_pTreeView->getWidget();
6801 pTreeView->SetStyle(pTreeView->GetStyle() | WB_SORT);
6802 }
6803
6804 virtual void set_entry_completion(bool bEnable, bool /*bCaseSensitive*/) override
6805 {
6806 assert(!bEnable && "not implemented yet");
6807 (void)bEnable;
6808 Edit& rEntry = m_pEntry->getEntry();
6810 }
6811
6812 virtual void set_font(const vcl::Font&) override { assert(false && "not implemented"); }
6813
6814 virtual void set_entry_font(const vcl::Font& rFont) override { m_pEntry->set_font(rFont); }
6815
6816 virtual vcl::Font get_entry_font() override
6817 {
6818 Edit& rEntry = m_pEntry->getEntry();
6819 return rEntry.GetPointFont(*rEntry.GetOutDev());
6820 }
6821
6822 virtual void set_entry_placeholder_text(const OUString& rText) override
6823 {
6824 Edit& rEntry = m_pEntry->getEntry();
6825 rEntry.SetPlaceholderText(rText);
6826 }
6827
6828 virtual void set_entry_editable(bool bEditable) override
6829 {
6830 Edit& rEntry = m_pEntry->getEntry();
6831 rEntry.SetReadOnly(!bEditable);
6832 }
6833
6834 virtual void cut_entry_clipboard() override
6835 {
6836 Edit& rEntry = m_pEntry->getEntry();
6837 rEntry.Cut();
6838 }
6839
6840 virtual void copy_entry_clipboard() override
6841 {
6842 Edit& rEntry = m_pEntry->getEntry();
6843 rEntry.Copy();
6844 }
6845
6846 virtual void paste_entry_clipboard() override
6847 {
6848 Edit& rEntry = m_pEntry->getEntry();
6849 rEntry.Paste();
6850 }
6851
6852 virtual void grab_focus() override { m_xEntry->grab_focus(); }
6853
6854 virtual void connect_focus_in(const Link<Widget&, void>& rLink) override
6855 {
6856 m_xEntry->connect_focus_in(rLink);
6857 }
6858
6859 virtual void connect_focus_out(const Link<Widget&, void>& rLink) override
6860 {
6861 m_xEntry->connect_focus_out(rLink);
6862 }
6863
6864 virtual bool changed_by_direct_pick() const override { return m_bTreeChange; }
6865
6866 virtual void set_custom_renderer(bool /*bOn*/) override { assert(false && "not implemented"); }
6867
6868 virtual int get_max_mru_count() const override
6869 {
6870 assert(false && "not implemented");
6871 return 0;
6872 }
6873
6874 virtual void set_max_mru_count(int) override { assert(false && "not implemented"); }
6875
6876 virtual OUString get_mru_entries() const override
6877 {
6878 assert(false && "not implemented");
6879 return OUString();
6880 }
6881
6882 virtual void set_mru_entries(const OUString&) override { assert(false && "not implemented"); }
6883
6884 virtual void set_item_menu(const OUString&, weld::Menu*) override
6885 {
6886 assert(false && "not implemented");
6887 }
6888
6889 int get_menu_button_width() const override
6890 {
6891 assert(false && "not implemented");
6892 return 0;
6893 }
6894
6896 {
6898 }
6899
6900 virtual ~SalInstanceEntryTreeView() override
6901 {
6902 Edit& rEntry = m_pEntry->getEntry();
6903 rEntry.RemoveEventListener(LINK(this, SalInstanceEntryTreeView, KeyPressListener));
6905 }
6906};
6907
6908IMPL_LINK(SalInstanceEntryTreeView, KeyPressListener, VclWindowEvent&, rEvent, void)
6909{
6910 if (rEvent.GetId() != VclEventId::WindowKeyInput)
6911 return;
6912 const KeyEvent& rKeyEvent = *static_cast<KeyEvent*>(rEvent.GetData());
6913 sal_uInt16 nKeyCode = rKeyEvent.GetKeyCode().GetCode();
6914 if (!(nKeyCode == KEY_UP || nKeyCode == KEY_DOWN || nKeyCode == KEY_PAGEUP
6915 || nKeyCode == KEY_PAGEDOWN))
6916 return;
6917
6918 m_pTreeView->disable_notify_events();
6919 auto& rListBox = m_pTreeView->getTreeView();
6920 if (!rListBox.FirstSelected())
6921 {
6922 if (SvTreeListEntry* pEntry = rListBox.First())
6923 rListBox.Select(pEntry, true);
6924 }
6925 else
6926 rListBox.KeyInput(rKeyEvent);
6927 m_xEntry->set_text(m_xTreeView->get_selected_text());
6928 m_xEntry->select_region(0, -1);
6929 m_pTreeView->enable_notify_events();
6930 m_bTreeChange = true;
6931 m_pEntry->fire_signal_changed();
6932 m_bTreeChange = false;
6933}
6934
6935IMPL_LINK(SalInstanceEntryTreeView, AutocompleteHdl, Edit&, rEdit, void)
6936{
6937 Selection aSel = rEdit.GetSelection();
6938
6939 OUString aFullText = rEdit.GetText();
6940 OUString aStartText = aFullText.copy(0, static_cast<sal_Int32>(aSel.Max()));
6941
6942 int nPos = -1;
6943 int nCount = m_xTreeView->n_children();
6944 for (int i = 0; i < nCount; ++i)
6945 {
6946 if (m_xTreeView->get_text(i).startsWithIgnoreAsciiCase(aStartText))
6947 {
6948 nPos = i;
6949 break;
6950 }
6951 }
6952
6953 m_xTreeView->select(nPos);
6954
6955 if (nPos != -1)
6956 {
6957 OUString aText = m_xTreeView->get_text(nPos);
6958 Selection aSelection(aText.getLength(), aStartText.getLength());
6959 rEdit.SetText(aText, aSelection);
6960 }
6961}
6962
6964 bool bTakeOwnership)
6965 : SalInstanceContainer(pPopover, pBuilder, bTakeOwnership)
6966 , m_xPopover(pPopover)
6967{
6968}
6969
6971{
6973 if (pDockingManager->IsInPopupMode(m_xPopover))
6974 ImplPopDown();
6975}
6976
6978 weld::Placement ePlace)
6979{
6980 SalInstanceWidget* pVclWidget = dynamic_cast<SalInstanceWidget*>(pParent);
6981 assert(pVclWidget);
6982 vcl::Window* pWidget = pVclWidget->getWidget();
6983
6984 tools::Rectangle aRect;
6985 Point aPt = pWidget->OutputToScreenPixel(rRect.TopLeft());
6986 aRect.SetLeft(aPt.X());
6987 aRect.SetTop(aPt.Y());
6988 aPt = pWidget->OutputToScreenPixel(rRect.BottomRight());
6989 aRect.SetRight(aPt.X());
6990 aRect.SetBottom(aPt.Y());
6991
6993 if (ePlace == weld::Placement::Under)
6994 nFlags = nFlags | FloatWinPopupFlags::Down;
6995 else
6996 nFlags = nFlags | FloatWinPopupFlags::Right;
6997
7000 pDockingManager->SetPopupModeEndHdl(m_xPopover,
7001 LINK(this, SalInstancePopover, PopupModeEndHdl));
7002 pDockingManager->StartPopupMode(m_xPopover, aRect, nFlags);
7003}
7004
7006{
7008 m_xPopover->EnableDocking(false);
7009 signal_closed();
7010}
7011
7013
7015{
7017
7019 if (pDockingManager->IsInPopupMode(m_xPopover.get()))
7020 {
7022 tools::Rectangle aRect = pDockingManager->GetPosSizePixel(m_xPopover.get());
7023 pDockingManager->SetPosSizePixel(m_xPopover.get(), aRect.Left(), aRect.Top(), aSize.Width(),
7024 aSize.Height(), PosSizeFlags::Size);
7025 }
7026}
7027
7028IMPL_LINK_NOARG(SalInstancePopover, PopupModeEndHdl, FloatingWindow*, void) { signal_closed(); }
7029
7030SalInstanceBuilder::SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot,
7031 const OUString& rUIFile,
7032 const css::uno::Reference<css::frame::XFrame>& rFrame)
7033 : weld::Builder()
7034 , m_xBuilder(new VclBuilder(pParent, rUIRoot, rUIFile, {}, rFrame, false))
7035{
7036}
7037
7038std::unique_ptr<weld::MessageDialog> SalInstanceBuilder::weld_message_dialog(const OUString& id)
7039{
7040 MessageDialog* pMessageDialog = m_xBuilder->get<MessageDialog>(id);
7041 std::unique_ptr<weld::MessageDialog> pRet(
7042 pMessageDialog ? new SalInstanceMessageDialog(pMessageDialog, this, false) : nullptr);
7043 if (pMessageDialog)
7044 {
7045 assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
7046 m_aOwnedToplevel.set(pMessageDialog);
7047 m_xBuilder->drop_ownership(pMessageDialog);
7048 }
7049 return pRet;
7050}
7051
7052std::unique_ptr<weld::Dialog> SalInstanceBuilder::weld_dialog(const OUString& id)
7053{
7054 Dialog* pDialog = m_xBuilder->get<Dialog>(id);
7055 std::unique_ptr<weld::Dialog> pRet(pDialog ? new SalInstanceDialog(pDialog, this, false)
7056 : nullptr);
7057 if (pDialog)
7058 {
7059 assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
7060 m_aOwnedToplevel.set(pDialog);
7061 m_xBuilder->drop_ownership(pDialog);
7062 }
7063 return pRet;
7064}
7065
7066std::unique_ptr<weld::Assistant> SalInstanceBuilder::weld_assistant(const OUString& id)
7067{
7069 std::unique_ptr<weld::Assistant> pRet(pDialog ? new SalInstanceAssistant(pDialog, this, false)
7070 : nullptr);
7071 if (pDialog)
7072 {
7073 assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
7074 m_aOwnedToplevel.set(pDialog);
7075 m_xBuilder->drop_ownership(pDialog);
7076 }
7077 return pRet;
7078}
7079
7081{
7082 assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
7083
7084 vcl::Window* pRoot = m_xBuilder->get_widget_root();
7085 if (SystemWindow* pWindow = dynamic_cast<SystemWindow*>(pRoot))
7086 {
7087 std::unique_ptr<weld::Window> xRet(new SalInstanceWindow(pWindow, this, false));
7088 m_aOwnedToplevel.set(pWindow);
7089 m_xBuilder->drop_ownership(pWindow);
7090 return xRet;
7091 }
7092
7095 xDialog->SetText(utl::ConfigManager::getProductName());
7096
7097 auto xContentArea = VclPtr<VclVBox>::Create(xDialog, false, 12);
7098 pRoot->SetParent(xContentArea);
7099 assert(pRoot == xContentArea->GetWindow(GetWindowType::FirstChild));
7100 xContentArea->Show();
7101 pRoot->Show();
7102 xDialog->SetHelpId(pRoot->GetHelpId());
7103
7104 m_aOwnedToplevel.set(xDialog);
7105
7106 return std::unique_ptr<weld::Dialog>(new SalInstanceDialog(xDialog, this, false));
7107}
7108
7109std::unique_ptr<weld::Widget> SalInstanceBuilder::weld_widget(const OUString& id)
7110{
7111 vcl::Window* pWidget = m_xBuilder->get(id);
7112 return pWidget ? std::make_unique<SalInstanceWidget>(pWidget, this, false) : nullptr;
7113}
7114
7115std::unique_ptr<weld::Container> SalInstanceBuilder::weld_container(const OUString& id)
7116{
7117 vcl::Window* pContainer = m_xBuilder->get(id);
7118 return pContainer ? std::make_unique<SalInstanceContainer>(pContainer, this, false) : nullptr;
7119}
7120
7121std::unique_ptr<weld::Box> SalInstanceBuilder::weld_box(const OUString& id)
7122{
7123 VclBox* pContainer = m_xBuilder->get<VclBox>(id);
7124 return pContainer ? std::make_unique<SalInstanceBox>(pContainer, this, false) : nullptr;
7125}
7126
7127std::unique_ptr<weld::Paned> SalInstanceBuilder::weld_paned(const OUString& id)
7128{
7129 VclPaned* pPaned = m_xBuilder->get<VclPaned>(id);
7130 return pPaned ? std::make_unique<SalInstancePaned>(pPaned, this, false) : nullptr;
7131}
7132
7133std::unique_ptr<weld::Frame> SalInstanceBuilder::weld_frame(const OUString& id)
7134{
7135 VclFrame* pFrame = m_xBuilder->get<VclFrame>(id);
7136 std::unique_ptr<weld::Frame> pRet(pFrame ? new SalInstanceFrame(pFrame, this, false) : nullptr);
7137 return pRet;
7138}
7139
7140std::unique_ptr<weld::ScrolledWindow>
7141SalInstanceBuilder::weld_scrolled_window(const OUString& id, bool bUserManagedScrolling)
7142{
7143 VclScrolledWindow* pScrolledWindow = m_xBuilder->get<VclScrolledWindow>(id);
7144 return pScrolledWindow ? std::make_unique<SalInstanceScrolledWindow>(
7145 pScrolledWindow, this, false, bUserManagedScrolling)
7146 : nullptr;
7147}
7148
7149std::unique_ptr<weld::Notebook> SalInstanceBuilder::weld_notebook(const OUString& id)
7150{
7151 vcl::Window* pNotebook = m_xBuilder->get(id);
7152 if (!pNotebook)
7153 return nullptr;
7154 if (pNotebook->GetType() == WindowType::TABCONTROL)
7155 return std::make_unique<SalInstanceNotebook>(static_cast<TabControl*>(pNotebook), this,
7156 false);
7157 if (pNotebook->GetType() == WindowType::VERTICALTABCONTROL)
7158 return std::make_unique<SalInstanceVerticalNotebook>(
7159 static_cast<VerticalTabControl*>(pNotebook), this, false);
7160 return nullptr;
7161}
7162
7163std::unique_ptr<weld::Button> SalInstanceBuilder::weld_button(const OUString& id)
7164{
7165 Button* pButton = m_xBuilder->get<Button>(id);
7166 return pButton ? std::make_unique<SalInstanceButton>(pButton, this, false) : nullptr;
7167}
7168
7169std::unique_ptr<weld::MenuButton> SalInstanceBuilder::weld_menu_button(const OUString& id)
7170{
7171 MenuButton* pButton = m_xBuilder->get<MenuButton>(id);
7172 return pButton ? std::make_unique<SalInstanceMenuButton>(pButton, this, false) : nullptr;
7173}
7174
7175std::unique_ptr<weld::MenuToggleButton>
7177{
7178 MenuToggleButton* pButton = m_xBuilder->get<MenuToggleButton>(id);
7179 return pButton ? std::make_unique<SalInstanceMenuToggleButton>(pButton, this, false) : nullptr;
7180}
7181
7182std::unique_ptr<weld::LinkButton> SalInstanceBuilder::weld_link_button(const OUString& id)
7183{
7184 FixedHyperlink* pButton = m_xBuilder->get<FixedHyperlink>(id);
7185 return pButton ? std::make_unique<SalInstanceLinkButton>(pButton, this, false) : nullptr;
7186}
7187
7188std::unique_ptr<weld::ToggleButton> SalInstanceBuilder::weld_toggle_button(const OUString& id)
7189{
7190 PushButton* pToggleButton = m_xBuilder->get<PushButton>(id);
7191 return pToggleButton ? std::make_unique<SalInstanceToggleButton>(pToggleButton, this, false)
7192 : nullptr;
7193}
7194
7195std::unique_ptr<weld::RadioButton> SalInstanceBuilder::weld_radio_button(const OUString& id)
7196{
7197 RadioButton* pRadioButton = m_xBuilder->get<RadioButton>(id);
7198 return pRadioButton ? std::make_unique<SalInstanceRadioButton>(pRadioButton, this, false)
7199 : nullptr;
7200}
7201
7202std::unique_ptr<weld::CheckButton> SalInstanceBuilder::weld_check_button(const OUString& id)
7203{
7204 CheckBox* pCheckButton = m_xBuilder->get<CheckBox>(id);
7205 return pCheckButton ? std::make_unique<SalInstanceCheckButton>(pCheckButton, this, false)
7206 : nullptr;
7207}
7208
7209std::unique_ptr<weld::Scale> SalInstanceBuilder::weld_scale(const OUString& id)
7210{
7211 Slider* pSlider = m_xBuilder->get<Slider>(id);
7212 return pSlider ? std::make_unique<SalInstanceScale>(pSlider, this, false) : nullptr;
7213}
7214
7215std::unique_ptr<weld::ProgressBar> SalInstanceBuilder::weld_progress_bar(const OUString& id)
7216{
7217 ::ProgressBar* pProgress = m_xBuilder->get<::ProgressBar>(id);
7218 return pProgress ? std::make_unique<SalInstanceProgressBar>(pProgress, this, false) : nullptr;
7219}
7220
7221std::unique_ptr<weld::Spinner> SalInstanceBuilder::weld_spinner(const OUString& id)
7222{
7223 Throbber* pThrobber = m_xBuilder->get<Throbber>(id);
7224 return pThrobber ? std::make_unique<SalInstanceSpinner>(pThrobber, this, false) : nullptr;
7225}
7226
7227std::unique_ptr<weld::Image> SalInstanceBuilder::weld_image(const OUString& id)
7228{
7229 FixedImage* pImage = m_xBuilder->get<FixedImage>(id);
7230 return pImage ? std::make_unique<SalInstanceImage>(pImage, this, false) : nullptr;
7231}
7232
7233std::unique_ptr<weld::Calendar> SalInstanceBuilder::weld_calendar(const OUString& id)
7234{
7235 Calendar* pCalendar = m_xBuilder->get<Calendar>(id);
7236 return pCalendar ? std::make_unique<SalInstanceCalendar>(pCalendar, this, false) : nullptr;
7237}
7238
7239std::unique_ptr<weld::Entry> SalInstanceBuilder::weld_entry(const OUString& id)
7240{
7241 Edit* pEntry = m_xBuilder->get<Edit>(id);
7242 return pEntry ? std::make_unique<SalInstanceEntry>(pEntry, this, false) : nullptr;
7243}
7244
7245std::unique_ptr<weld::SpinButton> SalInstanceBuilder::weld_spin_button(const OUString& id)
7246{
7247 FormattedField* pSpinButton = m_xBuilder->get<FormattedField>(id);
7248 return pSpinButton ? std::make_unique<SalInstanceSpinButton>(pSpinButton, this, false)
7249 : nullptr;
7250}
7251
7252std::unique_ptr<weld::MetricSpinButton>
7254{
7255 std::unique_ptr<weld::SpinButton> xButton(weld_spin_button(id));
7256 if (xButton)
7257 {
7258 SalInstanceSpinButton& rButton = dynamic_cast<SalInstanceSpinButton&>(*xButton);
7259 rButton.SetUseThousandSep();
7260 }
7261 return std::make_unique<weld::MetricSpinButton>(std::move(xButton), eUnit);
7262}
7263
7264std::unique_ptr<weld::FormattedSpinButton>
7266{
7267 FormattedField* pSpinButton = m_xBuilder->get<FormattedField>(id);
7268 return pSpinButton ? std::make_unique<SalInstanceFormattedSpinButton>(pSpinButton, this, false)
7269 : nullptr;
7270}
7271
7272std::unique_ptr<weld::ComboBox> SalInstanceBuilder::weld_combo_box(const OUString& id)
7273{
7274 vcl::Window* pWidget = m_xBuilder->get(id);
7275 ::ComboBox* pComboBox = dynamic_cast<::ComboBox*>(pWidget);
7276 if (pComboBox)
7277 return std::make_unique<SalInstanceComboBoxWithEdit>(pComboBox, this, false);
7278 ListBox* pListBox = dynamic_cast<ListBox*>(pWidget);
7279 return pListBox ? std::make_unique<SalInstanceComboBoxWithoutEdit>(pListBox, this, false)
7280 : nullptr;
7281}
7282
7283std::unique_ptr<weld::EntryTreeView>
7284SalInstanceBuilder::weld_entry_tree_view(const OUString& containerid, const OUString& entryid,
7285 const OUString& treeviewid)
7286{
7287 vcl::Window* pContainer = m_xBuilder->get(containerid);
7288 return pContainer ? std::make_unique<SalInstanceEntryTreeView>(pContainer, this, false,
7289 weld_entry(entryid),
7290 weld_tree_view(treeviewid))
7291 : nullptr;
7292}
7293
7294std::unique_ptr<weld::TreeView> SalInstanceBuilder::weld_tree_view(const OUString& id)
7295{
7296 SvTabListBox* pTreeView = m_xBuilder->get<SvTabListBox>(id);
7297 return pTreeView ? std::make_unique<SalInstanceTreeView>(pTreeView, this, false) : nullptr;
7298}
7299
7300std::unique_ptr<weld::IconView> SalInstanceBuilder::weld_icon_view(const OUString& id)
7301{
7302 IconView* pIconView = m_xBuilder->get<IconView>(id);
7303 return pIconView ? std::make_unique<SalInstanceIconView>(pIconView, this, false) : nullptr;
7304}
7305
7306std::unique_ptr<weld::Label> SalInstanceBuilder::weld_label(const OUString& id)
7307{
7308 Control* pLabel = m_xBuilder->get<Control>(id);
7309 return pLabel ? std::make_unique<SalInstanceLabel>(pLabel, this, false) : nullptr;
7310}
7311
7312std::unique_ptr<weld::TextView> SalInstanceBuilder::weld_text_view(const OUString& id)
7313{
7314 VclMultiLineEdit* pTextView = m_xBuilder->get<VclMultiLineEdit>(id);
7315 return pTextView ? std::make_unique<SalInstanceTextView>(pTextView, this, false) : nullptr;
7316}
7317
7318std::unique_ptr<weld::Expander> SalInstanceBuilder::weld_expander(const OUString& id)
7319{
7320 VclExpander* pExpander = m_xBuilder->get<VclExpander>(id);
7321 return pExpander ? std::make_unique<SalInstanceExpander>(pExpander, this, false) : nullptr;
7322}
7323
7324std::unique_ptr<weld::DrawingArea>
7325SalInstanceBuilder::weld_drawing_area(const OUString& id, const a11yref& rA11yImpl,
7326 FactoryFunction pUITestFactoryFunction, void* pUserData)
7327{
7328 VclDrawingArea* pDrawingArea = m_xBuilder->get<VclDrawingArea>(id);
7329 return pDrawingArea
7330 ? std::make_unique<SalInstanceDrawingArea>(pDrawingArea, this, rA11yImpl,
7331 pUITestFactoryFunction, pUserData, false)
7332 : nullptr;
7333}
7334
7335std::unique_ptr<weld::Menu> SalInstanceBuilder::weld_menu(const OUString& id)
7336{
7337 PopupMenu* pMenu = m_xBuilder->get_menu(id);
7338 return pMenu ? std::make_unique<SalInstanceMenu>(pMenu, true) : nullptr;
7339}
7340
7341std::unique_ptr<weld::Popover> SalInstanceBuilder::weld_popover(const OUString& id)
7342{
7343 DockingWindow* pDockingWindow = m_xBuilder->get<DockingWindow>(id);
7344 std::unique_ptr<weld::Popover> pRet(
7345 pDockingWindow ? new SalInstancePopover(pDockingWindow, this, false) : nullptr);
7346 if (pDockingWindow)
7347 {
7348 assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
7349 m_aOwnedToplevel.set(pDockingWindow);
7350 m_xBuilder->drop_ownership(pDockingWindow);
7351 }
7352 return pRet;
7353}
7354
7355std::unique_ptr<weld::Toolbar> SalInstanceBuilder::weld_toolbar(const OUString& id)
7356{
7357 ToolBox* pToolBox = m_xBuilder->get<ToolBox>(id);
7358 return pToolBox ? std::make_unique<SalInstanceToolbar>(pToolBox, this, false) : nullptr;
7359}
7360
7361std::unique_ptr<weld::Scrollbar> SalInstanceBuilder::weld_scrollbar(const OUString& id)
7362{
7363 ScrollBar* pScrollbar = m_xBuilder->get<ScrollBar>(id);
7364 return pScrollbar ? std::make_unique<SalInstanceScrollbar>(pScrollbar, this, false) : nullptr;
7365}
7366
7367std::unique_ptr<weld::SizeGroup> SalInstanceBuilder::create_size_group()
7368{
7369 return std::make_unique<SalInstanceSizeGroup>();
7370}
7371
7373{
7374 vcl::Window* pCtrl = m_xBuilder->get("tabcontrol");
7375 if (!pCtrl)
7376 return {};
7377 VclPtr<vcl::Window> xTabPage;
7378 if (pCtrl->GetType() == WindowType::TABCONTROL)
7379 {
7380 TabControl* pTabCtrl = static_cast<TabControl*>(pCtrl);
7381 xTabPage = pTabCtrl->GetTabPage(pTabCtrl->GetCurPageId());
7382 }
7383 else if (pCtrl->GetType() == WindowType::VERTICALTABCONTROL)
7384 {
7385 VerticalTabControl* pTabCtrl = static_cast<VerticalTabControl*>(pCtrl);
7386 xTabPage = pTabCtrl->GetPage(pTabCtrl->GetCurPageId());
7387 }
7388 vcl::Window* pTabChild = xTabPage ? xTabPage->GetWindow(GetWindowType::FirstChild) : nullptr;
7389 pTabChild = pTabChild ? pTabChild->GetWindow(GetWindowType::FirstChild) : nullptr;
7390 if (pTabChild)
7391 return pTabChild->GetHelpId();
7392 return {};
7393}
7394
7396{
7397 if (VclBuilderContainer* pOwnedToplevel
7398 = dynamic_cast<VclBuilderContainer*>(m_aOwnedToplevel.get()))
7399 pOwnedToplevel->m_pUIBuilder = std::move(m_xBuilder);
7400 else
7401 m_xBuilder.reset();
7403}
7404
7405std::unique_ptr<weld::Builder>
7406SalInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile)
7407{
7408 SalInstanceWidget* pParentInstance = dynamic_cast<SalInstanceWidget*>(pParent);
7409 vcl::Window* pParentWidget = pParentInstance ? pParentInstance->getWidget() : nullptr;
7410 return std::make_unique<SalInstanceBuilder>(pParentWidget, rUIRoot, rUIFile);
7411}
7412
7413std::unique_ptr<weld::Builder> SalInstance::CreateInterimBuilder(vcl::Window* pParent,
7414 const OUString& rUIRoot,
7415 const OUString& rUIFile, bool,
7416 sal_uInt64)
7417{
7418 return std::make_unique<SalInstanceBuilder>(pParent, rUIRoot, rUIFile);
7419}
7420
7422{
7423 //show help for widget with keyboard focus
7425 if (!pWidget)
7426 pWidget = m_xWindow;
7428 pWidget = m_xWindow->GetFocusedWindow().get();
7429 OUString sHelpId = pWidget->GetHelpId();
7430 while (sHelpId.isEmpty())
7431 {
7432 pWidget = pWidget->GetParent();
7433 if (!pWidget)
7434 break;
7435 sHelpId = pWidget->GetHelpId();
7436 }
7437 std::unique_ptr<weld::Widget> xTemp(
7438 pWidget != m_xWindow ? new SalInstanceWidget(pWidget, m_pBuilder, false) : nullptr);
7439 weld::Widget* pSource = xTemp ? xTemp.get() : this;
7440 bool bRunNormalHelpRequest = !m_aHelpRequestHdl.IsSet() || m_aHelpRequestHdl.Call(*pSource);
7441 Help* pHelp = bRunNormalHelpRequest ? Application::GetHelp() : nullptr;
7442 if (!pHelp)
7443 return;
7444
7445 // tdf#126007, there's a nice fallback route for offline help where
7446 // the current page of a notebook will get checked when the help
7447 // button is pressed and there was no help for the dialog found.
7448 //
7449 // But for online help that route doesn't get taken, so bodge this here
7450 // by using the page help id if available and if the help button itself
7451 // was the original id
7452 if (m_pBuilder && sHelpId.endsWith("/help"))
7453 {
7454 OUString sPageId = m_pBuilder->get_current_page_help_id();
7455 if (!sPageId.isEmpty())
7456 sHelpId = sPageId;
7457 else
7458 {
7459 // tdf#129068 likewise the help for the wrapping dialog is less
7460 // helpful than the help for the content area could be
7461 vcl::Window* pContentArea = nullptr;
7462 if (::Dialog* pDialog = dynamic_cast<::Dialog*>(m_xWindow.get()))
7463 pContentArea = pDialog->get_content_area();
7464 if (pContentArea)
7465 {
7466 vcl::Window* pContentWidget = pContentArea->GetWindow(GetWindowType::LastChild);
7467 if (pContentWidget)
7468 sHelpId = pContentWidget->GetHelpId();
7469 }
7470 }
7471 }
7472 pHelp->Start(sHelpId, pSource);
7473}
7474
7475//iterate upwards through the hierarchy from this widgets through its parents
7476//calling func with their helpid until func returns true or we run out of parents
7477void SalInstanceWidget::help_hierarchy_foreach(const std::function<bool(const OUString&)>& func)
7478{
7479 vcl::Window* pParent = m_xWidget;
7480 while ((pParent = pParent->GetParent()))
7481 {
7482 if (func(pParent->GetHelpId()))
7483 return;
7484 }
7485}
7486
7488 VclMessageType eMessageType,
7489 VclButtonsType eButtonsType,
7490 const OUString& rPrimaryMessage)
7491{
7492 SalInstanceWidget* pParentInstance = dynamic_cast<SalInstanceWidget*>(pParent);
7493 SystemWindow* pParentWidget = pParentInstance ? pParentInstance->getSystemWindow() : nullptr;
7494 VclPtrInstance<MessageDialog> xMessageDialog(pParentWidget, rPrimaryMessage, eMessageType,
7495 eButtonsType);
7496 return new SalInstanceMessageDialog(xMessageDialog, nullptr, true);
7497}
7498
7499weld::Window* SalInstance::GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow)
7500{
7502 if (!pWrapper)
7503 return nullptr;
7504 VclPtr<vcl::Window> xWindow = pWrapper->GetWindow(rWindow);
7505 if (!xWindow)
7506 return nullptr;
7507 return xWindow->GetFrameWeld();
7508}
7509
7511{
7512 if (!m_xFrameWeld)
7513 {
7514 vcl::Window* pWindow = GetWindow();
7515 if (pWindow)
7516 {
7517 assert(pWindow == pWindow->GetFrameWindow());
7518 m_xFrameWeld.reset(new SalInstanceWindow(pWindow, nullptr, false));
7519 }
7520 }
7521 return m_xFrameWeld.get();
7522}
7523
7525 sal_Int32 nCursorIndex, int nOffset, int nChars)
7526{
7528
7529 if (nCursorIndex == -1)
7530 return aInvalid;
7531
7532 if (nOffset > 0)
7533 {
7534 while (nOffset && nCursorIndex < rSurroundingText.getLength())
7535 {
7536 rSurroundingText.iterateCodePoints(&nCursorIndex, 1);
7537 --nOffset;
7538 }
7539 }
7540 else if (nOffset < 0)
7541 {
7542 while (nOffset && nCursorIndex > 0)
7543 {
7544 rSurroundingText.iterateCodePoints(&nCursorIndex, -1);
7545 ++nOffset;
7546 }
7547 }
7548
7549 if (nOffset)
7550 {
7551 SAL_WARN("vcl",
7552 "SalFrame::CalcDeleteSurroundingSelection, unable to move to offset: " << nOffset);
7553 return aInvalid;
7554 }
7555
7556 sal_Int32 nCursorEndIndex(nCursorIndex);
7557 sal_Int32 nCount(0);
7558 while (nCount < nChars && nCursorEndIndex < rSurroundingText.getLength())
7559 {
7560 rSurroundingText.iterateCodePoints(&nCursorEndIndex, 1);
7561 ++nCount;
7562 }
7563
7564 if (nCount != nChars)
7565 {
7566 SAL_WARN("vcl", "SalFrame::CalcDeleteSurroundingSelection, unable to select: "
7567 << nChars << " characters");
7568 return aInvalid;
7569 }
7570
7571 return Selection(nCursorIndex, nCursorEndIndex);
7572}
7573
7574/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Image > m_xWidget
css::uno::Reference< css::lang::XComponent > m_xFrame
Reference< XExecutableDialog > m_xDialog
AnyEventRef aEvent
sal_uInt16 nPageId
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static bool IsOnSystemEventLoop()
Returns true, if the VCL plugin runs on the system event loop.
Definition: svapp.cxx:374
static OutputDevice * GetDefaultDevice()
Get the default "device" (in this case the default window).
Definition: svapp.cxx:1043
static const AllSettings & GetSettings()
Gets the application's settings.
Definition: svapp.cxx:638
static void RemoveKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Remove a keypress listener from the application.
Definition: svapp.cxx:716
static Help * GetHelp()
Gets the application's help.
Definition: svapp.cxx:1352
static void AddKeyListener(const Link< VclWindowEvent &, bool > &rKeyListener)
Add a keypress listener to the application.
Definition: svapp.cxx:710
void SetToggleHdl(const Link< CheckBox &, void > &rLink)
Definition: button.hxx:367
void EnableTriState(bool bTriState=true)
Definition: button.cxx:3615
void Check(bool bCheck=true)
Definition: button.hxx:349
void SetState(TriState eState)
Definition: button.cxx:3593
TriState GetState() const
Definition: button.hxx:347
bool IsChecked() const
Definition: button.hxx:354
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:39
sal_Int32 InsertEntryWithImage(const OUString &rStr, const Image &rImage, sal_Int32 nPos=COMBOBOX_APPEND)
Definition: combobox.cxx:902
void SetEntryActivateHdl(const Link< Edit &, bool > &rLink)
Definition: combobox.cxx:989
virtual void SetText(const OUString &rStr) override
Definition: combobox.cxx:805
void RemoveEntryAt(sal_Int32 nPos)
Definition: combobox.cxx:923
bool IsTravelSelect() const
Definition: combobox.cxx:970
void SetMaxMRUCount(sal_Int32 n)
Definition: combobox.cxx:1298
OUString GetMRUEntries() const
Definition: combobox.cxx:1293
void SetUserDrawHdl(const Link< UserDrawEvent *, void > &rLink)
Definition: combobox.cxx:1258
void SetEntryData(sal_Int32 nPos, void *pNewData)
Definition: combobox.cxx:1313
void SetUserItemSize(const Size &rSz)
Definition: combobox.cxx:1263
void EnableAutocomplete(bool bEnable, bool bMatchCase=false)
Definition: combobox.cxx:264
sal_Int32 GetEntryCount() const
Definition: combobox.cxx:963
sal_uInt16 GetDropDownLineCount() const
Definition: combobox.cxx:549
void SetWidthInChars(sal_Int32 nWidthInChars)
Definition: combobox.cxx:1534
void EnableUserDraw(bool bUserDraw)
Definition: combobox.cxx:1268
void AddSeparator(sal_Int32 n)
Adds a new separator at the given position n.
Definition: combobox.cxx:1283
void SetDropDownLineCount(sal_uInt16 nLines)
Definition: combobox.cxx:533
void SetSelectHdl(const Link< ComboBox &, void > &rLink)
Definition: combobox.cxx:987
bool IsUserDrawEnabled() const
Definition: combobox.cxx:1273
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=COMBOBOX_APPEND)
Definition: combobox.cxx:882
tools::Long GetDropDownEntryHeight() const
Definition: combobox.cxx:1129
bool IsModifyByKeyboard() const
Definition: combobox.cxx:452
void SetMRUEntries(std::u16string_view rEntries)
Definition: combobox.cxx:1288
sal_Int32 GetMaxMRUCount() const
Definition: combobox.cxx:1303
Definition: ctrl.hxx:80
void SetLoseFocusHdl(const Link< Control &, void > &rLink)
Definition: ctrl.hxx:212
virtual void SetText(const OUString &rStr) override
Definition: ctrl.cxx:98
@ NoParent
No Parent.
bool IsInPopupMode(const vcl::Window *pWin)
Definition: dockmgr.cxx:358
void EndPopupMode(const vcl::Window *pWin)
Definition: dockmgr.cxx:364
void SetPosSizePixel(vcl::Window const *pWin, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
Definition: dockmgr.cxx:411
tools::Rectangle GetPosSizePixel(const vcl::Window *pWin)
Definition: dockmgr.cxx:420
void StartPopupMode(const vcl::Window *pWin, const tools::Rectangle &rRect, FloatWinPopupFlags nPopupModeFlags)
Definition: dockmgr.cxx:337
void SetPopupModeEndHdl(const vcl::Window *pWindow, const Link< FloatingWindow *, void > &rLink)
Definition: dockmgr.cxx:379
Definition: edit.hxx:56
void SetTextFilter(TextFilter *pFilter)
Definition: edit.hxx:238
virtual void Copy()
Definition: edit.cxx:2522
void SetPlaceholderText(const OUString &rStr)
Definition: edit.cxx:2582
virtual const Selection & GetSelection() const
Definition: edit.cxx:2474
virtual void Cut()
Definition: edit.cxx:2513
virtual void SetMaxTextLen(sal_Int32 nMaxLen)
Definition: edit.cxx:2387
void SetActivateHdl(const Link< Edit &, bool > &rLink)
Definition: edit.hxx:214
Edit * GetSubEdit() const
Definition: edit.hxx:217
virtual void SetSelection(const Selection &rSelection)
Definition: edit.cxx:2400
void SetAutocompleteHdl(const Link< Edit &, void > &rLink)
Definition: edit.hxx:219
virtual void SetModifyHdl(const Link< Edit &, void > &rLink)
Definition: edit.hxx:211
virtual void SetReadOnly(bool bReadOnly=true)
Definition: edit.cxx:2355
void SetForceControlBackground(bool b)
Definition: edit.hxx:242
virtual void Paste()
Definition: edit.cxx:2531
virtual OUString GetText() const override
Definition: edit.cxx:2570
void SetImage(const Image &rImage)
Definition: fixed.cxx:946
void set_mnemonic_widget(vcl::Window *pWindow)
Definition: fixed.cxx:406
Formatter & GetFormatter()
Definition: fmtfield.cxx:1311
void SetFormatter(Formatter *pFormatter)
Definition: fmtfield.cxx:1321
void SetValue(double dVal)
Definition: fmtfield.cxx:861
void SetDecimalDigits(sal_uInt16 _nPrecision)
Definition: fmtfield.cxx:600
void SetThousandsSep(bool _bUseSeparator)
Definition: fmtfield.cxx:559
double GetSpinSize() const
Definition: formatter.hxx:228
sal_uInt16 GetDecimalDigits() const
Definition: fmtfield.cxx:588
double GetMinValue() const
Definition: formatter.hxx:166
void SetOutputHdl(const Link< LinkParamNone *, bool > &rLink)
Definition: formatter.hxx:240
void SetInputHdl(const Link< sal_Int64 *, TriState > &rLink)
Definition: formatter.hxx:239
double GetMaxValue() const
Definition: formatter.hxx:171
virtual void SetMaxValue(double dMax)
Definition: fmtfield.cxx:714
virtual void SetMinValue(double dMin)
Definition: fmtfield.cxx:704
virtual void SetSpinSize(double dStep)
Definition: formatter.hxx:227
double GetValue()
Definition: fmtfield.cxx:866
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: headbar.cxx:1141
HeaderBarItemBits GetItemBits(sal_uInt16 nItemId) const
Definition: headbar.cxx:1206
void SetItemBits(sal_uInt16 nItemId, HeaderBarItemBits nNewBits)
Definition: headbar.cxx:1192
Definition: help.hxx:61
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
Definition: help.cxx:58
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: idle.cxx:34
Definition: image.hxx:40
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
void SetEditedEntryHdl(const Link< std::pair< SvTreeListEntry *, OUString >, bool > &rLink)
Definition: treeglue.hxx:35
void SetEditingEntryHdl(const Link< SvTreeListEntry *, bool > &rLink)
Definition: treeglue.hxx:30
void SetEndDragHdl(const Link< SvTreeListBox *, void > &rLink)
Definition: treeglue.hxx:69
SvTreeListEntry * GetTargetAtPoint(const Point &rPos, bool bHighLightTarget, bool bScroll=true)
Definition: treeglue.hxx:124
void SetEditedEntryHdl(const Link< std::pair< SvTreeListEntry *, OUString >, bool > &rLink)
Definition: treeglue.hxx:74
void SetEditingEntryHdl(const Link< SvTreeListEntry *, bool > &rLink)
Definition: treeglue.hxx:70
void SetStartDragHdl(const Link< SvTreeListBox *, bool > &rLink)
Definition: treeglue.hxx:68
void SetModelChangedHdl(const Link< SvTreeListBox *, void > &rLink)
Definition: treeglue.hxx:67
A widget used to choose from a list of items and which has no entry.
Definition: lstbox.hxx:83
sal_Int32 GetEntryCount() const
Definition: listbox.cxx:988
void RemoveEntry(sal_Int32 nPos)
Definition: listbox.cxx:958
void AddSeparator(sal_Int32 n)
Adds a new separator at the given position n.
Definition: listbox.cxx:1366
void SetEntryData(sal_Int32 nPos, void *pNewData)
Definition: listbox.cxx:1081
void SetSelectHdl(const Link< ListBox &, void > &rLink)
Definition: lstbox.hxx:220
OUString GetSelectedEntry(sal_Int32 nSelIndex=0) const
Definition: listbox.cxx:995
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=LISTBOX_APPEND)
Definition: listbox.cxx:942
void SetScaleY(const Fraction &rScaleY)
Definition: mapmod.cxx:150
const Fraction & GetScaleX() const
Definition: mapmod.cxx:185
MapUnit GetMapUnit() const
Definition: mapmod.cxx:181
void SetMapUnit(MapUnit eUnit)
Definition: mapmod.cxx:133
const Fraction & GetScaleY() const
Definition: mapmod.cxx:187
void SetScaleX(const Fraction &rScaleX)
Definition: mapmod.cxx:144
Definition: menu.hxx:116
bool IsItemChecked(sal_uInt16 nItemId) const
Definition: menu.cxx:908
void SetItemImage(sal_uInt16 nItemId, const Image &rImage)
Definition: menu.cxx:1028
void ShowItem(sal_uInt16 nItemId, bool bVisible=true)
Definition: menu.cxx:964
void SetMenuFlags(MenuFlags nFlags)
Definition: menu.hxx:252
void InsertSeparator(const OUString &rIdent={}, sal_uInt16 nPos=MENU_APPEND)
Definition: menu.cxx:472
void SetItemText(sal_uInt16 nItemId, const OUString &rStr)
Definition: menu.cxx:986
OUString GetItemText(sal_uInt16 nItemId) const
Definition: menu.cxx:1017
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:334
void SetHelpId(sal_uInt16 nItemId, const OUString &rHelpId)
Definition: menu.cxx:1148
OUString const & GetCurItemIdent() const
Definition: menu.hxx:263
void Clear()
Definition: menu.cxx:571
void CheckItem(sal_uInt16 nItemId, bool bCheck=true)
Definition: menu.cxx:838
sal_uInt16 GetItemId(sal_uInt16 nPos) const
Definition: menu.cxx:641
bool IsItemEnabled(sal_uInt16 nItemId) const
Definition: menu.cxx:953
OUString GetItemIdent(sal_uInt16 nItemId) const
Definition: menu.cxx:683
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
Definition: menu.cxx:919
void RemoveItem(sal_uInt16 nPos)
Definition: menu.cxx:496
void InsertItem(sal_uInt16 nItemId, const OUString &rStr, MenuItemBits nItemBits=MenuItemBits::NONE, const OUString &rIdent={}, sal_uInt16 nPos=MENU_APPEND)
Definition: menu.cxx:432
sal_uInt16 GetItemPos(sal_uInt16 nItemId) const
Definition: menu.cxx:662
sal_uInt16 GetItemCount() const
Definition: menu.cxx:577
MouseEventModifiers GetMode() const
Definition: event.hxx:124
sal_uInt16 GetModifier() const
Definition: event.hxx:156
sal_uInt16 GetClicks() const
Definition: event.hxx:126
sal_uInt16 GetButtons() const
Definition: event.hxx:147
const Point & GetPosPixel() const
Definition: event.hxx:123
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
Size GetOutputSize() const
Definition: outdev.hxx:327
tools::Long GetOutOffYPixel() const
Definition: outdev.hxx:319
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
Definition: bitmapex.cxx:33
tools::Long GetOutputWidthPixel() const
Definition: outdev.hxx:316
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
Definition: map.cxx:1110
Size GetOutputSizePixel() const
Definition: outdev.hxx:314
const Wallpaper & GetBackground() const
Definition: outdev.hxx:523
void SetMapMode()
Definition: map.cxx:597
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:417
virtual bool HasMirroredGraphics() const
Definition: outdev.cxx:703
const MapMode & GetMapMode() const
Definition: outdev.hxx:1557
void Erase()
Definition: wallpaper.cxx:96
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
Definition: stack.cxx:32
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
void SetBackground()
Definition: background.cxx:27
void Pop()
Definition: stack.cxx:91
OutDevType GetOutDevType() const
Definition: outdev.hxx:406
tools::Long GetOutOffXPixel() const
Definition: outdev.hxx:318
BitmapEx GetBitmapEx(const Point &rSrcPt, const Size &rSize) const
Query extended bitmap (with alpha channel, if available).
Definition: bitmapex.cxx:149
constexpr tools::Long Y() const
constexpr tools::Long X() const
sal_uInt16 Execute(vcl::Window *pWindow, const Point &rPopupPos)
Definition: menu.cxx:2771
static PopupMenu * GetActivePopupMenu()
Definition: menu.cxx:2722
void DropScaledCache()
Definition: salvtables.cxx:186
virtual ~SalBitmap()
Definition: salvtables.cxx:198
bool m_bOrigControlBackground
Definition: salvtables.cxx:247
VclPtr< vcl::Window > m_xWidget
Definition: salvtables.cxx:243
SalFlashAttention(VclPtr< vcl::Window > xWidget)
Definition: salvtables.cxx:284
Wallpaper m_aOrigBackground
Definition: salvtables.cxx:246
Color m_aOrigControlBackground
Definition: salvtables.cxx:245
DECL_LINK(FlashTimeout, Timer *, void)
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
virtual void Flush()=0
VclPtr< vcl::Window > m_pWindow
Definition: salframe.hxx:118
virtual weld::Window * GetFrameWeld() const
virtual ~SalFrame() override
Definition: salvtables.cxx:95
static OUString DumpSetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags)
Definition: salvtables.cxx:112
SALFRAMEPROC m_pProc
Definition: salframe.hxx:119
virtual void SetModal(bool)
Definition: salframe.hxx:257
void SetCallback(vcl::Window *pWindow, SALFRAMEPROC pProc)
Definition: salvtables.cxx:97
vcl::Window * GetWindow() const
Definition: salframe.hxx:297
std::unique_ptr< weld::Window > m_xFrameWeld
Definition: salframe.hxx:122
virtual void SetRepresentedURL(const OUString &)
Definition: salvtables.cxx:107
static Selection CalcDeleteSurroundingSelection(const OUString &rSurroundingText, sal_Int32 nCursorIndex, int nOffset, int nChars)
virtual bool GetModal() const
Definition: salframe.hxx:261
virtual ~SalInfoPrinter()
Definition: salvtables.cxx:210
virtual OUString get_page_title(const OUString &rIdent) const override
int find_id(int nId) const
VclPtr< vcl::RoadmapWizard > m_xWizard
Definition: salvtables.hxx:561
virtual void set_page_side_image(const OUString &rImage) override
virtual OUString get_page_ident(int nPage) const override
virtual ~SalInstanceAssistant() override
virtual OUString get_current_page_ident() const override
virtual weld::Container * append_page(const OUString &rIdent) override
virtual void set_current_page(int nPage) override
virtual void set_page_sensitive(const OUString &rIdent, bool bSensitive) override
std::vector< VclPtr< TabPage > > m_aAddedPages
Definition: salvtables.hxx:565
std::vector< std::unique_ptr< SalInstanceContainer > > m_aPages
Definition: salvtables.hxx:564
virtual void set_page_index(const OUString &rIdent, int nNewIndex) override
int find_page(std::u16string_view rIdent) const
std::vector< int > m_aIds
Definition: salvtables.hxx:566
virtual void set_page_side_help_id(const OUString &rHelpId) override
std::vector< VclPtr< VclGrid > > m_aAddedGrids
Definition: salvtables.hxx:567
virtual void set_page_title(const OUString &rIdent, const OUString &rTitle) override
weld::Button * weld_widget_for_response(int nResponse) override
SalInstanceAssistant(vcl::RoadmapWizard *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual int get_n_pages() const override
virtual int get_current_page() const override
virtual void reorder_child(weld::Widget *pWidget, int nNewPosition) override
SalInstanceBox(VclBox *pContainer, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
VclPtr< VclBox > m_xBox
virtual void sort_native_button_order() override
virtual std::unique_ptr< weld::Dialog > weld_dialog(const OUString &id) override
virtual std::unique_ptr< weld::Image > weld_image(const OUString &id) override
virtual std::unique_ptr< weld::Toolbar > weld_toolbar(const OUString &id) override
virtual std::unique_ptr< weld::RadioButton > weld_radio_button(const OUString &id) override
virtual std::unique_ptr< weld::Popover > weld_popover(const OUString &id) override
virtual std::unique_ptr< weld::Expander > weld_expander(const OUString &id) override
virtual std::unique_ptr< weld::Scale > weld_scale(const OUString &id) override
virtual std::unique_ptr< weld::Paned > weld_paned(const OUString &id) override
virtual std::unique_ptr< weld::MetricSpinButton > weld_metric_spin_button(const OUString &id, FieldUnit eUnit) override
virtual std::unique_ptr< weld::ProgressBar > weld_progress_bar(const OUString &id) override
virtual std::unique_ptr< weld::Assistant > weld_assistant(const OUString &id) override
virtual std::unique_ptr< weld::LinkButton > weld_link_button(const OUString &id) override
virtual std::unique_ptr< weld::Widget > weld_widget(const OUString &id) override
SalInstanceBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, const css::uno::Reference< css::frame::XFrame > &rFrame=css::uno::Reference< css::frame::XFrame >())
virtual std::unique_ptr< weld::Container > weld_container(const OUString &id) override
virtual std::unique_ptr< weld::Button > weld_button(const OUString &id) override
virtual std::unique_ptr< weld::ToggleButton > weld_toggle_button(const OUString &id) override
virtual std::unique_ptr< weld::DrawingArea > weld_drawing_area(const OUString &id, const a11yref &rA11yImpl=nullptr, FactoryFunction pUITestFactoryFunction=nullptr, void *pUserData=nullptr) override
virtual std::unique_ptr< weld::MenuToggleButton > weld_menu_toggle_button(const OUString &id) override
virtual std::unique_ptr< weld::Scrollbar > weld_scrollbar(const OUString &id) override
virtual std::unique_ptr< weld::ScrolledWindow > weld_scrolled_window(const OUString &id, bool bUserManagedScrolling=false) override
virtual std::unique_ptr< weld::TreeView > weld_tree_view(const OUString &id) override
virtual ~SalInstanceBuilder() override
virtual std::unique_ptr< weld::Label > weld_label(const OUString &id) override
OUString get_current_page_help_id() const
virtual std::unique_ptr< weld::FormattedSpinButton > weld_formatted_spin_button(const OUString &id) override
VclPtr< vcl::Window > m_aOwnedToplevel
Definition: salvtables.hxx:44
virtual std::unique_ptr< weld::Frame > weld_frame(const OUString &id) override
virtual std::unique_ptr< weld::TextView > weld_text_view(const OUString &id) override
virtual std::unique_ptr< weld::EntryTreeView > weld_entry_tree_view(const OUString &containerid, const OUString &entryid, const OUString &treeviewid) override
virtual std::unique_ptr< weld::IconView > weld_icon_view(const OUString &id) override
virtual std::unique_ptr< weld::SpinButton > weld_spin_button(const OUString &id) override
virtual std::unique_ptr< weld::CheckButton > weld_check_button(const OUString &id) override
virtual std::unique_ptr< weld::Spinner > weld_spinner(const OUString &id) override
virtual std::unique_ptr< weld::Notebook > weld_notebook(const OUString &id) override
virtual std::unique_ptr< weld::Entry > weld_entry(const OUString &id) override
std::unique_ptr< VclBuilder > m_xBuilder
Definition: salvtables.hxx:43
virtual std::unique_ptr< weld::SizeGroup > create_size_group() override
virtual std::unique_ptr< weld::Calendar > weld_calendar(const OUString &id) override
virtual std::unique_ptr< weld::Menu > weld_menu(const OUString &id) override
virtual std::unique_ptr< weld::MessageDialog > weld_message_dialog(const OUString &id) override
virtual std::unique_ptr< weld::Window > create_screenshot_window() override
virtual std::unique_ptr< weld::MenuButton > weld_menu_button(const OUString &id) override
virtual std::unique_ptr< weld::ComboBox > weld_combo_box(const OUString &id) override
virtual std::unique_ptr< weld::Box > weld_box(const OUString &id) override
virtual void set_custom_button(VirtualDevice *pDevice) override
virtual void set_label(const OUString &rText) override
virtual void set_image(VirtualDevice *pDevice) override
virtual OUString get_label() const override
virtual void set_font(const vcl::Font &rFont) override
virtual ~SalInstanceButton() override
virtual void set_from_icon_name(const OUString &rIconName) override
SalInstanceButton(::Button *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
VclPtr<::Button > m_xButton
virtual void set_inconsistent(bool inconsistent) override
virtual bool get_active() const override
virtual void set_active(bool active) override
SalInstanceCheckButton(CheckBox *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_label_wrap(bool wrap) override
virtual ~SalInstanceCheckButton() override
virtual bool get_inconsistent() const override
VclPtr< CheckBox > m_xCheckButton
virtual void insert_separator(int pos, const OUString &) override
virtual void set_entry_placeholder_text(const OUString &rText) override
virtual bool has_entry() const override
virtual void set_mru_entries(const OUString &rEntries) override
virtual bool changed_by_direct_pick() const override
virtual void set_entry_completion(bool bEnable, bool bCaseSensitive=false) override
virtual void set_entry_editable(bool bEditable) override
virtual void cut_entry_clipboard() override
virtual void set_entry_width_chars(int nChars) override
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
virtual void set_entry_message_type(weld::EntryMessageType eType) override
virtual void call_attention_to() override
virtual void set_entry_max_length(int nChars) override
virtual void copy_entry_clipboard() override
virtual OUString get_mru_entries() const override
virtual vcl::Font get_entry_font() override
SalInstanceComboBoxWithEdit(::ComboBox *pComboBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual ~SalInstanceComboBoxWithEdit() override
virtual void HandleEventListener(VclWindowEvent &rEvent) override
virtual bool get_entry_selection_bounds(int &rStartPos, int &rEndPos) override
virtual void set_custom_renderer(bool bOn) override
virtual void paste_entry_clipboard() override
virtual void remove(int pos) override
virtual OUString get_active_text() const override
virtual void set_entry_text(const OUString &rText) override
virtual int get_max_mru_count() const override
virtual void set_font(const vcl::Font &rFont) override
virtual void set_entry_font(const vcl::Font &rFont) override
virtual void select_entry_region(int nStartPos, int nEndPos) override
virtual void set_max_mru_count(int nCount) override
virtual void copy_entry_clipboard() override
virtual void set_max_mru_count(int) override
virtual void select_entry_region(int, int) override
virtual vcl::Font get_entry_font() override
virtual void remove(int pos) override
virtual void set_mru_entries(const OUString &) override
virtual void set_entry_completion(bool, bool bCaseSensitive=false) override
virtual void insert_separator(int pos, const OUString &) override
virtual void set_entry_placeholder_text(const OUString &) override
virtual bool changed_by_direct_pick() const override
virtual int get_max_mru_count() const override
virtual void set_entry_editable(bool bEditable) override
virtual void insert(int pos, const OUString &rStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface) override
virtual void set_entry_message_type(weld::EntryMessageType) override
virtual OUString get_active_text() const override
virtual void paste_entry_clipboard() override
virtual void set_entry_text(const OUString &) override
virtual void set_entry_font(const vcl::Font &) override
SalInstanceComboBoxWithoutEdit(ListBox *pListBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_font(const vcl::Font &rFont) override
virtual OUString get_mru_entries() const override
virtual bool get_entry_selection_bounds(int &, int &) override
virtual ~SalInstanceComboBoxWithoutEdit() override
virtual void HandleEventListener(VclWindowEvent &rEvent) override
virtual void set_custom_renderer(bool bOn) override
virtual void cut_entry_clipboard() override
virtual void set_entry_width_chars(int) override
virtual void set_entry_max_length(int) override
virtual bool has_entry() const override
std::vector< std::shared_ptr< OUString > > m_aUserData
Definition: salvtables.hxx:730
void CallHandleEventListener(VclWindowEvent &rEvent)
Definition: salvtables.hxx:922
VclPtr< ListBox > m_xComboBox
Definition: salvtables.hxx:731
virtual void connect_container_focus_changed(const Link< Container &, void > &rLink) override
virtual void child_grab_focus() override
virtual void HandleEventListener(VclWindowEvent &rEvent) override
SalInstanceContainer(vcl::Window *pContainer, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void move(weld::Widget *pWidget, weld::Container *pNewParent) override
VclPtr< vcl::Window > m_xContainer
Definition: salvtables.hxx:431
virtual css::uno::Reference< css::awt::XWindow > CreateChildFrame() override
virtual bool runAsync(std::shared_ptr< weld::DialogController > aOwner, const std::function< void(sal_Int32)> &rEndDialogFn) override
virtual void SetInstallLOKNotifierHdl(const Link< void *, vcl::ILibreOfficeKitNotifier * > &rLink) override
tools::Long m_nOldEditWidthReq
Definition: salvtables.hxx:519
virtual void collapse(weld::Widget *pEdit, weld::Widget *pButton) override
virtual void set_default_response(int nResponse) override
virtual bool get_modal() const override
virtual weld::Button * weld_widget_for_response(int nResponse) override
virtual void response(int nResponse) override
SalInstanceDialog(::Dialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
VclPtr<::Dialog > m_xDialog
Definition: salvtables.hxx:513
VclPtr< vcl::Window > m_xRefEdit
Definition: salvtables.hxx:517
virtual void add_button(const OUString &rText, int nResponse, const OUString &rHelpId={}) override
virtual weld::Container * weld_content_area() override
virtual void set_modal(bool bModal) override
sal_Int32 m_nOldBorderWidth
Definition: salvtables.hxx:520
virtual void undo_collapse() override
virtual int run() override
std::vector< VclPtr< vcl::Window > > m_aHiddenWidgets
Definition: salvtables.hxx:518
SalInstanceDrawingArea(VclDrawingArea *pDrawingArea, SalInstanceBuilder *pBuilder, const a11yref &rAlly, FactoryFunction pUITestFactoryFunction, void *pUserData, bool bTakeOwnership)
virtual void dblclick(const Point &rPos) override
virtual void HandleEventListener(VclWindowEvent &rEvent) override
virtual bool HandleKeyEventListener(VclWindowEvent &) override
virtual a11yrelationset get_accessible_relation_set() override
virtual void mouse_up(const Point &rPos) override
virtual void enable_drag_source(rtl::Reference< TransferDataContainer > &rHelper, sal_uInt8 eDNDConstants) override
virtual ~SalInstanceDrawingArea() override
virtual void click(const Point &rPos) override
virtual OutputDevice & get_ref_device() override
virtual void connect_key_release(const Link< const KeyEvent &, bool > &rLink) override
virtual Point get_pointer_position() const override
virtual void HandleMouseEventListener(VclWindowEvent &rEvent) override
virtual void mouse_down(const Point &rPos) override
virtual void mouse_move(const Point &rPos) override
virtual void queue_draw_area(int x, int y, int width, int height) override
virtual void connect_size_allocate(const Link< const Size &, void > &rLink) override
virtual Point get_accessible_location_on_screen() override
virtual void queue_draw() override
virtual void set_input_context(const InputContext &rInputContext) override
virtual void im_context_set_cursor_location(const tools::Rectangle &rCursorRect, int nExtTextInputWidth) override
virtual void set_cursor(PointerStyle ePointerStyle) override
VclPtr< VclDrawingArea > m_xDrawingArea
virtual void connect_key_press(const Link< const KeyEvent &, bool > &rLink) override
virtual a11yref get_accessible_parent() override
virtual void connect_style_updated(const Link< Widget &, void > &rLink) override
virtual int get_max_mru_count() const override
virtual bool changed_by_direct_pick() const override
virtual void set_item_menu(const OUString &, weld::Menu *) override
virtual vcl::Font get_entry_font() override
virtual ~SalInstanceEntryTreeView() override
VclPtr< VirtualDevice > create_render_virtual_device() const override
int get_menu_button_width() const override
virtual void paste_entry_clipboard() override
SalInstanceEntryTreeView(vcl::Window *pContainer, SalInstanceBuilder *pBuilder, bool bTakeOwnership, std::unique_ptr< weld::Entry > xEntry, std::unique_ptr< weld::TreeView > xTreeView)
virtual void set_entry_completion(bool bEnable, bool) override
virtual void set_font(const vcl::Font &) override
virtual void insert_separator(int, const OUString &) override
DECL_LINK(AutocompleteHdl, Edit &, void)
virtual void copy_entry_clipboard() override
virtual void connect_focus_out(const Link< Widget &, void > &rLink) override
virtual OUString get_mru_entries() const override
virtual void set_custom_renderer(bool) override
virtual void connect_focus_in(const Link< Widget &, void > &rLink) override
virtual void set_max_mru_count(int) override
SalInstanceTreeView * m_pTreeView
virtual void set_mru_entries(const OUString &) override
virtual void make_sorted() override
virtual void set_entry_font(const vcl::Font &rFont) override
DECL_LINK(KeyPressListener, VclWindowEvent &, void)
virtual void set_entry_editable(bool bEditable) override
SalInstanceEntry * m_pEntry
virtual void set_entry_placeholder_text(const OUString &rText) override
virtual void grab_focus() override
virtual void cut_entry_clipboard() override
virtual void set_editable(bool bEditable) override
virtual void set_font(const vcl::Font &rFont) override
virtual void connect_cursor_position(const Link< Entry &, void > &rLink) override
WeldTextFilter m_aTextFilter
Definition: salvtables.hxx:617
SalInstanceEntry(::Edit *pEntry, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
bool get_selection_bounds(int &rStartPos, int &rEndPos) override
virtual bool get_overwrite_mode() const override
void fire_signal_changed()
virtual bool get_editable() const override
virtual void cut_clipboard() override
virtual void copy_clipboard() override
virtual void set_alignment(TxtAlign eXAlign) override
VclPtr<::Edit > m_xEntry
Definition: salvtables.hxx:611
virtual void paste_clipboard() override
virtual OUString get_text() const override
virtual int get_width_chars() const override
virtual void set_position(int nCursorPos) override
virtual void set_placeholder_text(const OUString &rText) override
virtual void set_text(const OUString &rText) override
virtual ~SalInstanceEntry() override
virtual int get_position() const override
virtual void set_max_length(int nChars) override
virtual void set_width_chars(int nChars) override
virtual void replace_selection(const OUString &rText) override
virtual void select_region(int nStartPos, int nEndPos) override
virtual void set_message_type(weld::EntryMessageType eType) override
virtual void set_font_color(const Color &rColor) override
virtual void set_overwrite_mode(bool bOn) override
virtual void grab_focus() override
SalInstanceExpander(VclExpander *pExpander, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_expanded(bool bExpand) override
virtual OUString get_label() const override
virtual bool get_expanded() const override
VclPtr< VclExpander > m_xExpander
virtual ~SalInstanceExpander() override
virtual void set_label(const OUString &rText) override
virtual bool has_focus() const override
Link< weld::Widget &, void > m_aLoseFocusHdl
virtual void set_text(const OUString &rText) override
virtual void connect_changed(const Link< weld::Entry &, void > &rLink) override
weld::EntryFormatter * m_pFormatter
virtual Formatter & GetFormatter() override
SalInstanceFormattedSpinButton(FormattedField *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void connect_focus_out(const Link< weld::Widget &, void > &rLink) override
virtual ~SalInstanceFormattedSpinButton() override
VclPtr< FormattedField > m_xButton
virtual void SetFormatter(weld::EntryFormatter *pFormatter) override
virtual void set_label(const OUString &rText) override
virtual std::unique_ptr< weld::Label > weld_label_widget() const override
SalInstanceFrame(VclFrame *pFrame, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual OUString get_label() const override
VclPtr< VclFrame > m_xFrame
virtual int count_selected_items() const override
virtual OUString get_selected_text() const override
virtual void unselect(int pos) override
virtual void selected_foreach(const std::function< bool(weld::TreeIter &)> &func) override
VclPtr<::IconView > m_xIconView
virtual int n_children() const override
virtual OUString get_selected_id() const override
virtual OUString get_id(const weld::TreeIter &rIter) const override
virtual void connect_get_property_tree_elem(const Link< const weld::json_prop_query &, bool > &rLink) override
virtual void select(int pos) override
virtual void set_cursor(const weld::TreeIter &rIter) override
virtual bool get_iter_first(weld::TreeIter &rIter) const override
virtual ~SalInstanceIconView() override
std::vector< std::unique_ptr< OUString > > m_aUserData
virtual void set_item_width(int width) override
virtual void clear() override
virtual std::unique_ptr< weld::TreeIter > make_iterator(const weld::TreeIter *pOrig=nullptr) const override
virtual void freeze() override
virtual void thaw() override
virtual OUString get_text(const weld::TreeIter &rIter) const override
virtual int get_item_width() const override
virtual void scroll_to_item(const weld::TreeIter &rIter) override
virtual void connect_query_tooltip(const Link< const weld::TreeIter &, OUString > &rLink) override
virtual void insert_separator(int pos, const OUString *pId) override
virtual bool get_selected(weld::TreeIter *pIter) const override
SalInstanceIconView(::IconView *pIconView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual bool get_cursor(weld::TreeIter *pIter) const override
virtual void insert(int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, weld::TreeIter *pRet) override
VclPtr< FixedImage > m_xImage
virtual void set_from_icon_name(const OUString &rIconName) override
SalInstanceImage(FixedImage *pImage, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_image(VirtualDevice *pDevice) override
VclPtr< Control > m_xLabel
Definition: salvtables.hxx:411
virtual void set_mnemonic_widget(Widget *pTarget) override
SalInstanceLabel(Control *pLabel, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void set_font_color(const Color &rColor) override
virtual void set_label_type(weld::LabelType eType) override
virtual void set_font(const vcl::Font &rFont) override
virtual void set_label(const OUString &rText) override
virtual OUString get_label() const override
VclPtr< FixedHyperlink > m_xButton
virtual void set_label_wrap(bool wrap) override
virtual bool get_inconsistent() const override
virtual void set_item_active(const OUString &rIdent, bool bActive) override
virtual void set_item_sensitive(const OUString &rIdent, bool bSensitive) override
virtual bool get_active() const override
virtual void clear() override
virtual void set_popover(weld::Widget *pPopover) override
SalInstanceMenuButton(::MenuButton *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual ~SalInstanceMenuButton() override
virtual void set_active(bool active) override
virtual void remove_item(const OUString &rId) override
virtual OUString get_item_label(const OUString &rIdent) const override
virtual void set_item_label(const OUString &rIdent, const OUString &rText) override
virtual void insert_item(int pos, const OUString &rId, const OUString &rStr, const OUString *pIconName, VirtualDevice *pImageSurface, TriState eCheckRadioFalse) override
virtual void set_inconsistent(bool) override
virtual void set_item_visible(const OUString &rIdent, bool bShow) override
VclPtr<::MenuButton > m_xMenuButton
virtual void insert_separator(int pos, const OUString &rId) override
virtual bool get_sensitive(const OUString &rIdent) const override
Definition: salvtables.cxx:925
virtual int n_children() const override
Definition: salvtables.cxx:974
virtual void set_active(const OUString &rIdent, bool bActive) override
Definition: salvtables.cxx:929
sal_uInt16 m_nLastId
Definition: salvtables.hxx:151
virtual bool get_active(const OUString &rIdent) const override
Definition: salvtables.cxx:933
virtual void clear() override
Definition: salvtables.cxx:949
virtual void set_visible(const OUString &rIdent, bool bShow) override
Definition: salvtables.cxx:945
virtual void set_item_help_id(const OUString &rIdent, const OUString &rHelpId) override
Definition: salvtables.cxx:965
VclPtr< PopupMenu > m_xMenu
Definition: salvtables.hxx:148
SalInstanceMenu(PopupMenu *pMenu, bool bTakeOwnership)
Definition: salvtables.cxx:900
virtual OUString popup_at_rect(weld::Widget *pParent, const tools::Rectangle &rRect, weld::Placement ePlace=weld::Placement::Under) override
Definition: salvtables.cxx:908
virtual void set_label(const OUString &rIdent, const OUString &rLabel) override
Definition: salvtables.cxx:937
virtual OUString get_label(const OUString &rIdent) const override
Definition: salvtables.cxx:941
virtual void insert_separator(int pos, const OUString &rId) override
Definition: salvtables.cxx:958
virtual void remove(const OUString &rId) override
Definition: salvtables.cxx:970
virtual ~SalInstanceMenu() override
Definition: salvtables.cxx:980
PopupMenu * getMenu() const
Definition: salvtables.cxx:979
virtual OUString get_id(int pos) const override
Definition: salvtables.cxx:975
virtual void set_sensitive(const OUString &rIdent, bool bSensitive) override
Definition: salvtables.cxx:921
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) override
Definition: salvtables.cxx:950
virtual OUString get_secondary_text() const override
virtual weld::Container * weld_message_area() override
virtual void set_secondary_text(const OUString &rText) override
virtual OUString get_primary_text() const override
virtual void set_primary_text(const OUString &rText) override
VclPtr<::MessageDialog > m_xMessageDialog
SalInstanceMessageDialog(::MessageDialog *pDialog, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual OUString get_tab_label_text(const OUString &rIdent) const override
virtual void set_tab_label_text(const OUString &rIdent, const OUString &rText) override
virtual int get_page_index(const OUString &rIdent) const override
virtual void set_show_tabs(bool bShow) override
virtual OUString get_page_ident(int nPage) const override
std::vector< std::shared_ptr< SalInstanceContainer > > m_aPages
virtual void set_current_page(int nPage) override
virtual ~SalInstanceNotebook() override
virtual void remove_page(const OUString &rIdent) override
VclPtr< TabControl > m_xNotebook
virtual int get_current_page() const override
virtual OUString get_current_page_ident() const override
virtual weld::Container * get_page(const OUString &rIdent) const override
virtual int get_n_pages() const override
std::map< OUString, std::pair< VclPtr< TabPage >, VclPtr< VclGrid > > > m_aAddedPages
virtual void insert_page(const OUString &rIdent, const OUString &rLabel, int nPos) override
SalInstanceNotebook(TabControl *pNotebook, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
SalInstancePopover(DockingWindow *pPopover, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void popup_at_rect(weld::Widget *pParent, const tools::Rectangle &rRect, weld::Placement ePlace=weld::Placement::Under) override
virtual void resize_to_request() override
virtual void popdown() override
VclPtr< DockingWindow > m_xPopover
VclPtr<::RadioButton > m_xRadioButton
virtual void set_active(bool active) override
virtual void set_inconsistent(bool) override
virtual void set_label_wrap(bool wrap) override
virtual void set_from_icon_name(const OUString &rIconName) override
virtual bool get_inconsistent() const override
virtual void set_image(VirtualDevice *pDevice) override
virtual bool get_active() const override
virtual ~SalInstanceRadioButton() override
SalInstanceRadioButton(::RadioButton *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual ~SalInstanceScrolledWindow() override
virtual int hadjustment_get_upper() const override
virtual int vadjustment_get_value() const override
virtual int vadjustment_get_lower() const override
static void customize_scrollbars(ScrollBar &rScrollBar, const Color &rButtonTextColor, const Color &rBackgroundColor, const Color &rShadowColor, const Color &rFaceColor)
virtual void hadjustment_set_step_increment(int size) override
virtual VclPolicyType get_vpolicy() const override
virtual void vadjustment_set_step_increment(int size) override
virtual void set_scroll_thickness(int nThickness) override
virtual void vadjustment_set_page_increment(int size) override
virtual VclPolicyType get_hpolicy() const override
virtual void hadjustment_set_page_increment(int size) override
SalInstanceScrolledWindow(VclScrolledWindow *pScrolledWindow, SalInstanceBuilder *pBuilder, bool bTakeOwnership, bool bUserManagedScrolling)
virtual void vadjustment_configure(int value, int lower, int upper, int step_increment, int page_increment, int page_size) override
virtual void set_hpolicy(VclPolicyType eHPolicy) override
virtual void vadjustment_set_page_size(int size) override
virtual void vadjustment_set_upper(int upper) override
virtual void vadjustment_set_lower(int lower) override
virtual void vadjustment_set_value(int value) override
virtual void hadjustment_configure(int value, int lower, int upper, int step_increment, int page_increment, int page_size) override
virtual int get_scroll_thickness() const override
virtual int hadjustment_get_page_size() const override
Link< ScrollBar *, void > m_aOrigHScrollHdl
virtual int vadjustment_get_page_size() const override
virtual void set_vpolicy(VclPolicyType eVPolicy) override
virtual void hadjustment_set_page_size(int size) override
virtual void hadjustment_set_upper(int upper) override
virtual int hadjustment_get_value() const override
virtual void hadjustment_set_value(int value) override
VclPtr< VclScrolledWindow > m_xScrolledWindow
virtual int vadjustment_get_upper() const override
Link< ScrollBar *, void > m_aOrigVScrollHdl
virtual void set_increments(int step, int) override
SalInstanceSpinButton(FormattedField *pButton, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
Formatter & m_rFormatter
Definition: salvtables.hxx:680
virtual bool has_focus() const override
virtual unsigned int get_digits() const override
virtual sal_Int64 get_value() const override
virtual void get_range(sal_Int64 &min, sal_Int64 &max) const override
VclPtr< FormattedField > m_xButton
Definition: salvtables.hxx:677
sal_Int64 fromField(double fValue) const
virtual void get_increments(int &step, int &page) const override
virtual void set_digits(unsigned int digits) override
virtual void set_range(sal_Int64 min, sal_Int64 max) override
virtual void set_value(sal_Int64 value) override
virtual ~SalInstanceSpinButton() override
double toField(sal_Int64 nValue) const
virtual OUString get_text() const override
virtual void set_font_color(const Color &rColor) override
virtual bool can_move_cursor_with_up() const override
virtual int vadjustment_get_upper() const override
VclPtr< VclMultiLineEdit > m_xTextView
virtual void set_alignment(TxtAlign eXAlign) override
virtual void select_region(int nStartPos, int nEndPos) override
virtual bool has_focus() const override
virtual ~SalInstanceTextView() override
virtual void cut_clipboard() override
SalInstanceTextView(VclMultiLineEdit *pTextView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual void copy_clipboard() override
virtual int vadjustment_get_page_size() const override
Link< ScrollBar *, void > m_aOrigVScrollHdl
virtual void set_text(const OUString &rText) override
bool get_selection_bounds(int &rStartPos, int &rEndPos) override
virtual void set_max_length(int nChars) override
virtual int vadjustment_get_value() const override
virtual void paste_clipboard() override
virtual void set_monospace(bool bMonospace) override
virtual void set_font(const vcl::Font &rFont) override
virtual int vadjustment_get_lower() const override
virtual void vadjustment_set_value(int value) override
virtual void set_editable(bool bEditable) override
virtual void connect_cursor_position(const Link< TextView &, void > &rLink) override
virtual bool get_editable() const override
virtual bool can_move_cursor_with_down() const override
virtual void replace_selection(const OUString &rText) override
virtual void set_item_popover(const OUString &rIdent, weld::Widget *pPopover) override
VclPtr< ToolBox > m_xToolBox
virtual void set_item_visible(const OUString &rIdent, bool bVisible) override
virtual void set_icon_size(vcl::ImageType eType) override
virtual OUString get_item_ident(int nIndex) const override
virtual void set_item_active(const OUString &rIdent, bool bActive) override
void set_menu_item_active(const OUString &rIdent, bool bActive) override
virtual void set_item_help_id(const OUString &rIdent, const OUString &rHelpId) override
virtual int get_drop_index(const Point &rPoint) const override
SalInstanceToolbar(ToolBox *pToolBox, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual bool get_item_active(const OUString &rIdent) const override
OUString m_sStartShowIdent
virtual void insert_item(int pos, const OUString &rId) override
virtual void set_item_label(int nIndex, const OUString &rLabel) override
virtual OUString get_item_label(const OUString &rIdent) const override
virtual void set_item_image(const OUString &rIdent, const css::uno::Reference< css::graphic::XGraphic > &rIcon) override
virtual void insert_separator(int pos, const OUString &) override
virtual void set_item_menu(const OUString &rIdent, weld::Menu *pMenu) override
virtual void set_item_icon_name(const OUString &rIdent, const OUString &rIconName) override
virtual void set_item_image_mirrored(const OUString &rIdent, bool bMirrored) override
std::map< ToolBoxItemId, VclPtr< PopupMenu > > m_aMenus
bool get_menu_item_active(const OUString &rIdent) const override
virtual ~SalInstanceToolbar() override
virtual int get_n_items() const override
virtual vcl::ImageType get_icon_size() const override
virtual OUString get_item_tooltip_text(const OUString &rIdent) const override
virtual bool get_item_sensitive(const OUString &rIdent) const override
virtual void set_item_tooltip_text(int nIndex, const OUString &rTip) override
virtual sal_uInt16 get_modifier_state() const override
virtual bool get_item_visible(const OUString &rIdent) const override
virtual void set_item_sensitive(const OUString &rIdent, bool bSensitive) override
std::map< ToolBoxItemId, VclPtr< vcl::Window > > m_aFloats
virtual void set_item_ident(int nIndex, const OUString &rIdent) override
virtual void queue_draw() override
virtual void connect_visible_range_changed(const Link< weld::TreeView &, void > &rLink) override
virtual void copy_iterator(const weld::TreeIter &rSource, weld::TreeIter &rDest) const override
virtual void unset_drag_dest_row() override
SvTabListBox & getTreeView()
virtual void remove_selection() override
virtual void move_subtree(weld::TreeIter &rNode, const weld::TreeIter *pNewParent, int nIndexInNewParent) override
virtual void visible_foreach(const std::function< bool(weld::TreeIter &)> &func) override
void set_image(SvTreeListEntry *pEntry, const Image &rImage, int col)
virtual void set_sort_column(int nColumn) override
virtual int find_id(const OUString &rId) const override
void set_toggle(SvTreeListEntry *pEntry, TriState eState, int col)
void InvalidateModelEntry(SvTreeListEntry *pEntry)
virtual void show() override
virtual void columns_autosize() override
virtual void set_children_on_demand(const weld::TreeIter &rIter, bool bChildrenOnDemand) override
virtual void end_editing() override
virtual void enable_toggle_buttons(weld::ColumnToggleType eType) override
virtual void remove(int pos) override
virtual void scroll_to_row(int pos) override
virtual std::unique_ptr< weld::TreeIter > make_iterator(const weld::TreeIter *pOrig=nullptr) const override
SalInstanceTreeView(SvTabListBox *pTreeView, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
void AddStringItem(SvTreeListEntry *pEntry, const OUString &rStr, int nCol)
virtual int get_height_rows(int nRows) const override
virtual OUString get_column_title(int nColumn) const override
virtual bool get_children_on_demand(const weld::TreeIter &rIter) const override
virtual int n_children() const override
virtual bool iter_has_child(const weld::TreeIter &rIter) const override
virtual TreeView * get_drag_source() const override
void set_header_item_width(const std::vector< int > &rWidths)
virtual bool get_iter_abs_pos(weld::TreeIter &rIter, int nPos) const
static TriState do_get_toggle(SvTreeListEntry *pEntry, int col)
virtual bool is_selected(int pos) const override
virtual void start_editing(const weld::TreeIter &rIter) override
void do_set_toggle(SvTreeListEntry *pEntry, TriState eState, int col)
SvLBoxButtonData m_aCheckButtonData
void set_text_align(SvTreeListEntry *pEntry, double fAlign, int col)
virtual OUString get_selected_id() const override
void set_id(SvTreeListEntry *pEntry, const OUString &rId)
virtual void insert_separator(int pos, const OUString &) override
virtual void set_column_title(int nColumn, const OUString &rTitle) override
virtual void freeze() override
virtual bool iter_previous(weld::TreeIter &rIter) const override
virtual void set_clicks_to_toggle(int nToggleBehavior) override
virtual int get_selected_index() const override
virtual bool iter_previous_sibling(weld::TreeIter &rIter) const override
virtual bool changed_by_hover() const override
TriState get_toggle(SvTreeListEntry *pEntry, int col) const
virtual void swap(int pos1, int pos2) override
virtual bool iter_next_sibling(weld::TreeIter &rIter) const override
virtual bool get_selected(weld::TreeIter *pIter) const override
virtual void make_unsorted() override
virtual void connect_query_tooltip(const Link< const weld::TreeIter &, OUString > &rLink) override
virtual int vadjustment_get_value() const override
virtual void all_foreach(const std::function< bool(weld::TreeIter &)> &func) override
virtual void set_selection_mode(SelectionMode eMode) override
SvLBoxButtonData m_aRadioButtonData
virtual int find_text(const OUString &rText) const override
virtual void unselect(int pos) override
virtual int iter_compare(const weld::TreeIter &a, const weld::TreeIter &b) const override
SvTreeListEntry * GetPlaceHolderChild(SvTreeListEntry *pEntry) const
VclPtr< SvTabListBox > m_xTreeView
virtual int get_sort_column() const override
void set_text(SvTreeListEntry *pEntry, const OUString &rText, int col)
virtual void set_sort_order(bool bAscending) override
virtual void select(int pos) override
virtual void enable_drag_source(rtl::Reference< TransferDataContainer > &rHelper, sal_uInt8 eDNDConstants) override
virtual ~SalInstanceTreeView() override
virtual bool iter_children(weld::TreeIter &rIter) const override
static bool do_get_sensitive(SvTreeListEntry *pEntry, int col)
static void set_font_color(SvTreeListEntry *pEntry, const Color &rColor)
int to_external_model(int col) const
virtual int get_iter_index_in_parent(const weld::TreeIter &rIter) const override
virtual int count_selected_rows() const override
virtual int get_column_width(int nColumn) const override
o3tl::sorted_vector< SvTreeListEntry * > m_aExpandingPlaceHolderParents
virtual bool iter_next(weld::TreeIter &rIter) const override
virtual void set_cursor(int pos) override
virtual OUString get_selected_text() const override
std::vector< std::unique_ptr< OUString > > m_aUserData
virtual void set_sort_indicator(TriState eState, int col) override
OUString get_text(SvTreeListEntry *pEntry, int col) const
virtual void set_column_custom_renderer(int nColumn, bool bEnable) override
virtual void clear() override
virtual void insert(const weld::TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, VirtualDevice *pImageSurface, bool bChildrenOnDemand, weld::TreeIter *pRet) override
virtual TriState get_sort_indicator(int col) const override
virtual bool get_sensitive() const override
Definition: salvtables.cxx:370
bool IsDummyEntry(SvTreeListEntry *pEntry) const
virtual bool get_sort_order() const override
virtual void set_column_editables(const std::vector< bool > &rEditables) override
virtual bool iter_parent(weld::TreeIter &rIter) const override
virtual void expand_row(const weld::TreeIter &rIter) override
void set_text_emphasis(SvTreeListEntry *pEntry, bool bOn, int col=-1)
o3tl::sorted_vector< int > m_aCustomRenders
virtual int get_iter_depth(const weld::TreeIter &rIter) const override
const OUString * getEntryData(int index) const
virtual void thaw() override
virtual void set_centered_column(int nCol) override
virtual void connect_editing(const Link< const weld::TreeIter &, bool > &rStartLink, const Link< const iter_string &, bool > &rEndLink) override
virtual void set_extra_row_indent(const weld::TreeIter &rIter, int nIndentLevel) override
virtual bool get_row_expanded(const weld::TreeIter &rIter) const override
virtual bool get_iter_first(weld::TreeIter &rIter) const override
bool ExpandRow(const SalInstanceTreeIter &rIter)
virtual int iter_n_children(const weld::TreeIter &rIter) const override
int to_internal_model(int col) const
void set_sensitive(SvTreeListEntry *pEntry, bool bSensitive, int col)
virtual int get_cursor_index() const override
virtual tools::Rectangle get_row_area(const weld::TreeIter &rIter) const override
virtual OUString get_id(int pos) const override
virtual void bulk_insert_for_each(int nSourceCount, const std::function< void(weld::TreeIter &, int nSourceIndex)> &func, const weld::TreeIter *pParent=nullptr, const std::vector< int > *pFixedWidths=nullptr) override
virtual void make_sorted() override
virtual bool get_cursor(weld::TreeIter *pIter) const override
virtual void set_show_expanders(bool bShow) override
virtual std::vector< int > get_selected_rows() const override
virtual void vadjustment_set_value(int nValue) override
virtual void collapse_row(const weld::TreeIter &rIter) override
void update_checkbutton_column_width(SvTreeListEntry *pEntry)
virtual void hide() override
void do_insert(const weld::TreeIter *pParent, int pos, const OUString *pStr, const OUString *pId, const OUString *pIconName, const VirtualDevice *pImageSurface, bool bChildrenOnDemand, weld::TreeIter *pRet, bool bIsSeparator)
virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter *pResult, bool bDnDMode, bool bAutoScroll=true) override
bool get_text_emphasis(SvTreeListEntry *pEntry, int col) const
virtual void selected_foreach(const std::function< bool(weld::TreeIter &)> &func) override
virtual void set_column_fixed_widths(const std::vector< int > &rWidths) override
virtual void set_sort_func(const std::function< int(const weld::TreeIter &, const weld::TreeIter &)> &func) override
virtual OUString get_tooltip_text() const override
Definition: salvtables.cxx:512
virtual void set_help_id(const OUString &rId) override
Definition: salvtables.cxx:435
virtual css::uno::Reference< css::datatransfer::dnd::XDropTarget > get_drop_target() override
Definition: salvtables.cxx:689
virtual void HandleEventListener(VclWindowEvent &rEvent)
Definition: salvtables.cxx:733
DECL_LINK(EventListener, VclWindowEvent &, void)
virtual int get_margin_start() const override
Definition: salvtables.cxx:475
virtual void set_stack_background() override
Definition: salvtables.cxx:710
SalInstanceWidget(vcl::Window *pWidget, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
Definition: salvtables.cxx:355
virtual int get_grid_top_attach() const override
Definition: salvtables.cxx:453
virtual int get_margin_top() const override
Definition: salvtables.cxx:471
virtual int get_grid_left_attach() const override
Definition: salvtables.cxx:444
virtual void set_title_background() override
Definition: salvtables.cxx:715
virtual void connect_style_updated(const Link< Widget &, void > &rLink) override
Definition: salvtables.cxx:587
virtual bool get_hexpand() const override
Definition: salvtables.cxx:457
virtual void connect_mouse_press(const Link< const MouseEvent &, bool > &rLink) override
Definition: salvtables.cxx:547
virtual bool has_focus() const override
Definition: salvtables.cxx:393
virtual void hide() override
Definition: salvtables.cxx:401
virtual void set_size_request(int nWidth, int nHeight) override
Definition: salvtables.cxx:403
virtual int get_margin_bottom() const override
Definition: salvtables.cxx:473
virtual void set_background(const Color &rColor) override
Definition: salvtables.cxx:339
virtual void set_busy_cursor(bool bBusy) override
Definition: salvtables.cxx:632
virtual void show() override
Definition: salvtables.cxx:399
virtual vcl::Font get_font() override
Definition: salvtables.cxx:429
virtual void set_margin_top(int nMargin) override
Definition: salvtables.cxx:463
virtual void queue_resize() override
Definition: salvtables.cxx:645
void ensure_key_listener()
Definition: salvtables.cxx:319
const bool m_bTakeOwnership
Definition: salvtables.hxx:198
virtual void connect_size_allocate(const Link< const Size &, void > &rLink) override
Definition: salvtables.cxx:541
virtual void set_vexpand(bool bExpand) override
Definition: salvtables.cxx:459
virtual void connect_get_property_tree(const Link< tools::JsonWriter &, void > &rLink) override
Definition: salvtables.cxx:700
virtual void connect_mouse_release(const Link< const MouseEvent &, bool > &rLink) override
Definition: salvtables.cxx:559
virtual void set_grid_top_attach(int nAttach) override
Definition: salvtables.cxx:448
virtual bool has_child_focus() const override
Definition: salvtables.cxx:397
virtual void set_direction(bool bRTL) override
Definition: salvtables.cxx:616
virtual void get_property_tree(tools::JsonWriter &rJsonWriter) override
Definition: salvtables.cxx:705
virtual Size get_size_request() const override
Definition: salvtables.cxx:409
virtual void set_sensitive(bool sensitive) override
Definition: salvtables.cxx:368
virtual std::unique_ptr< weld::Container > weld_parent() const override
vcl::Window * getWidget() const
Definition: salvtables.cxx:663
void ensure_mouse_listener()
Definition: salvtables.cxx:330
virtual void help_hierarchy_foreach(const std::function< bool(const OUString &)> &func) override
bool IsLastThaw() const
Definition: salvtables.hxx:218
virtual void freeze() override
Definition: salvtables.cxx:618
virtual void set_tooltip_text(const OUString &rTip) override
Definition: salvtables.cxx:507
virtual css::uno::Reference< css::datatransfer::clipboard::XClipboard > get_clipboard() const override
Definition: salvtables.cxx:695
virtual void set_margin_bottom(int nMargin) override
Definition: salvtables.cxx:465
virtual void set_accessible_description(const OUString &rDescription) override
Definition: salvtables.cxx:484
virtual OUString strip_mnemonic(const OUString &rLabel) const override
Definition: salvtables.cxx:671
virtual int get_margin_end() const override
Definition: salvtables.cxx:477
SalInstanceBuilder * m_pBuilder
Definition: salvtables.hxx:187
bool notify_events_disabled() const
Definition: salvtables.cxx:667
virtual bool get_vexpand() const override
Definition: salvtables.cxx:461
virtual ~SalInstanceWidget() override
Definition: salvtables.cxx:647
virtual void connect_key_press(const Link< const KeyEvent &, bool > &rLink) override
Definition: salvtables.cxx:565
virtual bool is_visible() const override
Definition: salvtables.cxx:374
virtual void connect_mnemonic_activate(const Link< Widget &, bool > &rLink) override
Definition: salvtables.cxx:529
static void DoRecursivePaint(vcl::Window *pWindow, const Point &rPos, OutputDevice &rOutput)
virtual void set_grid_width(int nCols) override
Definition: salvtables.cxx:446
virtual void call_attention_to() override
Definition: salvtables.cxx:683
virtual OUString get_help_id() const override
Definition: salvtables.cxx:437
std::unique_ptr< SalFlashAttention > m_xFlashAttention
Definition: salvtables.hxx:186
virtual bool is_active() const override
Definition: salvtables.cxx:395
virtual bool get_extents_relative_to(const Widget &rRelative, int &x, int &y, int &width, int &height) const override
Definition: salvtables.cxx:596
virtual void set_hexpand(bool bExpand) override
Definition: salvtables.cxx:455
virtual bool has_grab() const override
Definition: salvtables.cxx:610
virtual bool get_sensitive() const override
Definition: salvtables.cxx:370
virtual void grab_focus() override
Definition: salvtables.cxx:386
virtual int get_text_height() const override
Definition: salvtables.cxx:421
void enable_notify_events()
Definition: salvtables.cxx:669
virtual void set_grid_left_attach(int nAttach) override
Definition: salvtables.cxx:439
virtual void set_margin_start(int nMargin) override
Definition: salvtables.cxx:467
virtual void set_accessible_name(const OUString &rName) override
Definition: salvtables.cxx:479
virtual void set_margin_end(int nMargin) override
Definition: salvtables.cxx:469
virtual OUString get_accessible_description() const override
Definition: salvtables.cxx:491
virtual void set_highlight_background() override
Definition: salvtables.cxx:726
virtual void connect_key_release(const Link< const KeyEvent &, bool > &rLink) override
Definition: salvtables.cxx:571
virtual void grab_add() override
Definition: salvtables.cxx:608
virtual void set_accessible_relation_labeled_by(weld::Widget *pLabel) override
Definition: salvtables.cxx:496
virtual void set_buildable_name(const OUString &rId) override
Definition: salvtables.cxx:433
void ensure_event_listener()
Definition: salvtables.cxx:307
SystemWindow * getSystemWindow()
Definition: salvtables.cxx:731
virtual void HandleMouseEventListener(VclWindowEvent &rEvent)
Definition: salvtables.cxx:754
virtual void draw(OutputDevice &rOutput, const Point &rPos, const Size &rSizePixel) override
virtual bool get_visible() const override
Definition: salvtables.cxx:372
virtual OUString get_accessible_name() const override
Definition: salvtables.cxx:489
virtual float get_approximate_digit_width() const override
Definition: salvtables.cxx:416
virtual void thaw() override
Definition: salvtables.cxx:625
VclPtr< vcl::Window > m_xWidget
Definition: salvtables.hxx:185
virtual void connect_mouse_move(const Link< const MouseEvent &, bool > &rLink) override
Definition: salvtables.cxx:553
void disable_notify_events()
Definition: salvtables.cxx:665
virtual OUString get_buildable_name() const override
Definition: salvtables.cxx:431
virtual void connect_focus_in(const Link< Widget &, void > &rLink) override
Definition: salvtables.cxx:523
virtual void set_cursor_data(void *pData) override
Definition: salvtables.cxx:514
bool IsFirstFreeze() const
Definition: salvtables.hxx:217
virtual bool get_direction() const override
Definition: salvtables.cxx:614
virtual Size get_pixel_size(const OUString &rText) const override
Definition: salvtables.cxx:423
virtual void connect_focus_out(const Link< Widget &, void > &rLink) override
Definition: salvtables.cxx:535
virtual void set_toolbar_background() override
Definition: salvtables.cxx:720
virtual Size get_preferred_size() const override
Definition: salvtables.cxx:414
virtual VclPtr< VirtualDevice > create_virtual_device() const override
Definition: salvtables.cxx:676
virtual void set_can_focus(bool bCanFocus) override
Definition: salvtables.cxx:376
virtual void grab_remove() override
Definition: salvtables.cxx:612
virtual bool HandleKeyEventListener(VclWindowEvent &rEvent)
Definition: salvtables.cxx:803
virtual bool has_toplevel_focus() const override
virtual VclPtr< VirtualDevice > screenshot() override
virtual Point get_position() const override
void clear_child_help(vcl::Window *pParent)
virtual void present() override
virtual void set_window_state(const OUString &rStr) override
virtual void set_modal(bool bModal) override
virtual css::uno::Reference< css::awt::XWindow > GetXWindow() override
virtual void set_centered_on_parent(bool) override
VclPtr< vcl::Window > m_xWindow
Definition: salvtables.hxx:446
virtual void resize_to_request() override
virtual void change_default_widget(weld::Widget *pOld, weld::Widget *pNew) override
SalInstanceWindow(vcl::Window *pWindow, SalInstanceBuilder *pBuilder, bool bTakeOwnership)
virtual SystemEnvData get_system_data() const override
virtual bool get_modal() const override
virtual OUString get_window_state(vcl::WindowDataMask nMask) const override
virtual bool is_default_widget(const weld::Widget *pCandidate) const override
virtual OUString get_title() const override
virtual bool get_resizable() const override
virtual weld::ScreenShotCollection collect_screenshot_data() override
void recursively_unset_default_buttons()
virtual void window_move(int x, int y) override
virtual ~SalInstanceWindow() override
virtual void set_title(const OUString &rTitle) override
void override_child_help(vcl::Window *pParent)
virtual const vcl::ILibreOfficeKitNotifier * GetLOKNotifier() override
virtual tools::Rectangle get_monitor_workarea() const override
void implResetDefault(const vcl::Window *_pWindow)
virtual Size get_size() const override
virtual std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
virtual weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
SalInstance(std::unique_ptr< comphelper::SolarMutex > pMutex)
Definition: salvtables.cxx:136
rtl::Reference< vcl::DisplayConnectionDispatch > m_pEventInst
Definition: salinst.hxx:78
virtual void DoQuit()
Definition: salvtables.cxx:178
bool CallEventCallback(void const *pEvent, int nBytes)
Definition: salvtables.cxx:165
bool m_bSupportsOpenGL
Definition: salinst.hxx:84
virtual ~SalInstance()
Definition: salvtables.cxx:141
virtual std::unique_ptr< SalMenuItem > CreateMenuItem(const SalItemParams &pItemData)
Definition: salvtables.cxx:163
virtual std::unique_ptr< weld::Builder > CreateInterimBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId=0)
virtual weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
void AcquireYieldMutex(sal_uInt32 nCount=1)
Definition: salvtables.cxx:147
virtual OpenGLContext * CreateOpenGLContext()
Definition: salvtables.cxx:151
sal_uInt32 ReleaseYieldMutexAll()
Definition: salvtables.cxx:145
virtual bool DoExecute(int &nExitCode)
Definition: salvtables.cxx:170
virtual std::unique_ptr< SalMenu > CreateMenu(bool bMenuBar, Menu *pMenu)
Definition: salvtables.cxx:157
virtual std::unique_ptr< SalSession > CreateSalSession()
Definition: salvtables.cxx:149
comphelper::SolarMutex * GetYieldMutex()
Definition: salvtables.cxx:143
const std::unique_ptr< comphelper::SolarMutex > m_pYieldMutex
Definition: salinst.hxx:79
virtual ~SalMenuItem()
Definition: salvtables.cxx:238
virtual bool AddMenuBarButton(const SalMenuButtonItem &)
Definition: salvtables.cxx:225
virtual int GetMenuBarHeight() const
Definition: salvtables.cxx:234
virtual bool ShowNativePopupMenu(FloatingWindow *pWin, const tools::Rectangle &rRect, FloatWinPopupFlags nFlags)
Definition: salvtables.cxx:218
virtual tools::Rectangle GetMenuBarButtonRectPixel(sal_uInt16 i_nItemId, SalFrame *i_pReferenceFrame)
Definition: salvtables.cxx:229
virtual void ShowCloseButton(bool bShow)
Definition: salvtables.cxx:223
virtual void RemoveMenuBarButton(sal_uInt16 nId)
Definition: salvtables.cxx:227
virtual ~SalMenu()
Definition: salvtables.cxx:216
virtual void ApplyPersona()
Definition: salvtables.cxx:236
virtual ~SalObject()
Definition: salvtables.cxx:214
virtual ~SalPrinter()
Definition: salvtables.cxx:202
virtual bool StartJob(const OUString *pFileName, const OUString &rJobName, const OUString &rAppName, sal_uInt32 nCopies, bool bCollate, bool bDirect, ImplJobSetup *pSetupData)=0
virtual ~SalSystem()
Definition: salvtables.cxx:200
virtual ~SalTimer() COVERITY_NOEXCEPT_FALSE
Definition: salvtables.cxx:184
virtual ~SalVirtualDevice() override
Definition: salvtables.cxx:212
A construction helper for ScopedVclPtr.
Definition: vclptr.hxx:409
void SetThumbPos(tools::Long nThumbPos) override
Definition: scrbar.cxx:1362
void SetRangeMin(tools::Long nNewRange) override
Definition: scrbar.cxx:1328
void EnableDrag()
Definition: scrbar.hxx:108
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
Definition: scrbar.hxx:130
void SetVisibleSize(tools::Long nNewSize) override
Definition: scrbar.cxx:1376
tools::Long GetLineSize() const override
Definition: scrbar.hxx:119
void SetRangeMax(tools::Long nNewRange) override
Definition: scrbar.cxx:1333
void SetLineSize(tools::Long nNewSize) override
Definition: scrbar.hxx:118
void SetPageSize(tools::Long nNewSize) override
Definition: scrbar.hxx:120
tools::Long GetRangeMin() const override
Definition: scrbar.hxx:111
tools::Long GetPageSize() const override
Definition: scrbar.hxx:121
ScrollType GetType() const
Definition: scrbar.hxx:128
const Link< ScrollBar *, void > & GetScrollHdl() const
Definition: scrbar.hxx:131
tools::Long GetVisibleSize() const override
Definition: scrbar.hxx:123
tools::Long GetRangeMax() const override
Definition: scrbar.hxx:113
tools::Long GetThumbPos() const override
Definition: scrbar.hxx:117
tools::Long Min() const
tools::Long Len() const
tools::Long Max() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetDownHdl(const Link< SpinField &, void > &rLink)
Definition: spinfld.hxx:55
void SetUpHdl(const Link< SpinField &, void > &rLink)
Definition: spinfld.hxx:54
void SetFaceColor(const Color &rColor)
const Color & GetWindowColor() const
void SetShadowColor(const Color &rColor)
const Color & GetShadowColor() const
const vcl::Font & GetFieldFont() const
void SetCheckedColor(const Color &rColor)
const Color & GetLightColor() const
void SetButtonTextColor(const Color &rColor)
const Color & GetHighlightColor() const
const Color & GetWarningColor() const
HeaderBar * GetHeaderBar()
Definition: svtabbx.cxx:522
void SetLink(const Link< SvLBoxButtonData *, void > &rLink)
Definition: svlbitm.hxx:83
bool IsStateChecked() const
Definition: svlbitm.hxx:184
bool IsStateTristate() const
Definition: svlbitm.hxx:192
bool isEnable() const
virtual SvLBoxItemType GetType() const =0
void Enable(bool bEnabled)
bool IsSelected(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1310
SvTreeListEntry * GetEntryAtAbsPos(sal_uInt32 nAbsPos) const
Definition: treelist.hxx:257
sal_uInt32 GetSelectionCount() const
Definition: treelist.cxx:1029
SvTreeListEntry * NextSelected(SvTreeListEntry *pEntry) const
Definition: treelist.hxx:254
SvTreeListEntry * FirstSelected() const
Definition: treelist.hxx:251
sal_uInt32 GetAbsPos(SvTreeListEntry const *pEntry) const
Definition: treelist.hxx:263
bool IsExpanded(SvTreeListEntry *pEntry) const
Definition: treelist.cxx:1283
tools::Long GetLogicTab(sal_uInt16 nTab)
Definition: svtabbx.cxx:465
virtual OUString GetEntryText(SvTreeListEntry *pEntry) const override
Definition: svtabbx.cxx:278
virtual void SetTabs() override
Definition: svtabbx.cxx:145
void SetTabJustify(sal_uInt16 nTab, SvTabJustify)
Definition: svtabbx.cxx:437
virtual SvTreeListEntry * InsertEntry(const OUString &rText, SvTreeListEntry *pParent=nullptr, bool bChildrenOnDemand=false, sal_uInt32 nPos=TREELIST_APPEND, void *pUserData=nullptr) override
Definition: svtabbx.cxx:246
void SetEntryText(SvTreeListEntry *, const OUString &)
void SetTabEditable(sal_uInt16 nTab, bool bEditable)
Definition: svtabbx.cxx:453
SvTreeListEntry * Prev(SvTreeListEntry *pEntry) const
void SetUpdateMode(bool)
void ScrollToAbsPos(tools::Long nPos)
VCL_DLLPRIVATE void CheckBoxInserted(SvTreeListEntry *pEntry)
virtual void Resize() override
virtual bool set_property(const OUString &rKey, const OUString &rValue) override
SvTreeListEntry * GetNextEntryInView(SvTreeListEntry *) const
void RemoveEntry(SvTreeListEntry const *pEntry)
Removes the entry along with all of its descendants.
void SetDeselectHdl(const Link< SvTreeListBox *, void > &rNewHdl)
SvTreeListEntry * FirstChild(SvTreeListEntry *pParent) const
void SetScrolledHdl(const Link< SvTreeListBox *, void > &rLink)
tools::Long getPreferredDimensions(std::vector< tools::Long > &rWidths) const
void SetDoubleClickHdl(const Link< SvTreeListBox *, bool > &rNewHdl)
void EnableInplaceEditing(bool bEnable)
void SetClicksToToggle(sal_Int8 nCount)
bool IsSelectDueToHover() const
void SetTooltipHdl(const Link< SvTreeListEntry *, OUString > &rLink)
void MakeVisible(SvTreeListEntry *pEntry)
SvTreeListEntry * Next(SvTreeListEntry *pEntry) const
tools::Rectangle GetBoundingRect(const SvTreeListEntry *pEntry)
Calculate and return the bounding rectangle of an entry.
SvTreeListEntry * GetEntry(SvTreeListEntry *pParent, sal_uInt32 nPos) const
void SetCollapsedEntryBmp(SvTreeListEntry *_pEntry, const Image &_rImage)
bool Collapse(SvTreeListEntry *pParent)
bool Select(SvTreeListEntry *pEntry, bool bSelect=true)
void SetExpandedEntryBmp(SvTreeListEntry *_pEntry, const Image &_rImage)
SvViewDataItem * GetViewDataItem(SvTreeListEntry const *, SvLBoxItem const *)
void SetCustomRenderHdl(const Link< svtree_render_args, void > &rLink)
virtual void CalcEntryHeight(SvTreeListEntry const *pEntry)
void SetForceMakeVisible(bool bEnable)
void ModelHasEntryInvalidated(SvTreeListEntry *pEntry) override
short GetEntryHeight() const
SvTreeListEntry * GetFirstEntryInView() const
void UnsetDropTarget()
void EditEntry(SvTreeListEntry *pEntry)
void SetSelectionMode(SelectionMode)
SvTreeListEntry * GetCurEntry() const
void SetNodeDefaultImages()
Sets default bitmaps for collapsed and expanded nodes.
SvViewDataEntry * GetViewDataEntry(SvTreeListEntry const *pEntry) const
void EnableCheckButton(SvLBoxButtonData *)
void SetCustomMeasureHdl(const Link< svtree_measure_args, Size > &rLink)
void SetCurEntry(SvTreeListEntry *_pEntry)
void EndEditing(bool bCancel=false)
virtual SvTreeListEntry * GetDropTarget(const Point &)
SvTreeListEntry * First() const
void SetDragHelper(const rtl::Reference< TransferDataContainer > &rHelper, sal_uInt8 eDNDConstants)
void SetSelectHdl(const Link< SvTreeListBox *, void > &rNewHdl)
SvTreeFlags nTreeFlags
void SetPopupMenuHdl(const Link< const CommandEvent &, bool > &rLink)
static OUString SearchEntryTextWithHeadTitle(SvTreeListEntry *pEntry)
void SetExpandingHdl(const Link< SvTreeListBox *, bool > &rNewHdl)
void SelectAll(bool bSelect)
virtual void InitViewData(SvViewDataEntry *, SvTreeListEntry *pEntry) override
virtual sal_uInt32 Insert(SvTreeListEntry *pEnt, SvTreeListEntry *pPar, sal_uInt32 nPos=TREELIST_APPEND)
SvTreeListEntry * GetParent(SvTreeListEntry *pEntry) const
SvTreeList * GetModel() const
bool Expand(SvTreeListEntry *pParent)
SvTreeListEntry * PrevSibling() const
SvTreeListEntry * NextSibling() const
const SvLBoxItem * GetFirstItem(SvLBoxItemType eType) const
void * GetUserData() const
bool HasChildren() const
size_t ItemCount() const
void SetExtraIndent(sal_uInt32 nExtraIndent)
SvTLEntryFlags GetFlags() const
const SvLBoxItem & GetItem(size_t nPos) const
void ReplaceItem(std::unique_ptr< SvLBoxItem > pNewItem, size_t nPos)
void SetFlags(SvTLEntryFlags nFlags)
void AddItem(std::unique_ptr< SvLBoxItem > pItem)
void SetTextColor(std::optional< Color > xColor)
void SetUserData(void *pPtr)
void Move(SvTreeListEntry *pSource, SvTreeListEntry *pTarget)
Definition: treelist.cxx:304
sal_uInt32 GetAbsPos(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:821
void SetSortMode(SvSortMode eMode)
Definition: treelist.hxx:195
SvTreeListEntry * GetEntry(SvTreeListEntry *pParent, sal_uInt32 nPos) const
Definition: treelist.cxx:1457
void Resort()
Definition: treelist.cxx:1355
static sal_uInt32 GetRelPos(const SvTreeListEntry *pChild)
Definition: treelist.cxx:828
SvSortMode GetSortMode() const
Definition: treelist.hxx:196
const SvTreeListEntries & GetChildList(SvTreeListEntry *pParent) const
Definition: treelist.cxx:1474
void SetCompareHdl(const Link< const SvSortData &, sal_Int32 > &rLink)
Definition: treelist.hxx:198
void EnableInvalidate(bool bEnable)
Definition: treelist.cxx:999
sal_uInt16 GetDepth(const SvTreeListEntry *pEntry) const
Definition: treelist.cxx:103
bool IsEnableInvalidate() const
Definition: treelist.hxx:136
void InvalidateEntry(SvTreeListEntry *)
Definition: treelist.cxx:1004
View-dependent data for a tree list entry created in the virtual function SvTreeListBox::CreateViewDa...
void SetSelectable(bool bSelectable)
VclPtr< VirtualDevice > createScreenshot()
Definition: syswin.cxx:1110
void SetWindowState(const vcl::WindowData &rData)
Definition: syswin.cxx:617
OUString GetWindowState(vcl::WindowDataMask nMask=vcl::WindowDataMask::All) const
Definition: syswin.cxx:835
void SetDeactivatePageHdl(const Link< TabControl *, bool > &rLink)
Definition: tabctrl.hxx:153
sal_uInt16 GetPageCount() const
Definition: tabctrl.cxx:1777
void SetTabPage(sal_uInt16 nPageId, TabPage *pPage)
Definition: tabctrl.cxx:1881
virtual bool set_property(const OUString &rKey, const OUString &rValue) override
Definition: tabctrl.cxx:2132
sal_uInt16 GetPagePos(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1789
OUString GetPageName(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:2002
void SetPageName(sal_uInt16 nPageId, const OUString &rName) const
Definition: tabctrl.cxx:1994
TabPage * GetTabPage(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1907
void SetCurPageId(sal_uInt16 nPageId)
Definition: tabctrl.cxx:1819
void InsertPage(sal_uInt16 nPageId, const OUString &rText, sal_uInt16 nPos=TAB_APPEND)
Definition: tabctrl.cxx:1638
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1853
OUString const & GetPageText(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1937
sal_uInt16 GetPageId(sal_uInt16 nPos) const
Definition: tabctrl.cxx:1782
void SetPageText(sal_uInt16 nPageId, const OUString &rText)
Definition: tabctrl.cxx:1917
void SetActivatePageHdl(const Link< TabControl *, void > &rLink)
Definition: tabctrl.hxx:152
void RemovePage(sal_uInt16 nPageId)
Definition: tabctrl.cxx:1687
void SetPriority(TaskPriority ePriority)
Definition: scheduler.cxx:606
Definition: timer.hxx:27
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:90
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: timer.cxx:83
A toolbar: contains all those icons, typically below the menu bar.
Definition: toolbox.hxx:74
ToolBoxItemId GetItemId(ImplToolItems::size_type nPos) const
Definition: toolbox2.cxx:746
OUString GetQuickHelpText(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1329
void SetSelectHdl(const Link< ToolBox *, void > &rLink)
Definition: toolbox.hxx:454
bool IsItemChecked(ToolBoxItemId nItemId) const
Definition: toolbox.hxx:514
void SetDropdownClickHdl(const Link< ToolBox *, void > &rLink)
Definition: toolbox2.cxx:1433
vcl::ImageType GetImageSize() const
Definition: toolbox2.cxx:635
void SetQuickHelpText(ToolBoxItemId nItemId, const OUString &rText)
Definition: toolbox2.cxx:1321
OUString GetItemCommand(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1311
bool IsItemEnabled(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1241
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
Definition: toolbox.cxx:1263
void InsertSeparator(ImplToolItems::size_type nPos=APPEND, sal_uInt16 nPixSize=0)
Definition: toolbox2.cxx:503
void EnableItem(ToolBoxItemId nItemId, bool bEnable=true)
Definition: toolbox2.cxx:1213
bool IsItemVisible(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1277
void CheckItem(ToolBoxItemId nItemId, bool bCheck=true)
Definition: toolbox.hxx:509
void SetItemImageMirrorMode(ToolBoxItemId nItemId, bool bMirror)
Definition: toolbox2.cxx:1001
ImplToolItems::size_type GetItemCount() const
Definition: toolbox2.cxx:712
void ShowItem(ToolBoxItemId nItemId, bool bVisible=true)
Shows or hides items.
Definition: toolbox2.cxx:1251
static constexpr auto APPEND
Definition: toolbox.hxx:86
void SetItemCommand(ToolBoxItemId nItemId, const OUString &rCommand)
Definition: toolbox2.cxx:1303
virtual void InsertItem(const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBoxItemBits nBits, const Size &rRequestedSize, ImplToolItems::size_type nPos=APPEND)
Insert a command (like '.uno:Save').
Definition: toolbox2.cxx:440
void SetHelpId(ToolBoxItemId nItemId, const OUString &rHelpId)
Definition: toolbox2.cxx:1352
tools::Rectangle GetItemRect(ToolBoxItemId nItemId)
Definition: toolbox2.cxx:838
ToolBoxButtonSize GetToolboxButtonSize() const
Definition: toolbox2.cxx:630
static constexpr auto ITEM_NOTFOUND
Definition: toolbox.hxx:89
void SetItemText(ToolBoxItemId nItemId, const OUString &rText)
Definition: toolbox2.cxx:1018
void SetItemImage(ToolBoxItemId nItemId, const Image &rImage)
Definition: toolbox2.cxx:966
void SetToolboxButtonSize(ToolBoxButtonSize eSize)
Definition: toolbox2.cxx:620
const OUString & GetItemText(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:1048
ImplToolItems::size_type GetItemPos(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:722
ToolBoxItemBits GetItemBits(ToolBoxItemId nItemId) const
Definition: toolbox2.cxx:904
sal_uInt16 GetModifier() const
Definition: toolbox.hxx:355
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
Definition: svapp.cxx:1473
virtual VclPtr< vcl::Window > GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)=0
Event to pass information for UserDraw() handling eg. in comboboxes.
Definition: event.hxx:222
virtual VclPtr< AbstractScreenshotAnnotationDlg > CreateScreenshotAnnotationDlg(weld::Dialog &rParentDialog)=0
static VclAbstractDialogFactory * Create()
Definition: abstdlg.cxx:34
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar,...
Definition: builder.hxx:69
void SetStyleUpdatedHdl(const Link< VclDrawingArea &, void > &rLink)
Definition: layout.hxx:754
void SetCommandHdl(const Link< const CommandEvent &, bool > &rLink)
Definition: layout.hxx:758
void SetMouseMoveHdl(const Link< const MouseEvent &, bool > &rLink)
Definition: layout.hxx:738
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: layout.hxx:704
void SetDeleteSurroundingHdl(const Link< const Selection &, bool > &rLink)
Definition: layout.hxx:770
void SetQueryTooltipHdl(const Link< tools::Rectangle &, OUString > &rLink)
Definition: layout.hxx:762
void SetMouseReleaseHdl(const Link< const MouseEvent &, bool > &rLink)
Definition: layout.hxx:742
void SetMousePressHdl(const Link< const MouseEvent &, bool > &rLink)
Definition: layout.hxx:734
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: layout.hxx:709
void SetResizeHdl(const Link< const Size &, void > &rLink)
Definition: layout.hxx:730
void SetDragHelper(const rtl::Reference< TransferDataContainer > &rHelper, sal_uInt8 eDNDConstants)
Definition: layout.hxx:778
void SetStartDragHdl(const Link< VclDrawingArea *, bool > &rLink)
Definition: layout.hxx:774
void SetUITestFactory(FactoryFunction pFactoryFunction, void *pUserData)
Definition: layout.hxx:717
void SetPaintHdl(const Link< std::pair< vcl::RenderContext &, const tools::Rectangle & >, void > &rLink)
Definition: layout.hxx:726
void SetKeyReleaseHdl(const Link< const KeyEvent &, bool > &rLink)
Definition: layout.hxx:750
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: layout.hxx:699
void SetGetSurroundingHdl(const Link< OUString &, int > &rLink)
Definition: layout.hxx:766
void SetKeyPressHdl(const Link< const KeyEvent &, bool > &rLink)
Definition: layout.hxx:746
OUString get_label() const
Definition: layout.cxx:1701
bool get_expanded() const
Definition: layout.cxx:1686
void SetExpandedHdl(const Link< VclExpander &, void > &rLink)
Definition: layout.hxx:471
vcl::Window * get_label_widget()
Definition: layout.cxx:1834
void set_expanded(bool bExpanded)
Definition: layout.cxx:1691
void set_label(const OUString &rLabel)
Definition: layout.cxx:1696
void set_label(const OUString &rLabel)
Definition: layout.cxx:1571
vcl::Window * get_label_widget()
Definition: layout.cxx:1549
OUString get_label() const
Definition: layout.cxx:1578
ScrollBar & GetVScrollBar() const
Definition: vclmedit.cxx:1441
void SetModifyHdl(const Link< Edit &, void > &rLink) override
Definition: vclmedit.hxx:145
bool CanDown() const
Definition: vclmedit.cxx:1469
virtual const Selection & GetSelection() const override
Definition: vclmedit.cxx:1152
virtual void SetSelection(const Selection &rSelection) override
Definition: vclmedit.cxx:1147
OUString GetText() const override
Definition: vclmedit.cxx:1119
virtual void Cut() override
Definition: vclmedit.cxx:1099
virtual void Paste() override
Definition: vclmedit.cxx:1109
virtual void SetText(const OUString &rStr) override
Definition: vclmedit.cxx:1114
virtual bool IsReadOnly() const override
Definition: vclmedit.cxx:1056
virtual void SetReadOnly(bool bReadOnly=true) override
Definition: vclmedit.cxx:1042
virtual void SetMaxTextLen(sal_Int32 nMaxLen) override
Definition: vclmedit.cxx:1064
bool CanUp() const
Definition: vclmedit.cxx:1461
virtual void Copy() override
Definition: vclmedit.cxx:1104
virtual void ReplaceSelected(const OUString &rStr) override
Definition: vclmedit.cxx:1079
A construction helper for a temporary VclPtr.
Definition: vclptr.hxx:277
void disposeAndClear()
Definition: vclptr.hxx:200
void clear()
Definition: vclptr.hxx:190
void set(reference_type *pBody)
Definition: vclptr.hxx:148
void reset(reference_type *pBody)
Definition: vclptr.hxx:153
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
bool isDisposed() const
ScrollBar & getHorzScrollBar()
Definition: layout.hxx:495
void setUserManagedScrolling(bool bUserManagedScrolling)
Definition: layout.hxx:499
ScrollBar & getVertScrollBar()
Definition: layout.hxx:494
VclEventId GetId() const
Definition: vclevent.hxx:185
void * GetData() const
Definition: vclevent.hxx:199
vcl::Window * GetWindow() const
Definition: vclevent.hxx:198
void RemovePage(std::u16string_view rPageId)
Definition: ivctrl.cxx:582
void SetCurPageId(const OUString &rId)
Definition: ivctrl.cxx:522
sal_uInt16 GetPagePos(std::u16string_view rPageId) const
Definition: ivctrl.cxx:598
const OUString & GetCurPageId() const
void SetActivatePageHdl(const Link< VerticalTabControl *, void > &rLink)
OUString GetPageText(std::u16string_view rPageId) const
Definition: ivctrl.cxx:614
VclPtr< vcl::Window > GetPage(std::u16string_view rPageId) const
Definition: ivctrl.cxx:606
sal_uInt16 GetPageCount() const
void SetDeactivatePageHdl(const Link< VerticalTabControl *, bool > &rLink)
const OUString & GetPageId(sal_uInt16 nIndex) const
Definition: ivctrl.cxx:550
vcl::Window * GetPageParent()
void InsertPage(const OUString &rPageId, const OUString &rLabel, const Image &rImage, const OUString &rTooltip, VclPtr< vcl::Window > xPage, int nPos=-1)
Definition: ivctrl.cxx:555
void SetPageText(std::u16string_view rPageId, const OUString &rText)
Definition: ivctrl.cxx:622
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true, bool bAlphaMaskTransparent=false)
Definition: virdev.cxx:405
WeldTextFilter(Link< OUString &, bool > &rInsertTextHdl)
virtual OUString filter(const OUString &rText) override
Link< OUString &, bool > & m_rInsertTextHdl
Definition: salvtables.hxx:600
bool mbClipChildren
Definition: window.h:353
bool mbReallyVisible
Definition: window.h:333
TYPE getX() const
TYPE getY() const
std::unique_ptr< weld::Label > m_xLabel
std::pair< Key, Value > key_value_pair_t
size_type count(const Value &v) const
size_type erase(const Value &x)
std::pair< const_iterator, bool > insert(Value &&x)
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr void SetBottom(tools::Long v)
constexpr Point BottomRight() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr bool IsEmpty() const
static OUString getProductName()
tools::Long GetFontHeight() const
Definition: font/font.cxx:909
void SetFontHeight(tools::Long nHeight)
Definition: font/font.cxx:908
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
wizard for a roadmap
Definition: wizdlg.hxx:65
VclPtr< OKButton > m_pFinish
Definition: wizdlg.hxx:96
bool ShowPage(sal_uInt16 nLevel)
sal_uInt16 GetCurLevel() const
Definition: wizdlg.hxx:122
void SetRoadmapHelpId(const OUString &_rId)
void SetItemSelectHdl(const Link< LinkParamNone *, void > &_rHdl)
void AddPage(TabPage *pPage)
const Size & GetPageSizePixel() const
Definition: wizdlg.hxx:133
VclPtr< CancelButton > m_pCancel
Definition: wizdlg.hxx:97
void SetRoadmapBitmap(const BitmapEx &maBitmap)
void SetPage(sal_uInt16 nLevel, TabPage *pPage)
void SetPageSizePixel(const Size &rSize)
Definition: wizdlg.hxx:132
VclPtr< PushButton > m_pNextPage
Definition: wizdlg.hxx:98
VclPtr< PushButton > m_pPrevPage
Definition: wizdlg.hxx:99
VclPtr< HelpButton > m_pHelp
Definition: wizdlg.hxx:100
TabPage * GetPage(sal_uInt16 nLevel) const
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2806
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: window3.cxx:66
void SetStyle(WinBits nStyle)
Definition: window.cxx:1962
void SetFont(const vcl::Font &rNewFont)
Definition: window3.cxx:59
void SetCursorRect(const tools::Rectangle *pRect=nullptr, tools::Long nExtTextInputWidth=0)
Definition: window.cxx:2112
void SetUpdateMode(bool bUpdate)
Definition: window.cxx:2967
void SetInputContext(const InputContext &rInputContext)
Definition: window.cxx:2076
bool IsReallyVisible() const
Definition: window2.cxx:1133
vcl::Window * GetParent() const
Definition: window2.cxx:1123
void SetMnemonicActivateHdl(const Link< vcl::Window &, bool > &rLink)
Definition: dlgctrl.cxx:508
SAL_DLLPRIVATE vcl::Window * ImplGetDlgWindow(sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart=0, sal_uInt16 nEnd=0xFFFF, sal_uInt16 *pIndex=nullptr)
Definition: dlgctrl.cxx:205
bool IsMouseCaptured() const
Definition: mouse.cxx:481
void RemoveEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:312
void SetControlForeground()
Definition: window2.cxx:486
bool HasChildPathFocus(bool bSystemWindow=false) const
Definition: window.cxx:3004
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2799
void SetControlFont()
Definition: window2.cxx:438
VclPtr< vcl::Window > GetFocusedWindow() const
Definition: window.cxx:2991
const OUString & get_id() const
Get the ID of the window.
Definition: window.cxx:3935
sal_uInt16 GetChildCount() const
Definition: stacking.cxx:1002
WindowType GetType() const
Definition: window2.cxx:1000
float approximate_digit_width() const
Definition: window3.cxx:72
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1288
static DockingManager * GetDockingManager()
Definition: window2.cxx:834
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Definition: window.cxx:2424
Size get_preferred_size() const
Definition: window2.cxx:1694
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1036
void SetCursor(vcl::Cursor *pCursor)
Definition: window.cxx:3013
void set_grid_left_attach(sal_Int32 nAttach)
Definition: window2.cxx:1839
SAL_DLLPRIVATE bool ImplIsChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
Definition: stacking.cxx:683
void set_height_request(sal_Int32 nHeightRequest)
Definition: window2.cxx:1644
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
Definition: window2.cxx:1353
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
void set_margin_bottom(sal_Int32 nWidth)
Definition: window2.cxx:1929
void GrabFocus()
Definition: window.cxx:2976
void set_id(const OUString &rID)
Sets an ID.
Definition: window.cxx:3930
void SetControlBackground()
Definition: window2.cxx:526
bool IsUpdateMode() const
Definition: window2.cxx:1199
bool HasFocus() const
Definition: window.cxx:2981
void set_margin_end(sal_Int32 nWidth)
Definition: window2.cxx:1897
sal_Int32 get_margin_end() const
Definition: window2.cxx:1907
void SetHelpHdl(const Link< vcl::Window &, bool > &rLink)
Definition: window.cxx:1861
void reorderWithinParent(sal_uInt16 nNewPosition)
Definition: stacking.cxx:163
void set_hexpand(bool bExpand)
Definition: window2.cxx:1755
virtual Point GetPosPixel() const
Definition: window.cxx:2794
void SetParent(vcl::Window *pNewParent)
Definition: stacking.cxx:832
virtual void EnableRTL(bool bEnable=true)
Definition: window3.cxx:216
void SetMapMode()
Definition: window3.cxx:125
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
void Enable(bool bEnable=true, bool bChild=true)
Definition: window.cxx:2433
void SetAccessibleDescription(const OUString &rDescr)
bool IsMapModeEnabled() const
Definition: window3.cxx:106
void LeaveWait()
Definition: mouse.cxx:614
WinBits GetStyle() const
Definition: window2.cxx:979
const AllSettings & GetSettings() const
Definition: window3.cxx:129
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
vcl::Window * GetAccessibleRelationLabeledBy() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: paint.cxx:1020
const OUString & GetHelpId() const
Definition: window2.cxx:859
bool get_vexpand() const
Definition: window2.cxx:1761
vcl::Font GetControlFont() const
Definition: window2.cxx:467
vcl::Font GetPointFont(vcl::RenderContext const &rRenderContext) const
Definition: window.cxx:2180
const MapMode & GetMapMode() const
Definition: window3.cxx:99
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:419
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void SetAccessibleName(const OUString &rName)
const vcl::ILibreOfficeKitNotifier * GetLOKNotifier() const
Definition: window.cxx:3246
void Hide()
Definition: window.hxx:879
sal_Int32 get_margin_top() const
Definition: window2.cxx:1923
SystemWindow * GetSystemWindow() const
Definition: stacking.cxx:807
sal_Int32 get_margin_start() const
Definition: window2.cxx:1891
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
Definition: window.hxx:528
void SetSettings(const AllSettings &rSettings)
Definition: window3.cxx:208
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:307
void set_margin_top(sal_Int32 nWidth)
Definition: window2.cxx:1913
sal_Int32 get_height_request() const
Definition: window2.cxx:1945
virtual css::uno::Reference< css::awt::XVclWindowPeer > GetComponentInterface(bool bCreate=true)
Definition: window.cxx:3145
void add_to_size_group(const std::shared_ptr< VclSizeGroup > &xGroup)
Definition: window2.cxx:1981
SalFrame * ImplGetFrame() const
Definition: window2.cxx:879
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:323
void ReleaseMouse()
Definition: mouse.cxx:469
sal_Int32 get_grid_left_attach() const
Definition: window2.cxx:1833
sal_Int32 get_grid_top_attach() const
Definition: window2.cxx:1857
void set_width_request(sal_Int32 nWidthRequest)
Definition: window2.cxx:1658
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Definition: window.cxx:3356
bool IsRTLEnabled() const
Definition: window3.cxx:127
Point PixelToLogic(const Point &rDevicePt) const
Definition: window3.cxx:161
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
virtual Size GetSizePixel() const
Definition: window.cxx:2402
bool IsControlBackground() const
Definition: window2.cxx:1113
Point GetPointerPosPixel()
Definition: mouse.cxx:540
const Color & GetControlBackground() const
Definition: window2.cxx:1108
virtual void SetPointer(PointerStyle)
Definition: mouse.cxx:486
vcl::Window * GetAccessibleRelationMemberOf() const
OUString GetAccessibleName() const
sal_Int32 get_width_request() const
Definition: window2.cxx:1951
virtual void ApplySettings(vcl::RenderContext &rRenderContext)
Definition: window.cxx:3850
void EnterWait()
Definition: mouse.cxx:601
void set_margin_start(sal_Int32 nWidth)
Definition: window2.cxx:1881
sal_Int32 get_margin_bottom() const
Definition: window2.cxx:1939
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1025
bool IsVisible() const
Definition: window2.cxx:1128
void EnableDocking(bool bEnable=true)
Definition: window2.cxx:839
void CaptureMouse()
Definition: mouse.cxx:451
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1283
weld::Window * GetFrameWeld() const
Definition: window2.cxx:884
void set_grid_top_attach(sal_Int32 nAttach)
Definition: window2.cxx:1863
void SetQuickHelpText(const OUString &rHelpText)
Definition: window2.cxx:1252
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2855
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3026
virtual OUString GetText() const
Definition: window.cxx:3055
void SetAccessibleRelationLabelFor(vcl::Window *pLabelFor)
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
Definition: window.cxx:3447
vcl::Window * GetFrameWindow() const
Definition: window2.cxx:890
void EnableMapMode(bool bEnable=true)
Definition: window3.cxx:105
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget()
Definition: mouse.cxx:651
virtual bool set_property(const OUString &rKey, const OUString &rValue)
Definition: window2.cxx:1478
Point ScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2812
void set_vexpand(bool bExpand)
Definition: window2.cxx:1767
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
Definition: event.cxx:328
void EnableNativeWidget(bool bEnable=true)
Definition: window.cxx:3681
void set_grid_width(sal_Int32 nCols)
Definition: window2.cxx:1827
const OUString & GetQuickHelpText() const
Definition: window2.cxx:1258
tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const
Definition: window.cxx:2914
void SetAccessibleRelationLabeledBy(vcl::Window *pLabeledBy)
vcl::Window * GetChild(sal_uInt16 nChild) const
Definition: stacking.cxx:1018
void SetDumpAsPropertyTreeHdl(const Link< tools::JsonWriter &, void > &rLink)
Definition: window.cxx:1782
OUString GetAccessibleDescription() const
bool IsActive() const
Definition: window2.cxx:1209
bool IsEnabled() const
Definition: window2.cxx:1148
virtual const SystemEnvData * GetSystemData() const
Definition: window.cxx:3854
void SetHelpId(const OUString &)
Definition: window2.cxx:854
void SetBackground()
Definition: window3.cxx:100
bool get_hexpand() const
Definition: window2.cxx:1749
Size signal_custom_get_size(vcl::RenderContext &rDevice)
Definition: weld.hxx:743
virtual void connect_container_focus_changed(const Link< Container &, void > &rLink)
Definition: weld.hxx:379
void signal_container_focus_changed()
Definition: weld.hxx:368
void connect_focus_out(const Link< weld::Widget &, void > &rLink)
Definition: weldutils.hxx:240
void connect_changed(const Link< weld::Entry &, void > &rLink)
Definition: weldutils.hxx:239
std::unique_ptr< Entry > m_xEntry
Definition: weld.hxx:1930
EntryTreeView(std::unique_ptr< Entry > xEntry, std::unique_ptr< TreeView > xTreeView)
Definition: builder.cxx:383
std::unique_ptr< TreeView > m_xTreeView
Definition: weld.hxx:1931
Link< Entry &, void > m_aCursorPositionHdl
Definition: weld.hxx:1725
virtual void connect_cursor_position(const Link< Entry &, void > &rLink)
Definition: weld.hxx:1773
virtual void connect_changed(const Link< Entry &, void > &rLink)
Definition: weld.hxx:1769
void signal_changed()
Definition: weld.hxx:1730
virtual void connect_query_tooltip(const Link< const TreeIter &, OUString > &rLink)
Definition: weld.hxx:1449
virtual void connect_get_property_tree_elem(const Link< const json_prop_query &, bool > &rLink)
Definition: weld.hxx:1455
virtual void insert_page(const OUString &rIdent, const OUString &rLabel, int nPos)=0
virtual void set_tab_label_text(const OUString &rIdent, const OUString &rLabel)=0
virtual OUString get_current_page_ident() const =0
virtual int get_n_pages() const =0
virtual OUString get_page_ident(int nPage) const =0
virtual int get_page_index(const OUString &rIdent) const =0
virtual weld::Container * get_page(const OUString &rIdent) const =0
virtual void set_current_page(int nPage)=0
virtual void set_show_tabs(bool bShow)=0
virtual OUString get_tab_label_text(const OUString &rIdent) const =0
virtual void remove_page(const OUString &rIdent)=0
virtual int get_current_page() const =0
virtual void set_position(int nPos)=0
virtual int get_position() const =0
void signal_closed()
Definition: weld.hxx:2468
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
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
virtual void set_value(int value)=0
virtual int adjustment_get_page_increment() const =0
virtual void set_scroll_thickness(int nThickness)=0
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
virtual int adjustment_get_upper() const =0
virtual int adjustment_get_page_size() const =0
virtual int adjustment_get_value() const =0
virtual void set_mode(VclSizeGroupMode eMode)=0
virtual void add_widget(weld::Widget *pWidget)=0
static unsigned int Power10(unsigned int n)
Definition: builder.cxx:267
virtual void stop()=0
virtual void start()=0
virtual void connect_cursor_position(const Link< TextView &, void > &rLink)
Definition: weld.hxx:2253
Link< TextView &, void > m_aCursorPositionHdl
Definition: weld.hxx:2215
void signal_toggle_menu(const OUString &rIdent)
Definition: weld.hxx:2490
bool signal_collapsing(const TreeIter &rIter)
Definition: weld.hxx:960
virtual void connect_editing(const Link< const TreeIter &, bool > &rStartLink, const Link< const iter_string &, bool > &rEndLink)
Definition: weld.hxx:1272
virtual void connect_visible_range_changed(const Link< TreeView &, void > &rLink)
Definition: weld.hxx:1283
virtual void set_sort_func(const std::function< int(const weld::TreeIter &, const weld::TreeIter &)> &func)
Definition: weld.hxx:1321
bool signal_expanding(const TreeIter &rIter)
Definition: weld.hxx:956
virtual void connect_query_tooltip(const Link< const TreeIter &, OUString > &rLink)
Definition: weld.hxx:993
Link< const MouseEvent &, bool > m_aMouseReleaseHdl
Definition: weld.hxx:96
Link< const KeyEvent &, bool > m_aKeyPressHdl
Definition: weld.hxx:92
Link< const MouseEvent &, bool > m_aMousePressHdl
Definition: weld.hxx:94
virtual void connect_mouse_release(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:277
virtual void connect_mnemonic_activate(const Link< Widget &, bool > &rLink)
Definition: weld.hxx:241
Link< const Size &, void > m_aSizeAllocateHdl
Definition: weld.hxx:91
Link< const KeyEvent &, bool > m_aKeyReleaseHdl
Definition: weld.hxx:93
virtual void connect_size_allocate(const Link< const Size &, void > &rLink)
Definition: weld.hxx:247
virtual void connect_style_updated(const Link< Widget &, void > &rLink)
Definition: weld.hxx:283
virtual void connect_key_release(const Link< const KeyEvent &, bool > &rLink)
Definition: weld.hxx:259
virtual void connect_focus_out(const Link< Widget &, void > &rLink)
Definition: weld.hxx:232
virtual void connect_mouse_move(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:271
Link< Widget &, void > m_aFocusOutHdl
Definition: weld.hxx:88
Link< Widget &, void > m_aStyleUpdatedHdl
Definition: weld.hxx:90
virtual void connect_mouse_press(const Link< const MouseEvent &, bool > &rLink)
Definition: weld.hxx:265
Link< Widget &, void > m_aFocusInHdl
Definition: weld.hxx:87
Link< const MouseEvent &, bool > m_aMouseMotionHdl
Definition: weld.hxx:95
virtual void connect_key_press(const Link< const KeyEvent &, bool > &rLink)
Definition: weld.hxx:253
virtual void connect_focus_in(const Link< Widget &, void > &rLink)
Definition: weld.hxx:226
Link< Widget &, bool > m_aMnemonicActivateHdl
Definition: weld.hxx:89
Link< Widget &, bool > m_aHelpRequestHdl
Definition: weld.hxx:527
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define COMBOBOX_APPEND
Definition: combobox.hxx:30
Any value
#define TREELIST_APPEND
int nCount
virtual void SetText(const OUString &rStr) override
float u
float y
float x
#define max(a, b)
#define MOUSE_LEFT
Definition: event.hxx:102
FieldUnit
DocumentType eType
sal_Int16 nValue
#define SELECTION_MAX
TriState
TRISTATE_FALSE
TRISTATE_INDET
TRISTATE_TRUE
#define HEADERBAR_FULLSIZE
Definition: headbar.hxx:202
HeaderBarItemBits
Definition: headbar.hxx:181
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
sal_Int32 nIndex
Mode eMode
uno_Any a
constexpr sal_uInt16 KEY_PAGEDOWN
Definition: keycodes.hxx:117
constexpr sal_uInt16 KEY_UP
Definition: keycodes.hxx:111
constexpr sal_uInt16 KEY_DOWN
Definition: keycodes.hxx:110
constexpr sal_uInt16 KEY_PAGEUP
Definition: keycodes.hxx:116
#define LANGUAGE_DONTKNOW
void sort_native_button_order(const VclBox &rContainer)
Definition: layout.cxx:862
bool isContainerWindow(const vcl::Window &rWindow)
Definition: layout.hxx:817
sal_uInt16 nPos
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
PopupMenuFlags
Definition: menu.hxx:72
constexpr sal_uInt16 MENU_APPEND
Definition: menu.hxx:67
std::unique_ptr< sal_Int32[]> pData
RttiCompleteObjectLocator col
size
int i
index
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::shared_ptr< T > make_shared(Args &&... args)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
help
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
BitmapEx GetBitmapEx(BitmapEx const &rBitmapEx, DrawModeFlags nDrawMode)
Definition: drawmode.cxx:242
ImageType
Definition: vclenum.hxx:280
WindowDataMask
Definition: windowstate.hxx:43
ColumnToggleType
Definition: weld.hxx:895
Placement
Definition: weld.hxx:2390
std::tuple< tools::JsonWriter &, const TreeIter &, std::string_view > json_prop_query
Definition: weld.hxx:1385
EntryMessageType
Definition: weld.hxx:703
LabelType
Definition: weld.hxx:2182
std::vector< ScreenShotEntry > ScreenShotCollection
Definition: weld.hxx:522
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Reference< XNameAccess > m_xContainer
sal_Int16 nId
@ OUTDEV_PDF
Definition: outdev.hxx:145
@ OUTDEV_VIRDEV
Definition: outdev.hxx:145
@ OUTDEV_WINDOW
Definition: outdev.hxx:145
@ OUTDEV_PRINTER
Definition: outdev.hxx:145
PointerStyle
Definition: ptrstyle.hxx:26
#define SAL_FRAME_POSSIZE_X
Definition: salframe.hxx:103
#define SAL_FRAME_POSSIZE_HEIGHT
Definition: salframe.hxx:106
#define SAL_FRAME_POSSIZE_WIDTH
Definition: salframe.hxx:105
#define SAL_FRAME_POSSIZE_Y
Definition: salframe.hxx:104
static SalInstanceTreeView * g_DragSource
std::set< VclPtr< vcl::Window > > winset
IMPL_LINK_NOARG(SalFlashAttention, FlashTimeout, Timer *, void)
Definition: salvtables.cxx:305
IMPL_STATIC_LINK_NOARG(SalInstanceTreeView, FinishDragHdl, SvTreeListBox *, void)
static void set_label_wrap(Control &rWidget, bool wrap)
IMPL_LINK(SalInstanceWidget, SettingsChangedHdl, VclWindowEvent &, rEvent, void)
Definition: salvtables.cxx:577
bool(* SALFRAMEPROC)(vcl::Window *pInst, SalEvent nEvent, const void *pEvent)
Definition: salwtype.hxx:233
ImplSVWinData * mpWinData
Definition: svdata.hxx:400
VclPtr< vcl::Window > mpFocusWin
Definition: svdata.hxx:251
SvTreeListEntry * iter
std::function< void(sal_Int32)> maEndDialogFn
Definition: abstdlg.hxx:64
std::shared_ptr< weld::Dialog > mxOwnerSelf
Definition: abstdlg.hxx:63
std::shared_ptr< weld::DialogController > mxOwnerDialogController
Definition: abstdlg.hxx:61
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
vcl::Window * ImplGetDefaultWindow()
Returns either the application window, or the default GL context window.
Definition: svdata.cxx:212
OUString VclResId(TranslateId aId)
Definition: svdata.cxx:261
#define TAB_APPEND
Definition: tabctrl.hxx:38
#define TAB_PAGE_NOTFOUND
Definition: tabctrl.hxx:39
@ HIGHEST
These events should run very fast!
weld::Builder * m_pBuilder
bool bVisible
#define SV_TAB_BORDER
Definition: treelistbox.hxx:79
std::tuple< vcl::RenderContext &, const tools::Rectangle &, const SvTreeListEntry & > svtree_render_args
SvTreeFlags
Definition: treelistbox.hxx:84
std::pair< vcl::RenderContext &, const SvTreeListEntry & > svtree_measure_args
SvTLEntryFlags
unsigned char sal_uInt8
#define SAL_MAX_UINT32
MenuItemBits
Definition: vclenum.hxx:33
ToolBoxButtonSize
Definition: vclenum.hxx:267
SelectionMode
Definition: vclenum.hxx:26
@ RET_HELP
Definition: vclenum.hxx:212
@ RET_OK
Definition: vclenum.hxx:206
@ RET_CLOSE
Definition: vclenum.hxx:211
@ RET_CANCEL
Definition: vclenum.hxx:205
@ RET_NO
Definition: vclenum.hxx:208
@ RET_YES
Definition: vclenum.hxx:207
VclPolicyType
Definition: vclenum.hxx:243
VclMessageType
Definition: vclenum.hxx:226
ScrollType
Definition: vclenum.hxx:372
FloatWinPopupFlags
Definition: vclenum.hxx:323
TxtAlign
Definition: vclenum.hxx:316
VclButtonsType
Definition: vclenum.hxx:216
VclSizeGroupMode
Definition: vclenum.hxx:235
@ WindowEndPopupMode
@ WindowMouseButtonDown
@ EditSelectionChanged
@ WindowMouseButtonUp
css::uno::Reference< css::accessibility::XAccessibleRelationSet > a11yrelationset
Definition: weld.hxx:52
css::uno::Reference< css::accessibility::XAccessible > a11yref
Definition: weld.hxx:51
void InvertFocusRect(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: window2.cxx:2030
sal_Int64 WinBits
Definition: wintypes.hxx:109
WinBits const WB_CLOSEABLE
Definition: wintypes.hxx:123
WinBits const WB_VCENTER
Definition: wintypes.hxx:150
WinBits const WB_STDDIALOG
Definition: wintypes.hxx:216
WinBits const WB_DIALOGCONTROL
Definition: wintypes.hxx:113
WinBits const WB_CENTER
Definition: wintypes.hxx:147
WindowType
Definition: wintypes.hxx:27
@ VERTICALTABCONTROL
WinBits const WB_SIZEABLE
Definition: wintypes.hxx:117
WinBits const WB_NOTABSTOP
Definition: wintypes.hxx:141
WinBits const WB_AUTOVSCROLL
Definition: wintypes.hxx:163
WinBits const WB_AUTOHSCROLL
Definition: wintypes.hxx:161
WinBits const WB_HORZ
Definition: wintypes.hxx:144
WinBits const WB_RIGHT
Definition: wintypes.hxx:148
WinBits const WB_SORT
Definition: wintypes.hxx:158
WinBits const WB_WORDBREAK
Definition: wintypes.hxx:156
WinBits const WB_DEFBUTTON
Definition: wintypes.hxx:181
WinBits const WB_VSCROLL
Definition: wintypes.hxx:178
WinBits const WB_TABSTOP
Definition: wintypes.hxx:140
WinBits const WB_CLIPCHILDREN
Definition: wintypes.hxx:112
WinBits const WB_HIDE
Definition: wintypes.hxx:160
WinBits const WB_LEFT
Definition: wintypes.hxx:146
WinBits const WB_HSCROLL
Definition: wintypes.hxx:177
size_t pos
std::unique_ptr< char[]> aBuffer