00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef koparaglayout_h
00021
#define koparaglayout_h
00022
00023
#include <koRuler.h>
00024
#include "koborder.h"
00025
class KoParagCounter;
00026
class KoStyle;
00027
00033 class KoParagLayout
00034 {
00035
public:
00036
KoParagLayout();
00037
KoParagLayout(
const KoParagLayout &layout ) { operator=( layout ); }
00038
00039 ~
KoParagLayout();
00040
00043
enum { Alignment = 1,
00044 BulletNumber = 2,
00045 Margins = 4,
00046 LineSpacing = 8,
00047 Borders = 16,
00048 Tabulator = 32,
00049 PageBreaking = 64,
00050
00051 All = Alignment | BulletNumber | Margins | LineSpacing | Borders | Tabulator | PageBreaking
00052 }
Flags;
00053
00055
enum {
00056 BreakBetweenLines = 0,
00057 KeepLinesTogether = 1,
00058 HardFrameBreakBefore = 2,
00059 HardFrameBreakAfter = 4,
00060 KeepWithPrevious = 8,
00061 KeepWithNext = 16
00062 };
00063
00064
00068 int alignment;
00070 double margins[5];
00082 enum SpacingType { LS_SINGLE = 0, LS_ONEANDHALF = -1, LS_DOUBLE = -2,
00083 LS_CUSTOM = -3, LS_AT_LEAST = -4, LS_MULTIPLE = -5, LS_FIXED = -6 };
00084 SpacingType lineSpacingType;
00085
double lineSpacingValue()
const {
return lineSpacing;}
00086
void setLineSpacingValue(
double _value) { lineSpacing = _value;}
00087
00088
static QString* shadowCssCompat;
00089
char unused;
00090
char pageBreaking;
00091
char direction;
00092
char unused2;
00093
KoBorder leftBorder, rightBorder, topBorder, bottomBorder;
00095 KoParagCounter*
counter;
00096
00097
KoStyle* style;
00098
00099
bool hasBorder()
const {
return topBorder.
penWidth() > 0
00100 || bottomBorder.
penWidth() > 0
00101 || leftBorder.
penWidth() > 0
00102 || rightBorder.
penWidth() > 0; }
00103
00104
void setTabList(
const KoTabulatorList & tabList ) { m_tabList = tabList; }
00105
const KoTabulatorList& tabList()
const {
return m_tabList; }
00106
00107
void operator=(
const KoParagLayout & );
00108
00110
int compare(
const KoParagLayout & layout )
const;
00111
00115
void saveParagLayout(
QDomElement & parentElem,
int alignment )
const;
00116
00120
static void loadParagLayout(
KoParagLayout& layout,
const QDomElement& parentElem,
int docVersion = 2 );
00121
00122
private:
00123
KoTabulatorList m_tabList;
00124
double lineSpacing;
00125
class Private;
00126 Private *d;
00127
00129
void initialise();
00130 };
00131
00132
#endif