| 1 | /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ |
| 2 | /* If you are missing that file, acquire a complete release at teeworlds.com. */ |
| 3 | #ifndef ENGINE_CONFIG_H |
| 4 | #define ENGINE_CONFIG_H |
| 5 | |
| 6 | #include "kernel.h" |
| 7 | |
| 8 | class IConfigManager : public IInterface |
| 9 | { |
| 10 | MACRO_INTERFACE("config" ) |
| 11 | public: |
| 12 | typedef void (*SAVECALLBACKFUNC)(IConfigManager *pConfig, void *pUserData); |
| 13 | typedef void (*POSSIBLECFGFUNC)(const struct SConfigVariable *, void *pUserData); |
| 14 | |
| 15 | virtual void Init() = 0; |
| 16 | virtual void Reset(const char *pScriptName) = 0; |
| 17 | virtual void ResetGameSettings() = 0; |
| 18 | virtual void SetReadOnly(const char *pScriptName, bool ReadOnly) = 0; |
| 19 | virtual void SetGameSettingsReadOnly(bool ReadOnly) = 0; |
| 20 | virtual bool Save() = 0; |
| 21 | virtual class CConfig *Values() = 0; |
| 22 | |
| 23 | virtual void RegisterCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) = 0; |
| 24 | |
| 25 | virtual void WriteLine(const char *pLine) = 0; |
| 26 | |
| 27 | virtual void StoreUnknownCommand(const char *pCommand) = 0; |
| 28 | |
| 29 | virtual void PossibleConfigVariables(const char *pStr, int FlagMask, POSSIBLECFGFUNC pfnCallback, void *pUserData) = 0; |
| 30 | }; |
| 31 | |
| 32 | extern IConfigManager *CreateConfigManager(); |
| 33 | |
| 34 | #endif |
| 35 | |