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. More...
 
bool sizeDiffs (StyleAttrs *otherStyleAttrs)
 This method returns whether something may change its size, when its style changes from this style to otherStyle. More...
 
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. More...
 
int hashValue ()
 Return a hash value for the object. More...
 
- 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. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

Public Attributes

Fontfont
 
int textDecoration
 
Colorcolor
 
ColorbackgroundColor
 
StyleImagebackgroundImage
 
BackgroundRepeat backgroundRepeat
 
BackgroundAttachment backgroundAttachment
 
Length backgroundPositionX
 
Length backgroundPositionY
 
TextAlignType textAlign
 
VAlignType valign
 
char textAlignChar
 
TextTransform textTransform
 
FloatType vloat
 
ClearType clear
 
Overflow overflow
 
Position position
 
Length top
 
Length bottom
 
Length left
 
Length right
 
int hBorderSpacing
 
int vBorderSpacing
 
int wordSpacing
 
Length width
 
Length height
 
Length lineHeight
 
Length textIndent
 
Length minWidth
 
Length maxWidth
 
Length minHeight
 
Length maxHeight
 
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 zIndex
 
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 backgroundAttachment, backgroundColor, backgroundImage, backgroundPositionX, backgroundPositionY, backgroundRepeat, borderCollapse, borderColor, borderStyle, borderWidth, bottom, clear, color, cursor, display, font, hBorderSpacing, height, left, lineHeight, listStylePosition, listStyleType, margin, maxHeight, maxWidth, minHeight, minWidth, overflow, padding, position, right, textAlign, textAlignChar, textDecoration, textIndent, textTransform, top, valign, vBorderSpacing, vloat, whiteSpace, width, wordSpacing, x_img, x_lang, x_link, x_tooltip, and zIndex.

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.

Todo:
Correct? Check specification.
Todo:
Correct? Check specification.
Todo:
Correct? Check specification.
Todo:
Correct? Check specification.

References dw::core::style::BACKGROUND_ATTACHMENT_SCROLL, dw::core::style::BACKGROUND_REPEAT, dw::core::style::BORDER_NONE, dw::core::style::CLEAR_NONE, dw::core::style::createPerLength(), dw::core::style::DISPLAY_INLINE, dw::core::style::FLOAT_NONE, dw::core::style::LENGTH_AUTO, dw::core::style::OVERFLOW_VISIBLE, dw::core::style::POSITION_STATIC, and dw::core::style::VALIGN_BASELINE.

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

References borderColor.

Referenced by dw::Textblock::changeLinkColor(), and main().

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

References borderStyle.

Referenced by main().

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

BackgroundAttachment dw::core::style::StyleAttrs::backgroundAttachment
Color * dw::core::style::StyleAttrs::backgroundColor
StyleImage* dw::core::style::StyleAttrs::backgroundImage
Length dw::core::style::StyleAttrs::backgroundPositionX
Length dw::core::style::StyleAttrs::backgroundPositionY
BackgroundRepeat dw::core::style::StyleAttrs::backgroundRepeat
BorderCollapse dw::core::style::StyleAttrs::borderCollapse
struct { ... } dw::core::style::StyleAttrs::borderColor
struct { ... } dw::core::style::StyleAttrs::borderStyle
Box dw::core::style::StyleAttrs::borderWidth
Length dw::core::style::StyleAttrs::bottom
Color * dw::core::style::StyleAttrs::bottom
BorderStyle dw::core::style::StyleAttrs::bottom
ClearType dw::core::style::StyleAttrs::clear
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
Length dw::core::style::StyleAttrs::left
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
Length dw::core::style::StyleAttrs::maxHeight
Length dw::core::style::StyleAttrs::maxWidth
Length dw::core::style::StyleAttrs::minHeight
Length dw::core::style::StyleAttrs::minWidth
Overflow dw::core::style::StyleAttrs::overflow
Box dw::core::style::StyleAttrs::padding
Position dw::core::style::StyleAttrs::position
Length dw::core::style::StyleAttrs::right
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
Length dw::core::style::StyleAttrs::top
Color* dw::core::style::StyleAttrs::top
BorderStyle dw::core::style::StyleAttrs::top
VAlignType dw::core::style::StyleAttrs::valign
int dw::core::style::StyleAttrs::vBorderSpacing
FloatType dw::core::style::StyleAttrs::vloat
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
int dw::core::style::StyleAttrs::zIndex

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