home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IDMTGTRN.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
156 lines
#ifndef _IDMTGTRN_
#define _IDMTGTRN_
/*******************************************************************************
* FILE NAME: idmtgtrn.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IDMTargetRenderer - Direct manipulation target 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 _IDMCOMM_
#include <idmcomm.hpp>
#endif
#ifndef _IDMRENDR_
#include <idmrendr.hpp>
#endif
#ifndef _IDMITEM_
#include <idmitem.hpp>
#endif
#ifndef _ISTRING_
#include <istring.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/* Forward Declarations */
struct _DRAGTRANSFER;
class IDMTargetDropEvent;
class IDMTargetEndEvent;
class IDMTargetRenderer : public IDMRenderer {
typedef IDMRenderer
Inherited;
typedef IDM::DropIndicator
DropIndicator;
/*******************************************************************************
* Objects of this class provide target rendering support for a direct *
* manipulation operation. Instances of this class are registered with the *
* target handler. The handler selects a "best match" renderer for a given *
* drag item and invokes the rendering functions of this renderer when source *
* or target 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 target renderer. |
| o No arguments. |
------------------------------------------------------------------------------*/
IDMTargetRenderer ( const char *rmfs, const char *type = IDM::any );
IDMTargetRenderer ( );
virtual
~IDMTargetRenderer ( );
/*--------------------------------- Testing ------------------------------------
| The following functions test whether a given item can be rendered: |
| canRender - Returns a drop indicator with the renderer's ability to |
| render the item with the argument attributes. |
------------------------------------------------------------------------------*/
virtual DropIndicator
canRender ( const IDMItem::Handle &dragItem );
/*---------------------------- Operation Specific ------------------------------
| The following function selects the appropriate operation: |
| supportsOperation - Returns true if the default operation (for example, |
| move, copy, or link) is supported by the item. |
------------------------------------------------------------------------------*/
virtual Boolean
supportsOperation ( const IDMItem::Handle &dragItem );
/*-------------------------------- Rendering -----------------------------------
| The following functions are called to perform rendering operations: |
| targetRender - Called when a drop event occurs for a drag |
| item and this renderer must render the item. |
| targetRenderPrepare - Called when the source window requests that the |
| target window generate a preparation event. |
| targetRenderComplete - Called when a completion event occurs and this |
| renderer must render a drag item. |
| informSourceOfCompletion - Informs the source window that the target |
| window has finished processing the data |
| associated with the dropped item. The source |
| window is informed for both source and target |
| rendering. |
------------------------------------------------------------------------------*/
virtual IDMTargetRenderer
&targetRender ( IDMTargetDropEvent &event,
const IDMItem::Handle &dragItem ),
&targetRenderPrepare ( IDMTargetDropEvent &event,
const IDMItem::Handle &dragItem ),
&targetRenderComplete ( IDMTargetEndEvent &event ),
&informSourceOfCompletion ( const IDMItem::Handle &dragItem );
protected:
/*------------------------------ Implementation --------------------------------
| The following functions provide utilities used to implement this class: |
| renderAtSource - Sends a render event to the source window to request |
| source rendering for the argument item. |
| prepareAtSource - Sends a prepare event to the source window to request|
| source preparation for the argument item. |
| renderComplete - Called to process a completion event for a drag item.|
| renderToName - Called to provide the name of the location where the |
| data will be renderer to. This name can be a |
| filename, shared memory buffer, etc. |
------------------------------------------------------------------------------*/
virtual Boolean
renderAtSource ( IDMTargetDropEvent &event,
const IDMItem::Handle &dragItem ),
prepareAtSource ( IDMTargetDropEvent &event,
const IDMItem::Handle &dragItem ),
renderComplete ( const IDMItem::Handle &dragItem, void* pBuffer );
virtual IString
renderToName ( const IDMItem::Handle &dragItem );
private: /*------------------------ PRIVATE ----------------------------------*/
_DRAGTRANSFER
*pPMDragTransfer;
_DRAGTRANSFER
*allocDragTransfer (IDMTargetDropEvent &dropEvent,
const IDMItem::Handle &pDI);
_DRAGTRANSFER
*dragTransfer () const;
}; // class IDMTargetRenderer
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif // _IDMTGTRN_