home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 48 / SENT14D.ISO / tech / delphi / disk14 / doc.pak / EXPTINTF.INT < prev    next >
Encoding:
Text File  |  1995-08-24  |  4.8 KB  |  104 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {                                                       }
  6. {       Copyright (c) 1995 Borland International        }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit Exptintf;
  11.  
  12. interface
  13.  
  14. uses WinTypes, VirtIntf, ToolIntf;
  15.  
  16. const
  17.   isExperts = 'Experts';
  18.   ExpertEntryPoint = 'INITEXPERT0012';
  19.  
  20. type
  21.   TExpertStyle = (esStandard, esForm, esProject);
  22.   TExpertState = set of (esEnabled, esChecked);
  23.  
  24.   {
  25.     This is the declaration of the pure-virtual base class for the expert
  26.     interface within the Delphi IDE.
  27.  
  28.     GetName -      REQUIRED.  This must return a unique descriptive name
  29.                    identifying this expert.
  30.     GetComment -   REQUIRED if style is esForm or es Project.  This should
  31.                    return a 1 - 2 sentence describing the function of this
  32.                    expert.
  33.     GetGlyph -     REQUIRED if style is esForm or esProject.  This should
  34.                    return a handle to a bitmap to be displayed in the form or
  35.                    project list boxes or dialogs.  This bitmap should be
  36.                    60x40 pixels.
  37.     GetStyle -     REQUIRED.  Returns one of three possible values:
  38.                    esStandard - Tells the IDE to treat the interface to
  39.                                 this expert as a menu item on the Help menu.
  40.                    esForm     - Tells the IDE to treat this expert interface
  41.                                 in a fashion similar to form templates.
  42.                    esProject  - Tells the IDE to treat this interface in a
  43.                                 fashion similar to project templates.
  44.     GetState -     REQUIRED. If the style is esStandard, esChecked will cause
  45.                    the menu to display a checkmark. NOTE: This function is
  46.                    called each time the expert is shown in a menu or listbox in
  47.                    order to determine how it should be displayed.
  48.     GetIDString -  REQUIRED. This ID string should be unique to all experts
  49.                    that could be installed.  By convention, the format of the
  50.                    string is:
  51.                    CompanyName.ExpertFunction, ex. Borland.WidgetExpert
  52.     GetMenuText -  REQURED if style is esStandard.  This should return the
  53.                    actual text to display for the menu item. NOTE: This
  54.                    function is called each time the parent menu is pulled-down,
  55.                    so it is possible to provide context sensative text.
  56.  
  57.     Execute -      REQUIRED. Called whenever this expert is invoked via the
  58.                    menu, form gallery dialog, or project gallery dialog.  The
  59.                    style will determine how the expert was invoked.
  60.  
  61.  
  62.     TExpertInitProc - defines the number and types of parameters passed to the
  63.                       single exported entry-point to the expert DLL.
  64.                       ToolServices - a pure-virtual class containing all the
  65.                                      tool services provided by the IDE.
  66.                       RegisterProc - The function to call in order to register
  67.                                      an expert.  NOTE: This function is called
  68.                                      once for each expert instance that the DLL
  69.                                      wants to register with the IDE.
  70.                       Terminate -    Set this parameter to point to a procedure
  71.                                      that will be called immediately before the
  72.                                      expert DLL is unloaded by the IDE.  Leave
  73.                                      nil, if not needed.
  74.   }
  75.  
  76.   TIExpert = class(TInterface)
  77.   public
  78.     { Expert UI strings }
  79.     function GetName: string; virtual; export; abstract;
  80.     function GetComment: string; virtual; export; abstract;
  81.     function GetGlyph: HBITMAP; virtual; export; abstract;
  82.     function GetStyle: TExpertStyle; virtual; export; abstract;
  83.     function GetState: TExpertState; virtual; export; abstract;
  84.     function GetIDString: string; virtual; export; abstract;
  85.     function GetMenuText: string; virtual; export; abstract;
  86.  
  87.     { Launch the Expert }
  88.     procedure Execute; virtual; export; abstract;
  89.   end;
  90.  
  91.   TExpertRegisterProc = function(Expert: TIExpert): Boolean;
  92.   TExpertTerminateProc = procedure;
  93.   TExpertInitProc = function(ToolServices: TIToolServices;
  94.     RegisterProc: TExpertRegisterProc;
  95.     var Terminate: TExpertTerminateProc): Boolean;
  96.  
  97. const
  98.   LibraryExpertProc: TExpertRegisterProc = nil;
  99.   ToolServices: TIToolServices = nil;
  100.  
  101. procedure RegisterLibraryExpert(Expert: TIExpert);
  102.  
  103. implementation
  104.