/src/libvisio/src/lib/VSDCharacterList.h
Line | Count | Source |
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 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 | 1.04M | { |
49 | 1.04M | return (m_elements.empty()); |
50 | 1.04M | } |
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: */ |