os_framed_page
|
 |
An HTML page with a collection of
frames as its content.
An os_framed_page
is an HTML page with a collection of frames as its content. An os_framed_page
is composed of the following elements.
- An
os_head
, containing meta-information elements. os_framed_page
has an os_head by containment, so in most
cases, it is unnecessary to create an os_head
explicitly.
- A top-level
os_frameset
. An os_frameset partitions a single view area
into multiple view areas. The frame partitioning can be specified in a
constructor or through the rows() or cols()
member function. Refer to the " os_frameset
" section for row and column size specification descriptions.
The find, remove, and replace
member functions first search the head, then the frameset, for elements matching
a specified key.
Member functions, such as title()
, background() , noframes()
, rows() , and cols()
, simply pass through to the underlying os_head or os_frameset
. The head and frameset can be accessed directly through the head()
and frameset() member functions.
To generate HTML from an os_framed_page
to use as the output from a Common Gateway Interface (CGI) program, set the os_framed_page
output type to cgi , either in the constructor or
through the output() member function. This setting
adds the MIME content tag " Content-Type:
text/html" to the beginning of the output stream. The output type is
non_cgi by default.
Declaration
#include <ospace/web/frameset.h>
class os_frameset : public os_element_group
Enums
enum os_frameset::output_type
{
non_cgi, // Adds no MIME content tag to the beginning of the page output.
cgi // Adds an HTML MIME content tag to the beginning of the page output.
};
Interface
Constructor
os_framed_page(
output_type output )
Constructs a framed page
with output type output (default non_cgi
).
Constructor
os_framed_page(
const string& title ,
output_type output )
Constructs a framed page
with title title and output type output
(default non_cgi ).
Constructor
os_framed_page(
const string& title ,
const string& background ,
output_type output )
Constructs a framed page
with title title , no-frames background image URL background
, and output type output (default non_cgi
).
Constructor
os_framed_page(
const string& title ,
os_frameset::partition_by partition ,
const string& layout1 ,
const string& layout2 ,
output_type output )
Constructs a framed page
with title title , output type output
(default non_cgi ), and the top-level
frameset partitioned by partition into two view
areas of size layout1 and layout2
.
Constructor
os_framed_page(
const string& title ,
os_frameset::partition_by partition ,
const string& layout1 ,
const string& layout2 ,
const string& layout3 ,
output_type
output )
Constructs a framed page
with title title , output type output
(default non_cgi ), and the top-level
frameset partitioned by partition into three view
areas of size layout1 , layout2
, and layout3 .
Constructor
os_framed_page(
const string& title ,
os_frameset::partition_by partition ,
const vector<string>& layout ,
output_type output )
Constructs a framed page
with title title , the top-level frameset
partitioned by partition into one view area for
each size specification in layout , and output
type output (default non_cgi
).
Constructor
os_framed_page(
const os_framed_page& rhs )
Constructs a framed page
that is a copy of rhs .
Destructor
/*
virtual */ ~os_framed_page()
Destroys the framed page.
<<
os_framed_page&
operator<<( const os_element& element )
Inserts a copy of element
into the top-level frameset and returns a reference to the framed page.
=
os_framed_page&
operator=( const os_framed_page& rhs )
Replaces the framed page
contents with a copy of rhs and returns a
reference to the framed page.
add
os_element*
add( const os_element& element )
Adds a copy of element
to the top-level frameset and returns a pointer to the new element.
add_noframes
os_element*
add_noframes( const string& text )
Adds an os_text
element created from text to the no-frames content
of the top-level frameset, and returns a pointer to the new element.
add_noframes
os_element*
add_noframes( const os_element& element
)
Adds a copy of element
to the no-frames content of the top-level frameset, and returns a pointer to
the new element.
background
os_framed_page&
background( const string& background )
Sets the no-frames
background image URL to background and returns a
reference to the framed page.
background
string
background() const
Returns the no-frames
background image URL of the top-level frameset, or the empty string if a
no-frames content element is not set.
clone
/*
virtual */ os_element* clone() const
Returns a base class
pointer to a heap-based deep copy of the framed page.
cols
os_framed_page&
cols( const vector<string>& layout
)
Partitions the top-level
frameset into columns, with one column for each size specification in layout
, and returns a reference to the framed page.
find_all
/*
virtual */ vector<os_element*> find_all( const string& key
, os_element::search_depth depth
)
Returns a list of pointers
to the elements with key key found on a depth
(default os_element::shallow ) search. Returns
an empty list if no matching elements are found.
find_first
/*
virtual */ os_element* find_first( const string& key
, os_element::search_depth depth
)
Returns a pointer to the
first element with key key found on a depth
(default os_element::shallow )
search. Returns 0 if no matching element is found.
frameset
os_frameset&
frameset()
Returns a reference to the
top-level frameset.
head
os_head&
head()
Returns a reference to the
head.
is_cols
bool
is_cols( vector<string>& layout )
const
Returns true
if the top-level frameset is partitioned into columns, and inserts the size
specification for each column into layout .
is_rows
bool
is_rows( vector<string>& layout )
const
Returns true
if the top-level frameset is partitioned into rows, and inserts the size
specification for each row into layout .
noframes
os_noframes*
noframes() const
Returns a pointer to the
no-frames content element of the top-level frameset, or 0 if not set.
noframes
os_framed_page&
noframes( const os_noframes& noframes )
Sets the no-frames content
of the top-level frameset to a copy of noframes
and returns a reference to the framed page.
noframes
os_framed_page&
noframes( const os_body& body )
Sets the no-frames content
of the top-level frameset to an os_noframes
element created from body , and returns a
reference to the framed page.
output
os_framed_page&
output( output_type output )
Sets the output type to output
and returns a reference to the framed page.
output
int
output() const
Returns the output type.
print
/*
virtual */ void print( ostream& os )
const
Prints the framed page to os
.
remove_all
/*
virtual */ int remove_all( const string& key
, os_element::search_depth depth
)
Removes all elements with
key key found on depth
(default os_element::shallow ) search, and
returns the total number of elements removed. Returns 0 if no matching
elements are found.
remove_first
/*
virtual */ bool remove_first( const string& key
, os_element::search_depth depth
)
Removes the first element
with key key found on depth
(default os_element::shallow ) search and
returns true . Returns false
if no matching element is found.
replace_all
/*
virtual */ int replace_all( const string& key
, const os_element& replacement
, os_element::search_depth depth
)
Replaces, with replacement
, all elements with key key
found on depth (default os_element::shallow
) search, and returns the total number of elements
replaced. Returns 0 if no matching elements are found.
replace_first
/*
virtual */ bool replace_first( const string& key
, const os_element& replacement
, os_element::search_depth depth
)
Replaces, with replacement
, the first element with key key found on depth
(default os_element::shallow ) search and
returns true . Returns false
if no matching element is found.
rows
os_framed_page&
rows( const vector<string>& layout
)
Partitions the top-level
frameset into rows, with one row for each size specification in layout
, and returns a reference to the framed page.
title
string
title() const
Returns the title, or the
empty string if not set.
title
os_framed_page&
title( const string& title )
Sets the title to title
and returns a reference to the framed page.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved