home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.6 KB | 127 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWIconSh.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWICONSH_H
- #define FWICONSH_H
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWICON_H
- #include "FWIcon.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CIconShape
- //========================================================================================
-
- class FW_CIconShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CIconShape)
-
- //---------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
-
- enum
- {
- kDefaultAlignment = FW_kIconAlignLeft | FW_kIconAlignTop
- };
-
- FW_CIconShape(const FW_CIcon& icon,
- const FW_CRect& rect,
- FW_RenderIconTransform transform = FW_kIconTransformNone,
- FW_RenderIconAlignment alignment = kDefaultAlignment);
-
- FW_CIconShape(const FW_CIconShape& other);
- FW_CIconShape(FW_CReadableStream& stream);
-
- virtual ~FW_CIconShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CIconShape& operator=(const FW_CIconShape& other);
-
- //---------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& stream) const;
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderIcon(FW_CGraphicContext& gc,
- const FW_CIcon& icon,
- const FW_CRect& rect,
- FW_RenderIconTransform transform = FW_kIconTransformNone,
- FW_RenderIconAlignment alignment = kDefaultAlignment);
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
-
- // ----- Geometry -----
- void GetGeometry(FW_CIcon& icon,
- FW_CRect& bounds,
- FW_RenderIconTransform& transform,
- FW_RenderIconAlignment& alignment) const;
- void SetGeometry(const FW_CIcon& icon,
- const FW_CRect& bounds,
- FW_RenderIconTransform transform = FW_kIconTransformNone,
- FW_RenderIconAlignment alignment = kDefaultAlignment);
-
- FW_RenderIconTransform GetIconTransform() const
- {return fTransform;}
- void SetIconTransform(FW_RenderIconTransform iconTransform)
- {fTransform = iconTransform;}
- FW_RenderIconAlignment GetIconAlignment() const
- {return fAlignment;}
- void SetIconAlignment(FW_RenderIconAlignment iconAlignment)
- {fAlignment = iconAlignment;}
-
- //---------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CIcon fIcon;
- FW_RenderIconTransform fTransform;
- FW_RenderIconAlignment fAlignment;
- };
-
- #endif // FWICONSH_H
-