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 / Form / Sources / View.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.6 KB  |  160 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FormView.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FORMVIEW_H
  11. #define FORMVIEW_H
  12.  
  13. #ifndef DEFINES_K
  14. #include "Defines.k"
  15. #endif
  16.  
  17. #ifndef FWPICTSV_H
  18. #include "FWPictSv.h"
  19. #endif
  20.  
  21. #if FW_PPOB_VIEWS
  22. #include "FWPPobOb.h"
  23. #endif
  24.  
  25. #if FW_MACAPP_VIEWS
  26. #include "FWMAObjs.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. // Forward Declaration
  31. //========================================================================================
  32.  
  33. class CFormPart;
  34. class FW_CViewContext;
  35. class FW_CMouseEvent;
  36. class FW_CRadioCluster;
  37. class FW_CListBox;
  38.  
  39. //========================================================================================
  40. // CFormView
  41. //========================================================================================
  42. // Implementation of a content view drawing a background picture
  43.  
  44. class CFormView : public FW_CPictSView
  45. {
  46. public:
  47.     FW_DECLARE_CLASS
  48.     FW_DECLARE_AUTO(CFormView)
  49.  
  50. public:        
  51.     CFormView(Environment *ev, 
  52.                         FW_CSuperView* container, 
  53.                         const FW_CRect& bounds,
  54.                         FW_ResourceID pictID1,
  55.                         FW_ResourceID pictID2);
  56.     virtual ~ CFormView();
  57.  
  58. private:
  59.     CFormView(Environment *ev);
  60.  
  61. //----------------------------------------------------------------------------------------
  62. // Inherited API
  63. public:        
  64.     virtual void                 Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
  65.     virtual void                 AdjustToNewLayout(Environment *ev, const FW_CPoint& oldExtent, 
  66.                                             const FW_CPoint& newExtent, FW_ERedrawVerb redraw);
  67.  
  68.     virtual FW_Handled         DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  69.  
  70.     virtual void                 PostCreateViewFromStream(Environment* ev);
  71.     virtual void                 CreateSubViews(Environment* ev);
  72.  
  73.     virtual void                 ActivateTarget(Environment* ev, FW_Boolean tabSelection);
  74.     
  75.     // ----- Archiving -----
  76. #if FW_ODFRC_VIEWS
  77.     static void*                Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  78.     static void                    Destroy(void* object, FW_ClassTypeConstant type);
  79.     virtual void                Flatten(Environment* ev, FW_CWritableStream& stream) const;
  80.     virtual void                InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  81. #endif
  82.  
  83. //----------------------------------------------------------------------------------------
  84. //    New API
  85. public:
  86.     void                         CenterInFrame(Environment* ev, FW_CPoint& size, FW_ERedrawVerb redraw);
  87.     
  88.     void                         SwitchForm(Environment* ev);
  89.     void                         DrawUserData(Environment *ev, FW_CViewContext& vc);
  90.     void                         ResetData(Environment *ev);
  91.  
  92. private:
  93.     void                         InitializePict(Environment* ev, FW_ResourceID pictID);
  94.     
  95. //----------------------------------------------------------------------------------------
  96. //    Private data
  97.  private:
  98.      FW_Boolean                    fFirstFormOn;    // switch between 2 kind of forms
  99.      FW_CPicture                    fPicture2;
  100. };
  101.  
  102. //========================================================================================
  103. //    class CMouseUpBehavior
  104. //========================================================================================
  105. // See comments in .cpp file
  106.  
  107. class CMouseUpBehavior : public FW_MEventHandler
  108. {
  109. public:
  110.     FW_DECLARE_AUTO(CMouseUpBehavior)
  111.  
  112.     CMouseUpBehavior(Environment* ev, FW_CListBox* listBox);
  113.     virtual ~CMouseUpBehavior();
  114.  
  115. public:
  116.     virtual FW_Handled    DoMouseUp(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  117.     
  118. private:
  119.     FW_CListBox*        fListBox;
  120. };
  121.  
  122. //========================================================================================
  123. // class CPPobFormView
  124. //========================================================================================
  125. #if FW_PPOB_VIEWS
  126.  
  127. class CPPobFormView : public FW_CPPobPictSView
  128. {
  129. public:
  130.     CPPobFormView(Environment* ev, FW_CReadableStream& stream, long type);
  131.  
  132.     static void*        Create(Environment* ev, FW_CReadableStream& stream, long type);
  133.     virtual void        CreateODFView(Environment* ev);    
  134.     
  135.     FW_ResourceID        fPictID2;
  136. };
  137.  
  138. #endif // FW_PPOB_VIEWS
  139.  
  140. //========================================================================================
  141. // class CMAFormView
  142. //========================================================================================
  143. #if FW_MACAPP_VIEWS
  144.  
  145. class CMAFormView : public FW_CMAPictSView
  146. {
  147. public:
  148.     CMAFormView(ResType type);
  149.  
  150.     static FW_CMAObject*    Create(ResType type);
  151.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  152.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  153.     
  154.     short                    fPictID2;
  155. };
  156.  
  157. #endif // FW_MACAPP_VIEWS
  158.  
  159. #endif
  160.