### IDMSourceRenderer

  The IDMSourceRenderer class provides source rendering support for a direct manipulation. Objects of this class are registered with the source handler via IDMRenderer::setDefaultSourceRenderer, IDMSourceHandler::addRenderer, or IDMSourceHandler::setRenderer.

  The source handler selects a best-match source renderer by calling IDMSourceHandler::findRendererFor for a given drag item and invokes the rendering functions of this renderer when source rendering events occur.

### IDMSourceRenderer - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~IDMSourceRenderer

      public:
      virtual ~IDMSourceRenderer()

Supported Platforms

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

IDMSourceRenderer

  Overload 1

      public:
      IDMSourceRenderer()

  This is the default constructor.

  When this constructor is used, the renderer supports any drag item type and all of the default source RMFs supported by the Open Class Library:

  - (IDM::rmLibrary)x(IDM::rfProcess,IDM::rfText,IDM::rfSharedMem),
  - (IDM::rmDiscard,IDM::rmPrint)x(IDM::unKnown),

Supported Platforms

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

  Overload 2

      public:
      IDMSourceRenderer( const char* rmfs,
                         const char* type = IDM::any )

  rmfs
    A pointer to the RMFs string.
  type
    A pointer to the drag item types string. The default is any drag item type, IDM::any.

  Use this function to construct objects of this class by providing rendering mechanisms and formats (RMFs) and drag item types that indicate the drag items that can be rendered by this source renderer.

Supported Platforms

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

### Renderer Specifics

Use these members to process the different rendering operations that are specific to the supported rendering mechanisms and formats.

doDiscard

      protected:
      virtual bool doDiscard(IDMSourceDiscardEvent& event)

  Called when a source discard event occurs and this renderer must discard (delete) a drag item.
  Note: Default processing is to nothing and return false.

Supported Platforms

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

OS/2 Considerations

  The OS/2 Workplace Shell sends this event via the DM_DISCARDOBJECT message whenever a drop occurs on a shredder object.

doPrint

      protected:
      virtual bool doPrint(IDMSourcePrintEvent& event)

  Called when a source print event occurs and this renderer must print a drag item.
  Note: Default processing is to nothing and return false.

Supported Platforms

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

OS/2 Considerations

  The OS/2 Workplace Shell sends this event via the DM_PRINTOBJECT message whenever a drop occurs on a printer object.

doRender

      protected:
      virtual bool doRender(IDMSourceRenderEvent& event)

  Called when a source render event occurs and this renderer must use source rendering to render a drag item.

  The Open Class Library uses this function to implement the support for the rendering mechanism and format.

Supported Platforms

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

doRenderEnd

      protected:
      virtual bool doRenderEnd(IDMSourceEndEvent& event)

  Called when a source end event occurs and this renderer must end the render operation on a drag item.
  Note: Default processing is to nothing and return false.

Supported Platforms

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

doRenderPrepare

      protected:
      virtual bool doRenderPrepare(IDMSourcePrepareEvent& event)

  Called when a render prepare event occurs and this renderer must use source rendering to render a drag item.

  The Open Class Library uses this function to implement the support for the rendering mechanism and format.

Supported Platforms

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

### Source and Target Rendering

Use these members to support the implementation of source rendering. Members that you can use to support target rendering are identified on an individual basis.

Source rendering is rendering that involves both the source and target after the drop has occurred. The data for rendering is not available when the drop occurs, so the target requests that the source make the data available. The request for data is issued for each drag item using IDMSourceRenderEvent and possibly IDMSourcePrepareEvent. The source can notify the target when it has finished rendering each drag item using IDMTargetEndEvent. The target informs the source when it has finished rendering each drag item via IDMSourceEndEvent.
Note: The default source rendering support in the Open Class Library does not use IDMTargetEndEvent.

Target rendering, the optimal form of rendering, involves mainly the target after the drop has occurred. The data for rendering is available when the drop occurs. The target informs the source when it has finished rendering each drag item via IDMSourceEndEvent.

canRender

      public:
      virtual bool canRender(const IString& types)

  Returns true if the source renderer can render drag items with the specified attributes. This function is called for each drag item during source begin event processing.
  Note: This function can be used for either source or target rendering.

Supported Platforms

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

informTargetOfCompletion

      public:
      virtual IDMSourceRenderer&
        informTargetOfCompletion( IDMSourceRenderEvent& event )

  Informs the target when source rendering has completed on the drag item. It is not used by any of the default renderers supported by the Open Class Library.
  Note: This function is used for source rendering only.

Exception

  IInvalidRequest | The target could not be informed that source rendering completed. The drag transfer information is invalid.
  IAccessError | The target could not be informed that source rendering completed. Posting the target end event to the target failed.

Supported Platforms

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

sourceDiscard

      public:
      virtual IDMSourceRenderer&
        sourceDiscard( IDMSourceDiscardEvent& event )

  Called by IDMSourceHandler::sourceDiscard when the source has responsibility for discarding (deleting) the drag item.

Supported Platforms

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

sourceEnd

      public:
      virtual IDMSourceRenderer&
        sourceEnd( IDMSourceEndEvent& event )

  Called when the target informs the source that it has finished processing the data associated with the dropped item.
  Note: This function can be used for either source or target rendering.

Supported Platforms

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

sourcePrepare

      public:
      virtual IDMSourceRenderer&
        sourcePrepare( IDMSourcePrepareEvent& event )

  Called when a drag item indicates it requires preparation, which can be any activity the source needs to perform before rendering the data.

  For example, the drag item may require the source to create a secondary thread when source rendering occurs. This allows the system to remain responsive to the users.
  Note: This function is used for source rendering only.

Supported Platforms

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

sourcePrint

      public:
      virtual IDMSourceRenderer&
        sourcePrint( IDMSourcePrintEvent& event )

  Called by IDMSourceHandler::sourcePrint when the source has responsibility for printing the item.

Supported Platforms

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

sourceRender

      public:
      virtual IDMSourceRenderer&
        sourceRender( IDMSourceRenderEvent& event )

  Called when the target renderer requests that a source renderer render a drag item.
  Note: This function is used for source rendering only.

Exception

  IInvalidRequest | The source renderer could not render the item. The rendering format is invalid.
  IInvalidRequest | The source renderer could not render the item. The rendering mechanism is invalid.

Supported Platforms

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

### IDMSourceRenderer - Inherited Member Functions and Data

#### Inherited Public Functions

  IDMRenderer

  -     virtual ~IDMRenderer()

  -     static IDMSourceRenderer& defaultSourceRenderer()

  -     static IDMTargetRenderer& defaultTargetRenderer()

  -     IDMRenderer(const char* rmfs, const char* types)

  -     IDMRenderer()

  -     static void
          setDefaultSourceRenderer( IDMSourceRenderer& sourceRenderer )

  -     static void
          setDefaultTargetRenderer( IDMTargetRenderer& targetRenderer )

  -     virtual IDMRenderer& setSupportedRMFs(const char* rmfs)

  -     virtual IDMRenderer& setSupportedTypes(const char* types)

  -     virtual IString supportedRMFs() const

  -     virtual IString supportedTypes() const

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None