1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gtk/NativeKeyBindings.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_widget_NativeKeyBindings_h_ 1.10 +#define mozilla_widget_NativeKeyBindings_h_ 1.11 + 1.12 +#include <gtk/gtk.h> 1.13 +#include "mozilla/Attributes.h" 1.14 +#include "mozilla/EventForwards.h" 1.15 +#include "nsIWidget.h" 1.16 + 1.17 +namespace mozilla { 1.18 +namespace widget { 1.19 + 1.20 +class NativeKeyBindings MOZ_FINAL 1.21 +{ 1.22 + typedef nsIWidget::NativeKeyBindingsType NativeKeyBindingsType; 1.23 + typedef nsIWidget::DoCommandCallback DoCommandCallback; 1.24 + 1.25 +public: 1.26 + static NativeKeyBindings* GetInstance(NativeKeyBindingsType aType); 1.27 + static void Shutdown(); 1.28 + 1.29 + void Init(NativeKeyBindingsType aType); 1.30 + 1.31 + bool Execute(const WidgetKeyboardEvent& aEvent, 1.32 + DoCommandCallback aCallback, 1.33 + void* aCallbackData); 1.34 + 1.35 +private: 1.36 + ~NativeKeyBindings(); 1.37 + 1.38 + bool ExecuteInternal(const WidgetKeyboardEvent& aEvent, 1.39 + DoCommandCallback aCallback, 1.40 + void* aCallbackData, 1.41 + guint aKeyval); 1.42 + 1.43 + GtkWidget* mNativeTarget; 1.44 + 1.45 + static NativeKeyBindings* sInstanceForSingleLineEditor; 1.46 + static NativeKeyBindings* sInstanceForMultiLineEditor; 1.47 +}; 1.48 + 1.49 +} // namespace widget 1.50 +} // namespace mozilla 1.51 + 1.52 +#endif // mozilla_widget_NativeKeyBindings_h_