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

fp_TOCContainer.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2004 Martin Sevior <msevior@physics.unimelb.edu.au>
00003  * Copyright (C) 1998 AbiSource, Inc.
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018  * 02111-1307, USA.
00019  *
00020  */
00021 
00022 #ifndef TOCCONTAINER_H
00023 #define TOCCONTAINER_H
00024 
00025 #ifdef FMT_TEST
00026 #include <stdio.h>
00027 #endif
00028 
00029 #include "ut_misc.h"
00030 #include "ut_types.h"
00031 #include "ut_vector.h"
00032 #include "pt_Types.h"
00033 #include "fp_Page.h"
00034 #include "fp_ContainerObject.h"
00035 #include "fp_Column.h"
00036 #include "gr_Graphics.h"
00037 
00038 class fl_DocSectionLayout;
00039 
00040 class ABI_EXPORT fp_TOCContainer : public fp_VerticalContainer
00041 {
00042 public:
00043     fp_TOCContainer(fl_SectionLayout* pSectionLayout);
00044     fp_TOCContainer(fl_SectionLayout* pSectionLayout,fp_TOCContainer * pMaster);
00045     virtual ~fp_TOCContainer();
00046     virtual void        mapXYToPosition(UT_sint32 x, UT_sint32 y,
00047                                         PT_DocPosition& pos,
00048                                         bool& bBOL, bool& bEOL, bool &isTOC);
00049     UT_sint32           getValue(void);
00050     void                layout(void);
00051     void                forceClearScreen(void);
00052     virtual UT_sint32   getHeight(void) const;
00053     virtual void        clearScreen(void);
00054     virtual void        draw(dg_DrawArgs*);
00055     virtual void        draw(GR_Graphics*);
00056     virtual void        setContainer(fp_Container * pContainer);
00057     virtual void        setY(UT_sint32 iY);
00058     virtual fp_Container * getNextContainerInSection(void) const;
00059     virtual fp_Container * getPrevContainerInSection(void) const;
00060     fp_Column *         getBrokenColumn(void);
00061     virtual bool        isVBreakable(void);
00062     virtual bool        isHBreakable(void) {return false;}
00063     virtual UT_sint32   wantVBreakAt(UT_sint32);
00064     virtual UT_sint32   wantHBreakAt(UT_sint32) {return 0;}
00065     virtual fp_ContainerObject * VBreakAt(UT_sint32);
00066     virtual fp_ContainerObject * HBreakAt(UT_sint32) {return NULL;}
00067 
00068     fl_DocSectionLayout * getDocSectionLayout(void);
00069     void                  setSelected(bool bIsSelected);
00070     fp_TOCContainer *   getMasterTOC(void) const
00071         { return m_pMasterTOC; }
00072     bool                isThisBroken(void) const
00073         { return m_bIsBroken;}
00074     void                setYBreakHere(UT_sint32 iBreakHere);
00075     void                setYBottom(UT_sint32 iBotContainer);
00076     bool                isInBrokenTOC(fp_Container * pCon);
00077 //
00078 // This is the smallest Y value of the TOC allowed in this
00079 // broken TOC
00080 //
00081     UT_sint32           getYBreak(void) const
00082         {return m_iYBreakHere;}
00083 //
00084 // This is the largest Y value of the TOC allowed in this broken TOC
00085 //
00086     UT_sint32           getYBottom(void) const
00087         {return m_iYBottom;}
00088     fp_TOCContainer *   getFirstBrokenTOC(void) const;
00089     fp_TOCContainer *   getLastBrokenTOC(void) const;
00090     void                setFirstBrokenTOC(fp_TOCContainer * pBroke);
00091     void                setLastBrokenTOC(fp_TOCContainer * pBroke);
00092     void                deleteBrokenTOCs(bool bClearFirst);
00093     void                adjustBrokenTOCs(void);
00094     UT_sint32           getBrokenTop(void);
00095     UT_sint32           getBrokenBot(void);
00096     void                setBrokenTop(UT_sint32 iTop)
00097         { m_iBrokenTop = iTop;}
00098     void                setBrokenBot(UT_sint32 iBot)
00099         { m_iBrokenBottom = iBot;}
00100     UT_sint32           getBrokenNumber(void);
00101     void setLastWantedVBreak(UT_sint32 iBreakAt)
00102     {
00103         m_iLastWantedVBreak = iBreakAt;
00104     }
00105     UT_sint32 getLastWantedVBreak(void) const
00106     {
00107         return m_iLastWantedVBreak;
00108     }
00109 
00110 private:
00111 //
00112 // Variables for TOC's broken across Vertical Containers.
00113 //
00114     fp_TOCContainer *     m_pFirstBrokenTOC;
00115     fp_TOCContainer *     m_pLastBrokenTOC;
00116     bool                    m_bIsBroken;
00117     fp_TOCContainer *     m_pMasterTOC;
00118     UT_sint32               m_iYBreakHere;
00119     UT_sint32               m_iYBottom;
00120     UT_sint32               m_iBrokenTop;
00121     UT_sint32               m_iBrokenBottom;
00122     UT_sint32               m_iLastWantedVBreak;
00123 };
00124 
00125 #endif /* TOCCONTAINER_H */

Generated on Sun May 27 2012 for AbiWord by  doxygen 1.7.1