d95963b654c4d2a582b21866fe759169c30e78a9
[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 #include "AglShellGrpcClient.h"
16
17 using namespace std;
18
19 class HomescreenHandler : public QObject
20 {
21         Q_OBJECT
22 public:
23         explicit HomescreenHandler(ApplicationLauncher *launcher = 0, GrpcClient *_client = nullptr, QObject *parent = 0);
24         ~HomescreenHandler();
25
26         Q_INVOKABLE void tapShortcut(QString application_id);
27
28         void addAppToStack(const QString& application_id);
29         void activateApp(const QString& app_id);
30         void deactivateApp(const QString& app_id);
31
32         QStringList apps_stack;
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         GrpcClient *m_grpc_client;
45 };
46
47 #endif // HOMESCREENHANDLER_H