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