• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

CEGUILayoutContainer.h

00001 /***********************************************************************
00002     filename:   CEGUILayoutContainer.h
00003     created:    29/7/2010
00004     author:     Martin Preisler
00005 
00006     purpose:    Defines abstract base class for layout containers
00007 *************************************************************************/
00008 /***************************************************************************
00009  *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
00010  *
00011  *   Permission is hereby granted, free of charge, to any person obtaining
00012  *   a copy of this software and associated documentation files (the
00013  *   "Software"), to deal in the Software without restriction, including
00014  *   without limitation the rights to use, copy, modify, merge, publish,
00015  *   distribute, sublicense, and/or sell copies of the Software, and to
00016  *   permit persons to whom the Software is furnished to do so, subject to
00017  *   the following conditions:
00018  *
00019  *   The above copyright notice and this permission notice shall be
00020  *   included in all copies or substantial portions of the Software.
00021  *
00022  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00023  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00024  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00025  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00026  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00027  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00028  *   OTHER DEALINGS IN THE SOFTWARE.
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 // Start of CEGUI namespace section
00043 namespace CEGUI
00044 {
00045 
00054 class CEGUIEXPORT LayoutContainer : public Window
00055 {
00056 public:
00057     /*************************************************************************
00058         Event name constants
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         Event trigger methods
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         Implementation Data
00191     *************************************************************************/
00192     // if true, we will relayout before rendering of this window starts
00193     bool d_needsLayouting;
00194 
00195     typedef std::multimap<Window*, Event::Connection>  ConnectionTracker;
00197     ConnectionTracker d_eventConnections;
00198 };
00199 
00200 } // End of  CEGUI namespace section
00201 
00202 #if defined(_MSC_VER)
00203 #   pragma warning(pop)
00204 #endif
00205 
00206 #endif  // end of guard _CEGUILayoutContainer_h_
00207 

Generated on Sat Sep 25 2010 02:10:34 for Crazy Eddies GUI System by  doxygen 1.7.1