~lukas-kde/miral/shellchrome-windowinfo

« back to all changes in this revision

Viewing changes to miral-qt/src/modules/Unity/Application/taskcontroller.h

  • Committer: Larry Price
  • Date: 2016-09-13 16:19:29 UTC
  • mto: (330.4.1 miral)
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: larry.price@canonical.com-20160913161929-vs9ka1capmljq1es
Removing miral-qt from release branch, updating copyright file, and adding GPL3 license to root dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2014-2015 Canonical, Ltd.
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 */
17
 
 
18
 
#ifndef QTMIR_TASK_CONTROLLER_H
19
 
#define QTMIR_TASK_CONTROLLER_H
20
 
 
21
 
#include <QObject>
22
 
#include <QSharedPointer>
23
 
#include <QString>
24
 
#include <QStringList>
25
 
 
26
 
namespace qtmir
27
 
{
28
 
 
29
 
class ApplicationInfo;
30
 
 
31
 
class TaskController : public QObject
32
 
{
33
 
    Q_OBJECT
34
 
 
35
 
public:
36
 
    enum class Error
37
 
    {
38
 
        APPLICATION_CRASHED,
39
 
        APPLICATION_FAILED_TO_START
40
 
    };
41
 
 
42
 
    TaskController(const TaskController&) = delete;
43
 
    virtual ~TaskController() = default;
44
 
 
45
 
    TaskController& operator=(const TaskController&) = delete;
46
 
 
47
 
    virtual bool appIdHasProcessId(const QString &appId, pid_t pid) = 0;
48
 
 
49
 
    virtual bool stop(const QString &appId) = 0;
50
 
    virtual bool start(const QString &appId, const QStringList &arguments) = 0;
51
 
 
52
 
    virtual bool suspend(const QString &appId) = 0;
53
 
    virtual bool resume(const QString &appId) = 0;
54
 
 
55
 
    virtual QSharedPointer<qtmir::ApplicationInfo> getInfoForApp(const QString &appId) const = 0;
56
 
 
57
 
Q_SIGNALS:
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);
64
 
 
65
 
    void processFailed(const QString &appId, TaskController::Error error);
66
 
 
67
 
protected:
68
 
    TaskController() = default;
69
 
};
70
 
 
71
 
} // namespace qtmir
72
 
 
73
 
#endif // QTMIR_TASK_CONTROLLER_H