Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: ui/base/ime/android/cursor_anchor_info_builder.h

Issue 643193003: Support InputMethodManager#updateCursorAnchorInfo for Android 5.0 (C++ version) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send ImeCompositionRangeChanged only when necessary Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 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_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_
6 #define UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_
7
8 #include <jni.h>
9
10 #include "base/android/scoped_java_ref.h"
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string16.h"
14 #include "base/strings/string_piece.h"
15 #include "ui/base/ui_base_export.h"
16 #include "ui/gfx/geometry/rect_f.h"
17 #include "ui/gfx/geometry/vector2d_f.h"
18 #include "ui/gfx/range/range.h"
19
20 namespace ui {
21
22 class UI_BASE_EXPORT CursorAnchorInfoBuilder {
23 public:
24 // Following values are defined in Android Framework.
25 enum Flags {
26 // android.view.inputmethod.CursorAnchorInfo.FLAG_HAS_INVISIBLE_REGION
27 kFlagHasVisibleRegion = 0x01,
28 // android.view.inputmethod.CursorAnchorInfo.FLAG_HAS_VISIBLE_REGION
29 kFlagHasInvisibleRegion = 0x02,
30 // android.view.inputmethod.CursorAnchorInfo.FLAG_IS_RTL
31 kFlagIsRtl = 0x04,
32 };
33
34 virtual ~CursorAnchorInfoBuilder();
35
36 virtual void AddCharacterBounds(int index,
37 const gfx::RectF& rect,
38 uint32 flags) = 0;
39 virtual base::android::ScopedJavaLocalRef<jobject> Build() = 0;
40 virtual void Reset() = 0;
41 virtual void SetComposingText(int composingTextStart,
42 base::StringPiece16 composingText) = 0;
43 virtual void SetInsertionMarkerLocation(float horizontalPosition,
44 float lineTop,
45 float lineBaseline,
46 float lineBottom,
47 uint32 flags) = 0;
48 virtual void SetScaleAndTranslate(float scale,
49 const gfx::Vector2dF& translate) = 0;
50 virtual void SetSelectionRange(const gfx::Range& range) = 0;
51
52 static scoped_ptr<CursorAnchorInfoBuilder> Create();
53 static bool Register(JNIEnv* env);
54
55 protected:
56 CursorAnchorInfoBuilder();
57 };
58
59 } // namespace ui
60
61 #endif // UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_
OLDNEW
« no previous file with comments | « ui/base/android/ui_base_jni_registrar.cc ('k') | ui/base/ime/android/cursor_anchor_info_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698