aboutsummaryrefslogtreecommitdiffstats
path: root/homescreen/src/homescreenhandler.h
blob: e0141921f58a9a0394449039880a15a725f20fa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// SPDX-License-Identifier: Apache-2.0
/*
 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
 * Copyright (c) 2022 Konsulko Group
 */

#ifndef HOMESCREENHANDLER_H
#define HOMESCREENHANDLER_H

#include <QObject>
#include <string>

#include "applicationlauncher.h"
#include "AppLauncherClient.h"

#include "shell.h"

using namespace std;

class HomescreenHandler : public QObject
{
	Q_OBJECT
public:
	explicit HomescreenHandler(Shell *aglShell, ApplicationLauncher *launcher = 0, QObject *parent = 0);
	~HomescreenHandler();

	Q_INVOKABLE void tapShortcut(QString application_id);

	void addAppToStack(const QString& application_id);
	void activateApp(const QString& app_id);
	void deactivateApp(const QString& app_id);

	std::list<std::pair<const QString, const QString>> pending_app_list;
signals:
	void showNotification(QString application_id, QString icon_path, QString text);
	void showInformation(QString info);

public slots:
	void processAppStatusEvent(const QString &id, const QString &status);

private:
	ApplicationLauncher *mp_launcher;
	AppLauncherClient *mp_applauncher_client;

	Shell *aglShell;

	QStringList apps_stack;
};

#endif // HOMESCREENHANDLER_H