2 * Copyright (C) 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 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 General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef APPLICATION_MANAGER_H
18#define APPLICATION_MANAGER_H
24#include "ApplicationInfo.h"
27#include <unity/shell/application/ApplicationManagerInterface.h>
31 namespace application {
32 class MirSurfaceInterface;
38using namespace unity::shell::application;
40class ApplicationManager : public ApplicationManagerInterface {
43 Q_PROPERTY(bool empty READ isEmpty NOTIFY emptyChanged)
44 Q_PROPERTY(QStringList availableApplications READ availableApplications NOTIFY availableApplicationsChanged)
47 ApplicationManager(QObject *parent = nullptr);
48 virtual ~ApplicationManager();
50 // QAbstractItemModel methods.
51 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
52 QVariant data(const QModelIndex& index, int role) const override;
53 Q_INVOKABLE ApplicationInfo *get(int index) const override;
54 Q_INVOKABLE ApplicationInfo *findApplication(const QString &appId) const override;
56 Q_INVOKABLE void move(int from, int to);
58 // Application control methods
59 Q_INVOKABLE bool requestFocusApplication(const QString &appId) override;
60 Q_INVOKABLE ApplicationInfo *startApplication(const QString &appId, const QStringList &arguments = QStringList()) override;
61 Q_INVOKABLE bool stopApplication(const QString &appId) override;
63 QString focusedApplicationId() const override;
66 QStringList availableApplications();
67 Q_INVOKABLE ApplicationInfo* add(QString appId);
69 QModelIndex findIndex(ApplicationInfo* application);
74 void focusRequested(const QString &appId);
75 void emptyChanged(bool empty);
76 void availableApplicationsChanged(QStringList list);
79 void onWindowCreatedTimerTimeout();
80 void updateFocusedApplication();
83 bool add(ApplicationInfo *application);
84 void remove(ApplicationInfo* application);
85 void buildListOfAvailableApplications();
86 void onWindowCreated();
87 ApplicationInfo *findApplication(MirSurface* surface);
88 QList<ApplicationInfo*> m_runningApplications;
89 QList<ApplicationInfo*> m_availableApplications;
90 QTimer m_windowCreatedTimer;
93Q_DECLARE_METATYPE(ApplicationManager*)
95#endif // APPLICATION_MANAGER_H
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