Index: ui/base/ime/android/cursor_anchor_info_builder.h |
diff --git a/ui/base/ime/android/cursor_anchor_info_builder.h b/ui/base/ime/android/cursor_anchor_info_builder.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c9bd52e435389fb66bda341bf3e0060ff86f9c4e |
--- /dev/null |
+++ b/ui/base/ime/android/cursor_anchor_info_builder.h |
@@ -0,0 +1,56 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ |
+#define UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ |
+ |
+#include <jni.h> |
+ |
+#include "base/android/scoped_java_ref.h" |
+#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/strings/string16.h" |
+#include "base/strings/string_piece.h" |
+#include "ui/base/ui_base_export.h" |
+#include "ui/gfx/geometry/matrix3_f.h" |
+#include "ui/gfx/geometry/rect_f.h" |
+#include "ui/gfx/range/range.h" |
+ |
+namespace ui { |
+ |
+class UI_BASE_EXPORT CursorAnchorInfoBuilder { |
+ public: |
+ enum Flags { |
jdduke (slow)
2015/01/14 17:17:09
I'm a little wary of duplicating these constants.
yukawa
2015/01/14 22:21:59
Added comment. Those values are actually defined
|
+ kFlagHasVisibleRegion = 0x01, |
+ kFlagHasInvisibleRegion = 0x02, |
+ kFlagIsRtl = 0x04, |
+ }; |
+ |
+ virtual ~CursorAnchorInfoBuilder(); |
+ |
+ virtual void AddCharacterBounds(int index, |
+ const gfx::RectF& rect, |
+ uint32 flags) = 0; |
+ virtual base::android::ScopedJavaLocalRef<jobject> Build() = 0; |
+ virtual void Reset() = 0; |
+ virtual void SetComposingText(int composingTextStart, |
+ base::StringPiece16 composingText) = 0; |
+ virtual void SetInsertionMarkerLocation(float horizontalPosition, |
+ float lineTop, |
+ float lineBaseline, |
+ float lineBottom, |
+ uint32 flags) = 0; |
+ virtual void SetMatrix(const gfx::Matrix3F& matrix) = 0; |
+ virtual void SetSelectionRange(const gfx::Range& range) = 0; |
+ |
+ static scoped_ptr<CursorAnchorInfoBuilder> Create(); |
+ static bool Register(JNIEnv* env); |
+ |
+ protected: |
+ CursorAnchorInfoBuilder(); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ |