| 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 |
| 11 #if defined(OS_LINUX) | 11 #if defined(OS_LINUX) |
| 12 #include <gdk/gdk.h> | 12 #include <gdk/gdk.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/string16.h" | 19 #include "base/string16.h" |
| 20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
| 21 #include "ui/base/ime/text_input_type.h" |
| 21 #include "ui/base/keycodes/keyboard_codes.h" | 22 #include "ui/base/keycodes/keyboard_codes.h" |
| 22 #include "ui/gfx/font.h" | 23 #include "ui/gfx/font.h" |
| 23 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
| 24 #include "views/controls/textfield/native_textfield_wrapper.h" | 25 #include "views/controls/textfield/native_textfield_wrapper.h" |
| 25 #include "views/view.h" | 26 #include "views/view.h" |
| 26 | 27 |
| 27 #if !defined(OS_LINUX) | 28 #if !defined(OS_LINUX) |
| 28 #include "base/logging.h" | 29 #include "base/logging.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 TextfieldController* GetController() const; | 63 TextfieldController* GetController() const; |
| 63 | 64 |
| 64 // Gets/Sets whether or not the Textfield is read-only. | 65 // Gets/Sets whether or not the Textfield is read-only. |
| 65 bool read_only() const { return read_only_; } | 66 bool read_only() const { return read_only_; } |
| 66 void SetReadOnly(bool read_only); | 67 void SetReadOnly(bool read_only); |
| 67 | 68 |
| 68 // Gets/Sets whether or not this Textfield is a password field. | 69 // Gets/Sets whether or not this Textfield is a password field. |
| 69 bool IsPassword() const; | 70 bool IsPassword() const; |
| 70 void SetPassword(bool password); | 71 void SetPassword(bool password); |
| 71 | 72 |
| 73 // Gets/Sets the input type of this textfield. |
| 74 ui::TextInputType GetTextInputType() const; |
| 75 void SetTextInputType(ui::TextInputType type); |
| 76 |
| 72 // Gets/Sets the text currently displayed in the Textfield. | 77 // Gets/Sets the text currently displayed in the Textfield. |
| 73 const string16& text() const { return text_; } | 78 const string16& text() const { return text_; } |
| 74 | 79 |
| 75 // Sets the text currently displayed in the Textfield. This doesn't | 80 // Sets the text currently displayed in the Textfield. This doesn't |
| 76 // change the cursor position if the current cursor is within the | 81 // change the cursor position if the current cursor is within the |
| 77 // new text's range, or moves the cursor to the end if the cursor is | 82 // new text's range, or moves the cursor to the end if the cursor is |
| 78 // out of the new text's range. | 83 // out of the new text's range. |
| 79 void SetText(const string16& text); | 84 void SetText(const string16& text); |
| 80 | 85 |
| 81 // Appends the given string to the previously-existing text in the field. | 86 // Appends the given string to the previously-existing text in the field. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // Holds whether margins were set. | 289 // Holds whether margins were set. |
| 285 bool horizontal_margins_were_set_; | 290 bool horizontal_margins_were_set_; |
| 286 bool vertical_margins_were_set_; | 291 bool vertical_margins_were_set_; |
| 287 | 292 |
| 288 // Text to display when empty. | 293 // Text to display when empty. |
| 289 string16 text_to_display_when_empty_; | 294 string16 text_to_display_when_empty_; |
| 290 | 295 |
| 291 // The accessible name of the text field. | 296 // The accessible name of the text field. |
| 292 string16 accessible_name_; | 297 string16 accessible_name_; |
| 293 | 298 |
| 299 // The input type of this text field. |
| 300 ui::TextInputType text_input_type_; |
| 301 |
| 294 DISALLOW_COPY_AND_ASSIGN(Textfield); | 302 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 295 }; | 303 }; |
| 296 | 304 |
| 297 } // namespace views | 305 } // namespace views |
| 298 | 306 |
| 299 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 307 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |