LibreOffice Module hwpfilter (master) 1
hpara.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_HWPFILTER_SOURCE_HPARA_H
21#define INCLUDED_HWPFILTER_SOURCE_HPARA_H
22
23#include "hwplib.h"
24#include "hwpfile.h"
25#include "hinfo.h"
26#include <tools/long.hxx>
27#include <map>
28#include <memory>
29#include <vector>
30
31struct HBox;
32
44enum
45{
47 PA_USER_PAGE = 2, /* p user_page definition */
53};
54
55class HWPPara;
56#define FIXED_SPACING_BIT (0x8000)
57
58struct LineInfo
59{
60 hunit pgy; /* internal */
61
62 void Read(HWPFile &hwpf, HWPPara const *para);
63};
69{
70 private:
72
73 public:
74// paragraph information
78 unsigned char reuse_shape; /* the new shape if 0 */
79 unsigned short nch;
80 unsigned short nline;
81
82// realking
84 unsigned char scflag;
85
89 unsigned char contain_cshape; /* if it's 0, all the characters are representing with representative shape */
90 unsigned char etcflag;
95 unsigned char pstyno;
96 std::shared_ptr<CharShape> cshape; /* When characters are all the same shape */
97 std::shared_ptr<ParaShape> pshape; /* if reuse flag is 0, */
98
99 std::unique_ptr<LineInfo[]> linfo;
100 std::vector<std::shared_ptr<CharShape>> cshapep;
104 std::vector<std::unique_ptr<HBox>> hhstr;
105
106 HWPPara(void);
107 ~HWPPara(void);
108
109 bool Read(HWPFile &hwpf, unsigned char flag);
110
111 void SetNext(HWPPara *n) { _next = n; };
112
113/* Functions for layout */
117 CharShape *GetCharShape(int pos);
121 ParaShape& GetParaShape(void) { return *pshape; }
122
126 HWPPara *Next(void) { return _next;}
127
128 private:
129 std::unique_ptr<HBox> readHBox(HWPFile &);
130};
131
132#endif // INCLUDED_HWPFILTER_SOURCE_HPARA_H
133
134/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
unsigned int uint
The HWPFile class is the main class of hwp for reading file information from stream.
Definition: hwpfile.h:98
It represents the paragraph.
Definition: hpara.h:69
unsigned short nline
Definition: hpara.h:80
void SetNext(HWPPara *n)
Definition: hpara.h:111
hunit begin_ypos
Definition: hpara.h:83
std::vector< std::unique_ptr< HBox > > hhstr
Box object list.
Definition: hpara.h:104
ParaShape & GetParaShape(void)
Returns the style of paragraph.
Definition: hpara.h:121
std::unique_ptr< LineInfo[]> linfo
Definition: hpara.h:99
unsigned char contain_cshape
If the value is 0, all character of paragraph have same style given cshape.
Definition: hpara.h:89
HWPPara * Next(void)
Returns next paragraph.
Definition: hpara.h:126
uint ctrlflag
Checks the special characters in the paragraph.
Definition: hpara.h:94
unsigned char reuse_shape
Zero is for the new paragraph style.
Definition: hpara.h:78
unsigned char scflag
Definition: hpara.h:84
std::shared_ptr< ParaShape > pshape
Definition: hpara.h:97
unsigned char pstyno
Definition: hpara.h:95
std::vector< std::shared_ptr< CharShape > > cshapep
Definition: hpara.h:100
unsigned short nch
Definition: hpara.h:79
unsigned char etcflag
Definition: hpara.h:90
HWPPara * _next
Definition: hpara.h:71
std::shared_ptr< CharShape > cshape
Definition: hpara.h:96
@ PA_IN_BLOCK
Definition: hpara.h:50
@ PA_USER_COLUMN
Definition: hpara.h:46
@ PA_BLOCK_BEGIN
Definition: hpara.h:49
@ PA_BLOCK_END
Definition: hpara.h:51
@ PA_USER_PAGE
Definition: hpara.h:47
@ PA_WIDOW_ORPHAN
Definition: hpara.h:52
@ PA_SECTION_BREAK
Definition: hpara.h:48
int hunit
Definition: hwplib.h:37
#define DLLEXPORT
Definition: hwplib.h:201
sal_Int64 n
Style of character.
Definition: hinfo.h:213
The HBox class is the base class for all date classes in hwp document.
Definition: hbox.h:44
Style of paragraph.
Definition: hinfo.h:276