1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_HWPFILTER_SOURCE_HPARA_H
21 #define INCLUDED_HWPFILTER_SOURCE_HPARA_H
31 * 0 bit : Use page columns
32 * 1 bit : Use page lows
33 * 2 bit : Use section break
37 * 6 bit : Preserve widow orphan
43 PA_USER_PAGE
= 2, /* p user_page definition */
52 #define FIXED_SPACING_BIT (0x8000)
56 /* 시작하는 글자의 위치 : 콘트롤은 여러 길이를 가진다 */
58 * Starting character position
63 hunit pgy
; /* internal */
64 hunit sx
; /* internal */
65 hunit psx
; /* internal */
66 hunit pex
; /* internal */
69 unsigned short softbreak
; // column, page, section
71 bool Read(HWPFile
&hwpf
, HWPPara
*para
);
74 * It represents the paragraph.
77 class DLLEXPORT HWPPara
83 // paragraph information
85 * Zero is for the new paragraph style.
87 unsigned char reuse_shape
; /* 0이면 새모양 */
96 * If the value is 0, all character of paragraph have same style given cshape
98 unsigned char contain_cshape
; /* 0이면 모든 글자가 대표 글자 모양 */
99 unsigned char etcflag
;
101 * Checks the special characters in the paragraph
103 unsigned long ctrlflag
;
104 unsigned char pstyno
;
105 CharShape cshape
; /* 글자가 모두 같은 모양일때 */
106 ParaShape pshape
; /* reuse flag가 0이면 */
107 int pno
; /* run-time only */
119 bool Read(HWPFile
&hwpf
, unsigned char flag
= 0);
120 int Write(CTextOut
&txtf
);
121 int Write(CHTMLOut
&html
);
123 void SetNext(HWPPara
*n
) { _next
= n
; };
127 * Returns the character style of paragraph.
129 CharShape
*GetCharShape(int pos
);
131 * Returns the style of paragraph.
133 ParaShape
& GetParaShape(void) { return pshape
;}
136 * Returns previous paragraph.
140 * Returns next paragraph.
142 HWPPara
*Next(void) { return _next
;}
144 int HomePos(int line
) const;
145 int EndPos(int line
) const;
146 int LineLen(int line
) const;
149 HBox
*readHBox(HWPFile
&);
154 inline int HWPPara::HomePos(int line
) const
156 if( nline
< line
+ 1 ) return nch
;
157 return linfo
[line
].pos
;
161 inline int HWPPara::EndPos(int line
) const
163 if( nline
<= line
+ 1 ) return nch
;
164 else return HomePos(line
+ 1);
168 inline int HWPPara::LineLen(int line
) const
170 return EndPos(line
) - HomePos(line
);
172 #endif // INCLUDED_HWPFILTER_SOURCE_HPARA_H
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */