home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IEVTRES_
- #define _IEVTRES_
- /*******************************************************************************
- * FILE NAME: ievtres.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IEventResult - encapsulates the OS/2 MRESULT parameter *
- * IUnsignedLongResult - event result from ULONG *
- * IPairResult - event result from IPair *
- * IPointResult - event result from IPoint *
- * ISizeResult - event result from ISize *
- * IBooleanResult - event result from IBoolean *
- * *
- * 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: R:/IBMCLASS/IBASEAPP/VCS/IEVTRES.HPV $
- //
- // Rev 1.2 25 Oct 1992 18:00:08 nunn
- // Brad Broyles changes for external beta
-
- Rev 1.1 17 Jul 1992 12:00:00 KKL
- New design
- Rev 1.2 21 Oct 1992 17:00:00 WBB
- Amending to match SKELETON.HPP
- *******************************************************************************/
-
- //Forward declarations for other classes:
- class IEventResult;
- class IUnsignedLongResult;
- class ISizeResult;
- class IPointResult;
- class ISizeResult;
- class IPair;
- class IPoint;
- class ISize;
- #if !defined( _IHANDLE_ ) && !defined( I_NO_RELATED_HPP )
- #include <ihandle.hpp>
- #endif
-
- class IEventResult {
- /*******************************************************************************
- * The class IEventResult encapsulates the OS/2 MRESULT parameter *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 7 ways to construct instances of this class: |
- | 1. default |
- | pvClRes is set to null (zero) |
- | 2. using a pointer to void |
- | pvClRes is set to the void pointer |
- | 3. using an unsigned long value |
- | pvClRes is set to the unsigned long value |
- | 4. using a window handle |
- | pvClRes is set to the window handle |
- | 5. using a message queue handle |
- | pvClRes is set to the message queue handle |
- | 6. using two unsigned long values |
- | the two long values are changed to ushorts and stored in pvClRes |
- | 7. using another instance of IEventResult |
- | the value of pvClRes is copied from the provided instance |
- ------------------------------------------------------------------------------*/
- IEventResult ( );
- IEventResult ( void* pv );
- IEventResult ( unsigned long ul );
- IEventResult ( IWindowHandle hw );
- IEventResult ( IMsgQueueHandle mqh );
- IEventResult ( unsigned long us1,
- unsigned long us2 );
- IEventResult ( const IEventResult& erCopy );
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | number1() - returns the first ULONG in the IEventResult |
- | number2() - returns the second ULONG in the IEventResult |
- ------------------------------------------------------------------------------*/
- unsigned long
- number1() const,
- number2() const;
-
- /*-------------------------------- OVERRIDES -----------------------------------
- | This class overrides the following inherited functions: |
- | = - overridden to allow setting one IEventResult equal to another |
- | void* - overridding cast operator |
- | unsigned long - extract unsigned long from IEventResult |
- | IWindowHandle - extract IWindowHandle from IEventResult |
- | IMsgQueueHandle - extract IMsqQueueHandle from IEventResult |
- ------------------------------------------------------------------------------*/
- IEventResult&
- operator=(const IEventResult& er);
- operator void*() const;
- operator unsigned long() const;
- operator IWindowHandle() const;
- operator IMsgQueueHandle() const;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- void*
- pvClRes;
- };
-
- /*--------------------------------- INLINES ----------------------------------*/
- #ifndef I_NO_INLINES
- #include <ievtres.inl>
- #endif
-
- class IUnsignedLongResult : public IEventResult {
- /*******************************************************************************
- * The class IUnsignedLongResult provides a class for using an unsigned long *
- * as an event result. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from an unsigned long value |
- | an IEventResult is created from the unsigned long value |
- ------------------------------------------------------------------------------*/
- IUnsignedLongResult(unsigned long ul) : IEventResult(ul) {;}
- };
-
- class IPairResult : public IEventResult {
- /*******************************************************************************
- * The class IPairResult provides a class for using an instance of IPair as an *
- * event result. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from an instance of IPair |
- | the two parts of the IPair are used to create an IEventResult |
- ------------------------------------------------------------------------------*/
- IPairResult(const IPair& pair);
- };
-
- class IPointResult : public IEventResult {
- /*******************************************************************************
- * The class IPointResult provides a class for using an instance of IPoint as *
- * an event result. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from an instance of IPoint |
- | the two parts of the IPoint are used to create an IEventResult |
- ------------------------------------------------------------------------------*/
- IPointResult(const IPoint& pt);
- };
-
- class ISizeResult : public IEventResult {
- /*******************************************************************************
- * The class ISizeResult provides a class for using an instance of ISize as *
- * an event result. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from an instance of ISize |
- | the x and y components of ISize are used to create an IEventResult |
- ------------------------------------------------------------------------------*/
- ISizeResult(const ISize& pt);
- };
-
- class IBooleanResult : public IEventResult {
- /*******************************************************************************
- * The class IBooleanResult provides a class for using an instance of Boolean *
- * as an event restult. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is one way to construct instances of this class: |
- | 1. from an instance of Boolean |
- | the Boolean's value is used to create an instance of IEventResult |
- ------------------------------------------------------------------------------*/
- IBooleanResult(Boolean b) : IEventResult((unsigned long) b) {;}
- };
-
- #endif /*_IEVTRES_ */