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

#include <CDragDropTarget_Extensible.h>

Inheritance diagram for CDragDropTarget_Extensible:
CDragDropTargetIDragDropTargetIPMUnknown

Public Member Functions

 CDragDropTarget_Extensible (IPMUnknown *boss)
 
virtual void PrepareTargetForDrag ()
 
virtual ErrorCode ProcessDragDropCommand (IDragDropController *, DragDrop::eCommandType)
 
virtual ServiceID GetFlavorHelperServiceID () const =0
 
IDragDropTargetFlavorHelperQueryActiveFlavorHelper () const
 
IDragDropTargetFlavorHelperGetActiveFlavorHelper () const
 
void SetActiveFlavorHelper (IDragDropTargetFlavorHelper *)
 
bool16 CanHandleDragData () const
 
void SetCanHandleDragData (bool16 can)
 
DragDrop::TargetResponse Delegate_CouldAcceptTypes (DataObjectIterator *, const IDragDropSource *, const IDragDropController *)
 
ErrorCode Delegate_ProcessDragDropCommand (IDragDropController *, DragDrop::eCommandType)
 
virtual PMRect HandleGetDragDataBounds () const
 
Support for Extensibility

Framework use only - subclasses should not call or override these methods. HandleCouldAcceptTypes call Delegate_CouldAcceptTypes to attempt to find a flavor helper willing to accept the flavors in the drag, based on helper type and the inherent priority of the flavors in the drag. If no such helper can be found HandleCouldAcceptTypes reverts to the behavior inherited from CDragDropTarget, thus allowing the target to define some default behavior. The remaining methods here delegate to the active flavor helper if one has been set. Similarly, if no active helper has been set, they revert to their inherited behavior.

virtual DragDrop::TargetResponse HandleCouldAcceptTypes (DataObjectIterator *, const IDragDropSource *, const IDragDropController *)
 
virtual void HandleDoDragEnter ()
 
virtual bool16 HandleDoDragEnter_PreflightDragData (IDragDropController *)
 
virtual void HandleDoDragWithin (const PMPoint &localPt)
 
virtual void HandleDoDragLeave ()
 
virtual ErrorCode HandleProcessDragDropCommand (IDragDropController *, DragDrop::eCommandType)
 
- Public Member Functions inherited from CDragDropTarget
 CDragDropTarget (IPMUnknown *boss)
 
virtual SysWireframe DoMakeDropHiliteRegion () const
 
virtual IDataBaseGetTargetDataBase () const
 
bool16 SameAsDragSource (const IDragDropSource *dragSource) const
 
bool16 AffectsSameDataAsDragSource (const IDragDropSource *dragSource) const
 
virtual bool16 HitTest_OutsideBounds (const SysPoint &) const
 
virtual IDragDropTargetQueryInternalDropTarget (const SysPoint &windowPoint, PMPoint &localPoint, DataObjectIterator *dataIter, const IDragDropSource *iSource, const IDragDropController *iController)
 
virtual PMMatrix GetInternalTransform () const
 
virtual void SetInternalTransform (PMMatrix)
 
virtual void RegisterTargetCallback (IDropTargetCallback *)
 
virtual void ReleaseTargetCallback (IDropTargetCallback *)
 
virtual void SetActiveContext ()
 
virtual void ResetActiveContext ()
 
virtual void SetDocument (IDocument *)
 
virtual void DrawTargetOutline ()
 
virtual bool16 IsTargetModifiable () const
 

Protected Member Functions

virtual bool16 DoDragEnter_PreflightDragData (IDragDropController *)
 
- Protected Member Functions inherited from CDragDropTarget
virtual DragDrop::TargetResponse CouldAcceptTypes (DataObjectIterator *, const IDragDropSource *, const IDragDropController *) const
 
virtual void DoDragEnter ()
 
virtual void DoDragWithin (const PMPoint &localPt)
 
virtual void DoDragLeave ()
 
