/*
 * config.h: declare a class that holds the setup-data and and attached menuhandler.
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#ifndef _CONFIG_H
#define _CONFIG_H
#include <vdr/menuitems.h>
#include <mysql.h>

static const short DBHOST_LEN    = 50;
static const short DBNAME_LEN    = 20;
static const short DBUSER_LEN    = 20;
static const short DBPW_LEN      = 25;
static const short TYPE_NAME_LEN = 50;

class cXmsSetup {
private:
  MYSQL *dbi;	 
  bool   dbOpen;
public:
  char DbHost[DBHOST_LEN];
  char DbName[DBNAME_LEN];
  char DbUser[DBUSER_LEN];
  char DbPassword[DBPW_LEN];
  int  DbPort;
  char DbSocket[MaxFileName];
  char DefaultType[TYPE_NAME_LEN];
  
  cXmsSetup(void);
  bool SetupParse(const char *Name, const char *Value);
  bool DbOpen();
  void DbClose();
  MYSQL * DbHandle() { return dbi; }
  bool IsDbOpened() { return dbOpen; }
};

class cMenuSetupXms : public cMenuSetupPage {
private:
  cXmsSetup data;
protected:
  virtual void Store(void);
public:
  cMenuSetupXms(void);
};

extern cXmsSetup XmsSetup;
#endif
