2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsNativeKeyBindings_h_
|
|
|
|
#define nsNativeKeyBindings_h_
|
|
|
|
|
|
|
|
// X.h defines KeyPress
|
|
|
|
#ifdef KeyPress
|
|
|
|
#undef KeyPress
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "nsINativeKeyBindings.h"
|
2012-07-26 12:17:33 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-09-25 04:21:19 -07:00
|
|
|
#include "mozilla/EventForwards.h"
|
2009-01-02 23:37:52 -08:00
|
|
|
#include <gtk/gtk.h>
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
enum NativeKeyBindingsType {
|
|
|
|
eKeyBindings_Input,
|
|
|
|
eKeyBindings_TextArea
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_NATIVEKEYBINDINGSINPUT_CID \
|
|
|
|
{0x5c337258, 0xa580, 0x472e, {0x86, 0x15, 0xf2, 0x77, 0xdd, 0xc5, 0xbb, 0x06}}
|
|
|
|
|
|
|
|
#define NS_NATIVEKEYBINDINGSTEXTAREA_CID \
|
|
|
|
{0x2a898043, 0x180f, 0x4c8b, {0x8e, 0x54, 0x41, 0x0c, 0x7a, 0x54, 0x0f, 0x27}}
|
|
|
|
|
|
|
|
#define NS_NATIVEKEYBINDINGSEDITOR_CID \
|
|
|
|
{0xf916ebfb, 0x78ef, 0x464b, {0x94, 0xd0, 0xa6, 0xf2, 0xca, 0x32, 0x00, 0xae}}
|
|
|
|
|
2012-07-26 12:17:33 -07:00
|
|
|
class nsNativeKeyBindings MOZ_FINAL : public nsINativeKeyBindings
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_HIDDEN_(void) Init(NativeKeyBindingsType aType);
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
// nsINativeKeyBindings
|
2013-10-01 00:22:58 -07:00
|
|
|
virtual NS_HIDDEN_(bool) KeyDown(const mozilla::WidgetKeyboardEvent& aEvent,
|
2007-03-22 10:30:00 -07:00
|
|
|
DoCommandCallback aCallback,
|
|
|
|
void *aCallbackData);
|
|
|
|
|
2013-10-01 00:22:58 -07:00
|
|
|
virtual NS_HIDDEN_(bool) KeyPress(const mozilla::WidgetKeyboardEvent& aEvent,
|
2013-08-24 00:24:32 -07:00
|
|
|
DoCommandCallback aCallback,
|
|
|
|
void *aCallbackData);
|
|
|
|
|
2013-10-01 00:22:58 -07:00
|
|
|
virtual NS_HIDDEN_(bool) KeyUp(const mozilla::WidgetKeyboardEvent& aEvent,
|
2013-08-24 00:24:32 -07:00
|
|
|
DoCommandCallback aCallback,
|
|
|
|
void *aCallbackData);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
~nsNativeKeyBindings() NS_HIDDEN;
|
|
|
|
|
2013-10-01 00:22:58 -07:00
|
|
|
bool KeyPressInternal(const mozilla::WidgetKeyboardEvent& aEvent,
|
2013-08-24 00:24:32 -07:00
|
|
|
DoCommandCallback aCallback,
|
|
|
|
void *aCallbackData,
|
|
|
|
guint aKeyval);
|
2008-04-14 21:16:24 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
GtkWidget *mNativeTarget;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|