Base interface for classes that can be applied a style. More...
#include <ilviews/base/stylable.h>
Public Member Functions | |
IlvStylable () | |
Constructor. | |
IlvStylable * | getChildStylable (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 IlvDisplay * | getStylableDisplay () const =0 |
Returns the display for this object. More... | |
virtual IlString | getStylableName () const |
Returns the name of this object. More... | |
virtual IlvStylable * | getStylableParent () 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 IlvStylist * | getStylist () 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... | |
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.
IlvStylist
, IlvStyleSheet
.
|
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.
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.
cssElementName | The element name to search for in children. |
|
virtual |
Returns the DOM class of this stylable object. <cssElement class="cssClass">
IlString IlvStylable::getCssElementId | ( | ) | const |
Returns the DOM element id of this stylable object. <cssElement id="cssId">
|
virtual |
Returns the DOM element name of this stylable object.
Reimplemented in IlvAbstractView, and IlvSimpleGraphic.
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()
.
w | The width of the container stylable. |
h | The height of the container stylable. |
Reimplemented in IlvGadget, and IlvAbstractView.
|
pure virtual |
Returns the display for this object.
Implemented in IlvSimpleGraphic, and IlvAbstractView.
|
virtual |
Returns the name of this object.
0
if it has none. This name may be used as the identifier discriminant in style sheets. Reimplemented in IlvView, and IlvSimpleGraphic.
|
virtual |
Returns the parent of this object in the style hierarchy.
Returns the size of this object.
It can be used for computing sizes relative to the object (image position, borders,...).
w | The width of the stylable. |
h | The height of the stylable. |
Reimplemented in IlvGadget, and IlvAbstractView.
|
pure virtual |
Returns the stylist for this object.
0
if there is none. Implemented in IlvAbstractView, and IlvSimpleGraphic.
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.
id | The new id. |