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

Applies styles to IlvStylable objects. More...

#include <ilviews/base/stylist.h>

Inheritance diagram for IlvStylist:
IlvAbstractView IlvDisplay IlvScrollView IlvView IlvDrawingView IlvElasticView IlvViewCOMAdapter IlvContainer

Public Member Functions

IlString getAppliedStyleSheet () const
 CSS stylesheet applied to this stylist as IlString Returns empty string if hasStylingApplied() is false. More...
 
virtual views::vector< IlvStylist * > getChildStylists () const =0
 Get child stylists. More...
 
virtual IlvStylistgetParentStylist () const =0
 Returns the parent stylist. More...
 
const IlPathNamegetStyleSheetPath () const
 Returns the CSS file that was applied to the stylist If there's no known path to a file. The IlvPathName::isEmpty will return true. This can happen if the CSS file has been applied with the string or streamer API. More...
 
virtual void notifyStyleChanges ()
 Recalculates the stylables and redraws them.
 
void notifyStyleChangesInStylistChain ()
 Recursively walks down the stylist hierarchy and calls notifyStyleChanges on all stylists without styling.
 
void removeStyling (IlBoolean refreshStylables=IlTrue)
 Removes all styling information from the stylist. More...
 
IlBoolean setStyleSheet (const char *text, size_t length, IlBoolean refreshStylables=IlTrue)
 Applies styling information to this stylist. More...
 
IlBoolean setStyleSheet (std::istream &file, IlBoolean refreshStylables=IlTrue)
 Applies styling information to this stylist. More...
 
void setStyleSheetPath (const IlPathName &file)
 Records the CSS file path that was applied to this stylist. More...
 

Detailed Description

Applies styles to IlvStylable objects.

Library: xviews or winviews or mviews (mutually exclusive)

A stylist is responsible for applying the styles that are stored in the style sheets attached to it to the stylable object it is in charge of.

See also
IlvStylable.

Member Function Documentation

◆ getAppliedStyleSheet()

IlString IlvStylist::getAppliedStyleSheet ( ) const

CSS stylesheet applied to this stylist as IlString Returns empty string if hasStylingApplied() is false.

Returns
IlString containing CSS

◆ getChildStylists()

virtual views::vector<IlvStylist*> IlvStylist::getChildStylists ( ) const
pure virtual

Get child stylists.

Returns a list of child stylists that are attached to this stylist. The child stylists may or may not have any styling applied. This can be checked with hasStylingApplied().

Returns
The parent stylist or 0 if there is none.
See also
hasStylingApplied().

Implemented in IlvDisplay, and IlvAbstractView.

◆ getParentStylist()

virtual IlvStylist* IlvStylist::getParentStylist ( ) const
pure virtual

Returns the parent stylist.

Stylist hierarchy is how cascading styling is done: if no style apply for a given stylable in this stylist, the parent stylist will be queried, recursively until there is no parent stylist anymore.

Returns
The parent stylist or 0 if there is none.

Implemented in IlvDisplay, and IlvAbstractView.

◆ getStyleSheetPath()

const IlPathName& IlvStylist::getStyleSheetPath ( ) const

Returns the CSS file that was applied to the stylist If there's no known path to a file. The IlvPathName::isEmpty will return true. This can happen if the CSS file has been applied with the string or streamer API.

Returns
IlvPathName pointing to the CSS file applied to this stylist.

◆ removeStyling()

void IlvStylist::removeStyling ( IlBoolean  refreshStylables = IlTrue)

Removes all styling information from the stylist.

Parameters
refreshStylables.If IlTrue, the stylables will be recalculated and redrawn after the styling is applied. Otherwise notifyStyleChanges must be manually called to see changes.

◆ setStyleSheet() [1/2]

IlBoolean IlvStylist::setStyleSheet ( const char *  text,
size_t  length,
IlBoolean  refreshStylables = IlTrue 
)

Applies styling information to this stylist.

The style sheet is queried for styling information if the look & feel handler is set to CSS. Calling this method again overwrites the previous styling information.

Parameters
text.A pointer to the css styling text.
length.Length of the styling text.
refreshStylables.If IlTrue, the stylables will be recalculated and redrawn after the styling is applied. Otherwise notifyStyleChanges must be manually called to see changes.
Returns
IlTrue if the style sheet was applied succesfully, and IlFalse if a problem occured.
See also
removeStyling(), notifyStyleChanges().

◆ setStyleSheet() [2/2]

IlBoolean IlvStylist::setStyleSheet ( std::istream &  file,
IlBoolean  refreshStylables = IlTrue 
)

Applies styling information to this stylist.

The style sheet is queried for styling information if the look & feel handler is set to CSS. Calling this method again overwrites the previous styling information.

Parameters
file.An input stream to the style sheet file containing the style information.
refreshStylables.If IlTrue, the stylables will be recalculated and redrawn after the styling is applied. Otherwise notifyStyleChanges must be manually called to see changes. If there was already a style sheet applied to this stylist, this method overwrites the previous one.
Returns
IlTrue if the style sheet was applied succesfully, and IlFalse if a problem occured.
See also
removeStyling(), notifyStyleChanges().

◆ setStyleSheetPath()

void IlvStylist::setStyleSheetPath ( const IlPathName file)

Records the CSS file path that was applied to this stylist.

Parameters
fileIlvPathName pointing to the CSS file applied on disk