os_ordered_list
|
 |
An ordered list.
An os_ordered_list
is a list of os_list_item objects that require a
specific order, and is typically rendered as a single-column numbered list.
Similar to an os_unordered_list , an os_ordered_list
is a block-structuring page element that begins a new block on the page.
A header for an os_ordered_list
can be specified in the constructor or through the header()
member function. A compact rendering reducing the vertical space between list
items can be specified in the constructor or through the spacing()
member function.
Items are inserted into the os_ordered_list
through either the add() member function or operator<<
.
By default, numbering begins with
1. Numbering can be specified to continue from the point that a previous os_ordered_list
ended through the continue_sequence() member
function. The starting sequence number can be specified explicitly through
either the sequence_number() or start()
member function.
By default, list items are
numbered using standard Arabic numerals. The numeral set can be specified
through the numbering() member function, which
supports an HTML extension implemented by Netscape browsers.
Note that the continue_sequence()
and sequence_number() member functions support
features proposed for HTML 3.0 and may not be supported by all browsers. The start()
member function supports an HTML extension implemented by Netscape browsers.
Declaration
#include <ospace/web/ordlst.h>
class os_ordered_list : public os_element_group
Enums
enum os_ordered_list::space
{
not_compact, // Renders the list full size.
compact // Renders the list with reduced space between the list items.
};
enum os_ordered_list::number
{
standard_arabic, // Marks list items with Arabic numerals.
uppercase_letter, // Marks list items with an uppercase letter.
lowercase_letter, // Marks list items with a lowercase letter.
uppercase_roman, // Marks list items with uppercase Roman numerals.
lowercase_roman // Marks list items with lowercase Roman numerals.
};
Interface
- Constructor
- os_ordered_list(
space spacing )
- Constructs an empty
ordered list with spacing spacing (default
not_compact
) and no header.
- Constructor
- os_ordered_list(
const os_element& header ,
space spacing )
- Constructs an empty
ordered list, with a copy of header as its
header and spacing spacing (default
not_compact
).
- Constructor
- os_ordered_list(
const string& header ,
space spacing )
- Constructs an empty
ordered list, with
os_text created from header
as the list header and spacing spacing (default not_compact
).
- Constructor
- os_ordered_list(
const os_ordered_list& rhs )
- Constructs an ordered
list that is a copy of rhs .
- Destructor
- /*
virtual */ ~os_ordered_list()
- Destroys the ordered
list.
- <<
- os_ordered_list&
operator<<( const os_element& element
)
- Inserts a list item
containing a copy of element into the ordered
list, and returns a reference to the ordered list.
- <<
- os_ordered_list&
operator<<( const os_list_item& list_item
)
- Inserts a copy of list_item
into the ordered list and returns a reference to the ordered list.
- <<
- os_ordered_list&
operator<<( const string& text )
- Inserts a list item
containing a copy of text into the ordered list,
and returns a reference to the ordered list.
- =
- os_ordered_list&
operator=( const os_ordered_list& rhs
)
- Replaces the contents of
the ordered list with a copy of rhs .
- add
- os_element*
add( const os_list_item& list_item )
- Adds a copy of list_item
to the ordered list and returns a pointer to the new list item.
- add
- /*
virtual */ os_element* add( const os_element& element
)
- Adds a list item
containing a copy of element to the ordered
list, and returns a pointer to the new list item.
- add
- /*
virtual */ os_element* add( const string& text
)
- Adds a list item
containing a copy of text to the ordered list,
and returns a pointer to the new list item.
- clone
- /*
virtual */ os_element* clone() const
- Returns a base class
pointer to a heap-based deep copy of the ordered list.
- continue_sequence
bool continue_sequence() const
- Returns
true
if the list item numbering continues from where the last ordered list
ended.
- continue_sequence
os_ordered_list&
continue_sequence( bool continue_sequence
)
- Sets starting number for
the first item to continue from the point the last ordered list item
ended, if continue_sequence is
true
, and returns a reference to the ordered list.
- header
- os_ordered_list&
header( const string& header )
- Sets the list header to
an
os_text element created from header
, and returns a reference to the ordered list header.
- header
- os_element*
header() const
- Returns a pointer to the
list header, or 0 if not set.
- header
- os_ordered_list&
header( const os_element& header )
- Sets the list header to
a copy of header and returns a reference to the
ordered list.
- numbering
- int
numbering() const
- Returns the list item
numbering, or
os_element::use_default if not
set.
- numbering
- os_ordered_list&
numbering( number numbering )
- Sets the type of
numbering for list items to numbering and
returns a reference to the ordered list.
- print
- /*
virtual */ void print( ostream& os )
const
- Prints the ordered list
to os .
- report_constraint_violation
- /*
virtual */ void report_constraint_violation( const os_element& element
, ostream& os
) const
- Prints a constraint
violation notice to os for element
within the ordered list.
- sequence_number
int sequence_number() const
- Returns the starting
number for the first item in the ordered list, or 0 if not set.
- sequence_number
os_ordered_list&
sequence_number( int sequence_number )
- Sets the starting number
for the first list item to sequence_number and
returns a reference to the ordered list.
- spacing
- os_ordered_list&
spacing( space spacing )
- Sets the spacing to spacing
and returns a reference to the ordered list.
- spacing
- int
spacing() const
- Returns the spacing.
- start
- os_ordered_list&
start( int start )
- Sets the starting number
for the first list item to start and returns a
reference to the ordered list.
- start
- int
start() const
- Returns the starting
number for the first item in the ordered list, or 0 if not set.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved