00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00029
00030 #ifndef _SML_NOTIFICATION_H_
00031 #define _SML_NOTIFICATION_H_
00032
00033 typedef enum {
00034 SML_SAN_VERSION_UNKNOWN = 0,
00035 SML_SAN_VERSION_10 = 1,
00036 SML_SAN_VERSION_11 = 2,
00037 SML_SAN_VERSION_12 = 3
00038 } SmlNotificationVersion;
00039
00040 typedef enum {
00041 SML_SAN_UIMODE_UNSPECIFIED = 0,
00042 SML_SAN_UIMODE_BACKGROUND = 1,
00043 SML_SAN_UIMODE_INFORMATIVE = 2,
00044 SML_SAN_UIMODE_USER = 3
00045 } SmlNotificationUIMode;
00046
00047 typedef enum {
00048 SML_SAN_INITIATOR_USER = 0,
00049 SML_SAN_INITIATOR_SERVER = 1
00050 } SmlNotificationInitiator;
00051
00052 SmlNotification *smlNotificationNew(SmlNotificationVersion version, SmlNotificationUIMode mode, SmlNotificationInitiator init, unsigned int sessionID, const char *identifier, const char *target, SmlMimeType type, SmlError **error);
00053 void smlNotificationSetCred(SmlNotification *san, SmlCred *cred);
00054 void smlNotificationSetManager(SmlNotification *san, SmlManager *manager);
00055 void smlNotificationFree(SmlNotification *san);
00056 SmlNotification *smlNotificationParse(const char *data, unsigned int size, SmlError **error);
00057 SmlBool smlNotificationAssemble(SmlNotification *san, char **data, unsigned int *size, SmlError **error);
00058 SmlBool smlNotificationSend(SmlNotification *san, SmlTransport *tsp, SmlError **error);
00059
00060 SmlBool smlNotificationNewAlert(SmlNotification *san, SmlAlertType type, const char *contenttype, const char *serverURI, SmlError **error);
00061 void smlNotificationFreeAlert(SmlSanAlert *alert);
00062
00063 SmlNotificationVersion smlNotificationGetVersion(SmlNotification *san);
00064 SmlNotificationUIMode smlNotificationGetMode(SmlNotification *san);
00065 SmlNotificationInitiator smlNotificationGetInitiator(SmlNotification *san);
00066 unsigned int smlNotificationGetSessionID(SmlNotification *san);
00067 const char *smlNotificationGetIdentifier(SmlNotification *san);
00068 unsigned int smlNotificationNumAlerts(SmlNotification *san);
00069 SmlSanAlert *smlNotificationNthAlert(SmlNotification *san, unsigned int nth);
00070
00071 SmlAlertType smlSanAlertGetType(SmlSanAlert *alert);
00072 const char *smlSanAlertGetContentType(SmlSanAlert *alert);
00073 const char *smlSanAlertGetServerURI(SmlSanAlert *alert);
00074
00075 #endif //_SML_NOTIFICATION_H_
00076