1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_BASE_IME_INPUT_METHOD_TSF_H_
6 #define UI_BASE_IME_INPUT_METHOD_TSF_H_
12 #include "base/memory/scoped_ptr.h"
13 #include "ui/base/ime/input_method_win.h"
19 // An InputMethod implementation based on Windows TSF API.
20 class UI_EXPORT InputMethodTSF : public InputMethodWin {
22 InputMethodTSF(internal::InputMethodDelegate* delegate,
23 HWND toplevel_window_handle);
24 virtual ~InputMethodTSF();
26 // Overridden from InputMethod:
27 virtual void OnFocus() OVERRIDE;
28 virtual void OnBlur() OVERRIDE;
29 virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
30 NativeEventResult* result) OVERRIDE;
31 virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE;
32 virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE;
33 virtual void CancelComposition(const TextInputClient* client) OVERRIDE;
34 virtual void DetachTextInputClient(TextInputClient* client) OVERRIDE;
35 virtual bool IsCandidatePopupOpen() const OVERRIDE;
37 // Overridden from InputMethodBase:
38 virtual void OnWillChangeFocusedClient(TextInputClient* focused_before,
39 TextInputClient* focused) OVERRIDE;
40 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
41 TextInputClient* focused) OVERRIDE;
44 class TSFEventObserver;
46 // Asks the client to confirm current composition text.
47 void ConfirmCompositionText();
49 // TSF event router and observer.
50 scoped_ptr<TSFEventObserver> tsf_event_observer_;
51 scoped_ptr<TSFEventRouter> tsf_event_router_;
53 DISALLOW_COPY_AND_ASSIGN(InputMethodTSF);
58 #endif // UI_BASE_IME_INPUT_METHOD_TSF_H_