Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef WPS_PARAGRAPH
00027 # define WPS_PARAGRAPH
00028
00029 #include <iostream>
00030
00031 #include <vector>
00032
00033 #include "libwps_internal.h"
00034
00035 #include "WPSList.h"
00036
00037 struct WPSTabStop
00038 {
00039 enum Alignment { LEFT, RIGHT, CENTER, DECIMAL, BAR };
00040 WPSTabStop(double position = 0.0, Alignment alignment = LEFT, uint16_t leaderCharacter='\0', uint8_t leaderNumSpaces = 0) :
00041 m_position(position), m_alignment(alignment), m_leaderCharacter(leaderCharacter), m_leaderNumSpaces(leaderNumSpaces)
00042 {
00043 }
00044 void addTo(librevenge::RVNGPropertyListVector &propList, double decalX=0.0) const;
00046 friend std::ostream &operator<<(std::ostream &o, WPSTabStop const &ft);
00047 double m_position;
00048 Alignment m_alignment;
00049 uint16_t m_leaderCharacter;
00050 uint8_t m_leaderNumSpaces;
00051 };
00052
00054 struct WPSParagraph
00055 {
00056 typedef WPSList::Level ListLevel;
00058 enum LineSpacingType { Fixed, AtLeast };
00059
00061 WPSParagraph() : m_spacingsInterlineUnit(librevenge::RVNG_PERCENT), m_spacingsInterlineType(Fixed), m_tabs(), m_justify(libwps::JustificationLeft),
00062 m_breakStatus(0), m_listLevelIndex(0), m_listLevel(), m_backgroundColor(WPSColor::white()),
00063 m_border(0), m_borderStyle(), m_extra("")
00064 {
00065 for (int i = 0; i < 3; i++) m_margins[i] = m_spacings[i] = 0.0;
00066 m_spacings[0] = 1.0;
00067 }
00068
00069 virtual ~WPSParagraph() {}
00071 void addTo(librevenge::RVNGPropertyList &propList, bool inTable) const;
00073 void setInterline(double value, librevenge::RVNGUnit unit, LineSpacingType type=Fixed)
00074 {
00075 m_spacings[0]=value;
00076 m_spacingsInterlineUnit=unit;
00077 m_spacingsInterlineType=type;
00078 }
00080 friend std::ostream &operator<<(std::ostream &o, WPSParagraph const &ft);
00081
00087 double m_margins[3];
00093 double m_spacings[3];
00095 librevenge::RVNGUnit m_spacingsInterlineUnit;
00097 LineSpacingType m_spacingsInterlineType;
00099 std::vector<WPSTabStop> m_tabs;
00100
00102 libwps::Justification m_justify;
00104 int m_breakStatus;
00105
00107 int m_listLevelIndex;
00109 ListLevel m_listLevel;
00110
00112 WPSColor m_backgroundColor;
00113
00115 int m_border;
00117 WPSBorder m_borderStyle;
00118
00120 std::string m_extra;
00121 };
00122 #endif
00123