/src/libvisio/src/lib/VSDParagraphList.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 __VSDPARAGRAPHLIST_H__ |
11 | | #define __VSDPARAGRAPHLIST_H__ |
12 | | |
13 | | #include <memory> |
14 | | #include <vector> |
15 | | #include <map> |
16 | | #include "VSDStyles.h" |
17 | | |
18 | | namespace libvisio |
19 | | { |
20 | | |
21 | | class VSDParagraphListElement; |
22 | | class VSDCollector; |
23 | | |
24 | | class VSDParagraphList |
25 | | { |
26 | | public: |
27 | | VSDParagraphList(); |
28 | | VSDParagraphList(const VSDParagraphList ¶List); |
29 | | ~VSDParagraphList(); |
30 | | VSDParagraphList &operator=(const VSDParagraphList ¶List); |
31 | | void addParaIX(unsigned id, unsigned level, unsigned charCount, const std::optional<double> &indFirst, |
32 | | const std::optional<double> &indLeft, const std::optional<double> &indRight, const std::optional<double> &spLine, |
33 | | const std::optional<double> &spBefore, const std::optional<double> &spAfter, const std::optional<unsigned char> &align, |
34 | | const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, |
35 | | const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, |
36 | | const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags); |
37 | | void addParaIX(unsigned id, unsigned level, const VSDOptionalParaStyle &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 | 1.05M | { |
48 | 1.05M | return (m_elements.empty()); |
49 | 1.05M | } |
50 | | private: |
51 | | std::map<unsigned, std::unique_ptr<VSDParagraphListElement>> m_elements; |
52 | | std::vector<unsigned> m_elementsOrder; |
53 | | }; |
54 | | |
55 | | } // namespace libvisio |
56 | | |
57 | | #endif // __VSDPARAGRAPHLIST_H__ |
58 | | /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |