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 
49 {
50 struct State;
51 }
52 
53 class ReadySetGoParser;
54 
59 {
60  friend class ReadySetGoParser;
61 public:
63  explicit ReadySetGoStyleManager(ReadySetGoParser &parser);
65  virtual ~ReadySetGoStyleManager();
66 
68  bool getColor(int colorId, MWAWColor &color) const;
70  bool getPattern(int patternId, MWAWGraphicStyle::Pattern &pattern) const;
71 
73  bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr);
75  bool readTabulationsV1(std::vector<MWAWTabStop> &tabulations, std::string &extra);
77  bool readTabulations(std::vector<MWAWTabStop> &tabs, long len=-1, int *cPos=nullptr);
78 
79 protected:
81  int version() const;
82 
83  //
84  // data
85  //
86 
88  bool readColors();
90  bool readColorNames();
92  bool readFontsBlock();
94  bool readFontsBlock2();
96  bool readFontsName();
97 
99  bool readStyles(int numStyles);
100 protected:
106  std::shared_ptr<ReadySetGoStyleManagerInternal::State> m_state;
107 };
108 #endif
109 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Class to store font.
Definition: MWAWFont.hxx:44
class to store the paragraph properties
Definition: MWAWParagraph.hxx:85
the main class to read a ReadySetGo 1.0,2.1,3.0,4.0,4.5,6.0 file
Definition: ReadySetGoParser.hxx:61
class to read/store ReadySetGo v1-v6 styles
Definition: ReadySetGoStyleManager.hxx:59
bool readStyles(int numStyles)
try to read the list of style block: v4
Definition: ReadySetGoStyleManager.cxx:671
ReadySetGoStyleManager(ReadySetGoParser &parser)
constructor
Definition: ReadySetGoStyleManager.cxx:302
bool readTabulations(std::vector< MWAWTabStop > &tabs, long len=-1, int *cPos=nullptr)
try to read a list of tabulations: v3
Definition: ReadySetGoStyleManager.cxx:1018
bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr)
try to read a style: v3
Definition: ReadySetGoStyleManager.cxx:770
std::shared_ptr< ReadySetGoStyleManagerInternal::State > m_state
the state
Definition: ReadySetGoStyleManager.hxx:106
bool readColorNames()
try to read the list of colors: v4.5
Definition: ReadySetGoStyleManager.cxx:393
bool readTabulationsV1(std::vector< MWAWTabStop > &tabulations, std::string &extra)
try to read a list of tabulations: v1-2
Definition: ReadySetGoStyleManager.cxx:944
MWAWParserStatePtr m_parserState
the parser state
Definition: ReadySetGoStyleManager.hxx:104
int version() const
returns the file version
Definition: ReadySetGoStyleManager.cxx:313
ReadySetGoParser & m_parser
the main parser
Definition: ReadySetGoStyleManager.hxx:102
bool readFontsBlock2()
try to read the optional list of font block: name + data?, v6
Definition: ReadySetGoStyleManager.cxx:548
virtual ~ReadySetGoStyleManager()
destructor
Definition: ReadySetGoStyleManager.cxx:309
bool readFontsName()
try to read the list of font name: v6
Definition: ReadySetGoStyleManager.cxx:608
bool readColors()
try to read the list of colors: v4.5
Definition: ReadySetGoStyleManager.cxx:354
bool getPattern(int patternId, MWAWGraphicStyle::Pattern &pattern) const
try to retrieve a pattern
Definition: ReadySetGoStyleManager.cxx:336
bool readFontsBlock()
try to read the list of font block: unsure, name + data?, v4.5
Definition: ReadySetGoStyleManager.cxx:455
bool getColor(int colorId, MWAWColor &color) const
try to retrieve the i^th color
Definition: ReadySetGoStyleManager.cxx:326
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition: libmwaw_internal.hxx:557
Internal: the structures of a ReadySetGoStyleManager.
Definition: ReadySetGoStyleManager.cxx:61
the class to store a color
Definition: libmwaw_internal.hxx:192
a basic pattern used in a MWAWGraphicStyle:
Definition: MWAWGraphicStyle.hxx:351

Generated on Mon Mar 6 2023 06:19:05 for libmwaw by doxygen 1.9.1