VSDCharacterList.h Source File documentation

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
19namespace libvisio
20{
21
22class VSDCharacterListElement;
23class VSDCollector;
24
25 class VSDCharacterList
26{
27public:
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 std::optional<VSDName> &font,
33 const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold,
34 const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline,
35 const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps,
36 const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript,
37 const std::optional<bool> &subscript, const std::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 }
51private:
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::VSDCharacterListElement
Definition VSDCharacterList.cpp:18
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::addCharIX
void addCharIX(unsigned id, unsigned level, unsigned charCount, const std::optional< VSDName > &font, const std::optional< Colour > &fontColour, const std::optional< double > &fontSize, const std::optional< bool > &bold, const std::optional< bool > &italic, const std::optional< bool > &underline, const std::optional< bool > &doubleunderline, const std::optional< bool > &strikeout, const std::optional< bool > &doublestrikeout, const std::optional< bool > &allcaps, const std::optional< bool > &initcaps, const std::optional< bool > &smallcaps, const std::optional< bool > &superscript, const std::optional< bool > &subscript, const std::optional< double > &scaleWidth)
Definition VSDCharacterList.cpp:107
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::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:47
libvisio::VSDOptionalCharStyle
Definition VSDStyles.h:226