kalarm/lib
shellprocess.hGo 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 SHELLPROCESS_H
00022 #define SHELLPROCESS_H
00023
00026 #include <kprocess.h>
00027
00028
00050 class ShellProcess : public KShellProcess
00051 {
00052 Q_OBJECT
00053 public:
00063 enum Status {
00064 INACTIVE,
00065 RUNNING,
00066 SUCCESS,
00067 UNAUTHORISED,
00068 DIED,
00069 NOT_FOUND,
00070 START_FAIL
00071 };
00075 ShellProcess(const QString& command);
00080 bool start(Communication comm = NoCommunication);
00082 Status status() const { return mStatus; }
00086 bool normalExit() const { return mStatus == SUCCESS; }
00088 const QString& command() const { return mCommand; }
00093 QString errorMessage() const;
00095 void writeStdin(const char* buffer, int bufflen);
00097 void stdinExit();
00101 static bool authorised();
00105 static const QCString& shellName() { shellPath(); return mShellName; }
00109 static const QCString& shellPath();
00110
00111 signals:
00115 void shellExited(ShellProcess*);
00116
00117 private slots:
00118 void writtenStdin(KProcess*);
00119 void slotExited(KProcess*);
00120
00121 private:
00122
00123 ShellProcess& operator<<(const QString&);
00124 ShellProcess& operator<<(const QCString&);
00125 ShellProcess& operator<<(const QStringList&);
00126 ShellProcess& operator<<(const char*);
00127
00128 static QCString mShellName;
00129 static QCString mShellPath;
00130 static bool mInitialised;
00131 static bool mAuthorised;
00132 QString mCommand;
00133 QValueList<QCString> mStdinQueue;
00134 Status mStatus;
00135 bool mStdinExit;
00136 };
00137
00138 #endif // SHELLPROCESS_H
|