WPSSubDocument.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  * Copyright (C) 2006, 2007 Andrew Ziem
00004  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
00005  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
00020  *
00021  * For further information visit http://libwpd.sourceforge.net
00022  */
00023 
00024 /* "This product is not manufactured, approved, or supported by
00025  * Corel Corporation or Corel Corporation Limited."
00026  */
00027 
00028 #ifndef WPSSUBDOCUMENT_H
00029 #define WPSSUBDOCUMENT_H
00030 
00031 #include "libwps_internal.h"
00032 
00033 class WPSContentListener;
00034 class WPSParser;
00035 
00037 class WPSSubDocument
00038 {
00039 public:
00041         WPSSubDocument(WPXInputStreamPtr &input, WPSParser *parser, int id=0);
00043         virtual ~WPSSubDocument();
00044 
00046         WPXInputStreamPtr &getInput()
00047         {
00048                 return m_input;
00049         }
00051         WPSParser *parser() const
00052         {
00053                 return m_parser;
00054         }
00056         int id() const
00057         {
00058                 return m_id;
00059         }
00061         void setId(int i)
00062         {
00063                 m_id = i;
00064         }
00065 
00067         virtual bool operator==(shared_ptr<WPSSubDocument> const &doc) const;
00068         bool operator!=(shared_ptr<WPSSubDocument> const &doc) const
00069         {
00070                 return !operator==(doc);
00071         }
00072 
00076         virtual void parse(shared_ptr<WPSContentListener> &listener, libwps::SubDocumentType subDocumentType) = 0;
00077 
00078 protected:
00079         WPXInputStreamPtr m_input;
00080         WPSParser *m_parser;
00081         int m_id;
00082 private:
00083         WPSSubDocument(const WPSSubDocument &);
00084         WPSSubDocument &operator=(const WPSSubDocument &);
00085 
00086 };
00087 
00088 typedef shared_ptr<WPSSubDocument> WPSSubDocumentPtr;
00089 #endif
00090 
00091 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
00092