koparaglayout.h
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 <qdom.h>
00025 #include "koborder.h"
00026 #include <koffice_export.h>
00027 class KoSavingContext;
00028 class KoGenStyle;
00029 class KoParagCounter;
00030 class KoParagStyle;
00031 class KoOasisContext;
00032
00038 class KOTEXT_EXPORT KoParagLayout
00039 {
00040 public:
00041 KoParagLayout();
00042 KoParagLayout( const KoParagLayout &layout ) { operator=( layout ); }
00043
00044 ~KoParagLayout();
00045
00048 enum { Alignment = 1,
00049 BulletNumber = 2,
00050 Margins = 4,
00051 LineSpacing = 8,
00052 Borders = 16,
00053 Tabulator = 32,
00054 PageBreaking = 64,
00055
00056 All = Alignment | BulletNumber | Margins | LineSpacing | Borders | Tabulator | PageBreaking
00057 } Flags;
00058
00060 enum {
00061 BreakBetweenLines = 0,
00062 KeepLinesTogether = 1,
00063 HardFrameBreakBefore = 2,
00064 HardFrameBreakAfter = 4,
00065 KeepWithPrevious = 8,
00066 KeepWithNext = 16
00067 };
00068
00069
00071 double margins[5];
00083 enum SpacingType { LS_SINGLE = 0, LS_ONEANDHALF = -1, LS_DOUBLE = -2,
00084 LS_CUSTOM = -3, LS_AT_LEAST = -4, LS_MULTIPLE = -5, LS_FIXED = -6 };
00085 SpacingType lineSpacingType;
00086 double lineSpacingValue() const { return lineSpacing;}
00087 void setLineSpacingValue(double _value) { lineSpacing = _value;}
00088
00089 static QString* shadowCssCompat;
00090
00091 char unused;
00092 char pageBreaking;
00093 char direction;
00095 char alignment;
00096 KoBorder leftBorder, rightBorder, topBorder, bottomBorder;
00098 KoParagCounter* counter;
00099
00100 KoParagStyle* style;
00101
00102 bool hasBorder() const { return topBorder.penWidth() > 0
00103 || bottomBorder.penWidth() > 0
00104 || leftBorder.penWidth() > 0
00105 || rightBorder.penWidth() > 0; }
00106
00107 void setTabList( const KoTabulatorList & tabList ) { m_tabList = tabList; }
00108 const KoTabulatorList& tabList() const { return m_tabList; }
00109
00110 void operator=( const KoParagLayout & );
00111
00113 int compare( const KoParagLayout & layout ) const;
00114
00118 void saveParagLayout( QDomElement & parentElem, int alignment ) const;
00119
00123 static void loadParagLayout( KoParagLayout& layout, const QDomElement& parentElem, int docVersion = 2 );
00124
00126 static void loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& context );
00130 void saveOasis( KoGenStyle& gs, KoSavingContext& context, bool savingStyle ) const;
00131
00133 static Qt::AlignmentFlags loadOasisAlignment( const QCString& str );
00135 static QCString saveOasisAlignment( Qt::AlignmentFlags alignment );
00136
00137 private:
00138 static int getAttribute(const QDomElement &element, const char *attributeName, int defaultValue) {
00139 QString value = element.attribute( attributeName );
00140 return value.isNull() ? defaultValue : value.toInt();
00141 }
00142
00143 static double getAttribute(const QDomElement &element, const char *attributeName, double defaultValue) {
00144 QString value = element.attribute( attributeName );
00145 return value.isNull() ? defaultValue : value.toDouble();
00146 }
00147
00148 private:
00149 KoTabulatorList m_tabList;
00150 double lineSpacing;
00151 class Private;
00152 Private *d;
00153
00155 void initialise();
00156 };
00157
00158 #endif
This file is part of the documentation for lib Library Version 1.4.2.