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

Side by Side Diff: Source/core/html/ime/Composition.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
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 21 matching lines...) Expand all
32 #define Composition_h 32 #define Composition_h
33 33
34 #include "bindings/v8/ScriptWrappable.h" 34 #include "bindings/v8/ScriptWrappable.h"
35 #include "wtf/PassRefPtr.h" 35 #include "wtf/PassRefPtr.h"
36 #include "wtf/RefCounted.h" 36 #include "wtf/RefCounted.h"
37 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
38 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 class InputMethodContext;
43
42 class Composition : public RefCounted<Composition>, public ScriptWrappable { 44 class Composition : public RefCounted<Composition>, public ScriptWrappable {
43 public: 45 public:
44 static PassRefPtr<Composition> create(); 46 static PassRefPtr<Composition> create(InputMethodContext*);
45 ~Composition(); 47 ~Composition();
46 48
47 String text() const { return m_text; } 49 String text() const;
48 void setText(const String& text) { m_text = text; } 50 int selectionStart() const;
49 51 int selectionEnd() const;
50 int selectionStart() const { return m_selectionStart; }
51 void setSelectionStart(int selectionStart) { selectionStart = m_selectionSta rt; }
52
53 int selectionEnd() const { return m_selectionEnd; }
54 void setSelectionEnd(int selectionEnd) { selectionEnd = m_selectionEnd; }
55
56 const Vector<unsigned>& getSegments() const; 52 const Vector<unsigned>& getSegments() const;
57 53
58 private: 54 private:
59 Composition(); 55 explicit Composition(InputMethodContext*);
60 56
61 String m_text; 57 InputMethodContext* m_inputMethodContext;
62 int m_selectionStart;
63 int m_selectionEnd;
64 Vector<unsigned> m_segments;
65 }; 58 };
66 59
67 } // namespace WebCore 60 } // namespace WebCore
68 61
69 #endif // Composition_h 62 #endif // Composition_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/ime/inputmethodcontext-composition-expected.txt ('k') | Source/core/html/ime/Composition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698