summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-02-11 11:24:05 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-03-01 12:57:21 +0000
commit855f7c08d1feab7669670bfbc4ed2b3b3225db16 (patch)
tree0d8f8cd014bb74cfd88aea2283e1d30ad7b2b547 /include
parent79434c321597790de6cb8db18f4b9fb6dc8c60bb (diff)
send theme info when changing color (in the picker) via UNO command
Change-Id: I288f8fb3375e152b5ee746fab2c05d08150d6c99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146817 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/docmodel/theme/ThemeColorJSON.hxx23
-rw-r--r--include/editeng/colritem.hxx6
-rw-r--r--include/editeng/memberids.h1
-rw-r--r--include/svx/svxids.hrc8
4 files changed, 34 insertions, 4 deletions
diff --git a/include/docmodel/theme/ThemeColorJSON.hxx b/include/docmodel/theme/ThemeColorJSON.hxx
new file mode 100644
index 000000000000..008850730e99
--- /dev/null
+++ b/include/docmodel/theme/ThemeColorJSON.hxx
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include <docmodel/dllapi.h>
+#include <docmodel/theme/ThemeColor.hxx>
+
+namespace model::theme
+{
+DOCMODEL_DLLPUBLIC OString convertToJSON(model::ThemeColor const& rThemeColor);
+DOCMODEL_DLLPUBLIC bool convertFromJSON(OString const& rJsonString, model::ThemeColor& rThemeColor);
+
+} // end of namespace model
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index d4090eb9e7eb..fc55b6e04553 100644
--- a/include/editeng/colritem.hxx
+++ b/include/editeng/colritem.hxx
@@ -39,6 +39,7 @@ public:
explicit SvxColorItem(const sal_uInt16 nId);
SvxColorItem(const Color& aColor, const sal_uInt16 nId);
+ SvxColorItem(const Color& aColor, model::ThemeColor const& rThemeColor, const sal_uInt16 nId);
virtual ~SvxColorItem() override;
// "pure virtual Methods" from SfxPoolItem
@@ -63,6 +64,11 @@ public:
const model::ThemeColor& GetThemeColor() const { return maThemeColor; }
+ void setThemeColor(model::ThemeColor const& rThemeColor)
+ {
+ maThemeColor = rThemeColor;
+ }
+
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
};
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index 0b110cb52c5d..6003ce394ba0 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -189,6 +189,7 @@
#define MID_COLOR_LUM_MOD 6
#define MID_COLOR_LUM_OFF 7
#define MID_COLOR_THEME_REFERENCE 8
+#define MID_COLOR_THEME_REFERENCE_JSON 9
#endif
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 0c744f007348..d3da901a09ce 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -449,9 +449,10 @@ class XFillGradientItem;
#define SID_ATTR_TEXTCOLUMNS_NUMBER ( SID_SVX_START + 340 )
#define SID_ATTR_TEXTCOLUMNS_SPACING ( SID_SVX_START + 341 )
-#define SID_ATTR_COLOR_THEME_INDEX TypedWhichId<SfxInt16Item>( SID_SVX_START + 342 )
-#define SID_ATTR_COLOR_LUM_MOD TypedWhichId<SfxInt16Item>( SID_SVX_START + 343 )
-#define SID_ATTR_COLOR_LUM_OFF TypedWhichId<SfxInt16Item>( SID_SVX_START + 344 )
+#define SID_ATTR_COLOR_THEME_REFERENCE TypedWhichId<SvxColorItem>( SID_SVX_START + 342 )
+#define SID_ATTR_COLOR_THEME_INDEX TypedWhichId<SfxInt16Item>( SID_SVX_START + 343 )
+#define SID_ATTR_COLOR_LUM_MOD TypedWhichId<SfxInt16Item>( SID_SVX_START + 344 )
+#define SID_ATTR_COLOR_LUM_OFF TypedWhichId<SfxInt16Item>( SID_SVX_START + 345 )
#define SID_SB_CONNECTIONPOOLING ( SID_SVX_START + 348 )
#define SID_SB_DBREGISTEROPTIONS ( SID_SVX_START + 349 )
@@ -683,7 +684,6 @@ class XFillGradientItem;
#define SID_PARAGRAPH_CHANGE_STATE ( SID_SVX_START + 754 )
#define SID_ATTR_SHADOW_BLUR ( SID_SVX_START + 755 )
-
//FREE
//FREE
//FREE