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 / Container / Sources / Tracker.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.4 KB  |  165 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Tracker.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef TRACKER_H
  11. #define TRACKER_H
  12.  
  13. // ----- Part Layer -----
  14.  
  15. #ifndef FWTRACKR_H
  16. #include "FWTrackr.h"
  17. #endif
  18.  
  19. // ----- OS Layer -----
  20.  
  21. #ifndef FWRECT_H
  22. #include "FWRect.h"
  23. #endif
  24.  
  25. #ifndef FWINK_H
  26. #include "FWInk.h"
  27. #endif
  28.  
  29. #ifndef FWSTYLE_H
  30. #include "FWStyle.h"
  31. #endif
  32.  
  33. // ----- Foundation Layer -----
  34.  
  35. #ifndef FWRUNTYP_H
  36. #include "FWRunTyp.h"
  37. #endif
  38.  
  39. //========================================================================================
  40. //    Forward class declarations
  41. //========================================================================================
  42.  
  43. class CProxy;
  44. class FW_CScroller;
  45. class FW_CGraphicContext;
  46. class FW_CPoint;
  47.  
  48. //========================================================================================
  49. //    class CResizeTracker
  50. //========================================================================================
  51.  
  52. class CResizeTracker : public FW_CTracker
  53. {
  54. //----------------------------------------------------------------------------------------
  55. //    Constructor/Destructor
  56. //
  57. public:
  58.     CResizeTracker(    Environment* ev, 
  59.                     FW_CView* view, ODFacet* facet,
  60.                     CProxy* theProxy, short whichHandle,
  61.                     const FW_CInk& resizeInk, const FW_CStyle& resizeStyle);
  62.     virtual ~CResizeTracker();
  63.  
  64. //----------------------------------------------------------------------------------------
  65. //    Inherited API
  66. //
  67. public:
  68.     virtual FW_CPoint     BeginTracking(Environment* ev, 
  69.                             const FW_CPoint& anchorPoint);
  70.     virtual FW_CPoint     ContinueTracking(Environment* ev, 
  71.                             const FW_CPoint& anchorPoint, 
  72.                             const FW_CPoint& previousPoint, 
  73.                             const FW_CPoint& currentPoint);
  74.     virtual FW_Boolean    EndTracking(Environment* ev, 
  75.                             const FW_CPoint& anchorPoint, 
  76.                             const FW_CPoint& lastPoint);
  77.  
  78. //----------------------------------------------------------------------------------------
  79. //    New API
  80. //
  81. public:
  82.     void        GetLastLocation(FW_CPoint& lastLocation)
  83.                     {lastLocation = fLastLocation;}
  84.     
  85. //----------------------------------------------------------------------------------------
  86. //    Data Members
  87. //
  88. private:
  89.     CProxy*            fProxy;
  90.     short            fWhichHandle;
  91.     FW_Boolean         fErase;
  92.     FW_CInk            fResizeInk;
  93.     FW_CStyle        fResizeStyle;
  94.     FW_CPoint        fDelta;
  95.     FW_CPoint        fLastLocation;
  96.     FW_CScroller*    fScroller;
  97. };
  98.  
  99. //========================================================================================
  100. //    class CTrackRect
  101. //========================================================================================
  102.  
  103. class CTrackRect
  104. {
  105.   public:
  106.     CTrackRect(const FW_CInk& frameInk, const FW_CStyle& frameStyle);
  107.     virtual ~CTrackRect();
  108.  
  109.     void TrackFeedback(Environment* ev, ODFacet* facet,  
  110.                        FW_CGraphicContext& gc,
  111.                        const FW_CPoint& anchorPoint, 
  112.                        const FW_CPoint& currentPoint, 
  113.                        FW_Boolean erase);
  114.  
  115.     void GetRectBounds(FW_CRect& bounds) const;
  116.  
  117.   private:
  118.     void SetRectGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint);
  119.  
  120.   private:
  121.     FW_CRect    fRect;
  122.     FW_CInk        fFrameInk;
  123.     FW_CStyle    fFrameStyle;
  124. };
  125.  
  126. //========================================================================================
  127. //    class CSelectTracker
  128. //========================================================================================
  129.  
  130. class CSelectTracker : public FW_CTracker
  131. {
  132. //----------------------------------------------------------------------------------------
  133. //    Constructor/Destructor
  134. //
  135.   public:
  136.     CSelectTracker(Environment* ev, 
  137.                    FW_CView* view, 
  138.                    ODFacet* facet, 
  139.                    CTrackRect* theShape);
  140.     virtual ~CSelectTracker();
  141.  
  142. //----------------------------------------------------------------------------------------
  143. //    Inherited API
  144. //
  145.   public:
  146.     virtual FW_CPoint     BeginTracking(Environment* ev, 
  147.                                     const FW_CPoint& anchorPoint);
  148.     virtual FW_CPoint     ContinueTracking(Environment* ev, 
  149.                                     const FW_CPoint& anchorPoint, 
  150.                                     const FW_CPoint& previousPoint, 
  151.                                     const FW_CPoint& currentPoint);
  152.     virtual FW_Boolean    EndTracking(Environment* ev, 
  153.                                     const FW_CPoint& anchorPoint, 
  154.                                     const FW_CPoint& lastPoint);
  155.         
  156. //----------------------------------------------------------------------------------------
  157. //    Data Members
  158. //
  159. private:
  160.     CTrackRect*     fShape;
  161.     FW_Boolean         fErase;
  162.     FW_CScroller*    fScroller;
  163. };
  164.  
  165. #endif