diff options
Diffstat (limited to 'include/libimobiledevice/notification_proxy.h')
| -rw-r--r-- | include/libimobiledevice/notification_proxy.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/include/libimobiledevice/notification_proxy.h b/include/libimobiledevice/notification_proxy.h new file mode 100644 index 0000000..adbb4cc --- /dev/null +++ b/include/libimobiledevice/notification_proxy.h | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | /** | ||
| 2 | * @file libimobiledevice/notification_proxy.h | ||
| 3 | * @brief Implementation to talk to the notification proxy on a device | ||
| 4 | * \internal | ||
| 5 | * | ||
| 6 | * Copyright (c) 2009 Nikias Bassen All Rights Reserved. | ||
| 7 | * | ||
| 8 | * This library is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU Lesser General Public | ||
| 10 | * License as published by the Free Software Foundation; either | ||
| 11 | * version 2.1 of the License, or (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This library is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * Lesser General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU Lesser General Public | ||
| 19 | * License along with this library; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef NOTIFICATION_PROXY_H | ||
| 24 | #define NOTIFICATION_PROXY_H | ||
| 25 | |||
| 26 | #ifdef __cplusplus | ||
| 27 | extern "C" { | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #include <libimobiledevice/libimobiledevice.h> | ||
| 31 | |||
| 32 | /* Error Codes */ | ||
| 33 | #define NP_E_SUCCESS 0 | ||
| 34 | #define NP_E_INVALID_ARG -1 | ||
| 35 | #define NP_E_PLIST_ERROR -2 | ||
| 36 | #define NP_E_CONN_FAILED -3 | ||
| 37 | |||
| 38 | #define NP_E_UNKNOWN_ERROR -256 | ||
| 39 | |||
| 40 | typedef int16_t np_error_t; | ||
| 41 | |||
| 42 | /* Notification IDs for use with post_notification (client --> device) */ | ||
| 43 | #define NP_SYNC_WILL_START "com.apple.itunes-mobdev.syncWillStart" | ||
| 44 | #define NP_SYNC_DID_START "com.apple.itunes-mobdev.syncDidStart" | ||
| 45 | #define NP_SYNC_DID_FINISH "com.apple.itunes-mobdev.syncDidFinish" | ||
| 46 | #define NP_SYNC_LOCK_REQUEST "com.apple.itunes-mobdev.syncLockRequest" | ||
| 47 | |||
| 48 | /* Notification IDs for use with observe_notification (device --> client) */ | ||
| 49 | #define NP_SYNC_CANCEL_REQUEST "com.apple.itunes-client.syncCancelRequest" | ||
| 50 | #define NP_SYNC_SUSPEND_REQUEST "com.apple.itunes-client.syncSuspendRequest" | ||
| 51 | #define NP_SYNC_RESUME_REQUEST "com.apple.itunes-client.syncResumeRequest" | ||
| 52 | #define NP_PHONE_NUMBER_CHANGED "com.apple.mobile.lockdown.phone_number_changed" | ||
| 53 | #define NP_DEVICE_NAME_CHANGED "com.apple.mobile.lockdown.device_name_changed" | ||
| 54 | #define NP_TIMEZONE_CHANGED "com.apple.mobile.lockdown.timezone_changed" | ||
| 55 | #define NP_TRUSTED_HOST_ATTACHED "com.apple.mobile.lockdown.trusted_host_attached" | ||
| 56 | #define NP_HOST_DETACHED "com.apple.mobile.lockdown.host_detached" | ||
| 57 | #define NP_HOST_ATTACHED "com.apple.mobile.lockdown.host_attached" | ||
| 58 | #define NP_REGISTRATION_FAILED "com.apple.mobile.lockdown.registration_failed" | ||
| 59 | #define NP_ACTIVATION_STATE "com.apple.mobile.lockdown.activation_state" | ||
| 60 | #define NP_BRICK_STATE "com.apple.mobile.lockdown.brick_state" | ||
| 61 | #define NP_DS_DOMAIN_CHANGED "com.apple.mobile.data_sync.domain_changed" | ||
| 62 | #define NP_BACKUP_DOMAIN_CHANGED "com.apple.mobile.backup.domain_changed" | ||
| 63 | #define NP_APP_INSTALLED "com.apple.mobile.application_installed" | ||
| 64 | #define NP_APP_UNINSTALLED "com.apple.mobile.application_uninstalled" | ||
| 65 | #define NP_DEV_IMAGE_MOUNTED "com.apple.mobile.developer_image_mounted" | ||
| 66 | #define NP_ATTEMPTACTIVATION "com.apple.springboard.attemptactivation" | ||
| 67 | #define NP_ITDBPREP_DID_END "com.apple.itdbprep.notification.didEnd" | ||
| 68 | #define NP_LANGUAGE_CHANGED "com.apple.language.changed" | ||
| 69 | #define NP_ADDRESS_BOOK_PREF_CHANGED "com.apple.AddressBook.PreferenceChanged" | ||
| 70 | |||
| 71 | struct np_client_int; | ||
| 72 | typedef struct np_client_int *np_client_t; | ||
| 73 | |||
| 74 | typedef void (*np_notify_cb_t) (const char *notification); | ||
| 75 | |||
| 76 | /* Interface */ | ||
| 77 | np_error_t np_client_new(idevice_t device, uint16_t port, np_client_t *client); | ||
| 78 | np_error_t np_client_free(np_client_t client); | ||
| 79 | np_error_t np_post_notification(np_client_t client, const char *notification); | ||
| 80 | np_error_t np_observe_notification(np_client_t client, const char *notification); | ||
| 81 | np_error_t np_observe_notifications(np_client_t client, const char **notification_spec); | ||
| 82 | np_error_t np_set_notify_callback(np_client_t client, np_notify_cb_t notify_cb); | ||
| 83 | |||
| 84 | #ifdef __cplusplus | ||
| 85 | } | ||
| 86 | #endif | ||
| 87 | |||
| 88 | #endif | ||
