### IDMItemProvider

  The IDMItemProvider class provides application-specific direct manipulation behavior for windows. Construct objects from a derived class or the IDMItemProviderFor template class and attach them to source and target windows that you enable for direct manipulation. Attach the objects with the member function IWindow::setItemProvider.

  The responsibilities of this class include the following:

  - Providing source and target items
  - Providing help when requested while a drag item is positioned over a target
  - Providing application-defined checking when a drag item is entering or moving over a target
  - Providing application-defined cleanup when a drag item is exiting a target
  - Providing other application-defined support; for example, drawing the target emphasis

  When the source handler detects that a direct manipulation is started in one of the windows it is attached to, it calls IDMItemProvider::provideSourceItems.

  When drag items enter a potential target, generic IDMItem objects are created to represent them. Next, the target handler calls IDMItemProvider::provideTargetItemFor once for each drag item. This gives a derived IDMItemProvider class the opportunity to replace the generic IDMItem objects with objects of some IDMItem-derived class that provides application-specific behavior.
  Note: See the direct manipulation section of the Task Information for more information on how to construct derived IDMItemProvider classes. Also, see the template class IDMItemProviderFor, which you can use to construct derived IDMItemProviderFor classes for your IDMItem derived classes.

### IDMItemProvider - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~IDMItemProvider

      public:
      virtual ~IDMItemProvider()

Supported Platforms

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

IDMItemProvider

      public:
      IDMItemProvider()

  Provides the default constructor to construct objects of this class.

Supported Platforms

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

### Drag Item Support

Use these members to provide event-specific support during a direct manipulation.

provideEnterSupport

      public:
      virtual bool
        provideEnterSupport( IDMTargetEnterEvent& event )

  Provides support for the target enter event. This function is called when the user moves a drag item over the target for which the provider is providing direct manipulation support.

  Derived classes should override this function to accomplish any of the following:

  - To draw target emphasis on the target window.
  - To validate that the drag item can be dropped. If it cannot be dropped, call IDMTargetEnterEvent::setDropIndicator to set one of the drop indicator values defined in IDM::DropIndicator.

  The default implementation of this function does the following:

  - For multiline edit (MLE) controls and the entry field, if the source and target windows are the same window, the drop indicator is set to IDM::neverOk.
  - For containers, if the potential target is a container object and if the drag item is directly over the object, you can validate that the container object can be dropped on via the member function IContainerObject::isDropOnAble. If the drag item is between container objects in one of the container list views, such as the details view, this test is not performed. IDMTargetEnterEvent::isDragAfter is used to determine if the drag item is between container objects if the objects are displayed in one of the container list views.
  - For intraprocess containers, if the operation is a move, IContainerControl::isMoveValid is called to validate the move.
  - For tool bar buttons, if the source and target buttons are the same button, if the button already exists on the tool bar, or if one of the drag item types is not IDM::toolBarButton, IDM::menuItem, or IDM::bitmap, the drop indicator is set to IDM::neverOk.
  - For tool bars, if the button already exists on the tool bar, or if one of the drag item types is not IDM::toolBarButton or IDM::menuItem, the drop indicator is set to IDM::neverOk.

Supported Platforms

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

provideHelpFor

      public:
      virtual bool provideHelpFor(IDMTargetHelpEvent& event)

  Provides target-specific drop help. This function is called when the user requests help while a drag item is positioned over a potential target.

  Derived classes should override this function to provide the specific help for the target of a drop. For example, you can provide help that details the processing that occurs if the drag item is dropped on the target.

  The default implementation of this function does nothing.

Supported Platforms

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

provideLeaveSupport

      public:
      virtual bool
        provideLeaveSupport( IDMTargetLeaveEvent& event )

  Provides support for the target leave event. This function is called when the user moves a drag item off of the target for which the provider is providing direct manipulation support.

  Derived classes should override this function to perform any required cleanup or to remove target emphasis from the target.

  The default implementation of this function does nothing.

Supported Platforms

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

provideSourceItems

      public:
      virtual bool
        provideSourceItems( const IDMSourceOperation::Handle& sourceOperation )

  Adds IDMItem or IDMItem-derived class objects to the specified sourceOperation. This function is called when a direct manipulation starts on a source window.

  If drag items are provided, true is returned.

Supported Platforms

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

provideTargetItemFor

      public:
      virtual IDMItem::Handle
        provideTargetItemFor( const IDMItem::Handle& dragItem )

  Replaces generic IDMItem objects with an IDMItem-derived class during the processing of the initial target enter event.

  The default implementation returns the item handle, dragItem, that was passed to the function.

Supported Platforms

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

### IDMItemProvider - Inherited Member Functions and Data

#### Inherited Public Functions

  - None

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None