home *** CD-ROM | disk | FTP | other *** search
- #ifndef _MMCOMPLB_HPP
- #define _MMCOMPLB_HPP
-
- // TODO: FIXME: DJB put this in, ITB will take out
- #pragma warning 849 9
-
- #include "mmcommon.hpp"
-
- class MetaObject;
- class MMReferenceNode;
- class WStringList;
- class DTFormEditBase;
- class MTPropertySheetBase;
- class DTWForm;
- struct MMLibraryData;
- struct MMPropertySheetThunk;
- struct MMFunctionData;
- class DTRegistryKey;
- class DTCodeBlockBase;
-
- class DTObject;
- class DTWObject;
-
- // MMLexusInterfaceBase:
- // this class represents Lexus to CompDll
-
- typedef WBool WCMDEF (*EnumDTFormCB)( DTObject *form, void *userdata );
-
- class IFormEditor;
- class IControl;
- struct MMFormInfo {
- WString name;
- IFormEditor *iFormEditor;
- const IControl *iControl;
- };
- struct MMControlInfo {
- WString instanceName;
- WString className;
- IControl *iControl;
- };
-
- class METADEF MMLexusInterfaceBase {
- public:
- enum Sheet {
- TabControlEdit,
- GridProperties,
- PictureProperty,
- };
-
- enum ClassType {
- CT_OleServerObject,
- CT_OleInterface,
- };
-
- enum ViewWindow {
- VW_Classes,
- VW_Files,
- VW_Objects,
- VW_Resources,
- VW_ObjectInspector,
- VW_Targets,
- };
-
- enum LoadOption {
- LO_Load, // Load the form if required
- LO_Check, // Don't load the form -- just check
- };
-
- public:
- virtual void OpenViewWindow( ViewWindow window ) = 0;
-
- virtual MTPropertySheetBase * MakePropertySheet(
- Sheet,
- const MMPropertySheet * ) = 0;
-
- virtual DTFormEditBase * FindForm(
- const WString &,
- WWindow *parent = NULL,
- WTabControl *tc = NULL ) = 0;
-
- virtual DTFormEditBase * CreateTabForm(
- WString &formName,
- WWindow *parent,
- WTabControl *tabcontrol ) = 0;
-
- virtual DTFormEditBase * CreatePropertySheetItem(
- WString & formName,
- WWindow * parent,
- WTabControl * tabControl ) = 0;
-
- virtual WBool GetImage(
- DTObject * obj,
- const WString & name,
- WBitmap & bmp,
- WIcon & ico,
- WCursor & cur ) = 0;
-
- virtual void GetImages( DTObject * obj,
- const WString & type,
- WStringList & icons ) = 0;
-
- virtual void EnumDTForms(
- EnumDTFormCB rtn,
- void * user ) = 0;
-
- virtual void GetFormList( WArray<MMFormInfo> &list ) = 0;
- virtual void GetControlList( IFormEditor *form,
- WArray<MMControlInfo> &list ) = 0;
- virtual DTObject * GetControlDTObject( IControl *control,
- LoadOption option = LO_Load ) = 0;
-
- virtual WFilePath GetFormFilePath(
- DTWForm * form ) = 0;
-
- virtual void ObjectSelected(
- DTObject * obj ) = 0;
-
- virtual DTRegistryKey * GetRegistryKey() = 0;
-
- virtual WBool ValidateIdentifier( const WString & str,
- WString & message ) = 0;
-
- virtual WBool NotifyView( long event ) = 0;
-
- virtual WStringArray GetClassList( ClassType, DTObject * ) = 0;
-
- /* Start the tab editor. Invokes FormEdit::StartTabDlg on
- the current formedit.
- */
- virtual void StartTabDlg() = 0;
-
- /* Start the menu editor. Invokes FormPaint::StartMenuDlg on
- the current formedit's form painter. The menuClass string
- is the name of the menu component's class that should be
- instantiated if there isn't a menu already on the form.
- */
- virtual void StartMenuDlg( const WString & menuClass ) = 0;
-
- /* If you have a hot key control, and you don't want Optima++ to
- pay attention to the keys you press, turn stifling off. Just
- turn it back on when you're done.
- */
- virtual void StifleGlobalAccelerators( WBool onOff ) = 0;
- };
-
- struct WDMLibraryData {
- WUInt numFunctions[ MMFT_NumFunctionTypes ];
- MMFunctionData * functions[ MMFT_NumFunctionTypes ];
- };
-
-
- class METAEXPORTCLASSDEF MMComponentLib : public MMCommon {
- public:
- MMComponentLib( WDMLibraryData * data );
- virtual ~MMComponentLib();
-
- virtual WBool Initialize();
- virtual WBool Finalize();
- virtual int NumMetaObjects();
- virtual MetaObject * GetMetaObject( unsigned i );
-
- virtual WForm * MakeObjectInspector(
- WWindow * parent,
- const WRect & r,
- const WChar * title,
- WStyle stl, WStyle ex_style ) const;
- virtual WForm * GetObjectInspector() const;
- virtual void CloseObjectInspector();
-
- virtual void MoveToEventPage() const;
- virtual void MoveToPropertyPage() const;
- virtual void ObjectInspectorSelect(
- WUInt numObjects,
- DTObject ** ) const;
- virtual void ObjectInspectorKey( WCharacterPressEventData * data );
- virtual void RefreshProperties() const;
-
- virtual WULong GetCompDLLVersion() const;
- virtual WULong GetLibraryVersion() const;
- virtual WConstantString GetRefTag() const;
- virtual WConstantString GetDescription() const;
- virtual WBool GetIsOle() const;
-
- virtual MMLanguage GetLanguage() const;
-
- virtual WUInt GetNumIncludes() const;
- virtual WConstantString GetInclude( WUInt idx ) const;
-
- virtual const MMReferenceNode * GetReferenceRoot();
-
- virtual WBool operator==( const MMComponentLib & o ) const;
-
- virtual const WModule & GetModule() const;
- virtual WBool SetModule( const WModule & );
-
- virtual void GenHeaderNames( WStringList & ) const;
-
- virtual void SetLexusInterface( MMLexusInterfaceBase * );
- virtual MMLexusInterfaceBase * GetLexusInterface() const;
- virtual MTPropertySheetBase * MakePropertySheet( MMLexusInterfaceBase::Sheet,
- const MMPropertySheet * ) const;
- virtual DTFormEditBase * FindForm( const WString &,
- WWindow *parent = NULL,
- WTabControl *tc = NULL ) const;
- virtual DTFormEditBase * CreateTabForm( WString &formName,
- WWindow *parent,
- WTabControl *tabcontrol ) const;
- virtual DTFormEditBase * CreatePropertySheetItem(
- WString &formName,
- WWindow *parent,
- WTabControl *tabcontrol ) const;
- virtual WBool GetImage(
- DTObject * obj,
- const WString & name,
- WBitmap & bmp,
- WIcon & ico,
- WCursor & cur ) const;
-
- virtual WUInt GetNumEnumerators() const;
- virtual const MMEnumerator * GetEnumerator( MMIndex idx ) const;
- virtual WUInt GetNumTypes() const;
- virtual const MMType * GetType( MMIndex idx ) const;
- virtual WUInt GetNumEvents() const;
- virtual const MMEvent * GetEvent( MMIndex idx ) const;
- virtual WUInt GetNumEventOverrides() const;
- virtual const MMEventOverride * GetEventOverride( MMIndex idx ) const;
- virtual WUInt GetNumParameters() const;
- virtual const MMParameter * GetParameter( MMIndex idx ) const;
- virtual WUInt GetNumParameterSets() const;
- virtual const MMParameterSet * GetParameterSet( MMIndex idx ) const;
- virtual WUInt GetNumStyles() const;
- virtual const MMStyle * GetStyle( MMIndex idx ) const;
- virtual WUInt GetNumProperties() const;
- virtual const MMProperty * GetProperty( MMIndex idx ) const;
- virtual WUInt GetNumMethods() const;
- virtual const MMMethod * GetMethod( MMIndex idx ) const;
- virtual WUInt GetNumPropertyGroups() const;
- virtual const MMPropertyGroup * GetPropertyGroup( MMIndex idx ) const;
- virtual WUInt GetNumPropertyControls() const;
- virtual const MMPropertyControl *GetPropertyControl( MMIndex idx ) const;
- virtual WUInt GetNumPropertySheets() const;
- virtual const MMPropertySheet * GetPropertySheet( MMIndex idx ) const;
- virtual WUInt GetNumComponents() const;
- virtual const MMComponent * GetComponent( MMIndex idx ) const;
- virtual WUInt GetNumReferenceNodes() const;
- virtual const MMReferenceNode * GetReferenceNode( MMIndex idx ) const;
- virtual const MMString * GetStringTable( MMIndex ) const;
- virtual MMIndex GetIndex( MMIndex ) const;
- virtual WBool GetString( MMString, WConstantString & str ) const;
-
- virtual WUInt GetNumFunctions( MMFunctionType ) const;
- virtual void * GetFunction( MMFunctionType, WUInt ) const;
- virtual WString GetFunctionName( MMFunctionType, WUInt ) const;
- virtual void * FindFunction( MMFunctionType, const WString & ) const;
-
- virtual MMSetPropFn GetSetPropFn( MMSetFnIndex idx ) const;
- virtual MMGetPropFn GetGetPropFn( MMGetFnIndex idx ) const;
- virtual MMMakePropSheet GetMakePropSheetFn( MMPropSheetFnIndex idx ) const;
- virtual MMMakePropControl GetMakePropControlFn( MMPropCtrlFnIndex idx ) const;
- virtual MMMakeDTObject GetMakeDTObjectFn( MMDTInstFnIndex idx ) const;
- virtual MMMakeDTType GetMakeDTTypeFn( MMDTTypeFnIndex idx ) const;
- virtual MMPropDefault GetPropDefFn( MMPropDefFnIndex idx ) const;
- virtual MMPropMakeEditor GetPropMakeEditorFn( MMPropMakeEditorFnIndex idx ) const;
- virtual WRange GetDataRange();
-
- virtual WUInt GetRefCount() const;
- virtual void IncrementRefCount();
- virtual void DecrementRefCount();
-
- virtual MMComponentLib * GetFirstLibrary() const;
- virtual MMComponentLib * GetDTWClassLibrary() const;
- virtual MMComponentLib * GetNextLibrary() const;
- virtual MMComponentLib * FindLibrary( const WString & name ) const;
-
- static const MetaObject * FindComponent( const WString & );
- static MMComponentLib * FindLibrary( const MMCommon * );
- inline static MMComponentLib * FindLibrary( WInt );
-
- protected:
- static MMComponentLib * _DTWClassFirst;
- static MMComponentLib * _First;
- WDMLibraryData * _dmData;
- WModule _theModule;
- static MMLexusInterfaceBase *_lexus;
- WRange _libDataRange;
- MMComponentLib * _next;
- WInt _referenceCount;
-
- MMEnumerator * _enumerators;
- MMType * _types;
- MMEvent * _events;
- MMEventOverride * _eventOverrides;
- MMStyle * _styles;
- MMProperty * _properties;
- MMMethod * _methods;
- MMParameter * _parameters;
- MMParameterSet * _parameterSets;
- MMPropertyGroup * _propertyGroups;
- MMPropertyControl * _propertyControls;
- MMPropertySheet * _propertySheets;
- MetaObject * _components;
- MMReferenceNode * _referenceNodes;
-
- const MMPropertySheetThunk *_propSheetThunk;
- const MMPropertySheet ** _propSheetReloc;
- const MMString * _stringTables;
- const MMIndex * _indices;
- const WChar * _strings;
- WUInt _stringLen;
- const WByte * _bufferData;
- WUInt _bufferLen;
- const MMLibraryData * _libData;
- };
-
- #ifdef __BUILDING_DTWCM_DLL__
- inline static MMComponentLib * MMComponentLib::FindLibrary( WInt obj )
- /********************************************************************/
- {
- MMComponentLib * lib;
-
- if( obj == -1 ) {
- return( _DTWClassFirst );
- }
-
- for( lib = _First; lib != NULL; lib = lib->_next ) {
- if( obj >= lib->_libDataRange.start && obj <= lib->_libDataRange.end ) {
- return lib;
- }
- }
-
- return NULL;
- }
-
- // sorry, has to go here for header file ordering issues
- inline MMComponentLib * MMCommon::GetLib() const
- /**********************************************/
- {
- return MMComponentLib::FindLibrary( (WUInt)_data );
- }
- #endif
-
- extern "C" {
- typedef MMComponentLib * __export __stdcall (*MMGetComponentLibFn)();
- #define MMGETCOMPONENTLIB "_MMGetComponentLib@0"
- };
-
- #define MMRC_WD_CONFIG "WDCFG"
-
- // TODO: FIXME: DJB put this in, ITB will take out
- #pragma warning 849 1
-
- #endif // _MMCOMPLB_HPP
-