KNewStuff
dxsengine.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 00021 #ifndef KNEWSTUFF2_DXS_ENGINE_H 00022 #define KNEWSTUFF2_DXS_ENGINE_H 00023 00024 #include <knewstuff2/core/coreengine.h> 00025 00026 namespace KNS 00027 { 00028 00029 class Dxs; 00030 class Category; 00031 00041 class DxsEngine : public CoreEngine 00042 { 00043 Q_OBJECT 00044 public: 00045 DxsEngine(QObject* parent); 00046 ~DxsEngine(); 00047 00048 enum Policy { 00049 DxsNever, 00050 DxsIfPossible, 00051 DxsAlways 00052 }; 00053 00054 void setDxsPolicy(Policy policy); 00055 00056 void loadEntries(Provider *provider); 00057 //void downloadPreview(Entry *entry); 00058 //void downloadPayload(Entry *entry); 00059 // FIXME: the upload/download stuff is only necessary when we use 00060 // integrated base64-encoded files; maybe delay to later version? 00061 00062 //bool uploadEntry(Provider *provider, Entry *entry); 00063 00064 // get the dxs object 00065 Dxs * dxsObject(const Provider * provider); 00066 00067 private slots: 00068 // FIXME: idem for slots 00069 void slotEntriesLoadedDXS(KNS::Entry::List list, Feed * feed); 00070 void slotEntriesFailed(); 00071 00072 void slotCategories(QList<KNS::Category*>); 00073 00074 private: 00075 QMap<const Provider *, Dxs *> m_dxsbyprovider; 00076 Policy m_dxspolicy; 00077 }; 00078 00079 } 00080 00081 #endif