ScummVM API documentation
inventory_window.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  * Additional copyright for this file:
8  * Copyright (C) 1995 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14 
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19 
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef BURIED_INVENTORY_WINDOW_H
26 #define BURIED_INVENTORY_WINDOW_H
27 
28 #include "buried/invdata.h"
29 #include "buried/sprtdata.h"
30 #include "buried/window.h"
31 
32 #include "common/array.h"
33 
34 namespace Graphics {
35 class Font;
36 }
37 
38 namespace Buried {
39 
40 class AVIFrames;
41 class InventoryInfoWindow;
42 class BurnedLetterViewWindow;
43 
44 class InventoryWindow : public Window {
45 public:
46  InventoryWindow(BuriedEngine *vm, Window *parent);
47  ~InventoryWindow();
48 
49  bool rebuildPreBuffer();
50 
51  bool addItem(int itemID);
52  bool removeItem(int itemID);
53 
54  bool startDraggingNewItem(int itemID, const Common::Point &pointStart);
55  bool isItemInInventory(int itemID);
56  InventoryElement getItemStaticData(int itemID);
57  int getItemCount() { return _itemArray.size(); }
58  int getItemID(int itemIndex) { return _itemArray[itemIndex]; }
59  void setItemArray(const Common::Array<int> &array);
60  Common::Array<int> &getItemArray() { return _itemArray; }
61 
62  bool destroyInfoWindow();
63  InventoryInfoWindow *getInfoWindow() { return _infoWindow; }
64 
65  bool displayBurnedLetterWindow();
66  bool destroyBurnedLetterWindow();
67  BurnedLetterViewWindow *getBurnedLetterWindow() { return _letterViewWindow; }
68 
69  void onPaint();
70  void onLButtonDown(const Common::Point &point, uint flags);
71  void onLButtonUp(const Common::Point &point, uint flags);
72  void onMouseMove(const Common::Point &point, uint flags);
73  bool onSetCursor(uint message);
74  void onTimer(uint timer);
75 
76 private:
77  void setCurItem(uint16 itemId);
78  uint16 getCurItem() const;
79 
80  Graphics::Font *_textFont;
81  int _fontHeight;
82  Graphics::Surface *_background;
83  Common::Array<int> _itemArray;
84 
85  bool _magSelected;
86  bool _upSelected;
87  bool _downSelected;
88  int _textSelected;
89 
90  bool _draggingObject;
91  bool _itemComesFromInventory;
92  int _draggingItemID;
93  Sprite _draggingItemSpriteData;
94  int _draggingIconIndex;
95  bool _draggingItemInInventory;
96 
97  Common::Point _curMousePos;
98  int _curCursor;
99 
100  InventoryInfoWindow *_infoWindow;
101  BurnedLetterViewWindow *_letterViewWindow;
102 
103  AVIFrames *_dragFrames;
104 
105  uint _scrollTimer;
106 
107  // TODO: Item data
108 };
109 
110 } // End of namespace Buried
111 
112 #endif
Definition: window.h:37
Definition: font.h:83
Definition: surface.h:67
Definition: inventory_info.h:62
Definition: avi_frames.h:42
Definition: buried.h:67
Definition: agent_evaluation.h:31
Definition: formatinfo.h:28
Definition: sprtdata.h:36
Definition: rect.h:45
Definition: invdata.h:81
Definition: inventory_info.h:40
Definition: inventory_window.h:44