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 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
| 10 #include "app/gtk_signal.h" |
10 #include "base/string16.h" | 11 #include "base/string16.h" |
11 #include "views/controls/native_control_gtk.h" | 12 #include "views/controls/native_control_gtk.h" |
12 #include "views/controls/textfield/native_textfield_wrapper.h" | 13 #include "views/controls/textfield/native_textfield_wrapper.h" |
13 | 14 |
14 namespace views { | 15 namespace views { |
15 | 16 |
16 class NativeTextfieldGtk : public NativeControlGtk, | 17 class NativeTextfieldGtk : public NativeControlGtk, |
17 public NativeTextfieldWrapper { | 18 public NativeTextfieldWrapper { |
18 public: | 19 public: |
19 explicit NativeTextfieldGtk(Textfield* parent); | 20 explicit NativeTextfieldGtk(Textfield* parent); |
20 ~NativeTextfieldGtk(); | 21 ~NativeTextfieldGtk(); |
21 | 22 |
| 23 // Returns the textfield this NativeTextfieldGtk wraps. |
| 24 Textfield* textfield() const { return textfield_; } |
| 25 |
| 26 // Returns the inner border of the entry. |
| 27 static gfx::Insets GetEntryInnerBorder(GtkEntry* entry); |
| 28 |
22 // Overridden from NativeTextfieldWrapper: | 29 // Overridden from NativeTextfieldWrapper: |
23 virtual string16 GetText() const; | 30 virtual string16 GetText() const; |
24 virtual void UpdateText(); | 31 virtual void UpdateText(); |
25 virtual void AppendText(const string16& text); | 32 virtual void AppendText(const string16& text); |
26 virtual string16 GetSelectedText() const; | 33 virtual string16 GetSelectedText() const; |
27 virtual void SelectAll(); | 34 virtual void SelectAll(); |
28 virtual void ClearSelection(); | 35 virtual void ClearSelection(); |
29 virtual void UpdateBorder(); | 36 virtual void UpdateBorder(); |
30 virtual void UpdateTextColor(); | 37 virtual void UpdateTextColor(); |
31 virtual void UpdateBackgroundColor(); | 38 virtual void UpdateBackgroundColor(); |
(...skipping 24 matching lines...) Expand all Loading... |
56 GtkWidget* entry, | 63 GtkWidget* entry, |
57 NativeTextfieldGtk* textfield); | 64 NativeTextfieldGtk* textfield); |
58 gboolean OnChanged(); | 65 gboolean OnChanged(); |
59 | 66 |
60 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldGtk); | 67 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldGtk); |
61 }; | 68 }; |
62 | 69 |
63 } // namespace views | 70 } // namespace views |
64 | 71 |
65 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ | 72 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_GTK_H_ |
OLD | NEW |