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

Side by Side Diff: ppapi/cpp/text_input.h

Issue 18671004: PPAPI: Move IMEInputEvent and TextInput to stable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 PPAPI_CPP_DEV_TEXT_INPUT_DEV_H_ 5 #ifndef PPAPI_CPP_DEV_TEXT_INPUT_DEV_H_
6 #define PPAPI_CPP_DEV_TEXT_INPUT_DEV_H_ 6 #define PPAPI_CPP_DEV_TEXT_INPUT_DEV_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ppapi/c/dev/ppb_text_input_dev.h" 10 #include "ppapi/c/ppb_text_input.h"
11 #include "ppapi/cpp/instance_handle.h" 11 #include "ppapi/cpp/instance_handle.h"
12 12
13 namespace pp { 13 namespace pp {
14 14
15 class Rect; 15 class Rect;
16 class Instance; 16 class Instance;
17 17
18 // This class allows you to associate the PPP_TextInput_Dev and 18 // This class allows you to associate the PPP_TextInput and
19 // PPB_TextInput_Dev C-based interfaces with an object. It associates itself 19 // PPB_TextInput C-based interfaces with an object. It associates itself
20 // with the given instance, and registers as the global handler for handling the 20 // with the given instance, and registers as the global handler for handling the
21 // PPP_TextInput_Dev interface that the browser calls. 21 // PPP_TextInput interface that the browser calls.
22 // 22 //
23 // You would typically use this either via inheritance on your instance: 23 // You would typically use this either via inheritance on your instance:
24 // class MyInstance : public pp::Instance, public pp::TextInput_Dev { 24 // class MyInstance : public pp::Instance, public pp::TextInput {
25 // MyInstance() : pp::TextInput_Dev(this) { 25 // MyInstance() : pp::TextInput(this) {
26 // } 26 // }
27 // ... 27 // ...
28 // }; 28 // };
29 // 29 //
30 // or by composition: 30 // or by composition:
31 // class MyTextInput : public pp::TextInput_Dev { 31 // class MyTextInput : public pp::TextInput {
32 // ... 32 // ...
33 // }; 33 // };
34 // 34 //
35 // class MyInstance : public pp::Instance { 35 // class MyInstance : public pp::Instance {
36 // MyInstance() : text_input_(this) { 36 // MyInstance() : text_input_(this) {
37 // } 37 // }
38 // 38 //
39 // MyTextInput text_input_; 39 // MyTextInput text_input_;
40 // }; 40 // };
41 class TextInput_Dev { 41 class TextInput {
42 public: 42 public:
43 explicit TextInput_Dev(Instance* instance); 43 explicit TextInput(Instance* instance);
44 virtual ~TextInput_Dev(); 44 virtual ~TextInput();
45 45
46 virtual void RequestSurroundingText(uint32_t desired_number_of_characters); 46 virtual void RequestSurroundingText(uint32_t desired_number_of_characters);
47 47
48 void SetTextInputType(PP_TextInput_Type type); 48 void SetTextInputType(PP_TextInput_Type type);
49 void UpdateCaretPosition(const Rect& caret, const Rect& bounding_box); 49 void UpdateCaretPosition(const Rect& caret, const Rect& bounding_box);
50 void CancelCompositionText(); 50 void CancelCompositionText();
51 void SelectionChanged(); 51 void SelectionChanged();
52 void UpdateSurroundingText(const std::string& text, 52 void UpdateSurroundingText(const std::string& text,
53 uint32_t caret, uint32_t anchor); 53 uint32_t caret, uint32_t anchor);
54 54
55 private: 55 private:
56 InstanceHandle instance_; 56 InstanceHandle instance_;
57 }; 57 };
58 58
59 } // namespace pp 59 } // namespace pp
60 60
61 #endif // PPAPI_CPP_DEV_TEXT_INPUT_DEV_H_ 61 #endif // PPAPI_CPP_DEV_TEXT_INPUT_DEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698