/*
* 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;
using SafeExamBrowser.Browser.Contracts.Events;
using SafeExamBrowser.Core.Contracts.Resources.Icons;
using SafeExamBrowser.UserInterface.Contracts.Browser.Data;
using SafeExamBrowser.UserInterface.Contracts.Browser.Events;
using SafeExamBrowser.UserInterface.Contracts.Windows;
namespace SafeExamBrowser.UserInterface.Contracts.Browser
{
///
/// Defines the functionality of a browser window, i.e. a window with an embedded browser instance (see ).
///
public interface IBrowserWindow : IWindow
{
///
/// Enables the backward navigation button.
///
bool CanNavigateBackwards { set; }
///
/// Enables the forward navigation button.
///
bool CanNavigateForwards { set; }
///
/// The native handle of the window.
///
IntPtr Handle { get; }
///
/// Event fired when the user changed the URL.
///
event AddressChangedEventHandler AddressChanged;
///
/// Event fired when the user would like to navigate backwards.
///
event ActionRequestedEventHandler BackwardNavigationRequested;
///
/// Event fired when the user would like to open the developer console.
///
event ActionRequestedEventHandler DeveloperConsoleRequested;
///
/// Event fired when the user would like to search the current page.
///
event FindRequestedEventHandler FindRequested;
///
/// Event fired when the user would like to navigate forwards.
///
event ActionRequestedEventHandler ForwardNavigationRequested;
///
/// Event fired when the user would like to navigate home.
///
event ActionRequestedEventHandler HomeNavigationRequested;
///
/// Event fired when the browser window wants to lose focus to the taskbar.
///
event LoseFocusRequestedEventHandler LoseFocusRequested;
///
/// Event fired when the user would like to reload the current page.
///
event ActionRequestedEventHandler ReloadRequested;
///
/// Event fired when the user would like to zoom in.
///
event ActionRequestedEventHandler ZoomInRequested;
///
/// Event fired when the user would like to zoom out.
///
event ActionRequestedEventHandler ZoomOutRequested;
///
/// Event fired when the user would like to reset the zoom factor.
///
event ActionRequestedEventHandler ZoomResetRequested;
///
/// Sets the focus on the address bar of the window.
///
void FocusAddressBar();
///
/// Sets the focus on the browser content of the window.
///
void FocusBrowser();
///
/// 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.
///
void FocusToolbar(bool forward);
///
/// Displays the find toolbar to search the content of a page.
///
void ShowFindbar();
///
/// Updates the address bar of the browser window to the given value.
///
void UpdateAddress(string adress);
///
/// Updates the icon of the browser window.
///
void UpdateIcon(IconResource icon);
///
/// Updates the download state for the given item.
///
void UpdateDownloadState(DownloadItemState state);
///
/// Updates the loading state according to the given value.
///
void UpdateLoadingState(bool isLoading);
///
/// Updates the page load progress according to the given value.
///
void UpdateProgress(double value);
///
/// Sets the title of the browser window to the given value.
///
void UpdateTitle(string title);
///
/// Updates the display value of the current page zoom. Value is expected to be in percentage.
///
void UpdateZoomLevel(double value);
}
}