VSDCharacterList.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 __VSDCHARACTERLIST_H__
00011 #define __VSDCHARACTERLIST_H__
00012 
00013 #include <vector>
00014 #include <map>
00015 #include "VSDTypes.h"
00016 #include "VSDStyles.h"
00017 
00018 namespace libvisio
00019 {
00020 
00021 class VSDCharacterListElement;
00022 class VSDCollector;
00023 
00024 class VSDCharacterList
00025 {
00026 public:
00027   VSDCharacterList();
00028   VSDCharacterList(const VSDCharacterList &charList);
00029   ~VSDCharacterList();
00030   VSDCharacterList &operator=(const VSDCharacterList &charList);
00031   void addCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font,
00032                  const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold,
00033                  const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline,
00034                  const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps,
00035                  const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript,
00036                  const boost::optional<bool> &subscript);
00037   void addCharIX(unsigned id, unsigned level, const VSDOptionalCharStyle &style);
00038   unsigned getCharCount(unsigned id) const;
00039   void setCharCount(unsigned id, unsigned charCount);
00040   void resetCharCount();
00041   unsigned getLevel() const;
00042 
00043   void setElementsOrder(const std::vector<unsigned> &m_elementsOrder);
00044   void handle(VSDCollector *collector) const;
00045   void clear();
00046   bool empty() const
00047   {
00048     return (m_elements.empty());
00049   }
00050 private:
00051   std::map<unsigned, VSDCharacterListElement *> m_elements;
00052   std::vector<unsigned> m_elementsOrder;
00053 };
00054 
00055 } // namespace libvisio
00056 
00057 #endif // __VSDCHARACTERLIST_H__
00058 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */