diff options
author | Teo Mrnjavac <teo@kde.org> | 2013-09-11 17:22:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-13 11:47:06 +0200 |
commit | 060b862b614285aae88540895736a57eb8563102 (patch) | |
tree | 40d564877eb856e8f7d840d992552b00b8a1cd0c /src/plugins/platforms/xcb/qxcbsessionmanager.h | |
parent | f4ebb061899da67aa26c08516fa7ee8c7b11dcbf (diff) |
Bring back Qt4 X11 session management functionality.
Added QXcbSessionManager to the Xcb plugin.
QXcbSessionManager inherits from QPlatformSessionManager, it's a port of
QSessionManager as it is in Qt 4.8.
Minor changes also in QPlatformSessionManager and QGuiApplication to
hook it up.
Task-number: QTBUG-28228
Task-number: QTBUG-30011
Task-number: QTBUG-33033
Change-Id: I50b33d05a1e32c5278dea339f693713acc870a70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbsessionmanager.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbsessionmanager.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbsessionmanager.h b/src/plugins/platforms/xcb/qxcbsessionmanager.h new file mode 100644 index 0000000000..0dca36d16f --- /dev/null +++ b/src/plugins/platforms/xcb/qxcbsessionmanager.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Teo Mrnjavac <teo@kde.org> +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QXCBSESSIONMANAGER_H +#define QXCBSESSIONMANAGER_H + +#include <qpa/qplatformsessionmanager.h> + +QT_BEGIN_NAMESPACE + +class QEventLoop; + +class QXcbSessionManager : public QPlatformSessionManager +{ +public: + QXcbSessionManager(const QString &id, const QString &key); + virtual ~QXcbSessionManager(); + + void *handle() const; + + void setSessionId(const QString &id); + void setSessionKey(const QString &key); + + bool allowsInteraction() Q_DECL_OVERRIDE; + bool allowsErrorInteraction() Q_DECL_OVERRIDE; + void release() Q_DECL_OVERRIDE; + + void cancel() Q_DECL_OVERRIDE; + + void setManagerProperty(const QString &name, const QString &value) Q_DECL_OVERRIDE; + void setManagerProperty(const QString &name, const QStringList &value) Q_DECL_OVERRIDE; + + bool isPhase2() const Q_DECL_OVERRIDE; + void requestPhase2() Q_DECL_OVERRIDE; + + void appCommitData() Q_DECL_OVERRIDE; + void appSaveState() Q_DECL_OVERRIDE; + + void exitEventLoop(); + +private: + QEventLoop *m_eventLoop; + + Q_DISABLE_COPY(QXcbSessionManager) +}; + +QT_END_NAMESPACE + +#endif //QXCBSESSIONMANAGER_H |