summaryrefslogtreecommitdiffstats
path: root/include/libimobiledevice/sbservices.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libimobiledevice/sbservices.h')
-rw-r--r--include/libimobiledevice/sbservices.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/include/libimobiledevice/sbservices.h b/include/libimobiledevice/sbservices.h
index f9d131b..f0bf2c4 100644
--- a/include/libimobiledevice/sbservices.h
+++ b/include/libimobiledevice/sbservices.h
@@ -60,14 +60,116 @@ typedef struct sbservices_client_private sbservices_client_private;
60typedef sbservices_client_private *sbservices_client_t; /**< The client handle. */ 60typedef sbservices_client_private *sbservices_client_t; /**< The client handle. */
61 61
62/* Interface */ 62/* Interface */
63
64/**
65 * Connects to the springboardservices service on the specified device.
66 *
67 * @param device The device to connect to.
68 * @param service The service descriptor returned by lockdownd_start_service.
69 * @param client Pointer that will point to a newly allocated
70 * sbservices_client_t upon successful return.
71 *
72 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
73 * client is NULL, or an SBSERVICES_E_* error code otherwise.
74 */
63sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t service, sbservices_client_t *client); 75sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t service, sbservices_client_t *client);
76
77/**
78 * Starts a new sbservices service on the specified device and connects to it.
79 *
80 * @param device The device to connect to.
81 * @param client Pointer that will point to a newly allocated
82 * sbservices_client_t upon successful return. Must be freed using
83 * sbservices_client_free() after use.
84 * @param label The label to use for communication. Usually the program name.
85 * Pass NULL to disable sending the label in requests to lockdownd.
86 *
87 * @return SBSERVICES_E_SUCCESS on success, or an SBSERVICES_E_* error
88 * code otherwise.
89 */
64sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t* client, const char* label); 90sbservices_error_t sbservices_client_start_service(idevice_t device, sbservices_client_t* client, const char* label);
91
92/**
93 * Disconnects an sbservices client from the device and frees up the
94 * sbservices client data.
95 *
96 * @param client The sbservices client to disconnect and free.
97 *
98 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
99 * client is NULL, or an SBSERVICES_E_* error code otherwise.
100 */
65sbservices_error_t sbservices_client_free(sbservices_client_t client); 101sbservices_error_t sbservices_client_free(sbservices_client_t client);
66 102
103
104/**
105 * Gets the icon state of the connected device.
106 *
107 * @param client The connected sbservices client to use.
108 * @param state Pointer that will point to a newly allocated plist containing
109 * the current icon state. It is up to the caller to free the memory.
110 * @param format_version A string to be passed as formatVersion along with
111 * the request, or NULL if no formatVersion should be passed. This is only
112 * supported since iOS 4.0 so for older firmware versions this must be set
113 * to NULL.
114 *
115 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
116 * client or state is invalid, or an SBSERVICES_E_* error code otherwise.
117 */
67sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version); 118sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist_t *state, const char *format_version);
119
120/**
121 * Sets the icon state of the connected device.
122 *
123 * @param client The connected sbservices client to use.
124 * @param newstate A plist containing the new iconstate.
125 *
126 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
127 * client or newstate is NULL, or an SBSERVICES_E_* error code otherwise.
128 */
68sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate); 129sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist_t newstate);
130
131/**
132 * Get the icon of the specified app as PNG data.
133 *
134 * @param client The connected sbservices client to use.
135 * @param bundleId The bundle identifier of the app to retrieve the icon for.
136 * @param pngdata Pointer that will point to a newly allocated buffer
137 * containing the PNG data upon successful return. It is up to the caller
138 * to free the memory.
139 * @param pngsize Pointer to a uint64_t that will be set to the size of the
140 * buffer pngdata points to upon successful return.
141 *
142 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
143 * client, bundleId, or pngdata are invalid, or an SBSERVICES_E_* error
144 * code otherwise.
145 */
69sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize); 146sbservices_error_t sbservices_get_icon_pngdata(sbservices_client_t client, const char *bundleId, char **pngdata, uint64_t *pngsize);
147
148/**
149 * Gets the interface orientation of the device.
150 *
151 * @param client The connected sbservices client to use.
152 * @param interface_orientation The interface orientation upon successful return.
153 *
154 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
155 * client or state is invalid, or an SBSERVICES_E_* error code otherwise.
156 */
70sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t client, sbservices_interface_orientation_t* interface_orientation); 157sbservices_error_t sbservices_get_interface_orientation(sbservices_client_t client, sbservices_interface_orientation_t* interface_orientation);
158
159/**
160 * Get the home screen wallpaper as PNG data.
161 *
162 * @param client The connected sbservices client to use.
163 * @param pngdata Pointer that will point to a newly allocated buffer
164 * containing the PNG data upon successful return. It is up to the caller
165 * to free the memory.
166 * @param pngsize Pointer to a uint64_t that will be set to the size of the
167 * buffer pngdata points to upon successful return.
168 *
169 * @return SBSERVICES_E_SUCCESS on success, SBSERVICES_E_INVALID_ARG when
170 * client or pngdata are invalid, or an SBSERVICES_E_* error
171 * code otherwise.
172 */
71sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize); 173sbservices_error_t sbservices_get_home_screen_wallpaper_pngdata(sbservices_client_t client, char **pngdata, uint64_t *pngsize);
72 174
73#ifdef __cplusplus 175#ifdef __cplusplus