InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RedlineIterator Class Referenceabstract

#include <redlineiterator.h>

Public Member Functions

virtual ~RedlineIterator ()
 
virtual void MoveToBeginning ()
 
virtual bool16 MoveToPosition (TextIndex t, int32 c=-1)=0
 
virtual TextIndex GetCurrentPosition (int32 *changePos=nil, int32 *numChanges=nil)=0
 
virtual int32 GetCurrentLength ()=0
 
virtual bool16 ProcessAccept (const RangeData *range=nil, bool16 doingAcceptAll=kFalse, bool16 restoreSelection=kFalse)
 
virtual bool16 ProcessReject (const RangeData *range=nil, bool16 doingRejectAll=kFalse, bool16 restoreSelection=kFalse)
 
virtual bool16 ProcessAcceptIncrement (const RangeData *range=nil, bool16 doingAcceptAll=kFalse, bool16 restoreSelection=kFalse)
 
virtual bool16 ProcessRejectIncrement (const RangeData *range=nil, bool16 doingRejectAll=kFalse, bool16 restoreSelection=kFalse)
 
virtual bool16 ProcessRejectDecrement (const RangeData *range=nil, bool16 doingRejectAll=kFalse, bool16 restoreSelection=kFalse)
 
virtual bool16 Increment (bool16 skipUnchanged)=0
 
virtual bool16 Decrement (bool16 skipUnchanged)=0
 
virtual const VOSRedlineChangeGetCurrentChangeRecord (TextIndex *pPosition=nil, int32 *pLength=nil)
 
virtual const VOS_RedlineObjectQueryCurrentObject ()
 
virtual void DescribeUser (PMString &user)
 
virtual void DescribeType (PMString &type)
 
virtual void DescribeTimeStamp (PMString &time)
 
virtual UIDRef DescribeChangeContent (PMString &detail, int32 maxLength=32)
 

Detailed Description

This class provides a way to iterate thru tracked changes. Create a new iterator using IRedlineDataStrand::NewRedlineIterator(), the caller is responsible for destroying the iterator.

See Also
IRedlineDataStrand
VOSRedline.h

When text is deleted, a change record is placed on a vos redline object on the character that followed the deleted text and the text is copied to a story thread so that it can be retrieved and displayed in galley view. When text is inserted, a change record is placed on a vos redline object in place and it's length is the number of characters inserted.

If the character following text that is deleted is an insert change then we have a situation where the insert change is nested. In this case, it is possible to iterate thru changes and the current position would be the same even though the iterator incremented/ecremented. Calling the accessor methods will return the appropriate change record information given the state of an internal flag or the useUI flag if passed when the iterator was constructed (via newredlineiterator). Accepting a nested insert will not affect the delete change; however, rejecting a nested insert will also reject the delete change.

Constructor & Destructor Documentation

virtual RedlineIterator::~RedlineIterator ()
virtual

Destructor

Member Function Documentation

virtual bool16 RedlineIterator::Decrement (bool16 skipUnchanged)
pure virtual

Decrements to the previous change record, returns false if there are no previous records.

Parameters
skipUnchangedIN whether or not to skip vos redline object without a change record
Returns
kTrue if decremented the iterator
virtual UIDRef RedlineIterator::DescribeChangeContent (PMStringdetail,
int32 maxLength = 32 
)
virtual

Sets detail equal to the deleted text string of the current delete text change record (if any), constrained by the maxLength.

Parameters
detailOUT current deleted text content string
maxLengthIN constrain detail param to this length
Returns
UIDRef of the deleted text owned item
virtual void RedlineIterator::DescribeTimeStamp (PMStringtime)
virtual

Sets time equal to the time stamp of the current change record.

Parameters
timeOUT current change time stamp
virtual void RedlineIterator::DescribeType (PMStringtype)
virtual

Sets type equal to the type of the current change record. Current values are "RL Insert" or "RL Delete"; to determine if the change is moved text versus added text check for type of "RL Insert" and use the GetIsMovedText() method for VOSRedlineChange objects.

Parameters
typeOUT current change type
virtual void RedlineIterator::DescribeUser (PMStringuser)
virtual

Sets user equal to the author of the current change record.

Parameters
userOUT current user name
virtual const VOSRedlineChange* RedlineIterator::GetCurrentChangeRecord (TextIndex * pPosition = nil,
int32 * pLength = nil 
)
virtual

