VSDParagraphList.h Source File documentation

VSDParagraphList.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 __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 &paraList);
29 ~VSDParagraphList();
30 VSDParagraphList &operator=(const VSDParagraphList &paraList);
31 void addParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst,
32 const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine,
33 const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align,
34 const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr,
35 const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize,
36 const boost::optional<double> &textPosAfterBullet, const boost::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 {
48 return (m_elements.empty());
49 }
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: */
libvisio::VSDOptionalParaStyle::indFirst
boost::optional< double > indFirst
Definition: VSDStyles.h:358
libvisio::VSDOptionalParaStyle::spLine
boost::optional< double > spLine
Definition: VSDStyles.h:361
libvisio::VSDParaIX::~VSDParaIX
~VSDParaIX() override
Definition: VSDParagraphList.cpp:43
libvisio::VSDParagraphList::resetCharCount
void resetCharCount()
Definition: VSDParagraphList.cpp:150
libvisio::VSDParagraphList::handle
void handle(VSDCollector *collector) const
Definition: VSDParagraphList.cpp:170
libvisio::VSDCollector::collectParaIX
virtual void collectParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional< double > &indFirst, const boost::optional< double > &indLeft, const boost::optional< double > &indRight, const boost::optional< double > &spLine, const boost::optional< double > &spBefore, const boost::optional< double > &spAfter, const boost::optional< unsigned char > &align, const boost::optional< unsigned char > &bullet, const boost::optional< VSDName > &bulletStr, const boost::optional< VSDName > &bulletFont, const boost::optional< double > &bulletFontSize, const boost::optional< double > &textPosAfterBullet, const boost::optional< unsigned > &flags)=0
libvisio::VSDOptionalParaStyle::textPosAfterBullet
boost::optional< double > textPosAfterBullet
Definition: VSDStyles.h:369
libvisio::VSDOptionalParaStyle::indLeft
boost::optional< double > indLeft
Definition: VSDStyles.h:359
libvisio::VSDParagraphList::setElementsOrder
void setElementsOrder(const std::vector< unsigned > &m_elementsOrder)
Definition: VSDParagraphList.cpp:163
libvisio::VSDParagraphListElement::handle
virtual void handle(VSDCollector *collector) const =0
libvisio::VSDParaIX::setCharCount
void setCharCount(unsigned charCount) override
Definition: VSDParagraphList.cpp:50
libvisio::VSDCollector
Definition: VSDCollector.h:21
libvisio::VSDOptionalParaStyle::bullet
boost::optional< unsigned char > bullet
Definition: VSDStyles.h:365
libvisio::VSDParaIX::getCharCount
unsigned getCharCount() const override
Definition: VSDParagraphList.cpp:46
libvisio::VSDParaIX::m_style
VSDOptionalParaStyle m_style
Definition: VSDParagraphList.cpp:55
libvisio::VSDParaIX::clone
VSDParagraphListElement * clone() override
Definition: VSDParagraphList.cpp:68
libvisio::VSDParagraphListElement
Definition: VSDParagraphList.cpp:18
libvisio::clone
std::unique_ptr< T > clone(const std::unique_ptr< T > &other)
Definition: libvisio_utils.h:65
VSDStyles.h
libvisio::VSDOptionalParaStyle
Definition: VSDStyles.h:323
libvisio::VSDParagraphList::empty
bool empty() const
Definition: VSDParagraphList.h:46
libvisio::VSDParagraphList::VSDParagraphList
VSDParagraphList()
Definition: VSDParagraphList.cpp:77
libvisio::VSDParagraphList::m_elements
std::map< unsigned, std::unique_ptr< VSDParagraphListElement > > m_elements
Definition: VSDParagraphList.h:51
VSDCollector.h
libvisio::VSDParagraphList::~VSDParagraphList
~VSDParagraphList()
Definition: VSDParagraphList.cpp:103
libvisio::VSDParagraphList::m_elementsOrder
std::vector< unsigned > m_elementsOrder
Definition: VSDParagraphList.h:52
libvisio::VSDParagraphList::operator=
VSDParagraphList & operator=(const VSDParagraphList &paraList)
Definition: VSDParagraphList.cpp:91
libvisio::VSDParaIX::handle
void handle(VSDCollector *collector) const override
Definition: VSDParagraphList.cpp:60
libvisio::VSDOptionalParaStyle::charCount
unsigned charCount
Definition: VSDStyles.h:357
libvisio::VSDParagraphList::getCharCount
unsigned getCharCount(unsigned id) const
Definition: VSDParagraphList.cpp:134
libvisio::VSDOptionalParaStyle::spAfter
boost::optional< double > spAfter
Definition: VSDStyles.h:363
libvisio::VSDOptionalParaStyle::spBefore
boost::optional< double > spBefore
Definition: VSDStyles.h:362
libvisio::VSDParagraphListElement::m_id
unsigned m_id
Definition: VSDParagraphList.cpp:27
libvisio::VSDOptionalParaStyle::bulletFontSize
boost::optional< double > bulletFontSize
Definition: VSDStyles.h:368
libvisio::VSDParagraphListElement::setCharCount
virtual void setCharCount(unsigned charCount)=0
libvisio::VSDOptionalParaStyle::align
boost::optional< unsigned char > align
Definition: VSDStyles.h:364
VSDParagraphList.h
libvisio::VSDParagraphList::addParaIX
void addParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional< double > &indFirst, const boost::optional< double > &indLeft, const boost::optional< double > &indRight, const boost::optional< double > &spLine, const boost::optional< double > &spBefore, const boost::optional< double > &spAfter, const boost::optional< unsigned char > &align, const boost::optional< unsigned char > &bullet, const boost::optional< VSDName > &bulletStr, const boost::optional< VSDName > &bulletFont, const boost::optional< double > &bulletFontSize, const boost::optional< double > &textPosAfterBullet, const boost::optional< unsigned > &flags)
Definition: VSDParagraphList.cpp:107
libvisio::VSDParagraphListElement::m_level
unsigned m_level
Definition: VSDParagraphList.cpp:27
libvisio::VSDParagraphListElement::VSDParagraphListElement
VSDParagraphListElement(unsigned id, unsigned level)
Definition: VSDParagraphList.cpp:20
MINUS_ONE
#define MINUS_ONE
Definition: VSDTypes.h:18
libvisio::VSDParaIX::VSDParaIX
VSDParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional< double > &indFirst, const boost::optional< double > &indLeft, const boost::optional< double > &indRight, const boost::optional< double > &spLine, const boost::optional< double > &spBefore, const boost::optional< double > &spAfter, const boost::optional< unsigned char > &align, const boost::optional< unsigned char > &bullet, const boost::optional< VSDName > &bulletStr, const boost::optional< VSDName > &bulletFont, const boost::optional< double > &bulletFontSize, const boost::optional< double > &textPosAfterBullet, const boost::optional< unsigned > &flags)
Definition: VSDParagraphList.cpp:33
libvisio::VSDParagraphListElement::clone
virtual VSDParagraphListElement * clone()=0
libvisio::VSDOptionalParaStyle::bulletFont
boost::optional< VSDName > bulletFont
Definition: VSDStyles.h:367
libvisio::VSDParagraphList
Definition: VSDParagraphList.h:25
libvisio::VSDOptionalParaStyle::flags
boost::optional< unsigned > flags
Definition: VSDStyles.h:370
libvisio::VSDOptionalParaStyle::indRight
boost::optional< double > indRight
Definition: VSDStyles.h:360
libvisio::VSDParagraphList::clear
void clear()
Definition: VSDParagraphList.cpp:191
libvisio::VSDParagraphList::setCharCount
void setCharCount(unsigned id, unsigned charCount)
Definition: VSDParagraphList.cpp:143
libvisio::VSDParaIX
Definition: VSDParagraphList.cpp:31
libvisio::VSDParagraphListElement::getCharCount
virtual unsigned getCharCount() const =0
libvisio
Definition: libvisio_utils.h:49
libvisio::VSDParagraphList::getLevel
unsigned getLevel() const
Definition: VSDParagraphList.cpp:156
libvisio::VSDOptionalParaStyle::bulletStr
boost::optional< VSDName > bulletStr
Definition: VSDStyles.h:366
libvisio::VSDParagraphListElement::~VSDParagraphListElement
virtual ~VSDParagraphListElement()
Definition: VSDParagraphList.cpp:21