#ifndef VDR_PERL_PROCESS_H
#define VDR_PERL_PROCESS_H

#include "comm.h"
#include <vdr/tools.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

class cOsdObject;

class cPerlProcess: public cPerlComm {
private:
	int mPid;
	char *mPath;
	int mArgc;
	char **mArgv;
	FILE *mPipe;
	bool mRunning;

	char *mMainMenuEntry;
	char *mVersion;
	char *mDescription;

	cOsdObject *mObject;

protected:
	virtual void HandleAction(const char *Action);

	void SetParameter(const char *Opts);
	void FinishCallback(const char *Opts);

public:
	cPerlProcess(void);
	~cPerlProcess();

	void ProcessArgs(int argc, char *argv[]);
	void SetPath(const char *Path) { mPath = strdup(Path); }
	void Start(void);

	const char *Version(void) const { return mVersion; }
	const char *Description(void) const { return mDescription; }
	const char *MainMenuEntry(void) const { return mMainMenuEntry; }
	cOsdObject *MainMenuAction(void);
};

#endif // VDR_PERL_PROCESS_H
