00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSG_SENSORSHELLAGENT_H
00022 #define KSG_SENSORSHELLAGENT_H
00023
00024 #include <tqobject.h>
00025 #include <tqptrlist.h>
00026 #include <tqguardedptr.h>
00027
00028 #include <SensorAgent.h>
00029
00030 class TQString;
00031
00032 class KProcess;
00033
00034 namespace KSGRD {
00035
00036 class SensorClient;
00037 class SensorManager;
00038
00046 class SensorShellAgent : public SensorAgent
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 SensorShellAgent( SensorManager *sm );
00052 ~SensorShellAgent();
00053
00054 bool start( const TQString &host, const TQString &shell,
00055 const TQString &command = "", int port = -1 );
00056
00057 void hostInfo( TQString &shell, TQString &command, int &port) const;
00058
00059 private slots:
00060 void msgSent( KProcess* );
00061 void msgRcvd( KProcess*, char *buffer, int buflen );
00062 void errMsgRcvd( KProcess*, char *buffer, int buflen );
00063 void daemonExited( KProcess* );
00064
00065 private:
00066 bool writeMsg( const char *msg, int len );
00067 bool txReady();
00068
00069 TQGuardedPtr<KProcess> mDaemon;
00070 TQString mShell;
00071 TQString mCommand;
00072 int mRetryCount;
00073 };
00074
00075 }
00076
00077 #endif