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

fl_FootnoteLayout.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2002 Patrick Lam <plam@mit.edu>
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., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 #ifndef FOOTNOTELAYOUT_H
00022 #define FOOTNOTELAYOUT_H
00023 
00024 #include "ut_types.h"
00025 #include "ut_vector.h"
00026 #include "pt_Types.h"
00027 #include "fl_Layout.h"
00028 #include "fl_ContainerLayout.h"
00029 #include "fl_SectionLayout.h"
00030 #include "pl_Listener.h"
00031 #include "ut_debugmsg.h"
00032 
00033 class pf_Frag_Strux;
00034 class fl_BlockLayout;
00035 
00036 // We have one fl_FootnoteLayout for each footnote.  They all
00037 // get physically placed at the bottom of the fp_Page in their own
00038 // little container.
00039 
00040 // The fl_FootnoteLayout lives after each block.
00041 
00042 // Need to do cursor navigation between blocks
00043 class fp_AnnotationRun;
00044 
00045 class ABI_EXPORT fl_EmbedLayout : public fl_SectionLayout
00046 {
00047     friend class fl_DocListener;
00048     friend class fp_FootnoteContainer;
00049 
00050 public:
00051     fl_EmbedLayout(FL_DocLayout* pLayout,
00052                    fl_DocSectionLayout * pDocSL,
00053                    pf_Frag_Strux* sdh,
00054                    PT_AttrPropIndex ap,
00055                    fl_ContainerLayout * pMyContainerLayout,
00056                    SectionType iSecType,
00057                    fl_ContainerType myType,
00058                    PTStruxType myStruxType);
00059     virtual ~fl_EmbedLayout();
00060     virtual void           setNeedsReformat(fl_ContainerLayout * pCL, UT_uint32 offset = 0);
00061     virtual void        updateLayout(bool bDoAll);
00062 
00063     virtual bool    doclistener_changeStrux(const PX_ChangeRecord_StruxChange * pcrxc);
00064     virtual bool    doclistener_deleteStrux(const PX_ChangeRecord_Strux * pcrx);
00065     virtual bool    doclistener_deleteEndEmbed(const PX_ChangeRecord_Strux * pcrx);
00066     virtual bool    bl_doclistener_insertEndEmbed(fl_ContainerLayout*,
00067                                               const PX_ChangeRecord_Strux * pcrx,
00068                                               pf_Frag_Strux* sdh,
00069                                               PL_ListenerId lid,
00070                                               void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
00071                                                                       PL_ListenerId lid,
00072                                                                       fl_ContainerLayout* sfhNew));
00073 
00074     virtual void             format(void) = 0;
00075     virtual void             updateLayout(void);
00076     virtual void             collapse(void) = 0;
00077     virtual void             markAllRunsDirty(void);
00078     virtual fl_SectionLayout *  getSectionLayout(void)  const;
00079     bool                     recalculateFields(UT_uint32 iUpdateCount);
00080     fl_BlockLayout *         getContainingBlock(void);
00081     virtual void             redrawUpdate(void);
00082     virtual fp_Container*    getNewContainer(fp_Container* = NULL) =0;
00083     fl_DocSectionLayout*     getDocSectionLayout(void) const { return m_pDocSL; }
00084     void                     setDocSectionLayout(fl_DocSectionLayout * pDSL)
00085       { m_pDocSL = pDSL;}
00086     bool                     isEndFootnoteIn(void) const
00087         {return m_bHasEndFootnote;}
00088     void                     setFootnoteEndIn(void)
00089         { m_bHasEndFootnote = true;}
00090     PT_DocPosition           getDocPosition(void);
00091     UT_uint32                getLength(void);
00092     UT_sint32                getOldSize(void) const
00093         { return m_iOldSize;}
00094     void                     setOldSize(UT_sint32 i)
00095         { m_iOldSize = i;}
00096 protected:
00097     virtual void             _purgeLayout(void);
00098     bool                     m_bNeedsRebuild;
00099     bool                     m_bNeedsFormat;
00100     bool                     m_bIsOnPage;
00101 private:
00102 
00103     fl_DocSectionLayout*     m_pDocSL;
00104     bool                     m_bHasEndFootnote;
00105     UT_sint32                m_iOldSize;
00106 };
00107 
00108 class ABI_EXPORT fl_FootnoteLayout : public fl_EmbedLayout
00109 {
00110     friend class fl_DocListener;
00111     friend class fp_FootnoteContainer;
00112 
00113 public:
00114     fl_FootnoteLayout(FL_DocLayout* pLayout,
00115                       fl_DocSectionLayout * pDocSL,
00116                       pf_Frag_Strux* sdh,
00117                       PT_AttrPropIndex ap,
00118                       fl_ContainerLayout * pMyContainerLayout);
00119     virtual ~fl_FootnoteLayout();
00120 
00121     virtual void             format(void);
00122     virtual void             collapse(void);
00123     virtual fp_Container*    getNewContainer(fp_Container* = NULL);
00124     UT_uint32                getFootnotePID(void) const
00125         {return m_iFootnotePID;}
00126 protected:
00127     virtual void             _lookupProperties(const PP_AttrProp* pAP);
00128 private:
00129     void                     _createFootnoteContainer(void);
00130     void                     _insertFootnoteContainer(fp_Container * pNewFC);
00131     void                     _localCollapse();
00132     UT_uint32                m_iFootnotePID;
00133 };
00134 
00135 
00136 class ABI_EXPORT fl_EndnoteLayout : public fl_EmbedLayout
00137 {
00138     friend class fl_DocListener;
00139     friend class fp_EndnoteContainer;
00140 
00141 public:
00142     fl_EndnoteLayout(FL_DocLayout* pLayout, fl_DocSectionLayout * pDocSL, pf_Frag_Strux* sdh, PT_AttrPropIndex ap, fl_ContainerLayout * pMyContainerLayout);
00143     virtual ~fl_EndnoteLayout();
00144 
00145     virtual void             format(void);
00146     virtual void             collapse(void);
00147     virtual fp_Container*    getNewContainer(fp_Container* = NULL);
00148     UT_uint32                getEndnotePID(void) const
00149         {return m_iEndnotePID;}
00150 protected:
00151     virtual void             _lookupProperties(const PP_AttrProp* pAP);
00152 private:
00153     void                     _createEndnoteContainer(void);
00154     void                     _insertEndnoteContainer(fp_Container * pNewFC);
00155     void                     _localCollapse();
00156 
00157     UT_uint32                m_iEndnotePID;
00158 };
00159 
00160 
00161 class ABI_EXPORT fl_AnnotationLayout : public fl_EmbedLayout
00162 {
00163     friend class fl_DocListener;
00164     friend class fp_AnnotationContainer;
00165 
00166 public:
00167     fl_AnnotationLayout(FL_DocLayout* pLayout,
00168                       fl_DocSectionLayout * pDocSL,
00169                       pf_Frag_Strux* sdh,
00170                       PT_AttrPropIndex ap,
00171                       fl_ContainerLayout * pMyContainerLayout);
00172     virtual ~fl_AnnotationLayout();
00173     fp_AnnotationRun *           getAnnotationRun(void);
00174     virtual void             format(void);
00175     virtual void             collapse(void);
00176     virtual fp_Container*    getNewContainer(fp_Container* = NULL);
00177     UT_uint32                getAnnotationPID(void) const
00178         {return m_iAnnotationPID;}
00179     const char *             getAuthor(void) const
00180     { return m_sAuthor.utf8_str();}
00181     const char *             getDate(void) const
00182     { return m_sDate.utf8_str();}
00183     const char *             getTitle(void) const
00184     { return m_sTitle.utf8_str();}
00185 protected:
00186     virtual void             _lookupProperties(const PP_AttrProp* pAP);
00187 private:
00188     void                     _createAnnotationContainer(void);
00189     void                     _insertAnnotationContainer(fp_Container * pNewFC);
00190     void                     _localCollapse();
00191     UT_uint32                m_iAnnotationPID;
00192     UT_UTF8String            m_sAuthor;
00193     UT_UTF8String            m_sDate;
00194     UT_UTF8String            m_sTitle;
00195 };
00196 
00197 
00198 #endif /* FOOTNOTELAYOUT_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1