FWText.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 FullWrite text document
36  *
37  */
38 #ifndef FW_TEXT
39 # define FW_TEXT
40 
41 #include "libmwaw_internal.hxx"
42 
43 
44 #include "MWAWDebug.hxx"
45 
46 namespace FWTextInternal
47 {
48 struct Border;
49 struct Font;
50 struct Paragraph;
51 
52 struct LineHeader;
53 struct Zone;
54 
55 struct State;
56 }
57 
58 struct FWEntry;
59 struct FWEntryManager;
60 
61 class FWParser;
62 
68 class FWText
69 {
70  friend class FWParser;
71 public:
73  FWText(FWParser &parser);
75  virtual ~FWText();
76 
78  int version() const;
79 
81  int numPages() const;
82 
83 protected:
84 
86  void flushExtra();
87 
89  bool sendMainText();
90 
92  bool send(int zId);
93 
94  //
95  // intermediate level
96  //
97 
99  bool readTextData(shared_ptr<FWEntry> zone);
100 
102  bool send(shared_ptr<FWTextInternal::Zone> zone);
103 
105  void send(shared_ptr<FWTextInternal::Zone> zone, int numChar,
107  std::string &str);
108 
110  bool sendTable(shared_ptr<FWTextInternal::Zone> zone,
111  FWTextInternal::LineHeader const &lHeader,
113  std::string &str);
116 
118  void prepareData() {
119  sortZones();
121  }
122 
124  void sortZones();
126  void createItemStructures();
127 
128  //
129  // low level
130  //
131 
133  bool readLineHeader(shared_ptr<FWTextInternal::Zone> zone, FWTextInternal::LineHeader &lHeader);
134 
136  bool readItem(shared_ptr<FWEntry> zone, int id=-1, bool hidden=false);
137 
139  bool readParagraphTabs(shared_ptr<FWEntry> zone, int id=-1);
141  bool readParaModDocInfo(shared_ptr<FWEntry> zone);
142 
144  bool readBorderDocInfo(shared_ptr<FWEntry> zone);
146  bool readBorder(shared_ptr<FWEntry> zone, FWTextInternal::Border &border, int fSz);
147 
149  bool readDataMod(shared_ptr<FWEntry> zone, int id);
150 
152  bool readColumns(shared_ptr<FWEntry> zone);
153 
155  bool getColor(int color, MWAWColor &col) const;
156 
157 private:
158  FWText(FWText const &orig);
159  FWText &operator=(FWText const &orig);
160 
161 protected:
162  //
163  // data
164  //
167 
169  shared_ptr<FWTextInternal::State> m_state;
170 
173 };
174 #endif
175 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:

Generated on Mon Jul 1 2013 23:57:58 for libmwaw by doxygen 1.8.4