WPS8Table.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) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 #ifndef WPS8_TABLE
27 # define WPS8_TABLE
28 
29 #include "libwps_internal.h"
30 
31 #include "WPSDebug.h"
32 
33 class WPSEntry;
34 class WPS8Parser;
35 class WPSPosition;
36 
38 typedef shared_ptr<WPS8ContentListener> WPS8ContentListenerPtr;
39 
40 namespace WPS8TableInternal
41 {
42 struct Cell;
43 struct State;
44 }
45 
47 //
48 // class to parse the object
49 //
51 
62 class WPS8Table
63 {
64  friend struct WPS8TableInternal::Cell;
65  friend class WPS8Parser;
66 public:
68  WPS8Table(WPS8Parser &parser);
69 
71  ~WPS8Table();
72 
75  {
76  m_listener = listen;
77  }
78 
80  void computePositions() const;
81 
83  int numPages() const;
84 
86  void flushExtra();
87 
88 protected:
91 
100  bool sendTable(Vec2f const &siz, int tableId, int strsid, bool inTextBox=false);
101 
102  // interface with main parser
103  void sendTextInCell(int strsId, int cellId);
104 
105 protected: // low level
106 
108  bool readMCLD(WPXInputStreamPtr input, WPSEntry const &entry);
109 
111  int version() const;
112 
115  {
116  return m_asciiFile;
117  }
118 private:
119  WPS8Table(WPS8Table const &orig);
120  WPS8Table &operator=(WPS8Table const &orig);
121 
122 protected:
125 
128 
130  mutable shared_ptr<WPS8TableInternal::State> m_state;
131 
134 };
135 
136 #endif
137 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
WPS8Table(WPS8Parser &parser)
constructor
Definition: WPS8Table.cpp:184
This class parses Works version 2000 through 8.
Definition: WPS8.h:53
shared_ptr< WPXInputStream > WPXInputStreamPtr
Definition: libwps_internal.h:74
Definition: WPSDebug.h:198
the main class to read/store table in a Pc MS Works document v5-8
Definition: WPS8Table.h:62
WPS8ContentListenerPtr m_listener
the listener
Definition: WPS8Table.h:124
Internal: class to store a basic cell with borders.
Definition: WPS8Table.cpp:47
WPS8Table & operator=(WPS8Table const &orig)
Definition: WPSContentListener.h:168
int numPages() const
returns the number page where we find a picture. In practice, 0/1
Definition: WPS8Table.cpp:204
bool readMCLD(WPXInputStreamPtr input, WPSEntry const &entry)
reads a MCLD zone: a zone which stores the tables structures
Definition: WPS8Table.cpp:317
libwps::DebugFile & ascii()
returns the debug file
Definition: WPS8Table.h:114
void sendTextInCell(int strsId, int cellId)
Definition: WPS8Table.cpp:209
WPS8Parser & m_mainParser
the main parser
Definition: WPS8Table.h:127
void computePositions() const
computes the final position of all table: does nothing as table anchors seem always a char ...
Definition: WPS8Table.cpp:217
shared_ptr< WPS8ContentListener > WPS8ContentListenerPtr
Definition: WPS8Graph.h:43
~WPS8Table()
destructor
Definition: WPS8Table.cpp:190
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WPS8Table.h:133
void setListener(WPS8ContentListenerPtr &listen)
sets the listener
Definition: WPS8Table.h:74
int version() const
returns the file version
Definition: WPS8Table.cpp:197
bool readStructures(WPXInputStreamPtr input)
finds all structures which correspond to a table
Definition: WPS8Table.cpp:294
void flushExtra()
sends the data which have not been send to the listener.
Definition: WPS8Table.cpp:222
bool sendTable(Vec2f const &siz, int tableId, int strsid, bool inTextBox=false)
tries to send a table corresponding to strsid with actual size siz
Definition: WPS8Table.cpp:242
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:37
shared_ptr< WPS8TableInternal::State > m_state
the state
Definition: WPS8Table.h:130
Class to define the position of an object (textbox, picture, ..) in the document. ...
Definition: WPSPosition.h:39

Generated on Wed Jun 11 2014 02:26:01 for libwps by doxygen 1.8.5