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

#include <ITextState.h>

Inheritance diagram for ITextState:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTSTATE }
 

Public Member Functions

virtual bool16 HasStateInfoFor (UID charStrand, TextIndex pos) const =0
 
virtual bool16 HasStateStyleFor (UID charStrand, TextIndex pos) const =0
 
virtual TextIndex LastStateInfoFor () const =0
 
virtual void ClearStateInfo ()=0
 
virtual bool16 WasDeleteState () const =0
 
virtual void IsDeleteState (bool16 b)=0
 
virtual void ApplyToState (UID charStrandUID, TextIndex where, const AttributeBossList *over)=0
 
virtual void ApplyToStateStyle (UID charStrandUID, TextIndex where, UID style)=0
 
virtual UID GetStateStyle () const =0
 
virtual const AttributeBossListPeekStateOverrides () const =0
 
virtual UID GetStateCharStrand () const =0
 
virtual TextIndex GetStatePosition () const =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

The ITextState interface is used to store information about attributes that are applied to the "insertion point" or the "text caret". The next insertion will use these attributes. However, if the selection is changed, then these attributes are lost forever. The ITextState interface is off the document. Each document has only 1 set of attributes active on an insertion point. It could be argued that each window could have it's own, but that is not true at this time.

Member Function Documentation

virtual void ITextState::ApplyToState (UID charStrandUID,
TextIndex where,
const AttributeBossListover 
)
pure virtual

Apply attributes to the caret for the a particular story and position.

Parameters
charStrandUIDis the character strand's UID in the story being set.
whereis the absolute position.
overis a list of attributes to store at the location.
virtual void ITextState::ApplyToStateStyle (UID charStrandUID,
TextIndex where,
UID style 
)
pure virtual

Apply a character style to the caret for the a particular story and position.

Parameters
charStrandUIDis the character strand's UID in the story being set.
whereis the absolute position.
styleis the character style UID to store at the location.
virtual void ITextState::ClearStateInfo ()
pure virtual

Clear the information in the "caret". The data is cleared after it is used during insert, for example.

virtual UID ITextState::GetStateCharStrand () const
pure virtual

What is the character strand UID that we are set for?

Returns
the UID of the character strand of the story for which we are set.
virtual TextIndex ITextState::GetStatePosition () const
pure virtual

What is the location of the data stored here?

Returns
the absolute position in the story of the data stored.
virtual UID ITextState::GetStateStyle () const
pure virtual

Get the character style applied to the ITextState object.

Returns
the UID of the character style stored on the "caret".
virtual bool16 ITextState::HasStateInfoFor (UID charStrand,
TextIndex pos 
) const
pure virtual

Is there information in this object for this story and position?

Parameters
charStrandis the UID of the character strand of the story in question.
posis the absolute position in the story in question.
Returns
kTrue if this interface has information stored for the position in question.
virtual bool16 ITextState::HasStateStyleFor (UID charStrand,
TextIndex pos 
) const
pure virtual

Is there a character style stored in this object for this story and position?

Parameters
charStrandis the UID of the character strand of the story in question.
posis the absolute position in the story in question.
Returns
kTrue if this interface has a style stored for the position in question.
virtual void ITextState::IsDeleteState (bool16 b)
pure virtual

Set the flag specifying whether we are loaded due to a delete.

Parameters
bspecifies whether the data was due to a delete.
virtual TextIndex ITextState::LastStateInfoFor () const
pure virtual

Where was the last position? Used as a shortcut when determining whether to look at this object's data further.

Returns
the absolute position in whatever story.
virtual const AttributeBossList* ITextState::PeekStateOverrides () const
pure virtual

Get the character attributes (local overrides) applied to the ITextState object.

Returns
a pointer to the list of character attributes stored on the "caret".
virtual bool16 ITextState::WasDeleteState () const
pure virtual

Upon delete, we automatically set the text state with the delete attributes so the next insertion looks like the deleted text. There are minor behavior differences.

Returns
kTrue if the ITextState was loaded by a delete (instead of applying to the caret).