1 /* 2 * 3 * Copyright (C) 2010-2011 Colomban Wendling <ban@herbesfolles.org> 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 * 18 */ 19 20 #ifndef H_GWH_BROWSER 21 #define H_GWH_BROWSER 22 23 #include <glib.h> 24 #include <gtk/gtk.h> 25 #include <webkit/webkit.h> 26 27 G_BEGIN_DECLS 28 29 30 #define GWH_TYPE_BROWSER (gwh_browser_get_type ()) 31 #define GWH_BROWSER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GWH_TYPE_BROWSER, GwhBrowser)) 32 #define GWH_BROWSER_CLASS(ko) (G_TYPE_CHECK_CLASS_CAST ((k), GWH_TYPE_BROWSER, GwhBrowserClass)) 33 #define GWH_IS_BROWSER(b) (G_TYPE_CHECK_INSTANCE_TYPE ((b), GWH_TYPE_BROWSER)) 34 #define GWH_IS_BROWSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GWH_TYPE_BROWSER)) 35 36 37 typedef enum { 38 GWH_BROWSER_POSITION_MESSAGE_WINDOW, 39 GWH_BROWSER_POSITION_SIDEBAR, 40 GWH_BROWSER_POSITION_SEPARATE_WINDOW 41 } GwhBrowserPosition; 42 43 44 typedef struct _GwhBrowser GwhBrowser; 45 typedef struct _GwhBrowserClass GwhBrowserClass; 46 typedef struct _GwhBrowserPrivate GwhBrowserPrivate; 47 48 struct _GwhBrowser 49 { 50 GtkVBox parent; 51 52 GwhBrowserPrivate *priv; 53 }; 54 55 struct _GwhBrowserClass 56 { 57 GtkVBoxClass parent_class; 58 59 void (*populate_popup) (GwhBrowser *browser, 60 GtkMenu *menu); 61 }; 62 63 64 G_GNUC_INTERNAL 65 GType gwh_browser_get_type (void) G_GNUC_CONST; 66 G_GNUC_INTERNAL 67 GtkWidget *gwh_browser_new (void); 68 G_GNUC_INTERNAL 69 void gwh_browser_set_uri (GwhBrowser *self, 70 const gchar *uri); 71 G_GNUC_INTERNAL 72 const gchar *gwh_browser_get_uri (GwhBrowser *self); 73 G_GNUC_INTERNAL 74 GtkToolbar *gwh_browser_get_toolbar (GwhBrowser *self); 75 G_GNUC_INTERNAL 76 WebKitWebView *gwh_browser_get_web_view (GwhBrowser *self); 77 G_GNUC_INTERNAL 78 void gwh_browser_reload (GwhBrowser *self); 79 G_GNUC_INTERNAL 80 void gwh_browser_set_inspector_transient_for (GwhBrowser *self, 81 GtkWindow *window); 82 G_GNUC_INTERNAL 83 GtkWindow *gwh_browser_get_inspector_transient_for (GwhBrowser *self); 84 G_GNUC_INTERNAL 85 void gwh_browser_toggle_inspector (GwhBrowser *self); 86 G_GNUC_INTERNAL 87 gchar **gwh_browser_get_bookmarks (GwhBrowser *self); 88 G_GNUC_INTERNAL 89 gboolean gwh_browser_has_bookmark (GwhBrowser *self, 90 const gchar *uri); 91 G_GNUC_INTERNAL 92 void gwh_browser_add_bookmark (GwhBrowser *self, 93 const gchar *uri); 94 G_GNUC_INTERNAL 95 void gwh_browser_remove_bookmark (GwhBrowser *self, 96 const gchar *uri); 97 98 99 G_END_DECLS 100 101 #endif /* guard */ 102