FWText.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 FullWrite text document
*
*/
#ifndef FW_TEXT
# define FW_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "FWStruct.hxx"
namespace FWTextInternal
{
struct Font;
struct Paragraph;
struct LineHeader;
struct Zone;
struct State;
}
class FWParser;
class FWText
{
friend class FWParser;
public:
FWText(FWParser &parser);
virtual ~FWText();
int version() const;
int numPages() const;
protected:
void flushExtra();
bool sendMainText();
bool send(int zId);
//
// intermediate level
//
bool readTextData(FWStruct::EntryPtr zone);
bool send(shared_ptr<FWTextInternal::Zone> zone);
void send(shared_ptr<FWTextInternal::Zone> zone, int numChar,
FWTextInternal::Font &font, FWTextInternal::Paragraph &ruler,
std::string &str);
bool sendTable(shared_ptr<FWTextInternal::Zone> zone,
FWTextInternal::LineHeader const &lHeader,
FWTextInternal::Font &font, FWTextInternal::Paragraph &ruler,
std::string &str);
bool sendHiddenItem(int id, FWTextInternal::Font &font, FWTextInternal::Paragraph &ruler);
void prepareData() {
sortZones();
createItemStructures();
}
void sortZones();
void createItemStructures();
//
// low level
//
bool readLineHeader(shared_ptr<FWTextInternal::Zone> zone, FWTextInternal::LineHeader &lHeader);
bool readItem(FWStruct::EntryPtr zone, int id=-1, bool hidden=false);
bool readParagraphTabs(FWStruct::EntryPtr zone, int id=-1);
bool readParaModDocInfo(FWStruct::EntryPtr zone);
bool readStyle(FWStruct::EntryPtr zone);
bool readDataMod(FWStruct::EntryPtr zone, int id);
bool readColumns(FWStruct::EntryPtr zone);
private:
FWText(FWText const &orig);
FWText &operator=(FWText const &orig);
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
shared_ptr<FWTextInternal::State> m_state;
FWParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
FWText::readStyle
bool readStyle(FWStruct::EntryPtr zone)
try to read a style
Definition: FWText.cxx:1956
FWText::readItem
bool readItem(FWStruct::EntryPtr zone, int id=-1, bool hidden=false)
check if the input of the zone points to a item zone in DataStruct Zone
Definition: FWText.cxx:1833
FWStruct::EntryPtr
shared_ptr< Entry > EntryPtr
Definition: FWStruct.hxx:135
FWText::sendTable
bool sendTable(shared_ptr< FWTextInternal::Zone > zone, FWTextInternal::LineHeader const &lHeader, FWTextInternal::Font &font, FWTextInternal::Paragraph &ruler, std::string &str)
try send a table row
Definition: FWText.cxx:1115
FWParser
the main class to read a FullWrite file
Definition: FWParser.hxx:66
FWStruct.hxx
libmwaw_internal.hxx
FWText::readParaModDocInfo
bool readParaModDocInfo(FWStruct::EntryPtr zone)
try to read the paragraph modifier (at the end of doc info)
Definition: FWText.cxx:2216
FWText::createItemStructures
void createItemStructures()
create the item structures
Definition: FWText.cxx:2419
FWText::sendHiddenItem
bool sendHiddenItem(int id, FWTextInternal::Font &font, FWTextInternal::Paragraph &ruler)
send a hidden item
Definition: FWText.cxx:1452
FWText::prepareData
void prepareData()
prepare the different data (called sortZones and createItemStructures)
Definition: FWText.hxx:116
FWText::m_state
shared_ptr< FWTextInternal::State > m_state
the state
Definition: FWText.hxx:162
FWText::version
int version() const
returns the file version
Definition: FWText.cxx:621
FWText::m_mainParser
FWParser * m_mainParser
the main parser;
Definition: FWText.hxx:165
FWTextInternal::Paragraph
Internal: class to store the paragraph properties.
Definition: FWText.cxx:415
FWText::sendMainText
bool sendMainText()
send a main zone
Definition: FWText.cxx:2332
FWText::FWText
FWText(FWParser &parser)
constructor
Definition: FWText.cxx:612
FWText::readTextData
bool readTextData(FWStruct::EntryPtr zone)
check if a zone is a text zone, if so read it...
Definition: FWText.cxx:1539
FWText::numPages
int numPages() const
returns the number of pages
Definition: FWText.cxx:628
FWText::sortZones
void sortZones()
sort the different zones, finding the main zone, ...
Definition: FWText.cxx:2376
FWText::operator=
FWText & operator=(FWText const &orig)
FWText
the main class to read the text part of writenow file
Definition: FWText.hxx:66
FWTextInternal::LineHeader
Internal: class to store the LineHeader.
Definition: FWText.cxx:235
FWText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition: FWText.hxx:159
MWAWDebug.hxx
FWText::~FWText
virtual ~FWText()
destructor
Definition: FWText.cxx:618
FWText::send
bool send(int zId)
send a id zone
Definition: FWText.cxx:2353
FWText::readDataMod
bool readDataMod(FWStruct::EntryPtr zone, int id)
try to read the font/paragraph modifier zone (Zone1f)
Definition: FWText.cxx:2180
MWAWParserStatePtr
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:342
FWText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition: FWText.cxx:2365
FWText::readLineHeader
bool readLineHeader(shared_ptr< FWTextInternal::Zone > zone, FWTextInternal::LineHeader &lHeader)
try to read the header of a line
Definition: FWText.cxx:1216
FWText::readColumns
bool readColumns(FWStruct::EntryPtr zone)
check if the input of the zone points to the columns definition, ...
Definition: FWText.cxx:2285
FWTextInternal::Font
Internal: class to store a font and it state.
Definition: FWText.cxx:185
FWText::readParagraphTabs
bool readParagraphTabs(FWStruct::EntryPtr zone, int id=-1)
check if the input of the zone points to a paragraph zone in DataStruct Zone
Definition: FWText.cxx:2008