home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-26 | 3.5 KB | 133 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Content.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CONTENT_H
- #define CONTENT_H
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWCONTNT_H
- #include "FWContnt.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class CODFxPart;
- class FW_CReadableStream;
-
- //========================================================================================
- // class CODFxContent
- //========================================================================================
-
- class CODFxContent : public FW_CContent
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- FW_DECLARE_AUTO(CODFxContent)
-
- CODFxContent(Environment* ev, CODFxPart* part);
- virtual ~CODFxContent();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void ExternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CPromise* promise,
- FW_CCloneInfo* cloneInfo);
- virtual FW_Boolean InternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CCloneInfo* cloneInfo);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
-
- public:
-
- enum { kMinPixPerRow = 64, kMidPixPerRow = 128, kMaxPixPerRow = 256 };
-
- // do not change maxColors without updating the content model
- enum { kMinColors = 4, kMaxColors = 9 };
-
- protected:
-
- typedef FW_CColor RegionColorArray[kMaxColors];
-
- public:
-
- struct ODFXContentStruct
- {
- ODFXContentStruct(Boolean initColors = false);
-
- FW_Boolean fVisibleGridLines; // duh...
- FW_Boolean fUnused; // set to false
- short fPixPerRow; // either 128 or 96
- short fNumColors; // either 4 or 9
- RegionColorArray fColors; // all 9 colors
- };
-
- public:
-
- void GetContentData(ODFXContentStruct& outData);
- void SetContentData(Environment* ev, const ODFXContentStruct& inData);
-
- Boolean GetShowGridLines();
- void SetShowGridLines(Environment* ev, Boolean show);
-
- short GetPixPerRow();
- void SetPixPerRow(Environment* ev, short inRes);
-
- void RotateColors(Environment* ev);
-
- short GetNumColors();
- void SetNumColors(Environment* ev, short numColors);
-
- FW_CPicture& GetPictureData(Environment* ev);
- void InvalidatePicture(Environment* ev);
-
- void GetColorData(RegionColorArray& colors);
- void SetColorData(Environment* ev, const RegionColorArray& colors);
-
- const FW_CColor& GetColorData(short n);
- void SetColorData(Environment* ev, short n, const FW_CColor& newColor);
-
- void ResetColorData(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
-
- ODFXContentStruct fContentData;
- FW_CPicture fPicture;
- Boolean fPictureValid;
- CODFxPart* fODFxPart;
- };
-
- inline void CODFxContent::InvalidatePicture(Environment* ev)
- {
- FW_UNUSED(ev);
- fPictureValid = false;
- }
-
- #endif