LibreOffice Module svx (master) 1
ColorSets.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 */
10
11#ifndef INCLUDED_SVX_COLORSETS_HXX
12#define INCLUDED_SVX_COLORSETS_HXX
13
14#include <vector>
15
16#include <rtl/ustring.hxx>
17#include <sal/types.h>
18#include <svx/svxdllapi.h>
19#include <tools/color.hxx>
20
21typedef struct _xmlTextWriter* xmlTextWriterPtr;
22class SdrPage;
23
24namespace svx
25{
26
28{
30 std::vector<Color> maColors;
31public:
32 ColorSet(OUString aName);
33
34 void add(sal_uInt32 nIndex, ::Color aColorData)
35 {
36 maColors[nIndex] = aColorData;
37 }
38
39 const OUString& getName() const
40 {
41 return maColorSetName;
42 }
43 const Color& getColor(sal_uInt32 nIndex) const
44 {
45 return maColors[nIndex];
46 }
47
48 void dumpAsXml(xmlTextWriterPtr pWriter) const;
49};
50
52{
53 std::vector<ColorSet> maColorSets;
54public:
55 ColorSets();
56 ~ColorSets();
57
58 void init();
59 const std::vector<ColorSet>& getColorSets() const
60 {
61 return maColorSets;
62 }
63
64 const ColorSet& getColorSet(sal_uInt32 nIndex)
65 {
66 return maColorSets[nIndex];
67 }
68
69 const ColorSet& getColorSet(std::u16string_view rName);
70};
71
74{
75 DK1 = 0,
76 LT1 = 1,
77 DK2 = 2,
78 LT2 = 3,
79 ACCENT1 = 4,
80 ACCENT2 = 5,
81 ACCENT3 = 6,
82 ACCENT4 = 7,
83 ACCENT5 = 8,
84 ACCENT6 = 9,
85 HLINK = 10,
86 FOLHLINK = 11,
87};
88
91{
92 OUString maName;
93 std::unique_ptr<ColorSet> mpColorSet;
94
95public:
96 Theme(OUString sName);
97 ~Theme();
98
99 void SetColorSet(std::unique_ptr<ColorSet> pColorSet);
100 ColorSet* GetColorSet();
101
102 void SetName(const OUString& rName);
103 const OUString& GetName() const;
104
105 void dumpAsXml(xmlTextWriterPtr pWriter) const;
106
107 void ToAny(css::uno::Any& rVal) const;
108
109 static std::unique_ptr<Theme> FromAny(const css::uno::Any& rVal);
110
111 void UpdateSdrPage(const SdrPage* pPage);
112
113 std::vector<Color> GetColors() const;
114
115 Color GetColor(ThemeColorType eType) const;
116};
117
118} // end of namespace svx
119
120#endif // INCLUDED_SVX_COLORSETS_HXX
121
122/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
Definition: ColorSets.hxx:21
FILE * init(int, char **)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
void add(sal_uInt32 nIndex, ::Color aColorData)
Definition: ColorSets.hxx:34
const OUString & getName() const
Definition: ColorSets.hxx:39
ColorSet(OUString aName)
Definition: ColorSets.cxx:129
const Color & getColor(sal_uInt32 nIndex) const
Definition: ColorSets.hxx:43
OUString maColorSetName
Definition: ColorSets.hxx:29
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: ColorSets.cxx:137
std::vector< Color > maColors
Definition: ColorSets.hxx:30
const std::vector< ColorSet > & getColorSets() const
Definition: ColorSets.hxx:59
std::vector< ColorSet > maColorSets
Definition: ColorSets.hxx:53
const ColorSet & getColorSet(sal_uInt32 nIndex)
Definition: ColorSets.hxx:64
A named theme has a named color set.
Definition: ColorSets.hxx:91
OUString maName
Definition: ColorSets.hxx:92
std::unique_ptr< ColorSet > mpColorSet
Definition: ColorSets.hxx:93
virtual OUString GetName() const override
struct _xmlTextWriter * xmlTextWriterPtr
DocumentType eType
OUString sName
sal_Int32 nIndex
ThemeColorType
Offsets into the color list of a theme.
Definition: ColorSets.hxx:74
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35