ClarisDrawText.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 ClarisDraw text part
*
*/
#ifndef CLARIS_DRAW_TEXT
# define CLARIS_DRAW_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"
#include "ClarisWksStruct.hxx"
namespace ClarisDrawTextInternal
{
struct Paragraph;
struct DSET;
struct State;
}
class ClarisDrawStyleManager;
class ClarisDrawParser;
class ClarisDrawText
{
friend class ClarisDrawParser;
public:
explicit ClarisDrawText(ClarisDrawParser &parser);
virtual ~ClarisDrawText();
int version() const;
void resetState();
int numPages() const;
std::shared_ptr<ClarisWksStruct::DSET> readDSETZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry);
protected:
bool sendZone(int number, int subZone=-1);
void flushExtra();
//
// low level
//
bool readFont(int id, int &posC, MWAWFont &font);
bool readParagraphs();
bool readParagraph(int id=-1);
bool readParagraphs(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone);
bool readFonts(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone);
bool readTokens(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone);
bool readTextZoneSize(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone);
bool sendText(ClarisDrawTextInternal::DSET const &zone, int subZone);
private:
ClarisDrawText(ClarisDrawText const &orig) = delete;
ClarisDrawText &operator=(ClarisDrawText const &orig) = delete;
protected:
//
// data
//
MWAWParserStatePtr m_parserState;
std::shared_ptr<ClarisDrawTextInternal::State> m_state;
ClarisDrawParser *m_mainParser;
std::shared_ptr<ClarisDrawStyleManager> m_styleManager;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
ClarisWksStruct.hxx
MWAWDebug.hxx
MWAWEntry.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWSubDocument.hxx
ClarisDrawParser
the main class to read a ClarisDraw v1 file
Definition ClarisDrawParser.hxx:64
ClarisDrawStyleManager
the main class to read a ClarisDraw style
Definition ClarisDrawStyleManager.hxx:60
ClarisDrawText::ClarisDrawText
ClarisDrawText(ClarisDrawParser &parser)
constructor
Definition ClarisDrawText.cxx:483
ClarisDrawText::resetState
void resetState()
resets the current state
Definition ClarisDrawText.cxx:501
ClarisDrawText::ClarisDrawParser
friend class ClarisDrawParser
Definition ClarisDrawText.hxx:74
ClarisDrawText::readParagraph
bool readParagraph(int id=-1)
the definition of ruler : present at the beginning of the text in the first version of Claris Works :...
Definition ClarisDrawText.cxx:927
ClarisDrawText::~ClarisDrawText
virtual ~ClarisDrawText()
destructor
Definition ClarisDrawText.cxx:491
ClarisDrawText::m_state
std::shared_ptr< ClarisDrawTextInternal::State > m_state
the state
Definition ClarisDrawText.hxx:139
ClarisDrawText::ClarisDrawText
ClarisDrawText(ClarisDrawText const &orig)=delete
ClarisDrawText::readFont
bool readFont(int id, int &posC, MWAWFont &font)
try to read a font
Definition ClarisDrawText.cxx:788
ClarisDrawText::readParagraphs
bool readParagraphs()
read the rulers block which is present at the beginning of the text
Definition ClarisDrawText.cxx:853
ClarisDrawText::m_mainParser
ClarisDrawParser * m_mainParser
the main parser;
Definition ClarisDrawText.hxx:142
ClarisDrawText::flushExtra
void flushExtra()
sends the data which have not yet been sent to the listener
Definition ClarisDrawText.cxx:1456
ClarisDrawText::readTokens
bool readTokens(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone)
try to the token zone)
Definition ClarisDrawText.cxx:1065
ClarisDrawText::operator=
ClarisDrawText & operator=(ClarisDrawText const &orig)=delete
ClarisDrawText::numPages
int numPages() const
returns the number of pages
Definition ClarisDrawText.cxx:506
ClarisDrawText::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition ClarisDrawText.hxx:136
ClarisDrawText::sendZone
bool sendZone(int number, int subZone=-1)
sends the zone data
Definition ClarisDrawText.cxx:1445
ClarisDrawText::readTextZoneSize
bool readTextZoneSize(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone)
try to read the text zone size
Definition ClarisDrawText.cxx:1168
ClarisDrawText::m_styleManager
std::shared_ptr< ClarisDrawStyleManager > m_styleManager
the style manager
Definition ClarisDrawText.hxx:144
ClarisDrawText::version
int version() const
returns the file version
Definition ClarisDrawText.cxx:494
ClarisDrawText::readFonts
bool readFonts(MWAWEntry const &entry, ClarisDrawTextInternal::DSET &zone)
try to read a font sequence
Definition ClarisDrawText.cxx:760
ClarisDrawText::sendText
bool sendText(ClarisDrawTextInternal::DSET const &zone, int subZone)
send the text zone to the listener
Definition ClarisDrawText.cxx:1214
ClarisDrawText::readDSETZone
std::shared_ptr< ClarisWksStruct::DSET > readDSETZone(ClarisWksStruct::DSET const &zone, MWAWEntry const &entry)
reads the zone Text DSET
Definition ClarisDrawText.cxx:519
MWAWEntry
basic class to store an entry in a file This contained :
Definition MWAWEntry.hxx:47
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
libmwaw_internal.hxx
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
ClarisDrawTextInternal
Internal: the structures of a ClarisDrawText.
Definition ClarisDrawText.cxx:58
ClarisDrawTextInternal::DSET
low level internal: main text zone
Definition ClarisDrawText.cxx:400
ClarisDrawTextInternal::Paragraph
Internal: class to store the paragraph properties.
Definition ClarisDrawText.cxx:113
ClarisDrawTextInternal::State
Internal: the state of a ClarisDrawText.
Definition ClarisDrawText.cxx:461
ClarisWksStruct::DSET
main structure which correspond to a document part
Definition ClarisWksStruct.hxx:87