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
00054 public:
00064 enum Status {
00065 INACTIVE,
00066 RUNNING,
00067 SUCCESS,
00068 UNAUTHORISED,
00069 DIED,
00070 NOT_FOUND,
00071 START_FAIL
00072 };
00076 explicit ShellProcess(const TQString& command);
00081 bool start(Communication comm = NoCommunication);
00083 Status status() const { return mStatus; }
00087 bool normalExit() const { return mStatus == SUCCESS; }
00089 const TQString& command() const { return mCommand; }
00094 TQString errorMessage() const;
00096 void writeStdin(const char* buffer, int bufflen);
00098 void stdinExit();
00102 static bool authorised();
00106 static const TQCString& shellName() { shellPath(); return mShellName; }
00110 static const TQCString& shellPath();
00111
00112 signals:
00116 void shellExited(ShellProcess*);
00117
00118 private slots:
00119 void writtenStdin(TDEProcess*);
00120 void slotExited(TDEProcess*);
00121
00122 private:
00123
00124 ShellProcess& operator<<(const TQString&);
00125 ShellProcess& operator<<(const TQCString&);
00126 ShellProcess& operator<<(const TQStringList&);
00127 ShellProcess& operator<<(const char*);
00128
00129 static TQCString mShellName;
00130 static TQCString mShellPath;
00131 static bool mInitialised;
00132 static bool mAuthorised;
00133 TQString mCommand;
00134 TQValueList<TQCString> mStdinQueue;
00135 Status mStatus;
00136 bool mStdinExit;
00137 };
00138
00139 #endif // SHELLPROCESS_H
|