using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Abp.Configuration
{
///
/// This is the main interface that must be implemented to be able to load/change values of settings.
///
public interface ISettingManager
{
///
/// Gets current value of a setting.
/// It gets the setting value, overwritten by application, current tenant and current user if exists.
///
/// Unique name of the setting
/// Current value of the setting
Task GetSettingValueAsync(string name);
///
/// Gets current value of a setting for the application level.
///
/// Unique name of the setting
/// Current value of the setting for the application
Task GetSettingValueForApplicationAsync(string name);
///
/// Gets current value of a setting for the application level.
/// If fallbackToDefault is false, it just gets value from application and returns null if application has not defined a value for the setting.
///
/// Unique name of the setting
///
/// Current value of the setting for the application
Task GetSettingValueForApplicationAsync(string name, bool fallbackToDefault);
///
/// Gets current value of a setting for a tenant level.
/// It gets the setting value, overwritten by given tenant.
///
/// Unique name of the setting
/// Tenant id
/// Current value of the setting
Task GetSettingValueForTenantAsync(string name, int tenantId);
///
/// Gets current value of a setting for a tenant level.
/// It gets the setting value, overwritten by given tenant if fallbackToDefault is true.
/// If fallbackToDefault is false, it just gets value from tenant and returns null if tenant has not defined a value for the setting.
///
/// Unique name of the setting
/// Tenant id
///
/// Current value of the setting
Task GetSettingValueForTenantAsync(string name, int tenantId, bool fallbackToDefault);
///
/// Gets current value of a setting for a user level.
/// It gets the setting value, overwritten by given tenant and user.
///
/// Unique name of the setting
/// Tenant id
/// User id
/// Current value of the setting for the user
Task GetSettingValueForUserAsync(string name, int? tenantId, long userId);
///
/// Gets current value of a setting for a user level.
/// It gets the setting value, overwritten by given tenant and user if fallbackToDefault is true.
/// If fallbackToDefault is false, it just gets value from user and returns null if user has not defined a value for the setting.
///
/// Unique name of the setting
/// Tenant id
/// User id
///
/// Current value of the setting for the user
Task GetSettingValueForUserAsync(string name, int? tenantId, long userId, bool fallbackToDefault);
///
/// Gets current value of a setting for a user level.
/// It gets the setting value, overwritten by given tenant and user.
///
/// Unique name of the setting
/// User
/// Current value of the setting for the user
Task GetSettingValueForUserAsync(string name, UserIdentifier user);
///
/// Gets current values of all settings.
/// It gets all setting values, overwritten by application, current tenant (if exists) and the current user (if exists).
///
/// List of setting values
Task> GetAllSettingValuesAsync();
///
/// Gets current values of all settings.
/// It gets default values of all settings then overwrites by given scopes.
///
/// One or more scope to overwrite
/// List of setting values
Task> GetAllSettingValuesAsync(SettingScopes scopes);
///
/// Gets a list of all setting values specified for the application.
/// It returns only settings those are explicitly set for the application.
/// If a setting's default value is used, it's not included the result list.
/// If you want to get current values of all settings, use method.
///
/// List of setting values
Task> GetAllSettingValuesForApplicationAsync();
///
/// Gets a list of all setting values specified for a tenant.
/// It returns only settings those are explicitly set for the tenant.
/// If a setting's default value is used, it's not included the result list.
/// If you want to get current values of all settings, use method.
///
/// Tenant to get settings
/// List of setting values
Task> GetAllSettingValuesForTenantAsync(int tenantId);
///
/// Gets a list of all setting values specified for a user.
/// It returns only settings those are explicitly set for the user.
/// If a setting's value is not set for the user (for example if user uses the default value), it's not included the result list.
/// If you want to get current values of all settings, use method.
///
/// User to get settings
/// All settings of the user
Task> GetAllSettingValuesForUserAsync(UserIdentifier user);
///
/// Changes setting for the application level.
///
/// Unique name of the setting
/// Value of the setting
Task ChangeSettingForApplicationAsync(string name, string value);
///
/// Changes setting for a Tenant.
///
/// TenantId
/// Unique name of the setting
/// Value of the setting
Task ChangeSettingForTenantAsync(int tenantId, string name, string value);
///
/// Changes setting for a user.
///
/// UserId
/// Unique name of the setting
/// Value of the setting
Task ChangeSettingForUserAsync(UserIdentifier user, string name, string value);
}
}