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

#include <ITextCaret.h>

Inheritance diagram for ITextCaret:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTCARET }
 
enum  { kStopCaretBlinking = 0, kStartCaretBlinking }
 
enum  { kEraseCaretNow = 0, kStrokeCaretNow }
 
enum  CaretState {
  kCaretOff, kCaretErased = kCaretOff, kCaretParked, kCaretStroked = kCaretParked,
  kCaretOn, kCaretBlinking = kCaretOn
}
 

Public Member Functions

virtual bool16 IsCaretStroked () const =0
 
virtual void DrawingRegion (IControlView *view, const SysRgn &invalidRgn)=0
 
virtual bool16 UpdateCaretPosition (IControlView *view=nil, const RangeData *newCaretPosition=nil)=0
 
virtual bool16 GetCaretBounds (PMLineSeg *pCaretBounds) const =0
 
virtual void ToggleCaret ()=0
 
virtual void DrawCaret (IGraphicsContext *gc, PMRect updateRect)=0
 
virtual void SetCaretState (CaretState, const RangeData *newCaretPosition=nil)=0
 
virtual CaretState GetCaretState ()=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

Interface to set and draw the text caret.

Member Enumeration Documentation

anonymous enum

Not used.

anonymous enum

Not used.

Member Function Documentation

virtual void ITextCaret::DrawCaret (IGraphicsContextgc,
PMRect updateRect 
)
pure virtual

Called from the view that the caret belongs to to draw the caret. Normally, this should not need to be called externally.

Parameters
gcThe graphic context to draw the caret with.
updateRectThe area of the screen being currently being redrawn.
virtual void ITextCaret::DrawingRegion (IControlViewview,
const SysRgn & invalidRgn 
)
pure virtual

Invalidate the param invalidRgn to redraw the text caret

Parameters
view
invalidRgn
virtual bool16 ITextCaret::GetCaretBounds (PMLineSegpCaretBounds) const
pure virtual

Use to get the caret bounds in pasteboard. It returns kFalse on error. By convention, the caret is 1.0 units wide, where wide is independent of x or y.

Parameters
pCaretBoundsReturn the caret bounds
Returns
bool16
virtual CaretState ITextCaret::GetCaretState ()
pure virtual

Get the text caret state

Parameters
none
Returns
CaretState The state of text caret
virtual bool16 ITextCaret::IsCaretStroked () const
pure virtual

Check if text caret was stroked?

Parameters
none
Returns
bool16 kTrue = text caret was stroked.
virtual void ITextCaret::SetCaretState (CaretState ,
const RangeDatanewCaretPosition = nil 
)
pure virtual

Set the new state and new position of text caret.

Parameters
CaretStateThe state of text caret kCreatOff, kCaretEarsed = earse text caret. kCaretParked, kCaretStroked = stroke text caret kCaretOn, kCaretBlinking = set the text caret, no stoke the caret
newCaretPositionThe new position of text caret
virtual void ITextCaret::ToggleCaret ()
pure virtual

Toggle text caret state to earse or storke

Parameters
none
virtual bool16 ITextCaret::UpdateCaretPosition (IControlViewview = nil,
const RangeDatanewCaretPosition = nil 
)
pure virtual

Use to recalculate the TextCaret. Pass in nil to use the current selection. It returns whether the position is a valid caret position.

Parameters
viewThe control view
newCaretPositionThe new caret position
Returns
bool16 kTrue = the position is a valid caret position.