Crazy Eddies GUI System: CEGUILayoutContainer.h Source File

Crazy Eddies GUI System 0.7.6

- 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
    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         Event trigger methods
    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         Implementation Data
    00192     *************************************************************************/
    00193     // if true, we will relayout before rendering of this window starts
    00194     bool d_needsLayouting;
    00195
    00196     typedef std::multimap<Window*, Event::Connection>  ConnectionTracker;
    00198     ConnectionTracker d_eventConnections;
    00199 };
    00200
    00201 } // End of  CEGUI namespace section
    00202
    00203 #if defined(_MSC_VER)
    00204 #   pragma warning(pop)
    00205 #endif
    00206
    00207 #endif  // end of guard _CEGUILayoutContainer_h_
    00208