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
34 * 0 bit : Use page columns
35 * 1 bit : Use page lows
36 * 2 bit : Use section break
40 * 6 bit : Preserve widow orphan
46 PA_USER_PAGE
= 2, /* p user_page definition */
55 #define FIXED_SPACING_BIT (0x8000)
59 /* the position of the starting character: the control has a different length */
61 * Starting character position
66 hunit pgy
; /* internal */
67 hunit sx
; /* internal */
68 hunit psx
; /* internal */
69 hunit pex
; /* internal */
72 unsigned short softbreak
; // column, page, section
74 void Read(HWPFile
&hwpf
, HWPPara
const *para
);
77 * It represents the paragraph.
80 class DLLEXPORT HWPPara
86 // paragraph information
88 * Zero is for the new paragraph style.
90 unsigned char reuse_shape
; /* the new shape if 0 */
99 * If the value is 0, all character of paragraph have same style given cshape
101 unsigned char contain_cshape
; /* if it's 0, all the characters are representing with representative shape */
102 unsigned char etcflag
;
104 * Checks the special characters in the paragraph
106 unsigned long ctrlflag
;
107 unsigned char pstyno
;
108 std::shared_ptr
<CharShape
> cshape
; /* When characters are all the same shape */
109 std::shared_ptr
<ParaShape
> pshape
; /* if reuse flag is 0, */
111 std::unique_ptr
<LineInfo
[]> linfo
;
112 std::vector
<std::shared_ptr
<CharShape
>> cshapep
;
116 std::map
<unsigned short, std::unique_ptr
<HBox
>> hhstr
;
121 bool Read(HWPFile
&hwpf
, unsigned char flag
);
123 void SetNext(HWPPara
*n
) { _next
= n
; };
125 /* Functions for layout */
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 next paragraph.
138 HWPPara
*Next(void) { return _next
;}
141 std::unique_ptr
<HBox
> readHBox(HWPFile
&);
144 #endif // INCLUDED_HWPFILTER_SOURCE_HPARA_H
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */