00001 /*********************************************************************** 00002 filename: CEGUIConfig_xmlHandler.h 00003 created: 17/7/2004 00004 author: Paul D Turner 00005 00006 purpose: Interface to configuration file parser 00007 *************************************************************************/ 00008 /*************************************************************************** 00009 * Copyright (C) 2004 - 2006 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 _CEGUIConfig_xmlHandler_h_ 00031 #define _CEGUIConfig_xmlHandler_h_ 00032 00033 #include "CEGUIBase.h" 00034 #include "CEGUIString.h" 00035 #include "CEGUILogger.h" 00036 #include "CEGUIXMLHandler.h" 00037 00038 #include <vector> 00039 00040 // Start of CEGUI namespace section 00041 namespace CEGUI 00042 { 00047 class Config_xmlHandler : public XMLHandler 00048 { 00049 public: 00050 /************************************************************************* 00051 Construction & Destruction 00052 *************************************************************************/ 00057 Config_xmlHandler(void) {} 00058 00063 virtual ~Config_xmlHandler(void) {} 00064 00065 /************************************************************************* 00066 SAX2 Handler overrides 00067 *************************************************************************/ 00072 virtual void elementStart(const String& element, const XMLAttributes& attributes); 00073 00074 /************************************************************************* 00075 Functions used by our implementation 00076 *************************************************************************/ 00081 const String& getLogFilename(void) const {return d_logFilename;} 00082 00083 00088 const String& getSchemeFilename(void) const {return d_schemeFilename;} 00089 00090 00095 const String& getLayoutFilename(void) const {return d_layoutFilename;} 00096 00097 00102 const String& getInitScriptFilename(void) const {return d_initScriptFilename;} 00103 00104 00109 const String& getTermScriptFilename(void) const {return d_termScriptFilename;} 00110 00111 00116 const String& getDefaultFontName(void) const {return d_defaultFontName;} 00117 00118 00123 const String& getDefaultResourceGroup(void) const {return d_defaultResourceGroup;} 00124 00129 LoggingLevel getLoggingLevel(void) const {return d_logLevel;} 00130 00131 00132 private: 00133 /************************************************************************* 00134 Implementation Constants 00135 *************************************************************************/ 00136 static const String CEGUIConfigElement; 00137 static const char ConfigLogfileAttribute[]; 00138 static const char ConfigSchemeAttribute[]; 00139 static const char ConfigLayoutAttribute[]; 00140 static const char ConfigDefaultFontAttribute[]; 00141 static const char ConfigInitScriptAttribute[]; 00142 static const char ConfigTerminateScriptAttribute[]; 00143 static const char ConfigDefaultResourceGroupAttribute[]; 00144 static const char ConfigLoggingLevelAttribute[]; 00145 00146 /************************************************************************* 00147 Implementation Data 00148 *************************************************************************/ 00149 String d_logFilename; 00150 String d_schemeFilename; 00151 String d_layoutFilename; 00152 String d_initScriptFilename; 00153 String d_termScriptFilename; 00154 String d_defaultFontName; 00155 String d_defaultResourceGroup; 00156 LoggingLevel d_logLevel; 00157 }; 00158 00159 00160 } // End of CEGUI namespace section 00161 00162 #endif // end of guard _CEGUIConfig_xmlHandler_h_