• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

fp_Column.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef COLUMN_H
00021 #define COLUMN_H
00022 
00023 #ifdef FMT_TEST
00024 #include <stdio.h>
00025 #endif
00026 
00027 #include "ut_misc.h"
00028 #include "ut_types.h"
00029 #include "ut_vector.h"
00030 #include "pt_Types.h"
00031 #include "fp_Page.h"
00032 #include "fl_DocLayout.h"
00033 #include "fp_ContainerObject.h"
00034 
00035 class fl_EndnoteSectionLayout;
00036 class fl_HdrFtrSectionLayout;
00037 class fl_DocSectionLayout;
00038 class fl_SectionLayout;
00039 class fp_TOCContainer;
00040 class fl_HdrFtrShadow;
00041 class fp_Page;
00042 class PP_AttrProp;
00043 class GR_Graphics;
00044 class fp_TableContainer;
00045 struct dg_DrawArgs;
00046 struct fp_Sliver;
00047 
00048 class ABI_EXPORT fp_VerticalContainer : public fp_Container
00049 {
00050 public:
00051     fp_VerticalContainer(FP_ContainerType iType, fl_SectionLayout* pSectionLayout);
00052     virtual ~fp_VerticalContainer();
00053 
00054     virtual void        setWidth(UT_sint32);
00055     void                _setWidth(UT_sint32 iWidth) {m_iWidth = iWidth;}
00056     virtual void        setHeight(UT_sint32);
00057     void                _setHeight(UT_sint32 iHeight) {m_iHeight = iHeight;}
00058     virtual void        setMaxHeight(UT_sint32);
00059     virtual void        setX(UT_sint32, bool bDontClearIfNeeded=false);
00060     virtual void        setY(UT_sint32);
00065     inline UT_sint32    getMaxHeight(void) const
00066         { return m_iMaxHeight; }
00067 
00072     virtual UT_sint32   getWidth(void) const
00073         { return m_iWidth; }
00074 
00075     virtual UT_sint32   getX(void) const;
00076 
00077     void        _setX( UT_sint32 iX) { m_iX = iX;}
00078 
00079     virtual UT_sint32   getY(void) const;
00080     UT_sint32           getY(GR_Graphics * pG) const;
00081 
00082     void        _setY( UT_sint32 iY) { m_iY = iY;}
00087     virtual UT_sint32   getHeight(void) const
00088         { return m_iHeight; }
00089 
00090     UT_sint32   getColumnGap(void) const;
00091 
00096     bool            getIntentionallyEmpty(void) const
00097         { return m_bIntentionallyEmpty; }
00101     void            setIntentionallyEmpty(bool b)
00102         { m_bIntentionallyEmpty = b; }
00103 
00104     fp_Container*           getFirstContainer(void) const;
00105     fp_Container*           getLastContainer(void) const;
00106     UT_sint32               getYoffsetFromTable(const fp_Container* pT,
00107                                                     const fp_Container* pCell,
00108                                                     const fp_ContainerObject* pCon) const;
00109     bool                insertContainerAfter(fp_Container* pNewContainer, fp_Container* pAfterContainer);
00110     bool                insertContainer(fp_Container*);
00111     bool                addContainer(fp_Container*);
00112     void                removeContainer(fp_Container* pContainer, bool bClear = false);
00113         void                            removeAll(void);
00114     virtual UT_uint32   distanceFromPoint(UT_sint32 x, UT_sint32 y);
00115 
00116     virtual void        mapXYToPosition(UT_sint32 xPos,
00117                                         UT_sint32 yPos,
00118                                         PT_DocPosition& pos,
00119                                         bool& bBOL, bool& bEOL, bool &isTOC);
00120 
00121     void                getOffsets(const fp_ContainerObject* pContainer,
00122                                    UT_sint32& xoff,
00123                                    UT_sint32& yoff) const;
00124     fp_TableContainer * getCorrectBrokenTable(const fp_Container * pLine) const;
00125     fp_TOCContainer *   getCorrectBrokenTOC(const fp_Container * pLine) const;
00126     void            getScreenOffsets(const fp_ContainerObject* pContainer,
00127                                              UT_sint32& xoff,
00128                                              UT_sint32& yoff) const;
00129 
00130     virtual UT_Option<UT_Rect>     getScreenRect() const;
00131     virtual void        markDirtyOverlappingRuns(const UT_Rect & recScreen);
00132     UT_sint32           countWrapped(void);
00133 
00134     virtual void        draw(dg_DrawArgs*);
00135     virtual void        draw(GR_Graphics*) {}
00136 
00137     void                clearScreen(void);
00138     void                bumpContainers(fp_ContainerObject* pLastContainerToKeep);
00139     virtual bool        isVBreakable(void) {return true;}
00140     virtual bool        isHBreakable(void) {return false;}
00141     virtual UT_sint32   wantVBreakAt(UT_sint32) {return 0;}
00142     virtual UT_sint32   wantHBreakAt(UT_sint32) {return 0;}
00143     virtual fp_ContainerObject * VBreakAt(UT_sint32) {return NULL;}
00144     virtual fp_ContainerObject * HBreakAt(UT_sint32) {return NULL;}
00145     void                recalcMaxWidth(bool bDontClearIfNeeded = false)
00146     {
00147         UT_UNUSED(bDontClearIfNeeded);
00148     }
00149     virtual UT_sint32   getMarginBefore(void) const { return 0;}
00150     virtual UT_sint32   getMarginAfter(void) const { return 0;}
00151     virtual void        setAssignedScreenHeight(UT_sint32) {}
00152     virtual fp_Container * getNextContainerInSection(void) const
00153         {return NULL;}
00154     virtual fp_Container * getPrevContainerInSection(void) const
00155         {return NULL;}
00156     bool                validate(void);
00157     FV_View*            getView(void) const;
00158     UT_sint32           getNumWrapped(void) const
00159         { return m_vecWrappedLines.getItemCount();}
00160     void                addWrappedLine(fp_Line * pLine)
00161         { m_vecWrappedLines.addItem(pLine);}
00162     void                clearWrappedLines(void)
00163         { m_vecWrappedLines.clear();}
00164     fp_Line *           getNthWrappedLine(UT_sint32 i)
00165         { return m_vecWrappedLines.getNthItem(i);}
00166     /* Virtual functions for vertical breakable containers*/
00167     virtual fp_Container * getFirstBrokenContainer() const {UT_ASSERT(0);return NULL;}
00168     virtual UT_sint32      getLastWantedVBreak(void) const {return 0;}
00169     virtual void           setLastWantedVBreak(UT_sint32) {;}
00170     virtual void           deleteBrokenAfter(bool) {;}
00171 
00172 protected:
00173     void                _setMaxContainerHeight(UT_sint32 iContainerHeight);
00174     UT_sint32           _getMaxContainerHeight(void) const;
00175 
00176     virtual void            _drawBoundaries(dg_DrawArgs* pDA);
00177     UT_sint32                   m_iRedrawHeight;
00178 private:
00179 
00183     UT_sint32               m_iWidth;
00184 
00188     UT_sint32               m_iHeight;
00192     UT_sint32               m_iMaxHeight;
00193 
00197     UT_sint32               m_iX;
00201     UT_sint32               m_iY;
00202 
00211     bool                    m_bIntentionallyEmpty;
00212     UT_sint32               m_imaxContainerHeight;
00213     UT_GenericVector<fp_Line *> m_vecWrappedLines;
00214 };
00215 
00216 class ABI_EXPORT fp_Column : public fp_VerticalContainer
00217 {
00218 public:
00219     fp_Column(fl_SectionLayout* pSectionLayout);
00220     ~fp_Column();
00221 
00222     fl_DocSectionLayout*    getDocSectionLayout(void) const;
00223     void            setLeader(fp_Column* p) { m_pLeader = p; }
00224     void            setFollower(fp_Column* p) { m_pFollower = p; }
00225     fp_Column*  getLeader(void) const  { return m_pLeader; }
00226     fp_Column*  getFollower(void) const         { return m_pFollower; }
00227     bool            containsPageBreak(void) const;
00233     void                setPage(fp_Page* pPage);
00234     virtual fp_Page*    getPage(void) const
00235         { return m_pPage; }
00236 
00237     UT_sint32               getColumnIndex(void);
00242     UT_sint32           getMaxHeight(void) const;
00243 
00244     void                layout(void);
00245 
00246     void                collapseEndnotes(void);
00247 #ifdef FMT_TEST
00248     void                __dump(FILE * fp) const;
00249 #endif
00250 
00251 protected:
00252     UT_uint32               _getBottomOfLastContainer(void) const;
00253 
00254     void                    _drawBoundaries(dg_DrawArgs* pDA);
00255 
00256 private:
00257 
00258     fp_Column*              m_pLeader;
00259     fp_Column*              m_pFollower;
00260     fp_Page*                m_pPage;
00261 };
00262 
00263 class ABI_EXPORT fp_ShadowContainer : public fp_VerticalContainer
00264 {
00265 public:
00266     fp_ShadowContainer(UT_sint32 iX, UT_sint32 iY,
00267                        UT_sint32 iWidth, UT_sint32 iHeight,
00268                        fl_SectionLayout* pSL);
00269     ~fp_ShadowContainer();
00270 
00271     fl_HdrFtrSectionLayout* getHdrFtrSectionLayout(void) const;
00272     fl_HdrFtrShadow *   getShadow();
00273     virtual void        draw(dg_DrawArgs*);
00274     virtual void        draw(GR_Graphics*) {};
00275     virtual void        layout(void);
00276     void                layout(bool bForce);
00277     virtual void        clearScreen(void);
00278     void                clearHdrFtrBoundaries(void);
00279     void                setPage(fp_Page* pPage);
00280     virtual inline fp_Page*     getPage(void) const
00281         { return m_pPage; }
00282 protected:
00283     void                _drawHdrFtrBoundaries(dg_DrawArgs * pDA);
00284 private:
00285     bool                m_bHdrFtrBoxDrawn;
00286     UT_sint32           m_ixoffBegin;
00287     UT_sint32           m_iyoffBegin;
00288     UT_sint32           m_ixoffEnd;
00289     UT_sint32           m_iyoffEnd;
00290     fp_Page*            m_pPage;
00291 
00292 };
00293 
00294 
00295 class ABI_EXPORT fp_HdrFtrContainer : public fp_VerticalContainer
00296 {
00297 public:
00298     fp_HdrFtrContainer( UT_sint32 iWidth,
00299                        fl_SectionLayout* pSL);
00300     ~fp_HdrFtrContainer();
00301 
00302     fl_HdrFtrSectionLayout* getHdrFtrSectionLayout(void) const;
00303     virtual void        draw(dg_DrawArgs*);
00304     virtual void        layout(void);
00305     virtual void        clearScreen(void);
00306     void                getScreenOffsets(fp_ContainerObject* pContainer, UT_sint32& xoff,
00307                                          UT_sint32& yoff);
00308 
00309 protected:
00310 };
00311 
00312 #endif /* COLUMN_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1