Change a few toolbar icons
[MacVim.git] / src / MacVim / PlugInInterface.h
blob490d619cab0f3ae625e679c3e9493e6a541eed74
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.
9 */
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.
15 * PlugInAppMediator
17 * The interface that the plugin may use to interact with the MacVim
18 * application.
20 * PlugInInstanceMediator
22 * The interface that a plugin may use to interact with a specific vim instance
23 * within MacVim.
25 * PlugInProtocol
27 * The protocol which the principal class of the plugin must conform to.
29 * Author: Matt Tolton
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 @end
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;
52 @end
54 @protocol PlugInProtocol
55 // The mediator should not be retained. It will exist until terminatePlugIn is
56 // called.
57 + (BOOL)initializePlugIn:(id<PlugInAppMediator>)mediator;
58 + (void)terminatePlugIn;
59 @end
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;
65 @end