mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Bug 840409 part.8 Implement widget::IMEHandler::NotifyIMEOfTextChange() r=jimm
This commit is contained in:
parent
6d5766f8ba
commit
4559245be6
@ -140,6 +140,21 @@ IMEHandler::NotifyIME(nsWindow* aWindow,
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult
|
||||
IMEHandler::NotifyIMEOfTextChange(uint32_t aStart,
|
||||
uint32_t aOldEnd,
|
||||
uint32_t aNewEnd)
|
||||
{
|
||||
#ifdef NS_ENABLE_TSF
|
||||
if (sIsInTSFMode) {
|
||||
return nsTextStore::OnTextChange(aStart, aOldEnd, aNewEnd);
|
||||
}
|
||||
#endif //NS_ENABLE_TSF
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// static
|
||||
bool
|
||||
|
@ -54,6 +54,13 @@ public:
|
||||
static nsresult NotifyIME(nsWindow* aWindow,
|
||||
NotificationToIME aNotification);
|
||||
|
||||
/**
|
||||
* Notifies IME of text change in the focused editable content.
|
||||
*/
|
||||
static nsresult NotifyIMEOfTextChange(uint32_t aStart,
|
||||
uint32_t aOldEnd,
|
||||
uint32_t aNewEnd);
|
||||
|
||||
/**
|
||||
* "Kakutei-Undo" of ATOK or WXG (both of them are Japanese IME) causes
|
||||
* strange WM_KEYDOWN/WM_KEYUP/WM_CHAR message pattern. So, when this
|
||||
|
@ -119,13 +119,13 @@ public:
|
||||
uint32_t aOldEnd,
|
||||
uint32_t aNewEnd)
|
||||
{
|
||||
if (!sTsfTextStore) return NS_OK;
|
||||
NS_ENSURE_TRUE(sTsfTextStore, NS_ERROR_NOT_AVAILABLE);
|
||||
return sTsfTextStore->OnTextChangeInternal(aStart, aOldEnd, aNewEnd);
|
||||
}
|
||||
|
||||
static void OnTextChangeMsg(void)
|
||||
{
|
||||
if (!sTsfTextStore) return;
|
||||
NS_ENSURE_TRUE_VOID(sTsfTextStore);
|
||||
// Notify TSF text change
|
||||
// (see comments on WM_USER_TSF_TEXTCHANGE in nsTextStore.h)
|
||||
sTsfTextStore->OnTextChangeMsgInternal();
|
||||
|
@ -7474,15 +7474,13 @@ nsWindow::OnIMEFocusChange(bool aFocus)
|
||||
NOTIFY_IME_OF_BLUR);
|
||||
}
|
||||
|
||||
#ifdef NS_ENABLE_TSF
|
||||
NS_IMETHODIMP
|
||||
nsWindow::OnIMETextChange(uint32_t aStart,
|
||||
uint32_t aOldEnd,
|
||||
uint32_t aNewEnd)
|
||||
{
|
||||
return nsTextStore::OnTextChange(aStart, aOldEnd, aNewEnd);
|
||||
return IMEHandler::NotifyIMEOfTextChange(aStart, aOldEnd, aNewEnd);
|
||||
}
|
||||
#endif // #ifdef NS_ENABLE_TSF
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::OnIMESelectionChange(void)
|
||||
|
@ -177,9 +177,7 @@ public:
|
||||
virtual void UpdateOpaqueRegion(const nsIntRegion& aOpaqueRegion);
|
||||
#endif // MOZ_XUL
|
||||
NS_IMETHOD OnIMEFocusChange(bool aFocus);
|
||||
#ifdef NS_ENABLE_TSF
|
||||
NS_IMETHOD OnIMETextChange(uint32_t aStart, uint32_t aOldEnd, uint32_t aNewEnd);
|
||||
#endif // NS_ENABLE_TSF
|
||||
NS_IMETHOD OnIMESelectionChange(void);
|
||||
#ifdef NS_ENABLE_TSF
|
||||
virtual nsIMEUpdatePreference GetIMEUpdatePreference();
|
||||
|
Loading…
Reference in New Issue
Block a user