mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-02-06 15:10:20 +00:00
feat: update app_links
This commit is contained in:
68
lib/common/rust/api/applinks_api.dart
Normal file
68
lib/common/rust/api/applinks_api.dart
Normal file
@@ -0,0 +1,68 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// @generated by `flutter_rust_bridge`@ 2.11.1.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
import '../frb_generated.dart';
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`
|
||||
|
||||
/// Check if the URL scheme is already registered with the correct executable path
|
||||
Future<ApplinksRegistrationResult> checkApplinksRegistration({
|
||||
required String scheme,
|
||||
}) => RustLib.instance.api.crateApiApplinksApiCheckApplinksRegistration(
|
||||
scheme: scheme,
|
||||
);
|
||||
|
||||
/// Register URL scheme in Windows registry
|
||||
/// This will create or update the registry keys for the custom URL scheme
|
||||
///
|
||||
/// # Arguments
|
||||
/// * `scheme` - The URL scheme to register (e.g., "sctoolbox")
|
||||
/// * `app_name` - Optional application display name (e.g., "SCToolBox"). If provided,
|
||||
/// the registry will show "URL:{app_name} Protocol" as the scheme description.
|
||||
Future<ApplinksRegistrationResult> registerApplinks({
|
||||
required String scheme,
|
||||
String? appName,
|
||||
}) => RustLib.instance.api.crateApiApplinksApiRegisterApplinks(
|
||||
scheme: scheme,
|
||||
appName: appName,
|
||||
);
|
||||
|
||||
/// Unregister URL scheme from Windows registry
|
||||
Future<ApplinksRegistrationResult> unregisterApplinks({
|
||||
required String scheme,
|
||||
}) =>
|
||||
RustLib.instance.api.crateApiApplinksApiUnregisterApplinks(scheme: scheme);
|
||||
|
||||
/// Applinks URL scheme registration result
|
||||
class ApplinksRegistrationResult {
|
||||
/// Whether registration was successful
|
||||
final bool success;
|
||||
|
||||
/// Detailed message about the operation
|
||||
final String message;
|
||||
|
||||
/// Whether the registry was modified (false if already configured correctly)
|
||||
final bool wasModified;
|
||||
|
||||
const ApplinksRegistrationResult({
|
||||
required this.success,
|
||||
required this.message,
|
||||
required this.wasModified,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
success.hashCode ^ message.hashCode ^ wasModified.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ApplinksRegistrationResult &&
|
||||
runtimeType == other.runtimeType &&
|
||||
success == other.success &&
|
||||
message == other.message &&
|
||||
wasModified == other.wasModified;
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
import '../frb_generated.dart';
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
|
||||
// These functions are ignored because they are not marked as `pub`: `get_process_path`
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `fmt`, `fmt`
|
||||
|
||||
Future<void> sendNotify({
|
||||
@@ -20,21 +21,27 @@ Future<void> sendNotify({
|
||||
appId: appId,
|
||||
);
|
||||
|
||||
/// Get system memory size in GB
|
||||
Future<BigInt> getSystemMemorySizeGb() =>
|
||||
RustLib.instance.api.crateApiWin32ApiGetSystemMemorySizeGb();
|
||||
|
||||
/// Get number of logical processors
|
||||
Future<int> getNumberOfLogicalProcessors() =>
|
||||
RustLib.instance.api.crateApiWin32ApiGetNumberOfLogicalProcessors();
|
||||
|
||||
/// Get all system information at once
|
||||
Future<SystemInfo> getSystemInfo() =>
|
||||
RustLib.instance.api.crateApiWin32ApiGetSystemInfo();
|
||||
|
||||
/// Get GPU info from registry (more accurate VRAM)
|
||||
Future<String> getGpuInfoFromRegistry() =>
|
||||
RustLib.instance.api.crateApiWin32ApiGetGpuInfoFromRegistry();
|
||||
|
||||
/// Resolve shortcut (.lnk) file to get target path
|
||||
Future<String> resolveShortcut({required String lnkPath}) =>
|
||||
RustLib.instance.api.crateApiWin32ApiResolveShortcut(lnkPath: lnkPath);
|
||||
|
||||
/// Open file explorer and select file/folder
|
||||
Future<void> openDirWithExplorer({
|
||||
required String path,
|
||||
required bool isFile,
|
||||
@@ -58,16 +65,19 @@ Future<List<ProcessInfo>> getProcessListByName({required String processName}) =>
|
||||
processName: processName,
|
||||
);
|
||||
|
||||
/// Kill processes by name
|
||||
Future<int> killProcessByName({required String processName}) => RustLib
|
||||
.instance
|
||||
.api
|
||||
.crateApiWin32ApiKillProcessByName(processName: processName);
|
||||
|
||||
/// Get disk physical sector size for performance
|
||||
Future<int> getDiskPhysicalSectorSize({required String driveLetter}) => RustLib
|
||||
.instance
|
||||
.api
|
||||
.crateApiWin32ApiGetDiskPhysicalSectorSize(driveLetter: driveLetter);
|
||||
|
||||
/// Create a desktop shortcut
|
||||
Future<void> createDesktopShortcut({
|
||||
required String targetPath,
|
||||
required String shortcutName,
|
||||
@@ -76,12 +86,14 @@ Future<void> createDesktopShortcut({
|
||||
shortcutName: shortcutName,
|
||||
);
|
||||
|
||||
/// Run a program with admin privileges (UAC)
|
||||
Future<void> runAsAdmin({required String program, required String args}) =>
|
||||
RustLib.instance.api.crateApiWin32ApiRunAsAdmin(
|
||||
program: program,
|
||||
args: args,
|
||||
);
|
||||
|
||||
/// Start a program (without waiting)
|
||||
Future<void> startProcess({
|
||||
required String program,
|
||||
required List<String> args,
|
||||
@@ -90,12 +102,15 @@ Future<void> startProcess({
|
||||
args: args,
|
||||
);
|
||||
|
||||
/// Check if NVME patch is applied
|
||||
Future<bool> checkNvmePatchStatus() =>
|
||||
RustLib.instance.api.crateApiWin32ApiCheckNvmePatchStatus();
|
||||
|
||||
/// Add NVME patch to registry
|
||||
Future<void> addNvmePatch() =>
|
||||
RustLib.instance.api.crateApiWin32ApiAddNvmePatch();
|
||||
|
||||
/// Remove NVME patch from registry
|
||||
Future<void> removeNvmePatch() =>
|
||||
RustLib.instance.api.crateApiWin32ApiRemoveNvmePatch();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user