00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00034 #ifndef NOTIFY_MGR_H
00035 #define NOTIFY_MGR_H
00036
00037 #include <hiker/types.h>
00038 #include <hiker/sysclass.h>
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00050
00051
00052
00053
00055 #define ALP_NOTIFY_EVENT_NOTIFY_REGISTER "/alp/notify/register/"
00056
00058 #define ALP_NOTIFY_EVENT_NOTIFY_INSTALL "/alp/notify/install/"
00059
00061 #define ALP_NOTIFY_EVENT_NOTIFY_BOOT "/alp/notify/boot/"
00062
00063
00064
00065
00066
00068 #define ALP_NOTIFY_MAX_NOTIFY_SIZE 128
00069
00071 #define ALP_NOTIFY_MAX_DETAILS_SIZE 256
00072
00074 #define ALP_NOTIFY_MAX_APPID_SIZE 64
00075
00076
00077
00078
00079
00081 #define ALP_NOTIFY_LAUNCH_DETAILS "--alp-notify-details="
00082
00084 #define ALP_NOTIFY_LAUNCH_TYPE "--alp-notify-type="
00085
00086
00087
00088
00089
00091 #define ALP_NOTIFY_PRIORITY_HIGH 10
00092
00094 #define ALP_NOTIFY_PRIORITY_NORMAL 0
00095
00097 #define ALP_NOTIFY_PRIORITY_LOW -10
00098
00100 #define ALP_NOTIFY_REGISTER_FLAG_DONTSAVE 0x01
00101
00103 #define ALP_NOTIFY_REGISTER_FLAG_ONETIME 0x02
00104
00105
00106
00107
00108
00110 #define ALP_NOTIFY_QUEUE_DEFAULT 0x01
00111
00113 #define ALP_NOTIFY_QUEUE_STATUSGADGET 0x02
00114
00116 #define ALP_NOTIFY_BROADCAST_FLAG_IMMEDIATE 0x01
00117
00119 #define ALP_NOTIFY_BROADCAST_FLAG_SYNC 0x02
00120
00121
00122
00123
00124
00126 #define ALP_NOTIFY_CALLBACK_CONTINUE 0x00
00127
00129 #define ALP_NOTIFY_CALLBACK_CANCEL 0x01
00130
00132 #define ALP_NOTIFY_CALLBACK_COMPLETED_ALREADY 0x02
00133
00134
00135
00136
00137
00139 #define ALP_NOTIFY_ERR_OUT_OF_MEMORY (ALP_CLASS_NOTIFY | 0x00010000)
00140
00142 #define ALP_NOTIFY_ERR_INVALID_CALLBACK (ALP_CLASS_NOTIFY | 0x00020000)
00143
00145 #define ALP_NOTIFY_ERR_INVALID_APPID (ALP_CLASS_NOTIFY | 0x00030000)
00146
00148 #define ALP_NOTIFY_ERR_INVALID_QUEUE (ALP_CLASS_NOTIFY | 0x00040000)
00149
00151 #define ALP_NOTIFY_ERR_INVALID_PRIORITY (ALP_CLASS_NOTIFY | 0x00050000)
00152
00154 #define ALP_NOTIFY_ERR_INVALID_NOTIFYTYPE (ALP_CLASS_NOTIFY | 0x00060000)
00155
00157 #define ALP_NOTIFY_ERR_INVALID_LENGTH (ALP_CLASS_NOTIFY | 0x00070000)
00158
00160 #define ALP_NOTIFY_ERR_INVALID_CMD (ALP_CLASS_NOTIFY | 0x00080000)
00161
00163 #define ALP_NOTIFY_ERR_NOT_REGISTERED (ALP_CLASS_NOTIFY | 0x00090000)
00164
00166 #define ALP_NOTIFY_ERR_ALREADY_REGISTERED (ALP_CLASS_NOTIFY | 0x000a0000)
00167
00169 #define ALP_NOTIFY_ERR_TOO_MANY_REGISTRATIONS (ALP_CLASS_NOTIFY | 0x000b0000)
00170
00172 #define ALP_NOTIFY_ERR_TOO_MANY_BROADCASTS (ALP_CLASS_NOTIFY | 0x000c0000)
00173
00175 #define ALP_NOTIFY_ERR_ACTIVE_BROADCAST (ALP_CLASS_NOTIFY | 0x000d0000)
00176
00178 #define ALP_NOTIFY_ERR_IPC (ALP_CLASS_NOTIFY | 0x000e0000)
00179
00181 #define ALP_NOTIFY_ERR_TIMEOUT (ALP_CLASS_NOTIFY | 0x000f0000)
00182
00184 #define ALP_NOTIFY_ERR_PERMISSION_DENIED (ALP_CLASS_NOTIFY | 0x00100000)
00185
00186
00187
00188
00189
00192 typedef struct _AlpNotifyLaunch AlpNotifyLaunch;
00193 struct _AlpNotifyLaunch {
00194 int handled;
00195 int length;
00196 char details[ALP_NOTIFY_MAX_DETAILS_SIZE+1];
00197 char notifyType[ALP_NOTIFY_MAX_NOTIFY_SIZE+1];
00198 char appID[ALP_NOTIFY_MAX_APPID_SIZE+1];
00199 };
00200
00201
00202
00203
00204
00216 typedef int (AlpNotifyCallbackProc)(const char * notifyType, void * details, int length, int * handled, const char * appID, void * userData);
00217
00236 extern alp_status_t alp_notify_register_server(const char * notifyType, AlpNotifyCallbackProc * callbackProc, void *userData, int priority, int flags);
00237
00255 extern alp_status_t alp_notify_register(const char * appID, const char * notifyType, int priority, int flags);
00256
00270 extern alp_status_t alp_notify_unregister(const char * appID, const char * notifyType, int flags);
00271
00283 extern alp_status_t alp_notify_unregister_server(const char * notifyType, int flags);
00284
00306 extern alp_status_t alp_notify_broadcast(const char * appID, const char * notifyType, const void * details, int length, int queue, int flags);
00307
00330 extern alp_status_t alp_notify_broadcast_sync(const char * appID, const char * notifyType, const void * details, int length, int queue, int flags, int timeout, int * handled);
00331
00344 extern alp_status_t alp_notify_done(const char * appID, int handled, int status);
00345
00352 extern int alp_notify_details(const char * src, AlpNotifyLaunch * dst);
00353
00355
00356 #ifdef __cplusplus
00357 }
00358 #endif
00359
00360 #endif