ScummVM API documentation
dialogs_input.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 XEEN_DIALOGS_STRING_INPUT_H
23 #define XEEN_DIALOGS_STRING_INPUT_H
24 
25 #include "common/keyboard.h"
26 #include "mm/xeen/dialogs/dialogs.h"
27 #include "mm/xeen/screen.h"
28 
29 namespace MM {
30 namespace Xeen {
31 
32 class Input : public ButtonContainer {
33 private:
37  Common::KeyState waitForKey(const Common::String &msg);
38 
42  void animateCursor();
43 protected:
44  Window *_window;
45  int _cursorAnimIndex;
46 
47  int nonEnToUpper(uint16 ascii);
48  int nonEnToLower(uint16 ascii);
49 
53  int getString(Common::String &line, uint maxLen, int maxWidth, bool isNumeric);
54 
55  Input(XeenEngine *vm, Window *window) : ButtonContainer(vm),
56  _window(window), _cursorAnimIndex(0) {}
57 public:
58  static int show(XeenEngine *vm, Window *window, Common::String &line,
59  uint maxLen, int maxWidth, bool isNumeric = false);
60 };
61 
62 class StringInput : public Input {
63 protected:
65 
66  int execute(bool type, const Common::String &expected,
67  const Common::String &title, int opcode);
68 public:
69  static int show(XeenEngine *vm, bool type, const Common::String &msg1,
70  const Common::String &msg2, int opcode);
71 };
72 
73 class NumericInput : public Input {
74 private:
75  NumericInput(XeenEngine *vm, int window);
76 
77  int execute(int maxLength, int maxWidth);
78 public:
79  static int show(XeenEngine *vm, int window, int maxLength, int maxWidth);
80 };
81 
82 class Choose123 : public ButtonContainer {
83 private:
84  SpriteResource _iconSprites;
85 
87 
88  int execute(uint numOptions);
89 
90  void loadButtons(uint numOptions);
91 public:
92  static int show(XeenEngine *vm, uint numOptions);
93 };
94 
95 class HowMuch : public ButtonContainer {
96 private:
97  SpriteResource _iconSprites;
98 
99  HowMuch(XeenEngine *vm) : ButtonContainer(vm) {}
100 
101  int execute();
102 public:
103  static int show(XeenEngine *vm);
104 };
105 
106 } // End of namespace Xeen
107 } // End of namespace MM
108 
109 #endif
Definition: dialogs_input.h:73
Definition: str.h:59
Definition: sprites.h:52
Definition: xeen.h:93
Definition: dialogs_input.h:95
Definition: detection.h:27
int getString(Common::String &line, uint maxLen, int maxWidth, bool isNumeric)
Definition: dialogs.h:74
Definition: keyboard.h:294
Definition: dialogs_input.h:62
Definition: dialogs_input.h:32
Definition: dialogs_input.h:82
Definition: window.h:84