2017-07-24 17:31:28 +02:00
|
|
|
|
/*
|
2023-03-08 00:30:20 +01:00
|
|
|
|
* Copyright (c) 2023 ETH Zürich, Educational Development and Technology (LET)
|
2017-07-24 17:31:28 +02: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/.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-12-05 11:54:43 +01:00
|
|
|
|
using System;
|
2022-05-02 16:33:35 +02:00
|
|
|
|
using SafeExamBrowser.Browser.Contracts.Events;
|
2021-03-18 23:12:07 +01:00
|
|
|
|
using SafeExamBrowser.Core.Contracts.Resources.Icons;
|
2020-01-22 15:16:11 +01:00
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Browser.Data;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Browser.Events;
|
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Windows;
|
2018-03-14 12:07:20 +01:00
|
|
|
|
|
2019-08-30 09:55:26 +02:00
|
|
|
|
namespace SafeExamBrowser.UserInterface.Contracts.Browser
|
2017-07-24 17:31:28 +02:00
|
|
|
|
{
|
2018-03-06 11:38:12 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines the functionality of a browser window, i.e. a window with an embedded browser instance (see <see cref="IBrowserControl"/>).
|
|
|
|
|
/// </summary>
|
2017-07-24 17:31:28 +02:00
|
|
|
|
public interface IBrowserWindow : IWindow
|
|
|
|
|
{
|
2019-01-23 09:37:47 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Enables the backward navigation button.
|
|
|
|
|
/// </summary>
|
|
|
|
|
bool CanNavigateBackwards { set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Enables the forward navigation button.
|
|
|
|
|
/// </summary>
|
|
|
|
|
bool CanNavigateForwards { set; }
|
2022-05-13 16:47:18 +02:00
|
|
|
|
|
2019-12-05 11:54:43 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The native handle of the window.
|
|
|
|
|
/// </summary>
|
|
|
|
|
IntPtr Handle { get; }
|
2019-01-23 09:37:47 +01:00
|
|
|
|
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user changed the URL.
|
|
|
|
|
/// </summary>
|
2017-08-02 08:31:12 +02:00
|
|
|
|
event AddressChangedEventHandler AddressChanged;
|
2017-07-31 20:22:53 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to navigate backwards.
|
|
|
|
|
/// </summary>
|
2017-08-02 08:31:12 +02:00
|
|
|
|
event ActionRequestedEventHandler BackwardNavigationRequested;
|
2017-07-31 20:22:53 +02:00
|
|
|
|
|
2019-05-22 11:42:31 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to open the developer console.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event ActionRequestedEventHandler DeveloperConsoleRequested;
|
|
|
|
|
|
2020-08-10 21:42:51 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to search the current page.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event FindRequestedEventHandler FindRequested;
|
|
|
|
|
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to navigate forwards.
|
|
|
|
|
/// </summary>
|
2017-08-02 08:31:12 +02:00
|
|
|
|
event ActionRequestedEventHandler ForwardNavigationRequested;
|
2017-07-31 20:22:53 +02:00
|
|
|
|
|
2020-10-05 23:37:23 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to navigate home.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event ActionRequestedEventHandler HomeNavigationRequested;
|
|
|
|
|
|
2021-11-24 08:42:07 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the browser window wants to lose focus to the taskbar.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event LoseFocusRequestedEventHandler LoseFocusRequested;
|
|
|
|
|
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to reload the current page.
|
|
|
|
|
/// </summary>
|
2017-08-02 08:31:12 +02:00
|
|
|
|
event ActionRequestedEventHandler ReloadRequested;
|
2017-07-31 20:22:53 +02:00
|
|
|
|
|
2019-01-18 16:11:33 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to zoom in.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event ActionRequestedEventHandler ZoomInRequested;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to zoom out.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event ActionRequestedEventHandler ZoomOutRequested;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Event fired when the user would like to reset the zoom factor.
|
|
|
|
|
/// </summary>
|
|
|
|
|
event ActionRequestedEventHandler ZoomResetRequested;
|
|
|
|
|
|
2022-05-13 16:47:18 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the focus on the address bar of the window.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void FocusAddressBar();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the focus on the browser content of the window.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void FocusBrowser();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the focus on the toolbar of the window. If the parameter is set to true, the first focusable control on the toolbar gets focused.
|
|
|
|
|
/// If it is set to false, the last one.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void FocusToolbar(bool forward);
|
|
|
|
|
|
2020-08-10 21:42:51 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Displays the find toolbar to search the content of a page.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void ShowFindbar();
|
|
|
|
|
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// <summary>
|
2019-05-22 11:42:31 +02:00
|
|
|
|
/// Updates the address bar of the browser window to the given value.
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateAddress(string adress);
|
|
|
|
|
|
2019-01-17 16:15:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the icon of the browser window.
|
|
|
|
|
/// </summary>
|
2019-11-06 08:45:37 +01:00
|
|
|
|
void UpdateIcon(IconResource icon);
|
2019-01-17 16:15:10 +01:00
|
|
|
|
|
2020-01-22 15:16:11 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the download state for the given item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateDownloadState(DownloadItemState state);
|
|
|
|
|
|
2018-03-01 08:50:08 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the loading state according to the given value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateLoadingState(bool isLoading);
|
|
|
|
|
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// <summary>
|
2019-05-22 11:42:31 +02:00
|
|
|
|
/// Updates the page load progress according to the given value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateProgress(double value);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sets the title of the browser window to the given value.
|
2017-07-31 20:22:53 +02:00
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateTitle(string title);
|
2019-05-22 11:42:31 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the display value of the current page zoom. Value is expected to be in percentage.
|
|
|
|
|
/// </summary>
|
|
|
|
|
void UpdateZoomLevel(double value);
|
2017-07-24 17:31:28 +02:00
|
|
|
|
}
|
|
|
|
|
}
|