00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _CEGUILayoutContainer_h_
00031 #define _CEGUILayoutContainer_h_
00032
00033 #include "../CEGUIWindow.h"
00034
00035 #include <map>
00036
00037 #if defined(_MSC_VER)
00038 # pragma warning(push)
00039 # pragma warning(disable : 4251)
00040 #endif
00041
00042
00043 namespace CEGUI
00044 {
00045
00054 class CEGUIEXPORT LayoutContainer : public Window
00055 {
00056 public:
00057
00058
00059
00061 static const String EventNamespace;
00062
00073 LayoutContainer(const String& type, const String& name);
00074
00079 virtual ~LayoutContainer(void);
00080
00085 void markNeedsLayouting();
00086
00091 bool needsLayouting() const;
00092
00097 virtual void layout() = 0;
00098
00104 virtual void layoutIfNecessary();
00105
00107 virtual Rect getUnclippedInnerRect_impl(void) const;
00108
00110 virtual void update(float elapsed);
00111
00112 protected:
00114 virtual Rect getClientChildWindowContentArea_impl() const;
00115
00117 virtual bool testClassName_impl(const String& class_name) const
00118 {
00119 if (class_name == "LayoutContainer") return true;
00120
00121 return Window::testClassName_impl(class_name);
00122 }
00123
00124 size_t getIdxOfChildWindow(Window* wnd) const;
00125
00127 virtual void addChild_impl(Window* wnd);
00129 virtual void removeChild_impl(Window* wnd);
00130
00131
00132
00133
00143 virtual bool handleChildSized(const EventArgs& e);
00144
00154 virtual bool handleChildMarginChanged(const EventArgs& e);
00155
00165 virtual bool handleChildAdded(const EventArgs& e);
00166
00176 virtual bool handleChildRemoved(const EventArgs& e);
00177
00182 virtual UVector2 getOffsetForWindow(Window* window) const;
00183
00188 virtual UVector2 getBoundingSizeForWindow(Window* window) const;
00189
00190
00191
00192
00193
00194 bool d_needsLayouting;
00195
00196 typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
00198 ConnectionTracker d_eventConnections;
00199 };
00200
00201 }
00202
00203 #if defined(_MSC_VER)
00204 # pragma warning(pop)
00205 #endif
00206
00207 #endif // end of guard _CEGUILayoutContainer_h_
00208