1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 /* 3 * Copyright (C) 2002 CodeFactory AB 4 * Copyright (C) 2001-2002 Mikael Hallendal <micke@imendio.com> 5 * Copyright (C) 2005 Imendio AB 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License as 9 * published by the Free Software Foundation; either version 2 of the 10 * License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public 18 * License along with this program; if not, write to the 19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 * Boston, MA 02111-1307, USA. 21 */ 22 23 #ifndef __DH_WINDOW_H__ 24 #define __DH_WINDOW_H__ 25 26 #include <gtk/gtk.h> 27 #include "dh-base.h" 28 29 G_BEGIN_DECLS 30 31 #define DH_TYPE_WINDOW (dh_window_get_type ()) 32 #define DH_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DH_TYPE_WINDOW, DhWindow)) 33 #define DH_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), DH_TYPE_WINDOW, DhWindowClass)) 34 #define DH_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DH_TYPE_WINDOW)) 35 #define DH_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DH_TYPE_WINDOW)) 36 #define DH_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DH_TYPE_WINDOW, DhWindowClass)) 37 38 typedef struct _DhWindow DhWindow; 39 typedef struct _DhWindowClass DhWindowClass; 40 typedef struct _DhWindowPriv DhWindowPriv; 41 42 typedef enum 43 { 44 DH_OPEN_LINK_NEW_WINDOW = 1 << 0, 45 DH_OPEN_LINK_NEW_TAB = 1 << 1 46 } DhOpenLinkFlags; 47 48 struct _DhWindow { 49 GtkWindow parent_instance; 50 DhWindowPriv *priv; 51 }; 52 53 struct _DhWindowClass { 54 GtkWindowClass parent_class; 55 56 /* Signals */ 57 void (*open_link) (DhWindow *window, 58 const char *location, 59 DhOpenLinkFlags flags); 60 }; 61 62 GType dh_window_get_type (void) G_GNUC_CONST; 63 GtkWidget *dh_window_new (DhBase *base); 64 void dh_window_search (DhWindow *window, 65 const gchar *str, 66 const gchar *book_id); 67 void dh_window_focus_search (DhWindow *window); 68 void _dh_window_display_uri (DhWindow *window, 69 const gchar *uri); 70 71 G_END_DECLS 72 73 #endif /* __DH_WINDOW_H__ */ 74