Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / cui / source / inc / SvxNotebookbarConfigPage.hxx
blob7793d6e6415b6ce9acfb7f38ffe96e9ed1d968be
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CUI_SOURCE_INC_SVXNOTEBOOKBARCONFIGPAGE_HXX
20 #define INCLUDED_CUI_SOURCE_INC_SVXNOTEBOOKBARCONFIGPAGE_HXX
22 #include <libxml/parser.h>
23 #include <vcl/weld.hxx>
24 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
26 #include <memory>
27 #include <vector>
29 #include "cfg.hxx" //for SvxConfigPage and SaveInData
31 class SvxNotebookbarConfigPage : public SvxConfigPage
33 private:
34 void UpdateButtonStates() override;
35 short QueryReset() override;
36 void Init() override;
37 void DeleteSelectedContent() override;
38 void DeleteSelectedTopLevel() override;
39 virtual void SelectElement() override;
40 void SetElement();
42 public:
43 struct NotebookbarEntries
45 OUString sUIItemId;
46 OUString sClassId;
47 OUString sActionName;
48 OUString sDisplayName;
49 OUString sVisibleValue;
51 struct CategoriesEntries
53 OUString sDisplayName;
54 OUString sUIItemId;
55 OUString sClassType;
57 SvxNotebookbarConfigPage(weld::Container* pPage, weld::DialogController* pController,
58 const SfxItemSet& rItemSet);
59 virtual ~SvxNotebookbarConfigPage() override;
60 SaveInData* CreateSaveInData(const css::uno::Reference<css::ui::XUIConfigurationManager>&,
61 const css::uno::Reference<css::ui::XUIConfigurationManager>&,
62 const OUString& aModuleId, bool docConfig) override;
63 static void FillFunctionsList(std::vector<NotebookbarEntries>& aEntries,
64 std::vector<CategoriesEntries>& aCategoryList,
65 OUString& sActiveCategory);
66 static void searchNodeandAttribute(std::vector<NotebookbarEntries>& aEntries,
67 std::vector<CategoriesEntries>& aCategoryList,
68 OUString& sActiveCategory,
69 CategoriesEntries& aCurCategoryEntry, xmlNode* pNodePtr,
70 bool isCategory);
71 static void getNodeValue(xmlNode* pNodePtr, NotebookbarEntries& aNodeEntries);
74 class SvxNotebookbarEntriesListBox final : public SvxMenuEntriesListBox
76 void ChangedVisibility(int nRow);
77 typedef std::pair<int, int> row_col;
78 DECL_LINK(CheckButtonHdl, const row_col&, void);
79 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
81 public:
82 SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPg);
83 virtual ~SvxNotebookbarEntriesListBox() override;
86 #endif // INCLUDED_CUI_SOURCE_INC_SVXNOTEBOOKBARCONFIGPAGE_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */