Update copyright message
[nautilus-actions.git] / src / nact / nact-tree-model.h
blobd6e80225874f00e006bbddcb652d43d99b0d2fa6
1 /*
2 * Nautilus Actions
3 * A Nautilus extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 /**
32 * SECTION: nact_tree_model
33 * @short_description: #NactTreeModel class definition.
34 * @include: nact/nact-tree-model.h
36 * NactTreeModel is derived from GtkTreeModelFilter in order to be able
37 * to selectively display profiles, whether an action has one or more
38 * profiles.
40 * NactTreeModel implements EggTreeMultiDragSource and GtkTreeDragDest
41 * interfaces.
43 * The GtkTreeModelFilter base class embeds a GtkTreeStore.
45 #ifndef __NACT_TREE_MODEL_H__
46 #define __NACT_TREE_MODEL_H__
48 #include <gtk/gtk.h>
50 #include <api/na-object.h>
52 #include "base-window.h"
54 G_BEGIN_DECLS
56 #define NACT_TREE_MODEL_TYPE ( nact_tree_model_get_type())
57 #define NACT_TREE_MODEL( object ) ( G_TYPE_CHECK_INSTANCE_CAST(( object ), NACT_TREE_MODEL_TYPE, NactTreeModel ))
58 #define NACT_TREE_MODEL_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST(( klass ), NACT_TREE_MODEL_TYPE, NactTreeModelClass ))
59 #define NACT_IS_TREE_MODEL( object ) ( G_TYPE_CHECK_INSTANCE_TYPE(( object ), NACT_TREE_MODEL_TYPE ))
60 #define NACT_IS_TREE_MODEL_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NACT_TREE_MODEL_TYPE ))
61 #define NACT_TREE_MODEL_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NACT_TREE_MODEL_TYPE, NactTreeModelClass ))
63 typedef struct NactTreeModelPrivate NactTreeModelPrivate;
65 typedef struct {
66 GtkTreeModelFilter parent;
67 NactTreeModelPrivate *private;
69 NactTreeModel;
71 typedef struct NactTreeModelClassPrivate NactTreeModelClassPrivate;
73 typedef struct {
74 GtkTreeModelFilterClass parent;
75 NactTreeModelClassPrivate *private;
77 NactTreeModelClass;
79 /* column ordering of the tree view
81 enum {
82 IACTIONS_LIST_ICON_COLUMN = 0,
83 IACTIONS_LIST_LABEL_COLUMN,
84 IACTIONS_LIST_NAOBJECT_COLUMN,
85 IACTIONS_LIST_N_COLUMN
88 /* iter on tree store
90 typedef gboolean ( *FnIterOnStore )( NactTreeModel *, GtkTreePath *, NAObject *, gpointer );
92 GType nact_tree_model_get_type( void );
94 void nact_tree_model_initial_load( BaseWindow *window, GtkTreeView *treeview );
95 void nact_tree_model_runtime_init( NactTreeModel *model, gboolean have_dnd );
96 void nact_tree_model_dispose( NactTreeModel *model );
98 void nact_tree_model_display( NactTreeModel *model, NAObject *object );
99 void nact_tree_model_display_order_change( NactTreeModel *model, gint order_mode );
100 void nact_tree_model_dump( NactTreeModel *model );
101 void nact_tree_model_fill( NactTreeModel *model, GList *items, gboolean are_profiles_displayed );
102 GtkTreePath *nact_tree_model_insert( NactTreeModel *model, const NAObject *object, GtkTreePath *path, NAObject **parent );
103 GtkTreePath *nact_tree_model_insert_into( NactTreeModel *model, const NAObject *object, GtkTreePath *path, NAObject **parent );
104 void nact_tree_model_iter( NactTreeModel *model, FnIterOnStore fn, gpointer user_data );
105 NAObject *nact_tree_model_object_at_path( NactTreeModel *model, GtkTreePath *path );
106 GtkTreePath *nact_tree_model_remove( NactTreeModel *model, NAObject *object );
108 G_END_DECLS
110 #endif /* __NACT_TREE_MODEL_H__ */