home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSParagraphStyle.h < prev    next >
Text File  |  1996-10-17  |  4KB  |  100 lines

  1. /*
  2.         NSParagraphStyle.h
  3.         Copyright (c) 1994-1996 NeXT Software, Inc.  All rights reserved.
  4.  
  5.     NSParagraphStyle and NSMutableParagraphStyle hold paragraph style information
  6.     NSTextTab holds information about a single tab stop
  7. */
  8.  
  9. #ifndef STRICT_OPENSTEP
  10.  
  11. #import <Foundation/Foundation.h>
  12. #import <AppKit/NSText.h>
  13.  
  14. typedef enum _NSTextTabType {
  15.     NSLeftTabStopType = 0,
  16.     NSRightTabStopType,        /* ??? Doesn't work yet */
  17.     NSCenterTabStopType,    /* ??? Doesn't work yet */
  18.     NSDecimalTabStopType    /* ??? Doesn't work yet */
  19. } NSTextTabType;
  20.  
  21. typedef enum _NSLineBreakMode {        /* What to do with long lines */
  22.     NSLineBreakByWordWrapping = 0,         /* Wrap at word boundaries, default */
  23.     NSLineBreakByCharWrapping,        /* Wrap at character boundaries */
  24.     NSLineBreakByClipping,        /* Simply clip */
  25.     NSLineBreakByTruncatingHead,    /* Truncate at head of line: "...wxyz" ??? Doesn't work yet */
  26.     NSLineBreakByTruncatingTail,    /* Truncate at tail of line: "abcd..." ??? Doesn't work yet */
  27.     NSLineBreakByTruncatingMiddle    /* Truncate middle of line:  "ab...yz" ??? Doesn't work yet */
  28. } NSLineBreakMode;
  29.  
  30. @interface NSTextTab : NSObject <NSCopying, NSCoding> {
  31.     struct {
  32.     NSTextTabType type:8;
  33.         unsigned int refCount:24;
  34.     } _flags;
  35.     float _location;
  36.     unsigned int _reserved;
  37. }
  38. - (id)initWithType:(NSTextTabType)type location:(float)loc;
  39. - (float)location;
  40. - (NSTextTabType)tabStopType;
  41. @end
  42.  
  43. @interface NSParagraphStyle : NSObject <NSCopying, NSMutableCopying, NSCoding> {
  44.     float _lineSpacing;
  45.     float _paragraphSpacing;
  46.     float _headIndent;
  47.     float _tailIndent;
  48.     float _firstLineHeadIndent;
  49.     float _minimumLineHeight;
  50.     float _maximumLineHeight;
  51.     NSArray *_tabStops;
  52.     struct {
  53.     NSTextAlignment alignment:4;
  54.         NSLineBreakMode lineBreakMode:4;
  55.         unsigned int refCount:24;
  56.     } _flags;
  57.     unsigned int _reserved1;
  58.     unsigned int _reserved2;
  59. }
  60.  
  61. + (NSParagraphStyle *)defaultParagraphStyle;
  62.  
  63. - (float)lineSpacing;        /* "Leading": distance between the bottom of one line fragment and top of next (applied between lines in the same container). Can't be negative. This value is included in the line fragment heights in layout manager. */
  64. - (float)paragraphSpacing;     /* Distance between the bottom of this paragraph and top of next. */
  65. - (NSTextAlignment)alignment;
  66.  
  67. /* The following values are relative to the appropriate margin (depending on the paragraph direction) */
  68.    
  69. - (float)headIndent;        /* Distance from margin to front edge of paragraph */
  70. - (float)tailIndent;        /* Distance from margin to back edge of paragraph; if negative or 0, from other margin */
  71. - (float)firstLineHeadIndent;    /* Distance from margin to edge appropriate for text direction */
  72. - (NSArray *)tabStops;        /* Distance from margin to tab stops */
  73.  
  74. - (float)minimumLineHeight;    /* Line height is the distance from bottom of descenders to top of ascenders; basically the line fragment height. Does not include lineSpacing (which is added after this computation). */
  75. - (float)maximumLineHeight;    /* 0 implies no maximum. */ 
  76.  
  77. - (NSLineBreakMode)lineBreakMode;
  78.  
  79. @end
  80.  
  81. @interface NSMutableParagraphStyle : NSParagraphStyle
  82.  
  83. - (void)setLineSpacing:(float)aFloat;
  84. - (void)setParagraphSpacing:(float)aFloat;
  85. - (void)setAlignment:(NSTextAlignment)alignment;
  86. - (void)setFirstLineHeadIndent:(float)aFloat;
  87. - (void)setHeadIndent:(float)aFloat;
  88. - (void)setTailIndent:(float)aFloat;
  89. - (void)setLineBreakMode:(NSLineBreakMode)mode;
  90. - (void)setMinimumLineHeight:(float)aFloat;
  91. - (void)setMaximumLineHeight:(float)aFloat;
  92. - (void)addTabStop:(NSTextTab *)anObject;
  93. - (void)removeTabStop:(NSTextTab *)anObject;
  94. - (void)setTabStops:(NSArray *)array;
  95. - (void)setParagraphStyle:(NSParagraphStyle *)obj;
  96.  
  97. @end
  98.  
  99. #endif
  100.