KNewStuff
downloaddialog.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KNEWSTUFF_DOWNLOADDIALOG_H
00021 #define KNEWSTUFF_DOWNLOADDIALOG_H
00022
00023 #include <kdialogbase.h>
00024 #include <knewstuff/provider.h>
00025
00026 namespace KIO
00027 {
00028 class Job;
00029 }
00030
00031 class KListView;
00032 class QTextBrowser;
00033 class QFrame;
00034 class KNewStuffGeneric;
00035
00036 namespace KNS
00037 {
00038
00039 class ProviderLoader;
00040 class Entry;
00041 class Provider;
00042 class Engine;
00043
00057 class KDE_EXPORT DownloadDialog : public KDialogBase
00058 {
00059 Q_OBJECT
00060 struct Private;
00061 public:
00070 DownloadDialog(Engine *engine, QWidget *parent, const QString& caption);
00071
00079 DownloadDialog(QWidget *parent, const QString& caption);
00080
00084 ~DownloadDialog();
00085
00091 void setType(QString type);
00092
00093
00098 void load();
00099
00108 void setProviderList(const QString& providerList);
00109
00118 void load(QString providerList);
00119
00126 void addProvider(Provider *p);
00127
00134 void addEntry(Entry *entry);
00135
00144 void addEntry(Entry *entry, const QStringList& variants);
00145
00150 void clear();
00151
00159 DownloadDialog(Engine *engine, QWidget *parent = 0);
00160
00161
00168 DownloadDialog(QWidget *parent = 0);
00169
00170
00180 static void open(const QString& type, const QString& caption);
00181
00191 static void open(QString type) KDE_DEPRECATED;
00192
00198 QPtrList<Entry> installedEntries();
00199
00200
00201 public slots:
00207 void slotProviders(Provider::List *list);
00208
00209 protected slots:
00210 void slotApply();
00211 void slotOk();
00212
00213 private slots:
00214 void slotResult(KIO::Job *job);
00215 void slotData(KIO::Job *job, const QByteArray &a);
00216 void slotInstall();
00217 void slotDetails();
00218 void slotInstalled(KIO::Job *job);
00219 void slotTab();
00220 void slotSelected();
00221 void slotPage(QWidget *w);
00222 void slotFinish();
00223 void slotEmail(const QString& link);
00224
00225 private:
00226 void init(Engine *e);
00227 Entry *getEntry();
00228 void loadProvider(Provider *p);
00229 void install(Entry *e);
00230 int installStatus(Entry *e);
00231 QListViewItem *currentEntryItem();
00232
00233 ProviderLoader *m_loader;
00234 QString m_entryname;
00235 KListView *lv_r, *lv_d, *lv_l;
00236 QTextBrowser *m_rt;
00237 QFrame *m_frame;
00238 QListViewItem *m_entryitem;
00239 QPtrList<Entry> m_entries;
00240 Entry *m_entry;
00241 KNewStuffGeneric *m_s;
00242 int m_curtab;
00243 QMap<QWidget*, QValueList<KListView*>* > m_map;
00244 QMap<QWidget*, Provider*> m_providers;
00245 QMap<QWidget*, QTextBrowser*> m_rts;
00246 QMap<QWidget*, QValueList<QPushButton*>* > m_buttons;
00247 QMap<KIO::Job*, Provider*> m_jobs;
00248 QMap<KIO::Job*, QString> m_data;
00249 QString m_filter;
00250 Engine *m_engine;
00251 Private *d;
00252 };
00253
00254 }
00255
00256 #endif
00257