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: */
boost::optional< unsigned > m_imgIndex
Definition: ShapeInfo.h:56
boost::shared_ptr< const CustomShape > getCustomShape() const
Definition: ShapeInfo.h:97
boost::shared_ptr< const Fill > m_fill
Definition: ShapeInfo.h:68
boost::optional< unsigned > m_numColumns
Definition: ShapeInfo.h:75
boost::optional< Dash > m_dash
Definition: ShapeInfo.h:72
boost::optional< unsigned > m_borderImgIndex
Definition: ShapeInfo.h:57
boost::optional< Margins > m_margins
Definition: ShapeInfo.h:66
boost::optional< unsigned > m_pageSeqNum
Definition: ShapeInfo.h:60
boost::optional< int > m_pictureContrast
Definition: ShapeInfo.h:85
boost::optional< int > m_pictureBrightness
Definition: ShapeInfo.h:84
boost::optional< VerticalAlign > m_verticalAlign
Definition: ShapeInfo.h:79
boost::shared_ptr< const CustomShape > getFromDynamicCustomShape(const DynamicCustomShape &dcs)
Definition: PolygonUtils.cpp:6393
boost::optional< Arrow > m_beginArrow
Definition: ShapeInfo.h:77
boost::optional< DynamicCustomShape > m_customShape
Definition: ShapeInfo.h:69
bool m_stretchBorderArt
Definition: ShapeInfo.h:70
boost::optional< std::vector< unsigned > > m_tableCellTextEnds
Definition: ShapeInfo.h:74
boost::optional< std::pair< bool, bool > > m_flips
Definition: ShapeInfo.h:65
std::map< unsigned, int > m_adjustValuesByIndex
Definition: ShapeInfo.h:62
Definition: ShapeType.h:38
boost::optional< TableInfo > m_tableInfo
Definition: ShapeInfo.h:73
std::vector< int > m_adjustValues
Definition: ShapeInfo.h:63
boost::optional< ShapeType > m_type
Definition: ShapeInfo.h:54
boost::optional< Coordinate > m_coordinates
Definition: ShapeInfo.h:58
boost::optional< Arrow > m_endArrow
Definition: ShapeInfo.h:78
std::vector< libmspub::Vertex > m_clipPath
Definition: ShapeInfo.h:83
boost::optional< ShapeType > m_cropType
Definition: ShapeInfo.h:55
Definition: PolygonUtils.h:77
boost::optional< unsigned > m_textId
Definition: ShapeInfo.h:61
unsigned m_columnSpacing
Definition: ShapeInfo.h:76
boost::optional< ColorReference > m_pictureRecolor
Definition: ShapeInfo.h:80
ShapeInfo()
Definition: ShapeInfo.h:86
const CustomShape * getCustomShape(ShapeType type)
Definition: PolygonUtils.cpp:5268
boost::optional< BorderPosition > m_borderPosition
Definition: ShapeInfo.h:67
boost::optional< int > m_innerRotation
Definition: ShapeInfo.h:82
std::vector< Line > m_lines
Definition: ShapeInfo.h:59
void noop(const CustomShape *)
Definition: MSPUBCollector.cpp:217
boost::optional< ColorReference > m_lineBackColor
Definition: ShapeInfo.h:71
boost::optional< double > m_rotation
Definition: ShapeInfo.h:64
Definition: ShapeInfo.h:52
boost::optional< Shadow > m_shadow
Definition: ShapeInfo.h:81

Generated for libmspub by doxygen 1.8.5