Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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* ,
00051 const PX_ChangeRecord* ) { return true; }
00052
00053 virtual bool populateStrux(pf_Frag_Strux* ,
00054 const PX_ChangeRecord* ,
00055 fl_ContainerLayout** ) { 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;
00111 };
00112
00113 #endif