LCOV - code coverage report
Current view: top level - hwpfilter/source - hbox.h (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 106 0.0 %
Date: 2014-04-11 Functions: 0 46 0.0 %
Legend: Lines: hit not hit

          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 <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             :         virtual 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             :     ulong 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             : /**
     203             :  * Definitions for frame's common 'option' member.
     204             :  */
     205             : #define DRAW_FRAME      1                         /* <-> no frame, bit 0 */
     206             : #define NORMAL_PIC      2                         /* <-> reverse,  bit 1 */
     207             : #define FIT_TO_COLUMN   4                         /* fig_xs is columnlen */
     208             : #define UNKNOWN_FILE    8                         /* need check reverse for pcx mono */
     209             : #define HYPERTEXT_FLAG  16
     210             : #define UNKNOWN_SIZE    32
     211             : #define FOPT_TEMP_BIT   0x00010000                /* temporary starts from 16th bits */
     212             : 
     213             : struct CellLine
     214             : {
     215             :     unsigned char key;
     216             :     unsigned char top;                            // 0 - ¶óÀξøÀ½, 1-single, 2-thick, 3-double
     217             :     unsigned char bottom;
     218             :     unsigned char left;
     219             :     unsigned char right;
     220             :     short color;                                  // cell color
     221             :     unsigned char shade;                          // <100%
     222             : };
     223             : /**
     224             :  * A cell has four properties to specify the position for itself in hwp.
     225             :  * @li xpos -  distance between left border of cell and left border of table
     226             :  * @li ypos -  distance between top border of cell and top border of table
     227             :  * @li width -  distance between left border of cell and right border of cell
     228             :  * @li height -  distance between top border of cell and bottom border of table
     229             :  * This is differ from the format of other office in fact cell has two properties
     230             :  * - rowindex and column index.
     231             :  *
     232             :  * @short Cell object
     233             :  */
     234             : struct Cell                                       // Cell
     235             : {
     236             :     unsigned char key;                            // Index value of border style
     237             :     short     p;
     238             :     short     color;                              // cell color
     239             :     short     x, y;                               // [x,y] cell pos
     240             :     short     w, h;                               // [x,y] cell size
     241             :     short     txthigh, cellhigh;                  // used maximum
     242             :     unsigned char flag, changed, used;            // unused(file)
     243             :     unsigned char ver_align;                      // vertical align  {1=center}
     244             :     unsigned char linetype[4];                    // [left,right,top,bottom]
     245             :     unsigned char shade;                          // <100%
     246             :     unsigned char diagonal;                       // { 0=none,\=1,/=2,X=3}
     247             :     unsigned char protect;
     248             : 
     249             :     void  Read( HWPFile &hwpf );
     250             : };
     251             : 
     252             : /**
     253             :  * @short Style for floating object
     254             :  */
     255             : struct FBoxStyle
     256             : {
     257             : /**
     258             :  * Anchor type : paragraph , page, char
     259             :  */
     260             :     unsigned char anchor_type;
     261             : /**
     262             :  * Kind of wrap
     263             :  */
     264             :     unsigned char txtflow;                        /* ±×¸²ÇÇÇÔ. 0-2(ÀÚ¸®Â÷Áö,Åõ¸í,¾î¿ï¸²) */
     265             : /**
     266             :  * Horizontal alignment
     267             :  */
     268             :     short     xpos;                               // left, right, center, xx
     269             : /**
     270             :  * Vertical alignment
     271             :  */
     272             :     short     ypos;                               // page top, bottom, yy
     273             : /**
     274             :  * Every margin of border
     275             :  * [0-2][] : out/in/cell margin
     276             :  * [][0-3] : left/right/top/bottom
     277             :  */
     278             :     short     margin[3][4];                       // out : left, right, top, bottom
     279             : /**
     280             :  * Index of floating object
     281             :  */
     282             :     short     boxnum;                             /* ½ºÅ¸¿ÀÇǽº¿¡¼­ ½ºÅ¸ÀÏ À̸§À¸·Î »ç¿ëµÉ ¼ýÀÚ */
     283             : /**
     284             :  * Type of floating object : line, txtbox, image, table, equalizer and button
     285             :  */
     286             :     unsigned char boxtype;                        // (L)ine, t(X)tbox, Picture - (G)
     287             :     short     cap_len; /* ĸ¼ÇÀÇ ±æÀÌ */
     288             : 
     289             :     void *cell;
     290             : 
     291             : };
     292             : 
     293             : /**
     294             :  * This object is for floating object like table, image, line and so on.
     295             :  *
     296             :  * @short floating object
     297             :  */
     298             : struct FBox: public HBox
     299             : {
     300             :     int zorder;
     301             :     short     option;                             // draw frame
     302             :     hchar     ctrl_ch;
     303             :     FBoxStyle style;
     304             : 
     305             :     short     box_xs, box_ys;
     306             :     short     cap_xs, cap_ys ;
     307             :     short     xs, ys;                             // ys = fig_ys + cap_ys + margin
     308             : // xs = fig_xs + cap_xs + margin
     309             :     short     cap_margin;
     310             :     char      xpos_type, ypos_type;
     311             :     unsigned char smart_linesp;
     312             : 
     313             : /*  ÀÌ ÀÚ·á´Â tbox³ª pic¿¡¼­´Â ÆÄÀÏ¿¡ ±â·ÏÇÏÁö ¾Ê°í ½ÇÇà½Ã¸¸ ÀÖÀ¸¸ç,
     314             :     line¿¡¼­´Â ÆÄÀÏ¿¡ ±â·ÏÇÑ´Ù.
     315             :  */
     316             :     short     boundsy, boundey;
     317             :     unsigned char boundx, draw;
     318             : 
     319             : /**
     320             :  * Physical x,y position.
     321             :  */
     322             :     short     pgx, pgy;                           // physical xpos, ypos
     323             :     short     pgno, showpg;                       // pageno where code is
     324             : 
     325             :     FBox      *prev, *next;
     326             : 
     327             :     FBox( hchar hch );
     328             :     virtual ~FBox();
     329             : };
     330             : 
     331             : struct Table;
     332             : /**
     333             :  * The TxtBox class saves object properties about table, textbox, equalizer or button
     334             :  */
     335             : struct TxtBox: public FBox
     336             : {
     337             :     hchar     reserved[2];
     338             :     hchar     dummy;
     339             : 
     340             :     short     dummy1;                             // to not change structure size */
     341             :     short     cap_len;
     342             :     short     next;
     343             :     short     dummy2;                             // to not change structure size */
     344             :     unsigned char reserved1;
     345             : /**
     346             :  * caption position
     347             :  */
     348             :     short     cap_pos;                            // caption pos
     349             :     short     num;                                // numbering
     350             : 
     351             :     short     dummy3;
     352             :     short     baseline;                           //(for equ)
     353             : 
     354             : /**
     355             :  * The value of type indicates as the below: zero is table, one is
     356             :  * textbox, two is equalizer and three is button.
     357             :  */
     358             :     short     type;                               // 0-table, 1-textbox, 2-¼ö½Ä, 3-button
     359             : /**
     360             :  * nCell is greater than one only for table, otherwise it is 1.
     361             :  */
     362             :     short     nCell;                              //:=1    offset 80
     363             : /**
     364             :  * If value of protect is 1, size of cell cann't change.
     365             :  */
     366             :     short     protect;                            //1=size lock
     367             : 
     368             :     Cell      *cell;
     369             :      Table *m_pTable;
     370             : /**
     371             :  * Paragraph list
     372             :  */
     373             :     std::list<HWPPara*> *plists;
     374             : /**
     375             :  * Caption
     376             :  */
     377             :     std::list<HWPPara*> caption;
     378             : 
     379             :     TxtBox();
     380             :     virtual ~TxtBox();
     381             : 
     382             : /**
     383             :  * @returns Count of cell.
     384             :  */
     385           0 :     virtual int NCell()   { return nCell; }
     386             : /**
     387             :  * This is one of table, text-box, equalizer and button
     388             :  * @returns Type of this object.
     389             :  */
     390           0 :     virtual int Type()    { return type;  }
     391             : 
     392             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     393             : 
     394             :     virtual hunit  Height(CharShape *csty) SAL_OVERRIDE;
     395             : };
     396             : 
     397             : #define ALLOWED_GAP 5
     398             : #define INIT_SIZE 20
     399             : #define ADD_AMOUNT 10
     400             : 
     401             : struct Columns
     402             : {
     403             :      int *data;
     404             :      size_t nCount;
     405             :      size_t nTotal;
     406           0 :      Columns(){
     407           0 :           nCount = 0;
     408           0 :           nTotal = INIT_SIZE;
     409           0 :           data = new int[nTotal];
     410           0 :      }
     411           0 :      ~Columns(){ delete[] data; }
     412             : 
     413           0 :      void AddColumnsSize(){
     414           0 :           int *tmp = data;
     415           0 :           if (nTotal + ADD_AMOUNT < nTotal) // overflow
     416             :           {
     417           0 :               throw ::std::bad_alloc();
     418             :           }
     419           0 :           data = new int[nTotal + ADD_AMOUNT];
     420           0 :           for (size_t i = 0 ; i < nTotal ; i++)
     421           0 :                 data[i] = tmp[i];
     422           0 :           nTotal += ADD_AMOUNT;
     423           0 :           delete[] tmp;
     424           0 :      }
     425             : 
     426           0 :      void insert(int pos){
     427           0 :           if( nCount == 0 ){
     428           0 :                 data[nCount++] = pos;
     429           0 :                 return;
     430             :           }
     431           0 :           for (size_t i = 0 ; i < nCount; i++ ) {
     432           0 :                 if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
     433           0 :                      return;  // Already exist;
     434           0 :                 if( pos < data[i] ){
     435           0 :                      if( nCount == nTotal )
     436           0 :                           AddColumnsSize();
     437           0 :                      for (size_t j = nCount ; j > i ; j--)
     438           0 :                           data[j] = data[j-1];
     439           0 :                      data[i] = pos;
     440           0 :                      nCount++;
     441           0 :                      return;
     442             :                 }
     443             :           }
     444             :           // last postion.
     445           0 :           if( nCount == nTotal )
     446           0 :                 AddColumnsSize();
     447           0 :           data[nCount++] = pos;
     448             :      }
     449             : 
     450           0 :      int getIndex(int pos)
     451             :      {
     452           0 :           if( pos == 0 )
     453           0 :                 return 0;
     454           0 :           for (size_t i = 0 ; i < nCount; i++) {
     455           0 :                 if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
     456           0 :                      return i;
     457             :           }
     458           0 :           return -1;
     459             :      }
     460             : };
     461             : 
     462             : struct Rows
     463             : {
     464             :      int *data;
     465             :      size_t nCount;
     466             :      size_t nTotal;
     467           0 :      Rows(){
     468           0 :           nCount = 0;
     469           0 :           nTotal = INIT_SIZE;
     470           0 :           data = new int[nTotal];
     471           0 :      }
     472           0 :      ~Rows(){ delete[] data; }
     473             : 
     474           0 :      void AddRowsSize(){
     475           0 :           int *tmp = data;
     476           0 :           if (nTotal + ADD_AMOUNT < nTotal) // overflow
     477             :           {
     478           0 :               throw ::std::bad_alloc();
     479             :           }
     480           0 :           data = new int[nTotal + ADD_AMOUNT];
     481           0 :           for (size_t i = 0 ; i < nTotal ; i++)
     482           0 :                 data[i] = tmp[i];
     483           0 :           nTotal += ADD_AMOUNT;
     484           0 :           delete[] tmp;
     485           0 :      }
     486             : 
     487           0 :      void insert(int pos){
     488           0 :           if( nCount == 0 ){
     489           0 :                 data[nCount++] = pos;
     490           0 :                 return;
     491             :           }
     492           0 :           for (size_t i = 0 ; i < nCount; i++) {
     493           0 :                 if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
     494           0 :                      return;  // Already exist;
     495           0 :                 if( pos < data[i] ){
     496           0 :                      if( nCount == nTotal )
     497           0 :                           AddRowsSize();
     498           0 :                      for (size_t j = nCount ; j > i ; j--)
     499           0 :                           data[j] = data[j-1];
     500           0 :                      data[i] = pos;
     501           0 :                      nCount++;
     502           0 :                      return;
     503             :                 }
     504             :           }
     505             :           // last postion.
     506           0 :           if( nCount == nTotal )
     507           0 :                 AddRowsSize();
     508           0 :           data[nCount++] = pos;
     509             :      }
     510             : 
     511           0 :      int getIndex(int pos)
     512             :      {
     513           0 :           if( pos == 0 )
     514           0 :                 return 0;
     515           0 :           for (size_t i = 0 ; i < nCount; i++) {
     516           0 :                 if( pos < data[i] + ALLOWED_GAP && pos > data[i] - ALLOWED_GAP )
     517           0 :                      return i;
     518             :           }
     519           0 :           return -1;
     520             :      }
     521             : };
     522             : 
     523             : struct TCell
     524             : {
     525             :      int nColumnIndex;
     526             :      int nRowIndex;
     527             :      int nColumnSpan;
     528             :      int nRowSpan;
     529             :      Cell *pCell;
     530             : };
     531             : 
     532             : struct Table
     533             : {
     534           0 :      Table() : box(NULL) {};
     535           0 :      ~Table() {
     536           0 :           std::list<TCell*>::iterator it = cells.begin();
     537           0 :           for( ; it != cells.end(); ++it)
     538           0 :                 delete *it;
     539           0 :      };
     540             : 
     541             :      Columns columns;
     542             :      Rows    rows;
     543             :      std::list<TCell*> cells;
     544             :      TxtBox *box;
     545             : };
     546             : 
     547             : /* picture (11) ±×¸², OLE±×¸², »ðÀԱ׸², ±×¸®±â */
     548             : enum pictype
     549             : {
     550             :     PICTYPE_FILE, PICTYPE_OLE, PICTYPE_EMBED,
     551             :     PICTYPE_DRAW, PICTYPE_UNKNOWN
     552             : };
     553             : /**
     554             :  * @short External image file
     555             :  */
     556             : struct PicDefFile
     557             : {
     558             :     char path[256];
     559             :     void *img;
     560             :     bool skipfind;
     561             : };
     562             : 
     563             : /**
     564             :  * @short Embeded image file
     565             :  */
     566             : struct PicDefEmbed
     567             : {
     568             :     char  embname[16];
     569             : };
     570             : 
     571             : /**
     572             :  * @short Win32 ole object
     573             :  */
     574             : struct PicDefOle
     575             : {
     576             :     char  embname[16];
     577             :     void  *hwpole;
     578             : };
     579             : 
     580             : /**
     581             :  * @short Drawing object of hwp
     582             :  */
     583             : struct PicDefDraw
     584             : {
     585             :     void      *hdo;
     586             :     uint      zorder;
     587             :     ZZRect    vrect;
     588             :     int       mbrcnt;
     589             : };
     590             : 
     591             : /**
     592             :  * @short For using common case
     593             :  */
     594             : struct PicDefUnknown
     595             : {
     596             :     char  path[256];
     597             : };
     598             : 
     599             : typedef union
     600             : {
     601             :     PicDefFile        picfile;
     602             :     PicDefEmbed       picembed;
     603             :     PicDefOle     picole;
     604             :     PicDefDraw        picdraw;
     605             :     PicDefUnknown     picun;
     606             : } PicDef;
     607             : 
     608             : #define PIC_INFO_LEN    348
     609             : /**
     610             :  * There are four kinds of image.
     611             :  * @li External image
     612             :  * @li Embeded 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             :     ulong     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/embeded/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             :     virtual 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             : #define HIDE_HD         1                         /* bit 0 */
     834             : #define HIDE_FT         2                         /* bit 1 */
     835             : #define HIDE_PGNUM      4                         /* bit 2 */
     836             : #define HIDE_FRAME      8                         /* bit 3 */
     837             : /**
     838             :  * Controls the display of page number, header, footer and border.
     839             :  */
     840           0 : struct PageNumCtrl: public HBox
     841             : {
     842             : /**
     843             :  * object type
     844             :  */
     845             :     unsigned short kind;
     846             : /**
     847             :  * control command.
     848             :  */
     849             :     unsigned short what;
     850             :     hchar      dummy;
     851             : 
     852             :     PageNumCtrl();
     853             : 
     854             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     855             : };
     856             : 
     857             : // mail merge(22)
     858             : /**
     859             :  * Generates the mailing list automatically using address book and mail body format.
     860             :  * @short Generates mailing list
     861             :  */
     862           0 : struct MailMerge: public HBox
     863             : {
     864             :     unsigned char field_name[20];
     865             :     hchar     dummy;
     866             : 
     867             :     MailMerge();
     868             : 
     869             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     870             :     virtual hchar_string GetString() SAL_OVERRIDE;
     871             : };
     872             : 
     873             : // char compositon(23)
     874             : /**
     875             :  * The compose struct displays characters at position. The maximum character count for composition is three.
     876             :  * @short Composition several characters
     877             :  */
     878           0 : struct Compose: public HBox
     879             : {
     880             :     hchar     compose[3];
     881             :     hchar     dummy;
     882             : 
     883             :     Compose();
     884             : 
     885             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     886             : };
     887             : 
     888             : // hyphen(24)
     889             : /**
     890             :  * @short Hyphen
     891             :  */
     892           0 : struct Hyphen: public HBox
     893             : {
     894             : /**
     895             :  * Width of hyphen
     896             :  */
     897             :     hchar     width;
     898             :     hchar     dummy;
     899             : 
     900             :     Hyphen();
     901             : 
     902             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     903             : };
     904             : 
     905             : // toc mark(25)
     906             : /**
     907             :  * The TocMark class is for making the content of a table.
     908             :  * When you set TocMark on current position, hwp makes it as toc automatically.
     909             :  * @short Table of contents
     910             :  */
     911           0 : struct TocMark: public HBox
     912             : {
     913             :     hchar     kind;
     914             :     hchar     dummy;
     915             : 
     916             :     TocMark();
     917             : 
     918             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     919             : };
     920             : 
     921             : // index mark(26)
     922             : /**
     923             :  * IndexMark marks the table of search.
     924             :  * If you set IndexMark at current position, hwp make it as search index.
     925             :  * @short Table of search
     926             :  */
     927           0 : struct IndexMark: public HBox
     928             : {
     929             :     hchar     keyword1[60];
     930             :     hchar     keyword2[60];
     931             :     unsigned short pgno;
     932             :     hchar     dummy;
     933             : 
     934             :     IndexMark();
     935             : 
     936             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
     937             : };
     938             : 
     939             : // outline(28)
     940             : #define MAX_OUTLINE_LEVEL   7
     941             : 
     942             : enum
     943             : {
     944             :     OLSTY_USER = 0,
     945             :     OLSTY_NUMS1 = 1,
     946             :     OLSTY_NUMS2 = 2,
     947             :     OLSTY_NUMSIG1 = 3,
     948             :     OLSTY_NUMSIG2 = 4,
     949             :     OLSTY_NUMSIG3 = 5,
     950             :     OLSTY_BULUSER = 128,
     951             :     OLSTY_BULLET1 = 129,
     952             :     OLSTY_BULLET2 = 130,
     953             :     OLSTY_BULLET3 = 131,
     954             :     OLSTY_BULLET4 = 132,
     955             :     OLSTY_BULLET5 = 133
     956             : };
     957             : 
     958             : // value is in style->userchar[level];
     959             : enum
     960             : {
     961             :     UDO_NUM,
     962             :     UDO_UROM,
     963             :     UDO_LROM,
     964             :     UDO_UENG,
     965             :     UDO_LENG,
     966             :     UDO_SYLL,
     967             :     UDO_JAMO,
     968             :     UDO_HANJA,
     969             :     UDO_SP_CNUM,
     970             :     UDO_SP_CLENG,
     971             :     UDO_SP_CSYLL,
     972             :     UDO_SP_CJAMO,
     973             :     N_UDO
     974             : };
     975             : /**
     976             :  * Number and format of title.
     977             :  * @short Number and format of title
     978             :  */
     979           0 : class Outline: public HBox
     980             : {
     981             :     public:
     982             : /**
     983             :  * kind of numbering format
     984             :  */
     985             :         unsigned short kind;
     986             :         unsigned char  shape;
     987             : /**
     988             :  * level of number, Ex) The level of 1.3.2.4 is four
     989             :  */
     990             :         unsigned char  level;
     991             : /**
     992             :  * value of level
     993             :  */
     994             :         unsigned short number[MAX_OUTLINE_LEVEL];
     995             : /**
     996             :  * shape of level
     997             :  */
     998             :         hchar     user_shape[MAX_OUTLINE_LEVEL];
     999             : /**
    1000             :  * decoration character for the level type
    1001             :  */
    1002             :         hchar     deco[MAX_OUTLINE_LEVEL][2];     /* »ç¿ëÀÚ Á¤Àǽà ¾ÕµÚ ¹®ÀÚ */
    1003             :         hchar     dummy;
    1004             : 
    1005             :         Outline();
    1006             : 
    1007             :         virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
    1008             :         hchar_string GetUnicode() const;
    1009             : };
    1010             : 
    1011             : /* ¹­À½ ºóÄ­(30) */
    1012             : /**
    1013             :  * The Special space to be treated non-space when a string is
    1014             :  * cut at the end of line
    1015             :  * @short Special space
    1016             :  */
    1017           0 : struct KeepSpace: public HBox
    1018             : {
    1019             :     hchar dummy;
    1020             : 
    1021             :     KeepSpace();
    1022             : 
    1023             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
    1024             : };
    1025             : 
    1026             : /* °íÁ¤Æø ºóÄ­(31) */
    1027             : /**
    1028             :  * @short Space with always same width not relation with fonts.
    1029             :  */
    1030           0 : struct FixedSpace: public HBox
    1031             : {
    1032             :     hchar     dummy;
    1033             : 
    1034             :     FixedSpace();
    1035             : 
    1036             :     virtual bool Read(HWPFile &hwpf) SAL_OVERRIDE;
    1037             : };
    1038             : #endif                                            /* _HBOX_H_ */
    1039             : 
    1040             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10