GWText.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 GreatWorks document
*
*/
#ifndef GW_TEXT
# define GW_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
namespace GWTextInternal
{
struct State;
struct Token;
struct Zone;
}
class GWParser;
class GWText
{
friend class GWParser;
public:
GWText(GWParser &parser);
virtual ~GWText();
int version() const;
int numPages() const;
protected:
bool createZones(int expectedHF);
bool sendMainText();
int numHFZones() const;
bool sendHF(int id);
bool sendTextbox(MWAWEntry const &entry);
void flushExtra();
//
// intermediate level
//
bool readFontNames();
bool readZone(GWTextInternal::Zone &zone);
bool readZonePositions(GWTextInternal::Zone &zone);
bool sendZone(GWTextInternal::Zone const &zone);
bool sendSimpleTextbox(MWAWEntry const &entry);
bool readFont(MWAWFont &font);
bool readRuler(MWAWParagraph &para);
bool readToken(GWTextInternal::Token &token, long &nChar);
bool findNextZone();
private:
GWText(GWText const &orig);
GWText &operator=(GWText const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<GWTextInternal::State> m_state;
GWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
GWText::numPages
int numPages() const
returns the number of pages
Definition: GWText.cxx:418
GWText::sendSimpleTextbox
bool sendSimpleTextbox(MWAWEntry const &entry)
try to send simplified textbox zone
Definition: GWText.cxx:1137
GWText::readFontNames
bool readFontNames()
try to read the font names zone
Definition: GWText.cxx:818
libmwaw_internal.hxx
GWTextInternal::Token
Internal and low level: structure which stores a token for GWText.
Definition: GWText.cxx:104
GWText::findNextZone
bool findNextZone()
heuristic function used to find the next zone
Definition: GWText.cxx:525
GWText::m_mainParser
GWParser * m_mainParser
the main parser;
Definition: GWText.hxx:126
GWText::numHFZones
int numHFZones() const
return the number of header/footer zones
Definition: GWText.cxx:436
GWText::GWText
GWText(GWParser &parser)
constructor
Definition: GWText.cxx:403
GWText::readZone
bool readZone(GWTextInternal::Zone &zone)
try to read a zone ( textheader+fonts+rulers)
Definition: GWText.cxx:594
GWText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: GWText.hxx:120
GWText::sendZone
bool sendZone(GWTextInternal::Zone const &zone)
try to send a zone
Definition: GWText.cxx:1289
GWText
the main class to read the text part of GreatWorks Text file
Definition: GWText.hxx:58
GWText::readZonePositions
bool readZonePositions(GWTextInternal::Zone &zone)
try to read the end of a zone ( line + frame position )
Definition: GWText.cxx:746
GWText::sendHF
bool sendHF(int id)
try to send the i^th header/footer
Definition: GWText.cxx:1109
GWText::readToken
bool readToken(GWTextInternal::Token &token, long &nChar)
try to read a token
Definition: GWText.cxx:1062
GWText::sendMainText
bool sendMainText()
send a main zone
Definition: GWText.cxx:1098
GWText::createZones
bool createZones(int expectedHF)
finds the different objects zones
Definition: GWText.cxx:471
GWText::operator=
GWText & operator=(GWText const &orig)
GWText::readRuler
bool readRuler(MWAWParagraph &para)
try to read a ruler
Definition: GWText.cxx:942
MWAWDebug.hxx
MWAWParagraph
class to store the paragraph properties
Definition: MWAWParagraph.hxx:83
GWText::version
int version() const
returns the file version
Definition: GWText.cxx:411
GWText::sendTextbox
bool sendTextbox(MWAWEntry const &entry)
try to send the textbox text
Definition: GWText.cxx:448
GWText::m_state
shared_ptr< GWTextInternal::State > m_state
the state
Definition: GWText.hxx:123
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
GWParser
the main class to read a GreatWorks text file
Definition: GWParser.hxx:57
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
GWText::readFont
bool readFont(MWAWFont &font)
try to read a font
Definition: GWText.cxx:885
GWText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: GWText.cxx:1122
GWText::~GWText
virtual ~GWText()
destructor
Definition: GWText.cxx:408
GWTextInternal::Zone
Internal and low level: structure which stores a text zone header for GWText.
Definition: GWText.cxx:286