Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / document-undo.h
index 9fc49b112c5e1bcff3b3920f1d2de949eef73253..9be260fa227646c15821961dee186b2a78454140 100644 (file)
@@ -1,14 +1,57 @@
-class SPDocumentUndo
+#ifndef SEEN_SP_DOCUMENT_UNDO_H
+#define SEEN_SP_DOCUMENT_UNDO_H
+
+
+namespace Inkscape {
+
+class DocumentUndo
 {
-       public:
-               static void set_undo_sensitive(SPDocument *doc, bool sensitive);
-               static bool get_undo_sensitive(SPDocument const *document);
-               static void clear_undo(SPDocument *document);
-               static void clear_redo(SPDocument *document);
-               static void done(SPDocument *document, unsigned int event_type, Glib::ustring event_description);
-               static void maybe_done(SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description);
-               static void reset_key(Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base);
-               static void cancel(SPDocument *document);
-               static gboolean undo(SPDocument *document);
-               static gboolean redo(SPDocument *document);
+public:
+
+    /**
+     * Set undo sensitivity.
+     *
+     * \note
+     *   Since undo sensitivity needs to be nested, setting undo sensitivity
+     *   should be done like this:
+     *\verbatim
+     bool saved = sp_document_get_undo_sensitive(document);
+     sp_document_set_undo_sensitive(document, false);
+     ... do stuff ...
+     sp_document_set_undo_sensitive(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(Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base);
+
+    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 :