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 <boost/optional.hpp>
15 #include <librevenge-stream/librevenge-stream.h>
16 #include "VSDXMLHelper.h"
17
18 namespace libvisio
19 {
20
21 class VSDCollector;
22
23 struct VSDXVariationClrScheme
24 {
25 Colour m_varColor1;
26 Colour m_varColor2;
27 Colour m_varColor3;
28 Colour m_varColor4;
29 Colour m_varColor5;
30 Colour m_varColor6;
31 Colour m_varColor7;
32
33 VSDXVariationClrScheme();
34 };
35
36 struct VSDXClrScheme
37 {
38 Colour m_dk1;
39 Colour m_lt1;
40 Colour m_dk2;
41 Colour m_lt2;
42 Colour m_accent1;
43 Colour m_accent2;
44 Colour m_accent3;
45 Colour m_accent4;
46 Colour m_accent5;
47 Colour m_accent6;
48 Colour m_hlink;
49 Colour m_folHlink;
50 Colour m_bkgnd;
51 std::vector<VSDXVariationClrScheme> m_variationClrSchemeLst;
52
53 VSDXClrScheme();
54 };
55
56 class VSDXTheme
57 {
58 public:
59 VSDXTheme();
60 ~VSDXTheme();
61 bool parse(librevenge::RVNGInputStream *input);
62 boost::optional<Colour> getThemeColour(unsigned value, unsigned variationIndex = 0) const;
63
64 private:
65 VSDXTheme(const VSDXTheme &);
66 VSDXTheme &operator=(const VSDXTheme &);
67
68 boost::optional<Colour> readSrgbClr(xmlTextReaderPtr reader);
69 boost::optional<Colour> readSysClr(xmlTextReaderPtr reader);
70
71 void readClrScheme(xmlTextReaderPtr reader);
72 void readThemeColour(xmlTextReaderPtr reader, int idToken, Colour &clr);
73 void readVariationClrSchemeLst(xmlTextReaderPtr reader);
74 void readVariationClrScheme(xmlTextReaderPtr reader, VSDXVariationClrScheme &varClrSch);
75
76 int getElementToken(xmlTextReaderPtr reader);
77
78 VSDXClrScheme m_clrScheme;
79 };
80
81 } // namespace libvisio
82
83 #endif // __VSDXTHEME_H__
84 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libvisio::VSDXClrScheme::m_accent5
Colour m_accent5
Definition: VSDXTheme.h:46
libvisio::VSDXVariationClrScheme::m_varColor7
Colour m_varColor7
Definition: VSDXTheme.h:31
libvisio::VSDXVariationClrScheme::m_varColor4
Colour m_varColor4
Definition: VSDXTheme.h:28
libvisio::VSDXClrScheme::m_lt2
Colour m_lt2
Definition: VSDXTheme.h:41
libvisio::VSDXVariationClrScheme::m_varColor3
Colour m_varColor3
Definition: VSDXTheme.h:27
libvisio::VSDXVariationClrScheme::m_varColor2
Colour m_varColor2
Definition: VSDXTheme.h:26
libvisio::VSDXClrScheme::m_bkgnd
Colour m_bkgnd
Definition: VSDXTheme.h:50
libvisio::VSDXClrScheme::m_lt1
Colour m_lt1
Definition: VSDXTheme.h:39
libvisio::Colour
Definition: VSDTypes.h:73
libvisio::VSDXClrScheme::m_dk1
Colour m_dk1
Definition: VSDXTheme.h:38
libvisio::VSDXVariationClrScheme::m_varColor1
Colour m_varColor1
Definition: VSDXTheme.h:25
libvisio::VSDXVariationClrScheme
Definition: VSDXTheme.h:23
libvisio::VSDXClrScheme::m_accent6
Colour m_accent6
Definition: VSDXTheme.h:47
libvisio::VSDXVariationClrScheme::m_varColor6
Colour m_varColor6
Definition: VSDXTheme.h:30
VSDXMLHelper.h
libvisio::VSDXClrScheme
Definition: VSDXTheme.h:36
libvisio::VSDXTheme::m_clrScheme
VSDXClrScheme m_clrScheme
Definition: VSDXTheme.h:78
libvisio::VSDXClrScheme::m_accent4
Colour m_accent4
Definition: VSDXTheme.h:45
libvisio::VSDXClrScheme::m_accent1
Colour m_accent1
Definition: VSDXTheme.h:42
libvisio::VSDXClrScheme::m_folHlink
Colour m_folHlink
Definition: VSDXTheme.h:49
libvisio::VSDXClrScheme::m_dk2
Colour m_dk2
Definition: VSDXTheme.h:40
libvisio
Definition: libvisio_utils.h:73
libvisio::VSDXClrScheme::m_hlink
Colour m_hlink
Definition: VSDXTheme.h:48
libvisio::VSDXVariationClrScheme::m_varColor5
Colour m_varColor5
Definition: VSDXTheme.h:29
libvisio::VSDXTheme
Definition: VSDXTheme.h:56
libvisio::VSDXVariationClrScheme::VSDXVariationClrScheme
VSDXVariationClrScheme()
Definition: VSDXTheme.cpp:20
libvisio::VSDXClrScheme::m_accent3
Colour m_accent3
Definition: VSDXTheme.h:44
libvisio::VSDXClrScheme::m_accent2
Colour m_accent2
Definition: VSDXTheme.h:43
libvisio::VSDXClrScheme::m_variationClrSchemeLst
std::vector< VSDXVariationClrScheme > m_variationClrSchemeLst
Definition: VSDXTheme.h:51