Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / sidebar / StylePresetsPanel.hxx
blobf91268886332ca34aaf21d41637ea95756f7f3a0
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 */
11 #pragma once
13 #include <memory>
15 #include <sfx2/sidebar/PanelLayout.hxx>
16 #include <sfx2/sidebar/ControllerItem.hxx>
17 #include <svtools/valueset.hxx>
18 #include <utility>
20 namespace sw::sidebar {
22 class StylePresetsPanel : public PanelLayout,
23 public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
25 public:
26 static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent);
28 StylePresetsPanel(weld::Widget* pParent);
30 virtual ~StylePresetsPanel() override;
32 virtual void NotifyItemUpdate(const sal_uInt16 nSId,
33 const SfxItemState eState,
34 const SfxPoolItem* pState) override;
36 virtual void GetControlState(
37 const sal_uInt16 /*nSId*/,
38 boost::property_tree::ptree& /*rState*/) override {};
40 private:
41 struct TemplateEntry
43 explicit TemplateEntry(OUString aURL)
44 : maURL(std::move(aURL))
47 OUString maURL;
50 void RefreshList();
52 std::unique_ptr<ValueSet> mxValueSet;
53 std::unique_ptr<weld::CustomWeld> mxValueSetWin;
55 std::vector<std::unique_ptr<TemplateEntry>> maTemplateEntries;
57 DECL_LINK(DoubleClickHdl, ValueSet*, void);
60 } // end of namespace sw::sidebar
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */