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 "ApplicationListModel.h"
24#include "ApplicationInfo.h"
28class ApplicationManager : public QObject {
32 Q_ENUMS(FormFactorHint)
33 Q_ENUMS(FavoriteApplication)
36 Q_PROPERTY(int keyboardHeight READ keyboardHeight NOTIFY keyboardHeightChanged)
37 Q_PROPERTY(bool keyboardVisible READ keyboardVisible NOTIFY keyboardVisibleChanged)
39 Q_PROPERTY(int sideStageWidth READ sideStageWidth)
40 Q_PROPERTY(StageHint stageHint READ stageHint)
41 Q_PROPERTY(FormFactorHint formFactorHint READ formFactorHint)
42 Q_PROPERTY(ApplicationListModel* mainStageApplications READ mainStageApplications)
43 Q_PROPERTY(ApplicationListModel* sideStageApplications READ sideStageApplications)
44 Q_PROPERTY(ApplicationInfo* mainStageFocusedApplication READ mainStageFocusedApplication
45 NOTIFY mainStageFocusedApplicationChanged)
46 Q_PROPERTY(ApplicationInfo* sideStageFocusedApplication READ sideStageFocusedApplication
47 NOTIFY sideStageFocusedApplicationChanged)
49 Q_PROPERTY(bool fake READ fake CONSTANT)
52 ApplicationManager(QObject *parent = NULL);
53 virtual ~ApplicationManager();
56 Dash, Default, Indicators, Notifications, Greeter, Launcher, OnScreenKeyboard,
60 MainStage, IntegrationStage, ShareStage, ContentPickingStage,
61 SideStage, ConfigurationStage
64 DesktopFormFactor, PhoneFormFactor, TabletFormFactor
66 enum FavoriteApplication {
67 CameraApplication, GalleryApplication, BrowserApplication, ShareApplication
73 Q_DECLARE_FLAGS(ExecFlags, Flag)
75 int keyboardHeight() const;
76 bool keyboardVisible() const;
77 int sideStageWidth() const;
78 StageHint stageHint() const;
79 FormFactorHint formFactorHint() const;
80 ApplicationListModel* mainStageApplications() const;
81 ApplicationListModel* sideStageApplications() const;
82 ApplicationInfo* mainStageFocusedApplication() const;
83 ApplicationInfo* sideStageFocusedApplication() const;
85 bool fake() { return true; }
87 Q_INVOKABLE void focusApplication(int handle);
88 Q_INVOKABLE void unfocusCurrentApplication(StageHint stageHint);
89 Q_INVOKABLE ApplicationInfo* startProcess(QString desktopFile,
91 QStringList arguments = QStringList());
92 Q_INVOKABLE void stopProcess(ApplicationInfo* application);
93 Q_INVOKABLE void startWatcher() {}
96 void keyboardHeightChanged();
97 void keyboardVisibleChanged();
98 void mainStageFocusedApplicationChanged();
99 void sideStageFocusedApplicationChanged();
100 void focusRequested(FavoriteApplication favoriteApplication);
103 void showApplicationWindow(ApplicationInfo *application);
104 void buildListOfAvailableApplications();
105 void generateQmlStrings(ApplicationInfo *application);
106 void createMainStageComponent();
107 void createMainStage();
108 void createSideStageComponent();
109 void createSideStage();
110 int m_keyboardHeight;
111 bool m_keyboardVisible;
112 ApplicationListModel* m_mainStageApplications;
113 ApplicationListModel* m_sideStageApplications;
114 ApplicationInfo* m_mainStageFocusedApplication;
115 ApplicationInfo* m_sideStageFocusedApplication;
116 QList<ApplicationInfo*> m_availableApplications;
117 QQmlComponent *m_mainStageComponent;
118 QQuickItem *m_mainStage;
119 QQmlComponent *m_sideStageComponent;
120 QQuickItem *m_sideStage;
123Q_DECLARE_OPERATORS_FOR_FLAGS(ApplicationManager::ExecFlags)
125Q_DECLARE_METATYPE(ApplicationManager*)
127#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