home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / hpp.z / MTOBJECT.HPP < prev    next >
C/C++ Source or Header  |  1996-12-03  |  3KB  |  90 lines

  1. #ifndef _MTOBJECT_HPP
  2. #define _MTOBJECT_HPP
  3.  
  4. #include "mtdef.hpp"
  5. #include "mmcomp.hpp"
  6.  
  7. class WStringList;
  8.  
  9. class DTObject;
  10. class MTPropertyDialog;
  11. class MTHashTable;
  12.  
  13. enum MMBitmapSize {
  14.     MMBmpS_Small,       // 16 x 16
  15.     MMBmpS_Medium,      // 24 x 24
  16.     MMBmpS_Large,       // 32 x 32
  17.     MMBmpS_NumSizes,
  18. };
  19.  
  20. class METACLASSDEF MetaObject : public MMComponent {
  21.     public:
  22.         MetaObject( const MMComponentData * data );
  23.         MetaObject();
  24.         MetaObject( const MetaObject & o );
  25.         MetaObject & operator=( const MetaObject & o );
  26.         virtual ~MetaObject();
  27.  
  28.         virtual WConstantString             GetName() const;
  29.         virtual WBool                       GetDerivedFrom( const WString & ) const;
  30.  
  31.         virtual const MMEventList &         EventList() const;
  32.         virtual const MMStyleList &         StyleList() const;
  33.         virtual const MMPropertyList &      PropertyList() const;
  34.         virtual const MMMethodList &        MethodList() const;
  35.         virtual const MMPropertySheetList & PropertySheetList() const;
  36.  
  37.         virtual DTObject *              Instantiate() const;
  38.  
  39.         virtual WBool                   GetBitmap( WBitmap & bmp,
  40.                                                 MMBitmapSize size ) const;
  41.         virtual WBool                   GetIcon( WIcon & bmp,
  42.                                                 MMBitmapSize size ) const;
  43.  
  44.         virtual MTPropertyDialog *      CreatePropDialog() const;
  45.  
  46.         virtual WBool                   CreateEventPopupMenu( DTObject *,
  47.                                                               WPopupMenu * ) const;
  48.         virtual MetaObject *            GetBaseObject() const;
  49.  
  50.         virtual WStyle                  GetMappedMask() const;
  51.         virtual WStyle                  GetExMappedMask() const;
  52.  
  53.         virtual const MMProperty *      FindProperty( const char * ) const;
  54.         virtual const MMStyle *         FindStyle( const char * ) const;
  55.  
  56.         virtual WUInt                   GetNumMappedProperties() const;
  57.         virtual const MMProperty *      GetMappedProperty( WUInt idx ) const;
  58.  
  59.     private:
  60.         virtual WBool           InitMetaObject();
  61.         void                    InitFindProps();
  62.         friend class            MMComponentLib;
  63.  
  64.     private:
  65.         MetaObject *            _base;
  66.         WConstantString         _name;
  67.         WBool                   _initialized;
  68.  
  69.         WBool                   _eventListInit;
  70.         WBool                   _styleListInit;
  71.         WBool                   _propertyListInit;
  72.         WBool                   _methodListInit;
  73.         WBool                   _propertySheetListInit;
  74.         WBool                   _mappedPropertyListInit;
  75.  
  76.         MMEventList             _eventList;
  77.         MMStyleList             _styleList;
  78.         MMPropertyList          _propertyList;
  79.         MMMethodList            _methodList;
  80.         MMPropertySheetList     _propertySheetList;
  81.  
  82.         MMPropertyList          _mappedProperties;
  83.  
  84.         MTHashTable *           _findProperties;
  85.         MTHashTable *           _findStyles;
  86. };
  87. typedef MetaObject MetaWObject;
  88.  
  89. #endif // _MTOBJECT_HPP
  90.