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

#include <IDragDropSource.h>

Inheritance diagram for IDragDropSource:
IPMUnknownCDragDropSourceCDragDropSource_ExtensibleBscDNDCustomDragSourceBscDNDDragSourceCusDtLnkUIDragDropSourcePnlTrvDragDropSource

Public Types

enum  { kDefaultIID = IID_IDRAGDROPSOURCE }
 

Public Member Functions

virtual bool16 WillDrag (IEvent *e) const =0
 
virtual CursorSpec GetDragCursor (DragDrop::eTargetResponse, bool16 isDragLocal) const =0
 
virtual SysWireframe DoMakeDragOutlineRegion () const =0
 
virtual bool16 DoAddDragContent (IDragDropController *)=0
 
virtual ErrorCode ProcessDragDropCommand (IDragDropController *controller, DragDrop::eCommandType)=0
 
virtual IDataBaseGetSourceDataBase () const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

IDragDropSource interface, represents the source object that initiates a drag drop operation. Implementors should derive from either CDragDropSource or CDragDropSource_Extensible.

See Also
IDragDropTarget

Member Function Documentation

virtual bool16 IDragDropSource::DoAddDragContent (IDragDropController)
pure virtual

Add drag content for the current drag operation

Parameters
controllerIN used to call IDragDropController::AddDragItem as necessary.
Returns
whether or not the operation succeeded

Implemented in BscDNDCustomDragSource, BscDNDDragSource, PnlTrvDragDropSource, CusDtLnkUIDragDropSource, CDragDropSource, and CDragDropSource_Extensible.

virtual SysWireframe IDragDropSource::DoMakeDragOutlineRegion () const
pure virtual

Provide the outline region to be dragged with the cursor as feedback during the drag operation. Can return constants DragDrop::kNoDragOutline or DragDrop::kDefaultDragOutline when appropriate - caller is responsible for releasing the returned region, if any.

Returns
SysWireframe to be used as drag feedback (caller is responsible for deleting this object)

Implemented in CDragDropSource, and CDragDropSource_Extensible.

virtual CursorSpec IDragDropSource::GetDragCursor (DragDrop::eTargetResponse ,
bool16 isDragLocal 
) const
pure virtual

Provide the cursor to be displayed during the drag based on the response from a target. Return DragDrop::kDefaultDragCursors to use the default platform cursors.

Parameters
targetResponseIN what action the target intends to perform (nothing, copy, move, link)
isDragLocalIN is the drag taking place within the source object (source and target are equivalent)
Returns
CursorSpec to display corresponding to target's intended action

Implemented in CDragDropSource, and CDragDropSource_Extensible.

virtual IDataBase* IDragDropSource::GetSourceDataBase () const
pure virtual

Return the database that contains the drag data offered by this source. Used to determine if a source and target belonging to different bosses actually view the same data. Can be used to determine if a drag operation should be a move vs. a copy, but not required.

Returns
the affected database (usually returns the database of an IDocument, or nil)

Implemented in CDragDropSource, and CDragDropSource_Extensible.

virtual ErrorCode IDragDropSource::ProcessDragDropCommand (IDragDropControllercontroller,
DragDrop::eCommandType  
)
pure virtual

Create and process (or schedule) the commands needed to complete the drop operation. Normally called on the drop target, this method is also called on sources when the original data needs to be deleted, as in a drag to the trash.

Parameters
controllerIN drag drop controller for this operation
commandTypeIN which operation to perform (sources will only receive kDrag to delete data)
Returns
success or failure of the drop

Implemented in CDragDropSource, and CDragDropSource_Extensible.

virtual bool16 IDragDropSource::WillDrag (IEvente) const
pure virtual

Called by Drag Drop framework prior to initiating a drag operation.

Parameters
eIN event to be used to obtain the current mouse position
Returns
whether or not a drag could be initiated from the mouse position in the event

Implemented in BscDNDCustomDragSource, BscDNDDragSource, PnlTrvDragDropSource, CusDtLnkUIDragDropSource, CDragDropSource_Extensible, and CDragDropSource.