home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vbtimer.zip / TIMERCOD.ZIP / VBTimer.hpp < prev    next >
C/C++ Source or Header  |  1995-06-14  |  4KB  |  90 lines

  1. /*******************************************************************************
  2. * FILE NAME: VBTimer.hpp                                                       *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *   Declaration of the class:                                                  *
  6. *     VBTimer- A part that signals an event at regular intervals               *
  7. * ---------------------------------------------------------------------------- *
  8. * Warning: This file was generated by the VisualAge C++ Visual Builder.        *
  9. * Modifications to this source file will be lost when the part is regenerated. *
  10. *******************************************************************************/
  11. #ifndef _VBTIMER_
  12. #define _VBTIMER_
  13.  
  14. class VBTimer;
  15.  
  16. #ifndef _VBTIMERFN_
  17. #include "VBTmerFn.hpp"
  18. #endif
  19.  
  20. #ifndef _ISTDNTFY_
  21. #include <istdntfy.hpp>
  22. #endif
  23.  
  24. class ITimer;
  25. class VBTimerFn;
  26. #include "VBTimer.h"
  27.  
  28.  
  29. /*----------------------------------------------------------------------------*/
  30. /* Align classes on four byte boundary.                                       */
  31. /*----------------------------------------------------------------------------*/
  32. #pragma pack(4)
  33.  
  34. //*****************************************************************************
  35. // Class definition for VBTimer
  36. //*****************************************************************************
  37. class VBTimer : public IStandardNotifier {
  38. public:
  39.    //---------------------------------------------------------------------------
  40.    // Constructors / destructors
  41.    //---------------------------------------------------------------------------
  42.    VBTimer();
  43.  
  44.    virtual  ~VBTimer();
  45.  
  46.    //---------------------------------------------------------------------------
  47.    // public member functions
  48.    //---------------------------------------------------------------------------
  49.    virtual VBTimer & initializePart();
  50.    virtual unsigned long interval() const;
  51.    virtual VBTimer& setInterval(unsigned long aInterval);
  52.    virtual Boolean isStarted() const;
  53.    virtual Boolean isStopped() const;
  54.    virtual VBTimer& stop();
  55.    virtual VBTimer& start();
  56.  
  57.    //---------------------------------------------------------------------------
  58.    // public member data
  59.    //---------------------------------------------------------------------------
  60.    static const INotificationId readyId;
  61.    static const INotificationId intervalId;
  62.    static const INotificationId startedEvent;
  63.    static const INotificationId stoppedEvent;
  64.    static const INotificationId timerEventId;
  65.  
  66. protected:
  67.    //---------------------------------------------------------------------------
  68.    // protected member functions
  69.    //---------------------------------------------------------------------------
  70.    virtual Boolean makeConnections();
  71.  
  72. private:
  73.    //---------------------------------------------------------------------------
  74.    // private member data
  75.    //---------------------------------------------------------------------------
  76.    ITimer * iTimer;
  77.    const IReference<ITimerFn> iVBTimerFn;
  78.    unsigned long iInterval;
  79.    Boolean iIsStarted;
  80.    Boolean iIsStopped;
  81. };   //VBTimer
  82.  
  83.  
  84. /*----------------------------------------------------------------------------*/
  85. /* Resume compiler default packing.                                           */
  86. /*----------------------------------------------------------------------------*/
  87. #pragma pack()
  88.  
  89. #endif
  90.