Cogs.Core
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
litehtml::element Class Reference
Inheritance diagram for litehtml::element:
litehtml::el_cdata litehtml::el_comment litehtml::el_script litehtml::el_style litehtml::el_text litehtml::html_tag litehtml::el_space 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 std::shared_ptr< litehtml::elementptr
 
typedef std::shared_ptr< const litehtml::elementconst_ptr
 
typedef std::weak_ptr< litehtml::elementweak_ptr
 

Public Member Functions

 element (const std::shared_ptr< litehtml::document > &doc)
 
positionget_position ()
 
int left () const
 
int right () const
 
int top () const
 
int bottom () const
 
int height () const
 
int width () const
 
int content_margins_top () const
 
int content_margins_bottom () const
 
int content_margins_left () const
 
int content_margins_right () const
 
int content_margins_width () const
 
int content_margins_height () const
 
int margin_top () const
 
int margin_bottom () const
 
int margin_left () const
 
int margin_right () const
 
margins get_margins () const
 
int padding_top () const
 
int padding_bottom () const
 
int padding_left () const
 
int padding_right () const
 
margins get_paddings () const
 
int border_top () const
 
int border_bottom () const
 
int border_left () const
 
int border_right () const
 
margins get_borders () const
 
bool in_normal_flow () const
 
litehtml::web_color get_color (const tchar_t *prop_name, bool inherited, const litehtml::web_color &def_color=litehtml::web_color())
 
bool is_inline_box () const
 
position get_placement () const
 
bool collapse_top_margin () const
 
bool collapse_bottom_margin () const
 
bool is_positioned () const
 
bool skip ()
 
void skip (bool val)
 
bool have_parent () const
 
element::ptr parent () const
 
void parent (element::ptr par)
 
bool is_visible () const
 
int calc_width (int defVal) const
 
int get_inline_shift_left ()
 
int get_inline_shift_right ()
 
void apply_relative_shift (int parent_width)
 
std::shared_ptr< documentget_document () const
 
virtual elements_vector select_all (const tstring &selector)
 
virtual elements_vector select_all (const css_selector &selector)
 
virtual element::ptr select_one (const tstring &selector)
 
virtual element::ptr select_one (const css_selector &selector)
 
virtual int render (int x, int y, int max_width, bool second_pass=false)
 
virtual int render_inline (const ptr &container, int max_width)
 
virtual int place_element (const ptr &el, int max_width)
 
virtual void calc_outlines (int parent_width)
 
virtual void calc_auto_margins (int parent_width)
 
virtual void apply_vertical_align ()
 
virtual bool fetch_positioned ()
 
virtual void render_positioned (render_type rt=render_all)
 
virtual void set_inner_html (const litehtml::tchar_t *str, litehtml::css *user_styles=0)
 
virtual bool appendChild (const ptr &el)
 
virtual bool removeChild (const ptr &el)
 
virtual void clearRecursive ()
 
virtual const tchar_t * get_tagName () const
 
virtual void set_tagName (const tchar_t *tag)
 
virtual void set_data (const tchar_t *data)
 
virtual element_float get_float () const
 
virtual vertical_align get_vertical_align () const
 
virtual element_clear get_clear () const
 
virtual size_t get_children_count () const
 
virtual element::ptr get_child (size_t idx) const
 
virtual overflow get_overflow () const
 
virtual css_length get_css_left () const
 
virtual css_length get_css_right () const
 
virtual css_length get_css_top () const
 
virtual css_length get_css_bottom () const
 
virtual css_offsets get_css_offsets () const
 
virtual css_length get_css_width () const
 
virtual void set_css_width (css_length &w)
 
virtual css_length get_css_height () const
 
virtual void set_attr (const tchar_t *name, const tchar_t *val)
 
virtual const tchar_t * get_attr (const tchar_t *name, const tchar_t *def=0) const
 
virtual void apply_stylesheet (const litehtml::css &stylesheet)
 
virtual void refresh_styles ()
 
virtual bool is_white_space () const
 
virtual bool is_body () const
 
virtual bool is_break () const
 
virtual int get_base_line ()
 
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 find_styles_changes (position::vector &redraw_boxes, int x, int y)
 
virtual const tchar_t * get_cursor ()
 
virtual void init_font ()
 
virtual bool is_point_inside (int x, int y)
 
virtual bool set_pseudo_class (const tchar_t *pclass, bool add)
 
virtual bool set_class (const tchar_t *pclass, bool add)
 
