/*
 * mainmenu.h: The actual menu implementations
 *
 * See the main source file 'vdr.c' for copyright information and
 * how to reach the author.
 *
 * $Id:
 */
    
#ifndef __UMSMENUS_H
#define __UMSMENUS_H

#include <vdr/osdbase.h>
#include <dirent.h>
#include "sndplayer.h"

#define MAX_CALLERID_LENGTH	600

const int et_voicemail	=  1;
const int et_fax	=  2;
const int et_calllist	=  3;

class cVBOXSndPlayerControl: public cSndPlayerControl
{
public:
    cVBOXSndPlayerControl(const char *fn)
	:cSndPlayerControl(fn)
    {}
};    	

class cUMSMainMenu : public cOsdMenu {
private:
  char *basePath;
  int GetNrVoiceMails(char *user);
  eOSState OpenSelectedBox(void);
  bool CheckCallHistory(char *user);
public:
  cUMSMainMenu(char *boxBasePath);
  void RebuildMenu(void);
  virtual eOSState ProcessKey(eKeys Key);
};

class cBoxMenu: public cOsdMenu {
private:
  cUMSMainMenu *parent;
  char basePath[200];
  char user[200];
  void Setup(void);
  int GetNrVoiceMails();
  eOSState OpenFolder(void);
public:
  cBoxMenu(cUMSMainMenu *Parent,char *heading,char *boxpath,char *boxname);
  void RebuildMenu(void);
  virtual eOSState ProcessKey(eKeys Key);
};  

class cVoiceMailMenu: public cOsdMenu {
private:
  bool bPlaying;
  cBoxMenu *parent;
  char basePath[200];
  char user[200];
  void AddVoiceMailItem(char *path,char* fn);
  void Setup(void);
  cVBOXSndPlayerControl *GetVBOXSndPlayerControl(void);
  eOSState DeleteVoiceMail(void);		
  eOSState LaunchPlayer(void);
  eOSState StopPlayer(void);
  eOSState ShowDetails(void);
public:
  cVoiceMailMenu(cBoxMenu *Parent,char *boxpath,char *boxname);
  virtual eOSState ProcessKey(eKeys Key);
};

class cCallHistoryMenu: public cOsdMenu {
private:
  cBoxMenu *parent;
  char basePath[200];
  char user[200];
  void AddHistoryItems(void);
  void Setup(void);
public:
  cCallHistoryMenu(cBoxMenu *Parent,char *boxpath,char *boxname);
  eOSState DeleteHistory(void);
  eOSState ShowDetails(void);
  eOSState SetReadState(bool bRead);
  virtual eOSState ProcessKey(eKeys Key);
};

#endif
