ScummVM API documentation
dialog_interface.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 PETKA_DIALOG_INTERFACE_H
23#define PETKA_DIALOG_INTERFACE_H
24
25#include "common/str.h"
26
27namespace Petka {
28
29enum DialogState {
30 kPlaying = 1,
31 kMenu = 2,
32 kIdle = 3
33};
34
35class Sound;
36class QMessageObject;
37class BigDialogue;
38class QSystem;
39struct QReaction;
40
42public:
45
46 void start(uint id, QMessageObject *sender);
47 void next(int choice);
48
49 void startUserMsg(uint16 arg);
50 void endUserMsg();
51
52 bool isActive();
53
54 Sound *findSound();
55
56 void setSender(QMessageObject *sender);
57 void setReaction(QReaction *reaction);
58
59 void fixCursor();
60
61private:
62 void onPlayOpcode(int prevTalkerId);
63 void onMenuOpcode();
64 void onEndOpcode();
65 void onUserMsgOpcode();
66
67 void removeSound();
68
69 void sendMsg(uint16 opcode);
70 void setPhrase(const Common::U32String *text);
71 void playSound(const Common::String &name);
72
73 void initCursor();
74 void restoreCursor();
75
76private:
77 BigDialogue *_dialog;
78 QSystem *_qsys;
79 bool _isUserMsg;
80 bool _afterUserMsg;
81 bool _firstTime;
82 int _id;
83 DialogState _state;
84 Common::String _soundName;
85 QMessageObject *_talker;
86 QMessageObject *_sender;
87 QReaction *_reaction;
88 int16 _savedCursorActType;
89 int16 _savedCursorId;
90 bool _wasCursorShown;
91 bool _wasCursorAnim;
92};
93
94} // End of namespace Petka
95
96#endif
Definition: str.h:59
Definition: ustr.h:57
Definition: big_dialogue.h:105
Definition: dialog_interface.h:41
Definition: object.h:58
Definition: q_system.h:50
Definition: sound.h:36
Definition: base.h:123