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

AbiCollab_Export.h

Go to the documentation of this file.
00001 /*
00002  * AbiCollab - Code to enable the modification of remote documents.
00003  * Copyright (C) 2005 by Martin Sevior
00004  * Copyright (C) 2006,2007 by Marc Maurer <uwog@uwog.net>
00005  * Copyright (C) 2007 by One Laptop Per Child
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 
00023 #ifndef ABI_COLLAB_EXPORT_H
00024 #define ABI_COLLAB_EXPORT_H
00025 
00026 #include "ut_types.h"
00027 #include "pt_Types.h"
00028 #include "px_ChangeRecord.h"
00029 #include "xav_Listener.h"
00030 #include "pl_Listener.h"
00031 #include "ut_string_class.h"
00032 #include <packet/xp/AbiCollab_Packet.h>
00033 
00034 class FL_DocLayout;
00035 class PD_Document;
00036 class UT_Stack;
00037 class PX_ChangeRecord;
00038 class ChangeAdjust;
00039 class AbiCollab;
00040 
00041 class ABI_Collab_Export : public PL_DocChangeListener
00042 {
00043 
00044 friend class AbiCollab;
00045 
00046 public:
00047     ABI_Collab_Export(AbiCollab* pAbiCollab, PD_Document* pDoc);
00048     virtual ~ABI_Collab_Export();
00049 
00050     virtual bool        populate(fl_ContainerLayout* /*sfh*/,
00051                                  const PX_ChangeRecord* /*pcr*/) { return true; }
00052 
00053     virtual bool        populateStrux(pf_Frag_Strux* /*sdh*/,
00054                                       const PX_ChangeRecord* /*pcr*/,
00055                                       fl_ContainerLayout** /*psfh*/) { return true; }
00056 
00057     virtual bool        change(fl_ContainerLayout* sfh,
00058                                const PX_ChangeRecord* pcr);
00059 
00060     virtual void        deferNotifications(void) {}
00061     virtual void        processDeferredNotifications(void) {}
00062 
00063     virtual bool        insertStrux(fl_ContainerLayout* sfh,
00064                                     const PX_ChangeRecord* pcr,
00065                                     pf_Frag_Strux* sdh,
00066                                     PL_ListenerId lid,
00067                                     void (*pfnBindHandles)(pf_Frag_Strux* sdhNew,
00068                                                             PL_ListenerId lid,
00069                                                             fl_ContainerLayout* sfhNew));
00070 
00071     virtual bool        signal(UT_uint32 iSignal);
00072 
00073     virtual PLListenerType getType() const;
00074 
00075     virtual void        setNewDocument(PD_Document * pDoc);
00076     virtual void        removeDocument(void);
00077 
00078     const UT_GenericVector<ChangeAdjust *> * getAdjusts(void) const
00079         { return & m_vecAdjusts;}
00080     UT_GenericVector<ChangeAdjust *> * getAdjusts(void)
00081         { return & m_vecAdjusts;}
00082 
00083     void                masterInit();
00084     void                slaveInit(const std::string& docUUID, UT_sint32 iRemoteRev);
00085 
00086 private:
00087 
00088     ChangeRecordSessionPacket*      _buildPacket( const PX_ChangeRecord* pcr );
00089     void                            _handleNewPacket( ChangeRecordSessionPacket* pPacket, const PX_ChangeRecord* pcr );
00090     bool                            _isGlobEnd(UT_Byte istart, UT_Byte istop);
00091     void                            _mapPropsAtts( UT_sint32 indx, std::map<UT_UTF8String,UT_UTF8String>& props,
00092                                             std::map<UT_UTF8String,UT_UTF8String>& atts );
00093 
00094     void                _init();
00095     void                _cleanup();
00096 
00098     PD_Document*        m_pDoc;
00099 
00100     UT_Stack            m_sLastContainerLayout;
00101 
00102     AV_ChangeMask       m_chgMaskCached;
00103     bool                m_bCacheChanges;
00104 
00105     UT_sint32           m_iBlockIndex;
00106     UT_sint32           m_iSectionIndex;
00107 
00108     AbiCollab *         m_pAbiCollab;
00109     UT_GenericVector<ChangeAdjust *>        m_vecAdjusts;
00110     GlobSessionPacket*  m_pGlobPacket;      // if set, we're in a glob
00111 };
00112 
00113 #endif /* ABI_COLLAB_EXPORT_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1