summaryrefslogtreecommitdiffstats
path: root/src/auto-save.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/auto-save.h')
-rw-r--r--src/auto-save.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/auto-save.h b/src/auto-save.h
new file mode 100644
index 0000000..83cc27d
--- /dev/null
+++ b/src/auto-save.h
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Auto-save
+ *
+ * Copyright (C) 2020 Tavmjong Bah
+ *
+ * Re-write of code formerly in inkscape.cpp and originally written by Jon Cruz and others.
+ *
+ * The contents of this file may be used under the GNU General Public License Version 2 or later.
+ *
+ */
+
+#ifndef INKSCAPE_AUTOSAVE_H
+#define INKSCAPE_AUTOSAVE_H
+
+class InkscapeApplication;
+
+namespace Inkscape {
+
+class AutoSave {
+private:
+ AutoSave() = default;
+
+public:
+ AutoSave(const AutoSave &) = delete;
+ AutoSave &operator=(const AutoSave &) = delete;
+ AutoSave(AutoSave &&) = delete;
+ AutoSave &operator=(AutoSave &&) = delete;
+
+ static AutoSave &getInstance()
+ {
+ static AutoSave theInstance;
+ return theInstance;
+ }
+
+ static void restart();
+ void init(InkscapeApplication *app);
+ void start(); // Includes restarting.
+ bool save();
+
+private:
+ InkscapeApplication* _app = nullptr;
+};
+
+} // namespace Inkscape
+
+#endif // INKSCAPE_AUTOSAVE_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 :