follow org.freedesktop.appearance.color-scheme setting
[LibreOffice.git] / include / sfx2 / templatedlglocalview.hxx
blob65b77ead1c9ade2ad2344368835bb7eb3430e8e5
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/.
8 */
9 #pragma once
11 #include <sfx2/templatelocalview.hxx>
12 #include <sfx2/listview.hxx>
14 class TemplateDlgLocalView final : public TemplateLocalView, public ListView
16 public:
17 TemplateDlgLocalView(std::unique_ptr<weld::ScrolledWindow> xWindow,
18 std::unique_ptr<weld::Menu> xMenu,
19 std::unique_ptr<weld::TreeView> xTreeView);
21 void setTemplateViewMode(TemplateViewMode eMode);
23 virtual void showAllTemplates() override;
25 void showRegion(TemplateContainerItem const* pItem);
27 void showRegion(std::u16string_view rName);
29 void reload();
31 virtual bool KeyInput(const KeyEvent& rKEvt) override;
33 void createContextMenu(const bool bIsDefault, const bool bIsBuiltIn, const bool bIsSingleSel,
34 const OUString& rDefaultImg);
36 virtual void Show() override;
38 virtual void Hide() override;
40 bool IsVisible() const;
42 void connect_focus_rect(const Link<weld::Widget&, tools::Rectangle>& rLink)
44 GetDrawingArea()->connect_focus_rect(rLink);
47 void MakeItemVisible(sal_uInt16 nId) { ThumbnailView::MakeItemVisible(nId); }
49 void insertItems(const std::vector<TemplateItemProperties>& rTemplates, bool isRegionSelected,
50 bool bShowCategoryInTooltip);
52 private:
53 void ContextMenuSelectHdl(std::string_view rIdent);
55 void insertFilteredItems();
57 void syncCursor();
59 void updateSelection();
61 DECL_LINK(RowActivatedHdl, weld::TreeView&, bool);
63 DECL_LINK(ListViewChangedHdl, weld::TreeView&, void);
65 DECL_LINK(PopupMenuHdl, const CommandEvent&, bool);
67 DECL_LINK(KeyPressHdl, const KeyEvent&, bool);
69 TemplateViewMode mViewMode;
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */