resourcefile.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_RESOURCEFILE_H
00022 #define KABC_RESOURCEFILE_H
00023
00024 #include <kconfig.h>
00025 #include <kdirwatch.h>
00026
00027 #include <sys/types.h>
00028
00029 #include "resource.h"
00030
00031 class QTimer;
00032
00033 namespace KABC {
00034
00035 class FormatPlugin;
00036 class ResourceConfigWidget;
00037
00041 class ResourceFile : public QObject, public Resource
00042 {
00043 Q_OBJECT
00044
00045 public:
00046
00053 ResourceFile( AddressBook *ab, const KConfig *cfg );
00054
00062 ResourceFile( AddressBook *ab, const QString &filename,
00063 FormatPlugin *format = 0 );
00064
00068 ~ResourceFile();
00069
00074 bool open();
00075
00079 void close();
00080
00084 Ticket *requestSaveTicket();
00085
00090 bool load();
00091
00098 bool save( Ticket *ticket );
00099
00103 void setFileName( const QString & );
00104
00108 QString fileName() const;
00109
00113 virtual QString identifier() const;
00114
00119 void removeAddressee( const Addressee& addr );
00120
00125 virtual void cleanUp();
00126
00127 protected slots:
00128 void fileChanged();
00129
00130 protected:
00131 bool lock( const QString &fileName );
00132 void unlock( const QString &fileName );
00133
00134 private:
00135 void init( const QString &filename, FormatPlugin *format );
00136
00137 QString mFileName;
00138 FormatPlugin *mFormat;
00139
00140 QString mLockUniqueName;
00141
00142 KDirWatch mDirWatch;
00143 };
00144
00145 }
00146 #endif
This file is part of the documentation for kdelibs Version 3.1.0.