1 #pragma once
2 // Description:
3 //   Get a line of text.
4 //
5 // Copyright (C) 2007 Frank Becker
6 //
7 // This program is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU General Public License as published by the Free Software
9 // Foundation;  either version 2 of the License,  or (at your option) any  later
10 // version.
11 //
12 // This program is distributed in the hope that it will be useful,  but  WITHOUT
13 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
15 //
16 
17 #include <string>
18 #include <InterceptorI.hpp>
19 
20 class TextInput: public InterceptorI
21 {
22 public:
23     TextInput( unsigned int maxLength=15);
24     virtual ~TextInput();
25 
26     virtual void input( const Trigger &trigger, const bool &isDown);
27     void turnOn( void);
28     void turnOff( void);
29 
isOn(void)30     bool isOn( void)
31     {
32 	return _isOn;
33     }
34 
getText(void)35     const std::string &getText( void)
36     {
37 	return _line;
38     }
39 
40 private:
41     TextInput( const TextInput&);
42     TextInput &operator=(const TextInput&);
43 
44     unsigned int _maxLen;
45     std::string _line;
46     bool _isOn;
47 };
48