• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kabc
 

kabc

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., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, 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 TQFile;
00031 class TQTimer;
00032 class KTempFile;
00033 
00034 namespace KIO {
00035 class Job;
00036 }
00037 
00038 namespace KABC {
00039 
00040 class FormatPlugin;
00041 
00045 class KABC_EXPORT ResourceNet : public Resource
00046 {
00047   Q_OBJECT
00048 
00049   public:
00050     ResourceNet( const KConfig* );
00051     ResourceNet( const KURL &url, const TQString &format );
00052     ~ResourceNet();
00053 
00054     virtual void writeConfig( KConfig* );
00055 
00056     virtual bool doOpen();
00057     virtual void doClose();
00058 
00059     virtual Ticket *requestSaveTicket();
00060     virtual void releaseSaveTicket( Ticket* );
00061 
00062     virtual bool load();
00063     virtual bool asyncLoad();
00064     virtual bool save( Ticket* ticket );
00065     virtual bool asyncSave( Ticket* ticket );
00066 
00070     void setUrl( const KURL & );
00071 
00075     KURL url() const;
00076 
00080     void setFormat( const TQString &name );
00081 
00085     TQString format() const;
00086 
00087   protected:
00088     void init( const KURL &url, const TQString &format );
00089 
00090   private slots:
00091     void downloadFinished( KIO::Job* );
00092     void uploadFinished( KIO::Job* );
00093     void signalError();
00094 
00095   private:
00096     bool clearAndLoad( TQFile *file );
00097     void saveToFile( TQFile *file );
00098     bool hasTempFile() const { return mTempFile != 0; }
00099     void abortAsyncLoading();
00100     void abortAsyncSaving();
00101     bool createLocalTempFile();
00102     void deleteLocalTempFile();
00103     void deleteStaleTempFile();
00104 
00105     FormatPlugin *mFormat;
00106     TQString mFormatName;
00107 
00108     KURL mUrl;
00109     KTempFile *mTempFile;
00110 
00111     class ResourceNetPrivate;
00112     ResourceNetPrivate *d;
00113 };
00114 
00115 }
00116 
00117 #endif

kabc

Skip menu "kabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kabc

Skip menu "kabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kabc by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |