File indexing completed on 2024-04-14 04:00:18

0001 /***************************************************************************
0002                                cmapfilefilterbase.h
0003                              -------------------
0004     begin                : Mon May 27 2002
0005     copyright            : (C) 2002 by Kmud Developer Team
0006     email                : kmud-devel@kmud.de
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #ifndef CMAPFILEFILTERBASE_H
0019 #define CMAPFILEFILTERBASE_H
0020 
0021 
0022 #include <QString>
0023 
0024 class CMapManager;
0025 
0026 /**This class is used as a base calls for all save/load filters
0027   *@author Kmud Developer Team
0028   */
0029 
0030 class CMapFileFilterBase
0031 {
0032 public: 
0033     CMapFileFilterBase(CMapManager *manager);
0034     virtual ~CMapFileFilterBase();
0035 
0036     /** This returns name of the import/export filter. This should be kept small
0037       * @return The Name of the filter */   
0038     virtual QString getName(void)=0;
0039     /** This returns a discription of the import/export filter
0040       * @return The discription */
0041     virtual QString getDescription(void)=0;
0042     /** This returns the extension  of the filename that will be loaded,created
0043       * @return The exstension */
0044     virtual QString getExtension(void)=0;
0045     /** This returns the pattern extension of the filename that will be loaded,created
0046       * @return The exstension */
0047     virtual QString getPatternExtension(void)=0;    
0048 
0049     /** This method will return true or false depending on if it's a export filter
0050       * @return True if this is a export filter, otherwise false */
0051     virtual bool supportSave(void)=0;
0052     /** This method will return true or false depending on if it's a import filter
0053       * @return True if this is a import filter, otherwise false */
0054     virtual bool supportLoad(void)=0;
0055         /** Is this the native format? */
0056         virtual bool isNative() = 0;
0057 
0058     /** This method is called by the map manager to save map data.  
0059       */
0060     virtual int saveData(const QString &) { return 0; }
0061     /** This method is called by the map manager to load map data.  
0062       */
0063     virtual int loadData(const QString &) { return 0; }
0064 
0065 protected:
0066     /** A pointer to the map manager */
0067     CMapManager *m_mapManager;
0068 };
0069 
0070 #endif