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
94private:
97
98 std::optional<Colour> readSrgbClr(xmlTextReaderPtr reader);
99 std::optional<Colour> readSysClr(xmlTextReaderPtr reader);
100
101 void readClrScheme(xmlTextReaderPtr reader);
102 bool readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr);
103 void readVariationClrSchemeLst(xmlTextReaderPtr reader);
104 void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch);
105 void readVariationStyleSchemeLst(xmlTextReaderPtr reader);
106 void readVariationStyleScheme(xmlTextReaderPtr reader, int idToken, VSDXVariationStyleScheme &vaStyleSch);
107 void readVarIdx(xmlTextReaderPtr reader, std::array<unsigned, 4>& varStyle);
108 void readFontScheme(xmlTextReaderPtr reader);
109 void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font);
110 bool readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace);
111 bool readTypeFace(xmlTextReaderPtr reader, int &script, librevenge::RVNGString &typeFace);
112 void readFmtScheme(xmlTextReaderPtr reader);
113 void readFillStyleLst(xmlTextReaderPtr reader);
114
115 int getElementToken(xmlTextReaderPtr reader);
116 void skipUnimplemented(xmlTextReaderPtr reader, int idToken);
117
120 std::vector<std::optional<Colour>> m_fillStyleLst;
121 std::vector<VSDXVariationStyleScheme> m_variationStyleSchemeLst;
122};
123
124} // namespace libvisio
125
126#endif // __VSDXTHEME_H__
127/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition VSDCollector.h:21
void readFontScheme(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:171
int getElementToken(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:82
VSDXClrScheme m_clrScheme
Definition VSDXTheme.h:118
std::vector< VSDXVariationStyleScheme > m_variationStyleSchemeLst
Definition VSDXTheme.h:121
std::optional< Colour > readSrgbClr(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:131
void readVariationStyleSchemeLst(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:511
void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch)
Definition VSDXTheme.cpp:404
std::optional< Colour > getThemeColour(unsigned value, unsigned variationIndex=0) const
Definition VSDXTheme.cpp:449
void skipUnimplemented(xmlTextReaderPtr reader, int idToken)
Definition VSDXTheme.cpp:668
bool readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace)
Definition VSDXTheme.cpp:244
void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font)
Definition VSDXTheme.cpp:203
void readVariationClrSchemeLst(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:373
std::optional< Colour > getStyleColour(unsigned value, unsigned variationIndex=0) const
Definition VSDXTheme.cpp:598
std::vector< std::optional< Colour > > m_fillStyleLst
Definition VSDXTheme.h:120
bool parse(librevenge::RVNGInputStream *input)
Definition VSDXTheme.cpp:87
void readClrScheme(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:269
std::optional< Colour > readSysClr(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:151
bool readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr)
Definition VSDXTheme.cpp:336
~VSDXTheme()
Definition VSDXTheme.cpp:77
VSDXTheme(const VSDXTheme &)
void readVariationStyleScheme(xmlTextReaderPtr reader, int idToken, VSDXVariationStyleScheme &vaStyleSch)
Definition VSDXTheme.cpp:543
VSDXTheme & operator=(const VSDXTheme &)
void readVarIdx(xmlTextReaderPtr reader, std::array< unsigned, 4 > &varStyle)
Definition VSDXTheme.cpp:579
void readFillStyleLst(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:686
VSDXFontScheme m_fontScheme
Definition VSDXTheme.h:119
void readFmtScheme(xmlTextReaderPtr reader)
Definition VSDXTheme.cpp:638
std::optional< Colour > getFillStyleColour(unsigned value) const
Definition VSDXTheme.cpp:733
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.16.1