virtual bool is_replaced () const
 
virtual int line_height () const
 
virtual white_space get_white_space () const
 
virtual style_display get_display () const
 
virtual visibility get_visibility () const
 
virtual element_position get_element_position (css_offsets *offsets=0) const
 
virtual void get_inline_boxes (position::vector &boxes)
 
virtual void parse_styles (bool is_reparse=false)
 
virtual void draw (uint_ptr hdc, int x, int y, const position *clip)
 
virtual void draw_background (uint_ptr hdc, int x, int y, const position *clip)
 
virtual const tchar_t * get_style_property (const tchar_t *name, bool inherited, const tchar_t *def=0)
 
virtual uint_ptr get_font (font_metrics *fm=0)
 
virtual int get_font_size () const
 
virtual void get_text (tstring &text)
 
virtual const tchar_t * get_text () const
 
virtual void parse_attributes ()
 
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=0)
 
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=0)
 
virtual element::ptr find_sibling (const element::ptr &el, const css_selector &selector, bool apply_pseudo=true, bool *is_pseudo=0)
 
virtual bool is_first_child_inline (const element::ptr &el) const
 
virtual bool is_last_child_inline (const element::ptr &el)
 
virtual bool have_inline_child () const
 
virtual void get_content_size (size &sz, int max_width)
 
virtual void init ()
 
virtual bool is_floats_holder () const
 
virtual int get_floats_height (element_float el_float=float_none) const
 
virtual int get_left_floats_height () const
 
virtual int get_right_floats_height () const
 
virtual int get_line_left (int y)
 
virtual int get_line_right (int y, int def_right)
 
virtual void get_line_left_right (int y, int def_right, int &ln_left, int &ln_right)
 
virtual void add_float (const ptr &el, int x, int y)
 
virtual void update_floats (int dy, const ptr &parent)
 
virtual void add_positioned (const ptr &el)
 
virtual int find_next_line_top (int top, int width, int def_right)
 
virtual int get_zindex () const
 
virtual void draw_stacking_context (uint_ptr hdc, int x, int y, const position *clip, bool with_positioned)
 
virtual void draw_children (uint_ptr hdc, int x, int y, const position *clip, draw_flag flag, int zindex)
 
virtual bool is_nth_child (const element::ptr &el, int num, int off, bool of_type) const
 
virtual bool is_nth_last_child (const element::ptr &el, int num, int off, bool of_type) const
 
virtual bool is_only_child (const element::ptr &el, bool of_type) const
 
virtual bool get_predefined_height (int &p_height) const
 
virtual void calc_document_size (litehtml::size &sz, int x=0, int y=0)
 
virtual void get_redraw_box (litehtml::position &pos, int x=0, int y=0)
 
virtual void add_style (const litehtml::style &st)
 
virtual element::ptr get_element_by_point (int x, int y, int client_x, int client_y)
 
virtual element::ptr get_child_by_point (int x, int y, int client_x, int client_y, draw_flag flag, int zindex)
 
virtual const backgroundget_background (bool own_only=false)
 
void set_userdata (void *data, int generation=0)
 
void * get_userdata () const
 
int get_userdata_generation () const
 

Protected Member Functions

virtual void select_all (const css_selector &selector, elements_vector &res)
 

Protected Attributes

std::weak_ptr< elementm_parent
 
std::weak_ptr< litehtml::documentm_doc
 
litehtml::boxm_box
 
elements_vector m_children
 
position m_pos
 
margins m_margins
 
margins m_padding
 
margins m_borders
 
bool m_skip
 
void * m_userdata
 
int m_userdatageneration
 

Friends

class block_box
 
class line_box
 
class html_tag
 
class el_table
 
class document
 

Detailed Description

Definition at line 12 of file element.h.

Member Typedef Documentation

◆ const_ptr

typedef std::shared_ptr<const litehtml::element> litehtml::element::const_ptr

Definition at line 21 of file element.h.

◆ ptr

typedef std::shared_ptr<litehtml::element> litehtml::element::ptr

Definition at line 20 of file element.h.

◆ weak_ptr

typedef std::weak_ptr<litehtml::element> litehtml::element::weak_ptr

Definition at line 22 of file element.h.

Constructor & Destructor Documentation

◆ element()

litehtml::element::element ( const std::shared_ptr< litehtml::document > &  doc)

Definition at line 15 of file element.cpp.

◆ ~element()

litehtml::element::~element ( )
virtual

