ShapeInfo.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libmspub
3  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License or as specified alternatively below. You may obtain a copy of
8  * the License at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * Major Contributor(s):
16  * Copyright (C) 2012 Brennan Vincent <brennanv@email.arizona.edu>
17  *
18  * All Rights Reserved.
19  *
20  * For minor contributions see the git repository.
21  *
22  * Alternatively, the contents of this file may be used under the terms of
23  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
24  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
25  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
26  * instead of those above.
27  */
28 #ifndef __SHAPEINFO_H__
29 #define __SHAPEINFO_H__
30 #include <boost/optional.hpp>
31 #include <boost/shared_ptr.hpp>
32 #include <map>
33 #include <vector>
34 #include <boost/function.hpp>
35 #include "ShapeType.h"
36 #include "Coordinate.h"
37 #include "Line.h"
38 #include "Margins.h"
39 #include "MSPUBTypes.h"
40 #include "Fill.h"
41 #include "PolygonUtils.h"
42 #include "Dash.h"
43 #include "TableInfo.h"
44 #include "Arrow.h"
45 #include "VerticalAlign.h"
46 #include "ColorReference.h"
47 #include "Shadow.h"
48 
49 namespace libmspub
50 {
51 void noop(const CustomShape *);
52 struct ShapeInfo
53 {
54  boost::optional<ShapeType> m_type;
55  boost::optional<ShapeType> m_cropType;
56  boost::optional<unsigned> m_imgIndex;
57  boost::optional<unsigned> m_borderImgIndex;
58  boost::optional<Coordinate> m_coordinates;
59  std::vector<Line> m_lines;
60  boost::optional<unsigned> m_pageSeqNum;
61  boost::optional<unsigned> m_textId;
62  std::map<unsigned, int> m_adjustValuesByIndex;
63  std::vector<int> m_adjustValues;
64  boost::optional<double> m_rotation;
65  boost::optional<std::pair<bool, bool> > m_flips;
66  boost::optional<Margins> m_margins;
67  boost::optional<BorderPosition> m_borderPosition; // Irrelevant except for rectangular shapes
68  boost::shared_ptr<const Fill> m_fill;
69  boost::optional<DynamicCustomShape> m_customShape;
71  boost::optional<ColorReference> m_lineBackColor;
72  boost::optional<Dash> m_dash;
73  boost::optional<TableInfo> m_tableInfo;
74  boost::optional<std::vector<unsigned> > m_tableCellTextEnds;
75  boost::optional<unsigned> m_numColumns;
76  unsigned m_columnSpacing;
77  boost::optional<Arrow> m_beginArrow;
78  boost::optional<Arrow> m_endArrow;
79  boost::optional<VerticalAlign> m_verticalAlign;
80  boost::optional<ColorReference> m_pictureRecolor;
81  boost::optional<Shadow> m_shadow;
82  boost::optional<int> m_innerRotation;
83  std::vector<libmspub::Vertex> m_clipPath;
84  boost::optional<int> m_pictureBrightness;
85  boost::optional<int> m_pictureContrast;
95  {
96  }
97  boost::shared_ptr<const CustomShape> getCustomShape() const
98  {
99  if (!!m_customShape)
100  {
102  }
103  if (!!m_cropType)
104  {
105  return boost::shared_ptr<const CustomShape>(
107  boost::function<void (const CustomShape *)>(noop));
108  }
109  return boost::shared_ptr<const CustomShape>(
111  boost::function<void (const CustomShape *)>(noop));
112  }
113 };
114 }
115 #endif
116 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libmspub by doxygen 1.8.3.1