00001 /* 00002 Copyright (C) 2001-2006, William Joseph. 00003 All Rights Reserved. 00004 00005 This file is part of GtkRadiant. 00006 00007 GtkRadiant is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 GtkRadiant is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with GtkRadiant; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #if !defined(INCLUDED_IMAP_H) 00023 #define INCLUDED_IMAP_H 00024 00025 #include "generic/constant.h" 00026 00027 class Tokeniser; 00028 class TokenWriter; 00029 00031 class MapImporter { 00032 public: 00033 STRING_CONSTANT(Name, "MapImporter"); 00034 00035 virtual ~MapImporter(){} 00036 00037 virtual bool importTokens(Tokeniser& tokeniser) = 0; 00038 }; 00039 00041 class MapExporter { 00042 public: 00043 STRING_CONSTANT(Name, "MapExporter"); 00044 00045 virtual ~MapExporter(){} 00046 00047 virtual void exportTokens(TokenWriter& writer) const = 0; 00048 }; 00049 00050 #include "iscenegraph.h" 00051 00052 class EntityCreator; 00053 00054 class TextInputStream; 00055 class TextOutputStream; 00056 00057 00058 typedef void(*GraphTraversalFunc)(scene::Node& root, const scene::Traversable::Walker& walker); 00059 00061 class MapFormat { 00062 public: 00063 INTEGER_CONSTANT(Version, 2); 00064 STRING_CONSTANT(Name, "map"); 00065 00066 virtual ~MapFormat(){} 00067 00069 virtual void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const = 0; 00071 virtual void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const = 0; 00072 }; 00073 00074 00075 template<typename Type> 00076 class Modules; 00077 typedef Modules<MapFormat> MapModules; 00078 00079 template<typename Type> 00080 class ModulesRef; 00081 typedef ModulesRef<MapFormat> MapModulesRef; 00082 00083 00084 #endif