2

The Delphi IDE allows extensions and plugins via the Open Tools API (OTAPI). It's not very well documented and I am not sure where to look to find out a comprehensive list of what the API allows access to and can achieve, apart from browsing ToolsAPI.pas itself.

Specifically, I would like to access a list of all bookmarks in all open files in the IDE (and preferably, be able to add, remove and navigate to them, the last being the most important.) Is this possible, and what interface do you use to do it?

The closest I have found is this interface in ToolsAPI.pas:

  IOTAEditView140 = interface(IOTAEditView40)
    ['{9C510462-C7BC-11D2-9AEB-00A02457621F}']
    function BookmarkGoto(BookmarkID: Integer): Boolean;
    function BookmarkRecord(BookmarkID: Integer): Boolean;
    function BookmarkToggle(BookmarkID: Integer): Boolean;

That seems, for one view (edit window?), to let you navigate to a bookmark, turn it on or off, and record (?) it, if you know the ID of an existing bookmark or know how to create a new unique ID. (I'm speculating.) But I can't see any enumeration capabilities nor do I feel very sure of how to use the above interface reliably - where do the BookMarkIDs come from, for example? How do you know what they are? How do you generate one? Etc.

4

1 回答 1

1

Delphi 编辑器中的全球书签问题中,您可以查看 CNPack 中的书签浏览代码(位于http://code.google.com/p/cnpack/下),了解它是如何制作的。

于 2014-01-09T14:01:40.453 回答