os_unordered_list


An unordered list.

An os_unordered_list is an unordered list of os_list_item objects that do not require a specific order and is typically rendered as a single-column bulleted list. Similar to an os_ordered_list , an os_unordered_list is a block-structuring page element that begins a new block on the page.

A header for an os_unordered_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 an os_unordered_list through either the add() member functions or operator<< .

By default, each list item is preceded by a solid round bullet. The bullet style can be specified through the bullet() member function, though this bullet style can be overridden within an os_list_item . Note that the bullet() member function supports an HTML extension implemented by Netscape browsers.

Declaration

#include <ospace/web/unordlst.h>
class os_unordered_list : public os_element_group

Enums

enum os_unordered_list::space
  {
  not_compact,  // Renders the list full size.
  compact       // Renders the list with reduced space between the list items.
  };


enum os_unordered_list::bullet_style
  {
  disc,         // Marks list items with a filled circle.
  circle,       // Marks list items with an unfilled circle.
  square,       // Marks list items with a filled square.
  };
	

Interface

Constructor
os_unordered_list( space spacing )
Constructs an empty unordered list with spacing spacing (default not_compact ) and no header.
Constructor
os_unordered_list( const os_element& header , space spacing )
Constructs an empty unordered list, with a copy of header as its header and spacing spacing (default not_compact ).
Constructor
os_unordered_list( const string& header , space spacing )
Constructs an empty unordered list, with an os_text element created from header as its header, and spacing spacing (default not_compact ).
Constructor
os_unordered_list( const os_unordered_list& rhs )
Constructs an unordered list that is a copy of rhs .
Destructor
/* virtual */ ~os_unordered_list()
Destroys the unordered list.
<<
os_unordered_list& operator<<( const os_element& element )
Inserts a list item containing a copy of element into the unordered list, and returns a reference to the unordered list.
<<
os_unordered_list& operator<<( const os_list_item& list_item )
Inserts a copy of list_item into the unordered list and returns a reference to the unordered list.
<<
os_unordered_list& operator<<( const string& text )
Inserts a list item containing a copy of text into the unordered list, and returns a reference to the unordered list.
=
os_unordered_list& operator=( const os_unordered_list& rhs )
Replaces the contents of the unordered list with a copy of rhs .
add
os_element* add( const os_list_item& list_item )
Adds a copy of list_item to the unordered 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 unordered 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 unordered list, and returns a pointer to the new list item.
bullet
os_unordered_list& bullet( bullet_style bullet )
Sets the bullet style for list items to bullet and returns a reference to the unordered list.
bullet
int bullet() const
Returns the list item bullet style, or os_element::use_default if not set.
clone
/* virtual */ os_element* clone() const
Returns a base class pointer to a heap-based deep copy of the unordered list.
header
os_element* header() const
Returns a pointer to the list header, or 0 if not set.
header
os_unordered_list& header( const string& header )
Sets the list header to an os_text element created from header , and returns a reference to the unordered list header.
header
os_unordered_list& header( const os_element& header )
Sets the list header to a copy of header, and returns a reference to the unordered list.
print
/* virtual */ void print( ostream& os ) const
Prints the unordered 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 unordered list.
spacing
os_unordered_list& spacing( space spacing )
Sets the spacing to spacing, and returns a reference to the unordered list.
spacing
int spacing() const
Returns the spacing, or os_unordered_list::not_compact if not set.

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved