#ifndef __EPGSEARCH_MENUWHATSON_H
#define __EPGSEARCH_MENUWHATSON_H

#include <vdr/menuitems.h>
#include "epgsearchcfg.h"

// --- cMenuMyScheduleItem ------------------------------------------------------

class cMenuMyScheduleItem : public cOsdItem {
public:
  const cEvent *event;
  const cChannel *channel;
  showMode mode;
  int progress;
  int timerMatch;
  bool inSwitchList;

  cMenuMyScheduleItem(const cEvent *Event, cChannel *Channel = NULL, int iProgress=0, showMode ShowMode = showNow);
  bool Update(bool Force = false);
};

// --- cMenuWhatsOnSearch ----------------------------------------------------------

class cMenuWhatsOnSearch : public cOsdMenu {
private:
    const cSchedules* schedules;
    eOSState Record(void);
    eOSState ExtendedSearch(void);
    static int currentChannel;
    static cChannel *scheduleChannel;
 public:
    static showMode currentShowMode;
    int shiftTime;
    time_t GetTimeT(int iTime);
    showMode GetNextMode();
    cMenuWhatsOnSearch(const cSchedules *Schedules, int CurrentChannelNr);
    ~cMenuWhatsOnSearch();
    void LoadSchedules();
    static int CurrentChannel(void) { return currentChannel; }
    static void SetCurrentChannel(int ChannelNr) { currentChannel = ChannelNr; }
    static cChannel *ScheduleChannel(void);
    virtual eOSState ProcessKey(eKeys Key); 
    virtual eOSState Switch(void);
    virtual eOSState Shift(int); 
    virtual eOSState Commands(eKeys Key);
    virtual eOSState ShowSummary();
    void SetHelpKeys();
    int GetTab(int Tab);
    void MoveToChannelWithEPG(int direction);
    const cChannel* GetNextChannelWithEPG(int direction);
    bool Update(void);
};

#endif
