Restore SEBPatch

This commit is contained in:
2025-06-01 11:44:20 +02:00
commit 8c656e3137
1297 changed files with 142172 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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/.
*/
namespace SafeExamBrowser.SystemComponents.Contracts.PowerSupply
{
/// <summary>
/// Defines all possible battery charge statuses which can be determined by the application.
/// </summary>
public enum BatteryChargeStatus
{
Undefined = 0,
/// <summary>
/// The battery charge is critical, i.e. below 20%.
/// </summary>
Critical,
/// <summary>
/// The battery charge is low, i.e. below 35%.
/// </summary>
Low,
/// <summary>
/// The battery charge is okay, i.e. above 35%.
/// </summary>
Okay
}
}

View File

@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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/.
*/
namespace SafeExamBrowser.SystemComponents.Contracts.PowerSupply.Events
{
/// <summary>
/// Indicates that the status of the power supply for the system has changed.
/// </summary>
public delegate void StatusChangedEventHandler(IPowerSupplyStatus status);
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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 SafeExamBrowser.SystemComponents.Contracts.PowerSupply.Events;
namespace SafeExamBrowser.SystemComponents.Contracts.PowerSupply
{
/// <summary>
/// Defines the functionality of the power supply.
/// </summary>
public interface IPowerSupply : ISystemComponent
{
/// <summary>
/// Fired when the status of the power supply changed.
/// </summary>
event StatusChangedEventHandler StatusChanged;
/// <summary>
/// Retrieves the current status of the power supply.
/// </summary>
IPowerSupplyStatus GetStatus();
}
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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;
namespace SafeExamBrowser.SystemComponents.Contracts.PowerSupply
{
/// <summary>
/// Provides data about the power supply of the system.
/// </summary>
public interface IPowerSupplyStatus
{
/// <summary>
/// Defines the current charge of the system battery: <c>0.0</c> means the battery is empty, <c>1.0</c> means it's fully charged.
/// </summary>
double BatteryCharge { get; }
/// <summary>
/// Defines the current charge status of the system battery.
/// </summary>
BatteryChargeStatus BatteryChargeStatus { get; }
/// <summary>
/// Defines the time remaining until the battery is empty.
/// </summary>
TimeSpan BatteryTimeRemaining { get; }
/// <summary>
/// Indicates whether the system is connected to the power grid.
/// </summary>
bool IsOnline { get; }
}
}