/*
 * menuitems.h: classes for osd-menu display
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#ifndef _MENUITEMS_H
#define _MENUITEMS_H
#include <vdr/osdbase.h>
#include <vdr/menu.h>

class     IntStack {
public:
  IntStack(int);
 ~IntStack();

  void    Push(int);
  int     Peek();
  int     Pop();

private:
  int   * stack;
  int     sc;
};  

class cMenuData {
public:
  enum 	  XmsParts {
	  xmsUnknown
   , xmsMain		  
	, xmsGenre
	, xmsSubGenre
	, xmsCategory
	, xmsMediaList
	, xmsComment
	, xmsCast
   , xmsSearch	
	, xmsInvalid
     };

  cMenuData(cMenuData::XmsParts);
 ~cMenuData();

  char     scratch[64]; 

  cMenuData::XmsParts Active();
  cMenuData::XmsParts Up();
  void     SetActive(cMenuData::XmsParts);

  int      Genre() { return genre; }
  int      Subgenre() { return subgenre; }
  char   * StrGenre() { return sGenre; }
  char   * StrSubgenre() { return sSubgenre; }
  char   * StrCategory() { return sCategory; }
  char   * StrTitle()    { return sTitle; }
  
  void     SetGenre(int i) { genre = i; }
  void     SetSubgenre(int i) { subgenre = i; }
  void     SetStrGenre(char*);
  void     SetStrSubgenre(char*);
  void     SetStrCategory(char*);
  void     SetStrTitle(char*);

  void     DumpKey(eKeys Key);
  
private:
  IntStack xmsParts;
  int      genre;
  int      subgenre;
  char *   sCategory;
  char *   sGenre;
  char *   sSubgenre;
  char *   sTitle;
};

class cOsdGenreList  : public cOsdMenu {
public:
  cOsdGenreList(cMenuData &);
 ~cOsdGenreList();

  eOSState ProcessKey(eKeys Key);
protected:
  void SetHelp();

private:
  cMenuData & menu;
  };

class cOsdSubGenreList : public cOsdMenu {
public:
  cOsdSubGenreList(cMenuData&);
 ~cOsdSubGenreList();
 
  eOSState ProcessKey(eKeys Key);
protected:
  void SetHelp();
private:
  cMenuData & menu;
  }; 

class cOsdCategoryList : public cOsdMenu {
public:
  cOsdCategoryList(cMenuData&);
 ~cOsdCategoryList();  
 
  eOSState ProcessKey(eKeys Key);
protected:
  void SetHelp();
private:
  cMenuData & menu;
  };	

class cOsdMediaList : public cOsdMenu {
public:	
  cOsdMediaList(cMenuData&,int);
  cOsdMediaList(cMenuData&,int, int);
  cOsdMediaList(cMenuData&,char*, char*);
 ~cOsdMediaList();  
 
  eOSState ProcessKey(eKeys Key);
protected:
  void SetHelp();
private:
  cMenuData & menu;  
  };

class cOsdComment : public cMenuText {
public:
  cOsdComment(cMenuData&,int);
 ~cOsdComment();
private:
  cMenuData & menu; 
  };

class cOsdCastList : public cOsdMenu {
public:
  cOsdCastList(cMenuData&, int);		
 ~cOsdCastList();

protected:
  void SetHelp();
private:
  cMenuData & menu;  
  }; 

class cOsdSearch : public cOsdMenu {
public:
  cOsdSearch(cMenuData &);
 ~cOsdSearch();

  eOSState ProcessKey(eKeys Key);
protected:
  void SetHelp();
private:
  cMenuData & menu;  
  };

#endif
