Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_CPP_TEXT_INPUT_CONTROLLER_H_ | |
| 6 #define PPAPI_CPP_TEXT_INPUT_CONTROLLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "ppapi/c/ppb_text_input_controller.h" | |
| 11 #include "ppapi/cpp/instance_handle.h" | |
| 12 | |
| 13 /// @file | |
| 14 /// This file defines the APIs for text input handling. | |
| 15 | |
| 16 namespace pp { | |
| 17 | |
| 18 class Rect; | |
| 19 class Instance; | |
| 20 | |
| 21 /// This class can be used for giving hints to the browser about the text input | |
| 22 /// status of plugins. | |
| 23 class TextInputController { | |
| 24 public: | |
| 25 /// A constructor for creating a <code>TextInputController</code> | |
|
dmichael (off chromium)
2013/07/26 17:59:37
nit: period to end the sentence
Seigo Nonaka
2013/07/31 01:57:45
Done.
| |
| 26 /// | |
| 27 /// @param[in] instance The instance with which this resource will be | |
| 28 /// associated. | |
| 29 explicit TextInputController(const InstanceHandle& instance); | |
| 30 | |
| 31 /// Destructor. | |
| 32 ~TextInputController(); | |
| 33 | |
| 34 /// SetTextInputType() informs the browser about the current text input mode | |
| 35 /// of the plugin. | |
| 36 /// | |
| 37 /// @param[in] type The type of text input type. | |
| 38 void SetTextInputType(PP_TextInput_Type type); | |
| 39 | |
| 40 /// UpdateCaretPosition() informs the browser about the coordinates of the | |
| 41 /// text input caret area. | |
| 42 /// | |
| 43 /// @param[in] caret A rectangle indicating the caret area. | |
| 44 void UpdateCaretPosition(const Rect& caret); | |
| 45 | |
| 46 /// CancelCompositionText() informs the browser about the current composition | |
|
dmichael (off chromium)
2013/07/26 17:59:37
s/about/that
Seigo Nonaka
2013/07/31 01:57:45
Done.
| |
| 47 /// text is cancelled by plugins. | |
|
dmichael (off chromium)
2013/07/26 17:59:37
s/by plugins./by the plugin.
Seigo Nonaka
2013/07/31 01:57:45
Done.
| |
| 48 void CancelCompositionText(); | |
| 49 | |
| 50 /// UpdateSurroundingText() informs the browser about the current text | |
| 51 /// selection and surrounding text. | |
| 52 /// | |
| 53 /// @param[in] text A UTF-8 sting indicating string buffer of current input | |
| 54 /// context. | |
| 55 /// | |
| 56 /// @param[in] caret A integer indicating the byte index of caret location in | |
| 57 /// <code>text</code>. | |
| 58 /// | |
| 59 /// @param[in] caret A integer indicating the byte index of anchor location in | |
| 60 /// <code>text</code>. If there is no selection, this value should be equal to | |
| 61 /// <code>caret</code>. | |
| 62 void UpdateSurroundingText(const std::string& text, | |
|
dmichael (off chromium)
2013/07/26 17:59:37
We're trying to keep the C++ interfaces as very si
Seigo Nonaka
2013/07/31 01:57:45
Done.
| |
| 63 uint32_t caret, | |
| 64 uint32_t anchor); | |
| 65 | |
| 66 private: | |
| 67 InstanceHandle instance_; | |
| 68 }; | |
| 69 | |
| 70 } // namespace pp | |
| 71 | |
| 72 #endif // PPAPI_CPP_TEXT_INPUT_CONTROLLER_H_ | |
| OLD | NEW |