home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ihandler.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  2.6 KB  |  76 lines

  1. #ifndef _IHANDLER_
  2. #define _IHANDLER_
  3. /*******************************************************************************
  4. * FILE NAME: ihandler.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IHandler                                                                 *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - 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. #include <ivbase.hpp>
  19. #include <ievent.hpp>
  20.  
  21. class IString;
  22. class IWindow;
  23.  
  24. #pragma pack(4)
  25.  
  26. class IHandler : public IVBase {
  27. typedef IVBase
  28.   Inherited;
  29. public:
  30. /*------------------------------- Constructors -------------------------------*/
  31.   IHandler ( );
  32. virtual
  33.  ~IHandler ( );
  34.  
  35. /*--------------------- Enabling and Disabling Handlers ----------------------*/
  36. virtual IHandler
  37.  &enable    ( Boolean enable = true ),
  38.  &disable   ( );
  39.  
  40. Boolean
  41.   isEnabled ( ) const;
  42.  
  43. /*---------------------------- Event Dispatching -----------------------------*/
  44. virtual IHandler
  45.  &handleEventsFor       ( IWindow* window ),
  46.  &stopHandlingEventsFor ( IWindow* window );
  47.  
  48. /*------------------------------- Diagnostics --------------------------------*/
  49. virtual IString
  50.   asString    ( ) const,
  51.   asDebugInfo ( ) const;
  52.  
  53. protected:
  54. /*---------------------------- Event Dispatching -----------------------------*/
  55. virtual Boolean
  56.   dispatchHandlerEvent ( IEvent& event ) = 0;
  57.  
  58. /*----------------------------- Event Processing -----------------------------*/
  59. virtual IEventResult
  60.   defaultProcedure ( IEvent& event );
  61.  
  62. private:
  63. /*--------------------------------- Private ----------------------------------*/
  64. friend IWindow;
  65. Boolean
  66.   active;
  67. unsigned
  68.   numWindows;
  69. }; // IHandler
  70.  
  71. #pragma pack()
  72.  
  73.   #include <ihandler.inl>
  74.  
  75. #endif /* _IHANDLER_ */
  76.