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

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: consistent quotation usage in layouttest html. 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
« no previous file with comments | « Source/core/html/ime/Composition.cpp ('k') | Source/core/html/ime/InputMethodContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
44 class InputMethodController;
43 class Node; 45 class Node;
44 46
45 class InputMethodContext : public ScriptWrappable { 47 class InputMethodContext : public ScriptWrappable {
46 public: 48 public:
47 static PassOwnPtr<InputMethodContext> create(HTMLElement*); 49 static PassOwnPtr<InputMethodContext> create(HTMLElement*);
48 ~InputMethodContext(); 50 ~InputMethodContext();
49 51
50 void ref() { m_element->ref(); } 52 void ref() { m_element->ref(); }
51 void deref() { m_element->deref(); } 53 void deref() { m_element->deref(); }
52 54
53 Composition* composition() const; 55 Composition* composition() const;
54 String locale() const; 56 String locale() const;
55 HTMLElement* target() const; 57 HTMLElement* target() const;
56 void confirmComposition(); 58 void confirmComposition();
57 void setCaretRectangle(Node* anchor, int x, int y, int w, int h); 59 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); 60 void setExclusionRectangle(Node* anchor, int x, int y, int w, int h);
59 61
62 String compositionText() const;
63 int selectionStart() const;
64 int selectionEnd() const;
65 const Vector<unsigned>& segments();
66
60 private: 67 private:
61 InputMethodContext(HTMLElement*); 68 InputMethodContext(HTMLElement*);
69 bool hasFocus() const;
70 CompositionUnderline selectedSegment() const;
71 InputMethodController& inputMethodController() const;
72
62 RefPtr<Composition> m_composition; 73 RefPtr<Composition> m_composition;
74 Vector<unsigned> m_segments;
63 HTMLElement* m_element; 75 HTMLElement* m_element;
64 }; 76 };
65 77
66 } // namespace WebCore 78 } // namespace WebCore
67 79
68 #endif // InputMethodContext_h 80 #endif // InputMethodContext_h
OLDNEW
« no previous file with comments | « Source/core/html/ime/Composition.cpp ('k') | Source/core/html/ime/InputMethodContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698