OLD | NEW |
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 Loading... |
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 |
OLD | NEW |