1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
12 #include <sfx2/tabdlg.hxx>
15 #define MAX_DEFAULT_PERSONAS 6 // Maximum number of default personas
17 class SvxPersonalizationTabPage
: public SfxTabPage
20 std::unique_ptr
<weld::RadioButton
> m_xNoPersona
; ///< Just the default look, without any bitmap
21 std::unique_ptr
<weld::RadioButton
> m_xDefaultPersona
; ///< Use the built-in bitmap
22 std::unique_ptr
<weld::ToggleButton
> m_vDefaultPersonaImages
23 [MAX_DEFAULT_PERSONAS
]; ///< Buttons to show the default persona images
24 OUString m_aPersonaSettings
; ///< Header and footer images + color to be set in the settings.
26 std::vector
<OUString
> m_vDefaultPersonaSettings
;
29 SvxPersonalizationTabPage(weld::Container
* pPage
, weld::DialogController
* pController
,
30 const SfxItemSet
& rSet
);
31 virtual ~SvxPersonalizationTabPage() override
;
33 static std::unique_ptr
<SfxTabPage
>
34 Create(weld::Container
* pPage
, weld::DialogController
* pController
, const SfxItemSet
* rSet
);
36 /// Apply the settings ([OK] button).
37 virtual bool FillItemSet(SfxItemSet
* rSet
) override
;
39 /// Reset to default settings ([Revert] button).
40 virtual void Reset(const SfxItemSet
* rSet
) override
;
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)
53 * abstract;Abstract;abstract/preview.jpg;abstract/Header2.jpg;abstract/Footer2.jpg;#ffffff
55 void LoadDefaultImages();
58 /// Handle the default Persona selection
59 DECL_LINK(DefaultPersona
, weld::Button
&, void);
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */