]> git.sven.stormbind.net Git - sven/vym.git/blobdiff - src/vymlock.h
New upstream version 2.9.22
[sven/vym.git] / src / vymlock.h
diff --git a/src/vymlock.h b/src/vymlock.h
new file mode 100644 (file)
index 0000000..c32a2a9
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef VYMLOCK_H
+#define VYMLOCK_H
+
+extern bool debug;
+
+class VymLock {
+  public:
+    enum LockState { Undefined, LockedByMyself, LockedByOther, NotWritable };
+    void operator==(const VymLock &);
+    VymLock();
+    VymLock(const QString &fn);
+    ~VymLock();
+    void init();
+    bool tryLock();
+    LockState getState();
+    bool releaseLock();
+    bool removeLockForced();
+    void setAuthor(const QString &s);
+    QString getAuthor();
+    void setHost(const QString &s);
+    QString getHost();
+    void setMapPath(const QString &path);
+    QString getMapPath();
+
+  private:
+    QString author;
+    QString host;
+    QString mapPath;
+    QString lockPath;
+    LockState state;
+};
+
+#endif