home *** CD-ROM | disk | FTP | other *** search
- /*
- Cell.h
- Application Kit, Release 2.0
- Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved.
- */
-
- #import <Foundation/Foundation.h>
- #import "NSGraphics.h"
- #import "NSText.h"
-
- enum {
- NSAnyType = 0,
- NSIntType = 1,
- NSPositiveIntType = 2,
- NSFloatType = 3,
- NSPositiveFloatType = 4,
- NSDateType = 5,
- NSDoubleType = 6,
- NSPositiveDoubleType = 7
- };
-
- typedef enum _NSCellType {
- NSNullCellType = 0,
- NSTextCellType = 1,
- NSImageCellType = 2
- } NSCellType;
-
- typedef enum _NSCellAttribute {
- NSCellDisabled = 0,
- NSCellState = 1,
- NSPushInCell = 2,
- NSCellEditable = 3,
- NSChangeGrayCell = 4,
- NSCellHighlighted = 5,
- NSCellLightsByContents = 6,
- NSCellLightsByGray = 7,
- NSChangeBackgroundCell = 8,
- NSCellLightsByBackground = 9,
- NSCellIsBordered = 10,
- NSCellHasOverlappingImage = 11,
- NSCellHasImageHorizontal = 12,
- NSCellHasImageOnLeftOrBottom = 13,
- NSCellChangesContents = 14,
- NSCellIsInsetButton = 15
- } NSCellAttribute;
-
- typedef enum _NSCellImagePosition {
- NSNoImage = 0,
- NSImageOnly = 1,
- NSImageLeft = 2,
- NSImageRight = 3,
- NSImageBelow = 4,
- NSImageAbove = 5,
- NSImageOverlaps = 6
- } NSCellImagePosition;
-
- /* ButtonCell highlightsBy and showsStateBy mask */
-
- enum {
- NSNoCellMask = 0,
- NSContentsCellMask = 1,
- NSPushInCellMask = 2,
- NSChangeGrayCellMask = 4,
- NSChangeBackgroundCellMask = 8,
- };
-
- @class NSEvent;
-
- @interface NSCell : NSObject
- {
- NSString *contents;
- id support;
- struct _cFlags1 {
- #ifdef __BIG_ENDIAN__
- unsigned int state:1;
- unsigned int highlighted:1;
- unsigned int disabled:1;
- unsigned int editable:1;
- unsigned int type:2;
- unsigned int freeText:1;
- unsigned int alignment:2;
- unsigned int bordered:1;
- unsigned int bezeled:1;
- unsigned int selectable:1;
- unsigned int scrollable:1;
- unsigned int entryType:3;
- #else
- unsigned int entryType:3;
- unsigned int scrollable:1;
- unsigned int selectable:1;
- unsigned int bezeled:1;
- unsigned int bordered:1;
- unsigned int alignment:2;
- unsigned int freeText:1;
- unsigned int type:2;
- unsigned int editable:1;
- unsigned int disabled:1;
- unsigned int highlighted:1;
- unsigned int state:1;
- #endif
- } cFlags1;
- struct _cFlags2 {
- #ifdef __BIG_ENDIAN__
- unsigned int continuous:1;
- unsigned int actOnMouseDown:1;
- unsigned int _isLeaf:1;
- unsigned int floatLeft:4;
- unsigned int floatRight:4;
- unsigned int autoRange:1;
- unsigned int actOnMouseDragged:1;
- unsigned int _isLoaded:1;
- unsigned int noWrap:1;
- unsigned int dontActOnMouseUp:1;
- #else
- unsigned int dontActOnMouseUp:1;
- unsigned int noWrap:1;
- unsigned int _isLoaded:1;
- unsigned int actOnMouseDragged:1;
- unsigned int autoRange:1;
- unsigned int floatRight:4;
- unsigned int floatLeft:4;
- unsigned int _isLeaf:1;
- unsigned int actOnMouseDown:1;
- unsigned int continuous:1;
- #endif
- } cFlags2;
- struct __cFlags3 {
- unsigned int isWhite:1;
- unsigned int useUserKeyEquivalent:1;
- unsigned int center:1;
- unsigned int docEditing:1;
- unsigned int docSaved:1;
- unsigned int wasSelectable:1;
- #ifdef KANJI
- unsigned int dontUseInputManager:1;
- unsigned int RESERVED:9;
- #else
- unsigned int RESERVED:10;
- #endif
- } _cFlags3;
- unsigned short _reservedCshort;
- }
-
-
- + (BOOL)prefersTrackingUntilMouseUp;
-
- - initTextCell:(NSString *)aString;
- - initImageCell:(NSImage *)iconName;
-
- - controlView;
- - (NSString *)type;
- - setType:(NSCellType)aType;
- - (int)state;
- - setState:(int)value;
- - incrementState;
- - target;
- - setTarget:anObject;
- - (SEL)action;
- - setAction:(SEL)aSelector;
- - (int)tag;
- - setTag:(int)anInt;
- - (BOOL)isOpaque;
- - (BOOL)isEnabled;
- - setEnabled:(BOOL)flag;
- - (int)sendActionOn:(int)mask;
- - (BOOL)isContinuous;
- - setContinuous:(BOOL)flag;
- - (BOOL)isEditable;
- - setEditable:(BOOL)flag;
- - (BOOL)isSelectable;
- - setSelectable:(BOOL)flag;
- - (BOOL)isBordered;
- - setBordered:(BOOL)flag;
- - (BOOL)isBezeled;
- - setBezeled:(BOOL)flag;
- - (BOOL)isScrollable;
- - setScrollable:(BOOL)flag;
- - (BOOL)isHighlighted;
- - (NSTextAlignment)alignment;
- - setAlignment:(NSTextAlignment)mode;
- - setWrap:(BOOL)flag;
- - font;
- - setFont:fontObj;
- - (int)entryType;
- - setEntryType:(int)aType;
- - (BOOL)isEntryAcceptable:(NSString *)aString;
- - setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits right:(unsigned)rightDigits;
- - (NSString *)keyEquivalent;
- - (NSString *)stringValue;
- - setStringValue:(NSString *)aString;
- - (int)intValue;
- - setIntValue:(int)anInt;
- - (float)floatValue;
- - setFloatValue:(float)aFloat;
- - (double)doubleValue;
- - setDoubleValue:(double)aDouble;
- - takeIntValueFrom:sender;
- - takeFloatValueFrom:sender;
- - takeDoubleValueFrom:sender;
- - takeStringValueFrom:sender;
- - (NSImage *)image;
- - setImage:(NSImage *)iconName;
- - (int)getParameter:(NSCellAttribute)aParameter;
- - setParameter:(NSCellAttribute)aParameter to:(int)value;
- - (NSRect)imageRectForBounds:(NSRect)theRect;
- - (NSRect)titleRectForBounds:(NSRect)theRect;
- - (NSRect)drawingRectForBounds:(NSRect)theRect;
- - (NSSize)cellSize;
- - (NSSize)cellSizeForBounds:(NSRect)aRect;
- - calcDrawInfo:(NSRect)aRect;
- - setUpFieldEditorAttributes:textObj;
- - drawInteriorWithFrame:(NSRect)cellFrame inView:controlView;
- - drawWithFrame:(NSRect)cellFrame inView:controlView;
- - highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- - (int)mouseDownFlags;
- - getPeriodicDelay:(float*)delay andInterval:(float*)interval;
- - (BOOL)startTrackingAt:(NSPoint)startPoint inView:controlView;
- - (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:controlView;
- - stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:controlView mouseIsUp:(BOOL)flag;
- - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:controlView untilMouseUp:(BOOL)untilMouseUp;
- - edit:(NSRect)aRect inView:controlView editor:textObj delegate:anObject event:(NSEvent *)theEvent;
- - select:(NSRect)aRect inView:controlView editor:textObj delegate:anObject start:(int)selStart length:(int)selLength;
- - endEditing:textObj;
- - resetCursorRect:(NSRect)cellFrame inView:controlView;
-
- @end
-
- #ifdef KANJI
- @interface NSCell(InputManager)
- - (BOOL)cellUsesIM;
- - setCellUsesIM:(BOOL)flag;
- @end
- #endif
-