2018-01-17 08:26:44 +01:00
|
|
|
|
/*
|
2024-03-05 18:37:42 +01:00
|
|
|
|
* Copyright (c) 2024 ETH Zürich, IT Services
|
2018-01-17 08:26:44 +01:00
|
|
|
|
*
|
|
|
|
|
* 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;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.Configuration.Contracts.Cryptography;
|
|
|
|
|
using SafeExamBrowser.Configuration.Contracts.DataFormats;
|
|
|
|
|
using SafeExamBrowser.Configuration.Contracts.DataResources;
|
2019-10-01 11:30:53 +02:00
|
|
|
|
using SafeExamBrowser.Settings;
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
2019-08-30 09:55:26 +02:00
|
|
|
|
namespace SafeExamBrowser.Configuration.Contracts
|
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>
|
2018-12-14 15:30:10 +01:00
|
|
|
|
/// Attempts to save the given resource as local client configuration.
|
2018-12-14 09:50:10 +01:00
|
|
|
|
/// </summary>
|
2018-12-14 15:30:10 +01:00
|
|
|
|
SaveStatus ConfigureClientWith(Uri resource, PasswordParameters password = null);
|
2018-12-14 09:50:10 +01:00
|
|
|
|
|
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>
|
2019-06-11 09:53:33 +02:00
|
|
|
|
SessionConfiguration 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>
|
2019-10-01 11:30:53 +02:00
|
|
|
|
AppSettings LoadDefaultSettings();
|
2018-01-17 08:26:44 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-12-21 11:36:20 +01:00
|
|
|
|
/// Registers the specified <see cref="IDataParser"/> to be used to parse configuration data.
|
2018-01-17 08:26:44 +01:00
|
|
|
|
/// </summary>
|
2018-12-21 11:36:20 +01:00
|
|
|
|
void Register(IDataParser parser);
|
2018-11-08 09:39:52 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-12-21 11:36:20 +01:00
|
|
|
|
/// Registers the specified <see cref="IDataSerializer"/> to be used to serialize configuration data.
|
2018-12-14 09:50:10 +01:00
|
|
|
|
/// </summary>
|
2018-12-21 11:36:20 +01:00
|
|
|
|
void Register(IDataSerializer serializer);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Registers the specified <see cref="IResourceLoader"/> to be used to load configuration resources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Register(IResourceLoader loader);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Registers the specified <see cref="IResourceSaver"/> to be used to save configuration resources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void Register(IResourceSaver saver);
|
2018-12-14 09:50:10 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Attempts to load settings from the specified resource.
|
2018-11-08 09:39:52 +01:00
|
|
|
|
/// </summary>
|
2019-10-01 11:30:53 +02:00
|
|
|
|
LoadStatus TryLoadSettings(Uri resource, out AppSettings settings, PasswordParameters password = null);
|
2018-01-17 08:26:44 +01:00
|
|
|
|
}
|
|
|
|
|
}
|