summaryrefslogtreecommitdiff
path: root/capplets/file-types/model-entry.h
blob: 1d4ba6a42c21586a4abc78a801706bb43c8fbf87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* -*- mode: c; style: linux -*- */

/* model-entry.h
 *
 * Copyright (C) 2002 Ximian, Inc.
 *
 * Written by Bradford Hovinen <hovinen@ximian.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
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __MODEL_ENTRY_H
#define __MODEL_ENTRY_H

#include <gnome.h>

G_BEGIN_DECLS

typedef struct _ModelEntry ModelEntry;

typedef enum {
	MODEL_ENTRY_NONE, MODEL_ENTRY_CATEGORY, MODEL_ENTRY_SERVICES_CATEGORY,
	MODEL_ENTRY_MIME_TYPE, MODEL_ENTRY_SERVICE
} ModelEntryType;

#define MODEL_ENTRY(obj) ((ModelEntry *) obj)

struct _ModelEntry
{
	ModelEntryType      type;

	struct _ModelEntry *next;
	struct _ModelEntry *parent;
	struct _ModelEntry *first_child;
};

ModelEntry *get_model_entries         (GtkTreeModel *model);

ModelEntry *model_entry_get_nth_child (ModelEntry *entry,
			               gint        n,
				       gboolean    categories_only);

gint        model_entry_get_index     (ModelEntry *parent,
				       ModelEntry *child);

void        model_entry_insert_child  (ModelEntry *entry,
				       ModelEntry *child,
				       GtkTreeModel *model);
void        model_entry_remove_child  (ModelEntry *entry,
				       ModelEntry *child,
				       GtkTreeModel *model);

void        model_entry_save          (ModelEntry *entry);
void        model_entry_delete        (ModelEntry *entry);

G_END_DECLS

#endif /* __MODEL_ENTRY_H */