Dillo
Public Member Functions | Public Attributes | List of all members
dw::core::style::StyleAttrs Class Reference

#include <style.hh>

Public Member Functions

void initValues ()
 
void resetValues ()
 Reset those style attributes to their standard values, which are not inherited, according to CSS.
 
bool sizeDiffs (StyleAttrs *otherStyleAttrs)
 This method returns whether something may change its size, when its style changes from this style to otherStyle.
 
void setBorderColor (Color *val)
 
void setBorderStyle (BorderStyle val)
 
int boxOffsetX ()
 
int boxRestWidth ()
 
int boxDiffWidth ()
 
int boxOffsetY ()
 
int boxRestHeight ()
 
int boxDiffHeight ()
 
bool hasBackground ()
 
bool equals (lout::object::Object *other)
 Returns, whether two objects are equal.
 
int hashValue ()
 Return a hash value for the object.
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly.
 
virtual Objectclone ()
 Return an exact copy of the object.
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer.
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object.
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses.
 

Public Attributes

Fontfont
 
int textDecoration
 
Colorcolor
 
ColorbackgroundColor
 
TextAlignType textAlign
 
VAlignType valign
 
char textAlignChar
 
TextTransform textTransform
 
int hBorderSpacing
 
int vBorderSpacing
 
int wordSpacing
 
Length width
 
Length height
 
Length lineHeight
 
Length textIndent
 
Box margin
 
Box borderWidth
 
Box padding
 
BorderCollapse borderCollapse
 
struct {
   Color *   top
 
   Color *   right
 
   Color *   bottom
 
   Color *   left
 
borderColor
 
struct {
   BorderStyle   top
 
   BorderStyle   right
 
   BorderStyle   bottom
 
   BorderStyle   left
 
borderStyle
 
DisplayType display
 
WhiteSpace whiteSpace
 
ListStylePosition listStylePosition
 
ListStyleType listStyleType
 
Cursor cursor
 
int x_link
 
int x_img
 
Tooltipx_tooltip
 
char x_lang [2]
 

Detailed Description

See Also
dw::core::style

Member Function Documentation

int dw::core::style::StyleAttrs::boxDiffHeight ( )
inline
int dw::core::style::StyleAttrs::boxDiffWidth ( )
inline
int dw::core::style::StyleAttrs::boxOffsetX ( )
inline
int dw::core::style::StyleAttrs::boxOffsetY ( )
inline
int dw::core::style::StyleAttrs::boxRestHeight ( )
inline
int dw::core::style::StyleAttrs::boxRestWidth ( )
inline
bool dw::core::style::StyleAttrs::equals ( lout::object::Object other)
virtual

Returns, whether two objects are equal.

The caller should ensure, that this and the object have the same class; this makes casting of "other" safe. Typically, an implementation should check this == other first, the caller can assume a fast implementation.

Reimplemented from lout::object::Object.

References backgroundColor, borderCollapse, borderColor, borderStyle, borderWidth, bottom, color, cursor, display, font, hBorderSpacing, height, left, lineHeight, listStylePosition, listStyleType, margin, padding, right, textAlign, textAlignChar, textDecoration, textIndent, textTransform, top, valign, vBorderSpacing, whiteSpace, width, wordSpacing, x_img, x_lang, x_link, and x_tooltip.

bool dw::core::style::StyleAttrs::hasBackground ( )
inline
int dw::core::style::StyleAttrs::hashValue ( )
virtual

Return a hash value for the object.

Reimplemented from lout::object::Object.

References hashValue().

Referenced by hashValue().

void dw::core::style::StyleAttrs::initValues ( )
void dw::core::style::StyleAttrs::resetValues ( )

Reset those style attributes to their standard values, which are not inherited, according to CSS.

References dw::core::style::BORDER_NONE, dw::core::style::DISPLAY_INLINE, dw::core::style::LENGTH_AUTO, and dw::core::style::VALIGN_BASELINE.

void dw::core::style::StyleAttrs::setBorderColor ( Color val)
inline

References borderColor.

Referenced by dw::Textblock::changeLinkColor().

void dw::core::style::StyleAttrs::setBorderStyle ( BorderStyle  val)
inline

References borderStyle.

bool dw::core::style::StyleAttrs::sizeDiffs ( StyleAttrs otherStyle)

This method returns whether something may change its size, when its style changes from this style to otherStyle.

It is mainly for optimizing style changes where only colors etc change (where false would be returned), in some cases it may return true, although a size change does not actually happen (e.g. when in a certain context a particular attribute is ignored).

Todo:
Should for CSS implemented properly. Currently, size changes are not needed, so always false is returned. See also dw::core::Widget::setStyle.

Referenced by dw::core::Widget::setStyle().

Member Data Documentation

Color * dw::core::style::StyleAttrs::backgroundColor
BorderCollapse dw::core::style::StyleAttrs::borderCollapse
struct { ... } dw::core::style::StyleAttrs::borderColor
struct { ... } dw::core::style::StyleAttrs::borderStyle
Box dw::core::style::StyleAttrs::borderWidth
Color * dw::core::style::StyleAttrs::bottom
BorderStyle dw::core::style::StyleAttrs::bottom
Color* dw::core::style::StyleAttrs::color
Cursor dw::core::style::StyleAttrs::cursor
DisplayType dw::core::style::StyleAttrs::display
Font* dw::core::style::StyleAttrs::font
int dw::core::style::StyleAttrs::hBorderSpacing
Length dw::core::style::StyleAttrs::height
Color * dw::core::style::StyleAttrs::left
BorderStyle dw::core::style::StyleAttrs::left
Length dw::core::style::StyleAttrs::lineHeight
ListStylePosition dw::core::style::StyleAttrs::listStylePosition
ListStyleType dw::core::style::StyleAttrs::listStyleType
Box dw::core::style::StyleAttrs::margin
Box dw::core::style::StyleAttrs::padding
Color * dw::core::style::StyleAttrs::right
BorderStyle dw::core::style::StyleAttrs::right
TextAlignType dw::core::style::StyleAttrs::textAlign
char dw::core::style::StyleAttrs::textAlignChar
int dw::core::style::StyleAttrs::textDecoration
Length dw::core::style::StyleAttrs::textIndent
TextTransform dw::core::style::StyleAttrs::textTransform
Color* dw::core::style::StyleAttrs::top
BorderStyle dw::core::style::StyleAttrs::top
VAlignType dw::core::style::StyleAttrs::valign
int dw::core::style::StyleAttrs::vBorderSpacing
WhiteSpace dw::core::style::StyleAttrs::whiteSpace
Length dw::core::style::StyleAttrs::width
int dw::core::style::StyleAttrs::wordSpacing
int dw::core::style::StyleAttrs::x_img
char dw::core::style::StyleAttrs::x_lang[2]
int dw::core::style::StyleAttrs::x_link
Tooltip* dw::core::style::StyleAttrs::x_tooltip

The documentation for this class was generated from the following files: