<?xml version="1.0"?>
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 1.0.3//EN" "http://www.gnustep.org/gsdoc-1_0_3.dtd">
<gsdoc base="NSTextContainer" up="Gui">
  <head>
    <title>NSTextContainer</title>
    <author name="Alexander Malmberg">
      <email address="alexander@malmberg.org">
        alexander@malmberg.org
      </email>
    </author>
    <author name="Jonathan Gapen">
      <email address="jagapen@smithlab.chem.wisc.edu">
        jagapen@smithlab.chem.wisc.edu
      </email>
    </author>
    <copy>1999 Free Software Foundation, Inc.</copy>
  </head>
  <body>
    <front><contents /></front>
    <chapter>
      <heading>
        Software documentation for the NSTextContainer class
      </heading>
      <class name="NSTextContainer" super="NSObject" gvadd="10.0.0">
        <declared>AppKit/NSTextContainer.h</declared>
        <desc>
          <em>Description forthcoming.</em>
        </desc>
        <ivariable type="NSRect" name="_containerRect" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <ivariable type="BOOL" name="_heightTracksTextView" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <ivariable type="id" name="_layoutManager" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <ivariable type="float" name="_lineFragmentPadding" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <ivariable type="BOOL" name="_observingFrameChanges" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <ivariable type="id" name="_textView" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <ivariable type="BOOL" name="_widthTracksTextView" validity="protected" gvadd="10.0.0">
          <desc>
            <em>Warning</em> the underscore at the start of the
            name of this instance variable indicates that, even
            though it is not technically <em>private</em>, it is
            intended for internal use within the package, and
            you should not use the variable in other code.
          </desc>
        </ivariable>
        <method type="NSSize" gvadd="10.0.0">
          <sel>containerSize</sel>
          <desc>
            <em>Description forthcoming.</em>
          </desc>
        </method>
        <method type="BOOL" gvadd="10.0.0">
          <sel>containsPoint:</sel>
          <arg type="NSPoint">aPoint</arg>
          <desc>
            Returns <code>YES</code> if <var>aPoint</var> is
            inside the region. Subclasses define regions by
            overriding this method.
          </desc>
        </method>
        <method type="BOOL" gvadd="10.0.0">
          <sel>heightTracksTextView</sel>
          <desc>
            <em>Description forthcoming.</em>
          </desc>
        </method>
        <method type="id" gvadd="10.0.0">
          <sel>initWithContainerSize:</sel>
          <arg type="NSSize">aSize</arg>
          <desc>
            Initializes a new instance and sets the
            container size to <var>aSize</var>.
          </desc>
        </method>
        <method type="BOOL" gvadd="10.0.0">
          <sel>isSimpleRectangularTextContainer</sel>
          <desc>
            Querying the region <br /> Returns
            <code>YES</code> if the region for this container is
            a rectangle as large as the container size, otherwise
            <code>NO</code>. For simple rectangular regions, the
            text system can apply certain optimizations.
            NSTextContainer always returns
            <code>YES</code>. Subclasses that define more
            complex regions must return <code>NO</code>.
          </desc>
        </method>
        <method type="GSLayoutManager*" gvadd="10.0.0">
          <sel>layoutManager</sel>
          <desc>
            Returns the layout manager of this text container.
          </desc>
        </method>
        <method type="float" gvadd="10.0.0">
          <sel>lineFragmentPadding</sel>
          <desc>
            <em>Description forthcoming.</em>
          </desc>
        </method>
        <method type="NSRect" gvadd="10.0.0">
          <sel>lineFragmentRectForProposedRect:</sel>
          <arg type="NSRect">proposedRect</arg>
          <sel>sweepDirection:</sel>
          <arg type="NSLineSweepDirection">sweepDir</arg>
          <sel>movementDirection:</sel>
          <arg type="NSLineMovementDirection">moveDir</arg>
          <sel>remainingRect:</sel>
          <arg type="NSRect*">remainingRect</arg>
          <desc>
            This is the main method used by the text system for
            querying the region and flowing text in it. It
            takes a proposed line fragment rectangle and, if
            possible, splits it into a valid line fragment
            rectangle, and a remaining rectangle that can be
            used in subsequent calls to this method.
            <var>sweepDir</var> is the direction that text moves
            inside the lines, and <var>moveDir</var> is the
            direction lines move in, or NSLineDoesntMove if
            the line may not move. The line sweep and line movement
            may not both be in the same dimension, ie. both be
            vertical, or both be horizontal. The method
            returns the first (according to the sweep
            direction) valid line fragment rectangle in the
            proposed rectangle. This line fragment rectangle
            is a sub-rectangle of the proposed rectangle in the
            sweep direction, and has the same size in the other
            direction. (Ie. if the sweep direction is left,
            the line fragment rectangle must have the same height
            as the proposed rectangle.) If there is no valid line
            fragment rectangle in the proposed rectangle, the
            proposed rectangle may be moved in the line
            movement direction until there is one. If no valid
            line fragment rectangle can be returned, the method
            returns NSZeroRect. The remaining rectangle should
            be set to the potentially valid part of the proposed
            rectangle, after moving in the line movement
            direction, that remains after the first line
            fragment rectangle. The proposed rectangle may be
            any rectangle; in particular, it may extend outside the
            container size. The remaining rectangle does not
            have to be or contain a valid line fragment rectangle.
            Subclasses define regions by overriding this
            method. Note: The TextContainerExample in the text
            system example collection (TODO: link) contains an
            example implementation of an NSTextContainer
            subclass that defiens a non-trivial region, as
            well as an interactive demonstration of this method.
            It can also be used as a simple test of custom
            subclasses. Note: Although a correct
            NSTextContainer implementation must handle
            all line sweep and movement directions, the current
            standard typesetter will only call this method
            with sweep right, and no movement or movement down.
            Relying on this makes writing a subclass easier,
            but it is <em>not</em> safe.
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>replaceLayoutManager:</sel>
          <arg type="GSLayoutManager*">aLayoutManager</arg>
          <desc>
            Managing the text network <br /> A text container
            may be attached to one layout manager and one text
            view. The text container is retained by the layout
            manager, and retains the text view. <br />
            Replaces the layout manager of this text container
            with <var>aLayoutManager</var>. This is done without
            changing the rest of the text network, so
            <var>aLayoutManager</var> will be connected to the
            text storage and text containers that the current
            layout manager is connected to.
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>setContainerSize:</sel>
          <arg type="NSSize">aSize</arg>
          <desc>
            The container size <br /> A text container has a
            container size. The region defined by the text
            container must be a subset of the rectangle of
            this size with it's top-left corner in the origin.
            Subclasses do not have to support arbitrary
            sizes, and may choose to ignore
            <ref type="method" id="-setContainerSize:">
              -setContainerSize:
            </ref>
            completely. However, the size returned by
            <ref type="method" id="-containerSize">
              -containerSize
            </ref>
            must be valid.
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>setHeightTracksTextView:</sel>
          <arg type="BOOL">flag</arg>
          <desc>
            <em>Description forthcoming.</em>
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>setLayoutManager:</sel>
          <arg type="GSLayoutManager*">aLayoutManager</arg>
          <desc>
            This method should not be called directly. It is
            called by the layout manager when the layout manager
            of a text container changes.
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>setLineFragmentPadding:</sel>
          <arg type="float">aFloat</arg>
          <desc>
            Line fragment padding <br /> The line fragment padding
            is an amount of space left empty at each end of a line
            fragment rectangle by the standard typesetter. The
            default is 0.0.
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>setTextView:</sel>
          <arg type="NSTextView*">aTextView</arg>
          <desc>
            Sets the NSTextView for this text container. Note that
            a text view should be attached to a text container only
            if the text container is attached to a layout manager
            that can handle text views (eg. NSLayoutManager). The
            text view is retained by the text container.
          </desc>
        </method>
        <method type="void" gvadd="10.0.0">
          <sel>setWidthTracksTextView:</sel>
          <arg type="BOOL">flag</arg>
          <desc>
            Automatic resizing <br /> A text container can be
            set to automatically track the width and/or height of
            its NSTextView (TODO: frame? bounds?). For more
            information, see the documentation on
            automatic resizing in NSTextView. (TODO: link)
            When enabled, the automatic resizing is done by
            calling
            <ref type="method" id="-setContainerSize:" class="NSTextContainer">[NSTextContainer -setContainerSize:]</ref> with the new size whenever the text view is resized.
          </desc>
        </method>
        <method type="NSTextView*" gvadd="10.0.0">
          <sel>textView</sel>
          <desc>
            Returns the NSTextView attached to this text
            container, or <code>nil</code> if there is none.
          </desc>
        </method>
        <method type="BOOL" gvadd="10.0.0">
          <sel>widthTracksTextView</sel>
          <desc>
            <em>Description forthcoming.</em>
          </desc>
        </method>
      </class>
    </chapter>
  </body>
</gsdoc>
