1 /* 2 * Copyright (C) 2013-2018 Team Kodi 3 * This file is part of Kodi - https://kodi.tv 4 * 5 * SPDX-License-Identifier: GPL-2.0-or-later 6 * See LICENSES/README.md for more information. 7 */ 8 9 #pragma once 10 11 /*! 12 \ingroup settings 13 \brief Interface defining methods being called by the settings system if an 14 action is performed on multiple/all settings 15 */ 16 class ISettingsHandler 17 { 18 public: 19 virtual ~ISettingsHandler() = default; 20 21 /*! 22 \brief Settings loading has been initiated. 23 24 \return True if the settings should be loaded, false if the loading should be aborted. 25 */ OnSettingsLoading()26 virtual bool OnSettingsLoading() { return true; } 27 /*! 28 \brief Settings have been loaded. 29 30 This callback can be used to trigger loading other settings. 31 */ OnSettingsLoaded()32 virtual void OnSettingsLoaded() { } 33 /*! 34 \brief Settings saving has been initiated. 35 36 \return True if the settings should be saved, false if the saving should be aborted. 37 */ OnSettingsSaving()38 virtual bool OnSettingsSaving() const { return true; } 39 /*! 40 \brief Settings have been saved. 41 42 This callback can be used to trigger saving other settings. 43 */ OnSettingsSaved()44 virtual void OnSettingsSaved() const { } 45 /*! 46 \brief Setting values have been unloaded. 47 48 This callback can be used to trigger uninitializing any state variables 49 (e.g. before re-loading the settings). 50 */ OnSettingsUnloaded()51 virtual void OnSettingsUnloaded() { } 52 /*! 53 \brief Settings have been cleared. 54 55 This callback can be used to trigger clearing any state variables. 56 */ OnSettingsCleared()57 virtual void OnSettingsCleared() { } 58 }; 59