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 {
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;
59 };
60 
63 {
65 
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 
98  int m_breakStatus; // BITS: 1: unbreakable, 2: dont break after
99 
104 
106  int m_border;
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