/*
 * Otv4vdr.h: A plugin for the Video Disk Recorder
 *
 */

#ifndef ___Otv4VDR_H
#define ___Otv4VDR_H

#include <vdr/thread.h>

#define VERSION         "0.0.1"
#define OTV4VDR         "Otv4vdr"
#define DESCRIPTION     "Update your favorite TV programs"
#define MAINMENUENTRY   "Update TV programs"
#define UPDATING        "Updating EPG, please wait..."
#define CHANNEL         "Channel number (10873 transp.):"
#define DOWNLOADED      "'EPG downloaded, now processing...'"
#define UPDATED         "'EPG updated!'"
#define ERR_DOWNLOADED  "'Unable to download EPG.'"
#define BAD_CHANNEL      "Bad channel for 10873 transponder. Did you configure it?"

class cDoIt : public cThread {
public:
  cDoIt (const char * , int);
  virtual ~cDoIt();
protected:
  char cconfigdirectory[400];
  int  ichannelsource;
  virtual void Action(void);
  };

class cMenuSetupOtv4vdr : public cMenuSetupPage {
private:
  char *cfgdir;
protected:
  virtual void Store(void);
public:
  cMenuSetupOtv4vdr(const char *CfgDir);
  virtual ~cMenuSetupOtv4vdr();
  virtual eOSState ProcessKey(eKeys Key);
  };

class cOtv4vdrSetup {
public:
  cOtv4vdrSetup(void);
  };

class cPluginOtv4vdr : public cPlugin {
public:
  cPluginOtv4vdr(void);
  virtual ~cPluginOtv4vdr();
  virtual const char *Version(void) { return VERSION; }
  virtual const char *Description(void) { return tr(DESCRIPTION); }
  virtual const char *CommandLineHelp(void);
  virtual bool ProcessArgs(int argc, char *argv[]);
  virtual bool Initialize(void);
  virtual bool Start(void);
  virtual void Stop(void);
  virtual void Housekeeping(void);
  virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); }
  virtual cOsdObject *MainMenuAction(void);
  void write_file(char *filename, char *data, unsigned long datasize);
  virtual cMenuSetupPage *SetupMenu(void);
  virtual bool SetupParse(const char *Name, const char *Value);
  virtual bool Service(const char *Id, void *Data = NULL);
  virtual const char **SVDRPHelpPages(void);
  virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
  cDoIt *UpdateProcess;
  };


#endif  //___Otv4VDR_H
