LibreOffice Module hwpfilter (master) 1
hinfo.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_HWPFILTER_SOURCE_HINFO_H
21#define INCLUDED_HWPFILTER_SOURCE_HINFO_H
22
23#include "hwplib.h"
24#include <string.h>
25
26#include <vector>
27#include <memory>
28
29#define CHAIN_MAX_PATH 40
30#define ANNOTATION_LEN 24
31
32class HWPFile;
33class CTextOut;
34class CHTMLOut;
35
39struct PaperInfo
40{
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)
64 {
65 }
66};
67
68/* 페이지 배경색, 배경그림 정보 */
70{
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;
86 : type(0)
87 , luminance(0)
88 , contrast(0)
89 , effect(0)
90 , flag(0)
91 , range(0)
92 , size(0)
93 , isset(false)
94 {
95 }
96};
97
98/* 연결인쇄 정보 */
103{
104 unsigned char chain_page_no;
105 unsigned char chain_footnote_no;
106 unsigned char chain_filename[CHAIN_MAX_PATH] = {};
108 : chain_page_no(0)
110 {
111 }
112};
113
114/* 문서 요약 */
119{
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];
126
127 bool Read(HWPFile &);
128};
129
144{
145 public:
149 short cur_col;
153 short cur_row;
158
163 short readonly;
164 unsigned char reserved1[4] = {};
169 unsigned char annotation[ANNOTATION_LEN] = {};
171// unsigned char reserved2[6];
172 short beginpagenum; /* 시작페이지 번호 */
176 short beginfnnum; /* 각주시작번호 */
177 short countfn; /* 각주 갯수 */
178 hunit splinetext, splinefn;
180 unsigned char fnchar;
181 unsigned char fnlinetype;
182// layout info
186 hunit bordermargin[4] = {};
188
189 unsigned char empty_line_hide;
190 unsigned char table_move;
191 unsigned char compressed;
192 unsigned char reserved3;
194/* 여기까지가 128 바이트이다 */
199 std::unique_ptr<unsigned char[]> info_block;
200
201 HWPInfo(void);
202 ~HWPInfo(void);
203
204 void Read(HWPFile &hwpf);
205
206};
207
208/* 글자 모양 구조체 */
213{
217 int index; /* 스타일의 인덱스를 저장. */
222 unsigned char color[2];
223 unsigned char font;
224 char space; /* 자간 */
225 unsigned char ratio;
226 unsigned char shade;
227 unsigned char attr;
228
229 void Read(HWPFile &);
230
231 CharShape();
232};
233
234/* 탭 설정에 대한 구조체 */
235
236#define MAXTABS 40
240struct TabSet
241{
242 unsigned char type;
243 unsigned char dot_continue;
246 : type(0)
247 , dot_continue(0)
248 , position(0)
249 {
250 }
251};
252
257{
258 unsigned char ncols;
259 unsigned char separator;
263 : ncols(0)
264 , separator(0)
265 , spacing(0)
266 , columnlen(0)
267 , columnlen0(0)
268 {
269 }
270};
271
276{
280 int index; /* 스타일의 인덱스를 저장 */
287 unsigned char condense;
288 unsigned char arrange_type;
290 std::shared_ptr<ColumnDef> xColdef;
291 unsigned char shade;
292 unsigned char outline;
293 unsigned char outline_continue;
294 unsigned char reserved[2];
295 std::shared_ptr<CharShape> cshape;
296 unsigned char pagebreak;
297
298 void Read(HWPFile &);
299
300 ParaShape();
301};
302#endif // INCLUDED_HWPFILTER_SOURCE_HINFO_H
303
304/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The HWPFile class is the main class of hwp for reading file information from stream.
Definition: hwpfile.h:98
HWPInfo class는 HWPFile에 대한 정보를 담고 있는 클래스이다.
Definition: hinfo.h:144
std::unique_ptr< unsigned char[]> info_block
Definition: hinfo.h:199
short countfn
Definition: hinfo.h:177
unsigned char compressed
Definition: hinfo.h:191
short cur_row
The row index of a document that is saved at last.
Definition: hinfo.h:153
short encrypted
Definition: hinfo.h:170
short beginpagenum
Definition: hinfo.h:172
short info_block_len
Definition: hinfo.h:193
unsigned char empty_line_hide
Definition: hinfo.h:189
PaperBackInfo back_info
Definition: hinfo.h:159
unsigned char table_move
Definition: hinfo.h:190
hunit splinefn
Definition: hinfo.h:178
hunit spfnfn
Definition: hinfo.h:179
short readonly
Sets the attribute of read-only or read/write.
Definition: hinfo.h:163
short beginfnnum
Information about footnote.
Definition: hinfo.h:176
HWPSummary summary
Summary of document.
Definition: hinfo.h:198
DocChainInfo chain_info
Information about document chain.
Definition: hinfo.h:168
PaperInfo paper
Paper Information.
Definition: hinfo.h:157
short cur_col
The column index of a document that is saved at last.
Definition: hinfo.h:149
unsigned char fnchar
Definition: hinfo.h:180
unsigned char fnlinetype
Definition: hinfo.h:181
short borderline
Definition: hinfo.h:187
unsigned char reserved3
Definition: hinfo.h:192
#define CHAIN_MAX_PATH
Definition: hinfo.h:29
#define ANNOTATION_LEN
Definition: hinfo.h:30
#define MAXTABS
Definition: hinfo.h:236
int hunit
Definition: hwplib.h:37
#define DLLEXPORT
Definition: hwplib.h:201
Style of character.
Definition: hinfo.h:213
int index
Index of character style.
Definition: hinfo.h:217
unsigned char font
Definition: hinfo.h:223
char space
Definition: hinfo.h:224
unsigned char attr
Definition: hinfo.h:227
void Read(HWPFile &)
Definition: hinfo.cxx:273
unsigned char ratio
Definition: hinfo.h:225
unsigned char shade
Definition: hinfo.h:226
hunit size
Font size.
Definition: hinfo.h:221
CharShape()
Definition: hinfo.cxx:261
Column properties.
Definition: hinfo.h:257
unsigned char separator
Definition: hinfo.h:259
hunit columnlen
Definition: hinfo.h:261
hunit columnlen0
Definition: hinfo.h:261
ColumnDef()
Definition: hinfo.h:262
unsigned char ncols
Definition: hinfo.h:258
hunit spacing
Definition: hinfo.h:260
Information of printing for chained page.
Definition: hinfo.h:103
unsigned char chain_filename[CHAIN_MAX_PATH]
Definition: hinfo.h:106
DocChainInfo()
Definition: hinfo.h:107
unsigned char chain_footnote_no
Definition: hinfo.h:105
unsigned char chain_page_no
Definition: hinfo.h:104
Summary of document.
Definition: hinfo.h:119
unsigned short title[56]
Definition: hinfo.h:120
unsigned short subject[56]
Definition: hinfo.h:121
unsigned short date[56]
Definition: hinfo.h:123
unsigned short keyword[2][56]
Definition: hinfo.h:124
bool Read(HWPFile &)
Definition: hinfo.cxx:175
unsigned short etc[3][56]
Definition: hinfo.h:125
unsigned short author[56]
Definition: hinfo.h:122
char effect
Definition: hinfo.h:75
int luminance
Definition: hinfo.h:73
unsigned short flag
Definition: hinfo.h:79
char reserved2[8]
Definition: hinfo.h:76
char reserved1[8]
Definition: hinfo.h:72
PaperBackInfo()
Definition: hinfo.h:85
int size
Definition: hinfo.h:82
bool isset
Definition: hinfo.h:84
char type
Definition: hinfo.h:71
char reserved3[27]
Definition: hinfo.h:81
int contrast
Definition: hinfo.h:74
std::vector< char > data
Definition: hinfo.h:83
int range
Definition: hinfo.h:80
char filename[260+1]
Definition: hinfo.h:77
Style of paragraph.
Definition: hinfo.h:276
hunit right_margin
Definition: hinfo.h:282
ParaShape()
Definition: hinfo.cxx:190
void Read(HWPFile &)
Definition: hinfo.cxx:210
unsigned char condense
Definition: hinfo.h:287
hunit pspacing_next
Definition: hinfo.h:286
hunit left_margin
Definition: hinfo.h:281
std::shared_ptr< CharShape > cshape
Definition: hinfo.h:295
unsigned char outline
Definition: hinfo.h:292
TabSet tabs[MAXTABS]
Definition: hinfo.h:289
unsigned char pagebreak
Definition: hinfo.h:296
unsigned char arrange_type
Definition: hinfo.h:288
hunit indent
Definition: hinfo.h:283
unsigned char outline_continue
Definition: hinfo.h:293
unsigned char reserved[2]
Definition: hinfo.h:294
int index
Index of paragraph style.
Definition: hinfo.h:280
hunit lspacing
Definition: hinfo.h:284
hunit pspacing_prev
Definition: hinfo.h:285
std::shared_ptr< ColumnDef > xColdef
Definition: hinfo.h:290
unsigned char shade
Definition: hinfo.h:291
Tab properties.
Definition: hinfo.h:241
hunit position
Definition: hinfo.h:244
unsigned char dot_continue
Definition: hinfo.h:243
TabSet()
Definition: hinfo.h:245
unsigned char type
Definition: hinfo.h:242