downloaddialog.h
/*
This file is part of KNewStuff.
Copyright (c) 2003 Josef Spillner <spillner@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KNEWSTUFF_DOWNLOADDIALOG_H
#define KNEWSTUFF_DOWNLOADDIALOG_H
#include <kdialogbase.h>
#include <knewstuff/provider.h>
namespace KIO
{
class Job;
}
class KListView;
class QTextBrowser;
class QFrame;
class KNewStuffGeneric;
namespace KNS
{
class ProviderLoader;
class Entry;
class Provider;
class Engine;
class KDE_EXPORT DownloadDialog : public KDialogBase
{
Q_OBJECT
struct Private;
public:
DownloadDialog(Engine *engine, QWidget *parent, const QString& caption);
DownloadDialog(QWidget *parent, const QString& caption);
~DownloadDialog();
void setType(QString type);
// ### KDE 4.0: use const QString&
void load();
void setProviderList(const QString& providerList);
void load(QString providerList); // KDE4: merge with load() above
void addProvider(Provider *p);
void addEntry(Entry *entry);
void addEntry(Entry *entry, const QStringList& variants);
void clear();
DownloadDialog(Engine *engine, QWidget *parent = 0);
// ### KDE 4.0: remove and make caption/parent argument optional
DownloadDialog(QWidget *parent = 0);
// ### KDE 4.0: remove and make caption/parent argument optional
static void open(const QString& type, const QString& caption);
static void open(QString type) KDE_DEPRECATED; // ### KDE 4.0: remove and make caption/parent argument optional
QPtrList<Entry> installedEntries();
// ### KDE 4.0: the open() method should return this
public slots:
void slotProviders(Provider::List *list);
protected slots:
void slotApply();
void slotOk();
private slots:
void slotResult(KIO::Job *job);
void slotData(KIO::Job *job, const QByteArray &a);
void slotInstall();
void slotDetails();
void slotInstalled(KIO::Job *job);
void slotTab();
void slotSelected();
void slotPage(QWidget *w);
void slotFinish();
void slotEmail(const QString& link);
private:
void init(Engine *e);
Entry *getEntry();
void loadProvider(Provider *p);
void install(Entry *e);
int installStatus(Entry *e);
QListViewItem *currentEntryItem();
ProviderLoader *m_loader;
QString m_entryname;
KListView *lv_r, *lv_d, *lv_l;
QTextBrowser *m_rt;
QFrame *m_frame;
QListViewItem *m_entryitem;
QPtrList<Entry> m_entries;
Entry *m_entry;
KNewStuffGeneric *m_s;
int m_curtab;
QMap<QWidget*, QValueList<KListView*>* > m_map;
QMap<QWidget*, Provider*> m_providers;
QMap<QWidget*, QTextBrowser*> m_rts;
QMap<QWidget*, QValueList<QPushButton*>* > m_buttons;
QMap<KIO::Job*, Provider*> m_jobs;
QMap<KIO::Job*, QString> m_data;
QString m_filter;
Engine *m_engine;
Private *d;
};
}
#endif
KNS::Entry
KNewStuff data entry container.
Definition: entry.h:44
KNewStuffGeneric
Basic KNewStuff class with predefined actions.
Definition: knewstuffgeneric.h:42
KNS::ProviderLoader
KNewStuff provider loader.
Definition: provider.h:172
KNS::Engine
Central class combining all possible KNewStuff operations.
Definition: engine.h:51
KNS::Provider
KNewStuff provider container.
Definition: provider.h:46
KNS::DownloadDialog
Common download dialog for data browsing and installation.
Definition: downloaddialog.h:57

KDE Home | KDE Accessibility Home | Description of Access Keys