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

  1. #ifndef _IHANDLER_
  2.   #define _IHANDLER_
  3. /**************************************************************/
  4. /* CLASS NAME:  IHandler                                      */
  5. /*                                                            */
  6. /* DESCRIPTION  : This is the base handler class.             */
  7. /*                                                            */
  8. /* Hungarian is h                                             */
  9. /*                                                            */
  10. /* CHANGE ACTIVITY:                                           */
  11. /*   DATE:     INITIAL:        DESCRIPTION                    */
  12. /*                                                            */
  13. /*   080892    Kevin Leong     Design/code                    */
  14. /*                                                            */
  15. /**************************************************************/
  16. /* Copyright (c) IBM Corporation 1991                         */
  17. /**************************************************************/
  18. class IHandler;
  19. class IEvent;
  20. class IString;
  21. #ifndef _IVBASE_
  22.   #include <ivbase.hpp>
  23. #endif
  24. #ifndef _IEVENT_
  25.   #include <ievent.hpp>
  26. #endif
  27.  
  28. class IHandler : public IVBase
  29. {
  30.   typedef IVBase Inherited;
  31.   public:
  32.     IHandler();
  33.     virtual Boolean dispatchHandlerEvent(IEvent& evt) = 0;
  34.     void enable();
  35.     void disable();
  36.     Boolean isEnabled() const;
  37.  
  38.     virtual IString dump();
  39.  
  40.   private:
  41.     Boolean bEnabled;
  42. };
  43.  
  44. inline IHandler::IHandler()
  45. /**************************************************************/
  46. /* Constructor.                                               */
  47. /**************************************************************/
  48.  : bEnabled(true)
  49. {;}
  50.  
  51. inline void IHandler::enable()
  52. /**************************************************************/
  53. /* Disable this SHandler.                                     */
  54. /**************************************************************/
  55. { bEnabled = true; }
  56.  
  57. inline void IHandler::disable()
  58. /**************************************************************/
  59. /* Disable this SHandler.                                     */
  60. /**************************************************************/
  61. { bEnabled = false; }
  62.  
  63. inline Boolean IHandler::isEnabled() const
  64. /**************************************************************/
  65. /* Is this SHandler enabled?                                  */
  66. /**************************************************************/
  67. { return bEnabled; }
  68. #endif /* IHANDLER */
  69.