OLD | NEW |
---|---|
(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/matrix3_f.h" | |
17 #include "ui/gfx/geometry/rect_f.h" | |
18 #include "ui/gfx/range/range.h" | |
19 | |
20 namespace ui { | |
21 | |
22 class UI_BASE_EXPORT CursorAnchorInfoBuilder { | |
23 public: | |
24 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
| |
25 kFlagHasVisibleRegion = 0x01, | |
26 kFlagHasInvisibleRegion = 0x02, | |
27 kFlagIsRtl = 0x04, | |
28 }; | |
29 | |
30 virtual ~CursorAnchorInfoBuilder(); | |
31 | |
32 virtual void AddCharacterBounds(int index, | |
33 const gfx::RectF& rect, | |
34 uint32 flags) = 0; | |
35 virtual base::android::ScopedJavaLocalRef<jobject> Build() = 0; | |
36 virtual void Reset() = 0; | |
37 virtual void SetComposingText(int composingTextStart, | |
38 base::StringPiece16 composingText) = 0; | |
39 virtual void SetInsertionMarkerLocation(float horizontalPosition, | |
40 float lineTop, | |
41 float lineBaseline, | |
42 float lineBottom, | |
43 uint32 flags) = 0; | |
44 virtual void SetMatrix(const gfx::Matrix3F& matrix) = 0; | |
45 virtual void SetSelectionRange(const gfx::Range& range) = 0; | |
46 | |
47 static scoped_ptr<CursorAnchorInfoBuilder> Create(); | |
48 static bool Register(JNIEnv* env); | |
49 | |
50 protected: | |
51 CursorAnchorInfoBuilder(); | |
52 }; | |
53 | |
54 } // namespace ui | |
55 | |
56 #endif // UI_BASE_ANDROID_CURSOR_ANCHOR_INFO_BUILDER_H_ | |
OLD | NEW |