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 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public 17 * License along with this program; if not, write to the 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 * Boston, MA 02111-1307, USA. 20 */ 21 22 #ifndef __DH_KEYWORD_MODEL_H__ 23 #define __DH_KEYWORD_MODEL_H__ 24 25 #include <gtk/gtk.h> 26 #include "dh-link.h" 27 #include "dh-book-manager.h" 28 29 G_BEGIN_DECLS 30 31 #define DH_TYPE_KEYWORD_MODEL (dh_keyword_model_get_type ()) 32 #define DH_KEYWORD_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DH_TYPE_KEYWORD_MODEL, DhKeywordModel)) 33 #define DH_KEYWORD_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DH_TYPE_KEYWORD_MODEL, DhKeywordModelClass)) 34 #define DH_IS_KEYWORD_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DH_TYPE_KEYWORD_MODEL)) 35 #define DH_IS_KEYWORD_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DH_TYPE_KEYWORD_MODEL)) 36 #define DH_KEYWORD_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DH_TYPE_KEYWORD_MODEL, DhKeywordModelClass)) 37 38 typedef struct _DhKeywordModel DhKeywordModel; 39 typedef struct _DhKeywordModelClass DhKeywordModelClass; 40 typedef struct _DhKeywordModelPriv DhKeywordModelPriv; 41 42 struct _DhKeywordModel 43 { 44 GObject parent_instance; 45 DhKeywordModelPriv *priv; 46 }; 47 48 struct _DhKeywordModelClass 49 { 50 GObjectClass parent_class; 51 }; 52 53 enum { 54 DH_KEYWORD_MODEL_COL_NAME, 55 DH_KEYWORD_MODEL_COL_LINK, 56 DH_KEYWORD_MODEL_NUM_COLS 57 }; 58 59 GType dh_keyword_model_get_type (void); 60 DhKeywordModel *dh_keyword_model_new (void); 61 void dh_keyword_model_set_words (DhKeywordModel *model, 62 DhBookManager *book_manager); 63 DhLink * dh_keyword_model_filter (DhKeywordModel *model, 64 const gchar *string, 65 const gchar *book_id); 66 67 G_END_DECLS 68 69 #endif /* __DH_KEYWORD_MODEL_H__ */ 70