home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
uicldd.zip
/
IDMCNRIT.HPP
< prev
next >
Wrap
Text File
|
1993-09-04
|
12KB
|
227 lines
#ifndef _IDMCNRIT_
#define _IDMCNRIT_
/*******************************************************************************
* FILE NAME: idmcnrit.hpp *
* *
* DESCRIPTION: *
* This file contains the definition of the classes: *
* IDMCnrItem - Container direct manipulation "item" class. *
* IDMCnrItemHandle - Handle to manage references to IDMCnrItem objects. *
* *
* *
* 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. *
* *
* $Log: M:/ibmclass/idrag/vcs/idmcnrit.hpv $ *
//
// Rev 1.2 04 Sep 1993 14:00:08 banzai
//Container DM LIVES!
//
// Rev 1.1 03 Sep 1993 20:08:34 banzai
//Container related changes
//
// Rev 1.0 02 Sep 1993 20:30:28 banzai
//Initial Drop
//
*******************************************************************************/
#ifndef _IDMITEM_
#include <idmitem.hpp>
#endif
#ifndef _ICNRCTL_
#include <icnrctl.hpp>
#endif
#ifndef _ICNROBJ_
#include <icnrobj.hpp>
#endif
/* Forward Declarations */
struct _DRAGITEM;
class IDMSrcOperationHandle;
class IDMTgtOperationHandle;
class IDMCnrTargetHandler;
class IDMCnrDropEvent;
class IDMCnrItem : public IDMItem {
typedef IDMItem
Inherited;
/*******************************************************************************
* Objects of this class are created by containers when a direct manipulation *
* operation commences in a source container and during a direct manipulation *
* operation when a container object is dragged over a potential target *
* container. *
* *
* Objects of this class possess the following attributes (in addition to *
* those inherited from its base class): *
* o Generic buffer (contents) to hold IContainerObject(s) *
* o association with a source or target drag operation object (see *
* IDMSourceOperation or IDMTargetOperation) *
* o association(s) with derived source or target renderer object(s) capable *
* of renderering container objects (see IDMCnrSrcRenderer or *
* IDMCnrTgtRenderer) which are created by the source or handler (see *
* IDMSourceHandler or IDMTargetHandler) *
* *
* This class provides virtual functions that implement support for direct *
* manipulation (i.e. drag drop) container object items. Derived classes *
* can be created to support more specific container object items. *
*******************************************************************************/
public:
/*------------------------- Constructors/Destructor ----------------------------
| Objects of this class are constructed in the following manner: |
| o By providing pointers to the container control and object, |
| the drag source operation handle, types, supported operations |
| and attributes. |
| o By providing a generic drag item reference. |
| o By providing a generic drag item reference and a pointer to the target |
| handler. |
------------------------------------------------------------------------------*/
IDMCnrItem ( IContainerControl *container,
IContainerObject *object,
const IDMSrcOperationHandle &sourceOperation,
const IString &types,
unsigned short supportedOperations = unknown,
unsigned short attributes = none);
IDMCnrItem ( const IDMItem &dragItem );
IDMCnrItem ( const IDMItem &dragItem,
IDMCnrTargetHandler *handler );
virtual
~IDMCnrItem ( );
/*------------------------------ Source Items ----------------------------------
| This function generates source items: |
| generateCnrSourceItems - Generates container object items based upon |
| selected object(s) in the source container. |
------------------------------------------------------------------------------*/
static Boolean
generateCnrSourceItems ( const IDMSrcOperationHandle &sourceOperation,
IContainerControl *container,
IContainerObject *containerObject,
const ISize &sizeOffset );
/*------------------------------ Source Rendering ------------------------------
| This function reads data from source window: |
| renderPrepare - Acquires object data from container and stores in |
| container item. |
------------------------------------------------------------------------------*/
//virtual Boolean
// renderPrepare ( IDMSourcePrepareEvent &event );
/*--------------------------------- Accessors ---------------------------------+
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| containerId - Returns the source container's ID. |
| object - Returns the container object. |
| sourceContainer - Returns the source container. |
+-----------------------------------------------------------------------------*/
unsigned long
containerId ( ) const;
IContainerObject
*object ( ) const;
IContainerControl
*sourceContainer ( ) const;
/*------------------------------- Implementation ------------------------------+
| This function facilitates re-usable means of creating container drag items |
| to support the multiple selection logic within containers: |
| createItem - Creates container drag item. |
| cnrTargetHandler - Returns pointer to the container's target handler. |
| setCnrTargetHandler - Sets pointer to the container's target handler. |
+-----------------------------------------------------------------------------*/
static IDMCnrItem
*createItem ( const IDMSrcOperationHandle &sourceOperation,
IContainerControl *container,
IContainerObject *containerObject,
const ISize &sizeOffset );
IDMCnrTargetHandler
*cnrTargetHandler ( ) const;
IDMCnrItem
&setCnrTargetHandler ( IDMCnrTargetHandler *handler );
/*------------------------------ Drop Processing -------------------------------
| This function writes data to the target window: |
| cnrDropped - Sets container object into target container. |
------------------------------------------------------------------------------*/
virtual Boolean
cnrDropped ( IWindow *containerControl, IDMCnrDropEvent &event );
protected:
/*--------------------------------- Accessors ---------------------------------+
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| setObject - Sets the container object. |
+-----------------------------------------------------------------------------*/
IDMCnrItem
&setObject ( IContainerObject *cnrObject );
/*----------------------- Rendering Mechanisms/Formats -----------------------
| This function provides means for setting the "RMF" of the drag item: |
| buildRMF - Builds a rendering mechanism and format (RMF) string. |
------------------------------------------------------------------------------*/
IString
buildRMF ( const IString &mechanism, const IString &format );
private: /*------------------------ PRIVATE ----------------------------------*/
IContainerControl
*pContainerCtl;
IContainerObject
*pContainerObj;
IDMCnrTargetHandler
*pCnrTgtHnd;
}; // IDMCnrItem
class IDMCnrItemHandle : public IReference< IDMCnrItem > {
/*******************************************************************************
* Objects of this class provide access to IDMCnrItem objects *
* associated with a direct manipulation event. This "handle" class manages *
* references to the IDMCnrItem object to ensure that it is not *
* deleted until the drag operation is completed. *
* *
* This class provides a "->" operator that enables instances to be treated *
* just like a pointer to an IDMCnrItem object. *
* *
* Example: *
* *
* This class has no members. It is essentially a synonym for the type *
* IReference< IDMCnrItem >. *
*******************************************************************************/
public:
IDMCnrItemHandle ( IDMCnrItem *containerItem );
~IDMCnrItemHandle ( );
/*--------------------------------- Operators ---------------------------------+
| Operators defined for IDMCnrItemHandle: |
| = - Overload definition to handle assignments of container item pointers |
| to container drag item handles. |
+-----------------------------------------------------------------------------*/
IDMCnrItemHandle
&operator = ( IDMCnrItem *containerItem );
}; // IDMCnrItemHandle
/*--------------------------------- INLINES ----------------------------------*/
#ifndef I_NO_INLINES
#include <idmcnrit.inl>
#endif
#endif // _IDMCNRIT_