Crazy Eddies GUI System  0.6.2
CEGUIScrolledContainer.h
1 /***********************************************************************
2  filename: CEGUIScrolledContainer.h
3  created: 1/3/2005
4  author: Paul D Turner
5 *************************************************************************/
6 /***************************************************************************
7  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining
10  * a copy of this software and associated documentation files (the
11  * "Software"), to deal in the Software without restriction, including
12  * without limitation the rights to use, copy, modify, merge, publish,
13  * distribute, sublicense, and/or sell copies of the Software, and to
14  * permit persons to whom the Software is furnished to do so, subject to
15  * the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be
18  * included in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  ***************************************************************************/
28 #ifndef _CEGUIScrolledContainer_h_
29 #define _CEGUIScrolledContainer_h_
30 
31 #include "CEGUIWindow.h"
32 #include "CEGUIWindowFactory.h"
33 #include "elements/CEGUIScrolledContainerProperties.h"
34 #include <map>
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 // Start of CEGUI namespace section
42 namespace CEGUI
43 {
49  class CEGUIEXPORT ScrolledContainer : public Window
50  {
51  public:
52  /*************************************************************************
53  Constants
54  *************************************************************************/
55  static const String WidgetTypeName;
56  static const String EventNamespace;
57  static const String EventContentChanged;
59 
60  /*************************************************************************
61  Object construction and destruction
62  *************************************************************************/
67  ScrolledContainer(const String& type, const String& name);
68 
73  ~ScrolledContainer(void);
74 
75  /*************************************************************************
76  Public interface methods
77  *************************************************************************/
86  bool isContentPaneAutoSized(void) const;
87 
99  void setContentPaneAutoSized(bool setting);
100 
109  const Rect& getContentArea(void) const;
110 
126  void setContentArea(const Rect& area);
127 
137  Rect getChildExtentsArea(void) const;
138 
139  // Overridden from Window.
140  Rect getUnclippedInnerRect_impl(void) const;
141 
142  protected:
143  /*************************************************************************
144  Implementation methods
145  *************************************************************************/
156  virtual bool testClassName_impl(const String& class_name) const
157  {
158  if (class_name=="ScrolledContainer") return true;
159  return Window::testClassName_impl(class_name);
160  }
161 
162  /*************************************************************************
163  Implementation of abstract methods from Window
164  *************************************************************************/
165  void drawSelf(float z) {};
166 
167  /*************************************************************************
168  Event trigger methods.
169  *************************************************************************/
180  virtual void onContentChanged(WindowEventArgs& e);
181 
193  virtual void onAutoSizeSettingChanged(WindowEventArgs& e);
194 
195  /*************************************************************************
196  Event callbacks
197  *************************************************************************/
202  bool handleChildSized(const EventArgs& e);
203 
208  bool handleChildMoved(const EventArgs& e);
209 
210  /*************************************************************************
211  Overridden from Window.
212  *************************************************************************/
213  void onChildAdded(WindowEventArgs& e);
214  void onChildRemoved(WindowEventArgs& e);
215  void onParentSized(WindowEventArgs& e);
216 
217  /*************************************************************************
218  Data fields
219  *************************************************************************/
220  typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
221  ConnectionTracker d_eventConnections;
224 
225  private:
226  /*************************************************************************
227  Static Properties for this class
228  *************************************************************************/
229  static ScrolledContainerProperties::ContentPaneAutoSized d_autoSizedProperty;
230  static ScrolledContainerProperties::ContentArea d_contentAreaProperty;
231  static ScrolledContainerProperties::ChildExtentsArea d_childExtentsAreaProperty;
232 
233  /*************************************************************************
234  Private methods
235  *************************************************************************/
236  void addScrolledContainerProperties(void);
237  };
238 
239 } // End of CEGUI namespace section
240 
241 
242 #if defined(_MSC_VER)
243 # pragma warning(pop)
244 #endif
245 
246 #endif // end of guard _CEGUIScrolledContainer_h_