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 
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: */
const uint16_t XFORM
Definition: constants.h:27
const uint16_t COLORS
Definition: constants.h:22
uint16_t m_recordType
Definition: PMDRecord.h:25
const uint16_t FONTS
Definition: constants.h:21
const uint16_t SHAPE
Definition: constants.h:24
boost::optional< unsigned > getRecordSize(uint16_t recType)
Definition: PMDRecord.h:36
const uint16_t TEXT_BLOCK
Definition: constants.h:25
const uint16_t PAGE
Definition: constants.h:17
Definition: PMDRecord.h:23
const uint16_t FONTS_PARENT
Definition: constants.h:16
unsigned m_seqNum
Definition: PMDRecord.h:27
PMDRecordContainer(uint16_t recordType, uint32_t offset, unsigned seqNum, uint16_t numRecords)
Definition: PMDRecord.h:30
const uint16_t PARA
Definition: constants.h:18
uint16_t m_numRecords
Definition: PMDRecord.h:28
const uint16_t CHARS
Definition: constants.h:26
Definition: geometry.h:20
const uint16_t GLOBAL_INFO
Definition: constants.h:23
const uint16_t LINE_SET
Definition: constants.h:20
uint32_t m_offset
Definition: PMDRecord.h:26

Generated for libpagemaker by doxygen 1.8.10