ScummVM API documentation
gui_textbox.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 AGS_SHARED_GUI_GUI_TEXTBOX_H
23#define AGS_SHARED_GUI_GUI_TEXTBOX_H
24
25#include "common/std/vector.h"
26#include "ags/shared/gui/gui_object.h"
27#include "ags/shared/util/string.h"
28
29namespace AGS3 {
30namespace AGS {
31namespace Shared {
32
33class GUITextBox : public GUIObject {
34public:
35 GUITextBox();
36
37 bool HasAlphaChannel() const override;
38 bool IsBorderShown() const;
39
40 // Operations
41 Rect CalcGraphicRect(bool clipped) override;
42 void Draw(Bitmap *ds, int x = 0, int y = 0) override;
43 void SetShowBorder(bool on);
44
45 // Events
46 void OnKeyPress(const KeyInput &ki) override;
47
48 // Serialization
49 void ReadFromFile(Stream *in, GuiVersion gui_version) override;
50 void WriteToFile(Stream *out) const override;
51 void ReadFromSavegame(Stream *in, GuiSvgVersion svg_ver) override;
52 void WriteToSavegame(Stream *out) const override;
53
54 // TODO: these members are currently public; hide them later
55public:
56 int32_t Font;
57 String Text;
58 color_t TextColor;
59
60private:
61 int32_t TextBoxFlags;
62 String _textToDraw;
63
64 void DrawTextBoxContents(Bitmap *ds, int x, int y, color_t text_color);
65};
66
67} // namespace Shared
68} // namespace AGS
69} // namespace AGS3
70
71#endif
Definition: allegro_bitmap.h:44
Definition: gui_object.h:44
Definition: gui_textbox.h:33
Definition: stream.h:52
Definition: string.h:60
Definition: fonts.h:43
Definition: keycode.h:281
Definition: geometry.h:219