00001 #ifndef _LCD_CALLBACK_H_ 00002 #define _LCD_CALLBACK_H_ 00003 00004 #include <string> 00005 #include <map> 00006 00030 #define LCD_CALLBACK_FUNCTION_BEGIN(fname) class LCDClass_fname : public LCDCallback \ 00031 { \ 00032 public: \ 00033 void operator()(KeyEvent lcdKey) 00034 00042 #define LCD_CALLBACK_FUNCTION_END(fname) \ 00043 }; \ 00044 LCDClass_fname fname; 00045 00051 typedef char KeyEvent; 00052 00060 class LCDCallback 00061 { 00062 public: 00063 LCDCallback() 00064 { 00065 } 00066 00075 virtual void operator()(KeyEvent lcdKey) = 0; 00076 }; 00077 00078 typedef std::map<KeyEvent, LCDCallback *> CallbackMap; 00079 00080 std::string toString(KeyEvent t) 00081 { 00082 std::string s(1, (char)t); 00083 return s; 00084 } 00085 00086 #endif