1 /*
2  * gnc-dense-cal-model.h
3  *
4  * Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 and/or version 3 of the GNU General Public License as
8  * published by the Free Software Foundation.
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, contact:
17  *
18  * Free Software Foundation           Voice:  +1-617-542-5942
19  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
20  * Boston, MA  02110-1301,  USA       gnu@gnu.org
21  */
22 
23 #ifndef _GNC_DENSE_CAL_MODEL_H
24 #define _GNC_DENSE_CAL_MODEL_H
25 
26 #include <config.h>
27 #include <glib.h>
28 #include <glib-object.h>
29 
30 G_BEGIN_DECLS
31 
32 #define GNC_TYPE_DENSE_CAL_MODEL (gnc_dense_cal_model_get_type())
33 #define GNC_DENSE_CAL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_DENSE_CAL_MODEL, GncDenseCalModel))
34 #define GNC_IS_DENSE_CAL_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_DENSE_CAL_MODEL))
35 #define GNC_DENSE_CAL_MODEL_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GNC_TYPE_DENSE_CAL_MODEL, GncDenseCalModelIface))
36 
37 typedef struct _GncDenseCalModel GncDenseCalModel; /* non existent */
38 typedef struct _GncDenseCalModelIface
39 {
40     GTypeInterface parent;
41 
42     /* signals */
43     void (*insert)(GncDenseCalModel *mdl, gint tag);
44     void (*update)(GncDenseCalModel *mdl, gint tag);
45     void (*remove)(GncDenseCalModel *mdl, gint tag);
46 
47     /* virtual table */
48     GList* (*get_contained)(GncDenseCalModel *model);
49     gchar* (*get_name)(GncDenseCalModel *model, guint tag);
50     gchar* (*get_info)(GncDenseCalModel *model, guint tag);
51     gint (*get_instance_count)(GncDenseCalModel *model, guint tag);
52     void (*get_instance)(GncDenseCalModel *model, guint tag, gint instance_index, GDate *date);
53 } GncDenseCalModelIface;
54 
55 GType gnc_dense_cal_model_get_type(void);
56 
57 /** @return Caller-owned GList (but not elements).  The Model-user will free. **/
58 GList* gnc_dense_cal_model_get_contained(GncDenseCalModel *model);
59 gchar* gnc_dense_cal_model_get_name(GncDenseCalModel *model, guint tag);
60 gchar* gnc_dense_cal_model_get_info(GncDenseCalModel *model, guint tag);
61 gint gnc_dense_cal_model_get_instance_count(GncDenseCalModel *model, guint tag);
62 void gnc_dense_cal_model_get_instance(GncDenseCalModel *model, guint tag, gint instance_index, GDate *date);
63 
64 G_END_DECLS
65 
66 #endif // _GNC_DENSE_CAL_MODEL_H
67