00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CEGUIGUILayout_xmlHandler_h_
00027 #define _CEGUIGUILayout_xmlHandler_h_
00028
00029 #include "CEGUIWindowManager.h"
00030 #include "CEGUIWindow.h"
00031 #include "CEGUIXMLHandler.h"
00032
00033 #include <vector>
00034
00035
00036 namespace CEGUI
00037 {
00042 class GUILayout_xmlHandler : public XMLHandler
00043 {
00044 typedef WindowManager::PropertyCallback PropertyCallback;
00045 public:
00046
00047
00048
00053 GUILayout_xmlHandler(const String& name_prefix, PropertyCallback* callback = NULL, void* userdata = NULL) :
00054 d_root(NULL),
00055 d_namingPrefix(name_prefix),
00056 d_propertyCallback(callback),
00057 d_userData(userdata)
00058 {}
00059
00064 virtual ~GUILayout_xmlHandler(void) {}
00065
00066
00067
00068
00073 virtual void elementStart(const String& element, const XMLAttributes& attributes);
00074 virtual void elementEnd(const String& element);
00075
00076
00077
00078
00083 void cleanupLoadedWindows(void);
00084
00085
00090 Window* getLayoutRootWindow(void) const;
00091
00092 private:
00093
00094
00095
00096 static const String GUILayoutElement;
00097 static const String WindowElement;
00098 static const String PropertyElement;
00099 static const String LayoutImportElement;
00100 static const String EventElement;
00101 static const char WindowTypeAttribute[];
00102 static const char WindowNameAttribute[];
00103 static const char PropertyNameAttribute[];
00104 static const char PropertyValueAttribute[];
00105 static const char LayoutParentAttribute[];
00106 static const char LayoutImportFilenameAttribute[];
00107 static const char LayoutImportPrefixAttribute[];
00108 static const char LayoutImportResourceGroupAttribute[];
00109 static const char EventNameAttribute[];
00110 static const char EventFunctionAttribute[];
00111
00112
00113
00114
00115
00116 typedef std::vector<Window*> WindowStack;
00117 Window* d_root;
00118 WindowStack d_stack;
00119 String d_layoutParent;
00120 const String& d_namingPrefix;
00121 PropertyCallback* d_propertyCallback;
00122 void* d_userData;
00123 };
00124
00125
00126 }
00127
00128
00129 #endif // end of guard _CEGUIGUILayout_xmlHandler_h_