AglShellGrpcClient: Activate windows with 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 #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         void setGrpcClient(GrpcClient *_client) { m_grpc_client = _client; }
32         GrpcClient *getGrpcClient(void) { return m_grpc_client; }
33
34         QStringList apps_stack;
35         std::list<std::pair<const QString, const QString>> pending_app_list;
36 signals:
37         void showNotification(QString application_id, QString icon_path, QString text);
38         void showInformation(QString info);
39
40 public slots:
41         void processAppStatusEvent(const QString &id, const QString &status);
42
43 private:
44         ApplicationLauncher *mp_launcher;
45         AppLauncherClient *mp_applauncher_client;
46         GrpcClient *m_grpc_client;
47 };
48
49 #endif // HOMESCREENHANDLER_H