| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_VIEW_H_ | 5 #ifndef VIEWS_VIEW_H_ |
| 6 #define VIEWS_VIEW_H_ | 6 #define VIEWS_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
| 46 class NativeViewAccessibilityWin; | 46 class NativeViewAccessibilityWin; |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 namespace views { | 49 namespace views { |
| 50 | 50 |
| 51 class Background; | 51 class Background; |
| 52 class Border; | 52 class Border; |
| 53 class FocusManager; | 53 class FocusManager; |
| 54 class FocusTraversable; | 54 class FocusTraversable; |
| 55 class InputMethod; |
| 55 class LayoutManager; | 56 class LayoutManager; |
| 56 class RootView; | 57 class RootView; |
| 57 class ScrollView; | 58 class ScrollView; |
| 59 class TextInputClient; |
| 58 class Widget; | 60 class Widget; |
| 59 class Window; | 61 class Window; |
| 60 | 62 |
| 61 // ContextMenuController is responsible for showing the context menu for a | 63 // ContextMenuController is responsible for showing the context menu for a |
| 62 // View. To use a ContextMenuController invoke SetContextMenuController on a | 64 // View. To use a ContextMenuController invoke SetContextMenuController on a |
| 63 // View. When the appropriate user gesture occurs ShowContextMenu is invoked | 65 // View. When the appropriate user gesture occurs ShowContextMenu is invoked |
| 64 // on the ContextMenuController. | 66 // on the ContextMenuController. |
| 65 // | 67 // |
| 66 // Setting a ContextMenuController on a view makes the view process mouse | 68 // Setting a ContextMenuController on a view makes the view process mouse |
| 67 // events. | 69 // events. |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 // chance. | 679 // chance. |
| 678 virtual bool OnKeyPressed(const KeyEvent& event); | 680 virtual bool OnKeyPressed(const KeyEvent& event); |
| 679 virtual bool OnKeyReleased(const KeyEvent& event); | 681 virtual bool OnKeyReleased(const KeyEvent& event); |
| 680 | 682 |
| 681 // Invoked when the user uses the mousewheel. Implementors should return true | 683 // Invoked when the user uses the mousewheel. Implementors should return true |
| 682 // if the event has been processed and false otherwise. This message is sent | 684 // if the event has been processed and false otherwise. This message is sent |
| 683 // if the view is focused. If the event has not been processed, the parent | 685 // if the view is focused. If the event has not been processed, the parent |
| 684 // will be given a chance. | 686 // will be given a chance. |
| 685 virtual bool OnMouseWheel(const MouseWheelEvent& event); | 687 virtual bool OnMouseWheel(const MouseWheelEvent& event); |
| 686 | 688 |
| 689 // Returns the View's TextInputClient instance or NULL if the View doesn't |
| 690 // support text input. |
| 691 virtual TextInputClient* GetTextInputClient(); |
| 692 |
| 693 // Convenience method to retrieve the InputMethod associated with the |
| 694 // Widget that contains this view. Returns NULL if this view is not part of a |
| 695 // view hierarchy with a Widget. |
| 696 virtual InputMethod* GetInputMethod(); |
| 697 |
| 687 // Accelerators -------------------------------------------------------------- | 698 // Accelerators -------------------------------------------------------------- |
| 688 | 699 |
| 689 // Sets a keyboard accelerator for that view. When the user presses the | 700 // Sets a keyboard accelerator for that view. When the user presses the |
| 690 // accelerator key combination, the AcceleratorPressed method is invoked. | 701 // accelerator key combination, the AcceleratorPressed method is invoked. |
| 691 // Note that you can set multiple accelerators for a view by invoking this | 702 // Note that you can set multiple accelerators for a view by invoking this |
| 692 // method several times. | 703 // method several times. |
| 693 virtual void AddAccelerator(const Accelerator& accelerator); | 704 virtual void AddAccelerator(const Accelerator& accelerator); |
| 694 | 705 |
| 695 // Removes the specified accelerator for this view. | 706 // Removes the specified accelerator for this view. |
| 696 virtual void RemoveAccelerator(const Accelerator& accelerator); | 707 virtual void RemoveAccelerator(const Accelerator& accelerator); |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 // The Windows-specific accessibility implementation for this View. | 1405 // The Windows-specific accessibility implementation for this View. |
| 1395 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1406 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
| 1396 #endif | 1407 #endif |
| 1397 | 1408 |
| 1398 DISALLOW_COPY_AND_ASSIGN(View); | 1409 DISALLOW_COPY_AND_ASSIGN(View); |
| 1399 }; | 1410 }; |
| 1400 | 1411 |
| 1401 } // namespace views | 1412 } // namespace views |
| 1402 | 1413 |
| 1403 #endif // VIEWS_VIEW_H_ | 1414 #endif // VIEWS_VIEW_H_ |
| OLD | NEW |