00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PX_CHANGERECORD_H
00022 #define PX_CHANGERECORD_H
00023
00024 #include "ut_types.h"
00025 #include "ut_uuid.h"
00026 #include "pt_Types.h"
00027 #include "pd_Document.h"
00028 #include "pt_PieceTable.h"
00029
00030 class PD_Document;
00031
00032 class ABI_EXPORT PX_ChangeRecord
00033 {
00034 friend class pt_PieceTable;
00035 public:
00036 typedef enum _PXType {
00037 PXT__FIRST__=-1,
00038 PXT_GlobMarker=-1,
00039 PXT_InsertSpan=0,
00040 PXT_DeleteSpan=1,
00041 PXT_ChangeSpan=2,
00042 PXT_InsertStrux=3,
00043 PXT_DeleteStrux=4,
00044 PXT_ChangeStrux=5,
00045 PXT_InsertObject=6,
00046 PXT_DeleteObject=7,
00047 PXT_ChangeObject=8,
00048 PXT_InsertFmtMark=9,
00049 PXT_DeleteFmtMark=10,
00050 PXT_ChangeFmtMark=11,
00051 PXT_ChangePoint=12,
00052 PXT_ListUpdate=13,
00053 PXT_StopList=14,
00054 PXT_UpdateField=15,
00055 PXT_RemoveList=16,
00056 PXT_UpdateLayout=17,
00057 PXT_AddStyle=18,
00058 PXT_RemoveStyle=19,
00059 PXT_CreateDataItem=20,
00060 PXT_ChangeDocProp=21,
00061 PXT__LAST__ = 22
00062 }PXType;
00063
00064 PX_ChangeRecord(PXType type,
00065 PT_DocPosition position,
00066 PT_AttrPropIndex indexNewAP,
00067 UT_uint32 iXID);
00068
00069 virtual ~PX_ChangeRecord();
00070
00071 PXType getType(void) const;
00072 PT_DocPosition getPosition(void) const;
00073 PT_AttrPropIndex getIndexAP(void) const;
00074 bool getPersistance(void) const;
00075
00080 inline void setPersistance(bool persistant)
00081 { m_persistant = persistant; }
00082
00083 virtual PX_ChangeRecord* reverse(void) const;
00084 PXType getRevType(void) const;
00085 UT_sint32 getCRNumber(void) const
00086 { return m_iCRNumber;}
00087 UT_uint32 getXID() const {return m_iXID;}
00088
00089 const char * getDocUUID() const;
00090
00091 PD_Document * getDocument(void) const;
00092 void setDocument(const PD_Document * pDoc) const;
00093 bool setCRNumber(void) const;
00094 bool isFromThisDoc(void) const;
00095 void setAdjustment(UT_sint32 iAdj) const;
00096 UT_sint32 getAdjustment(void) const;
00097 #ifdef PT_TEST
00098 virtual void __dump(FILE * fp) const;
00099 void __dump_type(FILE * fp) const;
00100 #endif
00101
00102 protected:
00104 PXType m_type;
00106 PT_DocPosition m_position;
00108 PT_AttrPropIndex m_indexAP;
00110 bool m_persistant;
00111
00112
00113 UT_uint32 m_iXID;
00114 mutable UT_sint32 m_iCRNumber;
00115 mutable PD_Document * m_pDoc;
00116 private:
00117 mutable struct uuid m_MyDocUUID;
00118 mutable UT_sint32 m_iAdjust;
00119 };
00120 #endif