1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00
vdr/interface.h

69 lines
2.2 KiB
C
Raw Normal View History

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.
*
2002-04-19 15:46:14 +02:00
* $Id: interface.h 1.25 2002/04/19 13:17:15 kls Exp $
2000-02-19 13:36:48 +01:00
*/
#ifndef __INTERFACE_H
#define __INTERFACE_H
#include "config.h"
#include "dvbapi.h"
#include "remote.h"
2000-09-19 17:48:42 +02:00
#include "svdrp.h"
2000-02-19 13:36:48 +01:00
class cInterface {
public:
enum { MaxCols = 5 };
private:
2000-11-01 11:45:05 +01:00
int width, height;
2000-02-19 13:36:48 +01:00
int open;
int cols[MaxCols];
2000-04-22 13:51:48 +02:00
eKeys keyFromWait;
2001-09-01 09:04:37 +02:00
bool interrupted;
2000-09-19 17:48:42 +02:00
cSVDRP *SVDRP;
cRcIoBase *rcIo;
unsigned int GetCh(bool Wait = true, bool *Repeat = NULL, bool *Release = NULL);
2000-02-19 13:36:48 +01:00
void QueryKeys(void);
void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
2001-09-01 15:23:27 +02:00
eKeys Wait(int Seconds = 0, bool KeepChar = false);
2000-02-19 13:36:48 +01:00
public:
cInterface(int SVDRPport = 0);
~cInterface();
void Open(int NumCols = 0, int NumLines = 0);
2000-02-19 13:36:48 +01:00
void Close(void);
2001-09-01 09:04:37 +02:00
void Interrupt(void) { interrupted = true; }
2000-11-01 11:45:05 +01:00
int Width(void) { return width; }
int Height(void) { return height; }
2000-04-23 15:38:16 +02:00
eKeys GetKey(bool Wait = true);
2000-09-17 09:36:50 +02:00
void PutKey(eKeys Key);
2000-02-19 13:36:48 +01:00
void Clear(void);
void ClearEol(int x, int y, eDvbColor Color = clrBackground);
void Fill(int x, int y, int w, int h, eDvbColor color = clrBackground);
2000-12-09 11:13:00 +01:00
void SetBitmap(int x, int y, const cBitmap &Bitmap);
void Flush(void);
2000-02-19 13:36:48 +01:00
void SetCols(int *c);
2002-04-19 15:46:14 +02:00
const int *GetCols(void) { return cols; }
2000-11-18 15:46:00 +01:00
eDvbFont SetFont(eDvbFont Font);
2000-11-01 11:45:05 +01:00
char *WrapText(const char *Text, int Width, int *Height);
void Write(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
2000-10-08 09:25:20 +02:00
void WriteText(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
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);
2001-09-01 09:04:37 +02:00
bool Confirm(const char *s, int Seconds = 10, bool WaitForTimeout = false);
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);
void DisplayChannelNumber(int Number);
void DisplayRecording(int Index, bool On);
2000-05-01 16:29:46 +02:00
bool Recording(void);
2000-02-19 13:36:48 +01:00
};
extern cInterface *Interface;
2000-02-19 13:36:48 +01:00
#endif //__INTERFACE_H