KNewStuff
kdxsbutton.h
Go to the documentation of this file.00001 /* 00002 This file is part of KNewStuff2. 00003 Copyright (c) 2005 - 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_UI_KDXSBUTTON_H 00022 #define KNEWSTUFF2_UI_KDXSBUTTON_H 00023 00024 #include <QtGui/QToolButton> 00025 #include "knewstuff2/core/entry.h" 00026 class KMenu; 00027 class QAction; 00028 class KUrl; 00029 00030 namespace KNS 00031 { 00032 00033 class Dxs; 00034 class Entry; 00035 class Provider; 00036 class DxsEngine; 00037 class Category; 00038 class Feed; 00051 class KDXSButton : public QToolButton 00052 { 00053 Q_OBJECT 00054 public: 00055 KDXSButton(QWidget *parent); 00056 ~KDXSButton(); 00057 00058 void setEntry(KNS::Entry *e); 00059 void setProvider(const KNS::Provider *provider); 00060 void setEngine(KNS::DxsEngine *engine); 00061 00062 public Q_SLOTS: 00063 void slotTriggered(QAction *action); 00064 void slotVersionsActivated(int id); 00065 void slotVersionsHighlighted(int id); 00066 void slotClicked(); 00067 00068 void slotInfo(QString provider, QString server, QString version); 00069 void slotCategories(QList<KNS::Category*> categories); 00070 void slotEntries(QList<KNS::Entry*> entries); 00071 void slotComments(QStringList comments); 00072 void slotHistory(QStringList entries); 00073 void slotChanges(QStringList entries); 00074 void slotRemoval(bool success); 00075 void slotSubscription(bool success); 00076 void slotComment(bool success); 00077 void slotRating(bool success); 00078 00079 void slotFault(); 00080 void slotError(); 00081 00082 void slotPayloadLoaded(KUrl url); 00083 void slotPayloadFailed(KNS::Entry *); 00084 00085 private: 00086 bool authenticate(); 00087 00088 // FIXME KDE4PORT item actions 00089 /*QAction *Items 00090 { 00091 install, 00092 uninstall, 00093 comments, 00094 changes, 00095 info, 00096 00097 historysub, 00098 00099 collabrating, 00100 collabcomment, 00101 collaboratesub, 00102 collabsubscribe, 00103 collabremoval, 00104 collabtranslation, 00105 00106 contactsub, 00107 contactbymail, 00108 contactbyjabber 00109 };*/ 00110 00111 QAction *action_install; 00112 QAction *action_uninstall; 00113 QAction *action_comments; 00114 QAction *action_changes; 00115 QAction *action_info; 00116 00117 QAction *action_historysub; 00118 00119 QAction *action_collabrating; 00120 QAction *action_collabcomment; 00121 QAction *action_collaboratesub; 00122 QAction *action_collabsubscribe; 00123 QAction *action_collabremoval; 00124 QAction *action_collabtranslation; 00125 00126 QAction *action_contactsub; 00127 QAction *action_contactbymail; 00128 QAction *action_contactbyjabber; 00129 00130 enum States { 00131 historyinactive, 00132 historydisabled, 00133 historyslots 00134 }; 00135 00136 KNS::Dxs *m_dxs; 00137 KMenu *m_p, *m_history, *m_contact; 00138 00139 KNS::Entry *m_entry; 00140 const KNS::Provider *m_provider; 00141 KNS::DxsEngine *m_engine; 00142 00143 QString m_username; 00144 QString m_password; 00145 00146 class Private; 00147 Private * const d; 00148 00149 QWidget * m_parent; 00150 }; 00151 00152 } 00153 00154 #endif