2018-01-17 08:26:44 +01:00
|
|
|
|
/*
|
|
|
|
|
* 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;
|
2018-12-14 09:50:10 +01:00
|
|
|
|
using SafeExamBrowser.Contracts.Configuration.Cryptography;
|
|
|
|
|
using SafeExamBrowser.Contracts.Configuration.DataFormats;
|
|
|
|
|
using SafeExamBrowser.Contracts.Configuration.DataResources;
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
2018-02-06 15:12:11 +01:00
|
|
|
|
namespace SafeExamBrowser.Contracts.Configuration
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-03-06 11:38:12 +01:00
|
|
|
|
/// <summary>
|
2018-12-11 16:06:10 +01:00
|
|
|
|
/// The repository which controls the loading and saving of configuration data.
|
2018-03-06 11:38:12 +01:00
|
|
|
|
/// </summary>
|
2018-02-06 15:12:11 +01:00
|
|
|
|
public interface IConfigurationRepository
|
2018-01-17 08:26:44 +01:00
|
|
|
|
{
|
2018-12-14 09:50:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the given resource as local client configuration.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void ConfigureClientWith(Uri resource, EncryptionParameters encryption = null);
|
|
|
|
|
|
2018-06-29 09:50:20 +02:00
|
|
|
|
/// <summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
/// Initializes the global configuration information for the currently running application instance.
|
2018-06-29 09:50:20 +02:00
|
|
|
|
/// </summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
AppConfig InitializeAppConfig();
|
2018-06-29 09:50:20 +02:00
|
|
|
|
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// <summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
/// Initializes all relevant configuration data for a new session.
|
2018-02-08 13:32:48 +01:00
|
|
|
|
/// </summary>
|
2018-10-12 11:16:59 +02:00
|
|
|
|
ISessionConfiguration InitializeSessionConfiguration();
|
2018-02-08 13:32:48 +01:00
|
|
|
|
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// <summary>
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// Loads the default settings.
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-11-08 09:39:52 +01:00
|
|
|
|
Settings.Settings LoadDefaultSettings();
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-12-14 09:50:10 +01:00
|
|
|
|
/// Registers the specified <see cref="IDataFormat"/> to be used when loading or saving configuration data.
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-11-08 09:39:52 +01:00
|
|
|
|
void Register(IDataFormat dataFormat);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-12-14 09:50:10 +01:00
|
|
|
|
/// Registers the specified <see cref="IDataResource"/> to be used when loading or saving configuration data.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Register(IDataResource dataResource);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attempts to load settings from the specified resource.
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// </summary>
|
2018-12-14 09:50:10 +01:00
|
|
|
|
LoadStatus TryLoadSettings(Uri resource, PasswordParameters password, out EncryptionParameters encryption, out Format format, out Settings.Settings settings);
|
2018-11-08 09:39:52 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-12-14 09:50:10 +01:00
|
|
|
|
/// Attempts to save settings according to the specified parameters.
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// </summary>
|
2018-12-14 09:50:10 +01:00
|
|
|
|
SaveStatus TrySaveSettings(Uri resource, Format format, Settings.Settings settings, EncryptionParameters encryption = null);
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|