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
26 #include <tools/long.hxx>
35 * 0 bit : Use page columns
36 * 1 bit : Use page lows
37 * 2 bit : Use section break
41 * 6 bit : Preserve widow orphan
47 PA_USER_PAGE
= 2, /* p user_page definition */
56 #define FIXED_SPACING_BIT (0x8000)
60 /* the position of the starting character: the control has a different length */
62 * Starting character position
67 hunit pgy
; /* internal */
68 hunit sx
; /* internal */
69 hunit psx
; /* internal */
70 hunit pex
; /* internal */
73 unsigned short softbreak
; // column, page, section
75 void Read(HWPFile
&hwpf
, HWPPara
const *para
);
78 * It represents the paragraph.
81 class DLLEXPORT HWPPara
87 // paragraph information
89 * Zero is for the new paragraph style.
91 unsigned char reuse_shape
; /* the new shape if 0 */
100 * If the value is 0, all character of paragraph have same style given cshape
102 unsigned char contain_cshape
; /* if it's 0, all the characters are representing with representative shape */
103 unsigned char etcflag
;
105 * Checks the special characters in the paragraph
107 tools::ULong ctrlflag
;
108 unsigned char pstyno
;
109 std::shared_ptr
<CharShape
> cshape
; /* When characters are all the same shape */
110 std::shared_ptr
<ParaShape
> pshape
; /* if reuse flag is 0, */
112 std::unique_ptr
<LineInfo
[]> linfo
;
113 std::vector
<std::shared_ptr
<CharShape
>> cshapep
;
117 std::map
<unsigned short, std::unique_ptr
<HBox
>> hhstr
;
122 bool Read(HWPFile
&hwpf
, unsigned char flag
);
124 void SetNext(HWPPara
*n
) { _next
= n
; };
126 /* Functions for layout */
128 * Returns the character style of paragraph.
130 CharShape
*GetCharShape(int pos
);
132 * Returns the style of paragraph.
134 ParaShape
& GetParaShape(void) { return *pshape
; }
137 * Returns next paragraph.
139 HWPPara
*Next(void) { return _next
;}
142 std::unique_ptr
<HBox
> readHBox(HWPFile
&);
145 #endif // INCLUDED_HWPFILTER_SOURCE_HPARA_H
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */