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