Pepper_47_C++_interfaces
remote_controller_samsung.h
Go to the documentation of this file.
1 // Copyright 2016 Samsung Electronics. 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_SAMSUNG_REMOTE_CONTROLLER_SAMSUNG_H_
6 #define PPAPI_CPP_SAMSUNG_REMOTE_CONTROLLER_SAMSUNG_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "ppapi/c/samsung/ppb_remote_controller_samsung.h"
13 
14 /// @file
15 /// This file defines API related to TV Remote Controller
16 
17 namespace pp {
18 
20  public:
21  /// A constructor for creating a <code>RemoteControllerSamsung</code> class
22  /// for given instance of a module.
23  explicit RemoteControllerSamsung(const InstanceHandle& instance);
24 
25  /// RegisterKeys() function registers given key arrays to be grabbed by
26  /// the application/widget containing pepper plugin calling this method.
27  ///
28  /// <strong>Note:</strong>
29  /// After registering for grabbing keys, events related to that key
30  /// will be delivered directly to the application/widget.
31  ///
32  /// <strong>Note:</strong>
33  /// For some embedders, we can`t tell if key that we try to register have
34  /// failed because it have been already registered. So if at least one key
35  /// have been successfully processed, we assume that other keys that failed,
36  /// have been already registered before this call.
37  ///
38  /// @param[in] key_count A number of keys which will be grabbed.
39  /// @param[in] keys An array containing list of keys which should be grabbed.
40  ///
41  /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
42  /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>key_count</code> is
43  /// equal 0 or one of <code>keys</code> is not supported anymore.
44  /// Returns <code>PP_ERROR_NOTSUPPORTED</code> if currently launched embedder
45  /// doesn`t support key registering.
46  /// Returns <code>PP_ERROR_FAILED</code> if registering all <code>keys</code>
47  /// have failed.
48  /// Returns <code>PP_OK</code> if at lest one key from <code>keys</code> have
49  /// been registered.
50  int32_t RegisterKeys(uint32_t key_count, const char* keys[]);
51 
52  /// RegisterKeys() function registers given key arrays to be grabbed by
53  /// the application/widget containing pepper plugin calling this method.
54  ///
55  /// <strong>Note:</strong>
56  /// After registering for grabbing keys, events related to that key
57  /// will be delivered directly to the application/widget.
58  ///
59  /// <strong>Note:</strong>
60  /// For some embedders, we can`t tell if key that we try to register have
61  /// failed because it have been already registered. So if at least one key
62  /// have been successfully processed, we assume that other keys that failed,
63  /// have been already registered before this call.
64  ///
65  /// @param[in] keys A vector containing list of keys which should be grabbed.
66  ///
67  /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
68  /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>key_count</code> is
69  /// equal 0 or one of <code>keys</code> is not supported anymore.
70  /// Returns <code>PP_ERROR_NOTSUPPORTED</code> if currently launched embedder
71  /// doesn`t support key registering.
72  /// Returns <code>PP_ERROR_FAILED</code> if registering all <code>keys</code>
73  /// have failed.
74  /// Returns <code>PP_OK</code> if at lest one key from <code>keys</code> have
75  /// been registered.
76  int32_t RegisterKeys(const std::vector<std::string>& keys);
77 
78  /// UnregisterKeys() function unregisters given key arrays from being grabbed
79  /// by the application/widget containing pepper plugin calling this method.
80  ///
81  /// <strong>Note:</strong>
82  /// For some embedders, we can`t tell if key that we try to unregister have
83  /// failed because it have been already unregistered. So if at least one key
84  /// have been successfully processed, we assume that other keys that failed,
85  /// have been already unregistered before this call.
86  ///
87  /// @param[in] key_count A number of keys which will be grabbed.
88  /// @param[in] keys An array containing list of keys which should be grabbed.
89  ///
90  /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
91  /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>key_count</code> is
92  /// equal 0 or one of <code>keys</code> is not supported anymore.
93  /// Returns <code>PP_ERROR_NOTSUPPORTED</code> if currently launched embedder
94  /// doesn`t support key registering.
95  /// Returns <code>PP_ERROR_FAILED</code> if registering all <code>keys</code>
96  /// have failed.
97  /// Returns <code>PP_OK</code> if at lest one key from <code>keys</code> have
98  /// been registered.
99  int32_t UnRegisterKeys(uint32_t key_count, const char* keys[]);
100 
101  /// UnregisterKeys() function unregisters given key arrays from being grabbed
102  /// by the application/widget containing pepper plugin calling this method.
103  ///
104  /// <strong>Note:</strong>
105  /// For some embedders, we can`t tell if key that we try to unregister have
106  /// failed because it have been already unregistered. So if at least one key
107  /// have been successfully processed, we assume that other keys that failed,
108  /// have been already unregistered before this call.
109  ///
110  /// @param[in] keys A vector containing list of keys which should be grabbed.
111  ///
112  /// @return An int32_t containing an error code from <code>pp_errors.h</code>.
113  /// Returns <code>PP_ERROR_BADARGUMENT</code> if <code>key_count</code> is
114  /// equal 0 or one of <code>keys</code> is not supported anymore.
115  /// Returns <code>PP_ERROR_NOTSUPPORTED</code> if currently launched embedder
116  /// doesn`t support key registering.
117  /// Returns <code>PP_ERROR_FAILED</code> if registering all <code>keys</code>
118  /// have failed.
119  /// Returns <code>PP_OK</code> if at lest one key from <code>keys</code> have
120  /// been registered.
121  int32_t UnRegisterKeys(const std::vector<std::string>& keys);
122 
123  private:
124  InstanceHandle instance_;
125 };
126 
127 } // namespace pp
128 
129 #endif // PPAPI_CPP_SAMSUNG_REMOTE_CONTROLLER_SAMSUNG_H_
RemoteControllerSamsung(const InstanceHandle &instance)
int32_t UnRegisterKeys(uint32_t key_count, const char *keys[])
int32_t RegisterKeys(uint32_t key_count, const char *keys[])