Add handling IM state
[MacVim/KaoriYa.git] / src / MacVim / MMTextViewHelper.h
blobf07f8d2489cba1f6c400a1a46155194d0280b036
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 #import <Cocoa/Cocoa.h>
14 enum {
15 // These values are chosen so that the min text view size is not too small
16 // with the default font (they only affect resizing with the mouse, you can
17 // still use e.g. ":set lines=2" to go below these values).
18 MMMinRows = 4,
19 MMMinColumns = 30
23 @interface MMTextViewHelper : NSObject {
24 id textView;
25 BOOL isDragging;
26 int dragRow;
27 int dragColumn;
28 int dragFlags;
29 NSPoint dragPoint;
30 BOOL isAutoscrolling;
31 int mouseShape;
32 NSTrackingRectTag trackingRectTag;
33 NSColor *insertionPointColor;
35 // Input Manager
36 NSRange imRange;
37 NSRange markedRange;
38 NSDictionary *markedTextAttributes;
39 NSMutableAttributedString *markedText;
40 int preEditRow;
41 int preEditColumn;
42 BOOL imControl;
45 - (void)setTextView:(id)view;
46 - (void)setInsertionPointColor:(NSColor *)color;
47 - (NSColor *)insertionPointColor;
49 - (void)keyDown:(NSEvent *)event;
50 - (void)insertText:(id)string;
51 - (void)doCommandBySelector:(SEL)selector;
52 - (BOOL)performKeyEquivalent:(NSEvent *)event;
53 - (void)scrollWheel:(NSEvent *)event;
54 - (void)mouseDown:(NSEvent *)event;
55 - (void)mouseUp:(NSEvent *)event;
56 - (void)mouseDragged:(NSEvent *)event;
57 - (void)mouseMoved:(NSEvent *)event;
58 - (void)mouseEntered:(NSEvent *)event;
59 - (void)mouseExited:(NSEvent *)event;
60 - (void)setFrame:(NSRect)frame;
61 - (void)viewDidMoveToWindow;
62 - (void)viewWillMoveToWindow:(NSWindow *)newWindow;
63 - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
64 - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
65 - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
66 - (void)setMouseShape:(int)shape;
68 // Input Manager
69 - (BOOL)hasMarkedText;
70 - (NSRange)markedRange;
71 - (NSDictionary *)markedTextAttributes;
72 - (void)setMarkedTextAttributes:(NSDictionary *)attr;
73 - (void)setMarkedText:(id)text selectedRange:(NSRange)range;
74 - (void)unmarkText;
75 - (NSMutableAttributedString *)markedText;
76 - (void)setPreEditRow:(int)row column:(int)col;
77 - (int)preEditRow;
78 - (int)preEditColumn;
79 - (void)setImRange:(NSRange)range;
80 - (NSRange)imRange;
81 - (void)setMarkedRange:(NSRange)range;
82 - (NSRect)firstRectForCharacterRange:(NSRange)range;
83 - (void)setImControl:(BOOL)enable;
85 @end