LibreOffice Module cui (master)  1
CommandCategoryListBox.hxx
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 #ifndef INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX
20 #define INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX
21 
22 #include <i18nutil/searchopt.hxx>
23 #include "cfgutil.hxx"
24 
26 {
29  css::uno::Reference< css::uno::XComponentContext > m_xContext;
30  css::uno::Reference< css::frame::XFrame > m_xFrame;
31  css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo;
32  css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo;
33  css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription;
34 
35  // For search
37 
40 
41  std::unique_ptr<weld::ComboBox> m_xControl;
42 
43 public:
44  CommandCategoryListBox(std::unique_ptr<weld::ComboBox> xControl);
46  void ClearAll();
47 
48  void Init(
49  const css::uno::Reference< css::uno::XComponentContext >& xContext,
50  const css::uno::Reference< css::frame::XFrame >& xFrame,
51  const OUString& sModuleLongName);
52  void FillFunctionsList(
53  const css::uno::Sequence< css::frame::DispatchInformation >& xCommands,
54  CuiConfigFunctionListBox* pFunctionListBox,
55  const OUString& filterTerm,
56  SaveInData *pCurrentSaveInData );
57  OUString getCommandName(const OUString& sCommand);
58 
59  void connect_changed(const Link<weld::ComboBox&, void>& rLink) { m_xControl->connect_changed(rLink); }
60 
66  void categorySelected(CuiConfigFunctionListBox* pFunctionListBox,
67  const OUString& filterTerm, SaveInData* pCurrentSaveInData = nullptr);
68 
69  void SetStylesInfo(SfxStylesInfo_Impl* pStyles);
70 
71  // Adds children of the given macro group to the functions list
72  void addChildren(
73  const weld::TreeIter* parentEntry, const css::uno::Reference<com::sun::star::script::browse::XBrowseNode> &parentNode,
74  CuiConfigFunctionListBox* pFunctionListBox, const OUString &filterTerm , SaveInData *pCurrentSaveInData,
75  std::vector<std::unique_ptr<weld::TreeIter>> &rNodesToExpand);
76 
77  void set_visible(bool bVisible) {m_xControl->set_visible(bVisible);}
78 };
79 
80 #endif // INCLUDED_CUI_SOURCE_INC_COMMANDCATEGORYLISTBOX_HXX
81 
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
OUString getCommandName(const OUString &sCommand)
css::uno::Reference< css::uno::XComponentContext > m_xContext
SfxGroupInfoArr_Impl m_aGroupInfo
css::uno::Reference< css::frame::XFrame > m_xFrame
SfxStylesInfo_Impl m_aStylesInfo
css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription
void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation > &xCommands, CuiConfigFunctionListBox *pFunctionListBox, const OUString &filterTerm, SaveInData *pCurrentSaveInData)
void set_visible(bool bVisible)
void Init(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XFrame > &xFrame, const OUString &sModuleLongName)
SfxStylesInfo_Impl * pStylesInfo
std::unique_ptr< weld::ComboBox > m_xControl
css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo
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
std::vector< std::unique_ptr< SfxGroupInfo_Impl > > SfxGroupInfoArr_Impl
Definition: cfgutil.hxx:100
void SetStylesInfo(SfxStylesInfo_Impl *pStyles)
css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo
CommandCategoryListBox(std::unique_ptr< weld::ComboBox > xControl)
void connect_changed(const Link< weld::ComboBox &, void > &rLink)
void categorySelected(CuiConfigFunctionListBox *pFunctionListBox, const OUString &filterTerm, SaveInData *pCurrentSaveInData=nullptr)
Signals that a command category has been selected.