LibreOffice Module cui (master)  1
CommandCategoryListBox.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 
21 
22 #include <com/sun/star/uno/XInterface.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
25 #include <com/sun/star/frame/theUICommandDescription.hpp>
26 #include <com/sun/star/ui/theUICategoryDescription.hpp>
27 #include <com/sun/star/script/browse/XBrowseNode.hpp>
28 #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
29 #include <com/sun/star/script/browse/theBrowseNodeFactory.hpp>
30 #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
32 #include <vcl/settings.hxx>
33 #include <vcl/svapp.hxx>
34 
35 // include search util
36 #include <com/sun/star/util/SearchFlags.hpp>
37 #include <com/sun/star/util/SearchAlgorithms2.hpp>
38 #include <tools/diagnose_ex.h>
39 #include <unotools/textsearch.hxx>
40 
41 #include <dialmgr.hxx>
42 #include <strings.hrc>
46 #include <comphelper/string.hxx>
47 #include <officecfg/Office/Common.hxx>
49 #include <i18nutil/searchopt.hxx>
50 #include <sal/log.hxx>
51 
52 #include <cfg.hxx> //for SaveInData
53 
54 CommandCategoryListBox::CommandCategoryListBox(std::unique_ptr<weld::ComboBox> xControl)
55  : pStylesInfo(nullptr)
56  , m_xControl(std::move(xControl))
57 {
58  //Initialize search util
59  m_searchOptions.AlgorithmType2 = css::util::SearchAlgorithms2::ABSOLUTE;
60  m_searchOptions.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
61  m_searchOptions.searchFlag |= (css::util::SearchFlags::REG_NOT_BEGINOFLINE
62  | css::util::SearchFlags::REG_NOT_ENDOFLINE);
63 }
64 
66 
68 {
69  // Clear objects from m_aGroupInfo vector to avoid memory leak
70  for (const auto& It : m_aGroupInfo)
71  {
72  if (It->nKind == SfxCfgKind::GROUP_STYLES && It->pObject)
73  {
74  SfxStyleInfo_Impl* pStyle = static_cast<SfxStyleInfo_Impl*>(It->pObject);
75  delete pStyle;
76  }
77  else if (It->nKind == SfxCfgKind::FUNCTION_SCRIPT && It->pObject)
78  {
79  OUString* pScriptURI = static_cast<OUString*>(It->pObject);
80  delete pScriptURI;
81  }
82  else if (It->nKind == SfxCfgKind::GROUP_SCRIPTCONTAINER && It->pObject)
83  {
84  css::uno::XInterface* xi = static_cast<css::uno::XInterface*>(It->pObject);
85  if (xi != nullptr)
86  {
87  xi->release();
88  }
89  }
90  }
91 
92  m_aGroupInfo.clear();
93  m_xControl->clear();
94 }
95 
96 void CommandCategoryListBox::Init(const css::uno::Reference<css::uno::XComponentContext>& xContext,
97  const css::uno::Reference<css::frame::XFrame>& xFrame,
98  const OUString& sModuleLongName)
99 {
100  // User will not see incomplete UI
101  m_xControl->freeze();
102  ClearAll();
103 
104  m_xContext = xContext;
105  m_xFrame = xFrame;
106 
107  m_sModuleLongName = sModuleLongName;
108  m_xGlobalCategoryInfo = css::ui::theUICategoryDescription::get(m_xContext);
110  css::uno::UNO_QUERY_THROW);
111  m_xUICmdDescription = css::frame::theUICommandDescription::get(m_xContext);
112 
113  // Support style commands
114  css::uno::Reference<css::frame::XController> xController;
115  css::uno::Reference<css::frame::XModel> xModel;
116  if (xFrame.is())
117  xController = xFrame->getController();
118  if (xController.is())
119  xModel = xController->getModel();
120 
121  m_aStylesInfo.init(sModuleLongName, xModel);
123 
124  try
125  {
126  css::uno::Reference<css::frame::XDispatchInformationProvider> xProvider(
127  m_xFrame, css::uno::UNO_QUERY_THROW);
128  css::uno::Sequence<sal_Int16> lGroups = xProvider->getSupportedCommandGroups();
129 
130  sal_Int32 nGroupsLength = lGroups.getLength();
131 
132  if (nGroupsLength > 0)
133  {
134  // Add the category of "All commands"
135  m_aGroupInfo.push_back(
136  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_ALLFUNCTIONS, 0));
137  m_xControl->append(
138  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
139  CuiResId(RID_SVXSTR_ALLFUNCTIONS));
140  }
141 
142  // Separate the "All commands"category from the actual categories
143  m_xControl->append_separator("");
144 
145  typedef std::pair<OUString, sal_Int16> str_id;
146  std::vector<str_id> aCategories;
147 
148  // Add the actual categories
149  for (sal_Int32 i = 0; i < nGroupsLength; ++i)
150  {
151  sal_Int16 nGroupID = lGroups[i];
152  OUString sGroupID = OUString::number(nGroupID);
153  OUString sGroupName;
154 
155  try
156  {
157  m_xModuleCategoryInfo->getByName(sGroupID) >>= sGroupName;
158  if (sGroupName.isEmpty())
159  continue;
160  }
161  catch (const css::container::NoSuchElementException&)
162  {
163  continue;
164  }
165  aCategories.emplace_back(std::make_pair(sGroupName, nGroupID));
166  }
167 
168  auto const sort = comphelper::string::NaturalStringSorter(
170  Application::GetSettings().GetUILanguageTag().getLocale());
171 
172  std::sort(aCategories.begin(), aCategories.end(),
173  [&sort](const str_id& a, const str_id& b) {
174  return sort.compare(a.first, b.first) < 0;
175  });
176 
177  // Add the actual categories
178  for (const auto& a : aCategories)
179  {
180  const OUString& rGroupName = a.first;
181  sal_Int16 nGroupID = a.second;
182  m_aGroupInfo.push_back(
183  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_FUNCTION, nGroupID));
184  m_xControl->append(
185  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
186  rGroupName);
187  }
188 
189  // Separate regular commands from styles and macros
190  m_xControl->append_separator("");
191 
192  // Add macros category
193  m_aGroupInfo.push_back(
194  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_SCRIPTCONTAINER, 0, nullptr));
195  m_xControl->append(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
196  CuiResId(RID_SVXSTR_MACROS));
197 
198  // Add styles category
199  //TODO: last param should contain user data?
200  m_aGroupInfo.push_back(
201  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_STYLES, 0, nullptr));
202  m_xControl->append(OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
203  CuiResId(RID_SVXSTR_GROUP_STYLES));
204  }
205  catch (const css::uno::RuntimeException&)
206  {
207  throw;
208  }
209  catch (const css::uno::Exception&)
210  {
211  }
212 
213  // Reveal the updated UI to user
214  m_xControl->thaw();
215  m_xControl->set_active(0);
216 }
217 
219  const css::uno::Sequence<css::frame::DispatchInformation>& xCommands,
220  CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm,
221  SaveInData* pCurrentSaveInData)
222 {
223  // Setup search filter parameters
224  m_searchOptions.searchString = filterTerm;
225  utl::TextSearch textSearch(m_searchOptions);
226  const bool bInExperimentalMode = officecfg::Office::Common::Misc::ExperimentalMode::get();
227 
228  for (const auto& rInfo : xCommands)
229  {
230  auto aProperties
232 
233  OUString sUIName = getCommandName(rInfo.Command);
235  OUString sTooltipLabel
238  .replaceFirst("~", "");
239  bool bIsExperimental
241 
242  // Hide experimental commands when not in experimental mode
243  bool bHideExperimental = bIsExperimental && !bInExperimentalMode;
244 
245  // Apply the search filter
246  if (bHideExperimental
247  || (!filterTerm.isEmpty() && !textSearch.searchForward(sUIName)
248  && !textSearch.searchForward(sLabel) && !textSearch.searchForward(sTooltipLabel)
249  && !textSearch.searchForward(sPopupLabel)))
250  {
251  continue;
252  }
253 
254  css::uno::Reference<css::graphic::XGraphic> xImage;
255  if (pCurrentSaveInData)
256  xImage = pCurrentSaveInData->GetImage(rInfo.Command);
257 
258  m_aGroupInfo.push_back(std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::FUNCTION_SLOT, 0));
259  SfxGroupInfo_Impl* pGrpInfo = m_aGroupInfo.back().get();
260  pGrpInfo->sCommand = rInfo.Command;
261  pGrpInfo->sLabel = sUIName;
262  pGrpInfo->sTooltip = sTooltipLabel;
263  pFunctionListBox->append(
264  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName,
265  xImage);
266  }
267 }
268 
269 OUString CommandCategoryListBox::getCommandName(const OUString& sCommand)
270 {
271  OUString sUIName;
272  try
273  {
274  css::uno::Reference<css::container::XNameAccess> xModuleConf;
275  m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf;
276  if (xModuleConf.is())
277  {
278  ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
279  sUIName = lProps.getUnpackedValueOrDefault("Name", OUString());
280  }
281  }
282  catch (const css::uno::RuntimeException&)
283  {
284  throw;
285  }
286  catch (css::uno::Exception&)
287  {
288  sUIName.clear();
289  }
290 
291  // fallback for missing UINames !?
292  if (sUIName.isEmpty())
293  {
294  sUIName = sCommand;
295  }
296 
297  return sUIName;
298 }
299 
301  const OUString& filterTerm,
302  SaveInData* pCurrentSaveInData)
303 {
304  SfxGroupInfo_Impl* pInfo
305  = reinterpret_cast<SfxGroupInfo_Impl*>(m_xControl->get_active_id().toInt64());
306  std::vector<std::unique_ptr<weld::TreeIter>> aNodesToExpand;
307  pFunctionListBox->freeze();
308  pFunctionListBox->ClearAll();
309 
310  switch (pInfo->nKind)
311  {
313  {
314  css::uno::Reference<css::frame::XDispatchInformationProvider> xProvider(
315  m_xFrame, css::uno::UNO_QUERY);
316  sal_Int32 nEntryCount = m_xControl->get_count();
317 
318  for (sal_Int32 nCurPos = 0; nCurPos < nEntryCount; ++nCurPos)
319  {
320  SfxGroupInfo_Impl* pCurrentInfo
321  = reinterpret_cast<SfxGroupInfo_Impl*>(m_xControl->get_id(nCurPos).toInt64());
322 
323  if (!pCurrentInfo) //separator
324  continue;
325 
326  if (pCurrentInfo->nKind == SfxCfgKind::GROUP_FUNCTION)
327  {
328  css::uno::Sequence<css::frame::DispatchInformation> lCommands;
329  try
330  {
331  lCommands = xProvider->getConfigurableDispatchInformation(
332  pCurrentInfo->nUniqueID);
333  FillFunctionsList(lCommands, pFunctionListBox, filterTerm,
334  pCurrentSaveInData);
335  }
336  catch (css::container::NoSuchElementException&)
337  {
338  }
339  }
340  }
341 
342  break;
343  }
345  {
346  sal_uInt16 nGroup = pInfo->nUniqueID;
347  css::uno::Reference<css::frame::XDispatchInformationProvider> xProvider(
348  m_xFrame, css::uno::UNO_QUERY_THROW);
349  css::uno::Sequence<css::frame::DispatchInformation> lCommands
350  = xProvider->getConfigurableDispatchInformation(nGroup);
351  FillFunctionsList(lCommands, pFunctionListBox, filterTerm, pCurrentSaveInData);
352  break;
353  }
354  case SfxCfgKind::GROUP_SCRIPTCONTAINER: //Macros
355  {
356  SAL_INFO("cui.customize", "** ** About to initialise SF Scripts");
357  // Add Scripting Framework entries
358  css::uno::Reference<css::script::browse::XBrowseNode> rootNode;
359  try
360  {
361  css::uno::Reference<css::script::browse::XBrowseNodeFactory> xFac
362  = css::script::browse::theBrowseNodeFactory::get(m_xContext);
363  rootNode.set(xFac->createView(
364  css::script::browse::BrowseNodeFactoryViewTypes::MACROSELECTOR));
365  }
366  catch (css::uno::Exception const&)
367  {
369  "cui.customize",
370  "Caught some exception whilst retrieving browse nodes from factory");
371  // TODO exception handling
372  }
373 
374  if (rootNode.is() && rootNode->hasChildNodes())
375  {
376  //We call acquire on the XBrowseNode so that it does not
377  //get autodestructed and become invalid when accessed later.
378  rootNode->acquire();
379 
380  m_aGroupInfo.push_back(std::make_unique<SfxGroupInfo_Impl>(
381  SfxCfgKind::GROUP_SCRIPTCONTAINER, 0, static_cast<void*>(rootNode.get())));
382 
383  // Add main macro groups
384  const css::uno::Sequence<css::uno::Reference<css::script::browse::XBrowseNode>>
385  aChildNodes = rootNode->getChildNodes();
386  for (auto const& childGroup : aChildNodes)
387  {
388  childGroup->acquire();
389 
390  if (childGroup->hasChildNodes())
391  {
392  OUString sUIName;
393  if (childGroup->getName() == "user")
394  {
395  sUIName = CuiResId(RID_SVXSTR_MYMACROS);
396  }
397  else if (childGroup->getName() == "share")
398  {
399  sUIName = CuiResId(RID_SVXSTR_PRODMACROS);
400  }
401  else
402  {
403  sUIName = childGroup->getName();
404  }
405 
406  if (sUIName.isEmpty())
407  {
408  continue;
409  }
410 
411  m_aGroupInfo.push_back(std::make_unique<SfxGroupInfo_Impl>(
413  std::unique_ptr<weld::TreeIter> xMacroGroup(pFunctionListBox->tree_append(
414  OUString::number(
415  reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
416  sUIName));
417 
418  {
419  // tdf#128010: Do not nag user asking to enable JRE: if it's disabled,
420  // simply don't show relevant entries (user chose to not use JRE)
421  css::uno::ContextLayer layer(
423  //Add the children and the grand children
424  addChildren(xMacroGroup.get(), childGroup, pFunctionListBox, filterTerm,
425  pCurrentSaveInData, aNodesToExpand);
426  }
427 
428  // Remove the main group if empty
429  if (!pFunctionListBox->iter_has_child(*xMacroGroup))
430  {
431  pFunctionListBox->remove(*xMacroGroup);
432  }
433  else if (!filterTerm.isEmpty())
434  {
435  aNodesToExpand.emplace_back(std::move(xMacroGroup));
436  }
437  }
438  }
439  }
440 
441  break;
442  }
444  {
445  const std::vector<SfxStyleInfo_Impl> lStyleFamilies = pStylesInfo->getStyleFamilies();
446 
447  for (const auto& pIt : lStyleFamilies)
448  {
449  if (pIt.sLabel.isEmpty())
450  {
451  continue;
452  }
453 
454  m_aGroupInfo.push_back(
455  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_STYLES, 0));
456  // pIt.sLabel is Name of the style family
457  std::unique_ptr<weld::TreeIter> xFuncEntry(pFunctionListBox->tree_append(
458  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
459  pIt.sLabel));
460 
461  const std::vector<SfxStyleInfo_Impl> lStyles = pStylesInfo->getStyles(pIt.sFamily);
462 
463  // Setup search filter parameters
464  m_searchOptions.searchString = filterTerm;
465  utl::TextSearch textSearch(m_searchOptions);
466 
467  // Insert children (styles)
468  for (const auto& pStyleIt : lStyles)
469  {
470  OUString sUIName = pStyleIt.sLabel;
471  sal_Int32 aStartPos = 0;
472  sal_Int32 aEndPos = sUIName.getLength();
473 
474  // Apply the search filter
475  if (!filterTerm.isEmpty()
476  && !textSearch.SearchForward(sUIName, &aStartPos, &aEndPos))
477  {
478  continue;
479  }
480 
481  SfxStyleInfo_Impl* pStyle = new SfxStyleInfo_Impl(pStyleIt);
482 
483  m_aGroupInfo.push_back(
484  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::GROUP_STYLES, 0, pStyle));
485 
486  m_aGroupInfo.back()->sCommand = pStyle->sCommand;
487  m_aGroupInfo.back()->sLabel = pStyle->sLabel;
488 
489  pFunctionListBox->append(
490  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())),
491  sUIName, xFuncEntry.get());
492  }
493 
494  // Remove the style group from the list if no children
495  if (!pFunctionListBox->iter_has_child(*xFuncEntry))
496  {
497  pFunctionListBox->remove(*xFuncEntry);
498  }
499  else if (!filterTerm.isEmpty())
500  {
501  aNodesToExpand.emplace_back(std::move(xFuncEntry));
502  }
503  }
504 
505  break;
506  }
507  default:
508  // Do nothing, the list box will stay empty
509  SAL_INFO("cui.customize",
510  "Ignoring unexpected SfxCfgKind: " << static_cast<int>(pInfo->nKind));
511  break;
512  }
513 
514  pFunctionListBox->thaw();
515 
516  if (pFunctionListBox->n_children())
517  pFunctionListBox->select(0);
518 
519  //post freeze
520  for (const auto& it : aNodesToExpand)
521  pFunctionListBox->expand_row(*it);
522 }
523 
525 
527  const weld::TreeIter* parentEntry,
528  const css::uno::Reference<css::script::browse::XBrowseNode>& parentNode,
529  CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm,
530  SaveInData* pCurrentSaveInData, std::vector<std::unique_ptr<weld::TreeIter>>& rNodesToExpand)
531 {
532  // Setup search filter parameters
533  m_searchOptions.searchString = filterTerm;
534  utl::TextSearch textSearch(m_searchOptions);
535 
536  const css::uno::Sequence<css::uno::Reference<css::script::browse::XBrowseNode>> aChildNodes
537  = parentNode->getChildNodes();
538  for (auto const& child : aChildNodes)
539  {
540  // Acquire to prevent auto-destruction
541  child->acquire();
542 
543  if (child->hasChildNodes())
544  {
545  OUString sUIName = child->getName();
546 
547  m_aGroupInfo.push_back(std::make_unique<SfxGroupInfo_Impl>(
548  SfxCfgKind::GROUP_SCRIPTCONTAINER, 0, static_cast<void*>(child.get())));
549  std::unique_ptr<weld::TreeIter> xNewEntry(pFunctionListBox->tree_append(
550  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName,
551  parentEntry));
552 
553  addChildren(xNewEntry.get(), child, pFunctionListBox, filterTerm, pCurrentSaveInData,
554  rNodesToExpand);
555 
556  // Remove the group if empty
557  if (!pFunctionListBox->iter_has_child(*xNewEntry))
558  pFunctionListBox->remove(*xNewEntry);
559  else
560  rNodesToExpand.emplace_back(std::move(xNewEntry));
561  }
562  else if (child->getType() == css::script::browse::BrowseNodeTypes::SCRIPT)
563  {
564  // Prepare for filtering
565  OUString sUIName = child->getName();
566  sal_Int32 aStartPos = 0;
567  sal_Int32 aEndPos = sUIName.getLength();
568 
569  // Apply the search filter
570  if (!filterTerm.isEmpty() && !textSearch.SearchForward(sUIName, &aStartPos, &aEndPos))
571  {
572  continue;
573  }
574 
575  OUString uri, description;
576 
577  css::uno::Reference<css::beans::XPropertySet> xPropSet(child, css::uno::UNO_QUERY);
578 
579  if (!xPropSet.is())
580  {
581  continue;
582  }
583 
584  css::uno::Any value = xPropSet->getPropertyValue("URI");
585  value >>= uri;
586 
587  try
588  {
589  value = xPropSet->getPropertyValue("Description");
590  value >>= description;
591  }
592  catch (css::uno::Exception&)
593  {
594  // do nothing, the description will be empty
595  }
596 
597  if (description.isEmpty())
598  {
599  description = CuiResId(RID_SVXSTR_NOMACRODESC);
600  }
601 
602  OUString* pScriptURI = new OUString(uri);
603 
604  css::uno::Reference<css::graphic::XGraphic> xImage;
605  if (pCurrentSaveInData)
606  xImage = pCurrentSaveInData->GetImage(uri);
607 
608  m_aGroupInfo.push_back(
609  std::make_unique<SfxGroupInfo_Impl>(SfxCfgKind::FUNCTION_SCRIPT, 0, pScriptURI));
610  m_aGroupInfo.back()->sCommand = uri;
611  m_aGroupInfo.back()->sLabel = sUIName;
612  m_aGroupInfo.back()->sHelpText = description;
613  pFunctionListBox->append(
614  OUString::number(reinterpret_cast<sal_Int64>(m_aGroupInfo.back().get())), sUIName,
615  xImage, parentEntry);
616  }
617  }
618 }
619 
620 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
std::vector< SfxStyleInfo_Impl > getStyleFamilies() const
Definition: cfgutil.cxx:157
OUString getCommandName(const OUString &sCommand)
OUString sTooltip
Definition: cfgutil.hxx:97
Reference< XControl > m_xControl
SfxGroupInfoArr_Impl m_aGroupInfo
static const AllSettings & GetSettings()
bool bIsExperimental
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
css::uno::Reference< css::graphic::XGraphic > GetImage(const OUString &rCommandURL)
Definition: cfg.cxx:323
std::unique_ptr< weld::TreeIter > tree_append(const OUString &rId, const OUString &rStr, const weld::TreeIter *pParent=nullptr)
Definition: cfgutil.hxx:125
css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo
OUString CuiResId(std::string_view aKey)
Definition: cuiresmgr.cxx:23
SfxStylesInfo_Impl m_aStylesInfo
bool iter_has_child(const weld::TreeIter &rIter) const
Definition: cfgutil.hxx:147
Reference< XController > xController
PropertiesInfo aProperties
bool IsExperimental(const OUString &rsCommandName, const OUString &rModuleName)
css::uno::Reference< css::frame::XFrame > m_xFrame
void select(int pos)
Definition: cfgutil.hxx:163
css::uno::Reference< css::uno::XCurrentContext > NoEnableJavaInteractionContext()
void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation > &xCommands, CuiConfigFunctionListBox *pFunctionListBox, const OUString &filterTerm, SaveInData *pCurrentSaveInData)
int n_children() const
Definition: cfgutil.hxx:145
OUString GetPopupLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
OUString sLabel
Definition: cfgutil.hxx:44
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
#define TOOLS_WARN_EXCEPTION(area, stream)
int i
uno_Any a
void Init(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XFrame > &xFrame, const OUString &sModuleLongName)
std::vector< SfxStyleInfo_Impl > getStyles(const OUString &sFamily)
Definition: cfgutil.cxx:199
SfxCfgKind nKind
Definition: cfgutil.hxx:91
TransliterationFlags transliterateFlags
SfxStylesInfo_Impl * pStylesInfo
std::unique_ptr< weld::ComboBox > m_xControl
sal_uInt16 nUniqueID
Definition: cfgutil.hxx:92
css::uno::Reference< css::uno::XComponentContext > m_xContext
bool searchForward(const OUString &rStr)
OUString sCommand
Definition: cfgutil.hxx:43
void init(const OUString &rModuleName, const css::uno::Reference< css::frame::XModel > &xModel)
Definition: cfgutil.cxx:70
void remove(int nPos)
Definition: cfgutil.hxx:141
void addChildren(const weld::TreeIter *parentEntry, const css::uno::Reference< com::sun::star::script::browse::XBrowseNode > &parentNode, CuiConfigFunctionListBox *pFunctionListBox, const OUString &filterTerm, SaveInData *pCurrentSaveInData, std::vector< std::unique_ptr< weld::TreeIter >> &rNodesToExpand)
i18nutil::SearchOptions2 m_searchOptions
const LanguageTag & getLocale()
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString sCommand
Definition: cfgutil.hxx:94
void SetStylesInfo(SfxStylesInfo_Impl *pStyles)
#define SAL_INFO(area, stream)
CommandCategoryListBox(std::unique_ptr< weld::ComboBox > xControl)
Reference< XComponentContext > getProcessComponentContext()
void expand_row(const weld::TreeIter &rIter)
Definition: cfgutil.hxx:144
css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo
Any value
OUString sLabel
Definition: cfgutil.hxx:95
css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription
Reference< XModel > xModel
OUString GetTooltipForCommand(const OUString &rsCommandName, const css::uno::Sequence< css::beans::PropertyValue > &rProperties, const Reference< frame::XFrame > &rxFrame)
exports com.sun.star. uri
void append(const OUString &rId, const OUString &rStr, const weld::TreeIter *pParent=nullptr)
Definition: cfgutil.hxx:121
void categorySelected(CuiConfigFunctionListBox *pFunctionListBox, const OUString &filterTerm, SaveInData *pCurrentSaveInData=nullptr)
Signals that a command category has been selected.