Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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_NativeKeyBindings_h_
7 #define mozilla_widget_NativeKeyBindings_h_
9 #include <gtk/gtk.h>
10 #include "mozilla/Attributes.h"
11 #include "mozilla/EventForwards.h"
12 #include "nsIWidget.h"
14 namespace mozilla {
15 namespace widget {
17 class NativeKeyBindings MOZ_FINAL
18 {
19 typedef nsIWidget::NativeKeyBindingsType NativeKeyBindingsType;
20 typedef nsIWidget::DoCommandCallback DoCommandCallback;
22 public:
23 static NativeKeyBindings* GetInstance(NativeKeyBindingsType aType);
24 static void Shutdown();
26 void Init(NativeKeyBindingsType aType);
28 bool Execute(const WidgetKeyboardEvent& aEvent,
29 DoCommandCallback aCallback,
30 void* aCallbackData);
32 private:
33 ~NativeKeyBindings();
35 bool ExecuteInternal(const WidgetKeyboardEvent& aEvent,
36 DoCommandCallback aCallback,
37 void* aCallbackData,
38 guint aKeyval);
40 GtkWidget* mNativeTarget;
42 static NativeKeyBindings* sInstanceForSingleLineEditor;
43 static NativeKeyBindings* sInstanceForMultiLineEditor;
44 };
46 } // namespace widget
47 } // namespace mozilla
49 #endif // mozilla_widget_NativeKeyBindings_h_