/* Copyright (c) 2012 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* From ppb_network_monitor.idl modified Thu Sep 19 16:42:34 2013. */ #ifndef PPAPI_C_PPB_NETWORK_MONITOR_H_ #define PPAPI_C_PPB_NETWORK_MONITOR_H_ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" #define PPB_NETWORKMONITOR_INTERFACE_1_0 "PPB_NetworkMonitor;1.0" #define PPB_NETWORKMONITOR_INTERFACE PPB_NETWORKMONITOR_INTERFACE_1_0 /** * @file * This file defines the PPB_NetworkMonitor interface. */ /** * @addtogroup Interfaces * @{ */ /** * The PPB_NetworkMonitor allows to get network interfaces * configuration and monitor network configuration changes. * * Permissions: Apps permission socket with subrule * network-state is required for UpdateNetworkList(). * For more details about network communication permissions, please see: * http://developer.chrome.com/apps/app_network.html */ struct PPB_NetworkMonitor_1_0 { /** * Creates a Network Monitor resource. * * @param[in] instance A PP_Instance identifying one instance of * a module. * * @return A PP_Resource corresponding to a network monitor or 0 * on failure. */ PP_Resource (*Create)(PP_Instance instance); /** * Gets current network configuration. When called for the first time, * completes as soon as the current network configuration is received from * the browser. Each consequent call will wait for network list changes, * returning a new PPB_NetworkList resource every time. * * @param[in] network_monitor A PP_Resource corresponding to a * network monitor. * @param[out] network_list The PPB_NetworkList resource with the * current state of network interfaces. * @param[in] callback A PP_CompletionCallback to be called upon * completion. * * @return An int32_t containing an error code from pp_errors.h. * PP_ERROR_NOACCESS will be returned if the caller doesn't have * required permissions. */ int32_t (*UpdateNetworkList)(PP_Resource network_monitor, PP_Resource* network_list, struct PP_CompletionCallback callback); /** * Determines if the specified resource is a * NetworkMonitor object. * * @param[in] resource A PP_Resource resource. * * @return Returns PP_TRUE if resource is a * PPB_NetworkMonitor, PP_FALSE otherwise. */ PP_Bool (*IsNetworkMonitor)(PP_Resource resource); }; typedef struct PPB_NetworkMonitor_1_0 PPB_NetworkMonitor; /** * @} */ #endif /* PPAPI_C_PPB_NETWORK_MONITOR_H_ */