resourcenet.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef KABC_RESOURCENET_H
00022 #define KABC_RESOURCENET_H
00023 
00024 #include <kconfig.h>
00025 
00026 #include <sys/types.h>
00027 
00028 #include <kabc/resource.h>
00029 
00030 class QTimer;
00031 class KTempFile;
00032 
00033 namespace KIO {
00034 class Job;
00035 }
00036 
00037 namespace KABC {
00038 
00039 class FormatPlugin;
00040 
00044 class ResourceNet : public Resource
00045 {
00046   Q_OBJECT
00047 
00048   public:
00049     ResourceNet( const KConfig* );
00050     ResourceNet( const KURL &url, const QString &format );
00051     ~ResourceNet();
00052 
00053     virtual void writeConfig( KConfig* );
00054 
00055     virtual bool doOpen();
00056     virtual void doClose();
00057   
00058     virtual Ticket *requestSaveTicket();
00059     virtual void releaseSaveTicket( Ticket* );
00060 
00061     virtual bool load();
00062     virtual bool asyncLoad();
00063     virtual bool save( Ticket* );
00064     virtual bool asyncSave( Ticket* );
00065 
00069     void setUrl( const KURL & );
00070 
00074     KURL url() const;
00075 
00079     void setFormat( const QString &name );
00080 
00084     QString format() const;
00085 
00086   protected:
00087     void init( const KURL &url, const QString &format );
00088 
00089   private slots:
00090     void downloadFinished( KIO::Job* );
00091     void uploadFinished( KIO::Job* );
00092 
00093   private:
00094     FormatPlugin *mFormat;
00095     QString mFormatName;
00096 
00097     KURL mUrl;
00098     QString mTempFile;
00099     KTempFile *mLocalTempFile;
00100     bool mUseLocalTempFile;
00101 
00102     class ResourceNetPrivate;
00103     ResourceNetPrivate *d;
00104 };
00105 
00106 }
00107 
00108 #endif
 
This file is part of the documentation for kabc Library Version 3.2.0.