1// Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
2// Copyright (C) 2013 Teo Mrnjavac <teo@kde.org>
3// Copyright (C) 2016 The Qt Company Ltd.
4// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
5
6#ifndef QPLATFORMSESSIONMANAGER_H
7#define QPLATFORMSESSIONMANAGER_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is part of the QPA API and is not meant to be used
14// in applications. Usage of this API may make your code
15// source and binary incompatible with future versions of Qt.
16//
17
18#include <QtGui/qtguiglobal.h>
19#include <QtCore/qmetatype.h>
20#include <QtCore/qnamespace.h>
21
22#include <QtGui/qsessionmanager.h>
23
24#ifndef QT_NO_SESSIONMANAGER
25
26QT_BEGIN_NAMESPACE
27
28class Q_GUI_EXPORT QPlatformSessionManager
29{
30public:
31 Q_DISABLE_COPY_MOVE(QPlatformSessionManager)
32
33 explicit QPlatformSessionManager(const QString &id, const QString &key);
34 virtual ~QPlatformSessionManager();
35
36 virtual QString sessionId() const;
37 virtual QString sessionKey() const;
38
39 virtual bool allowsInteraction();
40 virtual bool allowsErrorInteraction();
41 virtual void release();
42
43 virtual void cancel();
44
45 virtual void setRestartHint(QSessionManager::RestartHint restartHint);
46 virtual QSessionManager::RestartHint restartHint() const;
47
48 virtual void setRestartCommand(const QStringList &command);
49 virtual QStringList restartCommand() const;
50 virtual void setDiscardCommand(const QStringList &command);
51 virtual QStringList discardCommand() const;
52
53 virtual void setManagerProperty(const QString &name, const QString &value);
54 virtual void setManagerProperty(const QString &name, const QStringList &value);
55
56 virtual bool isPhase2() const;
57 virtual void requestPhase2();
58
59 void appCommitData();
60 void appSaveState();
61
62protected:
63 QString m_sessionId;
64 QString m_sessionKey;
65
66private:
67 QStringList m_restartCommand;
68 QStringList m_discardCommand;
69 QSessionManager::RestartHint m_restartHint;
70};
71
72QT_END_NAMESPACE
73
74#endif // QT_NO_SESSIONMANAGER
75
76#endif // QPLATFORMSESSIONMANAGER_H
77

source code of qtbase/src/gui/kernel/qplatformsessionmanager.h