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 / Draw / Sources / BoundShp.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.6 KB  |  95 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                BoundShp.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef BOUNDSHP_H
  13. #define BOUNDSHP_H
  14.  
  15. #ifndef CONSTANT_H
  16. #include "Constant.h"
  17. #endif
  18.  
  19. #ifndef BASESHP_H
  20. #include "BaseShp.h"
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWPOINT_H
  26. #include "FWPoint.h"
  27. #endif
  28.  
  29. #ifndef FWRECT_H
  30. #include "FWRect.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. // class CBoundedShape
  41. //========================================================================================
  42.  
  43. class CBoundedShape : public CBaseShape
  44. {
  45. public:
  46.     FW_DECLARE_CLASS
  47.     FW_DECLARE_AUTO(CBoundedShape)
  48.  
  49. public:
  50.     virtual ~CBoundedShape();
  51.  
  52.     // ----- Geometry
  53.     virtual void        SetShapeGeometry(const FW_CPoint& anchorPoint,  const FW_CPoint& currentPoint);
  54.     virtual FW_CRect    GetRectGeometry() const;
  55.     void                SetRectGeometry(const FW_CRect& bounds);
  56.         
  57.     // ----- Dragging
  58.     virtual void        OffsetShape(Environment *ev, FW_Fixed xDelta, FW_Fixed yDelta);
  59.  
  60.     // ----- Resize
  61.     virtual void        ResizeFeedback(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style, 
  62.                                         short whichHandle, const FW_CPoint& mouseLoc);
  63.     virtual void        GetMapRects(short whichHandle, const FW_CPoint& lastLocation,
  64.                                     FW_CRect& srcRect, FW_CRect& dstRect);
  65.     virtual void        GetHandleCenter(short whichHandle, FW_CPoint& center) const;
  66.     virtual void        MapShape(Environment *ev, const FW_CRect& srcRect, const FW_CRect& dstRect);
  67.  
  68.     // ----- Persistence
  69.     virtual void         Flatten(FW_CWritableStream& archive);
  70.     
  71.     // ----- Scripting
  72.     virtual FW_Boolean    HasProperty(ODDescType whichProperty) const;
  73.     virtual    FW_Boolean    GetProperty(Environment* ev,
  74.                                     FW_CPart* part,
  75.                                     FW_CDesc& propertyValue,
  76.                                     ODDescType whichProperty,
  77.                                     ODDescType desiredType) const;
  78.     virtual void        SetProperty(Environment* ev,
  79.                                     FW_CPart* part,
  80.                                     FW_CDesc& propertyValue,
  81.                                     ODDescType whichProperty);
  82.  
  83. protected:
  84.     CBoundedShape(CDrawPart* drawPart, unsigned short shapeType, unsigned short renderVerb);
  85.     CBoundedShape(CDrawPart* drawPart, FW_CReadableStream& archive);
  86.  
  87. private:
  88.     virtual void         OutlineShape(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style, const FW_CRect& rect) = 0;
  89.  
  90. private:
  91.     FW_CRect            fRect;
  92. };
  93.  
  94. #endif
  95.