/****************************************************************************
 * DESCRIPTION:
 *            
 *
 * $Id: menu.h,v 1.4 2005/05/21 11:58:10 ralf Exp $
 *
 * Contact:    ranga@teddycats.de
 *
 * Copyright (C) 2005 by Ralf Dotzert
 ****************************************************************************/
#ifndef MENU_H
#define MENU_H

#include <mysql/mysql.h>
#include <vdr/menu.h>
#include <vdr/interface.h>
#include "autotimer.h"
#include "libmysqlwrapped.h"

/**
@author Ralf Dotzert
*/

class cXxvAutotimerEdit : public cOsdMenu
{
private:
   cXxvAutoTimer *_timer;

public:
    cXxvAutotimerEdit(cXxvAutoTimer *timer);
    ~cXxvAutotimerEdit();
    void  Set();
    eOSState ProcessKey(eKeys Key);
};


class cXxvAutotimerMenu : public cOsdMenu
{
private:
    enum          State { UNDEF, EDIT, NEW, DELETE};
    State         _state;

    Database      *_db;
    cXxvAutoTimers _timers;
    bool           getTimers();
    cXxvAutoTimer  _currTimer;
    void           updateTimer();
    void           insertTimer();
    void           deleteTimer();


public:
    cXxvAutotimerMenu();
    ~cXxvAutotimerMenu();
    void  Set();
    eOSState ProcessKey(eKeys Key);
};

#endif
