1 #ifndef __lib_gui_einput_h
2 #define __lib_gui_einput_h
4 #include <lib/gui/ewidget.h>
5 #include <lib/python/connections.h>
9 class eInput: public eWidget
12 eInput(eWidget *parent);
14 PSignal0<void> changed;
38 void setContent(eInputContent *cnt);
40 void setOverwriteMode(int o);
42 void setFont(gFont *font);
45 int m_mode, m_have_focus;
46 ePtr<eInputContent> m_content;
47 int event(int event, void *data=0, void *data2=0);
50 class eInputContent: public iObject
53 /* management stuff */
54 void setInput(eInput *widget);
56 virtual void getDisplay(std::string &res, int &cursor)=0;
58 /* movement / user actions */
62 /* contents can define their own directions */
65 virtual void moveCursor(int dir)=0;
68 deleteForward, deleteBackward
70 virtual void deleteChar(int dir)=0;
72 /* no movement keys except stuff like '.' or so*/
73 virtual int haveKey(int code, int overwrite)=0;
75 virtual int isValid()=0;
76 virtual void validate()=0;