00001 /*************************************************************************** 00002 * Copyright (C) 2005 - 2006 by Raphael Langerhorst * 00003 * raphael-langerhorst@gmx.at * 00004 * * 00005 * Permission is hereby granted, free of charge, to any person obtaining * 00006 * a copy of this software and associated documentation files (the * 00007 * "Software"), to deal in the Software without restriction, including * 00008 * without limitation the rights to use, copy, modify, merge, publish, * 00009 * distribute, sublicense, and/or sell copies of the Software, and to * 00010 * permit persons to whom the Software is furnished to do so, subject to * 00011 * the following conditions: * 00012 * * 00013 * The above copyright notice and this permission notice shall be * 00014 * included in all copies or substantial portions of the Software. * 00015 * * 00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * 00017 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.* 00019 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * 00020 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * 00021 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * 00022 * OTHER DEALINGS IN THE SOFTWARE. * 00023 ***************************************************************************/ 00024 00025 #ifndef GWEGWORLDENGINEFACTORY_H 00026 #define GWEGWORLDENGINEFACTORY_H 00027 00028 #include <GweFactoryOption.h> 00029 #include <GweController.h> 00030 #include <GXmlDataController.h> 00031 00032 #include <qobject.h> 00033 #include <qstring.h> 00034 #include <qstringlist.h> 00035 #include <QList> 00036 #include <qmutex.h> 00037 #include <qmap.h> 00038 #include <qdom.h> 00039 00040 namespace GWE 00041 { 00042 00049 class GWorldEngineFactory : public QObject, protected QMutex 00050 { 00051 Q_OBJECT 00052 00053 protected: 00054 00055 QList<GweController*> GweControllers; 00056 00064 GweFactoryOption* RootOption; 00065 00071 bool DeleteControllersInDestructor; 00072 00073 public: 00074 00078 GWorldEngineFactory(QObject *parent = 0); 00079 00083 virtual ~GWorldEngineFactory(); 00084 00088 void setDeleteControllersInDestructor(bool delete_in_destructor); 00089 00093 bool getDeleteControllersInDestructor() const; 00094 00098 QList<GWE::GweController*> getInitializedControllers(); 00099 00104 GweFactoryOption* getRootOption(); 00105 00110 const GweFactoryOption* getRootOption() const; 00111 00112 public slots: 00113 00119 GweController* init(); 00120 00127 GweController* initDefault(); 00128 00133 GXmlDataController* initTestDataController(QString jid, QString pwd); 00134 00135 signals: 00136 00143 void initSucceeded(GweController* controller); 00144 00151 void initFailed(QString error_description); 00152 }; 00153 00154 } 00155 00156 #endif
1.4.7