Bump version to 6.4-15
[LibreOffice.git] / hwpfilter / source / hinfo.h
blobc415783e26a22565dcda30c2b14318d0301e8438
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 #include <vector>
27 #include <memory>
29 #define CHAIN_MAX_PATH 40
30 #define ANNOTATION_LEN 24
32 class HWPFile;
33 class CTextOut;
34 class CHTMLOut;
36 /**
37 * Information of page (physical)
39 struct PaperInfo
41 unsigned char paper_kind;
42 unsigned char paper_direction;
43 hunit paper_height;
44 hunit paper_width;
45 hunit top_margin;
46 hunit bottom_margin;
47 hunit left_margin;
48 hunit right_margin;
49 hunit header_length;
50 hunit footer_length;
51 hunit gutter_length;
52 PaperInfo()
53 : paper_kind(0)
54 , paper_direction(0)
55 , paper_height(0)
56 , paper_width(0)
57 , top_margin(0)
58 , bottom_margin(0)
59 , left_margin(0)
60 , right_margin(0)
61 , header_length(0)
62 , footer_length(0)
63 , gutter_length(0)
68 /* ?????? ??????, ???????? ???? */
69 struct PaperBackInfo
71 char type; // 0- background color, 1 - external image, 2- embedded image
72 char reserved1[8] = {};
73 int luminance; /* ???? ( -100 ~ 100 ) */
74 int contrast; /* ???? ( -100 ~ 100 ) */
75 char effect; /* 0-????????, 1-????????????, 2-???? */
76 char reserved2[8] = {};
77 char filename[260 + 1] = {}; // filename
78 unsigned char color[3] = {}; //0 - red, 1 - green, 2 - blue
79 unsigned short flag; /* 0 - ????????, 1 - ????????, 2 - ??????, 3 - ???????? */
80 int range; /* 0-????, 1-????????, 3-??????, 4-?????? */
81 char reserved3[27] = {};
82 int size;
83 std::vector<char> data; // image data
84 bool isset;
85 PaperBackInfo()
86 : type(0)
87 , luminance(0)
88 , contrast(0)
89 , effect(0)
90 , flag(0)
91 , range(0)
92 , size(0)
93 , isset(false)
98 /* ???????? ???? */
99 /**
100 * Information of printing for chained page
102 struct DocChainInfo
104 unsigned char chain_page_no;
105 unsigned char chain_footnote_no;
106 unsigned char chain_filename[CHAIN_MAX_PATH] = {};
107 DocChainInfo()
108 : chain_page_no(0)
109 , chain_footnote_no(0)
114 /* ???? ???? */
116 * Summary of document
118 struct HWPSummary
120 unsigned short title[56];
121 unsigned short subject[56];
122 unsigned short author[56];
123 unsigned short date[56];
124 unsigned short keyword[2][56];
125 unsigned short etc[3][56];
127 bool Read(HWPFile &);
131 HWPInfo class?? HWPFile?? ???? ?????? ???? ???? ??????????.
132 ?????? ???? ???? ????????(layout) ?????? ????????????
133 ????????, ???? ???? ?????? ???????? ????. \\
135 HWPInfo ???????? HWPFile?? #GetHWPInfo()# ?????? ???? ???? ?? ????.
137 @memo Hwp ???? ????
140 * Contains the basic information of the hwp document:
141 * margin, layout, paper and internal data.
143 class DLLEXPORT HWPInfo
145 public:
147 * The column index of a document that is saved at last
149 short cur_col;
151 * The row index of a document that is saved at last
153 short cur_row;
155 * Paper Information
157 PaperInfo paper;
159 PaperBackInfo back_info;
161 * Sets the attribute of read-only or read/write.
163 short readonly;
164 unsigned char reserved1[4] = {};
166 * Information about document chain
168 DocChainInfo chain_info;
169 unsigned char annotation[ANNOTATION_LEN] = {};
170 short encrypted;
171 // unsigned char reserved2[6];
172 short beginpagenum; /* ?????????? ???? */
174 * Information about footnote
176 short beginfnnum; /* ???????????? */
177 short countfn; /* ???? ???? */
178 hunit splinetext, splinefn;
179 hunit spfnfn;
180 unsigned char fnchar;
181 unsigned char fnlinetype;
182 // layout info
184 * Information about page layout
186 hunit bordermargin[4] = {};
187 short borderline;
189 unsigned char empty_line_hide;
190 unsigned char table_move;
191 unsigned char compressed;
192 unsigned char reserved3;
193 short info_block_len;
194 /* ?????????? 128 ?????????? */
196 * Summary of document
198 HWPSummary summary;
199 std::unique_ptr<unsigned char[]> info_block;
201 HWPInfo(void);
202 ~HWPInfo(void);
204 void Read(HWPFile &hwpf);
208 /* ???? ???? ?????? */
210 * @short Style of character
212 struct CharShape
215 * Index of character style
217 int index; /* ???????? ???????? ????. */
219 * Font size
221 hunit size;
222 unsigned char font[NLanguage];
223 unsigned char ratio[NLanguage];
224 signed char space[NLanguage]; /* ???? */
225 unsigned char color[2];
226 unsigned char shade;
227 unsigned char attr;
228 unsigned char reserved[4];
230 void Read(HWPFile &);
233 /* ?? ?????? ???? ?????? */
235 #define MAXTABS 40
237 * @short Tab properties
239 struct TabSet
241 unsigned char type;
242 unsigned char dot_continue;
243 hunit position;
244 TabSet()
245 : type(0)
246 , dot_continue(0)
247 , position(0)
253 * @short Column properties
255 struct ColumnDef
257 unsigned char ncols;
258 unsigned char separator;
259 hunit spacing;
260 hunit columnlen, columnlen0;
261 ColumnDef()
262 : ncols(0)
263 , separator(0)
264 , spacing(0)
265 , columnlen(0)
266 , columnlen0(0)
272 * @short Style of paragraph
274 struct ParaShape
277 * Index of paragraph style
279 int index; /* ???????? ???????? ???? */
280 hunit left_margin;
281 hunit right_margin;
282 hunit indent;
283 hunit lspacing;
284 hunit pspacing_prev;
285 hunit pspacing_next;
286 unsigned char condense;
287 unsigned char arrange_type;
288 TabSet tabs[MAXTABS];
289 std::shared_ptr<ColumnDef> xColdef;
290 unsigned char shade;
291 unsigned char outline;
292 unsigned char outline_continue;
293 unsigned char reserved[2];
294 std::shared_ptr<CharShape> cshape;
295 unsigned char pagebreak;
297 void Read(HWPFile &);
299 ParaShape();
301 #endif // INCLUDED_HWPFILTER_SOURCE_HINFO_H
303 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */