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 bool Save() = 0; |
20 | virtual class CConfig *Values() = 0; |
21 | |
22 | virtual void RegisterCallback(SAVECALLBACKFUNC pfnFunc, void *pUserData) = 0; |
23 | |
24 | virtual void WriteLine(const char *pLine) = 0; |
25 | |
26 | virtual void StoreUnknownCommand(const char *pCommand) = 0; |
27 | |
28 | virtual void PossibleConfigVariables(const char *pStr, int FlagMask, POSSIBLECFGFUNC pfnCallback, void *pUserData) = 0; |
29 | }; |
30 | |
31 | extern IConfigManager *CreateConfigManager(); |
32 | |
33 | #endif |
34 | |