/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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/. */
/** * IMEHandler class is a mediator class. On Windows, there are two IME API * sets: One is IMM which is legacy API set. The other is TSF which is modern * API set. By using this class, non-IME handler classes don't need to worry * that we're in which mode.
*/ class IMEHandler final { private: /** * Initialize() initializes both TSF modules and IMM modules. Some TIPs * may require a normal window (i.e., not message window) belonging to * this process. Therefore, this is called immediately after first normal * window is created.
*/ staticvoid Initialize();
public: staticvoid Terminate();
/** * Returns TSF related native data or native IME context.
*/ staticvoid* GetNativeData(nsWindow* aWindow, uint32_t aDataType);
/** * ProcessRawKeyMessage() message is called before calling TranslateMessage() * and DispatchMessage(). If this returns true, the message is consumed. * Then, caller must not perform TranslateMessage() nor DispatchMessage().
*/ staticbool ProcessRawKeyMessage(const MSG& aMsg);
/** * When the message is not needed to handle anymore by the caller, this * returns true. Otherwise, false.
*/ staticbool ProcessMessage(nsWindow* aWindow, UINT aMessage, WPARAM& aWParam,
LPARAM& aLParam, MSGResult& aResult);
/** * IsA11yHandlingNativeCaret() returns true if a11y is handling * native caret. In such case, IME modules shouldn't touch native caret.
**/ staticbool IsA11yHandlingNativeCaret();
/** * NeedsToCreateNativeCaret() returns true if IME handler needs to create * native caret for other applications which requests OBJID_CARET with * WM_GETOBJECT and a11y module isn't active (if a11y module is active, * it always creates native caret, i.e., even if no editor has focus).
*/ staticbool NeedsToCreateNativeCaret() { return sHasNativeCaretBeenRequested && !IsA11yHandlingNativeCaret();
}
/** * CreateNativeCaret() create native caret if this has been created it. * * @param aWindow The window which owns the caret. * @param aCaretRect The caret rect relative to aWindow.
*/ staticbool CreateNativeCaret(nsWindow* aWindow, const LayoutDeviceIntRect& aCaretRect);
/** * MaybeDestroyNativeCaret() destroies native caret if it has been created * by IMEHandler.
*/ staticvoid MaybeDestroyNativeCaret();
/** * HasNativeCaret() returns true if there is native caret and it was created * by IMEHandler.
*/ staticbool HasNativeCaret() { return sNativeCaretIsCreated; }
/** * When there is a composition, returns true. Otherwise, false.
*/ staticbool IsComposing();
/** * When there is a composition and it's in the window, returns true. * Otherwise, false.
*/ staticbool IsComposingOn(nsWindow* aWindow);
/** * Notifies IME of the notification (a request or an event).
*/ static nsresult NotifyIME(nsWindow* aWindow, const IMENotification& aIMENotification);
/** * Returns notification requests of IME.
*/ static IMENotificationRequests GetIMENotificationRequests();
/** * Returns IME open state on the window.
*/ staticbool GetOpenState(nsWindow* aWindow);
/** * Called when the window is destroying.
*/ staticvoid OnDestroyWindow(nsWindow* aWindow);
/** * Called when nsIWidget::SetInputContext() is called before the window's * InputContext is modified actually.
*/ staticvoid SetInputContext(nsWindow* aWindow, InputContext& aInputContext, const InputContextAction& aAction);
/** * Associate or disassociate IME context to/from the aWindowBase.
*/ staticvoid AssociateIMEContext(nsWindow* aWindowBase, bool aEnable);
/** * Called when the window is created.
*/ staticvoid InitInputContext(nsWindow* aWindow, InputContext& aInputContext);
/** * This is called by TSFStaticSink when active IME is changed.
*/ staticvoid OnKeyboardLayoutChanged();
#ifdef DEBUG /** * Returns true when current keyboard layout has IME. Otherwise, false.
*/ staticbool CurrentKeyboardLayoutHasIME(); #endif// #ifdef DEBUG
/** * Append InputScope values from type attreibute string of input element
*/ staticvoid AppendInputScopeFromType(const nsAString& aInputType,
nsTArray<InputScope>& aScopes);
/** * Return focused window if this receives focus notification and has not * received blur notification yet.
*/ static nsWindow* GetFocusedWindow() { return sFocusedWindow; }
/** * MaybeCreateNativeCaret() may create native caret over our caret if * focused content is text editable and we need to create native caret * for other applications. * * @param aWindow The window which owns the native caret.
*/ staticbool MaybeCreateNativeCaret(nsWindow* aWindow);
static decltype(SetInputScopes)* sSetInputScopes; staticvoid SetInputScopeForIMM32(nsWindow* aWindow, const nsAString& aHTMLInputType, const nsAString& aHTMLInputMode, bool aInPrivateBrowsing); staticbool sIsInTSFMode; // If sIMMEnabled is false, any IME messages are not handled in TSF mode. // Additionally, IME context is always disassociated from focused window. staticbool sIsIMMEnabled;
/** * Show the Windows on-screen keyboard. Only allowed for * chrome documents and Windows 8 and higher.
*/ staticvoid ShowOnScreenKeyboard(nsWindow* aWindow);
/** * Dismiss the Windows on-screen keyboard. Only allowed for * Windows 8 and higher.
*/ staticvoid DismissOnScreenKeyboard(nsWindow* aWindow);
};
} // namespace widget
} // namespace mozilla
#endif// #ifndef WinIMEHandler_h_
¤ Dauer der Verarbeitung: 0.34 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.