1 /* vi:set ts=8 sts=4 sw=4 ft=objc:
3 * VIM - Vi IMproved by Bram Moolenaar
4 * MacVim GUI port by Bjorn Winckler
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
11 // This header file should include everything that a plug-in will need so that
12 // it is all we need to distribute for plug-in developers.
17 * The interface that the plugin may use to interact with the MacVim
20 * PlugInInstanceMediator
22 * The interface that a plugin may use to interact with a specific vim instance
27 * The protocol which the principal class of the plugin must conform to.
33 @protocol PlugInAppMediator
35 - (void)addPlugInMenuItem
:(NSMenuItem
*)menuItem
;
37 // Returns the plugin instance of the specified class associated with the key vim window.
38 // If a vim window is not the key window, returns nil.
39 // If there are no instances with the specified class, returns nil.
40 - (id
)keyPlugInInstanceWithClass
:(Class
)class;
42 // Plugin architecture version. Major versions indicate API incompatibilities.
43 // Minor versions may include additions, but nothing that should break current
50 @protocol PlugInInstanceMediator
52 // vim values are converted into NSNumber, NSString, NSArray, and NSDictionary
53 - (id
)evaluateVimExpression
:(NSString
*)vimExpression
;
54 - (void)addVimInput
:(NSString
*)input
;
55 - (void)openFiles
:(NSArray
*)fileNames
;
56 - (void)addPlugInView
:(NSView
*)view withTitle
:(NSString
*)title
;
60 @protocol PlugInProtocol
61 // The mediator should not be retained. It will exist until terminatePlugIn is
63 + (BOOL
)initializePlugIn
:(id
<PlugInAppMediator
>)mediator
;
64 + (void)terminatePlugIn
;
67 @interface
NSObject (PlugInProtocol
)
68 // The mediator should not be retained. It will exist until it releases this
69 // plugin instance, and is not valid after that.
70 - (id
)initWithMediator
:(id
<PlugInInstanceMediator
>)mediator
;