Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUIGUILayout_xmlHandler.h

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIGUILayout_xmlHandler.h
00003         created:        5/7/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Interface to XML parser for GUILayout files
00007 *************************************************************************/
00008 /*************************************************************************
00009     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00011 
00012     This library is free software; you can redistribute it and/or
00013     modify it under the terms of the GNU Lesser General Public
00014     License as published by the Free Software Foundation; either
00015     version 2.1 of the License, or (at your option) any later version.
00016 
00017     This library is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020     Lesser General Public License for more details.
00021 
00022     You should have received a copy of the GNU Lesser General Public
00023     License along with this library; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 *************************************************************************/
00026 #ifndef _CEGUIGUILayout_xmlHandler_h_
00027 #define _CEGUIGUILayout_xmlHandler_h_
00028 
00029 #include "CEGUIWindowManager.h"
00030 #include "CEGUIWindow.h"
00031 
00032 #include "xercesc/sax2/DefaultHandler.hpp"
00033 
00034 #include <vector>
00035 
00036 // Start of CEGUI namespace section
00037 namespace CEGUI
00038 {
00043 class GUILayout_xmlHandler : public XERCES_CPP_NAMESPACE::DefaultHandler
00044 {
00045         typedef WindowManager::PropertyCallback PropertyCallback;
00046 public:
00047         /*************************************************************************
00048                 Construction & Destruction
00049         *************************************************************************/
00054         GUILayout_xmlHandler(const String& name_prefix, PropertyCallback* callback = NULL, void* userdata = NULL) : 
00055           d_root(NULL),
00056           d_namingPrefix(name_prefix),
00057           d_propertyCallback(callback),
00058           d_userData(userdata)
00059           {}
00060 
00065         virtual ~GUILayout_xmlHandler(void) {}
00066 
00067         /*************************************************************************
00068                 SAX2 Handler overrides
00069         *************************************************************************/ 
00074         virtual void    startElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname, const XERCES_CPP_NAMESPACE::Attributes& attrs);
00075 
00076         virtual void    endElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname);
00077 
00082         virtual void  warning (const XERCES_CPP_NAMESPACE::SAXParseException &exc);
00083         virtual void  error (const XERCES_CPP_NAMESPACE::SAXParseException &exc);
00084         virtual void  fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exc);
00085 
00086         /*************************************************************************
00087                 Functions used by our implementation
00088         *************************************************************************/
00093         void    cleanupLoadedWindows(void);
00094 
00095 
00100         Window* getLayoutRootWindow(void) const;
00101 
00102 private:
00103         /*************************************************************************
00104                 Implementation Constants
00105         *************************************************************************/
00106         static const String GUILayoutElement;                           
00107         static const String WindowElement;                              
00108         static const String PropertyElement;                            
00109         static const String LayoutImportElement;                        
00110         static const String EventElement;                                       
00111         static const char       WindowTypeAttribute[];                  
00112         static const char       WindowNameAttribute[];                  
00113         static const char       PropertyNameAttribute[];                
00114         static const char       PropertyValueAttribute[];               
00115         static const char       LayoutParentAttribute[];                
00116         static const char       LayoutImportFilenameAttribute[];
00117         static const char       LayoutImportPrefixAttribute[];  
00118     static const char   LayoutImportResourceGroupAttribute[]; 
00119         static const char       EventNameAttribute[];                   
00120         static const char       EventFunctionAttribute[];               
00121 
00122 
00123         /*************************************************************************
00124                 Implementation Data
00125         *************************************************************************/
00126         typedef std::vector<Window*>    WindowStack;    
00127         Window* d_root;                         
00128         WindowStack     d_stack;                
00129         String          d_layoutParent; 
00130         const String&           d_namingPrefix; 
00131         PropertyCallback*       d_propertyCallback; 
00132         void*                           d_userData;                     
00133 };
00134 
00135 
00136 } // End of  CEGUI namespace section
00137 
00138 
00139 #endif  // end of guard _CEGUIGUILayout_xmlHandler_h_

Generated on Wed Feb 16 12:41:06 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1