OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void SetAccessibleName(const base::string16& name); | 200 void SetAccessibleName(const base::string16& name); |
201 | 201 |
202 // Returns whether there is a drag operation originating from the textfield. | 202 // Returns whether there is a drag operation originating from the textfield. |
203 bool HasTextBeingDragged(); | 203 bool HasTextBeingDragged(); |
204 | 204 |
205 // View overrides: | 205 // View overrides: |
206 gfx::Insets GetInsets() const override; | 206 gfx::Insets GetInsets() const override; |
207 int GetBaseline() const override; | 207 int GetBaseline() const override; |
208 gfx::Size GetPreferredSize() const override; | 208 gfx::Size GetPreferredSize() const override; |
209 const char* GetClassName() const override; | 209 const char* GetClassName() const override; |
| 210 gfx::RenderText* GetRenderText() const override; |
210 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; | 211 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; |
211 bool OnMousePressed(const ui::MouseEvent& event) override; | 212 bool OnMousePressed(const ui::MouseEvent& event) override; |
212 bool OnMouseDragged(const ui::MouseEvent& event) override; | 213 bool OnMouseDragged(const ui::MouseEvent& event) override; |
213 void OnMouseReleased(const ui::MouseEvent& event) override; | 214 void OnMouseReleased(const ui::MouseEvent& event) override; |
214 void OnGestureEvent(ui::GestureEvent* event) override; | 215 void OnGestureEvent(ui::GestureEvent* event) override; |
215 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 216 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
216 bool CanHandleAccelerators() const override; | 217 bool CanHandleAccelerators() const override; |
217 void AboutToRequestFocusFromTabTraversal(bool reverse) override; | 218 void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
218 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; | 219 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; |
219 bool GetDropFormats( | 220 bool GetDropFormats( |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 base::i18n::TextDirection direction) override; | 300 base::i18n::TextDirection direction) override; |
300 void ExtendSelectionAndDelete(size_t before, size_t after) override; | 301 void ExtendSelectionAndDelete(size_t before, size_t after) override; |
301 void EnsureCaretInRect(const gfx::Rect& rect) override; | 302 void EnsureCaretInRect(const gfx::Rect& rect) override; |
302 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; | 303 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; |
303 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; | 304 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; |
304 | 305 |
305 protected: | 306 protected: |
306 // Inserts or appends a character in response to an IME operation. | 307 // Inserts or appends a character in response to an IME operation. |
307 virtual void DoInsertChar(base::char16 ch); | 308 virtual void DoInsertChar(base::char16 ch); |
308 | 309 |
309 // Returns the TextfieldModel's text/cursor/selection rendering model. | |
310 gfx::RenderText* GetRenderText() const; | |
311 | |
312 gfx::Point last_click_location() const { return last_click_location_; } | 310 gfx::Point last_click_location() const { return last_click_location_; } |
313 | 311 |
314 // Get the text from the selection clipboard. | 312 // Get the text from the selection clipboard. |
315 virtual base::string16 GetSelectionClipboardText() const; | 313 virtual base::string16 GetSelectionClipboardText() const; |
316 | 314 |
317 // Executes the given |command|. | 315 // Executes the given |command|. |
318 virtual void ExecuteTextEditCommand(ui::TextEditCommand command); | 316 virtual void ExecuteTextEditCommand(ui::TextEditCommand command); |
319 | 317 |
320 private: | 318 private: |
321 friend class TextfieldTestApi; | 319 friend class TextfieldTestApi; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 486 |
489 // Used to bind callback functions to this object. | 487 // Used to bind callback functions to this object. |
490 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 488 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
491 | 489 |
492 DISALLOW_COPY_AND_ASSIGN(Textfield); | 490 DISALLOW_COPY_AND_ASSIGN(Textfield); |
493 }; | 491 }; |
494 | 492 |
495 } // namespace views | 493 } // namespace views |
496 | 494 |
497 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 495 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |