1
/***************************************************************************
2
* Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> *
4
* This program is free software; you can redistribute it and/or *
5
* modify it under the terms of the GNU General Public License as *
6
* published by the Free Software Foundation; either version 2 of *
7
* the License or (at your option) version 3 or any later version *
8
* accepted by the membership of KDE e.V. (or its successor approved *
9
* by the membership of KDE e.V.), which shall act as a proxy *
10
* defined in Section 14 of version 3 of the license. *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
19
***************************************************************************/
21
#ifndef APPLICATIONVIEWWIDGET_H
22
#define APPLICATIONVIEWWIDGET_H
24
#include <QtCore/QPair>
26
#include <LibQApt/Package>
28
#include "AbstractViewBase.h"
33
class KPixmapSequenceOverlayPainter;
36
class ApplicationBackend;
37
class ApplicationDelegate;
38
class ApplicationDetailsView;
39
class ApplicationModel;
40
class ApplicationProxyModel;
47
class ApplicationViewWidget : public AbstractViewBase
51
ApplicationViewWidget(QWidget *parent, ApplicationBackend *appBackend);
52
~ApplicationViewWidget();
54
virtual void search(const QString &text);
57
QApt::Backend *m_backend;
58
ApplicationBackend *m_appBackend;
59
ApplicationModel *m_appModel;
60
ApplicationProxyModel *m_proxyModel;
61
QPair<AbstractViewBase *, Application *> m_currentPair;
63
QTreeView *m_treeView;
64
ApplicationDelegate *m_delegate;
65
KPixmapSequenceOverlayPainter *m_busyWidget;
66
ApplicationDetailsView *m_detailsView;
69
void infoButtonClicked(Application *app);
70
void installButtonClicked(Application *app, const QHash<QApt::Package *, QApt::Package::State> &addons);
71
void installButtonClicked(Application *app);
72
void removeButtonClicked(Application *app);
73
void cancelButtonClicked(Application *app);
74
void onSubViewDestroyed();
77
void setBackend(QApt::Backend *backend);
80
void setTitle(const QString &title);
81
void setIcon(const QIcon &icon);
82
void setStateFilter(QApt::Package::State state);
83
void setOriginFilter(const QString &origin);
84
void setFiltersFromCategory(Category *category);
85
void setShouldShowTechnical(bool show);
88
void switchToSubView(AbstractViewBase *view);
89
void registerNewSubView(AbstractViewBase *view);