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