home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IEVTDATA.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
9KB
|
163 lines
#ifndef _IEVTDATA_
#define _IEVTDATA_
/*******************************************************************************
* FILE NAME: ievtdata.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IEventData - The objects used as parameters and results of messages *
* *
* 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 _IBASE_
#include <ibase.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IEventData : public IBase {
typedef IBase
Inherited;
/*******************************************************************************
* The IEventData class is used to encapsulate the message parameter (MPARAM) *
* and message result (MRESULT) data of an event. *
* *
* The following classes are aliases for the IEventData class: *
* - IEventParameter1 *
* - IEventParameter2 *
* - IEventResult *
* - IHighEventParameter *
* - ILowEventParameter *
*******************************************************************************/
public:
/*------------------------------- Constructors ---------------------------------
| You can construct instances of this class in the following ways: |
| - Using the default constructor. The event data is set to 0. |
| - From a pointer to void. The event data is set to the specified void |
| pointer. |
| - From an unsigned long value. The event data is set to the specified |
| unsigned long number. |
| - From an integer. The event data is set to the specified integer. |
| This constructor accepts an uncasted value of 0. |
| - From two unsigned short integer values. The event data is set to an |
| unsigned long value whose two words are the the two specified |
| unsigned short numbers. |
| - From one unsigned short integer and two characters. The event data |
| is set to an unsigned long value whose two words are the unsigned |
| short integer number in the low word, and the two characters in the |
| high word. |
------------------------------------------------------------------------------*/
IEventData ( );
IEventData ( void* value );
IEventData ( unsigned long value );
IEventData ( int value );
IEventData ( unsigned short lowValue,
unsigned short hiValue );
IEventData ( unsigned short lowValue,
char lowByte,
char hiByte );
/*-------------------------------- Accessors -----------------------------------
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| lowNumber - Returns the lower value of the event data that contain |
| two unsigned short values. This is equivalent to the |
| low word of the event data, and is the same as the |
| number1 function. |
| highNumber - Returns the high value of the event data that contain |
| two unsigned short values. This is equivalent to the |
| high word of the event data, and is the same as the |
| number2 function. |
| number1 - Returns the lower value of the event data that contain |
| two unsigned short values. This is equivalent to the |
| low word of the event data, and is the same as the |
| lowNumber function. |
| number2 - Returns the high value of the event data that contain |
| two unsigned short values. This is equivalent to the |
| high word of the event data, and is the same as the |
| highNumber function. |
| lowLowByte - Returns the character in the low byte of the low word |
| of the event data, the same as the char1 function. |
| lowHighByte - Returns the character in the high byte of the low word |
| of the event data, the same as the char2 function. |
| highLowByte - Returns the character in the low byte of the high word |
| of the event data, the same as the char3 function. |
| highHighByte - Returns the character in the high byte of the high word |
| of the event data, the same as the char3 function. |
| char1 - Returns the character in the low byte of the low word |
| of the event data, the same as the lowLowByte function. |
| char2 - Returns the character in the high byte of the low word |
| of the event data, the same as the lowHighByte function. |
| char3 - Returns the character in the low byte of the high word |
| of the event data, the same as the highLowByte function. |
| char4 - Returns the character in the high byte of the high word |
| of the event data, the same as the highHighByte function. |
| asUnsignedLong - Returns the unsigned long event data value. |
------------------------------------------------------------------------------*/
unsigned short
lowNumber ( ) const,
highNumber ( ) const,
number1 ( ) const,
number2 ( ) const;
char
lowLowByte ( ) const,
lowHighByte ( ) const,
highLowByte ( ) const,
highHighByte ( ) const,
char1 ( ) const,
char2 ( ) const,
char3 ( ) const,
char4 ( ) const;
unsigned long
asUnsignedLong ( ) const;
/*-------------------------------- Conversion ----------------------------------
| This class provides the following data conversion operators: |
| operator char* - Returns the event data as a pointer to a |
| character. |
| operator unsigned long - Returns the event data as an unsigned long |
| number. |
------------------------------------------------------------------------------*/
operator char* ( ) const;
operator unsigned long ( ) const;
private:
/*--------------------------------- Private ----------------------------------*/
void*
pvClMsg;
}; // IEventData
typedef IEventData IEventParameter1;
typedef IEventData IEventParameter2;
typedef IEventData ILowEventParameter;
typedef IEventData IHighEventParameter;
typedef IEventData IEventResult;
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
/*----------------------------- Inline Functions -----------------------------*/
#ifndef I_NO_INLINES
#include <ievtdata.inl>
#endif
#endif /* _IEVTDATA_ */