home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 2.8 KB | 92 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Content.cpp
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- //========================================================================================
- // Runtime information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfclock
- #endif
-
- //========================================================================================
- // Class CClockContent
- //========================================================================================
-
- FW_DEFINE_AUTO(CClockContent)
-
- //----------------------------------------------------------------------------------------
- // CClockContent constructor
- //----------------------------------------------------------------------------------------
-
- CClockContent::CClockContent(Environment* ev, CClockPart* part)
- : FW_CContent(ev, part),
- fClockPart(part),
- fClockType(kAnalogClock),
- fHasTickSound(false),
- fHasChimeSound(true)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CClockContent destructor
- //----------------------------------------------------------------------------------------
-
- CClockContent::~CClockContent()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CClockContent::Externalize
- //----------------------------------------------------------------------------------------
-
- void CClockContent::Externalize(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo)
- {
- FW_UNUSED(cloneInfo);
- FW_PStorageUnitSink suSink(ev, storageUnit, kODPropContents, fClockPart->GetPartKind(ev));
- FW_CWritableStream stream(suSink);
- stream << fClockType;
- stream << fHasTickSound;
- stream << fHasChimeSound;
- }
-
- //----------------------------------------------------------------------------------------
- // CClockContent::Internalize
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CClockContent::Internalize(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_EStorageKinds storageKind,
- FW_CCloneInfo* cloneInfo)
- {
- FW_PStorageUnitSink suSink(ev, storageUnit, kODPropContents, fClockPart->GetPartKind(ev));
- FW_PBufferedSink sink(ev, suSink);
- FW_CReadableStream stream(sink);
- stream >> fClockType;
- stream >> fHasTickSound;
- stream >> fHasChimeSound;
- return true;
- }
-
-