InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Strand Class Referenceabstract
Inheritance diagram for Strand:
IStrandIPMUnknown

Public Member Functions

 Strand (IPMUnknown *boss)
 
virtual UID CreatePage ()=0
 
virtual UID GetFirstPage ()
 
virtual UID SetFirstPage (UID firstPage)
 
virtual ClassID GetObjectClass () const =0
 
virtual ICommandQueryRemoveFromDocumentCmd (UID textModelUID)
 
virtual void ForceCompositionDamage (TextIndex position, int32 numChars)
 
virtual void ForceContentDamage (TextIndex position, int32 numChars)
 
virtual UID GetOwningStoryUID () const
 
virtual void StrandAttachedToStory (UID textModelUID, int32 length)
 
virtual void StrandDetachedFromStory (UID textModelUID)
 
virtual void InsertStoryThread (UID dictUID, uint32 dictKey, const WideString *data, TextIndex pos)
 
virtual bool16 CreateStoryThreads (UID dictUID, const K2Vector< uint32 > &dictKeyList, const K2Vector< int32 > &lenList, TextIndex pos)
 
virtual bool16 JoinStoryThreads (TextIndex start, int32 len)
 
virtual void IncreaseSpan (TextIndex at, int32 len)
 
virtual void CollectMementosForDelete (TextIndex pos, int32 len, MementoList &list)
 
virtual void CollectMementosForCut (TextIndex pos, int32 len, MementoList &list)
 
virtual void CollectMementosForCopyRange (TextIndex pos, int32 len, MementoList &list) const
 
virtual void CollectMementosForReplace (TextIndex pos, int32 len, MementoList &list)
 
virtual void Delete (TextIndex startpos, int32 numchars)
 
virtual void Replace (const boost::shared_ptr< ITextModel::ReplacementList > &replList, bool16 clearNonContinuingAttrs)
 
void ReadWrite (IPMStream *s, ImplementationID prop)
 
- Public Member Functions inherited from IStrand
virtual void Insert (const WideString *data, TextIndex pos)=0
 
virtual IStrandPastePieceCut (TextIndex startpos, 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
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Protected Member Functions

UID CreatePage (ClassID pageClass)
 
virtual void CollectMementos (TextIndex pos, int32 len, MementoList &list) const
 

Protected Attributes

UID fStoryUID
 

Additional Inherited Members

- Public Types inherited from IStrand
enum  { kDefaultIID = IID_ISTRAND }
 
typedef K2Vector< InterfacePtr
< ITextModelMemento > > 
MementoList
 

Member Function Documentation

virtual UID Strand::CreatePage ()
pure virtual

Create a new page.

Implements IStrand.

virtual bool16 Strand::CreateStoryThreads (UID dictUID,
const K2Vector< uint32 > & dictKeyList,
const K2Vector< int32 > & lenList,
TextIndex pos 
)
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.

Implements IStrand.

virtual void Strand::ForceCompositionDamage (TextIndex position,
int32 numChars 
)
virtual

hardly any strands will care about damage.

Implements IStrand.

virtual void Strand::ForceContentDamage (TextIndex position,
int32 numChars 
)
inlinevirtual

hardly any strands will care about damage.

Implements IStrand.

virtual UID Strand::GetFirstPage ()
virtual

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

Implements IStrand.

virtual ClassID Strand::GetObjectClass () const
pure virtual

Return the classID of the VOS objects on the pages.

Implements IStrand.

virtual UID Strand::GetOwningStoryUID () const
virtual

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

Implements IStrand.

virtual void Strand::IncreaseSpan (TextIndex at,
int32 len 
)
virtual

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

Implements IStrand.

virtual void Strand::InsertStoryThread (UID dictUID,
uint32 dictKey,
const WideStringdata,
TextIndex pos 
)
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.

Implements IStrand.

virtual bool16 Strand::JoinStoryThreads (TextIndex start,
int32 len 
)
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.

Implements IStrand.

virtual ICommand* Strand::QueryRemoveFromDocumentCmd (UID textModelUID)
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.

Implements IStrand.

virtual UID Strand::SetFirstPage (UID firstPage)
virtual

Make

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

Implements IStrand.