WPS8Table.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* libwps
00003  * Version: MPL 2.0 / LGPLv2.1+
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Major Contributor(s):
00010  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
00011  * Copyright (C) 2006, 2007 Andrew Ziem
00012  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00013  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
00014  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
00015  *
00016  * For minor contributions see the git repository.
00017  *
00018  * Alternatively, the contents of this file may be used under the terms
00019  * of the GNU Lesser General Public License Version 2.1 or later
00020  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
00021  * applicable instead of those above.
00022  *
00023  * For further information visit http://libwps.sourceforge.net
00024  */
00025 
00026 #ifndef WPS8_TABLE
00027 #  define WPS8_TABLE
00028 
00029 #include "libwps_internal.h"
00030 
00031 #include "WPSDebug.h"
00032 
00033 class WPS8Parser;
00034 
00035 namespace WPS8TableInternal
00036 {
00037 struct Cell;
00038 struct State;
00039 }
00040 
00042 //
00043 // class to parse the object
00044 //
00046 
00057 class WPS8Table
00058 {
00059         friend struct WPS8TableInternal::Cell;
00060         friend class WPS8Parser;
00061 public:
00063         WPS8Table(WPS8Parser &parser);
00064 
00066         ~WPS8Table();
00067 
00069         void setListener(WPSContentListenerPtr &listen)
00070         {
00071                 m_listener = listen;
00072         }
00073 
00075         void computePositions() const;
00076 
00078         int numPages() const;
00079 
00081         void flushExtra();
00082 
00083 protected:
00085         bool readStructures(RVNGInputStreamPtr input);
00086 
00095         bool sendTable(Vec2f const &siz, int tableId, int strsid, bool inTextBox=false);
00096 
00097         // interface with main parser
00098         void sendTextInCell(int strsId, int cellId);
00099 
00100 protected: // low level
00101 
00103         bool readMCLD(RVNGInputStreamPtr input, WPSEntry const &entry);
00104 
00106         int version() const;
00107 
00109         libwps::DebugFile &ascii()
00110         {
00111                 return m_asciiFile;
00112         }
00113 private:
00114         WPS8Table(WPS8Table const &orig);
00115         WPS8Table &operator=(WPS8Table const &orig);
00116 
00117 protected:
00119         WPSContentListenerPtr m_listener;
00120 
00122         WPS8Parser &m_mainParser;
00123 
00125         mutable shared_ptr<WPS8TableInternal::State> m_state;
00126 
00128         libwps::DebugFile &m_asciiFile;
00129 };
00130 
00131 #endif
00132 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: