Crazy Eddies GUI System  0.7.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CEGUISequentialLayoutContainer.h
1 /***********************************************************************
2  filename: CEGUISequentialLayoutContainer.h
3  created: 02/8/2010
4  author: Martin Preisler
5 
6  purpose: Defines abstract base class for layout containers
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUISequentialLayoutContainer_h_
31 #define _CEGUISequentialLayoutContainer_h_
32 
33 #include "CEGUILayoutContainer.h"
34 
35 #if defined(_MSC_VER)
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
38 #endif
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
43 
52 class CEGUIEXPORT SequentialLayoutContainer : public LayoutContainer
53 {
54 public:
55  /*************************************************************************
56  Event name constants
57  *************************************************************************/
59  static const String EventNamespace;
60 
63 
74  SequentialLayoutContainer(const String& type, const String& name);
75 
80  virtual ~SequentialLayoutContainer(void);
81 
86  size_t getPositionOfChildWindow(Window* wnd) const;
87 
92  size_t getPositionOfChildWindow(const String& wnd) const;
93 
98  Window* getChildWindowAtPosition(size_t position) const;
99 
104  virtual void swapChildWindowPositions(size_t wnd1, size_t wnd2);
105 
110  void swapChildWindows(Window* wnd1, Window* wnd2);
111 
116  void swapChildWindows(const String& wnd1, Window* wnd2);
117 
122  void swapChildWindows(Window* wnd1, const String& wnd2);
123 
128  void swapChildWindows(const String& wnd1, const String& wnd2);
129 
137  virtual void moveChildWindowToPosition(Window* wnd, size_t position);
138 
146  void moveChildWindowToPosition(const String& wnd, size_t position);
147 
157  void moveChildWindow(Window* window, int delta = 1);
158 
163  void addChildWindowToPosition(Window* window, size_t position);
164 
169  void addChildWindowToPosition(const String& window, size_t position);
170 
175  void removeChildWindowFromPosition(size_t position);
176 
177 protected:
186  virtual void onChildWindowOrderChanged(WindowEventArgs& e);
187 
189  virtual bool testClassName_impl(const String& class_name) const
190  {
191  if (class_name == "SequentialLayoutContainer") return true;
192 
193  return LayoutContainer::testClassName_impl(class_name);
194  }
195 };
196 
197 } // End of CEGUI namespace section
198 
199 #if defined(_MSC_VER)
200 # pragma warning(pop)
201 #endif
202 
203 #endif // end of guard _CEGUISequentialLayoutContainer_h_
204