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

Side by Side Diff: Source/core/html/ime/InputMethodContext.h

Issue 23604053: Implement Composition interface for IME API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef InputMethodContext_h 31 #ifndef InputMethodContext_h
32 #define InputMethodContext_h 32 #define InputMethodContext_h
33 33
34 #include "bindings/v8/ScriptWrappable.h" 34 #include "bindings/v8/ScriptWrappable.h"
35 #include "core/editing/CompositionUnderline.h"
35 #include "core/html/HTMLElement.h" 36 #include "core/html/HTMLElement.h"
36 #include "wtf/PassOwnPtr.h" 37 #include "wtf/PassOwnPtr.h"
37 #include "wtf/RefPtr.h" 38 #include "wtf/RefPtr.h"
38 #include "wtf/text/WTFString.h" 39 #include "wtf/text/WTFString.h"
39 40
40 namespace WebCore { 41 namespace WebCore {
41 42
42 class Composition; 43 class Composition;
43 class Node; 44 class Node;
44 45
45 class InputMethodContext : public ScriptWrappable { 46 class InputMethodContext : public ScriptWrappable {
46 public: 47 public:
47 static PassOwnPtr<InputMethodContext> create(HTMLElement*); 48 static PassOwnPtr<InputMethodContext> create(HTMLElement*);
48 ~InputMethodContext(); 49 ~InputMethodContext();
49 50
50 void ref() { m_element->ref(); } 51 void ref() { m_element->ref(); }
51 void deref() { m_element->deref(); } 52 void deref() { m_element->deref(); }
52 53
53 Composition* composition() const; 54 Composition* composition() const;
54 String locale() const; 55 String locale() const;
55 HTMLElement* target() const; 56 HTMLElement* target() const;
56 void confirmComposition(); 57 void confirmComposition();
57 void setCaretRectangle(Node* anchor, int x, int y, int w, int h); 58 void setCaretRectangle(Node* anchor, int x, int y, int w, int h);
58 void setExclusionRectangle(Node* anchor, int x, int y, int w, int h); 59 void setExclusionRectangle(Node* anchor, int x, int y, int w, int h);
59 60
61 String getCompositionText() const;
tkent 2013/09/11 08:10:55 Do not add "get" prefix for getter functions. See
kochi 2013/09/11 08:32:00 Done.
62 int getSelectionStart() const;
63 int getSelectionEnd() const;
64 const Vector<unsigned>& getSegments();
65
60 private: 66 private:
61 InputMethodContext(HTMLElement*); 67 InputMethodContext(HTMLElement*);
68 bool hasFocus() const;
69 CompositionUnderline getSelectedSegment() const;
70
62 RefPtr<Composition> m_composition; 71 RefPtr<Composition> m_composition;
72 Vector<unsigned> m_segments;
63 HTMLElement* m_element; 73 HTMLElement* m_element;
64 }; 74 };
65 75
66 } // namespace WebCore 76 } // namespace WebCore
67 77
68 #endif // InputMethodContext_h 78 #endif // InputMethodContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698