00001 /****************************************************************************** 00002 * This file is part of the Gluon Development Platform 00003 * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 #ifndef GLUON_CREATOR_OBJECTMANAGER_H 00021 #define GLUON_CREATOR_OBJECTMANAGER_H 00022 00023 #include "gluoncreator_macros.h" 00024 00025 #include <core/singleton.h> 00026 00027 namespace GluonCore 00028 { 00029 class GluonObject; 00030 } 00031 00032 namespace GluonEngine 00033 { 00034 class Asset; 00035 class GameObject; 00036 class Scene; 00037 class Component; 00038 } 00039 00040 namespace GluonCreator 00041 { 00042 00043 class GLUONCREATOR_EXPORT ObjectManager : public GluonCore::Singleton<ObjectManager> 00044 { 00045 Q_OBJECT 00046 public slots: 00047 GluonEngine::Component* createNewComponent( const QString& type, GluonEngine::GameObject* parent ); 00048 GluonEngine::Scene* createNewScene(); 00049 GluonEngine::GameObject* createNewGameObject(); 00050 GluonEngine::Asset* createNewAsset( const QString& fileName ); 00051 void deleteGameObject( GluonEngine::GameObject* object ); 00052 void changeProperty( GluonCore::GluonObject* object, QString& property, QVariant& oldValue, QVariant& newValue ); 00053 QString humanifyClassName( const QString& fixThis, bool justRemoveNamespace = false ) const; 00054 00055 signals: 00056 void newObject( GluonCore::GluonObject* ); 00057 void newScene( GluonEngine::Scene* ); 00058 void newGameObject( GluonEngine::GameObject* ); 00059 void newComponent( GluonEngine::Component* ); 00060 00061 private: 00062 friend class GluonCore::Singleton<ObjectManager>; 00063 00064 ObjectManager(); 00065 ~ObjectManager(); 00066 Q_DISABLE_COPY( ObjectManager ) 00067 00068 int m_objectId; 00069 int m_sceneId; 00070 }; 00071 00072 } 00073 00074 #endif // GLUON_CREATOR_OBJECTMANAGER_H