![]() |
Webdar 1.0.0
Web user interface to libdar
|
class css_class gather css attributed under a given label More...
#include <css_class.hpp>
Public Types | |
enum | selector_type { active , checked , disabled , enabled , focus , hover , link , in_range , invalid , out_of_range , read_only , read_write , root , target , valid , visited } |
selector_type is ordered for :hover being defined after :link and :visited | |
enum | pseudo_element_type { first_line , first_letter , before , after , marker , selection } |
Public Member Functions | |
css_class (const std::string &name="") | |
css_class (const std::string &name, const css &ref) | |
css_class (const css_class &ref)=default | |
css_class (css_class &&ref) noexcept=default | |
css_class & | operator= (const css_class &ref)=default |
css_class & | operator= (css_class &&ref) noexcept=default |
void | change_name (const std::string &newname) |
change css_class name | |
const std::string & | get_name () const |
get the css_class name | |
void | set_value (const css &ref) |
defines or overwirte the css_class value from a css object | |
const css & | get_value () const |
obtain the current value | |
void | clear_value () |
clear css_class value and all selector values | |
void | set_selector (selector_type sel, const css &ref, const std::string &descendant="") |
defines the value for a given css_selector on that class (or pseudo-class in CSS parlance) More... | |
void | clear_selector (selector_type sel, const std::string &descendant="") |
remove definition for the given selector type | |
void | set_pseudo_element (pseudo_element_type pe, const css &val, const std::string &descendant="") |
defines the value of a given pseudo-element More... | |
void | clear_pseudo_element (pseudo_element_type pe, const std::string &descendant="") |
remove definition for the given pseudo-element | |
void | clear () |
clear all css definition, including those provided with selector, only the css name is kept | |
std::string | get_definition () const |
returns the css class definition | |
class css_class gather css attributed under a given label
associate a name to a css object in other words contains what HTML standard defines as a css class: a name associated to a list of CSS properties. this class also include selectors like :hover and so on
void css_class::set_pseudo_element | ( | pseudo_element_type | pe, |
const css & | val, | ||
const std::string & | descendant = "" |
||
) |
defines the value of a given pseudo-element
void css_class::set_selector | ( | selector_type | sel, |
const css & | ref, | ||
const std::string & | descendant = "" |
||
) |
defines the value for a given css_selector on that class (or pseudo-class in CSS parlance)
[in] | sel | the selector to be defined |
[in] | ref | the css definition to give to that selector (= pseudo-class) |
[in] | descendant | not an empty string, the definition applies to the specified descendant components (html type, like "p" for paragraph, "div" or other) or subcomponent with the provided class name. |