MSPUBTypes.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libmspub
3  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License or as specified alternatively below. You may obtain a copy of
8  * the License at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * Major Contributor(s):
16  * Copyright (C) 2012 Brennan Vincent <brennanv@email.arizona.edu>
17  * Copyright (C) 2012 Fridrich Strba <fridrich.strba@bluewin.ch>
18  *
19  * All Rights Reserved.
20  *
21  * For minor contributions see the git repository.
22  *
23  * Alternatively, the contents of this file may be used under the terms of
24  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
25  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
26  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
27  * instead of those above.
28  */
29 
30 #ifndef __MSPUBTYPES_H__
31 #define __MSPUBTYPES_H__
32 
33 #include <vector>
34 #include <string>
35 #include "MSPUBBlockType.h"
36 #include "MSPUBBlockID.h"
37 #include "MSPUBContentChunkType.h"
38 #include "MSPUBConstants.h"
39 
40 namespace libmspub
41 {
43 {
47 };
48 
50 {
51  LEFT = 0,
52  CENTER = 2,
53  RIGHT = 1,
54  JUSTIFY = 6
55 };
56 
58 {
59  unsigned short initial;
60  unsigned short type;
61  unsigned long contentsLength;
62  unsigned long contentsOffset;
63 };
64 
66 {
70  unsigned long startPosition;
71  unsigned long dataOffset;
72  unsigned long dataLength;
73  unsigned data;
74  std::vector<unsigned char> stringData;
75 };
76 
78 {
80  ContentChunkReference(MSPUBContentChunkType t, unsigned long o, unsigned long e, unsigned sn, unsigned psn) :
81  type(t), offset(o), end(e), seqNum(sn), parentSeqNum(psn) {}
83  unsigned long offset;
84  unsigned long end; //offset of the last element plus one.
85  unsigned seqNum;
86  unsigned parentSeqNum;
87 };
88 
90 {
91  QuillChunkReference() : length(0), offset(0), id(0), name(), name2() { }
92  unsigned long length;
93  unsigned long offset;
94  unsigned short id;
95  std::string name;
96  std::string name2;
97 };
98 
100 {
101  CharacterStyle(bool u, bool i, bool b, int tSIP = -1, int cI = -1, unsigned fI = 0) :
102  underline(u), italic(i), bold(b), textSizeInPt(tSIP), colorIndex(cI), fontIndex(fI) { }
103  bool underline;
104  bool italic;
105  bool bold;
108  unsigned fontIndex;
109 };
110 
112 {
113  ParagraphStyle(Alignment a = (Alignment)-1, unsigned dCSI = 0, unsigned ls = LINE_SPACING_UNIT, unsigned sb = 0, unsigned sa = 0, int fli = 0, unsigned li = 0, unsigned ri = 0) : align(a), defaultCharStyleIndex(dCSI), lineSpacing(ls), spaceBeforeEmu(sb), spaceAfterEmu(sa), firstLineIndentEmu(fli), leftIndentEmu(li), rightIndentEmu(ri) { }
116  unsigned lineSpacing;
117  unsigned spaceBeforeEmu;
118  unsigned spaceAfterEmu;
120  unsigned leftIndentEmu;
121  unsigned rightIndentEmu;
122 };
123 
124 struct TextSpan
125 {
126  TextSpan(std::vector<unsigned char> c, CharacterStyle s) : chars(c), style(s) { }
127  std::vector<unsigned char> chars;
129 };
130 
132 {
133  TextParagraph(std::vector<TextSpan> sp, ParagraphStyle st) : spans(sp), style(st) { }
134  std::vector<TextSpan> spans;
136 };
137 
138 struct Color
139 {
140  Color() : r(0), g(0), b(0) { }
141  Color(unsigned char red, unsigned char green, unsigned char blue) : r(red), g(green), b(blue) { }
142  unsigned char r, g, b;
143 };
144 
146 {
150 };
151 
153 {
162 };
163 
164 } // namespace libmspub
165 
166 #endif /* __MSPUBTYPES_H__ */
167 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libmspub by doxygen 1.8.1.2