2008-05-05 Paolo Borelli <pborelli@katamail.com>
[nautilus.git] / libnautilus-extension / nautilus-menu.h
blobd1511bd1d7918d7a70bb2ef273e79990678ee598
1 /*
2 * nautilus-menu.h - Menus exported by NautilusMenuProvider objects.
4 * Copyright (C) 2005 Raffaele Sandrini
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>
22 * Raffaele Sandrini <rasa@gmx.ch>
26 #ifndef NAUTILUS_MENU_H
27 #define NAUTILUS_MENU_H
29 #include <glib-object.h>
30 #include "nautilus-extension-types.h"
33 G_BEGIN_DECLS
35 /* NautilusMenu defines */
36 #define NAUTILUS_TYPE_MENU (nautilus_menu_get_type ())
37 #define NAUTILUS_MENU(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NAUTILUS_TYPE_MENU, NautilusMenu))
38 #define NAUTILUS_MENU_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NAUTILUS_TYPE_MENU, NautilusMenuClass))
39 #define NAUTILUS_IS_MENU(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAUTILUS_TYPE_MENU))
40 #define NAUTILUS_IS_MENU_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NAUTILUS_TYPE_MENU))
41 #define NAUTILUS_MENU_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NAUTILUS_TYPE_MENU, NautilusMenuClass))
42 /* NautilusMenuItem defines */
43 #define NAUTILUS_TYPE_MENU_ITEM (nautilus_menu_item_get_type())
44 #define NAUTILUS_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_MENU_ITEM, NautilusMenuItem))
45 #define NAUTILUS_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_MENU_ITEM, NautilusMenuItemClass))
46 #define NAUTILUS_MENU_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_MENU_ITEM))
47 #define NAUTILUS_MENU_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NAUTILUS_TYPE_MENU_ITEM))
48 #define NAUTILUS_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), NAUTILUS_TYPE_MENU_ITEM, NautilusMenuItemClass))
51 /* NautilusMenu types */
52 typedef struct _NautilusMenu NautilusMenu;
53 typedef struct _NautilusMenuPrivate NautilusMenuPrivate;
54 typedef struct _NautilusMenuClass NautilusMenuClass;
55 /* NautilusMenuItem types */
56 typedef struct _NautilusMenuItem NautilusMenuItem;
57 typedef struct _NautilusMenuItemDetails NautilusMenuItemDetails;
58 typedef struct _NautilusMenuItemClass NautilusMenuItemClass;
61 /* NautilusMenu structs */
62 struct _NautilusMenu {
63 GObject parent;
64 NautilusMenuPrivate *private;
67 struct _NautilusMenuClass {
68 GObjectClass parent_class;
71 /* NautilusMenuItem structs */
72 struct _NautilusMenuItem {
73 GObject parent;
75 NautilusMenuItemDetails *details;
78 struct _NautilusMenuItemClass {
79 GObjectClass parent;
81 void (*activate) (NautilusMenuItem *item);
85 /* NautilusMenu methods */
86 GType nautilus_menu_get_type (void);
87 NautilusMenu * nautilus_menu_new (void);
89 void nautilus_menu_append_item (NautilusMenu *this,
90 NautilusMenuItem *item);
91 GList* nautilus_menu_get_items (NautilusMenu *this);
92 void nautilus_menu_item_list_free (GList *item_list);
94 /* NautilusMenuItem methods */
95 GType nautilus_menu_item_get_type (void);
96 NautilusMenuItem *nautilus_menu_item_new (const char *name,
97 const char *label,
98 const char *tip,
99 const char *icon);
101 void nautilus_menu_item_activate (NautilusMenuItem *item);
102 void nautilus_menu_item_set_submenu (NautilusMenuItem *item,
103 NautilusMenu *menu);
104 /* NautilusMenuItem has the following properties:
105 * name (string) - the identifier for the menu item
106 * label (string) - the user-visible label of the menu item
107 * tip (string) - the tooltip of the menu item
108 * icon (string) - the name of the icon to display in the menu item
109 * sensitive (boolean) - whether the menu item is sensitive or not
110 * priority (boolean) - used for toolbar items, whether to show priority
111 * text.
112 * menu (NautilusMenu) - The menu belonging to this item. May be null.
115 G_END_DECLS
117 #endif /* NAUTILUS_MENU_H */