KDEsu
stub.h
Go to the documentation of this file.
00001 /* vi: ts=8 sts=4 sw=4 00002 * 00003 * This file is part of the KDE project, module kdesu. 00004 * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org> 00005 * 00006 * This is free software; you can use this library under the GNU Library 00007 * General Public License, version 2. See the file "COPYING.LIB" for the 00008 * exact licensing terms. 00009 */ 00010 00011 #ifndef __Stub_h_Included__ 00012 #define __Stub_h_Included__ 00013 00014 #include <QtCore/QByteRef> 00015 #include <QtCore/QList> 00016 00017 #include "process.h" 00018 00019 #include <kdesu/kdesu_export.h> 00020 00021 namespace KDESu { 00022 00023 namespace KDESuPrivate { class KCookie; } 00024 00025 00032 class KDESU_EXPORT StubProcess: public PtyProcess 00033 { 00034 public: 00035 StubProcess(); 00036 ~StubProcess(); 00037 00041 void setCommand(const QByteArray &command); 00042 00046 void setUser(const QByteArray &user); 00047 00051 void setXOnly(bool xonly); 00052 00058 void setPriority(int prio); 00059 00064 enum Scheduler { SchedNormal, SchedRealtime }; 00065 00069 void setScheduler(int sched); 00070 00071 protected: 00072 00076 int ConverseStub(int check); 00077 00082 virtual QByteArray display(); 00083 #ifdef Q_WS_X11 00084 00087 virtual QByteArray displayAuth(); 00088 #endif 00089 bool m_bXOnly; 00090 int m_Priority; 00091 int m_Scheduler; 00092 QByteArray m_Command; 00093 QByteArray m_User; 00094 KDESuPrivate::KCookie *m_pCookie; 00095 00096 private: 00097 QByteArray commaSeparatedList(const QList<QByteArray> &); 00098 void writeString(const QByteArray &str); 00099 00100 protected: 00101 virtual void virtual_hook( int id, void* data ); 00102 private: 00103 class StubProcessPrivate; 00104 StubProcessPrivate * const d; 00105 }; 00106 00107 } 00108 00109 #endif // __Stub_h_Included__
KDE 4.6 API Reference