2013-03-13 [colin] 3.9.0cvs119
[claws.git] / src / plugins / fancy / fancy_viewer.h
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * == Fancy Plugin ==
4  * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail Team
5  * This file Copyright (C) 2009-2013 Salvatore De Paolis <iwkse@claws-mail.org>
6  *  and the Claws Mail Team
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22
23 #ifndef FANCY_VIEWER_H
24 #define FANCY_VIEWER_H
25
26 #include <unistd.h>
27 #include <stdio.h>
28
29 #include <glib.h>
30 #include <glib/gi18n.h>
31 #include <gtk/gtk.h>
32 #include <gdk/gdkx.h>
33 #include <webkit/webkitwebview.h>
34 #include <webkit/webkitversion.h>
35 #include <webkit/webkitwebframe.h>
36 #include <webkit/webkitnetworkrequest.h>
37 #if WEBKIT_CHECK_VERSION (1,3,13)
38 #include <webkit/webkitglobals.h>
39 #endif
40 #include <prefs_common.h>
41 #include "common/claws.h"
42 #include "common/version.h"
43 #include "common/utils.h"
44 #include "mimeview.h"
45 #include "gdk/gdkkeysyms.h"
46 #include "main.h"
47 #include "plugin.h"
48 #include "menu.h"
49 #include "defs.h"
50 #include "utils.h"
51 #include "folder.h"
52 #ifdef USE_PTHREAD
53 #include <pthread.h>
54 #endif
55
56 #include <curl/curl.h>
57 #include <curl/curlver.h>
58 #include "filesel.h"
59
60 #ifdef HAVE_LIBSOUP_GNOME
61 #include <libsoup/soup-gnome.h>
62 #endif
63
64 typedef enum _NavigationMode {
65         NAV_DEFAULT,
66         NAV_INNER,
67         NAV_OUTER
68 } NavigationMode;
69
70 typedef struct _FancyViewer FancyViewer;
71 struct _FancyViewer
72 {
73         MimeViewer        mimeviewer;
74         GtkWidget         *scrollwin;
75         WebKitWebView     *view;
76         GtkWidget         *vbox;  
77         GtkWidget         *l_link;
78         /* Zoom Widgets  */
79         GtkWidget         *zoom_100;
80         GtkWidget         *ev_zoom_100;
81         GtkWidget         *zoom_in;
82         GtkWidget         *ev_zoom_in;
83         GtkWidget         *zoom_out;
84         GtkWidget         *ev_zoom_out;
85         GtkWidget         *stop_loading;
86         GtkWidget         *ev_stop_loading;
87         /* Preferences Widgets  */
88         GtkWidget         *fancy_prefs;
89         GtkWidget         *ev_fancy_prefs;
90         GtkWidget         *fancy_prefs_menu;
91         /* Menu Items */
92         GtkWidget         *enable_images;
93         GtkWidget         *enable_scripts;
94         GtkWidget         *enable_plugins;
95         GtkWidget         *enable_java;
96         GtkWidget         *enable_remote_content;
97         GtkWidget         *open_external;
98
99         GtkWidget         *progress;
100         WebKitWebSettings *settings;
101         gboolean          printing;
102         gboolean          override_prefs_images;
103         gboolean          override_prefs_remote_content;
104         gboolean          override_prefs_scripts;
105         gboolean          override_prefs_plugins;
106         gboolean          override_prefs_external;
107         gboolean                  override_prefs_java;
108
109         const gchar       *curlfile;
110         FILE              *stream;
111
112         gchar             *cur_link;
113         gchar             *filename;
114         MimeInfo          *to_load;
115         gulong            doc_handle;
116         gint              tag;
117         gint              loading;
118         gint              stop_previous;
119
120         /* DOM Objects */
121 #if WEBKIT_CHECK_VERSION(1,5,1)
122         WebKitDOMDocument         *doc;
123         WebKitDOMDOMWindow    *window;
124         WebKitDOMDOMSelection *selection;
125         WebKitDOMRange            *range;
126 #endif
127 };
128 #define OPEN_INTERNAL FALSE
129 #define OPEN_EXTERNAL TRUE
130 #define CTRL_KEY 4
131 #define GOOGLE_SEARCH "http://www.google.com/search?hl=en&q="
132
133 #endif
134