]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - include/ifiletypes.h
Merge branch 'q3map2help' into 'master'
[xonotic/netradiant.git] / include / ifiletypes.h
index e2851be29df2decd931ba4fe7caebfa8efe4fa03..25d2cac920fffaffd612ccdcdb124b113f3a98b4 100644 (file)
@@ -1,25 +1,25 @@
 /*
-Copyright (C) 2001-2006, William Joseph.
-All Rights Reserved.
+   Copyright (C) 2001-2006, William Joseph.
+   All Rights Reserved.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
-#if !defined(INCLUDED_IFILETYPES_H)
+#if !defined( INCLUDED_IFILETYPES_H )
 #define INCLUDED_IFILETYPES_H
 
 #include "generic/constant.h"
@@ -27,33 +27,34 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 class filetype_t
 {
 public:
-  filetype_t()
-    : name(""), pattern("")
-  {
-  }
-  filetype_t(const char* _name, const char* _pattern)
-    : name(_name), pattern(_pattern)
-  {
-  }
-  const char* name;
-  const char* pattern;
+filetype_t()
+       : name( "" ), pattern( "" ){
+}
+filetype_t( const char* _name, const char* _pattern, bool _can_load = true, bool _can_import = true, bool _can_save = true )
+       : name( _name ), pattern( _pattern ), can_load( _can_load ), can_import( _can_import ), can_save( _can_save ){
+}
+const char* name;
+const char* pattern;
+bool can_load;
+bool can_import;
+bool can_save;
 };
 
 
 class IFileTypeList
 {
 public:
-  virtual void addType(const char* moduleName, filetype_t type) = 0;
+virtual void addType( const char* moduleName, filetype_t type ) = 0;
 };
 
 class IFileTypeRegistry
 {
 public:
-  INTEGER_CONSTANT(Version, 1);
-  STRING_CONSTANT(Name, "filetypes");
+INTEGER_CONSTANT( Version, 1 );
+STRING_CONSTANT( Name, "filetypes" );
 
-  virtual void addType(const char* moduleType, const char* moduleName, filetype_t type) = 0;
-  virtual void getTypeList(const char* moduleType, IFileTypeList* typelist) = 0;
+virtual void addType( const char* moduleType, const char* moduleName, filetype_t type ) = 0;
+virtual void getTypeList( const char* moduleType, IFileTypeList* typelist, bool want_load = false, bool want_import = false, bool want_save = false ) = 0;
 };
 
 #include "modulesystem.h"
@@ -66,9 +67,8 @@ template<typename Type>
 class GlobalModuleRef;
 typedef GlobalModuleRef<IFileTypeRegistry> GlobalFiletypesModuleRef;
 
-inline IFileTypeRegistry& GlobalFiletypes()
-{
-  return GlobalFiletypesModule::getTable();
+inline IFileTypeRegistry& GlobalFiletypes(){
+       return GlobalFiletypesModule::getTable();
 }