include/hiker/attnmgr.h File Reference

#include <time.h>
#include <hiker/types.h>
#include <hiker/sysclass.h>
#include <hiker/attnmgr_properties.h>

Go to the source code of this file.

Data Structures

struct  _AlpAttnProp
struct  _AlpNotifyEventAttnAlert

Attention Alert Type Names

These are some sytem wide common alert type names.

All alert type definitions should follow the naming convention of the form ALP_ALERT_TYPE_xxxx and, in most cases, can be defined within the feature include files and do not need to be defined in this file.

Naming Scheme

The alert type name is meant to be hierarchical in order to group alert types with similar characteristics together.

For instance all the alerts that are of an alarm type natural are grouped under "/alp/alarm" such as the clock, calendar, and tasks alarms. Similarly, messaging applications such as IM, SMS+ and email should develop a hierachy under the /alp/messaging alert type for new messages, account status, and buddy status/presence.

Unfortunately, it will not always be obvious how to do this grouping, such as in the case of mobile alerts which don't share a lot of charactistics in come.

#define ALP_ALERT_TYPE_ALARM   ALP_ALERT_TYPE_ALP "/alarm"
 The alert type group for all ALP alarms.
#define ALP_ALERT_TYPE_ALARM_ANNIVERSARY   ALP_ALERT_TYPE_ALARM_CALENDAR "/anniversary"
 The alert type group for the ALP anniversary alarm.
#define ALP_ALERT_TYPE_ALARM_BIRTHDAY   ALP_ALERT_TYPE_ALARM_CALENDAR "/birthday"
 The alert type group for the ALP birthday alarm.
#define ALP_ALERT_TYPE_ALARM_CALENDAR   ALP_ALERT_TYPE_ALARM "/calendar"
 The alert type group for all ALP calendar alarms.
#define ALP_ALERT_TYPE_ALARM_CLOCK   ALP_ALERT_TYPE_ALARM "/clock"
 The alert type group for the ALP clock alarm.
#define ALP_ALERT_TYPE_ALARM_TASK   ALP_ALERT_TYPE_ALARM "/task"
 The alert type group for the ALP task alarm.
#define ALP_ALERT_TYPE_ALARM_WAKEUP   ALP_ALERT_TYPE_ALARM "/wakeup"
 The alert type group for the ALP wakeup alarm.
#define ALP_ALERT_TYPE_ALP   "/alp"
 The top of the ALP namespace for alert type names.
#define ALP_ALERT_TYPE_DOWNLOAD   ALP_ALERT_TYPE_ALP "/download"
 The alert type group for all ALP download alerts.
#define ALP_ALERT_TYPE_DOWNLOAD_STATUS   ALP_ALERT_TYPE_DOWNLOAD "/status"
 The alert type group for the ALP download status alert.
#define ALP_ALERT_TYPE_MESSAGING   ALP_ALERT_TYPE_ALP "/messaging"
 The alert type group for all ALP messaging (IM,SMS+,email) alerts.
#define ALP_ALERT_TYPE_SECURITY   ALP_ALERT_TYPE_ALP "/security"
 The alert type group for all ALP security alerts.

Attention Alert Notifications

#define ALP_ATTN_NOTIFY_FLAG_ACTION_MASK   0x000000FF
#define ALP_NOTIFY_EVENT_ATTN_ALERT   "/alp/attn/alert/"
typedef _AlpNotifyEventAttnAlert AlpNotifyEventAttnAlert
enum  AlpAttnNotifyAction { ALP_ATTN_NOTIFY_FLAG_ACTION_POST = 1, ALP_ATTN_NOTIFY_FLAG_ACTION_UPDATE, ALP_ATTN_NOTIFY_FLAG_ACTION_DELETE, ALP_ATTN_NOTIFY_FLAG_ACTION_PING }

Priority level definitions

Deprecated:
The API calls that have a priority argument are deprecated so these priority definitions also now deprecated.

The functionality is now being handled by the ALP_ATTN_PROP_LEVEL property.

Since the ALP_ATTN_PROP_LEVEL property will be set via the global settings preferences (see ALP_ATTENTION_PREFERENCES ) it no longer necessary to supply it with the properties passed in alp_attn_post() or alp_attn_post_with_callback().

#define ALP_ATTN_PRIORITY_DEFAULT   ALP_ATTN_PRIORITY_NONE
#define ALP_ATTN_PRIORITY_HIGH   ALP_ATTN_PRIORITY_IMPORTANT
#define ALP_ATTN_PRIORITY_LIST   ALP_ATTN_PRIORITY_INFO
#define ALP_ATTN_PRIORITY_LOW   ALP_ATTN_PRIORITY_SOUND
#define ALP_ATTN_PRIORITY_MAX   ALP_ATTN_PRIORITY_CRITICAL
#define ALP_ATTN_PRIORITY_MEDIUM   ALP_ATTN_PRIORITY_NOTICE
#define ALP_ATTN_PRIORITY_MIN   ALP_ATTN_PRIORITY_LOW
#define ALP_ATTN_PRIORITY_SOUND   0
enum  AlpAttnPriority {
  ALP_ATTN_PRIORITY_NONE = 0, ALP_ATTN_PRIORITY_EMERGENCY, ALP_ATTN_PRIORITY_CRITICAL, ALP_ATTN_PRIORITY_IMPORTANT,
  ALP_ATTN_PRIORITY_NOTICE, ALP_ATTN_PRIORITY_INFO
}

Attention Alert Property

Definition of AlpAttnProp and associated initialization macros and an example how to declare and initialize the array of properties that will be passed to alp_attn_post(), alp_attn_post_with_callback() or alp_attn_update().

Example
An example of a property array. It shows examples of the various ways this property array may be initialized: with the usual initialization and with the use of the two initialization macros - ALP_ATTN_PROP() and ALP_ATTN_PROPERTY().

     AlpAttnProp  properties[] = {
         { ALP_ATTN_PROP_ACTION_DEFAULT, ALP_ATTN_VALUE_VERB_SNOOZE },
         ALP_ATTN_PROP( ALP_ATTN_PROP_ALERT_TITLE, "Alarm"),
         ALP_ATTN_PROPERTY(ALERT_IMAGE, ALP_STOCK_ALARM),
         ALP_ATTN_PROPERTY(ALERT_ICON, ALP_STOCK_CALENDAR_APP),
         ALP_ATTN_PROPERTY(ALERT_MARKUP"-1", sBoldTime),
         ALP_ATTN_PROPERTY(ALERT_MARKUP"-2", sBoldDate),
         ALP_ATTN_PROP( ALP_ATTN_PROP_ALERT_SMARTTEXT"-3", details ),
     };
     uint32_t nprops = G_N_ELEMENTS(properties);
See also:
Attention Properties


#define ALP_ATTN_PROP(k, v)   { .key = (k), .value = (v), }
 Macro for setting property data from an arbitrary key and a value.
#define ALP_ATTN_PROPERTY(SHORTKEY, v)   { .key = (ALP_ATTN_PROP_##SHORTKEY), .value = (v), }
 Macro for setting property data from shorthand version of predefined ALP_ATTN_PROP keys and a value.
typedef _AlpAttnProp AlpAttnProp

Errors

#define ALP_STATUS_ATTN   (ALP_CLASS_ATTN | 0x00010000)
 Status class for attention manager API.
#define ALP_STATUS_ATTN_BAD_PARAM   (ALP_STATUS_ATTN | 0x00000100)
 An invalid parameter was passed to the function call.
#define ALP_STATUS_ATTN_INTERNAL_ERROR   (ALP_STATUS_ATTN | 0x00000300)
 An unexpected internal error occurred during the function call.
#define ALP_STATUS_ATTN_NO_MEMORY   (ALP_STATUS_ATTN | 0x00000200)
 Unable to allocate enough memory to complete the function call.
#define ALP_STATUS_ATTN_NOT_FOUND   (ALP_STATUS_ATTN | 0x00000400)
 The requested item was not present.

Defines

#define ALP_ATTN_API_IMPL   0
#define ALP_ATTN_DEPRECATE   __attribute((deprecated))

Typedefs

typedef void(* AlpAttnAlertCB )(const char *sourceAppId, const char *alertTypeName, const char *handle, int argc, char *argv[], void *user_data)
typedef void(* AlpAttnPostCB )(const char *sourceAppId, const char *alertTypeName, const char *handle, int argc, char *argv[], void *user_data)
 Prototype for the Attention Manager Alert callback function.

Functions

alp_status_t alp_attn_alert_delete (const char *sourceAppId, const char *alertTypeName, const char *handle) ALP_ATTN_DEPRECATE
alp_status_t alp_attn_alert_post (const char *sourceAppId, const char *alertTypeName, const char *handle, const char *interface, int32_t priority, int32_t duration, uint32_t nprops, const AlpAttnProp properties[]) ALP_ATTN_DEPRECATE
alp_status_t alp_attn_alert_post_with_callback (const char *sourceAppId, const char *alertTypeName, const char *handle, const char *interface, int32_t priority, int32_t duration, uint32_t nprops, const AlpAttnProp properties[], AlpAttnAlertCB callback, void *user_data) ALP_ATTN_DEPRECATE
alp_status_t alp_attn_alert_update (const char *sourceAppId, const char *alertTypeName, const char *handle, uint32_t nprops, const AlpAttnProp properties[]) ALP_ATTN_DEPRECATE
alp_status_t alp_attn_delete (const char *sourceAppId, const char *alertTypeName, const char *handle)
 Delete a posted attention alert using the alert id tuple.
alp_status_t alp_attn_post (const char *sourceAppId, const char *alertTypeName, const char *handle, uint32_t nprops, const AlpAttnProp properties[])
 Post an attention alert.
alp_status_t alp_attn_post_with_callback (const char *sourceAppId, const char *alertTypeName, const char *handle, uint32_t nprops, const AlpAttnProp properties[], AlpAttnPostCB callback, void *user_data)
 Post an attention alert with a callback.
alp_status_t alp_attn_update (const char *sourceAppId, const char *alertTypeName, const char *handle, uint32_t nprops, const AlpAttnProp properties[])
 Update the properties of a previously posted alert specified by the alert identifier.


Generated on Wed Jul 30 07:06:39 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.