Definition at line 23 of file element.cpp.

Member Function Documentation

◆ apply_relative_shift()

void litehtml::element::apply_relative_shift ( int  parent_width)

Definition at line 274 of file element.cpp.

◆ border_bottom()

int litehtml::element::border_bottom ( ) const
inline

Definition at line 320 of file element.h.

◆ border_left()

int litehtml::element::border_left ( ) const
inline

Definition at line 325 of file element.h.

◆ border_right()

int litehtml::element::border_right ( ) const
inline

Definition at line 330 of file element.h.

◆ border_top()

int litehtml::element::border_top ( ) const
inline

Definition at line 315 of file element.h.

◆ bottom()

int litehtml::element::bottom ( ) const
inline

Definition at line 231 of file element.h.

◆ calc_document_size()

void litehtml::element::calc_document_size ( litehtml::size sz,
int  x = 0,
int  y = 0 
)
virtual

Definition at line 149 of file element.cpp.

◆ calc_width()

int litehtml::element::calc_width ( int  defVal) const

Definition at line 174 of file element.cpp.

◆ collapse_bottom_margin()

bool litehtml::element::collapse_bottom_margin ( ) const

Definition at line 101 of file element.cpp.

◆ collapse_top_margin()

bool litehtml::element::collapse_top_margin ( ) const

Definition at line 92 of file element.cpp.

◆ content_margins_bottom()

int litehtml::element::content_margins_bottom ( ) const
inline

Definition at line 251 of file element.h.

◆ content_margins_height()

int litehtml::element::content_margins_height ( ) const
inline

Definition at line 271 of file element.h.

◆ content_margins_left()

int litehtml::element::content_margins_left ( ) const
inline

Definition at line 256 of file element.h.

◆ content_margins_right()

int litehtml::element::content_margins_right ( ) const
inline

Definition at line 261 of file element.h.

◆ content_margins_top()

int litehtml::element::content_margins_top ( ) const
inline

Definition at line 246 of file element.h.

◆ content_margins_width()

int litehtml::element::content_margins_width ( ) const
inline

Definition at line 266 of file element.h.

◆ get_borders()

litehtml::margins litehtml::element::get_borders ( ) const
inline

Definition at line 281 of file element.h.

◆ get_color()

litehtml::web_color litehtml::element::get_color ( const tchar_t *  prop_name,
bool  inherited,
const litehtml::web_color def_color = litehtml::web_color() 
)

Definition at line 56 of file element.cpp.

◆ get_document()

std::shared_ptr< document > litehtml::element::get_document ( ) const
inline

Definition at line 406 of file element.h.

◆ get_inline_shift_left()

int litehtml::element::get_inline_shift_left ( )

Definition at line 216 of file element.cpp.

◆ get_inline_shift_right()

int litehtml::element::get_inline_shift_right ( )

Definition at line 245 of file element.cpp.

◆ get_margins()

litehtml::margins litehtml::element::get_margins ( ) const
inline

Definition at line 380 of file element.h.

◆ get_paddings()

litehtml::margins litehtml::element::get_paddings ( ) const
inline

Definition at line 276 of file element.h.

◆ get_placement()

litehtml::position litehtml::element::get_placement ( ) const

Definition at line 66 of file element.cpp.

◆ get_position()

position & litehtml::element::get_position ( )
inline

Definition at line 401 of file element.h.

◆ get_predefined_height()

bool litehtml::element::get_predefined_height ( int &  p_height) const
virtual

Definition at line 110 of file element.cpp.

◆ get_redraw_box()

void litehtml::element::get_redraw_box ( litehtml::position pos,
int  x = 0,
int  y = 0 
)
virtual

Definition at line 158 of file element.cpp.

◆ get_text()

virtual const tchar_t * litehtml::element::get_text ( ) const
inlinevirtual

Definition at line 170 of file element.h.

◆ get_userdata()

void * litehtml::element::get_userdata ( ) const
inline

Definition at line 208 of file element.h.

◆ get_userdata_generation()

int litehtml::element::get_userdata_generation ( ) const
inline

Definition at line 209 of file element.h.

◆ have_parent()

bool litehtml::element::have_parent ( ) const
inline

Definition at line 345 of file element.h.

◆ height()

int litehtml::element::height ( ) const
inline

Definition at line 236 of file element.h.

◆ in_normal_flow()

bool litehtml::element::in_normal_flow ( ) const
inline

Definition at line 306 of file element.h.

◆ is_ancestor()

