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 "common/rect.h"
26#include "zvision/scripting/control.h"
27#include "zvision/text/string_manager.h"
28#include "zvision/text/text.h"
29
30namespace Video {
31 class VideoDecoder;
32}
33
34namespace ZVision {
35
36class InputControl : public Control {
37public:
38 InputControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream);
39 ~InputControl() override;
40
41private:
42 Graphics::Surface *_background;
43 Common::Rect _textRectangle;
44 Common::Rect _headerRectangle;
45 TextStyleState _stringInit;
46 TextStyleState _stringChooserInit;
47 uint32 _nextTabstop;
48 bool _focused;
49
50 Common::String _currentInputText;
51 bool _textChanged;
52 bool _enterPressed;
53 bool _readOnly;
54
55 int16 _txtWidth;
56 int16 _maxTxtWidth;
57 Video::VideoDecoder *_animation;
58
59public:
60 void focus() override;
61 void unfocus() override;
62 bool onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override;
63 bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override;
64 bool onKeyDown(Common::KeyState keyState) override;
65 bool process(uint32 deltaTimeInMillis) override;
66 void setText(const Common::String &_str);
67 const Common::String getText();
68 bool enterPress();
69 void setReadOnly(bool);
70};
71
72} // End of namespace ZVision
73
74#endif
Definition: stream.h:745
Definition: str.h:59
Definition: video_decoder.h:53
Definition: control.h:43
Definition: input_control.h:36
bool onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override
bool onKeyDown(Common::KeyState keyState) override
bool onMouseUp(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) override
bool process(uint32 deltaTimeInMillis) override
Definition: text.h:47
Definition: focus_list.h:27
Definition: keyboard.h:294
Definition: rect.h:144
Definition: rect.h:536
Definition: surface.h:67