// $Revision: 1.3 $ // Copyright (C) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_SHAREDCOLORSTYLE #define TaligentSamples_SHAREDCOLORSTYLE #ifndef Taligent_PRIMITIVECLASSES #include #endif #ifndef Taligent_STYLE #include #endif #ifndef Taligent_STANDARDTEXT #include #endif #ifndef Taligent_COLOR #include #endif class TSharedColorStyle : public TSharedStyle { public: MCollectibleDeclarationsMacro(TSharedColorStyle); TSharedColorStyle(const TColor&); TSharedColorStyle(const TSharedColorStyle&); virtual ~TSharedColorStyle(); TSharedColorStyle& operator=(const TSharedColorStyle&); virtual TStream& operator>>=(TStream&) const; virtual TStream& operator<<=(TStream&); const TColor* GetColor() const; private: TSharedColorStyle() {}; enum EVersion { kOriginalVersion }; }; class TInternalColorAttribute : public TInternalAttribute { public: MCollectibleDeclarationsMacro(TInternalColorAttribute); TInternalColorAttribute(const TColor& color); virtual ~TInternalColorAttribute(); virtual const TToken& GetName() const; const TColor* GetColor() const; virtual TStream& operator>>=(TStream&) const; virtual TStream& operator<<=(TStream&); virtual long Hash() const; virtual bool IsEqual(const MCollectible* obj) const; virtual void Finalize(); protected: TInternalColorAttribute(); TInternalColorAttribute(const TInternalColorAttribute&); TInternalColorAttribute& operator=(const TInternalColorAttribute&); private: const TColor& fColorRef; // temporary to avoid copy before Finalize. TColor* fOwnedColor; const static TToken fgName; const static TRGBColor fgDefaultColor; enum EVersion { kOriginalVersion }; }; #endif // TaligentSamples_SHAREDCOLORSTYLE