### IDMHandler

  The IDMHandler class is the base class for the source handler class, IDMSourceHandler, and the target handler class, IDMTargetHandler.

  This base class provides static functions to enable you to add source and target direct manipulation support to your application's windows and controls.

#### Windows Considerations

  You are required to use the enabling functions for direct manipulation support to your application's windows and controls. These enablers initialize the Windows specific direct manipulation support.
  Note: This requirement does not prevent you from using your own source and target handlers. Just be sure to set the default source and target handler prior to calling the enabling functions.

### IDMHandler - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class. This class can only be used as the base class for concrete-derived classes, such as IDMSourceHandler and IDMTargetHandler.

~IDMHandler

      protected:
      virtual ~IDMHandler()

Supported Platforms

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

IDMHandler

      protected:
      IDMHandler()

  Provides the default constructor, which takes no arguments.

Supported Platforms

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

### Default Handlers

Use these static members to get and set the default source and target handlers used by the various enabling functions.

defaultDragHandler

      public:
      static IDMDragHandler& defaultDragHandler()

  Returns the default drag handler.

Supported Platforms

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

defaultDropTargetHandler

      public:
      static IDMDropTargetHandler& defaultDropTargetHandler()

  Returns the default drop target handler.

Supported Platforms

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

defaultSourceHandler

      public:
      static IDMSourceHandler& defaultSourceHandler()

  Returns the default source handler.
  Note: The handler returned by this function may have been, or will be, attached to any window for which any of the enabling functions (enableDragFrom, enableDropOn, or enableDragDropFor) have been called. Any changes you make to this handler, such as adding renderers, removing renderers, or changing the renderers effects all of these windows.

Supported Platforms

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

defaultTargetHandler

      public:
      static IDMTargetHandler& defaultTargetHandler()

  Returns the default target handler.
  Note: The handler returned by this function may have been, or will be, attached to any window for which any of the enabling functions (enableDragFrom, enableDropOn, or enableDragDropFor) have been called. Any changes you make to this handler, such as adding renderers, removing renderers, or changing the renderers effects all of these windows.

Supported Platforms

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

setDefaultSourceHandler

      public:
      static void
        setDefaultSourceHandler( IDMSourceHandler& source )

  Sets the default source handler to the specified handler. This handler is attached to windows on subsequent calls to IDMHandler::enableDragFrom or IDMHandler::enableDragDropFor.

Supported Platforms

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

setDefaultTargetHandler

      public:
      static void
        setDefaultTargetHandler( IDMTargetHandler& target )

  Sets the default target handler to the specified handler. This handler is attached to windows on subsequent calls to IDMHandler::enableDragFrom or IDMHandler::enableDragDropFor.

Supported Platforms

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

### Enabling Direct Manipulation

Use these static members to provide a simple means of enabling direct manipulation for application windows and controls.

enableDragDropFor

  Attaches the default source and target handlers to the specified window and the default source and target renderers to their respective handlers.

  Overload 1

      public:
      static void enableDragDropFor(IMultiLineEdit* mle)

  mle
    A pointer to the multiline edit object.

  This overload of the function is used for multiline edit source and target enablement. A drag item provider is attached to the multiline edit (MLE) by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the MLE, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag and drop target handlers to the specified window.

  Overload 2

      public:
      static void
        enableDragDropFor( IToolBarButton* toolBarButton )

  toolBarButton
    A pointer to the tool bar button object.

  This overload of the function is used for tool bar button source and target enablement. A drag item provider is attached to the tool bar button by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the tool bar button, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag and drop target handlers to the specified window.

  Overload 3

      public:
      static void enableDragDropFor(IWindow* window)

  window
    A pointer to the window object.

  This overload of the function is used for the source and target enablement of controls that are not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls.
  Note: You must attach a drag item provider for any types of windows or controls that are not supported by the Open Class Library to enable them to support direct manipulation.

