/* * Copyright (c) 2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Desktop { class Launcher { public: enum class LauncherType { Default = 0, Application, UserPreferred, UserDefault }; struct Details : public RefCounted
{ String name; String executable; LauncherType launcher_type { LauncherType::Default }; static NonnullRefPtr
from_details_str(const String&); }; [[nodiscard]] static bool add_allowed_url(const URL&); [[nodiscard]] static bool add_allowed_handler_with_any_url(const String& handler); [[nodiscard]] static bool add_allowed_handler_with_only_specific_urls(const String& handler, const Vector&); [[nodiscard]] static bool seal_allowlist(); static bool open(const URL&, const String& handler_name = {}); static bool open(const URL&, const Details& details); static Vector get_handlers_for_url(const URL&); static NonnullRefPtrVector
get_handlers_with_details_for_url(const URL&); }; }