1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_widget_HeadlessKeyBindings_h
7 #define mozilla_widget_HeadlessKeyBindings_h
9 #include "mozilla/TextEvents.h"
10 #include "nsIWidget.h"
14 enum class NativeKeyBindingsType
: uint8_t;
23 * Helper to emulate native key bindings. Currently only MacOS is supported.
26 class HeadlessKeyBindings final
{
28 HeadlessKeyBindings() = default;
30 static HeadlessKeyBindings
& GetInstance();
32 void GetEditCommands(NativeKeyBindingsType aType
,
33 const WidgetKeyboardEvent
& aEvent
,
34 const Maybe
<WritingMode
>& aWritingMode
,
35 nsTArray
<CommandInt
>& aCommands
);
36 [[nodiscard
]] nsresult
AttachNativeKeyEvent(WidgetKeyboardEvent
& aEvent
);
40 } // namespace mozilla
42 #endif // mozilla_widget_HeadlessKeyBindings_h