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

#include <ICursorMgr.h>

Inheritance diagram for ICursorMgr:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICURSORMGR }
 
enum  eCursorModifierState {
  kNoModifiers = 0x00, kCmdKey = 0x01, kShiftKey = 0x02, kCapsLockKey = 0x04,
  kOptionAltKey = 0x08, kAltKey = kOptionAltKey, kOptionKey = kOptionAltKey, kControlKey = 0x10,
  kSpaceKey = 0x20
}
 
enum  {
  kNoModalCursor = -1, kModalCursor = 0, kWaitCursor = 1, kModalDialogCursor = 2,
  kDelayedBusyCursor = 3
}
 
enum  { kDontRestorePreviousCursor = 0, kRestorePreviousCursor = 1, kRecomputeNewCursor = 3 }
 
enum  { kSpinningBeachBall = 200, kSpinningWatch = 210, kCyclingArrow = 220 }
 

Public Member Functions

virtual CursorID GetCursorID ()=0
 
virtual CursorSpec GetCursorSpec ()=0
 
virtual ICursorProviderSetToolCursorProvider (ICursorProvider *)=0
 
virtual void LockToolCursor (bool16 lockit=kTrue)=0
 
virtual CursorSpec GetSnapToCursorSpec (CursorSpec &currentSpec, SnapType snapType)=0
 
virtual void SetNewCursor (ICursorProvider *, IControlView *, GSysPoint, eCursorModifierState)=0
 
virtual void SetNewCursor ()=0
 
virtual ICursorProviderTheToolCursorProvider () const =0
 
virtual void Hide ()=0
 
virtual void Show ()=0
 
virtual bool16 IsHidden () const =0
 
virtual void Suspend ()=0
 
virtual bool16 IsSuspended () const =0
 
virtual void Resume ()=0
 
virtual void StopTrackingCursor ()=0
 
virtual void Init ()=0
 
virtual void Shutdown ()=0
 
virtual void ClearCache ()=0
 
virtual void ObscureCursor ()=0
 
virtual void UnobscureCursor ()=0
 
virtual void AnimateWaitCursor ()=0
 
INTERNAL USE ONLY

These methods should not be called directly. Please use the AcquireModalCursor and AcquireWaitCursor helper classes instead.

virtual void BeginModalCursor (const ModalCursorTicket &callerID)=0
 
virtual void BeginModalCursor (const ModalCursorTicket &callerID, const CursorSpec &newspec)=0
 
virtual void ChangeModalCursor (const ModalCursorTicket &callerID, const CursorSpec &newspec)=0
 
virtual void EndModalCursor (const ModalCursorTicket &callerID)=0
 
virtual void BeginWaitCursor (const ModalCursorTicket &callerID)=0
 
virtual void AnimateWaitCursor (const ModalCursorTicket &callerID)=0
 
virtual void EndWaitCursor (const ModalCursorTicket &callerID)=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

virtual bool16 ModifiersAffectProvider (IControlView *view) const =0
 
virtual bool16 LocationAffectsProvider (IControlView *view) const =0
 
virtual bool16 HaveModifiersChanged (eCursorModifierState &oldModifiers, eCursorModifierState &newModifiers)=0
 

Detailed Description

Provides the interface required for maintaining the region associated with each cursor. Used by the application, to figure out how to set the mouse cursor, and used by the windows, to define what cursor should be used for which area of the screen.

See Also
ICursorRegion, ICursorProvider, AcquireModalCursor, AcquireWaitCursor

Member Enumeration Documentation

anonymous enum

Modal cursor states
Enumerator
kNoModalCursor 

Not a modal cursor

kModalCursor 

Modal cursor

kWaitCursor 

Modal busy cursor

kModalDialogCursor 

Modal dialog cursor

kDelayedBusyCursor 

Delayed modal busy cursor - doesn't appear for a second or so

anonymous enum

Restoring the cursor
Enumerator
kDontRestorePreviousCursor 

Don't attempt to restore the old cursor - wait until CursorMgr decides to recompute.

kRestorePreviousCursor 

Restore the previous cursor (saved when the modal state began)

kRecomputeNewCursor 

Recompute a new cursor right away

A set of "cross platform" definitions for what effect the modifiers have. For instance, is the Alt key equivalent to the Command key or the Option key? Luckily this "equivalence" is limited to the scope of cursor management, where Alt is usually equivalent to Option.

