fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / hwpfilter / source / hinfo.h
blob00bc6046c9b4d910ce9ebdc7079ea92abb55773f
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_HINFO_H
21 #define INCLUDED_HWPFILTER_SOURCE_HINFO_H
23 #include "hwplib.h"
24 #include "string.h"
26 #define CHAIN_MAX_PATH 40
27 #define ANNOTATION_LEN 24
29 class HWPFile;
30 class CTextOut;
31 class CHTMLOut;
33 /**
34 * Information of page (phisical)
36 struct PaperInfo
38 unsigned char paper_kind;
39 unsigned char paper_direction;
40 hunit paper_height;
41 hunit paper_width;
42 hunit top_margin;
43 hunit bottom_margin;
44 hunit left_margin;
45 hunit right_margin;
46 hunit header_length;
47 hunit footer_length;
48 hunit gutter_length;
49 PaperInfo()
50 : paper_kind(0)
51 , paper_direction(0)
52 , paper_height(0)
53 , paper_width(0)
54 , top_margin(0)
55 , bottom_margin(0)
56 , left_margin(0)
57 , right_margin(0)
58 , header_length(0)
59 , footer_length(0)
60 , gutter_length(0)
65 /* ?????? ??????, ???????? ???? */
66 struct PaperBackInfo
68 char type; // 0- background color, 1 - external image, 2- embedded image
69 char reserved1[8];
70 int luminance; /* ???? ( -100 ~ 100 ) */
71 int contrast; /* ???? ( -100 ~ 100 ) */
72 char effect; /* 0-????????, 1-????????????, 2-???? */
73 char reserved2[8];
74 char filename[260 + 1]; // filename
75 unsigned char color[3]; //0 - red, 1 - green, 2 - blue
76 unsigned short flag; /* 0 - ????????, 1 - ????????, 2 - ??????, 3 - ???????? */
77 int range; /* 0-????, 1-????????, 3-??????, 4-?????? */
78 char reserved3[27];
79 int size;
80 char *data; // image data
81 bool isset;
82 PaperBackInfo()
83 : type(0)
84 , luminance(0)
85 , contrast(0)
86 , effect(0)
87 , flag(0)
88 , range(0)
89 , size(0)
90 , data(NULL)
91 , isset(false)
93 memset(reserved1, 0, sizeof(reserved1));
94 memset(reserved2, 0, sizeof(reserved2));
95 memset(filename, 0, sizeof(filename));
96 memset(color, 0, sizeof(color));
97 memset(reserved3, 0, sizeof(reserved3));
101 /* ???????? ???? */
103 * Information of printing for chained page
105 struct DocChainInfo
107 unsigned char chain_page_no;
108 unsigned char chain_footnote_no;
109 unsigned char chain_filename[CHAIN_MAX_PATH];
110 DocChainInfo()
111 : chain_page_no(0)
112 , chain_footnote_no(0)
114 memset(chain_filename, 0, sizeof(chain_filename));
118 /* ???? ???? */
120 * Summary of document
122 struct HWPSummary
124 unsigned short title[56];
125 unsigned short subject[56];
126 unsigned short author[56];
127 unsigned short date[56];
128 unsigned short keyword[2][56];
129 unsigned short etc[3][56];
131 bool Read(HWPFile &);
135 HWPInfo class?? HWPFile?? ???? ?????? ???? ???? ??????????.
136 ?????? ???? ???? ????????(layout) ?????? ????????????
137 ????????, ???? ???? ?????? ???????? ????. \\
139 HWPInfo ???????? HWPFile?? #GetHWPInfo()# ?????? ???? ???? ?? ????.
141 @memo Hwp ???? ????
144 * Contains the basic information of the hwp document:
145 * margin, layout, paper and internal data.
147 class DLLEXPORT HWPInfo
149 public:
151 * The column index of a document that is saved at last
153 short cur_col;
155 * The row index of a document that is saved at last
157 short cur_row;
159 * Paper Information
161 PaperInfo paper;
163 PaperBackInfo back_info;
165 * Sets the attribute of read-only or read/write.
167 short readonly;
168 unsigned char reserved1[4];
170 * Information about document chain
172 DocChainInfo chain_info;
173 unsigned char annotation[ANNOTATION_LEN];
174 short encrypted;
175 // unsigned char reserved2[6];
176 short beginpagenum; /* ?????????? ???? */
178 * Information about footnote
180 short beginfnnum; /* ???????????? */
181 short countfn; /* ???? ???? */
182 hunit splinetext, splinefn;
183 hunit spfnfn;
184 unsigned char fnchar;
185 unsigned char fnlinetype;
186 // layout info
188 * Information about page layout
190 hunit bordermargin[4];
191 short borderline;
193 unsigned char empty_line_hide;
194 unsigned char table_move;
195 unsigned char compressed;
196 unsigned char reserved3;
197 short info_block_len;
198 /* ?????????? 128 ?????????? */
200 * Summary of document
202 HWPSummary summary;
203 unsigned char *info_block;
205 HWPInfo(void);
206 ~HWPInfo(void);
208 bool Read(HWPFile &hwpf);
209 bool Write(CTextOut &txtf);
210 bool Write(CHTMLOut &html);
214 /* ???? ???? ?????? */
216 * @short Style of character
218 struct CharShape
221 * Index of character style
223 int index; /* ???????? ???????? ????. */
225 * Font size
227 hunit size;
228 unsigned char font[NLanguage];
229 unsigned char ratio[NLanguage];
230 signed char space[NLanguage]; /* ???? */
231 unsigned char color[2];
232 unsigned char shade;
233 unsigned char attr;
234 unsigned char reserved[4];
236 bool Read(HWPFile &);
239 /* ?? ?????? ???? ?????? */
241 #define MAXTABS 40
243 * @short Tab properties
245 typedef struct
247 unsigned char type;
248 unsigned char dot_continue;
249 hunit position;
250 } TabSet;
253 * @short Column properties
255 typedef struct
257 unsigned char ncols;
258 unsigned char separator;
259 hunit spacing;
260 hunit columnlen, columnlen0;
261 } ColumnDef;
264 * @short Style of paragraph
266 struct ParaShape
269 * Index of paragraph style
271 int index; /* ???????? ???????? ???? */
272 hunit left_margin;
273 hunit right_margin;
274 hunit indent;
275 hunit lspacing;
276 hunit pspacing_prev;
277 hunit pspacing_next;
278 unsigned char condense;
279 unsigned char arrange_type;
280 TabSet tabs[MAXTABS];
281 ColumnDef coldef;
282 unsigned char shade;
283 unsigned char outline;
284 unsigned char outline_continue;
285 unsigned char reserved[2];
286 CharShape *cshape;
287 unsigned char pagebreak;
289 bool Read(HWPFile &);
290 // virtual ~ParaShape();
292 #endif // INCLUDED_HWPFILTER_SOURCE_HINFO_H
294 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */