Add default_font preference to Litehtml plugin
[claws.git] / src / plugins / litehtml_viewer / lh_widget.h
1 #include <gtk/gtk.h>
2 #include <glib.h>
3 #include <gio/gio.h>
4
5 #include "container_linux.h"
6
7 class lh_widget : public container_linux
8 {
9         public:
10                 lh_widget();
11                 ~lh_widget();
12
13                 GtkWidget *get_widget() const;
14
15                 /* Methods that litehtml calls */
16                 void set_caption(const litehtml::tchar_t* caption);
17                 void set_base_url(const litehtml::tchar_t* base_url);
18                 void on_anchor_click(const litehtml::tchar_t* url, const litehtml::element::ptr& el);
19                 void set_cursor(const litehtml::tchar_t* cursor);
20                 void import_css(litehtml::tstring& text, const litehtml::tstring& url, litehtml::tstring& baseurl);
21                 void get_client_rect(litehtml::position& client) const;
22                 inline const litehtml::tchar_t *get_default_font_name() const { return m_font_name; };
23                 inline int get_default_font_size() const { return m_font_size; };
24                 GdkPixbuf *get_image(const litehtml::tchar_t* url, bool redraw_on_ready);
25
26                 void draw(cairo_t *cr);
27                 void redraw();
28                 void open_html(const gchar *contents);
29                 void clear();
30                 void update_cursor();
31                 void update_font();
32                 void print();
33
34                 const litehtml::tchar_t *get_href_at(const gint x, const gint y) const;
35                 void popup_context_menu(const litehtml::tchar_t *url, GdkEventButton *event);
36
37                 litehtml::document::ptr m_html;
38                 litehtml::tstring m_clicked_url;
39
40         private:
41                 void paint_white();
42
43                 gint m_rendered_width;
44                 GtkWidget *m_drawing_area;
45                 GtkWidget *m_scrolled_window;
46                 GtkWidget *m_viewport;
47                 GtkWidget *m_context_menu;
48                 litehtml::context m_context;
49                 gint m_height;
50                 litehtml::tstring m_cursor;
51
52                 litehtml::tchar_t *m_font_name;
53                 int m_font_size;
54 };