OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WIN8_METRO_DRIVER_IME_TEXT_SERVICE_DELEGATE_H_ | 5 #ifndef WIN8_METRO_DRIVER_IME_TEXT_SERVICE_DELEGATE_H_ |
6 #define WIN8_METRO_DRIVER_IME_TEXT_SERVICE_DELEGATE_H_ | 6 #define WIN8_METRO_DRIVER_IME_TEXT_SERVICE_DELEGATE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
12 | 13 |
13 namespace metro_viewer { | 14 namespace metro_viewer { |
14 struct UnderlineInfo; | 15 struct UnderlineInfo; |
15 } | 16 } |
16 | 17 |
17 namespace metro_driver { | 18 namespace metro_driver { |
18 | 19 |
19 // A delegate which works together with virtual text service. | 20 // A delegate which works together with virtual text service. |
20 // Objects that implement this delegate will receive notifications from a | 21 // Objects that implement this delegate will receive notifications from a |
21 // virtual text service whenever an IME updates the composition or commits text. | 22 // virtual text service whenever an IME updates the composition or commits text. |
22 class TextServiceDelegate { | 23 class TextServiceDelegate { |
23 public: | 24 public: |
24 virtual ~TextServiceDelegate() {} | 25 virtual ~TextServiceDelegate() {} |
25 | 26 |
26 // Called when on-going composition is updated. An empty |text| represents | 27 // Called when on-going composition is updated. An empty |text| represents |
27 // that the composition is canceled. | 28 // that the composition is canceled. |
28 virtual void OnCompositionChanged( | 29 virtual void OnCompositionChanged( |
29 const base::string16& text, | 30 const base::string16& text, |
30 int32 selection_start, | 31 int32_t selection_start, |
31 int32 selection_end, | 32 int32_t selection_end, |
32 const std::vector<metro_viewer::UnderlineInfo>& underlines) = 0; | 33 const std::vector<metro_viewer::UnderlineInfo>& underlines) = 0; |
33 | 34 |
34 // Called when |text| is committed. | 35 // Called when |text| is committed. |
35 virtual void OnTextCommitted(const base::string16& text) = 0; | 36 virtual void OnTextCommitted(const base::string16& text) = 0; |
36 }; | 37 }; |
37 | 38 |
38 } // namespace metro_driver | 39 } // namespace metro_driver |
39 | 40 |
40 #endif // WIN8_METRO_DRIVER_IME_TEXT_SERVICE_DELEGATE_H_ | 41 #endif // WIN8_METRO_DRIVER_IME_TEXT_SERVICE_DELEGATE_H_ |
OLD | NEW |