2008-04-30 A. Walton <awalton@gnome.org>
[nautilus.git] / libnautilus-private / nautilus-undo-manager.h
blob0e8b9ac389ffd024ea807094b9fb0ba84c429ce1
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
3 /* NautilusUndoManager - Manages undo and redo transactions.
4 * This is the public interface used by the application.
6 * Copyright (C) 2000 Eazel, Inc.
8 * Author: Gene Z. Ragan <gzr@eazel.com>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the
22 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 * Boston, MA 02111-1307, USA.
26 #ifndef NAUTILUS_UNDO_MANAGER_H
27 #define NAUTILUS_UNDO_MANAGER_H
29 #include <bonobo/bonobo-object.h>
30 #include <libnautilus-private/nautilus-undo.h>
32 #define NAUTILUS_TYPE_UNDO_MANAGER \
33 (nautilus_undo_manager_get_type ())
34 #define NAUTILUS_UNDO_MANAGER(obj) \
35 (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_UNDO_MANAGER, NautilusUndoManager))
36 #define NAUTILUS_UNDO_MANAGER_CLASS(klass) \
37 (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_UNDO_MANAGER, NautilusUndoManagerClass))
38 #define NAUTILUS_IS_UNDO_MANAGER(obj) \
39 (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_UNDO_MANAGER))
40 #define NAUTILUS_IS_UNDO_MANAGER_CLASS(klass) \
41 (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_UNDO_MANAGER))
43 typedef struct NautilusUndoManagerDetails NautilusUndoManagerDetails;
45 typedef struct {
46 GObject parent;
47 NautilusUndoManagerDetails *details;
48 } NautilusUndoManager;
50 typedef struct {
51 GObjectClass parent_slot;
52 void (* changed) (GObject *object, gpointer data);
53 } NautilusUndoManagerClass;
55 GType nautilus_undo_manager_get_type (void);
56 NautilusUndoManager *nautilus_undo_manager_new (void);
58 /* Undo operations. */
59 void nautilus_undo_manager_undo (NautilusUndoManager *undo_manager);
61 #ifdef UIH
62 /* Connect the manager to a particular menu item. */
63 void nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *manager,
64 BonoboUIHandler *handler,
65 const char *path,
66 const char *no_undo_menu_item_label,
67 const char *no_undo_menu_item_hint);
69 #endif
71 /* Attach the undo manager to a Gtk object so that object and the widgets inside it can participate in undo. */
72 void nautilus_undo_manager_attach (NautilusUndoManager *manager,
73 GObject *object);
75 void nautilus_undo_manager_append (NautilusUndoManager *manager,
76 NautilusUndoTransaction *transaction);
77 void nautilus_undo_manager_forget (NautilusUndoManager *manager,
78 NautilusUndoTransaction *transaction);
80 #endif /* NAUTILUS_UNDO_MANAGER_H */