kword
KWFrameLayout.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KWFRAMELAYOUT_H
00020 #define KWFRAMELAYOUT_H
00021
00022 #include <qptrlist.h>
00023 #include <kdebug.h>
00024 #include <KoRect.h>
00025 #include <qmap.h>
00026
00027 class KWDocument;
00028 class KWFrameSet;
00029 class KWTextFrameSet;
00030 class KoRect;
00031
00032 class KWFrameLayout
00033 {
00034 public:
00035
00036
00037 struct HeaderFooterFrameset {
00038 enum OddEvenAll { Even, Odd, All };
00039
00040 HeaderFooterFrameset( KWTextFrameSet* fs, int start, int end,
00041 double spacing, OddEvenAll oea = All );
00042
00043
00044 KWTextFrameSet* m_frameset;
00045
00046
00047 int m_startAtPage;
00048 int m_endAtPage;
00049
00050
00051 OddEvenAll m_oddEvenAll;
00052
00053
00054 double m_height;
00055
00056
00057
00058
00059 double m_spacing;
00060
00061
00062 double m_minY;
00063
00064
00065
00066 bool m_positioned;
00067
00068
00069
00070 int frameNumberForPage( int page ) const;
00071
00072 int lastFrameNumber( int lastPage ) const;
00073
00074 void debug();
00075 bool deleteFramesAfterLast( int lastPage );
00076 };
00077
00085 KWFrameLayout( KWDocument* doc, QPtrList<HeaderFooterFrameset>& headersFooters,
00086 QPtrList<HeaderFooterFrameset>& footnotes, QPtrList<HeaderFooterFrameset>& endnotes )
00087 : m_headersFooters( headersFooters ), m_footnotes( footnotes ), m_endnotes( endnotes ), m_doc( doc )
00088 {}
00089
00090 enum { DontRemovePages = 1 };
00099 void layout( KWFrameSet* mainTextFrameSet, int numColumns,
00100 int fromPage, int toPage, uint flags );
00101
00102 protected:
00103 void resizeOrCreateHeaderFooter( KWTextFrameSet* headerFooter, uint frameNumber, const KoRect& rect );
00104 KoRect firstColumnRect( KWFrameSet* mainTextFrameSet, int pageNum, int numColumns ) const;
00105 enum HasFootNotes { NoFootNote, WithFootNotes, NoChange };
00106 bool resizeMainTextFrame( KWFrameSet* mainTextFrameSet, int pageNum, int numColumns, double ptColumnWidth, double ptColumnSpacing, double left, double top, double bottom, HasFootNotes hasFootNotes );
00107 void checkFootNotes();
00108
00109 private:
00110
00111 QPtrList<HeaderFooterFrameset>& m_headersFooters;
00112 QPtrList<HeaderFooterFrameset>& m_footnotes;
00113 QPtrList<HeaderFooterFrameset>& m_endnotes;
00114 QMap<KWFrameSet *, bool> m_framesetsToUpdate;
00115 KWDocument* m_doc;
00116 int m_lastMainFramePage;
00117 };
00118
00119 #endif
|