All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Stylish::StyleSheet Class Reference

A StyleSheet contains a list of rules that can be used to define the CSS properties of Styleable objects. More...

#include <Stylish/StyleSheet.hpp>

Public Member Functions

void declare (const Selector &selector, const Declarations &decls)
 Declare a rule. More...
 
bool isEmpty () const
 Check if the StyleSheet is empty. More...
 
const std::vector< Rule > & rules () const
 
void setId (Declaration &decl, const QString &source)
 Sets Stylesheet-unique id to declaration and assigns source to this id. More...
 
void setUpdateIsolatedSubtrees (bool u)
 
QString source (int id) const
 Gets source location for declaration with given id. More...
 
bool updateIsolatedSubtrees () const
 When a subtree is removed from the original tree, should we maintain the style in the subtree. More...
 

Detailed Description

A StyleSheet contains a list of rules that can be used to define the CSS properties of Styleable objects.

Member Function Documentation

void Stylish::StyleSheet::declare ( const Selector selector,
const Declarations &  decls 
)

Declare a rule.

Parameters
selectorselector that is used to match this declaration
decldeclaration
bool Stylish::StyleSheet::isEmpty ( ) const

Check if the StyleSheet is empty.

Returns
True if the StyleSheet is empty, otherwise false.
const std::vector<Rule>& Stylish::StyleSheet::rules ( ) const
inline
Returns
list of rules in this stylesheet
void Stylish::StyleSheet::setId ( Declaration decl,
const QString &  source 
)

Sets Stylesheet-unique id to declaration and assigns source to this id.

Parameters
declDeclaration to modify
sourcesource location of this declaration. This is free text field, but with CSS files the convention is to use "filename:linenumber" -format.
void Stylish::StyleSheet::setUpdateIsolatedSubtrees ( bool  u)
inline
See Also
updateIsolatedSubtrees
Parameters
uisolated subtree update mode
QString Stylish::StyleSheet::source ( int  id) const
inline

Gets source location for declaration with given id.

Parameters
idDeclaration id, see Declaration::id()
Returns
Declaration source in free text format. However, the convention is to use format "filename:linenumber"
bool Stylish::StyleSheet::updateIsolatedSubtrees ( ) const
inline

When a subtree is removed from the original tree, should we maintain the style in the subtree.

In practise: should we update the style to removed widgets

Returns
update mode