IShMouseAction Struct Reference
[Shell Interfaces]

Inheritance diagram for IShMouseAction:

IMCUnknown List of all members.

Public Member Functions

virtual MCCOMErr MCCOMAPI Do ()=0
virtual MCCOMErr MCCOMAPI Undo ()=0
virtual MCCOMErr MCCOMAPI Redo ()=0
virtual boolean MCCOMAPI WillCauseChange ()=0
virtual boolean MCCOMAPI CanUndo ()=0
virtual MCCOMErr MCCOMAPI GetName (TMCString &name)=0
virtual void MCCOMAPI Track (IMCGraphicContext *gc, int16 stage, TMCPoint &first, TMCPoint &prev, TMCPoint &cur, boolean moved, IShMouseAction **nextAction)=0
virtual MCCOMErr MCCOMAPI Feedback (IMCGraphicContext *gc, int16 stage, const TMCPoint &first, const TMCPoint &prev, const TMCPoint &cur, boolean moved, boolean show)=0
virtual void MCCOMAPI GetPartToRedraw (IMFPart **outPart, int32 stage)=0
virtual MCCOMErr MCCOMAPI Constrain (IMCGraphicContext *gc, int16 stage, const TMCPoint &first, const TMCPoint &prev, TMCPoint &cur, boolean moved)=0
virtual boolean MCCOMAPI NeedsToPrepareMenus (void)=0
virtual boolean MCCOMAPI ConstrainedToView (void)=0
virtual boolean MCCOMAPI IsPerpetualMouseAction (void)=0
virtual boolean MCCOMAPI ShouldHideCursor (void)=0
virtual boolean MCCOMAPI ShouldAutoScroll (void)=0

Member Function Documentation

virtual boolean MCCOMAPI IShMouseAction::CanUndo (   )  [pure virtual]
 

Returns true if the action is undoable. If CanUndo() returns false, Undo() and Redo() should return MC_E_NOTIMPL and do nothing.

Returns:
true if the action is undoable.

virtual MCCOMErr MCCOMAPI IShMouseAction::Constrain (  IMCGraphicContext *  gc,
int16  stage,
const TMCPoint &  first,
const TMCPoint &  prev,
TMCPoint &  cur,
boolean  moved
)  [pure virtual]
 

Use this method to constrain the 'cur' position to a value, before Track() is called

Parameters:
gc Graphic context for the mouse action
stage kShBeginTracking, kShContinueTracking, or kShEndTracking. Tells the function what stage of tracking we're in.
first Initial mouse position when this action started tracking
prev Previous mouse position from the previous call of Track()
cur Current mouse position - also returns constrained current mouse position
moved Pass true here if the mouse has moved since the last call to Track()

virtual boolean MCCOMAPI IShMouseAction::ConstrainedToView (  void   )  [pure virtual]
 

Returns:
true if the action should be constrained to the view. If so, the cursor locations outside of the view will be clamped to the view's limits.

virtual MCCOMErr MCCOMAPI IShMouseAction::Do (   )  [pure virtual]
 

Function called to actually perform the action.

Note:
As the constructor of the action is not protected by the exception mechanism, no memory allocations (ie 'pointer = new ...') should be used there. Only initializations (like 'pointer = NULL;') should be made in the constructor. The allocations should be made here in Do().

virtual MCCOMErr MCCOMAPI IShMouseAction::Feedback (  IMCGraphicContext *  gc,
int16  stage,
const TMCPoint &  first,
const TMCPoint &  prev,
const TMCPoint &  cur,
boolean  moved,
boolean  show
)  [pure virtual]
 

Allows the action to draw things related to the tracking. Feedback() is called for the first time right before the first call of Track(kShBeginTracking), and then Feedback() is called right after each call to Track().

Parameters:
gc Graphic context for the mouse action
stage kShBeginTracking, kShContinueTracking, or kShEndTracking. Tells the function what stage of tracking we're in.
first Initial mouse position when this action started tracking
prev Previous mouse position from the previous call of Track()
cur Current mouse position
moved Pass true here if the mouse has moved since the last call to Track()
show Pass false here to bypass any drawing, or true to enable drawing.

virtual MCCOMErr MCCOMAPI IShMouseAction::GetName (  TMCString &  name  )  [pure virtual]
 

Return the name to display in the undo/redo list.

Note:
Do not use hardcoded strings inside the code, use strings from resources instead.
Parameters:
name The name of the action

virtual void MCCOMAPI IShMouseAction::GetPartToRedraw (  IMFPart **  outPart,
int32  stage
)  [pure virtual]
 

Gives the action the opportunity to tell the Shell that the returned part should be redrawn after Do/Undo/Redo. Return NULL in outPart if no redraw is needed.

Parameters:
outPart Returns a pointer to the part that needs to be redrawn after the action runs.
stage Allows you to specify what stage to query for part redraw. kShDoAction, kShUndoAction, kShRedoAction

virtual boolean MCCOMAPI IShMouseAction::IsPerpetualMouseAction (  void   )  [pure virtual]
 

Returns:
true if the action wants infinite mouse movement

virtual boolean MCCOMAPI IShMouseAction::NeedsToPrepareMenus (  void   )  [pure virtual]
 

Returns:
true if execution of the action (Do() or Undo() or Redo()) should cause the menus to be prepared (ie if contents of the menus need to be enabled/disabled)

virtual MCCOMErr MCCOMAPI IShMouseAction::Redo (   )  [pure virtual]
 

Called to Redo the action. This can often simply call Do().

virtual boolean MCCOMAPI IShMouseAction::ShouldAutoScroll (  void   )  [pure virtual]
 

Returns:
true if the mouse should autoscroll in a scoll part

virtual boolean MCCOMAPI IShMouseAction::ShouldHideCursor (  void   )  [pure virtual]
 

Returns:
true if the action wants to hide the cursor

virtual void MCCOMAPI IShMouseAction::Track (  IMCGraphicContext *  gc,
int16  stage,
TMCPoint &  first,
TMCPoint &  prev,
TMCPoint &  cur,
boolean  moved,
IShMouseAction **  nextAction
)  [pure virtual]
 

Called each time the mouse moves. At least, Track() is called three times (even if the mouse does not move).

Note:
The nextAction parameter must return 'this' to continue the current action, or a pointer to a new action, or NULL if the tracking should stop and the Action be discarded.

The TMCPoint arguments are input values, but they can also be used as output values. This is useful to force the initial position of the mouse to be in the middle of a handle. Constraints on the 'cur' position should be handled in Constrain().

Parameters:
gc Graphic context for the mouse action
stage kShBeginTracking, kShContinueTracking, or kShEndTracking. Tells the function what stage of tracking we're in.
first Initial mouse position when this action started tracking
prev Previous mouse position from the previous call of Track()
cur Current mouse position
moved Pass true here if the mouse has moved since the last call to Track()
nextAction Returns a pointer to the next action whose Track() to call. See note in function description.

virtual MCCOMErr MCCOMAPI IShMouseAction::Undo (   )  [pure virtual]
 

Called to undo the action.

Note:
When undone, an action must restore the database to EXACTLY the same state it was in before Do() was called. This means that if a pointer is cloned, the action must store the original pointer in Do() and apply its modifications to the clone. Then, when Undo() is called, the action simply replaces the cloned and modified pointer with the original, unmodified one.

virtual boolean MCCOMAPI IShMouseAction::WillCauseChange (   )  [pure virtual]
 

Returns:
true if the action will modify the database.


The documentation for this struct was generated from the following file:
Generated on Mon Mar 14 12:29:05 2005 for Carrara SDK Doc by  doxygen 1.3.9.1