source: OGRE/trunk/ogre_dependencies/Dependencies/include/CEGUI/falagard/CEGUIFalWidgetComponent.h @ 692

Revision 692, 4.3 KB checked in by mattausch, 19 years ago (diff)

adding ogre 1.2 and dependencies

Line 
1/************************************************************************
2    filename:   CEGUIFalWidgetComponent.h
3    created:    Mon Jun 13 2005
4    author:     Paul D Turner <paul@cegui.org.uk>
5*************************************************************************/
6/*************************************************************************
7    Crazy Eddie's GUI System (http://www.cegui.org.uk)
8    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
9 
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Lesser General Public
12    License as published by the Free Software Foundation; either
13    version 2.1 of the License, or (at your option) any later version.
14 
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    Lesser General Public License for more details.
19 
20    You should have received a copy of the GNU Lesser General Public
21    License along with this library; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23*************************************************************************/
24#ifndef _CEGUIFalWidgetComponent_h_
25#define _CEGUIFalWidgetComponent_h_
26
27#include "falagard/CEGUIFalDimensions.h"
28#include "falagard/CEGUIFalPropertyInitialiser.h"
29#include "CEGUIWindow.h"
30
31#if defined(_MSC_VER)
32#       pragma warning(push)
33#       pragma warning(disable : 4251)
34#endif
35
36// Start of CEGUI namespace section
37namespace CEGUI
38{
39    /*!
40    \brief
41        Class that encapsulates information regarding a sub-widget required for a widget.
42
43    \todo
44        This is not finished in the slightest!  There will be many changes here...
45    */
46    class CEGUIEXPORT WidgetComponent
47    {
48    public:
49        WidgetComponent() {}
50        WidgetComponent(const String& type, const String& look, const String& suffix);
51
52        /*!
53        \brief
54            Create an instance of this widget component adding it as a child to the given Window.
55        */
56        void create(Window& parent) const;
57
58        const ComponentArea& getComponentArea() const;
59        void setComponentArea(const ComponentArea& area);
60
61        const String& getBaseWidgetType() const;
62        void setBaseWidgetType(const String& type);
63
64        const String& getWidgetLookName() const;
65        void setWidgetLookName(const String& look);
66
67        const String& getWidgetNameSuffix() const;
68        void setWidgetNameSuffix(const String& suffix);
69
70        VerticalAlignment getVerticalWidgetAlignemnt() const;
71        void setVerticalWidgetAlignment(VerticalAlignment alignment);
72
73        HorizontalAlignment getHorizontalWidgetAlignemnt() const;
74        void setHorizontalWidgetAlignemnt(HorizontalAlignment alignment);
75
76        void addPropertyInitialiser(const PropertyInitialiser& initialiser);
77        void clearPropertyInitialisers();
78
79        void layout(const Window& owner) const;
80
81        /*!
82        \brief
83            Writes an xml representation of this WidgetComponent to \a out_stream.
84
85        \param out_stream
86            Stream where xml data should be output.
87
88        \return
89            Nothing.
90        */
91        void writeXMLToStream(OutStream& out_stream) const;
92
93    private:
94        typedef std::vector<PropertyInitialiser> PropertiesList;
95
96        ComponentArea   d_area;              //!< Destination area for the widget (relative to it's parent).
97        String   d_baseType;                 //!< Type of widget to be created.
98        String   d_imageryName;              //!< Name of a WidgetLookFeel to be used for the widget.
99        String   d_nameSuffix;               //!< Suffix to apply to the parent Window name to create this widgets unique name.
100        VerticalAlignment    d_vertAlign;    //!< Vertical alignment to be used for this widget.
101        HorizontalAlignment  d_horzAlign;    //!< Horizontal alignment to be used for this widget.
102        PropertiesList  d_properties;        //!< Collection of PropertyInitialisers to be applied the the widget upon creation.
103    };
104
105} // End of  CEGUI namespace section
106
107
108#if defined(_MSC_VER)
109#       pragma warning(pop)
110#endif
111
112#endif  // end of guard _CEGUIFalWidgetComponent_h_
Note: See TracBrowser for help on using the repository browser.