storedtransferjob.h
00001 /* 00002 Copyright (C) 2004 David Faure <faure@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef STOREDTRANSFERJOB_H 00021 #define STOREDTRANSFERJOB_H 00022 00023 #include <kio/job.h> 00024 00025 // To be moved to KIO? 00026 namespace KIOext { 00027 00047 class StoredTransferJob : public KIO::TransferJob { 00048 Q_OBJECT 00049 TQ_OBJECT 00050 00051 public: 00061 StoredTransferJob(const KURL& url, int command, 00062 const TQByteArray &packedArgs, 00063 const TQByteArray &_staticData, 00064 bool showProgressInfo); 00065 00070 void setData( const TQByteArray& arr ); 00071 00076 TQByteArray data() const { return m_data; } 00077 00078 private slots: 00079 void slotData( KIO::Job *job, const TQByteArray &data ); 00080 void slotDataReq( KIO::Job *job, TQByteArray &data ); 00081 private: 00082 TQByteArray m_data; 00083 int m_uploadOffset; 00084 }; 00085 00095 StoredTransferJob *storedGet( const KURL& url, bool reload=false, bool showProgressInfo = true ); 00096 00109 StoredTransferJob *put( const TQByteArray& arr, const KURL& url, int permissions, 00110 bool overwrite, bool resume, bool showProgressInfo = true ); 00111 00112 } // namespace 00113 00114 #endif