home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / DTCODEBK.HPP < prev    next >
C/C++ Source or Header  |  1996-12-14  |  2KB  |  72 lines

  1. #ifndef _DTCODEBK_HPP
  2. #define _DTCODEBK_HPP
  3.  
  4. #if defined( _DEBUG ) && defined( new )
  5. #   undef new
  6. #   undef delete
  7. #   define _REDEFINE_WNEW
  8. #endif
  9.  
  10. #include <wcvector.h>
  11.  
  12. #ifdef _REDEFINE_WNEW
  13. #   include "wnew.hpp"
  14. #endif
  15.  
  16. #include "mtdef.hpp"
  17.  
  18. class MMEvent;
  19. class WStringList;
  20. class SaveSource;
  21. class SaveBlock;
  22. class DTObject;
  23. class ostream;
  24.  
  25. class METACLASSDEF DTCodeBlockBase {
  26.     public:
  27.         inline virtual ~DTCodeBlockBase() = 0;
  28.  
  29.         virtual void   AddDbgLine( int sourceLine ) = 0;
  30.  
  31.         virtual WString         GetName() const = 0;
  32.         virtual const MMEvent * GetEventDef() const = 0;
  33.         virtual int operator == ( const DTCodeBlockBase & ) const = 0;
  34.         virtual int operator <  ( const DTCodeBlockBase & ) const = 0;
  35.     
  36.         virtual void GenPrototype( WStringList & src,
  37.                                     const WString & obj_name ) = 0;
  38.         virtual void GenMembers( WStringList & src ) = 0;
  39.         virtual void GenRTCode( WStringList & src,
  40.                                     const WString & pfx,
  41.                                     const WString & name ) = 0;
  42.         virtual void    GetEventFuncName( WString &name ) = 0;
  43.  
  44.         virtual DTObject *      GetDTObj() = 0;
  45.  
  46.         virtual WBool EditEvent( WBool visible = TRUE ) = 0;
  47.         virtual WBool HasCode() const = 0;
  48.         virtual void  SetEventOwner( DTObject * owner ) = 0;
  49.  
  50.         virtual WBool Save( SaveSource & save ) = 0;
  51.         virtual WBool Load( SaveBlock * load ) = 0;
  52.  
  53.         //
  54.         // New style code generation:
  55.         //    Prototype     -- "WBool cb_1_Click( WObject *, WEventData * );"
  56.         //    EventHandler  -- { WClickEvent, WEventHandlerCast(...) },
  57.         //    Members       -- the .cpp definition
  58.         virtual void GeneratePrototype( ostream &, const WString & obj ) = 0;
  59.         virtual void GenerateEventHandler( ostream &, const WString & obj ) = 0;
  60.         virtual void GenerateMembers( ostream & ) = 0;
  61.  
  62. };
  63.  
  64. inline DTCodeBlockBase::~DTCodeBlockBase() {}
  65.  
  66. //typedef WCPtrSortedVector< DTCodeBlockBase > DTCodeBlockList;
  67. class  DTCodeBlockList :  public WCPtrSortedVector< DTCodeBlockBase > {};
  68.  
  69. class  DTCodeBlockListList :  public WCPtrOrderedVector< DTCodeBlockList > {};
  70.  
  71. #endif // _DTCODEBK_HPP
  72.