Added more missing APIs

This commit is contained in:
Florian Rappl
2026-09-04 16:51:51 +02:00
parent 98c72af3d6
commit fffd7dfb79
12 changed files with 831 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
namespace ElectronNET.API.Entities
{
/// <summary>
/// Options for <see cref="WebContents.AdjustSelection"/>.
/// </summary>
public class AdjustSelectionOptions
{
/// <summary>
/// Amount to shift the start index of the current selection.
/// </summary>
public int? Start { get; set; }
/// <summary>
/// Amount to shift the end index of the current selection.
/// </summary>
public int? End { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
namespace ElectronNET.API.Entities
{
/// <summary>
/// Options for <see cref="WebContents.FindInPageAsync"/>.
/// </summary>
public class FindInPageOptions
{
/// <summary>
/// Whether to search forward or backward, defaults to true.
/// </summary>
public bool? Forward { get; set; }
/// <summary>
/// Whether to begin a new text finding session with this request. Should be true
/// for initial requests, and false for subsequent requests. Defaults to false.
/// </summary>
public bool? FindNext { get; set; }
/// <summary>
/// Whether search should be case-sensitive, defaults to false.
/// </summary>
public bool? MatchCase { get; set; }
}
}

View File

@@ -0,0 +1,33 @@
namespace ElectronNET.API.Entities
{
/// <summary>
/// The result of a text finding session, reported by the found-in-page event.
/// </summary>
public class FoundInPageResult
{
/// <summary>
/// The identifier of the request returned by FindInPageAsync.
/// </summary>
public int RequestId { get; set; }
/// <summary>
/// Position of the active match.
/// </summary>
public int ActiveMatchOrdinal { get; set; }
/// <summary>
/// Number of matches.
/// </summary>
public int Matches { get; set; }
/// <summary>
/// Coordinates of the first match region.
/// </summary>
public Rectangle SelectionArea { get; set; }
/// <summary>
/// Indicates whether more responses are to follow.
/// </summary>
public bool FinalUpdate { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
namespace ElectronNET.API.Entities
{
/// <summary>
/// Options for loading a local file into a web page.
/// </summary>
public class LoadFileOptions
{
/// <summary>
/// Passed to url.format().
/// </summary>
public Dictionary<string, string> Query { get; set; }
/// <summary>
/// Passed to url.format().
/// </summary>
public string Search { get; set; }
/// <summary>
/// Passed to url.format().
/// </summary>
public string Hash { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
namespace ElectronNET.API.Entities
{
/// <summary>
/// Determines what happens to the selection when a text finding session is stopped.
/// </summary>
public enum StopFindInPageAction
{
/// <summary>
/// Clear the selection.
/// </summary>
ClearSelection,
/// <summary>
/// Translate the selection into a normal selection.
/// </summary>
KeepSelection,
/// <summary>
/// Focus and click the selection node.
/// </summary>
ActivateSelection
}
}