1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:17:45 +00:00

Launcher: Provide launcher details to LibDesktop

This allows applications to get additional information,
such as name or icons, for each launch handler.
This commit is contained in:
Tom 2020-07-13 18:55:09 -06:00 committed by Andreas Kling
parent 7498024805
commit 535113bac4
7 changed files with 208 additions and 26 deletions

View file

@ -27,13 +27,35 @@
#pragma once
#include <AK/Forward.h>
#include <AK/HashMap.h>
#include <AK/NonnullRefPtrVector.h>
#include <AK/RefCounted.h>
#include <AK/String.h>
namespace Desktop {
class Launcher {
public:
enum class LauncherType {
Default = 0,
UserPreferred,
UserDefault
};
struct Details: public RefCounted<Details> {
String name;
String executable;
HashMap<String, String> icons;
LauncherType launcher_type { LauncherType::Default };
static NonnullRefPtr<Details> from_details_str(const String&);
};
static bool open(const URL&, const String& handler_name = {});
static bool open(const URL&, const Details& details);
static Vector<String> get_handlers_for_url(const URL&);
static NonnullRefPtrVector<Details> get_handlers_with_details_for_url(const URL&);
};
}