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 <helpids.h>
29 #include <strings.hrc>
30 
31 #include <cfg.hxx>
33 #include <SvxConfigPageHelper.hxx>
34 #include <dialmgr.hxx>
35 #include <libxml/parser.h>
36 #include <osl/file.hxx>
39 #include <unotools/configmgr.hxx>
41 #include <com/sun/star/frame/theUICommandDescription.hpp>
42 #include <com/sun/star/ui/ImageType.hpp>
43 
44 namespace uno = com::sun::star::uno;
45 namespace frame = com::sun::star::frame;
46 namespace lang = com::sun::star::lang;
48 namespace beans = com::sun::star::beans;
50 
51 static bool isCategoryAvailable(OUString& sClassId, OUString& sUIItemId, OUString& sActiveCategory,
52  bool& isCategory)
53 {
54  if (sUIItemId == sActiveCategory)
55  return true;
56  else if ((sClassId == "GtkMenu" || sClassId == "GtkGrid") && sUIItemId != sActiveCategory)
57  {
58  isCategory = false;
59  return false;
60  }
61  return false;
62 }
63 
64 static OUString charToString(const char* cString)
65 {
66  OUStringBuffer aString;
67  for (unsigned long i = 0; i < strlen(cString); i++)
68  {
69  aString.append(cString[i]);
70  }
71  return aString.makeStringAndClear();
72 }
73 
74 static OUString getFileName(const OUString& aFileName)
75 {
76  if (aFileName == "notebookbar.ui")
77  return "Tabbed";
78  else if (aFileName == "notebookbar_compact.ui")
79  return "TabbedCompact";
80  else if (aFileName == "notebookbar_groupedbar_full.ui")
81  return "Groupedbar";
82  else if (aFileName == "notebookbar_groupedbar_compact.ui")
83  return "GroupedbarCompact";
84  else
85  return "None";
86 }
87 
88 static OUString getModuleId(const OUString& sModuleName)
89 {
90  if (sModuleName == "Writer")
91  return "com.sun.star.text.TextDocument";
92  else if (sModuleName == "Draw")
93  return "com.sun.star.drawing.DrawingDocument";
94  else if (sModuleName == "Impress")
95  return "com.sun.star.presentation.PresentationDocument";
96  else if (sModuleName == "Calc")
97  return "com.sun.star.sheet.SpreadsheetDocument";
98  else
99  return "None";
100 }
101 
103  : SvxConfigPage(pParent, rSet)
104 {
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_xCategoryListBox->set_visible(false);
116  m_xInsertBtn->set_visible(false);
117  m_xModifyBtn->set_visible(false);
118  m_xResetBtn->set_visible(false);
119  m_xCustomizeLabel->set_visible(false);
120 
121  weld::TreeView& rCommandCategoryBox = m_xFunctions->get_widget();
122  rCommandCategoryBox.hide();
123 
124  m_xContentsListBox.reset(
125  new SvxNotebookbarEntriesListBox(m_xBuilder->weld_tree_view("toolcontents"), this));
126  std::vector<int> aWidths;
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  int nExpectedSize = 16;
132 
133  int nStandardImageColWidth = rTreeView.get_checkbox_column_width();
134  int nMargin = nStandardImageColWidth - nExpectedSize;
135  if (nMargin < 16)
136  nMargin = 16;
137 
138  if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_LARGE)
139  nExpectedSize = 24;
140  else if (SvxConfigPageHelper::GetImageType() & css::ui::ImageType::SIZE_32)
141  nExpectedSize = 32;
142 
143  int nImageColWidth = nExpectedSize + nMargin;
144 
145  aWidths.push_back(nStandardImageColWidth);
146  aWidths.push_back(nImageColWidth);
147  rTreeView.set_column_fixed_widths(aWidths);
148 
149  rTreeView.set_hexpand(true);
150  rTreeView.set_vexpand(true);
152  rTreeView.show();
153 }
154 
156 
158 
160 
162 {
163  m_xTopLevelListBox->clear();
164  m_xContentsListBox->clear();
165  m_xSaveInListBox->clear();
167  OUString sAppName, sFileName;
169  OUString sNotebookbarInterface = getFileName(sFileName);
170 
171  OUString sScopeName
172  = utl::ConfigManager::getProductName() + " " + sAppName + " - " + sNotebookbarInterface;
173  OUString sSaveInListBoxID = notebookbarTabScope;
174 
175  m_xSaveInListBox->append(sSaveInListBoxID, sScopeName);
176  m_xSaveInListBox->set_active_id(sSaveInListBoxID);
177 
178  m_xTopLevelListBox->append("NotebookBar", "All Commands");
179  m_xTopLevelListBox->set_active_id("NotebookBar");
180  SelectElement();
181 }
182 
184  const css::uno::Reference<css::ui::XUIConfigurationManager>& xCfgMgr,
185  const css::uno::Reference<css::ui::XUIConfigurationManager>& xParentCfgMgr,
186  const OUString& aModuleId, bool bDocConfig)
187 {
188  return static_cast<SaveInData*>(
189  new ToolbarSaveInData(xCfgMgr, xParentCfgMgr, aModuleId, bDocConfig));
190 }
191 
193 
195 {
196  OUString msg = CuiResId(RID_SVXSTR_CONFIRM_TOOLBAR_RESET);
197 
198  OUString saveInName = m_xSaveInListBox->get_active_text();
199 
200  OUString label = SvxConfigPageHelper::replaceSaveInName(msg, saveInName);
201 
202  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(
203  GetDialogFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo, label));
204  int nValue = xQueryBox->run();
205  if (nValue == RET_YES)
206  {
207  OUString sOriginalUIPath = CustomNotebookbarGenerator::getOriginalUIPath();
208  OUString sCustomizedUIPath = CustomNotebookbarGenerator::getCustomizedUIPath();
209  osl::File::copy(sOriginalUIPath, sCustomizedUIPath);
210  OUString sAppName, sFileName;
212  OUString sNotebookbarInterface = getFileName(sFileName);
213  Sequence<OUString> sSequenceEntries;
214  CustomNotebookbarGenerator::setCustomizedUIItem(sSequenceEntries, sNotebookbarInterface);
215  OUString sUIPath = "modules/s" + sAppName.toAsciiLowerCase() + "/ui/";
217  }
218  return nValue;
219 }
220 
221 void SvxConfigPage::InsertEntryIntoNotebookbarTabUI(OUString& sClassId, OUString& sUIItemId,
222  OUString& sUIItemCommand, int nPos,
223  int nStartCol)
224 {
225  OUString sAppName, sFileName;
227 
228  css::uno::Reference<css::container::XNameAccess> m_xCommandToLabelMap,
229  m_xGlobalCommandToLabelMap;
230  uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
231  uno::Reference<container::XNameAccess> xNameAccess(
232  css::frame::theUICommandDescription::get(xContext));
233 
234  uno::Sequence<beans::PropertyValue> aPropSeq, aGlobalPropSeq;
235 
236  xNameAccess->getByName("com.sun.star.text.GlobalDocument") >>= m_xGlobalCommandToLabelMap;
237  xNameAccess->getByName(getModuleId(sAppName)) >>= m_xCommandToLabelMap;
238 
239  try
240  {
241  uno::Any aModuleVal = m_xCommandToLabelMap->getByName(sUIItemCommand);
242 
243  aModuleVal >>= aPropSeq;
244  }
245  catch (container::NoSuchElementException&)
246  {
247  }
248 
249  try
250  {
251  uno::Any aGlobalVal = m_xGlobalCommandToLabelMap->getByName(sUIItemCommand);
252  aGlobalVal >>= aGlobalPropSeq;
253  }
254  catch (container::NoSuchElementException&)
255  {
256  }
257 
258  OUString aLabel;
259  for (sal_Int32 i = 0; i < aPropSeq.getLength(); ++i)
260  if (aPropSeq[i].Name == "Name")
261  aPropSeq[i].Value >>= aLabel;
262  if (aLabel.isEmpty())
263  for (sal_Int32 i = 0; i < aGlobalPropSeq.getLength(); ++i)
264  if (aGlobalPropSeq[i].Name == "Name")
265  aGlobalPropSeq[i].Value >>= aLabel;
266 
267  OUString aName = SvxConfigPageHelper::stripHotKey(aLabel);
268 
269  if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
270  {
271  OUString sDataInTree = "--------------------------------------------";
272  m_xContentsListBox->set_text(nPos, sDataInTree, nStartCol + 1);
273  }
274  else
275  {
276  if (aName.isEmpty())
277  aName = sUIItemId;
278  auto xImage = GetSaveInData()->GetImage(sUIItemCommand);
279  if (xImage.is())
280  m_xContentsListBox->set_image(nPos, xImage, nStartCol);
281  m_xContentsListBox->set_text(nPos, aName, nStartCol + 1);
282  m_xContentsListBox->set_id(nPos, sUIItemId);
283  }
284 }
285 
286 void SvxNotebookbarConfigPage::getNodeValue(xmlNode* pNodePtr, NotebookbarEntries& aNodeEntries)
287 {
288  pNodePtr = pNodePtr->xmlChildrenNode;
289  while (pNodePtr)
290  {
291  if (!(xmlStrcmp(pNodePtr->name, reinterpret_cast<const xmlChar*>("property"))))
292  {
293  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("name"));
294  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("visible"))))
295  {
296  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
297  const char* cVisibleValue = reinterpret_cast<const char*>(aValue);
298  OUString sVisibleValue = charToString(cVisibleValue);
299  aNodeEntries.sVisibleValue = sVisibleValue;
300  xmlFree(aValue);
301  }
302  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("action_name"))))
303  {
304  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
305  const char* cActionName = reinterpret_cast<const char*>(aValue);
306  OUString sActionName = charToString(cActionName);
307  aNodeEntries.sActionName = sActionName;
308  xmlFree(aValue);
309  }
310  xmlFree(UriValue);
311  }
312  pNodePtr = pNodePtr->next;
313  }
314 }
315 
316 void SvxNotebookbarConfigPage::searchNodeandAttribute(std::vector<NotebookbarEntries>& aEntries,
317  std::vector<CategoriesEntries>& aCategoryList,
318  OUString& sActiveCategory,
319  CategoriesEntries& aCurItemEntry,
320  xmlNode* pNodePtr, bool isCategory)
321 {
322  pNodePtr = pNodePtr->xmlChildrenNode;
323  while (pNodePtr)
324  {
325  if (pNodePtr->type == XML_ELEMENT_NODE)
326  {
327  const char* cNodeName = reinterpret_cast<const char*>(pNodePtr->name);
328  OUString sNodeName = charToString(cNodeName);
329  OUString sSecondVal;
330  if (sNodeName == "object")
331  {
332  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("id"));
333  const char* cUIItemID = reinterpret_cast<const char*>(UriValue);
334  OUString sUIItemId = charToString(cUIItemID);
335  xmlFree(UriValue);
336 
337  UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("class"));
338  const char* cClassId = reinterpret_cast<const char*>(UriValue);
339  OUString sClassId = charToString(cClassId);
340  xmlFree(UriValue);
341 
342  CategoriesEntries aCategoryEntry;
343  if (sClassId == "sfxlo-PriorityHBox")
344  {
345  aCategoryEntry.sDisplayName = sUIItemId;
346  aCategoryEntry.sUIItemId = sUIItemId;
347  aCategoryEntry.sClassType = sClassId;
348  aCategoryList.push_back(aCategoryEntry);
349 
350  aCurItemEntry = aCategoryEntry;
351  }
352  else if (sClassId == "sfxlo-PriorityMergedHBox")
353  {
354  aCategoryEntry.sDisplayName = aCurItemEntry.sDisplayName + " | " + sUIItemId;
355  aCategoryEntry.sUIItemId = sUIItemId;
356  aCategoryEntry.sClassType = sClassId;
357 
358  if (aCurItemEntry.sClassType == sClassId)
359  {
360  sal_Int32 rPos = 0;
361  aCategoryEntry.sDisplayName
362  = aCurItemEntry.sDisplayName.getToken(rPos, ' ', rPos) + " | "
363  + sUIItemId;
364  }
365  aCategoryList.push_back(aCategoryEntry);
366  aCurItemEntry = aCategoryEntry;
367  }
368  else if (sClassId == "svtlo-ManagedMenuButton")
369  {
370  sal_Int32 rPos = 1;
371  sSecondVal = sUIItemId.getToken(rPos, ':', rPos);
372  if (!sSecondVal.isEmpty())
373  {
374  aCategoryEntry.sDisplayName
375  = aCurItemEntry.sDisplayName + " | " + sSecondVal;
376  aCategoryEntry.sUIItemId = sSecondVal;
377  aCategoryList.push_back(aCategoryEntry);
378  }
379  }
380 
381  NotebookbarEntries nodeEntries;
382  if (isCategoryAvailable(sClassId, sUIItemId, sActiveCategory, isCategory)
383  || isCategory)
384  {
385  isCategory = true;
386  if (sClassId == "GtkMenuItem" || sClassId == "GtkToolButton"
387  || sClassId == "GtkMenuToolButton"
388  || (sClassId == "svtlo-ManagedMenuButton" && sSecondVal.isEmpty()))
389  {
390  nodeEntries.sClassId = sClassId;
391  nodeEntries.sUIItemId = sUIItemId;
392  nodeEntries.sDisplayName = sUIItemId;
393 
394  getNodeValue(pNodePtr, nodeEntries);
395  aEntries.push_back(nodeEntries);
396  }
397  else if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
398  {
399  nodeEntries.sClassId = sClassId;
400  nodeEntries.sUIItemId = sUIItemId;
401  nodeEntries.sDisplayName = "Null";
402  nodeEntries.sVisibleValue = "Null";
403  nodeEntries.sActionName = "Null";
404  aEntries.push_back(nodeEntries);
405  }
406  else if (sClassId == "sfxlo-PriorityHBox"
407  || sClassId == "sfxlo-PriorityMergedHBox"
408  || sClassId == "svtlo-ManagedMenuButton")
409  {
410  nodeEntries.sClassId = sClassId;
411  nodeEntries.sUIItemId = sUIItemId;
412  nodeEntries.sDisplayName
413  = aCategoryList[aCategoryList.size() - 1].sDisplayName;
414  nodeEntries.sVisibleValue = "Null";
415  nodeEntries.sActionName = "Null";
416  aEntries.push_back(nodeEntries);
417  }
418  }
419  }
420  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry,
421  pNodePtr, isCategory);
422  }
423  pNodePtr = pNodePtr->next;
424  }
425 }
426 
427 void SvxNotebookbarConfigPage::FillFunctionsList(std::vector<NotebookbarEntries>& aEntries,
428  std::vector<CategoriesEntries>& aCategoryList,
429  OUString& sActiveCategory)
430 {
431  xmlDocPtr pDoc;
432  xmlNodePtr pNodePtr;
433  OUString sUIFilePath = CustomNotebookbarGenerator::getCustomizedUIPath();
434  char* cUIFileUIPath = CustomNotebookbarGenerator::convertToCharPointer(sUIFilePath);
435  pDoc = xmlParseFile(cUIFileUIPath);
436  pNodePtr = xmlDocGetRootElement(pDoc);
437 
438  CategoriesEntries aCurItemEntry;
439  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry, pNodePtr,
440  false);
441  if (pDoc != nullptr)
442  {
443  xmlFreeDoc(pDoc);
444  }
445  delete[] cUIFileUIPath;
446 }
447 
449 {
450  m_xContentsListBox->clear();
451  std::vector<NotebookbarEntries> aEntries;
452  std::vector<CategoriesEntries> aCategoryList;
453  OUString sActiveCategory = m_xTopLevelListBox->get_active_id();
454  FillFunctionsList(aEntries, aCategoryList, sActiveCategory);
455 
456  if (m_xTopLevelListBox->get_count() == 1)
457  {
458  for (unsigned long nIdx = 0; nIdx < aCategoryList.size(); nIdx++)
459  m_xTopLevelListBox->append(aCategoryList[nIdx].sUIItemId,
460  aCategoryList[nIdx].sDisplayName);
461  }
462  unsigned long nStart = 0;
463  if (aEntries[nStart].sClassId == "sfxlo-PriorityHBox"
464  || aEntries[nStart].sClassId == "sfxlo-PriorityMergedHBox")
465  nStart = 1;
466 
467  std::vector<NotebookbarEntries> aTempEntries;
468  for (unsigned long nIdx = nStart; nIdx < aEntries.size(); nIdx++)
469  {
470  if (aEntries[nIdx].sClassId == "svtlo-ManagedMenuButton")
471  {
472  aTempEntries.push_back(aEntries[nIdx]);
473  std::vector<NotebookbarEntries> aGtkEntries;
474  sal_Int32 rPos = 1;
475  sActiveCategory = aEntries[nIdx].sUIItemId.getToken(rPos, ':', rPos);
476  FillFunctionsList(aGtkEntries, aCategoryList, sActiveCategory);
477  for (unsigned long Idx = 0; Idx < aGtkEntries.size(); Idx++)
478  aTempEntries.push_back(aGtkEntries[Idx]);
479  aGtkEntries.clear();
480  }
481  else
482  aTempEntries.push_back(aEntries[nIdx]);
483  }
484 
485  aEntries = aTempEntries;
486  aTempEntries.clear();
487 
488  sal_Int64 nId = 0;
489  for (unsigned long nIdx = 0; nIdx < aEntries.size(); nIdx++)
490  {
491  OUString sId(OUString::number(nId));
492  m_xContentsListBox->insert(nIdx, sId);
493  if (aEntries[nIdx].sActionName != "Null")
494  {
495  if (aEntries[nIdx].sVisibleValue == "True")
496  {
497  m_xContentsListBox->set_toggle(nIdx, TRISTATE_TRUE, 0);
498  }
499  else
500  {
501  m_xContentsListBox->set_toggle(nIdx, TRISTATE_FALSE, 0);
502  }
503  }
504  InsertEntryIntoNotebookbarTabUI(aEntries[nIdx].sClassId, aEntries[nIdx].sDisplayName,
505  aEntries[nIdx].sActionName, nIdx, 1);
506  ++nId;
507  }
508  aEntries.clear();
509 }
510 
511 SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xParent,
512  SvxConfigPage* pPg)
513  : SvxMenuEntriesListBox(std::move(xParent), pPg)
514 {
515  m_xControl->connect_toggled(LINK(this, SvxNotebookbarEntriesListBox, CheckButtonHdl));
516  m_xControl->connect_key_press(Link<const KeyEvent&, bool>());
517  m_xControl->connect_key_press(LINK(this, SvxNotebookbarEntriesListBox, KeyInputHdl));
518 }
519 
521 
522 static void EditRegistryFile(OUString& sUIItemId, OUString& sSetEntry,
523  OUString& sNotebookbarInterface)
524 {
525  int nFlag = 0;
526  Sequence<OUString> aOldEntries
527  = CustomNotebookbarGenerator::getCustomizedUIItem(sNotebookbarInterface);
528  Sequence<OUString> aNewEntries(aOldEntries.getLength() + 1);
529  for (int nIdx = 0; nIdx < aOldEntries.getLength(); nIdx++)
530  {
531  sal_Int32 rPos = 0;
532  OUString sFirstValue = aOldEntries[nIdx].getToken(rPos, ',', rPos);
533  if (sFirstValue == sUIItemId)
534  {
535  aOldEntries[nIdx] = sSetEntry;
536  nFlag = 1;
537  break;
538  }
539  aNewEntries[nIdx] = aOldEntries[nIdx];
540  }
541 
542  if (nFlag == 0)
543  {
544  aNewEntries[aOldEntries.getLength()] = sSetEntry;
545  CustomNotebookbarGenerator::setCustomizedUIItem(aNewEntries, sNotebookbarInterface);
546  }
547  else
548  {
549  CustomNotebookbarGenerator::setCustomizedUIItem(aOldEntries, sNotebookbarInterface);
550  }
551 }
552 
554 {
555  OUString sUIItemId = m_xControl->get_selected_id();
556  OUString sAppName;
557  OUString sFileName;
559  OUString sNotebookbarInterface = getFileName(sFileName);
560 
561  OUString sVisible;
562  if (m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE)
563  sVisible = "True";
564  else
565  sVisible = "False";
566  OUString sSetEntries = sUIItemId + ",visible," + sVisible;
567  Sequence<OUString> sSeqOfEntries(1);
568  sSeqOfEntries[0] = sSetEntries;
569  EditRegistryFile(sUIItemId, sSetEntries, sNotebookbarInterface);
571  OUString sUIPath = "modules/s" + sAppName.toAsciiLowerCase() + "/ui/";
573 }
574 
575 IMPL_LINK(SvxNotebookbarEntriesListBox, CheckButtonHdl, const row_col&, rRowCol, void)
576 {
577  ChangedVisibility(rRowCol.first);
578 }
579 
580 IMPL_LINK(SvxNotebookbarEntriesListBox, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
581 {
582  if (rKeyEvent.GetKeyCode() == KEY_SPACE)
583  {
584  int nRow = m_xControl->get_selected_index();
585  m_xControl->set_toggle(
586  nRow, m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE ? TRISTATE_FALSE : TRISTATE_TRUE,
587  0);
588  ChangedVisibility(nRow);
589  return true;
590  }
591  return SvxMenuEntriesListBox::KeyInputHdl(rKeyEvent);
592 }
593 
594 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< CuiConfigFunctionListBox > m_xFunctions
Definition: cfg.hxx:373
static void ReloadNotebookBar(OUString &sUIPath)
void InsertEntryIntoNotebookbarTabUI(OUString &sClassId, OUString &sUIItemId, OUString &sUIItemCommand, int nPos, int nStartCol)
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cfg.hxx:400
static void getFileNameAndAppName(OUString &sAppName, OUString &sNotebookbarUIFileName)
std::unique_ptr< weld::MenuButton > m_xModifyBtn
Definition: cfg.hxx:398
#define KEY_SPACE
static OUString stripHotKey(const OUString &str)
static OUString charToString(const char *cString)
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
static void modifyCustomizedUIFile(const Sequence< OUString > &sUIItemProperties)
static sal_Int16 GetImageType()
std::unique_ptr< weld::Button > m_xRemoveCommandButton
Definition: cfg.hxx:404
sal_Int16 nId
css::uno::Reference< css::graphic::XGraphic > GetImage(const OUString &rCommandURL)
Definition: cfg.cxx:324
std::unique_ptr< weld::Label > m_xCategoryLabel
Definition: cfg.hxx:375
OUString Name
std::unique_ptr< SvxMenuEntriesListBox > m_xContentsListBox
Definition: cfg.hxx:390
TRISTATE_TRUE
std::unique_ptr< weld::ComboBox > m_xCategoryListBox
Definition: cfg.hxx:376
static void getNodeValue(xmlNode *pNodePtr, NotebookbarEntries &aNodeEntries)
std::unique_ptr< weld::ComboBox > m_xTopLevelListBox
Definition: cfg.hxx:387
RET_YES
virtual void show()=0
std::unique_ptr< weld::Label > m_xDescriptionFieldLb
Definition: cfg.hxx:377
std::unique_ptr< weld::TreeView > m_xControl
Definition: cfg.hxx:319
virtual void set_column_fixed_widths(const std::vector< int > &rWidths)=0
virtual void set_help_id(const OString &rName)=0
static void FillFunctionsList(std::vector< NotebookbarEntries > &aEntries, std::vector< CategoriesEntries > &aCategoryList, OUString &sActiveCategory)
virtual void set_vexpand(bool bExpand)=0
static OUString replaceSaveInName(const OUString &rMessage, const OUString &rSaveInName)
weld::Window * GetDialogFrameWeld() const
static OUString getProductName()
#define notebookbarTabScope
Definition: cfg.hxx:40
std::unique_ptr< weld::Builder > m_xBuilder
virtual ~SvxNotebookbarConfigPage() override
int i
TRISTATE_FALSE
std::unique_ptr< weld::Label > m_xSearchLabel
Definition: cfg.hxx:381
SvxNotebookbarEntriesListBox(std::unique_ptr< weld::TreeView > xControl, SvxConfigPage *pPg)
Object Value
virtual void set_hexpand(bool bExpand)=0
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:397
int get_checkbox_column_width() const
std::unique_ptr< weld::Entry > m_xSearchEdit
Definition: cfg.hxx:380
SvxNotebookbarConfigPage(TabPageParent pParent, const SfxItemSet &rItemSet)
std::unique_ptr< weld::Label > m_xCustomizeLabel
Definition: cfg.hxx:386
static char * convertToCharPointer(const OUString &sString)
std::unique_ptr< weld::Label > m_xLeftFunctionLabel
Definition: cfg.hxx:379
static bool isCategoryAvailable(OUString &sClassId, OUString &sUIItemId, OUString &sActiveCategory, bool &isCategory)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
std::unique_ptr< weld::ComboBox > m_xSaveInListBox
Definition: cfg.hxx:395
static void EditRegistryFile(OUString &sUIItemId, OUString &sSetEntry, OUString &sNotebookbarInterface)
OString const aName
std::unique_ptr< weld::TextView > m_xDescriptionField
Definition: cfg.hxx:378
ScXMLEditAttributeMap::Entry const aEntries[]
std::unique_ptr< weld::Button > m_xMoveDownButton
Definition: cfg.hxx:393
static void setCustomizedUIItem(Sequence< OUString > sUIItemProperties, OUString sNotebookbarConfigType)
static OUString getModuleId(const OUString &sModuleName)
std::unique_ptr< weld::Button > m_xMoveUpButton
Definition: cfg.hxx:392
#define HID_SVX_CONFIG_NOTEBOOKBAR_CONTENTS
Definition: helpids.h:29
def label(st)
virtual void set_size_request(int nWidth, int nHeight)=0
static OUString getFileName(const OUString &aFileName)
SaveInData * GetSaveInData()
Definition: cfg.hxx:452
std::unique_ptr< weld::Button > m_xAddCommandButton
Definition: cfg.hxx:403
virtual void SelectElement() override
OUString sDisplayName
OUString sId