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_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // Returns the text that is currently selected. | 83 // Returns the text that is currently selected. |
84 string16 GetSelectedText() const; | 84 string16 GetSelectedText() const; |
85 | 85 |
86 // Causes the edit field to be fully selected. | 86 // Causes the edit field to be fully selected. |
87 void SelectAll(); | 87 void SelectAll(); |
88 | 88 |
89 // Clears the selection within the edit field and sets the caret to the end. | 89 // Clears the selection within the edit field and sets the caret to the end. |
90 void ClearSelection() const; | 90 void ClearSelection() const; |
91 | 91 |
| 92 // Checks if there is any selected text. |
| 93 bool HasSelection() const; |
| 94 |
92 // Accessor for |style_|. | 95 // Accessor for |style_|. |
93 StyleFlags style() const { return style_; } | 96 StyleFlags style() const { return style_; } |
94 | 97 |
95 // Gets/Sets the text color to be used when painting the Textfield. | 98 // Gets/Sets the text color to be used when painting the Textfield. |
96 // Call |UseDefaultTextColor| to return to the system default colors. | 99 // Call |UseDefaultTextColor| to return to the system default colors. |
97 SkColor text_color() const { return text_color_; } | 100 SkColor text_color() const { return text_color_; } |
98 void SetTextColor(SkColor color); | 101 void SetTextColor(SkColor color); |
99 | 102 |
100 // Gets/Sets whether the default text color should be used when painting the | 103 // Gets/Sets whether the default text color should be used when painting the |
101 // Textfield. | 104 // Textfield. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 284 |
282 // The accessible name of the text field. | 285 // The accessible name of the text field. |
283 string16 accessible_name_; | 286 string16 accessible_name_; |
284 | 287 |
285 DISALLOW_COPY_AND_ASSIGN(Textfield); | 288 DISALLOW_COPY_AND_ASSIGN(Textfield); |
286 }; | 289 }; |
287 | 290 |
288 } // namespace views | 291 } // namespace views |
289 | 292 |
290 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 293 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |