vdk 2.4.0
gtkundomanager.h
1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * gtkundomanager.h
4 * This file is part of gtksourceview, but copied from gtk
5 *
6 * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence
7 * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330,
22 * Boston, MA 02111-1307, USA. * *
23 */
24
25/*
26 * Modified by the gtk Team, 1998-2001. See the AUTHORS file for a
27 * list of people on the gtk Team.
28 * See the ChangeLog files for a list of changes.
29 */
30
31#ifndef __GTK_UNDO_MANAGER_H__
32#define __GTK_UNDO_MANAGER_H__
33
34#include <vdk/gtksourcebuffer.h>
35
36G_BEGIN_DECLS
37
38#define GTK_TYPE_UNDO_MANAGER (gtk_undo_manager_get_type ())
39#define GTK_UNDO_MANAGER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_UNDO_MANAGER, GtkUndoManager))
40#define GTK_UNDO_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_UNDO_MANAGER, GtkUndoManagerClass))
41#define GTK_IS_UNDO_MANAGER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_UNDO_MANAGER))
42#define GTK_IS_UNDO_MANAGER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_UNDO_MANAGER))
43#define GTK_UNDO_MANAGER_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_UNDO_MANAGER, GtkUndoManagerClass))
44
45typedef struct _GtkUndoManager GtkUndoManager;
46typedef struct _GtkUndoManagerClass GtkUndoManagerClass;
47typedef struct _GtkUndoManagerPrivate GtkUndoManagerPrivate;
48
49struct _GtkUndoManager {
50 GObject base;
51
52 GtkUndoManagerPrivate *priv;
53};
54
55struct _GtkUndoManagerClass {
56 GObjectClass parent_class;
57
58 /* Signals */
59 void (*can_undo) (GtkUndoManager *um, gboolean can_undo);
60 void (*can_redo) (GtkUndoManager *um, gboolean can_redo);
61};
62
63GType gtk_undo_manager_get_type (void) G_GNUC_CONST;
64
65GtkUndoManager *gtk_undo_manager_new (GtkSourceBuffer *buffer);
66
67gboolean gtk_undo_manager_can_undo (const GtkUndoManager *um);
68gboolean gtk_undo_manager_can_redo (const GtkUndoManager *um);
69
70void gtk_undo_manager_undo (GtkUndoManager *um);
71void gtk_undo_manager_redo (GtkUndoManager *um);
72
73int gtk_undo_manager_get_undo_levels (GtkUndoManager *um);
74void gtk_undo_manager_set_undo_levels (GtkUndoManager *um,
75 int undo_levels);
76
77void gtk_undo_manager_begin_not_undoable_action (GtkUndoManager *um);
78void gtk_undo_manager_end_not_undoable_action (GtkUndoManager *um);
79
80G_END_DECLS
81
82#endif /* __GTK_UNDO_MANAGER_H__ */