Base interface for classes that can be applied a style. More...
#include <ilviews/base/stylable.h>
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... | |
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 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 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. 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... | |
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
. void IlvStylable::addCssElementClass | ( | const IlString & | cssClass | ) |
Appends a class to the DOM class list of this stylable object.
cssClass | The css class to add to this object's DOM. |
void IlvStylable::addCssElementClass | ( | const IlStringList & | cssClasses | ) |
Appends a list of classes to the DOM class list of this stylable object.
cssClasses | The css classes to add to this object's DOM. |
|
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 classes of this stylable object as a space separated string. <cssElement class="cssClass1 cssClass2">
|
virtual |
Returns the DOM classes of this stylable object. <cssElement class="cssClass1 cssClass2">
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 IlvGraphicSet, 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 IlvGraphicSet, 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 IlvGraphicSet, 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. This is the parent stylist that actually sets the style, meaning first stylist with hasStylingApplied() == true.
0
if there is none. Implemented in IlvGraphicSet, IlvAbstractView, and IlvSimpleGraphic.
void IlvStylable::readStyleInfo | ( | std::istream & | stream | ) |
Reads the ID and classes of the current stylable from an ILV file
stream | the ILV file stream. |
void IlvStylable::setCssElementClass | ( | const IlString & | cssClass | ) |
Sets the DOM class of this stylable object.
cssClass | The css class to apply to this object's DOM. |
void IlvStylable::setCssElementClass | ( | const IlStringList & | cssClasses | ) |
Sets the DOM classes of this stylable object.
cssClasses | The css classes to apply to this object's DOM. |
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. |