home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IEVENT.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  5KB  |  120 lines

  1. #ifndef _IEVENT_
  2.   #define _IEVENT_
  3. /*******************************************************************************
  4. * FILE NAME: ievent.hpp                                                        *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IEvent - The base event information class                                *
  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. *******************************************************************************/
  18. #ifndef _IVBASE_
  19.   #include <ivbase.hpp>
  20. #endif
  21. #ifndef _IEVTDATA_
  22.   #include <ievtdata.hpp>
  23. #endif
  24. #ifndef _IHANDLE_
  25.   #include <ihandle.hpp>
  26. #endif
  27.  
  28. /*----------------------------------------------------------------------------*/
  29. /* Align classes on four byte boundary.                                       */
  30. /*----------------------------------------------------------------------------*/
  31. #pragma pack(4)
  32.  
  33. // Forward declarations for other classes:
  34. class IWindow;
  35.  
  36. class IEvent : public IVBase {
  37. typedef IVBase
  38.   Inherited;
  39. /*******************************************************************************
  40. * The IEvent class is the base event information class.                        *
  41. *******************************************************************************/
  42. public:
  43. /*------------------------------- Constructors ---------------------------------
  44. | You can construct instances of this class in the following ways:             |
  45. |    - From an IHandle instance, an event ID, an instance of IEventParameter1, |
  46. |      and an instance of IEventParameter2.                                    |
  47. |    - From an IWindow instance, an event ID, an instance of IEventParameter1, |
  48. |      and an instance of IEventParameter2.                                    |
  49. ------------------------------------------------------------------------------*/
  50.   IEvent ( const IHandle          &handle,
  51.            unsigned long          eventId,
  52.            const IEventParameter1 ¶meter1,
  53.            const IEventParameter2 ¶meter2 );
  54.  
  55.   IEvent ( IWindow*               window,
  56.            unsigned long          eventId,
  57.            const IEventParameter1 ¶meter1,
  58.            const IEventParameter2 ¶meter2 );
  59.   IEvent ( const IEvent&          event );
  60.  ~IEvent ( );
  61.  
  62. /*-------------------------------- Accessors -----------------------------------
  63. | The following functions provide means of getting and setting the accessible  |
  64. | attributes of instances of this class:                                       |
  65. |   window     - Returns a pointer to the IWindow object to which the event    |
  66. |                has been dispatched.                                          |
  67. |   handle     - Returns the IWindowHandle object for the IWindow object to    |
  68. |                which the event has been dispatched.                          |
  69. |   eventId    - Returns the ID for the event.                                 |
  70. |   parameter1 - Returns the first event parameter.                            |
  71. |   parameter2 - Returns the second event parameter.                           |
  72. |   result     - Returns the event result.                                     |
  73. |   setResult  - Sets the event result.                                        |
  74. ------------------------------------------------------------------------------*/
  75. IWindow
  76.  *window     ( ) const;
  77.  
  78. IWindowHandle
  79.   handle     ( ) const;
  80.  
  81. unsigned long
  82.   eventId    ( ) const;
  83.  
  84. IEventParameter1
  85.   parameter1 ( ) const;
  86.  
  87. IEventParameter2
  88.   parameter2 ( ) const;
  89.  
  90. IEventResult
  91.   result     ( ) const;
  92.  
  93. IEvent
  94.  &setResult  ( const IEventResult& eventResult );
  95.  
  96. private:
  97. /*--------------------------------- Private ----------------------------------*/
  98. IHandle
  99.   hCl;
  100. unsigned long
  101.   ulClEvtId;
  102. IEventData
  103.   epCl1,
  104.   epCl2;
  105. IEventResult
  106.   erCl;
  107. }; // IEvent
  108.  
  109. /*----------------------------------------------------------------------------*/
  110. /* Resume compiler default packing.                                           */
  111. /*----------------------------------------------------------------------------*/
  112. #pragma pack()
  113.  
  114. /*----------------------------- Inline Functions -----------------------------*/
  115. #ifndef I_NO_INLINES
  116.   #include <ievent.inl>
  117. #endif
  118.  
  119. #endif /* _IEVENT_ */
  120.