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 / ODF / OS / FWGraphx / FWIcon.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.4 KB  |  89 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWIcon.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWICON_H
  11. #define FWICON_H
  12.  
  13. #ifndef FWGRREF_H
  14. #include "FWGrRef.h"
  15. #endif
  16.  
  17. #ifndef SLICON_H
  18. #include "SLIcon.h"
  19. #endif
  20.  
  21. #ifndef FWRESFIL_H
  22. #include "FWResFil.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_PResourceFile;
  30. class FW_CRect;
  31. class FW_CPoint;
  32. class FW_CReadableStream;
  33. class FW_CWritableStream;
  34.  
  35. struct FW_SGraphicContext;
  36.  
  37. //========================================================================================
  38. //    class FW_CIcon
  39. //========================================================================================
  40.  
  41. class FW_CIcon : public FW_TGrRefPtr<FW_HIcon>
  42. {
  43. public:
  44.     FW_DECLARE_AUTO(FW_CIcon)
  45.  
  46.                         FW_CIcon();
  47.                         FW_CIcon(FW_CReadableStream& stream);
  48.                         FW_CIcon(FW_PlatformIcon platformIcon);        // Does adopt the icon
  49.                         FW_CIcon(FW_PResourceFile& resourceFile,
  50.                                  FW_ResourceID resID,
  51.                                  short size);
  52.                         ~FW_CIcon();
  53.  
  54.                         FW_CIcon(const FW_CIcon& other);
  55.     FW_CIcon&            operator=(const FW_CIcon& other);
  56.     FW_CIcon            Copy() const;
  57.     
  58.     friend FW_CWritableStream& operator << (FW_CWritableStream& stream, const FW_CIcon& icon);
  59.     friend FW_CReadableStream& operator >> (FW_CReadableStream& stream, FW_CIcon& icon);
  60.  
  61.     // ----- Delegation
  62.     
  63.     FW_Boolean        IsEqual(const FW_CIcon& icon) const
  64.                         { return FW_PrivIcon_IsEqual(fRep, icon.fRep); }
  65.     
  66.     FW_PlatformIcon    GetPlatformIcon() const
  67.                         { return FW_PrivIcon_GetPlatformIcon(fRep); }
  68.  
  69.     FW_PlatformIcon    OrphanPlatformIcon() const
  70.                         { return FW_PrivIcon_OrphanPlatformIcon(fRep); }
  71.         
  72.     FW_Boolean         IsPlatformIconOrphan() const
  73.                         { return FW_PrivIcon_IsPlatformIconOrphan(fRep); }
  74.  
  75.     void            SetPlatformIcon(FW_PlatformIcon newIcon)
  76.                         { FW_PrivIcon_SetPlatformIcon(fRep, newIcon); }
  77.  
  78.     void            AdoptPlatformIcon(FW_PlatformIcon newIcon)
  79.                         { FW_PrivIcon_AdoptPlatformIcon(fRep, newIcon); }
  80.         
  81.     void            GetIconSize(FW_SPoint& size) const
  82.                         { FW_PrivIcon_GetIconSize(fRep, size); }
  83.                         
  84.     void            GetIconSize(FW_SGraphicContext& gc, FW_SPoint& size) const;
  85. };
  86.  
  87. #endif // FWICON_H
  88.  
  89.