LibreOffice Module cui (master)  1
SvxNotebookbarConfigPage.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 
23 #include <vcl/event.hxx>
24 #include <vcl/weld.hxx>
25 #include <vcl/svapp.hxx>
26 
27 #include <algorithm>
28 #include <cstddef>
29 
30 #include <helpids.h>
31 #include <strings.hrc>
32 
33 #include <cfg.hxx>
35 #include <SvxConfigPageHelper.hxx>
36 #include <dialmgr.hxx>
37 #include <libxml/parser.h>
38 #include <osl/file.hxx>
41 #include <unotools/configmgr.hxx>
43 #include <o3tl/string_view.hxx>
44 #include <com/sun/star/frame/theUICommandDescription.hpp>
45 
46 namespace uno = com::sun::star::uno;
47 namespace frame = com::sun::star::frame;
48 namespace lang = com::sun::star::lang;
50 namespace beans = com::sun::star::beans;
52 
53 static bool isCategoryAvailable(std::u16string_view sClassId, std::u16string_view sUIItemId,
54  std::u16string_view sActiveCategory, bool& isCategory)
55 {
56  if (sUIItemId == sActiveCategory)
57  return true;
58  else if ((sClassId == u"GtkMenu" || sClassId == u"GtkGrid") && sUIItemId != sActiveCategory)
59  {
60  isCategory = false;
61  return false;
62  }
63  return false;
64 }
65 
66 static OUString charToString(const char* cString)
67 {
68  return OUString(cString, strlen(cString), RTL_TEXTENCODING_UTF8);
69 }
70 
71 static OUString getFileName(std::u16string_view aFileName)
72 {
73  if (aFileName == u"notebookbar.ui")
74  return CuiResId(RID_CUISTR_TABBED);
75  else if (aFileName == u"notebookbar_compact.ui")
76  return CuiResId(RID_CUISTR_TABBED_COMPACT);
77  else if (aFileName == u"notebookbar_groupedbar_full.ui")
78  return CuiResId(RID_CUISTR_GROUPEDBAR);
79  else if (aFileName == u"notebookbar_groupedbar_compact.ui")
80  return CuiResId(RID_CUISTR_GROUPEDBAR_COMPACT);
81  else
82  return "None";
83 }
84 
85 static OUString getModuleId(std::u16string_view sModuleName)
86 {
87  if (sModuleName == u"Writer")
88  return "com.sun.star.text.TextDocument";
89  else if (sModuleName == u"Draw")
90  return "com.sun.star.drawing.DrawingDocument";
91  else if (sModuleName == u"Impress")
92  return "com.sun.star.presentation.PresentationDocument";
93  else if (sModuleName == u"Calc")
94  return "com.sun.star.sheet.SpreadsheetDocument";
95  else
96  return "None";
97 }
98 
100  weld::DialogController* pController,
101  const SfxItemSet& rSet)
102  : SvxConfigPage(pPage, pController, rSet)
103 {
104  m_xCommandCategoryListBox->set_visible(false);
105  m_xDescriptionFieldLb->set_visible(false);
106  m_xSearchEdit->set_visible(false);
107  m_xDescriptionField->set_visible(false);
108  m_xMoveUpButton->set_visible(false);
109  m_xMoveDownButton->set_visible(false);
110  m_xAddCommandButton->set_visible(false);
111  m_xRemoveCommandButton->set_visible(false);
112  m_xLeftFunctionLabel->set_visible(false);
113  m_xSearchLabel->set_visible(false);
114  m_xCategoryLabel->set_visible(false);
115  m_xInsertBtn->set_visible(false);
116  m_xModifyBtn->set_visible(false);
117  m_xResetBtn->set_visible(false);
118  m_xCustomizeLabel->set_visible(false);
119 
120  weld::TreeView& rCommandCategoryBox = m_xFunctions->get_widget();
121  rCommandCategoryBox.hide();
122 
123  m_xContentsListBox.reset(
124  new SvxNotebookbarEntriesListBox(m_xBuilder->weld_tree_view("toolcontents"), this));
125  m_xDropTargetHelper.reset(
126  new SvxConfigPageFunctionDropTarget(*this, m_xContentsListBox->get_widget()));
127  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
128  Size aSize(m_xFunctions->get_size_request());
129  rTreeView.set_size_request(aSize.Width(), aSize.Height());
130 
131  rTreeView.set_hexpand(true);
132  rTreeView.set_vexpand(true);
134  rTreeView.show();
135 }
136 
138 
140 
142 
144 {
145  m_xTopLevelListBox->clear();
146  m_xContentsListBox->clear();
147  m_xSaveInListBox->clear();
149  OUString sNotebookbarInterface = getFileName(m_sFileName);
150 
151  OUString sScopeName
152  = utl::ConfigManager::getProductName() + " " + m_sAppName + " - " + sNotebookbarInterface;
153  OUString sSaveInListBoxID = notebookbarTabScope;
154 
155  m_xSaveInListBox->append(sSaveInListBoxID, sScopeName);
156  m_xSaveInListBox->set_active_id(sSaveInListBoxID);
157 
158  m_xTopLevelListBox->append("NotebookBar", CuiResId(RID_CUISTR_ALL_COMMANDS));
159  m_xTopLevelListBox->set_active_id("NotebookBar");
160  SelectElement();
161 }
162 
164  const css::uno::Reference<css::ui::XUIConfigurationManager>& xCfgMgr,
165  const css::uno::Reference<css::ui::XUIConfigurationManager>& xParentCfgMgr,
166  const OUString& aModuleId, bool bDocConfig)
167 {
168  return static_cast<SaveInData*>(
169  new ToolbarSaveInData(xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig));
170 }
171 
173 
175 {
176  OUString msg = CuiResId(RID_CUISTR_CONFIRM_TOOLBAR_RESET);
177 
178  OUString saveInName = m_xSaveInListBox->get_active_text();
179 
180  OUString label = SvxConfigPageHelper::replaceSaveInName(msg, saveInName);
181 
182  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(
183  GetFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo, label));
184  int nValue = xQueryBox->run();
185  if (nValue == RET_YES)
186  {
187  OUString sOriginalUIPath = CustomNotebookbarGenerator::getOriginalUIPath();
188  OUString sCustomizedUIPath = CustomNotebookbarGenerator::getCustomizedUIPath();
189  osl::File::copy(sOriginalUIPath, sCustomizedUIPath);
190  OUString sNotebookbarInterface = getFileName(m_sFileName);
191  Sequence<OUString> sSequenceEntries;
192  CustomNotebookbarGenerator::setCustomizedUIItem(sSequenceEntries, sNotebookbarInterface);
193  OUString sUIPath = "modules/s" + m_sAppName.toAsciiLowerCase() + "/ui/";
195  }
196  return nValue;
197 }
198 
199 void SvxConfigPage::InsertEntryIntoNotebookbarTabUI(std::u16string_view sClassId,
200  const OUString& sUIItemId,
201  const OUString& sUIItemCommand,
202  weld::TreeView& rTreeView,
203  const weld::TreeIter& rIter)
204 {
205  css::uno::Reference<css::container::XNameAccess> m_xCommandToLabelMap;
206  uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
207  uno::Reference<container::XNameAccess> xNameAccess(
208  css::frame::theUICommandDescription::get(xContext));
209 
210  uno::Sequence<beans::PropertyValue> aPropSeq;
211 
212  xNameAccess->getByName(getModuleId(m_sAppName)) >>= m_xCommandToLabelMap;
213 
214  try
215  {
216  uno::Any aModuleVal = m_xCommandToLabelMap->getByName(sUIItemCommand);
217 
218  aModuleVal >>= aPropSeq;
219  }
220  catch (container::NoSuchElementException&)
221  {
222  }
223 
224  OUString aLabel;
225  for (auto const& prop : std::as_const(aPropSeq))
226  if (prop.Name == "Name")
227  prop.Value >>= aLabel;
228 
229  OUString aName = SvxConfigPageHelper::stripHotKey(aLabel);
230 
231  if (sClassId == u"GtkSeparatorMenuItem" || sClassId == u"GtkSeparator")
232  {
233  rTreeView.set_text(rIter, "--------------------------------------------", 0);
234  }
235  else
236  {
237  if (aName.isEmpty())
238  aName = sUIItemId;
239  auto xImage = GetSaveInData()->GetImage(sUIItemCommand);
240  if (xImage.is())
241  rTreeView.set_image(rIter, xImage, -1);
242  rTreeView.set_text(rIter, aName, 0);
243  rTreeView.set_id(rIter, sUIItemId);
244  }
245 }
246 
247 void SvxNotebookbarConfigPage::getNodeValue(xmlNode* pNodePtr, NotebookbarEntries& aNodeEntries)
248 {
249  pNodePtr = pNodePtr->xmlChildrenNode;
250  while (pNodePtr)
251  {
252  if (!(xmlStrcmp(pNodePtr->name, reinterpret_cast<const xmlChar*>("property"))))
253  {
254  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("name"));
255  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("visible"))))
256  {
257  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
258  const char* cVisibleValue = reinterpret_cast<const char*>(aValue);
259  aNodeEntries.sVisibleValue = charToString(cVisibleValue);
260  xmlFree(aValue);
261  }
262  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("action_name"))))
263  {
264  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
265  const char* cActionName = reinterpret_cast<const char*>(aValue);
266  aNodeEntries.sActionName = charToString(cActionName);
267  xmlFree(aValue);
268  }
269  xmlFree(UriValue);
270  }
271  pNodePtr = pNodePtr->next;
272  }
273 }
274 
275 void SvxNotebookbarConfigPage::searchNodeandAttribute(std::vector<NotebookbarEntries>& aEntries,
276  std::vector<CategoriesEntries>& aCategoryList,
277  OUString& sActiveCategory,
278  CategoriesEntries& aCurItemEntry,
279  xmlNode* pNodePtr, bool isCategory)
280 {
281  pNodePtr = pNodePtr->xmlChildrenNode;
282  while (pNodePtr)
283  {
284  if (pNodePtr->type == XML_ELEMENT_NODE)
285  {
286  const char* cNodeName = reinterpret_cast<const char*>(pNodePtr->name);
287  if (strcmp(cNodeName, "object") == 0)
288  {
289  OUString sSecondVal;
290 
291  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("id"));
292  const char* cUIItemID = reinterpret_cast<const char*>(UriValue);
293  OUString sUIItemId = charToString(cUIItemID);
294  xmlFree(UriValue);
295 
296  UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("class"));
297  const char* cClassId = reinterpret_cast<const char*>(UriValue);
298  OUString sClassId = charToString(cClassId);
299  xmlFree(UriValue);
300 
301  CategoriesEntries aCategoryEntry;
302  if (sClassId == "sfxlo-PriorityHBox")
303  {
304  aCategoryEntry.sDisplayName = sUIItemId;
305  aCategoryEntry.sUIItemId = sUIItemId;
306  aCategoryEntry.sClassType = sClassId;
307  aCategoryList.push_back(aCategoryEntry);
308 
309  aCurItemEntry = aCategoryEntry;
310  }
311  else if (sClassId == "sfxlo-PriorityMergedHBox")
312  {
313  aCategoryEntry.sDisplayName = aCurItemEntry.sDisplayName + " | " + sUIItemId;
314  aCategoryEntry.sUIItemId = sUIItemId;
315  aCategoryEntry.sClassType = sClassId;
316 
317  if (aCurItemEntry.sClassType == sClassId)
318  {
319  sal_Int32 rPos = 0;
320  aCategoryEntry.sDisplayName
321  = OUString::Concat(
322  o3tl::getToken(aCurItemEntry.sDisplayName, rPos, ' ', rPos))
323  + " | " + sUIItemId;
324  }
325  aCategoryList.push_back(aCategoryEntry);
326  aCurItemEntry = aCategoryEntry;
327  }
328  else if (sClassId == "svtlo-ManagedMenuButton")
329  {
330  sal_Int32 rPos = 1;
331  sSecondVal = sUIItemId.getToken(rPos, ':', rPos);
332  if (!sSecondVal.isEmpty())
333  {
334  aCategoryEntry.sDisplayName
335  = aCurItemEntry.sDisplayName + " | " + sSecondVal;
336  aCategoryEntry.sUIItemId = sSecondVal;
337  aCategoryList.push_back(aCategoryEntry);
338  }
339  }
340 
341  NotebookbarEntries nodeEntries;
342  if (isCategoryAvailable(sClassId, sUIItemId, sActiveCategory, isCategory)
343  || isCategory)
344  {
345  isCategory = true;
346  if (sClassId == "GtkMenuItem" || sClassId == "GtkToolButton"
347  || sClassId == "GtkMenuToolButton"
348  || (sClassId == "svtlo-ManagedMenuButton" && sSecondVal.isEmpty()))
349  {
350  nodeEntries.sClassId = sClassId;
351  nodeEntries.sUIItemId = sUIItemId;
352  nodeEntries.sDisplayName = sUIItemId;
353 
354  getNodeValue(pNodePtr, nodeEntries);
355  aEntries.push_back(nodeEntries);
356  }
357  else if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
358  {
359  nodeEntries.sClassId = sClassId;
360  nodeEntries.sUIItemId = sUIItemId;
361  nodeEntries.sDisplayName = "Null";
362  nodeEntries.sVisibleValue = "Null";
363  nodeEntries.sActionName = "Null";
364  aEntries.push_back(nodeEntries);
365  }
366  else if (sClassId == "sfxlo-PriorityHBox"
367  || sClassId == "sfxlo-PriorityMergedHBox"
368  || sClassId == "svtlo-ManagedMenuButton")
369  {
370  nodeEntries.sClassId = sClassId;
371  nodeEntries.sUIItemId = sUIItemId;
372  nodeEntries.sDisplayName
373  = aCategoryList[aCategoryList.size() - 1].sDisplayName;
374  nodeEntries.sVisibleValue = "Null";
375  nodeEntries.sActionName = "Null";
376  aEntries.push_back(nodeEntries);
377  }
378  }
379  }
380  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry,
381  pNodePtr, isCategory);
382  }
383  pNodePtr = pNodePtr->next;
384  }
385 }
386 
387 void SvxNotebookbarConfigPage::FillFunctionsList(xmlNodePtr pRootNodePtr,
388  std::vector<NotebookbarEntries>& aEntries,
389  std::vector<CategoriesEntries>& aCategoryList,
390  OUString& sActiveCategory)
391 {
392  CategoriesEntries aCurItemEntry;
393  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry, pRootNodePtr,
394  false);
395 }
396 
398 {
399  OString sUIFileUIPath = CustomNotebookbarGenerator::getSystemPath(
401  xmlDocPtr pDoc = xmlParseFile(sUIFileUIPath.getStr());
402  if (!pDoc)
403  return;
404  xmlNodePtr pNodePtr = xmlDocGetRootElement(pDoc);
405 
406  std::vector<NotebookbarEntries> aEntries;
407  std::vector<CategoriesEntries> aCategoryList;
408  OUString sActiveCategory = m_xTopLevelListBox->get_active_id();
409  FillFunctionsList(pNodePtr, aEntries, aCategoryList, sActiveCategory);
410 
411  if (m_xTopLevelListBox->get_count() == 1)
412  {
413  for (std::size_t nIdx = 0; nIdx < aCategoryList.size(); nIdx++)
414  m_xTopLevelListBox->append(aCategoryList[nIdx].sUIItemId,
415  aCategoryList[nIdx].sDisplayName);
416  }
417  tools::ULong nStart = 0;
418  if (aEntries[nStart].sClassId == "sfxlo-PriorityHBox"
419  || aEntries[nStart].sClassId == "sfxlo-PriorityMergedHBox")
420  nStart = 1;
421 
422  std::vector<NotebookbarEntries> aTempEntries;
423  for (std::size_t nIdx = nStart; nIdx < aEntries.size(); nIdx++)
424  {
425  if (aEntries[nIdx].sClassId == "svtlo-ManagedMenuButton")
426  {
427  aTempEntries.push_back(aEntries[nIdx]);
428  sal_Int32 rPos = 1;
429  sActiveCategory = aEntries[nIdx].sUIItemId.getToken(rPos, ':', rPos);
430  FillFunctionsList(pNodePtr, aTempEntries, aCategoryList, sActiveCategory);
431  }
432  else
433  aTempEntries.push_back(aEntries[nIdx]);
434  }
435 
436  aEntries = std::move(aTempEntries);
437 
438  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
439  rTreeView.bulk_insert_for_each(
440  aEntries.size(), [this, &rTreeView, &aEntries](weld::TreeIter& rIter, int nIdx) {
441  OUString sId(OUString::number(nIdx));
442  rTreeView.set_id(rIter, sId);
443  if (aEntries[nIdx].sActionName != "Null")
444  {
445  if (aEntries[nIdx].sVisibleValue == "True")
446  {
447  rTreeView.set_toggle(rIter, TRISTATE_TRUE);
448  }
449  else
450  {
451  rTreeView.set_toggle(rIter, TRISTATE_FALSE);
452  }
453  }
454  InsertEntryIntoNotebookbarTabUI(aEntries[nIdx].sClassId, aEntries[nIdx].sDisplayName,
455  aEntries[nIdx].sActionName, rTreeView, rIter);
456  });
457 
458  aEntries.clear();
459 
460  xmlFreeDoc(pDoc);
461 }
462 
463 SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xParent,
464  SvxConfigPage* pPg)
465  : SvxMenuEntriesListBox(std::move(xParent), pPg)
466 {
467  m_xControl->connect_toggled(LINK(this, SvxNotebookbarEntriesListBox, CheckButtonHdl));
468  m_xControl->connect_key_press(Link<const KeyEvent&, bool>());
469  m_xControl->connect_key_press(LINK(this, SvxNotebookbarEntriesListBox, KeyInputHdl));
470 }
471 
473 
474 static void EditRegistryFile(std::u16string_view sUIItemId, const OUString& sSetEntry,
475  const OUString& sNotebookbarInterface)
476 {
477  int nFlag = 0;
478  Sequence<OUString> aOldEntries
479  = CustomNotebookbarGenerator::getCustomizedUIItem(sNotebookbarInterface);
480  Sequence<OUString> aNewEntries(aOldEntries.getLength() + 1);
481  auto pNewEntries = aNewEntries.getArray();
482  for (int nIdx = 0; nIdx < aOldEntries.getLength(); nIdx++)
483  {
484  sal_Int32 rPos = 0;
485  std::u16string_view sFirstValue = o3tl::getToken(aOldEntries[nIdx], rPos, ',', rPos);
486  if (sFirstValue == sUIItemId)
487  {
488  aOldEntries.getArray()[nIdx] = sSetEntry;
489  nFlag = 1;
490  break;
491  }
492  pNewEntries[nIdx] = aOldEntries[nIdx];
493  }
494 
495  if (nFlag == 0)
496  {
497  pNewEntries[aOldEntries.getLength()] = sSetEntry;
498  CustomNotebookbarGenerator::setCustomizedUIItem(aNewEntries, sNotebookbarInterface);
499  }
500  else
501  {
502  CustomNotebookbarGenerator::setCustomizedUIItem(aOldEntries, sNotebookbarInterface);
503  }
504 }
505 
507 {
508  OUString sUIItemId = m_xControl->get_selected_id();
509  OUString sNotebookbarInterface = getFileName(m_pPage->GetFileName());
510 
511  OUString sVisible;
512  if (m_xControl->get_toggle(nRow) == TRISTATE_TRUE)
513  sVisible = "True";
514  else
515  sVisible = "False";
516  OUString sSetEntries = sUIItemId + ",visible," + sVisible;
517  Sequence<OUString> sSeqOfEntries{ sSetEntries };
518  EditRegistryFile(sUIItemId, sSetEntries, sNotebookbarInterface);
520  OUString sUIPath = "modules/s" + m_pPage->GetAppName().toAsciiLowerCase() + "/ui/";
522 }
523 
525  void)
526 {
527  ChangedVisibility(m_xControl->get_iter_index_in_parent(rRowCol.first));
528 }
529 
530 IMPL_LINK(SvxNotebookbarEntriesListBox, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
531 {
532  if (rKeyEvent.GetKeyCode() == KEY_SPACE)
533  {
534  int nRow = m_xControl->get_selected_index();
535  m_xControl->set_toggle(nRow, m_xControl->get_toggle(nRow) == TRISTATE_TRUE ? TRISTATE_FALSE
536  : TRISTATE_TRUE);
537  ChangedVisibility(nRow);
538  return true;
539  }
540  return SvxMenuEntriesListBox::KeyInputHdl(rKeyEvent);
541 }
542 
543 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void set_text(int row, const OUString &rText, int col=-1)=0
std::unique_ptr< CuiConfigFunctionListBox > m_xFunctions
Definition: cfg.hxx:387
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cfg.hxx:414
const OUString & GetFileName() const
Definition: cfg.hxx:480
static void EditRegistryFile(std::u16string_view sUIItemId, const OUString &sSetEntry, const OUString &sNotebookbarInterface)
std::unique_ptr< weld::MenuButton > m_xModifyBtn
Definition: cfg.hxx:412
std::unique_ptr< CommandCategoryListBox > m_xCommandCategoryListBox
Definition: cfg.hxx:386
static OUString stripHotKey(const OUString &str)
static OUString charToString(const char *cString)
Reference< XControl > m_xControl
SaveInData * CreateSaveInData(const css::uno::Reference< css::ui::XUIConfigurationManager > &, const css::uno::Reference< css::ui::XUIConfigurationManager > &, const OUString &aModuleId, bool docConfig) override
static void searchNodeandAttribute(std::vector< NotebookbarEntries > &aEntries, std::vector< CategoriesEntries > &aCategoryList, OUString &sActiveCategory, CategoriesEntries &aCurCategoryEntry, xmlNode *pNodePtr, bool isCategory)
virtual void hide()=0
std::unique_ptr< SvxConfigPageFunctionDropTarget > m_xDropTargetHelper
Definition: cfg.hxx:404
static void modifyCustomizedUIFile(const Sequence< OUString > &sUIItemProperties)
std::unique_ptr< weld::Button > m_xRemoveCommandButton
Definition: cfg.hxx:418
constexpr OUStringLiteral notebookbarTabScope
Definition: cfg.hxx:43
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
css::uno::Reference< css::graphic::XGraphic > GetImage(const OUString &rCommandURL)
Definition: cfg.cxx:327
std::unique_ptr< weld::Label > m_xCategoryLabel
Definition: cfg.hxx:389
constexpr sal_uInt16 KEY_SPACE
std::unique_ptr< SvxMenuEntriesListBox > m_xContentsListBox
Definition: cfg.hxx:403
TRISTATE_TRUE
virtual void set_id(int row, const OUString &rId)=0
OUString m_sFileName
Definition: cfg.hxx:421
static void getNodeValue(xmlNode *pNodePtr, NotebookbarEntries &aNodeEntries)
std::unique_ptr< weld::ComboBox > m_xTopLevelListBox
Definition: cfg.hxx:400
static void ReloadNotebookBar(std::u16string_view sUIPath)
RET_YES
virtual void show()=0
unsigned long ULong
std::unique_ptr< weld::Label > m_xDescriptionFieldLb
Definition: cfg.hxx:390
std::unique_ptr< weld::TreeView > m_xControl
Definition: cfg.hxx:322
std::pair< const TreeIter &, int > iter_col
void InsertEntryIntoNotebookbarTabUI(std::u16string_view sClassId, const OUString &sUIItemId, const OUString &sUIItemCommand, weld::TreeView &rTreeView, const weld::TreeIter &rIter)
static OUString replaceSaveInName(const OUString &rMessage, std::u16string_view rSaveInName)
virtual void set_help_id(const OString &rName)=0
virtual void set_vexpand(bool bExpand)=0
OUString CuiResId(TranslateId aKey)
Definition: cuiresmgr.cxx:23
IMPL_LINK(SvxNotebookbarEntriesListBox, CheckButtonHdl, const weld::TreeView::iter_col &, rRowCol, void)
static OString getSystemPath(OUString const &sURL)
static OUString getProductName()
constexpr OStringLiteral HID_SVX_CONFIG_NOTEBOOKBAR_CONTENTS
Definition: helpids.h:33
virtual ~SvxNotebookbarConfigPage() override
virtual void set_toggle(int row, TriState eState, int col=-1)=0
const OUString & GetAppName() const
Definition: cfg.hxx:479
TRISTATE_FALSE
std::unique_ptr< weld::Label > m_xSearchLabel
Definition: cfg.hxx:394
float u
SvxNotebookbarEntriesListBox(std::unique_ptr< weld::TreeView > xControl, SvxConfigPage *pPg)
virtual void set_hexpand(bool bExpand)=0
static bool isCategoryAvailable(std::u16string_view sClassId, std::u16string_view sUIItemId, std::u16string_view sActiveCategory, bool &isCategory)
static Sequence< OUString > getCustomizedUIItem(OUString sNotebookbarConfigType)
std::unique_ptr< weld::MenuButton > m_xInsertBtn
Definition: cfg.hxx:411
std::unique_ptr< weld::Entry > m_xSearchEdit
Definition: cfg.hxx:393
SvxNotebookbarConfigPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rItemSet)
weld::Window * GetFrameWeld() const
std::unique_ptr< weld::Label > m_xCustomizeLabel
Definition: cfg.hxx:399
OUString aName
static void FillFunctionsList(xmlNodePtr pRootNodePtr, std::vector< NotebookbarEntries > &aEntries, std::vector< CategoriesEntries > &aCategoryList, OUString &sActiveCategory)
std::unique_ptr< weld::Label > m_xLeftFunctionLabel
Definition: cfg.hxx:392
OUString aLabel
std::unique_ptr< weld::ComboBox > m_xSaveInListBox
Definition: cfg.hxx:409
SvxConfigPage * m_pPage
Definition: cfg.hxx:324
virtual void set_image(int row, const OUString &rImage, int col=-1)=0
std::unique_ptr< weld::TextView > m_xDescriptionField
Definition: cfg.hxx:391
ScXMLEditAttributeMap::Entry const aEntries[]
std::unique_ptr< weld::Button > m_xMoveDownButton
Definition: cfg.hxx:407
static void setCustomizedUIItem(Sequence< OUString > sUIItemProperties, OUString sNotebookbarConfigType)
std::unique_ptr< weld::Button > m_xMoveUpButton
Definition: cfg.hxx:406
def label(st)
virtual void set_size_request(int nWidth, int nHeight)=0
virtual void bulk_insert_for_each(int nSourceCount, const std::function< void(TreeIter &, int nSourceIndex)> &func, const weld::TreeIter *pParent=nullptr, const std::vector< int > *pFixedWidths=nullptr)=0
OUString m_sAppName
Definition: cfg.hxx:420
static OUString getFileName(std::u16string_view aFileName)
SaveInData * GetSaveInData()
Definition: cfg.hxx:478
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
static OUString getModuleId(std::u16string_view sModuleName)
sal_Int16 nValue
std::unique_ptr< weld::Button > m_xAddCommandButton
Definition: cfg.hxx:417
virtual void SelectElement() override
OUString sDisplayName
OUString sId