/*
 * statusandquestion: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id: menumessages.h 0.1 2004/07/11 14:12:20 hflor Exp $
 */

#ifndef __MENUMESSAGES_H
#define __MENUMESSAGES_H

#include <vdr/menu.h>
#include <vdr/menuitems.h>
#include "messages.h"

// --- cMenuEditMessage --------------------------------------------------------

class cMenuEditMessage : public cOsdMenu {
private:
  cMessage *message;
  bool prevexists;
  bool nextexists;
  int messagenumber;
  int messagecount;
#if VDRVERSNUM >= 10307
  int firstline;
  int numlines;
  int textlines;
  cTextWrapper *textwrapper;
  cOsdItem *splitline;
  cOsdItem *scrollitems[50];
#else
  int lastline;
  cMenuTextItem *menutextitem;
#endif
  void SetHelpKeys(void);
public:
  cMenuEditMessage(cMessage *Message, int MessageNumber, int MessageCount);
  virtual ~cMenuEditMessage();
  virtual void Set(int Width = 0);
  virtual eOSState ProcessKey(eKeys Key);
  };

// --- cMenuMessageItem --------------------------------------------------------

class cMenuMessageItem : public cOsdItem {
private:
  cMessage *message;
public:
  cMenuMessageItem(cMessage *Message);
  virtual bool operator< (const cListObject &ListObject);
  virtual void Set(void);
  cMessage *Message(void) { return message; }
  };

// --- cMenuMessages -----------------------------------------------------------

class cMenuMessages : public cOsdMenu {
private:
  bool lockmessages;
  bool lockmresponses;
  bool lockmhistory;
  bool deleteTop;
  bool deleteBottom;
  void SetHelpKeys(void);
  void AddDelete(void);
  void DelDelete(void);
  eOSState Disp(void);
  eOSState Delete(void);
  cMessage *CurrentMessage(void);
public:
  cMenuMessages(void);
  virtual ~cMenuMessages();
  virtual eOSState ProcessKey(eKeys Key);
  };

#endif //__MENUMESSAGES_H
