home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IDMTGTOP.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
9KB
|
168 lines
#ifndef _IDMTGTOP_
#define _IDMTGTOP_
/*******************************************************************************
* FILE NAME: idmtgtop.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IDMTargetOperation - Direct manipulation target operation 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 _IDMOPER_
#include <idmoper.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/* Forward Declarations */
class IContainerControl;
class IDMItemSeq;
class IDMImage;
class IDMTargetOperation : public IDMOperation {
typedef IDMOperation
Inherited;
typedef IDM::DropStyle
DropStyle;
/*******************************************************************************
* Objects of this class provide information about direct manipulation target *
* operations. *
* *
* Access to this information is usually gained through the static *
* targetOperation() function. *
* *
* Instances of this class are not intended to be created by application *
* programmers. They are created by the source event handler class, *
* IDMTargetHandler. Typically, access to the IDMTargetOperation class is *
* through an IDMTargetOperation::Handle object. *
*******************************************************************************/
public:
/*------------------------ IDMTargetOperation::Handle --------------------------
| IDMTargetOperation::Handle provides access to the IDMTargetOperation objects |
| associated with a direct manipulation operation. Handle manages the |
| references to the IDMTargetOperation object and ensures that this object is |
| not deleted until the direct manipulation operation is completed. |
| |
| Use Handle to reference a target operation handle within this class and |
| IDMTargetOperation::Handle externally. |
| |
| The handle provides a "->" operator that enables instances to be treated |
| just like pointers to an IDMTargetOperation object. |
------------------------------------------------------------------------------*/
typedef IReference< IDMTargetOperation > Handle;
/*------------------------- Constructors/Destructor ----------------------------
| Objects of this class are constructed by providing one of the following |
| items: |
| o A reference to the target enter event. |
------------------------------------------------------------------------------*/
IDMTargetOperation ( IDMTargetEnterEvent &event );
virtual
~IDMTargetOperation ( );
/*-------------------------------- Utilities -----------------------------------
| The following functions provide various utility services used to implement |
| this class: |
| instanceFor - Returns an IDMTargetOperation object |
| targetOperation - Returns an IDMTargetOperation object handle that was |
| created during the target enter event |
| setTargetOperation - Sets an IDMTargetOperation object handle during the |
| target enter event |
------------------------------------------------------------------------------*/
static IDMTargetOperation::Handle
instanceFor ( IDMTargetEnterEvent &event );
static IDMTargetOperation::Handle
targetOperation ( );
static void
setTargetOperation ( IDMTargetOperation::Handle tgtOperation );
/*------------------------------ Container Support ----------------------------+
| These functions provide a means of getting and setting container specific |
| attributes of instances of this class: |
| wasDragAfter - Returns the state of the latest drag-over or |
| drag-after notification. |
| isStyle - Queries whether a specified style flag is set. |
| setDropOffset - Sets the current drop offset. |
| setContainerNoRefresh - Sets the given container to no-refresh. |
| When drop processing returns, refresh is turned |
| on again. |
| setContainerRefresh - Forces the no-refresh containers to refresh. |
| setStyle - Sets the drop style. |
| dropOffset - Queries the current drop offset. |
| style - Returns the drop style. |
| dropPosition - Computes the drop position for this item, in |
| container workspace coordinates, and sets the |
| offset for the next item, according to the |
| handler's drop style. |
| positionRelativeTo - Returns a drag item's position relative to the |
| target container. If the item pointer is 0, the |
| drop point relative to the container is returned. |
+-----------------------------------------------------------------------------*/
Boolean
wasDragAfter ( ) const,
isStyle ( DropStyle dropStyle );
IDMTargetOperation
&setDropOffset ( const ISize &newPointerOffset ),
&setContainerNoRefresh ( IContainerControl *noRefresh ),
&setContainerRefresh ( ),
&setStyle ( DropStyle dropStyle );
ISize
dropOffset ( ) const;
DropStyle
style ( ) const;
IPoint
dropPosition ( const IDMItem::Handle &dragItem,
IDMTargetDropEvent &event ),
positionRelativeTo ( const IDMItem::Handle &pItem,
IDMTargetDropEvent &event );
protected:
private: /*------------------------ PRIVATE ----------------------------------*/
friend class IDMTargetHandler;
static IDMTargetOperation::Handle
pDMTgtOpHandle;
Boolean
bWasDragAfter,
bNotDragLeave,
bDrop;
ISize
sizeDropOffset;
DropStyle
dropStyle;
IContainerControl
*pCnrNoRefresh1,
*pCnrNoRefresh2;
}; //class IDMTargetOperation
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif //_IDMTGTOP_