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
00109 protected:
00111 virtual Rect getClientChildWindowContentArea_impl() const;
00112
00114 virtual bool testClassName_impl(const String& class_name) const
00115 {
00116 if (class_name == "LayoutContainer") return true;
00117
00118 return Window::testClassName_impl(class_name);
00119 }
00120
00121 size_t getIdxOfChildWindow(Window* wnd) const;
00122
00124 virtual void addChild_impl(Window* wnd);
00126 virtual void removeChild_impl(Window* wnd);
00128 virtual void drawSelf(const RenderingContext& ctx);
00129
00130
00131
00132
00142 virtual bool handleChildSized(const EventArgs& e);
00143
00153 virtual bool handleChildMarginChanged(const EventArgs& e);
00154
00164 virtual bool handleChildAdded(const EventArgs& e);
00165
00175 virtual bool handleChildRemoved(const EventArgs& e);
00176
00181 virtual UVector2 getOffsetForWindow(Window* window) const;
00182
00187 virtual UVector2 getBoundingSizeForWindow(Window* window) const;
00188
00189
00190
00191
00192
00193 bool d_needsLayouting;
00194
00195 typedef std::multimap<Window*, Event::Connection> ConnectionTracker;
00197 ConnectionTracker d_eventConnections;
00198 };
00199
00200 }
00201
00202 #if defined(_MSC_VER)
00203 # pragma warning(pop)
00204 #endif
00205
00206 #endif // end of guard _CEGUILayoutContainer_h_
00207