00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KOPARAGSTYLE_H
00020 #define KOPARAGSTYLE_H
00021
00022 #include "KoTextFormat.h"
00023 #include "KoParagLayout.h"
00024 #include "KoUserStyle.h"
00025 class KoGenStyles;
00026 class QDomElement;
00027
00032 class KOTEXT_EXPORT KoCharStyle : public KoUserStyle
00033 {
00034 public:
00036 KoCharStyle( const QString & name );
00037
00039 KoCharStyle( const KoCharStyle & rhs ) : KoUserStyle( QString::null ) { *this = rhs; }
00040
00043 const KoTextFormat & format() const;
00044 KoTextFormat & format();
00045
00046 protected:
00047 KoTextFormat m_format;
00048 };
00049
00054 class KOTEXT_EXPORT KoParagStyle : public KoCharStyle
00055 {
00056 public:
00058 KoParagStyle( const QString & name );
00059
00061 KoParagStyle( const KoParagStyle & rhs );
00062
00063 ~KoParagStyle();
00064
00065 void operator=( const KoParagStyle & );
00066
00067
00068 const KoParagLayout & paragLayout() const;
00069 KoParagLayout & paragLayout();
00070
00071 KoParagStyle *followingStyle() const { return m_followingStyle; }
00072 void setFollowingStyle( KoParagStyle *fst );
00073
00076 void saveStyle( QDomElement & parentElem );
00079 void loadStyle( QDomElement & parentElem, int docVersion = 2 );
00080
00082 void loadStyle( QDomElement & styleElem, KoOasisContext& context );
00085 QString saveStyle( KoGenStyles& genStyles, int styleType, const QString& parentStyleName, KoSavingContext& context ) const;
00086
00087 KoParagStyle * parentStyle() const {return m_parentStyle;}
00088 void setParentStyle( KoParagStyle *_style){ m_parentStyle = _style;}
00089
00090 int inheritedParagLayoutFlag() const { return m_inheritedParagLayoutFlag; }
00091 int inheritedFormatFlag() const { return m_inheritedFormatFlag; }
00092
00093 void propagateChanges( int paragLayoutFlag, int formatFlag );
00094
00095
00096 bool isOutline() const { return m_bOutline; }
00097 void setOutline( bool b );
00098
00099 private:
00100 KoParagLayout m_paragLayout;
00101 KoParagStyle *m_followingStyle;
00102 KoParagStyle *m_parentStyle;
00103 int m_inheritedParagLayoutFlag;
00104 int m_inheritedFormatFlag;
00105 bool m_bOutline;
00106 };
00107
00108 #endif
00109