home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IDMSRCRN.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
138 lines
#ifndef _IDMSRCRN_
#define _IDMSRCRN_
/*******************************************************************************
* FILE NAME: idmsrcrn.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IDMSourceRenderer - Direct manipulation source renderer class. *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or *
* disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _IDMRENDR_
#include <idmrendr.hpp>
#endif
#ifndef _ISTRING_
#include <istring.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/* Forward Declarations */
struct _DRAGTRANSFER;
class IDMSourceRenderEvent;
class IDMSourcePrepareEvent;
class IDMSourceEndEvent;
class IDMSourceDiscardEvent;
class IDMSourcePrintEvent;
class IDMSourceRenderer : public IDMRenderer {
typedef IDMRenderer
Inherited;
/*******************************************************************************
* Objects of this class provide source rendering support for a direct *
* manipulation operation. Instances of this class are registered with the *
* source handler. The handler selects a "best match" renderer for a given *
* drag item and invokes the rendering functions of this renderer when source *
* rendering events occur. *
*******************************************************************************/
public:
/*------------------------ Constructors/Destructor -----------------------------
| Objects of this class are constructed in the following manner: |
| o By providing rmfs and types which indicates which drag item can be |
| rendered by this source renderer. |
| o No arguments. |
------------------------------------------------------------------------------*/
IDMSourceRenderer ( const char *rmfs, const char *type = IDM::any );
IDMSourceRenderer ( );
virtual
~IDMSourceRenderer ( );
/*--------------------------------- Testing ------------------------------------
| This function tests whether a given item can be rendered: |
| canRender - Returns true if the renderer can render items with the |
| argument attribute. Used when the drag is initiated. |
------------------------------------------------------------------------------*/
virtual Boolean
canRender ( const IString &types );
/*-------------------------------- Rendering -----------------------------------
| The following functions perform rendering operations: |
| sourceRender - Called when the target renderer requests that a source |
| renderer render an item. |
| sourcePrepare - Called when an item indicates that it requires preparation.|
| sourceEnd - Called when the target window informs the source window |
| that it has finished processing the data that was |
| associated with the dropped item. |
| sourceDiscard - Called by the IDMSourceHandler::sourceDiscard() |
| function when it was indicated that the source window has |
| responsibility for discarding the item. |
| sourcePrint - Called by the IDMSourceHandler::sourcePrint() |
| function when it was indicated that the source window has |
| responsibility for printing the item. |
------------------------------------------------------------------------------*/
virtual IDMSourceRenderer
&sourceRender ( IDMSourceRenderEvent &event ),
&sourcePrepare ( IDMSourcePrepareEvent &event ),
&sourceEnd ( IDMSourceEndEvent &event ),
&sourceDiscard ( IDMSourceDiscardEvent &event ),
&sourcePrint ( IDMSourcePrintEvent &event );
/*---------------------------- Rendering Completion ----------------------------
| The following function is called when the rendering operation is complete: |
| informTargetOfCompletion - Informs the target window that source |
| renderering has completed on the drag item. |
------------------------------------------------------------------------------*/
virtual IDMSourceRenderer
&informTargetOfCompletion ( IDMSourceRenderEvent &event );
protected:
/*------------------------------ Implementation --------------------------------
| The following functions provide utilities used to implement the IDMRenderer |
| class: |
| doRender - Called when a render event occurs and this renderer must |
| render a drag item. |
| doRenderPrepare - Called when a render prepare event occurs and this |
| renderer must render a drag item. |
| doRenderEnd - Called when an end event occurs and this renderer must |
| end the render operation. |
| doDiscard - Called when a discard event occurs and this renderer |
| must discard a drag item. |
| doPrint - Called when a print event occurs and this renderer |
| must print a drag item. |
------------------------------------------------------------------------------*/
virtual Boolean
doRender ( IDMSourceRenderEvent &event );
doRenderPrepare ( IDMSourcePrepareEvent &event ),
doRenderEnd ( IDMSourceEndEvent &event ),
doDiscard ( IDMSourceDiscardEvent &event ),
doPrint ( IDMSourcePrintEvent &event );
private: /*------------------------ PRIVATE ----------------------------------*/
_DRAGTRANSFER
*pPMDragTransfer;
}; // class IDMSourceRenderer
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif // _IDMSRCRN_