10#include <config_feature_desktop.h>
11#include <config_options.h>
12#include <config_vclplug.h>
16#include <unordered_map>
17#include <com/sun/star/accessibility/AccessibleRole.hpp>
23#include <officecfg/Office/Common.hxx>
24#include <osl/module.hxx>
65#include <bitmaps.hlst>
77#include <calendar.hxx>
88#if defined(DISABLE_DYNLOADING) || defined(LINUX)
92static bool toBool(std::string_view rValue)
94 return (!rValue.empty() && (rValue[0] ==
't' || rValue[0] ==
'T' || rValue[0] ==
'1'));
99 OUString mapStockToImageResource(std::u16string_view sType)
101 if (sType == u
"view-refresh")
102 return SV_RESID_BITMAP_REFRESH;
103 else if (sType == u
"dialog-error")
105 else if (sType == u
"list-add")
107 else if (sType == u
"list-remove")
109 else if (sType == u
"edit-copy")
111 else if (sType == u
"edit-paste")
113 else if (sType == u
"document-open")
115 else if (sType == u
"open-menu-symbolic")
117 else if (sType == u
"window-close-symbolic")
118 return SV_RESID_BITMAP_CLOSEDOC;
119 else if (sType == u
"x-office-calendar")
129 if (
sType ==
u"media-skip-forward")
131 else if (
sType ==
u"media-skip-backward")
133 else if (
sType ==
u"media-playback-start")
135 else if (
sType ==
u"media-playback-stop")
137 else if (
sType ==
u"go-first")
139 else if (
sType ==
u"go-last")
141 else if (
sType ==
u"go-previous")
143 else if (
sType ==
u"go-next")
145 else if (
sType ==
u"go-up")
147 else if (
sType ==
u"go-down")
149 else if (
sType ==
u"missing-image")
151 else if (
sType ==
u"help-browser" ||
sType ==
u"help-browser-symbolic")
153 else if (
sType ==
u"window-close")
155 else if (
sType ==
u"document-new")
157 else if (
sType ==
u"pan-down-symbolic")
159 else if (
sType ==
u"pan-up-symbolic")
161 else if (!mapStockToImageResource(
sType).isEmpty())
170#if defined SAL_LOG_WARN
208 else if (rUIFile ==
u"modules/scalc/ui/inputbar.ui")
217 const ILibreOfficeKitNotifier* pNotifier)
236 auto it = std::find_if(
237 rList.begin(), rList.end(),
238 [&rUnit](
const std::pair<OUString, FieldUnit>& rItem) { return rItem.second == rUnit; });
239 if (it != rList.end())
247 signal_value_changed();
252 OUString sNewText(format_number(rSpinButton.get_value()));
253 if (sNewText != rSpinButton.get_text())
254 rSpinButton.set_text(sNewText);
263 int chars = ceil(width /
m_xSpinButton->get_approximate_digit_width());
270 for (
unsigned int i = 0;
i <
n; ++
i)
279 if ((
nValue < (std::numeric_limits<sal_Int64>::min() + nFactor)) ||
280 (
nValue > (std::numeric_limits<sal_Int64>::max() - nFactor)))
285 const int nHalf = nFactor / 2;
288 return (
nValue - nHalf) / nFactor;
289 return (
nValue + nHalf) / nFactor;
314 OUString sDoublePrime =
u"\u2033";
315 if (aSuffix !=
"\"" && aSuffix != sDoublePrime)
318 aSuffix = sDoublePrime;
322 OUString sPrime =
u"\u2032";
323 if (aSuffix !=
"'" && aSuffix != sPrime)
371 bool bRet =
vcl::TextToValue(get_text(), fResult, 0, m_xSpinButton->get_digits(), rLocaleData, m_eSrcUnit);
384 : m_xEntry(
std::move(xEntry))
385 , m_xTreeView(
std::move(xTreeView))
393 m_xEntry->set_text(rView.get_selected_text());
394 m_aChangeHdl.Call(*
this);
399 m_aChangeHdl.Call(*
this);
404 int nHeight = nRows == -1 ? -1 :
m_xTreeView->get_height_rows(nRows);
412 std::unique_ptr<weld::TreeIter> xEntry(rTreeView.
make_iterator(&rIter));
416 while (xEntry && rTreeView.
iter_compare(*xEntry, rIter) != 0)
432 std::unique_ptr<weld::TreeIter> xEntry(rTreeView.
make_iterator(&rIter));
433 bool bRetVal =
false;
447 OUString sID, css::uno::Reference<css::frame::XFrame> xFrame,
449 : m_pNotebookBarAddonsItem(pNotebookBarAddonsItem
452 , m_sID(
std::move(sID))
453 , m_sHelpRoot(sUIFile)
456 , m_bToplevelParentFound(false)
471 OUString sUri = sUIDir + sUIFile;
479 catch (
const css::uno::Exception &rExcept)
487 for (
auto const& mnemonicWidget :
m_pParserState->m_aMnemonicWidgetMaps)
489 FixedText *pOne = get<FixedText>(mnemonicWidget.m_sID);
491 SAL_WARN_IF(!pOne || !pOther,
"vcl",
"missing either source " << mnemonicWidget.m_sID
492 <<
" or target " << mnemonicWidget.m_sValue <<
" member of Mnemonic Widget Mapping");
503 for (
auto const& [ rType, rParam ] : rMap)
508 if (role != com::sun::star::accessibility::AccessibleRole::UNKNOWN)
514 SAL_WARN_IF(!pTarget,
"vcl",
"missing parameter of a11y relation: " << rParam);
517 if (rType ==
"labelled-by")
519 else if (rType ==
"label-for")
523 SAL_WARN(
"vcl.builder",
"unhandled a11y relation :" << rType);
533 RadioButton *pOther = get<RadioButton>(elem.m_sValue);
534 SAL_WARN_IF(!pOne || !pOther,
"vcl",
"missing member of radiobutton group");
538 pOne->
group(*pOther);
541 pOther->
group(*pOne);
553 assert(models.
insert(elem.m_sValue).second &&
"a liststore or treestore is used in duplicate widgets");
560 SAL_WARN_IF(!pListBoxTarget && !pComboBoxTarget && !pTreeBoxTarget && !
dynamic_cast<IconView*
>(pTarget),
"vcl",
"missing elements of combobox");
561 if (pListBoxTarget && pStore)
562 mungeModel(*pListBoxTarget, *pStore, elem.m_nActiveId);
563 else if (pComboBoxTarget && pStore)
564 mungeModel(*pComboBoxTarget, *pStore, elem.m_nActiveId);
565 else if (pTreeBoxTarget && pStore)
566 mungeModel(*pTreeBoxTarget, *pStore, elem.m_nActiveId);
574 SAL_WARN_IF(!pTarget || !pBuffer,
"vcl",
"missing elements of textview/textbuffer");
575 if (pTarget && pBuffer)
580 for (
auto const& elem :
m_pParserState->m_aNumericFormatterAdjustmentMaps)
582 NumericFormatter *pTarget =
dynamic_cast<NumericFormatter*
>(
get(elem.m_sID));
584 SAL_WARN_IF(!pTarget,
"vcl",
"missing NumericFormatter element of spinbutton/adjustment");
585 SAL_WARN_IF(!pAdjustment,
"vcl",
"missing Adjustment element of spinbutton/adjustment");
586 if (pTarget && pAdjustment)
590 for (
auto const& elem :
m_pParserState->m_aFormattedFormatterAdjustmentMaps)
594 SAL_WARN_IF(!pTarget,
"vcl",
"missing FormattedField element of spinbutton/adjustment");
595 SAL_WARN_IF(!pAdjustment,
"vcl",
"missing Adjustment element of spinbutton/adjustment");
596 if (pTarget && pAdjustment)
603 ScrollBar *pTarget = get<ScrollBar>(elem.m_sID);
605 SAL_WARN_IF(!pTarget || !pAdjustment,
"vcl",
"missing elements of scrollbar/adjustment");
606 if (pTarget && pAdjustment)
615 SAL_WARN_IF(!pTarget || !pAdjustment,
"vcl",
"missing elements of scale(slider)/adjustment");
616 if (pTarget && pAdjustment)
625 std::shared_ptr<VclSizeGroup> xGroup(std::make_shared<VclSizeGroup>());
627 for (
auto const& [ rKey, rValue ] : sizeGroup.m_aProperties)
628 xGroup->set_property(rKey, rValue);
630 for (
auto const& elem : sizeGroup.m_aWidgets)
638 std::set<OUString> aImagesToBeRemoved;
643 Button *pTarget =
nullptr;
647 pTargetButton = get<PushButton>(elem.m_sID);
648 pTarget = pTargetButton;
652 pTargetRadio = get<RadioButton>(elem.m_sID);
653 pTarget = pTargetRadio;
656 FixedImage *pImage = get<FixedImage>(elem.m_sValue);
658 "vcl",
"missing elements of button/image/stock");
659 if (!pTarget || !pImage)
661 aImagesToBeRemoved.insert(elem.m_sValue);
697 switch (aFind->second)
715 SAL_WARN(
"vcl.builder",
"unsupported image size " << aFind->second);
724 for (
auto const& elem : aImagesToBeRemoved)
732 MenuButton *pTarget = get<MenuButton>(elem.m_sID);
735 "vcl",
"missing elements of button/menu");
736 if (!pTarget || !pMenu)
743 for (
auto const& elem :
m_pParserState->m_aRedundantParentWidgets)
756 elem->set_label(pLabelWidget->
GetText());
765 elem->create_message_area();
771 "Requested top level widget \"" <<
m_sID <<
"\" not found in " << sUIFile);
773#if defined SAL_LOG_WARN
777 bool bHasDefButton =
false;
780 if (isButtonType(child.m_pWindow->GetType()))
785 bHasDefButton =
true;
790 SAL_WARN_IF(nButtons && !bHasDefButton,
"vcl.builder",
"No default button defined in " << sUIFile);
795 officecfg::Office::Common::Help::HelpRootURL::get().isEmpty();
810 for (std::vector<WinAndId>::reverse_iterator aI =
m_aChildren.rbegin(),
813 aI->m_pWindow.disposeAndClear();
817 for (std::vector<MenuAndId>::reverse_iterator aI =
m_aMenus.rbegin(),
818 aEnd =
m_aMenus.rend(); aI != aEnd; ++aI)
820 aI->m_pMenu.disposeAndClear();
830 bool bHasFrame =
true;
831 VclBuilder::stringmap::iterator aFind = rMap.find(
"has-frame");
832 if (aFind != rMap.end())
834 bHasFrame =
toBool(aFind->second);
842 bool bDrawValue =
true;
843 VclBuilder::stringmap::iterator aFind = rMap.find(
"draw-value");
844 if (aFind != rMap.end())
846 bDrawValue =
toBool(aFind->second);
855 VclBuilder::stringmap::iterator aFind = rMap.find(
"popup");
856 if (aFind != rMap.end())
858 sRet = aFind->second;
867 VclBuilder::stringmap::iterator aFind = rMap.find(
"name");
868 if (aFind != rMap.end())
870 sRet = aFind->second;
878 OUString sRet(
"top");
879 VclBuilder::stringmap::iterator aFind = rMap.find(
"value-pos");
880 if (aFind != rMap.end())
882 sRet = aFind->second;
890 OUString sRet(
"normal");
891 VclBuilder::stringmap::iterator aFind = rMap.find(
"type-hint");
892 if (aFind != rMap.end())
894 sRet = aFind->second;
902 bool bResizable =
true;
903 VclBuilder::stringmap::iterator aFind = rMap.find(
"resizable");
904 if (aFind != rMap.end())
906 bResizable =
toBool(aFind->second);
912#if HAVE_FEATURE_DESKTOP
916 VclBuilder::stringmap::iterator aFind = rMap.find(
"modal");
917 if (aFind != rMap.end())
919 bModal =
toBool(aFind->second);
928 bool bDecorated =
true;
929 VclBuilder::stringmap::iterator aFind = rMap.find(
"decorated");
930 if (aFind != rMap.end())
932 bDecorated =
toBool(aFind->second);
940 bool bCloseable =
true;
941 VclBuilder::stringmap::iterator aFind = rMap.find(
"deletable");
942 if (aFind != rMap.end())
944 bCloseable =
toBool(aFind->second);
952 bool bHasEntry =
false;
953 VclBuilder::stringmap::iterator aFind = rMap.find(
"has-entry");
954 if (aFind != rMap.end())
956 bHasEntry =
toBool(aFind->second);
964 bool bVertical =
false;
965 VclBuilder::stringmap::iterator aFind = rMap.find(
"orientation");
966 if (aFind != rMap.end())
968 bVertical = aFind->second.equalsIgnoreAsciiCase(
"vertical");
976 bool bVertical =
false;
977 VclBuilder::stringmap::iterator aFind = rMap.find(
"tab-pos");
978 if (aFind != rMap.end())
980 bVertical = aFind->second.equalsIgnoreAsciiCase(
"left") ||
981 aFind->second.equalsIgnoreAsciiCase(
"right");
989 bool bInconsistent =
false;
990 VclBuilder::stringmap::iterator aFind = rMap.find(
"inconsistent");
991 if (aFind != rMap.end())
993 bInconsistent =
toBool(aFind->second);
996 return bInconsistent;
1004 VclBuilder::stringmap::iterator aFind = rMap.find(
"pixbuf");
1005 if (aFind != rMap.end())
1007 sIconName = aFind->second;
1012 VclBuilder::stringmap::iterator aFind = rMap.find(
"icon-name");
1013 if (aFind != rMap.end())
1015 sIconName = aFind->second;
1019 if (sIconName ==
"missing-image")
1021 OUString sReplace = mapStockToImageResource(sIconName);
1022 return !sReplace.isEmpty() ? sReplace : sIconName;
1028 VclBuilder::stringmap::iterator aFind = rMap.find(
"relief");
1029 if (aFind != rMap.end())
1031 assert(aFind->second !=
"half" &&
"relief of 'half' unsupported");
1032 if (aFind->second ==
"none")
1042 VclBuilder::stringmap::iterator aFind = rMap.find(
"label");
1043 if (aFind != rMap.end())
1045 sType = aFind->second;
1053 OUString sActionName;
1054 VclBuilder::stringmap::iterator aFind = rMap.find(
"action-name");
1055 if (aFind != rMap.end())
1057 sActionName = aFind->second;
1066 VclBuilder::stringmap::iterator aFind = rMap.find(
"visible");
1067 if (aFind != rMap.end())
1069 bRet =
toBool(aFind->second);
1077 OUString sWidthRequest(
"0");
1078 OUString sHeightRequest(
"0");
1079 VclBuilder::stringmap::iterator aFind = rMap.find(
"width-request");
1080 if (aFind != rMap.end())
1082 sWidthRequest = aFind->second;
1085 aFind = rMap.find(
"height-request");
1086 if (aFind != rMap.end())
1088 sHeightRequest = aFind->second;
1091 return Size(sWidthRequest.toInt32(), sHeightRequest.toInt32());
1096 OUString sTooltipText;
1097 VclBuilder::stringmap::iterator aFind = rMap.find(
"tooltip-text");
1098 if (aFind == rMap.end())
1099 aFind = rMap.find(
"tooltip-markup");
1100 if (aFind != rMap.end())
1102 sTooltipText = aFind->second;
1105 return sTooltipText;
1111 VclBuilder::stringmap::iterator aFind = rMap.find(
"alignment");
1112 if (aFind != rMap.end())
1114 f = aFind->second.toFloat();
1123 VclBuilder::stringmap::iterator aFind = rMap.find(
"title");
1124 if (aFind != rMap.end())
1126 sTitle = aFind->second;
1134 bool bHeadersVisible =
true;
1135 VclBuilder::stringmap::iterator aFind = rMap.find(
"headers-visible");
1136 if (aFind != rMap.end())
1138 bHeadersVisible =
toBool(aFind->second);
1141 return bHeadersVisible;
1146 bool bSortIndicator =
false;
1147 VclBuilder::stringmap::iterator aFind = rMap.find(
"sort-indicator");
1148 if (aFind != rMap.end())
1150 bSortIndicator =
toBool(aFind->second);
1153 return bSortIndicator;
1158 bool bClickable =
false;
1159 VclBuilder::stringmap::iterator aFind = rMap.find(
"clickable");
1160 if (aFind != rMap.end())
1162 bClickable =
toBool(aFind->second);
1173 OUString
aCommand(extractActionName(rMap));
1184 if (!aTooltip.isEmpty())
1199 nBits |= extractRelief(rMap);
1209 nBits |= extractRelief(rMap);
1219 nBits |= extractRelief(rMap);
1228 if (extractResizable(rMap))
1230 if (extractCloseable(rMap))
1232 if (!extractDecorated(rMap))
1234 OUString
sType(extractTypeHint(rMap));
1235 if (sType ==
"utility")
1237 else if (sType ==
"popup-menu")
1239 else if (sType ==
"dock")
1249 VclBuilder::stringmap::iterator aFind = rMap.find(
"group");
1250 if (aFind != rMap.end())
1252 OUString sID = aFind->second;
1253 sal_Int32 nDelim = sID.indexOf(
':');
1255 sID = sID.copy(0, nDelim);
1263 if (!rAdjustment.isEmpty())
1264 m_pParserState->m_aNumericFormatterAdjustmentMaps.emplace_back(
id, rAdjustment);
1269 if (!rAdjustment.isEmpty())
1270 m_pParserState->m_aFormattedFormatterAdjustmentMaps.emplace_back(
id, rAdjustment);
1275 VclBuilder::stringmap::iterator aFind = rMap.find(
"adjustment");
1276 if (aFind != rMap.end())
1278 rAdjustmentMap.emplace_back(
id, aFind->second);
1289 sal_Int32 nActiveId = 0;
1290 VclBuilder::stringmap::iterator aFind = rMap.find(
"active");
1291 if (aFind != rMap.end())
1293 nActiveId = aFind->second.toInt32();
1301 bool bSelectable =
false;
1302 VclBuilder::stringmap::iterator aFind = rMap.find(
"selectable");
1303 if (aFind != rMap.end())
1305 bSelectable =
toBool(aFind->second);
1313 OUString sAdjustment;
1314 VclBuilder::stringmap::iterator aFind = rMap.find(
"adjustment");
1315 if (aFind != rMap.end())
1317 sAdjustment= aFind->second;
1326 bool bDrawIndicator =
false;
1327 VclBuilder::stringmap::iterator aFind = rMap.find(
"draw-indicator");
1328 if (aFind != rMap.end())
1330 bDrawIndicator =
toBool(aFind->second);
1333 return bDrawIndicator;
1339 VclBuilder::stringmap::iterator aFind = rMap.find(
"model");
1340 if (aFind != rMap.end())
1343 extractActive(rMap));
1350 VclBuilder::stringmap::iterator aFind = rMap.find(
"buffer");
1351 if (aFind != rMap.end())
1353 m_pParserState->m_aTextBufferMaps.emplace_back(
id, aFind->second);
1361 auto aFind = rMap.find(
"icon-size");
1362 if (aFind != rMap.end())
1363 nSize = aFind->second.toInt32();
1369 VclBuilder::stringmap::iterator aFind = rMap.find(
"image");
1370 if (aFind != rMap.end())
1372 m_pParserState->m_aButtonImageWidgetMaps.emplace_back(
id, aFind->second, bRadio);
1379 VclBuilder::stringmap::iterator aFind = rMap.find(
"mnemonic-widget");
1380 if (aFind != rMap.end())
1382 OUString sID = aFind->second;
1383 sal_Int32 nDelim = sID.indexOf(
':');
1385 sID = sID.copy(0, nDelim);
1386 m_pParserState->m_aMnemonicWidgetMaps.emplace_back(rLabelID, sID);
1400 rWinStyle |= nScrollBits;
1413 rMap[
"width-request"] = OUString::number(nWidthReq);
1415 rMap[
"height-request"] = OUString::number(nHeightReq);
1417 m_pParserState->m_aRedundantParentWidgets[pScrollParent] = pWindow;
1420#ifndef DISABLE_DYNLOADING
1427class NoAutoUnloadModule :
public osl::Module
1430 ~NoAutoUnloadModule() { release(); }
1435typedef std::map<OUString, std::shared_ptr<NoAutoUnloadModule>>
ModuleMap;
1439static std::shared_ptr<NoAutoUnloadModule> g_pMergedLib = std::make_shared<NoAutoUnloadModule>();
1442#ifndef SAL_DLLPREFIX
1443# define SAL_DLLPREFIX ""
1452#ifndef DISABLE_DYNLOADING
1459 static const char *aWidgetLibs[] = {
1462 for (
const auto & lib : aWidgetLibs)
1464 std::unique_ptr<NoAutoUnloadModule> pModule(
new NoAutoUnloadModule);
1466 if (pModule->loadRelative(&
thisModule, sModule))
1467 g_aModuleMap.insert(std::make_pair(sModule, std::move(pModule)));
1475#if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP
1482#elif defined EMSCRIPTEN && !ENABLE_QT5
1500 {
"makeNotebookbarTabControl", makeNotebookbarTabControl },
1506 for (
size_t i = 0;
i <
sizeof(custom_widgets) /
sizeof(custom_widgets[0]);
i++)
1507 if (strcmp(name, custom_widgets[i].name) == 0)
1508 return custom_widgets[i].func;
1519 const OUString
name = rName ==
"sfxlo-SidebarToolBox" ?
"sfxlo-NotebookbarToolBox" : rName;
1521 if (sal_Int32 nDelim =
name.indexOf(
'-'); nDelim != -1)
1523 const OUString sFunction(OUString::Concat(
"make") +
name.subView(nDelim + 1));
1525#ifndef DISABLE_DYNLOADING
1527 +
name.subView(0, nDelim)
1532 std::shared_ptr<NoAutoUnloadModule> pModule;
1534 if (!g_pMergedLib->is())
1537 g_pMergedLib->getFunctionSymbol(sFunction))))
1538 pModule = g_pMergedLib;
1542 pModule = std::make_shared<NoAutoUnloadModule>();
1543 bool ok = pModule->loadRelative(&
thisModule, sModule);
1554 assert(ok &&
"couldn't even directly dlsym the sFunction (available via preload)");
1557 assert(ok &&
"bad module name in .ui");
1562 pModule->getFunctionSymbol(sFunction));
1569 aI->second->getFunctionSymbol(sFunction));
1570#elif !HAVE_FEATURE_DESKTOP || (defined EMSCRIPTEN && !ENABLE_QT5)
1573 pFunction = lo_get_custom_widget_func(sFunction.toUtf8().getStr());
1574 SAL_WARN_IF(!pFunction,
"vcl.builder",
"Could not find " << sFunction);
1578 osl_getFunctionSymbol((oslModule)RTLD_DEFAULT, sFunction.pData));
1588 bool bIsPlaceHolder =
name.isEmpty();
1589 bool bVertical =
false;
1594 bool bTopLevel(
name ==
"GtkDialog" ||
name ==
"GtkMessageDialog" ||
1595 name ==
"GtkWindow" ||
name ==
"GtkPopover" ||
name ==
"GtkAssistant");
1603 sal_uInt16 nNewPageCount = pTabControl->
GetPageCount()+1;
1604 sal_uInt16 nNewPageId = nNewPageCount;
1605 pTabControl->
InsertPage(nNewPageId, OUString());
1607 SAL_WARN_IF(bIsPlaceHolder,
"vcl.builder",
"we should have no placeholders for tabpages");
1608 if (!bIsPlaceHolder)
1616 OUString::number(nNewPageCount);
1617 m_aChildren.emplace_back(sTabPageId, pPage,
false);
1628 SAL_WARN_IF(bIsPlaceHolder,
"vcl.builder",
"we should have no placeholders for tabpages");
1629 if (!bIsPlaceHolder)
1635 if (bIsPlaceHolder ||
name ==
"GtkTreeSelection")
1643 if (
name ==
"GtkDialog" ||
name ==
"GtkAssistant")
1649 if (extractResizable(rMap))
1651 if (extractCloseable(rMap))
1654 if (
name ==
"GtkAssistant")
1658#if HAVE_FEATURE_DESKTOP
1659 if (!extractModal(rMap))
1663 else if (
name ==
"GtkMessageDialog")
1666 if (extractResizable(rMap))
1677 else if (
name ==
"GtkBox" ||
name ==
"GtkStatusbar")
1679 bVertical = extractOrientation(rMap);
1685 else if (
name ==
"GtkPaned")
1687 bVertical = extractOrientation(rMap);
1693 else if (
name ==
"GtkHBox")
1695 else if (
name ==
"GtkVBox")
1697 else if (
name ==
"GtkButtonBox")
1699 bVertical = extractOrientation(rMap);
1705 else if (
name ==
"GtkHButtonBox")
1707 else if (
name ==
"GtkVButtonBox")
1709 else if (
name ==
"GtkGrid")
1711 else if (
name ==
"GtkFrame")
1713 else if (
name ==
"GtkExpander")
1717 xWindow = pExpander;
1723 if (sMenu.isEmpty())
1724 xButton = extractStockAndBuildPushButton(pParent, rMap,
name ==
"GtkToggleButton");
1727 assert(
m_bLegacy &&
"use GtkMenuButton");
1728 xButton = extractStockAndBuildMenuButton(pParent, rMap);
1732 setupFromActionName(xButton, rMap,
m_xFrame);
1735 else if (
name ==
"GtkMenuButton")
1739 OUString sMenu = extractPopupMenu(rMap);
1740 if (!sMenu.isEmpty())
1743 OUString
sType = extractWidgetName(rMap);
1744 if (
sType.isEmpty())
1746 xButton = extractStockAndBuildMenuButton(pParent, rMap);
1751 xButton = extractStockAndBuildMenuToggleButton(pParent, rMap);
1756 if (!extractDrawIndicator(rMap))
1759 setupFromActionName(xButton, rMap,
m_xFrame);
1766 assert(sMenu.getLength() &&
"not implemented yet");
1767 xButton = extractStockAndBuildMenuToggleButton(pParent, rMap);
1770 setupFromActionName(xButton, rMap,
m_xFrame);
1773 else if (
name ==
"GtkRadioButton")
1781 else if (
name ==
"GtkCheckButton")
1784 bool bIsTriState = extractInconsistent(rMap);
1793 xWindow = xCheckBox;
1795 else if (
name ==
"GtkSpinButton")
1797 OUString sAdjustment = extractAdjustment(rMap);
1800 if (extractHasFrame(rMap))
1805 xField->GetFormatter().SetMinValue(0);
1808 else if (
name ==
"GtkLinkButton")
1810 else if (
name ==
"GtkComboBox" ||
name ==
"GtkComboBoxText")
1821 if (extractEntry(rMap))
1824 xComboBox->EnableAutoSize(
true);
1825 xWindow = xComboBox;
1830 xListBox->EnableAutoSize(
true);
1834 else if (
name ==
"VclOptionalBox" ||
name ==
"sfxlo-OptionalBox")
1839 else if (
name ==
"svtlo-ManagedMenuButton")
1845 if (!sMenu.isEmpty())
1849 else if (
name ==
"sfxlo-PriorityMergedHBox")
1854 else if (
name ==
"sfxlo-PriorityHBox")
1859 else if (
name ==
"sfxlo-DropdownBox")
1864 else if (
name ==
"sfxlo-ContextVBox")
1869 else if (
name ==
"GtkIconView")
1871 assert(rMap.find(
"model") != rMap.end() &&
"GtkIconView must have a model");
1881 xWindowForPackingProps = xBox;
1887 if (pRealParent != pParent)
1890 else if (
name ==
"GtkTreeView")
1894 assert(rMap.find(
"model") != rMap.end() &&
"GtkTreeView must have a model");
1920 xWindowForPackingProps = xWindow;
1925 bool bHeadersVisible = extractHeadersVisible(rMap);
1926 if (bHeadersVisible)
1929 OUString containerid(
id +
"-container");
1931 m_aChildren.emplace_back(containerid, xContainer,
true);
1934 xHeader->set_width_request(0);
1935 OUString headerid(
id +
"-header");
1937 m_aChildren.emplace_back(headerid, xHeader,
true);
1940 xHeaderBox->InitHeaderBar(xHeader);
1945 xWindowForPackingProps = xContainer;
1950 xWindowForPackingProps = xBox;
1959 if (pRealParent != pParent)
1962 else if (
name ==
"GtkTreeViewColumn")
1970 if (extractClickable(rMap))
1972 if (extractSortIndicator(rMap))
1974 float fAlign = extractAlignment(rMap);
1977 else if (fAlign == 1.0)
1979 else if (fAlign == 0.5)
1981 auto nItemId = pHeaderBar->GetItemCount() + 1;
1982 OUString sTitle(extractTitle(rMap));
1983 pHeaderBar->InsertItem(nItemId, sTitle, 100, nBits);
1987 else if (
name ==
"GtkLabel")
1991 if (extractSelectable(rMap))
1996 else if (
name ==
"GtkImage")
1999 OUString sIconName = extractIconName(rMap);
2000 if (!sIconName.isEmpty())
2003 xWindow = xFixedImage;
2009 rMap[
"visible"] =
"false";
2012 else if (
name ==
"GtkSeparator")
2014 bVertical = extractOrientation(rMap);
2017 else if (
name ==
"GtkScrollbar")
2020 bVertical = extractOrientation(rMap);
2023 else if (
name ==
"GtkProgressBar")
2026 bVertical = extractOrientation(rMap);
2029 else if (
name ==
"GtkScrolledWindow")
2033 else if (
name ==
"GtkViewport")
2037 else if (
name ==
"GtkEventBox")
2041 else if (
name ==
"GtkEntry")
2044 if (extractHasFrame(rMap))
2049 else if (
name ==
"GtkNotebook")
2051 if (!extractVerticalTabPos(rMap))
2056 else if (
name ==
"GtkDrawingArea")
2060 else if (
name ==
"GtkTextView")
2068 if (pRealParent != pParent)
2071 else if (
name ==
"GtkSpinner")
2075 else if (
name ==
"GtkScale")
2078 bool bDrawValue = extractDrawValue(rMap);
2081 OUString sValuePos = extractValuePos(rMap);
2084 bVertical = extractOrientation(rMap);
2090 else if (
name ==
"GtkToolbar")
2094 else if(
name ==
"NotebookBarAddonsToolMergePoint")
2096 customMakeWidget pFunction = GetCustomMakeWidget(
"sfxlo-NotebookbarToolBox");
2097 if(pFunction !=
nullptr)
2101 else if (
name ==
"GtkToolButton" ||
name ==
"GtkMenuToolButton" ||
2102 name ==
"GtkToggleToolButton" ||
name ==
"GtkRadioToolButton" ||
name ==
"GtkToolItem")
2106 OUString
aCommand(extractActionName(rMap));
2110 if (
name ==
"GtkMenuToolButton")
2112 else if (
name ==
"GtkToggleToolButton")
2114 else if (
name ==
"GtkRadioToolButton")
2132 OUString sTooltip(extractTooltipText(rMap));
2133 if (!sTooltip.isEmpty())
2136 OUString sIconName(extractIconName(rMap));
2137 if (!sIconName.isEmpty())
2140 if (!extractVisible(rMap))
2148 else if (
name ==
"GtkSeparatorToolItem")
2156 else if (
name ==
"GtkWindow")
2158 WinBits nBits = extractDeferredBits(rMap);
2164 else if (
name ==
"GtkPopover")
2166 WinBits nBits = extractDeferredBits(rMap);
2169 else if (
name ==
"GtkCalendar")
2171 WinBits nBits = extractDeferredBits(rMap);
2178 pFunction(xWindow, pParent, rMap);
2184 if (!sMenu.isEmpty())
2191 SAL_INFO_IF(!xWindow,
"vcl.builder",
"probably need to implement " <<
name <<
" or add a make" <<
name <<
" function");
2199 SAL_INFO(
"vcl.builder",
"for name '" <<
name <<
"' and id '" <<
id <<
2200 "', created " << xWindow.
get() <<
" child of " <<
2224 bool isConsideredGtkPseudo(
vcl::Window const *pWindow)
2246 for (
auto const& [rKey, rValue] : rProps)
2252 OUStringBuffer aRet(rIn);
2253 for (sal_Int32 nI = 0; nI < aRet.getLength(); ++nI)
2255 if (aRet[nI] ==
'_' && nI+1 < aRet.getLength())
2257 if (aRet[nI+1] !=
'_')
2264 return aRet.makeStringAndClear();
2269 OUString sCustomProperty;
2270 VclBuilder::stringmap::iterator aFind = rMap.find(
"customproperty");
2271 if (aFind != rMap.end())
2273 sCustomProperty = aFind->second;
2276 return sCustomProperty;
2281 OUString sWidthChars(
"width-chars");
2282 VclBuilder::stringmap::iterator aFind = rMap.find(sWidthChars);
2283 if (aFind == rMap.end())
2284 rMap[sWidthChars] =
"20";
2289 bool bDropdown =
true;
2290 VclBuilder::stringmap::iterator aFind = rMap.find(
"dropdown");
2291 if (aFind != rMap.end())
2293 bDropdown =
toBool(aFind->second);
2314 for (
size_t i = 0;
i < rChilds.size(); ++
i)
2323 WinBits nBits = rChilds[
i]->GetStyle();
2327 rChilds[
i]->SetStyle(nBits);
2335 static const std::unordered_map<OUString, sal_Int16> aAtkRoleToAccessibleRole = {
2337 {
"invalid", AccessibleRole::UNKNOWN },
2338 {
"accelerator label", AccessibleRole::UNKNOWN },
2339 {
"alert", AccessibleRole::ALERT },
2340 {
"animation", AccessibleRole::UNKNOWN },
2341 {
"arrow", AccessibleRole::UNKNOWN },
2342 {
"calendar", AccessibleRole::UNKNOWN },
2343 {
"canvas", AccessibleRole::CANVAS },
2344 {
"check box", AccessibleRole::CHECK_BOX },
2345 {
"check menu item", AccessibleRole::CHECK_MENU_ITEM },
2346 {
"color chooser", AccessibleRole::COLOR_CHOOSER },
2347 {
"column header", AccessibleRole::COLUMN_HEADER },
2348 {
"combo box", AccessibleRole::COMBO_BOX },
2349 {
"date editor", AccessibleRole::DATE_EDITOR },
2350 {
"desktop icon", AccessibleRole::DESKTOP_ICON },
2351 {
"desktop frame", AccessibleRole::DESKTOP_PANE },
2352 {
"dial", AccessibleRole::UNKNOWN },
2353 {
"dialog", AccessibleRole::DIALOG },
2354 {
"directory pane", AccessibleRole::DIRECTORY_PANE },
2355 {
"drawing area", AccessibleRole::UNKNOWN },
2356 {
"file chooser", AccessibleRole::FILE_CHOOSER },
2357 {
"filler", AccessibleRole::FILLER },
2358 {
"font chooser", AccessibleRole::FONT_CHOOSER },
2359 {
"frame", AccessibleRole::FRAME },
2360 {
"glass pane", AccessibleRole::GLASS_PANE },
2361 {
"html container", AccessibleRole::UNKNOWN },
2362 {
"icon", AccessibleRole::ICON },
2363 {
"image", AccessibleRole::GRAPHIC },
2364 {
"internal frame", AccessibleRole::INTERNAL_FRAME },
2365 {
"label", AccessibleRole::LABEL },
2366 {
"layered pane", AccessibleRole::LAYERED_PANE },
2367 {
"list", AccessibleRole::LIST },
2368 {
"list item", AccessibleRole::LIST_ITEM },
2369 {
"menu", AccessibleRole::MENU },
2370 {
"menu bar", AccessibleRole::MENU_BAR },
2371 {
"menu item", AccessibleRole::MENU_ITEM },
2372 {
"option pane", AccessibleRole::OPTION_PANE },
2373 {
"page tab", AccessibleRole::PAGE_TAB },
2374 {
"page tab list", AccessibleRole::PAGE_TAB_LIST },
2375 {
"panel", AccessibleRole::PANEL },
2376 {
"password text", AccessibleRole::PASSWORD_TEXT },
2377 {
"popup menu", AccessibleRole::POPUP_MENU },
2378 {
"progress bar", AccessibleRole::PROGRESS_BAR },
2379 {
"push button", AccessibleRole::PUSH_BUTTON },
2380 {
"radio button", AccessibleRole::RADIO_BUTTON },
2381 {
"radio menu item", AccessibleRole::RADIO_MENU_ITEM },
2382 {
"root pane", AccessibleRole::ROOT_PANE },
2383 {
"row header", AccessibleRole::ROW_HEADER },
2384 {
"scroll bar", AccessibleRole::SCROLL_BAR },
2385 {
"scroll pane", AccessibleRole::SCROLL_PANE },
2386 {
"separator", AccessibleRole::SEPARATOR },
2387 {
"slider", AccessibleRole::SLIDER },
2388 {
"split pane", AccessibleRole::SPLIT_PANE },
2389 {
"spin button", AccessibleRole::SPIN_BOX },
2390 {
"statusbar", AccessibleRole::STATUS_BAR },
2391 {
"table", AccessibleRole::TABLE },
2392 {
"table cell", AccessibleRole::TABLE_CELL },
2393 {
"table column header", AccessibleRole::COLUMN_HEADER },
2394 {
"table row header", AccessibleRole::ROW_HEADER },
2395 {
"tear off menu item", AccessibleRole::UNKNOWN },
2396 {
"terminal", AccessibleRole::UNKNOWN },
2397 {
"text", AccessibleRole::TEXT },
2398 {
"toggle button", AccessibleRole::TOGGLE_BUTTON },
2399 {
"tool bar", AccessibleRole::TOOL_BAR },
2400 {
"tool tip", AccessibleRole::TOOL_TIP },
2401 {
"tree", AccessibleRole::TREE },
2402 {
"tree table", AccessibleRole::TREE_TABLE },
2403 {
"unknown", AccessibleRole::UNKNOWN },
2404 {
"viewport", AccessibleRole::VIEW_PORT },
2405 {
"window", AccessibleRole::WINDOW },
2406 {
"header", AccessibleRole::HEADER },
2407 {
"footer", AccessibleRole::FOOTER },
2408 {
"paragraph", AccessibleRole::PARAGRAPH },
2409 {
"ruler", AccessibleRole::RULER },
2410 {
"application", AccessibleRole::UNKNOWN },
2411 {
"autocomplete", AccessibleRole::UNKNOWN },
2412 {
"edit bar", AccessibleRole::EDIT_BAR },
2413 {
"embedded", AccessibleRole::EMBEDDED_OBJECT },
2414 {
"entry", AccessibleRole::UNKNOWN },
2415 {
"chart", AccessibleRole::CHART },
2416 {
"caption", AccessibleRole::CAPTION },
2417 {
"document frame", AccessibleRole::DOCUMENT },
2418 {
"heading", AccessibleRole::HEADING },
2419 {
"page", AccessibleRole::PAGE },
2420 {
"section", AccessibleRole::SECTION },
2421 {
"redundant object", AccessibleRole::UNKNOWN },
2422 {
"form", AccessibleRole::FORM },
2423 {
"link", AccessibleRole::HYPER_LINK },
2424 {
"input method window", AccessibleRole::UNKNOWN },
2425 {
"table row", AccessibleRole::UNKNOWN },
2426 {
"tree item", AccessibleRole::TREE_ITEM },
2427 {
"document spreadsheet", AccessibleRole::DOCUMENT_SPREADSHEET },
2428 {
"document presentation", AccessibleRole::DOCUMENT_PRESENTATION },
2429 {
"document text", AccessibleRole::DOCUMENT_TEXT },
2430 {
"document web", AccessibleRole::DOCUMENT },
2431 {
"document email", AccessibleRole::DOCUMENT },
2432 {
"comment", AccessibleRole::COMMENT },
2433 {
"list box", AccessibleRole::UNKNOWN },
2434 {
"grouping", AccessibleRole::GROUP_BOX },
2435 {
"image map", AccessibleRole::IMAGE_MAP },
2436 {
"notification", AccessibleRole::NOTIFICATION },
2437 {
"info bar", AccessibleRole::UNKNOWN },
2438 {
"level bar", AccessibleRole::UNKNOWN },
2439 {
"title bar", AccessibleRole::UNKNOWN },
2440 {
"block quote", AccessibleRole::UNKNOWN },
2441 {
"audio", AccessibleRole::UNKNOWN },
2442 {
"video", AccessibleRole::UNKNOWN },
2443 {
"definition", AccessibleRole::UNKNOWN },
2444 {
"article", AccessibleRole::UNKNOWN },
2445 {
"landmark", AccessibleRole::UNKNOWN },
2446 {
"log", AccessibleRole::UNKNOWN },
2447 {
"marquee", AccessibleRole::UNKNOWN },
2448 {
"math", AccessibleRole::UNKNOWN },
2449 {
"rating", AccessibleRole::UNKNOWN },
2450 {
"timer", AccessibleRole::UNKNOWN },
2451 {
"description list", AccessibleRole::UNKNOWN },
2452 {
"description term", AccessibleRole::UNKNOWN },
2453 {
"description value", AccessibleRole::UNKNOWN },
2454 {
"static", AccessibleRole::STATIC },
2455 {
"math fraction", AccessibleRole::UNKNOWN },
2456 {
"math root", AccessibleRole::UNKNOWN },
2457 {
"subscript", AccessibleRole::UNKNOWN },
2458 {
"superscript", AccessibleRole::UNKNOWN },
2459 {
"footnote", AccessibleRole::FOOTNOTE },
2462 auto it = aAtkRoleToAccessibleRole.find(roleName);
2463 if (it == aAtkRoleToAccessibleRole.end())
2464 return AccessibleRole::UNKNOWN;
2494 if (pCurrentChild->
GetHelpId().isEmpty())
2497 SAL_INFO(
"vcl.builder",
"for toplevel dialog " <<
this <<
" " <<
2498 rID <<
", set helpid " << pCurrentChild->
GetHelpId());
2509 pCurrentChild =
makeObject(pParent, rClass, rID, rProps);
2514 pCurrentChild->
set_id(rID);
2523 VclBuilder::stringmap::iterator aSize = rPango.find(
"size");
2524 if (aSize != rPango.end())
2527 rPango.erase(aSize);
2529 for (
auto const& [ rKey, rValue ] : rPango)
2544 return pCurrentChild;
2552 std::vector<OUString> sIDs;
2557 std::vector<vcl::EnumContext::Context> context;
2565 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
2567 if (res == xmlreader::XmlReader::Result::Begin)
2570 if (
name ==
"object")
2577 OUString sID(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
2578 sal_Int32 nDelim = sID.indexOf(
':');
2581 aProperties[
"customproperty"] = sID.copy(nDelim + 1);
2582 sID = sID.copy(0, nDelim);
2584 sIDs.push_back(sID);
2588 else if (
name ==
"style")
2594 else if (
name ==
"property")
2596 else if (pTabControl &&
name ==
"child")
2604 if (res == xmlreader::XmlReader::Result::End)
2610 if (res == xmlreader::XmlReader::Result::Done)
2619 assert(pTabControl || pVerticalTabControl);
2620 VclBuilder::stringmap::iterator aFind =
aProperties.find(
"label");
2623 OUString sTooltip(extractTooltipText(
aProperties));
2630 if (!context.empty())
2633 pPage->SetContext(std::move(context));
2636 for (
auto const& [ rKey, rValue ] : aAtkProperties)
2638 if (rKey ==
"AtkObject::accessible-name")
2640 else if (rKey ==
"AtkObject::accessible-description")
2643 SAL_INFO(
"vcl.builder",
"unhandled atk property: " << rKey);
2675 if (nLeftA < nLeftB)
2677 if (nLeftA > nLeftB)
2682 if (ePackA < ePackB)
2684 if (ePackA > ePackB)
2689 if (!bVerticalContainer)
2692 if (bPackA > bPackB)
2694 if (bPackA < bPackB)
2700 if (bPackA < bPackB)
2702 if (bPackA > bPackB)
2710 if (nPackA < nPackB)
2712 if (nPackA > nPackB)
2721 int nFramePosA = (pA == pLabel) ? 0 : 1;
2722 int nFramePosB = (pB == pLabel) ? 0 : 1;
2723 return nFramePosA < nFramePosB;
2735 OString
sType, sInternalChild;
2744 else if (
name ==
"internal-child")
2747 sInternalChild = OString(
name.begin,
name.length);
2761 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
2763 if (res == xmlreader::XmlReader::Result::Begin)
2765 if (
name ==
"object" ||
name ==
"placeholder")
2769 bool bObjectInserted = pCurrentChild && pParent != pCurrentChild;
2771 if (bObjectInserted)
2775 if (!sInternalChild.isEmpty())
2776 pCurrentChild->
Show();
2791 if (
sType ==
"label")
2794 pFrameParent->designate_label(pCurrentChild);
2796 if (sInternalChild.startsWith(
"vbox") || sInternalChild.startsWith(
"messagedialog-vbox"))
2798 if (
Dialog *pBoxParent =
dynamic_cast<Dialog*
>(pParent))
2799 pBoxParent->set_content_area(
static_cast<VclBox*
>(pCurrentChild));
2801 else if (sInternalChild.startsWith(
"action_area") || sInternalChild.startsWith(
"messagedialog-action_area"))
2806 pBoxParent->set_action_area(
static_cast<VclButtonBox*
>(pCurrentChild));
2810 bool bIsButtonBox =
dynamic_cast<VclButtonBox*
>(pCurrentChild) !=
nullptr;
2814 std::vector<vcl::Window*> aChilds;
2821 pPushButton->setAction(
true);
2824 aChilds.push_back(pChild);
2834 else if (
name ==
"packing")
2838 else if (
name ==
"interface")
2842 if (
name ==
"domain")
2855 if (res == xmlreader::XmlReader::Result::End)
2861 if (res == xmlreader::XmlReader::Result::Done)
2879 sProperty = OUString(span.
begin, span.
length, RTL_TEXTENCODING_UTF8);
2881 else if (span ==
"value")
2884 sValue = OUString(span.
begin, span.
length, RTL_TEXTENCODING_UTF8);
2888 if (!sProperty.isEmpty())
2889 rMap[sProperty] = sValue;
2905 sProperty = OUString(span.
begin, span.
length, RTL_TEXTENCODING_UTF8);
2907 else if (span ==
"target")
2910 sValue = OUString(span.
begin, span.
length, RTL_TEXTENCODING_UTF8);
2911 sal_Int32 nDelim = sValue.indexOf(
':');
2913 sValue = sValue.copy(0, nDelim);
2917 if (!sProperty.isEmpty())
2918 rMap[sProperty] = sValue;
2933 sProperty = OUString(span.
begin, span.
length, RTL_TEXTENCODING_UTF8);
2937 if (!sProperty.isEmpty())
2938 rMap[
"role"] = sProperty;
2953 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
2955 if (res == xmlreader::XmlReader::Result::Done)
2958 if (res == xmlreader::XmlReader::Result::Begin)
2963 bool bTranslated =
false;
2972 nId = OString(
name.begin,
name.length).toUInt32();
2978 else if (
name ==
"context")
2981 sContext = OString(
name.begin,
name.length);
2986 xmlreader::XmlReader::Text::Raw, &
name, &nsId);
2988 OString sValue(
name.begin,
name.length);
2989 OUString sFinalValue;
2995 sFinalValue = OUString::fromUtf8(sValue);
2998 if (aRow.size() <
nId+1)
3000 aRow[
nId] = sFinalValue;
3004 if (res == xmlreader::XmlReader::Result::End)
3026 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3028 if (res == xmlreader::XmlReader::Result::Done)
3031 if (res == xmlreader::XmlReader::Result::Begin)
3035 bool bNotTreeStore = rClass !=
u"GtkTreeStore";
3038 assert(bNotTreeStore &&
"gtk, as the time of writing, doesn't support data in GtkTreeStore serialization");
3044 if (res == xmlreader::XmlReader::Result::End)
3066 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3068 if (res == xmlreader::XmlReader::Result::Done)
3071 if (res == xmlreader::XmlReader::Result::Begin)
3074 if (
name ==
"property")
3078 if (res == xmlreader::XmlReader::Result::End)
3093 for (
auto const& [ rKey, rValue ] : rProperties)
3095 if (pWindow && rKey.match(
"AtkObject::"))
3096 pWindow->
set_property(rKey.copy(RTL_CONSTASCII_LENGTH(
"AtkObject::")), rValue);
3098 SAL_WARN(
"vcl.builder",
"unhandled atk prop: " << rKey);
3106 std::vector<ComboBoxTextItem> aItems;
3114 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3116 if (res == xmlreader::XmlReader::Result::Done)
3119 if (res == xmlreader::XmlReader::Result::Begin)
3124 bool bTranslated =
false;
3134 else if (
name ==
"context")
3137 sContext = OString(
name.begin,
name.length);
3139 else if (
name ==
"id")
3142 sId = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3147 xmlreader::XmlReader::Text::Raw, &
name, &nsId);
3149 OString sValue(
name.begin,
name.length);
3150 OUString sFinalValue;
3156 sFinalValue = OUString::fromUtf8(sValue);
3159 sFinalValue = (*m_pStringReplace)(sFinalValue);
3161 aItems.emplace_back(sFinalValue,
sId);
3165 if (res == xmlreader::XmlReader::Result::End)
3185 pCurrentMenu->
set_id(rID);
3197 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3199 if (res == xmlreader::XmlReader::Result::Done)
3202 if (res == xmlreader::XmlReader::Result::Begin)
3204 if (
name ==
"child")
3211 if (
name ==
"property")
3216 if (res == xmlreader::XmlReader::Result::End)
3225 m_aMenus.emplace_back(rID, pCurrentMenu);
3227 return pCurrentMenu;
3239 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3241 if (res == xmlreader::XmlReader::Result::Begin)
3243 if (
name ==
"object" ||
name ==
"placeholder")
3251 if (res == xmlreader::XmlReader::Result::End)
3257 if (res == xmlreader::XmlReader::Result::Done)
3266 OUString sCustomProperty;
3274 if (
name ==
"class")
3277 sClass = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3279 else if (
name ==
"id")
3282 sID = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3285 sal_Int32 nDelim = sID.indexOf(
':');
3288 sCustomProperty = sID.subView(nDelim+1);
3289 sID = sID.copy(0, nDelim);
3301 if (!sCustomProperty.isEmpty())
3307 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3309 if (res == xmlreader::XmlReader::Result::Done)
3312 if (res == xmlreader::XmlReader::Result::Begin)
3314 if (
name ==
"child")
3316 size_t nChildMenuIdx =
m_aMenus.size();
3318 bool bSubMenuInserted =
m_aMenus.size() > nChildMenuIdx;
3319 if (bSubMenuInserted)
3325 if (
name ==
"property")
3327 else if (
name ==
"accelerator")
3332 if (res == xmlreader::XmlReader::Result::End)
3357 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3359 if (res == xmlreader::XmlReader::Result::Done)
3362 if (res == xmlreader::XmlReader::Result::Begin)
3365 if (
name ==
"widget")
3372 OUString sWidget(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3373 sal_Int32 nDelim = sWidget.indexOf(
':');
3375 sWidget = sWidget.copy(0, nDelim);
3382 if (
name ==
"property")
3387 if (res == xmlreader::XmlReader::Result::End)
3399 vcl::KeyCode makeKeyCode(
const std::pair<OUString,OUString> &rKey)
3401 bool bShift = rKey.second.indexOf(
"GDK_SHIFT_MASK") != -1;
3402 bool bMod1 = rKey.second.indexOf(
"GDK_CONTROL_MASK") != -1;
3403 bool bMod2 = rKey.second.indexOf(
"GDK_ALT_MASK") != -1;
3404 bool bMod3 = rKey.second.indexOf(
"GDK_MOD2_MASK") != -1;
3406 if (rKey.first ==
"Insert")
3408 else if (rKey.first ==
"Delete")
3410 else if (rKey.first ==
"Return")
3412 else if (rKey.first ==
"Up")
3414 else if (rKey.first ==
"Down")
3416 else if (rKey.first ==
"Left")
3418 else if (rKey.first ==
"Right")
3420 else if (rKey.first ==
"asterisk")
3422 else if (rKey.first.getLength() > 1 && rKey.first[0] ==
'F')
3425 assert(nIndex >= 1 && nIndex <= 26);
3429 assert (rKey.first.getLength() == 1);
3432 if (cChar >=
'a' && cChar <=
'z')
3434 else if (cChar >=
'A' && cChar <=
'Z')
3436 else if (cChar >=
'0' && cChar <=
'9')
3439 return vcl::KeyCode(cChar, bShift, bMod1, bMod2, bMod3);
3449 if(rClass ==
"NotebookBarAddonsMenuMergePoint")
3454 else if (rClass ==
"GtkMenuItem")
3457 OUString
aCommand(extractActionName(rProps));
3463 else if (rClass ==
"GtkCheckMenuItem")
3466 OUString
aCommand(extractActionName(rProps));
3470 else if (rClass ==
"GtkRadioMenuItem")
3473 OUString
aCommand(extractActionName(rProps));
3477 else if (rClass ==
"GtkSeparatorMenuItem")
3487 if (!extractVisible(rProps))
3490 for (
auto const& [ rKey, rValue ] : rProps)
3492 if (rKey ==
"tooltip-markup")
3494 else if (rKey ==
"tooltip-text")
3497 SAL_INFO(
"vcl.builder",
"unhandled property: " << rKey);
3500 for (
auto const& [ rKey, rValue ] : rAtkProps)
3502 if (rKey ==
"AtkObject::accessible-name")
3504 else if (rKey ==
"AtkObject::accessible-description")
3507 SAL_INFO(
"vcl.builder",
"unhandled atk property: " << rKey);
3510 for (
auto const& [ rSignal, rValue ] : rAccels)
3512 if (rSignal ==
"activate")
3513 pParent->
SetAccelKey(nNewId, makeKeyCode(rValue));
3515 SAL_INFO(
"vcl.builder",
"unhandled accelerator for: " << rSignal);
3525 std::vector<std::unique_ptr<OUString>>& rUserData,
3526 const std::vector<ComboBoxTextItem> &rItems)
3528 T *pContainer =
dynamic_cast<T*
>(pWindow);
3532 sal_uInt16 nActiveId = extractActive(rMap);
3533 for (
auto const& item : rItems)
3535 sal_Int32
nPos = pContainer->InsertEntry(item.m_sItem);
3536 if (!item.m_sId.isEmpty())
3538 rUserData.emplace_back(std::make_unique<OUString>(item.m_sId));
3539 pContainer->SetEntryData(
nPos, rUserData.back().get());
3542 if (nActiveId < rItems.size())
3543 pContainer->SelectEntryPos(nActiveId);
3552 OUString sCustomProperty;
3559 if (
name ==
"class")
3562 sClass = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3564 else if (
name ==
"id")
3567 sID = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3570 sal_Int32 nDelim = sID.indexOf(
':');
3573 sCustomProperty = sID.subView(nDelim+1);
3574 sID = sID.copy(0, nDelim);
3580 if (sClass ==
"GtkListStore" || sClass ==
"GtkTreeStore")
3585 else if (sClass ==
"GtkMenu")
3590 else if (sClass ==
"GtkMenuBar")
3594 pTopLevel->SetMenuBar(
dynamic_cast<MenuBar*
>(xMenu.
get()));
3597 else if (sClass ==
"GtkSizeGroup")
3602 else if (sClass ==
"AtkObject")
3604 assert((pParent || pAtkProps) &&
"must have one set");
3605 assert(!(pParent && pAtkProps) &&
"must not have both");
3610 *pAtkProps = aAtkProperties;
3618 std::vector<ComboBoxTextItem> aItems;
3620 if (!sCustomProperty.isEmpty())
3627 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3629 if (res == xmlreader::XmlReader::Result::Done)
3632 if (res == xmlreader::XmlReader::Result::Begin)
3634 if (
name ==
"child")
3643 else if (
name ==
"items")
3645 else if (
name ==
"style")
3648 std::vector<vcl::EnumContext::Context> aContext =
handleStyle(reader, nPriority);
3651 vcl::IPrioritable* pPrioritable =
dynamic_cast<vcl::IPrioritable*
>(pCurrentChild.
get());
3652 SAL_WARN_IF(!pPrioritable,
"vcl",
"priority set for not supported item");
3654 pPrioritable->SetPriority(nPriority);
3656 if (!aContext.empty())
3658 vcl::IContext* pContextControl =
dynamic_cast<vcl::IContext*
>(pCurrentChild.
get());
3659 SAL_WARN_IF(!pContextControl,
"vcl",
"context set for not supported item");
3660 if (pContextControl)
3661 pContextControl->SetContext(std::move(aContext));
3667 if (
name ==
"property")
3669 else if (
name ==
"attribute")
3671 else if (
name ==
"relation")
3673 else if (
name ==
"role")
3675 else if (
name ==
"action-widget")
3680 if (res == xmlreader::XmlReader::Result::End)
3689 if (sClass ==
"GtkAdjustment")
3694 else if (sClass ==
"GtkTextBuffer")
3703 aPangoAttributes, aAtkAttributes);
3706 if (!aItems.empty())
3713 return pCurrentChild;
3726 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3728 if (res == xmlreader::XmlReader::Result::Done)
3731 if (res == xmlreader::XmlReader::Result::Begin)
3734 if (
name ==
"property")
3738 if (res == xmlreader::XmlReader::Result::End)
3757 ToolBox *pToolBoxParent =
nullptr;
3758 if (pCurrent == pParent)
3759 pToolBoxParent =
dynamic_cast<ToolBox*
>(pParent);
3769 pCurrent = aFind->second;
3779 OString sKey(
name.begin,
name.length);
3780 sKey = sKey.replace(
'_',
'-');
3782 xmlreader::XmlReader::Text::Raw, &
name, &nsId);
3783 OString sValue(
name.begin,
name.length);
3785 if (sKey ==
"expand" || sKey ==
"resize")
3787 bool bTrue = (!sValue.isEmpty() && (sValue[0] ==
't' || sValue[0] ==
'T' || sValue[0] ==
'1'));
3800 bool bTrue = (!sValue.isEmpty() && (sValue[0] ==
't' || sValue[0] ==
'T' || sValue[0] ==
'1'));
3803 else if (sKey ==
"pack-type")
3808 else if (sKey ==
"left-attach")
3812 else if (sKey ==
"top-attach")
3816 else if (sKey ==
"width")
3820 else if (sKey ==
"height")
3824 else if (sKey ==
"padding")
3828 else if (sKey ==
"position")
3832 else if (sKey ==
"secondary")
3836 else if (sKey ==
"non-homogeneous")
3840 else if (sKey ==
"homogeneous")
3846 SAL_WARN_IF(sKey !=
"shrink",
"vcl.builder",
"unknown packing: " << sKey);
3854 std::vector<vcl::EnumContext::Context> aContext;
3864 xmlreader::XmlReader::Text::NONE, &
name, &nsId);
3866 if (res == xmlreader::XmlReader::Result::Done)
3869 if (res == xmlreader::XmlReader::Result::Begin)
3872 if (
name ==
"class")
3877 if (classStyle.startsWith(
"context-", &rest))
3881 else if (classStyle.startsWith(
"priority-", &rest))
3883 nPriority = rest.toInt32();
3885 else if (classStyle !=
"small-button" && classStyle !=
"destructive-action" && classStyle !=
"suggested-action")
3887 SAL_WARN(
"vcl.builder",
"unknown class: " << classStyle);
3892 if (res == xmlreader::XmlReader::Result::End)
3915 aRet = OUString (
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3930 bool bTranslated =
false;
3937 sProperty = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3939 else if (
name ==
"context")
3942 sContext = OString(
name.begin,
name.length);
3950 (void)reader.
nextItem(xmlreader::XmlReader::Text::Raw, &
name, &nsId);
3951 OString sValue(
name.begin,
name.length);
3952 OUString sFinalValue;
3958 sFinalValue = OUString::fromUtf8(sValue);
3960 if (!sProperty.isEmpty())
3962 sProperty = sProperty.replace(
'_',
'-');
3964 sFinalValue = (*m_pStringReplace)(sFinalValue);
3965 rMap[sProperty] = sFinalValue;
3978 if (
name ==
"response")
3981 sResponse = OString(
name.begin,
name.length);
3985 (void)reader.
nextItem(xmlreader::XmlReader::Text::Raw, &
name, &nsId);
3986 OUString sID(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
3987 sal_Int32 nDelim = sID.indexOf(
':');
3989 sID = sID.copy(0, nDelim);
4000 OUString sModifiers;
4007 sValue = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
4009 else if (
name ==
"signal")
4012 sProperty = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
4014 else if (
name ==
"modifiers")
4017 sModifiers = OUString(
name.begin,
name.length, RTL_TEXTENCODING_UTF8);
4021 if (!sProperty.isEmpty() && !sValue.isEmpty())
4023 rMap[sProperty] = std::make_pair(sValue, sModifiers);
4036 if (child.m_sID == sID)
4037 return child.m_pWindow;
4047 if (menu.m_sID == sID)
4048 return dynamic_cast<PopupMenu*
>(menu.m_pMenu.get());
4077 assert(nResponse >= 100 &&
"keep non-canned responses in range 100+ to avoid collision with vcl RET_*");
4083 if (child.m_sID == sID)
4086 assert(pPushButton);
4089 pDialog->
add_button(pPushButton, nResponse,
false);
4100 [&sID](
WinAndId& rItem) { return rItem.m_sID == sID; });
4103 aI->m_pWindow.disposeAndClear();
4117 [&pWindow](
WinAndId& rItem) { return rItem.m_pWindow == pWindow; });
4126 if (child.m_pWindow == pWindow)
4143 if (child.m_pWindow == pPropHolder)
4144 return child.m_aPackingData;
4154 if (child.m_pWindow == pWindow)
4155 child.m_aPackingData.m_nPosition = nPosition;
4163 return &(aI->second);
4171 return &(aI->second);
4179 return &(aI->second);
4188 sal_uInt16 nEntry =
rTarget.InsertEntry(rRow[0]);
4189 if (rRow.size() > 1)
4193 sal_Int32
nValue = rRow[1].toInt32();
4194 rTarget.SetEntryData(nEntry,
reinterpret_cast<void*
>(
nValue));
4198 if (!rRow[1].isEmpty())
4200 m_aUserData.emplace_back(std::make_unique<OUString>(rRow[1]));
4207 rTarget.SelectEntryPos(nActiveId);
4215 sal_uInt16 nEntry =
rTarget.InsertEntry(rRow[0]);
4216 if (rRow.size() > 1)
4220 sal_Int32
nValue = rRow[1].toInt32();
4221 rTarget.SetEntryData(nEntry,
reinterpret_cast<void*
>(
nValue));
4225 if (!rRow[1].isEmpty())
4227 m_aUserData.emplace_back(std::make_unique<OUString>(rRow[1]));
4234 rTarget.SelectEntryPos(nActiveId);
4242 auto pEntry =
rTarget.InsertEntry(rRow[0]);
4243 if (rRow.size() > 1)
4247 sal_Int32
nValue = rRow[1].toInt32();
4248 pEntry->SetUserData(
reinterpret_cast<void*
>(
nValue));
4252 if (!rRow[1].isEmpty())
4254 m_aUserData.emplace_back(std::make_unique<OUString>(rRow[1]));
4269 int nMul = rtl_math_pow10Exp(1,
rTarget.GetDecimalDigits());
4271 for (
auto const& [ rKey, rValue ] : rAdjustment)
4273 if (rKey ==
"upper")
4275 sal_Int64 nUpper = rValue.toDouble() * nMul;
4279 else if (rKey ==
"lower")
4281 sal_Int64 nLower = rValue.toDouble() * nMul;
4285 else if (rKey ==
"value")
4287 sal_Int64
nValue = rValue.toDouble() * nMul;
4290 else if (rKey ==
"step-increment")
4292 sal_Int64 nSpinSize = rValue.toDouble() * nMul;
4293 rTarget.SetSpinSize(nSpinSize);
4297 SAL_INFO(
"vcl.builder",
"unhandled property :" << rKey);
4304 double nMaxValue = 0, nMinValue = 0,
nValue = 0, nSpinSize = 0;
4306 for (
auto const& [ rKey, rValue ] : rAdjustment)
4308 if (rKey ==
"upper")
4309 nMaxValue = rValue.toDouble();
4310 else if (rKey ==
"lower")
4311 nMinValue = rValue.toDouble();
4312 else if (rKey ==
"value")
4313 nValue = rValue.toDouble();
4314 else if (rKey ==
"step-increment")
4315 nSpinSize = rValue.toDouble();
4317 SAL_INFO(
"vcl.builder",
"unhandled property :" << rKey);
4329 for (
auto const& [ rKey, rValue ] : rAdjustment)
4331 if (rKey ==
"upper")
4332 rTarget.SetRangeMax(rValue.toInt32());
4333 else if (rKey ==
"lower")
4334 rTarget.SetRangeMin(rValue.toInt32());
4335 else if (rKey ==
"value")
4336 rTarget.SetThumbPos(rValue.toInt32());
4337 else if (rKey ==
"step-increment")
4338 rTarget.SetLineSize(rValue.toInt32());
4339 else if (rKey ==
"page-increment")
4340 rTarget.SetPageSize(rValue.toInt32());
4343 SAL_INFO(
"vcl.builder",
"unhandled property :" << rKey);
4350 for (
auto const& [ rKey, rValue ] : rAdjustment)
4352 if (rKey ==
"upper")
4353 rTarget.SetRangeMax(rValue.toInt32());
4354 else if (rKey ==
"lower")
4355 rTarget.SetRangeMin(rValue.toInt32());
4356 else if (rKey ==
"value")
4357 rTarget.SetThumbPos(rValue.toInt32());
4358 else if (rKey ==
"step-increment")
4359 rTarget.SetLineSize(rValue.toInt32());
4360 else if (rKey ==
"page-increment")
4361 rTarget.SetPageSize(rValue.toInt32());
4364 SAL_INFO(
"vcl.builder",
"unhandled property :" << rKey);
4371 for (
auto const& [ rKey, rValue ] : rTextBuffer)
4377 SAL_INFO(
"vcl.builder",
"unhandled property :" << rKey);
4383 : m_nLastToolbarId(0)
4384 , m_nLastMenuItemId(0)
PropertiesInfo aProperties
css::uno::Reference< css::lang::XComponent > m_xFrame
static bool insertItems(vcl::Window *pWindow, VclBuilder::stringmap &rMap, std::vector< std::unique_ptr< OUString > > &rUserData, const std::vector< ComboBoxTextItem > &rItems)
Insert items to a ComboBox or a ListBox.
std::map< OUString, std::shared_ptr< NoAutoUnloadModule > > ModuleMap
static ModuleMap g_aModuleMap
static bool toBool(std::string_view rValue)
static OUString GetUIRootDir()
const LocaleDataWrapper & GetLocaleDataWrapper() const
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static std::unique_ptr< weld::Builder > CreateInterimBuilder(vcl::Window *pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId=0)
static const AllSettings & GetSettings()
Gets the application's settings.
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
void EnableTriState(bool bTriState=true)
void SetState(TriState eState)
A widget used to choose from a list of items and which has an entry.
virtual void SetText(const OUString &rStr) override
virtual Size GetOptimalSize() const override
static void addKeyValue(SAL_UNUSED_PARAMETER const OUString &, SAL_UNUSED_PARAMETER const OUString &, SAL_UNUSED_PARAMETER tAddKeyHandling)
@ Default
Use given parent or get a default one using GetDefaultParent(...)
void add_button(PushButton *pButton, int nResponse, bool bTransferOwnership)
virtual void doDeferredInit(WinBits nBits)
const Image & GetImage() const
static Image loadThemeImage(const OUString &rFileName)
void SetImage(const Image &rImage)
void set_mnemonic_widget(vcl::Window *pWindow)
OUString GetStock() const
Size GetSizePixel() const
static std::unique_ptr< JSInstanceBuilder > CreateSidebarBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile, sal_uInt64 nLOKWindowId=0)
static std::unique_ptr< JSInstanceBuilder > CreateNotebookbarBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, const css::uno::Reference< css::frame::XFrame > &rFrame, sal_uInt64 nWindowId=0)
static std::unique_ptr< JSInstanceBuilder > CreateFormulabarBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
static std::unique_ptr< JSInstanceBuilder > CreatePopupBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
static std::unique_ptr< JSInstanceBuilder > CreateDialogBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile)
A widget used to choose from a list of items and which has no entry.
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
const LanguageTag & getLanguageTag() const
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)
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)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetSpaceBetweenEntries(short nSpace)
void SetEntryHeight(short nHeight)
void SetHighlightRange(sal_uInt16 nFirstTab=0, sal_uInt16 nLastTab=0xffff)
void SetNoAutoCurEntry(bool b)
void SetQuickSearch(bool bEnable)
virtual void doDeferredInit(WinBits nBits)
sal_uInt16 GetPageCount() const
void SetAccessibleDescription(sal_uInt16 nItemId, const OUString &rStr)
void SetTabPage(sal_uInt16 nPageId, TabPage *pPage)
void SetAccessibleName(sal_uInt16 nItemId, const OUString &rStr)
void SetPageName(sal_uInt16 nPageId, const OUString &rName) const
TabPage * GetTabPage(sal_uInt16 nPageId) const
void SetCurPageId(sal_uInt16 nPageId)
void InsertPage(sal_uInt16 nPageId, const OUString &rText, sal_uInt16 nPos=TAB_APPEND)
sal_uInt16 GetCurPageId() const
sal_uInt16 GetPageId(sal_uInt16 nPos) const
void SetHelpText(sal_uInt16 nPageId, const OUString &rText)
void SetPageText(sal_uInt16 nPageId, const OUString &rText)
void RemovePage(sal_uInt16 nPageId)
bool operator()(const vcl::Window *pA, const vcl::Window *pB) const
void delete_by_name(const OUString &sID)
T * get(VclPtr< T > &ret, const OUString &sID)
static OUString getStyleClass(xmlreader::XmlReader &reader)
void set_response(std::u16string_view sID, short nResponse)
stringmap m_aDeferredProperties
static std::vector< vcl::EnumContext::Context > handleStyle(xmlreader::XmlReader &reader, int &nPriority)
void handleActionWidget(xmlreader::XmlReader &reader)
static vcl::Window * prepareWidgetOwnScrolling(vcl::Window *pParent, WinBits &rWinStyle)
void(* customMakeWidget)(VclPtr< vcl::Window > &rRet, const VclPtr< vcl::Window > &pParent, stringmap &rVec)
These functions create a new widget with parent pParent and return it in rRet.
PackingData get_window_packing_data(const vcl::Window *pWindow) const
VclPtr< vcl::Window > m_pParent
void extractModel(const OUString &id, stringmap &rVec)
void mungeModel(ListBox &rTarget, const ListStore &rStore, sal_uInt16 nActiveId)
const ListStore * get_model_by_name(const OUString &sID) const
vcl::Window * get_widget_root()
css::uno::Reference< css::frame::XFrame > m_xFrame
XFrame to be able to extract labels and other properties of the UNO commands (like of ....
void extractButtonImage(const OUString &id, stringmap &rMap, bool bRadio)
VclPtr< Menu > handleMenu(xmlreader::XmlReader &reader, const OUString &rID, bool bMenuBar)
VclPtr< vcl::Window > handleObject(vcl::Window *pParent, stringmap *pAtkProps, xmlreader::XmlReader &reader)
static void applyAtkProperties(vcl::Window *pWindow, const stringmap &rProperties)
VclPtr< vcl::Window > insertObject(vcl::Window *pParent, const OUString &rClass, const OUString &rID, stringmap &rProps, stringmap &rPangoAttributes, stringmap &rAtkProps)
static void collectAtkRelationAttribute(xmlreader::XmlReader &reader, stringmap &rMap)
bool m_bToplevelHasDeferredInit
static void mungeTextBuffer(VclMultiLineEdit &rTarget, const TextBuffer &rTextBuffer)
void connectNumericFormatterAdjustment(const OUString &id, const OUString &rAdjustment)
std::vector< WinAndId > m_aChildren
void handleRow(xmlreader::XmlReader &reader, const OUString &rID)
void connectFormattedFormatterAdjustment(const OUString &id, const OUString &rAdjustment)
bool m_bToplevelHasDeferredProperties
void cleanupWidgetOwnScrolling(vcl::Window *pScrollParent, vcl::Window *pWindow, stringmap &rMap)
std::vector< std::unique_ptr< OUString > > m_aUserData
ResHookProc m_pStringReplace
void extractMnemonicWidget(const OUString &id, stringmap &rMap)
bool m_bToplevelParentFound
void handleListStore(xmlreader::XmlReader &reader, const OUString &rID, std::u16string_view rClass)
void extractBuffer(const OUString &id, stringmap &rVec)
static void collectAccelerator(xmlreader::XmlReader &reader, accelmap &rMap)
std::map< OUString, OUString > stringmap
void set_window_packing_position(const vcl::Window *pWindow, sal_Int32 nPosition)
OUString get_by_window(const vcl::Window *pWindow) const
void collectProperty(xmlreader::XmlReader &reader, stringmap &rVec) const
static void collectAtkRoleAttribute(xmlreader::XmlReader &reader, stringmap &rMap)
void insertMenuObject(Menu *pParent, PopupMenu *pSubMenu, const OUString &rClass, const OUString &rID, stringmap &rProps, stringmap &rAtkProps, accelmap &rAccels)
static int getImageSize(const stringmap &rMap)
std::vector< MenuAndId > m_aMenus
std::unique_ptr< ParserState > m_pParserState
VclBuilder(vcl::Window *pParent, const OUString &sUIRootDir, const OUString &sUIFile, OUString sID={}, css::uno::Reference< css::frame::XFrame > xFrame=css::uno::Reference< css::frame::XFrame >(), bool bLegacy=true, const NotebookBarAddonsItem *pNotebookBarAddonsItem=nullptr)
const TextBuffer * get_buffer_by_name(const OUString &sID) const
stringmap handleAtkObject(xmlreader::XmlReader &reader) const
void extractGroup(const OUString &id, stringmap &rVec)
const Adjustment * get_adjustment_by_name(const OUString &sID) const
void handleChild(vcl::Window *pParent, stringmap *pAtkProps, xmlreader::XmlReader &reader)
std::map< OUString, std::pair< OUString, OUString > > accelmap
void handleMenuObject(Menu *pParent, xmlreader::XmlReader &reader)
void drop_ownership(const vcl::Window *pWindow)
void setDeferredProperties()
void handleSizeGroup(xmlreader::XmlReader &reader)
void delete_by_window(vcl::Window *pWindow)
static void mungeAdjustment(NumericFormatter &rTarget, const Adjustment &rAdjustment)
void applyPackingProperty(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader)
PopupMenu * get_menu(std::u16string_view sID)
static bool extractAdjustmentToMap(const OUString &id, stringmap &rVec, std::vector< WidgetAdjustmentMap > &rAdjustmentMap)
VclPtr< vcl::Window > makeObject(vcl::Window *pParent, const OUString &rClass, const OUString &rID, stringmap &rVec)
void disposeBuilder()
releases references and disposes all children.
void handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &reader)
static SymbolType mapStockToSymbol(std::u16string_view icon_name)
void handleMenuChild(Menu *pParent, xmlreader::XmlReader &reader)
static void collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap)
void handlePacking(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader)
std::vector< ComboBoxTextItem > handleItems(xmlreader::XmlReader &reader) const
vcl::Window * get_by_name(std::u16string_view sID)
std::unique_ptr< NotebookBarAddonsItem > m_pNotebookBarAddonsItem
vcl::Window * get_label_widget()
A construction helper for a temporary VclPtr.
reference_type * get() const
Get the body.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
vcl::Window * GetPageParent()
void InsertPage(const OUString &rPageId, const OUString &rLabel, const Image &rImage, const OUString &rTooltip, VclPtr< vcl::Window > xPage, int nPos=-1)
VclPtr< vcl::Window > mpRealParent
VclPtr< vcl::Window > mpBorderWindow
VclPtr< vcl::Window > mpParent
std::pair< const_iterator, bool > insert(Value &&x)
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
static Context GetContextEnum(const OUString &rsContextName)
void SetStyle(WinBits nStyle)
vcl::Window * GetParent() const
bool IsControlFont() const
WindowType GetType() const
void set_padding(sal_Int32 nPadding)
virtual void SetSizePixel(const Size &rNewSize)
Size get_preferred_size() const
vcl::Window * GetWindow(GetWindowType nType) const
void set_border_width(sal_Int32 nBorderWidth)
void set_grid_left_attach(sal_Int32 nAttach)
Dialog * GetParentDialog() const
void set_height_request(sal_Int32 nHeightRequest)
void set_id(const OUString &rID)
Sets an ID.
bool set_font_attribute(const OUString &rKey, std::u16string_view rValue)
VclPackType get_pack_type() const
void reorderWithinParent(sal_uInt16 nNewPosition)
void set_grid_height(sal_Int32 nRows)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
const OUString & GetHelpId() const
vcl::Font GetControlFont() const
void set_pack_type(VclPackType ePackType)
bool get_secondary() const
SystemWindow * GetSystemWindow() const
void SetAccessibleRole(sal_uInt16 nRole)
bool IsDockingWindow() const
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
sal_Int32 get_height_request() const
void add_to_size_group(const std::shared_ptr< VclSizeGroup > &xGroup)
sal_Int32 get_grid_left_attach() const
sal_Int32 get_grid_top_attach() const
void set_width_request(sal_Int32 nWidthRequest)
bool IsSystemWindow() const
virtual Size GetSizePixel() const
sal_Int32 get_width_request() const
void set_secondary(bool bSecondary)
void set_expand(bool bExpand)
void set_grid_top_attach(sal_Int32 nAttach)
void SetQuickHelpText(const OUString &rHelpText)
virtual OUString GetText() const
void set_fill(bool bFill)
void SetAccessibleRelationLabelFor(vcl::Window *pLabelFor)
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
void set_non_homogeneous(bool bNonHomogeneous)
void SetType(WindowType nType)
virtual bool set_property(const OUString &rKey, const OUString &rValue)
void set_grid_width(sal_Int32 nCols)
void SetAccessibleRelationLabeledBy(vcl::Window *pLabeledBy)
void SetHelpId(const OUString &)
std::unique_ptr< Entry > m_xEntry
EntryTreeView(std::unique_ptr< Entry > xEntry, std::unique_ptr< TreeView > xTreeView)
void set_height_request_by_rows(int nRows)
std::unique_ptr< TreeView > m_xTreeView
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const =0
virtual bool get_row_expanded(const TreeIter &rIter) const =0
virtual bool get_iter_first(TreeIter &rIter) const =0
virtual bool iter_parent(TreeIter &rIter) const =0
virtual bool iter_next(TreeIter &rIter) const =0
virtual int iter_compare(const TreeIter &a, const TreeIter &b) const =0
virtual int get_iter_depth(const TreeIter &rIter) const =0
Result nextItem(Text reportText, Span *data, int *nsId)
bool nextAttribute(int *nsId, Span *localName)
Span getAttributeValue(bool fullyNormalize)
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_0
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_F1
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_INSERT
constexpr sal_uInt16 KEY_MULTIPLY
#define LINK(Instance, Class, Member)
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
void ensureDefaultWidthChars(VclBuilder::stringmap &rMap)
sal_Int16 getRoleFromName(const OUString &roleName)
void set_properties(vcl::Window *pWindow, const VclBuilder::stringmap &rProps)
OUString convertMnemonicMarkup(std::u16string_view rIn)
bool extractDropdown(VclBuilder::stringmap &rMap)
OUString extractCustomProperty(VclBuilder::stringmap &rMap)
void reorderWithinParent(vcl::Window &rWindow, sal_uInt16 nNewPosition)
void MergeNotebookBarAddons(vcl::Window *pParent, const VclBuilder::customMakeWidget &pFunction, const css::uno::Reference< css::frame::XFrame > &m_xFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem, VclBuilder::stringmap &rMap)
void MergeNotebookBarMenuAddons(Menu *pPopupMenu, sal_Int16 nItemId, const OUString &sItemIdName, NotebookBarAddonsItem &aNotebookBarAddonsItem)
ResHookProc GetReadStringHook()
std::locale Create(std::string_view aPrefixName, const LanguageTag &rLocale)
OUString get(TranslateId sContextAndId, const std::locale &loc)
bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile)
bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile)
bool isBuilderEnabledForPopup(std::u16string_view rUIFile)
sal_uInt32 toUInt32(std::u16string_view str, sal_Int16 radix=10)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
Return a label for the given command.
OUString GetTooltipForCommand(const OUString &rsCommandName, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, const Reference< frame::XFrame > &rxFrame)
OUString GetModuleIdentifier(const Reference< frame::XFrame > &rxFrame)
Image GetImageForCommand(const OUString &rsCommandName, const Reference< frame::XFrame > &rxFrame, vcl::ImageType eImageType)
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
Return a label for the given command.
void VclBuilderPreload()
Pre-loads all modules containing UI information.
bool TextToValue(const OUString &rStr, double &rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper &rLocaleDataWrapper, FieldUnit eUnit)
sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
IMPL_LINK_NOARG(HexColorControl, OnAsyncModifyHdl, void *, void)
size_t GetAbsPos(const weld::TreeView &rTreeView, const weld::TreeIter &rIter)
bool IsEntryVisible(const weld::TreeView &rTreeView, const weld::TreeIter &rIter)
IMPL_LINK(CustomWeld, DoResize, const Size &, rSize, void)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
std::vector< row > m_aEntries
std::vector< OUString > row
MenuAndId(OUString sId, Menu *pMenu)
std::vector< OUString > m_aWidgets
Reference< XFrame > xFrame
ImplSVData * ImplGetSVData()
const FieldUnitStringList & ImplGetFieldUnits()
std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList
WinBits const WB_CLOSEABLE
WinBits const WB_MOVEABLE
WinBits const WB_DIALOGCONTROL
WinBits const WB_OWNERDRAWDECORATION
WinBits const WB_DOCKABLE
WinBits const WB_DROPDOWN
WinBits const WB_STDTABCONTROL
WinBits const WB_SIZEABLE
WinBits const WB_SYSTEMWINDOW
WinBits const WB_SIMPLEMODE
WinBits const WB_AUTOVSCROLL
WinBits const WB_AUTOHSCROLL
WinBits const WB_HASBUTTONS
WinBits const WB_FLATBUTTON
WinBits const WB_HASBUTTONSATROOT
WinBits const WB_SMALLSTYLE
WinBits const WB_DEFBUTTON
WinBits const WB_ALLOWMENUBAR
WinBits const WB_CLIPCHILDREN