os_list_item


An item within a list.

An os_list_item is an item within a list, such as an os_ordered_list, os_unordered_list, an os_directory_list, or an os_menu_list.

An os_list_item can be preceded by a mark, such as a bullet or number, depending on the list type. The type of mark specified for the containing list can be overridden in an os_list_item through the mark() member function. All marker values are not appropriate for all list types. Note that the mark()member function supports an HTML extension implemented by Netscape browsers.

Elements are inserted into an os_list_item through the constructor, or through either the add() member function or operator<< .

By default, within an os_ordered_list, an os_list_item is numbered in sequence from the previous os_list_item. The sequence counter can be specified for an os_list_item through the counter() member function. The next os_list_item is numbered from the new counter value. The counter()member function supports a feature proposed for HTML 3.0 and may not be supported by all browsers.

Declaration

#include <ospace/web/lstitem.h>
class os_list_item : public os_element_group

Enums

enum os_list_item::marker
  {
  // *** List items within an unordered list:
  disc,              // Marks the list item with a filled circle.
  circle,            // Marks the list item with an unfilled circle.
  square,            // Marks the list item with a filled square.

  // *** List items within an ordered list:
  standard_arabic,   // Marks the list item with Arabic numerals.
  uppercase_letter,  // Marks the list item with an uppercase letter.
  lowercase_letter,  // Marks the list item with a lowercase letter.
  uppercase_roman,   // Marks the list item with uppercase Roman numerals.
  lowercase_roman    // Marks the list item with lowercase Roman numerals.
  };

Interface

Constructor
os_list_item()
Constructs an empty list item.
Constructor
os_list_item( const os_element& element )
Constructs a list item containing a copy of element .
Constructor
os_list_item( const string& text )
Constructs a list item containing an os_text element created from text .
Constructor
os_list_item( const os_list_item& rhs )
Constructs a list item that is a copy of rhs .
=
os_list_item& operator=( const os_list_item& rhs )
Replaces the contents of the list item with a copy of rhs .
clone
/* virtual */ os_element* clone() const
Returns a base class pointer to a heap-based deep copy of the list item.
counter
os_list_item& counter( int counter )
Sets the counter to counter and returns a reference to the list item.
counter
int counter() const
Returns the counter, or 0 if not set.
mark
os_list_item& mark( marker mark )
Sets the marker type to mark and returns a reference to the list item.
mark
int mark() const
Returns the marker type, or os_element::use_default if not set.
print
/* virtual */ void print( ostream& os ) const
Prints the list item to os .

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved