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