OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WRAPPER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WRAPPER_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WRAPPER_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WRAPPER_H_ |
7 | 7 |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Updates the border display for the native text field with the state desired | 65 // Updates the border display for the native text field with the state desired |
66 // by the Textfield. | 66 // by the Textfield. |
67 virtual void UpdateBorder() = 0; | 67 virtual void UpdateBorder() = 0; |
68 | 68 |
69 // Updates the text color used when painting the native text field. | 69 // Updates the text color used when painting the native text field. |
70 virtual void UpdateTextColor() = 0; | 70 virtual void UpdateTextColor() = 0; |
71 | 71 |
72 // Updates the background color used when painting the native text field. | 72 // Updates the background color used when painting the native text field. |
73 virtual void UpdateBackgroundColor() = 0; | 73 virtual void UpdateBackgroundColor() = 0; |
74 | 74 |
75 // Updates the cursor color used when painting the native text field. | |
76 virtual void UpdateCursorColor() = 0; | |
77 | |
78 // Updates the read-only state of the native text field. | 75 // Updates the read-only state of the native text field. |
79 virtual void UpdateReadOnly() = 0; | 76 virtual void UpdateReadOnly() = 0; |
80 | 77 |
81 // Updates the font used to render text in the native text field. | 78 // Updates the font used to render text in the native text field. |
82 virtual void UpdateFont() = 0; | 79 virtual void UpdateFont() = 0; |
83 | 80 |
84 // Updates the visibility of the text in the native text field. | 81 // Updates the visibility of the text in the native text field. |
85 virtual void UpdateIsObscured() = 0; | 82 virtual void UpdateIsObscured() = 0; |
86 | 83 |
87 // Updates the enabled state of the native text field. | 84 // Updates the enabled state of the native text field. |
(...skipping 29 matching lines...) Expand all Loading... |
117 | 114 |
118 // Gets the selection model. | 115 // Gets the selection model. |
119 virtual void GetSelectionModel(gfx::SelectionModel* sel) const = 0; | 116 virtual void GetSelectionModel(gfx::SelectionModel* sel) const = 0; |
120 | 117 |
121 // Selects the text given by |sel|. | 118 // Selects the text given by |sel|. |
122 virtual void SelectSelectionModel(const gfx::SelectionModel& sel) = 0; | 119 virtual void SelectSelectionModel(const gfx::SelectionModel& sel) = 0; |
123 | 120 |
124 // Returns the currnet cursor position. | 121 // Returns the currnet cursor position. |
125 virtual size_t GetCursorPosition() const = 0; | 122 virtual size_t GetCursorPosition() const = 0; |
126 | 123 |
| 124 // Get or set whether or not the cursor is enabled. |
| 125 virtual bool GetCursorEnabled() const = 0; |
| 126 virtual void SetCursorEnabled(bool enabled) = 0; |
| 127 |
127 // Following methods are to forward key/focus related events to the | 128 // Following methods are to forward key/focus related events to the |
128 // views wrapper so that TextfieldViews can handle key inputs without | 129 // views wrapper so that TextfieldViews can handle key inputs without |
129 // having focus. | 130 // having focus. |
130 | 131 |
131 // Invoked when a key is pressed/release on Textfield. Subclasser | 132 // Invoked when a key is pressed/release on Textfield. Subclasser |
132 // should return true if the event has been processed and false | 133 // should return true if the event has been processed and false |
133 // otherwise. | 134 // otherwise. |
134 // See also View::OnKeyPressed/OnKeyReleased. | 135 // See also View::OnKeyPressed/OnKeyReleased. |
135 virtual bool HandleKeyPressed(const ui::KeyEvent& e) = 0; | 136 virtual bool HandleKeyPressed(const ui::KeyEvent& e) = 0; |
136 virtual bool HandleKeyReleased(const ui::KeyEvent& e) = 0; | 137 virtual bool HandleKeyReleased(const ui::KeyEvent& e) = 0; |
(...skipping 28 matching lines...) Expand all Loading... |
165 // ExecuteCommand to avoid name clash. | 166 // ExecuteCommand to avoid name clash. |
166 virtual void ExecuteTextCommand(int command_id) = 0; | 167 virtual void ExecuteTextCommand(int command_id) = 0; |
167 | 168 |
168 // Creates an appropriate NativeTextfieldWrapper for the platform. | 169 // Creates an appropriate NativeTextfieldWrapper for the platform. |
169 static NativeTextfieldWrapper* CreateWrapper(Textfield* field); | 170 static NativeTextfieldWrapper* CreateWrapper(Textfield* field); |
170 }; | 171 }; |
171 | 172 |
172 } // namespace views | 173 } // namespace views |
173 | 174 |
174 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WRAPPER_H_ | 175 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WRAPPER_H_ |
OLD | NEW |