WPS8TextStyle.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WPS8TextStyle.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
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 * Major Contributor(s):
10 * Copyright (C) 2006, 2007 Andrew Ziem
11 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 */
21
22 #ifndef WPS8_TEXTSTYLE_H
23 #define WPS8_TEXTSTYLE_H
24
25 #include <ostream>
26 #include <string>
27 #include <vector>
28
29 #include "libwps_internal.h"
30
31 #include "WPSDebug.h"
32
33 namespace WPS8Struct
34 {
35 struct FileData;
36 }
37
38 namespace WPS8TextStyleInternal
39 {
40 struct State;
41 }
42
43 class WPS8Text;
44
45 class WPS8TextStyle
46 {
47 friend class WPS8Text;
48 public:
49 struct FontData;
50
51 WPS8TextStyle(WPS8Text &parser);
52 ~WPS8TextStyle();
53
55 void setListener(WPSContentListenerPtr &listen)
56 {
57 m_listener = listen;
58 }
59
61 bool readStructures();
62
63 protected:
65 bool readFontNames(WPSEntry const &entry);
67 bool readFont(long endPos, int &id, std::string &mess);
68
69 void sendFont(int fId, FontData &data);
70
72 bool readParagraph(long endPos, int &id, std::string &mess);
73
74 void sendParagraph(int pId);
75
78 bool readSTSH(WPSEntry const &entry);
79
81 bool readSGP(WPSEntry const &entry);
82
83 //----------------------------------------
84 // FDP parsing
85 //----------------------------------------
86
89 bool findFDPStructures(int which, std::vector<WPSEntry> &result);
92 bool findFDPStructuresByHand(int which, std::vector<WPSEntry> &result);
93
94 protected:
96 libwps::DebugFile &ascii()
97 {
98 return m_asciiFile;
99 }
100
101 private:
103 WPS8TextStyle(WPS8TextStyle const &orig);
105 WPS8TextStyle &operator=(WPS8TextStyle const &orig);
106
107 protected:
109 WPS8Text &m_mainParser;
111 RVNGInputStreamPtr m_input;
113 WPSContentListenerPtr m_listener;
115 mutable shared_ptr<WPS8TextStyleInternal::State> m_state;
117 libwps::DebugFile &m_asciiFile;
118 public:
119 struct FontData
120 {
121 FontData() : m_type(T_None), m_fieldType(F_None), m_fieldFormat(0) {}
123 friend std::ostream &operator<<(std::ostream &o, FontData const &fData);
125 std::string format() const;
126
127 enum { T_None=0, T_Object=2, T_Footnote=3, T_Endnote=4, T_Field=5, T_Comment=6 };
129 int m_type;
130 enum { F_None=0, F_PageNumber=-1, F_Date=-4, F_Time=-5 };
132 int m_fieldType;
134 int m_fieldFormat;
135 };
136 protected:
137 };
138
139
140 #endif /* WPS8_TEXT_H */
141 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WPS8TextStyle::sendFont
void sendFont(int fId, FontData &data)
Definition: WPS8TextStyle.cpp:644
WPSContentListenerPtr
shared_ptr< WPSContentListener > WPSContentListenerPtr
shared pointer to WPSContentListener
Definition: libwps_internal.h:101
WPS8TextStyle
Definition: WPS8TextStyle.h:45
WPS8TextStyle::FontData
Definition: WPS8TextStyle.h:119
WPS8TextStyle::FontData::operator<<
friend std::ostream & operator<<(std::ostream &o, FontData const &fData)
operator <<
Definition: WPS8TextStyle.cpp:1332
WPS8TextStyle::FontData::F_Date
Definition: WPS8TextStyle.h:130
WPS8Text
Definition: WPS8Text.h:47
libwps::DebugFile
Definition: WPSDebug.h:196
WPS8TextStyle::~WPS8TextStyle
~WPS8TextStyle()
Definition: WPS8TextStyle.cpp:193
WPS8TextStyle::FontData::T_None
Definition: WPS8TextStyle.h:127
WPS8TextStyle::readSTSH
bool readSTSH(WPSEntry const &entry)
reads a style sheet zone
Definition: WPS8TextStyle.cpp:1088
WPS8TextStyle::FontData::m_type
int m_type
the main type: footnote, ...
Definition: WPS8TextStyle.h:129
WPS8TextStyle::findFDPStructures
bool findFDPStructures(int which, std::vector< WPSEntry > &result)
finds the FDPC/FDPP structure using the BTEC/BTEP entries which == 0 means FDPP, 1 means FDPC ...
Definition: WPS8TextStyle.cpp:1229
WPS8TextStyle::FontData::m_fieldType
int m_fieldType
the field type: pagenumber, data, time, ...
Definition: WPS8TextStyle.h:132
WPS8TextStyle::setListener
void setListener(WPSContentListenerPtr &listen)
sets the listener
Definition: WPS8TextStyle.h:55
WPS8TextStyle::FontData::format
std::string format() const
returns a format to used with strftime
Definition: WPS8TextStyle.cpp:1378
WPS8TextStyle::findFDPStructuresByHand
bool findFDPStructuresByHand(int which, std::vector< WPSEntry > &result)
finds the FDPC/FDPP structure by searching after the text zone which == 0 means FDPP, 1 means FDPC
Definition: WPS8TextStyle.cpp:1310
WPS8TextStyleInternal
Definition: WPS8TextStyle.cpp:41
WPS8TextStyle::readStructures
bool readStructures()
finds all entries which correspond to the styles, parses them and stores data
Definition: WPS8TextStyle.cpp:200
WPS8TextStyle::readFont
bool readFont(long endPos, int &id, std::string &mess)
reads a font properties
Definition: WPS8TextStyle.cpp:378
WPS8TextStyle::sendParagraph
void sendParagraph(int pId)
Definition: WPS8TextStyle.cpp:1072
WPS8TextStyle::FontData::T_Comment
Definition: WPS8TextStyle.h:127
WPS8TextStyle::readParagraph
bool readParagraph(long endPos, int &id, std::string &mess)
the paragraph
Definition: WPS8TextStyle.cpp:662
WPS8TextStyle::FontData::F_Time
Definition: WPS8TextStyle.h:130
WPS8TextStyle::FontData::F_None
Definition: WPS8TextStyle.h:130
libwps_internal.h
WPS8TextStyle::FontData::F_PageNumber
Definition: WPS8TextStyle.h:130
WPS8Struct
namespace used to read the structures stored in a WPS8 files
Definition: WPS8Struct.cpp:30
WPS8TextStyle::readSGP
bool readSGP(WPSEntry const &entry)
parses a SGP zone: style general property ?
Definition: WPS8TextStyle.cpp:324
WPS8TextStyle::FontData::T_Object
Definition: WPS8TextStyle.h:127
WPS8TextStyle::ascii
libwps::DebugFile & ascii()
a DebugFile used to write what we recognize when we parse the document
Definition: WPS8TextStyle.h:96
WPS8TextStyle::m_mainParser
WPS8Text & m_mainParser
the main parser
Definition: WPS8TextStyle.h:109
WPS8TextStyle::FontData::T_Field
Definition: WPS8TextStyle.h:127
WPS8TextStyle::FontData::T_Footnote
Definition: WPS8TextStyle.h:127
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:82
WPS8TextStyle::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS8TextStyle.h:117
WPS8TextStyle::m_input
RVNGInputStreamPtr m_input
the main input
Definition: WPS8TextStyle.h:111
WPS8TextStyle::FontData::m_fieldFormat
int m_fieldFormat
the field format
Definition: WPS8TextStyle.h:134
WPS8TextStyle::WPS8TextStyle
WPS8TextStyle(WPS8Text &parser)
Definition: WPS8TextStyle.cpp:186
WPS8TextStyle::m_listener
WPSContentListenerPtr m_listener
the listener
Definition: WPS8TextStyle.h:113
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
WPS8TextStyle::m_state
shared_ptr< WPS8TextStyleInternal::State > m_state
the internal state
Definition: WPS8TextStyle.h:115
WPS8TextStyle::FontData::T_Endnote
Definition: WPS8TextStyle.h:127
WPS8TextStyle::operator=
WPS8TextStyle & operator=(WPS8TextStyle const &orig)
private copy operator: forbidden
WPS8TextStyle::FontData::FontData
FontData()
Definition: WPS8TextStyle.h:121
WPS8TextStyle::readFontNames
bool readFontNames(WPSEntry const &entry)
reads the font names
Definition: WPS8TextStyle.cpp:246
WPSDebug.h