InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CDragDropTarget Class Reference

#include <CDragDropTarget.h>

Inheritance diagram for CDragDropTarget:
IDragDropTargetIPMUnknownBscDNDDropTargetCDragDropTarget_Extensible

Public Member Functions

 CDragDropTarget (IPMUnknown *boss)
 
virtual SysWireframe DoMakeDropHiliteRegion () const
 
virtual ErrorCode ProcessDragDropCommand (IDragDropController *, DragDrop::eCommandType)
 
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
 
virtual DragDrop::TargetResponse HandleCouldAcceptTypes (DataObjectIterator *, const IDragDropSource *, const IDragDropController *)
 
virtual void HandleDoDragEnter ()
 
virtual void HandleDoDragWithin (const PMPoint &localPt)
 
virtual void HandleDoDragLeave ()
 
virtual ErrorCode HandleProcessDragDropCommand (IDragDropController *, DragDrop::eCommandType)
 

Protected Member Functions

virtual void PrepareTargetForDrag ()
 
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 HandleGetDragDataBounds () const
 
virtual PMRect GetDragDataBounds () const
 
const DragDrop::TargetResponseGetCachedResponse () const
 
DropTargetCallbackListGetTargetCallbackList ()
 

Protected Attributes

DragDrop::TargetResponse fCachedResponse
 

Additional Inherited Members

- Public Types inherited from IDragDropTarget
enum  { kDefaultIID = IID_IDRAGDROPTARGET }
 

Detailed Description

Basic implementation of the IDragDropTarget interface, representing the target object that receives a drop operation. Implementors of IDragDropTarget should derive from either this or CDragDropTarget_Extensible.

See Also
IDragDropTarget, CDragDropTarget_Extensible

Member Function Documentation

bool16 CDragDropTarget::AffectsSameDataAsDragSource (const IDragDropSourcedragSource) const
virtual

Does the specified drag source operate on the same data (pub/database/whatever) as this drag target? If AffectsSameDataAsDragSource is true, then data can be "moved" between such a source and target. (Default implementation checks to see if they return the same IDatabase from GetSource/TargetDataBase())

Implements IDragDropTarget.

virtual DragDrop::TargetResponse CDragDropTarget::CouldAcceptTypes (DataObjectIterator,
const IDragDropSource,
const IDragDropController 
) const
protectedvirtual

Override to check the available external flavors to see if this target can handle any of them. Default implementation returns DragDrop::TargetResponse(DragDrop::kWontAcceptDrop).

Implements IDragDropTarget.

Reimplemented in BscDNDDropTarget.

virtual void CDragDropTarget::DoDragEnter ()
protectedvirtual

Override to handle a drag entering the target. Default implementation does nothing.

Implements IDragDropTarget.

Reimplemented in BscDNDDropTarget.

virtual void CDragDropTarget::DoDragLeave ()
protectedvirtual

Override to handle a drag leaving the target. Default implementation does nothing.

Implements IDragDropTarget.

virtual void CDragDropTarget::DoDragWithin (const PMPointlocalPt)
protectedvirtual

Override to handle a drag moving within the target. Default implementation does nothing.

Implements IDragDropTarget.

virtual SysWireframe CDragDropTarget::DoMakeDropHiliteRegion () const
virtual

Override to specify a region to be hilighted to show that this target can accept the a drop. Default implementation returns DragDrop::kDefaultDropHilite, which highlights based on the bounds of the target.

Implements IDragDropTarget.

virtual void CDragDropTarget::DrawTargetOutline ()
virtual

Override if the targets wants to draw it's own highlight/outline feedback, it can make it available here. This method will not be called by the framework, but can be called by flavor helpers. Default implementation does nothing.

Implements IDragDropTarget.

const DragDrop::TargetResponse& CDragDropTarget::GetCachedResponse () const
inlineprotected

Retrieve the target response computed in CouldAcceptTypes for later use. Response is cached by HandleCouldAcceptTypes

virtual PMRect CDragDropTarget::GetDragDataBounds () const
protectedvirtual