Member Function Documentation

virtual void ICursorMgr::AnimateWaitCursor ()
pure virtual

Call this periodically to ensure that the cursor keeps spinning.

virtual void ICursorMgr::BeginModalCursor (const ModalCursorTicketcallerID)
pure virtual

Defaults to the arrow cursor

virtual CursorID ICursorMgr::GetCursorID ()
pure virtual

Get the current cursor by it's CursorID.

virtual CursorSpec ICursorMgr::GetCursorSpec ()
pure virtual

Get the current cursor by it's CursorSpec.

virtual CursorSpec ICursorMgr::GetSnapToCursorSpec (CursorSpeccurrentSpec,
SnapType snapType 
)
pure virtual

Used to compute a new cursor spec from an existing one given the snap type. Looks for a new cursor at kSnapToCrsrOffset from the currentSpec. The new CursorSpec is for a cursor that gives feedback to the user that the mouse is "snapped". If a cursor does not exist with this offset, the original cursor spec is returned.

Parameters
currentSpecIN the current cursor
snapTypeIN type of snapping: kSnapX, kSnapY, kSnapXandY, kSnapNone
Returns
the CursorSpec
virtual bool16 ICursorMgr::HaveModifiersChanged (eCursorModifierStateoldModifiers,
eCursorModifierStatenewModifiers 
)
protectedpure virtual

Utility functions to compare modifiers to the cached ones. NOTE: For now, HaveModifiersChanged should really only be called in one place in all of the program. That's because HaveModifiersChanged resets the cached modifiers. If HaveModifiersChanged is called in more than one place, you'll get unpredictable results.

virtual void ICursorMgr::Hide ()
pure virtual

Hide the cursor

virtual bool16 ICursorMgr::IsHidden () const
pure virtual

Is the cursor hidden

virtual bool16 ICursorMgr::IsSuspended () const
pure virtual

Is the cursor manager suspended

virtual bool16 ICursorMgr::LocationAffectsProvider (IControlViewview) const
protectedpure virtual

Utility function that returns whether location information affects the current cursor provider

virtual void ICursorMgr::LockToolCursor (bool16 lockit = kTrue)
pure virtual

Used to lock/unlock the tool cursor provider so that the locked cursor is shown instead of the usual tool cursor

virtual bool16 ICursorMgr::ModifiersAffectProvider (IControlViewview) const
protectedpure virtual

Utility function that returns whether keyboard modifiers affect the current cursor provider

virtual void ICursorMgr::ObscureCursor ()
pure virtual

Hide the cursor until the user moves the mouse (this is most useful when the user begins to edit text).

virtual void ICursorMgr::Resume ()
pure virtual

Resume the cursor manager. Called when the application has become frontmost again.

virtual void ICursorMgr::SetNewCursor (ICursorProvider,
IControlView,
GSysPoint ,
eCursorModifierState  
)
pure virtual

Obtains the cursor appropriate for the given cursor provider, widgetUnderMouse, global coordinate, and modifier key combination, and makes it the current cursor.

virtual void ICursorMgr::SetNewCursor ()
pure virtual

Call this function when you need to reevaluate the cursor with it's default parameters

virtual ICursorProvider* ICursorMgr::SetToolCursorProvider (ICursorProvider)
pure virtual

Sets the cursor provider to use for the tool area. Returns the old tool cursor provider. Called by the toolbox when the tool is selected.

virtual void ICursorMgr::Show ()
pure virtual

Show the cursor

virtual void ICursorMgr::StopTrackingCursor ()
pure virtual

Stop all cursor tracking and reset the cursor to the arrow. Called during application shutdown.

virtual void ICursorMgr::Suspend ()
pure virtual

Suspend the cursor manager. Called when the application has been suspended (no longer frontmost).

virtual ICursorProvider* ICursorMgr::TheToolCursorProvider () const
pure virtual

Utility function that returns the constant that represents the tool cursor provider. So, for example: UseToolCursorProvider(r); is simply a shortcut for UseCursorProvider(TheToolCursorProvider(), r);

virtual void ICursorMgr::UnobscureCursor ()
pure virtual

To cancel effect of ObscureCursor without waiting for mouse to move