/*
 * Copyright (c) 2018 ETH Zürich, Educational Development and Technology (LET)
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
using System;
using SafeExamBrowser.Contracts.Configuration.Cryptography;
using SafeExamBrowser.Contracts.Configuration.DataFormats;
using SafeExamBrowser.Contracts.Configuration.DataResources;
namespace SafeExamBrowser.Contracts.Configuration
{
	/// 
	/// The repository which controls the loading and saving of configuration data.
	/// 
	public interface IConfigurationRepository
	{
		/// 
		/// Attempts to save the given resource as local client configuration.
		/// 
		SaveStatus ConfigureClientWith(Uri resource, PasswordParameters password = null);
		/// 
		/// Initializes the global configuration information for the currently running application instance.
		/// 
		AppConfig InitializeAppConfig();
		/// 
		/// Initializes all relevant configuration data for a new session.
		/// 
		ISessionConfiguration InitializeSessionConfiguration();
		/// 
		/// Loads the default settings.
		/// 
		Settings.Settings LoadDefaultSettings();
		/// 
		/// Registers the specified  to be used when loading or saving configuration data.
		/// 
		void Register(IDataFormat dataFormat);
		/// 
		/// Registers the specified  to be used when loading or saving configuration data.
		/// 
		void Register(IDataResource dataResource);
		/// 
		/// Attempts to load settings from the specified resource.
		/// 
		LoadStatus TryLoadSettings(Uri resource, out Settings.Settings settings, PasswordParameters password = null);
		/// 
		/// Attempts to save settings according to the specified parameters.
		/// 
		SaveStatus TrySaveSettings(Uri resource, Format format, Settings.Settings settings, EncryptionParameters encryption = null);
	}
}