#ifndef _SETUP_H
#define _SETUP_H


#include <vdr/config.h>
#include <vdr/plugin.h>
#include <vdr/tools.h>
#include "vboxclient.h"

extern char *resolvenumber_script;

class cVBOXUser : public cListObject {
private:
	cVBOXClient * m_pVBOX;
	char * m_sServer;
	int	   m_nPort;
	char * m_sName;
	char * m_sPassword;
	char * m_sPIN;
 
	void _Free(void);
	
public:
  cVBOXUser();
//  cVBOXUser(const char * sServer,int nPort, const char *sName, const char * sPassword, const char *sPIN);
  ~cVBOXUser();

  bool Parse(char *s);
  bool Save(FILE *f);

  const char *Server(void) { return m_sServer; }
  int		  Port(void) {return m_nPort;}
  const char *Name(void) { return m_sName; }
  const char *Password(void) {return m_sPassword;}
  const char *PIN(void) { return m_sPIN; }
  cVBOXClient * GetVBOX(void){ return m_pVBOX; }	
  bool GetServerNewMsgCount(int *pCount,time_t *pTimeLatest);

};


class cVBOXUserlist : public cConfig<cVBOXUser>
{
private:

public:
  cVBOXUserlist(){}
//  cVBOXUserlist(const char * sServer,int nPort, const char *sName, const char * sPassword, const char *sPIN);  
  ~cVBOXUserlist(){}


};

class cMenuSetupVBOX;

class cVBOXSetup
{
public:
	cVBOXSetup()
		:m_bNotifyAboutNewCalls(true),
		m_bConfirmDeletion(true)
	{}

	void AddMenuEntrys(cMenuSetupPage *pSetupMenu);
	void Store(cMenuSetupVBOX *pSetupMenu);
	bool Parse(const char *Name, const char *Value);

public:
	int m_bNotifyAboutNewCalls;
	int m_bConfirmDeletion;
};


class cMenuSetupVBOX : public cMenuSetupPage {
private:
	cVBOXSetup *m_pVBOXSetup;
protected:
  virtual void Store (void);
public:
  cMenuSetupVBOX(cVBOXSetup *pVBOXSetup);
  void SetupStore(const char *Name, const char *Value = NULL)
  {
	  cMenuSetupPage::SetupStore(Name,Value);
  }
  void SetupStore(const char *Name, int Value)
  {
	  cMenuSetupPage::SetupStore(Name,Value);
  }
};




#endif