home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IDMSRCOP.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
139 lines
#ifndef _IDMSRCOP_
#define _IDMSRCOP_
/*******************************************************************************
* FILE NAME: idmsrcop.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IDMSourceOperation - Direct manipulation source 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 _IREFCNT_
#include <irefcnt.hpp>
#endif
#ifndef _IDMOPER_
#include <idmoper.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/* Forward Declarations */
struct _DRAGINFO;
class IDMSourceBeginEvent;
class IDMItemSeq;
class IDMImage;
class IDMSourceOperation : public IDMOperation {
typedef IDMOperation
Inherited;
typedef IDM::DragImageStyle
DragImageStyle;
/*******************************************************************************
* Objects of this class provide information about source direct manipulation *
* operations. *
* *
* Access to this information is usually gained through the following way: *
* o The IDMItem::sourceOperation() function. *
* *
* Instances of this class are not intended to be created by application *
* programmers. They are created by the source event handler class, *
* IDMSourceHandler. Typically, access is through an *
* IDMSourceOperation::Handle object. *
*******************************************************************************/
public:
/*------------------------ IDMSourceOperation::Handle --------------------------
| IDMSourceOperation::Handle provides access to the IDMSourceOperation objects |
| associated with a direct manipulation operation. Handle manages the |
| references to the IDMSourceOperation object and ensures that this object is |
| not deleted until the direct manipulation operation is completed. |
| |
| Use Handle to reference a source operation handle within this class and |
| IDMSourceOperation::Handle externally. |
| |
| Handle provides a "->" operator that enables instances to be treated just |
| like a pointer to an IDMSourceOperation object. |
------------------------------------------------------------------------------*/
typedef IReference< IDMSourceOperation > Handle;
/*------------------------- Constructors/Destructor ----------------------------
| Objects of this class are constructed by providing the following: |
| |
| o A reference to the source begin event and a drag image style. |
------------------------------------------------------------------------------*/
IDMSourceOperation ( IDMSourceBeginEvent &event,
DragImageStyle dragStyle = IDM::systemImages );
virtual
~IDMSourceOperation ( );
/*-------------------------------- Accessors -----------------------------------
| These functions provide read/write access to attributes of instances of |
| this class: |
| imageStyle - Returns the drag image style for this source |
| operation. |
| setImageStyle - Sets the drag image style for this source operation. |
| pointerOffset - Returns the position of the pointing device relative |
| to the source container object's origin. |
| setPointerOffset - Sets the position of the pointing device relative to |
| the source container object's origin. |
------------------------------------------------------------------------------*/
virtual DragImageStyle
imageStyle ( ) const;
virtual ISize
pointerOffset ( ) const;
virtual IDMSourceOperation
&setImageStyle ( DragImageStyle dragImageStyle = IDM::systemImages ),
&setPointerOffset ( const ISize &offset );
/*-------------------------------- Utilities -----------------------------------
| These functions provide various utility services used to implement this |
| class: |
| begin - Initiates the dragging of the object(s). |
| operationFrom - Retrieves a handle to the source drag operation from the |
| drag information structure. |
------------------------------------------------------------------------------*/
IDMSourceOperation
&begin ( );
static Handle
operationFrom ( _DRAGINFO *dragInformation );
protected:
private: /*------------------------ PRIVATE ----------------------------------*/
ISize
ptrOffset,
totalImgOffset;
DragImageStyle
drgImgStyle;
ISize
totalImageOffset ();
void
storeImageOffset(IDMImage *pIDMImage);
}; //class IDMSourceOperation
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif //_IDMSRCOP_