IDMTargetHandler

The IDMTargetHandler class processes events occurring on the target of a direct manipulation. You must add an object of this class to a window so it can support target direct manipulation. Objects of this class do not allow objects to be dragged from a window. See IDMSourceHandler for information about dragging objects from a window.
Note: An IDMTargetHandler object is added to a window if you initialize direct manipulation via the functions in Enabling Direct Manipulation.


IDMTargetHandler - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IDMTargetHandler
public:
virtual ~IDMTargetHandler()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IDMTargetHandler


Overload 1
public:
IDMTargetHandler()

This is the default constructor.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IDMTargetHandler(IContainerControl* containerControl)

containerControl
A pointer to the container control object.

Creates an object of this class using a pointer to a container control object. The constructed handler is automatically attached to the specified container.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
IDMTargetHandler(IEntryField* entryField)

entryField
A pointer to the entry field object.

Creates an object of this class using a pointer to an entry field object. The constructed handler is automatically attached to the specified entry field.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 4
public:
IDMTargetHandler(IMultiLineEdit* multiLineEdit)

multiLineEdit
A pointer to the multiline edit object.

Creates an object of this class using a pointer to a multiline edit (MLE) object. The constructed handler is automatically attached to the specified MLE.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 5
public:
IDMTargetHandler(IWindow* window)

window
A pointer to the window object.

Creates an object of this class using a pointer to an IWindow-based object that represents a control that is not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls. The constructed handler is automatically attached to the specified window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Dispatching

These members dispatch the various events for a direct manipulation target.


[view class]
dispatchHandlerEvent
protected:
virtual bool dispatchHandlerEvent(IEvent& event)

Overrides the default handler's dispatcher. This function processes the direct manipulation events for the target.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Event Processing

These members are dispatched in response to specific direct manipulation events for the target.


[view class]
targetDrop
protected:
virtual bool targetDrop( IDMTargetDropEvent& event, bool container = true )

Called when the drag item objects are dropped onto the target window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
targetEnd
protected:
virtual bool targetEnd(IDMTargetEndEvent& event)

Called when the source renderer completes rendering a specific drag item. The source renderer posts the target end event and this function processes it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
targetEnter
protected:
virtual bool targetEnter(IDMTargetEnterEvent& event)

Called when the drag item objects enter the target window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
targetHelp
protected:
virtual bool targetHelp(IDMTargetHelpEvent& event)

Called when the user requests help while dragging an object over the target window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
targetLeave
protected:
virtual bool targetLeave(IDMTargetLeaveEvent& event)

Called when the drag item objects leave the target window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Implementation

These members provide utilities used to implement this class. They are used by the Open Class Library.


[view class]
allocateOperation
protected:
virtual IDMTargetOperation::Handle allocateOperation( IDMTargetEnterEvent& event ) const

Creates a new IDMTargetOperation object.

This function is called when the target handler is handling the processing of a new direct manipulation. Derived classes should override this function and return a class derived from IDMTargetOperation.

This function returns a handle to the target operation object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
findRendererFor
protected:
virtual unsigned findRendererFor( const IDMItem::Handle& item )

Finds the appropriate target renderer for the drag item. Returns the position of the renderer or 0 if a renderer cannot be found.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
findRenderersFor
protected:
virtual bool findRenderersFor( const IDMTargetOperation::Handle& targetOperation )

Finds the appropriate target renderers for the specified target operation.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Renderer Processing

These members override the rendering functions defined in the base IDMHandler class. Use them to access the IDMTargetRenderer objects involved in a direct manipulation. Objects of this class render the drag item objects that are compatible with the rendering mechanisms and formats that the Open Class Library supports.


[view class]
addRenderer
public:
virtual IDMTargetHandler& addRenderer( const IDMTargetRenderer& newRenderer )

Adds the specified renderer to the set of candidates maintained by this handler and uses it to render objects dragged from a target window where this handler is attached. The renderer is added to the end of the renderer collection.
Note: Renderers are maintained by position, which are 1-based.

newRenderer
A reference to the renderer object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
numberOfRenderers
public:
virtual unsigned numberOfRenderers()

Returns the number of renderers associated with the target handler.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removeRenderer
public:
virtual IDMTargetHandler& removeRenderer( const IDMTargetRenderer& rendererToRemove )

Removes the specified renderer from this target handler.
Note: Renderers are maintained by position, which is 1-based.

rendererToRemove
A reference to the target renderer object to remove from the renderer collection.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
renderer
public:
virtual IDMTargetRenderer* renderer(unsigned position)

Returns the renderer with the specified position.
Note: Renderers are maintained by position, which is 1-based.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
replaceRenderer
public:
virtual IDMTargetHandler& replaceRenderer( unsigned position, const IDMTargetRenderer& replacement )

Replaces a given renderer with another specified renderer.
Note: Renderers are maintained by position, which is 1-based.

position
A value that represents the location of the target renderer to replace in the renderer collection.
replacement
A reference to the replacement renderer object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setRenderer
public:
virtual IDMTargetHandler& setRenderer( const IDMTargetRenderer& newRenderer )

Sets the renderer for this handler. Removes any pre-existing target renderers.

newRenderer
A reference to the target renderer object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMTargetHandler - Inherited Member Functions and Data

Inherited Public Functions

IHandler
IDMHandler

Inherited Public Data

Inherited Protected Functions

IDMHandler
IHandler

Inherited Protected Data