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