VSDCharacterList.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libvisio project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef __VSDCHARACTERLIST_H__
11 #define __VSDCHARACTERLIST_H__
12
13 #include <vector>
14 #include <map>
15 #include "VSDTypes.h"
16 #include "VSDStyles.h"
17
18 namespace libvisio
19 {
20
21 class VSDCharacterListElement;
22 class VSDCollector;
23
24 class VSDCharacterList
25 {
26 public:
27 VSDCharacterList();
28 VSDCharacterList(const VSDCharacterList &charList);
29 ~VSDCharacterList();
30 VSDCharacterList &operator=(const VSDCharacterList &charList);
31 void addCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font,
32 const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold,
33 const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline,
34 const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps,
35 const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript,
36 const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth);
37 void addCharIX(unsigned id, unsigned level, const VSDOptionalCharStyle &style);
38 unsigned getCharCount(unsigned id) const;
39 void setCharCount(unsigned id, unsigned charCount);
40 void resetCharCount();
41 unsigned getLevel() const;
42
43 void setElementsOrder(const std::vector<unsigned> &m_elementsOrder);
44 void handle(VSDCollector *collector) const;
45 void clear();
46 bool empty() const
47 {
48 return (m_elements.empty());
49 }
50 private:
51 std::map<unsigned, VSDCharacterListElement *> m_elements;
52 std::vector<unsigned> m_elementsOrder;
53 };
54
55 } // namespace libvisio
56
57 #endif // __VSDCHARACTERLIST_H__
58 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libvisio::VSDCharacterList::VSDCharacterList
VSDCharacterList()
Definition: VSDCharacterList.cpp:75
libvisio::VSDCharacterList::~VSDCharacterList
~VSDCharacterList()
Definition: VSDCharacterList.cpp:100
libvisio::VSDCharacterList::handle
void handle(VSDCollector *collector) const
Definition: VSDCharacterList.cpp:169
libvisio::VSDCharacterList::empty
bool empty() const
Definition: VSDCharacterList.h:46
libvisio::VSDCharacterList::addCharIX
void addCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional< VSDName > &font, const boost::optional< Colour > &fontColour, const boost::optional< double > &fontSize, const boost::optional< bool > &bold, const boost::optional< bool > &italic, const boost::optional< bool > &underline, const boost::optional< bool > &doubleunderline, const boost::optional< bool > &strikeout, const boost::optional< bool > &doublestrikeout, const boost::optional< bool > &allcaps, const boost::optional< bool > &initcaps, const boost::optional< bool > &smallcaps, const boost::optional< bool > &superscript, const boost::optional< bool > &subscript, const boost::optional< double > &scaleWidth)
Definition: VSDCharacterList.cpp:105
libvisio::VSDCharacterList::resetCharCount
void resetCharCount()
Definition: VSDCharacterList.cpp:149
libvisio::VSDCollector
Definition: VSDCollector.h:20
libvisio::VSDCharacterList::m_elementsOrder
std::vector< unsigned > m_elementsOrder
Definition: VSDCharacterList.h:52
VSDTypes.h
libvisio::VSDCharacterList::getLevel
unsigned getLevel() const
Definition: VSDCharacterList.cpp:155
libvisio::VSDOptionalCharStyle
Definition: VSDStyles.h:223
libvisio::VSDCharacterList::m_elements
std::map< unsigned, VSDCharacterListElement * > m_elements
Definition: VSDCharacterList.h:51
VSDStyles.h
libvisio
Definition: libvisio_utils.h:48
libvisio::VSDCharacterList::clear
void clear()
Definition: VSDCharacterList.cpp:191
libvisio::VSDCharacterList::setCharCount
void setCharCount(unsigned id, unsigned charCount)
Definition: VSDCharacterList.cpp:142
libvisio::VSDCharacterList::getCharCount
unsigned getCharCount(unsigned id) const
Definition: VSDCharacterList.cpp:133
libvisio::VSDCharacterList
Definition: VSDCharacterList.h:24
libvisio::VSDCharacterList::operator=
VSDCharacterList & operator=(const VSDCharacterList &charList)
Definition: VSDCharacterList.cpp:90
libvisio::VSDCharacterList::setElementsOrder
void setElementsOrder(const std::vector< unsigned > &m_elementsOrder)
Definition: VSDCharacterList.cpp:162