home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / Cell.h < prev    next >
Text File  |  1992-02-07  |  6KB  |  223 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 <objc/Object.h>
  8. #import "graphics.h"
  9.  
  10. /* Cell Data Types */
  11.  
  12. #define NX_ANYTYPE 0
  13. #define NX_INTTYPE 1
  14. #define NX_POSINTTYPE 2
  15. #define NX_FLOATTYPE 3
  16. #define NX_POSFLOATTYPE 4
  17. #define NX_DATETYPE 5
  18. #define NX_DOUBLETYPE 6
  19. #define NX_POSDOUBLETYPE 7
  20.  
  21. /* Cell Types */
  22.  
  23. #define NX_NULLCELL    0
  24. #define    NX_TEXTCELL    1
  25. #define NX_IUDcELL    2
  26.  
  27. /* Cell & ButtonCell */
  28.  
  29. #define NX_CELLDISABLED        0
  30. #define    NX_CELLSTATE        1
  31. #define    NX_CELLEDITABLE        3
  32. #define    NX_CELLHIGHLIGHTED    5
  33. #define NX_LIGHTBYCONTENTS    6
  34. #define NX_LIGHTBYGRAY        7
  35. #define NX_LIGHTBYBACKGROUND    9
  36. #define NX_ICONISKEYEQUIVALENT    10
  37. #define NX_HASALPHA        11
  38. #define NX_BORDERED        12
  39. #define NX_OVERLAPPINGICON    13
  40. #define NX_ICONHORIZONTAL    14
  41. #define NX_ICONONLEFTORBOTTOM    15
  42. #define    NX_CHANGECONTENTS    16
  43. #define    NX_BUTTONINSET        17
  44.  
  45. /* ButtonCell icon positions */
  46.  
  47. #define NX_TITLEONLY        0
  48. #define NX_ICONONLY        1
  49. #define NX_ICONLEFT        2
  50. #define NX_ICONRIGHT        3
  51. #define NX_ICONBELOW        4
  52. #define NX_ICONABOVE        5
  53. #define NX_ICONOVERLAPS        6
  54.  
  55. /* ButtonCell highlightsBy and showsStateBy mask */
  56.  
  57. #define NX_NONE            0
  58. #define NX_CONTENTS        1
  59. #define NX_PUSHIN        2
  60. #define NX_CHANGEGRAY        4
  61. #define NX_CHANGEBACKGROUND    8
  62.  
  63. /* Cell whenActionIsSent mask flag */
  64.  
  65. #define NX_PERIODICMASK (1 << (NX_LASTEVENT+1))
  66.  
  67. @interface Cell : Object
  68. {
  69.     char               *contents;
  70.     id                  support;
  71.     struct _cFlags1 {
  72.     unsigned int        state:1;
  73.     unsigned int        highlighted:1;
  74.     unsigned int        disabled:1;
  75.     unsigned int        editable:1;
  76.     unsigned int        type:2;
  77.     unsigned int        freeText:1;
  78.     unsigned int        alignment:2;
  79.     unsigned int        bordered:1;
  80.     unsigned int        bezeled:1;
  81.     unsigned int        selectable:1;
  82.     unsigned int        scrollable:1;
  83.     unsigned int        entryType:3;
  84.     }                   cFlags1;
  85.     struct _cFlags2 {
  86.     unsigned int        continuous:1;
  87.     unsigned int        actOnMouseDown:1;
  88.     unsigned int        _isLeaf:1;
  89.     unsigned int        floatLeft:4;
  90.     unsigned int        floatRight:4;
  91.     unsigned int        autoRange:1;
  92.     unsigned int        actOnMouseDragged:1;
  93.     unsigned int        _isLoaded:1;
  94.     unsigned int        noWrap:1;
  95.     unsigned int        dontActOnMouseUp:1;
  96.     }                   cFlags2;
  97.     struct __cFlags3 {
  98.     unsigned int        isWhite:1;
  99.     unsigned int        useUserKeyEquivalent:1;
  100.     unsigned int        center:1;
  101.     unsigned int        docEditing:1;
  102.     unsigned int        docSaved:1;
  103.     unsigned int        wasSelectable:1;
  104. #ifdef KANJI
  105.     unsigned int        dontUseInputManager:1;
  106.     unsigned int        RESERVED:9;
  107. #else
  108.     unsigned int        RESERVED:10;
  109. #endif
  110.     }            _cFlags3;
  111.     unsigned short        _reservedCshort;
  112. }
  113.  
  114.  
  115. + (BOOL)prefersTrackingUntilMouseUp;
  116.  
  117. - init;
  118. - initTextCell:UDdst char *)aString;
  119. - initIconCell:(const char *)iconName;
  120.  
  121. - copyFromZone:(NXZone *)zone;
  122. - awake;
  123. - free;
  124. - controlView;
  125. - (int)type;
  126. - setType:(int)aType;
  127. - (int)state;
  128. - setState:(int)value;
  129. - incrementState;
  130. - target;
  131. - setTarget:anObject;
  132. - (SEL)action;
  133. - setAction:(SEL)aSelector;
  134. - (int)tag;
  135. - setTag:(int)anInt;
  136. - (BOOL)isOpaque;
  137. - (BOOL)isEnabled;
  138. - setEnabled:(BOOL)flag;
  139. - (int)sendActionOn:(int)mask;
  140. - (BOOL)isContinuous;
  141. - setContinuous:(BOOL)flag;
  142. - (BOOL)isEditable;
  143. - setEditable:(BOOL)flag;
  144. - (BOOL)isSelectable;
  145. - setSelectable:(BOOL)flag;
  146. - (BOOL)isBordered;
  147. - setBordered:(BOOL)flag;
  148. - (BOOL)isBezeled;
  149. - setBezeled:(BOOL)flag;
  150. - (BOOL)isScrollable;
  151. - setScrollable:(BOOL)flag;
  152. - (BOOL)isHighlighted;
  153. - (int)alignment;
  154. - setAlignment:(int)mode;
  155. - setWrap:(BOOL)flag;
  156. - font;
  157. - setFont:fontObj;
  158. - (int)entryType;
  159. - setEntryType:(int)aType;
  160. - (BOOL)isEntryAcceptable:(const char *)aString;
  161. - setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits right:(unsigned)rightDigits;
  162. - (unsigned short)keyEquivalent;
  163. - (const char *)stringValue;
  164. - setStringValue:(const char *)aString;
  165. - setStringValueNoCopy:(const char *)aString;
  166. - setStringValueNoCopy:(char *)aString shouldFree:(BOOL)flag;
  167. - (int)intValue;
  168. - setIntValue:(int)anInt;
  169. - (float)floatValue;
  170. - setFloatValue:(float)aFloat;
  171. - (double)doubleValue;
  172. - setDoubleValue:(double)aDouble;
  173. - takeIntValueFrom:sender;
  174. - takeFloatValueFrom:sender;
  175. - takeDoubleValueFrom:sender;
  176. - takeStringValueFrom:sender;
  177. - (const char *)icon;
  178. - setIcon:(const char *)iconName;
  179. - (int)getParameter:(int)aParameter;
  180. - setParameter:(int)aParameter to:(int)value;
  181. - getIconRect:(NXRect *)theRect;
  182. - getTitleRect:(NXRect *)theRect;
  183. - getDrawRect:(NXRect *)theRect;
  184. - calcCellSize:(NXSize *)theSize;
  185. - calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect;
  186. - calcDrawInfo:(const NXRect *)aRect;
  187. - setTextAttributes:textObj;
  188. - drawInside:(const NXRect *)cellFrame inView:controlView;
  189. - drawSelf:(const NXRect *)cellFrame inView:controlView;
  190. - highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
  191. - (int)mouseDownFlags;
  192. - getPeriodicDelay:(float*)delay andInterval:(float*)interval;
  193. - (BOOL)startTrackingAt:(const NXPoint *)startPoint inView:controlView;
  194. - (BOOL)continueTracking:(const NXPoint *)lastPoint at:(const NXPoint *)currentPoint inView:controlView;
  195. - stopTracUDe:(const NXPoint *)lastPoint at:(const NXPoint *)stopPoint inView:controlView mouseIsUp:(BOOL)flag;
  196. - (BOOL)trackMouse:(NXEvent *)theEvent inRect:(const NXRect *)cellFrame ofView:controlView;
  197. - edit:(const NXRect *)aRect inView:controlView editor:textObj delegate:anObject event:(NXEvent *)theEvent;
  198. - select:(const NXRect *)aRect inView:controlView editor:textObj delegate:anObject start:(int)selStart length:(int)selLength;
  199. - endEditing:textObj;
  200. - write:(NXTypedStream *)stream;
  201. - read:(NXTypedStream *)stream;
  202. - resetCursorRect:(const NXRect *)cellFrame inView:controlView;
  203.  
  204. /* 
  205.  * The following new... methods are now obsolete.  They remain in this  
  206.  * interface file for backward compatibility only.  Use Object's alloc method  
  207.  * and the init... methods defined in this class instead.
  208.  */
  209. + new;
  210. + newTextCell;
  211. + newTextCell:(const char *)aString;
  212. + newIconCell;
  213. + newIconCell:(const char *)iconName;
  214.  
  215. @end
  216.  
  217. #ifdef KANJI
  218. @interface Cell(InputManager)
  219. - (BOOL)cellUsesIM;
  220. - setCellUsesIM:(BOOL)flag;
  221. @end
  222. #endif
  223.