planner-list-model.h 3.29 KB
Newer Older
Richard Hult's avatar
Richard Hult committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2002 CodeFactory AB
 * Copyright (C) 2002 Richard Hult <richard@imendio.com>
 * Copyright (C) 2002 Mikael Hallendal <micke@imendio.com>
 * Copyright (C) 2002 Alvaro del Castillo <acs@barrapunto.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
Josué Abarca's avatar
Josué Abarca committed
20 21
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Richard Hult's avatar
Richard Hult committed
22 23
 */

Richard Hult's avatar
Richard Hult committed
24 25
#ifndef __PLANNER_LIST_MODEL_H__
#define __PLANNER_LIST_MODEL_H__
Richard Hult's avatar
Richard Hult committed
26 27

#include <glib-object.h>
28
#include <gtk/gtk.h>
Richard Hult's avatar
Richard Hult committed
29 30
#include <libplanner/mrp-object.h>

Richard Hult's avatar
Richard Hult committed
31 32 33 34 35 36
#define PLANNER_TYPE_LIST_MODEL	          (planner_list_model_get_type ())
#define PLANNER_LIST_MODEL(obj)	          (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANNER_TYPE_LIST_MODEL, PlannerListModel))
#define PLANNER_LIST_MODEL_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), PLANNER_TYPE_LIST_MODEL, PlannerListModelClass))
#define PLANNER_IS_LIST_MODEL(obj)	          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANNER_TYPE_LIST_MODEL))
#define PLANNER_IS_LIST_MODEL_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), PLANNER_TYPE_LIST_MODEL))
#define PLANNER_LIST_MODEL_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), PLANNER_TYPE_LIST_MODEL, PlannerListModelClass))
Richard Hult's avatar
Richard Hult committed
37

Richard Hult's avatar
Richard Hult committed
38 39 40
typedef struct _PlannerListModel       PlannerListModel;
typedef struct _PlannerListModelClass  PlannerListModelClass;
typedef struct _PlannerListModelPriv   PlannerListModelPriv;
Richard Hult's avatar
Richard Hult committed
41

Richard Hult's avatar
Richard Hult committed
42
struct _PlannerListModel
Richard Hult's avatar
Richard Hult committed
43 44
{
        GObject          parent;
45

Richard Hult's avatar
Richard Hult committed
46
        PlannerListModelPriv *priv;
Richard Hult's avatar
Richard Hult committed
47 48
};

Richard Hult's avatar
Richard Hult committed
49
struct _PlannerListModelClass
Richard Hult's avatar
Richard Hult committed
50 51 52 53 54 55 56 57 58 59 60 61
{
	GObjectClass parent_class;

	gint  (*get_n_columns)   (GtkTreeModel *tree_model);
	GType (*get_column_type) (GtkTreeModel *tree_model,
				  gint          column);
	void  (*get_value)       (GtkTreeModel *tree_model,
				  GtkTreeIter  *iter,
				  gint          column,
				  GValue       *value);
};

62
GType            planner_list_model_get_type      (void) G_GNUC_CONST;
63
void             planner_list_model_append        (PlannerListModel      *model,
Richard Hult's avatar
Richard Hult committed
64
					      MrpObject        *object);
65
void             planner_list_model_remove        (PlannerListModel      *model,
Richard Hult's avatar
Richard Hult committed
66
					      MrpObject        *object);
Richard Hult's avatar
Richard Hult committed
67
void             planner_list_model_update        (PlannerListModel      *model,
Richard Hult's avatar
Richard Hult committed
68
					      MrpObject        *object);
Richard Hult's avatar
Richard Hult committed
69
GtkTreePath *    planner_list_model_get_path      (PlannerListModel      *model,
Richard Hult's avatar
Richard Hult committed
70
					      MrpObject        *object);
Richard Hult's avatar
Richard Hult committed
71
MrpObject *      planner_list_model_get_object    (PlannerListModel      *model,
Richard Hult's avatar
Richard Hult committed
72
					      GtkTreeIter      *iter);
Richard Hult's avatar
Richard Hult committed
73
void             planner_list_model_set_data      (PlannerListModel      *model,
Richard Hult's avatar
Richard Hult committed
74
					      GList            *data);
Richard Hult's avatar
Richard Hult committed
75
GList *          planner_list_model_get_data      (PlannerListModel      *model);
Richard Hult's avatar
Richard Hult committed
76

Richard Hult's avatar
Richard Hult committed
77
#endif /* __PLANNER_LIST_MODEL_H__ */