10#include <config_folders.h>
15#include <officecfg/Office/Common.hxx>
16#include <rtl/bootstrap.hxx>
33 :
SfxTabPage(pPage, pController,
"cui/ui/personalization_tab.ui",
"PersonalizationTabPage",
35 , m_xNoPersona(m_xBuilder->weld_radio_button(
"no_persona"))
36 , m_xDefaultPersona(m_xBuilder->weld_radio_button(
"default_persona"))
40 OUString sDefaultId(
"default" + OUString::number(
i));
55 return std::make_unique<SvxPersonalizationTabPage>(pPage, pController, *
rSet);
61 OUString aPersona(
"default");
65 bool bModified =
false;
66 if (aPersona != officecfg::Office::Common::Misc::Persona::get()
73 std::shared_ptr<comphelper::ConfigurationChanges> batch(
77 officecfg::Office::Common::Misc::Persona::set(aPersona, batch);
85 AllSettingsFlags::STYLE);
95 OUString aPersona = officecfg::Office::Common::Misc::Persona::get();
108 OUString gallery =
"$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER
"/gallery/personas/";
109 rtl::Bootstrap::expandMacros(gallery);
110 OUString aPersonasList = gallery +
"personas_list.txt";
115 bool foundOne =
false;
120 OUString aPersonaSetting, aPreviewFile,
aName;
121 sal_Int32 nParseIndex = 0;
124 aPersonaSetting = OStringToOUString(aLine, RTL_TEXTENCODING_UTF8);
125 aName = aPersonaSetting.getToken(1,
';', nParseIndex);
126 aPreviewFile = aPersonaSetting.getToken(0,
';', nParseIndex);
128 if (aPreviewFile.isEmpty())
133 INetURLObject aURLObj(rtl::Concat2View(gallery + aPreviewFile));
141 xVirDev->SetOutputSizePixel(aSize);
156 m_xDefaultPersona->set_active(
true);
159 if (&rButton == m_vDefaultPersonaImages[
nIndex].
get())
160 m_aPersonaSettings = m_vDefaultPersonaSettings[
nIndex];
162 m_vDefaultPersonaImages[
nIndex]->set_active(
false);
static void NotifyAllWindows(DataChangedEvent &rDCEvt)
ErrCode ImportGraphic(Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
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).
std::vector< OUString > m_vDefaultPersonaSettings
reference_type * get() const
static std::shared_ptr< ConfigurationChanges > create()
#define LINK(Instance, Class, Member)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
IMPL_LINK(SvxPersonalizationTabPage, DefaultPersona, weld::Button &, rButton, void)
#define MAX_DEFAULT_PERSONAS