ScummVM API documentation
message.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 MESSAGE_DIALOG_H
23
#define MESSAGE_DIALOG_H
24
25
#include "gui/dialog.h"
26
#include "common/str.h"
27
#include "common/str-array.h"
28
29
namespace
GUI
{
30
31
class
CommandSender;
32
class
StaticTextWidget;
33
class
ButtonWidget;
34
35
enum
{
36
kMessageOK = 0,
37
kMessageAlt = 1
38
};
39
40
44
class
MessageDialog
:
public
Dialog
{
45
public
:
46
MessageDialog
(
const
Common::U32String
&message);
47
MessageDialog
(
const
Common::String
&message);
48
MessageDialog
(
const
Common::U32String
&message,
49
const
Common::U32String
&defaultButton,
50
const
Common::U32String
&altButton =
Common::U32String
(),
51
Graphics::TextAlign
alignment =
Graphics::kTextAlignCenter
,
52
const
char
*url =
nullptr
,
53
const
Common::U32String
&extraMessage =
Common::U32String
());
54
MessageDialog
(
const
Common::String
&message,
55
const
Common::String
&defaultButton,
56
const
Common::String
&altButton =
Common::String
(),
57
Graphics::TextAlign
alignment =
Graphics::kTextAlignCenter
,
58
const
char
*url =
nullptr
);
59
MessageDialog
(
const
Common::U32String
&message,
60
const
Common::U32String
&defaultButton,
61
const
Common::U32StringArray
&altButtons,
62
Graphics::TextAlign
alignment =
Graphics::kTextAlignCenter
);
63
64
void
handleCommand(
CommandSender
*sender, uint32 cmd, uint32 data)
override
;
65
void
reflowLayout()
override
;
66
67
private
:
68
const
char
*_url;
69
void
init(
const
Common::U32String
&message,
70
const
Common::U32String
&defaultButton,
71
const
Common::U32StringArray
&altButtons,
72
Graphics::TextAlign
alignment,
73
const
char
*url,
74
const
Common::U32String
&extraMessage);
75
76
protected
:
77
Common::U32String
_message;
78
Graphics::TextAlign
_alignment;
79
Common::Array<StaticTextWidget *>
_lines;
80
Common::Array<ButtonWidget *>
_buttons;
81
StaticTextWidget
*_extraMessage;
82
};
83
87
class
TimedMessageDialog
:
public
MessageDialog
{
88
public
:
89
TimedMessageDialog
(
const
Common::U32String
&message, uint32 duration);
90
91
void
handleTickle()
override
;
92
93
protected
:
94
uint32 _timer;
95
};
96
100
class
CountdownMessageDialog
:
public
MessageDialog
{
101
public
:
102
CountdownMessageDialog
(
const
Common::U32String
&message,
103
uint32 duration);
104
CountdownMessageDialog
(
const
Common::U32String
&message,
105
uint32 duration,
106
const
Common::U32String
&defaultButton,
107
const
Common::U32String
&altButton =
Common::U32String
(),
108
Graphics::TextAlign
alignment =
Graphics::kTextAlignCenter
,
109
const
Common::U32String
&countdownMessage =
Common::U32String
(
""
));
110
111
void
handleTickle()
override
;
112
113
protected
:
114
void
updateCountdown();
115
116
uint32 _timer;
117
uint32 _startTime;
118
Common::U32String
_countdownMessage;
119
};
120
124
class
MessageDialogWithURL
:
public
MessageDialog
{
125
public
:
126
MessageDialogWithURL
(
const
Common::U32String
&message,
const
char
*url);
127
MessageDialogWithURL
(
const
Common::String
&message,
const
char
*url);
128
MessageDialogWithURL
(
const
Common::U32String
&message,
const
char
*url,
const
Common::U32String
&defaultButton,
Graphics::TextAlign
alignment =
Graphics::kTextAlignCenter
);
129
MessageDialogWithURL
(
const
Common::String
&message,
const
char
*url,
const
char
*defaultButton,
Graphics::TextAlign
alignment =
Graphics::kTextAlignCenter
);
130
};
131
132
133
134
}
// End of namespace GUI
135
136
#endif
GUI::CountdownMessageDialog
Definition:
message.h:100
Graphics::kTextAlignCenter
Center the text.
Definition:
font.h:52
GUI::MessageDialogWithURL
Definition:
message.h:124
Common::String
Definition:
str.h:59
Graphics::TextAlign
TextAlign
Definition:
font.h:48
GUI::MessageDialog
Definition:
message.h:44
Common::Array
Definition:
array.h:52
GUI::StaticTextWidget
Definition:
widget.h:206
GUI
Definition:
printman.h:30
Common::U32String
Definition:
ustr.h:57
GUI::Dialog
Definition:
dialog.h:49
GUI::TimedMessageDialog
Definition:
message.h:87
GUI::CommandSender
Definition:
object.h:40
gui
message.h
Generated on Fri Mar 13 2026 09:12:41 for ScummVM API documentation by
1.8.13