Bump version to 6.4-15
[LibreOffice.git] / hwpfilter / source / drawdef.h
blob00296d8d170421662836ea47e8f847078612438c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_HWPFILTER_SOURCE_DRAWDEF_H
21 #define INCLUDED_HWPFILTER_SOURCE_DRAWDEF_H
23 #include "hwplib.h"
24 #include <memory>
26 class HWPPara;
28 /**
29 * Constant for drawing objects
31 enum objtype
33 HWPDO_CONTAINER,
34 HWPDO_LINE,
35 HWPDO_RECT,
36 HWPDO_ELLIPSE,
37 HWPDO_ARC,
38 HWPDO_FREEFORM,
39 HWPDO_TEXTBOX,
40 HWPDO_CURVE,
41 HWPDO_ADVANCED_ELLIPSE,
42 HWPDO_ADVANCED_ARC,
43 HWPDO_CLOSED_FREEFORM,
44 HWPDO_NITEMS
47 #define HWPDO_PAT_TYPE_BITS 0xFF000000
49 #define HWPDO_PAT_SOLID 0x00000000
51 #define HWPDO_COLOR_NONE 0x10000000
53 #define HWPDO_FLAG_DRAW_PIE 0x00000002
56 #define HWPDO_FLAG_GRADATION 0x00010000
57 #define HWPDO_FLAG_ROTATION 0x00020000
58 #define HWPDO_FLAG_BITMAP 0x00040000
59 #define HWPDO_FLAG_AS_TEXTBOX 0x00080000
60 #define HWPDO_FLAG_WATERMARK 0x00100000
62 /**
63 * @short Basic properties for drawing objects
65 * The order of pstyle, hstyle and tstyle is important.
66 * @see LineObject
68 struct BAREHWPDOProperty
70 int line_pstyle;
71 int line_hstyle;
72 int line_tstyle;
73 unsigned int line_color;
74 hunit line_width;
75 unsigned int fill_color;
76 uint pattern_type;
77 unsigned int pattern_color;
78 hunit hmargin;
79 hunit vmargin;
80 uint flag;
83 /**
84 * @short Gradation properties for drawing object
86 struct GradationProperty
88 int fromcolor;
89 int tocolor;
90 int gstyle;
91 int angle;
92 int center_x;
93 int center_y;
94 int nstep;
97 /**
98 * @short Bitmap properties for drawing object
100 struct BitmapProperty
102 ZZPoint offset1;
103 ZZPoint offset2;
104 char szPatternFile[260 + 1];
105 char pictype;
109 * @short Rotation properties for drawing object
111 struct RotationProperty
113 int rot_originx;
114 int rot_originy;
115 ZZParall parall;
119 * @short All properties for drawing object
121 struct HWPDOProperty
123 int line_pstyle; /* Style of the middle of line */
124 int line_hstyle; /* Style of the end of line */
125 int line_tstyle; /* Style of the start of line */
126 unsigned int line_color;
127 hunit line_width;
128 unsigned int fill_color;
129 uint pattern_type;
130 unsigned int pattern_color;
131 hunit hmargin;
132 hunit vmargin;
133 uint flag;
135 /* Rotation properties */
136 int rot_originx;
137 int rot_originy;
138 ZZParall parall;
140 /* Gradation properties */
142 int fromcolor;
143 int tocolor;
144 int gstyle;
145 int angle;
146 int center_x;
147 int center_y;
148 int nstep;
150 /* Watermark */
151 int luminance;
152 int contrast;
153 int greyscale;
155 /* As TextBox */
156 HWPPara *pPara;
159 ZZPoint offset1;
160 ZZPoint offset2;
161 char szPatternFile[260 + 1];
162 char pictype;
166 * @short Line Object
168 struct HWPDOLine
170 uint flip;
174 * @short Polygon or Polyline Object
176 struct HWPDOFreeForm
178 int npt;
179 ZZPoint *pt;
183 * @short Textbox Object
185 struct HWPDOTextBox
187 HWPPara *h;
191 * @short Arc Object
193 struct HWPDOArc
195 ZZPoint radial[2];
199 * @short Common header for drawing object
201 struct HWPDrawingObject
204 * type of drawing object
206 int type;
208 * offset from origin of current group
210 ZZPoint offset;
212 * offset from origin of drawing object
214 ZZPoint offset2;
215 ZZSize extent;
217 * rectangle with consideration of line width
219 ZZRect vrect;
220 HWPDOProperty property;
221 union
223 HWPDOLine line_arc;
224 HWPDOFreeForm freeform;
225 HWPDOTextBox textbox;
227 * extended from hwpw96
229 HWPDOArc arc;
232 std::unique_ptr<struct HWPDrawingObject> next;
234 * This exists for container object
236 std::unique_ptr<struct HWPDrawingObject> child;
237 int index;
238 HWPDrawingObject();
239 ~HWPDrawingObject();
241 #endif // INCLUDED_HWPFILTER_SOURCE_DRAWDEF_H
243 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */