Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvStylable Class Referenceabstract

Base interface for classes that can be applied a style. More...

#include <ilviews/base/stylable.h>

Inheritance diagram for IlvStylable:
IlvAbstractView IlvGraphicSet IlvSimpleGraphic IlvScrollView IlvView IlvSelector IlvArc IlvDrawSelection IlvEllipse IlvGadget IlvGauge IlvGraphicPath IlvIcon IlvLabel IlvLine IlvListLabel IlvMarker IlvPolyPoints IlvPolySelection IlvRectangle IlvScale IlvTimeScale

Public Member Functions

 IlvStylable ()
 Constructor.
 
void addCssElementClass (const IlString &cssClass)
 Appends a class to the DOM class list of this stylable object. More...
 
void addCssElementClass (const IlStringList &cssClasses)
 Appends a list of classes to the DOM class list of this stylable object. More...
 
IlvStylablegetChildStylable (const IlString &cssElementName) const
 Returns child stylable with specified css element name. Returns null if the child is not found. More...
 
virtual IlString getCssElementClass () const
 Returns the DOM classes of this stylable object as a space separated string. <cssElement class="cssClass1 cssClass2"> More...
 
virtual const IlStringList & getCssElementClassList () const
 Returns the DOM classes of this stylable object. <cssElement class="cssClass1 cssClass2"> More...
 
IlString getCssElementId () const
 Returns the DOM element id of this stylable object. <cssElement id="cssId"> More...
 
virtual IlString getCssElementName () const
 Returns the DOM element name of this stylable object. More...
 
virtual void getOuterStylableSize (IlvDim &w, IlvDim &h) const
 Returns the size of the outer stylable if any. More...
 
virtual IlvDisplaygetStylableDisplay () const =0
 Returns the display for this object. More...
 
virtual IlString getStylableName () const
 Returns the name of this object. More...
 
virtual IlvStylablegetStylableParent () const
 Returns the parent of this object in the style hierarchy. More...
 
virtual void getStylableSize (IlvDim &w, IlvDim &h) const
 Returns the size of this object. More...
 
virtual IlvStylistgetStylist () const =0
 Returns the stylist for this object. This is the parent stylist that actually sets the style, meaning first stylist with hasStylingApplied() == true. More...
 
void readStyleInfo (std::istream &stream)
 
void setCssElementClass (const IlString &cssClass)
 Sets the DOM class of this stylable object. More...
 
void setCssElementClass (const IlStringList &cssClasses)
 Sets the DOM classes of this stylable object. More...
 
void setCssId (const IlString &id)
 Sets the object's css styling id. The id is initially the same as the name property of the object, but can be overridden using this function. More...
 
virtual void setupDefaultCssStyle ()
 virtual functions used to setupDefaultStyle. Override this to change default styling
 

Static Public Member Functions

static void DisableCssDom ()
 Disables any further DOM additions. More...
 

Detailed Description

Base interface for classes that can be applied a style.

Library: xviews or winviews or mviews (mutually exclusive)

Stylable objects are managed, from the style standpoint, by stylists.

See also
IlvStylist, IlvStyleSheet.

Member Function Documentation

◆ addCssElementClass() [1/2]

void IlvStylable::addCssElementClass ( const IlString cssClass)

Appends a class to the DOM class list of this stylable object.

Parameters
cssClassThe css class to add to this object's DOM.

◆ addCssElementClass() [2/2]

void IlvStylable::addCssElementClass ( const IlStringList &  cssClasses)

Appends a list of classes to the DOM class list of this stylable object.

Parameters
cssClassesThe css classes to add to this object's DOM.

◆ DisableCssDom()

static void IlvStylable::DisableCssDom ( )
static

Disables any further DOM additions.

This is used to disable DOM handling internally. Please use environment variable "ILV_DISABLE_DOM" instead. The purpose of disable the DOM is to optimize performance when the views is using classic look & feels. DOM should not be disabled when using CSS L&F or dynamically switching between classic and CSS L&F. Re-enabling DOM requires clearing the environment variable and restarting the application.

◆ getChildStylable()

