2 * nautilus-menu-provider.h - Interface for Nautilus extensions that
3 * provide context menu items.
5 * Copyright (C) 2003 Novell, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the Free
19 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Author: Dave Camp <dave@ximian.com>
25 /* This interface is implemented by Nautilus extensions that want to
26 * add context menu entries to files. Extensions are called when
27 * Nautilus constructs the context menu for a file. They are passed a
28 * list of NautilusFileInfo objects which holds the current selection */
30 #ifndef NAUTILUS_MENU_PROVIDER_H
31 #define NAUTILUS_MENU_PROVIDER_H
33 #include <glib-object.h>
34 #include <gtk/gtkwidget.h>
35 #include "nautilus-extension-types.h"
36 #include "nautilus-file-info.h"
37 #include "nautilus-menu.h"
41 #define NAUTILUS_TYPE_MENU_PROVIDER (nautilus_menu_provider_get_type ())
42 #define NAUTILUS_MENU_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_MENU_PROVIDER, NautilusMenuProvider))
43 #define NAUTILUS_IS_MENU_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_MENU_PROVIDER))
44 #define NAUTILUS_MENU_PROVIDER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NAUTILUS_TYPE_MENU_PROVIDER, NautilusMenuProviderIface))
46 typedef struct _NautilusMenuProvider NautilusMenuProvider
;
47 typedef struct _NautilusMenuProviderIface NautilusMenuProviderIface
;
49 struct _NautilusMenuProviderIface
{
50 GTypeInterface g_iface
;
52 GList
*(*get_file_items
) (NautilusMenuProvider
*provider
,
55 GList
*(*get_background_items
) (NautilusMenuProvider
*provider
,
57 NautilusFileInfo
*current_folder
);
58 GList
*(*get_toolbar_items
) (NautilusMenuProvider
*provider
,
60 NautilusFileInfo
*current_folder
);
63 /* Interface Functions */
64 GType
nautilus_menu_provider_get_type (void);
65 GList
*nautilus_menu_provider_get_file_items (NautilusMenuProvider
*provider
,
68 GList
*nautilus_menu_provider_get_background_items (NautilusMenuProvider
*provider
,
70 NautilusFileInfo
*current_folder
);
71 GList
*nautilus_menu_provider_get_toolbar_items (NautilusMenuProvider
*provider
,
73 NautilusFileInfo
*current_folder
);
75 /* This function emit a signal to inform nautilus that its item list has changed. */
76 void nautilus_menu_provider_emit_items_updated_signal (NautilusMenuProvider
*provider
);