| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void SetAccessibleName(const base::string16& name); | 202 void SetAccessibleName(const base::string16& name); |
| 203 | 203 |
| 204 // Returns whether there is a drag operation originating from the textfield. | 204 // Returns whether there is a drag operation originating from the textfield. |
| 205 bool HasTextBeingDragged(); | 205 bool HasTextBeingDragged(); |
| 206 | 206 |
| 207 // View overrides: | 207 // View overrides: |
| 208 gfx::Insets GetInsets() const override; | 208 gfx::Insets GetInsets() const override; |
| 209 int GetBaseline() const override; | 209 int GetBaseline() const override; |
| 210 gfx::Size GetPreferredSize() const override; | 210 gfx::Size GetPreferredSize() const override; |
| 211 const char* GetClassName() const override; | 211 const char* GetClassName() const override; |
| 212 gfx::RenderText* GetRenderText() const override; |
| 212 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; | 213 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; |
| 213 bool OnMousePressed(const ui::MouseEvent& event) override; | 214 bool OnMousePressed(const ui::MouseEvent& event) override; |
| 214 bool OnMouseDragged(const ui::MouseEvent& event) override; | 215 bool OnMouseDragged(const ui::MouseEvent& event) override; |
| 215 void OnMouseReleased(const ui::MouseEvent& event) override; | 216 void OnMouseReleased(const ui::MouseEvent& event) override; |
| 216 void OnGestureEvent(ui::GestureEvent* event) override; | 217 void OnGestureEvent(ui::GestureEvent* event) override; |
| 217 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 218 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 218 bool CanHandleAccelerators() const override; | 219 bool CanHandleAccelerators() const override; |
| 219 void AboutToRequestFocusFromTabTraversal(bool reverse) override; | 220 void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
| 220 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; | 221 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; |
| 221 bool GetDropFormats( | 222 bool GetDropFormats( |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 base::i18n::TextDirection direction) override; | 302 base::i18n::TextDirection direction) override; |
| 302 void ExtendSelectionAndDelete(size_t before, size_t after) override; | 303 void ExtendSelectionAndDelete(size_t before, size_t after) override; |
| 303 void EnsureCaretInRect(const gfx::Rect& rect) override; | 304 void EnsureCaretInRect(const gfx::Rect& rect) override; |
| 304 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; | 305 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; |
| 305 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; | 306 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; |
| 306 | 307 |
| 307 protected: | 308 protected: |
| 308 // Inserts or appends a character in response to an IME operation. | 309 // Inserts or appends a character in response to an IME operation. |
| 309 virtual void DoInsertChar(base::char16 ch); | 310 virtual void DoInsertChar(base::char16 ch); |
| 310 | 311 |
| 311 // Returns the TextfieldModel's text/cursor/selection rendering model. | |
| 312 gfx::RenderText* GetRenderText() const; | |
| 313 | |
| 314 gfx::Point last_click_location() const { return last_click_location_; } | 312 gfx::Point last_click_location() const { return last_click_location_; } |
| 315 | 313 |
| 316 // Get the text from the selection clipboard. | 314 // Get the text from the selection clipboard. |
| 317 virtual base::string16 GetSelectionClipboardText() const; | 315 virtual base::string16 GetSelectionClipboardText() const; |
| 318 | 316 |
| 319 // Executes the given |command|. | 317 // Executes the given |command|. |
| 320 virtual void ExecuteTextEditCommand(ui::TextEditCommand command); | 318 virtual void ExecuteTextEditCommand(ui::TextEditCommand command); |
| 321 | 319 |
| 322 private: | 320 private: |
| 323 friend class TextfieldTestApi; | 321 friend class TextfieldTestApi; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 508 |
| 511 // Used to bind callback functions to this object. | 509 // Used to bind callback functions to this object. |
| 512 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 510 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 513 | 511 |
| 514 DISALLOW_COPY_AND_ASSIGN(Textfield); | 512 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 515 }; | 513 }; |
| 516 | 514 |
| 517 } // namespace views | 515 } // namespace views |
| 518 | 516 |
| 519 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 517 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |