home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / icompnen.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.6 KB  |  128 lines

  1. /*******************************************************************************
  2. * FILE NAME: icompnen.hpp                                                      *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *   Declaration of the classes:                                                *
  6. *     IComponent                                                               *
  7. *                                                                              *
  8. * COPYRIGHT:                                                                   *
  9. *   IBM Open Class Library                                                     *
  10. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  11. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  12. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  13. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  14. *                                                                              *
  15. *   Portions or this component are based on work originating from Taligent.    *
  16. *   (C) Copyright Taligent, Inc. 1996 - All rights reserved.                   *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _ICOMPNEN_
  20. #define _ICOMPNEN_
  21.  
  22. #include <ipoint.hpp>
  23. #include <istdntfy.hpp>
  24. #include <istring.hpp>
  25.  
  26. // Forward References
  27. class IModel;
  28. class IGUIBundle;
  29. class IDocumentStorage;
  30. class IComponentImp;
  31.  
  32. // classes defined in this module
  33. class IComponent;
  34.  
  35. #pragma pack(4)
  36.  
  37.  
  38. /*******************************************************************************
  39. *                                                                              *
  40. *                           IComponent                                         *
  41. *                                                                              *
  42. *******************************************************************************/
  43.  
  44. class IComponent : public IVBase
  45. {
  46. public:
  47.  
  48. /*----------------------- Construction/Destruction ---------------------------*/
  49.  
  50.                             IComponent();
  51.     virtual void            initialize(IGUIBundle& bundle, IModel* adoptedModel);
  52.     virtual                 ~IComponent();
  53.     
  54.  
  55. /*----------------------------- Adopt/orphan ---------------------------------*/
  56.  
  57.     virtual void            adoptModel(IModel*);
  58.     virtual IModel*         orphanModel();
  59.  
  60.     
  61. /*----------------------------- Informational --------------------------------*/
  62.  
  63.     virtual Boolean         isStructuredStorage() const;    
  64.     Boolean                 isContainer() const;
  65.     Boolean                 isEmbedded() const;
  66.     
  67.     INotifier&              notifier();    
  68.     IGUIBundle&             bundle() const;
  69.     IModel*                 model() const;
  70.     IDocumentStorage&       storage() const;
  71.  
  72.     const IString&          documentName() const;
  73.  
  74.  
  75. /*--------------------------- Title Components -------------------------------*/
  76.     
  77.     void                    setDocumentName( const IString& name );
  78.  
  79.  
  80. /*--------------------- Sizing Notification Handlers -------------------------*/
  81.  
  82.     enum EAspect
  83.     {
  84.         kContent    = 1, // DVASPECT_CONTENT
  85.         kThumbnail  = 2, // DVASPECT_THUMBNAIL
  86.         kIcon       = 4, // DVASPECT_ICON
  87.         kDocPrint   = 8  // DVASPECT_DOCPRINT
  88.     };
  89.  
  90.     ISize                   handleGetArea( const EAspect ) const;
  91.     void                    handleSetArea( const EAspect, const ISize& );
  92.     
  93.  
  94. #ifdef IC_LIBRARYUSEONLY
  95.     ISize                   contentSize() const;
  96.     IComponentImp*          objectInstance() const;
  97.     void                    setInitialSize();
  98.     const IString&          uniqueDocumentName() const;
  99.     
  100.     static INotificationId  ContentsReplacedId;
  101. #endif
  102.     
  103. private:
  104.     IComponent&             operator=( const IComponent& );
  105.  
  106.     IString                 fDocumentName; // will be file name or "untitled"
  107.     IString                 fUniqueDocumentName; // will be file name or unique time-stamped name
  108.     IStandardNotifier       fNotifier;
  109.     
  110.     IModel*                 fpModel;
  111.     IGUIBundle*             fpBundle;
  112.     IDocumentStorage*       fpStorage;
  113.     IComponentImp*          fpImplementation;
  114.  
  115.     ISize                   fExtent; // content extent in HiMetric
  116.  
  117. friend class IComponentImp;
  118. friend class IModel;
  119. };
  120.  
  121.   #include <icompnen.inl>
  122.  
  123.  
  124. #pragma pack()
  125.  
  126.  
  127. #endif // _ICOMPNEN_
  128.