| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef WPS_PARAGRAPH |
| 27 |
# define WPS_PARAGRAPH |
| 28 |
|
| 29 |
#include <iostream> |
| 30 |
|
| 31 |
#include <vector> |
| 32 |
|
| 33 |
#include "libwps_internal.h" |
| 34 |
|
| 35 |
#include "WPSList.h" |
| 36 |
|
| 37 |
struct WPSTabStop |
| 38 |
{ |
| 39 |
enum Alignment { LEFT, RIGHT, CENTER, DECIMAL, BAR }; |
| 40 |
explicit WPSTabStop(double position = 0.0, Alignment alignment = LEFT, uint16_t leaderCharacter='\0', uint8_t leaderNumSpaces = 0) |
| 41 |
: m_position(position) |
| 42 |
, m_alignment(alignment) |
| 43 |
, m_leaderCharacter(leaderCharacter) |
| 44 |
, m_leaderNumSpaces(leaderNumSpaces) |
| 45 |
{ |
| 46 |
} |
| 47 |
void addTo(librevenge::RVNGPropertyListVector &propList, double decalX=0.0) const; |
| 48 |
|
| 49 |
friend std::ostream &operator<<(std::ostream &o, WPSTabStop const &ft); |
| 50 |
double m_position; |
| 51 |
Alignment m_alignment; |
| 52 |
uint16_t m_leaderCharacter; |
| 53 |
uint8_t m_leaderNumSpaces; |
| 54 |
}; |
| 55 |
|
| 56 |
|
| 57 |
struct WPSParagraph |
| 58 |
{ |
| 59 |
typedef WPSList::Level ListLevel; |
| 60 |
|
| 61 |
enum LineSpacingType { Fixed, AtLeast }; |
| 62 |
|
| 63 |
|
| 64 |
WPSParagraph() |
| 65 |
: m_spacingsInterlineUnit(librevenge::RVNG_PERCENT) |
| 66 |
, m_spacingsInterlineType(Fixed) |
| 67 |
, m_tabs() |
| 68 |
, m_justify(libwps::JustificationLeft) |
| 69 |
, m_breakStatus(0) |
| 70 |
, m_listLevelIndex(0) |
| 71 |
, m_listLevel() |
| 72 |
, m_backgroundColor(WPSColor::white()) |
| 73 |
, m_border(0) |
| 74 |
, m_borderStyle() |
| 75 |
, m_extra("") |
| 76 |
{ |
| 77 |
for (int i = 0; i < 3; i++) m_margins[i] = m_spacings[i] = 0.0; |
| 78 |
m_spacings[0] = 1.0; |
| 79 |
} |
| 80 |
WPSParagraph(WPSParagraph const &)=default; |
| 81 |
WPSParagraph &operator=(WPSParagraph const &)=default; |
| 82 |
|
| 83 |
virtual ~WPSParagraph(); |
| 84 |
|
| 85 |
void addTo(librevenge::RVNGPropertyList &propList, bool inTable) const; |
| 86 |
|
| 87 |
void setInterline(double value, librevenge::RVNGUnit unit, LineSpacingType type=Fixed) |
| 88 |
{ |
| 89 |
m_spacings[0]=value; |
| 90 |
m_spacingsInterlineUnit=unit; |
| 91 |
m_spacingsInterlineType=type; |
| 92 |
} |
| 93 |
|
| 94 |
friend std::ostream &operator<<(std::ostream &o, WPSParagraph const &ft); |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
double m_margins[3]; |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
double m_spacings[3]; |
| 108 |
|
| 109 |
librevenge::RVNGUnit m_spacingsInterlineUnit; |
| 110 |
|
| 111 |
LineSpacingType m_spacingsInterlineType; |
| 112 |
|
| 113 |
std::vector<WPSTabStop> m_tabs; |
| 114 |
|
| 115 |
|
| 116 |
libwps::Justification m_justify; |
| 117 |
|
| 118 |
int m_breakStatus; |
| 119 |
|
| 120 |
|
| 121 |
int m_listLevelIndex; |
| 122 |
|
| 123 |
ListLevel m_listLevel; |
| 124 |
|
| 125 |
|
| 126 |
WPSColor m_backgroundColor; |
| 127 |
|
| 128 |
|
| 129 |
int m_border; |
| 130 |
|
| 131 |
WPSBorder m_borderStyle; |
| 132 |
|
| 133 |
|
| 134 |
std::string m_extra; |
| 135 |
}; |
| 136 |
#endif |
| 137 |
|