Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

notifymgr.h

Go to the documentation of this file.
00001 /********************************************************************
00002 
00003 Copyright 2006, ACCESS Systems Americas, Inc. All rights reserved.
00004 
00005 The contents of this file are subject to the Mozilla Public License Version
00006 1.1 (the "License"); you may not use this file except in compliance with
00007 the License. You may obtain a copy of the License at
00008 http://www.mozilla.org/MPL/
00009 
00010 Software distributed under the License is distributed on an "AS IS" basis,
00011 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012 for the specific language governing rights and limitations under the
00013 License.
00014 
00015 The Original Code is the entire contents of this file.
00016 
00017 The Initial Developer of the Original Code is ACCESS Systems Americas, Inc.
00018 
00019 Portions created by ACCESS Systems Americas, Inc. are Copyright © 2006. All
00020 Rights Reserved.
00021 
00022 Contributor(s): none.
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 // notification types
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 // maximum sizes
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 // argv parameters when receiving a notification
00078 // -----------------------------------------------------------------------------
00079 
00081 #define ALP_NOTIFY_LAUNCH_DETAILS               "--alp-notify-details="
00082 
00084 #define ALP_NOTIFY_LAUNCH_TYPE                  "--alp-notify-type="
00085 
00086 // -----------------------------------------------------------------------------
00087 // register priority and flags
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 // broadcast queues and flags
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 // callback return values
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 // error codes
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 // data structures
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 // functions
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 }       // extern "C"
00358 #endif
00359 
00360 #endif

Generated on Sat Dec 16 20:29:47 2006 for hiker-0.9 by  doxygen 1.4.4