Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/shell/shell_input.h @ 5244

Last change on this file since 5244 was 5244, checked in by bensch, 19 years ago

orxonox/trunk: scrolling back through the Shell's History works

File size: 2.0 KB
Line 
1/*!
2 * @file shell_input.h
3 * @brief Definition of ...
4 * @todo AutoCompletion should print nice output
5 * @todo move up and down in Buffer
6 * @todo display old shell Commands
7*/
8
9#ifndef _SHELL_INPUT_H
10#define _SHELL_INPUT_H
11
12#include "text_engine.h"
13#include "event_listener.h"
14
15// FORWARD DECLARATION
16template<class T> class tList;
17template<class T> class tIterator;
18class ShellCompletion;
19
20
21//! A class for ...
22class ShellInput : public Text,  public EventListener {
23
24 public:
25  ShellInput();
26  virtual ~ShellInput();
27
28  /** @returns the inputLine */
29  const char* getInput() const { return this->inputLine; };
30
31  // InputLine
32  void flush();
33  void setInputText(const char* text);
34  void addCharacter(char character);
35  void addCharacters(const char* characters);
36  void removeCharacters(unsigned int characterCount = 1);
37  void setRepeatDelay(float repeatDelay, float repeatRate);
38  bool executeCommand();
39
40  void historyMoveUp();
41  void historyMoveDown();
42
43  void help(const char* className = "", const char* function = "");
44
45  virtual void tick(float dt);
46  virtual void process(const Event &event);
47
48 private:
49    // HANDLING TEXT INPUT
50   ShellCompletion*         completion;             //!< The Completion Interface.
51
52
53   char*                    inputLine;              //!< the Char-Array of the Buffer @todo not needed anymore
54   float                    repeatRate;             //!< The Repeat-Delay.
55   float                    repeatDelay;            //!< The delay of the first Character of a given Character.
56   float                    delayed;                //!< how much of the delay is remaining.
57   int                      pressedKey;             //!< the pressed key that will be repeated.
58
59   tList<char>*             history;                //!< The history of given commands.
60   tIterator<char>*         historyIT;
61   unsigned int             historyLength;          //!< The maximum length of the InputHistory.
62   bool                     historyScrolling;       //!< true if we are scrolling through the history.
63};
64
65#endif /* _SHELL_INPUT_H */
Note: See TracBrowser for help on using the repository browser.