IDMTargetOperation

The IDMTargetOperation class represents a target operation in a direct manipulation. Objects of this class provide information about target operations. You can access the target operation from a drag item using IDMItem::targetOperation or the static function IDMTargetOperation::targetOperation.

Objects of this class are not intended to be created by application programmers. The target event handler class, IDMTargetHandler creates them.

You can access an object of this class using IDMTargetOperation::Handle, which reference-counts the object.


IDMTargetOperation - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


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

Destructs objects of this class.
Note: If a container is the target of the direct manipulation, this function enables container refresh and refreshes the container.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IDMTargetOperation
public:
IDMTargetOperation(IDMTargetEnterEvent& event)

Construct objects of this class.

Exception

IAccessError The object for the target operation was not created. The drag information is not accessible.
IInvalidRequest The object for the target operation was not created. The target item provider failed to provide any items.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Container Support

Use these members to set and query container-specific attributes.


[view class]
dropOffset
public:
ISize dropOffset() const

Queries the current drop offset. The drop offset is the location where the next container object dropped would be positioned as long as the target operation's drop style is not IDM::dropPosition. The location is the offset relative to the position of the last object dropped.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
dropPosition
public:
IPoint dropPosition( const IDMItem::Handle& dragItem, IDMTargetDropEvent& event )

Returns the drop position for dragItem in container workspace coordinates and sets the offset for the next drag item according to the target operation's drop style.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isStyle
public:
bool isStyle(DropStyle dropStyle)

Returns true if the specified drop-style flag is set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
positionRelativeTo
public:
IPoint positionRelativeTo( const IDMItem::Handle& item, IDMTargetDropEvent& event )

Returns a drag item's position relative to the target container. If the drag item handle is 0, a drop point relative to the target container's origin is returned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDropOffset
public:
IDMTargetOperation& setDropOffset( const ISize& newPointerOffset )

Sets the current drop offset in window coordinates. The drop offset is the location where the next container object dropped would be positioned as long as the target operation's drop style is not IDM::dropPosition. The location is the offset relative to the position of the last object dropped.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setStyle
public:
IDMTargetOperation& setStyle(DropStyle dropStyle)

Sets the drop style for the target operation.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
style
public:
DropStyle style() const

Returns the target operation's drop style.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
wasDragAfter
public:
bool wasDragAfter() const

Returns true if the target enter event was generated above the first list item, between list items, or after the last list item in one of the list views of a container. An example of a container list view is the details view.

False is returned if the event was generated over a list item.

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]
instanceFor
public:
static IDMTargetOperation::Handle instanceFor( IDMTargetEnterEvent& event )

Returns an IDMTargetOperation object.
Note: Generally, you do not call this function. This function is called by the IDMTargetHandler object during the processing of a target enter event.

Exception

IAccessError The handle for the target operation object was not returned. The drag information is not accessible.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Operation Services

These are utility functions for drag operation objects.


[view class]
firstTimeEntered
public:
virtual bool firstTimeEntered() const

Returns a flag indicating that a drag operation is entering the target window for the first time.
Note: Generally, you do not call this function. This function is called by the IDMTargetHandler object during the processing of a targe enter event.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setFirstTimeEntered
public:
IDMTargetOperation& setFirstTimeEntered(bool flag)

Sets a flag indicating that a drag operation is entering the target window for the first time.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setTargetOperation
public:
static void setTargetOperation( IDMTargetOperation::Handle tgtOperation )

Sets an IDMTargetOperation handle during the processing of the initial target enter event.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
targetOperation
public:
static IDMTargetOperation::Handle targetOperation()

Returns the IDMTargetOperation handle created during the processing of the initial target enter event.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMTargetOperation - Type Definitions


[view class]
Handle
typedef ICountedPointerTo < IDMTargetOperation > Handle

IDMTargetOperation::Handle provides access to the IDMTargetOperation objects associated with a direct manipulation. This handle manages the references to the IDMTargetOperation object and ensures that this object is not destructed until the direct manipulation is completed.

Use Handle to reference a target operation handle within this class and IDMTargetOperation::Handle externally.

To convert from a Handle to an IDMTargetOperation pointer, use the ICountedPointerTo::getAlias() function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMTargetOperation - Inherited Member Functions and Data

Inherited Public Functions

IDMOperation
IMRefCounted

Inherited Public Data

IDMOperation

Inherited Protected Functions

IDMOperation
IMRefCounted

Inherited Protected Data