ScummVM API documentation
cellphone.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 TETRAEDGE_GAME_CELLPHONE_H
23 #define TETRAEDGE_GAME_CELLPHONE_H
24 
25 #include "common/array.h"
26 #include "common/callback.h"
27 #include "common/str.h"
28 #include "common/formats/xmlparser.h"
29 
30 #include "tetraedge/te/te_layout.h"
31 #include "tetraedge/te/te_text_layout.h"
32 #include "tetraedge/te/te_lua_gui.h"
33 
34 namespace Tetraedge {
35 
36 class Cellphone : public TeLayout {
37 public:
38  Cellphone();
39  virtual ~Cellphone() {}
40 
41  bool addNumber(const Common::String &num);
42  void currentPage(int offset);
43 
44  void enter();
45  void leave();
46 
47  void load();
48  void loadFromBackup(const Common::XMLParser::ParserNode *node);
49 
50  bool onCallNumberValidated();
51  bool onCloseButtonValidated();
52  bool onNextNumber();
53  bool onPreviousNumber();
54 
55  void saveToBackup(Common::XMLParser::ParserNode *xmlnode);
56  void setVisible(bool visible);
57 
58  TeSignal1Param<Common::String> &onCallNumber() {
59  return _onCallNumberSignal;
60  }
61 
62  void unload();
63 
64  Common::Error syncState(Common::Serializer &s);
65 
66  TeLuaGUI &gui() { return _gui; }
67 
68 private:
69 
70  int _nextNumber;
71  Common::Array<TeTextLayout*> _textLayoutArray;
72  Common::Array<Common::String> _addedNumbers;
73 
74  TeSignal1Param<Common::String> _onCallNumberSignal;
75 
76  TeLuaGUI _gui;
77 };
78 
79 } // end namespace Tetraedge
80 
81 #endif // TETRAEDGE_GAME_CELLPHONE_H
Definition: str.h:59
Definition: detection.h:27
Definition: error.h:84
Definition: array.h:52
Definition: te_lua_gui.h:51
Definition: xmlparser.h:145
Definition: serializer.h:79
Definition: te_layout.h:35
Definition: cellphone.h:36