Class Definition File | ScrComp.idl |
Class C++ Binding | ScrComp.xh |
Class Hierarchy |
SOMObject Component ODScriptComponent |
Description | This class is the base class for all script components. A script component is a separately built and packaged dll that provides scripting support for enabled OpenDoc classes. See ODScriptExtension for a description of the requirements for making a Part scriptable. |
Methods | The methods defined by the ODScriptComponent class include: |
Overridden Methods | There are no methods overridden by the ODScriptComponent class. |
This method indicates that a script component should perform any part initialization and activate event handling for registered parts.
Signature
void ActivateScriptComponent () |
Parameters
None.
Returns
None.
Remarks
This method is called by the script extension after initialization is completed and after all current parts and classes are registered.
This method registers a class for scripting access.
Signature
ODScrRegRet AddClass (string classname) |
Parameters
Returns
Remarks
This method requests to the Script Component to add the named class to the set of classes that are available for script access in this environment.
This method registers a script extension object for scripting access.
Signature
ODScrRegRet AddContainer (SOMObject instance, string classname, string containerName, ODScriptExtension definingExt) |
Parameters
Returns
Remarks
This method indicates that the container should be added to the set of objects accessible for script access.
This method registers the object for scripting access.
Signature
ODScrRegRet AddInstance (SOMObject instance, string classname, string instanceName, ODScriptExtension definingExt) |
Parameters
Returns
Remarks
This method indicates that the instance should be added to the set of objects accessible for script access.
This method terminates scripting for this scope.
Signature
void CloseScripting () |
Parameters
None.
Returns
None.
Remarks
This method requests that the script component terminate scripting for the current scope. All scripts, registration data, and the internal state should be released.
This method removes a script extension from the scripting environment.
Signature
ODScrRegRet DropContainer (ODScriptExtension container) |
Parameters
Returns
Remarks
This method removes the indicated container from the scripting interface. Correction of references to such an object in the script code is up to the Script Component.
This method removes an instance from the scripting environment.
Signature
ODScrRegRet DropInstance (SOMObject instance) |
Parameters
Returns
Remarks
This method removes the indicated instance from the scripting interface. Correction of references to such an object in the script code is up to the Script Component.
This method is an interface to get persistent data from the component.
Signature
void GetComponentData (long *pBufferSize, void *pBuffer) |
Parameters
Returns
None.
Remarks
This interface will be invoked by the script extension when it needs the component's persistent data. This would include the actual scripts, cached descriptive information, or other information that the component needs to have saved.
The pBufferSize value is updated with the actual size of the component data pBuffer. If the size specified on the call as the input is sufficient, the buffer will receive the component data.
If the buffer size provided is not sufficient, the pBufferSize value is updated with the size that is actually required. If the buffer was large enough, then the component's data is copied to that buffer and again the pBufferSize is updated to reflect the actual size of the data.
This method initializes the interactive edit session.
Signature
void InitEditor () |
Parameters
None.
Returns
None.
Remarks
This method is a request for the Script Component to present its script editor interface with the classes and objects previously registered presented in that interface.
This method initializes the script component and provides access for that script component to the associated script extension.
Signature
void InitScriptComponent (ODScriptExtension theExt, ODBoolean hasInitData) |
Parameters
Returns
None.
Remarks
this method allows the script component to access the script extension, primarily for persistent data but other interfaces may be used.
This method releases resources before closing down.
Signature
void ReleaseAll () |
Parameters
None.
Returns
None.
Remarks
This method allows the script component to release resources prior to closing down. It is called by the ODScriptExtension prior to that object being deleted.
This method renames an object after the object is exposed to scripting.
Signature
ODBoolean Rename (SOMObject pObject, char *pNewName) |
Parameters
Returns
kODTrue | Successful completion. |
kODFalse | Name not accessed, collision, or invalid. |
None.
Remarks
This interface is provided to support a user's ability to specify a name for an object, after the object has been exposed for scripting. The name for the object should be changed by the component. Any reference correction to the old object name is the responsibility of the component.