home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / cppbeta / ibmcli / ievtparm.hp_ / IEVTPARM.HPP
Encoding:
C/C++ Source or Header  |  1992-10-26  |  5.8 KB  |  113 lines

  1. #ifndef _IEVTPARM_
  2. #define _IEVTPARM_
  3. /*******************************************************************************
  4. * FILE NAME: ievtparm.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IEventParam - this class encapsulates the message parameter (MPARAM)     *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *$Log:   R:/IBMCLASS/IBASEAPP/VCS/IEVTPARM.HPV  $                                                                         *
  18. // 
  19. //    Rev 1.4   25 Oct 1992 17:59:58   nunn
  20. // Brad Broyles changes for external beta
  21.  
  22.       Rev 1.1   25 Jul 1992 12:00:00   KKL
  23.    Init. design/code
  24.       Rev 1.2   22 Oct 1992 11:00:00   WBB
  25.    Amending to match skeleton.hpp
  26. *******************************************************************************/
  27.  
  28. // Forward declarations for other classes:
  29. class IEventParam;
  30. class IPoint;
  31. #if !defined( _IHANDLE_ ) && !defined( I_NO_RELATED_HPP )
  32.   #include <ihandle.hpp>
  33. #endif
  34.  
  35. class IEventParam {
  36. /*******************************************************************************
  37. * The IEventParam class is used to encapsulate the message parameter (MPARAM)  *
  38. *******************************************************************************/
  39. public:
  40. /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
  41. | There are 7 ways to construct instances of this class:                       |
  42. |   1. default                                                                 |
  43. |     pvClMsg is set to zero                                                   |
  44. |   2. from a pointer to void                                                  |
  45. |     pvClMsg is set to the void pointer                                       |
  46. |   3. from an instance of IHandle                                             |
  47. |     pvClMsg is set to the handle                                             |
  48. |   4. from an unsigned long value                                             |
  49. |     pvClMsg is set to the value of the unsigned long                         |
  50. |   5. from two unsigned long values                                           |
  51. |     pvClMsg is set with two short values obtained from the unsigned longs    |
  52. |   6. from one unsigned long and two unsigned short values                    |
  53. |     pvClMsg is set with the long value and two shorts combined to make a long|
  54. |   7. from another instance of IEventParam                                    |
  55. |     the values of the IEventParam are copied into the new instance           |
  56. ------------------------------------------------------------------------------*/
  57.   IEventParam();
  58.   IEventParam(void* pv);
  59.   IEventParam(IHandle hw);
  60.   IEventParam(unsigned long ul);
  61.   IEventParam(unsigned long ul1, unsigned long ul2);
  62.   IEventParam(unsigned long u1, unsigned char uch1, unsigned char uch2);
  63.   IEventParam(const IEventParam& epCopy);
  64.  
  65. /*-------------------------------- ACCESSORS -----------------------------------
  66. | These function provide means of getting and setting the accessible           |
  67. | attributes of instances of this class:                                       |
  68. |   number1 - returns the lower two bytes of the IEventParam                   |
  69. |   number2 - returns the upper two bytes of the IEventParam                   |
  70. |   char1 - returns the lowest byte of the IEventParam                         |
  71. |   char2 - returns the second-lowest byte of the IEventParam                  |
  72. |   char3 - returns the second-highest byte of the IEventParam                 |
  73. |   char4 - returns the highest byte of the IEventParam                        |
  74. ------------------------------------------------------------------------------*/
  75. unsigned long
  76.   number1() const,
  77.   number2() const;
  78. unsigned char
  79.   char1() const,
  80.   char2() const,
  81.   char3() const,
  82.   char4() const;
  83.  
  84. /*-------------------------------- OVERRIDES -----------------------------------
  85. | This class overrides the following inherited functions:                      |
  86. |   = - assignment operator                                                    |
  87. |   void* - cast operator to void pointer                                      |
  88. |   char* - cast operator to char pointer                                      |
  89. |   IPoint - extract IPoint from IEventParam                                   |
  90. |   unsigned long - extract unsigned long from IEventParam                     |
  91. |   IHandle - extract IHandle from IEventParam                                 |
  92. ------------------------------------------------------------------------------*/
  93. IEventParam&
  94.   operator=(const IEventParam& ep);
  95.   operator void*() const;
  96.   operator char*() const;
  97.   operator IPoint() const;
  98.   operator unsigned long() const;
  99.   operator IHandle() const;
  100.  
  101. private:
  102. /*--------------------------------- PRIVATE ----------------------------------*/
  103. void*
  104.   pvClMsg;
  105. }; // IEventParam
  106.  
  107. /*--------------------------------- INLINES ----------------------------------*/
  108. #ifndef I_NO_INLINES
  109.   #include <ievtparm.inl>
  110. #endif
  111.  
  112. #endif /*_IEVTPARM_ */
  113.