www.marco cantu.com
|
|
Delphi Developers' Handbook
Chapter 15: Other Delphi Extensions
Copyright Marco Cantu' 1997
A Summary of the ToolsAPI
In this and the last few chapters, weÆve discussed a number of the ToolsAPI classes for extending the Delphi environment. However, other classes that relate to the Delphi environment (such as the run-time type information weÆll discuss in the next chapter) appear in the VCL source code.
What follows is a summary of the ToolsAPI, listing all of the classes in a single section. This is far from a complete reference: it is only a list of the classes defined by each unit, with short descriptions. YouÆll find additional details (primarily extended comments) in the source code files themselves, and there is no reason to duplicate that information here.
Below, you may notice that weÆve skipped a file of the ToolsAPI directory. In fact, we intentionally didnÆt include the DsgnIntf unit, since it doesnÆt define interfaces to the Delphi environment, but internal editor classes, such as component and property editors. We discussed these classes in detail in Chapters 12 and 13. Some more information on custom form designers will follow after this section.
The VirtIntf Unit
The classes in the VirtIntf unit are the base classes of the hierarchy of ToolsAPI interface classes. They are seldom used directly.
TInterface |
A generic interface class, implementing a reference-counting mechanism. Most of the other interface classes derive from this one. |
TIStream |
The abstract base class of interfaces for the internal Delphi stream classes, described in the next section. |
The IStreams Unit
The classes in the IStreams unit are the hierarchy of interface stream classes. DonÆt confuse these with the standard stream classes (discussed in Chapter 3). Each interface stream object encapsulates a corresponding stream object, used to performs the actual reading and writing operations. You can see an example of the usage of the interface stream classes in the last chapter, in the Form Wizard example.
TIVCLStreamAdapter and TIStreamAdapter |
The base classes of the other interface streams, used to map a TIStream into a plain TStream object. |
TIMemoryStream |
Implements a wrapper for the TMemoryStream class and inherits from the TIStreamAdapter class. We used this class in the form wizard example from the previous chapter. |
TIFileStream |
Implements a wrapper for a TFileStream class and inherits from the TIVCLStreamAdapter class. |
TVirtualStream |
Implements a wrapper for a generic TIStream object and inherits from the TStream class. |
The FileIntf Unit
The only class in the FileIntf unit is the base class for a virtual file system.
TIVirtualFileSystem |
Implements the virtual file system for the Delphi environment. An add-in tool might implement and use a different file system. |
- A virtual file system is a mechanism for mapping file operations onto data structures which are not file based. You should have noticed that in Delphi you can open a string list into the editor. This is accomplished with a virtual file system: the editor thinks that the string list is a file and loads it. The read and write operations on this "fake" file are mapped by a virtual file system into operations on the string list object.
The ToolIntf Unit
The classes in the ToolIntf unit include the fundamental ToolServices class, the menu interfaces, and the notifier interfaces.
TIMenuItemIntf |
The interface class for each menu item and pull-down menu of the Delphi environment. We used this class in the add-in wizard in the previous chapter. |
TIMainMenuIntf |
The interface for Delphi menu system. This is a lightweight class youÆll use to access to the menus. |
TIAddInNotifier |
Used by wizards and version control systems so that Delphi can notify them about some file or project action. We used this class in our VCS Demo. |
TIToolServices |
In practice, the interface to Delphi itself, including project information, actions you can perform, and many more features. WeÆve used the global ToolServices object of this class in many examples in this chapter and the previous two. This is frequently the entry point for other interfaces. |
The ExpIntf Unit
The only class in the ExptIntf unit is the base class of every custom wizard.
TIExpert |
The class you should derive from to create custom wizards.
We saw several examples of this class in the previous chapter. |
The VcsIntf Unit
The only class in the VcsIntf unit is the base class of every custom version control system.
TIVCSClient |
The class you should derive from to create a custom version control system. WeÆve already seen examples of this class in this chapter. |
The EditIntf Unit
The classes in the EditIntf unit include module interfaces (including resource files and others) and all the environment editors (including the source code editor, the form designer, and the components in the designer). In Delphi 3 this units includes also the "creator" classes.
TIModuleInterface |
The interface of a module: a form, a unit, a project file, a resource file, and so on. WeÆve used this in the last version of the Project VCS example. |
TIModuleNotifier |
A notifier for the module, with more notifications than a generic project notifier. WeÆve used this in the last version of the Project VCS example. |
TIResourceFile |
The interface to a resource file. |
TIResourceEntry |
The interface to an entry within a resource file. |
TIComponentInterface |
The interface for a component at design-time. |
TIFormInterface |
The interface for a form at design-time. |
TIEditorInterface |
The interface for a module loaded in the editor. |
TIEditReader |
The interface for reading text in the editor. |
TIEditWriter |
The interface for writing text in the editor. WeÆve used this in the last version of the Project VCS example. |
TIEditView |
The interface for setting the reading or writing position within an editor file. |
TIProjectCreator |
The interface used by the ToolServices.ProjectCreate method to initialize a new project in a flexible way. |
TIModuleCreator |
The interface used by the ToolServices.ModuleCreate method to add a new unit to a project in a flexible way. |
|