summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libiphone/notification_proxy.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/include/libiphone/notification_proxy.h b/include/libiphone/notification_proxy.h
index 14d1b39..520ccd1 100644
--- a/include/libiphone/notification_proxy.h
+++ b/include/libiphone/notification_proxy.h
@@ -27,16 +27,21 @@ extern "C" {
27 27
28#include <libiphone/libiphone.h> 28#include <libiphone/libiphone.h>
29 29
30struct np_client_int; 30/* Error Codes */
31typedef struct np_client_int *np_client_t; 31#define NP_E_SUCCESS 0
32#define NP_E_INVALID_ARG -1
33#define NP_E_PLIST_ERROR -2
34
35#define NP_E_UNKNOWN_ERROR -256
36
37typedef int16_t np_error_t;
32 38
33// NotificationProxy related 39/* Notification IDs for use with post_notification (client --> device) */
34// notifications for use with post_notification (client --> device)
35#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" 40#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart"
36#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" 41#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart"
37#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" 42#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish"
38 43
39// notifications for use with observe_notification (device --> client) 44/* Notification IDs for use with observe_notification (device --> client) */
40#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" 45#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest"
41#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" 46#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest"
42#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" 47#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest"
@@ -48,17 +53,18 @@ typedef struct np_client_int *np_client_t;
48#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" 53#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled"
49#define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd" 54#define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd"
50 55
51iphone_error_t np_new_client ( iphone_device_t device, int dst_port, np_client_t *client ); 56struct np_client_int;
52iphone_error_t np_free_client ( np_client_t client ); 57typedef struct np_client_int *np_client_t;
53
54iphone_error_t np_post_notification ( np_client_t client, const char *notification );
55
56iphone_error_t np_observe_notification ( np_client_t client, const char *notification );
57iphone_error_t np_observe_notifications ( np_client_t client, const char **notification_spec );
58 58
59typedef void (*np_notify_cb_t) ( const char *notification ); 59typedef void (*np_notify_cb_t) (const char *notification);
60 60
61iphone_error_t np_set_notify_callback ( np_client_t client, np_notify_cb_t notify_cb ); 61/* Interface */
62np_error_t np_client_new(iphone_device_t device, int dst_port, np_client_t *client);
63np_error_t np_client_free(np_client_t client);
64np_error_t np_post_notification(np_client_t client, const char *notification);
65np_error_t np_observe_notification(np_client_t client, const char *notification);
66np_error_t np_observe_notifications(np_client_t client, const char **notification_spec);
67np_error_t np_set_notify_callback(np_client_t client, np_notify_cb_t notify_cb);
62 68
63#ifdef __cplusplus 69#ifdef __cplusplus
64} 70}