4cdf8ceb1bbe0f5a298113a1f1dc9cb9864168a7
[claws.git] / src / plugins / litehtml_viewer / lh_widget.h
1 #include <gtk/gtk.h>
2 #include <glib.h>
3
4 #include "container_linux.h"
5
6 class lh_widget : public container_linux
7 {
8         public:
9                 lh_widget();
10                 ~lh_widget();
11
12                 GtkWidget *get_widget() const;
13
14                 void set_caption(const litehtml::tchar_t* caption);
15                 void set_base_url(const litehtml::tchar_t* base_url);
16                 void on_anchor_click(const litehtml::tchar_t* url, const litehtml::element::ptr& el);
17                 void set_cursor(const litehtml::tchar_t* cursor);
18                 void import_css(litehtml::tstring& text, const litehtml::tstring& url, litehtml::tstring& baseurl);
19                 void get_client_rect(litehtml::position& client) const;
20                 GdkPixbuf *get_image(const litehtml::tchar_t* url, bool redraw_on_ready);
21
22                 gint height() const { return m_height; };
23                 void setHeight(gint height) { m_height = height; };
24                 void draw(cairo_t *cr);
25                 void redraw();
26                 void open_html(const gchar *contents);
27                 void clear();
28
29         private:
30                 void paint_white();
31
32                 litehtml::document::ptr m_html;
33                 gint m_rendered_width;
34                 GtkWidget *m_drawing_area;
35                 GtkWidget *m_scrolled_window;
36                 GtkWidget *m_viewport;
37                 litehtml::context m_context;
38                 gint m_height;
39 };