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