• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KNewStuff

downloaddialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Enrico Ros <eros.kde@email.it>                  *
00003  *   Copyright (C) 2005 - 2007 Josef Spillner <spillner@kde.org>           *
00004  *   Copyright (C) 2007 Dirk Mueller <mueller@kde.org>                     *
00005  *   Copyright (C) 2007 Jeremy Whiting <jeremy@scitools.com>               *
00006  *                                                                         *
00007  *   This library is free software; you can redistribute it and/or         *
00008  *   modify it under the terms of the GNU Lesser General Public            *
00009  *   License as published by the Free Software Foundation; either          *
00010  *   version 2 of the License, or (at your option) any later version.      *
00011  *                                                                         *
00012  *   This library is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00015  *   Lesser General Public License for more details.                       *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU Lesser General Public      *
00018  *   License along with this library; if not, write to the                 *
00019  *   Free Software Foundation, Inc.,                                       *
00020  ***************************************************************************/
00021 
00022 #ifndef KNEWSTUFF2_UI_DOWNLOADDIALOG_H
00023 #define KNEWSTUFF2_UI_DOWNLOADDIALOG_H
00024 
00025 #include <QMutex>
00026 
00027 #include <kdialog.h>
00028 #include <ktitlewidget.h>
00029 
00030 #include <knewstuff2/dxs/dxsengine.h>
00031 #include <knewstuff2/core/category.h>
00032 
00033 #include "ui_DownloadDialog.h"
00034 
00035 class KJob;
00036 class KLineEdit;
00037 class QComboBox;
00038 class QHideEvent;
00039 class QLabel;
00040 class QProgressIndicator;
00041 class QSortFilterProxyModel;
00042 
00043 namespace KNS
00044 {
00045 
00046 class DownloadDialog;
00047 class EntryView;
00048 class ItemsView;
00049 class ItemsModel;
00050 class ItemsViewDelegate;
00051 
00070 class DownloadDialog : public KDialog, public Ui::DownloadDialog
00071 {
00072     Q_OBJECT
00073 
00074 public:
00075     DownloadDialog(DxsEngine* engine, QWidget * parent);
00076     ~DownloadDialog();
00077 
00078     enum EntryAction {
00079         kViewInfo,
00080         kComments,
00081         kChanges,
00082         kContactEmail,
00083         kContactJabber,
00084         kCollabTranslate,
00085         kCollabRemoval,
00086         kCollabSubscribe,
00087         kUninstall,
00088         kInstall,
00089         kCollabComment,
00090         kCollabRate
00091     };
00092 
00093     void refresh();
00094 
00095     // show a message in the bottom bar
00096     void displayMessage(const QString & msg,
00097                         KTitleWidget::MessageType type = KTitleWidget::PlainMessage,
00098                         int timeOutMs = 0);
00099 
00100     // begin installing that item
00101     void installItem(Entry * entry);
00102 
00103     // remove an already installed item
00104     void removeItem(Entry * entry);
00105 
00106 private Q_SLOTS:
00108     void slotEntryLoaded(KNS::Entry *entry, const KNS::Feed *feed, const KNS::Provider *provider);
00109     void slotEntryRemoved(KNS::Entry *entry, const KNS::Feed *feed);
00110     void slotEntriesFailed();
00111     void slotPayloadFailed(KNS::Entry * entry);
00112 
00113     void slotResetMessage();
00114     void slotNetworkTimeout();
00115     void slotSortingSelected(int sortType);
00116     void slotSearchTextChanged();
00117     void slotUpdateSearch();
00118 
00119     void slotInfo(QString provider, QString server, QString version);
00120     void slotComments(QStringList comments);
00121     // DXS
00122     void slotLoadProvidersListDXS();
00123     void slotLoadProviderDXS();
00124     void slotCategories(QList<Category*> categories);
00125     void slotEntries(QList<Entry*> entries);
00126     void slotFault();
00127     void slotError();
00128     // file downloading
00129     void slotEntryChanged(KNS::Entry *);
00130     //void slotItemMessage( KJob *, const QString & );
00131     //void slotItemPercentage( KJob *, unsigned long );
00132     //void slotItemResult( KJob * );
00133     void slotProgress(const QString & text, int percentage);
00134     void slotProvidersFailed();
00135 
00136     void slotPerformAction(DownloadDialog::EntryAction action, KNS::Entry * entry);
00137     void slotCollabAction(DownloadDialog::EntryAction action);
00138 
00139     void slotListIndexChanged(const QModelIndex &index, const QModelIndex &old);
00140 protected:
00141     virtual void hideEvent(QHideEvent * event);
00142 
00143 private:
00144 
00145     void populateSortCombo(const Provider * provider);
00146 
00147     // Contents
00148     // gui related vars
00149     //Ui::DownloadDialog * m_ui;
00150 
00151     // other classes
00152     QTimer * m_searchTimer;
00153     QTimer * messageTimer;
00154     QTimer * networkTimer;
00155 
00156     DxsEngine *m_engine;
00157     QMap<QString, QString> categorymap;
00158     QMap<const Feed*, KNS::ItemsModel*> m_models;
00159     QSortFilterProxyModel * m_filteredModel;
00160     ItemsViewDelegate * mDelegate;
00161 
00162     //QList<Entry*> m_entries;
00163     QMap<const Feed*, Entry::List> entries;
00164     QMap<const Provider*, Entry::List> m_entriesByProvider;
00165     QMap<Entry*, const Provider*> m_providers;
00166 
00167     QMutex mMutex;
00168 };
00169 
00170 }
00171 
00172 #endif

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal