Photon 1.0.0
Loading...
Searching...
No Matches
litehtml::html_tag Class Reference

#include <html_tag.h>

Inheritance diagram for litehtml::html_tag:
litehtml::element litehtml::el_anchor litehtml::el_base litehtml::el_before_after_base litehtml::el_body litehtml::el_break litehtml::el_div litehtml::el_font litehtml::el_image litehtml::el_link litehtml::el_para litehtml::el_table litehtml::el_td litehtml::el_title litehtml::el_tr

Public Types

typedef shared_ptr< html_tagptr
 
- Public Types inherited from litehtml::element
typedef std::shared_ptr< elementptr
 
typedef std::shared_ptr< const elementconst_ptr
 
typedef std::weak_ptr< elementweak_ptr
 

Public Member Functions

 html_tag (const shared_ptr< document > &doc)
 
 html_tag (const element::ptr &parent, const string &style="display: block")
 
bool appendChild (const element::ptr &el) override
 
bool removeChild (const element::ptr &el) override
 
void clearRecursive () override
 
string_id tag () const override
 
string_id id () const override
 
const char * get_tagName () const override
 
void set_tagName (const char *tag) override
 
void set_data (const char *data) override
 
const vector< string_id > & classes () const
 
const string_vectorstr_classes () const
 
void set_attr (const char *name, const char *val) override
 
const char * get_attr (const char *name, const char *def=nullptr) const override
 
void apply_stylesheet (const litehtml::css &stylesheet) override
 
void refresh_styles () override
 
bool is_white_space () const override
 
bool is_body () const override
 
bool is_break () const override
 
bool on_mouse_over () override
 
bool on_mouse_leave () override
 
bool on_lbutton_down () override
 
bool on_lbutton_up () override
 
void on_click () override
 
bool set_pseudo_class (string_id cls, bool add) override
 
bool set_class (const char *pclass, bool add) override
 
bool is_replaced () const override
 
void compute_styles (bool recursive=true) override
 
void draw (uint_ptr hdc, int x, int y, const position *clip, const std::shared_ptr< render_item > &ri) override
 
void draw_background (uint_ptr hdc, int x, int y, const position *clip, const std::shared_ptr< render_item > &ri) override
 
template<class Type >
const Type & get_property (string_id name, bool inherited, const Type &default_value, uint_ptr css_properties_member_offset) const
 
bool get_custom_property (string_id name, css_token_vector &result) const
 
elements_listchildren ()
 
int select (const css_selector::vector &selector_list, bool apply_pseudo=true) override
 
int select (const string &selector) override
 
int select (const css_selector &selector, bool apply_pseudo=true) override
 
int select (const css_element_selector &selector, bool apply_pseudo=true) override
 
int select_pseudoclass (const css_attribute_selector &sel)
 
int select_attribute (const css_attribute_selector &sel)
 
elements_list select_all (const string &selector) override
 
elements_list select_all (const css_selector &selector) override
 
element::ptr select_one (const string &selector) override
 
element::ptr select_one (const css_selector &selector) override
 
element::ptr find_ancestor (const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) override
 
element::ptr find_adjacent_sibling (const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) override
 
element::ptr find_sibling (const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=nullptr) override
 
void get_text (string &text) override
 
void parse_attributes () override
 
void get_content_size (size &sz, int max_width) override
 
void add_style (const style &style) override
 
bool is_nth_child (const element::ptr &el, int num, int off, bool of_type, const css_selector::vector &selector_list) const override
 
bool is_nth_last_child (const element::ptr &el, int num, int off, bool of_type, const css_selector::vector &selector_list) const override
 
bool is_only_child (const element::ptr &el, bool of_type) const override
 
const backgroundget_background (bool own_only=false) override
 
string dump_get_name () override
 
- Public Member Functions inherited from litehtml::element
 element (const std::shared_ptr< document > &doc)
 
virtual ~element ()=default
 
const css_propertiescss () const
 
css_propertiescss_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< documentget_document () const
 
const std::list< std::shared_ptr< element > > & children () const
 
virtual bool is_space () const
 
virtual bool is_comment () const
 
virtual bool is_text () const
 
