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

#include <ITextFocus.h>

Inheritance diagram for ITextFocus:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTFOCUS }
 

Public Member Functions

virtual void Initialize (ITextModel *model, const RangeData &range)=0
 
virtual ITextModelQueryModel () const =0
 
virtual void PreDirtyFocus ()=0
 
virtual void SetRange (bool16 allowNotify, const RangeData &range, bool16 excludeCacheEnd=kTrue)=0
 
virtual RangeData GetCurrentRange () const =0
 
virtual TextIndex GetStart (RangeData::Lean *lean) const =0
 
virtual TextIndex GetEnd () const =0
 
virtual bool16 IsRange () const =0
 
virtual uint32 Length () const =0
 
virtual void Inserted (TextIndex start, int32 count, bool16 allowNotify)=0
 
virtual void Deleted (TextIndex start, int32 count, bool16 allowNotify)=0
 
virtual void Update (const ITextFocusManager::FocusUpdateInfoList &updateInfoList, bool16 allowNotify)=0
 
virtual void NotifyChanged (bool16 excludeCacheEnd=kTrue)=0
 
virtual void DeRegisterFromModel (void)=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

This interface describes a text selection. It describes the start, end and the story selected. There are methods to get and set the range. In the current implementation, the TextModel has a TextFocusManager that maintains the foci positions during editing.

See Also
ITextModel
ITextFocusManager
RangeData

Member Function Documentation

virtual void ITextFocus::Deleted (TextIndex start,
int32 count,
bool16 allowNotify 
)
pure virtual

Only called by the TextFocusManager to maintain foci during editing.

Parameters
startis the location of the delete.
countis the number of characters deleted.
allowNotifytells whether to tell the focus cache about the change.
virtual RangeData ITextFocus::GetCurrentRange () const
pure virtual

Get the range of text in the selection.

Returns
the selected range.
virtual TextIndex ITextFocus::GetEnd () const
pure virtual

Get the end of the selection.

Returns
the ending text index.
virtual TextIndex ITextFocus::GetStart (RangeData::Lean * lean) const
pure virtual

Get the start of the selection. Lean indicates whether the caret "sticks" left or right. This affects shift selecting among other things.

Parameters
leanis set based on the direction stickiness of the selection.
Returns
the starting text index.
virtual void ITextFocus::Initialize (ITextModelmodel,
const RangeDatarange 
)
pure virtual

Initialize the TextFocus. DO NOT call this to move a selection from one model to another, that isn't supported, and is done through ITextFocusManager.

Parameters
modelis the textModel. is the selection start/end.
virtual void ITextFocus::Inserted (TextIndex start,
int32 count,
bool16 allowNotify 
)
pure virtual

Only called by the TextFocusManager to maintain foci during editing.

Parameters
startis the location of the insert.
countis the number of characters inserted.
allowNotifytells whether to tell the focus cache about the change.
virtual bool16 ITextFocus::IsRange () const
pure virtual

Get whether a range of text is selected. The alternative is a caret.

Returns
kTrue is the selection is more than just a caret.
virtual uint32 ITextFocus::Length () const
pure virtual

Get the number of characters selected. Length() > 0 == IsRange().

Returns
the number of selected characters.
virtual void ITextFocus::NotifyChanged (bool16 excludeCacheEnd = kTrue)
pure virtual

NotifyChanged is called during the undo/redo of certain Text editing operations to try and maintain a legal selection.

Parameters
excludeCacheEndindicates whether the range-damage (IFocusCache) will damage when at the end.
virtual void ITextFocus::PreDirtyFocus ()
pure virtual
This function must be called before the text focus scope changes.

Provide an implementation of PreDirty that will help restore the text focus at undo and redo.

virtual ITextModel* ITextFocus::QueryModel () const
pure virtual

Query for the TextModel from this focus

Returns
an AddRef'd ITextModel for this focus.
virtual void ITextFocus::Update (const ITextFocusManager::FocusUpdateInfoListupdateInfoList,
bool16 allowNotify 
)
pure virtual

Only called by the TextFocusManager to maintain foci during editing.

Parameters
updateInfoListis a list of changes.
allowNotifytells whether to tell the focus cache about the change.