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 / Selection.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.3 KB  |  116 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Selection.h
  4. //    Release Version:    $ ODF 2 $ 
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef SELECTION_H
  11. #define SELECTION_H
  12.  
  13. #ifndef PART_H
  14. #include "Part.h"
  15. #endif
  16.  
  17. #ifndef CELL_H
  18. #include "Cell.h"
  19. #endif
  20.  
  21. // ----- ODF Includes -----
  22.  
  23. #ifndef FWSELECT_H
  24. #include "FWSelect.h"
  25. #endif
  26.  
  27. //==============================================================================
  28. //    Forward declarations
  29. //==============================================================================
  30.  
  31. class CTablePart;
  32. class CTableProxy;
  33. class CTablePartContent;
  34. class CTableSelectionContent;
  35.  
  36. //==============================================================================
  37. //    class CTableSelection
  38. //==============================================================================
  39.  
  40. class CTableSelection : public FW_CSelection
  41. {
  42. //----------------------------------------------------------------------------------------
  43. //    Initialization/Destruction
  44. //
  45.   public:
  46.  
  47.     FW_DECLARE_AUTO(CTableSelection)
  48.  
  49.     CTableSelection(Environment* ev, CTablePart* tablePart, CTablePartContent* content);
  50.     virtual ~ CTableSelection();
  51.     
  52. //----------------------------------------------------------------------------------------
  53. //    Inherited API
  54. //
  55.   public:
  56.     virtual FW_Boolean        IsEmpty(Environment* ev) const;    
  57.     virtual void            CloseSelection(Environment* ev);
  58.     virtual void            ClearSelection(Environment* ev);
  59.     virtual void            SelectAll(Environment* ev);
  60.  
  61.     virtual FW_CContent*    GetSelectedContent(Environment* ev);
  62.     
  63.     // ----- Drag and Drop -----
  64.     virtual ODShape*        AcquireSelectionShape(Environment* ev, ODFacet* facet, FW_CFrame* frame);
  65.     
  66.     virtual FW_Boolean        IsMouseInDraggableItem(Environment* ev, 
  67.                                 FW_CFrame* frame, 
  68.                                 const FW_CMouseEvent& theMouseEvent, 
  69.                                 FW_Boolean inBackground);
  70.                                 
  71.     virtual void            UpdateSelectionOnMouseDown(Environment* ev, 
  72.                                 const FW_CMouseEvent& mouseEvent,
  73.                                 ODFacet* embeddedFacet,
  74.                                 FW_Boolean inEmbeddedFrameBorder,
  75.                                 FW_Boolean inBackground);
  76.  
  77.     // ----- Linking Support -----
  78.     virtual FW_Boolean        CanPasteAsLink(Environment* ev, 
  79.                                 ODPasteAsMergeSetting& setting,
  80.                                 ODStorageUnit* su);
  81.  
  82.     virtual FW_Boolean        IsSelectionLinkable(Environment* ev);
  83.                                 // Don't allow publishing if cell is a link destination
  84.  
  85.     virtual FW_CLinkSource*    DoFindLinkSource(Environment* ev);
  86.     virtual FW_CLinkDestination* GetLinkDestination(Environment* ev, FW_Boolean& multipleLinks);
  87.  
  88.     ODUpdateID                GetSavedLinkSpecID(Environment* ev);
  89.     void                    SaveLinkSpecID(Environment* ev, ODUpdateID linkSpecID);
  90.                                 // Save the link spec id in the selected proxy
  91.  
  92. //----------------------------------------------------------------------------------------
  93. //    New API
  94. //
  95.   public:
  96.       CCell                GetSelectedCell() const;
  97.           
  98.     // ----- Selection -----
  99.     void                Select(Environment* ev, const CCell& cell);
  100.     
  101.     void                InvalidateSelection(Environment* ev);
  102.  
  103.     void                SelectProxy(Environment* ev, CTableProxy* proxy);
  104.  
  105. //----------------------------------------------------------------------------------------
  106. //    Data Members
  107. //
  108.   protected:
  109.     CTablePart*                    fTablePart;
  110.     CTablePartContent*            fTableContent;
  111.     CTableSelectionContent*        fSelectionContent;
  112. };
  113.  
  114.  
  115. #endif
  116.