• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkworkspace

kdisplaymanager.h

Go to the documentation of this file.
00001 /*
00002    Copyright (C) 2004,2005 Oswald Buddenhagen <ossi@kde.org>
00003    Copyright (C) 2005 Stephan Kulow <coolo@kde.org>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the Lesser GNU General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     General Public License for more details.
00014 
00015    You should have received a copy of the Lesser GNU General Public License
00016    along with this program; see the file COPYING.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
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 }; // class KDisplayManager
00100 
00101 #endif // KDISPLAYMANAGER_H
00102 

libkworkspace

Skip menu "libkworkspace"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal