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) 2006, 2007 Andrew Ziem 00011 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca) 00012 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net) 00013 * 00014 * For minor contributions see the git repository. 00015 * 00016 * Alternatively, the contents of this file may be used under the terms 00017 * of the GNU Lesser General Public License Version 2.1 or later 00018 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are 00019 * applicable instead of those above. 00020 */ 00021 00022 #ifndef LOTUS_GRAPH_H 00023 #define LOTUS_GRAPH_H 00024 00025 #include <ostream> 00026 #include <vector> 00027 00028 #include <librevenge-stream/librevenge-stream.h> 00029 00030 #include "libwps_internal.h" 00031 00032 #include "WPSDebug.h" 00033 #include "WKSContentListener.h" 00034 00035 namespace LotusGraphInternal 00036 { 00037 struct Zone; 00038 struct State; 00039 00040 class SubDocument; 00041 } 00042 00043 class LotusParser; 00044 class LotusStyleManager; 00045 00050 class LotusGraph 00051 { 00052 public: 00053 friend class LotusParser; 00054 friend class LotusGraphInternal::SubDocument; 00055 00057 LotusGraph(LotusParser &parser); 00059 ~LotusGraph(); 00061 void cleanState(); 00063 void setListener(WKSContentListenerPtr &listen) 00064 { 00065 m_listener = listen; 00066 } 00067 protected: 00069 bool checkFilePosition(long pos); 00071 int version() const; 00072 00074 bool hasGraphics(int sheetId) const; 00076 void sendGraphics(int sheetId); 00078 void sendPicture(LotusGraphInternal::Zone const &zone); 00080 void sendTextBox(WPSEntry const &entry); 00081 00082 // 00083 // low level 00084 // 00085 00086 // ////////////////////// zone ////////////////////////////// 00087 00089 bool readZoneBegin(long endPos); 00091 bool readZoneData(long endPos, int type); 00093 bool readTextBoxData(long endPos); 00095 bool readPictureDefinition(long endPos); 00097 bool readPictureData(long endPos); 00098 00099 private: 00100 LotusGraph(LotusGraph const &orig); 00101 LotusGraph &operator=(LotusGraph const &orig); 00103 libwps::DebugFile &ascii() 00104 { 00105 return m_asciiFile; 00106 } 00108 RVNGInputStreamPtr m_input; 00109 shared_ptr<WKSContentListener> m_listener; 00110 00111 LotusParser &m_mainParser; 00113 shared_ptr<LotusStyleManager> m_styleManager; 00115 shared_ptr<LotusGraphInternal::State> m_state; 00117 libwps::DebugFile &m_asciiFile; 00118 }; 00119 00120 #endif /* LOTUS_GRAPH_H */ 00121 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */