KIO
accessmanagerreply_p.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the KDE project. 00003 * 00004 * Copyright (C) 2008 - 2009 Urs Wolfer <uwolfer @ kde.org> 00005 * Copyright (C) 2009 - 2010 Dawit Alemayehu <adawit @ kde.org> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Library General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Library General Public License 00018 * along with this library; see the file COPYING.LIB. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301, USA. 00021 * 00022 */ 00023 00024 #ifndef KIO_ACCESSMANAGERREPLY_P_H 00025 #define KIO_ACCESSMANAGERREPLY_P_H 00026 00027 #include <QtCore/QPointer> 00028 #include <QtNetwork/QNetworkReply> 00029 00030 namespace KIO 00031 { 00032 class Job; 00033 class SimpleJob; 00034 } 00035 class KJob; 00036 class KUrl; 00037 00038 namespace KDEPrivate { 00039 00047 class AccessManagerReply : public QNetworkReply 00048 { 00049 Q_OBJECT 00050 public: 00051 AccessManagerReply(const QNetworkAccessManager::Operation &op, 00052 const QNetworkRequest &request, 00053 KIO::SimpleJob *kioJob, 00054 QObject *parent); 00055 00056 virtual ~AccessManagerReply(); 00057 virtual qint64 bytesAvailable() const; 00058 virtual void abort(); 00059 00060 void setIgnoreContentDisposition(bool on); 00061 void setStatus(const QString& message, QNetworkReply::NetworkError); 00062 void putOnHold(); 00063 00064 protected: 00065 virtual qint64 readData(char *data, qint64 maxSize); 00066 void readHttpResponseHeaders(KIO::Job *); 00067 00068 private Q_SLOTS: 00069 void slotData(KIO::Job *kioJob, const QByteArray &data); 00070 void slotMimeType(KIO::Job *kioJob, const QString &mimeType); 00071 void slotResult(KJob *kJob); 00072 void slotRedirection(KIO::Job *job, const KUrl &url); 00073 void slotPercent(KJob *job, unsigned long percent); 00074 00075 private: 00076 QByteArray m_data; 00077 bool m_metaDataRead; 00078 bool m_ignoreContentDisposition; 00079 QPointer<KIO::SimpleJob> m_kioJob; 00080 }; 00081 00082 } 00083 00084 #endif // KIO_ACCESSMANAGERREPLY_P_H
KDE 4.6 API Reference