ScummVM API documentation
pet_section.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 TITANIC_PET_SECTION_H
23 #define TITANIC_PET_SECTION_H
24 
25 #include "titanic/messages/mouse_messages.h"
26 #include "titanic/support/simple_file.h"
27 
28 namespace Titanic {
29 
30 enum PetArea {
31  PET_INVENTORY = 0, PET_CONVERSATION = 1, PET_REMOTE = 2,
32  PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_STARFIELD = 5, PET_TRANSLATION = 6
33 };
34 
35 class CPetControl;
36 class CPetElement;
37 class CTextControl;
38 class CScreenManager;
39 class CRoomItem;
40 
42  int _field0;
43  int _field4;
44  int _field8;
45  int _fieldC;
46 
47  CPetSectionSubData() : _field0(0), _field4(0), _field8(0),
48  _fieldC(0) {}
49 };
50 
51 class CPetSection {
52 public:
53  CPetControl *_petControl;
54 protected:
58  void areaChanged(PetArea area);
59 
63  CString getActiveNPCName() const;
64 
68  void copyColors(uint tableNum, uint colors[5]);
69 public:
70  CPetSection() : _petControl(nullptr) {}
71  virtual ~CPetSection() {}
72 
76  virtual bool setup(CPetControl *petControl) { return false; }
77 
81  virtual bool reset() { return false; }
82 
86  virtual void draw(CScreenManager *screenManager) {}
87 
91  virtual Rect getBounds() const { return Rect(); }
92 
96  virtual void changed(int changeType) {}
97 
102  virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
103  virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg) { return false; }
104  virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg) { return false; }
105  virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg) { return false; }
106  virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return false; }
107  virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) { return false; }
108  virtual bool MouseWheelMsg(CMouseWheelMsg *msg) { return false; }
109  virtual bool KeyCharMsg(CKeyCharMsg *msg) { return false; }
110  virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
111 
115  virtual bool checkDragEnd(CGameObject *item) { return false; }
116 
120  virtual CGameObject *dragEnd(const Point &pt) const { return nullptr; }
121 
125  virtual void displayMessage(const CString &msg);
126 
130  virtual bool isValid(CPetControl *petControl) { return false; }
131 
135  virtual void load(SimpleFile *file, int param) {}
136 
140  virtual void postLoad() {}
141 
145  virtual void save(SimpleFile *file, int indent) {}
146 
150  virtual void enter(PetArea oldArea) {}
151 
155  virtual void leave() {}
156 
157  virtual void proc23() {}
158 
162  virtual void enterRoom(CRoomItem *room) {}
163 
167  virtual void timerExpired(int val);
168 
172  virtual CTextControl *getText() { return nullptr; }
173 
177  virtual void removeText(int duration);
178 
182  virtual void removeText();
183 
187  virtual void stopTextTimer();
188 
192  virtual CPetElement *getElement(uint id) { return nullptr; }
193 
197  virtual CGameObject *getBackground(int index) const { return nullptr; }
198 
202  virtual void displayNPCName(CGameObject *npc) {}
203 
204  virtual void proc33() {}
205 
209  virtual void setNPC(const CString &name) {}
210 
214  virtual void resetNPC() {}
215 
219  virtual void showCursor() {}
220 
224  virtual void hideCursor() {}
225 
229  virtual void highlight(int id) {}
230 
234  CPetControl *getPetControl() const { return _petControl; }
235 
239  uint getColor(uint index);
240 
245  const uint *getColorTable(int tableNum = -1);
246 };
247 
248 } // End of namespace Titanic
249 
250 #endif /* TITANIC_PET_SECTION_H */
Definition: mouse_messages.h:150
virtual CGameObject * dragEnd(const Point &pt) const
Definition: pet_section.h:120
virtual void draw(CScreenManager *screenManager)
Definition: pet_section.h:86
Definition: text_control.h:35
Definition: mouse_messages.h:117
virtual bool isValid(CPetControl *petControl)
Definition: pet_section.h:130
Definition: pet_section.h:41
Definition: pet_section.h:51
virtual bool reset()
Definition: pet_section.h:81
virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg)
Definition: pet_section.h:102
Definition: mouse_messages.h:139
virtual CGameObject * getBackground(int index) const
Definition: pet_section.h:197
Definition: simple_file.h:49
Definition: room_item.h:33
virtual bool setup(CPetControl *petControl)
Definition: pet_section.h:76
CPetControl * getPetControl() const
Definition: pet_section.h:234
virtual void hideCursor()
Definition: pet_section.h:224
Definition: screen_manager.h:49
Definition: game_object.h:79
virtual CPetElement * getElement(uint id)
Definition: pet_section.h:192
Definition: messages.h:408
virtual bool checkDragEnd(CGameObject *item)
Definition: pet_section.h:115
Definition: mouse_messages.h:181
Definition: pet_val_base.h:27
Definition: rect.h:35
Definition: mouse_messages.h:103
virtual void load(SimpleFile *file, int param)
Definition: pet_section.h:135
virtual void enterRoom(CRoomItem *room)
Definition: pet_section.h:162
virtual void highlight(int id)
Definition: pet_section.h:229
Definition: rect.h:45
Definition: arm.h:30
Definition: string.h:40
virtual void displayNPCName(CGameObject *npc)
Definition: pet_section.h:202
virtual void save(SimpleFile *file, int indent)
Definition: pet_section.h:145
virtual void resetNPC()
Definition: pet_section.h:214
virtual CTextControl * getText()
Definition: pet_section.h:172
Definition: mouse_messages.h:87
Definition: messages.h:307
virtual void changed(int changeType)
Definition: pet_section.h:96
Definition: mouse_messages.h:71
virtual void postLoad()
Definition: pet_section.h:140
virtual void showCursor()
Definition: pet_section.h:219
virtual void enter(PetArea oldArea)
Definition: pet_section.h:150
virtual void setNPC(const CString &name)
Definition: pet_section.h:209
Definition: pet_control.h:45
virtual Rect getBounds() const
Definition: pet_section.h:91
virtual void leave()
Definition: pet_section.h:155