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 
55 
56 namespace RagTime5TextInternal
57 {
58 struct State;
59 struct FieldParser;
60 
61 class SubDocument;
62 }
63 
64 class RagTime5Parser;
66 class RagTime5Zone;
67 
74 {
77  friend class RagTime5Parser;
78 
79 public:
80 
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 
112 
114  bool readTextUnknown0(int typeId);
116  bool readTextUnknown1(int typeId);
117 
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  //
143 
145  shared_ptr<RagTime5StructManager> m_structManager;
148 
150  shared_ptr<RagTime5TextInternal::State> m_state;
151 };
152 #endif
153 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Internal: the helper to read field for a RagTime5Text.
Definition: RagTime5Text.cxx:63
bool readTextStyles(RagTime5ClusterManager::Cluster &cluster)
try to read a main text styles
Definition: RagTime5Text.cxx:195
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: RagTime5Text.cxx:682
bool readFieldDefinition(RagTime5Zone &zone, long endPos, int n)
try to read a field definition
Definition: RagTime5Text.cxx:275
Internal: the structures of a RagTime5Text.
Definition: RagTime5Text.cxx:59
main zone in a RagTime v5-v6 document
Definition: RagTime5StructManager.hxx:48
shared_ptr< RagTime5TextInternal::State > m_state
the state
Definition: RagTime5Text.hxx:150
bool readFieldPosition(RagTime5Zone &zone, long endPos, int n)
try to read a field position
Definition: RagTime5Text.cxx:401
bool readLinkZones(RagTime5ClusterManager::Cluster &cluster, RagTime5ClusterManager::Link const &link)
try to read a list of link/list definition
Definition: RagTime5Text.cxx:439
friend class RagTime5TextInternal::SubDocument
Definition: RagTime5Text.hxx:76
int version() const
returns the file version
Definition: RagTime5Text.cxx:174
RagTime5Text(RagTime5Parser &parser)
constructor
Definition: RagTime5Text.cxx:165
virtual ~RagTime5Text()
destructor
Definition: RagTime5Text.cxx:171
the main class to read a RagTime v5 file
Definition: RagTime5Parser.hxx:69
the main class to read the text part of RagTime 56 file
Definition: RagTime5Text.hxx:73
bool readTextUnknown0(int typeId)
try to read a text style position correspondance ?
Definition: RagTime5Text.cxx:577
shared_ptr< RagTime5StructManager > m_structManager
the structure manager
Definition: RagTime5Text.hxx:145
RagTime5Text & operator=(RagTime5Text const &orig)
bool readTextCluster(RagTime5Zone &zone, int zoneType)
try to read a spreadsheet cluster
Definition: RagTime5Text.cxx:1425
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:445
int numPages() const
returns the number of pages
Definition: RagTime5Text.cxx:179
basic class used to store RagTime 5/6 structures
Definition: RagTime5StructManager.hxx:158
bool readFieldZones(RagTime5ClusterManager::Cluster &cluster, RagTime5ClusterManager::Link const &link, bool isDefinition)
try to read a list of field definition
Definition: RagTime5Text.cxx:204
MWAWParserStatePtr m_parserState
the parser state
Definition: RagTime5Text.hxx:147
RagTime5Parser & m_mainParser
the parser
Definition: RagTime5Text.hxx:142
the cluster data
Definition: RagTime5ClusterManager.hxx:209
bool readTextUnknown1(int typeId)
try to read a list of unknown zone 6 bytes data
Definition: RagTime5Text.cxx:618

Generated on Thu Jul 9 2015 20:26:37 for libmwaw by doxygen 1.8.8