summaryrefslogtreecommitdiff
path: root/interface.h
blob: 137c7d4897f78cd9e24302b9365768e1ab727917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * interface.h: Abstract user interface layer
 *
 * See the main source file 'vdr.c' for copyright information and
 * how to reach the author.
 *
 * $Id: interface.h 1.27 2002/06/22 14:39:48 kls Exp $
 */

#ifndef __INTERFACE_H
#define __INTERFACE_H

#include "config.h"
#include "osdbase.h"
#include "remote.h"
#include "svdrp.h"

class cInterface {
public:
  enum { MaxCols = 5 };
private:
  int width, height;
  int open;
  int cols[MaxCols];
  eKeys keyFromWait;
  bool interrupted;
  cSVDRP *SVDRP;
  cRcIoBase *rcIo;
  unsigned int GetCh(bool Wait = true, bool *Repeat = NULL, bool *Release = NULL);
  void QueryKeys(void);
  void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
  eKeys Wait(int Seconds = 0, bool KeepChar = false);
public:
  cInterface(int SVDRPport = 0);
  ~cInterface();
  bool IsOpen(void) { return open > 0; }
  void Open(int NumCols = 0, int NumLines = 0);
  void Close(void);
  void Interrupt(void) { interrupted = true; }
  int Width(void) { return width; }
  int Height(void) { return height; }
  eKeys GetKey(bool Wait = true);
  void PutKey(eKeys Key);
  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);
  void SetBitmap(int x, int y, const cBitmap &Bitmap);
  void Flush(void);
  void SetCols(int *c);
  const int *GetCols(void) { return cols; }
  eDvbFont SetFont(eDvbFont Font);
  char *WrapText(const char *Text, int Width, int *Height);
  void Write(int x, int y, const char *s, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground);
  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);
  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);
  void LearnKeys(void);
  void DisplayChannelNumber(int Number);
  void DisplayRecording(int Index, bool On);
  bool Recording(void);
  };

extern cInterface *Interface;

#endif //__INTERFACE_H