kabc Library: resourcenet.h Source File (kabc Library)

| # kabc Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# resourcenet.h

    00001 /*
    00002     This file is part of libkabc.
    00003     Copyright (c) 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_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 KABC_EXPORT 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.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:31:31 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003