ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

metaengine.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program 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 this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef ENGINES_METAENGINE_H
00024 #define ENGINES_METAENGINE_H
00025 
00026 #include "common/scummsys.h"
00027 #include "common/error.h"
00028 #include "common/array.h"
00029 
00030 #include "engines/game.h"
00031 #include "engines/savestate.h"
00032 
00033 #include "base/plugins.h"
00034 
00035 class Engine;
00036 class OSystem;
00037 
00038 namespace Common {
00039 class FSList;
00040 class String;
00041 }
00042 
00047 struct ExtraGuiOption {
00048     const char *label;          // option label, e.g. "Fullscreen mode"
00049     const char *tooltip;        // option tooltip (when the mouse hovers above it)
00050     const char *configOption;   // confMan key, e.g. "fullscreen"
00051     bool defaultState;          // the detault state of the checkbox (checked or not)
00052 };
00053 
00054 typedef Common::Array<ExtraGuiOption> ExtraGuiOptions;
00055 
00064 class MetaEngine : public PluginObject {
00065 public:
00066     virtual ~MetaEngine() {}
00067 
00069     virtual const char *getOriginalCopyright() const = 0;
00070 
00072     virtual PlainGameList getSupportedGames() const = 0;
00073 
00075     virtual PlainGameDescriptor findGame(const char *gameId) const = 0;
00076 
00082     virtual DetectedGames detectGames(const Common::FSList &fslist) const = 0;
00083 
00094     virtual Common::Error createInstance(OSystem *syst, Engine **engine) const = 0;
00095 
00114     virtual SaveStateList listSaves(const char *target) const {
00115         return SaveStateList();
00116     }
00117 
00131     virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const {
00132         return ExtraGuiOptions();
00133     }
00134 
00145     virtual int getMaximumSaveSlot() const {
00146         return 0;
00147     }
00148 
00161     virtual void removeSaveState(const char *target, int slot) const {}
00162 
00172     virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const {
00173         return SaveStateDescriptor();
00174     }
00175 
00178 
00183     enum MetaEngineFeature {
00189         kSupportsListSaves,
00190 
00194         kSupportsLoadingDuringStartup,
00195 
00200         kSupportsDeleteSave,
00201 
00216         kSavesSupportMetaInfo,
00217 
00223         kSavesSupportThumbnail,
00224 
00231         kSavesSupportCreationDate,
00232 
00239         kSavesSupportPlayTime,
00240 
00251         kSimpleSavesNames
00252     };
00253 
00258     virtual bool hasFeature(MetaEngineFeature f) const {
00259         return false;
00260     }
00261 
00263 };
00264 
00268 class EngineManager : public Common::Singleton<EngineManager> {
00269 public:
00270     PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
00271     PlainGameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
00272     DetectionResults detectGames(const Common::FSList &fslist) const;
00273     const PluginList &getPlugins() const;
00274 
00280     Common::String createTargetForGame(const DetectedGame &game);
00281 };
00282 
00284 #define EngineMan EngineManager::instance()
00285 
00286 #endif


Generated on Sat May 18 2019 05:01:09 for ResidualVM by doxygen 1.7.1
curved edge   curved edge