diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-02-16 20:02:01 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-02-17 08:23:15 +0100 |
commit | 8cc70d18c4507a746607fe5922b7c5e94b7f7579 (patch) | |
tree | 92b23704bcabac77dfa5b896833ef6c59aec6183 /include | |
parent | b447be3ccba686c4e35d61b05b50d31045c9d1ac (diff) |
sd theme: add doc model for shape fill color
In preparation of adding UNO API for this.
Change-Id: Iecb2e44c43bca9e892fcb6242870ec12faa48be5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130050
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/colritem.hxx | 58 | ||||
-rw-r--r-- | include/svx/xcolit.hxx | 8 |
2 files changed, 44 insertions, 22 deletions
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx index 21e389115b11..cbd52844b059 100644 --- a/include/editeng/colritem.hxx +++ b/include/editeng/colritem.hxx @@ -25,18 +25,48 @@ #define VERSION_USEAUTOCOLOR 1 +/// Represents theme metadata for a (tools) Color. +class EDITENG_DLLPUBLIC SvxThemeColor +{ + sal_Int16 maThemeIndex; + /// Luminance Modulation: 100th percentage, defaults to 100%. + sal_Int16 mnLumMod; + /// Luminance Offset: 100th percentage, defaults to 0%. + sal_Int16 mnLumOff; + +public: + explicit SvxThemeColor(); + bool operator==(const SvxThemeColor& rThemeColor) const; + + sal_Int16 GetThemeIndex() const + { + return maThemeIndex; + } + + void SetThemeIndex(sal_Int16 nIndex) + { + maThemeIndex = nIndex; + } + + void SetLumMod(sal_Int16 nLumMod) { mnLumMod = nLumMod; } + + sal_Int16 GetLumMod() const { return mnLumMod; } + + void SetLumOff(sal_Int16 nLumOff) { mnLumOff = nLumOff; } + + sal_Int16 GetLumOff() const { return mnLumOff; } + + void dumpAsXml(xmlTextWriterPtr pWriter) const; +}; + /** SvxColorItem item describes a color. */ class EDITENG_DLLPUBLIC SvxColorItem final : public SfxPoolItem { private: Color mColor; - sal_Int16 maThemeIndex; + SvxThemeColor maThemeColor; sal_Int16 maTintShade; - /// Luminance Modulation: 100th percentage, defaults to 100%. - sal_Int16 mnLumMod; - /// Luminance Offset: 100th percentage, defaults to 0%. - sal_Int16 mnLumOff; public: static SfxPoolItem* CreateDefault(); @@ -63,16 +93,6 @@ public: } void SetValue(const Color& rNewColor); - sal_Int16 GetThemeIndex() const - { - return maThemeIndex; - } - - void SetThemeIndex(sal_Int16 nIndex) - { - maThemeIndex = nIndex; - } - sal_Int16 GetTintOrShade() const { return maTintShade; @@ -83,13 +103,9 @@ public: maTintShade = nTintOrShade; } - void SetLumMod(sal_Int16 nLumMod) { mnLumMod = nLumMod; } - - sal_Int16 GetLumMod() const { return mnLumMod; } + SvxThemeColor& GetThemeColor() { return maThemeColor; } - void SetLumOff(sal_Int16 nLumOff) { mnLumOff = nLumOff; } - - sal_Int16 GetLumOff() const { return mnLumOff; } + const SvxThemeColor& GetThemeColor() const { return maThemeColor; } void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; diff --git a/include/svx/xcolit.hxx b/include/svx/xcolit.hxx index 8760ba88208e..5b882f9a97a9 100644 --- a/include/svx/xcolit.hxx +++ b/include/svx/xcolit.hxx @@ -21,8 +21,9 @@ #define INCLUDED_SVX_XCOLIT_HXX #include <tools/color.hxx> -#include <svx/svxdllapi.h> +#include <editeng/colritem.hxx> +#include <svx/svxdllapi.h> #include <svx/xit.hxx> class XColorList; @@ -32,6 +33,7 @@ class XColorList; class SVXCORE_DLLPUBLIC XColorItem : public NameOrIndex { Color aColor; + SvxThemeColor maThemeColor; public: static SfxPoolItem* CreateDefault(); @@ -48,6 +50,10 @@ public: const Color& GetColorValue() const; void SetColorValue(const Color& rNew) { aColor = rNew; Detach(); } + + SvxThemeColor& GetThemeColor() { return maThemeColor; } + const SvxThemeColor& GetThemeColor() const { return maThemeColor; } + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; |