Bug 840409 part.8 Implement widget::IMEHandler::NotifyIMEOfTextChange() r=jimm

This commit is contained in:
Masayuki Nakano 2013-02-25 13:00:06 +09:00
parent 6d5766f8ba
commit 4559245be6
5 changed files with 25 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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)

View File

@ -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();