![]() |
|||
Dokumentation
VDR
|
00001 00010 #ifndef __INTERFACE_H 00011 #define __INTERFACE_H 00012 00013 #include "config.h" 00014 #include "osdbase.h" 00015 #include "remote.h" 00016 #include "svdrp.h" 00017 00019 class cInterface { 00020 public: 00021 enum { MaxCols = 5 }; 00022 private: 00023 int width, height; 00024 int open; 00025 int cols[MaxCols]; 00026 bool interrupted; 00027 cSVDRP *SVDRP; 00028 void QueryKeys(cRemote *Remote); 00029 void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor); 00030 eKeys Wait(int Seconds = 0, bool KeepChar = false); 00031 public: 00032 cInterface(int SVDRPport = 0); 00033 ~cInterface(); 00034 bool IsOpen(void) { return open > 0; } 00035 void Open(int NumCols = 0, int NumLines = 0); 00036 void Close(void); 00037 bool HasSVDRPConnection(void) { return SVDRP && SVDRP->HasConnection(); } 00038 void Interrupt(void) { interrupted = true; } 00039 int Width(void) { return width; } 00040 int Height(void) { return height; } 00041 eKeys GetKey(bool Wait = true); 00042 void Clear(void); 00043 void ClearEol(int x, int y, eDvbColor Color = clrBackground); 00044 void Fill(int x, int y, int w, int h, eDvbColor color = clrBackground); 00045 void SetBitmap(int x, int y, const cBitmap &Bitmap); 00046 void Flush(void); 00047 void SetCols(int *c); 00048 const int *GetCols(void) { return cols; } 00049 eDvbFont SetFont(eDvbFont Font); 00050 char *WrapText(const char *Text, int Width, int *Height); 00051 void Write(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground); 00052 void WriteText(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground); 00053 void Title(const char *s); 00054 void Status(const char *s, eDvbColor FgColor = clrBlack, eDvbColor BgColor = clrCyan); 00055 void Info(const char *s); 00056 void Error(const char *s); 00057 bool Confirm(const char *s, int Seconds = 10, bool WaitForTimeout = false); 00058 void Help(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); 00059 void LearnKeys(void); 00060 }; 00061 00062 extern cInterface *Interface; 00063 00064 #endif //__INTERFACE_H 00065