home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.6 KB | 160 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FormView.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FORMVIEW_H
- #define FORMVIEW_H
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- #ifndef FWPICTSV_H
- #include "FWPictSv.h"
- #endif
-
- #if FW_PPOB_VIEWS
- #include "FWPPobOb.h"
- #endif
-
- #if FW_MACAPP_VIEWS
- #include "FWMAObjs.h"
- #endif
-
- //========================================================================================
- // Forward Declaration
- //========================================================================================
-
- class CFormPart;
- class FW_CViewContext;
- class FW_CMouseEvent;
- class FW_CRadioCluster;
- class FW_CListBox;
-
- //========================================================================================
- // CFormView
- //========================================================================================
- // Implementation of a content view drawing a background picture
-
- class CFormView : public FW_CPictSView
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(CFormView)
-
- public:
- CFormView(Environment *ev,
- FW_CSuperView* container,
- const FW_CRect& bounds,
- FW_ResourceID pictID1,
- FW_ResourceID pictID2);
- virtual ~ CFormView();
-
- private:
- CFormView(Environment *ev);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- public:
- virtual void Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape);
- virtual void AdjustToNewLayout(Environment *ev, const FW_CPoint& oldExtent,
- const FW_CPoint& newExtent, FW_ERedrawVerb redraw);
-
- virtual FW_Handled DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- virtual void PostCreateViewFromStream(Environment* ev);
- virtual void CreateSubViews(Environment* ev);
-
- virtual void ActivateTarget(Environment* ev, FW_Boolean tabSelection);
-
- // ----- Archiving -----
- #if FW_ODFRC_VIEWS
- static void* Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
- static void Destroy(void* object, FW_ClassTypeConstant type);
- virtual void Flatten(Environment* ev, FW_CWritableStream& stream) const;
- virtual void InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
- #endif
-
- //----------------------------------------------------------------------------------------
- // New API
- public:
- void CenterInFrame(Environment* ev, FW_CPoint& size, FW_ERedrawVerb redraw);
-
- void SwitchForm(Environment* ev);
- void DrawUserData(Environment *ev, FW_CViewContext& vc);
- void ResetData(Environment *ev);
-
- private:
- void InitializePict(Environment* ev, FW_ResourceID pictID);
-
- //----------------------------------------------------------------------------------------
- // Private data
- private:
- FW_Boolean fFirstFormOn; // switch between 2 kind of forms
- FW_CPicture fPicture2;
- };
-
- //========================================================================================
- // class CMouseUpBehavior
- //========================================================================================
- // See comments in .cpp file
-
- class CMouseUpBehavior : public FW_MEventHandler
- {
- public:
- FW_DECLARE_AUTO(CMouseUpBehavior)
-
- CMouseUpBehavior(Environment* ev, FW_CListBox* listBox);
- virtual ~CMouseUpBehavior();
-
- public:
- virtual FW_Handled DoMouseUp(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- private:
- FW_CListBox* fListBox;
- };
-
- //========================================================================================
- // class CPPobFormView
- //========================================================================================
- #if FW_PPOB_VIEWS
-
- class CPPobFormView : public FW_CPPobPictSView
- {
- public:
- CPPobFormView(Environment* ev, FW_CReadableStream& stream, long type);
-
- static void* Create(Environment* ev, FW_CReadableStream& stream, long type);
- virtual void CreateODFView(Environment* ev);
-
- FW_ResourceID fPictID2;
- };
-
- #endif // FW_PPOB_VIEWS
-
- //========================================================================================
- // class CMAFormView
- //========================================================================================
- #if FW_MACAPP_VIEWS
-
- class CMAFormView : public FW_CMAPictSView
- {
- public:
- CMAFormView(ResType type);
-
- static FW_CMAObject* Create(ResType type);
- virtual FW_CView* CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
- virtual void ReadFields(Environment* ev, FW_CReadableStream& stream);
-
- short fPictID2;
- };
-
- #endif // FW_MACAPP_VIEWS
-
- #endif
-