~ubuntu-branches/ubuntu/vivid/muon/vivid-proposed

« back to all changes in this revision

Viewing changes to installer/ApplicationModel/ApplicationViewWidget.h

Tags: upstream-1.3.65
Import upstream version 1.3.65

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>             *
3
 
 *                                                                         *
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.                    *
11
 
 *                                                                         *
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.                          *
16
 
 *                                                                         *
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
 
 ***************************************************************************/
20
 
 
21
 
#ifndef APPLICATIONVIEWWIDGET_H
22
 
#define APPLICATIONVIEWWIDGET_H
23
 
 
24
 
#include <QtCore/QPair>
25
 
 
26
 
#include <LibQApt/Package>
27
 
 
28
 
#include "AbstractViewBase.h"
29
 
 
30
 
class QIcon;
31
 
class QTreeView;
32
 
 
33
 
class KPixmapSequenceOverlayPainter;
34
 
 
35
 
class Application;
36
 
class ApplicationBackend;
37
 
class ApplicationDelegate;
38
 
class ApplicationDetailsView;
39
 
class ApplicationModel;
40
 
class ApplicationProxyModel;
41
 
class Category;
42
 
 
43
 
namespace QApt {
44
 
    class Backend;
45
 
}
46
 
 
47
 
class ApplicationViewWidget : public AbstractViewBase
48
 
{
49
 
    Q_OBJECT
50
 
public:
51
 
    ApplicationViewWidget(QWidget *parent, ApplicationBackend *appBackend);
52
 
    ~ApplicationViewWidget();
53
 
 
54
 
    virtual void search(const QString &text);
55
 
 
56
 
private:
57
 
    QApt::Backend *m_backend;
58
 
    ApplicationBackend *m_appBackend;
59
 
    ApplicationModel *m_appModel;
60
 
    ApplicationProxyModel *m_proxyModel;
61
 
    QPair<AbstractViewBase *, Application *> m_currentPair;
62
 
 
63
 
    QTreeView *m_treeView;
64
 
    ApplicationDelegate *m_delegate;
65
 
    KPixmapSequenceOverlayPainter *m_busyWidget;
66
 
    ApplicationDetailsView *m_detailsView;
67
 
 
68
 
private Q_SLOTS:
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();
75
 
 
76
 
public Q_SLOTS:
77
 
    void setBackend(QApt::Backend *backend);
78
 
    void reload();
79
 
 
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);
86
 
 
87
 
Q_SIGNALS:
88
 
    void switchToSubView(AbstractViewBase *view);
89
 
    void registerNewSubView(AbstractViewBase *view);
90
 
};
91
 
 
92
 
#endif