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

#include <IStrand.h>

Inheritance diagram for IStrand:
IPMUnknownStrand

Public Types

enum  { kDefaultIID = IID_ISTRAND }
 
typedef K2Vector< InterfacePtr
< ITextModelMemento > > 
MementoList
 

Public Member Functions

virtual void Insert (const WideString *data, TextIndex pos)=0
 
virtual void Delete (TextIndex startpos, int32 numchars)=0
 
virtual IStrandPastePieceCut (TextIndex startpos, int32 numchars)=0
 
virtual void Replace (const boost::shared_ptr< ITextModel::ReplacementList > &replList, bool16 clearNonContinuingAttrs)=0
 
virtual void ForceCompositionDamage (TextIndex position, int32 numChars)=0
 
virtual void ForceContentDamage (TextIndex position, int32 numChars)=0
 
virtual int32 GetRunLength (TextIndex position, TextIndex *runBegin=nil)=0
 
virtual IStrandPastePieceCopyRange (TextIndex startpos, int32 numchars)=0
 
virtual int32 Paste (TextIndex startpos, IStrandPastePiece *str)=0
 
virtual void IncreaseSpan (TextIndex at, int32 len)=0
 
virtual void CollectMementosForDelete (TextIndex at, int32 len, MementoList &list)=0
 
virtual void CollectMementosForCut (TextIndex at, int32 len, MementoList &list)=0
 
virtual void CollectMementosForCopyRange (TextIndex at, int32 len, MementoList &list) const =0
 
virtual void CollectMementosForReplace (TextIndex at, int32 len, MementoList &list)=0
 
virtual UID GetFirstPage ()=0
 
virtual UID SetFirstPage (UID firstPage)=0
 
virtual UID CreatePage ()=0
 
virtual ClassID GetObjectClass () const =0
 
virtual ICommandQueryRemoveFromDocumentCmd (UID textModelUID)=0
 
virtual UID GetOwningStoryUID () const =0
 
virtual void StrandAttachedToStory (UID textModelUID, int32 length)=0
 
virtual void StrandDetachedFromStory (UID textModelUID)=0
 
virtual void InsertStoryThread (UID dictUID, uint32 dictKey, const WideString *data, TextIndex pos)=0
 
virtual bool16 CreateStoryThreads (UID dictUID, const K2Vector< uint32 > &dictKeyList, const K2Vector< int32 > &lenList, TextIndex pos)=0
 
virtual bool16 JoinStoryThreads (TextIndex start, int32 len)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Abstract interface that all strands must support. Some of the common methods that a strand of the text model must support.

Member Function Documentation

virtual UID IStrand::CreatePage ()
pure virtual

Create a new page.

Implemented in Strand.

virtual bool16 IStrand::CreateStoryThreads (UID dictUID,
const K2Vector< uint32 > & dictKeyList,
const K2Vector< int32 > & lenList,
TextIndex pos 
)
pure virtual

Divide existing story thread into one or more new story threads. We always divide off the bottom of an existing story thread. Stands without special StoryThread responsibilities are not required to do anything with this call.

Valid 'pos' values for CreateStoryThread() is the next character after what will become the new final CR of the dividing story thread.

An K2Vector is allowed in order to speed creation of many StoryThreads at one time. A typical creation sequence might be to create an initial story thread with InsertStoryThread(), insert one more sequences of initial text, each terminated by a CR, in the new story thread and then call CreateStoryThread() with the appropriate list of keys and lengths.

Implemented in Strand.

virtual void IStrand::ForceCompositionDamage (TextIndex position,
int32 numChars 
)
pure virtual

hardly any strands will care about damage.

Implemented in Strand.

virtual void IStrand::ForceContentDamage (TextIndex position,
int32 numChars 
)
pure virtual

hardly any strands will care about damage.

Implemented in Strand.

virtual UID IStrand::GetFirstPage ()
pure virtual

Return the first disk page in the strand. Creates the first page if there wasn't one already.

Implemented in Strand.

virtual ClassID IStrand::GetObjectClass () const
pure virtual

Return the classID of the VOS objects on the pages.

Implemented in Strand.

virtual UID IStrand::GetOwningStoryUID () const
pure virtual

frequently returns kInvalidUID, each strand is NOT required to remember this

Implemented in Strand.

virtual int32 IStrand::GetRunLength (TextIndex position,
TextIndex * runBegin = nil 
)
pure virtual

returns the REMAINING length only – length of what's left AFTER position

virtual void IStrand::IncreaseSpan (TextIndex at,
int32 len 
)
pure virtual

Called by the text model during Paste for all strands that did generate VOSSavedData to be pasted.

Implemented in Strand.

virtual void IStrand::InsertStoryThread (UID dictUID,
uint32 dictKey,
const WideStringdata,
TextIndex pos 
)
pure virtual

Insert a new story thread. Strands that do not need to do special handling for StoryThread creation can simply implement this method by calling DoInsert() on themselves. Valid 'pos' values for InsertStoryThread() are the first index after an existing StoryThread. This means you can't insert a StoryThread at TextIndex zero (0) but you CAN insert after the final CR (and story thread) of the TextModel. 'data' must be terminated by a CR.

Implemented in Strand.

virtual bool16 IStrand::JoinStoryThreads (TextIndex start,
int32 len 
)
pure virtual

The inverse of CreateStoryThread. The span of the joined StoryThread(s) are given back to the preceding StoryThread. This method does not change the length of the TextModel.

Implemented in Strand.

virtual ICommand* IStrand::QueryRemoveFromDocumentCmd (UID textModelUID)
pure virtual

Called to obtain a command when the strand is about to be removed from the document. The returned command should remove any owned UIDs make sure to also remove all disk pages! It should be undoable.

Implemented in Strand.

virtual UID IStrand::SetFirstPage (UID firstPage)
pure virtual

Make

Parameters
firstPagethe first page in the strand. Returns what previously was the first page.

Implemented in Strand.