OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
| 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/string16.h" |
| 10 |
| 11 namespace views { |
| 12 |
| 13 class KeyEvent; |
| 14 class Textfield; |
| 15 |
| 16 // This defines the callback interface for other code to be notified of changes |
| 17 // in the state of a text field. |
| 18 class TextfieldController { |
| 19 public: |
| 20 // This method is called whenever the text in the field changes. |
| 21 virtual void ContentsChanged(Textfield* sender, |
| 22 const string16& new_contents) = 0; |
| 23 |
| 24 // This method is called to get notified about keystrokes in the edit. |
| 25 // Returns true if the message was handled and should not be processed |
| 26 // further. If it returns false the processing continues. |
| 27 virtual bool HandleKeyEvent(Textfield* sender, |
| 28 const KeyEvent& key_event) = 0; |
| 29 }; |
| 30 |
| 31 } // namespace views |
| 32 |
| 33 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
OLD | NEW |