1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 /* 3 * Copyright (C) 2002 CodeFactory AB 4 * Copyright (C) 2002 Mikael Hallendal <micke@imendio.com> 5 * Copyright (C) 2005-2008 Imendio AB 6 * Copyright (C) 2010 Lanedo GmbH 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License as 10 * published by the Free Software Foundation; either version 2 of the 11 * License, or (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 GNU 16 * General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public 19 * License along with this program; if not, write to the 20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 * Boston, MA 02111-1307, USA. 22 */ 23 24 #ifndef _DH_BOOK_H_ 25 #define _DH_BOOK_H_ 26 27 #include <gtk/gtk.h> 28 29 G_BEGIN_DECLS 30 31 typedef struct _DhBook DhBook; 32 typedef struct _DhBookClass DhBookClass; 33 34 #define DH_TYPE_BOOK (dh_book_get_type ()) 35 #define DH_BOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DH_TYPE_BOOK, DhBook)) 36 #define DH_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), DH_TYPE_BOOK, DhBookClass)) 37 #define DH_IS_BOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DH_TYPE_BOOK)) 38 #define DH_IS_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DH_TYPE_BOOK)) 39 #define DH_BOOK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DH_TYPE_BOOK, DhBookClass)) 40 41 struct _DhBook { 42 GObject parent_instance; 43 }; 44 45 struct _DhBookClass { 46 GObjectClass parent_class; 47 }; 48 49 GType dh_book_get_type (void) G_GNUC_CONST; 50 DhBook *dh_book_new (const gchar *book_path); 51 GList *dh_book_get_keywords (DhBook *book); 52 GNode *dh_book_get_tree (DhBook *book); 53 const gchar *dh_book_get_name (DhBook *book); 54 const gchar *dh_book_get_title (DhBook *book); 55 gboolean dh_book_get_enabled (DhBook *book); 56 void dh_book_set_enabled (DhBook *book, 57 gboolean enabled); 58 gint dh_book_cmp_by_path (const DhBook *a, 59 const DhBook *b); 60 gint dh_book_cmp_by_name (const DhBook *a, 61 const DhBook *b); 62 gint dh_book_cmp_by_title (const DhBook *a, 63 const DhBook *b); 64 65 G_END_DECLS 66 67 #endif /* _DH_BOOK_H_ */ 68