Main Page
Namespaces
Classes
Files
File List
File Members
WPSParagraph.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* libwps
3
* Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
4
* Copyright (C) 2006, 2007 Andrew Ziem
5
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
6
* Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
7
* Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Library General Public
11
* License as published by the Free Software Foundation; either
12
* version 2 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Library General Public License for more details.
18
*
19
* You should have received a copy of the GNU Library General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*
23
* For further information visit http://libwps.sourceforge.net
24
*/
25
26
/* "This product is not manufactured, approved, or supported by
27
* Corel Corporation or Corel Corporation Limited."
28
*/
29
30
#ifndef WPS_PARAGRAPH
31
# define WPS_PARAGRAPH
32
33
#include <assert.h>
34
#include <iostream>
35
36
#include <vector>
37
38
#include "
libwps_internal.h
"
39
40
#include "
WPSList.h
"
41
42
class
WPSContentListener
;
43
class
WPXPropertyListVector;
44
45
struct
WPSTabStop
46
{
47
enum
Alignment
{
LEFT
,
RIGHT
,
CENTER
,
DECIMAL
,
BAR
};
48
WPSTabStop
(
double
position = 0.0,
Alignment
alignment =
LEFT
, uint16_t leaderCharacter=
'\0'
, uint8_t leaderNumSpaces = 0) :
49
m_position
(position),
m_alignment
(alignment),
m_leaderCharacter
(leaderCharacter),
m_leaderNumSpaces
(leaderNumSpaces)
50
{
51
}
52
void
addTo
(WPXPropertyListVector &propList,
double
decalX=0.0);
54
friend
std::ostream &
operator<<
(std::ostream &o,
WPSTabStop
const
&ft);
55
double
m_position
;
56
Alignment
m_alignment
;
57
uint16_t
m_leaderCharacter
;
58
uint8_t
m_leaderNumSpaces
;
59
};
60
62
struct
WPSParagraph
63
{
64
typedef
WPSList::Level
ListLevel
;
65
67
WPSParagraph
() :
m_tabs
(),
m_justify
(libwps::
JustificationLeft
),
68
m_breakStatus
(0),
m_listLevelIndex
(0),
m_listLevel
(),
69
m_border
(0),
m_borderStyle
(libwps::
BorderSingle
),
m_borderWidth
(1),
m_borderColor
(0),
m_extra
(
""
)
70
{
71
for
(
int
i = 0; i < 3; i++)
m_margins
[i] =
m_spacings
[i] = 0.0;
72
m_spacings
[0] = 1.0;
// interline normal
73
}
74
virtual
~WPSParagraph
() {}
76
void
send
(shared_ptr<WPSContentListener> listener)
const
;
78
friend
std::ostream &
operator<<
(std::ostream &o,
WPSParagraph
const
&ft);
79
85
double
m_margins
[3];
// 0: first line left, 1: left, 2: right
91
double
m_spacings
[3];
// 0: interline, 1: before, 2: after
93
std::vector<WPSTabStop>
m_tabs
;
94
96
libwps::Justification
m_justify
;
98
int
m_breakStatus
;
// BITS: 1: unbreakable, 2: dont break after
99
101
int
m_listLevelIndex
;
103
ListLevel
m_listLevel
;
104
106
int
m_border
;
108
libwps::BorderStyle
m_borderStyle
;
110
int
m_borderWidth
;
112
uint32_t
m_borderColor
;
113
115
std::string
m_extra
;
116
};
117
#endif
118
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Generated on Wed Aug 8 2012 16:07:57 for libwps by
doxygen
1.8.1.2