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 <com/sun/star/frame/theUICommandDescription.hpp>
44 #include <com/sun/star/ui/ImageType.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(const OUString& sClassId, const OUString& sUIItemId,
54  const OUString& sActiveCategory, bool& isCategory)
55 {
56  if (sUIItemId == sActiveCategory)
57  return true;
58  else if ((sClassId == "GtkMenu" || sClassId == "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(const OUString& aFileName)
72 {
73  if (aFileName == "notebookbar.ui")
74  return "Tabbed";
75  else if (aFileName == "notebookbar_compact.ui")
76  return "TabbedCompact";
77  else if (aFileName == "notebookbar_groupedbar_full.ui")
78  return "Groupedbar";
79  else if (aFileName == "notebookbar_groupedbar_compact.ui")
80  return "GroupedbarCompact";
81  else
82  return "None";
83 }
84 
85 static OUString getModuleId(const OUString& sModuleName)
86 {
87  if (sModuleName == "Writer")
88  return "com.sun.star.text.TextDocument";
89  else if (sModuleName == "Draw")
90  return "com.sun.star.drawing.DrawingDocument";
91  else if (sModuleName == "Impress")
92  return "com.sun.star.presentation.PresentationDocument";
93  else if (sModuleName == "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  std::vector<int> aWidths;
128  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
129  Size aSize(m_xFunctions->get_size_request());
130  rTreeView.set_size_request(aSize.Width(), aSize.Height());
131 
132  int nExpectedSize = 16;
133 
134  int nStandardImageColWidth = rTreeView.get_checkbox_column_width();
135  int nMargin = nStandardImageColWidth - nExpectedSize;
136  if (nMargin < 16)
137  nMargin = 16;
138 
139  if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_LARGE)
140  nExpectedSize = 24;
141  else if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_32)
142  nExpectedSize = 32;
143 
144  int nImageColWidth = nExpectedSize + nMargin;
145 
146  aWidths.push_back(nStandardImageColWidth);
147  aWidths.push_back(nImageColWidth);
148  rTreeView.set_column_fixed_widths(aWidths);
149 
150  rTreeView.set_hexpand(true);
151  rTreeView.set_vexpand(true);
153  rTreeView.show();
154 }
155 
157 
159 
161 
163 {
164  m_xTopLevelListBox->clear();
165  m_xContentsListBox->clear();
166  m_xSaveInListBox->clear();
168  OUString sNotebookbarInterface = getFileName(m_sFileName);
169 
170  OUString sScopeName
171  = utl::ConfigManager::getProductName() + " " + m_sAppName + " - " + sNotebookbarInterface;
172  OUString sSaveInListBoxID = notebookbarTabScope;
173 
174  m_xSaveInListBox->append(sSaveInListBoxID, sScopeName);
175  m_xSaveInListBox->set_active_id(sSaveInListBoxID);
176 
177  m_xTopLevelListBox->append("NotebookBar", "All Commands");
178  m_xTopLevelListBox->set_active_id("NotebookBar");
179  SelectElement();
180 }
181 
183  const css::uno::Reference<css::ui::XUIConfigurationManager>& xCfgMgr,
184  const css::uno::Reference<css::ui::XUIConfigurationManager>& xParentCfgMgr,
185  const OUString& aModuleId, bool bDocConfig)
186 {
187  return static_cast<SaveInData*>(
188  new ToolbarSaveInData(xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig));
189 }
190 
192 
194 {
195  OUString msg = CuiResId(RID_SVXSTR_CONFIRM_TOOLBAR_RESET);
196 
197  OUString saveInName = m_xSaveInListBox->get_active_text();
198 
199  OUString label = SvxConfigPageHelper::replaceSaveInName(msg, saveInName);
200 
201  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(
202  GetFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo, label));
203  int nValue = xQueryBox->run();
204  if (nValue == RET_YES)
205  {
206  OUString sOriginalUIPath = CustomNotebookbarGenerator::getOriginalUIPath();
207  OUString sCustomizedUIPath = CustomNotebookbarGenerator::getCustomizedUIPath();
208  osl::File::copy(sOriginalUIPath, sCustomizedUIPath);
209  OUString sNotebookbarInterface = getFileName(m_sFileName);
210  Sequence<OUString> sSequenceEntries;
211  CustomNotebookbarGenerator::setCustomizedUIItem(sSequenceEntries, sNotebookbarInterface);
212  OUString sUIPath = "modules/s" + m_sAppName.toAsciiLowerCase() + "/ui/";
214  }
215  return nValue;
216 }
217 
219  const OUString& sUIItemId,
220  const OUString& sUIItemCommand,
221  weld::TreeView& rTreeView,
222  weld::TreeIter& rIter, int nStartCol)
223 {
224  css::uno::Reference<css::container::XNameAccess> m_xCommandToLabelMap;
225  uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
226  uno::Reference<container::XNameAccess> xNameAccess(
227  css::frame::theUICommandDescription::get(xContext));
228 
229  uno::Sequence<beans::PropertyValue> aPropSeq;
230 
231  xNameAccess->getByName(getModuleId(m_sAppName)) >>= m_xCommandToLabelMap;
232 
233  try
234  {
235  uno::Any aModuleVal = m_xCommandToLabelMap->getByName(sUIItemCommand);
236 
237  aModuleVal >>= aPropSeq;
238  }
239  catch (container::NoSuchElementException&)
240  {
241  }
242 
243  OUString aLabel;
244  for (sal_Int32 i = 0; i < aPropSeq.getLength(); ++i)
245  if (aPropSeq[i].Name == "Name")
246  aPropSeq[i].Value >>= aLabel;
247 
248  OUString aName = SvxConfigPageHelper::stripHotKey(aLabel);
249 
250  if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
251  {
252  OUString sDataInTree = "--------------------------------------------";
253  rTreeView.set_text(rIter, sDataInTree, nStartCol + 1);
254  }
255  else
256  {
257  if (aName.isEmpty())
258  aName = sUIItemId;
259  auto xImage = GetSaveInData()->GetImage(sUIItemCommand);
260  if (xImage.is())
261  rTreeView.set_image(rIter, xImage, nStartCol);
262  rTreeView.set_text(rIter, aName, nStartCol + 1);
263  rTreeView.set_id(rIter, sUIItemId);
264  }
265 }
266 
267 void SvxNotebookbarConfigPage::getNodeValue(xmlNode* pNodePtr, NotebookbarEntries& aNodeEntries)
268 {
269  pNodePtr = pNodePtr->xmlChildrenNode;
270  while (pNodePtr)
271  {
272  if (!(xmlStrcmp(pNodePtr->name, reinterpret_cast<const xmlChar*>("property"))))
273  {
274  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("name"));
275  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("visible"))))
276  {
277  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
278  const char* cVisibleValue = reinterpret_cast<const char*>(aValue);
279  aNodeEntries.sVisibleValue = charToString(cVisibleValue);
280  xmlFree(aValue);
281  }
282  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("action_name"))))
283  {
284  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
285  const char* cActionName = reinterpret_cast<const char*>(aValue);
286  aNodeEntries.sActionName = charToString(cActionName);
287  xmlFree(aValue);
288  }
289  xmlFree(UriValue);
290  }
291  pNodePtr = pNodePtr->next;
292  }
293 }
294 
295 void SvxNotebookbarConfigPage::searchNodeandAttribute(std::vector<NotebookbarEntries>& aEntries,
296  std::vector<CategoriesEntries>& aCategoryList,
297  OUString& sActiveCategory,
298  CategoriesEntries& aCurItemEntry,
299  xmlNode* pNodePtr, bool isCategory)
300 {
301  pNodePtr = pNodePtr->xmlChildrenNode;
302  while (pNodePtr)
303  {
304  if (pNodePtr->type == XML_ELEMENT_NODE)
305  {
306  const char* cNodeName = reinterpret_cast<const char*>(pNodePtr->name);
307  if (strcmp(cNodeName, "object") == 0)
308  {
309  OUString sSecondVal;
310 
311  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("id"));
312  const char* cUIItemID = reinterpret_cast<const char*>(UriValue);
313  OUString sUIItemId = charToString(cUIItemID);
314  xmlFree(UriValue);
315 
316  UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("class"));
317  const char* cClassId = reinterpret_cast<const char*>(UriValue);
318  OUString sClassId = charToString(cClassId);
319  xmlFree(UriValue);
320 
321  CategoriesEntries aCategoryEntry;
322  if (sClassId == "sfxlo-PriorityHBox")
323  {
324  aCategoryEntry.sDisplayName = sUIItemId;
325  aCategoryEntry.sUIItemId = sUIItemId;
326  aCategoryEntry.sClassType = sClassId;
327  aCategoryList.push_back(aCategoryEntry);
328 
329  aCurItemEntry = aCategoryEntry;
330  }
331  else if (sClassId == "sfxlo-PriorityMergedHBox")
332  {
333  aCategoryEntry.sDisplayName = aCurItemEntry.sDisplayName + " | " + sUIItemId;
334  aCategoryEntry.sUIItemId = sUIItemId;
335  aCategoryEntry.sClassType = sClassId;
336 
337  if (aCurItemEntry.sClassType == sClassId)
338  {
339  sal_Int32 rPos = 0;
340  aCategoryEntry.sDisplayName
341  = aCurItemEntry.sDisplayName.getToken(rPos, ' ', rPos) + " | "
342  + sUIItemId;
343  }
344  aCategoryList.push_back(aCategoryEntry);
345  aCurItemEntry = aCategoryEntry;
346  }
347  else if (sClassId == "svtlo-ManagedMenuButton")
348  {
349  sal_Int32 rPos = 1;
350  sSecondVal = sUIItemId.getToken(rPos, ':', rPos);
351  if (!sSecondVal.isEmpty())
352  {
353  aCategoryEntry.sDisplayName
354  = aCurItemEntry.sDisplayName + " | " + sSecondVal;
355  aCategoryEntry.sUIItemId = sSecondVal;
356  aCategoryList.push_back(aCategoryEntry);
357  }
358  }
359 
360  NotebookbarEntries nodeEntries;
361  if (isCategoryAvailable(sClassId, sUIItemId, sActiveCategory, isCategory)
362  || isCategory)
363  {
364  isCategory = true;
365  if (sClassId == "GtkMenuItem" || sClassId == "GtkToolButton"
366  || sClassId == "GtkMenuToolButton"
367  || (sClassId == "svtlo-ManagedMenuButton" && sSecondVal.isEmpty()))
368  {
369  nodeEntries.sClassId = sClassId;
370  nodeEntries.sUIItemId = sUIItemId;
371  nodeEntries.sDisplayName = sUIItemId;
372 
373  getNodeValue(pNodePtr, nodeEntries);
374  aEntries.push_back(nodeEntries);
375  }
376  else if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
377  {
378  nodeEntries.sClassId = sClassId;
379  nodeEntries.sUIItemId = sUIItemId;
380  nodeEntries.sDisplayName = "Null";
381  nodeEntries.sVisibleValue = "Null";
382  nodeEntries.sActionName = "Null";
383  aEntries.push_back(nodeEntries);
384  }
385  else if (sClassId == "sfxlo-PriorityHBox"
386  || sClassId == "sfxlo-PriorityMergedHBox"
387  || sClassId == "svtlo-ManagedMenuButton")
388  {
389  nodeEntries.sClassId = sClassId;
390  nodeEntries.sUIItemId = sUIItemId;
391  nodeEntries.sDisplayName
392  = aCategoryList[aCategoryList.size() - 1].sDisplayName;
393  nodeEntries.sVisibleValue = "Null";
394  nodeEntries.sActionName = "Null";
395  aEntries.push_back(nodeEntries);
396  }
397  }
398  }
399  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry,
400  pNodePtr, isCategory);
401  }
402  pNodePtr = pNodePtr->next;
403  }
404 }
405 
406 void SvxNotebookbarConfigPage::FillFunctionsList(xmlNodePtr pRootNodePtr,
407  std::vector<NotebookbarEntries>& aEntries,
408  std::vector<CategoriesEntries>& aCategoryList,
409  OUString& sActiveCategory)
410 {
411  CategoriesEntries aCurItemEntry;
412  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry, pRootNodePtr,
413  false);
414 }
415 
417 {
418  OString sUIFileUIPath = CustomNotebookbarGenerator::getSystemPath(
420  xmlDocPtr pDoc = xmlParseFile(sUIFileUIPath.getStr());
421  xmlNodePtr pNodePtr = xmlDocGetRootElement(pDoc);
422 
423  std::vector<NotebookbarEntries> aEntries;
424  std::vector<CategoriesEntries> aCategoryList;
425  OUString sActiveCategory = m_xTopLevelListBox->get_active_id();
426  FillFunctionsList(pNodePtr, aEntries, aCategoryList, sActiveCategory);
427 
428  if (m_xTopLevelListBox->get_count() == 1)
429  {
430  for (std::size_t nIdx = 0; nIdx < aCategoryList.size(); nIdx++)
431  m_xTopLevelListBox->append(aCategoryList[nIdx].sUIItemId,
432  aCategoryList[nIdx].sDisplayName);
433  }
434  unsigned long nStart = 0;
435  if (aEntries[nStart].sClassId == "sfxlo-PriorityHBox"
436  || aEntries[nStart].sClassId == "sfxlo-PriorityMergedHBox")
437  nStart = 1;
438 
439  std::vector<NotebookbarEntries> aTempEntries;
440  for (std::size_t nIdx = nStart; nIdx < aEntries.size(); nIdx++)
441  {
442  if (aEntries[nIdx].sClassId == "svtlo-ManagedMenuButton")
443  {
444  aTempEntries.push_back(aEntries[nIdx]);
445  std::vector<NotebookbarEntries> aGtkEntries;
446  sal_Int32 rPos = 1;
447  sActiveCategory = aEntries[nIdx].sUIItemId.getToken(rPos, ':', rPos);
448  FillFunctionsList(pNodePtr, aGtkEntries, aCategoryList, sActiveCategory);
449  for (std::size_t Idx = 0; Idx < aGtkEntries.size(); Idx++)
450  aTempEntries.push_back(aGtkEntries[Idx]);
451  aGtkEntries.clear();
452  }
453  else
454  aTempEntries.push_back(aEntries[nIdx]);
455  }
456 
457  aEntries = aTempEntries;
458  aTempEntries.clear();
459 
460  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
461  rTreeView.bulk_insert_for_each(
462  aEntries.size(), [this, &rTreeView, &aEntries](weld::TreeIter& rIter, int nIdx) {
463  OUString sId(OUString::number(nIdx));
464  rTreeView.set_id(rIter, sId);
465  if (aEntries[nIdx].sActionName != "Null")
466  {
467  if (aEntries[nIdx].sVisibleValue == "True")
468  {
469  rTreeView.set_toggle(rIter, TRISTATE_TRUE, 0);
470  }
471  else
472  {
473  rTreeView.set_toggle(rIter, TRISTATE_FALSE, 0);
474  }
475  }
476  InsertEntryIntoNotebookbarTabUI(aEntries[nIdx].sClassId, aEntries[nIdx].sDisplayName,
477  aEntries[nIdx].sActionName, rTreeView, rIter, 1);
478  });
479 
480  aEntries.clear();
481 
482  if (pDoc != nullptr)
483  {
484  xmlFreeDoc(pDoc);
485  }
486 }
487 
488 SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xParent,
489  SvxConfigPage* pPg)
490  : SvxMenuEntriesListBox(std::move(xParent), pPg)
491 {
492  m_xControl->connect_toggled(LINK(this, SvxNotebookbarEntriesListBox, CheckButtonHdl));
493  m_xControl->connect_key_press(Link<const KeyEvent&, bool>());
494  m_xControl->connect_key_press(LINK(this, SvxNotebookbarEntriesListBox, KeyInputHdl));
495 }
496 
498 
499 static void EditRegistryFile(const OUString& sUIItemId, const OUString& sSetEntry,
500  const OUString& sNotebookbarInterface)
501 {
502  int nFlag = 0;
503  Sequence<OUString> aOldEntries
504  = CustomNotebookbarGenerator::getCustomizedUIItem(sNotebookbarInterface);
505  Sequence<OUString> aNewEntries(aOldEntries.getLength() + 1);
506  for (int nIdx = 0; nIdx < aOldEntries.getLength(); nIdx++)
507  {
508  sal_Int32 rPos = 0;
509  OUString sFirstValue = aOldEntries[nIdx].getToken(rPos, ',', rPos);
510  if (sFirstValue == sUIItemId)
511  {
512  aOldEntries[nIdx] = sSetEntry;
513  nFlag = 1;
514  break;
515  }
516  aNewEntries[nIdx] = aOldEntries[nIdx];
517  }
518 
519  if (nFlag == 0)
520  {
521  aNewEntries[aOldEntries.getLength()] = sSetEntry;
522  CustomNotebookbarGenerator::setCustomizedUIItem(aNewEntries, sNotebookbarInterface);
523  }
524  else
525  {
526  CustomNotebookbarGenerator::setCustomizedUIItem(aOldEntries, sNotebookbarInterface);
527  }
528 }
529 
531 {
532  OUString sUIItemId = m_xControl->get_selected_id();
533  OUString sNotebookbarInterface = getFileName(m_pPage->GetFileName());
534 
535  OUString sVisible;
536  if (m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE)
537  sVisible = "True";
538  else
539  sVisible = "False";
540  OUString sSetEntries = sUIItemId + ",visible," + sVisible;
541  Sequence<OUString> sSeqOfEntries(1);
542  sSeqOfEntries[0] = sSetEntries;
543  EditRegistryFile(sUIItemId, sSetEntries, sNotebookbarInterface);
545  OUString sUIPath = "modules/s" + m_pPage->GetAppName().toAsciiLowerCase() + "/ui/";
547 }
548 
549 IMPL_LINK(SvxNotebookbarEntriesListBox, CheckButtonHdl, const row_col&, rRowCol, void)
550 {
551  ChangedVisibility(rRowCol.first);
552 }
553 
554 IMPL_LINK(SvxNotebookbarEntriesListBox, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
555 {
556  if (rKeyEvent.GetKeyCode() == KEY_SPACE)
557  {
558  int nRow = m_xControl->get_selected_index();
559  m_xControl->set_toggle(
560  nRow, m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE ? TRISTATE_FALSE : TRISTATE_TRUE,
561  0);
562  ChangedVisibility(nRow);
563  return true;
564  }
565  return SvxMenuEntriesListBox::KeyInputHdl(rKeyEvent);
566 }
567 
568 /* 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:392
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cfg.hxx:419
const OUString & GetFileName() const
Definition: cfg.hxx:481
std::unique_ptr< weld::MenuButton > m_xModifyBtn
Definition: cfg.hxx:417
std::unique_ptr< CommandCategoryListBox > m_xCommandCategoryListBox
Definition: cfg.hxx:391
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:409
static void modifyCustomizedUIFile(const Sequence< OUString > &sUIItemProperties)
static sal_Int16 GetImageType()
std::unique_ptr< weld::Button > m_xRemoveCommandButton
Definition: cfg.hxx:423
css::uno::Reference< css::graphic::XGraphic > GetImage(const OUString &rCommandURL)
Definition: cfg.cxx:320
std::unique_ptr< weld::Label > m_xCategoryLabel
Definition: cfg.hxx:394
OUString Name
constexpr sal_uInt16 KEY_SPACE
std::unique_ptr< SvxMenuEntriesListBox > m_xContentsListBox
Definition: cfg.hxx:408
TRISTATE_TRUE
virtual void set_id(int row, const OUString &rId)=0
OUString m_sFileName
Definition: cfg.hxx:426
static void getNodeValue(xmlNode *pNodePtr, NotebookbarEntries &aNodeEntries)
std::unique_ptr< weld::ComboBox > m_xTopLevelListBox
Definition: cfg.hxx:405
RET_YES
virtual void show()=0
std::unique_ptr< weld::Label > m_xDescriptionFieldLb
Definition: cfg.hxx:395
std::unique_ptr< weld::TreeView > m_xControl
Definition: cfg.hxx:321
virtual void set_column_fixed_widths(const std::vector< int > &rWidths)=0
virtual void set_help_id(const OString &rName)=0
virtual void set_vexpand(bool bExpand)=0
static OUString replaceSaveInName(const OUString &rMessage, const OUString &rSaveInName)
virtual void bulk_insert_for_each(int nSourceCount, const std::function< void(TreeIter &, int nSourceIndex)> &func, const std::vector< int > *pFixedWidths=nullptr)=0
static bool isCategoryAvailable(const OUString &sClassId, const OUString &sUIItemId, const OUString &sActiveCategory, bool &isCategory)
static void EditRegistryFile(const OUString &sUIItemId, const OUString &sSetEntry, const OUString &sNotebookbarInterface)
static OString getSystemPath(OUString const &sURL)
int i
static OUString getProductName()
#define notebookbarTabScope
Definition: cfg.hxx:42
virtual void set_toggle(int row, TriState eState, int col)=0
virtual ~SvxNotebookbarConfigPage() override
const OUString & GetAppName() const
Definition: cfg.hxx:480
TRISTATE_FALSE
std::unique_ptr< weld::Label > m_xSearchLabel
Definition: cfg.hxx:399
SvxNotebookbarEntriesListBox(std::unique_ptr< weld::TreeView > xControl, SvxConfigPage *pPg)
virtual void set_hexpand(bool bExpand)=0
static void ReloadNotebookBar(const OUString &sUIPath)
void InsertEntryIntoNotebookbarTabUI(const OUString &sClassId, const OUString &sUIItemId, const OUString &sUIItemCommand, weld::TreeView &rTreeView, weld::TreeIter &rIter, int nStartCol)
OUString CuiResId(const char *pKey)
Definition: cuiresmgr.cxx:23
IMPL_LINK(SvxNotebookbarEntriesListBox, CheckButtonHdl, const row_col &, rRowCol, void)
static Sequence< OUString > getCustomizedUIItem(OUString sNotebookbarConfigType)
std::unique_ptr< weld::MenuButton > m_xInsertBtn
Definition: cfg.hxx:416
int get_checkbox_column_width() const
std::unique_ptr< weld::Entry > m_xSearchEdit
Definition: cfg.hxx:398
SvxNotebookbarConfigPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rItemSet)
weld::Window * GetFrameWeld() const
std::unique_ptr< weld::Label > m_xCustomizeLabel
Definition: cfg.hxx:404
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:397
OUString aLabel
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
std::unique_ptr< weld::ComboBox > m_xSaveInListBox
Definition: cfg.hxx:414
SvxConfigPage * m_pPage
Definition: cfg.hxx:323
virtual void set_image(int row, const OUString &rImage, int col=-1)=0
OUString sId
std::unique_ptr< weld::TextView > m_xDescriptionField
Definition: cfg.hxx:396
ScXMLEditAttributeMap::Entry const aEntries[]
std::unique_ptr< weld::Button > m_xMoveDownButton
Definition: cfg.hxx:412
static void setCustomizedUIItem(Sequence< OUString > sUIItemProperties, OUString sNotebookbarConfigType)
static OUString getModuleId(const OUString &sModuleName)
std::unique_ptr< weld::Button > m_xMoveUpButton
Definition: cfg.hxx:411
#define HID_SVX_CONFIG_NOTEBOOKBAR_CONTENTS
Definition: helpids.h:29
def label(st)
virtual void set_size_request(int nWidth, int nHeight)=0
OUString m_sAppName
Definition: cfg.hxx:425
static OUString getFileName(const OUString &aFileName)
SaveInData * GetSaveInData()
Definition: cfg.hxx:479
sal_Int16 nValue
std::unique_ptr< weld::Button > m_xAddCommandButton
Definition: cfg.hxx:422
virtual void SelectElement() override
OUString sDisplayName