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.
You can construct and destruct objects of this class.
![]() |
public:
virtual ~IDMSourceRenderer()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
IDMSourceRenderer( const char* rmfs, const char* 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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to process the different rendering operations that are specific to the supported rendering mechanisms and formats.
![]() |
protected:
virtual bool doDiscard(IDMSourceDiscardEvent& event)
Called when a source discard event occurs and this renderer
must discard (delete) a drag item.
Note:
Windows | OS/2 | AIX |
Ignored | Yes | Yes |
The OS/2 Workplace Shell sends this event via the DM_DISCARDOBJECT message whenever a drop occurs on a shredder object.
![]() |
protected:
virtual bool doPrint(IDMSourcePrintEvent& event)
Called when a source print event occurs and this renderer
must print a drag item.
Note:
Windows | OS/2 | AIX |
Ignored | Yes | Yes |
The OS/2 Workplace Shell sends this event via the DM_PRINTOBJECT message whenever a drop occurs on a printer object.
![]() |
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
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
![]() |
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:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
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:
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.
![]() |
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:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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:
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. |
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
![]() |
public:
virtual IDMSourceRenderer& sourceDiscard( IDMSourceDiscardEvent& event )
Called by IDMSourceHandler::sourceDiscard when the source has responsibility for discarding (deleting) the drag item.
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
![]() |
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:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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:
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
![]() |
public:
virtual IDMSourceRenderer& sourcePrint( IDMSourcePrintEvent& event )
Called by IDMSourceHandler::sourcePrint when the source has responsibility for printing the item.
Windows | OS/2 | AIX |
Ignored | Yes | Ignored |
![]() |
public:
virtual IDMSourceRenderer& sourceRender( IDMSourceRenderEvent& event )
Called when the target renderer requests that a source renderer
render a drag item.
Note:
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. |
Windows | OS/2 | AIX |
Yes | Yes | Ignored |
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