home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 September / dppcpro0998.iso / Rwc / Sybase / Install.exe / hpp.z / DTTYPE.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  3.2 KB  |  112 lines

  1. #ifndef _DTTYPE_HPP
  2. #define _DTTYPE_HPP
  3.  
  4. struct MMTypeData;
  5. class  SaveSource;
  6. class  SaveItem;
  7. class  MMBoolType;
  8.  
  9. enum DT_Textify {
  10.     DTT_SaveFile  = 0,
  11.     DTT_PropSheet = 1,
  12.     DTT_GenCode   = 2,
  13. };
  14.  
  15. class DTObject;
  16.  
  17. class METACLASSDEF DTType : public WObject {
  18.     WDeclareSubclass( DTType, WObject );
  19.  
  20.     public:
  21.         DTType( const MMType * imp );
  22.         virtual ~DTType() = 0;
  23.  
  24.         virtual WBool       MakeVariable( const WString & varname,
  25.                                           WString & out );
  26.     
  27.         virtual WBool       Textify( WString &, DT_Textify vbl ) const = 0;
  28.         virtual WBool       DeTextify( const WString &, DT_Textify vbl ) = 0;
  29.  
  30.         virtual WBool       Save( const char *, SaveSource & save ) const;
  31.         virtual WBool       Load( SaveItem * item );
  32.  
  33.         virtual WBool       operator==( const DTType & o ) = 0;
  34.         virtual WBool       Browse( WWindow * parent, DTObject * obj );
  35.  
  36.         virtual WUInt       GetNumValues();
  37.         virtual WString     GetValue( WUInt i );
  38.  
  39.         virtual const MMType *  GetData() const;
  40.  
  41.     private:
  42.         const MMType *  _data;
  43.  
  44. #ifdef _DEBUG
  45.     public:
  46.         static unsigned     GetNumAllocs();
  47.     private:
  48.         static unsigned     _NumAllocs;
  49. #endif
  50. };
  51.  
  52. class METACLASSDEF DTBoolType : public DTType {
  53.     WDeclareSubclass( DTBoolType, DTType );
  54.  
  55.     public:
  56.         DTBoolType( const MMType * imp );
  57.         ~DTBoolType();
  58.  
  59.         virtual WBool       MakeVariable( const WString & varname,
  60.                                           WString & out );
  61.     
  62.         virtual WBool       Textify( WString &, DT_Textify ) const;
  63.         virtual WBool       DeTextify( const WString &, DT_Textify );
  64.  
  65.         virtual WBool       operator==( const DTType & o );
  66.  
  67.         virtual WBool       Set( WBool val );
  68.         virtual WBool       Get() const;
  69.  
  70.         static DTType *     MakeDTBool( const MMType * );
  71.         static DTType *     Instantiate( const MMType * mm ) { return MakeDTBool( mm ); }
  72.  
  73.         virtual MMType * GetData() const;
  74.  
  75.         virtual WUInt       GetNumValues();
  76.         virtual WString     GetValue( WUInt i );
  77.  
  78.     private:
  79.         const MMBoolType *      _data;
  80.         WBool                   _value;
  81. };
  82.  
  83. class METAEXPORTCLASSDEF DTEnumType : public DTType {
  84.     WDeclareSubclass( DTEnumType, DTType );
  85.  
  86.     public:
  87.         DTEnumType( const MMType * imp );
  88.         ~DTEnumType();
  89.  
  90.         virtual WBool       MakeVariable( const WString & varname,
  91.                                           WString & out );
  92.     
  93.         virtual WBool       Textify( WString &, DT_Textify ) const;
  94.         virtual WBool       DeTextify( const WString &, DT_Textify );
  95.  
  96.         virtual WBool       operator==( const DTType & o );
  97.  
  98.         virtual WBool       Set( long val );
  99.         virtual WLong       Get() const;
  100.  
  101.         virtual WUInt       GetNumValues();
  102.         virtual WString     GetValue( WUInt i );
  103.  
  104.         static DTType *     MakeDTEnumType( const MMType * );
  105.         static DTType *     Instantiate( const MMType * mm ) { return MakeDTEnumType( mm ); }
  106.  
  107.     private:
  108.         long                    _value;
  109. };
  110.  
  111. #endif // _DTTYPE_HPP
  112.