MSPUBTypes.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 libmspub 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 __MSPUBTYPES_H__
11 #define __MSPUBTYPES_H__
12 
13 #include <vector>
14 #include <string>
15 #include <boost/optional.hpp>
16 #include "MSPUBBlockType.h"
17 #include "MSPUBBlockID.h"
18 #include "MSPUBContentChunkType.h"
19 #include "MSPUBConstants.h"
20 #include "ListInfo.h"
21 
22 namespace libmspub
23 {
25 {
29 };
30 
32 {
36 };
37 
39 {
40  LEFT = 0,
41  CENTER = 2,
42  RIGHT = 1,
43  JUSTIFY = 6
44 };
45 
47 {
48  unsigned short initial;
49  unsigned short type;
50  unsigned long contentsLength;
51  unsigned long contentsOffset;
52 };
53 
55 {
59  unsigned long startPosition;
60  unsigned long dataOffset;
61  unsigned long dataLength;
62  unsigned data;
63  std::vector<unsigned char> stringData;
64 };
65 
67 {
69  ContentChunkReference(MSPUBContentChunkType t, unsigned long o, unsigned long e, unsigned sn, unsigned psn) :
70  type(t), offset(o), end(e), seqNum(sn), parentSeqNum(psn) {}
72  unsigned long offset;
73  unsigned long end; //offset of the last element plus one.
74  unsigned seqNum;
75  unsigned parentSeqNum;
76 };
77 
79 {
80  QuillChunkReference() : length(0), offset(0), id(0), name(), name2() { }
81  unsigned long length;
82  unsigned long offset;
83  unsigned short id;
84  std::string name;
85  std::string name2;
86 };
87 
89 {
91  underline(), italic(), bold(),
93  {
94  }
95  CharacterStyle(bool u, bool i, bool b,
96  boost::optional<double> tSIP = boost::optional<double>(),
97  int cI = -1,
98  boost::optional<unsigned> fI = boost::optional<unsigned>(),
99  SuperSubType sst = NO_SUPER_SUB) :
100  underline(u), italic(i), bold(b), textSizeInPt(tSIP), colorIndex(cI), fontIndex(fI), superSubType(sst) { }
101  bool underline;
102  bool italic;
103  bool bold;
104  boost::optional<double> textSizeInPt;
106  boost::optional<unsigned> fontIndex;
108 };
109 
111 {
114 };
115 
117 {
119  double m_amount;
121  {
122  }
123  LineSpacingInfo(LineSpacingType type, double amount) :
124  m_type(type), m_amount(amount)
125  {
126  }
127 };
128 
130 {
131  boost::optional<Alignment> m_align;
132  boost::optional<unsigned> m_defaultCharStyleIndex;
133  boost::optional<LineSpacingInfo> m_lineSpacing;
134  boost::optional<unsigned> m_spaceBeforeEmu;
135  boost::optional<unsigned> m_spaceAfterEmu;
136  boost::optional<int> m_firstLineIndentEmu;
137  boost::optional<unsigned> m_leftIndentEmu;
138  boost::optional<unsigned> m_rightIndentEmu;
139  boost::optional<ListInfo> m_listInfo;
140  std::vector<unsigned> m_tabStopsInEmu;
141  boost::optional<unsigned> m_dropCapLines;
142  boost::optional<unsigned> m_dropCapLetters;
147  {
148  }
149 };
150 
151 struct TextSpan
152 {
153  TextSpan(const std::vector<unsigned char> &c, const CharacterStyle &s) : chars(c), style(s) { }
154  std::vector<unsigned char> chars;
156 };
157 
159 {
160  TextParagraph(const std::vector<TextSpan> &sp, const ParagraphStyle &st) : spans(sp), style(st) { }
161  std::vector<TextSpan> spans;
163 };
164 
165 struct Color
166 {
167  Color() : r(0), g(0), b(0) { }
168  Color(unsigned char red, unsigned char green, unsigned char blue) : r(red), g(green), b(blue) { }
169  unsigned char r, g, b;
170 };
171 
173 {
177 };
178 
180 {
190 };
191 
192 } // namespace libmspub
193 
194 #endif /* __MSPUBTYPES_H__ */
195 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libmspub by doxygen 1.8.4