FullWrtText.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 FULL_WRT_TEXT
# define FULL_WRT_TEXT
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "FullWrtStruct.hxx"
namespace FullWrtTextInternal
{
struct Font;
struct Paragraph;
struct LineHeader;
struct Zone;
struct State;
}
class FullWrtParser;
class FullWrtText
{
friend class FullWrtParser;
public:
explicit FullWrtText(FullWrtParser &parser);
virtual ~FullWrtText();
int version() const;
int numPages() const;
protected:
void flushExtra();
bool sendMainText();
int getHeaderFooterId(bool header, int page, int &numSimilar) const;
bool send(int zId, MWAWColor fontColor=MWAWColor::black());
//
// intermediate level
//
bool readTextData(FullWrtStruct::EntryPtr zone);
bool send(std::shared_ptr<FullWrtTextInternal::Zone> zone, MWAWColor fontColor=MWAWColor::black());
void send(std::shared_ptr<FullWrtTextInternal::Zone> zone, int numChar,
FullWrtTextInternal::Font &font, FullWrtTextInternal::Paragraph &ruler,
std::string &str);
bool sendTable(std::shared_ptr<FullWrtTextInternal::Zone> zone,
FullWrtTextInternal::LineHeader const &lHeader,
FullWrtTextInternal::Font &font, FullWrtTextInternal::Paragraph &ruler,
std::string &str);
bool sendHiddenItem(int id, FullWrtTextInternal::Font &font, FullWrtTextInternal::Paragraph &ruler);
void prepareData()
{
sortZones();
createItemStructures();
}
void sortZones();
void createItemStructures();
//
// low level
//
bool readLineHeader(std::shared_ptr<FullWrtTextInternal::Zone> zone, FullWrtTextInternal::LineHeader &lHeader);
bool readItem(FullWrtStruct::EntryPtr zone, int id=-1, bool hidden=false);
bool readParagraphTabs(FullWrtStruct::EntryPtr zone, int id=-1);
bool readParaModDocInfo(FullWrtStruct::EntryPtr zone);
bool readStyle(FullWrtStruct::EntryPtr zone);
bool readDataMod(FullWrtStruct::EntryPtr zone, int id);
bool readColumns(FullWrtStruct::EntryPtr zone);
private:
FullWrtText(FullWrtText const &orig) = delete;
FullWrtText &operator=(FullWrtText const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<FullWrtTextInternal::State> m_state;
FullWrtParser *m_mainParser;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
FullWrtStruct.hxx
MWAWDebug.hxx
FullWrtParser
the main class to read a FullWrite file
Definition FullWrtParser.hxx:67
FullWrtText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition FullWrtText.cxx:2497
FullWrtText::sendHiddenItem
bool sendHiddenItem(int id, FullWrtTextInternal::Font &font, FullWrtTextInternal::Paragraph &ruler)
send a hidden item
Definition FullWrtText.cxx:1556
FullWrtText::m_state
std::shared_ptr< FullWrtTextInternal::State > m_state
the state
Definition FullWrtText.hxx:165
FullWrtText::FullWrtText
FullWrtText(FullWrtText const &orig)=delete
FullWrtText::prepareData
void prepareData()
prepare the different data (called sortZones and createItemStructures)
Definition FullWrtText.hxx:118
FullWrtText::FullWrtParser
friend class FullWrtParser
Definition FullWrtText.hxx:68
FullWrtText::readParagraphTabs
bool readParagraphTabs(FullWrtStruct::EntryPtr zone, int id=-1)
check if the input of the zone points to a paragraph zone in DataStruct Zone
Definition FullWrtText.cxx:2115
FullWrtText::readItem
bool readItem(FullWrtStruct::EntryPtr zone, int id=-1, bool hidden=false)
check if the input of the zone points to a item zone in DataStruct Zone
Definition FullWrtText.cxx:1936
FullWrtText::version
int version() const
returns the file version
Definition FullWrtText.cxx:719
FullWrtText::readTextData
bool readTextData(FullWrtStruct::EntryPtr zone)
check if a zone is a text zone, if so read it...
Definition FullWrtText.cxx:1643
FullWrtText::operator=
FullWrtText & operator=(FullWrtText const &orig)=delete
FullWrtText::numPages
int numPages() const
returns the number of pages
Definition FullWrtText.cxx:726
FullWrtText::createItemStructures
void createItemStructures()
create the item structures
Definition FullWrtText.cxx:2549
FullWrtText::readStyle
bool readStyle(FullWrtStruct::EntryPtr zone)
try to read a style
Definition FullWrtText.cxx:2063
FullWrtText::sendTable
bool sendTable(std::shared_ptr< FullWrtTextInternal::Zone > zone, FullWrtTextInternal::LineHeader const &lHeader, FullWrtTextInternal::Font &font, FullWrtTextInternal::Paragraph &ruler, std::string &str)
try send a table row
Definition FullWrtText.cxx:1214
FullWrtText::readParaModDocInfo
bool readParaModDocInfo(FullWrtStruct::EntryPtr zone)
try to read the paragraph modifier (at the end of doc info)
Definition FullWrtText.cxx:2323
FullWrtText::sendMainText
bool sendMainText()
send a main zone
Definition FullWrtText.cxx:2439
FullWrtText::readDataMod
bool readDataMod(FullWrtStruct::EntryPtr zone, int id)
try to read the font/paragraph modifier zone (Zone1f)
Definition FullWrtText.cxx:2288
FullWrtText::readColumns
bool readColumns(FullWrtStruct::EntryPtr zone)
check if the input of the zone points to the columns definition, ...
Definition FullWrtText.cxx:2392
FullWrtText::readLineHeader
bool readLineHeader(std::shared_ptr< FullWrtTextInternal::Zone > zone, FullWrtTextInternal::LineHeader &lHeader)
try to read the header of a line
Definition FullWrtText.cxx:1317
FullWrtText::send
bool send(int zId, MWAWColor fontColor=MWAWColor::black())
send a id zone
Definition FullWrtText.cxx:2486
FullWrtText::sortZones
void sortZones()
sort the different zones, finding the main zone, ...
Definition FullWrtText.cxx:2507
FullWrtText::FullWrtText
FullWrtText(FullWrtParser &parser)
constructor
Definition FullWrtText.cxx:708
FullWrtText::m_mainParser
FullWrtParser * m_mainParser
the main parser;
Definition FullWrtText.hxx:168
FullWrtText::~FullWrtText
virtual ~FullWrtText()
destructor
Definition FullWrtText.cxx:715
FullWrtText::getHeaderFooterId
int getHeaderFooterId(bool header, int page, int &numSimilar) const
return the header/footer blockid ( or -1)
Definition FullWrtText.cxx:2458
FullWrtText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition FullWrtText.hxx:162
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
FullWrtStruct::EntryPtr
std::shared_ptr< Entry > EntryPtr
Definition FullWrtStruct.hxx:153
FullWrtTextInternal
Internal: the structures of a FullWrtText.
Definition FullWrtText.cxx:60
FullWrtTextInternal::Font
Internal: class to store a font and it state.
Definition FullWrtText.cxx:210
FullWrtTextInternal::LineHeader
Internal: class to store the LineHeader.
Definition FullWrtText.cxx:267
FullWrtTextInternal::Paragraph
Internal: class to store the paragraph properties.
Definition FullWrtText.cxx:476
FullWrtTextInternal::State
Internal: the state of a FullWrtText.
Definition FullWrtText.cxx:669
FullWrtTextInternal::Zone
Internal: class to store a text zone.
Definition FullWrtText.cxx:387
MWAWColor
the class to store a color
Definition libmwaw_internal.hxx:192
MWAWColor::black
static MWAWColor black()
return the back color
Definition libmwaw_internal.hxx:245