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.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IDMSourceOperation()
Destructs objects of this class.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IDMSourceOperation( IDMSourceBeginEvent& event, DragImageStyle dragStyle = IDM::systemImages )
Constructs objects of this class.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to set and query container-specific attributes.
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these functions to set and query the drag image style and the stacking percentage that determines the placement of stacked drag images.
![]() |
public:
virtual DragImageStyle imageStyle() const
Returns the drag image style for the source operation.
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
![]() |
public:
virtual IDMSourceOperation& setImageStyle( DragImageStyle dragImageStyle = IDM::systemImages )
Sets the drag image style for the source operation.
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
![]() |
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:
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
![]() |
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.
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
These members provide utilities used to implement this class. They are used by the Open Class Library.
![]() |
public:
IDMSourceOperation& begin()
Initiates the direct manipulation.
Note:
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. |
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These are utility functions for drag operation objects.
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
static Handle operationFrom(_DRAGINFO* dragInformation)
Retrieves a handle to the source operation from the drag information structure.
IAccessError | The source operation handle was not retrieved. The drag information is not accessible. |
Windows | OS/2 | AIX |
No | Yes | Yes |
The parameter, dragInformation, is a pointer to the DRAGINFO structure.
![]() |
public:
static void setSourceOperation( IDMSourceOperation::Handle srcOperation )
Sets an IDMSourceOperation handle during the processing of the source begin event.
Windows | OS/2 | AIX |
Yes | No | Yes |
![]() |
public:
static IDMSourceOperation::Handle sourceOperation()
Returns the IDMSourceOperation handle created during the processing of the source begin event.
Windows | OS/2 | AIX |
Yes | No | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
IDMOperation& addItem(const IDMItem::Handle& newItem)
IContainerObject* containerObject() const
static bool debugSupport()
IDMItem::Handle item(unsigned position)
unsigned numberOfItems()
virtual IPoint position() const
IDMOperation& removeItem( const IDMItem::Handle& itemToRemove )
IDMOperation& removeItem(unsigned position)
IDMOperation& replaceItem( unsigned position, const IDMItem::Handle& replacement )
IDMOperation& setContainerObject(IContainerObject* object)
IDMOperation& setContainerRefreshOff( IContainerControl* container )
IDMOperation& setContainerRefreshOn()
static void setDebugSupport(bool debugSupport = true)
virtual IDMOperation& setOperation(unsigned long op)
virtual IDMOperation& setPosition(IPoint position)
virtual IDMOperation& setSource(Source source)
virtual IDMOperation& setSourceWindowHandle( IWindowHandle window )
virtual IDMOperation& setTargetWindowHandle( IWindowHandle window )
virtual Source source() const
virtual IWindow* sourceWindow() const
virtual IWindowHandle sourceWindowHandle() const
virtual IWindow* targetWindow() const
virtual IWindowHandle targetWindowHandle() const
void addRef()
unsigned long count() const
void removeRef()
static const unsigned long copy
static const unsigned long drag
static const unsigned long link
static const unsigned long move
static const unsigned long unknown
virtual ~IDMOperation()
_DRAGINFO* dragInfo() const
bool dragWasInterrupted() const
IDMOperation(IDMSourceBeginEvent& event)
IDMOperation(IDMTargetEnterEvent& event)
IDMOperation& setDragInfo(_DRAGINFO* dragInfo)
IDMOperation& setDragResult(bool result)
virtual ~IMRefCounted()
IMRefCounted(const IMRefCounted&)
IMRefCounted()
IMRefCounted& operator =(const IMRefCounted&)