1 /* -*- Mode: C++; tab-width: 4; 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 WinTextEventDispatcherListener_h_
7 #define WinTextEventDispatcherListener_h_
9 #include "mozilla/Attributes.h"
10 #include "mozilla/StaticPtr.h"
11 #include "mozilla/TextEventDispatcherListener.h"
17 * On Windows, it's enough TextEventDispatcherListener to be a singleton
18 * because we have only one input context per process (IMM can create
19 * multiple IM context but we don't support such behavior).
22 class WinTextEventDispatcherListener final
23 : public TextEventDispatcherListener
{
25 static WinTextEventDispatcherListener
* GetInstance();
26 static void Shutdown();
30 NS_IMETHOD
NotifyIME(TextEventDispatcher
* aTextEventDispatcher
,
31 const IMENotification
& aNotification
) override
;
32 NS_IMETHOD_(IMENotificationRequests
) GetIMENotificationRequests() override
;
34 OnRemovedFrom(TextEventDispatcher
* aTextEventDispatcher
) override
;
36 WillDispatchKeyboardEvent(TextEventDispatcher
* aTextEventDispatcher
,
37 WidgetKeyboardEvent
& aKeyboardEvent
,
38 uint32_t aIndexOfKeypress
, void* aData
) override
;
41 WinTextEventDispatcherListener();
42 virtual ~WinTextEventDispatcherListener();
44 static StaticRefPtr
<WinTextEventDispatcherListener
> sInstance
;
48 } // namespace mozilla
50 #endif // #ifndef WinTextEventDispatcherListener_h_