virtual void NotifyTargetCallbacks (IDropTargetCallback::eCallbackState state, const PMPoint &localPt)
 
virtual PMRect GetDragDataBounds () const
 
const DragDrop::TargetResponseGetCachedResponse () const
 
DropTargetCallbackListGetTargetCallbackList ()
 

Additional Inherited Members

- Public Types inherited from IDragDropTarget
enum  { kDefaultIID = IID_IDRAGDROPTARGET }
 
- Protected Attributes inherited from CDragDropTarget
DragDrop::TargetResponse fCachedResponse
 

Detailed Description

Extensible implementation of the CDragDropSource interface, representing the target object that receives a drop operation. Implementors of IDragDropTarget should derive from either this or CDragDropTarget. Note that CDragDropTarget_Extensible derives from CDragDropTarget.

See Also
IDragDropTarget, CDragDropTarget

Member Function Documentation

bool16 CDragDropTarget_Extensible::CanHandleDragData () const
inline

Get the cached flag for whether the target can handle the dragged data.

DragDrop::TargetResponse CDragDropTarget_Extensible::Delegate_CouldAcceptTypes (DataObjectIterator,
const IDragDropSource,
const IDragDropController 
)

Attempt to find a flavor helper willing to accept the flavors in the drag, based on helper type and the inherent priority of the flavors in the drag.

ErrorCode CDragDropTarget_Extensible::Delegate_ProcessDragDropCommand (IDragDropController,
DragDrop::eCommandType  
)

Unused. This method is not called and should probably be removed. ProcessDragDropCommand currently handles delegation to the active helper

virtual bool16 CDragDropTarget_Extensible::DoDragEnter_PreflightDragData (IDragDropController)
protectedvirtual

Override to give the target a chance to "preflight" the data contained in a drag. The default implementation returns kTrue to indicate that the drag should proceed.

IDragDropTargetFlavorHelper* CDragDropTarget_Extensible::GetActiveFlavorHelper () const

Get the active flavor handler, nil if one has not been set.

virtual ServiceID CDragDropTarget_Extensible::GetFlavorHelperServiceID () const
pure virtual

Override this to return the service ID that flavor helpers for this target will respond to.

virtual DragDrop::TargetResponse CDragDropTarget_Extensible::HandleCouldAcceptTypes (DataObjectIterator,
const IDragDropSource,
const IDragDropController 
)
virtual

Framework use only. Subclasses should not call or override these methods - see protected variants.

Reimplemented from CDragDropTarget.

virtual PMRect CDragDropTarget_Extensible::HandleGetDragDataBounds () const
virtual

Overridden to provide delegation to flavor helpers. If no helper is active, calls GetDragDataBounds on target itself.

Reimplemented from CDragDropTarget.

virtual void CDragDropTarget_Extensible::PrepareTargetForDrag ()
virtual

Override if the target needs a chance to initialize itself prior to a drag operation entering the target. Called from HandleCouldAcceptTypes. Default implementation clears the cached active target helper.

Reimplemented from CDragDropTarget.

virtual ErrorCode CDragDropTarget_Extensible::ProcessDragDropCommand (IDragDropController,
DragDrop::eCommandType  
)
virtual

Default implementation checks CanHandleDragData, and then forwards the ProcessDragDropCommand method to the active flavor helper.

Reimplemented from CDragDropTarget.

IDragDropTargetFlavorHelper* CDragDropTarget_Extensible::QueryActiveFlavorHelper () const

Query for the active flavor handler, nil if one has not been set.

void CDragDropTarget_Extensible::SetActiveFlavorHelper (IDragDropTargetFlavorHelper)

Set the active flavor handler. Called by Delegate_CouldAcceptTypes when/if it finds a helper accept the data in a drag.

void CDragDropTarget_Extensible::SetCanHandleDragData (bool16 can)
inline

Set the cached flag for whether the target can handle the dragged data. Can be called by flavor helpers