Restore SEBPatch
This commit is contained in:
@@ -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.UserInterface.Contracts.Shell.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Event handler fired by an <see cref="IActionCenterActivator"/> to control the visibility of the <see cref="IActionCenter"/>.
|
||||
/// </summary>
|
||||
public delegate void ActivatorEventHandler();
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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.ComponentModel;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Event handler used to define the control flow when the <see cref="ITaskbar"/>'s quit button is clicked.
|
||||
/// </summary>
|
||||
public delegate void QuitButtonClickedEventHandler(CancelEventArgs args);
|
||||
}
|
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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.I18n.Contracts;
|
||||
using SafeExamBrowser.UserInterface.Contracts.Shell.Events;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// The action center is a user interface element via which the user can access and control various aspects of SEB.
|
||||
/// </summary>
|
||||
public interface IActionCenter
|
||||
{
|
||||
/// <summary>
|
||||
/// Controls the visibility of the clock.
|
||||
/// </summary>
|
||||
bool ShowClock { set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls the visibility of the quit button.
|
||||
/// </summary>
|
||||
bool ShowQuitButton { set; }
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the user clicked the quit button.
|
||||
/// </summary>
|
||||
event QuitButtonClickedEventHandler QuitButtonClicked;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given application control to the action center.
|
||||
/// </summary>
|
||||
void AddApplicationControl(IApplicationControl control, bool atFirstPosition = false);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given notification control to the action center.
|
||||
/// </summary>
|
||||
void AddNotificationControl(INotificationControl control);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given system control to the action center.
|
||||
/// </summary>
|
||||
void AddSystemControl(ISystemControl control);
|
||||
|
||||
/// <summary>
|
||||
/// Closes the action center.
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// Makes the action center invisible.
|
||||
/// </summary>
|
||||
void Hide();
|
||||
|
||||
/// <summary>
|
||||
/// Moves the action center to the left of the screen and resizes it accordingly.
|
||||
/// </summary>
|
||||
void InitializeBounds();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes all text elements in the action center.
|
||||
/// </summary>
|
||||
void InitializeText(IText text);
|
||||
|
||||
/// <summary>
|
||||
/// Makes the action center visible and automatically hides it after a short delay.
|
||||
/// </summary>
|
||||
void Promote();
|
||||
|
||||
/// <summary>
|
||||
/// Registers the specified activator to control the visibility of the action center.
|
||||
/// </summary>
|
||||
void Register(IActionCenterActivator activator);
|
||||
|
||||
/// <summary>
|
||||
/// Makes the action center visible.
|
||||
/// </summary>
|
||||
void Show();
|
||||
}
|
||||
}
|
@@ -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/.
|
||||
*/
|
||||
|
||||
using SafeExamBrowser.UserInterface.Contracts.Shell.Events;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// A module which can be used to control the <see cref="IActionCenter"/>.
|
||||
/// </summary>
|
||||
public interface IActionCenterActivator : IActivator
|
||||
{
|
||||
/// <summary>
|
||||
/// Fired when the action center should be made visible.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler Activated;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the action center should be made invisible.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler Deactivated;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the action center visibility should be toggled.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler Toggled;
|
||||
}
|
||||
}
|
36
SafeExamBrowser.UserInterface.Contracts/Shell/IActivator.cs
Normal file
36
SafeExamBrowser.UserInterface.Contracts/Shell/IActivator.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an activator for a shell component.
|
||||
/// </summary>
|
||||
public interface IActivator
|
||||
{
|
||||
/// <summary>
|
||||
/// Temporarily stops processing all user input.
|
||||
/// </summary>
|
||||
void Pause();
|
||||
|
||||
/// <summary>
|
||||
/// Resumes processing user input.
|
||||
/// </summary>
|
||||
void Resume();
|
||||
|
||||
/// <summary>
|
||||
/// Starts monitoring user input events.
|
||||
/// </summary>
|
||||
void Start();
|
||||
|
||||
/// <summary>
|
||||
/// Stops monitoring user input events.
|
||||
/// </summary>
|
||||
void Stop();
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// The control for an application which can be loaded into the shell.
|
||||
/// </summary>
|
||||
public interface IApplicationControl
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// The control for a notification which can be loaded into the shell.
|
||||
/// </summary>
|
||||
public interface INotificationControl
|
||||
{
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// The control of a system component which can be loaded into the shell.
|
||||
/// </summary>
|
||||
public interface ISystemControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Closes the control and / or any associated user interface elements.
|
||||
/// </summary>
|
||||
void Close();
|
||||
}
|
||||
}
|
28
SafeExamBrowser.UserInterface.Contracts/Shell/ITaskView.cs
Normal file
28
SafeExamBrowser.UserInterface.Contracts/Shell/ITaskView.cs
Normal 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.Applications.Contracts;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// The task view provides an overview of all currently running application instances.
|
||||
/// </summary>
|
||||
public interface ITaskview
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds the given application to the task view.
|
||||
/// </summary>
|
||||
void Add(IApplication<IApplicationWindow> application);
|
||||
|
||||
/// <summary>
|
||||
/// Registers the specified activator for the task view.
|
||||
/// </summary>
|
||||
void Register(ITaskviewActivator activator);
|
||||
}
|
||||
}
|
@@ -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/.
|
||||
*/
|
||||
|
||||
using SafeExamBrowser.UserInterface.Contracts.Shell.Events;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// A module which can be used to control the <see cref="ITaskview"/>.
|
||||
/// </summary>
|
||||
public interface ITaskviewActivator : IActivator
|
||||
{
|
||||
/// <summary>
|
||||
/// Fired when the task view should be hidden.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler Deactivated;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the task view should be made visible and the next application instance should be selected.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler NextActivated;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when the task view should be made visible and the previous application instance should be selected.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler PreviousActivated;
|
||||
}
|
||||
}
|
90
SafeExamBrowser.UserInterface.Contracts/Shell/ITaskbar.cs
Normal file
90
SafeExamBrowser.UserInterface.Contracts/Shell/ITaskbar.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.Browser.Contracts.Events;
|
||||
using SafeExamBrowser.I18n.Contracts;
|
||||
using SafeExamBrowser.UserInterface.Contracts.Shell.Events;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// The taskbar is a user interface element via which the user can access and control various aspects of the application.
|
||||
/// </summary>
|
||||
public interface ITaskbar
|
||||
{
|
||||
/// <summary>
|
||||
/// Controls the visibility of the clock.
|
||||
/// </summary>
|
||||
bool ShowClock { set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls the visibility of the quit button.
|
||||
/// </summary>
|
||||
bool ShowQuitButton { set; }
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the user clicked the quit button in the taskbar.
|
||||
/// </summary>
|
||||
event QuitButtonClickedEventHandler QuitButtonClicked;
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when the Taskbar wants to lose focus.
|
||||
/// </summary>
|
||||
event LoseFocusRequestedEventHandler LoseFocusRequested;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given application control to the taskbar.
|
||||
/// </summary>
|
||||
void AddApplicationControl(IApplicationControl control, bool atFirstPosition = false);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given notification control to the taskbar.
|
||||
/// </summary>
|
||||
void AddNotificationControl(INotificationControl control);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the given system control to the taskbar.
|
||||
/// </summary>
|
||||
void AddSystemControl(ISystemControl control);
|
||||
|
||||
/// <summary>
|
||||
/// Closes the taskbar.
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// Puts the focus on the taskbar.
|
||||
/// </summary>
|
||||
void Focus(bool forward = true);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the absolute height of the taskbar (i.e. in physical pixels).
|
||||
/// </summary>
|
||||
int GetAbsoluteHeight();
|
||||
|
||||
/// <summary>
|
||||
/// Moves the taskbar to the bottom of the screen and resizes it accordingly.
|
||||
/// </summary>
|
||||
void InitializeBounds();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes all text elements in the taskbar.
|
||||
/// </summary>
|
||||
void InitializeText(IText text);
|
||||
|
||||
/// <summary>
|
||||
/// Registers the specified activator for the taskbar.
|
||||
/// </summary>
|
||||
void Register(ITaskbarActivator activator);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the taskbar.
|
||||
/// </summary>
|
||||
void Show();
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell.Events;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// A module which can be used to activate the <see cref="ITaskbar"/>.
|
||||
/// </summary>
|
||||
public interface ITaskbarActivator : IActivator
|
||||
{
|
||||
/// <summary>
|
||||
/// Fired when the taskbar should be activated (i.e. put into focus).
|
||||
/// </summary>
|
||||
event ActivatorEventHandler Activated;
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell.Events;
|
||||
|
||||
namespace SafeExamBrowser.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// A module which observes user input and indicates when the user would like to terminate SEB.
|
||||
/// </summary>
|
||||
public interface ITerminationActivator : IActivator
|
||||
{
|
||||
/// <summary>
|
||||
/// Fired when a termination request has been detected.
|
||||
/// </summary>
|
||||
event ActivatorEventHandler Activated;
|
||||
}
|
||||
}
|
26
SafeExamBrowser.UserInterface.Contracts/Shell/Location.cs
Normal file
26
SafeExamBrowser.UserInterface.Contracts/Shell/Location.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.UserInterface.Contracts.Shell
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines all possible locations of a user control in the shell.
|
||||
/// </summary>
|
||||
public enum Location
|
||||
{
|
||||
/// <summary>
|
||||
/// A user control styled for and placed in the action center.
|
||||
/// </summary>
|
||||
ActionCenter,
|
||||
|
||||
/// <summary>
|
||||
/// A user control styled for and placed in the taskbar.
|
||||
/// </summary>
|
||||
Taskbar
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user