e0141921f58a9a0394449039880a15a725f20fa3
[apps/homescreen.git] / homescreen / src / homescreenhandler.h
1 // SPDX-License-Identifier: Apache-2.0
2 /*
3  * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
4  * Copyright (c) 2022 Konsulko Group
5  */
6
7 #ifndef HOMESCREENHANDLER_H
8 #define HOMESCREENHANDLER_H
9
10 #include <QObject>
11 #include <string>
12
13 #include "applicationlauncher.h"
14 #include "AppLauncherClient.h"
15
16 #include "shell.h"
17
18 using namespace std;
19
20 class HomescreenHandler : public QObject
21 {
22         Q_OBJECT
23 public:
24         explicit HomescreenHandler(Shell *aglShell, ApplicationLauncher *launcher = 0, QObject *parent = 0);
25         ~HomescreenHandler();
26
27         Q_INVOKABLE void tapShortcut(QString application_id);
28
29         void addAppToStack(const QString& application_id);
30         void activateApp(const QString& app_id);
31         void deactivateApp(const QString& app_id);
32
33         std::list<std::pair<const QString, const QString>> pending_app_list;
34 signals:
35         void showNotification(QString application_id, QString icon_path, QString text);
36         void showInformation(QString info);
37
38 public slots:
39         void processAppStatusEvent(const QString &id, const QString &status);
40
41 private:
42         ApplicationLauncher *mp_launcher;
43         AppLauncherClient *mp_applauncher_client;
44
45         Shell *aglShell;
46
47         QStringList apps_stack;
48 };
49
50 #endif // HOMESCREENHANDLER_H