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 / FWPart / FWPartng.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.1 KB  |  143 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPartng.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPARTNG_H
  11. #define FWPARTNG_H
  12.  
  13. #ifndef FWPART_H
  14. #include "FWPart.h"
  15. #endif
  16.  
  17. #ifndef FWPROXY_H
  18. #include "FWProxy.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. class FW_MProxy;
  26. class FW_CCloneInfo;
  27. class FW_CProxyFrame;
  28. class FW_CPartProxyFrameIterator;
  29. class FW_CSelection;
  30.  
  31. //========================================================================================
  32. //    class FW_CEmbeddingPart
  33. //========================================================================================
  34.  
  35. class FW_CEmbeddingPart : public FW_CPart
  36. {
  37.     friend class FW_CPartProxyIterator;
  38.  
  39. public:
  40.     FW_DECLARE_CLASS
  41.  
  42. //----------------------------------------------------------------------------------------
  43. //    Initialization/Destruction
  44. //
  45. public:
  46.     FW_CEmbeddingPart(ODPart* odPart, 
  47.                      FW_Instance partInstance,
  48.                     FW_ResourceID partInfoID);
  49.     
  50.     virtual ~FW_CEmbeddingPart();
  51.  
  52. //----------------------------------------------------------------------------------------
  53. //    Inherited API
  54. //
  55. public:    
  56.     // ----- Release -----
  57.     virtual void                ReleaseAll(Environment *ev);
  58.  
  59.     // ----- Linking -----
  60.     virtual void                LinkStatusChanged(Environment *ev, ODFrame* odFrame);
  61.  
  62.     // ----- Purge -----
  63.     virtual ODSize                Purge(Environment *ev, ODSize size);
  64.     
  65.     // ----- Part Properties -----
  66.     virtual ODStorageUnit*        AcquireContainingPartProperties(Environment* ev, 
  67.                                                                 ODFrame* embeddedFrame);
  68.     
  69.     // ----- Cloning -----
  70.     virtual void                CloneInto(Environment *ev,
  71.                                         ODDraftKey key,
  72.                                         ODStorageUnit* toSU,
  73.                                         ODFrame* scope);
  74.     
  75.     // ----- Factory -----
  76.     virtual FW_CDataInterchange* NewDataInterchange(Environment* ev);
  77.  
  78. //----------------------------------------------------------------------------------------
  79. //    New API
  80. //
  81. public:                                            
  82.     virtual void                EmbeddedFrameRemoved(Environment *ev, 
  83.                                             FW_MProxy* proxy);
  84.                     
  85.     FW_MProxy*                    GetProxy(Environment *ev, ODFrame* embeddedFrame) const;
  86.     
  87. //----------------------------------------------------------------------------------------
  88. //    Internal API (you should never have to called it)
  89. //
  90. public:
  91.     // ----- Frame Group/Sequence Number -----
  92.     ODID                        PrivGetNextFrameGroup(Environment *ev);
  93.     void                        PrivSetNextFrameGroup(Environment *ev, ODID frameGroup);
  94.  
  95.     // ----- ProxyFrame list management -----        
  96.     void                         PrivAddProxy(Environment* ev, FW_MProxy* proxy);
  97.     void                         PrivRemoveProxy(Environment* ev, FW_MProxy* proxy);
  98.         
  99.  
  100. #ifdef FW_BUILD_WIN
  101.     void                        WinAddEmbedMenu(Environment *ev, 
  102.                                             FW_CMenuBar *menuBar);
  103.     ODPart*                        WinCreateEmbeddedPartFromCommand(Environment* ev, 
  104.                                             ODCommandID commandID);
  105.  
  106.     void                         WinEnableEmbedMenu(Environment* ev,
  107.                                             FW_CMenuBar* menuBar);
  108. #endif
  109.  
  110. //----------------------------------------------------------------------------------------
  111. //    Data members
  112. //
  113. private:    
  114.     FW_TOrderedCollection<FW_MProxy>*         fProxys;    
  115.     ODID                        fNextFrameGroup;
  116.  
  117. #ifdef FW_BUILD_WIN
  118.     // This is used by the Windows version to create the embed menu
  119.     FW_CPullDownMenu*            fWinEmbedMenu;
  120.     ODCommandID                    fWinFirstPartID;
  121.     ODCommandID                    fWinLastPartID;
  122.     char                          fTypeString[1024];        // [HLX] need to be dynamic
  123.     char                         *fTypePtr [25];            // [HLX] need to be dynamic
  124. #endif
  125. };
  126.  
  127. //========================================================================================
  128. //    Inlines
  129. //========================================================================================
  130.  
  131. //---------------------------------------------------------------------------------------
  132. //    FW_CEmbeddingPart::PrivGetNextFrameGroup
  133. //----------------------------------------------------------------------------------------
  134. inline ODID FW_CEmbeddingPart::PrivGetNextFrameGroup(Environment*)
  135. {
  136.     return ++fNextFrameGroup;
  137. }
  138.  
  139. #endif
  140.  
  141.  
  142.  
  143.