LibreOffice Module svx (master) 1
galbrws1.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <svl/lstner.hxx>
23#include <vcl/weld.hxx>
24#include <vector>
25
26#include <functional>
27
28class GalleryBrowser1;
29
30
31class Gallery;
33class GalleryTheme;
35struct ExchangeData;
36class SfxItemSet;
37
38namespace svx::sidebar { class GalleryControl; }
39
40class GalleryBrowser1 final : public SfxListener
41{
42 friend class GalleryBrowser;
44
45private:
46
47 std::unique_ptr<weld::Button> mxNewTheme;
48 std::unique_ptr<weld::TreeView> mxThemes;
49 std::unique_ptr<weld::Button> mxMoreGalleries;
51 std::unique_ptr<ExchangeData> mpExchangeData;
52 std::unique_ptr<SfxItemSet> mpThemePropsDlgItemSet;
53
54 OUString aImgNormal;
55 OUString aImgDefault;
56 OUString aImgReadOnly;
57
58 ::std::function<void ()> maThemeSelectionHandler;
59
60 void ImplInsertThemeEntry( const GalleryThemeEntry* pEntry );
61 static void ImplFillExchangeData( const GalleryTheme* pThm, ExchangeData& rData );
62 void ImplGetExecuteVector(std::vector<OUString>& o_aExec);
63 void ImplExecute(std::u16string_view rIdent);
64 void ImplGalleryThemeProperties( std::u16string_view rThemeName, bool bCreateNew );
65 void EndNewThemePropertiesDlgHdl(sal_Int32 nResult);
66 void EndThemePropertiesDlgHdl(sal_Int32 nResult);
67 void ImplEndGalleryThemeProperties(bool bCreateNew, sal_Int32 nResult);
68
69 // SfxListener
70 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
71
72 DECL_LINK( ClickNewThemeHdl, weld::Button&, void );
73 DECL_LINK( SelectThemeHdl, weld::TreeView&, void );
74 DECL_LINK( PopupMenuHdl, const CommandEvent&, bool );
75 DECL_LINK( KeyInputHdl, const KeyEvent&, bool );
76 DECL_STATIC_LINK( GalleryBrowser1, OnMoreGalleriesClick, weld::Button&, void );
77
78public:
79
81 weld::Builder& rBuilder,
82 Gallery* pGallery,
83 ::std::function<void ()> aThemeSelectionHandler);
84
86
87 void SelectTheme( sal_uInt16 nThemePos ) { mxThemes->select( nThemePos ); SelectThemeHdl( *mxThemes ); }
88 OUString GetSelectedTheme() const { return mxThemes->get_selected_text(); }
89};
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString aImgDefault
Definition: galbrws1.hxx:55
Gallery * mpGallery
Definition: galbrws1.hxx:50
void EndThemePropertiesDlgHdl(sal_Int32 nResult)
Definition: galbrws1.cxx:236
friend class svx::sidebar::GalleryControl
Definition: galbrws1.hxx:43
DECL_LINK(SelectThemeHdl, weld::TreeView &, void)
OUString aImgNormal
Definition: galbrws1.hxx:54
void ImplGalleryThemeProperties(std::u16string_view rThemeName, bool bCreateNew)
Definition: galbrws1.cxx:169
void ImplEndGalleryThemeProperties(bool bCreateNew, sal_Int32 nResult)
Definition: galbrws1.cxx:196
static void ImplFillExchangeData(const GalleryTheme *pThm, ExchangeData &rData)
Definition: galbrws1.cxx:109
std::unique_ptr< weld::Button > mxMoreGalleries
Definition: galbrws1.hxx:49
std::unique_ptr< SfxItemSet > mpThemePropsDlgItemSet
Definition: galbrws1.hxx:52
void SelectTheme(sal_uInt16 nThemePos)
Definition: galbrws1.hxx:87
OUString GetSelectedTheme() const
Definition: galbrws1.hxx:88
void ImplExecute(std::u16string_view rIdent)
Definition: galbrws1.cxx:241
GalleryBrowser1(weld::Builder &rBuilder, Gallery *pGallery, ::std::function< void()> aThemeSelectionHandler)
Definition: galbrws1.cxx:47
::std::function< void()> maThemeSelectionHandler
Definition: galbrws1.hxx:58
OUString aImgReadOnly
Definition: galbrws1.hxx:56
void ImplInsertThemeEntry(const GalleryThemeEntry *pEntry)
Definition: galbrws1.cxx:90
std::unique_ptr< weld::TreeView > mxThemes
Definition: galbrws1.hxx:48
std::unique_ptr< weld::Button > mxNewTheme
Definition: galbrws1.hxx:47
DECL_LINK(ClickNewThemeHdl, weld::Button &, void)
DECL_STATIC_LINK(GalleryBrowser1, OnMoreGalleriesClick, weld::Button &, void)
DECL_LINK(PopupMenuHdl, const CommandEvent &, bool)
friend class GalleryBrowser
Definition: galbrws1.hxx:42
void ImplGetExecuteVector(std::vector< OUString > &o_aExec)
Definition: galbrws1.cxx:132
void EndNewThemePropertiesDlgHdl(sal_Int32 nResult)
Definition: galbrws1.cxx:231
std::unique_ptr< ExchangeData > mpExchangeData
Definition: galbrws1.hxx:51
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: galbrws1.cxx:308
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)