ScummVM API documentation
tree_item.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_TREE_ITEM_H
23#define TITANIC_TREE_ITEM_H
24
25#include "titanic/core/message_target.h"
26#include "titanic/support/simple_file.h"
27
28namespace Titanic {
29
30class CGameManager;
31class CMovieClipList;
32class CNamedItem;
33class CProjectItem;
34class CScreenManager;
35class CViewItem;
36
38 friend class CMessage;
39 DECLARE_MESSAGE_MAP;
40private:
41 CTreeItem *_parent;
42 CTreeItem *_nextSibling;
43 CTreeItem *_priorSibling;
44 CTreeItem *_firstChild;
45 int _field14;
46public:
47 CLASSDEF;
48 CTreeItem();
49
50
54 void dump(int indent);
55
59 virtual CString dumpItem(int indent) const;
60
64 void save(SimpleFile *file, int indent) override;
65
69 void load(SimpleFile *file) override;
70
74 virtual CGameManager *getGameManager() const;
75
79 virtual bool isFileItem() const;
80
84 virtual bool isRoomItem() const;
85
89 virtual bool isNodeItem() const;
90
94 virtual bool isViewItem() const;
95
99 virtual bool isLinkItem() const;
100
104 virtual bool isPlaceHolderItem() const;
105
109 virtual bool isNamedItem() const;
110
114 virtual bool isGameObject() const;
115
119 virtual bool isGameObjectDescItem() const;
120
124 virtual const CString getName() const { return CString(); }
125
129 virtual bool isEquals(const CString &name, bool startsWith = false) const{ return false; }
130
134 virtual int compareTo(const CString &name, int maxLen = 0) const { return false; }
135
139 virtual const CMovieClipList *getMovieClips() const { return nullptr; }
140
144 virtual bool connectsTo(CViewItem *destView) const { return false; }
145
149 virtual void draw(CScreenManager *screenManager) {}
150
154 virtual Rect getBounds() const { return Rect(); }
155
159 virtual void freeSurface() {}
160
164 CTreeItem *getParent() const { return _parent; }
165
170
174 CTreeItem *getNextSibling() const { return _nextSibling; }
175
179 CTreeItem *getPriorSibling() const { return _priorSibling; }
180
185
189 CTreeItem *getFirstChild() const { return _firstChild; }
190
195
200 CTreeItem *scan(CTreeItem *item) const;
201
206
210 CTreeItem *findNextInstanceOf(ClassDef *classDef, CTreeItem *startItem) const;
211
215 void addUnder(CTreeItem *newParent);
216
220 void setParent(CTreeItem *newParent);
221
226
230 void moveUnder(CTreeItem *newParent);
231
236
242
246 void detach();
247
251 void attach(CTreeItem *item);
252
259 CNamedItem *findByName(const CString &name, bool subMatch = false);
260};
261
262} // End of namespace Titanic
263
264#endif /* TITANIC_TREE_ITEM_H */
Definition: game_manager.h:48
Definition: messages.h:93
Definition: message_target.h:85
Definition: movie_clip.h:69
Definition: named_item.h:33
Definition: project_item.h:84
Definition: screen_manager.h:49
Definition: string.h:40
Definition: tree_item.h:37
virtual bool isNamedItem() const
void attach(CTreeItem *item)
virtual bool isGameObjectDescItem() const
CTreeItem * findNextInstanceOf(ClassDef *classDef, CTreeItem *startItem) const
void moveUnder(CTreeItem *newParent)
CTreeItem * getPriorSibling() const
Definition: tree_item.h:179
void setParent(CTreeItem *newParent)
virtual bool isFileItem() const
CTreeItem * getLastSibling()
virtual const CString getName() const
Definition: tree_item.h:124
virtual int compareTo(const CString &name, int maxLen=0) const
Definition: tree_item.h:134
CTreeItem * getNextSibling() const
Definition: tree_item.h:174
CTreeItem * getLastChild() const
CTreeItem * scan(CTreeItem *item) const
virtual bool isEquals(const CString &name, bool startsWith=false) const
Definition: tree_item.h:129
virtual bool isGameObject() const
void dump(int indent)
CNamedItem * findByName(const CString &name, bool subMatch=false)
CTreeItem * findChildInstanceOf(ClassDef *classDef) const
virtual CString dumpItem(int indent) const
virtual void freeSurface()
Definition: tree_item.h:159
CTreeItem * getFirstChild() const
Definition: tree_item.h:189
void load(SimpleFile *file) override
virtual CGameManager * getGameManager() const
virtual bool connectsTo(CViewItem *destView) const
Definition: tree_item.h:144
virtual bool isPlaceHolderItem() const
virtual bool isNodeItem() const
virtual void draw(CScreenManager *screenManager)
Definition: tree_item.h:149
virtual const CMovieClipList * getMovieClips() const
Definition: tree_item.h:139
virtual Rect getBounds() const
Definition: tree_item.h:154
void addSibling(CTreeItem *item)
virtual bool isLinkItem() const
virtual bool isViewItem() const
void addUnder(CTreeItem *newParent)
CProjectItem * getRoot() const
void save(SimpleFile *file, int indent) override
CTreeItem * getParent() const
Definition: tree_item.h:164
virtual bool isRoomItem() const
Definition: view_item.h:32
Definition: saveable_object.h:35
Definition: rect.h:35
Definition: simple_file.h:49