Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: now it is possible to get old commands from the List

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 addCharacter(char character);
34  void addCharacters(const char* characters);
35  void removeCharacters(unsigned int characterCount = 1);
36  void setRepeatDelay(float repeatDelay, float repeatRate);
37  bool executeCommand();
38
39  void historyMoveUp();
40  void historyMoveDown();
41
42  void help(const char* className = "", const char* function = "");
43
44  virtual void tick(float dt);
45  virtual void process(const Event &event);
46
47 private:
48    // HANDLING TEXT INPUT
49   ShellCompletion*         completion;             //!< The Completion Interface.
50
51
52   char*                    inputLine;              //!< the Char-Array of the Buffer @todo not needed anymore
53   float                    repeatRate;             //!< The Repeat-Delay.
54   float                    repeatDelay;            //!< The delay of the first Character of a given Character.
55   float                    delayed;                //!< how much of the delay is remaining.
56   int                      pressedKey;             //!< the pressed key that will be repeated.
57
58   tList<char>*             history;                //!< The history of given commands.
59   tIterator<char>*         historyIT;
60   unsigned int             historyLength;          //!< The maximum length of the InputHistory.
61   bool                     historyScrolling;       //!< true if we are scrolling through the history.
62};
63
64#endif /* _SHELL_INPUT_H */
Note: See TracBrowser for help on using the repository browser.