ZWText.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* Parser to ZWrite document
*
*/
#ifndef ZW_TEXT
# define ZW_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
namespace ZWTextInternal
{
struct Section;
struct State;
class SubDocument;
}
class ZWParser;
class ZWText
{
friend class ZWParser;
friend class ZWTextInternal::SubDocument;
public:
ZWText(ZWParser &parser);
virtual ~ZWText();
int version() const;
int numPages() const;
protected:
enum TextCode { None, Center, BookMark, NewPage, Tag, Link };
bool createZones();
bool sendMainText();
void flushExtra();
//
// intermediate level
//
void computePositions();
bool sendText(ZWTextInternal::Section const &zone, MWAWEntry const &entry);
bool sendText(int sectionId, MWAWEntry const &entry);
TextCode isTextCode(MWAWInputStreamPtr &input, long endPos, MWAWEntry &dPos) const;
bool readHFZone(MWAWEntry const &entry);
bool hasHeaderFooter(bool header) const;
bool sendHeaderFooter(bool header);
bool readStyles(MWAWEntry const &entry);
bool readSectionFonts(MWAWEntry const &entry);
private:
ZWText(ZWText const &orig);
ZWText &operator=(ZWText const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<ZWTextInternal::State> m_state;
ZWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
ZWText::m_state
shared_ptr< ZWTextInternal::State > m_state
the state
Definition: ZWText.hxx:126
ZWText::BookMark
Definition: ZWText.hxx:76
ZWText::sendMainText
bool sendMainText()
send a main zone
Definition: ZWText.cxx:540
ZWText::readStyles
bool readStyles(MWAWEntry const &entry)
read the styles
Definition: ZWText.cxx:629
ZWText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: ZWText.hxx:123
ZWText::TextCode
TextCode
the list of code in the text
Definition: ZWText.hxx:76
libmwaw_internal.hxx
ZWText::isTextCode
TextCode isTextCode(MWAWInputStreamPtr &input, long endPos, MWAWEntry &dPos) const
check if a character after '<' corresponds to a text code
Definition: ZWText.cxx:354
ZWText::~ZWText
virtual ~ZWText()
destructor
Definition: ZWText.cxx:235
ZWText::NewPage
Definition: ZWText.hxx:76
ZWText::operator=
ZWText & operator=(ZWText const &orig)
ZWText::None
Definition: ZWText.hxx:76
ZWText::computePositions
void computePositions()
compute the positions
Definition: ZWText.cxx:259
ZWParser
the main class to read a ZWrite file
Definition: ZWParser.hxx:80
ZWTextInternal::SubDocument
Internal: the subdocument of a ZWText.
Definition: ZWText.cxx:164
ZWText::hasHeaderFooter
bool hasHeaderFooter(bool header) const
returns true if there is a header/footer
Definition: ZWText.cxx:253
ZWText::ZWText
ZWText(ZWParser &parser)
constructor
Definition: ZWText.cxx:230
ZWText::version
int version() const
returns the file version
Definition: ZWText.cxx:238
ZWText::numPages
int numPages() const
returns the number of pages
Definition: ZWText.cxx:245
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
ZWText
the main class to read the text part of ZWrite Text file
Definition: ZWText.hxx:58
ZWText::readSectionFonts
bool readSectionFonts(MWAWEntry const &entry)
read a section fonts
Definition: ZWText.cxx:558
MWAWDebug.hxx
ZWText::m_mainParser
ZWParser * m_mainParser
the main parser;
Definition: ZWText.hxx:129
ZWText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: ZWText.cxx:920
ZWText::readHFZone
bool readHFZone(MWAWEntry const &entry)
read the header/footer zone
Definition: ZWText.cxx:791
ZWText::Link
Definition: ZWText.hxx:76
ZWText::Center
Definition: ZWText.hxx:76
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
ZWText::createZones
bool createZones()
finds the different text zones
Definition: ZWText.cxx:294
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
ZWText::sendHeaderFooter
bool sendHeaderFooter(bool header)
try to send the header/footer
Definition: ZWText.cxx:726
ZWText::Tag
Definition: ZWText.hxx:76
ZWText::sendText
bool sendText(ZWTextInternal::Section const &zone, MWAWEntry const &entry)
try to send a section
Definition: ZWText.cxx:414
ZWTextInternal::Section
Internal: struct used to store a section of a ZWText.
Definition: ZWText.cxx:117