kabc Library API Documentation

resourcedir.h

00001 /* 00002 This file is part of libkabc. 00003 Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef KABC_RESOURCEDIR_H 00022 #define KABC_RESOURCEDIR_H 00023 00024 #include <kconfig.h> 00025 #include <kdirwatch.h> 00026 00027 #include <sys/types.h> 00028 00029 #include <kabc/resource.h> 00030 00031 class QTimer; 00032 00033 namespace KABC { 00034 00035 class FormatPlugin; 00036 class Lock; 00037 00041 class ResourceDir : public Resource 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 ResourceDir( const KConfig* ); 00047 ResourceDir( const QString &path, const QString &type = "vcard" ); 00048 ~ResourceDir(); 00049 00050 virtual void writeConfig( KConfig* ); 00051 00052 virtual bool doOpen(); 00053 virtual void doClose(); 00054 00055 virtual Ticket *requestSaveTicket(); 00056 virtual void releaseSaveTicket( Ticket* ); 00057 00058 virtual bool load(); 00059 virtual bool asyncLoad(); 00060 virtual bool save( Ticket * ); 00061 virtual bool asyncSave( Ticket * ); 00062 00066 void setPath( const QString & ); 00067 00071 QString path() const; 00072 00076 void setFormat( const QString &format ); 00077 00081 QString format() const; 00082 00087 virtual void removeAddressee( const Addressee& addr ); 00088 00089 protected slots: 00090 void pathChanged(); 00091 00092 protected: 00093 void init( const QString &path, const QString &format ); 00094 00095 private: 00096 FormatPlugin *mFormat; 00097 00098 KDirWatch mDirWatch; 00099 00100 QString mPath; 00101 QString mFormatName; 00102 00103 Lock *mLock; 00104 00105 bool mAsynchronous; 00106 00107 class ResourceDirPrivate; 00108 ResourceDirPrivate *d; 00109 }; 00110 00111 } 00112 00113 #endif
KDE Logo
This file is part of the documentation for kabc Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 10 18:56:01 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003