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;
29 void setContent(eInputContent *cnt);
31 void setOverwriteMode(int o);
33 void setFont(gFont *font);
36 int m_mode, m_have_focus;
37 ePtr<eInputContent> m_content;
38 int event(int event, void *data=0, void *data2=0);
41 class eInputContent: public iObject
44 /* management stuff */
45 void setInput(eInput *widget);
47 virtual void getDisplay(std::string &res, int &cursor)=0;
49 /* movement / user actions */
53 /* contents can define their own directions */
56 virtual void moveCursor(int dir)=0;
59 deleteForward, deleteBackward
61 virtual void deleteChar(int dir)=0;
63 /* no movement keys except stuff like '.' or so*/
64 virtual int haveKey(int code, int overwrite)=0;
66 virtual int isValid()=0;
67 virtual void validate()=0;