WNText.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 WriteNow text document
36  *
37  */
38 #ifndef WN_TEXT
39 # define WN_TEXT
40 
41 #include <list>
42 #include <string>
43 #include <vector>
44 
45 #include "libmwaw_internal.hxx"
46 
47 #include "MWAWEntry.hxx"
48 #include "MWAWSubDocument.hxx"
49 
50 #include "MWAWDebug.hxx"
51 #include "MWAWInputStream.hxx"
52 
53 #include "MWAWParser.hxx"
54 
55 namespace WNTextInternal
56 {
57 struct ContentZone;
58 struct ContentZones;
59 
60 struct Font;
61 struct Paragraph;
62 
63 struct TableData;
64 struct Token;
65 
66 struct Cell;
67 
68 struct State;
69 }
70 
71 struct WNEntry;
72 struct WNEntryManager;
73 
74 class WNParser;
75 
81 class WNText
82 {
83  friend class WNParser;
84  friend struct WNTextInternal::Cell;
85 public:
87  WNText(WNParser &parser);
89  virtual ~WNText();
90 
92  int version() const;
93 
95  int numPages() const;
96 
98  WNEntry getHeader() const;
99 
101  WNEntry getFooter() const;
102 
103 protected:
105  bool createZones();
106 
108  void flushExtra();
109 
112  bool parseZone(WNEntry const &entry, std::vector<WNEntry> &listData);
113 
115  shared_ptr<WNTextInternal::ContentZones> parseContent(WNEntry const &entry);
116 
120  void sendZone(int id);
121 
123  bool send(WNEntry const &entry);
124 
126  bool send(std::vector<WNTextInternal::ContentZone> &listZones,
127  std::vector<shared_ptr<WNTextInternal::ContentZones> > &footnoteList,
129 
131  void setProperty(WNTextInternal::Paragraph const &ruler);
132 
133  //
134  // low level
135  //
136 
138  bool readFontNames(WNEntry const &entry);
139 
141  bool readFont(MWAWInputStream &input, bool inStyle, WNTextInternal::Font &font);
142 
145 
147  bool readToken(MWAWInputStream &input, WNTextInternal::Token &token);
148 
151 
154 
156  bool readStyles(WNEntry const &entry);
157 
158 private:
159  WNText(WNText const &orig);
160  WNText &operator=(WNText const &orig);
161 
162 protected:
163  //
164  // data
165  //
168 
170  shared_ptr<WNTextInternal::State> m_state;
171 
173  shared_ptr<WNEntryManager> m_entryManager;
174 
177 };
178 #endif
179 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:

Generated on Tue May 6 2014 09:50:49 for libmwaw by doxygen 1.8.3.1