| [6776] | 1 | /* |
|---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
|---|
| 3 | * > www.orxonox.net < |
|---|
| 4 | * |
|---|
| 5 | * |
|---|
| 6 | * License notice: |
|---|
| 7 | * |
|---|
| 8 | * This program is free software; you can redistribute it and/or |
|---|
| 9 | * modify it under the terms of the GNU General Public License |
|---|
| 10 | * as published by the Free Software Foundation; either version 2 |
|---|
| 11 | * of the License, or (at your option) any later version. |
|---|
| 12 | * |
|---|
| 13 | * This program is distributed in the hope that it will be useful, |
|---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | * GNU General Public License for more details. |
|---|
| 17 | * |
|---|
| 18 | * You should have received a copy of the GNU General Public License |
|---|
| 19 | * along with this program; if not, write to the Free Software |
|---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 21 | * |
|---|
| 22 | * Author: |
|---|
| 23 | * Sandro 'smerkli' Merkli |
|---|
| 24 | * Co-authors: |
|---|
| 25 | * ... |
|---|
| 26 | * |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| 29 | #ifndef _ChatInputHandler_H__ |
|---|
| 30 | #define _ChatInputHandler_H__ |
|---|
| 31 | |
|---|
| 32 | /* std includes */ |
|---|
| 33 | #include <deque> |
|---|
| 34 | #include <string> |
|---|
| 35 | #include <fstream> |
|---|
| 36 | #include <iostream> |
|---|
| 37 | #include <cassert> |
|---|
| 38 | |
|---|
| 39 | /* project includes */ |
|---|
| 40 | #include <OrxonoxPrereqs.h> |
|---|
| [6791] | 41 | #include <core/BaseObject.h> |
|---|
| 42 | #include <core/PathConfig.h> |
|---|
| 43 | |
|---|
| [6788] | 44 | #include "core/input/InputBuffer.h" |
|---|
| 45 | #include "core/input/InputManager.h" |
|---|
| 46 | #include "core/input/InputState.h" |
|---|
| [6791] | 47 | |
|---|
| [6788] | 48 | #include "../libraries/network/Host.h" |
|---|
| 49 | #include <util/Singleton.h> |
|---|
| [6776] | 50 | |
|---|
| 51 | |
|---|
| 52 | namespace orxonox |
|---|
| 53 | { |
|---|
| 54 | /* class to handle chat using an InputBuffer */ |
|---|
| [6788] | 55 | class _OrxonoxExport ChatInputHandler : public Singleton<ChatInputHandler>, |
|---|
| 56 | public OrxonoxClass |
|---|
| [6776] | 57 | { |
|---|
| 58 | private: |
|---|
| 59 | /** Input buffer, to be used to catch input from the |
|---|
| 60 | * keyboard |
|---|
| 61 | */ |
|---|
| 62 | InputBuffer *inpbuf; |
|---|
| 63 | |
|---|
| [6788] | 64 | /** input state */ |
|---|
| 65 | InputState *inputState; |
|---|
| 66 | |
|---|
| 67 | /** setup input buffer, the constructor calls this */ |
|---|
| [6776] | 68 | void configureInputBuffer(); |
|---|
| 69 | |
|---|
| [6788] | 70 | /* singleton pointer */ |
|---|
| 71 | static ChatInputHandler* singletonPtr_s; |
|---|
| 72 | |
|---|
| [6776] | 73 | public: |
|---|
| 74 | /** constructor */ |
|---|
| 75 | ChatInputHandler(); |
|---|
| [6777] | 76 | friend class Singleton<ChatInputHandler>; |
|---|
| [6776] | 77 | |
|---|
| [6777] | 78 | /* start listening, stop listening */ |
|---|
| [6791] | 79 | static void activate_static(); |
|---|
| [6777] | 80 | void activate(); |
|---|
| 81 | void deactivate(); |
|---|
| 82 | |
|---|
| [6788] | 83 | /* callbacks for input handler */ |
|---|
| [6776] | 84 | void inputChanged(); |
|---|
| 85 | void addline(); |
|---|
| 86 | void backspace(); |
|---|
| 87 | void deleteChar(); |
|---|
| 88 | void cursorRight(); |
|---|
| 89 | void cursorLeft(); |
|---|
| 90 | void cursorEnd(); |
|---|
| 91 | void cursorHome(); |
|---|
| 92 | void exit(); |
|---|
| 93 | }; |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | #endif /*_ChatInputHandler_H__*/ |
|---|