1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
40 * 0 bit : Use page columns
41 * 1 bit : Use page lows
42 * 2 bit : Use section break
46 * 6 bit : Preserve widow orphan
52 PA_USER_PAGE
= 2, /* p user_page definiton */
61 #define FIXED_SPACING_BIT (0x8000)
65 /* ½ÃÀÛÇÏ´Â ±ÛÀÚÀÇ À§Ä¡ : ÄÜÆ®·ÑÀº ¿©·¯ ±æÀ̸¦ °¡Áø´Ù */
67 * Starting character position
72 hunit pgy
; /* internal */
73 hunit sx
; /* internal */
74 hunit psx
; /* internal */
75 hunit pex
; /* internal */
78 unsigned short softbreak
; // column, page, section
80 bool Read(HWPFile
&hwpf
, HWPPara
*para
);
83 * It represents the paragraph.
86 class DLLEXPORT HWPPara
92 // paragraph information
94 * Zero is for the new paragraph style.
96 unsigned char reuse_shape
; /* 0ÀÌ¸é »õ¸ð¾ç */
102 unsigned char scflag
;
105 * If the value is 0, all character of paragraph have same style given cshape
107 unsigned char contain_cshape
; /* 0ÀÌ¸é ¸ðµç ±ÛÀÚ°¡ ´ëÇ¥ ±ÛÀÚ ¸ð¾ç */
108 unsigned char etcflag
;
110 * Checks the special characters in the paragraph
112 unsigned long ctrlflag
;
113 unsigned char pstyno
;
114 CharShape cshape
; /* ±ÛÀÚ°¡ ¸ðµÎ °°Àº ¸ð¾çÀ϶§ */
115 ParaShape pshape
; /* reuse flag°¡ 0À̸é */
116 int pno
; /* run-time only */
128 int Read(HWPFile
&hwpf
, unsigned char flag
= 0);
129 int Write(CTextOut
&txtf
);
130 int Write(CHTMLOut
&html
);
132 void SetNext(HWPPara
*n
) { _next
= n
; };
134 /* layoutÀ» À§ÇÑ ÇÔ¼ö */
136 * Returns the character sytle of paragraph.
138 CharShape
*GetCharShape(int pos
);
140 * Returns the sytle of paragraph.
142 ParaShape
*GetParaShape(void);
145 * Returns previous paragraph.
149 * Returns next paragraph.
153 int HomePos(int line
) const;
154 int EndPos(int line
) const;
155 int LineLen(int line
) const;
158 HBox
*readHBox(HWPFile
&);
163 inline int HWPPara::HomePos(int line
) const
165 if( nline
< line
+ 1 ) return nch
;
166 return linfo
[line
].pos
;
170 inline int HWPPara::EndPos(int line
) const
172 if( nline
<= line
+ 1 ) return nch
;
173 else return HomePos(line
+ 1);
177 inline int HWPPara::LineLen(int line
) const
179 return EndPos(line
) - HomePos(line
);
181 #endif /* _HWPPARA_H_ */
183 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */