OLD | NEW |
---|---|
1 // Copyright (c) 2009 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 #ifndef VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ |
6 #define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... | |
34 virtual string16 GetSelectedText() const; | 34 virtual string16 GetSelectedText() const; |
35 virtual void SelectAll(); | 35 virtual void SelectAll(); |
36 virtual void ClearSelection(); | 36 virtual void ClearSelection(); |
37 virtual void UpdateBorder(); | 37 virtual void UpdateBorder(); |
38 virtual void UpdateTextColor(); | 38 virtual void UpdateTextColor(); |
39 virtual void UpdateBackgroundColor(); | 39 virtual void UpdateBackgroundColor(); |
40 virtual void UpdateReadOnly(); | 40 virtual void UpdateReadOnly(); |
41 virtual void UpdateFont(); | 41 virtual void UpdateFont(); |
42 virtual void UpdateIsPassword(); | 42 virtual void UpdateIsPassword(); |
43 virtual void UpdateEnabled(); | 43 virtual void UpdateEnabled(); |
44 virtual bool IsPassword(); | |
45 virtual gfx::Insets CalculateInsets(); | 44 virtual gfx::Insets CalculateInsets(); |
46 virtual void UpdateHorizontalMargins(); | 45 virtual void UpdateHorizontalMargins(); |
47 virtual void UpdateVerticalMargins(); | 46 virtual void UpdateVerticalMargins(); |
48 virtual void SetFocus(); | 47 virtual bool SetFocus(); |
49 virtual View* GetView(); | 48 virtual View* GetView(); |
50 virtual gfx::NativeView GetTestingHandle() const; | 49 virtual gfx::NativeView GetTestingHandle() const; |
51 virtual bool IsIMEComposing() const; | 50 virtual bool IsIMEComposing() const; |
51 virtual bool OnKeyPressed(const views::KeyEvent& e) { return false; } | |
sky
2011/01/05 22:57:35
Don't inline virtual methods.
| |
52 virtual bool OnKeyReleased(const views::KeyEvent& e) { return false; } | |
53 virtual void WillGainFocus() {} | |
54 virtual void DidGainFocus() {} | |
55 virtual void WillLoseFocus() {} | |
52 | 56 |
53 // Overridden from NativeControlGtk: | 57 // Overridden from NativeControlGtk: |
54 virtual void CreateNativeControl(); | 58 virtual void CreateNativeControl(); |
55 virtual void NativeControlCreated(GtkWidget* widget); | 59 virtual void NativeControlCreated(GtkWidget* widget); |
56 | 60 |
61 // Returns true if the textfield is for password. | |
62 bool IsPassword(); | |
63 | |
57 private: | 64 private: |
58 Textfield* textfield_; | 65 Textfield* textfield_; |
59 | 66 |
60 // Callback when the entry text changes. | 67 // Callback when the entry text changes. |
61 static gboolean OnKeyPressEventHandler( | 68 static gboolean OnKeyPressEventHandler( |
62 GtkWidget* entry, | 69 GtkWidget* entry, |
63 GdkEventKey* event, | 70 GdkEventKey* event, |
64 NativeTextfieldGtk* textfield); | 71 NativeTextfieldGtk* textfield); |
65 gboolean OnKeyPressEvent(GdkEventKey* event); | 72 gboolean OnKeyPressEvent(GdkEventKey* event); |
66 static gboolean OnActivateHandler( | 73 static gboolean OnActivateHandler( |
67 GtkWidget* entry, | 74 GtkWidget* entry, |
68 NativeTextfieldGtk* textfield); | 75 NativeTextfieldGtk* textfield); |
69 gboolean OnActivate(); | 76 gboolean OnActivate(); |
70 static gboolean OnChangedHandler( | 77 static gboolean OnChangedHandler( |
71 GtkWidget* entry, | 78 GtkWidget* entry, |
72 NativeTextfieldGtk* textfield); | 79 NativeTextfieldGtk* textfield); |
73 gboolean OnChanged(); | 80 gboolean OnChanged(); |
74 | 81 |
75 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldGtk); | 82 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldGtk); |
76 }; | 83 }; |
77 | 84 |
78 } // namespace views | 85 } // namespace views |
79 | 86 |
80 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ | 87 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ |
OLD | NEW |