summaryrefslogtreecommitdiffstats
path: root/include/libiphone
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-07-06 19:46:35 +0200
committerGravatar Matt Colyer2009-07-18 10:39:42 -0700
commitab8e29dafc0577203e6867329b1d3ff9095a4fb2 (patch)
treeb8b19f763cc83b0a0449b16ec4ddc626ce66a136 /include/libiphone
parent4105af17e9f2df5405afa6a74a02a304ed6bacff (diff)
downloadlibimobiledevice-ab8e29dafc0577203e6867329b1d3ff9095a4fb2.tar.gz
libimobiledevice-ab8e29dafc0577203e6867329b1d3ff9095a4fb2.tar.bz2
API cleanup for NotificationProxy
Diffstat (limited to 'include/libiphone')
-rw-r--r--include/libiphone/libiphone.h33
-rw-r--r--include/libiphone/notification_proxy.h46
2 files changed, 46 insertions, 33 deletions
diff --git a/include/libiphone/libiphone.h b/include/libiphone/libiphone.h
index 3f5d86c..456f000 100644
--- a/include/libiphone/libiphone.h
+++ b/include/libiphone/libiphone.h
@@ -63,9 +63,6 @@ typedef struct iphone_lckd_client_int *iphone_lckd_client_t;
63struct iphone_msync_client_int; 63struct iphone_msync_client_int;
64typedef struct iphone_msync_client_int *iphone_msync_client_t; 64typedef struct iphone_msync_client_int *iphone_msync_client_t;
65 65
66struct iphone_np_client_int;
67typedef struct iphone_np_client_int *iphone_np_client_t;
68
69//debug related functions 66//debug related functions
70#define DBGMASK_ALL 0xFFFF 67#define DBGMASK_ALL 0xFFFF
71#define DBGMASK_NONE 0x0000 68#define DBGMASK_NONE 0x0000
@@ -102,36 +99,6 @@ iphone_error_t iphone_msync_free_client(iphone_msync_client_t client);
102iphone_error_t iphone_msync_recv(iphone_msync_client_t client, plist_t * plist); 99iphone_error_t iphone_msync_recv(iphone_msync_client_t client, plist_t * plist);
103iphone_error_t iphone_msync_send(iphone_msync_client_t client, plist_t plist); 100iphone_error_t iphone_msync_send(iphone_msync_client_t client, plist_t plist);
104 101
105// NotificationProxy related
106// notifications for use with post_notification (client --> device)
107#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart"
108#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart"
109#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish"
110
111// notifications for use with observe_notification (device --> client)
112#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest"
113#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest"
114#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest"
115#define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed"
116#define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed"
117#define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation"
118#define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed"
119#define NP_APP_INSTALLED "com.apple.mobile.application_installed"
120#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled"
121
122iphone_error_t iphone_np_new_client ( iphone_device_t device, int dst_port, iphone_np_client_t *client );
123iphone_error_t iphone_np_free_client ( iphone_np_client_t client );
124
125iphone_error_t iphone_np_post_notification ( iphone_np_client_t client, const char *notification );
126
127iphone_error_t iphone_np_observe_notification ( iphone_np_client_t client, const char *notification );
128iphone_error_t iphone_np_observe_notifications ( iphone_np_client_t client, const char **notification_spec );
129iphone_error_t iphone_np_get_notification ( iphone_np_client_t client, char **notification );
130
131typedef void (*iphone_np_notify_cb_t) ( const char *notification );
132
133iphone_error_t iphone_np_set_notify_callback ( iphone_np_client_t client, iphone_np_notify_cb_t notify_cb );
134
135#ifdef __cplusplus 102#ifdef __cplusplus
136} 103}
137#endif 104#endif
diff --git a/include/libiphone/notification_proxy.h b/include/libiphone/notification_proxy.h
new file mode 100644
index 0000000..9412b4f
--- /dev/null
+++ b/include/libiphone/notification_proxy.h
@@ -0,0 +1,46 @@
1#ifndef NOTIFICATION_PROXY_H
2#define NOTIFICATION_PROXY_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <libiphone/libiphone.h>
9
10struct np_client_int;
11typedef struct np_client_int *np_client_t;
12
13// NotificationProxy related
14// notifications for use with post_notification (client --> device)
15#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart"
16#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart"
17#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish"
18
19// notifications for use with observe_notification (device --> client)
20#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest"
21#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest"
22#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest"
23#define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed"
24#define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed"
25#define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation"
26#define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed"
27#define NP_APP_INSTALLED "com.apple.mobile.application_installed"
28#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled"
29
30iphone_error_t np_new_client ( iphone_device_t device, int dst_port, np_client_t *client );
31iphone_error_t np_free_client ( np_client_t client );
32
33iphone_error_t np_post_notification ( np_client_t client, const char *notification );
34
35iphone_error_t np_observe_notification ( np_client_t client, const char *notification );
36iphone_error_t np_observe_notifications ( np_client_t client, const char **notification_spec );
37
38typedef void (*np_notify_cb_t) ( const char *notification );
39
40iphone_error_t np_set_notify_callback ( np_client_t client, np_notify_cb_t notify_cb );
41
42#ifdef __cplusplus
43}
44#endif
45
46#endif