summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/KeymapSwitcher.h
blob: 04dfb09b616cfdea58622a1a11d8ffc5cecbb826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright (c) 2021, Timur Sultanov <SultanovTS@yandex.ru>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/String.h>
#include <AK/Vector.h>
#include <AK/WeakPtr.h>
#include <LibCore/Object.h>
#include <LibKeyboard/CharacterMap.h>
#include <WindowServer/WMClientConnection.h>

namespace WindowServer {

class KeymapSwitcher final : public Core::Object {
    C_OBJECT(KeymapSwitcher)
public:
    virtual ~KeymapSwitcher() override;

    void refresh();

    void next_keymap();

    Function<void(String const& keymap)> on_keymap_change;

    String get_current_keymap() const;

private:
    KeymapSwitcher();

    Vector<AK::String> m_keymaps;

    void setkeymap(AK::String const&);
};

}