/* * 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(String const&); }; static void ensure_connection(); static ErrorOr add_allowed_url(URL const&); static ErrorOr add_allowed_handler_with_any_url(String const& handler); static ErrorOr add_allowed_handler_with_only_specific_urls(String const& handler, Vector const&); static ErrorOr seal_allowlist(); static bool open(const URL&, String const& handler_name = {}); static bool open(const URL&, Details const& details); static Vector get_handlers_for_url(const URL&); static NonnullRefPtrVector
get_handlers_with_details_for_url(const URL&); }; }