2000-02-19 13:36:48 +01:00
|
|
|
/*
|
|
|
|
* interface.h: Abstract user interface layer
|
|
|
|
*
|
2000-04-24 09:46:05 +02:00
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
2000-02-19 13:36:48 +01:00
|
|
|
* how to reach the author.
|
|
|
|
*
|
2000-04-24 09:46:05 +02:00
|
|
|
* $Id: interface.h 1.7 2000/04/24 09:44:25 kls Exp $
|
2000-02-19 13:36:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __INTERFACE_H
|
|
|
|
#define __INTERFACE_H
|
|
|
|
|
|
|
|
#include "config.h"
|
2000-03-11 11:22:37 +01:00
|
|
|
#include "dvbapi.h"
|
2000-02-19 13:36:48 +01:00
|
|
|
|
|
|
|
class cInterface {
|
|
|
|
public:
|
|
|
|
enum { MaxCols = 5 };
|
|
|
|
private:
|
|
|
|
int open;
|
|
|
|
int cols[MaxCols];
|
2000-04-22 13:51:48 +02:00
|
|
|
eKeys keyFromWait;
|
2000-04-23 15:38:16 +02:00
|
|
|
unsigned int GetCh(bool Wait = true);
|
2000-02-19 13:36:48 +01:00
|
|
|
void QueryKeys(void);
|
2000-03-11 11:22:37 +01:00
|
|
|
void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
|
2000-04-22 13:51:48 +02:00
|
|
|
eKeys Wait(int Seconds = 1, bool KeepChar = false);
|
2000-02-19 13:36:48 +01:00
|
|
|
public:
|
|
|
|
cInterface(void);
|
|
|
|
void Init(void);
|
2000-04-23 15:38:16 +02:00
|
|
|
void Open(int NumCols = MenuColumns, int NumLines = MenuLines);
|
2000-02-19 13:36:48 +01:00
|
|
|
void Close(void);
|
2000-04-23 15:38:16 +02:00
|
|
|
eKeys GetKey(bool Wait = true);
|
2000-02-19 13:36:48 +01:00
|
|
|
void Clear(void);
|
2000-03-11 11:22:37 +01:00
|
|
|
void ClearEol(int x, int y, eDvbColor Color = clrBackground);
|
2000-02-19 13:36:48 +01:00
|
|
|
void SetCols(int *c);
|
2000-03-11 11:22:37 +01:00
|
|
|
void Write(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
|
|
|
|
void WriteText(int x, int y, const char *s, bool Current = false);
|
|
|
|
void Title(const char *s);
|
|
|
|
void Status(const char *s, eDvbColor FgColor = clrBlack, eDvbColor BgColor = clrCyan);
|
|
|
|
void Info(const char *s);
|
|
|
|
void Error(const char *s);
|
|
|
|
bool Confirm(const char *s);
|
|
|
|
void Help(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
|
2000-02-19 13:36:48 +01:00
|
|
|
void LearnKeys(void);
|
2000-04-22 09:56:33 +02:00
|
|
|
void DisplayChannel(int Number, const char *Name = NULL);
|
2000-02-19 13:36:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern cInterface Interface;
|
2000-04-15 17:38:11 +02:00
|
|
|
extern cDvbApi DvbApi; //XXX member of cInterface???
|
2000-02-19 13:36:48 +01:00
|
|
|
|
|
|
|
#endif //__INTERFACE_H
|