| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VIEWS_IME_TEXT_INPUT_CLIENT_H_ | 5 #ifndef UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
| 6 #define VIEWS_IME_TEXT_INPUT_CLIENT_H_ | 6 #define UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/i18n/rtl.h" |
| 12 #include "base/string16.h" | 11 #include "base/string16.h" |
| 13 #include "ui/base/ime/composition_text.h" | 12 #include "ui/base/ime/composition_text.h" |
| 14 #include "ui/base/ime/text_input_type.h" | 13 #include "ui/base/ime/text_input_type.h" |
| 15 #include "ui/base/range/range.h" | 14 #include "ui/base/range/range.h" |
| 16 #include "views/views_export.h" | 15 #include "ui/base/ui_export.h" |
| 17 | 16 |
| 18 namespace gfx { | 17 namespace gfx { |
| 19 class Rect; | 18 class Rect; |
| 20 } | 19 } |
| 21 | 20 |
| 22 namespace views { | 21 namespace ui { |
| 23 | |
| 24 class View; | |
| 25 | 22 |
| 26 // An interface implemented by a View that needs text input support. | 23 // An interface implemented by a View that needs text input support. |
| 27 class VIEWS_EXPORT TextInputClient { | 24 class UI_EXPORT TextInputClient { |
| 28 public: | 25 public: |
| 29 virtual ~TextInputClient() {} | 26 virtual ~TextInputClient() {} |
| 30 | 27 |
| 31 // Input method result ------------------------------------------------------- | 28 // Input method result ------------------------------------------------------- |
| 32 | 29 |
| 33 // Sets composition text and attributes. If there is composition text already, | 30 // Sets composition text and attributes. If there is composition text already, |
| 34 // it’ll be replaced by the new one. Otherwise, current selection will be | 31 // it’ll be replaced by the new one. Otherwise, current selection will be |
| 35 // replaced. If there is no selection, the composition text will be inserted | 32 // replaced. If there is no selection, the composition text will be inserted |
| 36 // at the insertion point. | 33 // at the insertion point. |
| 37 virtual void SetCompositionText(const ui::CompositionText& composition) = 0; | 34 virtual void SetCompositionText(const ui::CompositionText& composition) = 0; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // Called whenever current keyboard layout or input method is changed, | 105 // Called whenever current keyboard layout or input method is changed, |
| 109 // especially the change of input locale and text direction. | 106 // especially the change of input locale and text direction. |
| 110 virtual void OnInputMethodChanged() = 0; | 107 virtual void OnInputMethodChanged() = 0; |
| 111 | 108 |
| 112 // Called whenever the user requests to change the text direction and layout | 109 // Called whenever the user requests to change the text direction and layout |
| 113 // alignment of the current text box. It’s for supporting ctrl-shift on | 110 // alignment of the current text box. It’s for supporting ctrl-shift on |
| 114 // Windows. | 111 // Windows. |
| 115 // Returns false if the operation is not supported. | 112 // Returns false if the operation is not supported. |
| 116 virtual bool ChangeTextDirectionAndLayoutAlignment( | 113 virtual bool ChangeTextDirectionAndLayoutAlignment( |
| 117 base::i18n::TextDirection direction) = 0; | 114 base::i18n::TextDirection direction) = 0; |
| 118 | |
| 119 // Gets the View object who owns this TextInputClient instance. | |
| 120 virtual View* GetOwnerViewOfTextInputClient() = 0; | |
| 121 }; | 115 }; |
| 122 | 116 |
| 123 } // namespace views | 117 } // namespace ui |
| 124 | 118 |
| 125 #endif // VIEWS_IME_TEXT_INPUT_CLIENT_H_ | 119 #endif // UI_BASE_IME_TEXT_INPUT_CLIENT_H_ |
| OLD | NEW |