Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PAGE_H
00021 #define PAGE_H
00022
00023 #include <stdio.h>
00024 #include "ut_types.h"
00025 #include "ut_vector.h"
00026 #include "pt_Types.h"
00027 #include "fl_SectionLayout.h"
00028 #include "fp_PageSize.h"
00029 #include "fp_ContainerObject.h"
00030
00031 class FL_DocLayout;
00032 class fp_Column;
00033 class fp_Container;
00034 class fp_ShadowContainer;
00035 class fp_FootnoteContainer;
00036 class fp_AnnotationContainer;
00037 class fp_FrameContainer;
00038 class fl_DocSectionLayout;
00039 class fl_HdrFtrSectionLayout;
00040 class fl_HdrFtrShadow;
00041 class fl_FootnoteLayout;
00042 class fl_AnnotationLayout;
00043 class fl_FrameLayout;
00044 class FV_View;
00045 class GR_Graphics;
00046 class fp_TableContainer;
00047 class fl_TOCLayout;
00048 struct dg_DrawArgs;
00049
00050 class ABI_EXPORT _BL
00051 {
00052 public:
00053 _BL(fl_BlockLayout * pBL,fp_Line * pL) :
00054 m_pBL(pBL),
00055 m_pL(pL)
00056 {
00057 }
00058 fl_BlockLayout * m_pBL;
00059 fp_Line * m_pL;
00060 };
00061
00062
00063 class ABI_EXPORT fp_Page
00064 {
00065 public:
00066 fp_Page(FL_DocLayout*,
00067 FV_View*,
00068 const fp_PageSize& pageSize,
00069 fl_DocSectionLayout* pOwner
00070 );
00071 ~fp_Page();
00072
00073 UT_sint32 getWidth(void) const;
00074 const fp_PageSize& getPageSize() const;
00075 UT_sint32 getHeight(void) const;
00076 UT_sint32 getBottom(void) const;
00077 fp_Page* getNext(void) const;
00078 fp_Page* getPrev(void) const;
00079 void setNext(fp_Page*);
00080 void setPrev(fp_Page*);
00081 void markAllDirty(void) {m_bNeedsRedraw = true;}
00082 UT_sint32 getColumnGap(void) const;
00083 FL_DocLayout* getDocLayout() const;
00084 void setView(FV_View*);
00085 bool isOnScreen(void) const;
00086
00087 inline fl_DocSectionLayout* getOwningSection(void) const { return m_pOwner; }
00088
00089 PT_DocPosition getFirstLastPos(bool bFirst) const;
00090 void mapXYToPosition(bool bNotFrames,UT_sint32 xPos, UT_sint32 yPos, PT_DocPosition& pos, bool& bBOL, bool& bEOL,bool & isTOC, bool bUseHdrFtr = false, fl_HdrFtrShadow ** pShadow = NULL) const;
00091 void mapXYToPosition(UT_sint32 xPos, UT_sint32 yPos, PT_DocPosition& pos, bool& bBOL, bool& bEOL, bool & isTOC,bool bUseHdrFtr = false, fl_HdrFtrShadow ** pShadow = NULL) const;
00092 void getScreenOffsets(const fp_Container*, UT_sint32& xoff, UT_sint32& yoff) const;
00093
00094 void draw(dg_DrawArgs*, bool bAlaysUseWhiteBackground=false);
00095 bool needsRedraw(void) const;
00096 UT_sint32 getFilledHeight(fp_Container * prevContainer) const;
00097 UT_sint32 getAvailableHeight(void) const;
00098 UT_sint32 getAvailableHeightForColumn(const fp_Column * pColumn) const;
00099 fp_TableContainer * getContainingTable(PT_DocPosition pos);
00100 void clearCountWrapNumber(void);
00101
00102 void columnHeightChanged(fp_Column* pLeader);
00103 bool breakPage(void);
00104 UT_sint32 countColumnLeaders(void) const;
00105 fp_Column* getNthColumnLeader(UT_sint32 n) const;
00106 bool insertColumnLeader(fp_Column* pLeader, fp_Column* pAfter);
00107 void removeColumnLeader(fp_Column* pLeader);
00108 fp_Container* getNthColumn(UT_uint32 n,fl_DocSectionLayout *pSection) const;
00109 bool isEmpty(void) const;
00110 bool containsPageBreak(void) const;
00111 fp_Container * updatePageForWrapping(fp_Column *& pNextCol);
00112
00113 void removeHdrFtr(HdrFtrType hfType);
00114 fp_ShadowContainer* getHdrFtrP(HdrFtrType hfType) const;
00115 fp_ShadowContainer* getHdrFtrContainer(fl_HdrFtrSectionLayout*);
00116 fp_ShadowContainer* buildHdrFtrContainer(fl_HdrFtrSectionLayout*,
00117 HdrFtrType hfType);
00118
00119
00120 void footnoteHeightChanged(void);
00121 UT_sint32 countFootnoteContainers(void) const;
00122 fp_FootnoteContainer* getNthFootnoteContainer(UT_sint32 n) const;
00123 bool insertFootnoteContainer(fp_FootnoteContainer * pFC);
00124 void removeFootnoteContainer(fp_FootnoteContainer * pFC);
00125 UT_sint32 findFootnoteContainer(fp_FootnoteContainer * pFC) const;
00126 void clearScreenFootnotes(void);
00127 UT_sint32 getFootnoteHeight(void) const;
00128
00129
00130
00131 void annotationHeightChanged(void);
00132 UT_sint32 countAnnotationContainers(void) const;
00133 fp_AnnotationContainer* getNthAnnotationContainer(UT_sint32 n) const;
00134 bool insertAnnotationContainer(fp_AnnotationContainer * pFC);
00135 void removeAnnotationContainer(fp_AnnotationContainer * pFC);
00136 UT_sint32 findAnnotationContainer(fp_AnnotationContainer * pFC) const;
00137 void clearScreenAnnotations(void);
00138 UT_sint32 getAnnotationHeight(void) const;
00139 UT_sint32 getAnnotationPos( UT_uint32 pid) const;
00140
00141
00142 void frameHeightChanged(void) const;
00143 UT_sint32 countAboveFrameContainers(void) const;
00144 UT_sint32 countBelowFrameContainers(void) const;
00145 fp_FrameContainer* getNthAboveFrameContainer(UT_sint32 n) const;
00146 fp_FrameContainer* getNthBelowFrameContainer(UT_sint32 n) const;
00147 bool insertFrameContainer(fp_FrameContainer * pFC);
00148 void removeFrameContainer(fp_FrameContainer * pFC);
00149 UT_sint32 findFrameContainer(fp_FrameContainer * pFC) const;
00150 void clearScreenFrames(void);
00151 void markDirtyOverlappingRuns(fp_FrameContainer * pFC);
00152 void expandDamageRect(UT_sint32 x, UT_sint32 y,
00153 UT_sint32 width, UT_sint32 height);
00154 bool intersectsDamagedRect(fp_ContainerObject * pObj) const;
00155 void redrawDamagedFrames(dg_DrawArgs* pDA);
00156 bool overlapsWrappedFrame(const fp_Line * pLine) const;
00157 bool overlapsWrappedFrame(const UT_Rect & rec) const;
00158 void setPageNumberInFrames(void);
00159 UT_sint32 getPageNumber(void) const;
00160 UT_sint32 getFieldPageNumber(void) const;
00161 void setFieldPageNumber(UT_sint32 iPageNum);
00162 void resetFieldPageNumber(void);
00163 bool TopBotMarginChanged(void);
00164 void setLastMappedTOC(fl_TOCLayout * pTOCL)
00165 { m_pLastMappedTOC = pTOCL;}
00166 fl_TOCLayout * getLastMappedTOC(void) const
00167 { return m_pLastMappedTOC;}
00168 fg_FillType & getFillType(void);
00169 const fg_FillType & getFillType(void) const;
00170 void getAllLayouts(UT_GenericVector<fl_ContainerLayout *> & AllLayouts) const;
00171
00172 #ifdef FMT_TEST
00173 void __dump(FILE * fp) const;
00174 #endif
00175
00176 void updateColumnX();
00177 protected:
00178 void _drawCropMarks(dg_DrawArgs*);
00179 void _reformat(void);
00180 void _reformatColumns(void);
00181 void _reformatFootnotes(void);
00182 void _reformatAnnotations(void);
00183
00184 private:
00185 fp_Page(const fp_Page&) = delete;
00186 void operator=(const fp_Page&) = delete;
00187
00188 FL_DocLayout* m_pLayout;
00189 FV_View* m_pView;
00190 fp_Page* m_pNext;
00191 fp_Page* m_pPrev;
00192
00193 fp_PageSize m_pageSize;
00194
00195 bool m_bNeedsRedraw;
00196
00197 UT_GenericVector<fp_Column *> m_vecColumnLeaders;
00198
00199 fl_DocSectionLayout* m_pOwner;
00200
00201 fp_ShadowContainer* m_pFooter;
00202 fp_ShadowContainer* m_pHeader;
00203
00204 UT_GenericVector<fp_FootnoteContainer *> m_vecFootnotes;
00205 UT_GenericVector<fp_AnnotationContainer *> m_vecAnnotations;
00206 fg_FillType m_FillType;
00207 UT_GenericVector<fp_FrameContainer *> m_vecAboveFrames;
00208 UT_GenericVector<fp_FrameContainer *> m_vecBelowFrames;
00209 fl_TOCLayout * m_pLastMappedTOC;
00210
00211 UT_Rect m_rDamageRect;
00212 UT_sint32 m_iCountWrapPasses;
00213 UT_sint32 m_iFieldPageNumber;
00214 };
00215
00216 #endif