home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
DTJOBJCT.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-12-28
|
7KB
|
218 lines
#ifndef _DTJOBJECT_HPP
#define _DTJOBJECT_HPP
#include "dtobject.hpp"
#include "dtformbs.hpp"
#define JAVA_FILE_EXTENSION WTEXT(".java")
#define JAVA_CLASS_EXTENSION WTEXT(".class")
struct MMJFileGenerationParms;
enum __ControlScope {
ePublic = 0,
eDefault = 1,
eProtected = 2,
ePrivateProtected = 3,
ePrivate = 4,
};
enum MMJFileFragment {
JAVA_CG_GENFORM, // generate all code for a form
JAVA_CG_GENHTML, // generate the html for an applet
JAVA_CG_GENACTIVEX_HOOKS, // for applets only: generate the hooks
// that communicate between the actual
// applet and the applet form
};
enum MMJCodeGeneration {
JAVA_CG_IMPORTS, // package imports
JAVA_CG_CONSTRUCTOR, // the class constructor
JAVA_CG_FINALIZER, // finalizer (ie destructor) code
JAVA_CG_HANDLE_EVENT, // event handler
JAVA_CG_DECLARATION, // member declarations/initializations
JAVA_CG_STYLES, // code for additional styles
JAVA_CG_CREATE, // create code
JAVA_CG_DESTROY, // destroy code
JAVA_CG_AUTO, // any code like auto connection code that
// will be generated in the create just before
// the form is made visible
JAVA_CG_DB_TRANSCONNECT, // connect the transaction
JAVA_CG_DB_CREATEQUERY, // create the query
JAVA_CG_DB_SETSQL, // set the SQL for the query
JAVA_CG_DB_AUTOOPENQUERY, // open the query
JAVA_CG_QUERY_DESTROY, // destroy the query
JAVA_CG_TRANS_DISCONNECT, // disconnect the transaction
JAVA_CG_CHILDMETHODS, // child-inspired methods, sent to form
JAVA_CG_PARENTMETHODS, // child-inspired methods, sent from form
// its children
JAVA_CG_APPCHILDMETHODS, // child-inspired applet methods, sent to form
JAVA_CG_APPPARENTMETHODS, // child-inspired applet methods, sent from
// form to its children
JAVA_CG_APPCHILDHTML, // child-inspired applet HTML code, sent to
// form
JAVA_CG_APPPARENTHTML, // child-inspired applet HTML code, sent from/
// form to its children
JAVA_CG_EVENTS, // generate the events for a component
JAVA_CG_ADDLISTENER, // generate the add listener calls for the component
};
class METAEXPORTCLASSDEF DTJObject : public DTObjectBase
/******************************************************/
{
public:
virtual ~DTJObject();
virtual WBool GetIsHollow(); // groupbox
virtual void GenFileFragment( MMFileFragment fg, WStringList &,
MMFileGenerationParms * parms ) const;
// not used any more
void GenCode( MMCodeGeneration mmCodeGen,
WStringList& srcList ) const;
public:
// override this to demangle the Meta object name
virtual void GenClassName( WString & ) const;
//
// Style
//
// The Windows style property of the associated Window.
// This doesn't necessarily match GetWindow()->GetStyle()
// because some styles are deferred until run-time (such
// as WSVisible).
virtual WStyle GetStyle() const;
virtual WBool SetStyle( WStyle stl, WBool clone=FALSE );
//
// DefaultStyle
//
// The style with which new instances are created. Default
// implementation returns GetWindow()->GetDefaultStyle().
virtual WStyle GetDefaultStyle() const;
//
// ExtendedStyle
//
// The ExtendedStyle property of the window nature.
virtual WStyle GetExtendedStyle() const;
virtual WBool SetExtendedStyle( WStyle style, WBool clone=FALSE );
//
// DefaultExtendedStyle
//
// See DefaultStyle
virtual WStyle GetDefaultExtendedStyle() const;
//
// Create
//
// Call Create on the windowed object.
//
virtual WBool Create( WWindow * parent, const WRect & r,
const WChar * text, WStyle style,
WStyle exStyle, void * data = NULL,
WBool isLoading = FALSE );
//
// Rectangle
//
// The pixel-based position of the object; optionally, absolute
// to the desktop.
virtual void DTGetRectangle( WRect & r,
WBool abs = FALSE ) const;
virtual void DTSetRectangle( const WRect & r );
//
// ClientRectangle
//
// Get the client rectangle. This is mainly used for DTForms.
virtual void DTGetClientRectangle( WRect & r ) const;
//
// RCRectangle
//
// The rectangle to use in the .rc file (still in pixel though).
// This differs for WComboBox, which gives a .rc file rectangle
// of the correct height instead of the design time height.
virtual void DTGetRCRectangle( WRect & r ) const;
//
// PixelsToDLU / DLUToPixels
//
// Map between pixels and dialog units (DLU).
virtual WRect DTMapPixelsToDLU( const WRect & pix ) const;
virtual WRect DTMapDLUToPixels( const WRect & dlu ) const;
//
// BringToTop
//
// Bring the object to the top of the Z- order
virtual void DTBringToTop();
//
// Repaint
//
// Invalidate an object and cause it to be repainted
virtual void DTRepaint();
//
// ObjectPrefix
//
// Get the prefix used when accessing member functions of the
// object -- eg. "cb_1->"
WString GetObjectPrefix() const;
virtual void GenerateCode( MMCodeGeneration, ostream &, MMCodeGenerationParms & );
virtual void GenerateCode( MMJCodeGeneration mmCodeGen,
WStringList& srcList,
MMJFileGenerationParms* pGenParms ) const;
virtual void AddEventsToList( DTCodeBlockList* pEventList );
protected:
virtual void GenerateImports( WStringList& srcList,
MMJFileGenerationParms* pGenParms ) const;
virtual void GenerateEvents( WStringList& source,
MMJFileGenerationParms* pGenParms ) const;
virtual void GenerateAddListenerCode( const WString prefix,
WStringList& srcList,
MMJFileGenerationParms* pGenParms ) const;
virtual WStyle CheckExtraStyles(WStyle style);
WString GetLastPart( const WString &fulltype ) const;
protected:
DTJObject( const MetaObject * pMetaObj = NULL );
};
#endif // _DTJOBJECT_HPP