diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2021-07-28 02:03:12 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-17 13:26:45 +0100 |
commit | 3171d185f8c17799f0b85f5931aa59101cbc6b4e (patch) | |
tree | 76bdf97c13114991a08648cc81c02243f90bef0e /include/svx | |
parent | retire loplugin:simplifybool (diff) | |
download | core-3171d185f8c17799f0b85f5931aa59101cbc6b4e.tar.gz core-3171d185f8c17799f0b85f5931aa59101cbc6b4e.zip |
make colorsets work outside of styles and with direct formatting
[ Miklos: picked only the document model bits, now in SdrModel, next to
styles. ]
(cherry picked from commit 1647d34d8573f4940c0cbb7fb6cd9c6b4e5a4a15,
from the feature/themesupport2 branch)
Change-Id: I80f9e0b205b8b4a6914f851bdc63e3e0ca6706e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125313
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/ColorSets.hxx | 23 | ||||
-rw-r--r-- | include/svx/svdmodel.hxx | 7 |
2 files changed, 30 insertions, 0 deletions
diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx index 361fe47c622e..eee992da94b5 100644 --- a/include/svx/ColorSets.hxx +++ b/include/svx/ColorSets.hxx @@ -18,6 +18,8 @@ #include <svx/svxdllapi.h> #include <tools/color.hxx> +typedef struct _xmlTextWriter* xmlTextWriterPtr; + namespace svx { @@ -41,6 +43,8 @@ public: { return maColors[nIndex]; } + + void dumpAsXml(xmlTextWriterPtr pWriter) const; }; class SVXCORE_DLLPUBLIC ColorSets @@ -64,6 +68,25 @@ public: const ColorSet& getColorSet(std::u16string_view rName); }; +/// A named theme has a named color set. +class SVXCORE_DLLPUBLIC Theme +{ + OUString maName; + std::unique_ptr<ColorSet> mpColorSet; + +public: + Theme(OUString const& rName); + ~Theme(); + + void SetColorSet(std::unique_ptr<ColorSet> pColorSet); + ColorSet* GetColorSet(); + + void SetName(const OUString& rName); + const OUString& GetName() const; + + void dumpAsXml(xmlTextWriterPtr pWriter) const; +}; + } // end of namespace svx #endif // INCLUDED_SVX_COLORSETS_HXX diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 73fc9f646f43..ab9578a7bc93 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -90,6 +90,10 @@ namespace com::sun::star::beans { struct PropertyValue; } +namespace svx +{ +class Theme; +} constexpr const sal_Unicode DEGREE_CHAR = u'\x00B0'; /* U+00B0 DEGREE SIGN */ @@ -536,6 +540,9 @@ public: SfxStyleSheetBasePool* GetStyleSheetPool() const { return mxStyleSheetPool.get(); } void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { mxStyleSheetPool=pPool; } + void SetTheme(std::unique_ptr<svx::Theme> pTheme); + svx::Theme* GetTheme(); + void SetStarDrawPreviewMode(bool bPreview); bool IsStarDrawPreviewMode() const { return m_bStarDrawPreviewMode; } |