KNewStuff
imageloader.h
Go to the documentation of this file.
00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2006, 2007 Josef Spillner <spillner@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 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 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef KNEWSTUFF3_IMAGELOADER_H 00020 #define KNEWSTUFF3_IMAGELOADER_H 00021 00022 #include <QtGui/QImage> 00023 #include <QtCore/QObject> 00024 #include <QtCore/QByteArray> 00025 00026 #include <kdebug.h> 00027 00028 #include "core/entryinternal.h" 00029 00030 class KJob; 00031 namespace KIO 00032 { 00033 class Job; 00034 class TransferJob; 00035 } 00036 00037 namespace KNS3 { 00038 00051 class ImageLoader : public QObject 00052 { 00053 Q_OBJECT 00054 public: 00055 ImageLoader(const EntryInternal& entry, EntryInternal::PreviewType type, QObject* parent); 00056 void start(); 00061 KJob* job(); 00062 00063 Q_SIGNALS: 00064 void signalPreviewLoaded(const KNS3::EntryInternal&, KNS3::EntryInternal::PreviewType); 00065 00066 private Q_SLOTS: 00067 void slotDownload(KJob *job); 00068 void slotData(KIO::Job* job, const QByteArray& buf); 00069 00070 private: 00071 EntryInternal m_entry; 00072 EntryInternal::PreviewType m_previewType; 00073 QByteArray m_buffer; 00074 KIO::TransferJob *m_job; 00075 }; 00076 } 00077 #endif 00078
KDE 4.6 API Reference