VSDStencils.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* libvisio
00003  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License or as specified alternatively below. You may obtain a copy of
00008  * the License at http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * Major Contributor(s):
00016  * Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
00017  * Copyright (C) 2011 Eilidh McAdam <tibbylickle@gmail.com>
00018  *
00019  *
00020  * All Rights Reserved.
00021  *
00022  * For minor contributions see the git repository.
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
00026  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00027  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
00028  * instead of those above.
00029  */
00030 
00031 #ifndef __VSDSTENCILS_H__
00032 #define __VSDSTENCILS_H__
00033 
00034 #include <map>
00035 #include <vector>
00036 #include "VSDStyles.h"
00037 #include "VSDGeometryList.h"
00038 #include "VSDFieldList.h"
00039 #include "VSDTypes.h"
00040 #include "VSDParagraphList.h"
00041 #include "VSDCharacterList.h"
00042 #include "VSDShapeList.h"
00043 
00044 namespace libvisio
00045 {
00046 
00047 class VSDShape
00048 {
00049 public:
00050   VSDShape();
00051   VSDShape(const VSDShape &shape);
00052   ~VSDShape();
00053   VSDShape &operator=(const VSDShape &shape);
00054   void clear();
00055 
00056   std::map<unsigned, VSDGeometryList> m_geometries;
00057   VSDShapeList m_shapeList;
00058   VSDFieldList m_fields;
00059   ForeignData *m_foreign;
00060   unsigned m_parent, m_masterPage, m_masterShape, m_shapeId;
00061   unsigned m_lineStyleId, m_fillStyleId, m_textStyleId;
00062   VSDOptionalLineStyle m_lineStyle;
00063   VSDOptionalFillStyle m_fillStyle;
00064   VSDOptionalTextBlockStyle m_textBlockStyle;
00065   VSDOptionalCharStyle m_charStyle;
00066   VSDCharacterList m_charList;
00067   VSDOptionalParaStyle m_paraStyle;
00068   VSDParagraphList m_paraList;
00069   WPXBinaryData m_text;
00070   std::map< unsigned, VSDName > m_names;
00071   TextFormat m_textFormat;
00072   std::map<unsigned, NURBSData> m_nurbsData;
00073   std::map<unsigned, PolylineData> m_polylineData;
00074   XForm m_xform;
00075   XForm *m_txtxform;
00076   VSDMisc m_misc;
00077 };
00078 
00079 class VSDStencil
00080 {
00081 public:
00082   VSDStencil();
00083   VSDStencil(const VSDStencil &stencil);
00084   ~VSDStencil();
00085   VSDStencil &operator=(const VSDStencil &stencil);
00086   void addStencilShape(unsigned id, const VSDShape &shape);
00087   void setFirstShape(unsigned id);
00088   const VSDShape *getStencilShape(unsigned id) const;
00089   std::map<unsigned, VSDShape> m_shapes;
00090   double m_shadowOffsetX;
00091   double m_shadowOffsetY;
00092   unsigned m_firstShapeId;
00093 };
00094 
00095 class VSDStencils
00096 {
00097 public:
00098   VSDStencils();
00099   ~VSDStencils();
00100   void addStencil(unsigned idx, const VSDStencil &stencil);
00101   const VSDStencil *getStencil(unsigned idx) const;
00102   const VSDShape *getStencilShape(unsigned pageId, unsigned shapeId) const;
00103   unsigned count() const
00104   {
00105     return m_stencils.size();
00106   }
00107   void clear();
00108 private:
00109   std::map<unsigned, VSDStencil> m_stencils;
00110 };
00111 
00112 
00113 } // namespace libvisio
00114 
00115 #endif // __VSDSTENCILS_H__
00116 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */