1/****************************************************************************
2**
3** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
4** Copyright (C) 2013 Teo Mrnjavac <teo@kde.org>
5** Copyright (C) 2016 The Qt Company Ltd.
6** Contact: https://www.qt.io/licensing/
7**
8** This file is part of the QtGui module of the Qt Toolkit.
9**
10** $QT_BEGIN_LICENSE:LGPL$
11** Commercial License Usage
12** Licensees holding valid commercial Qt licenses may use this file in
13** accordance with the commercial license agreement provided with the
14** Software or, alternatively, in accordance with the terms contained in
15** a written agreement between you and The Qt Company. For licensing terms
16** and conditions see https://www.qt.io/terms-conditions. For further
17** information use the contact form at https://www.qt.io/contact-us.
18**
19** GNU Lesser General Public License Usage
20** Alternatively, this file may be used under the terms of the GNU Lesser
21** General Public License version 3 as published by the Free Software
22** Foundation and appearing in the file LICENSE.LGPL3 included in the
23** packaging of this file. Please review the following information to
24** ensure the GNU Lesser General Public License version 3 requirements
25** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
26**
27** GNU General Public License Usage
28** Alternatively, this file may be used under the terms of the GNU
29** General Public License version 2.0 or (at your option) the GNU General
30** Public license version 3 or any later version approved by the KDE Free
31** Qt Foundation. The licenses are as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
33** included in the packaging of this file. Please review the following
34** information to ensure the GNU General Public License requirements will
35** be met: https://www.gnu.org/licenses/gpl-2.0.html and
36** https://www.gnu.org/licenses/gpl-3.0.html.
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QPLATFORMSESSIONMANAGER_H
43#define QPLATFORMSESSIONMANAGER_H
44
45//
46// W A R N I N G
47// -------------
48//
49// This file is part of the QPA API and is not meant to be used
50// in applications. Usage of this API may make your code
51// source and binary incompatible with future versions of Qt.
52//
53
54#include <QtGui/qtguiglobal.h>
55#include <QtCore/qmetatype.h>
56#include <QtCore/qnamespace.h>
57
58#include <QtGui/qsessionmanager.h>
59
60#ifndef QT_NO_SESSIONMANAGER
61
62QT_BEGIN_NAMESPACE
63
64class Q_GUI_EXPORT QPlatformSessionManager
65{
66public:
67 Q_DISABLE_COPY_MOVE(QPlatformSessionManager)
68
69 explicit QPlatformSessionManager(const QString &id, const QString &key);
70 virtual ~QPlatformSessionManager();
71
72 virtual QString sessionId() const;
73 virtual QString sessionKey() const;
74
75 virtual bool allowsInteraction();
76 virtual bool allowsErrorInteraction();
77 virtual void release();
78
79 virtual void cancel();
80
81 virtual void setRestartHint(QSessionManager::RestartHint restartHint);
82 virtual QSessionManager::RestartHint restartHint() const;
83
84 virtual void setRestartCommand(const QStringList &command);
85 virtual QStringList restartCommand() const;
86 virtual void setDiscardCommand(const QStringList &command);
87 virtual QStringList discardCommand() const;
88
89 virtual void setManagerProperty(const QString &name, const QString &value);
90 virtual void setManagerProperty(const QString &name, const QStringList &value);
91
92 virtual bool isPhase2() const;
93 virtual void requestPhase2();
94
95 void appCommitData();
96 void appSaveState();
97
98protected:
99 QString m_sessionId;
100 QString m_sessionKey;
101
102private:
103 QStringList m_restartCommand;
104 QStringList m_discardCommand;
105 QSessionManager::RestartHint m_restartHint;
106};
107
108QT_END_NAMESPACE
109
110#endif // QT_NO_SESSIONMANAGER
111
112#endif // QPLATFORMSESSIONMANAGER_H
113