virtual bool is_ancestor (const ptr &el) const
 
virtual std::vector< std::tuple< string, string > > dump_get_attrs ()
 
void dump (litehtml::dumper &cout)
 
std::tuple< element::ptr, element::ptr, element::ptrsplit_inlines ()
 
virtual std::shared_ptr< render_itemcreate_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 &parameters)
 
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

void select_all (const css_selector &selector, elements_list &res) override
 
void draw_list_marker (uint_ptr hdc, const position &pos)
 
string get_list_marker_text (int index)
 
element::ptr get_element_before (const style &style, bool create)
 
element::ptr get_element_after (const style &style, bool create)
 
void map_to_pixel_length_property (string_id prop_name, string attr_value)
 
void map_to_pixel_length_property_with_default_value (string_id prop_name, string attr_value, int default_value)
 
void map_to_dimension_property (string_id prop_name, string attr_value)
 
void map_to_dimension_property_ignoring_zero (string_id prop_name, string attr_value)
 
- Protected Member Functions inherited from litehtml::element
element::ptr _add_before_after (int type, const style &style)
 

Protected Attributes

string_id m_tag
 
string_id m_id
 
string_vector m_str_classes
 
vector< string_id > m_classes
 
style m_style
 
string_map m_attrs
 
vector< string_id > m_pseudo_classes
 
- Protected Attributes inherited from litehtml::element
std::weak_ptr< elementm_parent
 
std::weak_ptr< documentm_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

void handle_counter_properties ()
 

Friends

class elements_iterator
 
class el_table
 
class table_grid
 
class line_box
 

Member Typedef Documentation

◆ ptr

typedef shared_ptr<html_tag> litehtml::html_tag::ptr

Constructor & Destructor Documentation

◆ html_tag() [1/2]

litehtml::html_tag::html_tag ( const shared_ptr< document > &  doc)
explicit

◆ html_tag() [2/2]

litehtml::html_tag::html_tag ( const element::ptr parent,
const string &  style = "display: block" 
)
explicit

Member Function Documentation

◆ add_style()

void litehtml::html_tag::add_style ( const style style)
overridevirtual

Reimplemented from litehtml::element.

◆ appendChild()

bool litehtml::html_tag::appendChild ( const element::ptr el)
overridevirtual

Reimplemented from litehtml::element.

◆ apply_stylesheet()

void litehtml::html_tag::apply_stylesheet ( const litehtml::css stylesheet)
overridevirtual

Reimplemented from litehtml::element.

◆ children()

elements_list & litehtml::html_tag::children ( )
inline

◆ classes()

const vector< string_id > & litehtml::html_tag::classes ( ) const
inline

◆ clearRecursive()

void litehtml::html_tag::clearRecursive ( )
overridevirtual

Reimplemented from litehtml::element.

◆ compute_styles()

void litehtml::html_tag::compute_styles ( bool  recursive = true)
overridevirtual

Reimplemented from litehtml::element.

◆ draw()

void litehtml::html_tag::draw ( uint_ptr  hdc,
int  x,
int  y,
const position clip,
const std::shared_ptr< render_item > &  ri 
)
overridevirtual

Reimplemented from litehtml::element.

◆ draw_background()

void litehtml::html_tag::draw_background ( uint_ptr  hdc,
int  x,
int  y,
const position clip,
const std::shared_ptr< render_item > &  ri 
)
overridevirtual

Reimplemented from litehtml::element.

◆ draw_list_marker()

void litehtml::html_tag::draw_list_marker ( uint_ptr  hdc,
const position pos 
)
protected

◆ dump_get_name()

string litehtml::html_tag::dump_get_name ( )
overridevirtual

Reimplemented from litehtml::element.

◆ find_adjacent_sibling()

litehtml::element::ptr litehtml::html_tag::find_adjacent_sibling ( const element::ptr el,
const css_selector selector,
bool  apply_pseudo = true,
bool *  is_pseudo = nullptr 
)
overridevirtual

Reimplemented from litehtml::element.

◆ find_ancestor()

element::ptr litehtml::html_tag::find_ancestor ( const css_selector selector,
bool  apply_pseudo = true,
bool *  is_pseudo = nullptr 
)
overridevirtual

