Fix placement of auxiliary IM window for Core Text
[MacVim.git] / src / MacVim / PlugInInterface.h
blobdbbf4b64f82c05852eb33017d56b1ab2e0a6566d
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 // Plugin architecture version. Major versions indicate API incompatibilities.
43 // Minor versions may include additions, but nothing that should break current
44 // plugins.
45 - (int)majorVersion;
46 - (int)minorVersion;
48 @end
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;
58 @end
60 @protocol PlugInProtocol
61 // The mediator should not be retained. It will exist until terminatePlugIn is
62 // called.
63 + (BOOL)initializePlugIn:(id<PlugInAppMediator>)mediator;
64 + (void)terminatePlugIn;
65 @end
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;
71 @end