VSDXTheme.h Source File documentation

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 <boost/optional.hpp>
16 #include <librevenge-stream/librevenge-stream.h>
17 #include "VSDXMLHelper.h"
18
19 namespace libvisio
20 {
21
22 class VSDCollector;
23
24 struct VSDXVariationClrScheme
25 {
26 Colour m_varColor1;
27 Colour m_varColor2;
28 Colour m_varColor3;
29 Colour m_varColor4;
30 Colour m_varColor5;
31 Colour m_varColor6;
32 Colour m_varColor7;
33
34 VSDXVariationClrScheme();
35 };
36
37 struct VSDXClrScheme
38 {
39 Colour m_dk1;
40 Colour m_lt1;
41 Colour m_dk2;
42 Colour m_lt2;
43 Colour m_accent1;
44 Colour m_accent2;
45 Colour m_accent3;
46 Colour m_accent4;
47 Colour m_accent5;
48 Colour m_accent6;
49 Colour m_hlink;
50 Colour m_folHlink;
51 Colour m_bkgnd;
52 std::vector<VSDXVariationClrScheme> m_variationClrSchemeLst;
53
54 VSDXClrScheme();
55 };
56
57 struct VSDXFont
58 {
59 librevenge::RVNGString m_latinTypeFace;
60 librevenge::RVNGString m_eaTypeFace;
61 librevenge::RVNGString m_csTypeFace;
62 std::map<unsigned, librevenge::RVNGString> m_typeFaces;
63
64 VSDXFont();
65 };
66
67 struct VSDXFontScheme
68 {
69 VSDXFont m_majorFont;
70 VSDXFont m_minorFont;
71 unsigned m_schemeId;
72
73 VSDXFontScheme();
74 };
75
76 class VSDXTheme
77 {
78 public:
79 VSDXTheme();
80 ~VSDXTheme();
81 bool parse(librevenge::RVNGInputStream *input);
82 boost::optional<Colour> getThemeColour(unsigned value, unsigned variationIndex = 0) const;
83
84 private:
85 VSDXTheme(const VSDXTheme &);
86 VSDXTheme &operator=(const VSDXTheme &);
87
88 boost::optional<Colour> readSrgbClr(xmlTextReaderPtr reader);
89 boost::optional<Colour> readSysClr(xmlTextReaderPtr reader);
90
91 void readClrScheme(xmlTextReaderPtr reader);
92 void readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr);
93 void readVariationClrSchemeLst(xmlTextReaderPtr reader);
94 void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch);
95 void readFontScheme(xmlTextReaderPtr reader);
96 void readFont(xmlTextReaderPtr reader, int idToken, VSDXFont &font);
97 void readTypeFace(xmlTextReaderPtr reader, librevenge::RVNGString &typeFace);
98 void readTypeFace(xmlTextReaderPtr reader, int &script, librevenge::RVNGString &typeFace);
99
100 int getElementToken(xmlTextReaderPtr reader);
101
102 VSDXClrScheme m_clrScheme;
103 VSDXFontScheme m_fontScheme;
104 };
105
106 } // namespace libvisio
107
108 #endif // __VSDXTHEME_H__
109 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libvisio::VSDXClrScheme::m_accent5
Colour m_accent5
Definition: VSDXTheme.h:47
libvisio::VSDXVariationClrScheme::m_varColor7
Colour m_varColor7
Definition: VSDXTheme.h:32
libvisio::VSDXVariationClrScheme::m_varColor4
Colour m_varColor4
Definition: VSDXTheme.h:29
libvisio::VSDXClrScheme::m_lt2
Colour m_lt2
Definition: VSDXTheme.h:42
libvisio::VSDXFontScheme::m_minorFont
VSDXFont m_minorFont
Definition: VSDXTheme.h:70
libvisio::VSDXVariationClrScheme::m_varColor3
Colour m_varColor3
Definition: VSDXTheme.h:28
libvisio::VSDXVariationClrScheme::m_varColor2
Colour m_varColor2
Definition: VSDXTheme.h:27
libvisio::VSDXClrScheme::m_bkgnd
Colour m_bkgnd
Definition: VSDXTheme.h:51
libvisio::VSDXClrScheme::m_lt1
Colour m_lt1
Definition: VSDXTheme.h:40
libvisio::Colour
Definition: VSDTypes.h:72
libvisio::VSDXClrScheme::m_dk1
Colour m_dk1
Definition: VSDXTheme.h:39
libvisio::VSDXVariationClrScheme::m_varColor1
Colour m_varColor1
Definition: VSDXTheme.h:26
libvisio::VSDXVariationClrScheme
Definition: VSDXTheme.h:24
libvisio::VSDXFontScheme::m_schemeId
unsigned m_schemeId
Definition: VSDXTheme.h:71
libvisio::VSDXClrScheme::m_accent6
Colour m_accent6
Definition: VSDXTheme.h:48
libvisio::VSDXVariationClrScheme::m_varColor6
Colour m_varColor6
Definition: VSDXTheme.h:31
VSDXMLHelper.h
libvisio::VSDXClrScheme
Definition: VSDXTheme.h:37
libvisio::VSDXTheme::m_clrScheme
VSDXClrScheme m_clrScheme
Definition: VSDXTheme.h:102
libvisio::VSDXClrScheme::m_accent4
Colour m_accent4
Definition: VSDXTheme.h:46
libvisio::VSDXFont::m_latinTypeFace
librevenge::RVNGString m_latinTypeFace
Definition: VSDXTheme.h:59
libvisio::VSDXFontScheme
Definition: VSDXTheme.h:67
libvisio::VSDXClrScheme::m_accent1
Colour m_accent1
Definition: VSDXTheme.h:43
libvisio::VSDXFont::m_eaTypeFace
librevenge::RVNGString m_eaTypeFace
Definition: VSDXTheme.h:60
libvisio::VSDXFont::m_csTypeFace
librevenge::RVNGString m_csTypeFace
Definition: VSDXTheme.h:61
libvisio::VSDXClrScheme::m_folHlink
Colour m_folHlink
Definition: VSDXTheme.h:50
libvisio::VSDXFont::m_typeFaces
std::map< unsigned, librevenge::RVNGString > m_typeFaces
Definition: VSDXTheme.h:62
libvisio::VSDXClrScheme::m_dk2
Colour m_dk2
Definition: VSDXTheme.h:41
libvisio
Definition: libvisio_utils.h:48
libvisio::VSDXClrScheme::m_hlink
Colour m_hlink
Definition: VSDXTheme.h:49
libvisio::VSDXFontScheme::m_majorFont
VSDXFont m_majorFont
Definition: VSDXTheme.h:69
libvisio::VSDXVariationClrScheme::m_varColor5
Colour m_varColor5
Definition: VSDXTheme.h:30
libvisio::VSDXFont
Definition: VSDXTheme.h:57
libvisio::VSDXTheme
Definition: VSDXTheme.h:76
libvisio::VSDXVariationClrScheme::VSDXVariationClrScheme
VSDXVariationClrScheme()
Definition: VSDXTheme.cpp:20
libvisio::VSDXClrScheme::m_accent3
Colour m_accent3
Definition: VSDXTheme.h:45
libvisio::VSDXClrScheme::m_accent2
Colour m_accent2
Definition: VSDXTheme.h:44
libvisio::VSDXClrScheme::m_variationClrSchemeLst
std::vector< VSDXVariationClrScheme > m_variationClrSchemeLst
Definition: VSDXTheme.h:52
libvisio::VSDXTheme::m_fontScheme
VSDXFontScheme m_fontScheme
Definition: VSDXTheme.h:103