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 / Form / Sources / FormView.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  3.3 KB  |  111 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FormView.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Laurent Delamare
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FORMVIEW_H
  13. #define FORMVIEW_H
  14.  
  15. #ifndef DEFINES_K
  16. #include "Defines.k"
  17. #endif
  18.  
  19. // ----- Part Layer -----
  20.  
  21. #ifndef FWSVIEW_H
  22. #include "FWSView.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. // Forward Declaration
  27. //========================================================================================
  28.  
  29. class CFormPart;
  30. class FW_CViewContext;
  31. class FW_CMouseEvent;
  32. class FW_CRadioCluster;
  33. class FW_CListBox;
  34.  
  35. //========================================================================================
  36. // CFormView
  37. //========================================================================================
  38. // Implementation of a content view drawing a background picture
  39.  
  40. class CFormView : public FW_CSuperView
  41. {
  42. public:
  43.     FW_DECLARE_CLASS
  44.  
  45. public:        
  46.     CFormView(Environment *ev, 
  47.                 FW_CSuperView* container, 
  48.                 const FW_CRect& bounds,
  49.                 const FW_CPoint& extent);
  50.     virtual ~ CFormView();
  51.  
  52. private:
  53.     CFormView(Environment *ev);
  54.  
  55. //----------------------------------------------------------------------------------------
  56. // Inherited API
  57. public:        
  58.     virtual void         Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  59.     virtual void         AdjustToNewLayout(Environment *ev, const FW_CPoint& oldExtent, 
  60.                                             const FW_CPoint& newExtent, FW_Boolean redraw);
  61.  
  62.     virtual FW_Boolean     DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  63.  
  64.     virtual void         PostCreateViewFromStream(Environment* ev);
  65.  
  66.     virtual void         ActivateTarget(Environment* ev, FW_Boolean tabSelection);
  67.     
  68.     // ----- Archiving -----
  69.     static void*        Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  70.     static void            Destroy(void* object, FW_ClassTypeConstant type);
  71.     virtual void        Flatten(Environment* ev, FW_CWritableStream& stream) const;
  72.     virtual void        InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //    New API
  76.     void                 CenterInFrame(Environment* ev, FW_CPoint& size, FW_Boolean redraw);
  77.     void                 CreateOwnSubViews(Environment* ev);
  78.     
  79.     void                 SwitchForm(Environment* ev);
  80.     void                 DrawUserData(Environment *ev, FW_CViewContext& vc);
  81.     void                 ResetData(Environment *ev);
  82.  
  83. //----------------------------------------------------------------------------------------
  84. //    Private data
  85.  private:
  86.      FW_Boolean            fFirstFormOn;    // switch between 2 kind of forms
  87.     FW_CRadioCluster*    fRadioClusters[kNumRadioClusters];
  88. };
  89.  
  90. //========================================================================================
  91. //    class CMouseUpBehavior
  92. //========================================================================================
  93. // See comments in .cpp file
  94.  
  95. class CMouseUpBehavior : public FW_MEventHandler
  96. {
  97. public:
  98.     FW_DECLARE_AUTO(CMouseUpBehavior)
  99.  
  100.     CMouseUpBehavior(Environment* ev, FW_CListBox* listBox);
  101.     virtual ~CMouseUpBehavior();
  102.  
  103. public:
  104.     virtual FW_Boolean    DoMouseUp(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  105.     
  106. private:
  107.     FW_CListBox*        fListBox;
  108. };
  109.  
  110. #endif
  111.