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 / Table / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.5 KB  |  159 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 2 $ 
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FRAME_H
  11. #define FRAME_H
  12.  
  13. // ----- TablePart Includes -----
  14.  
  15. #ifndef PART_H
  16. #include "Part.h"
  17. #endif
  18.  
  19. #ifndef CELL_H
  20. #include "Cell.h"
  21. #endif
  22.  
  23. #ifndef CONSTANT_H
  24. #include "Constant.h"
  25. #endif
  26.  
  27. // ----- ODF Includes -----
  28.  
  29. #ifndef FWDRGDRP_H
  30. #include "FWDrgDrp.h"
  31. #endif
  32.  
  33. #ifndef FWFRMING_H
  34. #include "FWFrming.h"
  35. #endif
  36.  
  37. #ifndef FWPRESEN_H
  38. #include "FWPresen.h"
  39. #endif
  40.  
  41. #ifndef FWRECSHP_H
  42. #include "FWRecShp.h"
  43. #endif
  44.  
  45. //========================================================================================
  46. //    Forward declarations
  47. //========================================================================================
  48.  
  49. class FW_CGraphicContext;
  50. class CTablePart;
  51. class CTableSelection;
  52. class CTableProxy;
  53. class CTablePartContent;
  54. class FW_CViewContext;
  55. class CTableView;
  56.  
  57. //========================================================================================
  58. //    class CTableFrame
  59. //========================================================================================
  60.  
  61. class CTableFrame : public FW_CEmbeddingFrame, public FW_MDraggableFrame, public FW_MDroppableFrame
  62. {
  63. //----------------------------------------------------------------------------------------
  64. //    Initialization/Destruction
  65. //
  66. public:
  67.   
  68.       FW_DECLARE_AUTO(CTableFrame)
  69.     
  70.     CTableFrame(Environment* ev, 
  71.                 ODFrame* odFrame, 
  72.                 FW_CPresentation* presentation, 
  73.                 CTablePart* tablePart,
  74.                 CTablePartContent* tableContent);
  75.     virtual ~ CTableFrame();
  76.     
  77. //----------------------------------------------------------------------------------------
  78. //    Inherited API
  79. //
  80. public:
  81.     // ----- Getters/Setters -----
  82.     CTableSelection*        GetSelection(Environment* ev) const;
  83.     ETableLoc                GetDragLocation() const;
  84.     CCell                    GetDragCell() const;
  85.     CCell                    GetDragSourceCell() const;
  86.     
  87.     // ----- Focus change -----
  88.     virtual void            FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);
  89.  
  90.     virtual void            FrameShapeChanged(Environment* ev);
  91.  
  92.     // ----- Events -----
  93.     virtual FW_Handled        DoVirtualKey(Environment* ev, const FW_CVirtualKeyEvent& theVirtualKeyEvent);
  94.     virtual FW_Handled        DoMouseDownInEmbeddedFrameBorder(Environment* ev, const FW_CBorderMouseEvent& theBorderMouseEvent);
  95.     
  96.     // ----- Window Geometry -----
  97.     virtual void            AdjustZoomedWindowSize(Environment *ev, FW_CPoint& proposedSize);
  98.  
  99.     // ----- Views & Geometry -----
  100.     virtual void            PostCreateViewFromStream(Environment* ev);
  101.  
  102.     // ----- Drag And Drop -----
  103.     virtual ODDragResult    CanAcceptDrop(Environment *ev, ODDragItemIterator* dragInfo);
  104.     virtual FW_CDropTracker* NewDropTracker(Environment *ev, FW_CView* view, ODFacet* facet);
  105.  
  106.     virtual FW_CDragCommand* NewDragCommand(Environment *ev, 
  107.                                             FW_CFrame* theFrame,
  108.                                             const FW_CMouseEvent& theMouseEvent);
  109.     virtual FW_CDropCommand* NewDropCommand(Environment *ev,
  110.                                             FW_CFrame* frame,
  111.                                             ODDragItemIterator* dropInfo, 
  112.                                             ODFacet* odFacet, 
  113.                                             const FW_CPoint& dropPoint);
  114.  
  115.     virtual FW_CClipboardCommand* NewClipboardCommand(Environment* ev, ODCommandID commandID);
  116.  
  117.     virtual FW_CInsertCommand*    NewInsertCommand(Environment* ev, const FW_PFileSpecification& fileSpec);
  118.  
  119.     virtual FW_Handled        Drag(Environment* ev, const FW_CMouseEvent& event);
  120.  
  121.     // ----- Linking -----
  122.     virtual void            FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  123.  
  124. //----------------------------------------------------------------------------------------
  125. //    New API
  126. //
  127. public:
  128.     void            ChangeEmbeddedFacetSelectState(Environment* ev, FW_Boolean state);
  129.  
  130.     void            MoveProxy(Environment* ev, CTableProxy* proxy, const CCell& destCell);
  131.                               
  132.     void            SelectCell(Environment* ev, const CCell& cell);
  133.  
  134.     CTablePartContent*    GetTableContent(Environment*) const
  135.                         {return fTableContent;}
  136.     CTableView*        GetTableView(Environment*) const
  137.                         {return fTableView;}
  138.  
  139.     FW_CRect        GetContentRect(Environment* ev) const;
  140.     void            AdjustContentViewSize(Environment* ev, FW_ERedrawVerb redraw);
  141.  
  142. //----------------------------------------------------------------------------------------
  143. //    Data Members
  144. //
  145. protected:
  146.     // ----- Part back-pointer -----
  147.     CTablePart*            fTablePart;
  148.     CTablePartContent*    fTableContent;
  149.     
  150.     // ----- Drag & drop state variables -----
  151.     CCell            fDraggedCell;
  152.     
  153.     FW_CRectShape    fSelectFrame;
  154.     
  155.     CTableView*        fTableView;
  156. };
  157.  
  158. #endif
  159.