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

~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

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.

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

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

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

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

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

setStyle

      public:
      IDMTargetOperation& setStyle(DropStyle dropStyle)

  Sets the drop style for the target operation.

Supported Platforms

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

style

      public:
      DropStyle style() const

  Returns the target operation's drop style.

Supported Platforms

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

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.

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.

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

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

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

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

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

  -     IDMOperation& addItem(const IDMItem::Handle& newItem)

  -     IContainerObject* containerObject() const

  -     static bool debugSupport()

  -     IDMItem::Handle item(unsigned position)

  -     unsigned numberOfItems()

  -     virtual unsigned long operation() const

  -     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(IDMTargetEnterEvent& event)

  -     IDMOperation(IDMSourceBeginEvent& event)

  -     IDMOperation& setDragInfo(_DRAGINFO* dragInfo)

  -     IDMOperation& setDragResult(bool result)

  IMRefCounted

  -     virtual ~IMRefCounted()

  -     IMRefCounted()

  -     IMRefCounted(const IMRefCounted&)

  -     IMRefCounted& operator =(const IMRefCounted&)

#### Inherited Protected Data

  - None