ScummVM API documentation
input_control.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ZVISION_INPUT_CONTROL_H
23 #define ZVISION_INPUT_CONTROL_H
24 
25 #include "zvision/scripting/control.h"
26 #include "zvision/text/text.h"
27 #include "zvision/text/string_manager.h"
28 
29 #include "common/rect.h"
30 
31 namespace Video {
32  class VideoDecoder;
33 }
34 
35 namespace ZVision {
36 
37 class InputControl : public Control {
38 public:
39  InputControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream);
40  ~InputControl() override;
41 
42 private:
43  Graphics::Surface *_background;
44  Common::Rect _textRectangle;
45  Common::Rect _headerRectangle;
46  TextStyleState _stringInit;
47  TextStyleState _stringChooserInit;
48  uint32 _nextTabstop;
49  bool _focused;
50 
51  Common::String _currentInputText;
52  bool _textChanged;
53  bool _enterPressed;
54  bool _readOnly;
55 
56  int16 _txtWidth;
57  int16 _maxTxtWidth;
58  Video::VideoDecoder *_animation;
59 
60 public:
61  void focus() override;
62  void unfocus() override;
63  bool onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override;
64  bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override;
65  bool onKeyDown(Common::KeyState keyState) override;
66  bool process(uint32 deltaTimeInMillis) override;
67  void setText(const Common::String &_str);
68  const Common::String getText();
69  bool enterPress();
70  void setReadOnly(bool);
71 };
72 
73 } // End of namespace ZVision
74 
75 #endif
Definition: str.h:59
Definition: surface.h:67
Definition: control.h:43
Definition: text.h:47
Definition: rect.h:144
Definition: stream.h:745
Definition: clock.h:29
Definition: video_decoder.h:53
Definition: rect.h:45
Definition: keyboard.h:294
Definition: input_control.h:37
Definition: avi_frames.h:36