#ifndef __EPGSEARCHRES_H
#define __EPGSEARCHRES_H

#include <vdr/menuitems.h>
#include <vdr/recording.h>
#include "epgsearchext.h"

typedef enum
{
    showTitleEpisode,
    showEpisode
} ModeYellowSR;

// --- cMenuSearchResultsItem ------------------------------------------------------
class cMenuSearchResultsItem : public cOsdItem {
  char *fileName;
public: 
  const cEvent *eventInfo;
  const char *FileName(void) { return fileName; }
  cMenuSearchResultsItem(const cEvent *EventInfo, bool bEpisodeOnly = false);
  cMenuSearchResultsItem(cRecording *Recording);
};

class cMenuSearchResults : public cOsdMenu {
private:
  cSearchExt* searchExt;
  bool BuildList(void);
  bool ScanRecordings(void);
  cEvent *GetEventByTitle(const cSchedule* schedules, const char *p2, const cEvent *Start=NULL);
  virtual eOSState ProcessKey(eKeys Key);
  eOSState ShowSummary(void);
  eOSState Record(void);
  void SetHelpKeys(void);
  eOSState Switch(void);
  eOSState Commands(eKeys Key);
  eOSState Play(void);
  cRecording *GetRecording(cMenuSearchResultsItem *Item);

  static const cEvent *scheduleEventInfo;
  static int currentChannel;
  bool m_bSearchInRecordings;
  ModeYellowSR modeYellow;
public:
  char *m_pSearchString;
  bool m_bSort;
  bool m_bWithPayTV;
public:
  cMenuSearchResults(const char *p2, bool bSearchInRecordings=false);
  cMenuSearchResults(cSearchExt*);
  ~cMenuSearchResults() {free(m_pSearchString);}
  };

#endif
