Pepper_31_C_interfaces
ppb_sef_client_samsung.h
Go to the documentation of this file.
1 /**
2  * This file defines the <code>PPB_SefClient_Samsung</code> interface.
3  */
4 
5 /* From samsung/ppb_sef_client_samsung.idl modified Mon Nov 4 08:40:28 2013. */
6 
7 #ifndef PPAPI_C_SAMSUNG_PPB_SEF_CLIENT_SAMSUNG_H_
8 #define PPAPI_C_SAMSUNG_PPB_SEF_CLIENT_SAMSUNG_H_
9 
10 #include "ppapi/c/pp_bool.h"
11 #include "ppapi/c/pp_completion_callback.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h"
17 
18 #define PPB_SEFCLIENT_SAMSUNG_INTERFACE_0_1 "PPB_SefClient_Samsung;0.1"
19 #define PPB_SEFCLIENT_SAMSUNG_INTERFACE PPB_SEFCLIENT_SAMSUNG_INTERFACE_0_1
20 
21 /**
22  * @file
23  */
24 
25 
26 /**
27  * @addtogroup Typedefs
28  * @{
29  */
30 /**
31  * Defines the callback type to receive events from EMP.
32  *
33  * @param[inout] user_data The opaque pointer that the caller passed into
34  * <code>Open()</code>.
35  * @param[in] event_type A type of the event.
36  * @param[in] args_count How many arguments in the array.
37  * @param[in] args An array of <code>PP_Var</code>. Please note that
38  * the ref count of arguments is not increased on behalf of the plugin.
39  */
40 typedef void (*PPB_SefClient_Samsung_Callback)(void* user_data,
41  int32_t event_type,
42  uint32_t args_count,
43  const struct PP_Var args[]);
44 /**
45  * @}
46  */
47 
48 /**
49  * @addtogroup Interfaces
50  * @{
51  */
52 /**
53  * Interface used to communicate with EMP (External Module Process).
54  */
56  /**
57  * Create() creates Sef Client resource.
58  *
59  * @param[in] instance A <code>PP_Instance</code> identifying one instance
60  * of a module.
61  * @param[in] callback A <code>PPB_SefClient_Samsung_Callback</code>
62  * callback function that browser calls when EMP sends event to Sef Client.
63  * User can pass a null callback.
64  * @param[in] user_data A pointer to user data used in the callback function.
65  *
66  * @return A <code>PP_Resource</code containing the Sef Client resource if
67  * successful or 0 if resource cannot be created.
68  */
71  void* user_data);
72  /**
73  * IsSefClient() determines if the provided resource if a Sef Client
74  * resource.
75  *
76  * @param[in] resource A <code>PP_Resource</code corresponding to a generic
77  * resource.
78  *
79  * @return A <code>PP_Bool</code containing <code>PP_TRUE</code if given
80  * resource is a Sef Client resource, otherwise <code>PP_FALSE</code>.
81  */
83  /**
84  * Open() opens new EMP with given name, version and credential. It's possible
85  * to call Open() only once on given Sef Client resource.
86  *
87  * @param[in] sef_client A <code>PP_Resource</code> corresponding to a Sef
88  * Client resource.
89  * @param[in] name The name of the EMP.
90  * @param[in] version The version of the EMP.
91  * @param[in] credential The credential of the EMP.
92  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
93  * completion of Open().
94  *
95  * @return An int32_t containing an error code from <code>pp_errors.h</code>.
96  */
97  int32_t (*Open)(PP_Resource sef_client,
98  const char* name,
99  const char* version,
100  const char* credential,
101  struct PP_CompletionCallback callback);
102  /**
103  * Execute() executes given command on opened EMP.
104  *
105  *
106  * @param[in] sef_client A <code>PP_Resource</code> corresponding to a Sef
107  * Client resource.
108  * @param[in] params_count The number of parameters.
109  * @param[in] params An array of parameters.
110  * @param[in] result A pointer where will be stored result of executed
111  * command.
112  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
113  * completion of Execute().
114  *
115  * @return An int32_t containing an error code from <code>pp_errors.h</code>.
116  */
117  int32_t (*Execute)(PP_Resource sef_client,
118  uint32_t params_count,
119  const struct PP_Var params[],
120  struct PP_Var* result,
121  struct PP_CompletionCallback callback);
122 };
123 
125 /**
126  * @}
127  */
128 
129 #endif /* PPAPI_C_SAMSUNG_PPB_SEF_CLIENT_SAMSUNG_H_ */
130 
void(* PPB_SefClient_Samsung_Callback)(void *user_data, int32_t event_type, uint32_t args_count, const struct PP_Var args[])
PP_Resource(* Create)(PP_Instance instance, PPB_SefClient_Samsung_Callback callback, void *user_data)
PP_Bool(* IsSefClient)(PP_Resource resource)
int32_t PP_Resource
Definition: pp_resource.h:40
int32_t(* Open)(PP_Resource sef_client, const char *name, const char *version, const char *credential, struct PP_CompletionCallback callback)
int32_t(* Execute)(PP_Resource sef_client, uint32_t params_count, const struct PP_Var params[], struct PP_Var *result, struct PP_CompletionCallback callback)
Definition: pp_var.h:155
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool
Definition: pp_bool.h:30