### 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.

~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

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.

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

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.

imageStyle

      public:
      virtual DragImageStyle imageStyle() const

  Returns the drag image style for the source operation.

Supported Platforms

  Windows | OS/2 | AIX
  Ignored | Yes | Ignored

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

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

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.

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.

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:

  - IDMOperation::copy
  - IDMOperation::drag
  - IDMOperation::link
  - IDMOperation::move
  - IDMOperation::unknown

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

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

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.

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

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

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

  -     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

  IMRefCounted

  -     void addRef()

  -     unsigned long count() const

  -     void removeRef()

#### Inherited Public Data

  IDMOperation

  -     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

#### Inherited Protected Functions

  IDMOperation

  -     virtual ~IDMOperation()

  -     _DRAGINFO* dragInfo() const

  -     bool dragWasInterrupted() const

  -     IDMOperation(IDMSourceBeginEvent& event)

  -     IDMOperation(IDMTargetEnterEvent& event)

  -     IDMOperation& setDragInfo(_DRAGINFO* dragInfo)

  -     IDMOperation& setDragResult(bool result)

  IMRefCounted

  -     virtual ~IMRefCounted()

  -     IMRefCounted(const IMRefCounted&)

  -     IMRefCounted()

  -     IMRefCounted& operator =(const IMRefCounted&)

#### Inherited Protected Data

  - None