Photon 1.0.0
|
#include <element.h>
Public Types | |
typedef std::shared_ptr< element > | ptr |
typedef std::shared_ptr< const element > | const_ptr |
typedef std::weak_ptr< element > | weak_ptr |
Public Member Functions | |
element (const std::shared_ptr< document > &doc) | |
virtual | ~element ()=default |
const css_properties & | css () const |
css_properties & | css_w () |
bool | in_normal_flow () const |
bool | is_inline () const |
bool | is_inline_box () const |
bool | is_block_box () const |
position | get_placement () const |
bool | is_positioned () const |
bool | is_float () const |
bool | is_block_formatting_context () const |
bool | is_root () const |
element::ptr | parent () const |
void | parent (const element::ptr &par) |
bool | is_table_skip () const |
std::shared_ptr< document > | get_document () const |
const std::list< std::shared_ptr< element > > & | children () const |
virtual elements_list | select_all (const string &selector) |
virtual elements_list | select_all (const css_selector &selector) |
virtual element::ptr | select_one (const string &selector) |
virtual element::ptr | select_one (const css_selector &selector) |
virtual bool | appendChild (const ptr &el) |
virtual bool | removeChild (const ptr &el) |
virtual void | clearRecursive () |
virtual string_id | id () const |
virtual string_id | tag () const |
virtual const char * | get_tagName () const |
virtual void | set_tagName (const char *tag) |
virtual void | set_data (const char *data) |
virtual void | set_attr (const char *name, const char *val) |
virtual const char * | get_attr (const char *name, const char *def=nullptr) const |
virtual void | apply_stylesheet (const litehtml::css &stylesheet) |
virtual void | refresh_styles () |
virtual bool | is_white_space () const |
virtual bool | is_space () const |
virtual bool | is_comment () const |
virtual bool | is_body () const |
virtual bool | is_break () const |
virtual bool | is_text () const |
virtual bool | on_mouse_over () |
virtual bool | on_mouse_leave () |
virtual bool | on_lbutton_down () |
virtual bool | on_lbutton_up () |
virtual void | on_click () |
virtual bool | set_pseudo_class (string_id cls, bool add) |
virtual bool | set_class (const char *pclass, bool add) |
virtual bool | is_replaced () const |
virtual void | compute_styles (bool recursive=true) |
virtual void | draw (uint_ptr hdc, int x, int y, const position *clip, const std::shared_ptr< render_item > &ri) |
virtual void | draw_background (uint_ptr hdc, int x, int y, const position *clip, const std::shared_ptr< render_item > &ri) |
virtual void | get_text (string &text) |
virtual void | parse_attributes () |
virtual int | select (const css_selector::vector &selector_list, bool apply_pseudo=true) |
virtual int | select (const string &selector) |
virtual int | select (const css_selector &selector, bool apply_pseudo=true) |
virtual int | select (const css_element_selector &selector, bool apply_pseudo=true) |
virtual element::ptr | find_ancestor (const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) |
virtual bool | is_ancestor (const ptr &el) const |
virtual element::ptr | find_adjacent_sibling (const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) |
virtual element::ptr | find_sibling (const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) |
virtual void | get_content_size (size &sz, int max_width) |
virtual bool | is_nth_child (const element::ptr &el, int num, int off, bool of_type, const css_selector::vector &selector_list={}) const |
virtual bool | is_nth_last_child (const element::ptr &el, int num, int off, bool of_type, const css_selector::vector &selector_list={}) const |
virtual bool | is_only_child (const element::ptr &el, bool of_type) const |
virtual void | add_style (const style &style) |
virtual const background * | get_background (bool own_only=false) |
virtual string | dump_get_name () |
virtual std::vector< std::tuple< string, string > > | dump_get_attrs () |
void | dump (litehtml::dumper &cout) |
std::tuple< element::ptr, element::ptr, element::ptr > | split_inlines () |
virtual std::shared_ptr< render_item > | create_render_item (const std::shared_ptr< render_item > &parent_ri) |
bool | requires_styles_update () |
void | add_render (const std::shared_ptr< render_item > &ri) |
bool | find_styles_changes (position::vector &redraw_boxes) |
element::ptr | add_pseudo_before (const style &style) |
element::ptr | add_pseudo_after (const style &style) |
string | get_counter_value (const string &counter_name) |
string | get_counters_value (const string_vector ¶meters) |
void | increment_counter (const string_id &counter_name_id, const int increment=1) |
void | reset_counter (const string_id &counter_name_id, const int value=0) |
Protected Member Functions | |
virtual void | select_all (const css_selector &selector, elements_list &res) |
element::ptr | _add_before_after (int type, const style &style) |
Protected Attributes | |
std::weak_ptr< element > | m_parent |
std::weak_ptr< document > | m_doc |
elements_list | m_children |
css_properties | m_css |
std::list< std::weak_ptr< render_item > > | m_renders |
used_selector::vector | m_used_styles |
Private Member Functions | |
std::vector< element::ptr > | get_siblings_before () const |
bool | find_counter (const string_id &counter_name_id, std::map< string_id, int >::iterator &map_iterator) |
void | parse_counter_tokens (const string_vector &tokens, const int default_value, std::function< void(const string_id &, const int)> handler) const |
Private Attributes | |
std::map< string_id, int > | m_counter_values |
Friends | |
class | line_box |
class | html_tag |
class | el_table |
class | document |
typedef std::shared_ptr<const element> litehtml::element::const_ptr |
typedef std::shared_ptr<element> litehtml::element::ptr |
typedef std::weak_ptr<element> litehtml::element::weak_ptr |
|
explicit |
|
virtualdefault |
|
protected |
|
inline |
|
inline |
void litehtml::element::add_render | ( | const std::shared_ptr< render_item > & | ri | ) |
|
virtual |
Reimplemented in litehtml::el_before_after_base, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag, litehtml::el_table, litehtml::el_script, and litehtml::el_style.
|
virtual |
Reimplemented in litehtml::el_anchor, and litehtml::html_tag.
|
inline |
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_text, litehtml::el_image, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_comment, and litehtml::el_image.
|
inline |
|
inline |
|
virtual |
Reimplemented in litehtml::el_image, litehtml::el_text, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
void litehtml::element::dump | ( | litehtml::dumper & | cout | ) |
|
virtual |
Reimplemented in litehtml::el_text.
|
virtual |
Reimplemented in litehtml::el_image, litehtml::el_space, litehtml::el_text, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
private |
|
virtual |
Reimplemented in litehtml::html_tag.
bool litehtml::element::find_styles_changes | ( | position::vector & | redraw_boxes | ) |
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_image, litehtml::el_text, and litehtml::html_tag.
litehtml::string litehtml::element::get_counter_value | ( | const string & | counter_name | ) |
string litehtml::element::get_counters_value | ( | const string_vector & | parameters | ) |
|
inline |
position litehtml::element::get_placement | ( | ) | const |
|
private |
|
virtual |
Reimplemented in litehtml::el_script, litehtml::el_style, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_cdata, litehtml::el_comment, litehtml::el_text, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
inline |
void litehtml::element::increment_counter | ( | const string_id & | counter_name_id, |
const int | increment = 1 |
||
) |
|
virtual |
|
inline |
bool litehtml::element::is_block_formatting_context | ( | ) | const |
|
virtual |
Reimplemented in litehtml::el_body, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_break, litehtml::el_space, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_comment.
|
inline |
bool litehtml::element::is_inline | ( | ) | const |
bool litehtml::element::is_inline_box | ( | ) | const |
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
inline |
|
virtual |
Reimplemented in litehtml::el_image, and litehtml::html_tag.
|
inline |
|
virtual |
Reimplemented in litehtml::el_space.
bool litehtml::element::is_table_skip | ( | ) | const |
|
virtual |
Reimplemented in litehtml::el_text.
|
virtual |
Reimplemented in litehtml::el_space, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_anchor, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
inline |
|
inline |
|
virtual |
|
private |
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
bool litehtml::element::requires_styles_update | ( | ) |
void litehtml::element::reset_counter | ( | const string_id & | counter_name_id, |
const int | value = 0 |
||
) |
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
protectedvirtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::el_cdata, litehtml::el_comment, and litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
|
virtual |
Reimplemented in litehtml::html_tag.
std::tuple< element::ptr, element::ptr, element::ptr > litehtml::element::split_inlines | ( | ) |
|
virtual |
Reimplemented in litehtml::el_script, litehtml::el_style, and litehtml::html_tag.
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |