31 #ifndef __VOS_Redline__ 32 #define __VOS_Redline__ 34 #include "VOSObject.h" 35 #include "VOSCursor.h" 37 #include "WideString.h" 39 #include "XMLReference.h" 46 class ITextIndexIDList;
58 typedef enum { kUnknown = 0, kDelete, kInsert, kApply } RedlineChangeType;
62 RedlineChangeType type,
73 , fIsMovedText(kFalse)
81 RedlineChangeType GetChangeType()
const 86 void SetUserName(
const PMString& userName)
87 { fUserName = userName; }
89 void PrintUser()
const 91 int32 GetUserID()
const 95 uint64 GetTimeStamp()
const 96 {
return fTimeStamp; }
97 void SetTimeStamp(uint64 i)
100 bool16 GetIsMovedText()
const 101 {
return fIsMovedText; }
102 void SetIsMovedText(bool16 isMovedText)
103 { fIsMovedText = isMovedText; }
105 bool16 GetIsDeletedText()
const 106 {
return fType == VOSRedlineChange::kDelete; }
107 bool16 GetIsAddedText()
const 108 {
return fType == VOSRedlineChange::kInsert && !fIsMovedText; }
111 {
return fTimeStamp == other.fTimeStamp && fType == other.fType && fUserName == other.fUserName && fIsMovedText == other.fIsMovedText; }
116 RedlineChangeType fType;
129 RedlineUndo(int32 len, VOSRedlineChange::RedlineChangeType type);
130 virtual void Undo(TextIndex start);
132 void Target(
const UIDRef& strand);
138 VOSRedlineChange::RedlineChangeType fType;
151 , fLength(copy.fLength)
152 , fChangeStack(copy.fChangeStack)
170 void SetLength(int32 len);
171 void AdjustLength(int32 delta)
174 int32 NumberOfChanges()
const 175 {
return fChangeStack.size(); }
177 {
return fChangeStack[n]; }
186 static void Insert(
VOS_Cursor& cursor,
IRedlineDataStrand *redline, int32 len, bool16 trackInsert,
const VOSRedlineChange *useThisChange, bool16 pasting, bool16 isNoteChar, bool16 isTableContinuation = kFalse, bool16 isSaveBack = kFalse);
193 static bool16 CanApplyDeleteChange(
VOS_Cursor& cursor, int32 len);
198 static void UndoSimpleChange(
VOS_Cursor& cursor, int32 len, VOSRedlineChange::RedlineChangeType type);
200 static void UndoSimpleChange(
VOS_Cursor& cursor, int32 len);
213 static bool16 CanApplyDeleteChange(
VOS_Cursor& cursor, int32 len,
const PMString& user);
219 void RemoveChangeRecord(int32 changeIndex);
221 void ClearChangeStack() { fChangeStack.clear(); }