ScummVM API documentation
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_INTERFACE_H
23#define PETKA_INTERFACE_H
24
25#include "common/ustr.h"
26#include "common/rect.h"
27#include "common/array.h"
28
29namespace Petka {
30
31class QVisibleObject;
32class QText;
33
34class Interface {
35public:
36 Interface();
37 virtual ~Interface() {}
38
39 virtual void start(int id) {};
40 virtual void stop();
41
42 virtual void update(uint time);
43 void draw();
44
45 virtual void onLeftButtonDown(Common::Point p) {};
46 virtual void onRightButtonDown(Common::Point p) {};
47 virtual void onMouseMove(Common::Point p) {};
48
49 void setText(const Common::U32String &text, uint16 textColor, uint16 outlineColor);
50 void setTextPhrase(const Common::U32String &text, uint16 textColor, uint16 outlineColor);
51
52 void removeTexts();
53
54 QVisibleObject *findObject(int resourceId);
55
56 void initCursor(int id, bool show, bool animate);
57
58private:
59 void sort();
60
61public:
63 QVisibleObject *_objUnderCursor;
64 uint _startIndex;
65};
66
67class SubInterface : public Interface {
68public:
69 void start(int id) override;
70 void stop() override;
71
72private:
73 int _savedXOffset;
74 int _savedSceneWidth;
75 int _savedCursorId;
76 int _savedCursorType;
77};
78
79} // End of namespace Petka
80
81#endif
Definition: array.h:52
Definition: ustr.h:57
Definition: interface.h:34
Definition: object.h:37
Definition: interface.h:67
Definition: rect.h:144