summaryrefslogtreecommitdiff
path: root/packages/cocoaint/src/appkit/NSTextContainer.inc
blob: af18de999405bf8adbd887ccfb5ff98da30d3e8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ Parsed from AppKit.framework NSTextContainer.h }


{$ifdef TYPES}
type
  NSTextContainerPtr = ^NSTextContainer;
{$endif}

{$ifdef TYPES}
type
  NSLineSweepDirection = NSUInteger;
  NSLineSweepDirectionPtr = ^NSLineSweepDirection;

const
  NSLineSweepLeft = 0;
  NSLineSweepRight = 1;
  NSLineSweepDown = 2;
  NSLineSweepUp = 3;

type
  NSLineMovementDirection = NSUInteger;
  NSLineMovementDirectionPtr = ^NSLineMovementDirection;

const
  NSLineDoesntMove = 0;
  NSLineMovesLeft = 1;
  NSLineMovesRight = 2;
  NSLineMovesDown = 3;
  NSLineMovesUp = 4;
{$endif}

{$ifdef CLASSES}

type
  NSTextContainer = objcclass external (NSObject, NSCodingProtocol, NSTextLayoutOrientationProviderProtocol)
  private
    _layoutManager: NSLayoutManager;
    _textView: NSTextView;
    _size: NSSize;
    _lineFragmentPadding: CGFloat;
    _tcFlags: bitpacked record
      case byte of
        0: (_anonBitField__tcFlags0: cuint);
        1: (
          widthTracksTextView: 0..1;
          heightTracksTextView: 0..1;
          observingFrameChanges: 0..1;
          lineBreakMode: 0..((1 shl 4)-1);
          _reserved: 0..((1 shl 9)-1);
        );
      end;
  public
    function initWithContainerSize (size: NSSize): instancetype; message 'initWithContainerSize:';
    procedure setLayoutManager(newValue: NSLayoutManager); message 'setLayoutManager:';
    function layoutManager: NSLayoutManager; message 'layoutManager';
    procedure replaceLayoutManager (newLayoutManager: NSLayoutManager); message 'replaceLayoutManager:';
    procedure setTextView(newValue: NSTextView); message 'setTextView:';
    function textView: NSTextView; message 'textView';
    procedure setWidthTracksTextView(newValue: ObjCBOOL); message 'setWidthTracksTextView:';
    function widthTracksTextView: ObjCBOOL; message 'widthTracksTextView';
    procedure setHeightTracksTextView(newValue: ObjCBOOL); message 'setHeightTracksTextView:';
    function heightTracksTextView: ObjCBOOL; message 'heightTracksTextView';
    procedure setContainerSize(newValue: NSSize); message 'setContainerSize:';
    function containerSize: NSSize; message 'containerSize';
    procedure setLineFragmentPadding(newValue: CGFloat); message 'setLineFragmentPadding:';
    function lineFragmentPadding: CGFloat; message 'lineFragmentPadding';
    function lineFragmentRectForProposedRect_sweepDirection_movementDirection_remainingRect (proposedRect: NSRect; sweepDirection: NSLineSweepDirection; movementDirection: NSLineMovementDirection; remainingRect: NSRectPointer): NSRect; message 'lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:';
    function isSimpleRectangularTextContainer: ObjCBOOL; message 'isSimpleRectangularTextContainer';
    function containsPoint (point: NSPoint): ObjCBOOL; message 'containsPoint:';

    { Adopted protocols }
    procedure encodeWithCoder (aCoder: NSCoder); message 'encodeWithCoder:';
    function initWithCoder (aDecoder: NSCoder): id; message 'initWithCoder:';
    function layoutOrientation: NSTextLayoutOrientation; message 'layoutOrientation'; { available in 10_7 }
  end;
{$endif}