From ae8a947367b4be57c9b0ca7bbf0032de0e2018d3 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 9 May 2002 18:00:00 +0200 Subject: Version 1.1.0 - Begin of the 1.1 development branch. THIS IS NOT A STABLE VERSION! The current stable version for every day use is still the 1.0 branch. - First step towards a universal plugin interface. See the file PLUGINS.html for a detailed description. The man page vdr(1) describes the new options '-L' and '-P' used to load plugins. This first step implements the complete "outer" shell for plugins. The "inner" access to VDR data structures will follow. - The VDR version number is now displayed in the title line of the "Setup" menu. --- menuitems.h | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 menuitems.h (limited to 'menuitems.h') diff --git a/menuitems.h b/menuitems.h new file mode 100644 index 0000000..a08a714 --- /dev/null +++ b/menuitems.h @@ -0,0 +1,110 @@ +/* + * menuitems.h: General purpose menu items + * + * See the main source file 'vdr.c' for copyright information and + * how to reach the author. + * + * $Id: menuitems.h 1.1 2002/05/09 09:41:06 kls Exp $ + */ + +#ifndef __MENUITEMS_H +#define __MENUITEMS_H + +#include "osd.h" + +class cMenuEditItem : public cOsdItem { +private: + const char *name; + const char *value; +public: + cMenuEditItem(const char *Name); + ~cMenuEditItem(); + void SetValue(const char *Value); + }; + +class cMenuEditIntItem : public cMenuEditItem { +protected: + int *value; + int min, max; + virtual void Set(void); +public: + cMenuEditIntItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX); + virtual eOSState ProcessKey(eKeys Key); + }; + +class cMenuEditBoolItem : public cMenuEditIntItem { +protected: + const char *falseString, *trueString; + virtual void Set(void); +public: + cMenuEditBoolItem(const char *Name, int *Value, const char *FalseString = NULL, const char *TrueString = NULL); + }; + +class cMenuEditChrItem : public cMenuEditItem { +private: + char *value; + const char *allowed; + const char *current; + virtual void Set(void); +public: + cMenuEditChrItem(const char *Name, char *Value, const char *Allowed); + ~cMenuEditChrItem(); + virtual eOSState ProcessKey(eKeys Key); + }; + +class cMenuEditStrItem : public cMenuEditItem { +private: + char *value; + int length; + const char *allowed; + int pos; + bool insert, newchar, uppercase; + void SetHelpKeys(void); + virtual void Set(void); + char Inc(char c, bool Up); +public: + cMenuEditStrItem(const char *Name, char *Value, int Length, const char *Allowed); + ~cMenuEditStrItem(); + virtual eOSState ProcessKey(eKeys Key); + }; + +class cMenuEditStraItem : public cMenuEditIntItem { +private: + const char * const *strings; +protected: + virtual void Set(void); +public: + cMenuEditStraItem(const char *Name, int *Value, int NumStrings, const char * const *Strings); + }; + +class cMenuTextItem : public cOsdItem { +private: + char *text; + int x, y, w, h, lines, offset; + eDvbColor fgColor, bgColor; + eDvbFont font; +public: + cMenuTextItem(const char *Text, int X, int Y, int W, int H = -1, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground, eDvbFont Font = fontOsd); + ~cMenuTextItem(); + int Height(void) { return h; } + void Clear(void); + virtual void Display(int Offset = -1, eDvbColor FgColor = clrWhite, eDvbColor BgColor = clrBackground); + bool CanScrollUp(void) { return offset > 0; } + bool CanScrollDown(void) { return h + offset < lines; } + void ScrollUp(bool Page); + void ScrollDown(bool Page); + virtual eOSState ProcessKey(eKeys Key); + }; + +class cMenuSetupPage : public cOsdMenu { +protected: + cSetup data; + int osdLanguage; + void SetupTitle(const char *s); + virtual void Set(void) = 0; +public: + cMenuSetupPage(void); + virtual eOSState ProcessKey(eKeys Key); + }; + +#endif //__MENUITEMS_H -- cgit v1.2.3