1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the QtGui module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at [email protected].
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #include <qsessionmanager.h>
|
---|
43 |
|
---|
44 | #ifndef QT_NO_SESSIONMANAGER
|
---|
45 |
|
---|
46 | QT_BEGIN_NAMESPACE
|
---|
47 |
|
---|
48 | class QSessionManagerPrivate : public QObjectPrivate
|
---|
49 | {
|
---|
50 | public:
|
---|
51 | QSessionManagerPrivate(QSessionManager *m, const QString &id,
|
---|
52 | const QString &key);
|
---|
53 |
|
---|
54 | QStringList restartCommand;
|
---|
55 | QStringList discardCommand;
|
---|
56 | const QString sessionId;
|
---|
57 | const QString sessionKey;
|
---|
58 | QSessionManager::RestartHint restartHint;
|
---|
59 | };
|
---|
60 |
|
---|
61 | QSessionManagerPrivate::QSessionManagerPrivate(QSessionManager*,
|
---|
62 | const QString &id,
|
---|
63 | const QString &key)
|
---|
64 | : QObjectPrivate(), sessionId(id), sessionKey(key)
|
---|
65 | {
|
---|
66 | }
|
---|
67 |
|
---|
68 | QSessionManager::QSessionManager(QApplication *app, QString &id, QString &key)
|
---|
69 | : QObject(*new QSessionManagerPrivate(this, id, key), app)
|
---|
70 | {
|
---|
71 | Q_D(QSessionManager);
|
---|
72 | d->restartHint = RestartIfRunning;
|
---|
73 | }
|
---|
74 |
|
---|
75 | QSessionManager::~QSessionManager()
|
---|
76 | {
|
---|
77 | }
|
---|
78 |
|
---|
79 | QString QSessionManager::sessionId() const
|
---|
80 | {
|
---|
81 | Q_D(const QSessionManager);
|
---|
82 | return d->sessionId;
|
---|
83 | }
|
---|
84 |
|
---|
85 | QString QSessionManager::sessionKey() const
|
---|
86 | {
|
---|
87 | Q_D(const QSessionManager);
|
---|
88 | return d->sessionKey;
|
---|
89 | }
|
---|
90 |
|
---|
91 |
|
---|
92 | bool QSessionManager::allowsInteraction()
|
---|
93 | {
|
---|
94 | return false;
|
---|
95 | }
|
---|
96 |
|
---|
97 | bool QSessionManager::allowsErrorInteraction()
|
---|
98 | {
|
---|
99 | return false;
|
---|
100 | }
|
---|
101 |
|
---|
102 | void QSessionManager::release()
|
---|
103 | {
|
---|
104 | }
|
---|
105 |
|
---|
106 | void QSessionManager::cancel()
|
---|
107 | {
|
---|
108 | }
|
---|
109 |
|
---|
110 | void QSessionManager::setRestartHint(QSessionManager::RestartHint hint)
|
---|
111 | {
|
---|
112 | Q_D(QSessionManager);
|
---|
113 | d->restartHint = hint;
|
---|
114 | }
|
---|
115 |
|
---|
116 | QSessionManager::RestartHint QSessionManager::restartHint() const
|
---|
117 | {
|
---|
118 | Q_D(const QSessionManager);
|
---|
119 | return d->restartHint;
|
---|
120 | }
|
---|
121 |
|
---|
122 | void QSessionManager::setRestartCommand(const QStringList &command)
|
---|
123 | {
|
---|
124 | Q_D(QSessionManager);
|
---|
125 | d->restartCommand = command;
|
---|
126 | }
|
---|
127 |
|
---|
128 | QStringList QSessionManager::restartCommand() const
|
---|
129 | {
|
---|
130 | Q_D(const QSessionManager);
|
---|
131 | return d->restartCommand;
|
---|
132 | }
|
---|
133 |
|
---|
134 | void QSessionManager::setDiscardCommand(const QStringList &command)
|
---|
135 | {
|
---|
136 | Q_D(QSessionManager);
|
---|
137 | d->discardCommand = command;
|
---|
138 | }
|
---|
139 |
|
---|
140 | QStringList QSessionManager::discardCommand() const
|
---|
141 | {
|
---|
142 | Q_D(const QSessionManager);
|
---|
143 | return d->discardCommand;
|
---|
144 | }
|
---|
145 |
|
---|
146 | void QSessionManager::setManagerProperty(const QString &name,
|
---|
147 | const QString &value)
|
---|
148 | {
|
---|
149 | Q_UNUSED(name);
|
---|
150 | Q_UNUSED(value);
|
---|
151 | }
|
---|
152 |
|
---|
153 | void QSessionManager::setManagerProperty(const QString &name,
|
---|
154 | const QStringList &value)
|
---|
155 | {
|
---|
156 | Q_UNUSED(name);
|
---|
157 | Q_UNUSED(value);
|
---|
158 | }
|
---|
159 |
|
---|
160 | bool QSessionManager::isPhase2() const
|
---|
161 | {
|
---|
162 | return false;
|
---|
163 | }
|
---|
164 |
|
---|
165 | void QSessionManager::requestPhase2()
|
---|
166 | {
|
---|
167 | }
|
---|
168 |
|
---|
169 | QT_END_NAMESPACE
|
---|
170 |
|
---|
171 | #endif // QT_NO_SESSIONMANAGER
|
---|