MRWText.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 Mariner Write text document
*
*/
#ifndef MRW_TEXT
# define MRW_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
namespace MRWTextInternal
{
struct Paragraph;
struct State;
struct Table;
struct Zone;
}
struct MRWEntry;
class MRWParser;
class MRWText
{
friend class MRWParser;
public:
MRWText(MRWParser &parser);
virtual ~MRWText();
int version() const;
int numPages() const;
protected:
void setProperty(MRWTextInternal::Paragraph const &ruler);
void flushExtra();
//
// intermediate level
//
bool send(int zoneId);
bool send(MRWTextInternal::Zone const &zone, MWAWEntry const &entry);
bool findTableStructure(MRWTextInternal::Table &table, MWAWEntry const &entry);
bool sendTable(MRWTextInternal::Table &table);
bool readTextStruct(MRWEntry const &entry, int zoneId);
bool readZone(MRWEntry const &entry, int zoneId);
int computeNumPages(MRWTextInternal::Zone const &zone) const;
bool readFonts(MRWEntry const &entry, int zoneId);
bool readFontNames(MRWEntry const &entry, int zoneId);
bool readRulers(MRWEntry const &entry, int zoneId);
bool readPLCZone(MRWEntry const &entry, int zoneId);
bool readStyleNames(MRWEntry const &entry, int zoneId);
private:
MRWText(MRWText const &orig);
MRWText &operator=(MRWText const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<MRWTextInternal::State> m_state;
MRWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MRWTextInternal::Table
Internal: struct used to store the table of a MRWText.
Definition: MRWText.cxx:417
MRWText::~MRWText
virtual ~MRWText()
destructor
Definition: MRWText.cxx:499
MRWParser
the main class to read a Mariner Write file
Definition: MRWParser.hxx:121
MRWText::send
bool send(int zoneId)
try to send a zone (knowing zoneId)
Definition: MRWText.cxx:704
libmwaw_internal.hxx
MRWText::MRWText
MRWText(MRWParser &parser)
constructor
Definition: MRWText.cxx:494
MRWText::readPLCZone
bool readPLCZone(MRWEntry const &entry, int zoneId)
try to read a PLC zone: position in text to char(zone 4) or ruler(zone 5) id
Definition: MRWText.cxx:1051
MRWText::computeNumPages
int computeNumPages(MRWTextInternal::Zone const &zone) const
try to compute the number of pages of a zone, returns 0 if not data
Definition: MRWText.cxx:577
MRWText::version
int version() const
returns the file version
Definition: MRWText.cxx:503
MRWText::m_mainParser
MRWParser * m_mainParser
the main parser;
Definition: MRWText.hxx:130
MRWText::readRulers
bool readRulers(MRWEntry const &entry, int zoneId)
try to read a ruler zone
Definition: MRWText.cxx:1516
MRWText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: MRWText.hxx:124
MRWText::findTableStructure
bool findTableStructure(MRWTextInternal::Table &table, MWAWEntry const &entry)
try to find the table structure beginning in actual position
Definition: MRWText.cxx:978
MRWText::sendTable
bool sendTable(MRWTextInternal::Table &table)
try to send a table
Definition: MRWText.cxx:923
MRWEntry
a entry to store a zone structure
Definition: MRWParser.hxx:64
MRWTextInternal::Zone
Internal: struct used to store zone data of a MRWText.
Definition: MRWText.cxx:325
MRWText::readFontNames
bool readFontNames(MRWEntry const &entry, int zoneId)
try to read a font name zone
Definition: MRWText.cxx:1104
MRWText::readTextStruct
bool readTextStruct(MRWEntry const &entry, int zoneId)
try to read the text struct
Definition: MRWText.cxx:598
MRWText::m_state
shared_ptr< MRWTextInternal::State > m_state
the state
Definition: MRWText.hxx:127
MWAWDebug.hxx
MRWText::readZone
bool readZone(MRWEntry const &entry, int zoneId)
try to read a text zone
Definition: MRWText.cxx:532
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
MRWText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: MRWText.cxx:1951
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
MRWText
the main class to read the text part of Mariner Write file
Definition: MRWText.hxx:60
MRWText::numPages
int numPages() const
returns the number of pages
Definition: MRWText.cxx:510
MRWText::operator=
MRWText & operator=(MRWText const &orig)
MRWTextInternal::Paragraph
Internal: struct used to store the paragraph of a MRWText.
Definition: MRWText.cxx:92
MRWText::readStyleNames
bool readStyleNames(MRWEntry const &entry, int zoneId)
try to read a style name zone
Definition: MRWText.cxx:1450
MRWText::setProperty
void setProperty(MRWTextInternal::Paragraph const &ruler)
sends a paragraph property to the listener
Definition: MRWText.cxx:1510
MRWText::readFonts
bool readFonts(MRWEntry const &entry, int zoneId)
try to read a font zone
Definition: MRWText.cxx:1187