ladybird/Libraries/LibWebView/WebUI/SettingsUI.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

40 lines
1 KiB
C++

/*
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWebView/WebUI.h>
namespace WebView {
class SettingsUI : public WebUI {
WEB_UI(SettingsUI);
private:
virtual void register_interfaces() override;
void load_current_settings();
void restore_default_settings();
void set_new_tab_page_url(JsonValue const&);
void set_languages(JsonValue const&);
void load_available_engines();
void set_search_engine(JsonValue const&);
void add_custom_search_engine(JsonValue const&);
void remove_custom_search_engine(JsonValue const&);
void set_autocomplete_engine(JsonValue const&);
void load_forcibly_enabled_site_settings();
void set_site_setting_enabled_globally(JsonValue const&);
void add_site_setting_filter(JsonValue const&);
void remove_site_setting_filter(JsonValue const&);
void remove_all_site_setting_filters(JsonValue const&);
void set_do_not_track(JsonValue const&);
};
}