home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Clock / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.7 KB  |  98 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. // ----- Framework Layer -----
  14.  
  15. #ifndef FWPART_H
  16. #include "FWPart.h"
  17. #endif
  18.  
  19. // ----- OS Layer -----
  20.  
  21. #ifndef FWMNUITM_H
  22. #include "FWMnuItm.h"
  23. #endif
  24.  
  25. #ifndef FWTIME_H
  26. #include "FWTime.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. // Classes used by this interface
  31. //========================================================================================
  32.  
  33. class CClockContent;
  34.  
  35. //========================================================================================
  36. // Constants
  37. //========================================================================================
  38.  
  39. const short kAnalogClock = 1;
  40. const short kDigitalClock = 2;
  41.  
  42. //========================================================================================
  43. // CClockPart
  44. //========================================================================================
  45.  
  46. class CClockPart : public FW_CPart
  47. {
  48. public:
  49.     FW_DECLARE_AUTO(CClockPart)
  50.  
  51. //----------------------------------------------------------------------------------------
  52. //    Initialization/Destruction
  53. //
  54. public:
  55.     CClockPart(ODPart* odPart);
  56.     virtual void Initialize(Environment* ev);
  57.  
  58.     virtual ~ CClockPart();
  59.  
  60. //----------------------------------------------------------------------------------------
  61. //    Inherited API
  62. //
  63. public:
  64.     // ----- Factory Methods -----    
  65.     virtual FW_CFrame* NewFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, FW_Boolean fromStorage);
  66.     virtual FW_CContent* NewPartContent(Environment* ev);
  67.     
  68.     virtual FW_Boolean DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  69.     
  70.     virtual FW_Boolean DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  71.     virtual FW_Boolean DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  72.     
  73.     
  74. //----------------------------------------------------------------------------------------
  75. //    New API
  76. //
  77. public:    
  78.     void         PlayTickSound();
  79.     void         PlayChimeSound();
  80.     
  81. //----------------------------------------------------------------------------------------
  82. //    Data Members
  83. //
  84. private:
  85.     FW_CTime             fLastTime;
  86.     FW_CPresentation*    fPresentation;    
  87.     CClockContent*        fClockContent;    
  88.     FW_Boolean            fLockIdle;            // Use to block idle while changing clock type    
  89.     FW_CIdler*            fIdler;
  90.     
  91. #ifdef FW_BUILD_MAC
  92.     FW_PlatformHandle     fChimeSound;
  93.     FW_PlatformHandle     fTickSound;
  94. #endif
  95. };
  96.  
  97. #endif
  98.