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

tdeabc

resourcenet.h

00001 /*
00002     This file is part of libtdeabc.
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 <tdeconfig.h>
00025 
00026 #include <sys/types.h>
00027 
00028 #include <tdeabc/resource.h>
00029 
00030 class TQFile;
00031 class TQTimer;
00032 class KTempFile;
00033 
00034 namespace TDEIO {
00035 class Job;
00036 }
00037 
00038 namespace TDEABC {
00039 
00040 class FormatPlugin;
00041 
00045 class KABC_EXPORT ResourceNet : public Resource
00046 {
00047   Q_OBJECT
00048 
00049   public:
00050     ResourceNet( const TDEConfig* );
00051     ResourceNet( const KURL &url, const TQString &format );
00052     ~ResourceNet();
00053 
00054     virtual void writeConfig( TDEConfig* );
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( TDEIO::Job* );
00092     void uploadFinished( TDEIO::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

tdeabc

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

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.6.3
This website is maintained by Timothy Pearson.