home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks3 / AppKit.framework / Headers / NSCell.h < prev    next >
Text File  |  1994-09-29  |  7KB  |  234 lines

  1. /*
  2.     Cell.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <Foundation/Foundation.h> 
  8. #import "NSGraphics.h"
  9. #import "NSText.h"
  10.  
  11. enum {
  12.     NSAnyType                = 0,
  13.     NSIntType                = 1,
  14.     NSPositiveIntType            = 2,
  15.     NSFloatType                = 3,
  16.     NSPositiveFloatType            = 4,
  17.     NSDateType                = 5,
  18.     NSDoubleType            = 6,
  19.     NSPositiveDoubleType        = 7
  20. };
  21.  
  22. typedef enum _NSCellType {
  23.     NSNullCellType            = 0,
  24.     NSTextCellType            = 1,
  25.     NSImageCellType            = 2
  26. } NSCellType;
  27.  
  28. typedef enum _NSCellAttribute {
  29.     NSCellDisabled            = 0,
  30.     NSCellState                = 1,
  31.     NSPushInCell            = 2,
  32.     NSCellEditable            = 3,
  33.     NSChangeGrayCell            = 4,
  34.     NSCellHighlighted            = 5,
  35.     NSCellLightsByContents        = 6,
  36.     NSCellLightsByGray            = 7,
  37.     NSChangeBackgroundCell        = 8,
  38.     NSCellLightsByBackground        = 9,
  39.     NSCellIsBordered            = 10,
  40.     NSCellHasOverlappingImage        = 11,
  41.     NSCellHasImageHorizontal        = 12,
  42.     NSCellHasImageOnLeftOrBottom    = 13,
  43.     NSCellChangesContents        = 14,
  44.     NSCellIsInsetButton            = 15
  45. } NSCellAttribute;
  46.  
  47. typedef enum _NSCellImagePosition {
  48.     NSNoImage                = 0,
  49.     NSImageOnly                = 1,
  50.     NSImageLeft                = 2,
  51.     NSImageRight            = 3,
  52.     NSImageBelow            = 4,
  53.     NSImageAbove            = 5,
  54.     NSImageOverlaps            = 6
  55. } NSCellImagePosition;
  56.  
  57. /* ButtonCell highlightsBy and showsStateBy mask */
  58.  
  59. enum {
  60.     NSNoCellMask            = 0,
  61.     NSContentsCellMask            = 1,
  62.     NSPushInCellMask            = 2,
  63.     NSChangeGrayCellMask        = 4,
  64.     NSChangeBackgroundCellMask        = 8,
  65. };
  66.  
  67. @class NSEvent;
  68.  
  69. @interface NSCell : NSObject
  70. {
  71.     NSString               *contents;
  72.     id                  support;
  73.     struct _cFlags1 {
  74. #ifdef __BIG_ENDIAN__
  75.     unsigned int        state:1;
  76.     unsigned int        highlighted:1;
  77.     unsigned int        disabled:1;
  78.     unsigned int        editable:1;
  79.     unsigned int        type:2;
  80.     unsigned int        freeText:1;
  81.     unsigned int        alignment:2;
  82.     unsigned int        bordered:1;
  83.     unsigned int        bezeled:1;
  84.     unsigned int        selectable:1;
  85.     unsigned int        scrollable:1;
  86.     unsigned int        entryType:3;
  87. #else
  88.     unsigned int        entryType:3;
  89.     unsigned int        scrollable:1;
  90.     unsigned int        selectable:1;
  91.     unsigned int        bezeled:1;
  92.     unsigned int        bordered:1;
  93.     unsigned int        alignment:2;
  94.     unsigned int        freeText:1;
  95.     unsigned int        type:2;
  96.     unsigned int        editable:1;
  97.     unsigned int        disabled:1;
  98.     unsigned int        highlighted:1;
  99.     unsigned int        state:1;
  100. #endif
  101.     }                   cFlags1;
  102.     struct _cFlags2 {
  103. #ifdef __BIG_ENDIAN__
  104.     unsigned int        continuous:1;
  105.     unsigned int        actOnMouseDown:1;
  106.     unsigned int        _isLeaf:1;
  107.     unsigned int        floatLeft:4;
  108.     unsigned int        floatRight:4;
  109.     unsigned int        autoRange:1;
  110.     unsigned int        actOnMouseDragged:1;
  111.     unsigned int        _isLoaded:1;
  112.     unsigned int        noWrap:1;
  113.     unsigned int        dontActOnMouseUp:1;
  114. #else
  115.     unsigned int        dontActOnMouseUp:1;
  116.     unsigned int        noWrap:1;
  117.     unsigned int        _isLoaded:1;
  118.     unsigned int        actOnMouseDragged:1;
  119.     unsigned int        autoRange:1;
  120.     unsigned int        floatRight:4;
  121.     unsigned int        floatLeft:4;
  122.     unsigned int        _isLeaf:1;
  123.     unsigned int        actOnMouseDown:1;
  124.     unsigned int        continuous:1;
  125. #endif
  126.     }                   cFlags2;
  127.     struct __cFlags3 {
  128.     unsigned int        isWhite:1;
  129.     unsigned int        useUserKeyEquivalent:1;
  130.     unsigned int        center:1;
  131.     unsigned int        docEditing:1;
  132.     unsigned int        docSaved:1;
  133.     unsigned int        wasSelectable:1;
  134. #ifdef KANJI
  135.     unsigned int        dontUseInputManager:1;
  136.     unsigned int        RESERVED:9;
  137. #else
  138.     unsigned int        RESERVED:10;
  139. #endif
  140.     }            _cFlags3;
  141.     unsigned short        _reservedCshort;
  142. }
  143.  
  144.  
  145. + (BOOL)prefersTrackingUntilMouseUp;
  146.  
  147. - initTextCell:(NSString *)aString;
  148. - initImageCell:(NSImage *)iconName;
  149.  
  150. - controlView;
  151. - (NSString *)type;
  152. - setType:(NSCellType)aType;
  153. - (int)state;
  154. - setState:(int)value;
  155. - incrementState;
  156. - target;
  157. - setTarget:anObject;
  158. - (SEL)action;
  159. - setAction:(SEL)aSelector;
  160. - (int)tag;
  161. - setTag:(int)anInt;
  162. - (BOOL)isOpaque;
  163. - (BOOL)isEnabled;
  164. - setEnabled:(BOOL)flag;
  165. - (int)sendActionOn:(int)mask;
  166. - (BOOL)isContinuous;
  167. - setContinuous:(BOOL)flag;
  168. - (BOOL)isEditable;
  169. - setEditable:(BOOL)flag;
  170. - (BOOL)isSelectable;
  171. - setSelectable:(BOOL)flag;
  172. - (BOOL)isBordered;
  173. - setBordered:(BOOL)flag;
  174. - (BOOL)isBezeled;
  175. - setBezeled:(BOOL)flag;
  176. - (BOOL)isScrollable;
  177. - setScrollable:(BOOL)flag;
  178. - (BOOL)isHighlighted;
  179. - (NSTextAlignment)alignment;
  180. - setAlignment:(NSTextAlignment)mode;
  181. - setWrap:(BOOL)flag;
  182. - font;
  183. - setFont:fontObj;
  184. - (int)entryType;
  185. - setEntryType:(int)aType;
  186. - (BOOL)isEntryAcceptable:(NSString *)aString;
  187. - setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits right:(unsigned)rightDigits;
  188. - (NSString *)keyEquivalent;
  189. - (NSString *)stringValue;
  190. - setStringValue:(NSString *)aString;
  191. - (int)intValue;
  192. - setIntValue:(int)anInt;
  193. - (float)floatValue;
  194. - setFloatValue:(float)aFloat;
  195. - (double)doubleValue;
  196. - setDoubleValue:(double)aDouble;
  197. - takeIntValueFrom:sender;
  198. - takeFloatValueFrom:sender;
  199. - takeDoubleValueFrom:sender;
  200. - takeStringValueFrom:sender;
  201. - (NSImage *)image;
  202. - setImage:(NSImage *)iconName;
  203. - (int)getParameter:(NSCellAttribute)aParameter;
  204. - setParameter:(NSCellAttribute)aParameter to:(int)value;
  205. - (NSRect)imageRectForBounds:(NSRect)theRect;
  206. - (NSRect)titleRectForBounds:(NSRect)theRect;
  207. - (NSRect)drawingRectForBounds:(NSRect)theRect;
  208. - (NSSize)cellSize;
  209. - (NSSize)cellSizeForBounds:(NSRect)aRect;
  210. - calcDrawInfo:(NSRect)aRect;
  211. - setUpFieldEditorAttributes:textObj;
  212. - drawInside:(NSRect)cellFrame inView:controlView;
  213. - drawSelf:(NSRect)cellFrame inView:controlView;
  214. - highlight:(NSRect)cellFrame inView:controlView lit:(BOOL)flag;
  215. - (int)mouseDownFlags;
  216. - getPeriodicDelay:(float*)delay andInterval:(float*)interval;
  217. - (BOOL)startTrackingAt:(NSPoint)startPoint inView:controlView;
  218. - (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:controlView;
  219. - stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:controlView mouseIsUp:(BOOL)flag;
  220. - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:controlView untilMouseUp:(BOOL)untilMouseUp;
  221. - edit:(NSRect)aRect inView:controlView editor:textObj delegate:anObject event:(NSEvent *)theEvent;
  222. - select:(NSRect)aRect inView:controlView editor:textObj delegate:anObject start:(int)selStart length:(int)selLength;
  223. - endEditing:textObj;
  224. - resetCursorRect:(NSRect)cellFrame inView:controlView;
  225.  
  226. @end
  227.  
  228. #ifdef KANJI
  229. @interface NSCell(InputManager)
  230. - (BOOL)cellUsesIM;
  231. - setCellUsesIM:(BOOL)flag;
  232. @end
  233. #endif
  234.