LibreOffice Module cui (master) 1
personalization.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
10#pragma once
11
12#include <sfx2/tabdlg.hxx>
13#include <vector>
14
15#define MAX_DEFAULT_PERSONAS 6 // Maximum number of default personas
16
18{
19private:
20 std::unique_ptr<weld::RadioButton> m_xNoPersona;
21 std::unique_ptr<weld::RadioButton> m_xDefaultPersona;
22 std::unique_ptr<weld::ToggleButton> m_vDefaultPersonaImages
25
26 std::vector<OUString> m_vDefaultPersonaSettings;
27
28public:
30 const SfxItemSet& rSet);
31 virtual ~SvxPersonalizationTabPage() override;
32
33 static std::unique_ptr<SfxTabPage>
34 Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet);
35
37 virtual bool FillItemSet(SfxItemSet* rSet) override;
38
40 virtual void Reset(const SfxItemSet* rSet) override;
41
42 /*
43 * Loads the default personas from the shared personas directory
44 * which resides in the shared gallery.
45 * There needs to be a separate subdirectory for each default persona,
46 * which includes the preview, header, and footer images.
47 * And there needs to be a personas_list.txt file in the personas directory
48 * which keeps the index/info of the default personas, one persona per line.
49 * A line should look like this:
50 * persona_slug;Persona Name;subdir/preview.jpg;subdir/header.jpg;subdir/footer.jpg;#textcolor
51 * (It is recommended to keep the subdir name the same as the slug)
52 * Example line:
53 * abstract;Abstract;abstract/preview.jpg;abstract/Header2.jpg;abstract/Footer2.jpg;#ffffff
54 */
55 void LoadDefaultImages();
56
57private:
59 DECL_LINK(DefaultPersona, weld::Button&, void);
60};
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxPersonalizationTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
virtual void Reset(const SfxItemSet *rSet) override
Reset to default settings ([Revert] button).
std::unique_ptr< weld::ToggleButton > m_vDefaultPersonaImages[MAX_DEFAULT_PERSONAS]
Buttons to show the default persona images.
virtual ~SvxPersonalizationTabPage() override
std::unique_ptr< weld::RadioButton > m_xDefaultPersona
Use the built-in bitmap.
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
OUString m_aPersonaSettings
Header and footer images + color to be set in the settings.
std::unique_ptr< weld::RadioButton > m_xNoPersona
Just the default look, without any bitmap.
virtual bool FillItemSet(SfxItemSet *rSet) override
Apply the settings ([OK] button).
DECL_LINK(DefaultPersona, weld::Button &, void)
Handle the default Persona selection.
std::vector< OUString > m_vDefaultPersonaSettings
#define MAX_DEFAULT_PERSONAS