1 #ifndef LH_EL_TEXT_H
2 #define LH_EL_TEXT_H
3 
4 #include "html_tag.h"
5 
6 namespace litehtml
7 {
8 	class el_text : public element
9 	{
10 	protected:
11 		tstring			m_text;
12 		tstring			m_transformed_text;
13 		size			m_size;
14 		text_transform	m_text_transform;
15 		bool			m_use_transformed;
16 		bool			m_draw_spaces;
17 	public:
18 		el_text(const tchar_t* text, const std::shared_ptr<litehtml::document>& doc);
19 		virtual ~el_text();
20 
21 		virtual void				get_text(tstring& text) override;
22 		virtual const tchar_t*		get_style_property(const tchar_t* name, bool inherited, const tchar_t* def = 0) override;
23 		virtual void				parse_styles(bool is_reparse) override;
24 		virtual int					get_base_line() override;
25 		virtual void				draw(uint_ptr hdc, int x, int y, const position* clip) override;
26 		virtual int					line_height() const override;
27 		virtual uint_ptr			get_font(font_metrics* fm = 0) override;
28 		virtual style_display		get_display() const override;
29 		virtual white_space			get_white_space() const override;
30 		virtual element_position	get_element_position(css_offsets* offsets = 0) const override;
31 		virtual css_offsets			get_css_offsets() const override;
32 
33 	protected:
34 		virtual void				get_content_size(size& sz, int max_width) override;
35 	};
36 }
37 
38 #endif  // LH_EL_TEXT_H
39