Pepper_31_C_interfaces
ppb_removable_storage_dev.h
Go to the documentation of this file.
1 /* Copyright (c) 2013 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From dev/ppb_removable_storage_dev.idl modified Fri Jan 3 07:37:36 2014. */
5 
6 #ifndef PPAPI_C_DEV_PPB_REMOVABLE_STORAGE_DEV_H_
7 #define PPAPI_C_DEV_PPB_REMOVABLE_STORAGE_DEV_H_
8 
9 #include "ppapi/c/dev/ppb_device_ref_dev.h"
10 #include "ppapi/c/pp_array_output.h"
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h"
17 
18 #define PPB_REMOVABLESTORAGE_DEV_INTERFACE_0_1 "PPB_RemovableStorage(Dev);0.1"
19 #define PPB_REMOVABLESTORAGE_DEV_INTERFACE \
20  PPB_REMOVABLESTORAGE_DEV_INTERFACE_0_1
21 
22 /**
23  * @file
24  * This file defines the <code>PPB_RemovableStorage_Dev</code> interface, which
25  * enumarates the removable storage devices and notifies about their change.
26  */
27 
28 
29 /**
30  * @addtogroup Interfaces
31  * @{
32  */
33 /**
34  * The <code>PPB_RemovableStorage_Dev</code> interface enumarates the removable
35  * storage devices and notifies about their change.
36  */
38  /**
39  * Creates a removable storage resource.
40  *
41  * @param[in] instance A <code>PP_Instance</code> identifying one instance of
42  * a module.
43  *
44  * @return A <code>PP_Resource</code> corresponding to a removable storage
45  * resource if successful, 0 if failed.
46  */
48  /**
49  * Determines if the given resource is a removable storage resource.
50  *
51  * @param[in] resource A <code>PP_Resource</code> containing a resource.
52  *
53  * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if the given
54  * resource is a removable storage resource, otherwise <code>PP_FALSE</code>.
55  */
57  /**
58  * Enumerates removable storage devices.
59  *
60  * @param[in] removable_storage A <code>PP_Resource</code> corresponding to
61  * a removable storage resource.
62  * @param[in] output An output array which will receive
63  * <code>PPB_RemovableStorageDeviceRef</code> resources on success. Please
64  * note that the ref count of those resources has already been increased by
65  * 1 for the caller.
66  * @param[in] callback A <code>PP_CompletionCallback</code> to run on
67  * completion.
68  *
69  * @return An error code from <code>pp_errors.h</code>.
70  */
71  int32_t (*EnumerateDevices)(PP_Resource removable_storage,
72  struct PP_ArrayOutput output,
73  struct PP_CompletionCallback callback);
74  /**
75  * Requests device change notifications.
76  *
77  * @param[in] removable_storage A <code>PP_Resource</code> corresponding to
78  * a removable storage resource.
79  * @param[in] callback The callback to receive notifications. If not NULL, it
80  * will be called once for the currently available devices, and then every
81  * time the list of available devices changes. All calls will happen on the
82  * same thread as the one on which MonitorDeviceChange() is called. It will
83  * receive notifications until <code>removable_storage</code> is destroyed or
84  * <code>MonitorDeviceChange()</code> is called to set a new callback for
85  * <code>removable_storage</code>. You can pass NULL to cancel sending
86  * notifications.
87  * @param[inout] user_data An opaque pointer that will be passed to
88  * <code>callback</code>.
89  *
90  * @return An error code from <code>pp_errors.h</code>.
91  */
92  int32_t (*MonitorDeviceChange)(PP_Resource removable_storage,
94  void* user_data);
95  /**
96  * Opens removable file system.
97  *
98  * @param[in] removable_storage A <code>PP_Resource</code> corresponding to
99  * a removable storage resource.
100  * @param[in] file_system A <code>PP_Resource</code> corresponding to a file
101  * system of PP_FILESYSTEMTYPE_REMOVABLESTORAGE type.
102  * @param[in] device_ref A <code>PP_Resource</code> corresponding to a device
103  * reference.
104  * @param[in] callback A <code>PP_CompletionCallback</code> to run on
105  * completion.
106  *
107  * @return An error code from <code>pp_errors.h</code>.
108  */
109  int32_t (*Open)(PP_Resource removable_storage,
110  PP_Resource file_system,
111  PP_Resource device_ref,
112  struct PP_CompletionCallback callback);
113 };
114 
116 /**
117  * @}
118  */
119 
120 #endif /* PPAPI_C_DEV_PPB_REMOVABLE_STORAGE_DEV_H_ */
121 
int32_t(* MonitorDeviceChange)(PP_Resource removable_storage, PP_MonitorDeviceChangeCallback callback, void *user_data)
PP_Resource(* Create)(PP_Instance instance)
int32_t PP_Resource
Definition: pp_resource.h:40
int32_t(* EnumerateDevices)(PP_Resource removable_storage, struct PP_ArrayOutput output, struct PP_CompletionCallback callback)
PP_Bool(* IsRemovableStorage)(PP_Resource resource)
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool
Definition: pp_bool.h:30
int32_t(* Open)(PP_Resource removable_storage, PP_Resource file_system, PP_Resource device_ref, struct PP_CompletionCallback callback)
void(* PP_MonitorDeviceChangeCallback)(void *user_data, uint32_t device_count, const PP_Resource devices[])