00001
00022
00023
00024
00025
00026 #ifndef __SYNFIG_AUTORECOVER_H
00027 #define __SYNFIG_AUTORECOVER_H
00028
00029
00030
00031 #include <synfig/string.h>
00032 #include <synfig/canvas.h>
00033 #include <sigc++/connection.h>
00034
00035
00036
00037
00038
00039
00040
00041 namespace studio {
00042
00043 class AutoRecover
00044 {
00045 int timeout;
00046 sigc::connection auto_backup_connect;
00047 public:
00048 AutoRecover();
00049 ~AutoRecover();
00050
00051 static int pid();
00052 static synfig::String get_shadow_file_name(const synfig::String& filename);
00053
00054 static bool auto_backup();
00055
00056 static bool cleanup_pid(int pid);
00057
00058 void set_timeout(int milliseconds);
00059 int get_timeout()const { return timeout; }
00060
00061 static synfig::String get_shadow_directory();
00062
00063 bool recovery_needed()const;
00064 bool recover(int& number_recovered);
00065
00066 void normal_shutdown();
00067
00068 void clear_backup(synfig::Canvas::Handle canvas);
00069 };
00070
00071 };
00072
00073
00074
00075 #endif