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 <memory>
14#include <vector>
15#include <map>
16#include "VSDTypes.h"
17#include "VSDStyles.h"
18
19 namespace libvisio
20{
21
22 class VSDCharacterListElement;
23 class VSDCollector;
24
25 class VSDCharacterList
26{
27 public:
28 VSDCharacterList();
29 VSDCharacterList(const VSDCharacterList &charList);
30 ~VSDCharacterList();
31 VSDCharacterList &operator=(const VSDCharacterList &charList);
32 void addCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font,
33 const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold,
34 const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline,
35 const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps,
36 const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript,
37 const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth);
38 void addCharIX(unsigned id, unsigned level, const VSDOptionalCharStyle &style);
39 unsigned getCharCount(unsigned id) const;
40 void setCharCount(unsigned id, unsigned charCount);
41 void resetCharCount();
42 unsigned getLevel() const;
43
44 void setElementsOrder(const std::vector<unsigned> &m_elementsOrder);
45 void handle(VSDCollector *collector) const;
46 void clear();
47 bool empty() const
48 {
49 return (m_elements.empty());
50 }
51 private:
52 std::map<unsigned, std::unique_ptr<VSDCharacterListElement>> m_elements;
53 std::vector<unsigned> m_elementsOrder;
54};
55
56} // namespace libvisio
57
58#endif // __VSDCHARACTERLIST_H__
59/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
VSDStyles.h
VSDTypes.h
libvisio::VSDCharacterList
Definition: VSDCharacterList.h:26
libvisio::VSDCharacterList::setCharCount
void setCharCount(unsigned id, unsigned charCount)
Definition: VSDCharacterList.cpp:141
libvisio::VSDCharacterList::~VSDCharacterList
~VSDCharacterList()
Definition: VSDCharacterList.cpp:102
libvisio::VSDCharacterList::empty
bool empty() const
Definition: VSDCharacterList.h:47
libvisio::VSDCharacterList::operator=
VSDCharacterList & operator=(const VSDCharacterList &charList)
Definition: VSDCharacterList.cpp:90
libvisio::VSDCharacterList::handle
void handle(VSDCollector *collector) const
Definition: VSDCharacterList.cpp:168
libvisio::VSDCharacterList::setElementsOrder
void setElementsOrder(const std::vector< unsigned > &m_elementsOrder)
Definition: VSDCharacterList.cpp:161
libvisio::VSDCharacterList::clear
void clear()
Definition: VSDCharacterList.cpp:189
libvisio::VSDCharacterList::m_elements
std::map< unsigned, std::unique_ptr< VSDCharacterListElement > > m_elements
Definition: VSDCharacterList.h:52
libvisio::VSDCharacterList::getLevel
unsigned getLevel() const
Definition: VSDCharacterList.cpp:154
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:107
libvisio::VSDCharacterList::getCharCount
unsigned getCharCount(unsigned id) const
Definition: VSDCharacterList.cpp:132
libvisio::VSDCharacterList::VSDCharacterList
VSDCharacterList()
Definition: VSDCharacterList.cpp:76
libvisio::VSDCharacterList::m_elementsOrder
std::vector< unsigned > m_elementsOrder
Definition: VSDCharacterList.h:53
libvisio::VSDCharacterList::resetCharCount
void resetCharCount()
Definition: VSDCharacterList.cpp:148
libvisio::VSDCollector
Definition: VSDCollector.h:21
libvisio
Definition: libvisio_utils.h:49
libvisio::VSDOptionalCharStyle
Definition: VSDStyles.h:209