ReadySetGoStyleManager.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 READYSETGO_STYLE_MANAGER
35 # define READYSETGO_STYLE_MANAGER
36 
37 #include <string>
38 #include <vector>
39 
40 #include <librevenge/librevenge.h>
41 
42 #include "MWAWDebug.hxx"
43 #include "MWAWGraphicStyle.hxx"
44 #include "MWAWInputStream.hxx"
45 
46 #include "MWAWParser.hxx"
47 
48 struct MWAWTabStop;
49 
51 {
52 struct State;
53 }
54 
55 class ReadySetGoParser;
56 
61 {
62  friend class ReadySetGoParser;
63 public:
65  explicit ReadySetGoStyleManager(ReadySetGoParser &parser);
67  virtual ~ReadySetGoStyleManager();
68 
70  bool getColor(int colorId, MWAWColor &color) const;
72  bool getPattern(int patternId, MWAWGraphicStyle::Pattern &pattern) const;
73 
75  bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr);
77  bool readTabulationsV1(std::vector<MWAWTabStop> &tabulations, std::string &extra);
79  bool readTabulations(std::vector<MWAWTabStop> &tabs, long len=-1, int *cPos=nullptr);
80 
81 protected:
83  int version() const;
84 
85  //
86  // data
87  //
88 
90  bool readColors();
92  bool readColorNames();
94  bool readFontsBlock();
96  bool readFontsBlock2();
98  bool readFontsName();
99 
101  bool readStyles(int numStyles);
102 protected:
108  std::shared_ptr<ReadySetGoStyleManagerInternal::State> m_state;
109 };
110 #endif
111 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
class to read/store ReadySetGo v1-v6 styles
Definition: ReadySetGoStyleManager.hxx:60
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
bool readFontsBlock2()
try to read the optional list of font block: name + data?, v6
Definition: ReadySetGoStyleManager.cxx:543
int version() const
returns the file version
Definition: ReadySetGoStyleManager.cxx:313
bool readFontsName()
try to read the list of font name: v6
Definition: ReadySetGoStyleManager.cxx:603
bool readColorNames()
try to read the list of colors: v4.5
Definition: ReadySetGoStyleManager.cxx:393
the class to store a color
Definition: libmwaw_internal.hxx:192
bool readTabulations(std::vector< MWAWTabStop > &tabs, long len=-1, int *cPos=nullptr)
try to read a list of tabulations: v3
Definition: ReadySetGoStyleManager.cxx:1013
bool readColors()
try to read the list of colors: v4.5
Definition: ReadySetGoStyleManager.cxx:354
std::shared_ptr< ReadySetGoStyleManagerInternal::State > m_state
the state
Definition: ReadySetGoStyleManager.hxx:108
bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr)
try to read a style: v3
Definition: ReadySetGoStyleManager.cxx:765
bool readTabulationsV1(std::vector< MWAWTabStop > &tabulations, std::string &extra)
try to read a list of tabulations: v1-2
Definition: ReadySetGoStyleManager.cxx:939
Class to store font.
Definition: MWAWFont.hxx:43
bool readFontsBlock()
try to read the list of font block: unsure, name + data?, v4.5
Definition: ReadySetGoStyleManager.cxx:450
class to store a tab use by MWAWParagraph
Definition: MWAWParagraph.hxx:46
MWAWParserStatePtr m_parserState
the parser state
Definition: ReadySetGoStyleManager.hxx:106
bool getColor(int colorId, MWAWColor &color) const
try to retrieve the i^th color
Definition: ReadySetGoStyleManager.cxx:326
class to store the paragraph properties
Definition: MWAWParagraph.hxx:84
Internal: the structures of a ReadySetGoStyleManager.
Definition: ReadySetGoStyleManager.cxx:60
ReadySetGoParser & m_parser
the main parser
Definition: ReadySetGoStyleManager.hxx:104
bool readStyles(int numStyles)
try to read the list of style block: v4
Definition: ReadySetGoStyleManager.cxx:666
the main class to read a ReadySetGo 1.0,2.1,3.0,4.0,4.5,6.0 file
Definition: ReadySetGoParser.hxx:60
bool getPattern(int patternId, MWAWGraphicStyle::Pattern &pattern) const
try to retrieve a pattern
Definition: ReadySetGoStyleManager.cxx:336
virtual ~ReadySetGoStyleManager()
destructor
Definition: ReadySetGoStyleManager.cxx:309
ReadySetGoStyleManager(ReadySetGoParser &parser)
constructor
Definition: ReadySetGoStyleManager.cxx:302
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:351

Generated on Thu May 30 2024 13:09:12 for libmwaw by doxygen 1.8.10