bool litehtml::element::is_ancestor ( const ptr &  el) const
virtual

Definition at line 202 of file element.cpp.

◆ is_inline_box()

bool litehtml::element::is_inline_box ( ) const

Definition at line 79 of file element.cpp.

◆ is_point_inside()

bool litehtml::element::is_point_inside ( int  x,
int  y 
)
virtual

Definition at line 27 of file element.cpp.

◆ is_positioned()

bool litehtml::element::is_positioned ( ) const
inline

Definition at line 391 of file element.h.

◆ is_visible()

bool litehtml::element::is_visible ( ) const
inline

Definition at line 396 of file element.h.

◆ left()

int litehtml::element::left ( ) const
inline

Definition at line 221 of file element.h.

◆ margin_bottom()

int litehtml::element::margin_bottom ( ) const
inline

Definition at line 365 of file element.h.

◆ margin_left()

int litehtml::element::margin_left ( ) const
inline

Definition at line 370 of file element.h.

◆ margin_right()

int litehtml::element::margin_right ( ) const
inline

Definition at line 375 of file element.h.

◆ margin_top()

int litehtml::element::margin_top ( ) const
inline

Definition at line 360 of file element.h.

◆ padding_bottom()

int litehtml::element::padding_bottom ( ) const
inline

Definition at line 291 of file element.h.

◆ padding_left()

int litehtml::element::padding_left ( ) const
inline

Definition at line 296 of file element.h.

◆ padding_right()

int litehtml::element::padding_right ( ) const
inline

Definition at line 301 of file element.h.

◆ padding_top()

int litehtml::element::padding_top ( ) const
inline

Definition at line 286 of file element.h.

◆ parent() [1/2]

element::ptr litehtml::element::parent ( ) const
inline

Definition at line 350 of file element.h.

◆ parent() [2/2]

void litehtml::element::parent ( element::ptr  par)
inline

Definition at line 355 of file element.h.

◆ right()

int litehtml::element::right ( ) const
inline

Definition at line 216 of file element.h.

◆ set_inner_html()

void litehtml::element::set_inner_html ( const litehtml::tchar_t *  str,
litehtml::css user_styles = 0 
)
virtual

Definition at line 321 of file element.cpp.

◆ set_userdata()

void litehtml::element::set_userdata ( void *  data,
int  generation = 0 
)
inline

Definition at line 207 of file element.h.

◆ skip() [1/2]

bool litehtml::element::skip ( )
inline

Definition at line 335 of file element.h.

◆ skip() [2/2]

void litehtml::element::skip ( bool  val)
inline

Definition at line 340 of file element.h.

◆ top()

int litehtml::element::top ( ) const
inline

Definition at line 226 of file element.h.

◆ width()

int litehtml::element::width ( ) const
inline

Definition at line 241 of file element.h.

Friends And Related Function Documentation

◆ block_box

friend class block_box
friend

Definition at line 14 of file element.h.

◆ document

friend class document
friend

Definition at line 18 of file element.h.

◆ el_table

friend class el_table
friend

Definition at line 17 of file element.h.

◆ html_tag

friend class html_tag
friend

Definition at line 16 of file element.h.

◆ line_box

friend class line_box
friend

Definition at line 15 of file element.h.

Member Data Documentation

◆ m_borders

margins litehtml::element::m_borders
protected

Definition at line 31 of file element.h.

◆ m_box

litehtml::box* litehtml::element::m_box
protected

Definition at line 26 of file element.h.

◆ m_children

elements_vector litehtml::element::m_children
protected

Definition at line 27 of file element.h.

◆ m_doc

std::weak_ptr<litehtml::document> litehtml::element::m_doc
protected

Definition at line 25 of file element.h.

◆ m_margins

margins litehtml::element::m_margins
protected

Definition at line 29 of file element.h.

◆ m_padding

margins litehtml::element::m_padding
protected

Definition at line 30 of file element.h.

◆ m_parent

std::weak_ptr<element> litehtml::element::m_parent
protected

Definition at line 24 of file element.h.

◆ m_pos

position litehtml::element::m_pos
protected

Definition at line 28 of file element.h.

◆ m_skip

bool litehtml::element::m_skip
protected

Definition at line 32 of file element.h.

◆ m_userdata

void* litehtml::element::m_userdata
protected

Definition at line 33 of file element.h.

◆ m_userdatageneration

int litehtml::element::m_userdatageneration
protected

Definition at line 34 of file element.h.


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