| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // These classes define a text field widget that can be used in the views UI | 5 // These classes define a text field widget that can be used in the views UI |
| 6 // toolkit. | 6 // toolkit. |
| 7 | 7 |
| 8 #ifndef CHROME_VIEWS_CONTROLS_TEXT_FIELD_H_ | 8 #ifndef CHROME_VIEWS_CONTROLS_TEXT_FIELD_H_ |
| 9 #define CHROME_VIEWS_CONTROLS_TEXT_FIELD_H_ | 9 #define CHROME_VIEWS_CONTROLS_TEXT_FIELD_H_ |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 // This defines the callback interface for other code to be notified of | 25 // This defines the callback interface for other code to be notified of |
| 26 // changes in the state of a text field. | 26 // changes in the state of a text field. |
| 27 class Controller { | 27 class Controller { |
| 28 public: | 28 public: |
| 29 // This method is called whenever the text in the field changes. | 29 // This method is called whenever the text in the field changes. |
| 30 virtual void ContentsChanged(TextField* sender, | 30 virtual void ContentsChanged(TextField* sender, |
| 31 const std::wstring& new_contents) = 0; | 31 const std::wstring& new_contents) = 0; |
| 32 | 32 |
| 33 // This method is called to get notified about keystrokes in the edit. | 33 // This method is called to get notified about keystrokes in the edit. |
| 34 virtual void HandleKeystroke(TextField* sender, | 34 // This method returns true if the message was handled and should not be |
| 35 // processed further. If it returns false the processing continues. |
| 36 virtual bool HandleKeystroke(TextField* sender, |
| 35 UINT message, TCHAR key, UINT repeat_count, | 37 UINT message, TCHAR key, UINT repeat_count, |
| 36 UINT flags) = 0; | 38 UINT flags) = 0; |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 enum StyleFlags { | 41 enum StyleFlags { |
| 40 STYLE_DEFAULT = 0, | 42 STYLE_DEFAULT = 0, |
| 41 STYLE_PASSWORD = 1<<0, | 43 STYLE_PASSWORD = 1<<0, |
| 42 STYLE_MULTILINE = 1<<1, | 44 STYLE_MULTILINE = 1<<1, |
| 43 STYLE_LOWERCASE = 1<<2 | 45 STYLE_LOWERCASE = 1<<2 |
| 44 }; | 46 }; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 protected: | 197 protected: |
| 196 // Calculates the insets for the text field. | 198 // Calculates the insets for the text field. |
| 197 void CalculateInsets(gfx::Insets* insets); | 199 void CalculateInsets(gfx::Insets* insets); |
| 198 | 200 |
| 199 DISALLOW_COPY_AND_ASSIGN(TextField); | 201 DISALLOW_COPY_AND_ASSIGN(TextField); |
| 200 }; | 202 }; |
| 201 | 203 |
| 202 } // namespace views | 204 } // namespace views |
| 203 | 205 |
| 204 #endif // CHROME_VIEWS_CONTROLS_TEXT_FIELD_H_ | 206 #endif // CHROME_VIEWS_CONTROLS_TEXT_FIELD_H_ |
| OLD | NEW |