ScummVM API documentation
pda_mgr.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 PINK_PDA_MGR_H
23#define PINK_PDA_MGR_H
24
25#include "common/stack.h"
26
27#include "pink/cursor_mgr.h"
28#include "pink/utils.h"
29
30namespace Pink {
31
32class PinkEngine;
33class LeadActor;
34class PDAPage;
35
36struct Command;
37
38class PDAMgr {
39public:
40 PDAMgr(PinkEngine *game);
41 ~PDAMgr();
42
43 void loadState(Archive &archive) { _savedPage = archive.readString(); }
44 void saveState(Archive &archive);
45
46 void execute(const Command &command);
47 void goToPage(const Common::String pageName);
48
49 void update() { _cursorMgr.update(); }
50
51 void close();
52
53 void onLeftButtonClick(Common::Point point);
54 void onLeftButtonUp();
55 void onMouseMove(Common::Point point);
56
57 PinkEngine *getGame() const { return _game; }
58 const Common::String &getSavedPageName() { return _savedPage; }
59
60 void setLead(LeadActor *lead) { _lead = lead; }
61
62private:
63 void loadGlobal();
64
65 void initPerilButtons();
66
67 void updateWheels(bool playSfx = false);
68 void updateLocator();
69
70 void calculateIndexes();
71
72 static bool isNavigate(const Common::String &name);
73 static bool isDomain(const Common::String &name);
74
75private:
76 PinkEngine *_game;
77 LeadActor *_lead;
78 PDAPage *_page;
79 PDAPage *_globalPage;
80 CursorMgr _cursorMgr;
81 Common::String _savedPage;
82 Common::Stack<Common::String> _previousPages;
83 byte _countryIndex;
84 byte _domainIndex;
85 byte _iteration;
86 byte _handFrame;
87 enum LeftHandAction {
88 kLeft1,
89 kLeft2,
90 kLeft3,
91 kLeft4
92 } _leftHandAction;
93};
94
95} // End of namespace Pink
96
97#endif
Definition: str.h:59
Definition: archive.h:39
Definition: cursor_mgr.h:35
Definition: lead_actor.h:42
Definition: pda_mgr.h:38
Definition: pda_page.h:31
Definition: pink.h:104
Definition: rect.h:144
Definition: pda_button_actor.h:29