RagTimeText.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 /*
35  * Parser to RagTime text document
36  *
37  */
38 #ifndef RAGTIME_TEXT
39 # define RAGTIME_TEXT
40 
41 #include <list>
42 #include <string>
43 #include <vector>
44 
45 #include "libmwaw_internal.hxx"
46 
47 #include "MWAWEntry.hxx"
48 #include "MWAWSubDocument.hxx"
49 
50 #include "MWAWDebug.hxx"
51 #include "MWAWInputStream.hxx"
52 
53 #include "MWAWParser.hxx"
54 
55 namespace RagTimeTextInternal
56 {
57 struct TextZone;
58 
59 struct State;
60 }
61 
62 class RagTimeParser;
63 
70 {
71  friend class RagTimeParser;
72 public:
74  RagTimeText(RagTimeParser &parser);
76  virtual ~RagTimeText();
77 
79  int version() const;
80 
82  int getFontId(int localId) const;
83 
84 protected:
86  bool readFontNames(MWAWEntry &entry);
87 
89  bool readTextZone(MWAWEntry &entry, int width, MWAWColor const &fontColor=MWAWColor::black());
91  bool readFonts(RagTimeTextInternal::TextZone &zone, MWAWColor const &color, long endPos);
93  bool readParagraphs(RagTimeTextInternal::TextZone &zone, int width, long endPos);
94 
96  bool send(int id);
98  void flushExtra();
99 
100  //
101  // low level
102  //
103 
105  bool send(RagTimeTextInternal::TextZone const &zone);
106 
107 private:
108  RagTimeText(RagTimeText const &orig);
109  RagTimeText &operator=(RagTimeText const &orig);
110 
111 protected:
112  //
113  // data
114  //
117 
119  shared_ptr<RagTimeTextInternal::State> m_state;
120 
123 };
124 #endif
125 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
RagTimeParser * m_mainParser
the main parser;
Definition: RagTimeText.hxx:122
MWAWParserStatePtr m_parserState
the parser state
Definition: RagTimeText.hxx:116
virtual ~RagTimeText()
destructor
Definition: RagTimeText.cxx:111
shared_ptr< RagTimeTextInternal::State > m_state
the state
Definition: RagTimeText.hxx:119
bool readParagraphs(RagTimeTextInternal::TextZone &zone, int width, long endPos)
try to read the paragraph properties (knowing the zone width in point used to determine the right mar...
Definition: RagTimeText.cxx:432
the main class to read the text part of ragTime file
Definition: RagTimeText.hxx:69
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:183
bool readFontNames(MWAWEntry &entry)
try to read the font name: the FHFo structure: FileH?Font zone
Definition: RagTimeText.cxx:130
the class to store a color
Definition: libmwaw_internal.hxx:166
int getFontId(int localId) const
returns a mac font id corresponding to a local id
Definition: RagTimeText.cxx:121
Internal: a text's zone of a RagTimeText.
Definition: RagTimeText.cxx:58
bool readTextZone(MWAWEntry &entry, int width, MWAWColor const &fontColor=MWAWColor::black())
try to read a text zone (knowing the zone width in point and the font color)
Definition: RagTimeText.cxx:220
the main class to read a RagTime v3 file
Definition: RagTimeParser.hxx:59
RagTimeText(RagTimeParser &parser)
constructor
Definition: RagTimeText.cxx:106
bool readFonts(RagTimeTextInternal::TextZone &zone, MWAWColor const &color, long endPos)
try to read the character properties (knowing the font color)
Definition: RagTimeText.cxx:363
bool send(int id)
try to send a text zone
Definition: RagTimeText.cxx:582
RagTimeText & operator=(RagTimeText const &orig)
int version() const
returns the file version
Definition: RagTimeText.cxx:114
void flushExtra()
flush extra zone
Definition: RagTimeText.cxx:710
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:386
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46

Generated on Fri Aug 8 2014 00:08:59 for libmwaw by doxygen 1.8.7