summaryrefslogtreecommitdiffstats
path: root/src/document-undo.h
blob: 85b44d5621d4158c285e1c0e3c96c37737fe9452 (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
#ifndef SEEN_SP_DOCUMENT_UNDO_H
#define SEEN_SP_DOCUMENT_UNDO_H

namespace Glib {
    class ustring;
}

typedef struct _GObject GObject;

class SPDesktop;
class SPDocument;
struct InkscapeApplication;

namespace Inkscape {

class DocumentUndo
{
public:

    /**
     * Set undo sensitivity.
     *
     * \note
     *   Since undo sensitivity needs to be nested, setting undo sensitivity
     *   should be done like this:
     *\verbatim
     bool saved = DocumentUndo::getUndoSensitive(document);
     DocumentUndo::setUndoSensitive(document, false);
     ... do stuff ...
     DocumentUndo::setUndoSensitive(document, saved);  \endverbatim
    */
    static void setUndoSensitive(SPDocument *doc, bool sensitive);

    static bool getUndoSensitive(SPDocument const *document);

    static void clearUndo(SPDocument *document);

    static void clearRedo(SPDocument *document);

    static void done(SPDocument *document, unsigned int event_type, Glib::ustring const &event_description);

    static void maybeDone(SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring const &event_description);

    static void resetKey(SPDocument *doc);

    static void cancel(SPDocument *document);

    static gboolean undo(SPDocument *document);

    static gboolean redo(SPDocument *document);
};

} // namespace Inkscape

#endif // SEEN_SP_DOCUMENT_UNDO_H

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :