/*
* 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
{
///
/// Saves the given resource as local client configuration.
///
void ConfigureClientWith(Uri resource, EncryptionParameters encryption = 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, PasswordParameters password, out EncryptionParameters encryption, out Format format, out Settings.Settings settings);
///
/// Attempts to save settings according to the specified parameters.
///
SaveStatus TrySaveSettings(Uri resource, Format format, Settings.Settings settings, EncryptionParameters encryption = null);
}
}