00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef VDR_SUDOKU_LIST_H
00022 #define VDR_SUDOKU_LIST_H
00023
00024 #include "sudoku.h"
00025 #include <vdr/osdbase.h>
00026 #include <vdr/tools.h>
00027
00028
00029 namespace SudokuPlugin
00030 {
00031
00032
00033
00034
00035 class ListLine : public cListObject
00036 {
00037 cString sudoku;
00038 cString description;
00039
00040
00041 ListLine();
00042 friend class cConfig<ListLine>;
00043
00044 public:
00045
00046
00047 ListLine(const char* sudoku, const char* description = "");
00048
00049
00050 const char* get_sudoku() const;
00051
00052
00053 const char* get_description() const;
00054
00055
00056 void set_description(const char* new_description);
00057
00058
00059 bool Parse(const char* line);
00060
00061
00062 bool Save(FILE* file) const;
00063 };
00064
00065
00066
00067
00068
00069 class ListMenu : public cOsdMenu
00070 {
00071 cConfig<ListLine> list;
00072 int selected;
00073 bool save_mode;
00074
00075 public:
00076
00077
00078 ListMenu(const char* filename, const char* new_sudoku = NULL);
00079
00080
00081 const char* get_selected_sudoku() const;
00082
00083
00084 virtual eOSState ProcessKey(eKeys key);
00085
00086 private:
00087
00088
00089 void refresh();
00090 };
00091
00092
00093
00094
00095
00096 class ListEdit : public cOsdMenu
00097 {
00098 ListLine& line;
00099 char description[100];
00100
00101 public:
00102
00103
00104 ListEdit(ListLine& line);
00105
00106
00107 virtual eOSState ProcessKey(eKeys key);
00108 };
00109
00110 }
00111
00112 #endif // VDR_SUDOKU_LIST_H