nuclear@6: /* nuclear@6: GoatKit - a themable/animated widget toolkit for games nuclear@6: Copyright (C) 2014 John Tsiombikas nuclear@6: nuclear@6: This program is free software: you can redistribute it and/or modify nuclear@6: it under the terms of the GNU Lesser General Public License as published by nuclear@6: the Free Software Foundation, either version 3 of the License, or nuclear@6: (at your option) any later version. nuclear@6: nuclear@6: This program is distributed in the hope that it will be useful, nuclear@6: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@6: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@6: GNU Lesser General Public License for more details. nuclear@6: nuclear@6: You should have received a copy of the GNU Lesser General Public License nuclear@6: along with this program. If not, see . nuclear@6: */ nuclear@6: #ifndef TEXTBOX_H_ nuclear@6: #define TEXTBOX_H_ nuclear@6: nuclear@6: #include "widget.h" nuclear@6: nuclear@6: namespace goatkit { nuclear@6: nuclear@6: struct TextBoxImpl; nuclear@6: nuclear@6: class TextBox : public Widget { nuclear@6: private: nuclear@6: TextBoxImpl *tbox; nuclear@6: nuclear@6: public: nuclear@6: TextBox(); nuclear@6: virtual ~TextBox(); nuclear@6: nuclear@6: virtual const char *get_type_name() const; nuclear@6: virtual bool can_focus() const; nuclear@6: nuclear@6: virtual void clear(); nuclear@6: nuclear@6: virtual void set_text(const char *t); nuclear@6: virtual const char *get_text() const; nuclear@6: nuclear@6: virtual int set_cursor(int idx); nuclear@6: virtual int get_cursor() const; nuclear@6: nuclear@6: virtual int cursor_begin(); nuclear@6: virtual int cursor_end(); nuclear@6: virtual int cursor_prev(); nuclear@6: virtual int cursor_next(); nuclear@6: nuclear@6: virtual void insert(char c); nuclear@6: nuclear@6: virtual void on_key(const KeyEvent &ev); nuclear@6: virtual void on_click(); nuclear@6: }; nuclear@6: nuclear@6: } // namespace goatkit nuclear@6: nuclear@6: #endif // TEXTBOX_H_