IDMSourceOperation

The IDMSourceOperation class represents a source operation in a direct manipulation. Objects of this class provide information about source operations. You can access the source operation from a drag item using IDMItem::sourceOperation.

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

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


IDMSourceOperation - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


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

Destructs objects of this class.
Note: If a container is the source of the direct manipulation, the container refresh is enabled and the container is refreshed.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IDMSourceOperation
public:
IDMSourceOperation( IDMSourceBeginEvent& event, DragImageStyle dragStyle = IDM::systemImages )

Constructs objects of this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Container Support

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


[view class]
pointerOffset
public:
virtual ISize pointerOffset() const

Returns the position of the hot spot of the pointing device relative to the source container object's origin. If the source is not a container, ISize( 0, 0 ) is returned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setPointerOffset
public:
virtual IDMSourceOperation& setPointerOffset( const ISize& offset )

Sets the position of the hot spot of the pointing device relative to the source container object's origin.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Drag Image Support

Use these functions to set and query the drag image style and the stacking percentage that determines the placement of stacked drag images.


[view class]
imageStyle
public:
virtual DragImageStyle imageStyle() const

Returns the drag image style for the source operation.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


[view class]
setImageStyle
public:
virtual IDMSourceOperation& setImageStyle( DragImageStyle dragImageStyle = IDM::systemImages )

Sets the drag image style for the source operation.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


[view class]
setStackingPercentage
public:
virtual IDMSourceOperation& setStackingPercentage( const IPair& stackingPercentage )

Sets the stacking percentage that is used to calculate the placement of the next "stacked" image when the drag image style, IDM::stack3AndFade or IDM::allStacked, is specified.

The stacking percentage determines the placement of the next stacked image based upon the origin of the current image. For example, if you specify IPair( 25, 25 ) as the stacking percentage, the origin of the next stacked image is positioned at a point that is located 25 percent of the current images' width and height plus the origin of the current image. For example, if the origin of the current image is ( 0,0 ) and its size is ( 32, 32 ), the origin of the next stacked image is ( 8, 8 ).

By specifying a negative value for either of the values that comprise the stacking percentage, you can vary the stacking direction.
Note: The origin of the initial image is relative to the hot spot of the pointing device. It is determined by the pointer offset value returned by IDMImage::pointerOffset.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


[view class]
stackingPercentage
public:
IPair stackingPercentage() const

Returns the stacking percentage that is used to calculate the placement of the next "stacked" image when the drag image style, IDM::stack3AndFade or IDM::allStacked, is specified.

Supported Platforms

Windows OS/2 AIX
Ignored Yes Ignored


Implementation

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


[view class]
begin
public:
IDMSourceOperation& begin()

Initiates the direct manipulation.
Note: Generally, you do not call this function. This function is called by the IDMSourceHandler object during the processing of a source begin event.

Exception

IAccessError The drag operation was not started. The drag information could not be allocated. The system resources may be exhausted.
IAccessError The drag operation was not started. Allocation of a drag item failed.
IAccessError The drag operation was not started. A drag item may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Operation Services

These are utility functions for drag operation objects.


[view class]
operation
public:
virtual unsigned long operation() const

Returns the default drag operation for the direct manipulation. Use this function to determine the actual operation that occurred at the target after the drop has occurred.

The possible default drag operations include the following:

Application-defined drag operations are assigned a value greater than IDMOperation::unknown.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operationFrom
public:
static Handle operationFrom(_DRAGINFO* dragInformation)

Retrieves a handle to the source operation from the drag information structure.

Exception

IAccessError The source operation handle was not retrieved. The drag information is not accessible.

Supported Platforms

Windows OS/2 AIX
No Yes Yes

OS/2 Considerations

The parameter, dragInformation, is a pointer to the DRAGINFO structure.


[view class]
setSourceOperation
public:
static void setSourceOperation( IDMSourceOperation::Handle srcOperation )

Sets an IDMSourceOperation handle during the processing of the source begin event.

Supported Platforms

Windows OS/2 AIX
Yes No Yes


[view class]
sourceOperation
public:
static IDMSourceOperation::Handle sourceOperation()

Returns the IDMSourceOperation handle created during the processing of the source begin event.

Supported Platforms

Windows OS/2 AIX
Yes No Yes


IDMSourceOperation - Type Definitions


[view class]
Handle
typedef ICountedPointerTo < IDMSourceOperation > Handle

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

Use Handle to reference a source operation handle within this class and IDMSourceOperation::Handle externally.

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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IDMSourceOperation - Inherited Member Functions and Data

Inherited Public Functions

IDMOperation
IMRefCounted

Inherited Public Data

IDMOperation

Inherited Protected Functions

IDMOperation
IMRefCounted

Inherited Protected Data