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  m_xGlobalCommandToLabelMap;
226  uno::Reference<uno::XComponentContext> xContext = ::comphelper::getProcessComponentContext();
227  uno::Reference<container::XNameAccess> xNameAccess(
228  css::frame::theUICommandDescription::get(xContext));
229 
230  uno::Sequence<beans::PropertyValue> aPropSeq, aGlobalPropSeq;
231 
232  xNameAccess->getByName("com.sun.star.text.GlobalDocument") >>= m_xGlobalCommandToLabelMap;
233  xNameAccess->getByName(getModuleId(m_sAppName)) >>= m_xCommandToLabelMap;
234 
235  try
236  {
237  uno::Any aModuleVal = m_xCommandToLabelMap->getByName(sUIItemCommand);
238 
239  aModuleVal >>= aPropSeq;
240  }
241  catch (container::NoSuchElementException&)
242  {
243  }
244 
245  try
246  {
247  uno::Any aGlobalVal = m_xGlobalCommandToLabelMap->getByName(sUIItemCommand);
248  aGlobalVal >>= aGlobalPropSeq;
249  }
250  catch (container::NoSuchElementException&)
251  {
252  }
253 
254  OUString aLabel;
255  for (sal_Int32 i = 0; i < aPropSeq.getLength(); ++i)
256  if (aPropSeq[i].Name == "Name")
257  aPropSeq[i].Value >>= aLabel;
258  if (aLabel.isEmpty())
259  for (sal_Int32 i = 0; i < aGlobalPropSeq.getLength(); ++i)
260  if (aGlobalPropSeq[i].Name == "Name")
261  aGlobalPropSeq[i].Value >>= aLabel;
262 
263  OUString aName = SvxConfigPageHelper::stripHotKey(aLabel);
264 
265  if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
266  {
267  OUString sDataInTree = "--------------------------------------------";
268  rTreeView.set_text(rIter, sDataInTree, nStartCol + 1);
269  }
270  else
271  {
272  if (aName.isEmpty())
273  aName = sUIItemId;
274  auto xImage = GetSaveInData()->GetImage(sUIItemCommand);
275  if (xImage.is())
276  rTreeView.set_image(rIter, xImage, nStartCol);
277  rTreeView.set_text(rIter, aName, nStartCol + 1);
278  rTreeView.set_id(rIter, sUIItemId);
279  }
280 }
281 
282 void SvxNotebookbarConfigPage::getNodeValue(xmlNode* pNodePtr, NotebookbarEntries& aNodeEntries)
283 {
284  pNodePtr = pNodePtr->xmlChildrenNode;
285  while (pNodePtr)
286  {
287  if (!(xmlStrcmp(pNodePtr->name, reinterpret_cast<const xmlChar*>("property"))))
288  {
289  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("name"));
290  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("visible"))))
291  {
292  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
293  const char* cVisibleValue = reinterpret_cast<const char*>(aValue);
294  aNodeEntries.sVisibleValue = charToString(cVisibleValue);
295  xmlFree(aValue);
296  }
297  if (!(xmlStrcmp(UriValue, reinterpret_cast<const xmlChar*>("action_name"))))
298  {
299  xmlChar* aValue = xmlNodeGetContent(pNodePtr);
300  const char* cActionName = reinterpret_cast<const char*>(aValue);
301  aNodeEntries.sActionName = charToString(cActionName);
302  xmlFree(aValue);
303  }
304  xmlFree(UriValue);
305  }
306  pNodePtr = pNodePtr->next;
307  }
308 }
309 
310 void SvxNotebookbarConfigPage::searchNodeandAttribute(std::vector<NotebookbarEntries>& aEntries,
311  std::vector<CategoriesEntries>& aCategoryList,
312  OUString& sActiveCategory,
313  CategoriesEntries& aCurItemEntry,
314  xmlNode* pNodePtr, bool isCategory)
315 {
316  pNodePtr = pNodePtr->xmlChildrenNode;
317  while (pNodePtr)
318  {
319  if (pNodePtr->type == XML_ELEMENT_NODE)
320  {
321  const char* cNodeName = reinterpret_cast<const char*>(pNodePtr->name);
322  if (strcmp(cNodeName, "object") == 0)
323  {
324  OUString sSecondVal;
325 
326  xmlChar* UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("id"));
327  const char* cUIItemID = reinterpret_cast<const char*>(UriValue);
328  OUString sUIItemId = charToString(cUIItemID);
329  xmlFree(UriValue);
330 
331  UriValue = xmlGetProp(pNodePtr, reinterpret_cast<const xmlChar*>("class"));
332  const char* cClassId = reinterpret_cast<const char*>(UriValue);
333  OUString sClassId = charToString(cClassId);
334  xmlFree(UriValue);
335 
336  CategoriesEntries aCategoryEntry;
337  if (sClassId == "sfxlo-PriorityHBox")
338  {
339  aCategoryEntry.sDisplayName = sUIItemId;
340  aCategoryEntry.sUIItemId = sUIItemId;
341  aCategoryEntry.sClassType = sClassId;
342  aCategoryList.push_back(aCategoryEntry);
343 
344  aCurItemEntry = aCategoryEntry;
345  }
346  else if (sClassId == "sfxlo-PriorityMergedHBox")
347  {
348  aCategoryEntry.sDisplayName = aCurItemEntry.sDisplayName + " | " + sUIItemId;
349  aCategoryEntry.sUIItemId = sUIItemId;
350  aCategoryEntry.sClassType = sClassId;
351 
352  if (aCurItemEntry.sClassType == sClassId)
353  {
354  sal_Int32 rPos = 0;
355  aCategoryEntry.sDisplayName
356  = aCurItemEntry.sDisplayName.getToken(rPos, ' ', rPos) + " | "
357  + sUIItemId;
358  }
359  aCategoryList.push_back(aCategoryEntry);
360  aCurItemEntry = aCategoryEntry;
361  }
362  else if (sClassId == "svtlo-ManagedMenuButton")
363  {
364  sal_Int32 rPos = 1;
365  sSecondVal = sUIItemId.getToken(rPos, ':', rPos);
366  if (!sSecondVal.isEmpty())
367  {
368  aCategoryEntry.sDisplayName
369  = aCurItemEntry.sDisplayName + " | " + sSecondVal;
370  aCategoryEntry.sUIItemId = sSecondVal;
371  aCategoryList.push_back(aCategoryEntry);
372  }
373  }
374 
375  NotebookbarEntries nodeEntries;
376  if (isCategoryAvailable(sClassId, sUIItemId, sActiveCategory, isCategory)
377  || isCategory)
378  {
379  isCategory = true;
380  if (sClassId == "GtkMenuItem" || sClassId == "GtkToolButton"
381  || sClassId == "GtkMenuToolButton"
382  || (sClassId == "svtlo-ManagedMenuButton" && sSecondVal.isEmpty()))
383  {
384  nodeEntries.sClassId = sClassId;
385  nodeEntries.sUIItemId = sUIItemId;
386  nodeEntries.sDisplayName = sUIItemId;
387 
388  getNodeValue(pNodePtr, nodeEntries);
389  aEntries.push_back(nodeEntries);
390  }
391  else if (sClassId == "GtkSeparatorMenuItem" || sClassId == "GtkSeparator")
392  {
393  nodeEntries.sClassId = sClassId;
394  nodeEntries.sUIItemId = sUIItemId;
395  nodeEntries.sDisplayName = "Null";
396  nodeEntries.sVisibleValue = "Null";
397  nodeEntries.sActionName = "Null";
398  aEntries.push_back(nodeEntries);
399  }
400  else if (sClassId == "sfxlo-PriorityHBox"
401  || sClassId == "sfxlo-PriorityMergedHBox"
402  || sClassId == "svtlo-ManagedMenuButton")
403  {
404  nodeEntries.sClassId = sClassId;
405  nodeEntries.sUIItemId = sUIItemId;
406  nodeEntries.sDisplayName
407  = aCategoryList[aCategoryList.size() - 1].sDisplayName;
408  nodeEntries.sVisibleValue = "Null";
409  nodeEntries.sActionName = "Null";
410  aEntries.push_back(nodeEntries);
411  }
412  }
413  }
414  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry,
415  pNodePtr, isCategory);
416  }
417  pNodePtr = pNodePtr->next;
418  }
419 }
420 
421 void SvxNotebookbarConfigPage::FillFunctionsList(xmlNodePtr pRootNodePtr,
422  std::vector<NotebookbarEntries>& aEntries,
423  std::vector<CategoriesEntries>& aCategoryList,
424  OUString& sActiveCategory)
425 {
426  CategoriesEntries aCurItemEntry;
427  searchNodeandAttribute(aEntries, aCategoryList, sActiveCategory, aCurItemEntry, pRootNodePtr,
428  false);
429 }
430 
432 {
433  OString sUIFileUIPath = CustomNotebookbarGenerator::getSystemPath(
435  xmlDocPtr pDoc = xmlParseFile(sUIFileUIPath.getStr());
436  xmlNodePtr pNodePtr = xmlDocGetRootElement(pDoc);
437 
438  std::vector<NotebookbarEntries> aEntries;
439  std::vector<CategoriesEntries> aCategoryList;
440  OUString sActiveCategory = m_xTopLevelListBox->get_active_id();
441  FillFunctionsList(pNodePtr, aEntries, aCategoryList, sActiveCategory);
442 
443  if (m_xTopLevelListBox->get_count() == 1)
444  {
445  for (std::size_t nIdx = 0; nIdx < aCategoryList.size(); nIdx++)
446  m_xTopLevelListBox->append(aCategoryList[nIdx].sUIItemId,
447  aCategoryList[nIdx].sDisplayName);
448  }
449  unsigned long nStart = 0;
450  if (aEntries[nStart].sClassId == "sfxlo-PriorityHBox"
451  || aEntries[nStart].sClassId == "sfxlo-PriorityMergedHBox")
452  nStart = 1;
453 
454  std::vector<NotebookbarEntries> aTempEntries;
455  for (std::size_t nIdx = nStart; nIdx < aEntries.size(); nIdx++)
456  {
457  if (aEntries[nIdx].sClassId == "svtlo-ManagedMenuButton")
458  {
459  aTempEntries.push_back(aEntries[nIdx]);
460  std::vector<NotebookbarEntries> aGtkEntries;
461  sal_Int32 rPos = 1;
462  sActiveCategory = aEntries[nIdx].sUIItemId.getToken(rPos, ':', rPos);
463  FillFunctionsList(pNodePtr, aGtkEntries, aCategoryList, sActiveCategory);
464  for (std::size_t Idx = 0; Idx < aGtkEntries.size(); Idx++)
465  aTempEntries.push_back(aGtkEntries[Idx]);
466  aGtkEntries.clear();
467  }
468  else
469  aTempEntries.push_back(aEntries[nIdx]);
470  }
471 
472  aEntries = aTempEntries;
473  aTempEntries.clear();
474 
475  weld::TreeView& rTreeView = m_xContentsListBox->get_widget();
476  rTreeView.bulk_insert_for_each(
477  aEntries.size(), [this, &rTreeView, &aEntries](weld::TreeIter& rIter, int nIdx) {
478  OUString sId(OUString::number(nIdx));
479  rTreeView.set_id(rIter, sId);
480  if (aEntries[nIdx].sActionName != "Null")
481  {
482  if (aEntries[nIdx].sVisibleValue == "True")
483  {
484  rTreeView.set_toggle(rIter, TRISTATE_TRUE, 0);
485  }
486  else
487  {
488  rTreeView.set_toggle(rIter, TRISTATE_FALSE, 0);
489  }
490  }
491  InsertEntryIntoNotebookbarTabUI(aEntries[nIdx].sClassId, aEntries[nIdx].sDisplayName,
492  aEntries[nIdx].sActionName, rTreeView, rIter, 1);
493  });
494 
495  aEntries.clear();
496 
497  if (pDoc != nullptr)
498  {
499  xmlFreeDoc(pDoc);
500  }
501 }
502 
503 SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xParent,
504  SvxConfigPage* pPg)
505  : SvxMenuEntriesListBox(std::move(xParent), pPg)
506 {
507  m_xControl->connect_toggled(LINK(this, SvxNotebookbarEntriesListBox, CheckButtonHdl));
508  m_xControl->connect_key_press(Link<const KeyEvent&, bool>());
509  m_xControl->connect_key_press(LINK(this, SvxNotebookbarEntriesListBox, KeyInputHdl));
510 }
511 
513 
514 static void EditRegistryFile(const OUString& sUIItemId, const OUString& sSetEntry,
515  const OUString& sNotebookbarInterface)
516 {
517  int nFlag = 0;
518  Sequence<OUString> aOldEntries
519  = CustomNotebookbarGenerator::getCustomizedUIItem(sNotebookbarInterface);
520  Sequence<OUString> aNewEntries(aOldEntries.getLength() + 1);
521  for (int nIdx = 0; nIdx < aOldEntries.getLength(); nIdx++)
522  {
523  sal_Int32 rPos = 0;
524  OUString sFirstValue = aOldEntries[nIdx].getToken(rPos, ',', rPos);
525  if (sFirstValue == sUIItemId)
526  {
527  aOldEntries[nIdx] = sSetEntry;
528  nFlag = 1;
529  break;
530  }
531  aNewEntries[nIdx] = aOldEntries[nIdx];
532  }
533 
534  if (nFlag == 0)
535  {
536  aNewEntries[aOldEntries.getLength()] = sSetEntry;
537  CustomNotebookbarGenerator::setCustomizedUIItem(aNewEntries, sNotebookbarInterface);
538  }
539  else
540  {
541  CustomNotebookbarGenerator::setCustomizedUIItem(aOldEntries, sNotebookbarInterface);
542  }
543 }
544 
546 {
547  OUString sUIItemId = m_xControl->get_selected_id();
548  OUString sNotebookbarInterface = getFileName(m_pPage->GetFileName());
549 
550  OUString sVisible;
551  if (m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE)
552  sVisible = "True";
553  else
554  sVisible = "False";
555  OUString sSetEntries = sUIItemId + ",visible," + sVisible;
556  Sequence<OUString> sSeqOfEntries(1);
557  sSeqOfEntries[0] = sSetEntries;
558  EditRegistryFile(sUIItemId, sSetEntries, sNotebookbarInterface);
560  OUString sUIPath = "modules/s" + m_pPage->GetAppName().toAsciiLowerCase() + "/ui/";
562 }
563 
564 IMPL_LINK(SvxNotebookbarEntriesListBox, CheckButtonHdl, const row_col&, rRowCol, void)
565 {
566  ChangedVisibility(rRowCol.first);
567 }
568 
569 IMPL_LINK(SvxNotebookbarEntriesListBox, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
570 {
571  if (rKeyEvent.GetKeyCode() == KEY_SPACE)
572  {
573  int nRow = m_xControl->get_selected_index();
574  m_xControl->set_toggle(
575  nRow, m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE ? TRISTATE_FALSE : TRISTATE_TRUE,
576  0);
577  ChangedVisibility(nRow);
578  return true;
579  }
580  return SvxMenuEntriesListBox::KeyInputHdl(rKeyEvent);
581 }
582 
583 /* 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:391
std::unique_ptr< weld::Button > m_xResetBtn
Definition: cfg.hxx:418
const OUString & GetFileName() const
Definition: cfg.hxx:480
std::unique_ptr< weld::MenuButton > m_xModifyBtn
Definition: cfg.hxx:416
std::unique_ptr< CommandCategoryListBox > m_xCommandCategoryListBox
Definition: cfg.hxx:390
#define KEY_SPACE
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:408
static void modifyCustomizedUIFile(const Sequence< OUString > &sUIItemProperties)
static sal_Int16 GetImageType()
std::unique_ptr< weld::Button > m_xRemoveCommandButton
Definition: cfg.hxx:422
css::uno::Reference< css::graphic::XGraphic > GetImage(const OUString &rCommandURL)
Definition: cfg.cxx:323
std::unique_ptr< weld::Label > m_xCategoryLabel
Definition: cfg.hxx:393
OUString Name
std::unique_ptr< SvxMenuEntriesListBox > m_xContentsListBox
Definition: cfg.hxx:407
TRISTATE_TRUE
virtual void set_id(int row, const OUString &rId)=0
OUString m_sFileName
Definition: cfg.hxx:425
static void getNodeValue(xmlNode *pNodePtr, NotebookbarEntries &aNodeEntries)
std::unique_ptr< weld::ComboBox > m_xTopLevelListBox
Definition: cfg.hxx:404
RET_YES
virtual void show()=0
std::unique_ptr< weld::Label > m_xDescriptionFieldLb
Definition: cfg.hxx:394
std::unique_ptr< weld::TreeView > m_xControl
Definition: cfg.hxx:320
sal_Int16 const nValue
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)
static OUString getProductName()
#define notebookbarTabScope
Definition: cfg.hxx:41
virtual void set_toggle(int row, TriState eState, int col)=0
virtual ~SvxNotebookbarConfigPage() override
const OUString & GetAppName() const
Definition: cfg.hxx:479
int i
TRISTATE_FALSE
std::unique_ptr< weld::Label > m_xSearchLabel
Definition: cfg.hxx:398
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:415
int get_checkbox_column_width() const
std::unique_ptr< weld::Entry > m_xSearchEdit
Definition: cfg.hxx:397
SvxNotebookbarConfigPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rItemSet)
weld::Window * GetFrameWeld() const
std::unique_ptr< weld::Label > m_xCustomizeLabel
Definition: cfg.hxx:403
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:396
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:413
SvxConfigPage * m_pPage
Definition: cfg.hxx:322
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:395
ScXMLEditAttributeMap::Entry const aEntries[]
std::unique_ptr< weld::Button > m_xMoveDownButton
Definition: cfg.hxx:411
static void setCustomizedUIItem(Sequence< OUString > sUIItemProperties, OUString sNotebookbarConfigType)
static OUString getModuleId(const OUString &sModuleName)
std::unique_ptr< weld::Button > m_xMoveUpButton
Definition: cfg.hxx:410
#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:424
static OUString getFileName(const OUString &aFileName)
SaveInData * GetSaveInData()
Definition: cfg.hxx:478
std::unique_ptr< weld::Button > m_xAddCommandButton
Definition: cfg.hxx:421
virtual void SelectElement() override
OUString sDisplayName