00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_LOCK_H
00022 #define KABC_LOCK_H
00023
00024 #include "kabc_export.h"
00025 #include <QtCore/QString>
00026 #include <QtCore/QObject>
00027
00028 namespace KABC {
00029
00034 class KABC_EXPORT_DEPRECATED Lock : public QObject
00035 {
00036 Q_OBJECT
00037 public:
00044 Lock( const QString &identifier );
00045
00049 ~Lock();
00050
00054 virtual bool lock();
00055
00059 virtual bool unlock();
00060
00064 virtual QString error() const;
00065
00072 QString lockFileName() const;
00073
00085 static bool readLockFile( const QString &filename, int &pid, QString &app );
00086
00095 static bool writeLockFile( const QString &filename );
00096
00100 static QString locksDir();
00101
00102 Q_SIGNALS:
00106 void locked();
00110 void unlocked();
00111
00112 private:
00113 class Private;
00114 Private *const d;
00115 };
00116
00117 }
00118
00119 #endif