summaryrefslogtreecommitdiff
path: root/src/nautilus-file-undo-manager.h
blob: a5e21d796ae6bb4e95036f283497f91165694e72 (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

/* nautilus-file-undo-manager.h - Manages the undo/redo stack
 *
 * Copyright (C) 2007-2011 Amos Brocco
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU 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
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Amos Brocco <amos.brocco@gmail.com>
 */

#ifndef __NAUTILUS_FILE_UNDO_MANAGER_H__
#define __NAUTILUS_FILE_UNDO_MANAGER_H__

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>

#include "nautilus-file-undo-operations.h"

typedef struct _NautilusFileUndoManager NautilusFileUndoManager;
typedef struct _NautilusFileUndoManagerClass NautilusFileUndoManagerClass;
typedef struct _NautilusFileUndoManagerPrivate NautilusFileUndoManagerPrivate;

#define NAUTILUS_TYPE_FILE_UNDO_MANAGER\
	(nautilus_file_undo_manager_get_type())
#define NAUTILUS_FILE_UNDO_MANAGER(object)\
	(G_TYPE_CHECK_INSTANCE_CAST((object), NAUTILUS_TYPE_FILE_UNDO_MANAGER,\
				    NautilusFileUndoManager))
#define NAUTILUS_FILE_UNDO_MANAGER_CLASS(klass)\
	(G_TYPE_CHECK_CLASS_CAST((klass), NAUTILUS_TYPE_FILE_UNDO_MANAGER,\
				 NautilusFileUndoManagerClass))
#define NAUTILUS_IS_FILE_UNDO_MANAGER(object)\
	(G_TYPE_CHECK_INSTANCE_TYPE((object), NAUTILUS_TYPE_FILE_UNDO_MANAGER))
#define NAUTILUS_IS_FILE_UNDO_MANAGER_CLASS(klass)\
	(G_TYPE_CHECK_CLASS_TYPE((klass), NAUTILUS_TYPE_FILE_UNDO_MANAGER))
#define NAUTILUS_FILE_UNDO_MANAGER_GET_CLASS(object)\
	(G_TYPE_INSTANCE_GET_CLASS((object), NAUTILUS_TYPE_FILE_UNDO_MANAGER,\
				   NautilusFileUndoManagerClass))

typedef enum {
	NAUTILUS_FILE_UNDO_MANAGER_STATE_NONE,
	NAUTILUS_FILE_UNDO_MANAGER_STATE_UNDO,
	NAUTILUS_FILE_UNDO_MANAGER_STATE_REDO
} NautilusFileUndoManagerState;

struct _NautilusFileUndoManager {
	GObject parent_instance;

	/* < private > */
	NautilusFileUndoManagerPrivate* priv;
};

struct _NautilusFileUndoManagerClass {
	GObjectClass parent_class;
};

GType nautilus_file_undo_manager_get_type (void) G_GNUC_CONST;

NautilusFileUndoManager * nautilus_file_undo_manager_get (void);

void nautilus_file_undo_manager_set_action (NautilusFileUndoInfo *info);
NautilusFileUndoInfo *nautilus_file_undo_manager_get_action (void);

NautilusFileUndoManagerState nautilus_file_undo_manager_get_state (void);

void nautilus_file_undo_manager_undo (GtkWindow *parent_window);
void nautilus_file_undo_manager_redo (GtkWindow *parent_window);

gboolean nautilus_file_undo_manager_is_operating (void);

#endif /* __NAUTILUS_FILE_UNDO_MANAGER_H__ */