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  * Version: MPL 2.0 / LGPLv2.1+
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  * Major Contributor(s):
10  * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11  * Copyright (C) 2006, 2007 Andrew Ziem
12  * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13  * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15  *
16  * For minor contributions see the git repository.
17  *
18  * Alternatively, the contents of this file may be used under the terms
19  * of the GNU Lesser General Public License Version 2.1 or later
20  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21  * applicable instead of those above.
22  *
23  * For further information visit http://libwps.sourceforge.net
24  */
25 
26 #ifndef WPS_PARAGRAPH
27 # define WPS_PARAGRAPH
28 
29 #include <assert.h>
30 #include <iostream>
31 
32 #include <vector>
33 
34 #include "libwps_internal.h"
35 
36 #include "WPSList.h"
37 
38 struct WPSTabStop
39 {
41  WPSTabStop(double position = 0.0, Alignment alignment = LEFT, uint16_t leaderCharacter='\0', uint8_t leaderNumSpaces = 0) :
42  m_position(position), m_alignment(alignment), m_leaderCharacter(leaderCharacter), m_leaderNumSpaces(leaderNumSpaces)
43  {
44  }
45  void addTo(librevenge::RVNGPropertyListVector &propList, double decalX=0.0) const;
47  friend std::ostream &operator<<(std::ostream &o, WPSTabStop const &ft);
48  double m_position;
52 };
53 
56 {
58 
62  m_border(0), m_borderStyle(), m_extra("")
63  {
64  for (int i = 0; i < 3; i++) m_margins[i] = m_spacings[i] = 0.0;
65  m_spacings[0] = 1.0; // interline normal
66  }
67  // destructor
68  virtual ~WPSParagraph() {}
70  void addTo(librevenge::RVNGPropertyList &propList, bool inTable) const;
72  friend std::ostream &operator<<(std::ostream &o, WPSParagraph const &ft);
73 
79  double m_margins[3]; // 0: first line left, 1: left, 2: right
85  double m_spacings[3]; // 0: interline, 1: before, 2: after
87  std::vector<WPSTabStop> m_tabs;
88 
92  int m_breakStatus; // BITS: 1: unbreakable, 2: dont break after
93 
97  ListLevel m_listLevel;
98 
101 
103  int m_border;
106 
108  std::string m_extra;
109 };
110 #endif
111 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Definition: WPSParagraph.h:40
libwps::Justification m_justify
the justification
Definition: WPSParagraph.h:90
WPSList::Level ListLevel
Definition: WPSParagraph.h:57
int m_breakStatus
a list of bits: 0x1 (unbreakable), 0x2 (do not break after)
Definition: WPSParagraph.h:92
class to store the paragraph properties
Definition: WPSParagraph.h:55
a border list
Definition: libwps_internal.h:216
Definition: libwps_internal.cpp:32
void addTo(librevenge::RVNGPropertyList &propList, bool inTable) const
add to the propList
Definition: WPSParagraph.cpp:178
double m_margins[3]
the margins
Definition: WPSParagraph.h:79
Definition: WPSParagraph.h:40
Alignment
Definition: WPSParagraph.h:40
int m_listLevelIndex
the actual level index
Definition: WPSParagraph.h:95
Justification
Definition: libwps_internal.h:257
double m_spacings[3]
the line spacing
Definition: WPSParagraph.h:85
small structure to keep information about a level
Definition: WPSList.h:40
std::vector< WPSTabStop > m_tabs
the tabulations
Definition: WPSParagraph.h:87
WPSParagraph()
constructor
Definition: WPSParagraph.h:60
int m_border
list of bits to indicated a border 1: LeftBorderBit, 2: RightBorderBit, ...
Definition: WPSParagraph.h:103
Alignment m_alignment
Definition: WPSParagraph.h:49
uint16_t m_leaderCharacter
Definition: WPSParagraph.h:50
void addTo(librevenge::RVNGPropertyListVector &propList, double decalX=0.0) const
Definition: WPSParagraph.cpp:37
uint32_t m_backgroundColor
the background color
Definition: WPSParagraph.h:100
std::string m_extra
a string to store some errors
Definition: WPSParagraph.h:108
virtual ~WPSParagraph()
Definition: WPSParagraph.h:68
WPSTabStop(double position=0.0, Alignment alignment=LEFT, uint16_t leaderCharacter='\0', uint8_t leaderNumSpaces=0)
Definition: WPSParagraph.h:41
Definition: WPSParagraph.h:40
friend std::ostream & operator<<(std::ostream &o, WPSParagraph const &ft)
operator <<
Definition: WPSParagraph.cpp:110
friend std::ostream & operator<<(std::ostream &o, WPSTabStop const &ft)
operator <<
Definition: WPSParagraph.cpp:79
double m_position
Definition: WPSParagraph.h:48
uint8_t m_leaderNumSpaces
Definition: WPSParagraph.h:51
Definition: WPSParagraph.h:38
WPSBorder m_borderStyle
the border style
Definition: WPSParagraph.h:105
Definition: libwps_internal.h:257
ListLevel m_listLevel
the actual level
Definition: WPSParagraph.h:97
Definition: WPSParagraph.h:40
Definition: WPSParagraph.h:40

Generated on Thu Oct 9 2014 14:30:04 for libwps by doxygen 1.8.8