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

fl_FrameLayout.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2003 Martin Sevior.
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 FRAMELAYOUT_H
00021 #define FRAMELAYOUT_H
00022 
00023 #include "ut_types.h"
00024 #include "ut_vector.h"
00025 #include "pt_Types.h"
00026 #include "fl_Layout.h"
00027 #include "fl_ContainerLayout.h"
00028 #include "fl_SectionLayout.h"
00029 #include "pl_Listener.h"
00030 #include "ut_debugmsg.h"
00031 #include "pp_PropertyMap.h"
00032 
00033 class pf_Frag_Strux;
00034 
00035 enum FL_FrameFormatMode
00036 {
00037     FL_FRAME_POSITIONED_TO_BLOCK,
00038     FL_FRAME_POSITIONED_TO_COLUMN,
00039     FL_FRAME_POSITIONED_TO_PAGE,
00040     FL_FRAME_POSITIONED_INLINE
00041 };
00042 
00043 enum FL_FrameWrapMode
00044 {
00045     FL_FRAME_ABOVE_TEXT,
00046     FL_FRAME_BELOW_TEXT,
00047     FL_FRAME_WRAPPED_TO_RIGHT,
00048     FL_FRAME_WRAPPED_TO_LEFT,
00049     FL_FRAME_WRAPPED_BOTH_SIDES,
00050     FL_FRAME_WRAPPED_TOPBOT
00051 };
00052 
00053 enum FL_FrameType
00054 {
00055     FL_FRAME_TEXTBOX_TYPE,
00056     FL_FRAME_WRAPPER_IMAGE,
00057     FL_FRAME_WRAPPER_TABLE,
00058     FL_FRAME_WRAPPER_EMBED
00059 };
00060 
00061 // We have one fl_FrameLayout for each Frame.  They all
00062 // get physically placed on a page.
00063 
00064 
00065 // The fl_FrameLayout is placed before the Block it is closest to on the page.
00066 // It holds Blocks of it's own like cells and footnotes.
00067 
00068 class ABI_EXPORT fl_FrameLayout : public fl_SectionLayout
00069 {
00070     friend class fl_DocListener;
00071     friend class fp_FrameContainer;
00072 
00073 public:
00074     fl_FrameLayout(FL_DocLayout* pLayout,
00075                    pf_Frag_Strux* sdh,
00076                    PT_AttrPropIndex ap,
00077                    fl_ContainerLayout * pMyContainerLayout);
00078     virtual ~fl_FrameLayout();
00079 
00080     virtual bool    doclistener_changeStrux(const PX_ChangeRecord_StruxChange * pcrxc);
00081     virtual bool    doclistener_deleteStrux(const PX_ChangeRecord_Strux * pcrx);
00082     virtual bool    doclistener_deleteEndFrame(const PX_ChangeRecord_Strux * pcrx);
00083     virtual bool    bl_doclistener_insertEndFrame(fl_ContainerLayout*,
00084                                               const PX_ChangeRecord_Strux * pcrx,
00085                                               pf_Frag_Strux* sdh,
00086                                               PL_ListenerId lid,
00087                                               void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
00088                                                                       PL_ListenerId lid,
00089                                                                       fl_ContainerLayout* sfhNew));
00090    bool                     insertBlockAfter(fl_ContainerLayout* pCL,
00091                                               const PX_ChangeRecord_Strux * pcrx,
00092                                               pf_Frag_Strux* sdh,
00093                                               PL_ListenerId lid,
00094                                               void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
00095                                                                       PL_ListenerId lid,
00096                                                                       fl_ContainerLayout* sfhNew));
00097 
00098     void                     miniFormat(void);
00099     virtual void             format(void);
00100     virtual void             updateLayout(bool bDoFull);
00101     virtual void             collapse(void);
00102     void                     localCollapse();
00103     virtual void             markAllRunsDirty(void);
00104     virtual fl_SectionLayout *  getSectionLayout(void)  const;
00105     bool                     recalculateFields(UT_uint32 iUpdateCount);
00106     virtual void             redrawUpdate(void);
00107     virtual fp_Container*    getNewContainer(fp_Container* = NULL);
00108     PT_DocPosition           getDocPosition(void);
00109     UT_uint32                getLength(void);
00110     virtual void             setNeedsReformat(fl_ContainerLayout * pCL, UT_uint32 offset = 0);
00111     void                     setContainerProperties(void);
00112     UT_sint32                getBoundingSpace(void) const;
00113     FL_FrameType             getFrameType(void) const
00114         {return m_iFrameType;}
00115     FL_FrameFormatMode       getFramePositionTo(void) const
00116         { return m_iFramePositionTo;}
00117     FL_FrameWrapMode         getFrameWrapMode(void) const
00118         { return m_iFrameWrapMode;}
00119     UT_sint32                getFrameWidth(void) const
00120         { return m_iWidth;}
00121     UT_sint32                getFrameHeight(void) const
00122         { return m_iHeight;}
00123     UT_sint32                getFrameXpos(void) const
00124         { return m_iXpos;}
00125     UT_sint32                getFrameYpos(void) const
00126         { return m_iYpos;}
00127     UT_sint32                getFrameXColpos(void) const
00128         { return m_iXColumn;}
00129     UT_sint32                getFrameYColpos(void) const
00130         { return m_iYColumn;}
00131     UT_sint32                getFrameXPagepos(void) const
00132         { return m_iXPage;}
00133     UT_sint32                getFrameYPagepos(void) const
00134         { return m_iYPage;}
00135 
00136     void                setFrameWidth(UT_sint32 iW) { m_iWidth = iW;}
00137     void                setFrameHeight(UT_sint32 iH) { m_iHeight = iH;}
00138     void                setFrameXpos(UT_sint32 iX)  { m_iXpos = iX;}
00139     void                setFrameYpos(UT_sint32 iY) { m_iYpos = iY;}
00140     bool                isEndFrameIn(void) const
00141         { return m_bHasEndFrame;}
00142     bool                isTightWrap(void)
00143       { return m_bIsTightWrap;}
00144     bool                expandHeight(void) const
00145     { return m_bExpandHeight;}
00146     UT_sint32           minHeight(void) const
00147     { return m_iMinHeight;}
00148     fl_ContainerLayout *     getParentContainer(void) const
00149             {return m_pParentContainer;}
00150     void                setParentContainer(fl_ContainerLayout * pCon)
00151             {m_pParentContainer = pCon;}
00152 private:
00153     virtual void             _lookupProperties(const PP_AttrProp* pAP);
00154     virtual void             _lookupMarginProperties(const PP_AttrProp* pAP);
00155     void                     _purgeLayout(void);
00156     void                     _createFrameContainer(void);
00157     void                     _insertFrameContainer(fp_Container * pNewFC);
00158     FL_FrameType             m_iFrameType;
00159     FL_FrameFormatMode       m_iFramePositionTo;
00160     bool                     m_bNeedsRebuild;
00161     bool                     m_bNeedsFormat;
00162     bool                     m_bIsOnPage;
00163     bool                     m_bHasEndFrame;
00164 
00165 // Frame-background properties
00166     PP_PropertyMap::Background  m_background;
00167 
00168 // Frame-border properties
00169     PP_PropertyMap::Line   m_lineBottom;
00170     PP_PropertyMap::Line   m_lineLeft;
00171     PP_PropertyMap::Line   m_lineRight;
00172     PP_PropertyMap::Line   m_lineTop;
00173 
00174     UT_sint32               m_iWidth;
00175     UT_sint32               m_iHeight;
00176     UT_sint32               m_iXpos;
00177     UT_sint32               m_iYpos;
00178 
00179     UT_sint32               m_iXpad;
00180     UT_sint32               m_iYpad;
00181 
00182     UT_sint32               m_iXColumn;
00183     UT_sint32               m_iYColumn;
00184 
00185     UT_sint32               m_iXPage;
00186     UT_sint32               m_iYPage;
00187 
00188     UT_sint32               m_iBoundingSpace;
00189         FL_FrameWrapMode        m_iFrameWrapMode;
00190     bool                    m_bIsTightWrap;
00191     UT_sint32               m_iPrefPage;
00192     UT_sint32               m_iPrefColumn;
00193     bool                    m_bExpandHeight;
00194     UT_sint32               m_iMinHeight;
00195     fl_ContainerLayout *    m_pParentContainer;
00196 };
00197 
00198 #endif /* FRAMELAYOUT_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1