// $Id: GlobalSettings.hh 5733 2006-10-02 13:16:39Z m9710797 $ #ifndef GLOBALSETTINGS_HH #define GLOBALSETTINGS_HH #include "Observer.hh" #include "noncopyable.hh" #include namespace openmsx { class CommandController; class IntegerSetting; class BooleanSetting; class StringSetting; class ThrottleManager; class Setting; template class EnumSetting; /** * This class contains settings that are used by several other class * (including some singletons). This class was introduced to solve * lifetime management issues. */ class GlobalSettings : private Observer, private noncopyable { public: explicit GlobalSettings(CommandController& commandController); ~GlobalSettings(); IntegerSetting& getSpeedSetting(); BooleanSetting& getPauseSetting(); BooleanSetting& getPowerSetting(); BooleanSetting& getAutoSaveSetting(); BooleanSetting& getConsoleSetting(); StringSetting& getUserDirSetting(); StringSetting& getUMRCallBackSetting(); EnumSetting& getBootSectorSetting(); ThrottleManager& getThrottleManager(); private: // Observer virtual void update(const Setting& setting); CommandController& commandController; std::auto_ptr speedSetting; std::auto_ptr pauseSetting; std::auto_ptr powerSetting; std::auto_ptr autoSaveSetting; std::auto_ptr consoleSetting; std::auto_ptr userDirSetting; std::auto_ptr umrCallBackSetting; std::auto_ptr > bootSectorSetting; std::auto_ptr throttleManager; }; } // namespace openmsx #endif