From a1e2fec59eb7d0d2a3adbd4691b3ea2ee1302921 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 6 Jul 2009 19:46:35 +0200 Subject: API cleanup for NotificationProxy Signed-off-by: Martin Szulecki --- include/libiphone/notification_proxy.h | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/libiphone/notification_proxy.h (limited to 'include/libiphone/notification_proxy.h') 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 @@ +#ifndef NOTIFICATION_PROXY_H +#define NOTIFICATION_PROXY_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct np_client_int; +typedef struct np_client_int *np_client_t; + +// NotificationProxy related +// notifications for use with post_notification (client --> device) +#define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" +#define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" +#define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" + +// notifications for use with observe_notification (device --> client) +#define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" +#define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" +#define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" +#define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed" +#define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed" +#define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation" +#define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed" +#define NP_APP_INSTALLED "com.apple.mobile.application_installed" +#define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" + +iphone_error_t np_new_client ( iphone_device_t device, int dst_port, np_client_t *client ); +iphone_error_t np_free_client ( np_client_t client ); + +iphone_error_t np_post_notification ( np_client_t client, const char *notification ); + +iphone_error_t np_observe_notification ( np_client_t client, const char *notification ); +iphone_error_t np_observe_notifications ( np_client_t client, const char **notification_spec ); + +typedef void (*np_notify_cb_t) ( const char *notification ); + +iphone_error_t np_set_notify_callback ( np_client_t client, np_notify_cb_t notify_cb ); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.1-32-gdbae From 4c81f3c622d80a9291f3c13de2075afd753a0e1c Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 14:56:24 +0200 Subject: Add missing copyright to afc and notification_proxy headers --- include/libiphone/notification_proxy.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/libiphone/notification_proxy.h') diff --git a/include/libiphone/notification_proxy.h b/include/libiphone/notification_proxy.h index 9412b4f..8efb483 100644 --- a/include/libiphone/notification_proxy.h +++ b/include/libiphone/notification_proxy.h @@ -1,3 +1,23 @@ +/* + * notification_proxy.h + * + * Copyright (c) 2009 Nikias Bassen All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + #ifndef NOTIFICATION_PROXY_H #define NOTIFICATION_PROXY_H -- cgit v1.1-32-gdbae From f995c63e1bc56dd2d098a06f130d55334979f38f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 24 Jul 2009 16:35:28 +0200 Subject: Add new NP_ITDBPREP_DID_END notification signaling music db refresh --- include/libiphone/notification_proxy.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libiphone/notification_proxy.h') diff --git a/include/libiphone/notification_proxy.h b/include/libiphone/notification_proxy.h index 8efb483..14d1b39 100644 --- a/include/libiphone/notification_proxy.h +++ b/include/libiphone/notification_proxy.h @@ -46,6 +46,7 @@ typedef struct np_client_int *np_client_t; #define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed" #define NP_APP_INSTALLED "com.apple.mobile.application_installed" #define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" +#define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd" iphone_error_t np_new_client ( iphone_device_t device, int dst_port, np_client_t *client ); iphone_error_t np_free_client ( np_client_t client ); -- cgit v1.1-32-gdbae From d11abfb48218a37d9c66831ebec8b0a736d5385f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 02:20:03 +0200 Subject: Update NotificationProxy API and introduce new error codes --- include/libiphone/notification_proxy.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'include/libiphone/notification_proxy.h') 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" { #include -struct np_client_int; -typedef struct np_client_int *np_client_t; +/* Error Codes */ +#define NP_E_SUCCESS 0 +#define NP_E_INVALID_ARG -1 +#define NP_E_PLIST_ERROR -2 + +#define NP_E_UNKNOWN_ERROR -256 + +typedef int16_t np_error_t; -// NotificationProxy related -// notifications for use with post_notification (client --> device) +/* Notification IDs for use with post_notification (client --> device) */ #define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" #define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" #define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" -// notifications for use with observe_notification (device --> client) +/* Notification IDs for use with observe_notification (device --> client) */ #define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" #define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" #define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" @@ -48,17 +53,18 @@ typedef struct np_client_int *np_client_t; #define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" #define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd" -iphone_error_t np_new_client ( iphone_device_t device, int dst_port, np_client_t *client ); -iphone_error_t np_free_client ( np_client_t client ); - -iphone_error_t np_post_notification ( np_client_t client, const char *notification ); - -iphone_error_t np_observe_notification ( np_client_t client, const char *notification ); -iphone_error_t np_observe_notifications ( np_client_t client, const char **notification_spec ); +struct np_client_int; +typedef struct np_client_int *np_client_t; -typedef void (*np_notify_cb_t) ( const char *notification ); +typedef void (*np_notify_cb_t) (const char *notification); -iphone_error_t np_set_notify_callback ( np_client_t client, np_notify_cb_t notify_cb ); +/* Interface */ +np_error_t np_client_new(iphone_device_t device, int dst_port, np_client_t *client); +np_error_t np_client_free(np_client_t client); +np_error_t np_post_notification(np_client_t client, const char *notification); +np_error_t np_observe_notification(np_client_t client, const char *notification); +np_error_t np_observe_notifications(np_client_t client, const char **notification_spec); +np_error_t np_set_notify_callback(np_client_t client, np_notify_cb_t notify_cb); #ifdef __cplusplus } -- cgit v1.1-32-gdbae From da94f0ebc7232e8e9d0e629fe559b7bc93d9a1c6 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sat, 25 Jul 2009 18:12:49 +0200 Subject: Update doxygen config and allow generation of documentation --- include/libiphone/notification_proxy.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/libiphone/notification_proxy.h') diff --git a/include/libiphone/notification_proxy.h b/include/libiphone/notification_proxy.h index 520ccd1..66b7a80 100644 --- a/include/libiphone/notification_proxy.h +++ b/include/libiphone/notification_proxy.h @@ -1,5 +1,7 @@ -/* - * notification_proxy.h +/** + * @file libiphone/notification_proxy.h + * @brief Implementation to talk to the notification proxy on a device + * \internal * * Copyright (c) 2009 Nikias Bassen All Rights Reserved. * -- cgit v1.1-32-gdbae