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

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

adding ogre 1.2 and dependencies

Line 
1/************************************************************************
2        filename:       CEGUIWindowFactory.h
3        created:        21/2/2004
4        author:         Paul D Turner
5       
6        purpose:        Defines abstract base class for WindowFactory objects
7*************************************************************************/
8/*************************************************************************
9    Crazy Eddie's GUI System (http://www.cegui.org.uk)
10    Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
11
12    This library is free software; you can redistribute it and/or
13    modify it under the terms of the GNU Lesser General Public
14    License as published by the Free Software Foundation; either
15    version 2.1 of the License, or (at your option) any later version.
16
17    This library is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20    Lesser General Public License for more details.
21
22    You should have received a copy of the GNU Lesser General Public
23    License along with this library; if not, write to the Free Software
24    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25*************************************************************************/
26#ifndef _CEGUIWindowFactory_h_
27#define _CEGUIWindowFactory_h_
28
29#include "CEGUIBase.h"
30#include "CEGUIString.h"
31#include "CEGUIWindow.h"
32
33
34// Start of CEGUI namespace section
35namespace CEGUI
36{
37/*!
38\brief
39        Abstract class that defines the required interface for all WindowFactory objects
40
41        A WindowFactory is used to create and destroy windows of a specific type.  For every
42        type of Window object wihin the system (widgets, dialogs, movable windows etc) there
43        must be an associated WindowFactory registered with the WindowManager so that the system
44        knows how to create and destroy those types of Window base object.
45*/
46class CEGUIEXPORT WindowFactory
47{
48public:
49        /*!
50        \brief
51                Create a new Window object of whatever type this WindowFactory produces.
52
53        \param name
54                A unique name that is to be assigned to the newly created Window object
55
56        \return
57                Pointer to the new Window object.
58        */
59        virtual Window* createWindow(const String& name) = 0;
60
61        /*!
62        \brief
63                Destroys the given Window object.
64
65        \param window
66                Pointer to the Window object to be destroyed.
67
68        \return
69                Nothing.
70        */
71        virtual void    destroyWindow(Window* window) = 0;
72
73        /*!
74        \brief
75                Get the string that describes the type of Window object this WindowFactory produces.
76
77        \return
78                String object that contains the unique Window object type produced by this WindowFactory
79        */
80        const String& getTypeName(void) const           {return d_type;}
81
82protected:
83        /*************************************************************************
84                Construction and Destruction
85        *************************************************************************/
86        WindowFactory(const String& type) : d_type(type) {}
87
88public:         // luabind compatibility
89        virtual ~WindowFactory(void) {}
90
91protected:
92        /*************************************************************************
93                Implementation Data
94        *************************************************************************/
95        String          d_type;         //!< String holding the type of object created by this factory
96};
97
98} // End of  CEGUI namespace section
99
100#endif  // end of guard _CEGUIWindowFactory_h_
Note: See TracBrowser for help on using the repository browser.