![]() | InDesign SDK 20.5 |
#include <CTracker.h>
Public Member Functions | |
| CTracker (IPMUnknown *boss) | |
| virtual void | SetupTracker (IControlView *theControlView, ISnapTo *theSnapper=NULL, IItemContext *context=NULL) |
| virtual IControlView * | QueryControlView () const |
| virtual bool16 | IsEnabled () |
| virtual bool16 | IsTracking () |
| virtual void | EnableTracking () |
| virtual void | DisableTracking () |
| virtual bool16 | BeginTracking (IEvent *theEvent) |
| virtual void | HandleContinueTracking (const GSysPoint &where) |
| virtual void | ContinueTracking (const PBPMPoint &where, bool16 mouseDidMove) |
| virtual bool16 | EndTracking (IEvent *theEvent) |
| virtual void | AbortTracking (IEvent *theEvent) |
| virtual void | TimerMessage (int32 flags) |
| virtual bool16 | WantTimer (ClassID trackerTimerBoss) |
Public Member Functions inherited from ITracker | |
| void | SetupTracker (IControlView *theControlView) |
| void | SetupSpecialTracker (IControlView *theControlView, ISnapTo *theSnapper, IItemContext *context) |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Protected Member Functions | |
| virtual void | Initialize (IEvent *theEvent) |
| virtual bool16 | DoBeginTracking (IEvent *theEvent) |
| virtual bool16 | DoEndTracking (IEvent *theEvent) |
| virtual void | NotifyBeginTracking (const PMPoint &startPt, IDynamicTrackerData::TrackingEffect effect=IDynamicTrackerData::kUnknown) |
| virtual void | NotifyContinueTracking (const PMPoint &startPt, const PMPoint &endPoint, IDynamicTrackerData::TrackingEffect effect=IDynamicTrackerData::kUnknown) |
| virtual void | NotifyEndTracking (const PMPoint &startPt, const PMPoint &endPoint, IDynamicTrackerData::TrackingEffect effect=IDynamicTrackerData::kUnknown) |
| virtual IDynamicTrackerData::TrackingEffect | GetTrackingEffect (IDynamicTrackerData::TrackingState state) |
| virtual void | PushEventHandler () |
| virtual void | PopEventHandler () |
| virtual bool16 | WantsToAutoScroll (const PMPoint ¤tPoint) |
| virtual PMPoint | AutoScroll (const PMPoint &scrollBy, const PMPoint &scrolledPoint) |
| virtual void | GlobalToPasteboard (const GSysPoint &thePoint, PBPMPoint &convertedPoint) |
| virtual PMPoint | PasteboardToGlobal (const PBPMPoint &pbPoint) |
| virtual IPanorama * | QueryPanorama (IControlView *pView) const |
| virtual void | DisableUpdates () |
| virtual void | EnableUpdates () |
| void | DeselectAllItems () |
| virtual void | ComputeAdjustedPoint (PMPoint &adjustedPoint) |
| void | InitializeModalCursor () |
| void | ChangeModalCursor (const CursorSpec &spec) |
| void | UpdateModalCursor () |
| void | ReleaseModalCursor () |
| virtual uint32 | GetMouseMoveDelay () |
| virtual uint32 | GetMouseSteadyDelay () |
| virtual bool16 | AdjustPoint (PBPMPoint &point) |
| void | StartTimer (ClassID trackerTimerBoss, uint32 milliSeconds, uint32 mouseMoveDelay=kDefaultMouseMoveDelay, uint32 mouseSteadyDelay=kDefaultMouseSteadyDelay) |
| void | StopTimer (ClassID trackerTimerBoss) |
| bool16 | GetTimerFlags () |
| void | SetTimerFlags (int32 flags) |
| uint32 | GetElapsedTime () |
| virtual IDataBase * | GetTrackingDataBase () const |
Static Protected Member Functions | |
| static void | DeactivatePageItem () |
Protected Attributes | |
| IControlView * | fControlView |
| IDataBase * | fDataBase |
| IItemContext * | fItemContext |
| ISnapTo * | fSnapTo |
| SnapType | fSnapType |
| bool16 | fIsTracking |
| bool16 | fWantsToAutoScroll |
| PMPoint | fPreviousPoint |
| PMPoint | fFirstPoint |
| GSysPoint | fFirstGlobalWhere |
| uint32 | fFirstTicks |
| bool16 | fEnabled |
| IRulerData * | fHorzRuler |
| IRulerData * | fVertRuler |
| AcquireModalCursor * | fModalCursor |
| AutoBusyCursor * | fAutoBusyCursor |
| uint32 | fOldSchedulerMask |
| int32 | fTimerFlags |
| K2Vector< ITrackerTimer * > | fTimerPtrs |
Concrete implementation for trackers.
A tracker monitors mouse movement while an object is being manipulated by a tool and provides visual feedback in the layout view. It makes the changes to the objects being manipulated using commands. A tool may have one or more trackers but only a single tracker will be active at any one time.
Tracking occurs when the user manipulates objects (or widgets) using the mouse. Tracking behavior is context sensitive and depends on the selected tool, where and on what the mouse down event occurs. Tracking the mouse can occur in order to create something or select something, or move a control in a widget for example.
ITracker is the main controlling interface for a tracker. It is the interface used by clients of the tracker to focus the tracker on a view and to which overall control is passed so the mouse can be tracked. It manages and controls all other interfaces in the boss.
| virtual |
Override this method to provide any special behavior required if the tracker was aborted in the middle of tracking. For example the PlaceTextTracker needs to abort if a menu is selected after the tracker is enabled
| theEvent | [IN] the associated event |
Implements ITracker.
Reimplemented in CPathCreationTracker, CLayoutTracker, and CSliderTracker.
| protectedvirtual |
The CTracker will call this method to adjust the raw point. The current implemention will use fSnapTo or ComputeAdjustedPoint() to do this. Some classes may find it useful to override this method if they wish to only adjust/Snap one dimension.
| point | to adjust |
| protectedvirtual |
Scroll the view by the indicated amount
| scrollBy | [IN] how much to scroll by. Typical value obtained from the panorama associated with this tracker's view. |
| scrolledPoint | [IN] the point from HandleContinueTracking that caused the autoscroll |
Reimplemented in CPathCreationTracker.
| virtual |
Start tracking the mouse. Usually called as the result of a mouse down event.
| theEvent | [IN] the associated event |
Implements ITracker.
Reimplemented in SnapTracker, CPathCreationTracker, CLayoutTracker, and CSliderTracker.
| protected |
Call this method to switch the cursor while tracking. Make sure CTracker::BeginTracking() gets called first, however.
| spec | [IN] the cursor spec to change to |
| protectedvirtual |
Override if the base class wants to change the input value in any way. This method is called before snap to is called The implementation in CTracker computes the ruler adjusted value, if the tracker is tracking in the layout view
| adjustedPoint | [IN/OUT] the adjusted value |
| virtual |
The default implementation does nothing; client code will likely override this. Called after BeginTracking() and before EndTracking(). ContinueTracking is called repeatedly even when the mouse is not moving (to support things like auto scrolling)
| where | [IN] current location of mouse ptr |
| mouseDidMove | [IN] kTrue if mouse-event generated this call, kFalse otherwise (e.g. auto-scrolling) |
Implements ITracker.
Reimplemented in CPathCreationTracker, CLayoutTracker, and CSliderTracker.
| protected |
Deselect all types of selection in the fControlView
| virtual |
Turns off tracking; this should rarely be overridden by client code. Removes the tracker's eventhandler from the stack, releases the mouse capture. Also stops the timer (fMouseTrackerThread). Called automatically in base class EndTracking (and AbortTracking).
Implements ITracker.
| protectedvirtual |
Helper method called in base class during BeginTracking to turn off updates.
| protectedvirtual |
A return value of kTrue means "continue tracking". i.e. this tracker did not simply spawn a different one
| theEvent | [IN] event that is behind this call |
Implements ITracker.
Reimplemented in CLayoutTracker.
| protectedvirtual |
Called by EndTracking, does the action end tracking would do without ending the tracking.
| theEvent | [IN] event that is behind this call |
Implements ITracker.
| virtual |
Turn on tracking; means that the tracker's eventhandler is on the stack ready to accept events. Called automatically in base class BeginTracking.
Implements ITracker.
| protectedvirtual |
Helper method called in base class during EndTracking to turn on updates.
| virtual |
Tracking is completed. Tidy up and post any dynamic commands.
| theEvent | [IN] the associated event |
Implements ITracker.
Reimplemented in CPathCreationTracker, CLayoutTracker, and CSliderTracker.
| inlineprotectedvirtual |
Called to initialize tracker timer
| inlineprotectedvirtual |
Called to initialize tracker timer
| inlineprotected |
Timer management flags, set when an tracker timer is run, typically when an ITrackerTimer's RunTask method is called.
| protectedvirtual |
If IDynamicTrackerData is present, use it to notify document observers. This function is called by NotifyBeginTracking(), NotifyContinueTracking(), and NotifyEndTracking() whenever a specific tracking state is not provided to determine what effect to use for notifying. (i.e. when effect is IDynamicTrackerData::kUnknown). By default kBeginTracking -> kAffectsXY, kContinueTracking -> kAffectsXYWH, kEndTracking -> kAffectsXYWH
| state,one | of kNotTracking, kBeginTracking, kContinueTracking, kEndTracking, kAbortTracking. |
| protectedvirtual |
Convert a point from global system coordinate to pasteboard point.
| thePoint | [IN] input point |
| convertedPoint | [OUT] output point |
Reimplemented in CSliderTracker.
| virtual |
Called by the tracker event handler. This is a cover routine for ContinueTracking for things like autoscrolling. Generally this is not overridden in sub-classes of CTracker.
| where | [IN] the global system point at time of call. Can convert to a pasteboard coordinate via GlobalToPasteboard method in CTracker.h. |
Implements ITracker.
| protectedvirtual |
Subclasses of CTracker can override Initialize and DoBeginTracking() instead of overriding BeginTracking(). This way they are guaranteed that Initialize has been called first, and the thread only gets started if DoBeginTracking() returns kTrue.
Previously, overrides of BeginTracking() had to call the inherited method at the end, thereby losing the benefit of any initialization done by the base class.
Set initial fields. Called before DoBeginTracking()
| theEvent | [IN] the event at time of call |
Implements ITracker.
Reimplemented in CLayoutTracker.
| protected |
Called internally during BeginTracking to set up the modal cursor during life of tracker.
| virtual |
Determine if tracking is turned on.
Implements ITracker.
| virtual |
Determine if this tracker is actively tracking at present time. Means that the tracker's BeginTracking() method has been called, i.e. the tracker is actually tracking the mouse.
Implements ITracker.
| protectedvirtual |
If IDynamicTrackerData is present, use it to notify document observers. Can pass effect directly, or GetTrackingEffect will be used to determine it if effect is IDynamicTrackerData::kUnknown.
| startPt | |
| endPoint | |
| effect,How | tracker affects x, y, w, h, etc values. See IDynamicTrackerData::TrackingEffect. |
| protectedvirtual |
If IDynamicTrackerData is present, use it to notify document observers. Can pass effect directly, or GetTrackingEffect will be used to determine it if effect is IDynamicTrackerData::kUnknown.
| startPt | |
| endPoint |
| protectedvirtual |
If IDynamicTrackerData is present, use it to notify document observers. Can pass effect directly, or GetTrackingEffect will be used to determine it if effect is IDynamicTrackerData::kUnknown.
| startPt | |
| endPoint | |
| effect,How | tracker affects x, y, w, h, etc values. See IDynamicTrackerData::TrackingEffect. |
Convert a point from pasteboard point to global system coordinate.
| pbPoint | [IN] input point |
| protectedvirtual |
Pop tracker's event handler from the stack. In general should be for internal use only since this is called automatically in DisableTracking.
| protectedvirtual |
Push tracker's event handler on the stack. In general should be for internal use only since this is called automatically in EnableTracking.
| virtual |
Acquire interface ptr to associated control-view.
Implements ITracker.
| protectedvirtual |
Return a bumped reference to the panorama associated with this tracker's view.
| protected |
Called internally by CTracker in various places.
| virtual |
Initialize the state of the tracker with a control-view and other optional abstractions. Indicate which control view the tracker is modifying. Used for access to graphics context. Snap to interface is optional, but it must be present if the tracker needs to do snap to.
| theControlView | [IN] the control view to track in. |
| theSnapper | [IN] the ISnapTo interface if the tracker want snap to behavior. Applies to tracker in the layout widget. May be nil. |
| context | [IN] the item context for the tracker to use. Obsolete. |
Implements ITracker.
| protected |
Called if WantTimer for a particular ITrackerTimer ClassID returns kTrue.
| trackerTimerBoss | [IN] ClassID for the tracker timer. Typical values are kMouseTrackerBoss, kPatientUserBoss and kDynamicPauseTimerBoss. |
| milliSeconds | [IN] delay until timer is first called. Typically the tracker timer would then call the tracker's TimerMessage method. |
| mouseMoveDelay | [IN] how frequently in milliseconds RunTask is called while mouse is moving. |
| mouseSteadyDelay | [IN] how frequently in milliseconds RunTask is called while mouse is not moving. |
| protected |
Stop a tracker timer with a particular ClassID
| trackerTimerBoss | [IN] ClassID for the tracker timer to stop. |
| inlinevirtual |
Called after the ITrackerTimer has expired. Timer is started in BeginTracking. Used to turn on patient user tracking by CLayoutTracker. Can be used to change cursor feedback.
| flags | [IN] int32 value, flags from IShape, typically draw flags such as kPatientUser or kDynamicPause |
Implements ITracker.
Reimplemented in CLayoutTracker.
| protected |
Call this after DoSnapTo() has been called and fSnapType is updated if your tracker wants to update the cursor as the mouse snaps and unsnaps.
| protectedvirtual |
Determine if this tracker wants to provide automatic scrolling.
| currentPoint | [IN] the point in pasteboard coordinates. |
| virtual |
Stop a tracker timer with a particular ClassID
| trackerTimerBoss | [IN] ClassID for the tracker timer. Typical values are kMouseTrackerBoss, kPatientUserBoss and kDynamicPauseTimerBoss. |
Reimplemented in CLayoutTracker.