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