OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_BASE_IME_ANDROID_CURAOR_ANCHOR_INFO_CONTROLLER_H_ |
| 6 #define UI_BASE_IME_ANDROID_CURAOR_ANCHOR_INFO_CONTROLLER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/strings/string16.h" |
| 13 #include "ui/base/ui_base_export.h" |
| 14 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/gfx/geometry/vector2d.h" |
| 16 #include "ui/gfx/geometry/vector2d_f.h" |
| 17 #include "ui/gfx/range/range.h" |
| 18 |
| 19 namespace cc { |
| 20 class CompositorFrameMetadata; |
| 21 } |
| 22 |
| 23 namespace ui { |
| 24 |
| 25 class CursorAnchorInfoBuilder; |
| 26 class CursorAnchorInfoSender; |
| 27 |
| 28 class UI_BASE_EXPORT CursorAnchorInfoController { |
| 29 public: |
| 30 // Defined in android.view.inputmethod.InputConnection. |
| 31 enum Flags { |
| 32 kCursorUpdateModeImmediate = 0x01, |
| 33 kCursorUpdateModeMonitor = 0x02, |
| 34 }; |
| 35 |
| 36 virtual ~CursorAnchorInfoController(); |
| 37 |
| 38 virtual void OnFocusedNodeChanged(bool is_editable_node) = 0; |
| 39 |
| 40 virtual void OnTextInputStateChanged( |
| 41 const base::string16& text, |
| 42 const gfx::Range& selection_range, |
| 43 const gfx::Range& composition_range) = 0; |
| 44 |
| 45 virtual void OnCompositionRangeChanged( |
| 46 const gfx::Range& range, |
| 47 const std::vector<gfx::Rect>& character_bounds) = 0; |
| 48 |
| 49 virtual void OnFrameMetadataUpdated( |
| 50 const cc::CompositorFrameMetadata& frame_metadata, |
| 51 const gfx::Vector2d& view_offset) = 0; |
| 52 |
| 53 virtual bool OnRequestCursorUpdates(uint32 cursor_update_mode) = 0; |
| 54 |
| 55 // Does not take ownership of |sender|. |
| 56 static scoped_ptr<CursorAnchorInfoController> Create( |
| 57 CursorAnchorInfoSender* sender); |
| 58 |
| 59 static scoped_ptr<CursorAnchorInfoController> CreateForTest( |
| 60 CursorAnchorInfoSender* sender, |
| 61 scoped_ptr<CursorAnchorInfoBuilder> cursor_anchor_info_builder); |
| 62 |
| 63 protected: |
| 64 CursorAnchorInfoController(); |
| 65 }; |
| 66 |
| 67 } // namespace ui |
| 68 |
| 69 #endif // UI_BASE_IME_ANDROID_CURAOR_ANCHOR_INFO_CONTROLLER_H_ |
OLD | NEW |