OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2013 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 dev/ppb_var_dictionary_dev.idl modified Sun Mar 03 13:15:51 2013. */ |
| 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_VAR_DICTIONARY_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_VAR_DICTIONARY_DEV_H_ |
| 10 |
| 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_stdint.h" |
| 14 #include "ppapi/c/pp_var.h" |
| 15 |
| 16 #define PPB_VAR_DICTIONARY_DEV_INTERFACE_0_1 "PPB_VarDictionary(Dev);0.1" |
| 17 #define PPB_VAR_DICTIONARY_DEV_INTERFACE PPB_VAR_DICTIONARY_DEV_INTERFACE_0_1 |
| 18 |
| 19 /** |
| 20 * @file |
| 21 * This file defines the <code>PPB_VarDictionary_Dev</code> struct providing |
| 22 * a way to interact with dictionary vars. |
| 23 */ |
| 24 |
| 25 |
| 26 /** |
| 27 * @addtogroup Interfaces |
| 28 * @{ |
| 29 */ |
| 30 struct PPB_VarDictionary_Dev_0_1 { |
| 31 /** |
| 32 * Creates a dictionary var, i.e., a <code>PP_Var</code> with type set to |
| 33 * <code>PP_VARTYPE_DICTIONARY</code>. |
| 34 * |
| 35 * @return An empty dictionary var, whose reference count is set to 1 on |
| 36 * behalf of the caller. |
| 37 */ |
| 38 struct PP_Var (*Create)(void); |
| 39 /** |
| 40 * Gets the value associated with the specified key. |
| 41 * |
| 42 * @param[in] dict A dictionary var. |
| 43 * @param[in] key A string var. |
| 44 * |
| 45 * @return The value that is associated with <code>key</code>. The reference |
| 46 * count is incremented on behalf of the caller. If <code>key</code> is not a |
| 47 * string var, or it doesn't exist in <code>dict</code>, an undefined var is |
| 48 * returned. |
| 49 */ |
| 50 struct PP_Var (*Get)(struct PP_Var dict, struct PP_Var key); |
| 51 /** |
| 52 * Sets the value associated with the specified key. |
| 53 * |
| 54 * @param[in] dict A dictionary var. |
| 55 * @param[in] key A string var. If this key hasn't existed in |
| 56 * <code>dict</code>, it is added and associated with <code>value</code>; |
| 57 * otherwise, the previous value is replaced with <code>value</code>. |
| 58 * @param[in] value The value to set. |
| 59 * |
| 60 * @return A <code>PP_Bool</code> indicating whether the operation succeeds. |
| 61 */ |
| 62 PP_Bool (*Set)(struct PP_Var dict, struct PP_Var key, struct PP_Var value); |
| 63 /** |
| 64 * Deletes the specified key and its associated value, if the key exists. |
| 65 * |
| 66 * @param[in] dict A dictionary var. |
| 67 * @param[in] key A string var. |
| 68 */ |
| 69 void (*Delete)(struct PP_Var dict, struct PP_Var key); |
| 70 /** |
| 71 * Checks whether a key exists. |
| 72 * |
| 73 * @param[in] dict A dictionary var. |
| 74 * @param[in] key A string var. |
| 75 * |
| 76 * @return A <code>PP_Bool</code> indicating whether the key exists. |
| 77 */ |
| 78 PP_Bool (*HasKey)(struct PP_Var dict, struct PP_Var key); |
| 79 /** |
| 80 * Gets all the keys in a dictionary. |
| 81 * |
| 82 * @param[in] dict A dictionary var. |
| 83 * |
| 84 * @return An array var which contains all the keys of <code>dict</code>. Its |
| 85 * reference count is incremented on behalf of the caller. The elements are |
| 86 * string vars. Returns a null var if failed. |
| 87 */ |
| 88 struct PP_Var (*GetKeys)(struct PP_Var dict); |
| 89 }; |
| 90 |
| 91 typedef struct PPB_VarDictionary_Dev_0_1 PPB_VarDictionary_Dev; |
| 92 /** |
| 93 * @} |
| 94 */ |
| 95 |
| 96 #endif /* PPAPI_C_DEV_PPB_VAR_DICTIONARY_DEV_H_ */ |
| 97 |
OLD | NEW |