OLD | NEW |
| (Empty) |
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 | |
3 * found in the LICENSE file. | |
4 */ | |
5 | |
6 /* From private/ppb_network_monitor_private.idl, | |
7 * modified Thu Mar 28 10:30:11 2013. | |
8 */ | |
9 | |
10 #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ | |
11 #define PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ | |
12 | |
13 #include "ppapi/c/pp_bool.h" | |
14 #include "ppapi/c/pp_instance.h" | |
15 #include "ppapi/c/pp_macros.h" | |
16 #include "ppapi/c/pp_resource.h" | |
17 #include "ppapi/c/pp_stdint.h" | |
18 | |
19 #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 \ | |
20 "PPB_NetworkMonitor_Private;0.2" | |
21 #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE \ | |
22 PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 | |
23 | |
24 /** | |
25 * @file | |
26 * This file defines the <code>PPB_NetworkMonitor_Private</code> interface. | |
27 */ | |
28 | |
29 | |
30 /** | |
31 * @addtogroup Typedefs | |
32 * @{ | |
33 */ | |
34 /** | |
35 * <code>PPB_NetworkMonitor_Callback</code> is a callback function | |
36 * type that is used to receive notifications about network | |
37 * configuration changes. The <code>network_list</code> passed to this | |
38 * callback is a <code>PPB_NetworkList_Private</code> resource that | |
39 * contains current configuration of network interfaces. | |
40 */ | |
41 typedef void (*PPB_NetworkMonitor_Callback)(void* user_data, | |
42 PP_Resource network_list); | |
43 /** | |
44 * @} | |
45 */ | |
46 | |
47 /** | |
48 * @addtogroup Interfaces | |
49 * @{ | |
50 */ | |
51 /** | |
52 * The <code>PPB_NetworkMonitor_Private</code> provides access to | |
53 * notifications of network configuration changes. | |
54 */ | |
55 struct PPB_NetworkMonitor_Private_0_2 { | |
56 /** | |
57 * Starts network change monitoring. The specified | |
58 * <code>callback</code> will be called on the main thread once | |
59 * after this method is called (to supply the initial network | |
60 * configuration) and then later every time network configuration | |
61 * changes. Notifications are stopped when the returned resource is | |
62 * destroyed. If the plugin doesn't have access to the network list | |
63 * then the callback will be called once with the | |
64 * <code>network_list</code> parameter is set to 0. | |
65 * | |
66 * @param[in] callback The callback that will be called every time | |
67 * network configuration changes or NULL to stop network monitoring. | |
68 * | |
69 * @param[inout] user_data The data to be passed to the callback on | |
70 * each call. | |
71 * | |
72 * @return A <code>PP_Resource</code> containing the created | |
73 * NetworkMonitor resource. | |
74 */ | |
75 PP_Resource (*Create)(PP_Instance instance, | |
76 PPB_NetworkMonitor_Callback callback, | |
77 void* user_data); | |
78 /** | |
79 * Determines if the specified <code>resource</code> is a | |
80 * <code>NetworkMonitor</code> object. | |
81 * | |
82 * @param[in] resource A <code>PP_Resource</code> resource. | |
83 * | |
84 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is | |
85 * a <code>PPB_NetworkMonitor_Private</code>, <code>PP_FALSE</code> | |
86 * otherwise. | |
87 */ | |
88 PP_Bool (*IsNetworkMonitor)(PP_Resource resource); | |
89 }; | |
90 | |
91 typedef struct PPB_NetworkMonitor_Private_0_2 PPB_NetworkMonitor_Private; | |
92 /** | |
93 * @} | |
94 */ | |
95 | |
96 #endif /* PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ */ | |
97 | |
OLD | NEW |