2 * Copyright 2013-2016 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include <unity/shell/launcher/LauncherModelInterface.h>
21#include <unity/shell/application/ApplicationManagerInterface.h>
23#include <QAbstractListModel>
31 namespace app_launch {
36using namespace unity::shell::launcher;
37using namespace unity::shell::application;
39class LauncherModel: public LauncherModelInterface
44 LauncherModel(QObject *parent = nullptr);
47 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
49 QVariant data(const QModelIndex &index, int role) const override;
51 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
52 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
53 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
54 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
55 Q_INVOKABLE void setUser(const QString &username) override;
56 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
58 unity::shell::application::ApplicationManagerInterface* applicationManager() const override;
59 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager) override;
61 bool onlyPinned() const override;
62 void setOnlyPinned(bool onlyPinned) override;
64 int findApplication(const QString &appId);
67 void requestRemove(const QString &appId) override;
68 Q_INVOKABLE void refresh();
69 Q_INVOKABLE void alert(const QString &appId);
74 void unpin(const QString &appId);
81 AppInfo getApplicationInfo(const QString &appId);
84 void countChanged(const QString &appId, int count);
85 void countVisibleChanged(const QString &appId, bool count);
86 void progressChanged(const QString &appId, int progress);
88 void applicationAdded(const QModelIndex &parent, int row);
89 void applicationRemoved(const QModelIndex &parent, int row);
90 void focusedAppIdChanged();
91 void applicationSurfaceCountChanged(int);
94 QList<LauncherItem*> m_list;
96 GSettings *m_settings;
97 DBusInterface *m_dbusIface;
98 ASAdapter *m_asAdapter;
100 ApplicationManagerInterface *m_appManager;
101 std::shared_ptr<ubuntu::app_launch::Registry> m_ualRegistry;
103 friend class LauncherModelTest;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list