/* * Copyright (c) 2021, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include namespace KeyboardSettings { class KeyboardSettingsWidget final : public GUI::SettingsWindow::Tab { C_OBJECT_ABSTRACT(KeyboardSettingsWidget) public: virtual ~KeyboardSettingsWidget() override; virtual void apply_settings() override; void window_activated(bool is_active_window); static ErrorOr> create(); private: static ErrorOr> try_create(); KeyboardSettingsWidget() = default; ErrorOr setup(); void set_keymaps(Vector const& keymaps, ByteString const& active_keymap); void write_caps_lock_to_ctrl_sys_variable(bool); ErrorOr read_caps_lock_to_ctrl_sys_variable(); Vector m_initial_keymap_list; ByteString m_initial_active_keymap; RefPtr m_selected_keymaps_listview; RefPtr m_active_keymap_label; RefPtr m_num_lock_checkbox; RefPtr m_caps_lock_checkbox; RefPtr m_activate_keymap_button; RefPtr m_add_keymap_button; RefPtr m_remove_keymap_button; RefPtr m_test_typing_area; RefPtr m_clear_test_typing_area_button; Function m_activate_keymap_event; }; }