~unity-2d-team/unity-2d/shortcut-hint-overlay

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/applicationslist.h

  • Committer: Tiago Salem Herrmann
  • Date: 2012-03-19 15:28:41 UTC
  • mfrom: (771.40.182 unity-2d)
  • Revision ID: tiago.herrmann@canonical.com-20120319152841-2hfflo67muks7gca
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 */
16
16
 
17
 
#ifndef LAUNCHERAPPLICATIONSLIST_H
18
 
#define LAUNCHERAPPLICATIONSLIST_H
 
17
#ifndef APPLICATIONSLIST_H
 
18
#define APPLICATIONSLIST_H
19
19
 
20
20
#include <QAbstractListModel>
21
21
#include <QList>
22
22
#include <QVariant>
23
23
#include <QString>
 
24
#include <QStringList>
24
25
#include <QUrl>
25
26
#include <QObject>
26
27
#include <QtDeclarative/qdeclarative.h>
33
34
struct SnMonitorContext;
34
35
struct SnMonitorEvent;
35
36
struct SnStartupSequence;
36
 
class LauncherApplication;
 
37
class Application;
37
38
class BamfApplication;
38
39
class BamfView;
39
40
 
40
 
class LauncherApplicationsList : public QAbstractListModel, protected AbstractX11EventFilter, protected QDBusContext
 
41
class ApplicationsList : public QAbstractListModel, protected AbstractX11EventFilter
41
42
{
42
43
    Q_OBJECT
43
 
    friend class LauncherApplicationsListDBUS;
 
44
    friend class ApplicationsListDBUS;
 
45
    friend class ApplicationsListManager;
44
46
 
45
47
public:
46
 
    LauncherApplicationsList(QObject *parent = 0);
47
 
    ~LauncherApplicationsList();
 
48
    ApplicationsList(QObject *parent = 0);
 
49
    ~ApplicationsList();
48
50
 
49
51
    QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
50
52
    int rowCount(const QModelIndex & parent = QModelIndex()) const;
54
56
 
55
57
public Q_SLOTS:
56
58
    void move(int from, int to);
 
59
    void moveFinished(int from, int to);
57
60
 
58
61
Q_SIGNALS:
59
62
    void applicationBecameUrgent(int index);
66
69
    void insertBamfApplication(BamfApplication* bamf_application);
67
70
    void insertSnStartupSequence(SnStartupSequence* sequence);
68
71
 
69
 
    void insertApplication(LauncherApplication* application);
70
 
    void removeApplication(LauncherApplication* application);
 
72
    void insertApplication(Application* application);
 
73
    void removeApplication(Application* application);
71
74
 
72
75
    QString favoriteFromDesktopFilePath(const QString& desktop_file) const;
73
76
 
74
77
    void writeFavoritesToGConf();
75
78
 
76
 
    /* List of LauncherApplication displayed in the launcher. */
77
 
    QList<LauncherApplication*> m_applications;
78
 
    /* Hash of desktop file names to LauncherApplication used to reduce
 
79
    void remoteEntryUpdated(const QString& desktopFile, const QString& sender, const QString& applicationURI, const QMap<QString, QVariant>& properties);
 
80
 
 
81
    void doMove(int from, int to);
 
82
 
 
83
    /* List of Application displayed in the launcher. */
 
84
    QList<Application*> m_applications;
 
85
    /* Hash of desktop file names to Application used to reduce
79
86
       the algorithmical complexity of merging the list of running applications
80
87
       and the list of favorited applications into the list of applications
81
88
       displayed (m_applications).
82
89
    */
83
 
    QHash<QString, LauncherApplication*> m_applicationForDesktopFile;
84
 
    /* Hash of application executables to LauncherApplication used to reduce
 
90
    QHash<QString, Application*> m_applicationForDesktopFile;
 
91
    /* Hash of application executables to Application used to reduce
85
92
       the algorithmical complexity of merging the list of launching applications
86
93
       and the list of running applications into the list of applications
87
94
       displayed (m_applications).
88
95
    */
89
 
    QHash<QString, LauncherApplication*> m_applicationForExecutable;
 
96
    QHash<QString, Application*> m_applicationForExecutable;
90
97
    QStringList m_xdgApplicationDirs;
91
98
 
92
99
    /* Startup notification support */
102
109
    void onApplicationLaunchingChanged(bool launching);
103
110
    void onApplicationUrgentChanged(bool urgent);
104
111
    void onApplicationUserVisibleChanged(bool user_visible);
105
 
    void onRemoteEntryUpdated(QString applicationURI,
106
 
                              QMap<QString, QVariant> properties);
107
112
};
108
113
 
109
 
QML_DECLARE_TYPE(LauncherApplicationsList)
 
114
QML_DECLARE_TYPE(ApplicationsList)
110
115
 
111
 
#endif // LAUNCHERAPPLICATIONSLIST_H
 
116
#endif // APPLICATIONSLIST_H