home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / HELLO6 / ATIMEHDR.HPP < prev    next >
C/C++ Source or Header  |  1995-04-07  |  5KB  |  64 lines

  1. #ifndef _ATIMEHDR_
  2. #define _ATIMEHDR_
  3. /*****************************************************************************
  4. * TIME HANDLER SAMPLE PROGRAM - Version 6: Class Header (atimehdr.hpp)       *
  5. *                                                                            *
  6. * COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1995. *
  7. *                                                                            *
  8. * DISCLAIMER OF WARRANTIES:                                                  *
  9. *   The following [enclosed] code is sample code created by IBM              *
  10. *   Corporation.  This sample code is not part of any standard IBM product   *
  11. *   and is provided to you solely for the purpose of assisting you in the    *
  12. *   development of your applications.  The code is provided "AS IS",         *
  13. *   without warranty of any kind.  IBM shall not be liable for any damages   *
  14. *   arising out of your use of the sample code, even if they have been       *
  15. *   advised of the possibility of such damages.                              *
  16. *****************************************************************************/
  17. //NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
  18.  
  19. #ifndef _IHANDLER_                                                          //V6
  20.   #include <ihandler.hpp>               //Include IHandler class header       V6
  21. #endif                                                                      //V6
  22.  
  23. /**************************************************************************   V6
  24. * Class:   ATimeHandler                                                   *   V6
  25. *                                                                         *   V6
  26. * Purpose: New Handler class that processes timer events.                 *   V6
  27. *                                                                         *   V6
  28. **************************************************************************/ //V6
  29. class ATimeHandler : public IHandler                                        //V6
  30. {                                                                           //V6
  31. typedef IHandler
  32.   Inherited;
  33. public:                                                                     //V6
  34.   ATimeHandler() : timerId(0) { }       //Initialize timerId data member      V6
  35. virtual ~ATimeHandler() { }                                                 //V6
  36. /*----------------- Override Public IHandler Functions -------------------|   V6
  37. | These public IHandler functions are overridden to add start and stop    |   V6
  38. |   timer calls, respectively.                                            |   V6
  39. |------------------------------------------------------------------------*/ //V6
  40. virtual ATimeHandler                                                        //V6
  41.   &handleEventsFor(IWindow *window),                                        //V6
  42.   &stopHandlingEventsFor(IWindow *window );                                 //V6
  43.  
  44. protected:                                                                  //V6
  45. /*------------------- Override Protected IHandler Function ---------------|   V6
  46. | The dispatchHandlerEvent function is overridden to call the tick        |   V6
  47. |   function for processing timer events.                                 |   V6
  48. | The tick function is added in ATimeHandler and should be overridden     |   V6
  49. |   by classes that inherit from ATimeHandler.                            |   V6
  50. |------------------------------------------------------------------------*/ //V6
  51. Boolean                                                                     //V6
  52.   dispatchHandlerEvent(IEvent& event);                                      //V6
  53. virtual Boolean                                                             //V6
  54.   tick(IEvent& event);                                                      //V6
  55.  
  56. private:                                                                    //V6
  57. /*--------------------------- Private Data Member ------------------------|   V6
  58. | The timerId private data member is used by the ATimeHandler functions   |   V6
  59. |   to save the ID of the outstanding timer call.                         |   V6
  60. |------------------------------------------------------------------------*/ //V6
  61.   unsigned long timerId;                                                    //V6
  62. };                                                                          //V6
  63. #endif                                                                      //V6
  64.