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
50 namespace ReadySetGoStyleManagerInternal
51{
52 struct State;
53}
54
55 class ReadySetGoParser;
56
60 class ReadySetGoStyleManager
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:
104 ReadySetGoParser &m_parser;
106 MWAWParserStatePtr m_parserState;
108 std::shared_ptr<ReadySetGoStyleManagerInternal::State> m_state;
109};
110#endif
111// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWGraphicStyle.hxx
MWAWInputStream.hxx
MWAWParser.hxx
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
MWAWParagraph
class to store the paragraph properties
Definition MWAWParagraph.hxx:85
ReadySetGoParser
the main class to read a ReadySetGo 1.0,2.1,3.0,4.0,4.5,6.0 file
Definition ReadySetGoParser.hxx:61
ReadySetGoStyleManager::readStyles
bool readStyles(int numStyles)
try to read the list of style block: v4
Definition ReadySetGoStyleManager.cxx:666
ReadySetGoStyleManager::ReadySetGoStyleManager
ReadySetGoStyleManager(ReadySetGoParser &parser)
constructor
Definition ReadySetGoStyleManager.cxx:302
ReadySetGoStyleManager::readTabulations
bool readTabulations(std::vector< MWAWTabStop > &tabs, long len=-1, int *cPos=nullptr)
try to read a list of tabulations: v3
Definition ReadySetGoStyleManager.cxx:1013
ReadySetGoStyleManager::readStyle
bool readStyle(MWAWFont &font, MWAWParagraph &para, int *cPos=nullptr)
try to read a style: v3
Definition ReadySetGoStyleManager.cxx:765
ReadySetGoStyleManager::m_state
std::shared_ptr< ReadySetGoStyleManagerInternal::State > m_state
the state
Definition ReadySetGoStyleManager.hxx:108
ReadySetGoStyleManager::readColorNames
bool readColorNames()
try to read the list of colors: v4.5
Definition ReadySetGoStyleManager.cxx:393
ReadySetGoStyleManager::readTabulationsV1
bool readTabulationsV1(std::vector< MWAWTabStop > &tabulations, std::string &extra)
try to read a list of tabulations: v1-2
Definition ReadySetGoStyleManager.cxx:939
ReadySetGoStyleManager::m_parserState
MWAWParserStatePtr m_parserState
the parser state
Definition ReadySetGoStyleManager.hxx:106
ReadySetGoStyleManager::ReadySetGoParser
friend class ReadySetGoParser
Definition ReadySetGoStyleManager.hxx:62
ReadySetGoStyleManager::version
int version() const
returns the file version
Definition ReadySetGoStyleManager.cxx:313
ReadySetGoStyleManager::m_parser
ReadySetGoParser & m_parser
the main parser
Definition ReadySetGoStyleManager.hxx:104
ReadySetGoStyleManager::readFontsBlock2
bool readFontsBlock2()
try to read the optional list of font block: name + data?, v6
Definition ReadySetGoStyleManager.cxx:543
ReadySetGoStyleManager::~ReadySetGoStyleManager
virtual ~ReadySetGoStyleManager()
destructor
Definition ReadySetGoStyleManager.cxx:309
ReadySetGoStyleManager::readFontsName
bool readFontsName()
try to read the list of font name: v6
Definition ReadySetGoStyleManager.cxx:603
ReadySetGoStyleManager::readColors
bool readColors()
try to read the list of colors: v4.5
Definition ReadySetGoStyleManager.cxx:354
ReadySetGoStyleManager::getPattern
bool getPattern(int patternId, MWAWGraphicStyle::Pattern &pattern) const
try to retrieve a pattern
Definition ReadySetGoStyleManager.cxx:336
ReadySetGoStyleManager::readFontsBlock
bool readFontsBlock()
try to read the list of font block: unsure, name + data?, v4.5
Definition ReadySetGoStyleManager.cxx:450
ReadySetGoStyleManager::getColor
bool getColor(int colorId, MWAWColor &color) const
try to retrieve the i^th color
Definition ReadySetGoStyleManager.cxx:326
MWAWParserStatePtr
std::shared_ptr< MWAWParserState > MWAWParserStatePtr
a smart pointer of MWAWParserState
Definition libmwaw_internal.hxx:557
ReadySetGoStyleManagerInternal
Internal: the structures of a ReadySetGoStyleManager.
Definition ReadySetGoStyleManager.cxx:61
MWAWColor
the class to store a color
Definition libmwaw_internal.hxx:192
MWAWGraphicStyle::Pattern
a basic pattern used in a MWAWGraphicStyle:
Definition MWAWGraphicStyle.hxx:351
MWAWTabStop
class to store a tab use by MWAWParagraph
Definition MWAWParagraph.hxx:46
ReadySetGoStyleManagerInternal::State
Internal: the state of a ReadySetGoStyleManager.
Definition ReadySetGoStyleManager.cxx:65