Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __SHAPEINFO_H__
00029 #define __SHAPEINFO_H__
00030 #include <boost/optional.hpp>
00031 #include <boost/shared_ptr.hpp>
00032 #include <map>
00033 #include <vector>
00034 #include <boost/function.hpp>
00035 #include "ShapeType.h"
00036 #include "Coordinate.h"
00037 #include "Line.h"
00038 #include "Margins.h"
00039 #include "MSPUBTypes.h"
00040 #include "Fill.h"
00041 #include "PolygonUtils.h"
00042 #include "Dash.h"
00043 #include "TableInfo.h"
00044 #include "Arrow.h"
00045 #include "VerticalAlign.h"
00046 #include "ColorReference.h"
00047 #include "Shadow.h"
00048
00049 namespace libmspub
00050 {
00051 void noop(const CustomShape *);
00052 struct ShapeInfo
00053 {
00054 boost::optional<ShapeType> m_type;
00055 boost::optional<ShapeType> m_cropType;
00056 boost::optional<unsigned> m_imgIndex;
00057 boost::optional<unsigned> m_borderImgIndex;
00058 boost::optional<Coordinate> m_coordinates;
00059 std::vector<Line> m_lines;
00060 boost::optional<unsigned> m_pageSeqNum;
00061 boost::optional<unsigned> m_textId;
00062 std::map<unsigned, int> m_adjustValuesByIndex;
00063 std::vector<int> m_adjustValues;
00064 boost::optional<double> m_rotation;
00065 boost::optional<std::pair<bool, bool> > m_flips;
00066 boost::optional<Margins> m_margins;
00067 boost::optional<BorderPosition> m_borderPosition;
00068 boost::shared_ptr<const Fill> m_fill;
00069 boost::optional<DynamicCustomShape> m_customShape;
00070 bool m_stretchBorderArt;
00071 boost::optional<ColorReference> m_lineBackColor;
00072 boost::optional<Dash> m_dash;
00073 boost::optional<TableInfo> m_tableInfo;
00074 boost::optional<std::vector<unsigned> > m_tableCellTextEnds;
00075 boost::optional<unsigned> m_numColumns;
00076 unsigned m_columnSpacing;
00077 boost::optional<Arrow> m_beginArrow;
00078 boost::optional<Arrow> m_endArrow;
00079 boost::optional<VerticalAlign> m_verticalAlign;
00080 boost::optional<ColorReference> m_pictureRecolor;
00081 boost::optional<Shadow> m_shadow;
00082 boost::optional<int> m_innerRotation;
00083 std::vector<libmspub::Vertex> m_clipPath;
00084 boost::optional<int> m_pictureBrightness;
00085 boost::optional<int> m_pictureContrast;
00086 ShapeInfo() : m_type(), m_cropType(), m_imgIndex(), m_borderImgIndex(),
00087 m_coordinates(), m_lines(), m_pageSeqNum(),
00088 m_textId(), m_adjustValuesByIndex(), m_adjustValues(),
00089 m_rotation(), m_flips(), m_margins(), m_borderPosition(),
00090 m_fill(), m_customShape(), m_stretchBorderArt(false),
00091 m_lineBackColor(), m_dash(), m_tableInfo(),
00092 m_tableCellTextEnds(), m_numColumns(),
00093 m_columnSpacing(0), m_beginArrow(), m_endArrow(),
00094 m_verticalAlign(), m_pictureRecolor(), m_shadow(), m_innerRotation(), m_clipPath(), m_pictureBrightness(), m_pictureContrast()
00095 {
00096 }
00097 boost::shared_ptr<const CustomShape> getCustomShape() const
00098 {
00099 if (!!m_customShape)
00100 {
00101 return getFromDynamicCustomShape(m_customShape.get());
00102 }
00103 if (!!m_cropType)
00104 {
00105 return boost::shared_ptr<const CustomShape>(
00106 libmspub::getCustomShape(m_cropType.get()),
00107 boost::function<void (const CustomShape *)>(noop));
00108 }
00109 return boost::shared_ptr<const CustomShape>(
00110 libmspub::getCustomShape(m_type.get_value_or(RECTANGLE)),
00111 boost::function<void (const CustomShape *)>(noop));
00112 }
00113 };
00114 }
00115 #endif
00116