WriteNowText.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 WriteNow text document
*
*/
#ifndef WRITE_NOW_TEXT
# define WRITE_NOW_TEXT
#include <list>
#include <string>
#include <vector>
#include "libmwaw_internal.hxx"
#include "MWAWEntry.hxx"
#include "MWAWSubDocument.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
#include "MWAWParser.hxx"
namespace WriteNowTextInternal
{
struct ContentZone;
struct ContentZones;
struct Font;
struct Paragraph;
struct TableData;
struct Token;
struct Cell;
struct State;
}
struct WriteNowEntry;
struct WriteNowEntryManager;
class WriteNowParser;
class WriteNowText
{
friend class WriteNowParser;
friend struct WriteNowTextInternal::Cell;
public:
explicit WriteNowText(WriteNowParser &parser);
virtual ~WriteNowText();
int version() const;
int numPages() const;
WriteNowEntry getHeader() const;
WriteNowEntry getFooter() const;
protected:
bool createZones();
void flushExtra();
bool parseZone(WriteNowEntry const &entry, std::vector<WriteNowEntry> &listData);
std::shared_ptr<WriteNowTextInternal::ContentZones> parseContent(WriteNowEntry const &entry);
void sendZone(int id);
bool send(WriteNowEntry const &entry);
bool send(std::vector<WriteNowTextInternal::ContentZone> &listZones,
std::vector<std::shared_ptr<WriteNowTextInternal::ContentZones> > &footnoteList,
WriteNowTextInternal::Paragraph &ruler);
void setProperty(WriteNowTextInternal::Paragraph const &ruler);
//
// low level
//
bool readFontNames(WriteNowEntry const &entry);
bool readFont(MWAWInputStream &input, bool inStyle, WriteNowTextInternal::Font &font);
bool readParagraph(MWAWInputStream &input, WriteNowTextInternal::Paragraph &ruler);
bool readToken(MWAWInputStream &input, WriteNowTextInternal::Token &token);
bool readTokenV2(MWAWInputStream &input, WriteNowTextInternal::Token &token);
bool readTable(MWAWInputStream &input, WriteNowTextInternal::TableData &table);
bool readStyles(WriteNowEntry const &entry);
private:
WriteNowText(WriteNowText const &orig) = delete;
WriteNowText &operator=(WriteNowText const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<WriteNowTextInternal::State> m_state;
std::shared_ptr<WriteNowEntryManager> m_entryManager;
WriteNowParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWEntry.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWSubDocument.hxx
MWAWInputStream
Internal class used to read the file stream Internal class used to read the file stream,...
Definition MWAWInputStream.hxx:54
WriteNowParser
the main class to read a WriteNow file
Definition WriteNowParser.hxx:69
WriteNowText::createZones
bool createZones()
finds the different text zones
Definition WriteNowText.cxx:709
WriteNowText::operator=
WriteNowText & operator=(WriteNowText const &orig)=delete
WriteNowText::readFont
bool readFont(MWAWInputStream &input, bool inStyle, WriteNowTextInternal::Font &font)
read a font
Definition WriteNowText.cxx:1241
WriteNowText::readParagraph
bool readParagraph(MWAWInputStream &input, WriteNowTextInternal::Paragraph &ruler)
read a paragraph format
Definition WriteNowText.cxx:1331
WriteNowText::WriteNowText
WriteNowText(WriteNowText const &orig)=delete
WriteNowText::numPages
int numPages() const
returns the number of pages
Definition WriteNowText.cxx:670
WriteNowText::readFontNames
bool readFontNames(WriteNowEntry const &entry)
try to read the fonts zone
Definition WriteNowText.cxx:1118
WriteNowText::parseZone
bool parseZone(WriteNowEntry const &entry, std::vector< WriteNowEntry > &listData)
try to read the text zone ( list of entries ) and to create the text data zone
Definition WriteNowText.cxx:994
WriteNowText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition WriteNowText.hxx:167
WriteNowText::m_mainParser
WriteNowParser * m_mainParser
the main parser;
Definition WriteNowText.hxx:176
WriteNowText::m_entryManager
std::shared_ptr< WriteNowEntryManager > m_entryManager
the list of entry
Definition WriteNowText.hxx:173
WriteNowText::readStyles
bool readStyles(WriteNowEntry const &entry)
try to read the styles zone
Definition WriteNowText.cxx:1441
WriteNowText::getHeader
WriteNowEntry getHeader() const
returns the header entry (if defined)
Definition WriteNowText.cxx:689
WriteNowText::getFooter
WriteNowEntry getFooter() const
returns the footer entry (if defined)
Definition WriteNowText.cxx:696
WriteNowText::WriteNowText
WriteNowText(WriteNowParser &parser)
constructor
Definition WriteNowText.cxx:652
WriteNowText::parseContent
std::shared_ptr< WriteNowTextInternal::ContentZones > parseContent(WriteNowEntry const &entry)
parse a text data zone ( and create the associated structure )
Definition WriteNowText.cxx:837
WriteNowText::WriteNowParser
friend class WriteNowParser
Definition WriteNowText.hxx:83
WriteNowText::send
bool send(WriteNowEntry const &entry)
send the text to the listener
Definition WriteNowText.cxx:1748
WriteNowText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition WriteNowText.cxx:2088
WriteNowText::readTokenV2
bool readTokenV2(MWAWInputStream &input, WriteNowTextInternal::Token &token)
read a token (v2)
Definition WriteNowText.cxx:1660
WriteNowText::readTable
bool readTable(MWAWInputStream &input, WriteNowTextInternal::TableData &table)
read a table frame (checkme)
Definition WriteNowText.cxx:1703
WriteNowText::m_state
std::shared_ptr< WriteNowTextInternal::State > m_state
the state
Definition WriteNowText.hxx:170
WriteNowText::readToken
bool readToken(MWAWInputStream &input, WriteNowTextInternal::Token &token)
read a token
Definition WriteNowText.cxx:1626
WriteNowText::~WriteNowText
virtual ~WriteNowText()
destructor
Definition WriteNowText.cxx:660
WriteNowText::version
int version() const
returns the file version
Definition WriteNowText.cxx:663
WriteNowText::setProperty
void setProperty(WriteNowTextInternal::Paragraph const &ruler)
sends a paragraph property to the listener
Definition WriteNowText.cxx:1431
WriteNowText::sendZone
void sendZone(int id)
send all the content zone of a zone defined by id 0: main, 1 header/footer, 2: footnote
Definition WriteNowText.cxx:2051
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
WriteNowTextInternal
Internal: the structures of a WriteNowText.
Definition WriteNowText.cxx:59
WriteNowEntryManager
the manager of the entries
Definition WriteNowEntry.hxx:106
WriteNowEntry
class to store entry in a WriteNow document
Definition WriteNowEntry.hxx:48
WriteNowTextInternal::Cell
Internal: the cell of a WriteNowText.
Definition WriteNowText.cxx:497
WriteNowTextInternal::ContentZone
Internal: structure used to store the content structure.
Definition WriteNowText.cxx:347
WriteNowTextInternal::ContentZones
Internal: structure used to store the content structure.
Definition WriteNowText.cxx:455
WriteNowTextInternal::Font
Internal: the fonts.
Definition WriteNowText.cxx:62
WriteNowTextInternal::Paragraph
Internal: class to store the paragraph properties.
Definition WriteNowText.cxx:93
WriteNowTextInternal::State
Internal: the state of a WriteNowText.
Definition WriteNowText.cxx:557
WriteNowTextInternal::TableData
Internal: the table of a WriteNowText.
Definition WriteNowText.cxx:216
WriteNowTextInternal::Token
Internal: the token of a WriteNowText.
Definition WriteNowText.cxx:168