initial change to grpc
[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         static HomescreenHandler *Instance(Shell *aglShell = 0, ApplicationLauncher *launcher = 0)
25         {
26                 static HomescreenHandler *inst = new HomescreenHandler(aglShell, launcher);
27                 return inst;
28         }
29
30         explicit HomescreenHandler(Shell *aglShell = 0, ApplicationLauncher *launcher = 0, QObject *parent = 0);
31         ~HomescreenHandler();
32
33         Q_INVOKABLE void tapShortcut(QString application_id);
34
35         void addAppToStack(const QString& application_id);
36         void activateApp(const QString& app_id);
37         void deactivateApp(const QString& app_id);
38
39 signals:
40         void showNotification(QString application_id, QString icon_path, QString text);
41         void showInformation(QString info);
42
43 public slots:
44         void processAppStatusEvent(const QString &id, const QString &status);
45
46 private:
47         ApplicationLauncher *mp_launcher;
48         AppLauncherClient *mp_applauncher_client;
49
50         Shell *aglShell;
51
52         QStringList apps_stack;
53 };
54
55 #endif // HOMESCREENHANDLER_H