2
* Copyright (C) 2014-2015 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef QTMIR_TASK_CONTROLLER_H
19
#define QTMIR_TASK_CONTROLLER_H
22
#include <QSharedPointer>
24
#include <QStringList>
29
class ApplicationInfo;
31
class TaskController : public QObject
39
APPLICATION_FAILED_TO_START
42
TaskController(const TaskController&) = delete;
43
virtual ~TaskController() = default;
45
TaskController& operator=(const TaskController&) = delete;
47
virtual bool appIdHasProcessId(const QString &appId, pid_t pid) = 0;
49
virtual bool stop(const QString &appId) = 0;
50
virtual bool start(const QString &appId, const QStringList &arguments) = 0;
52
virtual bool suspend(const QString &appId) = 0;
53
virtual bool resume(const QString &appId) = 0;
55
virtual QSharedPointer<qtmir::ApplicationInfo> getInfoForApp(const QString &appId) const = 0;
58
void processStarting(const QString &appId);
59
void applicationStarted(const QString &appId);
60
void processStopped(const QString &appId);
61
void processSuspended(const QString &appId);
62
void focusRequested(const QString &appId);
63
void resumeRequested(const QString &appId);
65
void processFailed(const QString &appId, TaskController::Error error);
68
TaskController() = default;
73
#endif // QTMIR_TASK_CONTROLLER_H