home *** CD-ROM | disk | FTP | other *** search
- #ifndef _DTTYPE_HPP
- #define _DTTYPE_HPP
-
- struct MMTypeData;
- class SaveSource;
- class SaveItem;
- class MMBoolType;
-
- enum DT_Textify {
- DTT_SaveFile = 0,
- DTT_PropSheet = 1,
- DTT_GenCode = 2,
- };
-
- class DTObject;
-
- class METACLASSDEF DTType : public WObject {
- WDeclareSubclass( DTType, WObject );
-
- public:
- DTType( const MMType * imp );
- virtual ~DTType() = 0;
-
- virtual WBool MakeVariable( const WString & varname,
- WString & out );
-
- virtual WBool Textify( WString &, DT_Textify vbl ) const = 0;
- virtual WBool DeTextify( const WString &, DT_Textify vbl ) = 0;
-
- virtual WBool Save( const char *, SaveSource & save ) const;
- virtual WBool Load( SaveItem * item );
-
- virtual WBool operator==( const DTType & o ) = 0;
- virtual WBool Browse( WWindow * parent, DTObject * obj );
-
- virtual WUInt GetNumValues();
- virtual WString GetValue( WUInt i );
-
- virtual const MMType * GetData() const;
-
- private:
- const MMType * _data;
-
- #ifdef _DEBUG
- public:
- static unsigned GetNumAllocs();
- private:
- static unsigned _NumAllocs;
- #endif
- };
-
- class METACLASSDEF DTBoolType : public DTType {
- WDeclareSubclass( DTBoolType, DTType );
-
- public:
- DTBoolType( const MMType * imp );
- ~DTBoolType();
-
- virtual WBool MakeVariable( const WString & varname,
- WString & out );
-
- virtual WBool Textify( WString &, DT_Textify ) const;
- virtual WBool DeTextify( const WString &, DT_Textify );
-
- virtual WBool operator==( const DTType & o );
-
- virtual WBool Set( WBool val );
- virtual WBool Get() const;
-
- static DTType * MakeDTBool( const MMType * );
- static DTType * Instantiate( const MMType * mm ) { return MakeDTBool( mm ); }
-
- virtual MMType * GetData() const;
-
- virtual WUInt GetNumValues();
- virtual WString GetValue( WUInt i );
-
- private:
- const MMBoolType * _data;
- WBool _value;
- };
-
- class METAEXPORTCLASSDEF DTEnumType : public DTType {
- WDeclareSubclass( DTEnumType, DTType );
-
- public:
- DTEnumType( const MMType * imp );
-
- virtual WBool MakeVariable( const WString & varname,
- WString & out );
-
- virtual WBool Textify( WString &, DT_Textify ) const;
- virtual WBool DeTextify( const WString &, DT_Textify );
-
- virtual WBool operator==( const DTType & o );
-
- virtual WBool Set( long val );
- virtual WLong Get() const;
-
- virtual WUInt GetNumValues();
- virtual WString GetValue( WUInt i );
-
- static DTType * MakeDTEnumType( const MMType * );
- static DTType * Instantiate( const MMType * mm ) { return MakeDTEnumType( mm ); }
-
- private:
- long _value;
- };
-
- #endif // _DTTYPE_HPP
-