00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef PROGRAMSENSOR_H
00011 #define PROGRAMSENSOR_H
00012 #include "sensor.h"
00013 #include <kprocess.h>
00014 #include <kprocio.h>
00015 #include <tqstring.h>
00016 #include <tqstringlist.h>
00017 #include <tqvaluevector.h>
00018 #include <tqtextcodec.h>
00019 class ProgramSensor : public Sensor
00020 {
00021 Q_OBJECT
00022
00023 public:
00024 ProgramSensor(const TQString &programName, int msec=1000, TQString encoding="" );
00025 ~ProgramSensor();
00026 void update();
00027
00028 private:
00029 TQTextCodec *codec;
00030 KShellProcess ksp;
00031 TQString programName;
00032 TQString sensorResult;
00033
00034 public slots:
00035 void receivedStdout(TDEProcess *proc, char *buffer, int buflen);
00036 void processExited(TDEProcess *proc);
00037 };
00038
00039 #endif // PROGRAMSENSOR_H