Style

This class stores the style description for an SGML element. More...

Public Methods

Style( const QString& name );
Style( const Style& src );
intdisplayType( );
boolenumValue( const char* token, int& value );
const StyleAttr*find( const char* token );
boolflagValue( const char* token );
boollistValue( const char* token, QString& value );
intmatchFactor( const STag* tag );
boolnumberValue( const char* token, int& value );
QStringselectorString( );
voidsetDisplay( DisplayProto  display );
boolstringValue( const char* token, QString& value );
~Style( );

Private Methods

voidprint( );

Private Data Members

QList<StyleAttr>_attrs;
DisplayProto _display;
QString_name;
QList<Attr>_sgmlAttrs;

Detailed Documentation

This class stores the style description for an SGML element.

An SGML element can contain other SGML elements and/or content. In order to present the content to a user it must be rendered. This class specifies a mapping from an SGML element's content and attributes to an on-screen representation.

Each instance of the Style class is associated with a single "element". However, an "element" may be a simple element name (i.e. "H1" ) or an element path (i.e. "/HTML/BODY/H1" ). The list of styles for a document type is stored in a StyleSheet.

Public Methods Documentation

Style ( const QString& name );

Construct a default style for the named element.

int matchFactor ( const STag* tag );

Returns an integer value that tells how good a match this style is to the given start tag. If the tag name does not match the name of this style, or one of the attribute requirements is not met by this tag then 0 is returned. Otherwise, one plus the number of attributes for this style are returned. The best match should be the first match with the highest matchFactor().


Return to Index.
Automatically generated on Aug 11 23:32