summaryrefslogtreecommitdiff
path: root/libnautilus/nautilus-distributed-undo.idl
blob: 5a68056e0c55e1263218e84f4639e303f7c08076 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */

/* nautilus-undo.idl - Interface for view components that
 *                     support undo, used internally by the
 *                     undo support classes.
 *
 * Copyright (C) 2000 Eazel, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef NAUTILUS_UNDO_IDL_INCLUDED
#define NAUTILUS_UNDO_IDL_INCLUDED

#include <Bonobo.idl>

module Nautilus {

	module Undo {

		/* The specifications for a menu item. */
		struct MenuItem {
			string label;
			string hint;
		};

		/* A single undoable operation is represented by a
		 * transaction.  This is the interface a transaction
		 * must supply for use by an undo manager.
		 */
		interface Transaction : ::Bonobo::Unknown {
			/* These menu items are used to display undo
			 * or redo menu items for this transaction.
			 * The operation name is for lists of undoable
			 * operations that are listed somewhere other
			 * than an undo or redo object.
			 */
			readonly attribute MenuItem undo_menu_item;
			readonly attribute MenuItem redo_menu_item;
			readonly attribute string operation_name;

			/* Here's how you actually perform an undo.
			 * Once it's performed, calling this again is
			 * safe; it's guaranteed to do nothing.
			 */
			void undo ();
		};

		/* An undo manager deals with a list of transactions
		 * for a particular application or window. This is the
		 * interface of the manager from the transaction's
		 * point of view only.
		 */
		interface Manager : ::Bonobo::Unknown {
			/* Add a new transaction. This is normally called
			 * by the code that creates the transaction.
			 */
			void append (in Transaction transaction);

			/* Forget a transaction. This is typically called
			 * when the operation that the transaction does
			 * undo for no longer makes sense.
			 */
			void forget (in Transaction transaction);

			/* Sometimes an undo has to be "forced" from the
			 * client side when it recognizes an undo key
			 * equivalent.
			 */
			void undo ();

			/* FIXME bugzilla.gnome.org 41292: 
			 * We may need additional interface so the
			 * client can include an appropriate undo item in
			 * a contextual menu.
			 */
		};

		/* To locate the appropriate manager, a view component
		 * can query for this interface on its Bonobo control
		 * frame.  This is done automatically by functions in
		 * the undo manager.
		 */
		interface Context : ::Bonobo::Unknown {
			readonly attribute Manager undo_manager;
		};
	};
};

#endif /* NAUTILUS_UNDO_IDL_INCLUDED */