home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Source / Toolsapi / EDITINTF.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  29.3 KB  |  585 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Visual Component Library         }
  5. {                                                       }
  6. {       Copyright (c) 1995,99 Inprise Corporation       }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit EditIntf;
  11.  
  12. interface
  13.  
  14. uses SysUtils, Windows, VirtIntf;
  15.  
  16. const
  17.   cursorPos = Integer(0);
  18.   ViewTopPos = Integer(1);
  19.  
  20.   atWhiteSpace     = 0;
  21.   atComment        = 1;
  22.   atReservedWord   = 2;
  23.   atIdentifier     = 3;
  24.   atSymbol         = 4;
  25.   atString         = 5;
  26.   atNumber         = 6;
  27.   atFloat          = 7; // not used in Pascal tokenizer
  28.   atOctal          = 8; // not used in Pascal tokenizer
  29.   atHex            = 9; // not used in Pascal tokenizer
  30.   atCharacter      = 10; // not used in Pascal tokenizer
  31.   atPreproc        = 11; // not used in Pascal tokenizer
  32.   atIllegal        = 12; // not used in Pascal tokenizer
  33.   atAssembler      = 13;
  34.   SyntaxOff        = 14;
  35.  
  36.   MarkedBlock      = 15;
  37.   SearchMatch      = 16;
  38.  
  39.   lfCurrentCSIP         = $0001;
  40.   lfBreakpointEnabled   = $0002;
  41.   lfBreakpointDisabled  = $0004;
  42.   lfBreakpointInvalid   = $0008;
  43.   lfErrorLine           = $0010;
  44.   lfBreakpointVerified  = $0020;
  45.  
  46. type
  47.   { Editor position expressed as column/line after tabs are expanded to spaces
  48.     and include the "virtual" editor space (columns beyond the end of lines) }
  49.   TEditPos = packed record
  50.     Col: SmallInt; { Col is one-based }
  51.     Line: Longint; { Line is one-based }
  52.   end;
  53.  
  54.   { Editor position expressed as character index/line before tabs are expanded
  55.     and does not include the indecies beyond the end of a line }
  56.   TCharPos = packed record
  57.     CharIndex: SmallInt; { CharIndex is zero-based }
  58.     Line: Longint; { Line is one-based }
  59.   end;
  60.  
  61.   { Use the TIEditReader class to gain read access to an editor buffer:
  62.  
  63.     NOTES:
  64.       The buffer is accessed as a linear "file" with line breaks included.
  65.       This reader interface could be accessed through a custom read-only
  66.       TStream descendant.
  67.  
  68.     WARNING!!!
  69.      o A TIEditReader should never be active at the same time as a TIEditWriter.
  70.   }
  71.  
  72.   TIEditReader = class(TInterface)
  73.   public
  74.     function GetText(Position: Longint; Buffer: PChar; Count: Longint): Longint;
  75.       virtual; stdcall; abstract;
  76.   end;
  77.  
  78.   { Use the TIEditWriter class to gain write access to an editor buffer:
  79.  
  80.     NOTES:
  81.      o As with the reader, the buffer is accessed as a linear "file" with
  82.        line breaks included.  The writer uses a "copy in place" metaphor for
  83.        modifying the editor buffer.  In other words, the writer can be thought
  84.        of as simply copying from one buffer to another.  All positions (Pos)
  85.        passed to the function are positions relative to the original file.  Due
  86.        to the "copy" metaphor of the writer it does not support moving backward
  87.        in the editor buffer. It is recommended that all modifications that must
  88.        be performed should be done from the start to the finish.
  89.      o After the TIEditWriter is freed(released), the undo-buffer of the editor
  90.        is flushed unless CreateUndoableWriter was called to obtain the
  91.        TIEditWriter.
  92.  
  93.     WARNING!!!
  94.      o A TIEditWriter should never be active at the same time as a TIEditReader.
  95.   }
  96.  
  97.   TIEditWriter = class(TInterface)
  98.   public
  99.     function CopyTo(Pos: Longint): Boolean; virtual; stdcall; abstract;
  100.     function DeleteTo(Pos: Longint): Boolean; virtual; stdcall; abstract;
  101.     function Insert(Text: PChar): Boolean; virtual; stdcall; abstract;
  102.     function Position: Longint; virtual; stdcall; abstract;
  103.     function GetCurrentPos: TCharPos; virtual; stdcall; abstract;
  104.  
  105.     property CurrentPos: TCharPos read GetCurrentPos;
  106.   end;
  107.  
  108.   { The TIEditView represents an individual view on an edit buffer:
  109.  
  110.     This interface allows the cursor and view positions to be accessed and
  111.     updated.  The only restriction on using this interface is that it should
  112.     not be held for any length of time.  Since a view can be deleted at any
  113.     time, the interface could become invalid.
  114.   }
  115.  
  116.   TIEditView = class(TInterface)
  117.   public
  118.     function GetPos(Index: Integer): TEditPos; virtual; stdcall; abstract;
  119.     procedure SetPos(Index: Integer; Value: TEditPos); virtual; stdcall; abstract;
  120.     function GetViewSize: TSize; virtual; stdcall; abstract;
  121.     function PosToCharPos(Pos: Longint): TCharPos; virtual; stdcall; abstract;
  122.     function CharPosToPos(CharPos: TCharPos): Longint; virtual; stdcall; abstract;
  123.     procedure ConvertPos(EdPosToCharPos: Boolean; var EditPos: TEditPos;
  124.       var CharPos: TCharPos); virtual; stdcall; abstract;
  125.     procedure GetAttributeAtPos(const EdPos: TEditPos; var Element, LineFlag: Integer);
  126.       virtual; stdcall; abstract;
  127.  
  128.     property CursorPos: TEditPos index CursorPos read GetPos write SetPos;
  129.     property TopPos: TEditPos index ViewTopPos read GetPos write SetPos;
  130.     property ViewSize: TSize read GetViewSize;
  131.   end;
  132.  
  133.   { The TIEditorInterface is the base interface to an editor buffer:
  134.  
  135.     Use this interface to obtain TIEditReader, TIEditWriter, and TIEditView
  136.     interfaces.
  137.  
  138.     NOTE: If the block type is btColumn then the values for BlockStart and
  139.           BlockAfter are actually expressing as TEditPos records.  This
  140.           applies both to getting and setting the values
  141.  
  142.   }
  143.  
  144.   TSyntaxHighlighter = (shNone, shPascal, shC, shSQL, shQuery);
  145.   TBlockType = (btInclusive, btLine, btColumn, btNonInclusive, btUnknown);
  146.  
  147.   TIEditorInterface = class(TInterface)
  148.   public
  149.     function CreateReader: TIEditReader; virtual; stdcall; abstract;
  150.     function CreateWriter: TIEditWriter; virtual; stdcall; abstract;
  151.     function FileName: string; virtual; stdcall; abstract;
  152.     function LinesInBuffer: Longint; virtual; stdcall; abstract;
  153.     function BufferModified: Boolean; virtual; stdcall; abstract;
  154.     function MarkModified: Boolean; virtual; stdcall; abstract;
  155.     function SetSyntaxHighlighter(SyntaxHighlighter: TSyntaxHighlighter): TSyntaxHighlighter;
  156.       virtual; stdcall; abstract;
  157.     function GetViewCount: Integer; virtual; stdcall; abstract;
  158.     function GetView(Index: Integer): TIEditView; virtual; stdcall; abstract;
  159.     function CreateUndoableWriter: TIEditWriter; virtual; stdcall; abstract;
  160.     // These functions will affect all views on this buffer.
  161.     function GetBlockAfter: TCharPos; virtual; stdcall; abstract;
  162.     function GetBlockStart: TCharPos; virtual; stdcall; abstract;
  163.     function GetBlockType: TBlockType; virtual; stdcall; abstract;
  164.     function GetBlockVisible: Boolean; virtual; stdcall; abstract;
  165.     procedure SetBlockAfter(Value: TCharPos); virtual; stdcall; abstract;
  166.     procedure SetBlockStart(Value: TCharPos); virtual; stdcall; abstract;
  167.     procedure SetBlockType(Value: TBlockType); virtual; stdcall; abstract;
  168.     procedure SetBlockVisible(Value: Boolean); virtual; stdcall; abstract;
  169.  
  170.     property BlockStart: TCharPos read GetBlockStart write SetBlockStart;
  171.     property BlockAfter: TCharPos read GetBlockAfter write SetBlockAfter;
  172.     property BlockType: TBlockType read GetBlockType write SetBlockType;
  173.     property BlockVisible: Boolean read GetBlockVisible write SetBlockVisible;
  174.   end;
  175.  
  176.   { The TIComponentInterface is the base interface for a component living
  177.     on a form/data module.  Never hold this interface for very long, since
  178.     the component may be deleted at any time.
  179.  
  180.     GetComponentType   - Returns a string representing the type of the
  181.                          component.
  182.     GetParent          - Returns the interface corresponding to the parent
  183.                          control if a TControl, otherwise returns the owner
  184.                          of the control.  If a TPersistent or the root object
  185.                          then it returns nil.
  186.     IsTControl         - Returns True if component is a TControl descendant
  187.     GetPropCount       - Returns the number of published properties on this
  188.                          component.
  189.     GetPropName        - Given the index, returns the property name.
  190.     GetPropType        - Given the index, returns the property type.
  191.     GetPropTypeByName  - Given the name, returns the property type
  192.     GetPropValue
  193.     GetPropValueByName - Given the index or name, returns the property value.
  194.                          The untyped var must be large enough to hold the
  195.                          returned value.  If the property is a descendant of
  196.                          TPersistent, the return value is a TIComponent-
  197.                          Interface. For properties of any other object type,
  198.                          the return value is nil.
  199.     SetPropValue
  200.     SetPropValueByName - Given the index or name, sets the property value.
  201.     GetControlCount    - Returns the number of child controls (if a TControl
  202.                          descendant, else returns 0).
  203.     GetControl         - Given the index, returns an interface to the
  204.                          child control.
  205.     GetComponentCount  - Returns the number of child components (if a
  206.                          TComponent descendant, else returns 0).
  207.     GetComponent       - Given the index, returns an interface to the
  208.                          child component.
  209.     Select             - Selects the component and updates the Object Inspector.
  210.     Focus              - Same as Select except it brings the form to front with
  211.                          the component selected.  If this interface is a Form/
  212.                          Data Module, then Focus only brings the form to front.
  213.     Delete             - Deletes the component from the form.  Following this
  214.                          call, this interface will now be invalid and must be
  215.                          freed.
  216.   }
  217.  
  218.   TIComponentInterface = class;
  219.  
  220.   TPropertyType = (ptUnknown, ptInteger, ptChar, ptEnumeration, ptFloat,
  221.     ptString, ptSet, ptClass, ptMethod, ptWChar, ptLString, ptLWString,
  222.     ptVariant);
  223.  
  224.   TGetChildCallback = function (Param: Pointer;
  225.     ComponentInterface: TIComponentInterface): Boolean stdcall;
  226.  
  227.   TIComponentInterface = class(TInterface)
  228.   public
  229.     function GetComponentType: string; virtual; stdcall; abstract;
  230.     function GetComponentHandle: Pointer; virtual; stdcall; abstract;
  231.     function GetParent: TIComponentInterface; virtual; stdcall; abstract;
  232.     function IsTControl: Boolean; virtual; stdcall; abstract;
  233.     function GetPropCount: Integer; virtual; stdcall; abstract;
  234.     function GetPropName(Index: Integer): string; virtual; stdcall; abstract;
  235.     function GetPropType(Index: Integer): TPropertyType; virtual; stdcall; abstract;
  236.     function GetPropTypeByName(const Name: string): TPropertyType;
  237.       virtual; stdcall; abstract;
  238.     function GetPropValue(Index: Integer; var Value): Boolean;
  239.       virtual; stdcall; abstract;
  240.     function GetPropValueByName(const Name: string; var Value): Boolean;
  241.       virtual; stdcall; abstract;
  242.     function SetProp(Index: Integer; const Value): Boolean;
  243.       virtual; stdcall; abstract;
  244.     function SetPropByName(const Name: string; const Value): Boolean;
  245.       virtual; stdcall; abstract;
  246.     function GetChildren(Param: Pointer; Proc: TGetChildCallback): Boolean;
  247.       virtual; stdcall; abstract;
  248.     function GetControlCount: Integer; virtual; stdcall; abstract;
  249.     function GetControl(Index: Integer): TIComponentInterface;
  250.       virtual; stdcall; abstract;
  251.     function GetComponentCount: Integer; virtual; stdcall; abstract;
  252.     function GetComponent(Index: Integer): TIComponentInterface;
  253.       virtual; stdcall; abstract;
  254.     function Select: Boolean; virtual; stdcall; abstract;
  255.     function Focus: Boolean; virtual; stdcall; abstract;
  256.     function Delete: Boolean; virtual; stdcall; abstract;
  257.   end;
  258.  
  259.   { The TIFormInterface is the base interface to a designed form/data module:
  260.  
  261.      FileName          - Returns the actual filename of the form.
  262.      FormModified      - Returns True if the form has been modified. This is
  263.                          independent of the source code.
  264.      MarkModified      - Forces the form to be marked as modified.  Returns
  265.                          True is successful.
  266.      GetFormComponent  - Returns a TIComponentInterface representing the root
  267.                          component of the Form/Data module.
  268.      FincComponent     - Given the name, returns a component interface of the
  269.                          component on the Form/Data module.  Nil if the
  270.                          component is not found.
  271.      GetComponentFromHandle - Given the component handle (from
  272.                          TIModuleNotifier.ComponentRenamed or
  273.                          TIComponentInterface.GetComponentHandle) returns a
  274.                          TIComponentInterface for that component.
  275.      GetSelCount       - Returns the number of Selected components
  276.      GetSelComponent   - Returns the index'th selected component on the form/
  277.                          Data Module.
  278.      GetCreateParent   - Returns a TIComponentInterface used to parent the
  279.                          component currently being created.
  280.                          NOTE: This is only valid from a TIModuleNotifier.
  281.                          ComponentRenamed callback when OldName = '' and
  282.                          NewName <> ''
  283.      CreateComponent   - Adds a new component of type "TypeName" to the form.
  284.                          if Container is nil, and the component to be added is
  285.                          a TWinControl, then it is parented to the currently
  286.                          selected container.  If Container is non-nil, and it
  287.                          is a TWinControl, then the component is parented to
  288.                          that control.  Set Name to an empty string to allow
  289.                          the component's name to be auto-generated.  Set W and
  290.                          H to -1 to use the default size of the component. Set
  291.                          X and Y to -1 to center the component on the form.
  292.   }
  293.  
  294.   TIFormInterface = class(TInterface)
  295.   public
  296.     function FileName: string; virtual; stdcall; abstract;
  297.     function FormModified: Boolean; virtual; stdcall; abstract;
  298.     function MarkModified: Boolean; virtual; stdcall; abstract;
  299.     function GetFormComponent: TIComponentInterface; virtual; stdcall; abstract;
  300.     function FindComponent(const Name: string): TIComponentInterface;
  301.       virtual; stdcall; abstract;
  302.     function GetComponentFromHandle(ComponentHandle: Pointer): TIComponentInterface;
  303.       virtual; stdcall; abstract;
  304.     function GetSelCount: Integer; virtual; stdcall; abstract;
  305.     function GetSelComponent(Index: Integer): TIComponentInterface;
  306.       virtual; stdcall; abstract;
  307.     function GetCreateParent: TIComponentInterface; virtual; stdcall; abstract;
  308.     function CreateComponent(Container: TIComponentInterface;
  309.       const TypeName: string; X, Y, W, H: Integer): TIComponentInterface;
  310.       virtual; stdcall; abstract;
  311.   end;
  312.  
  313.   TResHeaderValue = (hvFlags, hvLanguage, hvDataVersion, hvVersion,
  314.     hvCharacteristics);
  315.  
  316.   { TIResourceEntry is a raw interface to a resource entry in the project's
  317.     resource file (<projectname>.RES).
  318.  
  319.     This interface is a very raw.  No implication on what is contained within
  320.     a particular entry is made.  It if up to the add-in developer to interpret
  321.     the data accessed through this interface.  NOTE: The 'MAINICON' entry and
  322.     related entries should not be modified as these are maintained by Delphi.
  323.  
  324.     GetResourceType
  325.     SetResourceType   - Sets and gets the resource type of this entry.  Follows
  326.                         Windows standard of specifying a type by name or value.
  327.                         If the high-word is 0, then the low-word is the
  328.                         resource type value, otherwise it is a pointer to a
  329.                         null terminated ANSI (byte per char) string. Most
  330.                         predefined types are by value.
  331.  
  332.     GetResourceName
  333.     SetResourceName   - Sets and gets the resource name of this entry.  Follows
  334.                         Windows standard of specifying a type by name or value.
  335.                         If the high-word is 0, then the low-word is the
  336.                         resource type value, otherwise it is a pointer to a
  337.                         null terminated ANSI (byte per char) string.
  338.  
  339.     GetHeaderValue
  340.     SetHeaderValue    - Gets and sets various resource header values.  Pass in
  341.                         one of the TResHeaderValues enums to indicate which
  342.                         value to get/set.  Although some values are 16bits
  343.                         (Word) these functions operation only on 32bits
  344.                         (Integer).
  345.  
  346.     GetData           - Returns a raw pointer to the actual resource data buffer.
  347.  
  348.     GetDataSize       - Returns the current size of the data buffer.
  349.  
  350.     SetDataSize       - Resizes the current data buffer.  If the size is
  351.                         smaller than the current size, the data is simply
  352.                         truncated without regard to its current contents.
  353.  
  354.     GetEntryHandle    - Returns a unique handle value identifying the resource
  355.                         entry.
  356.   }
  357.  
  358.   TIResourceEntry = class(TInterface)
  359.   public
  360.     function GetResourceType: PChar; virtual; stdcall; abstract;
  361.     function GetResourceName: PChar; virtual; stdcall; abstract;
  362.     function Change(NewType, NewName: PChar): Boolean; virtual; stdcall; abstract;
  363.     function GetHeaderValue(HeaderValue: TResHeaderValue;
  364.       var Value: Integer): Boolean; virtual; stdcall; abstract;
  365.     function SetHeaderValue(HeaderValue: TResHeaderValue;
  366.       Value: Integer): Boolean; virtual; stdcall; abstract;
  367.     function GetData: Pointer; virtual; stdcall; abstract;
  368.     function GetDataSize: Integer; virtual; stdcall; abstract;
  369.     function SetDataSize(NewSize: Integer): Boolean; virtual; stdcall; abstract;
  370.     function GetEntryHandle: Pointer; virtual; stdcall; abstract;
  371.   end;
  372.  
  373.   { The TIResourceFile is an interface on the project's resource file
  374.     (<projectname>.RES).
  375.  
  376.     GetEntryCount     - Returns the number of Resource entries.
  377.  
  378.     GetEntry          - Given an index, returns a TIResourceEntry of the
  379.                         index'th entry.
  380.  
  381.     FindEntry         - Given a Resource type and name, return a
  382.                         TIResourceEntry or nil if not found.
  383.  
  384.     DeleteEntry       - Given an entry handle, delete the given resource
  385.                         entry.
  386.  
  387.     CreateEntry       - Creates a new resource entry of the given type and name
  388.                         and returns a TIResourceEntry.  Returns nil if the
  389.                         entry already exists or any other error occurs.
  390.   }
  391.  
  392.   TIResourceFile = class(TInterface)
  393.   public
  394.     function FileName: string; virtual; stdcall; abstract;
  395.     function GetEntryCount: Integer; virtual; stdcall; abstract;
  396.     function GetEntry(Index: Integer): TIResourceEntry; virtual; stdcall; abstract;
  397.     function GetEntryFromHandle(EntryHandle: Pointer): TIResourceEntry; virtual; stdcall; abstract;
  398.     function FindEntry(ResType, Name: PChar): TIResourceEntry; virtual; stdcall; abstract;
  399.     function DeleteEntry(EntryHandle: Pointer): Boolean; virtual; stdcall; abstract;
  400.     function CreateEntry(ResType, Name: PChar; Flags, LanguageId: Word;
  401.       DataVersion, Version, Characteristics: Integer): TIResourceEntry; virtual; stdcall; abstract;
  402.   end;
  403.  
  404.   { The TIModuleNotifer interface is a client provided interface:
  405.  
  406.     Use this interface as a base to a client defined implementation.  An
  407.     instance of the TIModuleNotifer descendant is the registered with a
  408.     TIModuleInterface in order to receive notifications for the events
  409.     defined by the TNotifyCode.
  410.  
  411.       ncModuleDeleted    - the Module associated with the TIModule is being
  412.                            freed.  Perform any clean-up and free all references
  413.                            to a TIModuleInterface, including un-registering
  414.                            the notifier class.
  415.       ncModuleRenamed    - The module was renamed by a "save as" operation.
  416.       ncEditorModified   - The edit buffer was modified by the user or through
  417.                            a TIEditWriter interface (internal or external).
  418.       ncFormModified     - The form was modified by the user or through
  419.                            a TIFormInterface (internal of external).
  420.       ncEditorSelected   - An edit view was selected and focused.
  421.       ncFormSelected     - The associated form was selected and focused.
  422.       ncBeforeSave       - This is sent right before the module (editor and
  423.                            possibly the form) is actually saved to the file
  424.                            system
  425.       ncAfterSave        - Like the ncBeforeSave this is after all saving has
  426.                            occurred and was successful.
  427.       ncFormSaving       - This is sent just prior to the associated form is
  428.                            actually streamed out.  This *may* be sent after an
  429.                            ncBeforeSave, but not always.  This may be sent as
  430.                            a result of a project compile operated without an
  431.                            ncBeforSave being sent.
  432.       ncProjResModified  - If this notifier is attached to a project module,
  433.                            this event will be sent when the project resource
  434.                            file changes (mainly when the user changes the
  435.                            Icon, or other changes are made through the
  436.                            TIResourceFile interface).
  437.  
  438.       ComponentRenamed   - Before any component on the associated form/data
  439.                            model is renamed, this event is triggered allowing
  440.                            the interface to track any changes to component on
  441.                            a form.  If NewName is an empty string, component,
  442.                            OldName was deleted.  If OldName is an empty string,
  443.                            component NewName was added and you may call
  444.                            TIFormInterface.GetCreateParent to determine the
  445.                            container in which this component is being created.
  446.                            .GetCreateParent is only valid if component is a
  447.                            TControl.
  448.                            NOTE: This procedure will *NOT* be called when the
  449.                            form is being destroyed due to the form designer
  450.                            being destroyed.
  451.   }
  452.  
  453.   TNotifyCode = (ncModuleDeleted, ncModuleRenamed, ncEditorModified,
  454.     ncFormModified, ncEditorSelected, ncFormSelected, ncBeforeSave,
  455.     ncAfterSave, ncFormSaving, ncProjResModified);
  456.  
  457.   TIModuleNotifier = class(TInterface)
  458.   public
  459.     procedure Notify(NotifyCode: TNotifyCode); virtual; stdcall; abstract;
  460.     procedure ComponentRenamed(ComponentHandle: Pointer;
  461.       const OldName, NewName: string); virtual; stdcall; abstract;
  462.   end;
  463.  
  464.   { The TIModuleInterface represents any file/module open in the IDE:
  465.  
  466.     A module is simply a file, or a file and form.  Use this interface to gain
  467.     access to the edit buffer and form. There is only one instance of a
  468.     TIModuleInterface per module, but is reference counted so it can be treated
  469.     as separate instances.  When finished with the interface, the owner *must*
  470.     "free" it. For instance, if a TIModuleNotifier object is told that the
  471.     module was deleted.
  472.  
  473.     Functions:
  474.  
  475.     GetEditorInterface - This returns an interface to the associated edit
  476.                          buffer.
  477.     GetFormInterface   - This returns an interface to the associated form, if
  478.                          one exists.  Returns nil otherwise.
  479.     GetAncestortModule - Return the ancestor module to this Form/Data module
  480.                          if not a direct descendent of a TForm or TDataModule.
  481.     GetProjectResource - If this module interface is referencing a project
  482.                          module, this will return an interface on the project's
  483.                          resource.  Returns nil if this is not a project module
  484.                          interface. (this resource contains the application's
  485.                          main ICON as entry 'MAINICON').
  486.     IsProjectModule    - Returns True if this is a project module interface,
  487.                          False, otherwise.
  488.     Close              - Returns true if the module was closed.
  489.                          This may cause the ncModuleDeleted notification to
  490.                          be triggered.  If another form references this module
  491.                          through form inheritance, or form linking, the module
  492.                          will remain "open" but is marked for deletion.
  493.                          NOTE: This will close the module without saving or
  494.                                even asking the user to save. See the Save
  495.                                function.
  496.     Save               - Returns true if successfully saved. Pass True in order
  497.                          force the save operation without the user being asked.
  498.                          Otherwise the user will be asked.  If the module is
  499.                          marked UnNamed, the "Save As" dialog will be
  500.                          presented to the user.
  501.     Rename             - Renames the current module. The form file name will be
  502.                          derived from the new name. An ncModuleRenamed
  503.                          notification will be sent.
  504.     GetFileSystem      - Returns true if able to get the current file system
  505.                          associated with this module. An empty string indicates
  506.                          the default file system.
  507.     SetFileSystem      - Returns true if able to set the file system to the
  508.                          indicated file system. An empty string indicates the
  509.                          default file system.  One use is in response to an
  510.                          ncModuleRenamed notification and the new name is
  511.                          unavailable in the current file system.
  512.     ShowSource         - Selects and focuses the top-most edit buffer view.
  513.     ShowForm           - Selects and focused the form, if present.
  514.     AddNotifier        - Registers an instance of a descendant to TIModule-
  515.                          Notifier.
  516.     RemoveNotifier     - Removes a registered instance of a TIModuleNotifier.
  517.     GetAuxEditorInterface - Obtains a TIEditorInterface to the .H file if the
  518.                          main file is a .c/.cpp file.  Used only in C++Builder.
  519.   }
  520.  
  521.   TIModuleInterface = class(TInterface)
  522.   public
  523.     function GetEditorInterface: TIEditorInterface; virtual; stdcall; abstract;
  524.     function GetFormInterface: TIFormInterface; virtual; stdcall; abstract;
  525.     function GetAncestorModule: TIModuleInterface; virtual; stdcall; abstract;
  526.     function GetProjectResource: TIResourceFile; virtual; stdcall; abstract;
  527.     function IsProjectModule: Boolean; virtual; stdcall; abstract;
  528.     function Close: Boolean; virtual; stdcall; abstract;
  529.     function Save(ForceSave: Boolean): Boolean; virtual; stdcall; abstract;
  530.     function Rename(const NewName: string): Boolean; virtual; stdcall; abstract;
  531.     function GetFileSystem(var FileSystem: string): Boolean; virtual; stdcall; abstract;
  532.     function SetFileSystem(const FileSystem: string): Boolean; virtual; stdcall; abstract;
  533.     function ShowSource: Boolean; virtual; stdcall; abstract;
  534.     function ShowForm: Boolean; virtual; stdcall; abstract;
  535.     function AddNotifier(AModuleNotifier: TIModuleNotifier): Boolean; virtual; stdcall; abstract;
  536.     function RemoveNotifier(AModuleNotifier: TIModuleNotifier): Boolean; virtual; stdcall; abstract;
  537.     function GetAuxEditorInterface: TIEditorInterface; virtual; stdcall; abstract;
  538.   end;
  539.  
  540.   { TIProjectCreator interface
  541.  
  542.   }
  543.  
  544.   TIProjectCreator = class(TInterface)
  545.   public
  546.     function Existing: Boolean; virtual; stdcall; abstract;
  547.     function GetFileName: string; virtual; stdcall; abstract;
  548.     function GetFileSystem: string; virtual; stdcall; abstract;
  549.     function NewProjectSource(const ProjectName: string): string; virtual; stdcall; abstract;
  550.     procedure NewDefaultModule; virtual; stdcall; abstract;
  551.     procedure NewProjectResource(Module: TIModuleInterface); virtual; stdcall; abstract;
  552.   end;
  553.  
  554.   TIProjectCreatorEx = class(TIProjectCreator)
  555.   public
  556.     function GetOptionName: string; virtual; stdcall; abstract; 
  557.     function NewOptionSource(const ProjectName: string): string; virtual; stdcall; abstract;
  558.   end;
  559.  
  560.   { TIModuleCreator interface
  561.   }
  562.  
  563.   TIModuleCreator = class(TInterface)
  564.   public
  565.     function Existing: Boolean; virtual; stdcall; abstract;
  566.     function GetAncestorName: string; virtual; stdcall; abstract;
  567.     function GetFileName: string; virtual; stdcall; abstract;
  568.     function GetFileSystem: string; virtual; stdcall; abstract;
  569.     function GetFormName: string; virtual; stdcall; abstract;
  570.     function NewModuleSource(const UnitIdent, FormIdent,
  571.       AncestorIdent: string): string; virtual; stdcall; abstract;
  572.     procedure FormCreated(Form: TIFormInterface); virtual; stdcall; abstract;
  573.   end;
  574.  
  575.   TIModuleCreatorEx = class(TIModuleCreator)
  576.   public
  577.     function GetIntfName: string; virtual; stdcall; abstract;
  578.     function NewIntfSource(const UnitIdent, FormIdent,
  579.       AncestorIdent: string): string; virtual; stdcall; abstract;
  580.   end;
  581.  
  582. implementation
  583.  
  584. end.
  585.