2 * Copyright (C) 2013 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
23#include "ApplicationInfo.h"
26#include <unity/shell/application/ApplicationManagerInterface.h>
29using namespace unity::shell::application;
31class ApplicationManager : public ApplicationManagerInterface {
35 Q_ENUMS(FormFactorHint)
36 Q_ENUMS(FavoriteApplication)
39 Q_PROPERTY(int keyboardHeight READ keyboardHeight NOTIFY keyboardHeightChanged)
40 Q_PROPERTY(bool keyboardVisible READ keyboardVisible NOTIFY keyboardVisibleChanged)
42 Q_PROPERTY(int sideStageWidth READ sideStageWidth)
43 Q_PROPERTY(StageHint stageHint READ stageHint)
44 Q_PROPERTY(FormFactorHint formFactorHint READ formFactorHint)
46 Q_PROPERTY(bool fake READ fake CONSTANT)
49 ApplicationManager(QObject *parent = NULL);
50 virtual ~ApplicationManager();
53 Dash, Default, Indicators, Notifications, Greeter, Launcher, OnScreenKeyboard,
57 MainStage, IntegrationStage, ShareStage, ContentPickingStage,
58 SideStage, ConfigurationStage
61 DesktopFormFactor, PhoneFormFactor, TabletFormFactor
63 enum FavoriteApplication {
64 CameraApplication, GalleryApplication, BrowserApplication, ShareApplication,
65 PhoneApplication, DialerApplication, MessagingApplication, AddressbookApplication
71 Q_DECLARE_FLAGS(ExecFlags, Flag)
73 int keyboardHeight() const;
74 bool keyboardVisible() const;
75 int sideStageWidth() const;
76 StageHint stageHint() const;
77 FormFactorHint formFactorHint() const;
79 bool fake() { return true; }
81 // QAbstractItemModel methods.
82 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
83 QVariant data(const QModelIndex& index, int role) const override;
84 Q_INVOKABLE ApplicationInfo *get(int index) const override;
85 Q_INVOKABLE ApplicationInfo *findApplication(const QString &appId) const override;
87 Q_INVOKABLE void move(int from, int to);
89 // Application control methods
90 Q_INVOKABLE bool focusApplication(const QString &appId) override;
91 Q_INVOKABLE void unfocusCurrentApplication() override;
92 Q_INVOKABLE ApplicationInfo *startApplication(const QString &appId, const QStringList &arguments = QStringList()) override;
93 Q_INVOKABLE ApplicationInfo *startApplication(const QString &appId, ExecFlags flags, const QStringList &arguments = QStringList());
94 Q_INVOKABLE bool stopApplication(const QString &appId) override;
96 QString focusedApplicationId() const override;
99 void keyboardHeightChanged();
100 void keyboardVisibleChanged();
101 void focusRequested(FavoriteApplication favoriteApplication);
102 void focusRequested(const QString &appId);
105 void add(ApplicationInfo *application);
106 void remove(ApplicationInfo* application);
107 void showApplicationWindow(ApplicationInfo *application);
108 void buildListOfAvailableApplications();
109 void generateQmlStrings(ApplicationInfo *application);
110 void createMainStageComponent();
111 void createMainStage();
112 void createSideStageComponent();
113 void createSideStage();
114 int m_keyboardHeight;
115 bool m_keyboardVisible;
116 QList<ApplicationInfo*> m_runningApplications;
117 QList<ApplicationInfo*> m_availableApplications;
118 QQmlComponent *m_mainStageComponent;
119 QQuickItem *m_mainStage;
120 QQmlComponent *m_sideStageComponent;
121 QQuickItem *m_sideStage;
124Q_DECLARE_OPERATORS_FOR_FLAGS(ApplicationManager::ExecFlags)
126Q_DECLARE_METATYPE(ApplicationManager*)
128#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