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 / ODF / Framewrk / FWWindow / FWFloWin.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.3 KB  |  123 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFloWin.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. //
  10. //    FW_CFloatWindow: Wrapper for a floating ODWindow.
  11. //    
  12. //        The creation of a FW_CFloatingWindow works differently from FW_CWindow. Usually in your
  13. //        part Initialize method your directly create the floating windows you need.
  14. //        
  15. //        void CMyPart::Initialize()
  16. //        {
  17. //                ...
  18. //                fPaletteWindow = new FW_CFloatingWindow(....);
  19. //                ...
  20. //        }
  21. //
  22. //        Floating windows are created hidden. You can call FW_CWindow::Show() or FW_CWindow::Hide() to 
  23. //        show/Hide your floating windows. When your part is desactivated/activated, the visible floating windows 
  24. //        will be automatically hidden/shown.
  25. //
  26. //        Floating window have to be deleted in your ReleaseAll method
  27. //    
  28.  
  29. #ifndef FWFLOWIN_H
  30. #define FWFLOWIN_H
  31.  
  32. #ifndef FWTCOLL_H
  33. #include "FWTColl.h"
  34. #endif
  35.  
  36. #ifndef FWWINDOW_H
  37. #include "FWWindow.h"
  38. #endif
  39.  
  40. #ifndef FWBNDSTR_H
  41. #include "FWBndStr.h"
  42. #endif
  43.  
  44. // ----- OpenDoc Includes -----
  45.  
  46. #ifndef FWODTYPS_H
  47. #include "FWODTyps.h"
  48. #endif
  49.  
  50. //========================================================================================
  51. //    Forward Declarations
  52. //========================================================================================
  53.  
  54. class ODPart;
  55. class ODWindowState;
  56. class FW_CPrivSharedWindow;
  57. struct FW_SWindowParameters;
  58. class FW_CPart;
  59. class FW_CFrame;
  60. class FW_CPresentation;
  61.  
  62.  
  63.  
  64. //========================================================================================
  65. //    class FW_CFloatingWindow
  66. //========================================================================================
  67.  
  68. class FW_CFloatingWindow : public FW_CWindow
  69. {
  70. public:
  71.     FW_DECLARE_CLASS
  72.  
  73. //----------------------------------------------------------------------------------------
  74. //    Constructors/Destructor
  75. //
  76. public:
  77.     FW_CFloatingWindow(Environment* ev, 
  78.                         FW_CPart* part,
  79.                         FW_CPresentation* presentation,
  80.                         const FW_CString& windowTitle,
  81.                         const FW_CPoint& interiorSize,
  82.                         const FW_CPoint& position,
  83.                         FW_Boolean hasCloseBox);
  84.  
  85.     virtual ~FW_CFloatingWindow();
  86.     
  87. //----------------------------------------------------------------------------------------
  88. //    Inherited API
  89. //
  90. public:
  91.     virtual FW_Boolean            IsFloating(Environment* ev) const;
  92.                                     
  93.     virtual ODID                GetID(Environment* ev) const;
  94.     virtual void                SetID(Environment* ev, ODID windowID);
  95.     
  96.     FW_CPart*                    GetPart(Environment*) const
  97.                                     {return fPart;}
  98.                                     
  99.     virtual ODWindow*            AcquireODWindow(Environment* ev) const;
  100.                                                 
  101. //----------------------------------------------------------------------------------------
  102. //    New API
  103. //
  104. public:
  105.     static void                 HideShowFloatingWindows(Environment *ev, FW_Boolean state, ODPart* part = NULL);                                
  106.     static void                    TransferOwnership(Environment* ev, ODPart* newOwner);
  107.                                         
  108. //----------------------------------------------------------------------------------------
  109. //    Data Members
  110. //
  111. private:
  112.     FW_CPart*                    fPart;
  113.     ODTypeToken                    fPresentation;
  114.     FW_CPrivSharedWindow*        fSharedWindow;
  115.     FW_SWindowParameters*        fWindowParameters;
  116.     FW_CFrame*                    fRootFrame;
  117.     
  118. protected:
  119.     static FW_TOrderedCollection<FW_CPrivSharedWindow>*    fgSharedWindows;
  120. };
  121.  
  122. #endif
  123.