2002-05-09 16:26:56 +02:00
|
|
|
/*
|
|
|
|
* menuitems.h: General purpose menu items
|
|
|
|
*
|
|
|
|
* See the main source file 'vdr.c' for copyright information and
|
|
|
|
* how to reach the author.
|
|
|
|
*
|
2004-05-16 12:58:04 +02:00
|
|
|
* $Id: menuitems.h 1.9 2004/05/16 12:45:14 kls Exp $
|
2002-05-09 16:26:56 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MENUITEMS_H
|
|
|
|
#define __MENUITEMS_H
|
|
|
|
|
2004-05-16 10:35:36 +02:00
|
|
|
#include "osdbase.h"
|
2002-05-09 16:26:56 +02:00
|
|
|
|
2002-08-15 11:28:26 +02:00
|
|
|
extern const char *FileNameChars;
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
class cMenuEditItem : public cOsdItem {
|
|
|
|
private:
|
2002-08-11 13:32:23 +02:00
|
|
|
char *name;
|
|
|
|
char *value;
|
2002-05-09 16:26:56 +02:00
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2004-02-29 14:21:22 +01:00
|
|
|
class cMenuEditBitItem : public cMenuEditBoolItem {
|
|
|
|
protected:
|
|
|
|
int *value;
|
|
|
|
int bit;
|
|
|
|
int mask;
|
|
|
|
virtual void Set(void);
|
|
|
|
public:
|
|
|
|
cMenuEditBitItem(const char *Name, int *Value, int Mask, const char *FalseString = NULL, const char *TrueString = NULL);
|
|
|
|
};
|
|
|
|
|
2003-01-19 14:59:46 +01:00
|
|
|
class cMenuEditNumItem : public cMenuEditItem {
|
|
|
|
protected:
|
|
|
|
char *value;
|
|
|
|
int length;
|
|
|
|
bool blind;
|
|
|
|
virtual void Set(void);
|
|
|
|
public:
|
|
|
|
cMenuEditNumItem(const char *Name, char *Value, int Length, bool Blind = false);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
class cMenuEditChrItem : public cMenuEditItem {
|
|
|
|
private:
|
|
|
|
char *value;
|
2002-08-11 13:32:23 +02:00
|
|
|
char *allowed;
|
2002-05-09 16:26:56 +02:00
|
|
|
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;
|
2002-08-11 13:32:23 +02:00
|
|
|
char *allowed;
|
2002-05-09 16:26:56 +02:00
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2004-03-28 09:20:02 +02:00
|
|
|
class cMenuEditChanItem : public cMenuEditIntItem {
|
|
|
|
protected:
|
|
|
|
virtual void Set(void);
|
|
|
|
public:
|
|
|
|
cMenuEditChanItem(const char *Name, int *Value);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMenuEditTranItem : public cMenuEditChanItem {
|
|
|
|
private:
|
|
|
|
int number;
|
2004-05-16 12:58:04 +02:00
|
|
|
int *source;
|
2004-03-28 09:20:02 +02:00
|
|
|
int transponder;
|
|
|
|
public:
|
2004-05-16 12:58:04 +02:00
|
|
|
cMenuEditTranItem(const char *Name, int *Value, int *Source);
|
2004-03-28 09:20:02 +02:00
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMenuEditDayItem : public cMenuEditIntItem {
|
|
|
|
protected:
|
|
|
|
static int days[];
|
|
|
|
int d;
|
|
|
|
virtual void Set(void);
|
|
|
|
public:
|
|
|
|
cMenuEditDayItem(const char *Name, int *Value);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMenuEditDateItem : public cMenuEditItem {
|
|
|
|
protected:
|
|
|
|
time_t *value;
|
|
|
|
virtual void Set(void);
|
|
|
|
public:
|
|
|
|
cMenuEditDateItem(const char *Name, time_t *Value);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMenuEditTimeItem : public cMenuEditItem {
|
|
|
|
protected:
|
|
|
|
int *value;
|
|
|
|
int hh, mm;
|
|
|
|
int pos;
|
|
|
|
virtual void Set(void);
|
|
|
|
public:
|
|
|
|
cMenuEditTimeItem(const char *Name, int *Value);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
|
|
|
};
|
|
|
|
|
2002-05-11 13:44:58 +02:00
|
|
|
class cPlugin;
|
|
|
|
|
2002-05-09 16:26:56 +02:00
|
|
|
class cMenuSetupPage : public cOsdMenu {
|
2002-05-11 13:44:58 +02:00
|
|
|
private:
|
|
|
|
cPlugin *plugin;
|
2002-05-09 16:26:56 +02:00
|
|
|
protected:
|
2002-05-11 13:44:58 +02:00
|
|
|
void SetSection(const char *Section);
|
|
|
|
virtual void Store(void) = 0;
|
|
|
|
void SetupStore(const char *Name, const char *Value = NULL);
|
|
|
|
void SetupStore(const char *Name, int Value);
|
2002-05-09 16:26:56 +02:00
|
|
|
public:
|
|
|
|
cMenuSetupPage(void);
|
|
|
|
virtual eOSState ProcessKey(eKeys Key);
|
2002-05-11 13:44:58 +02:00
|
|
|
void SetPlugin(cPlugin *Plugin);
|
2002-05-09 16:26:56 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__MENUITEMS_H
|