libkworkspace
kdisplaymanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KDISPLAYMANAGER_H
00022 #define KDISPLAYMANAGER_H
00023
00024 #include "kworkspace.h"
00025 #include <kdemacros.h>
00026 #include <QtCore/QString>
00027 #include <QtCore/QList>
00028 #include <QtCore/QByteArray>
00029
00030 struct KDE_EXPORT SessEnt {
00031 QString display, from, user, session;
00032 int vt;
00033 bool self:1, tty:1;
00034 };
00035
00036 typedef QList<SessEnt> SessList;
00037
00038 class KDE_EXPORT KDisplayManager {
00039
00040 #ifdef Q_WS_X11
00041
00042 public:
00043 KDisplayManager();
00044 ~KDisplayManager();
00045
00046 bool canShutdown();
00047 void shutdown( KWorkSpace::ShutdownType shutdownType,
00048 KWorkSpace::ShutdownMode shutdownMode,
00049 const QString &bootOption = QString() );
00050
00051 void setLock( bool on );
00052
00053 bool isSwitchable();
00054 int numReserve();
00055 void startReserve();
00056 bool localSessions( SessList &list );
00057 bool switchVT( int vt );
00058 void lockSwitchVT( int vt );
00059
00060 bool bootOptions( QStringList &opts, int &dflt, int &curr );
00061
00062 static QString sess2Str( const SessEnt &se );
00063 static void sess2Str2( const SessEnt &se, QString &user, QString &loc );
00064
00065 private:
00066 bool exec( const char *cmd, QByteArray &ret );
00067 bool exec( const char *cmd );
00068
00069 void GDMAuthenticate();
00070
00071 #else // Q_WS_X11
00072
00073 public:
00074 KDisplayManager() {}
00075
00076 bool canShutdown() { return false; }
00077 void shutdown( KWorkSpace::ShutdownType shutdownType,
00078 KWorkSpace::ShutdownMode shutdownMode,
00079 const QString &bootOption = QString() ) {}
00080
00081 void setLock( bool ) {}
00082
00083 bool isSwitchable() { return false; }
00084 int numReserve() { return -1; }
00085 void startReserve() {}
00086 bool localSessions( SessList &list ) { return false; }
00087 void switchVT( int vt ) {}
00088
00089 bool bootOptions( QStringList &opts, int &dflt, int &curr );
00090
00091 #endif // Q_WS_X11
00092
00093 private:
00094 #ifdef Q_WS_X11
00095 class Private;
00096 Private * const d;
00097 #endif // Q_WS_X11
00098
00099 };
00100
00101 #endif // KDISPLAYMANAGER_H
00102