cwidget::fragment Class Reference

A fragment represents a logical unit of text. More...

#include <fragment.h>

Inheritance diagram for cwidget::fragment:

cwidget::_newline_fragment cwidget::_text_fragment cwidget::fragment_cache cwidget::fragment_container cwidget::_sequence_fragment

List of all members.

Public Member Functions

virtual fragment_contents layout (size_t firstw, size_t w, const style &st)=0
 Return all the lines of this fragment, given the "shape" of the fragment.
virtual size_t max_width (size_t first_indent, size_t rest_indent) const =0
virtual size_t trailing_width (size_t first_indent, size_t rest_indent) const =0
virtual bool final_newline () const =0
virtual ~fragment ()
 Nothing to do in the base class.


Detailed Description

A fragment represents a logical unit of text.

Member Function Documentation

virtual fragment_contents cwidget::fragment::layout ( size_t  firstw,
size_t  w,
const style st 
) [pure virtual]

Return all the lines of this fragment, given the "shape" of the fragment.

Note that some fragments ignore the given widths, so the caller is expected to either put everything in a formatting box (one that forces its contents to stay "in bounds") or manually clip the return value.

Parameters:
firstw the width to which the first line of the fragment should be formatted.
w the width to which subsequent lines of the fragment should be formatted.
s the enclosing style of this fragment. The fragment's size is guaranteed to be independent of s.
Returns:
the lines of this fragment; the caller is responsible for deleting it.

Implemented in cwidget::_text_fragment, cwidget::_newline_fragment, cwidget::_sequence_fragment, and cwidget::fragment_cache.

Referenced by cwidget::widgets::text_layout::height_request(), and cwidget::fragment_cache::layout().

virtual size_t cwidget::fragment::max_width ( size_t  first_indent,
size_t  rest_indent 
) const [pure virtual]

Parameters:
first_indent the indentation of the first line, relative to a baseline (which may be outside this fragment).
rest_indent the indentation of any other lines.
Returns:
the maximum length of any line in this fragment. Any call to layout() with a width greater than this maximum length will produce the same result.

Implemented in cwidget::_text_fragment, cwidget::_newline_fragment, cwidget::fragment_container, and cwidget::fragment_cache.

Referenced by cwidget::dropbox(), cwidget::fragment_cache::max_width(), and cwidget::widgets::text_layout::width_request().

virtual size_t cwidget::fragment::trailing_width ( size_t  first_indent,
size_t  rest_indent 
) const [pure virtual]

Parameters:
first_indent the indentation of the first line.
rest_indent the indentation of any other lines.
Returns:
the length of any "trailing" line in the fragment, including indentation.

Implemented in cwidget::_text_fragment, cwidget::_newline_fragment, cwidget::fragment_container, and cwidget::fragment_cache.

Referenced by cwidget::fragment_cache::trailing_width().

virtual bool cwidget::fragment::final_newline (  )  const [pure virtual]


The documentation for this class was generated from the following files:

Generated on Wed Jan 28 07:23:53 2009 for cwidget by  doxygen 1.5.6