Reimplemented from litehtml::element.

◆ find_sibling()

litehtml::element::ptr litehtml::html_tag::find_sibling ( const element::ptr el,
const css_selector selector,
bool  apply_pseudo = true,
bool *  is_pseudo = nullptr 
)
overridevirtual

Reimplemented from litehtml::element.

◆ get_attr()

const char * litehtml::html_tag::get_attr ( const char *  name,
const char *  def = nullptr 
) const
overridevirtual

Reimplemented from litehtml::element.

◆ get_background()

const litehtml::background * litehtml::html_tag::get_background ( bool  own_only = false)
overridevirtual

Reimplemented from litehtml::element.

◆ get_content_size()

void litehtml::html_tag::get_content_size ( size sz,
int  max_width 
)
overridevirtual

Reimplemented from litehtml::element.

◆ get_custom_property()

bool litehtml::html_tag::get_custom_property ( string_id  name,
css_token_vector result 
) const

◆ get_element_after()

litehtml::element::ptr litehtml::html_tag::get_element_after ( const style style,
bool  create 
)
protected

◆ get_element_before()

litehtml::element::ptr litehtml::html_tag::get_element_before ( const style style,
bool  create 
)
protected

◆ get_list_marker_text()

litehtml::string litehtml::html_tag::get_list_marker_text ( int  index)
protected

◆ get_property()

template<class Type >
const Type & litehtml::html_tag::get_property ( string_id  name,
bool  inherited,
const Type &  default_value,
uint_ptr  css_properties_member_offset 
) const

◆ get_tagName()

const char * litehtml::html_tag::get_tagName ( ) const
overridevirtual

Reimplemented from litehtml::element.

◆ get_text()

void litehtml::html_tag::get_text ( string &  text)
overridevirtual

Reimplemented from litehtml::element.

◆ handle_counter_properties()

void litehtml::html_tag::handle_counter_properties ( )
private

◆ id()

string_id litehtml::html_tag::id ( ) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_body()

bool litehtml::html_tag::is_body ( ) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_break()

bool litehtml::html_tag::is_break ( ) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_nth_child()

bool litehtml::html_tag::is_nth_child ( const element::ptr el,
int  num,
int  off,
bool  of_type,
const css_selector::vector selector_list 
) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_nth_last_child()

bool litehtml::html_tag::is_nth_last_child ( const element::ptr el,
int  num,
int  off,
bool  of_type,
const css_selector::vector selector_list 
) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_only_child()

bool litehtml::html_tag::is_only_child ( const element::ptr el,
bool  of_type 
) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_replaced()

bool litehtml::html_tag::is_replaced ( ) const
overridevirtual

Reimplemented from litehtml::element.

◆ is_white_space()

bool litehtml::html_tag::is_white_space ( ) const
overridevirtual

Reimplemented from litehtml::element.

◆ map_to_dimension_property()

void litehtml::html_tag::map_to_dimension_property ( string_id  prop_name,
string  attr_value 
)
protected

◆ map_to_dimension_property_ignoring_zero()

void litehtml::html_tag::map_to_dimension_property_ignoring_zero ( string_id  prop_name,
string  attr_value 
)
protected

◆ map_to_pixel_length_property()

void litehtml::html_tag::map_to_pixel_length_property ( string_id  prop_name,
string  attr_value 
)
protected

◆ map_to_pixel_length_property_with_default_value()

void litehtml::html_tag::map_to_pixel_length_property_with_default_value ( string_id  prop_name,
string  attr_value,
int  default_value 
)
protected

◆ on_click()

void litehtml::html_tag::on_click ( )
overridevirtual

Reimplemented from litehtml::element.

◆ on_lbutton_down()

bool litehtml::html_tag::on_lbutton_down ( )
overridevirtual

Reimplemented from litehtml::element.

◆ on_lbutton_up()

bool litehtml::html_tag::on_lbutton_up ( )
overridevirtual

Reimplemented from litehtml::element.

◆ on_mouse_leave()

bool litehtml::html_tag::on_mouse_leave ( )
overridevirtual

Reimplemented from litehtml::element.

◆ on_mouse_over()