Returns the current change record, nil if there is no current change record, and sets pPosition equal to GetCurrentPosition and pLength equal to GetCurrentLength. Note: the item pointed to by the returned value from is allocated with new, the caller is responsible for deallocating the memory.

Parameters
pPositionOUT current change's text index
pLengthOUT current change's length
Returns
current redline object
virtual int32 RedlineIterator::GetCurrentLength ()
pure virtual

Returns the length of the vos redline object. Note: for delete changes this is always 1, to get the length of the delete text use DescribeChangeContent() and examine the PMString.

Returns
length of the vos redline object
virtual TextIndex RedlineIterator::GetCurrentPosition (int32 * changePos = nil,
int32 * numChanges = nil 
)
pure virtual

Returns current text position of the iterator.

Parameters
changePosOUT position of the change at this text index
numChangesOUT number of changes at this text position
Returns
current change text index
virtual bool16 RedlineIterator::Increment (bool16 skipUnchanged)
pure virtual

Increments to the next change record, returns false if there are no records beyond the current record.

Parameters
skipUnchangedIN whether or not to skip vos redline object without a change record
Returns
kTrue if incremented the iterator
virtual void RedlineIterator::MoveToBeginning ()
virtual

Move iterator to beginning of the story, text position = 0.

virtual bool16 RedlineIterator::MoveToPosition (TextIndex t,
int32 c = -1 
)
pure virtual

Move iterator to specified text position at the first change record (default) or the change specified, returns false if text position is off the end of the story.

Parameters
tIN the text index to move to
cIN the change index to move to
Returns
kTrue if moved the iterator
virtual bool16 RedlineIterator::ProcessAccept (const RangeDatarange = nil,
bool16 doingAcceptAll = kFalse,
bool16 restoreSelection = kFalse 
)
virtual

Accepts the current change record, returns kFalse if no change to accept or there was error processing accept command.

Parameters
rangeIN the text range to accept, nil means accept current change only
doingAcceptAllIN whether or not accepting all changes, passed to command
restoreSelectionIN whether or not selection should restore, passed to command
Returns
kTrue if successfully accepted the change
virtual bool16 RedlineIterator::ProcessAcceptIncrement (const RangeDatarange = nil,
bool16 doingAcceptAll = kFalse,
bool16 restoreSelection = kFalse 
)
virtual

Accepts the current change record and increments to the next change record, returns false if there were not records beyond the accepted change.

Parameters
rangeIN the text range to accept, nil means accept current change only
doingAcceptAllIN whether or not accepting all changes, passed to command
restoreSelectionIN whether or not selection should restore, passed to command
Returns
kTrue if incremented the iterator
virtual bool16 RedlineIterator::ProcessReject (const RangeDatarange = nil,
bool16 doingRejectAll = kFalse,
bool16 restoreSelection = kFalse 
)
virtual

Rejects the current change record, returns kFalse if no change to reject or there was error processing reject command.

Parameters
rangeIN the text range to reject, nil means reject current change only
doingRejectAllIN whether or not rejecting all changes, passed to command
restoreSelectionIN whether or not selection should restore, passed to command
Returns
kTrue if successfully rejected the change
virtual bool16 RedlineIterator::ProcessRejectDecrement (const RangeDatarange = nil,
bool16 doingRejectAll = kFalse,
bool16 restoreSelection = kFalse 
)
virtual

Rejects the current change record and decrements to the previous change record, returns false if there are no records before the rejected change.

Parameters
rangeIN the text range to reject, nil means reject current change only
doingRejectAllIN whether or not rejecting all changes, passed to command
restoreSelectionIN whether or not selection should restore, passed to command
Returns
kTrue if decremented the iterator
virtual bool16 RedlineIterator::ProcessRejectIncrement (const RangeDatarange = nil,
bool16 doingRejectAll = kFalse,
bool16 restoreSelection = kFalse 
)
virtual

Rejects the current change record and increments to the next change record, returns false if there are no records beyond the rejected change.

Parameters
rangeIN the text range to reject, nil means reject current change only
doingRejectAllIN whether or not rejecting all changes, passed to command
restoreSelectionIN whether or not selection should restore, passed to command
Returns
kTrue if incremented the iterator
virtual const VOS_RedlineObject* RedlineIterator::QueryCurrentObject ()
virtual

Returns the current vos redline object, nil if there is no current object.

Returns
current redline object