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 IlvSimpleGraphic IlvScrollView IlvView IlvArc IlvDrawSelection IlvEllipse IlvGadget IlvGauge IlvGraphicPath IlvIcon IlvLabel IlvLine IlvListLabel IlvMarker IlvPolyPoints IlvPolySelection IlvRectangle IlvScale IlvTimeScale

Public Member Functions

 IlvStylable ()
 Constructor.
 
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 class of this stylable object. <cssElement class="cssClass"> 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. 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

◆ 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 class of this stylable object. <cssElement class="cssClass">

Returns
The css class 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 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 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 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.

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

Implemented in IlvAbstractView, and IlvSimpleGraphic.

◆ 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.