![]() | InDesign SDK 20.5 |
#include <ITextModel.h>

Classes | |
| struct | SingleReplacementInfo |
Public Types | |
| enum | { kDefaultIID = IID_ITEXTMODEL } |
Public Member Functions | |
| virtual UID | GetFrameListUID () const =0 |
| virtual IFrameList * | QueryFrameList () const =0 |
| virtual UID | GetStrandFromClass (ClassID klass) const =0 |
| virtual IPMUnknown * | QueryStrand (ClassID clsID, PMIID faceID) const =0 |
| virtual IPMUnknown * | QueryNthStrand (int32 n, PMIID faceID) const =0 |
| virtual ErrorCode | CopyRange (TextIndex start, int32 length, boost::shared_ptr< PasteData > &pasteData)=0 |
| virtual ErrorCode | CopyRange (Text::StoryRangeList *list, boost::shared_ptr< PasteData > &pasteData)=0 |
| virtual void | DoForceCompositionDamage (TextIndex start, int32 len)=0 |
| virtual void | DoForceContentDamage (TextIndex start, int32 len)=0 |
Retrieve data functions | |
| virtual int32 | TotalLength () const =0 |
| virtual int32 | GetPrimaryStoryThreadSpan () const =0 |
| virtual uint32 | GetTextChangeCount () const =0 |
| virtual uint32 | GetAttrChangeCount () const =0 |
| virtual uint32 | GetOtherChangeCount () const =0 |
| virtual uint32 | GetChangeCount () const =0 |
| virtual void | GetSurroundingParaBoundaries (int32 &newstart, int32 &newlen) const =0 |
| virtual bool16 | FindStoryThread (UID threadDictUID, uint32 threadDictKey, TextIndex *pStart=nil, int32 *pLen=nil) const =0 |
| virtual ITextStoryThread * | QueryStoryThread (TextIndex at, TextIndex *pStart=nil, int32 *pSpan=nil) const =0 |
| virtual int32 | GetStoryThreadSpan (TextIndex at, TextIndex *pStart, int32 *pSpan=nil) const =0 |
| virtual RangeData | GetStoryThreadRange (TextIndex at) const =0 |
| virtual UID | GetStoryThreadStyle (TextIndex at, TextIndex *pStart=nil, TextIndex *pSpan=nil) const =0 |
| virtual ITextParcelList * | QueryTextParcelList (TextIndex at) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Text operations | |
The following functions perform specific text operations. The parameter is false when the client wants irreversible changes. The case of parameter true is currently exclusive to internal use. ErrorCode returns the global error state which may be set if embedded commands fail. | |
| typedef K2Vector < SingleReplacementInfo > | ReplacementList |
| virtual ErrorCode | Insert (TextIndex start, const WideString *data, const ILanguage *language=nil)=0 |
| virtual ErrorCode | Delete (TextIndex start, int32 len)=0 |
| virtual ErrorCode | Delete (const RangeData &range)=0 |
| virtual ErrorCode | Cut (TextIndex start, int32 len, boost::shared_ptr< PasteData > &pasteData)=0 |
| virtual ErrorCode | Cut (const RangeData &range, boost::shared_ptr< PasteData > &pasteData)=0 |
| virtual ErrorCode | Replace (TextIndex start, int32 len, const WideString *data, const ILanguage *language=nil, bool16 clearNonContinuingAttrs=kTrue)=0 |
| virtual ErrorCode | Paste (TextIndex start, const boost::shared_ptr< PasteData > &data)=0 |
| virtual ErrorCode | ApplyStyle (TextIndex start, int32 len, UID styleref, ClassID which, bool16 destroyAll, bool16 keepOldStyleAsOverrides=kTrue)=0 |
| virtual ErrorCode | ApplyOverrides (TextIndex start, int32 len, const AttributeBossList *these, ClassID which)=0 |
| virtual ErrorCode | ClearOverrides (TextIndex start, int32 length, const AttributeBossList *these, ClassID which)=0 |
| virtual ErrorCode | InsertStoryThread (TextIndex start, UID threadDictUID, uint32 threadDictKey, const WideString *data, const ILanguage *language=nil)=0 |
| virtual ErrorCode | CreateStoryThreads (TextIndex start, UID threadDictUID, const K2Vector< uint32 > &threadDictKeyList, const K2Vector< int32 > &threadLenList)=0 |
| virtual ErrorCode | JoinStoryThreads (TextIndex start, int32 len)=0 |
| virtual ErrorCode | RegisterStrand (UID strand)=0 |
| virtual ErrorCode | UnregisterStrand (UID strand)=0 |
| virtual ErrorCode | RemoveRedundantOverrides (TextIndex start, int32 len)=0 |
| virtual uint32 | IncrementAttrChangeCount ()=0 |
| virtual uint32 | IncrementOtherChangeCount ()=0 |
| virtual ErrorCode | Replace (const boost::shared_ptr< ReplacementList > &replacementList, const ILanguage *language, bool16 clearNonContinuingAttrs=kTrue)=0 |
| virtual void | StartRecordingChanges_ForUndoRedo ()=0 |
| virtual void | EndRecordingChanges_ForUndoRedo ()=0 |
This is the main interface for a text story. It has the following responsibilities:
Note: use ITextModelCmds to get to text edit commands.
| pure virtual |
Apply attribute boss list to a range.
| start | IN start of apply range. |
| len | IN length of apply range. |
| these | IN attribute boss list to apply. |
| which | IN indicates whether the applied attributes are paragraph or character attributes. |
| pure virtual |
Apply style to a range.
| start | IN start of apply range. |
| len | IN length of apply range. |
| styleref | IN style to apply. |
| which | IN whether this is a character or a paragraph style. |
| destroyAll | IN whether overrides must be removed along with the application of the style. |
| keepOldStyleAsOverrides | IN whether to apply current style as overrides before setting new style. |
| pure virtual |
Clear attribute boss list from range.
| start | IN start of clear range. |
| length | IN length of clear range. |
| these | IN attribute boss list to clear. |
| which | IN whether the attributes to clear are paragraph or character attributes. |
| pure virtual |
Takes data from the model to store it in a stream (clipboard, database, ...)
| start | IN start of copy range. |
| length | IN length of copy range. |
| pasteData | OUT is the copied data. It should be used by caller to paste the data somewhere else in the same story, another story in the same document, or another story in another document. pasteData is a shared pointer. |
| pure virtual |
Takes data from the model to store it in a stream (clipboard, database, ...)
| list | IN list of ranges to copy from. |
| pasteData | OUT is the copied data. It should be used by caller to paste the data somewhere else in the same story, another story in the same document, or another story in another document. pasteData is a shared pointer. |
| pure virtual |
Create one or more StoryThreads sharing the same Dictionary uid There are a few restrctions: start must be > 1. There must be a CR at (start - 1). Each threadLenList[] value must be at least 1 and there must be a CR at the end of each new StoryThread. This method does not change the length of the TextModel.
| start | IN insert position. |
| threadDictUID | IN thread disctionary uid. |
| threadDictKeyList | IN story thread key list. |
| threadLenList | IN story thread length list. |
| pure virtual |
Cut range of text from story.
| start | IN start of cut range. |
| len | IN length of cut range. |
| pasteData | OUT is the cut data. It should be used by caller to paste the data somewhere else in the same story, another story in the same document, or another story in another document. pasteData is a shared pointer. |
| pure virtual |
Cut range of text from story.
| range | IN cut range. |
| pasteData | OUT is the cut data. It should be used by caller to paste the data somewhere else in the same story, another story in the same document, or another story in another document. pasteData is a shared pointer. |
| pure virtual |
Delete text range from story
| start | IN range start. |
| len | IN range len. |
| pure virtual |
Delete text range.
| range | IN range to delete. |
| pure virtual |
Forces recomposition within a range. Most operations do this automatically, sometimes damage must be forced. e.g. dragging an inline graphic.
| start | IN start of recomposition range. |
| len | IN length of recomposition range. |
| pure virtual |
Forces recomposition within a range. Most operations do this automatically, sometimes damage must be forced. e.g. dragging an inline graphic. Incase where we do not want to delete wax line and merely want to invalidate so that it will be reconsidered for composition
| start | IN start of recomposition range. |
| len | IN length of recomposition range. |
| pure virtual |
Gets the offset boundaries of a storythread.
| threadDictUID | IN thread disctionary uid. |
| threadDictKey | IN, thread dictionary key. |
| pStart | OUT start of range |
| pSpan | OUT span of range. |
| pure virtual |
The TextModel maintains a counter that will be incremented whenever the effective attribute applied to any chracters may have changed. This includes changes to applied styles and overrides.
| pure virtual |
The TextModel maintains a counter that will be incremented for any change to the above counters, be it Text, Attribute or Other. This is intended to simplify most clients who are not interested in particular details.
| pure virtual |
Returns the wax strand (a.k.a frame list) uid. The frame list is set by registering the frame list boss as a strand.
| pure virtual |
The TextModel maintains a counter that should be changed by entities which are associated with the TextModel, such as Inlines, Tables, etc, when some appropriate aspect of them changes. An easy example of this is Tables - a change to a Table stroke does represent an effective change to the TextModel, that is an export of the contents of the TextModel will be different after the change than before the change - and so the TableModel will use this counter to signal change.
| pure virtual |
Returns the total number of characters in the primary story thread. (It does not include any characters that are part of story threads for table cells.)
| pure virtual |
Returns range of storythread
| at | IN text index where to look for storythread. |
| pure virtual |
Gets the range of a storythread
| at | IN text index where to look for storythread. |
| pStart | OUT start of storythread range. |
| pSpan | OUT length of storythread range. |
| pure virtual |
Returns the story thread style at a particular index (a UID for an object that implements ITextAttributes). Optionally a start and a span are returned through runStart and runSpan. This start and span forms a run of adjoining story threads that have the same story thread styles.
| at | IN The index to get the story thread style for. |
| pStart | OUT the index this story thread style begins being good for. |
| pSpan | OUT how far from runStart is this story thread applied. |
Returns the UID of the strand attached to the model that has a particular class. kInvalidUID is returned when no such a strand is found.
| klass | IN strand class. |
| pure virtual |
Returns the boundaries of the wrapping paragraph.
| newstart | IN specifies a position to look for paragraph boundaries. This argument is also an out argument. It returns the actual start of the paragraph. |
| newlen | OUT returns the actual length of the paragraph. |
| pure virtual |
The TextModel maintains a counter that will be incremented whenever a character is inserted, removed or replaced in the TextModel.
| pure virtual |
Increments the changed counter associated with Char/Para Attr changes. The TextModel will handle this internally for normal sorts of applies but actions that take place outside the view of the TextModel, such as Style deletion, must result in a call to this method.
| pure virtual |
Increments the change counter associated with non Text and Char/Para Attr changes.
| pure virtual |
Insert string at a text index.
| start | IN insert position. |
| data | IN string to insert. |
| language | IN language of text inserted. |
| pure virtual |
Insert a new StoryThread. There are a few restrictions : start must be the first TextIndex after an existing StoryThread. This means you are either inserting at the beginning of any StoryThread other than the one at TextIndex 0 or you are at the end of the TextModel (at TotalLength()). Note that this is the only permitted way to insert past the end of the TextModel.
| start | IN insert position. |
| threadDictUID | IN thread disctionary uid. |
| threadDictKey | IN, thread dictionary key. |
| data | IN string to insert. |
| language | IN of inserted string. It must end with a carriage return. |
| 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.
| start | IN start join range. |
| len | IN length of join range. |
| pure virtual |
Paste data into story.
| start | IN insertion position. |
| data | IN paste data to insert. data is a shared pointer. |
| pure virtual |
Returns a pointer to the wax strand boss.
| pure virtual |
Returns a pointer to an interface on the Nth strand attached to the model.
| n | IN strand index. |
| faceID | IN id of an interface on the strand boss. When faceID is equal IID_IUNKNOWN, a pointer to the strand boss is returned. |
| pure virtual |
Returns a pointer to the storythread at a particular text index
| at | IN text index where to look for storythread. |
| pStart | OUT start of storythread range. |
| pSpan | OUT length of storythread range. |
| pure virtual |
Returns a pointer to an interface on the strand attached to the model that has a particular class.
| clsID | IN strand class. |
| faceID | IN id of an interface on the strand boss. When faceID is equal IID_IUNKOWN, a pointer to the strand boss is returned. |
| pure virtual |
Returns a pointer to the text parcel list at an offset.
| at | IN text index to look for parcel list. |
| pure virtual |
Attach strand to text model.
| strand | IN strand uid. |
| pure virtual |
Remove redundant overrides from range. These are the overrides that have no effect because they exist in the applied styles.
| start | IN range start |
| len | IN range length. |
| pure virtual |
Replace text in a range
| start | IN replace range start. |
| len | IN replace range length. |
| data | IN replacement string. |
| language | IN replacement string language. |
| clearNonContinuingAttrs | IN whether non-continuing attributes should be cleared after insert. |
| pure virtual |
Used to perform a set of replacements on the text model. This is an optmized form for doing multiple replacements. The list of ranges must be in ascending text index order.
| replacementList | IN list of ranges and replacement strings. This is a shared_ptr. |
| pure virtual |
Returns the total number of characters in the text model (including data for embedded tables).
| pure virtual |
Detach strand from text model.
| strand | IN strand uid. |