VSDParagraphList.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libvisio project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef __VSDPARAGRAPHLIST_H__
00011 #define __VSDPARAGRAPHLIST_H__
00012 
00013 #include <vector>
00014 #include <map>
00015 #include "VSDStyles.h"
00016 
00017 namespace libvisio
00018 {
00019 
00020 class VSDParagraphListElement;
00021 class VSDCollector;
00022 
00023 class VSDParagraphList
00024 {
00025 public:
00026   VSDParagraphList();
00027   VSDParagraphList(const VSDParagraphList &paraList);
00028   ~VSDParagraphList();
00029   VSDParagraphList &operator=(const VSDParagraphList &paraList);
00030   void addParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst,
00031                  const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine,
00032                  const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align,
00033                  const boost::optional<unsigned> &flags);
00034   void addParaIX(unsigned id, unsigned level, const VSDOptionalParaStyle &style);
00035   unsigned getCharCount(unsigned id) const;
00036   void setCharCount(unsigned id, unsigned charCount);
00037   void resetCharCount();
00038   unsigned getLevel() const;
00039 
00040   void setElementsOrder(const std::vector<unsigned> &m_elementsOrder);
00041   void handle(VSDCollector *collector) const;
00042   void clear();
00043   bool empty() const
00044   {
00045     return (m_elements.empty());
00046   }
00047 private:
00048   std::map<unsigned, VSDParagraphListElement *> m_elements;
00049   std::vector<unsigned> m_elementsOrder;
00050 };
00051 
00052 } // namespace libvisio
00053 
00054 #endif // __VSDPARAGRAPHLIST_H__
00055 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */