1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hpara.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 /* $Id: hpara.h,v 1.5 2008-06-04 09:59:48 vg Exp $ */
44 * 0 bit : Use page columns
45 * 1 bit : Use page lows
46 * 2 bit : Use section break
50 * 6 bit : Preserve widow orphan
56 PA_USER_PAGE
= 2, /* p user_page definiton */
65 #define FIXED_SPACING_BIT (0x8000)
69 /* ½ÃÀÛÇÏ´Â ±ÛÀÚÀÇ À§Ä¡ : ÄÜÆ®·ÑÀº ¿©·¯ ±æÀ̸¦ °¡Áø´Ù */
71 * Starting character position
76 hunit pgy
; /* internal */
77 hunit sx
; /* internal */
78 hunit psx
; /* internal */
79 hunit pex
; /* internal */
82 unsigned short softbreak
; // column, page, section
84 bool Read(HWPFile
&hwpf
, HWPPara
*para
);
87 * It represents the paragraph.
90 class DLLEXPORT HWPPara
96 // paragraph information
98 * Zero is for the new paragraph style.
100 unsigned char reuse_shape
; /* 0ÀÌ¸é »õ¸ð¾ç */
102 unsigned short nline
;
106 unsigned char scflag
;
109 * If the value is 0, all character of paragraph have same style given cshape
111 unsigned char contain_cshape
; /* 0ÀÌ¸é ¸ðµç ±ÛÀÚ°¡ ´ëÇ¥ ±ÛÀÚ ¸ð¾ç */
112 unsigned char etcflag
;
114 * Checks the special characters in the paragraph
116 unsigned long ctrlflag
;
117 unsigned char pstyno
;
118 CharShape cshape
; /* ±ÛÀÚ°¡ ¸ðµÎ °°Àº ¸ð¾çÀ϶§ */
119 ParaShape pshape
; /* reuse flag°¡ 0À̸é */
120 int pno
; /* run-time only */
132 int Read(HWPFile
&hwpf
, unsigned char flag
= 0);
133 int Write(CTextOut
&txtf
);
134 int Write(CHTMLOut
&html
);
136 void SetNext(HWPPara
*n
) { _next
= n
; };
138 /* layoutÀ» À§ÇÑ ÇÔ¼ö */
140 * Returns the character sytle of paragraph.
142 CharShape
*GetCharShape(int pos
);
144 * Returns the sytle of paragraph.
146 ParaShape
*GetParaShape(void);
149 * Returns previous paragraph.
153 * Returns next paragraph.
157 int HomePos(int line
) const;
158 int EndPos(int line
) const;
159 int LineLen(int line
) const;
162 HBox
*readHBox(HWPFile
&);
167 inline int HWPPara::HomePos(int line
) const
169 if( nline
< line
+ 1 ) return nch
;
170 return linfo
[line
].pos
;
174 inline int HWPPara::EndPos(int line
) const
176 if( nline
<= line
+ 1 ) return nch
;
177 else return HomePos(line
+ 1);
181 inline int HWPPara::LineLen(int line
) const
183 return EndPos(line
) - HomePos(line
);
185 #endif /* _HWPPARA_H_ */