lock.h
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 <qstring.h>
00025 #include <qobject.h>
00026 
00027 namespace KABC {
00028 
00033 class Lock : public QObject
00034 {
00035     Q_OBJECT
00036   public:
00043     Lock( const QString &identifier );
00044 
00048     ~Lock();
00049 
00053     virtual bool lock();
00054     
00058     virtual bool unlock();
00059 
00060     virtual QString error() const;
00061 
00062     QString lockFileName() const;
00063 
00064     static bool readLockFile( const QString &filename, int &pid, QString &app );
00065     static bool writeLockFile( const QString &filename );
00066 
00067     static QString locksDir();
00068 
00069   signals:
00070     void locked();
00071     void unlocked();
00072 
00073   private:
00074     QString mIdentifier;
00075     
00076     QString mLockUniqueName;
00077 
00078     QString mError;
00079 
00080     class Private;
00081     Private *d;
00082 };
00083 
00084 }
00085 
00086 #endif
 
This file is part of the documentation for kabc Library Version 3.2.0.