1 // Copyright 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_DUMMY_TEXT_INPUT_CLIENT_H_
6 #define UI_BASE_IME_DUMMY_TEXT_INPUT_CLIENT_H_
8 #include "ui/base/ime/text_input_client.h"
12 // Dummy implementation of TextInputClient. All functions do nothing.
13 class DummyTextInputClient
: public TextInputClient
{
15 DummyTextInputClient();
16 explicit DummyTextInputClient(TextInputType text_input_type
);
17 ~DummyTextInputClient() override
;
19 // Overriden from TextInputClient.
20 void SetCompositionText(const CompositionText
& composition
) override
;
21 void ConfirmCompositionText() override
;
22 void ClearCompositionText() override
;
23 void InsertText(const base::string16
& text
) override
;
24 void InsertChar(base::char16 ch
, int flags
) override
;
25 TextInputType
GetTextInputType() const override
;
26 TextInputMode
GetTextInputMode() const override
;
27 int GetTextInputFlags() const override
;
28 bool CanComposeInline() const override
;
29 gfx::Rect
GetCaretBounds() const override
;
30 bool GetCompositionCharacterBounds(uint32 index
,
31 gfx::Rect
* rect
) const override
;
32 bool HasCompositionText() const override
;
33 bool GetTextRange(gfx::Range
* range
) const override
;
34 bool GetCompositionTextRange(gfx::Range
* range
) const override
;
35 bool GetSelectionRange(gfx::Range
* range
) const override
;
36 bool SetSelectionRange(const gfx::Range
& range
) override
;
37 bool DeleteRange(const gfx::Range
& range
) override
;
38 bool GetTextFromRange(const gfx::Range
& range
,
39 base::string16
* text
) const override
;
40 void OnInputMethodChanged() override
;
41 bool ChangeTextDirectionAndLayoutAlignment(
42 base::i18n::TextDirection direction
) override
;
43 void ExtendSelectionAndDelete(size_t before
, size_t after
) override
;
44 void EnsureCaretInRect(const gfx::Rect
& rect
) override
;
45 bool IsEditCommandEnabled(int command_id
) override
;
46 void SetEditCommandForNextKeyEvent(int command_id
) override
;
48 TextInputType text_input_type_
;
50 DISALLOW_COPY_AND_ASSIGN(DummyTextInputClient
);
55 #endif // UI_BASE_IME_DUMMY_TEXT_INPUT_CLIENT_H_