PMDRecord.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

PMDRecord.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 libpagemaker 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 __PMDRECORD_H__
11 #define __PMDRECORD_H__
12
13 #include <stdint.h>
14 #include <librevenge/librevenge.h>
15 #include <boost/optional.hpp>
16 #include <vector>
17
18 #include "constants.h"
19
20 namespace libpagemaker
21 {
22
23 struct PMDRecordContainer
24 {
25 uint16_t m_recordType;
26 uint32_t m_offset;
27 unsigned m_seqNum;
28 uint16_t m_numRecords;
29
30 PMDRecordContainer(uint16_t recordType, uint32_t offset, unsigned seqNum, uint16_t numRecords)
31 : m_recordType(recordType), m_offset(offset), m_seqNum(seqNum),
32 m_numRecords(numRecords)
33 { }
34 };
35
36 inline boost::optional<unsigned> getRecordSize(uint16_t recType)
37 {
38 switch (recType)
39 {
40 case SHAPE:
41 return 258;
42 case GLOBAL_INFO:
43 return 2496;
44 case PAGE:
45 return 472;
46 case LINE_SET:
47 return 4;
48 case XFORM:
49 return 26;
50 case TEXT_BLOCK:
51 return 36;
52 case CHARS:
53 return 30;
54 case PARA:
55 return 80;
56 case FONTS:
57 return 94;
58 case FONTS_PARENT:
59 return 10;
60 case COLORS:
61 return 210;
62 default:
63 return boost::none;
64 }
65 }
66
67 }
68
69 #endif /* __PMDRECORD_H__ */
70
71 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
GLOBAL_INFO
const uint8_t GLOBAL_INFO
Definition: constants.h:23
CHARS
const uint8_t CHARS
Definition: constants.h:26
TEXT_BLOCK
const uint8_t TEXT_BLOCK
Definition: constants.h:25
COLORS
const uint8_t COLORS
Definition: constants.h:22
PARA
const uint8_t PARA
Definition: constants.h:18
libpagemaker::PMDRecordContainer::m_recordType
uint16_t m_recordType
Definition: PMDRecord.h:25
constants.h
libpagemaker::getRecordSize
boost::optional< unsigned > getRecordSize(uint16_t recType)
Definition: PMDRecord.h:36
FONTS
const uint8_t FONTS
Definition: constants.h:21
XFORM
const uint8_t XFORM
Definition: constants.h:27
libpagemaker::PMDRecordContainer
Definition: PMDRecord.h:23
libpagemaker::PMDRecordContainer::m_seqNum
unsigned m_seqNum
Definition: PMDRecord.h:27
SHAPE
const uint8_t SHAPE
Definition: constants.h:24
libpagemaker::PMDRecordContainer::PMDRecordContainer
PMDRecordContainer(uint16_t recordType, uint32_t offset, unsigned seqNum, uint16_t numRecords)
Definition: PMDRecord.h:30
PAGE
const uint8_t PAGE
Definition: constants.h:17
LINE_SET
const uint8_t LINE_SET
Definition: constants.h:20
FONTS_PARENT
const uint8_t FONTS_PARENT
Definition: constants.h:16
libpagemaker::PMDRecordContainer::m_numRecords
uint16_t m_numRecords
Definition: PMDRecord.h:28
libpagemaker
Definition: geometry.h:20
libpagemaker::PMDRecordContainer::m_offset
uint32_t m_offset
Definition: PMDRecord.h:26