update credits
[LibreOffice.git] / hwpfilter / source / hinfo.h
blob4aa7458444edb3579b50267ca3c3738f86adb5da
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 _HWPINFO_H_
21 #define _HWPINFO_H_
23 #include "hwplib.h"
25 #define CHAIN_MAX_PATH 40
26 #define ANNOTATION_LEN 24
28 class HWPFile;
29 class CTextOut;
30 class CHTMLOut;
32 /**
33 * Information of page (phisical)
35 typedef struct
37 unsigned char paper_kind;
38 unsigned char paper_direction;
39 hunit paper_height;
40 hunit paper_width;
41 hunit top_margin;
42 hunit bottom_margin;
43 hunit left_margin;
44 hunit right_margin;
45 hunit header_length;
46 hunit footer_length;
47 hunit gutter_length;
48 } PaperInfo;
50 /* ?????? ??????, ???????? ???? */
51 typedef struct
53 char type; // 0- background color, 1 - external image, 2- embeded image
54 char reserved1[8];
55 int luminance; /* ???? ( -100 ~ 100 ) */
56 int contrast; /* ???? ( -100 ~ 100 ) */
57 char effect; /* 0-????????, 1-????????????, 2-???? */
58 char reserved2[8];
59 char filename[260 + 1]; // filename
60 unsigned char color[3]; //0 - red, 1 - green, 2 - blue
61 unsigned short flag; /* 0 - ????????, 1 - ????????, 2 - ??????, 3 - ???????? */
62 int range; /* 0-????, 1-????????, 3-??????, 4-?????? */
63 char reserved3[27];
64 int size;
65 char *data; // image data
66 bool isset;
67 } PaperBackInfo;
69 /* ???????? ???? */
70 /**
71 * Information of printing for chained page
73 typedef struct
75 unsigned char chain_page_no;
76 unsigned char chain_footnote_no;
77 unsigned char chain_filename[CHAIN_MAX_PATH];
78 } DocChainInfo;
80 /* ???? ???? */
81 /**
82 * Summary of document
84 struct HWPSummary
86 unsigned short title[56];
87 unsigned short subject[56];
88 unsigned short author[56];
89 unsigned short date[56];
90 unsigned short keyword[2][56];
91 unsigned short etc[3][56];
93 bool Read(HWPFile &);
96 /**
97 HWPInfo class?? HWPFile?? ???? ?????? ???? ???? ??????????.
98 ?????? ???? ???? ????????(layout) ?????? ????????????
99 ????????, ???? ???? ?????? ???????? ????. \\
101 HWPInfo ???????? HWPFile?? #GetHWPInfo()# ?????? ???? ???? ?? ????.
103 @memo Hwp ???? ????
106 * Contains the basic information of the hwp document:
107 * margin, layout, paper and internal data.
109 class DLLEXPORT HWPInfo
111 public:
113 * The column index of a document that is saved at last
115 short cur_col;
117 * The row index of a document that is saved at last
119 short cur_row;
121 * Paper Information
123 PaperInfo paper;
125 PaperBackInfo back_info;
127 * Sets the attribute of read-only or read/write.
129 short readonly;
130 unsigned char reserved1[4];
132 * Information about document chain
134 DocChainInfo chain_info;
135 unsigned char annotation[ANNOTATION_LEN];
136 short encrypted;
137 // unsigned char reserved2[6];
138 short beginpagenum; /* ?????????? ???? */
140 * Information about footnote
142 short beginfnnum; /* ???????????? */
143 short countfn; /* ???? ???? */
144 hunit splinetext, splinefn;
145 hunit spfnfn;
146 unsigned char fnchar;
147 unsigned char fnlinetype;
148 // layout info
150 * Information about page layout
152 hunit bordermargin[4];
153 short borderline;
155 unsigned char empty_line_hide;
156 unsigned char table_move;
157 unsigned char compressed;
158 unsigned char reserved3;
159 short info_block_len;
160 /* ?????????? 128 ?????????? */
162 * Summary of document
164 HWPSummary summary;
165 unsigned char *info_block;
167 HWPInfo(void);
168 ~HWPInfo(void);
170 bool Read(HWPFile &hwpf);
171 bool Write(CTextOut &txtf);
172 bool Write(CHTMLOut &html);
176 /* ???? ???? ?????? */
178 * @short Style of character
180 struct CharShape
183 * Index of character style
185 int index; /* ???????? ???????? ????. */
187 * Font size
189 hunit size;
190 unsigned char font[NLanguage];
191 unsigned char ratio[NLanguage];
192 signed char space[NLanguage]; /* ???? */
193 unsigned char color[2];
194 unsigned char shade;
195 unsigned char attr;
196 unsigned char reserved[4];
198 bool Read(HWPFile &);
201 /* ?? ?????? ???? ?????? */
203 #define MAXTABS 40
205 * @short Tab properties
207 typedef struct
209 unsigned char type;
210 unsigned char dot_continue;
211 hunit position;
212 } TabSet;
215 * @short Column properties
217 typedef struct
219 unsigned char ncols;
220 unsigned char separator;
221 hunit spacing;
222 hunit columnlen, columnlen0;
223 } ColumnDef;
226 * @short Style of paragraph
228 struct ParaShape
231 * Index of paragraph style
233 int index; /* ???????? ???????? ???? */
234 hunit left_margin;
235 hunit right_margin;
236 hunit indent;
237 hunit lspacing;
238 hunit pspacing_prev;
239 hunit pspacing_next;
240 unsigned char condense;
241 unsigned char arrange_type;
242 TabSet tabs[MAXTABS];
243 ColumnDef coldef;
244 unsigned char shade;
245 unsigned char outline;
246 unsigned char outline_continue;
247 unsigned char reserved[2];
248 CharShape *cshape;
249 unsigned char pagebreak;
251 bool Read(HWPFile &);
252 // virtual ~ParaShape();
254 #endif /* _HWPINFO_H_ */
256 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */