KNewStuff
entryloader.h
Go to the documentation of this file.00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 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 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 #ifndef KNEWSTUFF2_ENTRY_LOADER_H 00021 #define KNEWSTUFF2_ENTRY_LOADER_H 00022 00023 #include <knewstuff2/core/entry.h> 00024 00025 #include <QtXml/qdom.h> 00026 #include <QtCore/QObject> 00027 #include <QtCore/QString> 00028 00029 class KJob; 00030 00031 namespace KIO 00032 { 00033 class Job; 00034 } 00035 00036 namespace KNS 00037 { 00038 00039 class Feed; 00040 class Provider; 00041 00049 class EntryLoader : public QObject 00050 { 00051 Q_OBJECT 00052 public: 00056 EntryLoader(QObject* parent); 00057 00065 void load(const Provider *provider, Feed *feed); 00066 00072 const Provider *provider() const; 00073 00079 Feed *feed() const; 00080 00081 Q_SIGNALS: 00085 void signalEntriesLoaded(KNS::Entry::List list); 00086 00090 void signalEntriesFailed(); 00091 00095 void signalProgress(KJob*, unsigned long); 00096 00097 protected Q_SLOTS: 00098 void slotJobData(KIO::Job *, const QByteArray &); 00099 void slotJobResult(KJob *); 00100 00101 private: 00102 QByteArray m_jobdata; 00103 00104 Entry::List m_entries; 00105 Feed *m_feed; 00106 const Provider *m_provider; 00107 }; 00108 00109 } 00110 00111 #endif