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

#include <IDragDropSourceContentHelper.h>

Inheritance diagram for IDragDropSourceContentHelper:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDRAGDROPSOURCECONTENTHELPER }
 

Public Member Functions

virtual DragDrop::eHelperType GetHelperType () const =0
 
virtual bool16 CouldStartDrag (IDragDropSource *, IEvent *e) const =0
 
virtual CursorSpec GetDragCursor (IDragDropSource *, DragDrop::eTargetResponse, bool16 isDragLocal) const =0
 
virtual SysWireframe CreateDragOutlineRegion (IDragDropSource *) const =0
 
virtual bool16 DoAddDragContent (IDragDropSource *, IDragDropController *)=0
 
virtual ErrorCode ProcessDragDropCommand (IDragDropSource *, IDragDropController *, DragDrop::eCommandType)=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

The IDragDropSourceContentHelper interface provides extensibility for drag drop sources. Drag source extensibility requires the source be derived from CDragDropSource_Extensible. Create a new boss with an IDragDropSourceContentHelper implementation combined with a IK2ServiceProvider implementation that corresponds to the service ID defined by the extensible drag source.

When the framework asks an extensible drag source if it is willing to start a drag, the source then asks each of it's content helpers if they could start a drag from the current mouse location. One helper is chosen based on willingness to begin a drag, and in the case of multiple helpers, prioritized by helper type. The extensible source then forwards the subsequent method calls that occur during the drag to the chosen helper.

See Also
IDragDropSource, IK2ServiceProvider, CDragDropSource_Extensible

Member Function Documentation

virtual bool16 IDragDropSourceContentHelper::CouldStartDrag (IDragDropSource,
IEvente 
) const
pure virtual

Could this helper initiate a drag from the given mouse position?

Parameters
sourceIN the drag drop source this helper is assisting
eIN event containing current mouse position and modifiers
Returns
kTrue if a drag could be started.
virtual SysWireframe IDragDropSourceContentHelper::CreateDragOutlineRegion (IDragDropSource) 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.

Parameters
sourceIN the drag drop source this helper is assisting
Returns
SysWireframe to be used as drag feedback (caller is responsible for deleting this object)
virtual bool16 IDragDropSourceContentHelper::DoAddDragContent (IDragDropSource,
IDragDropController 
)
pure virtual

Add drag content for the current drag operation.

Parameters
sourceIN the drag drop source this helper is assisting
controllerIN used to call IDragDropController::AddDragItem as necessary.
Returns
kTrue if the operation succeeded
virtual CursorSpec IDragDropSourceContentHelper::GetDragCursor (IDragDropSource,
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
sourceIN the drag drop source this helper is assisting
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
virtual DragDrop::eHelperType IDragDropSourceContentHelper::GetHelperType () const
pure virtual

Return the type or priority of the helper. This is used to resolve conflicts that can arise when more than one source content helper is capable of starting a drag drop operation. The presence of multiple helpers is not a conflict, a conflict would arise when one helper wants to replace or augment what another helper already does.

Returns
helper type appropriate for this helper. Use DragDrop::kDefaultHelper by default.
virtual ErrorCode IDragDropSourceContentHelper::ProcessDragDropCommand (IDragDropSource,
IDragDropController,
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
sourceIN the drag drop source this helper is assisting
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