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 *getEngineId() const = 0;
00070 
00072     virtual const char *getOriginalCopyright() const = 0;
00073 
00075     virtual PlainGameList getSupportedGames() const = 0;
00076 
00078     virtual PlainGameDescriptor findGame(const char *gameId) const = 0;
00079 
00085     virtual DetectedGames detectGames(const Common::FSList &fslist) const = 0;
00086 
00097     virtual Common::Error createInstance(OSystem *syst, Engine **engine) const = 0;
00098 
00117     virtual SaveStateList listSaves(const char *target) const {
00118         return SaveStateList();
00119     }
00120 
00134     virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const {
00135         return ExtraGuiOptions();
00136     }
00137 
00148     virtual int getMaximumSaveSlot() const {
00149         return 0;
00150     }
00151 
00164     virtual void removeSaveState(const char *target, int slot) const {}
00165 
00175     virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const {
00176         return SaveStateDescriptor();
00177     }
00178 
00181 
00186     enum MetaEngineFeature {
00192         kSupportsListSaves,
00193 
00197         kSupportsLoadingDuringStartup,
00198 
00203         kSupportsDeleteSave,
00204 
00219         kSavesSupportMetaInfo,
00220 
00226         kSavesSupportThumbnail,
00227 
00234         kSavesSupportCreationDate,
00235 
00242         kSavesSupportPlayTime,
00243 
00254         kSimpleSavesNames
00255     };
00256 
00261     virtual bool hasFeature(MetaEngineFeature f) const {
00262         return false;
00263     }
00264 
00266 };
00267 
00271 class EngineManager : public Common::Singleton<EngineManager> {
00272 public:
00278     DetectionResults detectGames(const Common::FSList &fslist) const;
00279 
00281     const Plugin *findPlugin(const Common::String &engineId) const;
00282 
00284     const PluginList &getPlugins() const;
00285 
00287     QualifiedGameDescriptor findTarget(const Common::String &target, const Plugin **plugin = NULL) const;
00288 
00296     QualifiedGameList findGamesMatching(const Common::String &engineId, const Common::String &gameId) const;
00297 
00303     Common::String createTargetForGame(const DetectedGame &game);
00304 
00306     void upgradeTargetIfNecessary(const Common::String &target) const;
00307 
00308 private:
00310     QualifiedGameList findGameInLoadedPlugins(const Common::String &gameId) const;
00311 
00313     const Plugin *findLoadedPlugin(const Common::String &engineId) const;
00314 
00316     void upgradeTargetForEngineId(const Common::String &target) const;
00317 };
00318 
00320 #define EngineMan EngineManager::instance()
00321 
00322 #endif


Generated on Sat Feb 15 2020 05:00:55 for ResidualVM by doxygen 1.7.1
curved edge   curved edge