home *** CD-ROM | disk | FTP | other *** search
- #ifndef _DTJOBJCT_HPP
- #define _DTJOBJCT_HPP
-
- #include "dtobject.hpp"
- #include "dtformbs.hpp"
-
- #define JAVA_FILE_EXTENSION WTEXT(".java")
- #define JAVA_CLASS_EXTENSION WTEXT(".class")
-
- struct MMJCodeGenerationParms;
-
- enum __ControlScope {
- ePublic = 0,
- eDefault = 1,
- eProtected = 2,
- ePrivateProtected = 3,
- ePrivate = 4,
- };
-
- enum __FlowLayoutAlignment {
- eLEFT = 0,
- eCENTER = 1,
- eRIGHT = 2,
- };
-
- enum __LayoutManager {
- eNoLayoutManager = 0,
- eBorderLayout = 1,
- eCardLayout = 2,
- eFlowLayout = 3,
- eGridLayout = 4,
- eGridBagLayout = 5,
- eResizePercentLayout = 6,
- eDefaultLayout = 7,
- };
-
- enum __BorderLayoutDirection {
- eCenter = 0,
- eNorth = 1,
- eSouth = 2,
- eWest = 3,
- eEast = 4,
- };
-
- enum __GridBagConstraintsAnchor {
- eGBCCenter = 10,
- eGBCNorth = 11,
- eGBCNorthEast = 12,
- eGBCEast = 13,
- eGBCSouthEast = 14,
- eGBCSouth = 15,
- eGBCSouthWest = 16,
- eGBCWest = 17,
- eGBCNorthWest = 18,
- };
-
- enum __GridBagConstraintsFill {
- eGBCNone = 0,
- eGBCBoth = 1,
- eGBCHorizontal= 2,
- eGBCVertical = 3,
- };
-
- 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
- JAVA_CG_GENSERIALIZED, // generate all serialized info for a 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_LISTENERS, // implementation for all listener interfaces
- JAVA_CG_DECLARATION, // member declarations/initializations
-
- JAVA_CG_STYLES, // code for additional styles
- JAVA_CG_CREATE, // create code
- JAVA_CG_CREATE_ACTIVEX, // create ActiveX casting code
- JAVA_CG_CREATE_EVENT, // call the create event
- JAVA_CG_DESTROY_EVENT, // call the destroy event
- 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_TRANSCREATE, // create the transactions
- JAVA_CG_DB_QUERYCREATE, // create the queries
- JAVA_CG_DB_TRANSCONNECT, // connect the transaction
- JAVA_CG_DB_QUERYATTACH, // attach query to transaction
- 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
- JAVA_CG_PREADD, // code generated prior to the add
-
- JAVA_CG_FDX_METHODS, // implementation for FDX interface
- JAVA_CG_FDX_DECLARATION, // declarations for FDX class members
- JAVA_CG_FDX_READ, // component FDX class read
- JAVA_CG_FDX_WRITE, // component FDX class write
-
- JAVA_CG_APPCHILDSERIALIZED, // child-inspired serialized info, sent to
- // the form
- JAVA_CG_APPPARENTSERIALIZED,// child-inspired serialized info, sent from
- // form to its children
- JAVA_CG_PRE_ADDNOTIFY,
-
- JAVA_CG_MENUBAR, // generate the menus
- };
-
- class WJavaObject;
-
- class METAEXPORTCLASSDEF DTJObjectBase : public DTObjectBase
- /**********************************************************/
- {
- public:
- virtual ~DTJObjectBase();
-
- virtual WJavaObject* GetWJavaObject() const;
-
- // Returns the WJavaObject used by the form painter at
- // design time, if such an object exists.
- // Returns NULL otherwise.
- virtual WJavaObject * GetJImplementation() const;
-
- virtual WBool GetIsHollow(); // groupbox
-
- virtual WBool GetImplements( const WString & ) const;
-
- virtual void GenFileFragment( MMFileFragment fg, WStringList &,
- MMFileGenerationParms * parms ) const;
-
- // not used any more
- void GenCode( MMCodeGeneration mmCodeGen,
- WStringList& srcList ) const;
-
- WBool DoJavaPainting() const;
-
- void SetNonImplementationJavaObj( WJavaObject * javaObj );
-
- virtual WBool CanCreateNonImplementationJavaObj() const;
-
- static PropertyInspectObject * MakePropEditor_dataSource(
- const MMProperty * prop, PropertyInspector * prt,
- WUInt numObject, DTObject ** objects );
-
- static PropertyInspectObject * MakePropEditor_dataColumns(
- const MMProperty * prop, PropertyInspector * prt,
- WUInt numObject, DTObject ** objects );
-
- 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;
-
-
- //
- // Visible
- //
- // The object is currently visible.
-
- virtual WBool GetVisible();
- virtual WBool SetVisible( WBool visible );
-
- //
- // 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,
- WBool abs = FALSE );
- virtual WRect DTGetDURectangle( WBool abs = FALSE ) const;
-
- //
- // 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( WRect * rect=NULL );
-
-
- //
- // ObjectPrefix
- //
- // Get the prefix used when accessing member functions of the
- // object -- eg. "cb_1->"
-
- virtual WString GetObjectPrefix() const;
-
- //
- // IsValidContainer
- //
- // Returns true if obj is allowed as a container for this
- // DTObject. errMsg is filled in with details about
- // about why it isn't allowed.
- virtual WBool IsValidContainer(
- const DTObject *obj,
- WString &errMsg ) const;
-
- virtual void AmendPopup( WPopupMenu * popup, WBool before );
-
- WBool HandleCustomizeMenuClick( WObject *, WEventData * );
-
- virtual void GenerateCode( MMCodeGeneration mmCodeGen,
- ostream& src,
- MMCodeGenerationParms& pGenParms );
-
- virtual void EmitProperties( const WString& objPrefix,
- ostream& src ) const;
-
- virtual void EmitProperty( const WString& objPrefix, ostream& src,
- const MMProperty * prop ) const;
-
- virtual WString DTGetName() const;
-
- virtual void GenName( WUInt id, WString & ) const;
-
- virtual void PropertyChanged( const WString & name );
-
- virtual void AddEventsToList( DTUserFunctionVect* pEventList,
- WBool recurseChildren );
-
- virtual void GenEventObjectName( WString & ) const;
-
- WBool PreventUpdates();
- WBool AllowUpdates();
-
- //
- // FDX
- //
-
- virtual WBool GetDDXEnabled() const;
- virtual void SetDDXEnabled( WBool );
-
- virtual void EscapeCString( WString &, const WString & ) const;
-
- protected:
- virtual void GenerateCreate( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
- virtual void GeneratePreAdd( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
- virtual void GenerateImports( ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateEvents( ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateAddListenerCode( const WString prefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateCreateEvent( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateDestroyEvent( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual WStyle CheckExtraStyles(WStyle style);
-
- WString GetLastPart( const WString &fulltype ) const;
-
- virtual WString GetControlScope() const;
-
- private:
- WBool handleObjectLoading( WObject *, WEventData * );
-
- protected:
- DTJObjectBase( const MetaObject * pMetaObj = NULL );
-
- WBool _doJavaPainting;
- WMenuItem * _customizeMenuItem;
- WRect _latestDTRect;
- WJavaObject * _customizer;
- WJavaObject * _customizerForm;
- WJavaObject * _nonImplementationJavaObj;
- };
-
- class METAEXPORTCLASSDEF DTJObject : public DTJObjectBase
- /*******************************************************/
- {
- public:
- virtual ~DTJObject();
-
- protected:
- DTJObject( const MetaObject * pMetaObj = NULL );
- };
-
- // needed for mdreader
- typedef DTJObject DTjava__dot__lang__dot__Object__dot__102;
- typedef DTJObjectBase DTpowersoft__dot__generic__dot__Object__dot__102;
-
- #include "dttyped.hpp"
-
- class DTType_JBool_Or_Null;
- class DTType_WLong_Or_Null;
- class DTType_WInt_Or_Null;
- class DTType_WShort_Or_Null;
- class DTType_WChar_Or_Null;
- class DTType_WString_Or_Null;
- class DTType_JFont_Or_Null;
- class DTType_Color_Or_Null;
- class DTEnumType_Or_Null;
- extern DTType * METAEXPORTDEF Get_Generic_Color_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Color_Property( DTObject * obj, const DTType_Color_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Font_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Font_Property( DTObject * obj, const DTType_JFont_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_String_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_String_Property( DTObject * obj, const DTType_WString_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Boolean_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Boolean_Property( DTObject * obj, const DTType_JBool_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Long_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Long_Property( DTObject * obj, const DTType_WLong_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Int_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Int_Property( DTObject * obj, const DTType_WInt_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Short_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Short_Property( DTObject * obj, const DTType_WShort_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Char_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Char_Property( DTObject * obj, const DTType_WChar_Or_Null * val, const MMProperty * );
- extern DTType * METAEXPORTDEF Get_Generic_Enum_Property( const DTObject * obj, const MMProperty * prop );
- extern WBool METAEXPORTDEF Set_Generic_Enum_Property( DTObject * obj, const DTEnumType_Or_Null * val, const MMProperty * );
-
- #endif // _DTJOBJCT_HPP
-