- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

RagTime5Text.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 /*
35 * Parser to RagTime 5-6 document ( text part )
36 *
37 */
38 #ifndef RAGTIME5_TEXT
39 # define RAGTIME5_TEXT
40
41 #include <string>
42 #include <map>
43 #include <vector>
44
45 #include <librevenge/librevenge.h>
46
47 #include "libmwaw_internal.hxx"
48
49 #include "MWAWDebug.hxx"
50 #include "MWAWInputStream.hxx"
51 #include "MWAWPosition.hxx"
52
53 #include "RagTime5StructManager.hxx"
54 #include "RagTime5ClusterManager.hxx"
55
56 namespace RagTime5TextInternal
57 {
58 struct State;
59 struct FieldParser;
60
61 class SubDocument;
62 }
63
64 class RagTime5Parser;
65 class RagTime5StructManager;
66 class RagTime5Zone;
67
73 class RagTime5Text
74 {
75 friend struct RagTime5TextInternal::FieldParser;
76 friend class RagTime5TextInternal::SubDocument;
77 friend class RagTime5Parser;
78
79 public:
80
82 RagTime5Text(RagTime5Parser &parser);
84 virtual ~RagTime5Text();
85
87 int version() const;
88
90 int numPages() const;
91
92 protected:
93
95 void flushExtra();
96
97 // interface with main parser
98
100 bool readTextCluster(RagTime5Zone &zone, int zoneType);
101
102 //
103 // Intermediate level
104 //
105
106 //
107 // basic text
108 //
109
111 bool readTextStyles(RagTime5ClusterManager::Cluster &cluster);
112
114 bool readTextUnknown0(int typeId);
116 bool readTextUnknown1(int typeId);
117
119 bool readLinkZones(RagTime5ClusterManager::Cluster &cluster, RagTime5ClusterManager::Link const &link);
120
122 bool readFieldZones(RagTime5ClusterManager::Cluster &cluster, RagTime5ClusterManager::Link const &link, bool isDefinition);
124 bool readFieldDefinition(RagTime5Zone &zone, long endPos, int n);
126 bool readFieldPosition(RagTime5Zone &zone, long endPos, int n);
127
128 //
129 // low level
130 //
131
132
133 private:
134 RagTime5Text(RagTime5Text const &orig);
135 RagTime5Text &operator=(RagTime5Text const &orig);
136
137 protected:
138 //
139 // data
140 //
142 RagTime5Parser &m_mainParser;
143
145 shared_ptr<RagTime5StructManager> m_structManager;
147 MWAWParserStatePtr m_parserState;
148
150 shared_ptr<RagTime5TextInternal::State> m_state;
151 };
152 #endif
153 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
RagTime5TextInternal::FieldParser
Internal: the helper to read field for a RagTime5Text.
Definition: RagTime5Text.cxx:63
RagTime5Text::readTextStyles
bool readTextStyles(RagTime5ClusterManager::Cluster &cluster)
try to read a main text styles
Definition: RagTime5Text.cxx:195
RagTime5Text::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: RagTime5Text.cxx:682
libmwaw_internal.hxx
RagTime5Text::readFieldDefinition
bool readFieldDefinition(RagTime5Zone &zone, long endPos, int n)
try to read a field definition
Definition: RagTime5Text.cxx:275
RagTime5StructManager.hxx
RagTime5TextInternal
Internal: the structures of a RagTime5Text.
Definition: RagTime5Text.cxx:59
RagTime5Zone
main zone in a RagTime v5-v6 document
Definition: RagTime5StructManager.hxx:48
RagTime5Text::m_state
shared_ptr< RagTime5TextInternal::State > m_state
the state
Definition: RagTime5Text.hxx:150
RagTime5Text::readFieldPosition
bool readFieldPosition(RagTime5Zone &zone, long endPos, int n)
try to read a field position
Definition: RagTime5Text.cxx:401
RagTime5Text::readLinkZones
bool readLinkZones(RagTime5ClusterManager::Cluster &cluster, RagTime5ClusterManager::Link const &link)
try to read a list of link/list definition
Definition: RagTime5Text.cxx:439
RagTime5Text::SubDocument
friend class RagTime5TextInternal::SubDocument
Definition: RagTime5Text.hxx:76
RagTime5Text::version
int version() const
returns the file version
Definition: RagTime5Text.cxx:174
RagTime5Text::RagTime5Text
RagTime5Text(RagTime5Parser &parser)
constructor
Definition: RagTime5Text.cxx:165
RagTime5Text::~RagTime5Text
virtual ~RagTime5Text()
destructor
Definition: RagTime5Text.cxx:171
RagTime5Parser
the main class to read a RagTime v5 file
Definition: RagTime5Parser.hxx:69
RagTime5Text
the main class to read the text part of RagTime 56 file
Definition: RagTime5Text.hxx:73
MWAWInputStream.hxx
MWAWDebug.hxx
RagTime5Text::readTextUnknown0
bool readTextUnknown0(int typeId)
try to read a text style position correspondance ?
Definition: RagTime5Text.cxx:577
RagTime5Text::m_structManager
shared_ptr< RagTime5StructManager > m_structManager
the structure manager
Definition: RagTime5Text.hxx:145
RagTime5Text::operator=
RagTime5Text & operator=(RagTime5Text const &orig)
RagTime5Text::readTextCluster
bool readTextCluster(RagTime5Zone &zone, int zoneType)
try to read a spreadsheet cluster
Definition: RagTime5Text.cxx:1425
MWAWPosition.hxx
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:445
RagTime5Text::numPages
int numPages() const
returns the number of pages
Definition: RagTime5Text.cxx:179
RagTime5StructManager
basic class used to store RagTime 5/6 structures
Definition: RagTime5StructManager.hxx:158
RagTime5Text::readFieldZones
bool readFieldZones(RagTime5ClusterManager::Cluster &cluster, RagTime5ClusterManager::Link const &link, bool isDefinition)
try to read a list of field definition
Definition: RagTime5Text.cxx:204
RagTime5ClusterManager.hxx
RagTime5Text::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: RagTime5Text.hxx:147
RagTime5Text::m_mainParser
RagTime5Parser & m_mainParser
the parser
Definition: RagTime5Text.hxx:142
RagTime5ClusterManager::Link
a link to a small zone (or set of zones) in RagTime 5/6 documents
Definition: RagTime5ClusterManager.hxx:100
RagTime5ClusterManager::Cluster
the cluster data
Definition: RagTime5ClusterManager.hxx:209
RagTime5Text::readTextUnknown1
bool readTextUnknown1(int typeId)
try to read a list of unknown zone 6 bytes data
Definition: RagTime5Text.cxx:618