MacDrawProStyleManager.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 #ifndef MACDRAWPRO_STYLE_MANAGER
35 # define MACDRAWPRO_STYLE_MANAGER
36 
37 #include <map>
38 #include <string>
39 #include <vector>
40 
41 #include <librevenge/librevenge.h>
42 
43 #include "MWAWDebug.hxx"
44 #include "MWAWGraphicStyle.hxx"
45 #include "MWAWInputStream.hxx"
46 
47 class MWAWFont;
48 
50 {
51 struct State;
52 }
53 
54 class MacDrawProParser;
55 
60 {
61  friend class MacDrawProParser;
62 public:
66  virtual ~MacDrawProStyleManager();
67 
68 protected:
70  bool readRSRCZones();
71 
72  // Intermediate level
73 
75  bool readHeaderInfoStylePart(std::string &extra);
77  bool readStyles(long const(&sizeZones)[5]);
78 
80  bool getColor(int cId, MWAWColor &color) const;
82  bool getDash(int dId, std::vector<float> &dash) const;
84  bool getFont(int fId, MWAWFont &font) const;
86  bool getPattern(int pId, MWAWGraphicStyle::Pattern &pattern) const;
88  bool getPenSize(int pId, float &penSize) const;
89 
90  //
91  // low level
92  //
93 
95  bool readFontStyles(MWAWEntry const &entry);
96 
97  // data fork or rsrc fork
98 
100  bool readArrows(MWAWEntry const &entry, bool inRsrc=false);
102  bool readDashs(MWAWEntry const &entry, bool inRsrc=false);
104  bool readPens(MWAWEntry const &entry, bool inRsrc=false);
106  bool readRulers(MWAWEntry const &entry, bool inRsrc=false);
107 
108  // rsrc
109 
111  bool readDocumentInfo(MWAWEntry const &entry);
113  bool readPreferences(MWAWEntry const &entry);
115  bool readFontNames();
117  bool readColors(MWAWEntry const &entry);
119  bool readBWPatterns(MWAWEntry const &entry);
121  bool readColorPatterns(MWAWEntry const &entry);
123  bool readPatternsToolList(MWAWEntry const &entry);
125  bool readRulerSettings(MWAWEntry const &entry);
127  bool readViews(MWAWEntry const &entry);
128 
130  bool readRSRCDstl(MWAWEntry const &entry);
131 
132  //
133  // data
134  //
135 
136 protected:
142  shared_ptr<MacDrawProStyleManagerInternal::State> m_state;
143 };
144 #endif
145 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
bool getFont(int fId, MWAWFont &font) const
tries to return the font corresponding to an id
Definition: MacDrawProStyleManager.cxx:238
bool readRulerSettings(MWAWEntry const &entry)
tries to read the Ruler settings resource Rset:256 or Rst2:256
Definition: MacDrawProStyleManager.cxx:1264
bool readFontNames()
tries to read the font name resources Fmtx:256 and Fnms:256
Definition: MacDrawProStyleManager.cxx:941
bool readRulers(MWAWEntry const &entry, bool inRsrc=false)
tries to read the Ruler styles or the resource Drul:256
Definition: MacDrawProStyleManager.cxx:669
bool readHeaderInfoStylePart(std::string &extra)
tries to read the header info part which corresponds to style data
Definition: MacDrawProStyleManager.cxx:304
shared_ptr< MacDrawProStyleManagerInternal::State > m_state
the state
Definition: MacDrawProStyleManager.hxx:142
MacDrawProParser & m_parser
the main parser
Definition: MacDrawProStyleManager.hxx:138
bool readDashs(MWAWEntry const &entry, bool inRsrc=false)
tries to read the dash settings or the resource Dset:256
Definition: MacDrawProStyleManager.cxx:528
bool getColor(int cId, MWAWColor &color) const
tries to return the color corresponding to an id
Definition: MacDrawProStyleManager.cxx:226
the class to store a color
Definition: libmwaw_internal.hxx:166
bool readRSRCZones()
tries to read the RSRC zones
Definition: MacDrawProStyleManager.cxx:731
Class to store font.
Definition: MWAWFont.hxx:44
bool getPattern(int pId, MWAWGraphicStyle::Pattern &pattern) const
tries to return the pattern corresponding to an id
Definition: MacDrawProStyleManager.cxx:271
bool readColorPatterns(MWAWEntry const &entry)
tries to read the color pattern colP:256
Definition: MacDrawProStyleManager.cxx:1119
bool readPatternsToolList(MWAWEntry const &entry)
tries to read the list of pattern patR:256: list of BW/Color patterns list which appear in the patter...
Definition: MacDrawProStyleManager.cxx:1216
the main class to read a MacDraw II file
Definition: MacDrawProParser.hxx:63
the main class to read a MacDraw II file
Definition: MacDrawProStyleManager.hxx:59
bool readArrows(MWAWEntry const &entry, bool inRsrc=false)
tries to read the Arrow styles or the resource Aset:256
Definition: MacDrawProStyleManager.cxx:465
virtual ~MacDrawProStyleManager()
destructor
Definition: MacDrawProStyleManager.cxx:217
MWAWParserStatePtr m_parserState
the parser state
Definition: MacDrawProStyleManager.hxx:140
bool readRSRCDstl(MWAWEntry const &entry)
reads the Dstl:256 resource (unknown content)
Definition: MacDrawProStyleManager.cxx:1368
bool readDocumentInfo(MWAWEntry const &entry)
tries to read the Document Information resource Dinf:256
Definition: MacDrawProStyleManager.cxx:861
bool readPens(MWAWEntry const &entry, bool inRsrc=false)
tries to read the Pen styles or the resource PSet:256
Definition: MacDrawProStyleManager.cxx:599
bool getPenSize(int pId, float &penSize) const
tries to return the pen size corresponding to an id
Definition: MacDrawProStyleManager.cxx:260
bool readStyles(long const (&sizeZones)[5])
tries to read the style zone knowings the size and the number of data in each zones ...
Definition: MacDrawProStyleManager.cxx:350
bool readBWPatterns(MWAWEntry const &entry)
tries to read the BW pattern bawP:256
Definition: MacDrawProStyleManager.cxx:1064
bool getDash(int dId, std::vector< float > &dash) const
tries to return the dash definition corresponding to an id
Definition: MacDrawProStyleManager.cxx:249
bool readColors(MWAWEntry const &entry)
tries to read colors map Ctbl:256
Definition: MacDrawProStyleManager.cxx:1010
Internal: the structures of a MacDrawProStyleManager.
Definition: MacDrawProStyleManager.cxx:61
bool readViews(MWAWEntry const &entry)
reads the view positions resource Dvws:256
Definition: MacDrawProStyleManager.cxx:1318
shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:407
bool readPreferences(MWAWEntry const &entry)
tries to read the main Preferences resource Pref:256
Definition: MacDrawProStyleManager.cxx:810
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:95
bool readFontStyles(MWAWEntry const &entry)
tries to read the font style ( last style in data fork )
Definition: MacDrawProStyleManager.cxx:393
MacDrawProStyleManager(MacDrawProParser &parser)
constructor
Definition: MacDrawProStyleManager.cxx:212

Generated on Fri Oct 17 2014 06:15:04 for libmwaw by doxygen 1.8.8