1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
|
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
/* $Id: hbox.h,v 1.6 2008-06-04 09:56:30 vg Exp $ */
#ifndef _HBOX_H_
#define _HBOX_H_
#include "list.hxx"
#include "hwplib.h"
#include "hwpfile.h"
#include "hinfo.h"
#include "hpara.h"
/**
* The HBox class is the base class for all date classes in hwp document.
* For example, there are special character, table, image, etc.
* It has one character. The ascii code value of special characters are smaller than 32. General character is greater than 32.
*
* @short Base class for characters
*/
struct HBox
{
public:
hchar hh;
/**
* Construct a HBox object with parameter hch.
* @param hch 16bit character being able to have Korean character.
*/
HBox( hchar hch );
virtual ~HBox();
/**
* @returns The Size of HBox object
*/
virtual int WSize();
/**
* @returns The Height of HBox object as hunit value.
*/
virtual hunit Height(CharShape *csty);
/**
* Read properties from HIODevice object like stream, file, memory.
*
* @param hwpf HWPFile Object having all information for a hwp file.
* @returns True if reading from stream is successful.
*/
virtual int Read(HWPFile &hwpf);
/**
* @param hstr Buffer to save string
* @param slen Size of buffer
* @returns The string having each proper format by pointer
*/
virtual int GetString(hchar *hstr, int slen = 255);
private:
static int boxCount;
};
/**
* @short Class for saving data to be skipped.
*/
struct SkipBlock: public HBox
{
ulong data_block_len;
hchar dummy;
char *data_block;
SkipBlock(hchar);
virtual ~SkipBlock();
virtual int Read(HWPFile &hwpf);
};
struct DateCode;
struct FieldCode : public HBox
{
uchar type[2]; /* 2/0 - , 3/0-, 3/1-, 3/2-糯¥, 4/0-Ʋ */
char *reserved1;
unsigned short location_info; /* 0 - ڵ, 1 - ڵ */
char *reserved2;
hchar *str1;
hchar *str2;
hchar *str3;
char *bin;
DateCode *m_pDate;
FieldCode();
virtual ~FieldCode();
virtual int Read(HWPFile &hwpf);
};
/**
* Kind of BOOKMARK
*/
enum
{
BM_MARK,
BM_BEGIN,
BM_END
};
#define BMK_COMMENT_LEN 15
/**
* @short Class for BOOKMARK
*/
struct Bookmark: public HBox
{
hchar dummy;
hchar id[BMK_COMMENT_LEN + 1];
unsigned short type;
Bookmark();
virtual ~Bookmark();
virtual int Read(HWPFile &hwpf);
};
// date format(7)
const int DATE_SIZE = 40;
/**
* @short Class for saving date format made by user
*/
struct DateFormat: public HBox
{
hchar format[DATE_SIZE];
hchar dummy;
DateFormat();
virtual int Read(HWPFile &hwpf);
};
/**
* @short Class for current date and time with specified format.
*/
struct DateCode: public HBox
{
enum
{
YEAR, MONTH, WEEK, DAY, HOUR, MIN
};
hchar format[DATE_SIZE];
/**
* year/month/week/day/hour/minute
*/
short date[6];
hchar dummy;
unsigned char key;
DateCode();
virtual int Read(HWPFile &hwpf);
/**
* @returns Length of date string
*/
virtual int GetString(hchar *hstr, int slen = 255);
};
/**
* @short Tab object
*/
struct Tab: public HBox
{
hunit width;
unsigned short leader;
hchar dummy;
Tab();
virtual int Read(HWPFile &hwpf);
};
// tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
enum ttype { TBL_TYPE, TXT_TYPE, EQU_TYPE, BUTTON_TYPE, HYPERTEXT_TYPE };
enum /* TxtBox->margin[n][?] */
{
OUT_M, IN_M, CELL_M
};
enum /* TxtBox->margin[?][n] */
{
L_M, R_M, T_M, B_M
};
enum anchor { CHAR_ANCHOR, PARA_ANCHOR, PAGE_ANCHOR, PAPER_ANCHOR };
enum { TF_OCCUPY_SPACE, TF_TRANSPARENT,TF_ARROUND_TEXT };
enum
{
CAP_OUT_BOT, CAP_OUT_TOP, CAP_IN_BOT, CAP_IN_TOP,
CAP_LEFT_BOT, CAP_LEFT_TOP, CAP_RIGHT_BOT, CAP_RIGHT_TOP,
EQU_CAP_POS
};
/**
* Definitions for frame's common 'option' member.
*/
#define DRAW_FRAME 1 /* <-> no frame, bit 0 */
#define NORMAL_PIC 2 /* <-> reverse, bit 1 */
#define FIT_TO_COLUMN 4 /* fig_xs is columnlen */
#define UNKNOWN_FILE 8 /* need check reverse for pcx mono */
#define HYPERTEXT_FLAG 16
#define UNKNOWN_SIZE 32
#define FOPT_TEMP_BIT 0x00010000 /* temporary starts from 16th bits */
struct CellLine
{
unsigned char key;
unsigned char top; // 0 - ξ, 1-single, 2-thick, 3-double
unsigned char bottom;
unsigned char left;
unsigned char right;
short color; // cell color
unsigned char shade; // <100%
};
/**
* A cell has four properties to specify the position for itself in hwp.
* @li xpos - distance between left border of cell and left border of table
* @li ypos - distance between top border of cell and top border of table
* @li width - distance between left border of cell and right border of cell
* @li height - distance between top border of cell and bottom border of table
* This is differ from the format of other office in fact cell has two properties
* - rowindex and column index.
*
* @short Cell object
*/
struct Cell // Cell
{
unsigned char key; // Index value of border style
short p;
short color; // cell color
short x, y; // [x,y] cell pos
short w, h; // [x,y] cell size
short txthigh, cellhigh; // used maximum
unsigned char flag, changed, used; // unused(file)
unsigned char ver_align; // vertical align {1=center}
unsigned char linetype[4]; // [left,right,top,bottom]
unsigned char shade; // <100%
unsigned char diagonal; // { 0=none,\=1,/=2,X=3}
unsigned char protect;
void Read( HWPFile &hwpf );
};
/**
* @short Style for floating object
*/
struct FBoxStyle
{
/**
* Anchor type : paragraph , page, char
*/
unsigned char anchor_type;
/**
* Kind of wrap
*/
unsigned char txtflow; /* . 0-2(ڸ,,︲) */
/**
* Horizontal alignment
*/
short xpos; // left, right, center, xx
/**
* Vertical alignment
*/
short ypos; // page top, bottom, yy
/**
* Every margin of border
* [0-2][] : out/in/cell margin
* [][0-3] : left/right/top/bottom
*/
short margin[3][4]; // out : left, right, top, bottom
/**
* Index of floating object
*/
short boxnum; /* Ÿǽ Ÿ ̸ */
/**
* Type of floating object : line, txtbox, image, table, equalizer and button
*/
unsigned char boxtype; // (L)ine, t(X)tbox, Picture - (G)
short cap_len; /* ĸ */
void *cell;
};
/**
* This object is for floating object like table, image, line and so on.
*
* @short floating object
*/
struct FBox: public HBox
{
int zorder;
short option; // draw frame
hchar ctrl_ch;
FBoxStyle style;
short box_xs, box_ys;
short cap_xs, cap_ys ;
short xs, ys; // ys = fig_ys + cap_ys + margin
// xs = fig_xs + cap_xs + margin
short cap_margin;
char xpos_type, ypos_type;
unsigned char smart_linesp;
/* ڷ tbox pic Ͽ ʰ ø ,
line Ͽ Ѵ.
*/
short boundsy, boundey;
unsigned char boundx, draw;
/**
* Physical x,y position.
*/
short pgx, pgy; // physical xpos, ypos
short pgno, showpg; // pageno where code is
FBox *prev, *next;
FBox( hchar hch );
virtual ~FBox();
};
struct Table;
/**
* The TxtBox class saves object properties about table, textbox, equalizer or button
*/
struct TxtBox: public FBox
{
hchar reserved[2];
hchar dummy;
short dummy1; // to not change structure size */
short cap_len;
short next;
short dummy2; // to not change structure size */
unsigned char reserved1;
/**
* caption position
*/
short cap_pos; // caption pos
short num; // numbering
short dummy3;
short baseline; //(for equ)
/**
* The value of type indicates as the below: zero is table, one is
* textbox, two is equalizer and three is button.
*/
short type; // 0-table, 1-textbox, 2-, 3-button
/**
* nCell is greater than one only for table, otherwise it is 1.
*/
short nCell; //:=1 offset 80
/**
* If value of protect is 1, size of cell cann't change.
*/
short protect; //1=size lock
Cell *cell;
Table *m_pTable;
/**
* Paragraph list
*/
LinkedList<HWPPara> *plists;
/**
* Caption
*/
LinkedList<HWPPara> caption;
TxtBox();
virtual ~TxtBox();
/**
* @returns Count of cell.
*/
virtual int NCell() { return nCell; }
/**
* This is one of table, text-box, equalizer and button
* @returns Type of this object.
*/
virtual int Type() { return type; }
virtual int Read(HWPFile &hwpf);
virtual hunit Height(CharShape *csty);
};
#define ALLOWED_GAP 5
#define INIT_SIZE 20
#define ADD_AMOUNT 10
struct Columns
{
int *data;
int nCount;
int nTotal;
Columns(){
nCount = 0;
nTotal = INIT_SIZE;
data = new int[nTotal];
}
~Columns(){ delete[] data; }
void AddColumnsSize(){
int *tmp = data;
data = new int[nTotal + ADD_AMOUNT];
for( int i = 0 ; i < nTotal ; i++ )
data[i] = tmp[i];
nTotal += ADD_AMOUNT;
delete[] tmp;
}
void insert(int pos){
if( nCount == 0 ){
data[nCount++] = pos;
return;
}
for( int i = 0 ; i < nCount; i++ ){
if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
return; // Already exist;
if( pos < data[i] ){
if( nCount == nTotal )
AddColumnsSize();
for( int j = nCount ; j > i ; j-- )
data[j] = data[j-1];
data[i] = pos;
nCount++;
return;
}
}
// last postion.
if( nCount == nTotal )
AddColumnsSize();
data[nCount++] = pos;
}
int getIndex(int pos)
{
if( pos == 0 )
return 0;
for( int i = 0 ; i < nCount; i++){
if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
return i;
}
return -1;
}
};
struct Rows
{
int *data;
int nCount;
int nTotal;
Rows(){
nCount = 0;
nTotal = INIT_SIZE;
data = new int[nTotal];
}
~Rows(){ delete[] data; }
void AddRowsSize(){
int *tmp = data;
data = new int[nTotal + ADD_AMOUNT];
for( int i = 0 ; i < nTotal ; i++ )
data[i] = tmp[i];
nTotal += ADD_AMOUNT;
delete[] tmp;
}
void insert(int pos){
if( nCount == 0 ){
data[nCount++] = pos;
return;
}
for( int i = 0 ; i < nCount; i++ ){
if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
return; // Already exist;
if( pos < data[i] ){
if( nCount == nTotal )
AddRowsSize();
for( int j = nCount ; j > i ; j-- )
data[j] = data[j-1];
data[i] = pos;
nCount++;
return;
}
}
// last postion.
if( nCount == nTotal )
AddRowsSize();
data[nCount++] = pos;
}
int getIndex(int pos)
{
if( pos == 0 )
return 0;
for( int i = 0 ; i < nCount; i++){
if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
return i;
}
return -1;
}
};
struct TCell
{
int nColumnIndex;
int nRowIndex;
int nColumnSpan;
int nRowSpan;
Cell *pCell;
};
struct Table
{
Table(){};
~Table(){
LinkedListIterator<TCell> it(&cells);
for( ; it.current(); it++)
delete it.current();
};
Columns columns;
Rows rows;
LinkedList<TCell> cells;
TxtBox *box;
};
/* picture (11) , OLE, Ա, */
enum pictype
{
PICTYPE_FILE, PICTYPE_OLE, PICTYPE_EMBED,
PICTYPE_DRAW, PICTYPE_UNKNOWN
};
/**
* @short External image file
*/
struct PicDefFile
{
char path[256];
void *img;
bool skipfind;
};
/**
* @short Embeded image file
*/
struct PicDefEmbed
{
char embname[16];
};
/**
* @short Win32 ole object
*/
struct PicDefOle
{
char embname[16];
void *hwpole;
};
/**
* @short Drawing object of hwp
*/
struct PicDefDraw
{
void *hdo;
uint zorder;
ZZRect vrect;
int mbrcnt;
};
/**
* @short For using common case
*/
struct PicDefUnknown
{
char path[256];
};
typedef union
{
PicDefFile picfile;
PicDefEmbed picembed;
PicDefOle picole;
PicDefDraw picdraw;
PicDefUnknown picun;
} PicDef;
#define PIC_INFO_LEN 348
/**
* There are four kinds of image.
* @li External image
* @li Embeded image
* @li Win32 ole object
* @li Drawing object of hwp
*
* @short Image object
*/
struct Picture: public FBox
{
hchar reserved[2];
hchar dummy;
/**
* follow_block_size is the size information of the Drawing object of hwp.
* It's value is greater than 0 if the pictype is PICTYPE_DRAW.
*/
ulong follow_block_size; /* ߰ . */
short dummy1; // to not change structure size */
short dummy2; // to not change structure size */
uchar reserved1;
/**
* Position of caption
*/
short cap_pos; // caption pos
/**
* Index of current Picture object
*/
short num; // numbering
/**
* Type of this object
* It is one of external/ole/embeded/drawing picture
*/
uchar pictype;
hunit skip[2];
/**
* Ratio of magnification or reduction.
*/
hunit scale[2];
PicDef picinfo;
char reserved3[9];
LinkedList<HWPPara> caption;
/**
* It's for the Drawing object
*/
unsigned char *follow; /* drawing϶, ߰. */
bool ishyper;
Picture();
virtual ~Picture();
virtual int Type ();
virtual int Read (HWPFile &hwpf);
virtual hunit Height (CharShape *sty);
};
// line (14)
/**
* @short Line
*/
struct Line: public FBox
{
hchar reserved[2];
hchar dummy;
char reserved2[8];
short sx, sy, ex, ey;
short width, shade, color;
Line();
virtual int Read(HWPFile &hwpf);
};
// hidden(15)
/**
* @short Hidden section
*/
struct Hidden: public HBox
{
hchar reserved[2];
hchar dummy;
unsigned char info[8]; // h, next, dummy
LinkedList<HWPPara> plist;
Hidden();
virtual ~Hidden();
virtual int Read(HWPFile &hwpf);
};
/**
* @short Header or footer
*/
struct HeaderFooter: public HBox
{
hchar reserved[2];
hchar dummy;
unsigned char info[8];
/**
* Header or footer
*/
unsigned char type;
unsigned char where;
unsigned char linenumber;
unsigned int m_nPageNumber;
/**
* Paragraph list of header or footer
*/
LinkedList<HWPPara> plist;
HeaderFooter();
virtual ~HeaderFooter();
virtual int Read(HWPFile &hwpf);
};
/**
* Both footnote and endnote are comment. Footnote is located at the end of paragraph; endnote is located at the end of page. The Footnote class represents footnote and endnote.
* @short Footnote or endnote
*/
struct Footnote: public HBox
{
hchar reserved[2];
hchar dummy;
unsigned char info[8];
/**
* The number of current footnote/endnote
*/
unsigned short number;
/**
* Set the type of Footnote either footnote or endnote.
*/
unsigned short type;
/**
* The width of the Footnote object.
*/
hunit width;
/**
* Paragraph list of Footnote objects
*/
LinkedList<HWPPara> plist;
Footnote();
virtual ~Footnote();
virtual int Read(HWPFile &hwpf);
};
// auto number(18)
/**
* Kind of auto input number
*/
enum
{
PGNUM_AUTO,
FNNUM_AUTO,
ENNUM_AUTO,
PICNUM_AUTO,
TBLNUM_AUTO,
EQUNUM_AUTO
};
/**
* @short Input current index of page,comment,table and picture.
*/
struct AutoNum: public HBox
{
unsigned short type;
unsigned short number;
hchar dummy;
AutoNum();
virtual int Read(HWPFile &hwpf);
};
/**
* @short Input new number as current index of page,comment,table and picture.
*/
struct NewNum: public HBox
{
unsigned short type;
unsigned short number;
hchar dummy;
NewNum();
virtual int Read(HWPFile &hwpf);
};
// page numger(20)
/**
* @short Input page index in footer or header
*/
struct ShowPageNum: public HBox
{
/**
* Location of page number to be inserted.
*/
unsigned short where;
unsigned int m_nPageNumber;
/**
* Shape of page number to be inserted.
*/
unsigned short shape;
hchar dummy;
ShowPageNum();
virtual int Read(HWPFile &hwpf);
};
/* Ȧʽ (21) */
#define HIDE_HD 1 /* bit 0 */
#define HIDE_FT 2 /* bit 1 */
#define HIDE_PGNUM 4 /* bit 2 */
#define HIDE_FRAME 8 /* bit 3 */
/**
* Controls the display of page number, header, footer and border.
*/
struct PageNumCtrl: public HBox
{
/**
* object type
*/
unsigned short kind;
/**
* control command.
*/
unsigned short what;
hchar dummy;
PageNumCtrl();
virtual int Read(HWPFile &hwpf);
};
// mail merge(22)
/**
* Generates the mailing list automatically using address book and mail body format.
* @short Generates mailing list
*/
struct MailMerge: public HBox
{
unsigned char field_name[20];
hchar dummy;
MailMerge();
virtual int Read(HWPFile &hwpf);
virtual int GetString(hchar *, int slen = 255);
};
// char compositon(23)
/**
* The compose struct displays characters at position. The maximum character count for composition is three.
* @short Composition several characters
*/
struct Compose: public HBox
{
hchar compose[3];
hchar dummy;
Compose();
virtual int Read(HWPFile &hwpf);
};
// hyphen(24)
/**
* @short Hyphen
*/
struct Hyphen: public HBox
{
/**
* Width of hyphen
*/
hchar width;
hchar dummy;
Hyphen();
virtual int Read(HWPFile &hwpf);
};
// toc mark(25)
/**
* The TocMark class is for making the content of a table.
* When you set TocMark on current position, hwp makes it as toc automatically.
* @short Table of contents
*/
struct TocMark: public HBox
{
hchar kind;
hchar dummy;
TocMark();
virtual int Read(HWPFile &hwpf);
};
// index mark(26)
/**
* IndexMark marks the table of search.
* If you set IndexMark at current position, hwp make it as search index.
* @short Table of search
*/
struct IndexMark: public HBox
{
hchar keyword1[60];
hchar keyword2[60];
unsigned short pgno;
hchar dummy;
IndexMark();
virtual int Read(HWPFile &hwpf);
};
// outline(28)
#define MAX_OUTLINE_LEVEL 7
enum
{
OLSTY_USER = 0,
OLSTY_NUMS1 = 1,
OLSTY_NUMS2 = 2,
OLSTY_NUMSIG1 = 3,
OLSTY_NUMSIG2 = 4,
OLSTY_NUMSIG3 = 5,
OLSTY_BULUSER = 128,
OLSTY_BULLET1 = 129,
OLSTY_BULLET2 = 130,
OLSTY_BULLET3 = 131,
OLSTY_BULLET4 = 132,
OLSTY_BULLET5 = 133
};
// value is in style->userchar[level];
enum
{
UDO_NUM,
UDO_UROM,
UDO_LROM,
UDO_UENG,
UDO_LENG,
UDO_SYLL,
UDO_JAMO,
UDO_HANJA,
UDO_SP_CNUM,
UDO_SP_CLENG,
UDO_SP_CSYLL,
UDO_SP_CJAMO,
N_UDO
};
/**
* Number and format of title.
* @short Number and format of title
*/
class Outline: public HBox
{
public:
/**
* kind of numbering format
*/
unsigned short kind;
unsigned char shape;
/**
* level of number, Ex) The level of 1.3.2.4 is four
*/
unsigned char level;
/**
* value of level
*/
unsigned short number[MAX_OUTLINE_LEVEL];
/**
* shape of level
*/
hchar user_shape[MAX_OUTLINE_LEVEL];
/**
* decoration charactor for the level type
*/
hchar deco[MAX_OUTLINE_LEVEL][2]; /* ǽ յ */
hchar dummy;
Outline();
virtual int Read(HWPFile &hwpf);
hchar *GetUnicode(hchar *, int slen = 255);
};
/* ĭ(30) */
/**
* The Special space to be treated non-space when a string is
* cut at the end of line
* @short Special space
*/
struct KeepSpace: public HBox
{
hchar dummy;
KeepSpace();
virtual int Read(HWPFile &hwpf);
};
/* ĭ(31) */
/**
* @short Space with always same width not relation with fonts.
*/
struct FixedSpace: public HBox
{
hchar dummy;
FixedSpace();
virtual int Read(HWPFile &hwpf);
};
#endif /* _HBOX_H_ */
|