• 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., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, 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(fp_Container * pT,
00107                                                 fp_Container* pCell,
00108                                                 fp_ContainerObject * pCon);
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(fp_ContainerObject* pContainer,
00122                                    UT_sint32& xoff,
00123                                    UT_sint32& yoff);
00124     fp_TableContainer * getCorrectBrokenTable(fp_Container * pLine);
00125     fp_TOCContainer *   getCorrectBrokenTOC(fp_Container * pLine);
00126     void            getScreenOffsets(fp_ContainerObject* pContainer,
00127                                          UT_sint32& xoff,
00128                                          UT_sint32& yoff);
00129 
00130         virtual UT_Rect *   getScreenRect();
00131     virtual void        markDirtyOverlappingRuns(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 protected:
00167     void                _setMaxContainerHeight(UT_sint32 iContainerHeight);
00168     UT_sint32           _getMaxContainerHeight(void) const;
00169 
00170     virtual void            _drawBoundaries(dg_DrawArgs* pDA);
00171     UT_sint32                   m_iRedrawHeight;
00172 private:
00173 
00177     UT_sint32               m_iWidth;
00178 
00182     UT_sint32               m_iHeight;
00186     UT_sint32               m_iMaxHeight;
00187 
00191     UT_sint32               m_iX;
00195     UT_sint32               m_iY;
00196 
00205     bool                    m_bIntentionallyEmpty;
00206     UT_sint32               m_imaxContainerHeight;
00207     UT_GenericVector<fp_Line *> m_vecWrappedLines;
00208 };
00209 
00210 class ABI_EXPORT fp_Column : public fp_VerticalContainer
00211 {
00212 public:
00213     fp_Column(fl_SectionLayout* pSectionLayout);
00214     ~fp_Column();
00215 
00216     fl_DocSectionLayout*    getDocSectionLayout(void) const;
00217     void            setLeader(fp_Column* p) { m_pLeader = p; }
00218     void            setFollower(fp_Column* p) { m_pFollower = p; }
00219     fp_Column*  getLeader(void) const  { return m_pLeader; }
00220     fp_Column*  getFollower(void) const         { return m_pFollower; }
00221     bool            containsPageBreak(void) const;
00227     void                setPage(fp_Page* pPage);
00228     virtual fp_Page*    getPage(void) const
00229         { return m_pPage; }
00230 
00231     UT_sint32               getColumnIndex(void);
00236     UT_sint32           getMaxHeight(void) const;
00237 
00238     void                layout(void);
00239 
00240     void                collapseEndnotes(void);
00241 #ifdef FMT_TEST
00242     void                __dump(FILE * fp) const;
00243 #endif
00244 
00245 protected:
00246     UT_uint32               _getBottomOfLastContainer(void) const;
00247 
00248     void                    _drawBoundaries(dg_DrawArgs* pDA);
00249 
00250 private:
00251 
00252     fp_Column*              m_pLeader;
00253     fp_Column*              m_pFollower;
00254     fp_Page*                m_pPage;
00255 };
00256 
00257 class ABI_EXPORT fp_ShadowContainer : public fp_VerticalContainer
00258 {
00259 public:
00260     fp_ShadowContainer(UT_sint32 iX, UT_sint32 iY,
00261                        UT_sint32 iWidth, UT_sint32 iHeight,
00262                        fl_SectionLayout* pSL);
00263     ~fp_ShadowContainer();
00264 
00265     fl_HdrFtrSectionLayout* getHdrFtrSectionLayout(void) const;
00266     fl_HdrFtrShadow *   getShadow();
00267     virtual void        draw(dg_DrawArgs*);
00268     virtual void        draw(GR_Graphics*) {};
00269     virtual void        layout(void);
00270     void                layout(bool bForce);
00271     virtual void        clearScreen(void);
00272     void                clearHdrFtrBoundaries(void);
00273     void                setPage(fp_Page* pPage);
00274     virtual inline fp_Page*     getPage(void) const
00275         { return m_pPage; }
00276 protected:
00277     void                _drawHdrFtrBoundaries(dg_DrawArgs * pDA);
00278 private:
00279     bool                m_bHdrFtrBoxDrawn;
00280     UT_sint32           m_ixoffBegin;
00281     UT_sint32           m_iyoffBegin;
00282     UT_sint32           m_ixoffEnd;
00283     UT_sint32           m_iyoffEnd;
00284     fp_Page*            m_pPage;
00285 
00286 };
00287 
00288 
00289 class ABI_EXPORT fp_HdrFtrContainer : public fp_VerticalContainer
00290 {
00291 public:
00292     fp_HdrFtrContainer( UT_sint32 iWidth,
00293                        fl_SectionLayout* pSL);
00294     ~fp_HdrFtrContainer();
00295 
00296     fl_HdrFtrSectionLayout* getHdrFtrSectionLayout(void) const;
00297     virtual void        draw(dg_DrawArgs*);
00298     virtual void        layout(void);
00299     virtual void        clearScreen(void);
00300     void                getScreenOffsets(fp_ContainerObject* pContainer, UT_sint32& xoff,
00301                                          UT_sint32& yoff);
00302 
00303 protected:
00304 };
00305 
00306 #endif /* COLUMN_H */

Generated on Sun May 27 2012 for AbiWord by  doxygen 1.7.1