Supported Platforms

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

Windows Considerations

  Attaches the default drag and drop target handlers to the specified window.

  Overload 4

      public:
      static void enableDragDropFor(IEntryField* entryField)

  entryField
    A pointer to the entry field object.

  This overload of the function is used for entry field source and target enablement. A drag item provider is attached to the entry field by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the entry field, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag and drop target handlers to the specified window.

  Overload 5

      public:
      static void enableDragDropFor(IContainerControl* container)

  container
    A pointer to the container object.

  This overload of the function is used for container source and target enablement. A drag item provider is attached to the container by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the container, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag and drop target handlers to the specified window.

enableDragFrom

  Attaches the default source handler to the specified window and the default source renderer to the handler.

  Overload 1

      public:
      static void enableDragFrom(IContainerControl* container)

  container
    A pointer to the container object.

  This overload of the function is used for container source enablement. A drag item provider is attached to the container by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the container, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag handler to the specified window.

  Overload 2

      public:
      static void enableDragFrom(IWindow* window)

  window
    A pointer to the window object.

  This overload of the function is used for the source enablement of controls that are not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls.
  Note: You must attach a drag item provider for any types of windows or controls that are not supported by the Open Class Library to enable them to support direct manipulation.

Supported Platforms

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

Windows Considerations

  Attaches the default drag handler to the specified window.

  Overload 3

      public:
      static void enableDragFrom(IEntryField* entryField)

  entryField
    A pointer to the entry field object.

  This overload of the function is used for entry field source enablement. A drag item provider is attached to the entry field by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the entry field, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag handler to the specified window.

  Overload 4

      public:
      static void enableDragFrom(IMultiLineEdit* mle)

  mle
    A pointer to the multiline edit object.

  This overload of the function is used for multiline edit source enablement. A drag item provider is attached to the multiline edit (MLE) by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the MLE, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drag handler to the specified window.

enableDropOn

  Attaches the default target handler to the specified window and the default target renderer to the handler.

  Overload 1

      public:
      static void enableDropOn(IToolBar* toolBar)

  toolBar
    A pointer to the tool bar object.

  This overload of the function is used for tool bar target enablement. A drag item provider is attached to the tool bar by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the tool bar, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drop target handler to the specified window.

  Overload 2

      public:
      static void enableDropOn(IContainerControl* container)

  container
    A pointer to the container object.

  This overload of the function is used for container target enablement. A drag item provider is attached to the container by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the container, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drop target handler to the specified window.

  Overload 3

      public:
      static void enableDropOn(IMultiLineEdit* mle)

  mle
    A pointer to the multiline edit object.

  This overload of the function is used for multiline edit target enablement. A drag item provider is attached to the multiline edit (MLE) by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the MLE, you must attach your own drag item providers.

Supported Platforms

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

Windows Considerations

  Attaches the default drop target handler to the specified window.

  Overload 4

      public:
      static void enableDropOn(IEntryField* entryField)

  entryField
    A pointer to the entry field object.

  This overload of the function is used for entry field target enablement. A drag item provider is attached to the entry field by default, which provides default direct manipulation support for it. If you want specialized direct manipulation support for the entry field, you must attach your own drag item providers.

Supported Platforms

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

  Overload 5

      public:
      static void enableDropOn(IWindow* window)

  window
    A pointer to the window object.

  This overload of the function is used for the target enablement of controls that are not supported by the default Open Class Library support for direct manipulation. These controls can be system-defined controls or custom controls.
  Note: You must attach a drag item provider for any types of windows or controls that are not supported by the Open Class Library to enable them to support direct manipulation.

Supported Platforms

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

Windows Considerations

  Attaches the default drop target handler to the specified window.

### Handler Processing

Handler-processing members query information about the windows that the handler is attached to.

isContainerControl

      protected:
      bool isContainerControl(const IWindow* window) const

  Returns true if the window is a container control.

