home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks2 / AppKit.framework / Headers / NSCell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-29  |  6.4 KB  |  232 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. @interface NSCell : NSObject
  68. {
  69.     NSString               *contents;
  70.     id                  support;
  71.     struct _cFlags1 {
  72. #ifdef __BIG_ENDIAN__
  73.     unsigned int        state:1;
  74.     unsigned int        highlighted:1;
  75.     unsigned int        disabled:1;
  76.     unsigned int        editable:1;
  77.     unsigned int        type:2;
  78.     unsigned int        freeText:1;
  79.     unsigned int        alignment:2;
  80.     unsigned int        bordered:1;
  81.     unsigned int        bezeled:1;
  82.     unsigned int        selectable:1;
  83.     unsigned int        scrollable:1;
  84.     unsigned int        entryType:3;
  85. #else
  86.     unsigned int        entryType:3;
  87.     unsigned int        scrollable:1;
  88.     unsigned int        selectable:1;
  89.     unsigned int        bezeled:1;
  90.     unsigned int        bordered:1;
  91.     unsigned int        alignment:2;
  92.     unsigned int        freeText:1;
  93.     unsigned int        type:2;
  94.     unsigned int        editable:1;
  95.     unsigned int        disabled:1;
  96.     unsigned int        highlighted:1;
  97.     unsigned int        state:1;
  98. #endif
  99.     }                   cFlags1;
  100.     struct _cFlags2 {
  101. #ifdef __BIG_ENDIAN__
  102.     unsigned int        continuous:1;
  103.     unsigned int        actOnMouseDown:1;
  104.     unsigned int        _isLeaf:1;
  105.     unsigned int        floatLeft:4;
  106.     unsigned int        floatRight:4;
  107.     unsigned int        autoRange:1;
  108.     unsigned int        actOnMouseDragged:1;
  109.     unsigned int        _isLoaded:1;
  110.     unsigned int        noWrap:1;
  111.     unsigned int        dontActOnMouseUp:1;
  112. #else
  113.     unsigned int        dontActOnMouseUp:1;
  114.     unsigned int        noWrap:1;
  115.     unsigned int        _isLoaded:1;
  116.     unsigned int        actOnMouseDragged:1;
  117.     unsigned int        autoRange:1;
  118.     unsigned int        floatRight:4;
  119.     unsigned int        floatLeft:4;
  120.     unsigned int        _isLeaf:1;
  121.     unsigned int        actOnMouseDown:1;
  122.     unsigned int        continuous:1;
  123. #endif
  124.     }                   cFlags2;
  125.     struct __cFlags3 {
  126.     unsigned int        isWhite:1;
  127.     unsigned int        useUserKeyEquivalent:1;
  128.     unsigned int        center:1;
  129.     unsigned int        docEditing:1;
  130.     unsigned int        docSaved:1;
  131.     unsigned int        wasSelectable:1;
  132. #ifdef KANJI
  133.     unsigned int        dontUseInputManager:1;
  134.     unsigned int        RESERVED:9;
  135. #else
  136.     unsigned int        RESERVED:10;
  137. #endif
  138.     }            _cFlags3;
  139.     unsigned short        _reservedCshort;
  140. }
  141.  
  142.  
  143. + (BOOL)prefersTrackingUntilMouseUp;
  144.  
  145. - initTextCell:(NSString *)aString;
  146. - initImageCell:(NSImage *)iconName;
  147.  
  148. - controlView;
  149. - (NSString *)type;
  150. - setType:(NSCellType)aType;
  151. - (int)state;
  152. - setState:(int)value;
  153. - incrementState;
  154. - target;
  155. - setTarget:anObject;
  156. - (SEL)action;
  157. - setAction:(SEL)aSelector;
  158. - (int)tag;
  159. - setTag:(int)anInt;
  160. - (BOOL)isOpaque;
  161. - (BOOL)isEnabled;
  162. - setEnabled:(BOOL)flag;
  163. - (int)sendActionOn:(int)mask;
  164. - (BOOL)isContinuous;
  165. - setContinuous:(BOOL)flag;
  166. - (BOOL)isEditable;
  167. - setEditable:(BOOL)flag;
  168. - (BOOL)isSelectable;
  169. - setSelectable:(BOOL)flag;
  170. - (BOOL)isBordered;
  171. - setBordered:(BOOL)flag;
  172. - (BOOL)isBezeled;
  173. - setBezeled:(BOOL)flag;
  174. - (BOOL)isScrollable;
  175. - setScrollable:(BOOL)flag;
  176. - (BOOL)isHighlighted;
  177. - (NSTextAlignment)alignment;
  178. - setAlignment:(NSTextAlignment)mode;
  179. - setWrap:(BOOL)flag;
  180. - font;
  181. - setFont:fontObj;
  182. - (int)entryType;
  183. - setEntryType:(int)aType;
  184. - (BOOL)isEntryAcceptable:(NSString *)aString;
  185. - setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits right:(unsigned)rightDigits;
  186. - (NSString *)keyEquivalent;
  187. - (NSString *)stringValue;
  188. - setStringValue:(NSString *)aString;
  189. - (int)intValue;
  190. - setIntValue:(int)anInt;
  191. - (float)floatValue;
  192. - setFloatValue:(float)aFloat;
  193. - (double)doubleValue;
  194. - setDoubleValue:(double)aDouble;
  195. - takeIntValueFrom:sender;
  196. - takeFloatValueFrom:sender;
  197. - takeDoubleValueFrom:sender;
  198. - takeStringValueFrom:sender;
  199. - (NSImage *)image;
  200. - setImage:(NSImage *)iconName;
  201. - (int)getParameter:(NSCellAttribute)aParameter;
  202. - setParameter:(NSCellAttribute)aParameter to:(int)value;
  203. - (NSRect)imageRectForBounds:(NSRect)theRect;
  204. - (NSRect)titleRectForBounds:(NSRect)theRect;
  205. - (NSRect)drawingRectForBounds:(NSRect)theRect;
  206. - (NSSize)cellSize;
  207. - (NSSize)cellSizeForBounds:(NSRect)aRect;
  208. - calcDrawInfo:(NSRect)aRect;
  209. - setUpFieldEditorAttributes:textObj;
  210. - drawInside:(NSRect)cellFrame inView:controlView;
  211. - drawSelf:(NSRect)cellFrame inView:controlView;
  212. - highlight:(NSRect)cellFrame inView:controlView lit:(BOOL)flag;
  213. - (int)mouseDownFlags;
  214. - getPeriodicDelay:(float*)delay andInterval:(float*)interval;
  215. - (BOOL)startTrackingAt:(NSPoint)startPoint inView:controlView;
  216. - (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:controlView;
  217. - stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:controlView mouseIsUp:(BOOL)flag;
  218. - (BOOL)trackMouse:(NXEvent *)theEvent inRect:(NSRect)cellFrame ofView:controlView untilMouseUp:(BOOL)untilMouseUp;
  219. - edit:(NSRect)aRect inView:controlView editor:textObj delegate:anObject event:(NXEvent *)theEvent;
  220. - select:(NSRect)aRect inView:controlView editor:textObj delegate:anObject start:(int)selStart length:(int)selLength;
  221. - endEditing:textObj;
  222. - resetCursorRect:(NSRect)cellFrame inView:controlView;
  223.  
  224. @end
  225.  
  226. #ifdef KANJI
  227. @interface NSCell(InputManager)
  228. - (BOOL)cellUsesIM;
  229. - setCellUsesIM:(BOOL)flag;
  230. @end
  231. #endif
  232.