home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ibmodf.zip / ODFRK.ZIP / OFORMV.HPP < prev    next >
Text File  |  1995-06-19  |  5KB  |  139 lines

  1.  
  2. #ifndef _OFORMV_
  3. #define _OFORMV_
  4.  
  5. /*******************************************************************************
  6. * FILE NAME: OFORMV.hpp                                                        *
  7. *                                                                              *
  8. * DESCRIPTION: see online documentation                                        *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1994                                         *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or               *
  15. *   disclosure                                                                 *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. ********************************************************************************/
  19.  
  20. //To avoid "true, True, etc. already defined" error, put include of IBASE before any OD stuff
  21. #include <ivbase.hpp>      
  22.  
  23. // ----- OpenDoc Includes -----
  24. #include <odtypes.hh>
  25.  
  26. // ----- UICL Includes -----
  27. #include <icanvas.hpp>
  28. #include <ihandle.hpp>
  29. #include <ipoint.hpp>
  30. #include <irect.hpp>
  31. #include <iconnect.hpp>
  32.  
  33. // Forward declarations for other classes:
  34. class ODFacet;
  35. class ODFrame;
  36. class ODFModel;
  37. class ODShape;
  38. class ODFFormViewPrivateData;
  39.  
  40.  
  41. /*----------------------------------------------------------------------------  */
  42. /* Align classes on four byte boundary.                                         */
  43. /*----------------------------------------------------------------------------  */
  44. #pragma pack(4)
  45.  
  46. class ODFFormView : public ICanvas {
  47. public:
  48.    typedef ICanvas Inherited;
  49.  
  50. // forward declaration for nested class
  51. class Style;
  52.  
  53.  
  54. /*------------------------------------Style-------------------------------------*/
  55.    INESTEDBITFLAGCLASSDEF2(Style, ODFFormView, ICanvas, IWindow);
  56.    static const Style classDefaultStyle;
  57.    static Style defaultStyle();
  58.    static void setDefaultStyle(const Style &style);
  59.  
  60.    ODFFormView(
  61.    unsigned long viewId,
  62.    ODFModel *part,
  63.    const ISize &initialSize = ISize ( ),
  64.    const Style &style = defaultStyle ( ));
  65.  
  66.    virtual  ~ODFFormView();
  67.  
  68. /*-----------------------View Connection to Model Object------------------------
  69. ------------------------------------------------------------------------------*/
  70.    ODFFormView
  71.      &addConnection(IModelViewSynchConnection *connection);
  72.    ODFFormView 
  73.      &removeConnection(IModelViewSynchConnection *connection);
  74.  
  75.    virtual ODFFormView &startBeingViewFor(ODFModel *model);
  76.    virtual Boolean beginRelinquishFocus(ODTypeToken focus,
  77.                                         ODFFormView *proposedView);  
  78.    ODFFormView 
  79.      &flushDirtyConnections();
  80.  
  81.    enum UpdateMode {         
  82.      immediate,
  83.      onFocusChg, 
  84.      noAutoUpdate
  85.      };
  86.    virtual ODFFormView
  87.      &setModelUpdateMode        ( UpdateMode updateMode = onFocusChg );
  88.    virtual UpdateMode
  89.      modelUpdateMode            ( ) const;           
  90.  
  91.  
  92. //virtual ODFFormView
  93. // &layout              ( );
  94. //ISize
  95. // layoutSize          ( ) const;
  96. //ODFFormView
  97. // &setLayoutSize       ( const ISize& size );
  98. //virtual IWindowPosBuffer
  99. //  fixupChildren       ( );
  100. //Boolean
  101. //  areChildrenReversed ( ) const;
  102.  
  103.    virtual ODFFormView &initializeView ();
  104.    virtual ODFFormView &stopBeingViewFor (ODFModel *model);
  105.    virtual ODFFormView &drawView();
  106.    virtual ODFModel *model() const;
  107.    IBase::Boolean isViewEnabled() const;
  108.    ODFrame *frame() const;
  109.    ODFacet *facet() const;
  110.    virtual ODFFormView &setViewClient (IControl *clientControl);
  111.    virtual IControl *viewClient ();
  112.    virtual ODFFormView &sizeTo (const ISize &newSize);
  113.  
  114.  
  115. private:
  116.    ODFFormView(const ODFFormView &);
  117.    ODFFormView &operator =(const ODFFormView &);
  118.    void throwReadOnlyChangedException();     //???? still need ????
  119.  
  120.    ODFModel *p_modelPart;
  121.    IObserverList *fConnectionList;
  122.    ODFacet *p_facet;
  123.    ODFrame *p_frame;
  124.    static Style currentDefaultStyle;
  125.    ODFFormViewPrivateData *p_privateData;
  126.    Boolean p_viewEnabled;
  127.    IWindow *p_wndParent;
  128.    IControl *p_viewClient;
  129. }; // ODFFormView
  130.  
  131. // ODFFormView
  132.    INESTEDBITFLAGCLASSFUNCS(Style, ODFFormView);
  133.  
  134. /*----------------------------------------------------------------------------  */
  135. /* Resume compiler default packing.                                             */
  136. /*----------------------------------------------------------------------------  */
  137. #pragma pack()
  138. #endif /* _OFORMV_ */
  139.