Supported Platforms

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

### Item Providers

These static members set a default item provider for the argument window.
Note: In most cases, the Open Class Library will provide an item provider when you enable a window for direct manipulation. Please see Enabling Direct Manipulation for details.

setItemProvider

  Sets the default item provider for the argument window.

  Overload 1

      protected:
      static void setItemProvider(IMultiLineEdit* mle)

  mle
    A pointer to the multiline edit object.

  Sets the default item provider for the multiline edit object.

Supported Platforms

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

  Overload 2

      protected:
      static void setItemProvider(IToolBarButton* toolBar)

  toolBar
    A pointer to the tool bar button object.

  Sets the default item provider for the tool bar button object.

Supported Platforms

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

  Overload 3

      protected:
      static void setItemProvider(IContainerControl* container)

  container
    A pointer to the container object.

  Sets the default item provider for the container object.

Supported Platforms

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

  Overload 4

      protected:
      static void setItemProvider(IEntryField* entryField)

  entryField
    A pointer to the entry field object.

  Sets the default item provider for the entry field object.

Supported Platforms

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

  Overload 5

      protected:
      static void setItemProvider(IToolBar* toolBar)

  toolBar
    A pointer to the tool bar object.

  Sets the default item provider for the tool bar object.

Supported Platforms

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

### Rendering

These members provide a means of accessing the base IDMRenderer objects involved in the direct manipulation described by objects of this class. These objects are used to handle the rendering of drag item objects that are compatible with the supported rendering mechanisms and formats (RMFs).

addRenderer

      protected:
      virtual IDMHandler&
        addRenderer( const IDMRenderer& newRenderer )

  Adds a specified renderer to this handler. The renderer is added to the end of the renderer collection.
  Note: Renderers are maintained by position, which are 1-based.

Supported Platforms

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

numberOfRenderers

      protected:
      virtual unsigned numberOfRenderers()

  Returns the number of renderers currently in the renderer collection.

Supported Platforms

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

removeRenderer

  Removes the specified renderer from this handler.
  Note: Renderers are maintained by position, which are 1-based.

  Overload 1

      protected:
      virtual IDMHandler& removeRenderer(unsigned position)

  position
    A value that represents the location of the renderer in the renderer collection.

Supported Platforms

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

  Overload 2

      protected:
      virtual IDMHandler&
        removeRenderer( const IDMRenderer& rendererToRemove )

  rendererToRemove
    A reference to the renderer object to remove from the renderer collection.

Supported Platforms

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

renderer

      protected:
      virtual IDMRenderer* renderer(unsigned position)

  Returns the renderer at the given position.
  Note: Renderers are maintained by position, which are 1-based.

Supported Platforms

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

replaceRenderer

      protected:
      virtual IDMHandler&
        replaceRenderer( unsigned position,
                         const IDMRenderer& replacement )

  Replaces a renderer with another specified renderer.
  Note: Renderers are maintained by position, which are 1-based.

Supported Platforms

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

setRenderer

      protected:
      virtual IDMHandler&
        setRenderer( const IDMRenderer& newRenderer )

  Sets the renderer for this handler. Removes any pre-existing renderers.

Supported Platforms

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

### IDMHandler - Inherited Member Functions and Data

#### Inherited Public Functions

  IHandler

  -     virtual ~IHandler()

  -     virtual IString asDebugInfo() const

  -     virtual IString asString() const

  -     virtual IHandler& disable()

  -     virtual IHandler& enable(bool enable = true)

  -     virtual IHandler& handleEventsFor(IWindow* window)

  -     IHandler()

  -     bool isEnabled() const

  -     virtual IHandler& stopHandlingEventsFor(IWindow* window)

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IHandler

  -     virtual IEventResult defaultProcedure(IEvent& event)

  -     virtual bool dispatchHandlerEvent(IEvent& event) = 0

#### Inherited Protected Data

  - None