VSDXTheme.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libvisio 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#ifndef __VSDXTHEME_H__
11#define __VSDXTHEME_H__
12
13#include <vector>
14#include <map>
15#include <optional>
16#include <array>
17#include <librevenge-stream/librevenge-stream.h>
18#include "VSDXMLHelper.h"
19
20namespace libvisio
21{
22
23class VSDCollector;
24
37
57
59{
60 librevenge::RVNGString m_latinTypeFace;
61 librevenge::RVNGString m_eaTypeFace;
62 librevenge::RVNGString m_csTypeFace;
63 std::map<unsigned, librevenge::RVNGString> m_typeFaces;
64
65 VSDXFont();
66};
67
76
78{
79 std::array<std::array<unsigned, 4>, 4> m_varStyles;
80
82};
83
85{
86public:
87 VSDXTheme();
88 ~VSDXTheme();
89 bool parse(librevenge::RVNGInputStream *input);
90 std::optional<Colour> getThemeColour(unsigned value, unsigned variationIndex = 0) const;
91 std::optional<Colour> getStyleColour(unsigned value, unsigned variationIndex = 0) const;
92 std::optional<Colour> getFillStyleColour(unsigned value) const;
93 size_t getFillStyleLstSize() const { return m_fillStyleLst.size(); }
94
95private:
98
99 std::optional<Colour> readSrgbClr(xmlTextReaderPtr reader);
100 std::optional<Colour> readSysClr(xmlTextReaderPtr reader);
101 std::optional<Colour> readSchemeClr(xmlTextReaderPtr reader);
102
103 void readClrScheme(xmlTextReaderPtr reader);
104 bool readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr);
105 void readVariationClrSchemeLst(xmlTextReaderPtr reader);
106 void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch);
107 void readVariationStyleSchemeLst(xmlTextReaderPtr reader);
108 void readVariationStyleScheme(xmlTextReaderPtr reader, int idToken, VSDXVariationStyleScheme &vaStyleSch);
109 void readVarIdx(xmlTextReaderPtr reader, std::array<unsigned, 4>& varStyle);
110 void readFontScheme(xmlTextReaderPtr reader);
111 void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font);
112 bool readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace);
113 bool readTypeFace(xmlTextReaderPtr reader, int &script, librevenge::RVNGString &typeFace);
114 void readFmtScheme(xmlTextReaderPtr reader);
115 void readFillStyleLst(xmlTextReaderPtr reader);
116 void readGradFill(xmlTextReaderPtr reader, std::size_t nPos);
117 void readGradFillLst(xmlTextReaderPtr reader, std::size_t nPos);
118
119 int getElementToken(xmlTextReaderPtr reader);
120 void skipUnimplemented(xmlTextReaderPtr reader, int idToken);
121
124 std::array<std::vector<std::optional<Colour>>, 6> m_fillStyleLst;
125 std::vector<VSDXVariationStyleScheme> m_variationStyleSchemeLst;
126};
127
128} // namespace libvisio
129
130#endif // __VSDXTHEME_H__
131/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition VSDCollector.h:21
void readFontScheme(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:216
size_t getFillStyleLstSize() const
Definition VSDXTheme.h:93
int getElementToken(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:82
VSDXClrScheme m_clrScheme
Definition VSDXTheme.h:122
std::vector< VSDXVariationStyleScheme > m_variationStyleSchemeLst
Definition VSDXTheme.h:125
std::optional< Colour > readSrgbClr(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:131
void readVariationStyleSchemeLst(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:559
void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch)
Definition VSDXTheme.cpp:452
std::optional< Colour > getThemeColour(unsigned value, unsigned variationIndex=0) const
Definition VSDXTheme.cpp:497
void skipUnimplemented(xmlTextReaderPtr reader, int idToken)
Definition VSDXTheme.cpp:716
bool readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace)
Definition VSDXTheme.cpp:289
void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font)
Definition VSDXTheme.cpp:248
void readVariationClrSchemeLst(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:421
std::optional< Colour > getStyleColour(unsigned value, unsigned variationIndex=0) const
Definition VSDXTheme.cpp:646
bool parse(librevenge::RVNGInputStream *input)
Definition VSDXTheme.cpp:87
void readClrScheme(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:314
std::optional< Colour > readSysClr(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:151
bool readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr)
Definition VSDXTheme.cpp:381
void readGradFill(xmlTextReaderPtr reader, std::size_t nPos)
Definition VSDXTheme.cpp:787
~VSDXTheme()
Definition VSDXTheme.cpp:77
VSDXTheme(const VSDXTheme &)
void readVariationStyleScheme(xmlTextReaderPtr reader, int idToken, VSDXVariationStyleScheme &vaStyleSch)
Definition VSDXTheme.cpp:591
VSDXTheme & operator=(const VSDXTheme &)
void readVarIdx(xmlTextReaderPtr reader, std::array< unsigned, 4 > &varStyle)
Definition VSDXTheme.cpp:627
void readGradFillLst(xmlTextReaderPtr reader, std::size_t nPos)
Definition VSDXTheme.cpp:816
std::optional< Colour > readSchemeClr(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:171
void readFillStyleLst(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:734
VSDXFontScheme m_fontScheme
Definition VSDXTheme.h:123
void readFmtScheme(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:686
std::optional< Colour > getFillStyleColour(unsigned value) const
Definition VSDXTheme.cpp:855
std::array< std::vector< std::optional< Colour > >, 6 > m_fillStyleLst
Definition VSDXTheme.h:124
VSDXTheme()
Definition VSDXTheme.cpp:69
Definition libvisio_utils.h:47
Definition VSDTypes.h:71
Definition VSDXTheme.h:39
VSDXClrScheme()
Definition VSDXTheme.cpp:31
Colour m_accent6
Definition VSDXTheme.h:49
Colour m_accent3
Definition VSDXTheme.h:46
std::vector< VSDXVariationClrScheme > m_variationClrSchemeLst
Definition VSDXTheme.h:53
Colour m_accent4
Definition VSDXTheme.h:47
Colour m_dk1
Definition VSDXTheme.h:40
Colour m_dk2
Definition VSDXTheme.h:42
Colour m_lt2
Definition VSDXTheme.h:43
Colour m_hlink
Definition VSDXTheme.h:50
Colour m_lt1
Definition VSDXTheme.h:41
Colour m_accent1
Definition VSDXTheme.h:44
Colour m_folHlink
Definition VSDXTheme.h:51
Colour m_bkgnd
Definition VSDXTheme.h:52
Colour m_accent5
Definition VSDXTheme.h:48
Colour m_accent2
Definition VSDXTheme.h:45
Definition VSDXTheme.h:69
VSDXFontScheme()
Definition VSDXTheme.cpp:57
unsigned m_schemeId
Definition VSDXTheme.h:72
VSDXFont m_majorFont
Definition VSDXTheme.h:70
VSDXFont m_minorFont
Definition VSDXTheme.h:71
Definition VSDXTheme.h:59
librevenge::RVNGString m_csTypeFace
Definition VSDXTheme.h:62
librevenge::RVNGString m_latinTypeFace
Definition VSDXTheme.h:60
VSDXFont()
Definition VSDXTheme.cpp:49
std::map< unsigned, librevenge::RVNGString > m_typeFaces
Definition VSDXTheme.h:63
librevenge::RVNGString m_eaTypeFace
Definition VSDXTheme.h:61
Definition VSDXTheme.h:26
Colour m_varColor6
Definition VSDXTheme.h:32
VSDXVariationClrScheme()
Definition VSDXTheme.cpp:20
Colour m_varColor1
Definition VSDXTheme.h:27
Colour m_varColor2
Definition VSDXTheme.h:28
Colour m_varColor5
Definition VSDXTheme.h:31
Colour m_varColor3
Definition VSDXTheme.h:29
Colour m_varColor4
Definition VSDXTheme.h:30
Colour m_varColor7
Definition VSDXTheme.h:33
Definition VSDXTheme.h:78
VSDXVariationStyleScheme()
Definition VSDXTheme.cpp:64
std::array< std::array< unsigned, 4 >, 4 > m_varStyles
Definition VSDXTheme.h:79

Generated for libvisio by doxygen 1.14.0