home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 5.1 KB | 192 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Tracker.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef TRACKER_H
- #define TRACKER_H
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef CELL_H
- #include "Cell.h"
- #endif
-
- #ifndef CONSTANT_H
- #include "Constant.h"
- #endif
-
- // ----- ODF Includes -----
-
- #ifndef FWTRACKR_H
- #include "FWTrackr.h"
- #endif
-
- // ----- OS Includes -----
-
- #ifndef FWLINSHP_H
- #include "FWLinShp.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- //========================================================================================
- // Forward declarations
- //========================================================================================
-
- class CTablePart;
- class CTableFrame;
- class CTableContent;
- class CTableSelection;
-
- //========================================================================================
- // class CTableDropTracker
- //========================================================================================
-
- class CTableDropTracker : public FW_CDropTracker
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CTableDropTracker(Environment* ev,
- CTablePart* part,
- CTableContent* content,
- CTableFrame* frame,
- ODFacet* facet,
- const CCell& sourceCell);
- virtual ~CTableDropTracker();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Tracking -----
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
-
- private:
- void Hilite(Environment* ev, const CCell& cell, ODFacet* facet);
- FW_Boolean ShouldHilite(Environment* ev, const FW_CPoint& anchorPoint, CCell& cell);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CTableFrame* fTableFrame;
- CTablePart* fTablePart;
- CTableContent* fTableContent;
- CCell fSourceCell;
- CCell fCurCell;
- FW_Boolean fHiliteOn;
- };
-
- //========================================================================================
- // class CCrossShape
- //========================================================================================
-
- class CCrossShape
- {
- //---------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- CCrossShape(const FW_CPoint& brCell, FW_CPoint& brFrm);
-
- //---------------------------------------------------------------------------------------
- // Public API
- //
- public:
- void SetHLineToMove();
- void SetVLineToMove();
-
- // ----- Rendering -----
- void Render(FW_CGraphicContext& graphicContext);
-
- // ----- Transform -----
- void MoveShape(FW_Fixed deltaX, FW_Fixed deltaY);
-
- //---------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CLineShape vLine;
- FW_CLineShape hLine;
- };
-
- //========================================================================================
- // class CGridLineTracker
- //========================================================================================
-
- class CGridLineTracker : public FW_CTracker
- {
- public:
- CGridLineTracker(Environment* ev,
- FW_CView* view,
- ODFacet* facet,
- ETableLoc tl,
- FW_CRect dragArea,
- FW_CPoint borders);
- virtual ~CGridLineTracker();
-
- //----------------------------------------------------------------------------------------
- // Required Overrides
- //
- public:
- virtual FW_CPoint BeginTracking(Environment* ev,
- const FW_CPoint& anchorPoint);
- virtual FW_CPoint ContinueTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& previousPoint,
- const FW_CPoint& currentPoint);
- virtual FW_Boolean EndTracking(Environment* ev,
- const FW_CPoint& anchorPoint,
- const FW_CPoint& lastPoint);
-
- //----------------------------------------------------------------------------------------
- // Accessor Functions
- //
- public:
- const FW_CPoint& GetOldBorders();
- const FW_CPoint& GetNewBorders();
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_Boolean fHorizMove; // resize horizontally?
- FW_Boolean fVertMove; // resize vertically?
- FW_CRect fDragArea; // permissible drag area
- FW_CPoint fOldBorders;
- FW_CPoint fNewBorders;
- CCrossShape fCross; // cursor
- };
-
- //========================================================================================
- // CGridLineTracker Inlines
- //========================================================================================
-
- inline const FW_CPoint& CGridLineTracker::GetOldBorders()
- {
- return fOldBorders;
- }
-
- inline const FW_CPoint& CGridLineTracker::GetNewBorders()
- {
- return fNewBorders;
- }
-
- #endif
-