Override to return the dragged item bounds that will be sent to the target callbacks. Default implementation returns an empty PMRect

virtual PMMatrix CDragDropTarget::GetInternalTransform () const
virtual

Basic implementation to retrieve the transformation.

Implements IDragDropTarget.

virtual IDataBase* CDragDropTarget::GetTargetDataBase () const
virtual

Override to specify the database that would accept the drag data received by this target. Default behavior is to return nil - which means that no drag source, other than on on the same boss as this target, is able to move data to this target so the drop represents a copy.

Implements IDragDropTarget.

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

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

Reimplemented in CDragDropTarget_Extensible.

virtual PMRect CDragDropTarget::HandleGetDragDataBounds () const
protectedvirtual

Added so delegation of GetDragDataBounds to FlavorHelpers is possible. Default implementation simply calls GetDragDataBounds() on this target

Reimplemented in CDragDropTarget_Extensible.

virtual bool16 CDragDropTarget::HitTest_OutsideBounds (const SysPoint) const
virtual

Override to allow drop targets to respond outside their actual bounds. Typically used for autoscrolling a target when over its scroll bars. Default implementation does not support this and returns kFalse.

Implements IDragDropTarget.

virtual bool16 CDragDropTarget::IsTargetModifiable () const
virtual

Override if a target could be viewing "read-only" data. Default is kTrue (target is modifiable).

Implements IDragDropTarget.

virtual void CDragDropTarget::NotifyTargetCallbacks (IDropTargetCallback::eCallbackState state,
const PMPointlocalPt 
)
protectedvirtual

Default implementation to call any target callbacks registered for this target. Called from HandleDoDragEnter/Within/Leave just after calling DoDragEnter/Within/Leave.

virtual void CDragDropTarget::PrepareTargetForDrag ()
protectedvirtual

Override if the target needs a chance to initialize itself prior to a drag operation entering the target. Called from HandleCouldAcceptTypes. Default implementation does nothing.

Reimplemented in CDragDropTarget_Extensible.

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

Override to process the commands needed to complete a drop. Default implementation does nothing and returns kFailure.

Parameters
IDragDropController*IN controller for the drag
DragDrop::eCommandTypeIN targets will only receive kDragMove or kDrop
Returns
kSuccess or error code on failure

Implements IDragDropTarget.

Reimplemented in BscDNDDropTarget, and CDragDropTarget_Extensible.

virtual IDragDropTarget* CDragDropTarget::QueryInternalDropTarget (const SysPointwindowPoint,
PMPointlocalPoint,
DataObjectIteratordataIter,
const IDragDropSourceiSource,
const IDragDropControlleriController 
)
virtual

Override to look for non-widget targets inside this target. Default implementation does not support this and returns nil.

Implements IDragDropTarget.

virtual void CDragDropTarget::RegisterTargetCallback (IDropTargetCallback)
virtual

Basic implementation to register a target callback.

Implements IDragDropTarget.

virtual void CDragDropTarget::ReleaseTargetCallback (IDropTargetCallback)
virtual

Basic implementation to release a target callback.

Implements IDragDropTarget.

virtual void CDragDropTarget::ResetActiveContext ()
virtual

Override to clear target specific context. Default implementation does not support this.

bool16 CDragDropTarget::SameAsDragSource (const IDragDropSourcedragSource) const
virtual

Is the specified drag source equivalent to this drag target? Default implementation checks to see if the source is on the same boss as this target.

Implements IDragDropTarget.

virtual void CDragDropTarget::SetActiveContext ()
virtual

Override to allow a target specific context (like IID_IDRAGDROPTARGETDOCUMENT) to be set. Default implementation does not support this.

virtual void CDragDropTarget::SetDocument (IDocument)
virtual

Override to support setting of the target's document. Default implementation does not support this

Implements IDragDropTarget.

virtual void CDragDropTarget::SetInternalTransform (PMMatrix )
virtual

Basic implementation to remember the transformation.

Implements IDragDropTarget.