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 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 #ifndef KNEWSTUFF2_ENTRY_LOADER_H 00019 #define KNEWSTUFF2_ENTRY_LOADER_H 00020 00021 #include <knewstuff2/core/entry.h> 00022 00023 #include <QtXml/qdom.h> 00024 #include <QtCore/QObject> 00025 #include <QtCore/QString> 00026 00027 class KJob; 00028 00029 namespace KIO 00030 { 00031 class Job; 00032 } 00033 00034 namespace KNS 00035 { 00036 00037 class Feed; 00038 class Provider; 00039 00047 class EntryLoader : public QObject 00048 { 00049 Q_OBJECT 00050 public: 00054 EntryLoader(QObject* parent); 00055 00063 void load(const Provider *provider, Feed *feed); 00064 00070 const Provider *provider() const; 00071 00077 Feed *feed() const; 00078 00079 Q_SIGNALS: 00083 void signalEntriesLoaded(KNS::Entry::List list); 00084 00088 void signalEntriesFailed(); 00089 00093 void signalProgress(KJob*, unsigned long); 00094 00095 protected Q_SLOTS: 00096 void slotJobData(KIO::Job *, const QByteArray &); 00097 void slotJobResult(KJob *); 00098 00099 private: 00100 QByteArray m_jobdata; 00101 00102 Entry::List m_entries; 00103 Feed *m_feed; 00104 const Provider *m_provider; 00105 }; 00106 00107 } 00108 00109 #endif