diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/libiphone/notification_proxy.h | 34 |
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 | ||
| 30 | struct np_client_int; | 30 | /* Error Codes */ |
| 31 | typedef 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 | |||
| 37 | typedef 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 | ||
| 51 | iphone_error_t np_new_client ( iphone_device_t device, int dst_port, np_client_t *client ); | 56 | struct np_client_int; |
| 52 | iphone_error_t np_free_client ( np_client_t client ); | 57 | typedef struct np_client_int *np_client_t; |
| 53 | |||
| 54 | iphone_error_t np_post_notification ( np_client_t client, const char *notification ); | ||
| 55 | |||
| 56 | iphone_error_t np_observe_notification ( np_client_t client, const char *notification ); | ||
| 57 | iphone_error_t np_observe_notifications ( np_client_t client, const char **notification_spec ); | ||
| 58 | 58 | ||
| 59 | typedef void (*np_notify_cb_t) ( const char *notification ); | 59 | typedef void (*np_notify_cb_t) (const char *notification); |
| 60 | 60 | ||
| 61 | iphone_error_t np_set_notify_callback ( np_client_t client, np_notify_cb_t notify_cb ); | 61 | /* Interface */ |
| 62 | np_error_t np_client_new(iphone_device_t device, int dst_port, np_client_t *client); | ||
| 63 | np_error_t np_client_free(np_client_t client); | ||
| 64 | np_error_t np_post_notification(np_client_t client, const char *notification); | ||
| 65 | np_error_t np_observe_notification(np_client_t client, const char *notification); | ||
| 66 | np_error_t np_observe_notifications(np_client_t client, const char **notification_spec); | ||
| 67 | np_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 | } |
