20#ifndef koparaglayout_h
21#define koparaglayout_h
26#include <koffice_export.h>
39class KOTEXT_EXPORT KoParagLayout
43 KoParagLayout( const KoParagLayout &layout ) { operator=( layout ); }
56 BackgroundColor = 128,
58 All = Alignment | BulletNumber | Margins | LineSpacing |
59 Borders | Tabulator | PageBreaking | BackgroundColor
64 BreakBetweenLines = 0,
65 KeepLinesTogether = 1,
66 HardFrameBreakBefore = 2,
67 HardFrameBreakAfter = 4,
86 enum SpacingType { LS_SINGLE = 0, LS_ONEANDHALF = -1, LS_DOUBLE = -2,
87 LS_CUSTOM = -3, LS_AT_LEAST = -4, LS_MULTIPLE = -5, LS_FIXED = -6 };
88 SpacingType lineSpacingType;
89 double lineSpacingValue() const { return lineSpacing;}
90 void setLineSpacingValue( double _value) { lineSpacing = _value;}
92 static TQString* shadowCssCompat;
100 KoBorder leftBorder, rightBorder, topBorder, bottomBorder;
116 bool hasBorder() const { return topBorder.penWidth() > 0
117 || bottomBorder.penWidth() > 0
118 || leftBorder.penWidth() > 0
119 || rightBorder.penWidth() > 0; }
121 void setTabList( const KoTabulatorList & tabList ) { m_tabList = tabList; }
122 const KoTabulatorList& tabList() const { return m_tabList; }
130 void operator=( const KoParagLayout & );
133 int compare( const KoParagLayout & layout ) const;
138 void saveParagLayout( TQDomElement & parentElem, int alignment ) const;
143 static void loadParagLayout( KoParagLayout& layout, const TQDomElement& parentElem, int docVersion = 2 );
146 static void loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& context );
152 void saveOasis( KoGenStyle& gs, KoSavingContext& context, bool savingStyle ) const;
155 static TQt::AlignmentFlags loadOasisAlignment( const TQCString& str );
157 static TQCString saveOasisAlignment( TQt::AlignmentFlags alignment );
160 static int getAttribute( const TQDomElement &element, const char *attributeName, int defaultValue) {
161 TQString value = element.attribute( attributeName );
162 return value.isNull() ? defaultValue : value.toInt();
165 static double getAttribute( const TQDomElement &element, const char *attributeName, double defaultValue) {
166 TQString value = element.attribute( attributeName );
167 return value.isNull() ? defaultValue : value.toDouble();
171 KoTabulatorList m_tabList;
This class represents a border - for anything, like paragraph, or frame.
Used during loading of Oasis format (and discarded at the end of the loading).
This is the structure associated with a paragraph (KoTextParag), to define the bullet or numbering of...
SpacingType Line spacing values Assuming h is the height of the biggest char in the line, and v is the linespacin...
TQColor backgroundColor The background color of the paragraph.
void operator=(const KoParagLayout &) Assignment operator for KoParagLayout.
double margins[5] left, right, top, bottom, firstLineSpacing - in pt
KoParagCounter * counter can be 0 if no counter set
char alignment Alignment flag (AlignAuto/AlignLeft/AlignRight/AlignJustify).
A paragraph style is a combination of a character style and paragraph-layout attributes,...
Used during saving to Oasis format (and discarded at the end of the saving).
|