Class Hierarchy
Flv_Style_List
Include Files
#include <FL/Flv_Style.H>
Description
The Flv_Style_List class is designed to manage a sparse array of
styles. This class is not a visual class, but is designed to manage a list
of attributes that can alter the way a visual class looks. These apply to
row, column and cell styles. By allowing you to define an entire row or
column at one time, you can apply basic formatting without storing information
on a cell by cell basis. Flv_Style_List is designed to make it easy to to
set values.
Methods
This is the constructor for Flv_Style_List and basically creates an empty
list with no styles.
The clear function is designed to remove any style information. It will
also release any associated memory if there are no cells connected to a style.
The clear_current function will undefine the current style. If there are no
cell reverences, it will release the memory assosiated with the current style.
The count function will return the number of styles currently in the list.
This returns the current entry in the list. Or NULL if there is no current entry.
The find function performs a binary search for a style with a value of
n. It will leave the current record at the record that is greater than or
equal to the value being searched for. If the value matches, find will
return that value. If the value doesn't match the function will return
NULL. If the function returns NULL, use current() to get the entry that was
closest.
The first function moves the current record to the first one in the
list. If there are any styles in the list, first will return a pointer to
that style. If there are no entries in the list first will return NULL.
The insert function will insert the style into the list at the appropriate
place. If the value of n already exists, the function will return false
and will not insert the style. All styles passed to insert should be
dynamically allocated. It will be easier to use the [] operator to allow
the list to create it's own styles.
The next function will move the current record to the next record in the list
if any and return a pointer to that style. If there are no more entries or
the list is empty, next will return NULL.
The operator[] is a guaranteed access operator. That means if you
reference style x and style x is in the list, a reference to that style will be
returned. It also means that if you reference style x and style x is not
in the list, the operator will create a new style with a value of x, insert it
in the correct location in the list, and then return a reference to that
new style. The operator[] is specifically optimized for adding entries at
the end of the list. The [] operator uses a binary search to locate the
style.
The prior function will move to the previous style in the list. If the list
is empty or there is no prior style (at the begining of the list), prior will
return NULL. If a prior style does exist, prior will set that as the
current record and return a pointer to it.
The release function is designed to clear all style information and release
all memory associated with the list. This includes any cell style
information.
The remove function will remove the current record. It is optimized for
tail removal. That is, if you remove entries from the end of the list to
the front of the list, remove will do the least work.
The skip_to function is designed to find the closest style with a value
that is greater than or equal to the value v. If the style's value matches
v skip_to will return a pointer to it. If the list is empty or the value
is not found, skip_to will return NULL. skip_to is optimized for
sequential access.