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

ie_exp_RTF_listenerGetProps.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 IE_EXP_RTF_LISTENERGETPROPS
00021 #define IE_EXP_RTF_LISTENERGETPROPS
00022 #include "ie_exp_RTF.h"
00023 
00024 /******************************************************************
00025 ** This class is to be considered private to ie_exp_RTF.cpp
00026 ** This is a PL_Listener.  It's purpose is to gather information
00027 ** from the document (the font table and color table and anything
00028 ** else) that must be written to the rtf header.
00029 ******************************************************************/
00030 
00031 class ABI_EXPORT s_RTF_ListenerGetProps : public PL_Listener
00032 {
00033 public:
00034     s_RTF_ListenerGetProps(PD_Document * pDocument,
00035                            IE_Exp_RTF * pie);
00036     virtual ~s_RTF_ListenerGetProps();
00037 
00038     virtual bool        populate(fl_ContainerLayout* sfh,
00039                                  const PX_ChangeRecord * pcr);
00040 
00041     virtual bool        populateStrux(pf_Frag_Strux* sdh,
00042                                       const PX_ChangeRecord * pcr,
00043                                       fl_ContainerLayout* * psfh);
00044 
00045     virtual bool        change(fl_ContainerLayout* sfh,
00046                                const PX_ChangeRecord * pcr);
00047 
00048     virtual bool        insertStrux(fl_ContainerLayout* sfh,
00049                                     const PX_ChangeRecord * pcr,
00050                                     pf_Frag_Strux* sdh,
00051                                     PL_ListenerId lid,
00052                                     void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
00053                                                             PL_ListenerId lid,
00054                                                             fl_ContainerLayout* sfhNew));
00055 
00056     virtual bool        signal(UT_uint32 iSignal);
00057     bool                hasBlock() { return m_bHasBlock; }
00058 
00059 protected:
00060     void                _closeSection(void);
00061     void                _closeBlock(void);
00062     void                _closeSpan(void);
00063     void                _openSpan(PT_AttrPropIndex apiSpan);
00064     void                _outputData(const UT_UCSChar * p, UT_uint32 length);
00065     void                _compute_span_properties(const PP_AttrProp * pSpanAP,
00066                                                  const PP_AttrProp * pBlockAP,
00067                                                  const PP_AttrProp * pSectionAP);
00068 
00069     void                _check_revs_for_color(const PP_AttrProp * pAP1,
00070                                               const PP_AttrProp * pAP2,
00071                                               const PP_AttrProp * pAP3);
00072 
00073     void                _check_revs_for_font (const PP_AttrProp * pAP1,
00074                                               const PP_AttrProp * pAP2,
00075                                               const PP_AttrProp * pAP3);
00076 
00077     void                _searchTableAPI(PT_AttrPropIndex api);
00078     void                _searchCellAPI(PT_AttrPropIndex api);
00079  private:
00080     PD_Document *       m_pDocument;
00081     IE_Exp_RTF *        m_pie;
00082     bool                m_bInSection;
00083     bool                m_bInBlock;
00084     bool                m_bInSpan;
00085     PT_AttrPropIndex    m_apiLastSpan;
00086 
00087     PT_AttrPropIndex    m_apiThisSection;
00088     PT_AttrPropIndex    m_apiThisBlock;
00089     PT_AttrPropIndex    m_apiSavedBlock;
00091     bool                m_bHasBlock;
00092 };
00093 
00094 #endif /* IE_EXP_RTF_LISTENERGETPROPS */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1