home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IDMRENDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
141 lines
#ifndef _IDMRENDR_
#define _IDMRENDR_
/*******************************************************************************
* FILE NAME: idmrendr.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IDMRenderer - Direct manipulation renderer common base class, or base *
* class. Objects of this class render items during a *
* direct manipulation operation. *
* *
* 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 _IVBASE_
#include <ivbase.hpp>
#endif
#ifndef _ISTRING_
#include <istring.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/* Forward Declarations */
class IDMRenderer : public IVBase {
typedef IVBase
Inherited;
/*******************************************************************************
* The IDMRenderer class is the common base class, or abstract class, for the *
* direct manipulation source and target renderer classes. *
* *
* Objects of this class render items during a direct manipulation operation. *
* Rendering is essentially the transfer or recreation of the dragged object *
* from the source window to the target window. *
* *
* The IDMRenderer class defines the common protocol for both source and target *
* renderers. The derived classes, IDMSourceRenderer and IDMTargetRenderer *
* define the specific protocol for source renderers and target renderers, *
* renderers, respectively. *
* *
* A generic renderer object possesses the following attributes: *
* o A set of supported types of drag items that this renderer can work with. *
* An example of a drag item type is a string. *
* o A set of supported rendering mechanisms and formats (RMFs). These *
* rendering mechanisms and formats describe the various means this *
* renderer can use to transfer the dragged object. An example of a *
* rendering mechanism is IDM::rmFile, and an example of a rendering *
* IDM::rfText (See IDMCOMM.HPP for the definitions of other RMFs). *
* *
* Two basic categories of operations can be performed on objects of this *
* class: *
* o Queries to see if the renderer can render a given item. *
* o Requests to perform one of the basic rendering processes. *
*******************************************************************************/
public:
/*------------------------ Constructor/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 renderer. |
| o No arguments. |
------------------------------------------------------------------------------*/
IDMRenderer ( const char *rmfs, const char *types );
IDMRenderer ( );
virtual
~IDMRenderer ( );
/*------------------------- Supported Types and RMFs ---------------------------
| The following functions return and set the rendering types, mechanisms, and |
| formats supported by an IDMRenderer object: |
| supportedTypes - Returns the types of items supported by the |
| renderer. |
| supportedRMFs - Returns the rendering mechanisms and formats |
| supported by this renderer. |
| setSupportedTypes - Sets the types of items supported by the |
| renderer. |
| setSupportedRMFs - Sets the rendering mechanisms and formats |
| supported by this renderer. |
------------------------------------------------------------------------------*/
virtual IString
supportedTypes ( ) const,
supportedRMFs ( ) const;
virtual IDMRenderer
&setSupportedTypes ( const char *types ),
&setSupportedRMFs ( const char *rmfs );
/*---------------------------- Default Renderers -------------------------------
| These functions maintain default source/target renderers that are added |
| automatically to newly created source/target handlers: |
| defaultSourceRenderer - Returns the default source renderer; an |
| instance of class IDMSourceRenderer unless |
| the default has been set otherwise. |
| setDefaultSourceRenderer - Sets the default source renderer. |
| defaultTargetRenderer - Returns the default target renderer; an |
| instance of class IDMTargetRenderer unless |
| the default has been set otherwise. |
| setDefaultTargetRenderer - Sets the default target renderer. |
------------------------------------------------------------------------------*/
static IDMSourceRenderer
&defaultSourceRenderer ( );
static IDMTargetRenderer
&defaultTargetRenderer ( );
static void
setDefaultSourceRenderer ( IDMSourceRenderer &sourceRenderer ),
setDefaultTargetRenderer ( IDMTargetRenderer &targetRenderer );
protected:
private: /*------------------------ PRIVATE ----------------------------------*/
IString
strTypes,
strRMFs;
static IDMSourceRenderer
*pSource;
static IDMTargetRenderer
*pTarget;
}; // class IDMRenderer
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif // _IDMRENDR_