Factory.h
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
00027
00028 #ifndef ROCKETCOREFACTORY_H
00029 #define ROCKETCOREFACTORY_H
00030
00031 #include <Rocket/Core/XMLParser.h>
00032 #include <Rocket/Core/Header.h>
00033 #include <map>
00034
00035 namespace Rocket {
00036 namespace Core {
00037
00038 class Context;
00039 class ContextInstancer;
00040 class Decorator;
00041 class DecoratorInstancer;
00042 class Element;
00043 class ElementDocument;
00044 class ElementInstancer;
00045 class Event;
00046 class EventInstancer;
00047 class EventListener;
00048 class EventListenerInstancer;
00049 class FontEffect;
00050 class FontEffectInstancer;
00051 class StyleSheet;
00052 class PropertyDictionary;
00053
00063 class ROCKETCORE_API Factory
00064 {
00065 public:
00067 static bool Initialise();
00069 static void Shutdown();
00070
00073 static ContextInstancer* RegisterContextInstancer(ContextInstancer* instancer);
00077 static Context* InstanceContext(const String& name);
00078
00083 static ElementInstancer* RegisterElementInstancer(const String& name, ElementInstancer* instancer);
00087 static ElementInstancer* GetElementInstancer(const String& tag);
00094 static Element* InstanceElement(Element* parent, const String& instancer, const String& tag, const XMLAttributes& attributes);
00095
00101 static bool InstanceElementText(Element* parent, const String& text);
00106 static bool InstanceElementStream(Element* parent, Stream* stream);
00111 static ElementDocument* InstanceDocumentStream(Rocket::Core::Context* context, Stream* stream);
00112
00117 static DecoratorInstancer* RegisterDecoratorInstancer(const String& name, DecoratorInstancer* instancer);
00122 static Decorator* InstanceDecorator(const String& name, const PropertyDictionary& properties);
00123
00128 static FontEffectInstancer* RegisterFontEffectInstancer(const String& name, FontEffectInstancer* instancer);
00133 static FontEffect* InstanceFontEffect(const String& name, const PropertyDictionary& properties);
00134
00138 static StyleSheet* InstanceStyleSheetString(const String& string);
00142 static StyleSheet* InstanceStyleSheetFile(const String& file_name);
00146 static StyleSheet* InstanceStyleSheetStream(Stream* stream);
00148 static void ClearStyleSheetCache();
00149
00153 static EventInstancer* RegisterEventInstancer(EventInstancer* instancer);
00160 static Event* InstanceEvent(Element* target, const String& name, const Dictionary& parameters, bool interruptible);
00161
00164 static EventListenerInstancer* RegisterEventListenerInstancer(EventListenerInstancer* instancer);
00169 static EventListener* InstanceEventListener(const String& value);
00170
00171 private:
00172 Factory();
00173 ~Factory();
00174 };
00175
00176 }
00177 }
00178
00179 #endif