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