00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef kwtextparag_h
00021 #define kwtextparag_h
00022
00023 #include "KoTextParag.h"
00024
00025 class KoStyleCollection;
00026 class QDomDocument;
00027 class KWTextFrameSet;
00028 class KWTextDocument;
00029 class KWDocument;
00030 class KWTextParag;
00031 class KoParagStyle;
00032
00033
00034 typedef KoParagLayout KWParagLayout;
00035
00040 class KWTextParag : public KoTextParag
00041 {
00042 public:
00043 KWTextParag( KoTextDocument *d, KoTextParag *pr = 0, KoTextParag *nx = 0, bool updateIds = TRUE )
00044 : KoTextParag( d, pr, nx, updateIds ) { }
00045 ~KWTextParag() { }
00046
00047 KWTextDocument * kwTextDocument() const;
00048
00049 virtual void setParagLayout( const KoParagLayout &layout, int flags = KoParagLayout::All, int marginIndex = -1 );
00050
00052 void setPageBreaking( int pb );
00053 int pageBreaking() const { return m_layout.pageBreaking; }
00054 bool linesTogether() const { return m_layout.pageBreaking & KoParagLayout::KeepLinesTogether; }
00055 bool hardFrameBreakBefore() const { return m_layout.pageBreaking & KoParagLayout::HardFrameBreakBefore; }
00056 bool hardFrameBreakAfter() const { return m_layout.pageBreaking & KoParagLayout::HardFrameBreakAfter; }
00057
00059 static KoTextFormat loadFormat( QDomElement &formatElem, KoTextFormat *refFormat, const QFont &defaultFont, const QString & defaultLanguage, bool hyphanation );
00061 static QDomElement saveFormat( QDomDocument &doc, KoTextFormat *curFormat, KoTextFormat *refFormat, int pos, int len );
00062
00063
00065 void save( QDomElement &parentElem, bool saveAnchorsFramesets = false );
00066
00068 void save( QDomElement &parentElem, int from, int to, bool saveAnchorsFramesets = false );
00069
00071 void load( QDomElement &attributes );
00072
00074 void loadFormatting( QDomElement &attributes, int offset = 0, bool loadFootNote=true );
00075
00077 void loadLayout( QDomElement & attributes );
00078
00080 static KoParagLayout loadParagLayout( QDomElement & parentElem, KWDocument *doc, bool useRefStyle );
00081
00082 virtual void loadOasis( const QDomElement& e, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos );
00083 virtual void saveOasis( KoXmlWriter& writer, KoSavingContext& context,
00084 int from, int to, bool saveAnchorsFramesets = false ) const;
00085
00086 virtual void join( KoTextParag *parag );
00087 protected:
00088 virtual void drawFormattingChars( QPainter &painter, int start, int len,
00089 int lastY_pix, int baseLine_pix, int h_pix,
00090 bool drawSelections,
00091 KoTextFormat *lastFormat, const QMemArray<int> &selectionStarts,
00092 const QMemArray<int> &selectionEnds, const QColorGroup &cg,
00093 bool rightToLeft, int line, KoTextZoomHandler* zh,
00094 int whichFormattingChars );
00095
00096 };
00097
00098 #endif