ladybird/Libraries/LibWebView/SearchEngine.h
Timothy Flynn 2810071a9c LibWebView: Support custom search engines
This allows the user to store custom search engines via about:settings.
Custom engines will be displayed below the builtin engines in the drop-
down to select the default engine.

A couple of edge cases here:

1. We currently reject a custom engine if one with the same name already
   exists. In the future, we should allow editing custom engines.

2. If a custom engine which was the default engine is removed, we will
   disable search rather than falling back to any other engine.
2025-04-06 13:45:10 +02:00

25 lines
483 B
C++

/*
* Copyright (c) 2023-2025, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Span.h>
#include <AK/String.h>
#include <AK/StringView.h>
namespace WebView {
struct SearchEngine {
String format_search_query_for_display(StringView query) const;
String format_search_query_for_navigation(StringView query) const;
String name;
String query_url;
};
ReadonlySpan<SearchEngine> builtin_search_engines();
}