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;
44 @protocol PlugInInstanceMediator
46 // vim values are converted into NSNumber, NSString, NSArray, and NSDictionary
47 - (id
)evaluateVimExpression
:(NSString
*)vimExpression
;
48 - (void)addVimInput
:(NSString
*)input
;
49 - (void)openFiles
:(NSArray
*)fileNames
;
50 - (void)addPlugInView
:(NSView
*)view withTitle
:(NSString
*)title
;
54 @protocol PlugInProtocol
55 // The mediator should not be retained. It will exist until terminatePlugIn is
57 + (BOOL
)initializePlugIn
:(id
<PlugInAppMediator
>)mediator
;
58 + (void)terminatePlugIn
;
61 @interface
NSObject (PlugInProtocol
)
62 // The mediator should not be retained. It will exist until it releases this
63 // plugin instance, and is not valid after that.
64 - (id
)initWithMediator
:(id
<PlugInInstanceMediator
>)mediator
;