Crazy Eddie's GUI System  ${CEGUI_VERSION}
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
InventoryReceiver.h
1 /***********************************************************************
2  created: Fri Apr 22 2011
3  author: Paul D Turner <paul@cegui.org.uk>
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _InventoryReceiver_h_
28 #define _InventoryReceiver_h_
29 
30 #include "InventoryBase.h"
31 #include <CEGUI/Window.h>
32 
33 // Start of CEGUI namespace section
34 namespace CEGUI
35 {
36 class InventoryItem;
37 
38 // Class representing a container for InventoryItem objects.
39 class InventoryReceiver : public Window, public InventoryBase
40 {
41 public:
42  static const String WidgetTypeName;
43  static const String EventNamespace;
44 
45  InventoryReceiver(const String& type, const String& name);
46 
47  // return whether the given item will fit at the given content grid
48  // co-ordinates.
49  bool itemWillFitAtLocation(const InventoryItem& item, int x, int y);
50 
51  // adds the given item at the given content grid co-ordinates. The item
52  // is only added if the item will fit at the given location. Returns
53  // true if the item was added successfully.
54  bool addItemAtLocation(InventoryItem& item, int x, int y);
55 
56  // removes the given item.
57  void removeItem(InventoryItem& item);
58 
59 protected:
60  // write the item's layout data into the content map.
61  void writeItemToContentMap(const InventoryItem& item);
62  // erase the item's layout data from the content map.
63  void eraseItemFromContentMap(const InventoryItem& item);
64 
65  // base class overrides
68  Rectf gridBasePixelRect() const;
69 };
70 
71 } // End of CEGUI namespace section
72 
73 #endif // end of guard _InventoryReceiver_h_
74 
void onDragDropItemDropped(DragDropEventArgs &e)
Handler called when a DragContainer is dragged over this window.
Definition: InventoryReceiver.cpp:173
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
EventArgs based class used for certain drag/drop notifications.
Definition: cegui/include/CEGUI/InputEvent.h:341
Definition: InventoryBase.h:37
void populateGeometryBuffer()
Update the rendering cache.
Definition: InventoryReceiver.cpp:192
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: cegui/include/CEGUI/Window.h:149
Definition: InventoryReceiver.h:39
Definition: InventoryItem.h:38
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62