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 
20 #pragma once
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(const css::uno::Reference<css::uno::XComponentContext>& xContext,
49  const css::uno::Reference<css::frame::XFrame>& xFrame,
50  const OUString& sModuleLongName);
51  void FillFunctionsList(const css::uno::Sequence<css::frame::DispatchInformation>& xCommands,
52  CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm,
53  SaveInData* pCurrentSaveInData);
54  OUString getCommandName(const OUString& sCommand);
55 
57  {
58  m_xControl->connect_changed(rLink);
59  }
60 
66  void categorySelected(CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm,
67  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
73  addChildren(const weld::TreeIter* parentEntry,
74  const css::uno::Reference<com::sun::star::script::browse::XBrowseNode>& parentNode,
75  CuiConfigFunctionListBox* pFunctionListBox, const OUString& filterTerm,
76  SaveInData* pCurrentSaveInData,
77  std::vector<std::unique_ptr<weld::TreeIter>>& rNodesToExpand);
78 
79  void set_visible(bool bVisible) { m_xControl->set_visible(bVisible); }
80 };
81 
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
OUString getCommandName(const OUString &sCommand)
SfxGroupInfoArr_Impl m_aGroupInfo
css::uno::Reference< css::container::XNameAccess > m_xModuleCategoryInfo
SfxStylesInfo_Impl m_aStylesInfo
css::uno::Reference< css::frame::XFrame > m_xFrame
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::uno::XComponentContext > m_xContext
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)
CommandCategoryListBox(std::unique_ptr< weld::ComboBox > xControl)
css::uno::Reference< css::container::XNameAccess > m_xGlobalCategoryInfo
void connect_changed(const Link< weld::ComboBox &, void > &rLink)
css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription
void categorySelected(CuiConfigFunctionListBox *pFunctionListBox, const OUString &filterTerm, SaveInData *pCurrentSaveInData=nullptr)
Signals that a command category has been selected.