bool litehtml::html_tag::on_mouse_over ( )
overridevirtual

Reimplemented from litehtml::element.

◆ parse_attributes()

void litehtml::html_tag::parse_attributes ( )
overridevirtual

Reimplemented from litehtml::element.

◆ refresh_styles()

void litehtml::html_tag::refresh_styles ( )
overridevirtual

Reimplemented from litehtml::element.

◆ removeChild()

bool litehtml::html_tag::removeChild ( const element::ptr el)
overridevirtual

Reimplemented from litehtml::element.

◆ select() [1/4]

int litehtml::html_tag::select ( const css_element_selector selector,
bool  apply_pseudo = true 
)
overridevirtual

Reimplemented from litehtml::element.

◆ select() [2/4]

int litehtml::html_tag::select ( const css_selector selector,
bool  apply_pseudo = true 
)
overridevirtual

Reimplemented from litehtml::element.

◆ select() [3/4]

int litehtml::html_tag::select ( const css_selector::vector selector_list,
bool  apply_pseudo = true 
)
overridevirtual

Reimplemented from litehtml::element.

◆ select() [4/4]

int litehtml::html_tag::select ( const string &  selector)
overridevirtual

Reimplemented from litehtml::element.

◆ select_all() [1/3]

litehtml::elements_list litehtml::html_tag::select_all ( const css_selector selector)
overridevirtual

Reimplemented from litehtml::element.

◆ select_all() [2/3]

void litehtml::html_tag::select_all ( const css_selector selector,
elements_list res 
)
overrideprotectedvirtual

Reimplemented from litehtml::element.

◆ select_all() [3/3]

litehtml::elements_list litehtml::html_tag::select_all ( const string &  selector)
overridevirtual

Reimplemented from litehtml::element.

◆ select_attribute()

int litehtml::html_tag::select_attribute ( const css_attribute_selector sel)

◆ select_one() [1/2]

litehtml::element::ptr litehtml::html_tag::select_one ( const css_selector selector)
overridevirtual

Reimplemented from litehtml::element.

◆ select_one() [2/2]

litehtml::element::ptr litehtml::html_tag::select_one ( const string &  selector)
overridevirtual

Reimplemented from litehtml::element.

◆ select_pseudoclass()

int litehtml::html_tag::select_pseudoclass ( const css_attribute_selector sel)

◆ set_attr()

void litehtml::html_tag::set_attr ( const char *  name,
const char *  val 
)
overridevirtual

Reimplemented from litehtml::element.

◆ set_class()

bool litehtml::html_tag::set_class ( const char *  pclass,
bool  add 
)
overridevirtual

Reimplemented from litehtml::element.

◆ set_data()

void litehtml::html_tag::set_data ( const char *  data)
overridevirtual

Reimplemented from litehtml::element.

◆ set_pseudo_class()

bool litehtml::html_tag::set_pseudo_class ( string_id  cls,
bool  add 
)
overridevirtual

Reimplemented from litehtml::element.

◆ set_tagName()

void litehtml::html_tag::set_tagName ( const char *  tag)
overridevirtual

Reimplemented from litehtml::element.

◆ str_classes()

const string_vector & litehtml::html_tag::str_classes ( ) const
inline

◆ tag()

string_id litehtml::html_tag::tag ( ) const
overridevirtual

Reimplemented from litehtml::element.

Friends And Related Symbol Documentation

◆ el_table

friend class el_table
friend

◆ elements_iterator

friend class elements_iterator
friend

◆ line_box

friend class line_box
friend

◆ table_grid

friend class table_grid
friend

Member Data Documentation

◆ m_attrs

string_map litehtml::html_tag::m_attrs
protected

◆ m_classes

vector<string_id> litehtml::html_tag::m_classes
protected

◆ m_id

string_id litehtml::html_tag::m_id
protected

◆ m_pseudo_classes

vector<string_id> litehtml::html_tag::m_pseudo_classes
protected

◆ m_str_classes

string_vector litehtml::html_tag::m_str_classes
protected

◆ m_style

style litehtml::html_tag::m_style
protected

◆ m_tag

string_id litehtml::html_tag::m_tag
protected

The documentation for this class was generated from the following files: