My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
Changes to /AppKit/NSCell.h
e5277a40a7e8 vs. 2470bd80abf4 Compare: vs.  Format:
Revision 2470bd80abf4
Go to: 
Project members, sign in to write a code review
/AppKit/NSCell.h   e5277a40a7e8 /AppKit/NSCell.h   2470bd80abf4
1 /* Copyright (c) 2006 Christopher J. W. Lloyd 1 /* Copyright (c) 2006-2007 Christopher J. W. Lloyd
2 2
3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 4
5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 6
7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
8 8
9 #import <AppKit/NSText.h> 9 #import <AppKit/NSText.h>
10 10
11 @class NSFont,NSImage,NSView; 11 @class NSFont,NSImage,NSView;
12 12
13 typedef enum { 13 typedef enum {
14 NSNullCellType, 14 NSNullCellType,
15 NSTextCellType, 15 NSTextCellType,
16 NSImageCellType 16 NSImageCellType
17 } NSCellType; 17 } NSCellType;
18 18
19 enum { 19 enum {
20 NSAnyType=0, 20 NSAnyType=0,
21 NSIntType=1, 21 NSIntType=1,
22 NSPositiveIntType=2, 22 NSPositiveIntType=2,
23 NSFloatType=3, 23 NSFloatType=3,
24 NSPositiveFloatType=4, 24 NSPositiveFloatType=4,
25 NSDoubleType=6, 25 NSDoubleType=6,
26 NSPositiveDoubleType=7 26 NSPositiveDoubleType=7
27 }; 27 };
28 28
29 typedef enum { 29 typedef enum {
30 NSNoImage, 30 NSNoImage,
31 NSImageOnly, 31 NSImageOnly,
32 NSImageLeft, 32 NSImageLeft,
33 NSImageRight, 33 NSImageRight,
34 NSImageBelow, 34 NSImageBelow,
35 NSImageAbove, 35 NSImageAbove,
36 NSImageOverlaps 36 NSImageOverlaps
37 } NSCellImagePosition; 37 } NSCellImagePosition;
38 38
39 typedef enum { 39 typedef enum {
40 NSMixedState=-1, 40 NSMixedState=-1,
41 NSOffState=0, 41 NSOffState=0,
42 NSOnState=1, 42 NSOnState=1,
43 } NSCellState; 43 } NSCellState;
44 44
45 @interface NSCell : NSObject <NSCopying,NSCoding> { 45 @interface NSCell : NSObject <NSCopying,NSCoding> {
46 int _state; 46 int _state;
47 NSFont *_font; 47 NSFont *_font;
48 int _entryType; 48 int _entryType;
49 id _objectValue; 49 id _objectValue;
50 NSImage *_image; 50 NSImage *_image;
51 int _textAlignment; 51 int _textAlignment;
52 int _cellType; 52 int _cellType;
53 NSFormatter *_formatter; 53 NSFormatter *_formatter;
54 NSString *_title; 54 NSString *_title;
55 id _representedObject; 55 id _representedObject;
56 56
57 BOOL _isEnabled; 57 BOOL _isEnabled;
58 BOOL _isEditable; 58 BOOL _isEditable;
59 BOOL _isSelectable; 59 BOOL _isSelectable;
60 BOOL _isScrollable; 60 BOOL _isScrollable;
61 BOOL _wraps; 61 BOOL _wraps;
62 BOOL _isBordered; 62 BOOL _isBordered;
63 BOOL _isBezeled; 63 BOOL _isBezeled;
64 BOOL _isHighlighted; 64 BOOL _isHighlighted;
65 BOOL _refusesFirstResponder; 65 BOOL _refusesFirstResponder;
66 BOOL _isContinuous; 66 BOOL _isContinuous;
67 } 67 }
68 68
69 -initTextCell:(NSString *)string; 69 -initTextCell:(NSString *)string;
70 -initImageCell:(NSImage *)image; 70 -initImageCell:(NSImage *)image;
71 71
72 -(NSView *)controlView; 72 -(NSView *)controlView;
73 -(NSCellType)type; 73 -(NSCellType)type;
74 -(int)state; 74 -(int)state;
75 75
76 -target; 76 -target;
77 -(SEL)action; 77 -(SEL)action;
78 -(int)tag; 78 -(int)tag;
79 -(int)entryType; 79 -(int)entryType;
80 -(id)formatter; 80 -(id)formatter;
81 -(NSFont *)font; 81 -(NSFont *)font;
82 -(NSImage *)image; 82 -(NSImage *)image;
83 -(NSTextAlignment)alignment; 83 -(NSTextAlignment)alignment;
84 -(BOOL)wraps; 84 -(BOOL)wraps;
85 -(NSString *)title; 85 -(NSString *)title;
86 86
87 -(BOOL)isEnabled; 87 -(BOOL)isEnabled;
88 -(BOOL)isEditable; 88 -(BOOL)isEditable;
89 -(BOOL)isSelectable; 89 -(BOOL)isSelectable;
90 -(BOOL)isScrollable; 90 -(BOOL)isScrollable;
91 -(BOOL)isBordered; 91 -(BOOL)isBordered;
92 -(BOOL)isBezeled; 92 -(BOOL)isBezeled;
93 -(BOOL)isContinuous; 93 -(BOOL)isContinuous;
94 -(BOOL)refusesFirstResponder; 94 -(BOOL)refusesFirstResponder;
95 -(BOOL)isHighlighted; 95 -(BOOL)isHighlighted;
96 96
97 -objectValue; 97 -objectValue;
98 -(NSString *)stringValue; 98 -(NSString *)stringValue;
99 -(int)intValue; 99 -(int)intValue;
100 -(float)floatValue; 100 -(float)floatValue;
101 -(double)doubleValue; 101 -(double)doubleValue;
102 -(NSAttributedString *)attributedStringValue; 102 -(NSAttributedString *)attributedStringValue;
103 -(id)representedObject; 103 -(id)representedObject;
104 104
105 -(void)setType:(NSCellType)type; 105 -(void)setType:(NSCellType)type;
106 106
107 -(void)setState:(int)value; 107 -(void)setState:(int)value;
108 -(int)nextState; 108 -(int)nextState;
109 109
110 -(void)setTarget:target; 110 -(void)setTarget:target;
111 -(void)setAction:(SEL)action; 111 -(void)setAction:(SEL)action;
112 -(void)setTag:(int)tag; 112 -(void)setTag:(int)tag;
113 -(void)setEntryType:(int)type; 113 -(void)setEntryType:(int)type;
114 -(void)setFormatter:(NSFormatter *)formatter; 114 -(void)setFormatter:(NSFormatter *)formatter;
115 -(void)setFont:(NSFont *)font; 115 -(void)setFont:(NSFont *)font;
116 -(void)setImage:(NSImage *)image; 116 -(void)setImage:(NSImage *)image;
117 -(void)setAlignment:(NSTextAlignment)alignment; 117 -(void)setAlignment:(NSTextAlignment)alignment;
118 -(void)setWraps:(BOOL)wraps; 118 -(void)setWraps:(BOOL)wraps;
119 -(void)setTitle:(NSString *)title; 119 -(void)setTitle:(NSString *)title;
120 120
121 -(void)setEnabled:(BOOL)flag; 121 -(void)setEnabled:(BOOL)flag;
122 -(void)setEditable:(BOOL)flag; 122 -(void)setEditable:(BOOL)flag;
123 -(void)setSelectable:(BOOL)flag; 123 -(void)setSelectable:(BOOL)flag;
124 -(void)setScrollable:(BOOL)flag; 124 -(void)setScrollable:(BOOL)flag;
125 -(void)setBordered:(BOOL)flag; 125 -(void)setBordered:(BOOL)flag;
126 -(void)setBezeled:(BOOL)flag; 126 -(void)setBezeled:(BOOL)flag;
127 -(void)setContinuous:(BOOL)flag; 127 -(void)setContinuous:(BOOL)flag;
128 -(void)setRefusesFirstResponder:(BOOL)flag; 128 -(void)setRefusesFirstResponder:(BOOL)flag;
129 -(void)setHighlighted:(BOOL)flag; 129 -(void)setHighlighted:(BOOL)flag;
130 130
131 -(void)setFloatingPointFormat:(BOOL)fpp left:(unsigned)left right:(unsigned)right; 131 -(void)setFloatingPointFormat:(BOOL)fpp left:(unsigned)left right:(unsigned)right;
132 132
133 -(void)setObjectValue:(id <NSCopying>)value; 133 -(void)setObjectValue:(id <NSCopying>)value;
134 -(void)setStringValue:(NSString *)value; 134 -(void)setStringValue:(NSString *)value;
135 -(void)setIntValue:(int)value; 135 -(void)setIntValue:(int)value;
136 -(void)setFloatValue:(float)value; 136 -(void)setFloatValue:(float)value;
137 -(void)setDoubleValue:(double)value; 137 -(void)setDoubleValue:(double)value;
138 -(void)setAttributedStringValue:(NSAttributedString *)value; 138 -(void)setAttributedStringValue:(NSAttributedString *)value;
139 -(void)setRepresentedObject:(id)object; 139 -(void)setRepresentedObject:(id)object;
140 140
141 -(void)takeObjectValueFrom:sender; 141 -(void)takeObjectValueFrom:sender;
142 -(void)takeStringValueFrom:sender; 142 -(void)takeStringValueFrom:sender;
143 -(void)takeIntValueFrom:sender; 143 -(void)takeIntValueFrom:sender;
144 -(void)takeFloatValueFrom:sender; 144 -(void)takeFloatValueFrom:sender;
145 145
146 -(NSSize)cellSize; 146 -(NSSize)cellSize;
147 147
148 -(NSRect)imageRectForBounds:(NSRect)rect; 148 -(NSRect)imageRectForBounds:(NSRect)rect;
149 -(NSRect)titleRectForBounds:(NSRect)rect; 149 -(NSRect)titleRectForBounds:(NSRect)rect;
150 -(NSRect)drawingRectForBounds:(NSRect)rect; 150 -(NSRect)drawingRectForBounds:(NSRect)rect;
151 151
152 -(void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)view; 152 -(void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)view;
153 -(void)drawWithFrame:(NSRect)frame inView:(NSView *)view; 153 -(void)drawWithFrame:(NSRect)frame inView:(NSView *)view;
154 154
155 -(void)highlight:(BOOL)highlight withFrame:(NSRect)frame inView:(NSView *)view; 155 -(void)highlight:(BOOL)highlight withFrame:(NSRect)frame inView:(NSView *)view;
156 156
157 -(BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)view; 157 -(BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)view;
158 -(BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)view; 158 -(BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)view;
159 -(void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)view mouseIsUp:(BOOL)flag; 159 -(void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)view mouseIsUp:(BOOL)flag;
160 -(BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)frame ofView:(NSView *)view untilMouseUp:(BOOL)flag; 160 -(BOOL)trackMouse:(NSEvent *)event inRect:(NSRect)frame ofView:(NSView *)view untilMouseUp:(BOOL)flag;
161 161
162 -(NSText *)setUpFieldEditorAttributes:(NSText *)editor; 162 -(NSText *)setUpFieldEditorAttributes:(NSText *)editor;
163 163
164 -(void)editWithFrame:(NSRect)frame inView:(NSView *)view editor:(NSText *)editor delegate:(id)delegate event:(NSEvent *)event; 164 -(void)editWithFrame:(NSRect)frame inView:(NSView *)view editor:(NSText *)editor delegate:(id)delegate event:(NSEvent *)event;
165 -(void)selectWithFrame:(NSRect)frame inView:(NSView *)view editor:(NSText *)editor delegate:(id)delegate start:(int)location length:(int)length; 165 -(void)selectWithFrame:(NSRect)frame inView:(NSView *)view editor:(NSText *)editor delegate:(id)delegate start:(int)location length:(int)length;
166 -(void)endEditing:(NSText *)editor; 166 -(void)endEditing:(NSText *)editor;
167 167
168 -(void)resetCursorRect:(NSRect)rect inView:(NSView *)view; 168 -(void)resetCursorRect:(NSRect)rect inView:(NSView *)view;
169 169
170 @end 170 @end
Powered by Google Project Hosting