home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Container / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  5.7 KB  |  167 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 1 $
  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. // ----- Part Layer -----
  14.  
  15. #ifndef FWFRMING_H
  16. #include "FWFrming.h"
  17. #endif
  18.  
  19. #ifndef FWDRGDRP_H
  20. #include "FWDrgDrp.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. // Forward Declarations
  25. //========================================================================================
  26.  
  27. class FW_CPresentation;
  28. class FW_CGrowBox;
  29.  
  30. class CContainerPart;
  31. class CContainerSelection;
  32.  
  33. //========================================================================================
  34. // CContainerFrame
  35. //========================================================================================
  36.  
  37. class CContainerFrame : public FW_CEmbeddingFrame, public FW_MDraggableFrame, public FW_MDroppableFrame
  38. {
  39. public:
  40.     FW_DECLARE_CLASS
  41.     FW_DECLARE_AUTO(CContainerFrame)
  42.  
  43. //----------------------------------------------------------------------------------------
  44. // Initialization/destruction
  45. //
  46. public:        
  47.     CContainerFrame(Environment* ev, 
  48.                     ODFrame* odFrame, 
  49.                     FW_CPresentation* presentation, 
  50.                     CContainerPart* part,
  51.                     FW_ResourceId id = 0);    
  52.     virtual ~ CContainerFrame();
  53.  
  54. //----------------------------------------------------------------------------------------
  55. // Inherited API
  56. //
  57. public:        
  58.     // ----- Menu
  59.     virtual FW_Boolean                DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  60.     virtual FW_Boolean                DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  61.     
  62.     // ----- Events -----
  63.     virtual void                    DoActivateEvent(Environment* ev, const FW_CActivateEvent& theActivateEvent);
  64.  
  65.     // ----- Embedded Mouse Events -----
  66.     virtual FW_Boolean                DoMouseDownInEmbeddedFrameBorder(Environment* ev, 
  67.                                                         const FW_CBorderMouseEvent& theBorderMouseEvent);
  68.     virtual FW_Boolean                DoMouseDownInEmbeddedFrame(Environment* ev, 
  69.                                                         const FW_CEmbeddedMouseEvent& theEmbeddedMouseEvent);
  70.  
  71.     // ----- Embedding -----
  72.     virtual ODFacet*                CreateEmbeddedFacet(Environment* ev,
  73.                                             ODFacet* embeddingFacet,
  74.                                             FW_MProxy* proxy,
  75.                                             ODFrame* embeddedFrame,
  76.                                             ODShape* proposedClipShape);
  77.     
  78.     // ----- Frame activation -----                                    
  79.     virtual void                    FocusStateChanged(Environment* ev, 
  80.                                             ODTypeToken focus, 
  81.                                             FW_Boolean newState, 
  82.                                             ODFrame* newOwner);
  83.  
  84.     // ----- Geometry -----                                    
  85.     virtual void                    GeometryChanged(Environment* ev,
  86.                                             ODFacet* odFacet,
  87.                                             FW_Boolean clipShapeChanged,
  88.                                             FW_Boolean externalTransformChanged);
  89.                                             
  90.     // ----- Drag and Drop -----
  91.     virtual ODDragResult            CanAcceptDrop(Environment* ev, ODDragItemIterator* dragInfo);
  92.  
  93.     // ----- Views -----
  94.     virtual void                     PostCreateViewFromStream(Environment* ev);
  95.     
  96.     // ----- Drawing -----
  97.     virtual void                    Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  98.  
  99.     // ----- Commands Factory -----
  100.     virtual FW_CClipboardCommand*     NewClipboardCommand(Environment* ev, ODCommandID commandID);
  101.     virtual FW_CInsertCommand*         NewInsertCommand(Environment* ev, const FW_PFileSpecification& fileSpec);
  102.     virtual FW_CDragCommand*         NewDragCommand(Environment* ev, 
  103.                                                 FW_CFrame* theFrame,
  104.                                                 const FW_CMouseEvent& theMouseEvent);
  105.     virtual FW_CDropCommand*        NewDropCommand(Environment* ev, FW_CFrame* frame,
  106.                                                 ODDragItemIterator* dropInfo, 
  107.                                                 ODFacet* facet, const FW_CPoint& windowPoint);
  108.  
  109.     // ----- RequestEmbeddedFrame -----
  110.     virtual FW_MProxy*                EmbeddedFrameRequested(Environment *ev,
  111.                                                         FW_MProxy* baseProxy,
  112.                                                         ODFrame* baseFrame,
  113.                                                         ODShape* frameShape,
  114.                                                         ODPart* embeddedPart,
  115.                                                         ODTypeToken viewType,
  116.                                                         ODTypeToken presentation,
  117.                                                         ODID frameGroupID,
  118.                                                         FW_Boolean isOverlaid,
  119.                                                         FW_Boolean isSubFrame);
  120.     // ----- Internalize/Externalize -----
  121.     virtual void                    ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  122.     virtual void                    InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  123.                                                 
  124.     // ----- Window Size ------
  125.     virtual void                    AdjustZoomedWindowSize(Environment* ev, FW_CPoint& proposedSize);
  126.     virtual void                    AdjustWindowGrowLimits(Environment* ev, FW_CPoint& minSize, FW_CPoint& maxSize);
  127.     
  128. //----------------------------------------------------------------------------------------
  129. //    New API
  130. //
  131.   public:
  132.     CContainerSelection*    GetSelection(Environment* ev);
  133.     FW_Fixed                GetZoomFactor(Environment *ev) const;
  134.     void                    ChangeZoomFactor(Environment* ev, FW_Fixed zoomFactor);
  135.  
  136.     FW_CRect                GetContentRect(Environment* ev) const;
  137.     void                    AdjustContentViewSize(Environment* ev, FW_Boolean refresh);
  138.  
  139. //----------------------------------------------------------------------------------------
  140. // Data Members
  141. //
  142. private:    
  143.     CContainerPart*            fContainerPart;
  144.     CContainerSelection*    fSelection;
  145.     
  146.     FW_Fixed                fZoomFactor;
  147. };
  148.  
  149. //----------------------------------------------------------------------------------------
  150. //    CContainerFrame::GetZoomFactor
  151. //----------------------------------------------------------------------------------------
  152. inline FW_Fixed    CContainerFrame::GetZoomFactor(Environment *ev) const 
  153. {
  154.     return fZoomFactor;
  155. }
  156.  
  157. //----------------------------------------------------------------------------------------
  158. //    CContainerFrame::GetSelection
  159. //----------------------------------------------------------------------------------------
  160. inline CContainerSelection*    CContainerFrame::GetSelection(Environment *ev)
  161. {
  162.     return fSelection;
  163. }
  164.  
  165.  
  166. #endif
  167.