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 / Bitmap / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.5 KB  |  126 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef PART_H
  13. #define PART_H
  14.  
  15. // ----- Part Layer -----
  16.  
  17. #ifndef FWPART_H
  18. #include "FWPart.h"
  19. #endif
  20.  
  21. // ----- OS Layer -----
  22.  
  23. #ifndef FWBITMAP_H
  24. #include "FWBitmap.h"
  25. #endif
  26.  
  27. #ifndef FWMENU_H
  28. #include "FWMenu.h"
  29. #endif
  30.  
  31. // ----- Foundation Layer -----
  32.  
  33. #ifndef FWBNDSTR_H
  34. #include "FWBndStr.h"
  35. #endif
  36.  
  37. #include "Defines.k"
  38.  
  39. #if FW_SUPPORTS_CYBERDOG
  40. class FW_CCyberdogHelper;
  41. #endif
  42.  
  43. //========================================================================================
  44. //    Forward Declarations
  45. //========================================================================================
  46.  
  47. class CBitmapContent;
  48.  
  49. //========================================================================================
  50. //    class CBitmapPart
  51. //========================================================================================
  52.  
  53. class CBitmapPart : public FW_CPart
  54. {
  55. //----------------------------------------------------------------------------------------
  56. //    Initialization/Destruction
  57. //
  58. public:
  59.  
  60.     FW_DECLARE_AUTO(CBitmapPart)
  61.     
  62.     CBitmapPart(ODPart* odPart);
  63.     virtual ~ CBitmapPart();
  64.     
  65.     virtual void Initialize(Environment* ev, ODStorageUnit* storageUnit, FW_Boolean fromStorage);
  66.  
  67. //----------------------------------------------------------------------------------------
  68. //    Inherited API
  69. //
  70. public:
  71.     virtual FW_CContent*        NewPartContent(Environment* ev);
  72.  
  73.     virtual FW_CFrame*            NewFrame(Environment* ev, 
  74.                                      ODFrame* odFrame, 
  75.                                      FW_CPresentation* presentation,
  76.                                         FW_Boolean fromStorage);
  77.  
  78.     virtual FW_CWindow*            NewDocumentWindow(Environment* ev);
  79.  
  80.     virtual FW_Handled            DoAbout(Environment* ev);
  81.     
  82. #if FW_SUPPORTS_CYBERDOG
  83.     // These are here for the "Reload" commands. You don't need this in your
  84.     // own part; it's just a demonstration feature in ODFBitmap.
  85.     virtual FW_Handled             DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  86.     virtual FW_Handled             DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  87.     // You'll probably want these. LoadCyberItem will be called for you when
  88.     // Cyberdog wants you to load something. GetCyberdogHelper is an accessor
  89.     // which you'll need to call from your Frame subclass.
  90.     static void                 LoadCyberItem (Environment* ev, void* selfCPart);
  91.     FW_CCyberdogHelper*            GetCyberdogHelper ();
  92. #endif
  93.     
  94. //----------------------------------------------------------------------------------------
  95. //    New API
  96. //
  97. public:
  98.     void                    UpdatePresentation(Environment* ev);
  99.     void                    AdjustFramesSize(Environment* ev);
  100.  
  101. //----------------------------------------------------------------------------------------
  102. //    Data Members
  103. //
  104. private:
  105.     CBitmapContent*            fBitmapContent;
  106.     FW_CPresentation*        fBitmapPresentation;
  107. #if FW_SUPPORTS_CYBERDOG
  108.     // This is for the "Reload" stuff, which again, you don't need in your part.
  109.     FW_Boolean                 fReloadContinuously;
  110.     // You really really need this. The helper class implements all the 
  111.     // communication with the ODF-provided SOM subclass of CyberPartExtension,
  112.     // along with some basic recipes.
  113.     FW_CCyberdogHelper*     fHelper;
  114. #endif
  115. };
  116.  
  117. #if FW_SUPPORTS_CYBERDOG
  118. inline FW_CCyberdogHelper* CBitmapPart::GetCyberdogHelper ()
  119. {
  120.     return fHelper;
  121. }
  122. #endif
  123.  
  124. #endif // PART_H
  125.  
  126.