home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Clock / Sources / Content.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.6 KB  |  150 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Content.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef CONTENT_H
  11. #define CONTENT_H
  12.  
  13. // ----- FrameWork Includes -----
  14.  
  15. #ifndef FWCONTNT_H
  16. #include "FWContnt.h"
  17. #endif
  18.  
  19. #ifndef FWTIME_H
  20. #include "FWTime.h"
  21. #endif
  22.  
  23. #ifndef FWSTRING_H
  24. #include "FWString.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. //    class CClockContent
  29. //========================================================================================
  30.  
  31. class CClockContent : public FW_CContent
  32. {
  33. //----------------------------------------------------------------------------------------
  34. //    Initialization/Destruction
  35. //
  36.   public:
  37.     FW_DECLARE_AUTO(CClockContent)
  38.     
  39.     CClockContent(Environment* ev, FW_CPart* part);
  40.  
  41.     virtual ~CClockContent();
  42.  
  43. //----------------------------------------------------------------------------------------
  44. //    Inherited API
  45. //
  46.   public:
  47.     virtual void        ExternalizeKind(Environment* ev,
  48.                                     ODStorageUnit* storageUnit,
  49.                                     FW_CKind* kind,
  50.                                     FW_StorageKinds storageKind,
  51.                                     FW_CPromise* promise,
  52.                                     FW_CCloneInfo* cloneInfo);
  53.     virtual FW_Boolean    InternalizeKind(Environment* ev,
  54.                                     ODStorageUnit* storageUnit, 
  55.                                     FW_CKind* kind,
  56.                                     FW_StorageKinds storageKind,
  57.                                     FW_CCloneInfo* cloneInfo);
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    New API
  61. //
  62.     FW_Boolean            HasTickSound() const;
  63.     FW_Boolean            HasChimeSound() const;
  64.  
  65.     void                ToggleTickSound();
  66.     void                ToggleChimeSound();
  67.  
  68.     FW_CTimeSpan        GetTimeOffset() const;
  69.     void                SetTimeOffset(const FW_CTimeSpan& offset);
  70.  
  71.     FW_CString            GetFaceString() const;
  72.     void                SetFaceString(const FW_CString& faceString);
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //    Data Members
  76. //
  77.   private:
  78.     //--- part content data
  79.     FW_Boolean            fHasTickSound;
  80.     FW_Boolean            fHasChimeSound;
  81.     FW_CTimeSpan        fTimeOffset;
  82.     FW_CString32         fFaceString;
  83. };
  84.  
  85. //----------------------------------------------------------------------------------------
  86. // CClockContent::HasTickSound
  87. //----------------------------------------------------------------------------------------
  88. inline FW_Boolean CClockContent::HasTickSound() const
  89. {
  90.     return fHasTickSound;
  91. }
  92.  
  93. //----------------------------------------------------------------------------------------
  94. // CClockContent::HasChimeSound
  95. //----------------------------------------------------------------------------------------
  96. inline FW_Boolean CClockContent::HasChimeSound() const
  97. {
  98.     return fHasChimeSound;
  99. }
  100.  
  101. //----------------------------------------------------------------------------------------
  102. // CClockContent::ToggleTickSound
  103. //----------------------------------------------------------------------------------------
  104. inline void CClockContent::ToggleTickSound()
  105. {
  106.     fHasTickSound = !fHasTickSound;
  107. }
  108.  
  109. //----------------------------------------------------------------------------------------
  110. // CClockContent::ToggleChimeSound
  111. //----------------------------------------------------------------------------------------
  112. inline void CClockContent::ToggleChimeSound()
  113. {
  114.     fHasChimeSound = !fHasChimeSound;
  115. }
  116.  
  117. //----------------------------------------------------------------------------------------
  118. // CClockContent::GetTimeOffset
  119. //----------------------------------------------------------------------------------------
  120. inline FW_CTimeSpan CClockContent::GetTimeOffset() const
  121. {
  122.     return fTimeOffset;
  123. }
  124.  
  125. //----------------------------------------------------------------------------------------
  126. // CClockContent::SetTimeOffset
  127. //----------------------------------------------------------------------------------------
  128. inline void CClockContent::SetTimeOffset(const FW_CTimeSpan& offset)
  129. {
  130.     fTimeOffset = offset;
  131. }
  132.  
  133. //----------------------------------------------------------------------------------------
  134. // CClockContent::GetFaceString
  135. //----------------------------------------------------------------------------------------
  136. inline FW_CString CClockContent::GetFaceString() const
  137. {
  138.     return fFaceString;
  139. }
  140.  
  141. //----------------------------------------------------------------------------------------
  142. // CClockContent::SetFaceString
  143. //----------------------------------------------------------------------------------------
  144. inline void CClockContent::SetFaceString(const FW_CString& faceString)
  145. {
  146.     fFaceString = faceString;
  147. }
  148.  
  149. #endif
  150.