IlvStylable* IlvStylable::getChildStylable ( const IlString cssElementName) const

Returns child stylable with specified css element name. Returns null if the child is not found.

Searches all children by name and returns the first matching child stylable.

Parameters
cssElementNameThe element name to search for in children.

◆ getCssElementClass()

virtual IlString IlvStylable::getCssElementClass ( ) const
virtual

Returns the DOM classes of this stylable object as a space separated string. <cssElement class="cssClass1 cssClass2">

Returns
The css classes of this object, space separated.

◆ getCssElementClassList()

virtual const IlStringList& IlvStylable::getCssElementClassList ( ) const
virtual

Returns the DOM classes of this stylable object. <cssElement class="cssClass1 cssClass2">

Returns
The css classes of this object.

◆ getCssElementId()

IlString IlvStylable::getCssElementId ( ) const

Returns the DOM element id of this stylable object. <cssElement id="cssId">

Returns
The css id of this object.

◆ getCssElementName()

virtual IlString IlvStylable::getCssElementName ( ) const
virtual

Returns the DOM element name of this stylable object.

Returns
The css element name of this object.

Reimplemented in IlvGraphicSet, IlvAbstractView, and IlvSimpleGraphic.

◆ getOuterStylableSize()

virtual void IlvStylable::getOuterStylableSize ( IlvDim w,
IlvDim h 
) const
virtual

Returns the size of the outer stylable if any.

When a stylable is part of another one, this information allows for instance to compute relative sizes or placement.

If the stylable is not part of another one, this function returns the same results than getStylableSize().

Parameters
wThe width of the container stylable.
hThe height of the container stylable.

Reimplemented in IlvGadget, and IlvAbstractView.

◆ getStylableDisplay()

virtual IlvDisplay* IlvStylable::getStylableDisplay ( ) const
pure virtual

Returns the display for this object.

Returns
The display instance of this object.

Implemented in IlvGraphicSet, IlvSimpleGraphic, and IlvAbstractView.

◆ getStylableName()

virtual IlString IlvStylable::getStylableName ( ) const
virtual

Returns the name of this object.

Returns
The name of this object or 0 if it has none. This name may be used as the identifier discriminant in style sheets.

Reimplemented in IlvGraphicSet, IlvView, and IlvSimpleGraphic.

◆ getStylableParent()

virtual IlvStylable* IlvStylable::getStylableParent ( ) const
virtual

Returns the parent of this object in the style hierarchy.

Returns
The parent stylable if this object has one. The parent is used for inherited style properties.

◆ getStylableSize()

virtual void IlvStylable::getStylableSize ( IlvDim w,
IlvDim h 
) const
virtual

Returns the size of this object.

It can be used for computing sizes relative to the object (image position, borders,...).

Parameters
wThe width of the stylable.
hThe height of the stylable.

Reimplemented in IlvGadget, and IlvAbstractView.

◆ getStylist()

virtual IlvStylist* IlvStylable::getStylist ( ) const
pure virtual

Returns the stylist for this object. This is the parent stylist that actually sets the style, meaning first stylist with hasStylingApplied() == true.

Returns
The stylist of this object or 0 if there is none.

Implemented in IlvGraphicSet, IlvAbstractView, and IlvSimpleGraphic.

◆ readStyleInfo()

void IlvStylable::readStyleInfo ( std::istream &  stream)

Reads the ID and classes of the current stylable from an ILV file

Parameters
streamthe ILV file stream.

◆ setCssElementClass() [1/2]

void IlvStylable::setCssElementClass ( const IlString cssClass)

Sets the DOM class of this stylable object.

Parameters
cssClassThe css class to apply to this object's DOM.

◆ setCssElementClass() [2/2]

void IlvStylable::setCssElementClass ( const IlStringList &  cssClasses)

Sets the DOM classes of this stylable object.

Parameters
cssClassesThe css classes to apply to this object's DOM.

◆ setCssId()

void IlvStylable::setCssId ( const IlString id)

Sets the object's css styling id. The id is initially the same as the name property of the object, but can be overridden using this function.

Parameters
idThe new id.