#ifndef AEESMS_H
#define AEESMS_H
/*=====================================================================
FILE:  AEESMS.h

SERVICES:  AEE SMS Interfaces

GENERAL DESCRIPTION:
   Base level definitions, typedefs, etc. for AEE SMS

        Copyright © 1999-2004 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
======================================================================*/
#include "AEEWebOpts.h"

//**********************************************************************
//
// ISMSMsg Interface
//
//**********************************************************************
typedef WebOpt SMSMsgOpt;
typedef struct ISMSMsg      ISMSMsg;

// Define priorities for message
#define AEESMS_PRIORITY_NORMAL         0
#define AEESMS_PRIORITY_INTERACTIVE    1
#define AEESMS_PRIORITY_URGENT         2
#define AEESMS_PRIORITY_EMERGENCY      3

// Define a data type to refer priorities
typedef uint32 AEEMSGPriority;

// Define privacy options
#define AEESMS_PRIVACY_NORMAL          0
#define AEESMS_PRIVACY_RESTRICTED      1
#define AEESMS_PRIVACY_CONFIDENTIAL    2
#define AEESMS_PRIVACY_SECRET          3

// Define a data type to refer privacy options
typedef uint32 AEEMSGPrivacy;

// Define message classes
#define AEESMS_CLASS_0                 0           // GW Class 0
#define AEESMS_CLASS_1                 1           // GW Class 1
#define AEESMS_CLASS_2                 2           // GW Class 2
#define AEESMS_CLASS_3                 3           // GW Class 3
#define AEESMS_CLASS_NONE              4           // None
#define AEESMS_CLASS_CDMA              5           // CDMA

// Define a data type to refer message class
typedef uint32 AEESMSClass;

// Define message tags
#define AEESMS_TAG_NONE                      0
#define AEESMS_TAG_MT_READ                   1
#define AEESMS_TAG_MT_NOT_READ               2
#define AEESMS_TAG_MO_SENT                   3
#define AEESMS_TAG_MO_NOT_SENT               4
#define AEESMS_TAG_MO_SENT_ST_NOT_RECEIVED   5
#define AEESMS_TAG_MO_SENT_ST_NOT_STORED     6
#define AEESMS_TAG_MO_SENT_ST_STORED         7
#define AEESMS_TAG_MO_TEMPLATE               8
#define AEESMS_TAG_STATUS_RPT                9

// Define a data type to refer to message tags
typedef uint32 AEESMSTag;

// Define message types
#define AEESMS_TYPE_UNKNOWN                  0
#define AEESMS_TYPE_TEXT                     1
#define AEESMS_TYPE_PAGE                     2
#define AEESMS_TYPE_VOICE_MAIL_NOTIFICATION  3
#define AEESMS_TYPE_BROADCAST                4
#define AEESMS_TYPE_WAP                      5
#define AEESMS_TYPE_EMS                      6

// Define a data type to refer to message type
typedef uint32 AEESMSType;

// Define Message Waiting Types
#define  AEESMS_MSGWAITINGTYPE_NONE          0
#define  AEESMS_MSGWAITINGTYPE_DISCARD       1
#define  AEESMS_MSGWAITINGTYPE_STORE         2
#define  AEESMS_MSGWAITINGTYPE_NONE_1111     3

// Define a data type to refer to Message Waiting Type
typedef uint8 AEESMSMsgWaitingType;



// Define Message Waiting Kind Types
#define  AEESMS_MSGWAITINGKIND_VOICEMAIL     0
#define  AEESMS_MSGWAITINGKIND_FAX           1 
#define  AEESMS_MSGWAITINGKIND_EMAIL         2
#define  AEESMS_MSGWAITINGKIND_OTHER         3

// Define a data type to refer to Message Waiting Kind Type
typedef uint8 AEESMSMsgWaitingKind;



// Define User Data Header Types
#define   AEESMS_UDH_CONCAT_8                0
#define   AEESMS_UDH_SPECIAL_SM              1
#define   AEESMS_UDH_PORT_8                  4
#define   AEESMS_UDH_PORT_16                 5 
#define   AEESMS_UDH_SMSC_CONTROL            6
#define   AEESMS_UDH_SOURCE                  7
#define   AEESMS_UDH_CONCAT_16               8
#define   AEESMS_UDH_WCMP                    9
#define   AEESMS_UDH_TEXT_FORMATING          10
#define   AEESMS_UDH_PRE_DEF_SOUND           11
#define   AEESMS_UDH_USER_DEF_SOUND          12
#define   AEESMS_UDH_PRE_DEF_ANIM            13
#define   AEESMS_UDH_LARGE_ANIM              14
#define   AEESMS_UDH_SMALL_ANIM              15
#define   AEESMS_UDH_LARGE_PICTURE           16
#define   AEESMS_UDH_SMALL_PICTURE           17
#define   AEESMS_UDH_VAR_PICTURE             18
#define   AEESMS_UDH_RFC822                  32

// Define a data type to refer UDH ID
typedef uint8 AEESMSUDHId;


// Define message broadcast types
#define AEESMS_BC_UNKOWN                     0
#define AEESMS_BC_EMERGENCY                  1
#define AEESMS_BC_ADMIN                      2
#define AEESMS_BC_MAINTENANCE                3
#define AEESMS_BC_GEN_NEWS_LOC               4
#define AEESMS_BC_GEN_NEWS_REG               5
#define AEESMS_BC_GEN_NEWS_NAT               6
#define AEESMS_BC_GEN_NEWS_INT               7
#define AEESMS_BC_FIN_NEWS_LOC               8
#define AEESMS_BC_FIN_NEWS_REG               9
#define AEESMS_BC_FIN_NEWS_NAT               0xA
#define AEESMS_BC_FIN_NEWS_INT               0xB
#define AEESMS_BC_SPT_NEWS_LOC               0xC
#define AEESMS_BC_SPT_NEWS_REG               0xD
#define AEESMS_BC_SPT_NEWS_NAT               0xE
#define AEESMS_BC_SPT_NEWS_INT               0xF
#define AEESMS_BC_ENT_NEWS_LOC               0x10
#define AEESMS_BC_ENT_NEWS_REG               0x11
#define AEESMS_BC_ENT_NEWS_NAT               0x12
#define AEESMS_BC_ENT_NEWS_INT               0x13
#define AEESMS_BC_LOC_WEATHER                0x14
#define AEESMS_BC_AREA_TRAFFIC               0x15
#define AEESMS_BC_AIRPORT_SCHED              0x16
#define AEESMS_BC_RESTAURANTS                0x17
#define AEESMS_BC_LODGINGS                   0x18
#define AEESMS_BC_RETAILS                    0x19
#define AEESMS_BC_ADS                        0x1A
#define AEESMS_BC_STOCK_QUOTES               0x1B
#define AEESMS_BC_JOBS                       0x1C
#define AEESMS_BC_MEDICAL                    0x1D
#define AEESMS_BC_TECH_NEWS                  0x1E
#define AEESMS_BC_MULTI                      0x1F
#define AEESMS_BC_ALL                        0xffff

// Define a data type to refer to message broadcast types
typedef uint32 AEESMSBCType;

#define AEESMS_ENC_OCTET             0
#define AEESMS_ENC_IS91EP            1
#define AEESMS_ENC_ASCII             2
#define AEESMS_ENC_IA5               3
#define AEESMS_ENC_UNICODE           4
#define AEESMS_ENC_SHIFT_JIS         5
#define AEESMS_ENC_KOREAN            6
#define AEESMS_ENC_LATIN_HEBREW      7
#define AEESMS_ENC_LATIN             8
#define AEESMS_ENC_GSM_7_BIT_DEFAULT 9

// Define a data type to refer to MO SMS encoding types
typedef uint32 AEESMSEncType;

// Defines to set various message options
#define MSGOPT_TO_DEVICE_SZ     (WEBOPT_SZ + 0)
#define MSGOPT_PAYLOAD_SZ       (WEBOPT_SZ + 1)
#define MSGOPT_BREW_HANDLER_SZ  (WEBOPT_SZ + 2)
#define MSGOPT_SC_ADDRESS_SZ    (WEBOPT_SZ + 3)
#define MSGOPT_FROM_DEVICE_SZ   (WEBOPT_SZ + 4)
#define MSGOPT_CALLBACK_SZ      (WEBOPT_SZ + 5)
#define MSGOPT_TO_EMAIL_SZ      (WEBOPT_SZ + 6)

#define MSGOPT_PAYLOAD_WSZ      (WEBOPT_WSZ + 0)

#define MSGOPT_TIMESTAMP        (WEBOPT_VARIABLE + sizeof(JulianType))

#define MSGOPT_BREW_CLASS       (WEBOPT_32BIT + 0)
#define MSGOPT_PRIORITY         (WEBOPT_32BIT + 1)
#define MSGOPT_PRIVACY          (WEBOPT_32BIT + 2)
#define MSGOPT_PAYLOAD_ENCODING (WEBOPT_32BIT + 3)
#define MSGOPT_LANG             (WEBOPT_32BIT + 4)
#define MSGOPT_CLASS            (WEBOPT_32BIT + 5)
#define MSGOPT_TAG              (WEBOPT_32BIT + 6)
#define MSGOPT_MSGTYPE          (WEBOPT_32BIT + 7)
#define MSGOPT_BCTYPE           (WEBOPT_32BIT + 8)
#define MSGOPT_REQUEST_DL_ACK   (WEBOPT_32BIT + 9)
#define MSGOPT_NUM              (WEBOPT_32BIT + 10)
#define MSGOPT_REQUEST_USER_ACK (WEBOPT_32BIT + 11)
#define MSGOPT_MOSMS_ENCODING   (WEBOPT_32BIT + 12)
#define MSGOPT_MSG_ID           (WEBOPT_32BIT + 13)
#define MSGOPT_REQUEST_READ_ACK (WEBOPT_32BIT + 14)
#define MSGOPT_DL_ACK           (WEBOPT_32BIT + 15)
#define MSGOPT_USER_ACK         (WEBOPT_32BIT + 16)
#define MSGOPT_READ_ACK         (WEBOPT_32BIT + 17)

#define MSGOPT_PAYLOAD_BINARY   (WEBOPT_VARBUFFER + 0)
#define MSGOPT_UDH_CONCAT       (WEBOPT_VARBUFFER + 1)
#define MSGOPT_UDH_SPECIAL_SM   (WEBOPT_VARBUFFER + 2)
#define MSGOPT_UDH_PORT         (WEBOPT_VARBUFFER + 3)
#define MSGOPT_UDH_TEXT_FORMAT  (WEBOPT_VARBUFFER + 4)
#define MSGOPT_UDH_PREDEFINED   (WEBOPT_VARBUFFER + 5)
#define MSGOPT_UDH_USERDEFINED  (WEBOPT_VARBUFFER + 6)
#define MSGOPT_UDH_VAR_PICTURE  (WEBOPT_VARBUFFER + 7)
#define MSGOPT_UDH_RFC822       (WEBOPT_VARBUFFER + 8)
#define MSGOPT_UDH_OTHER        (WEBOPT_VARBUFFER + 9)

#define MSGOPT_PAYLOAD_SOURCE   (WEBOPT_INTERFACE + 0)

#define MSGOPT_END              WEBOPT_END
#define MSGOPT_ANY              WEBOPT_ANY
#define MSGOPT_COPYOPTS         WEBOPT_COPYOPTS

#define MSGOPT_SETUDHCONCAT8BUFFER(pbuf,seq,total,ref)      do {((unsigned char*)(pbuf))[0] = (unsigned char)5; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_CONCAT_8; ((unsigned char*)(pbuf))[3] = (unsigned char)(seq); ((unsigned char*)(pbuf))[4] = (unsigned char)(total); ((unsigned char*)(pbuf))[5] = (unsigned char)(ref); ((unsigned char*)(pbuf))[6] = (unsigned char)0;} while(0)
#define MSGOPT_SETUDHCONCAT16BUFFER(pbuf,seq,total,ref)     do {((unsigned char*)(pbuf))[0] = (unsigned char)5; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_CONCAT_16; ((unsigned char*)(pbuf))[3] = (unsigned char)(seq); ((unsigned char*)(pbuf))[4] = (unsigned char)(total); ((unsigned char*)(pbuf))[5] = (unsigned char)(ref & 0x00FF); ((unsigned char*)(pbuf))[6] = (unsigned char)(ref >> 8);} while(0)

#define MSGOPT_SETUDHSPECIALSMBUFFER(pbuf,waiting,waiting_kind,count)    do {((unsigned char*)(pbuf))[0] = (unsigned char)4; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_SPECIAL_SM; ((unsigned char*)(pbuf))[3] = (unsigned char)(waiting); ((unsigned char*)(pbuf))[4] = (unsigned char)(waiting_kind); ((unsigned char*)(pbuf))[5] = (unsigned char)(count);} while(0)

#define MSGOPT_SETUDHPORT8BUFFER(pbuf,dest,orig)            do {((unsigned char*)(pbuf))[0] = (unsigned char)5; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_PORT_8; ((unsigned char*)(pbuf))[3] = (unsigned char)(dest); ((unsigned char*)(pbuf))[4] = (unsigned char)(0); ((unsigned char*)(pbuf))[5] = (unsigned char)(orig); ((unsigned char*)(pbuf))[6] = (unsigned char)(0);} while(0)
#define MSGOPT_SETUDHPORT16BUFFER(pbuf,dest,orig)           do {((unsigned char*)(pbuf))[0] = (unsigned char)5; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_PORT_16; ((unsigned char*)(pbuf))[3] = (unsigned char)(dest & 0x00FF); ((unsigned char*)(pbuf))[4] = (unsigned char)(dest >> 8); ((unsigned char*)(pbuf))[5] = (unsigned char)(orig & 0x00FF); ((unsigned char*)(pbuf))[6] = (unsigned char)(orig >> 8);} while(0)

#define MSGOPT_SETUDHTEXTFORMATBUFFER(pbuf,start,len,style) do {((unsigned char*)(pbuf))[0] = (unsigned char)4; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_TEXT_FORMATING; ((unsigned char*)(pbuf))[3] = (unsigned char)(start); ((unsigned char*)(pbuf))[4] = (unsigned char)(len); ((unsigned char*)(pbuf))[5] = (unsigned char)(style);} while(0)

#define MSGOPT_SETUDHPREDEFSOUNDBUFFER(pbuf,pos,num)        do {((unsigned char*)(pbuf))[0] = (unsigned char)3; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_PRE_DEF_SOUND; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(num);} while(0)
#define MSGOPT_SETUDHPREDEFANIMBUFFER(pbuf,pos,num)         do {((unsigned char*)(pbuf))[0] = (unsigned char)3; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_PRE_DEF_ANIM;  ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(num);} while(0)

#define MSGOPT_SETUDHUSERDEFSOUNDBUFFER(pbuf,pos,len,pdata) do {((unsigned char*)(pbuf))[0] = (unsigned char)((3 + len) & 0x00ff); ((unsigned char*)(pbuf))[1] = (unsigned char)((3 + len) >> 8); ((unsigned char*)(pbuf))[2] = AEESMS_UDH_USER_DEF_SOUND; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(len); MEMCPY(((unsigned char*)(pbuf + 5)),(pdata),(len));} while(0)
#define MSGOPT_SETUDHLARGEANIMBUFFER(pbuf,pos,pdata)        do {((unsigned char*)(pbuf))[0] = (unsigned char)131; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_LARGE_ANIM; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(128); MEMCPY(((unsigned char*)(pbuf + 5)),(pdata),(128));} while(0)
#define MSGOPT_SETUDHSMALLANIMBUFFER(pbuf,pos,pdata)        do {((unsigned char*)(pbuf))[0] = (unsigned char)35; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_SMALL_ANIM; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(32); MEMCPY(((unsigned char*)(pbuf + 5)),(pdata),(32));} while(0)
#define MSGOPT_SETUDHLARGEPICBUFFER(pbuf,pos,pdata)         do {((unsigned char*)(pbuf))[0] = (unsigned char)131; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_LARGE_PICTURE; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(128); MEMCPY(((unsigned char*)(pbuf + 5)),(pdata),(128));} while(0)
#define MSGOPT_SETUDHSMALLPICBUFFER(pbuf,pos,pdata)         do {((unsigned char*)(pbuf))[0] = (unsigned char)35; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_SMALL_PICTURE; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(32); MEMCPY(((unsigned char*)(pbuf + 5)),(pdata),(32));} while(0)

#define MSGOPT_SETUDHVARPICBUFFER(pbuf,pos,width,height,pdata) do {((unsigned char*)(pbuf))[0] = (unsigned char)(((39 + (width*height)) >> 3) & 0x00ff); ((unsigned char*)(pbuf))[1] = (unsigned char)((39 + (width*height)) >> 11); ((unsigned char*)(pbuf))[2] = AEESMS_UDH_VAR_PICTURE; ((unsigned char*)(pbuf))[3] = (unsigned char)(pos); ((unsigned char*)(pbuf))[4] = (unsigned char)(width); ((unsigned char*)(pbuf))[5] = (unsigned char)(height); MEMCPY(((unsigned char*)(pbuf + 6)),(pdata),(((height*width)+7)/8));} while(0)

#define MSGOPT_SETRFC822BUFFER(pbuf,len)                    do {((unsigned char*)(pbuf))[0] = (unsigned char)2; ((unsigned char*)(pbuf))[1] = (unsigned char)0; ((unsigned char*)(pbuf))[2] = AEESMS_UDH_RFC822; ((unsigned char*)(pbuf))[3] = (unsigned char)(len);} while(0)

#define MSGOPT_SETUDHOTHERBUFFER(pbuf,udhID,len,pdata)      do {((unsigned char*)(pbuf))[0] = (unsigned char)((3 + len) & 0x00ff); ((unsigned char*)(pbuf))[1] = (unsigned char)((3 + len) >> 8); ((unsigned char*)(pbuf))[2] = (unsigned char)(udhID); ((unsigned char*)(pbuf))[3] = (unsigned char)(len & 0x00FF); ((unsigned char*)(pbuf))[4] = (unsigned char)(len >> 8); MEMCPY(((unsigned char*)(pbuf + 5)),(pdata),(len));} while(0)

#define MSGOPT_GETUDHBUFFERLENGTH(pbuf)                     WEBOPT_GETVARBUFFERLENGTH(pbuf)
#define MSGOPT_GETUDHBUFFERDATA(pbuf)                       WEBOPT_GETVARBUFFERDATA(pbuf)

// Define ISMSMsg interface methods
AEEINTERFACE(ISMSMsg)
{
   INHERIT_IWebOpts(ISMSMsg);
};

#define ISMSMSG_AddRef(p)                       AEEGETPVTBL((p),ISMSMsg)->AddRef((p))
#define ISMSMSG_Release(p)                      AEEGETPVTBL((p),ISMSMsg)->Release((p))
#define ISMSMSG_QueryInterface(p,clsid,pp)      AEEGETPVTBL((p),ISMSMsg)->QueryInterface((p),(clsid),(pp))
#define ISMSMSG_AddOpt(p,o)                     AEEGETPVTBL((p),ISMSMsg)->AddOpt((p),(o))
#define ISMSMSG_RemoveOpt(p,n)                  AEEGETPVTBL((p),ISMSMsg)->RemoveOpt((p),(0),(n))
#define ISMSMSG_GetOpt(p,n,o)                   AEEGETPVTBL((p),ISMSMsg)->GetOpt((p),(n),(0),(o))
#define ISMSMSG_GetOptWithIndex(p,n,i,o)        AEEGETPVTBL((p),ISMSMsg)->GetOpt((p),(n),(i),(o))
//*********************************************************************
//
// ISMS Interface
//
//*********************************************************************
// Define client status. Main client can specify its status to ISMS using
// these types
#define AEESMS_CS_OK                            0
#define AEESMS_CS_OUT_OF_RESOURCES              1

// Define data type to refer to client status
typedef uint32 AEESMSClientStatus;

// Define error type
#define AEESMS_ERRORTYPE_NONE                   0
#define AEESMS_ERRORTYPE_UNKNOWN                1
#define AEESMS_ERRORTYPE_TEMP                   2
#define AEESMS_ERRORTYPE_PERM                   3

// Define error
#define AEESMS_ERROR_NONE                       0

#define AEESMS_ERROR_GENERAL_PROBLEM            1
#define AEESMS_ERROR_BUSY                       2
#define AEESMS_ERROR_NO_MEMORY                  3

#define AEESMS_ERROR_NETWORK_PROBLEM               0x0010
#define AEESMS_ERROR_ADDRESS_TRANSLATION_FAILURE   0x0011

#define AEESMS_ERROR_DESTINATION_BUSY           0x0020
#define AEESMS_ERROR_DESTINATION_OUT_OF_SERVICE 0x0021
#define AEESMS_ERROR_DESTINATION_PROBLEM        0x0022

#define AEESMS_ERROR_RADIO_PROBLEM              0x0030

#define AEESMS_ERROR_PID_PROBLEM                0x0040
#define AEESMS_ERROR_UNSUPPORTED_TELEMATIC      0x0041

#define AEESMS_ERROR_DCS_PROBLEM                0x0051
#define AEESMS_ERROR_ALPHABET_NOT_SUPPORTED     0x0052
#define AEESMS_ERROR_MSG_CLASS_NOT_SUPPORTED    0x0053

#define AEESMS_ERROR_COMMAND_PROBLEM            0x0060
#define AEESMS_ERROR_SC_BUSY                    0x0061
#define AEESMS_ERROR_NO_SC_SUBSCRIPTION         0x0062
#define AEESMS_ERROR_SC_FAILURE                 0x0063

#define AEESMS_ERROR_SMS_ORIGINATION_DENIED     0x0070
#define AEESMS_ERROR_SMS_NOT_SUPPORTED          0x0071
#define AEESMS_ERROR_SMS_TERMINATION_DENIED     0x0072

#define AEESMS_ERROR_OEM_DEFINED_FIRST          0x00d0
#define AEESMS_ERROR_OEM_DEFINED_LAST           0x00ff

#define AEESMS_GETERRORTYPE(n)                  (uint16)((n) >> 16)
#define AEESMS_GETERROR(n)                      (uint16)((n) & 0x0000ffff)
#define AEESMS_SETERROR(n,et,e)                 do {(n) = (((uint32)(et)) << 16); ((n) += (e));} while (0)

// Define identifiers for Domain Preference
#define AEESMS_GW_DOMAIN_PREF_CS_PREFERRED      0
#define AEESMS_GW_DOMAIN_PREF_PS_PREFERRED      1
#define AEESMS_GW_DOMAIN_PREF_CS_ONLY           2
#define AEESMS_GW_DOMAIN_PREF_PS_ONLY           3
#define AEESMS_GW_DOMAIN_PREF_LAST              4

// Define ISMS interface
typedef struct ISMS         ISMS;

AEEINTERFACE(ISMS)
{
   INHERIT_IQueryInterface(ISMS);

   void (*SendMsg)(ISMS *po, ISMSMsg * pISMSMsg, AEECallback * pcb, uint32 *pnRv);
   int  (*ReceiveMsg)(ISMS *po, uint32 uMsgId, ISMSMsg **ppMsg);
   int  (*SetClientStatus)(ISMS *po, AEESMSClientStatus cs, AEESMSType mt); 
   int  (*GetBytesAvailableForPayload)(ISMS * po, ISMSMsg * pISMSMsg, int * pnBytes, int * pnPadding);
   int  (*GetEncodingsAvailableForMOSMS)(ISMS * po, uint32 * pBuffer, uint32 * pnSize);
};

#define ISMS_AddRef(p)                                   AEEGETPVTBL(p,ISMS)->AddRef((p))
#define ISMS_Release(p)                                  AEEGETPVTBL(p,ISMS)->Release((p))
#define ISMS_QueryInterface(p,i,o)                       AEEGETPVTBL(p,ISMS)->QueryInterface((p),(i),(o))
#define ISMS_SendMsg(p,pm,pc,pn)                         AEEGETPVTBL(p,ISMS)->SendMsg((p),(pm),(pc),(pn))
#define ISMS_ReceiveMsg(p,n,ppi)                         AEEGETPVTBL(p,ISMS)->ReceiveMsg((p),(n),(ppi))
#define ISMS_SetClientStatus(p,cs,mt)                    AEEGETPVTBL(p,ISMS)->SetClientStatus((p),(cs),(mt))
#define ISMS_GetBytesAvailableForPayload(p,pm,pnb,pnp)   AEEGETPVTBL(p,ISMS)->GetBytesAvailableForPayload((p),(pm),(pnb),(pnp))
#define ISMS_GetEncodingsAvailableForMOSMS(p,pb,pn)      AEEGETPVTBL(p,ISMS)->GetEncodingsAvailableForMOSMS((p),(pb),(pn))
//*********************************************************************
//
// ISMSNotifier Interface
//
//*********************************************************************
#define NMASK_SMS_TYPE         0x0001   // Arrival of SMS for specific message type
#define NMASK_SMS_BROADCAST    0x0002   // Arrival of broadcast SMS

typedef struct ISMSNotifier ISMSNotifier;

//*********************************************************************
//
// ISMSStorage Interface
//
//*********************************************************************
// Define identifiers for storage type

#define AEESMS_CARD_RUIM      0
#define AEESMS_CARD_SIM       1
#define AEESMS_NV_CDMA        2
#define AEESMS_NV_GW          3
#define AEESMS_STORAGE_LAST   4

// Define data type to refer to storage types
typedef uint32 AEESMSStorageType;

typedef struct
{
   uint32                     nSize;
   uint32                     nMaxSlots;
   uint32                     nFreeSlots;
   uint32                     nUsedTagSlots;
} AEESMSStorageStatus;

typedef struct ISMSStorage         ISMSStorage;

AEEINTERFACE(ISMSStorage)
{
   INHERIT_IQueryInterface(ISMSStorage);
   void              (*GetStorageStatus)(ISMSStorage * po, AEESMSStorageType st, AEESMSTag mt, AEECallback *pcb, AEESMSStorageStatus * pss, uint32 *pnErr);
   void              (*StoreMsg)(ISMSStorage * po, AEESMSStorageType st, ISMSMsg * pi, AEECallback *pcb, uint32 * pnIndex, uint32 *pnErr);
   void              (*ReadMsg)(ISMSStorage * po, AEESMSStorageType st, uint32 nIndex, AEECallback *pcb, ISMSMsg ** ppi, uint32 *pnErr);
   void              (*Delete)(ISMSStorage * po, AEESMSStorageType st, AEESMSTag mt, uint32 nIndex, AEECallback *pcb, uint32 *pnErr);
   void              (*EnumMsgInit)(ISMSStorage * po, AEESMSStorageType st, AEESMSTag mt, AEECallback *pcb, uint32 *pnErr);
   void              (*EnumNextMsg)(ISMSStorage * po, AEESMSStorageType st, AEECallback *pcb, uint32 * pnIndex, ISMSMsg ** ppi, uint32 *pnErr);
};

#define ISMSSTORAGE_AddRef(p)                               AEEGETPVTBL(p,ISMSStorage)->AddRef((p))
#define ISMSSTORAGE_Release(p)                              AEEGETPVTBL(p,ISMSStorage)->Release((p))
#define ISMSSTORAGE_QueryInterface(p,i,o)                   AEEGETPVTBL(p,ISMSStorage)->QueryInterface((p),(i),(o))
#define ISMSSTORAGE_GetStorageStatus(p,st,mt,pcb,pss,pe)    AEEGETPVTBL(p,ISMSStorage)->GetStorageStatus((p),(st),(mt),(pcb),(pss),(pe))
#define ISMSSTORAGE_StoreMsg(p,st,pi,pcb,pni,pe)            AEEGETPVTBL(p,ISMSStorage)->StoreMsg((p),(st),(pi),(pcb),(pni),(pe))
#define ISMSSTORAGE_ReadMsg(p,st,ni,pcb,ppi,pe)             AEEGETPVTBL(p,ISMSStorage)->ReadMsg((p),(st),(ni),(pcb),(ppi),(pe))
#define ISMSSTORAGE_DeleteAll(p,st,pcb,pe)                  AEEGETPVTBL(p,ISMSStorage)->Delete((p),(st),(AEESMS_TAG_NONE),(0xffffffff),(pcb),(pe))
#define ISMSSTORAGE_DeleteMsgTag(p,st,mt,pcb,pe)            AEEGETPVTBL(p,ISMSStorage)->Delete((p),(st),(mt),(0xffffffff),(pcb),(pe))
#define ISMSSTORAGE_DeleteMsg(p,st,ni,pcb,pe)               AEEGETPVTBL(p,ISMSStorage)->Delete((p),(st),(AEESMS_TAG_NONE),(ni),(pcb),(pe))
#define ISMSSTORAGE_EnumMsgInit(p,st,mt,pcb,pe)             AEEGETPVTBL(p,ISMSStorage)->EnumMsgInit((p),(st),(mt),(pcb),(pe))
#define ISMSSTORAGE_EnumNextMsg(p,st,pcb,pni,ppi,pe)        AEEGETPVTBL(p,ISMSStorage)->EnumNextMsg((p),(st),(pcb),(pni),(ppi),(pe))

//**********************************************************************
//
// ISMSBCSrvOpts
//
//**********************************************************************
typedef WebOpt SMSBCSrvOpts;
typedef struct ISMSBCSrvOpts      ISMSBCSrvOpts;

// Define broadcast alert type
#define AEESMS_BC_ALERT_NONE                    0
#define AEESMS_BC_ALERT_DEFAULT                 1
#define AEESMS_BC_ALERT_VIBRATE_ONCE            2
#define AEESMS_BC_ALERT_VIBRATE_REPEAT          3
#define AEESMS_BC_ALERT_VISUAL_ONCE             4
#define AEESMS_BC_ALERT_VISUAL_REPEAT           5
#define AEESMS_BC_ALERT_LOW_PRIORITY_ONCE       6
#define AEESMS_BC_ALERT_LOW_PRIORITY_REPEAT     7
#define AEESMS_BC_ALERT_MEDIUM_PRIORITY_ONCE    8
#define AEESMS_BC_ALERT_MEDIUM_PRIORITY_REPEAT  9
#define AEESMS_BC_ALERT_HIGH_PRIORITY_ONCE      10
#define AEESMS_BC_ALERT_HIGH_PRIORITY_REPEAT    11

// Define data type to refer to broadcast alert type
typedef uint32 AEESMSBCAlertType;

// Define ServiceID structure
typedef struct
{
   AEESMSBCType srvType;
   uint32       dwLang;
   uint16       fromService;
   uint16       toService;
} AEESMSBCSrvID;

// Reserve ISMSBCSrvOpts chunk of the option ID space
#define SMSBCSRVOPT_LABEL_SZ         (WEBOPT_SZ + 0)

#define SMSBCSRVOPT_SELECTED         (WEBOPT_32BIT + 0)
#define SMSBCSRVOPT_PRIORITY         (WEBOPT_32BIT + 1)
#define SMSBCSRVOPT_LABEL_ENCODING   (WEBOPT_32BIT + 2)
#define SMSBCSRVOPT_ALERT            (WEBOPT_32BIT + 3)
#define SMSBCSRVOPT_MAX_MSGS         (WEBOPT_32BIT + 4)

#define SMSBCSRVOPT_SERVICEID        (WEBOPT_VARIABLE + sizeof(AEESMSBCSrvID))

#define SMSBCSRVOPT_END              WEBOPT_END
#define SMSBCSRVOPT_ANY              WEBOPT_ANY
#define SMSBCSRVOPT_COPYOPTS         WEBOPT_COPYOPTS

AEEINTERFACE(ISMSBCSrvOpts)
{
   INHERIT_IWebOpts(ISMSBCSrvOpts);
};

#define ISMSBCSRVOPTS_AddRef(p)                       AEEGETPVTBL((p),ISMSBCSrvOpts)->AddRef((p))
#define ISMSBCSRVOPTS_Release(p)                      AEEGETPVTBL((p),ISMSBCSrvOpts)->Release((p))
#define ISMSBCSRVOPTS_QueryInterface(p,clsid,pp)      AEEGETPVTBL((p),ISMSBCSrvOpts)->QueryInterface((p),(clsid),(pp))
#define ISMSBCSRVOPTS_AddOpt(p,o)                     AEEGETPVTBL((p),ISMSBCSrvOpts)->AddOpt((p),(o))
#define ISMSBCSRVOPTS_RemoveOpt(p,n)                  AEEGETPVTBL((p),ISMSBCSrvOpts)->RemoveOpt((p),(0),(n))
#define ISMSBCSRVOPTS_GetOpt(p,n,o)                   AEEGETPVTBL((p),ISMSBCSrvOpts)->GetOpt((p),(n),(0),(o))

//*********************************************************************
//
// ISMSBCConfig Interface
//
//*********************************************************************
// Define broadcast configurations
#define AEESMS_BC_CONFIG_DISALLOW         0
#define AEESMS_BC_CONFIG_ALLOW_TABLE      1
#define AEESMS_BC_CONFIG_ALLOW_ALL        2

// Define data type to refer to broadcast configurations
typedef uint32 AEESMSBCConfig;

// Define broadcast preferences
#define AEESMS_BC_PREF_DISALLOW           0
#define AEESMS_BC_PREF_ALLOW_TABLE        1
#define AEESMS_BC_PREF_ALLOW_ALL          2

// Define data type to refer to broadcast preferences
typedef uint32 AEESMSBCPref;

// Define broadcast message mode
#define AEESMS_MODE_CDMA                  0
#define AEESMS_MODE_GW                    1

// Define data type to refer to broadcast message mode
typedef uint32 AEESMSMode;

typedef struct ISMSBCConfig         ISMSBCConfig;

AEEINTERFACE(ISMSBCConfig)
{
   INHERIT_IQueryInterface(ISMSBCConfig);
   void     (*GetBCConfig)(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, AEESMSBCConfig * pConfig, uint32 * pnErr);
   void     (*GetBCPref)(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, AEESMSBCPref * pPref, uint32 * pnErr);
   void     (*SetBCPref)(ISMSBCConfig * po, AEESMSMode mode, AEESMSBCPref nPref, AEECallback *pcb, uint32 * pnErr);
   void     (*GetServiceIDs)(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, uint32 * pnCount, AEESMSBCSrvID ** ppsid, uint32 * pnErr);
   void     (*GetServiceOpts)(ISMSBCConfig * po, AEESMSMode mode, AEESMSBCSrvID srvID, AEECallback *pcb, ISMSBCSrvOpts ** ppi, uint32 * pnErr);
   void     (*SetServiceOpts)(ISMSBCConfig * po, AEESMSMode mode, ISMSBCSrvOpts * pi, AEECallback *pcb, uint32 * pnErr);
   void     (*GetAllServiceOpts)(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, uint32 * pnCount, ISMSBCSrvOpts *** pppi, uint32 * pnErr);
   void     (*DeleteService)(ISMSBCConfig * po, AEESMSMode mode, AEESMSBCSrvID srvID, AEECallback *pcb, uint32 * pnErr);
};

#define ISMSBCCONFIG_AddRef(p)                              AEEGETPVTBL(p,ISMSBCConfig)->AddRef((p))
#define ISMSBCCONFIG_Release(p)                             AEEGETPVTBL(p,ISMSBCConfig)->Release((p))
#define ISMSBCCONFIG_QueryInterface(p,i,o)                  AEEGETPVTBL(p,ISMSBCConfig)->QueryInterface((p),(i),(o))
#define ISMSBCCONFIG_GetBCConfig(p,m,pcb,pc,pe)             AEEGETPVTBL(p,ISMSBCConfig)->GetBCConfig((p),(m),(pcb),(pc),(pe))
#define ISMSBCCONFIG_GetBCPref(p,m,pcb,pp,pe)               AEEGETPVTBL(p,ISMSBCConfig)->GetBCPref((p),(m),(pcb),(pp),(pe))
#define ISMSBCCONFIG_SetBCPref(p,m,np,pcb,pe)               AEEGETPVTBL(p,ISMSBCConfig)->SetBCPref((p),(m),(np),(pcb),(pe))
#define ISMSBCCONFIG_GetServiceIDs(p,m,pcb,pnc,ppsid,pe)    AEEGETPVTBL(p,ISMSBCConfig)->GetServiceIDs((p),(m),(pcb),(pnc),(ppsid),(pe))
#define ISMSBCCONFIG_GetServiceOpts(p,m,sid,pcb,ppi,pe)     AEEGETPVTBL(p,ISMSBCConfig)->GetServiceOpts((p),(m),(sid),(pcb),(ppi),(pe))
#define ISMSBCCONFIG_SetServiceOpts(p,m,pi,pcb,pe)          AEEGETPVTBL(p,ISMSBCConfig)->SetServiceOpts((p),(m),(pi),(pcb),(pe))
#define ISMSBCCONFIG_GetAllServiceOpts(p,m,pcb,pnc,pppi,pe) AEEGETPVTBL(p,ISMSBCConfig)->GetAllServiceOpts((p),(m),(pcb),(pnc),(pppi),(pe))
#define ISMSBCCONFIG_DeleteService(p,m,sid,pcb,pe)          AEEGETPVTBL(p,ISMSBCConfig)->DeleteService((p),(m),(sid),(pcb),(pe))



/*=====================================================================
  DATA STRUCTURE DOCUMENTATION
=======================================================================
AEEMSGPriority

Description:
   Specifies the priority of the message.

Definition:
enum {
   AEESMS_PRIORITY_NORMAL,
   AEESMS_PRIORITY_INTERACTIVE,
   AEESMS_PRIORITY_URGENT,
   AEESMS_PRIORITY_EMERGENCY
};
typedef uint32 AEEMSGPriority;

Members:
   AEESMS_PRIORITY_NORMAL:
   AEESMS_PRIORITY_INTERACTIVE:
   AEESMS_PRIORITY_URGENT:
   AEESMS_PRIORITY_EMERGENCY:

Comments:
   None

See Also:
   None

=======================================================================
AEEMSGPrivacy

Description:
   Specifies the Privacy of the message.

Definition:

enum {
   AEESMS_PRIVACY_NORMAL,
   AEESMS_PRIVACY_RESTRICTED,
   AEESMS_PRIVACY_CONFIDENTIAL,
   AEESMS_PRIVACY_SECRET
};
typedef uint32 AEEMSGPrivacy;

Members:

   AEESMS_PRIVACY_NORMAL:
   AEESMS_PRIVACY_RESTRICTED:
   AEESMS_PRIVACY_CONFIDENTIAL:
   AEESMS_PRIVACY_SECRET:

Comments:
   None

See Also:
   None

=======================================================================
AEESMSClass

Description:
   Specifies the class of the message which can be used by application to
decide storage option for the message.

Definition:

enum
{
   AEESMS_CLASS_0,
   AEESMS_CLASS_1,
   AEESMS_CLASS_2,
   AEESMS_CLASS_3,
   AEESMS_CLASS_NONE,
   AEESMS_CLASS_CDMA
};
typedef uint32 AEESMSClass;

Members:

   AEESMS_CLASS_0    : GSM/UMTS Class 0 message
   AEESMS_CLASS_1    : GSM/UMTS Class 1 message
   AEESMS_CLASS_2    : GSM/UMTS Class 2 message
   AEESMS_CLASS_3    : GSM/UMTS Class 3 message
   AEESMS_CLASS_NONE : No message class
   AEESMS_CLASS_CDMA : CDMA message

Comments:
   None

See Also:
   None

=======================================================================
AEESMSTag

Description:
   Specifies the message status in the SIM card.

Definition:

enum
{
   AEESMS_TAG_NONE,
   AEESMS_TAG_MT_READ,
   AEESMS_TAG_MT_NOT_READ,
   AEESMS_TAG_MO_SENT,
   AEESMS_TAG_MO_NOT_SENT,
   AEESMS_TAG_MO_SENT_ST_NOT_RECEIVED,
   AEESMS_TAG_MO_SENT_ST_NOT_STORED,
   AEESMS_TAG_MO_SENT_ST_STORED,
   AEESMS_TAG_MO_TEMPLATE,
   AEESMS_TAG_STATUS_RPT
};
typedef uint32 AEESMSTag;

Members:

   AEESMS_TAG_NONE                     : No status tag. This is treated as don't care for the cases
                                         where tag sets a qualification criteria for specified action
   AEESMS_TAG_MT_READ                  : Message is read
   AEESMS_TAG_MT_NOT_READ              : Message is not read
   AEESMS_TAG_MO_SENT                  : Message is sent
   AEESMS_TAG_MO_NOT_SENT              : Message is not sent
   AEESMS_TAG_MO_SENT_ST_NOT_RECEIVED  : Message sent but status not received. GSM/UMTS specific.
   AEESMS_TAG_MO_SENT_ST_NOT_STORED    : Message sent, status received but not stored. GSM/UMTS specific.
   AEESMS_TAG_MO_SENT_ST_STORED        : Message sent, status received and stored. GSM/UMTS specific.
   AEESMS_TAG_MO_TEMPLATE              : Message is template for mobile originated messages
   AEESMS_TAG_STATUS_RPT               : Message is status report

Comments:
   None

See Also:
   None

=======================================================================
AEESMSType

Description:
   Specifies the message type.

Definition:

enum
{
   AEESMS_TYPE_UNKNOWN = 0,
   AEESMS_TYPE_TEXT,
   AEESMS_TYPE_PAGE,
   AEESMS_TYPE_VOICE_MAIL_NOTIFICATION,
   AEESMS_TYPE_BROADCAST,
   AEESMS_TYPE_WAP,
   AEESMS_TYPE_EMS
};
typedef uint32 AEESMSType;

Members:

   AEESMS_TYPE_UNKNOWN: Incoming SMS Message has a unknown or unrecognised type.

   AEESMS_TYPE_TEXT: Incoming message is CDMA Teleservice CMT_95 Message, or 
                     IS91_SHORT_MESSAGE or GSM SMS Text Message.

   AEESMS_TYPE_PAGE: Incoming message is CDMA Teleservice CPT_95 or IS91 CLI Message

   AEESMS_TYPE_VOICE_MAIL_NOTIFICATION: Incoming message is CDMA Teleservice VMN_95
                                       or IS91 Voice Mail Notification or analog MWI
                                       or GSM SMS Message with Message Waiting Indication.

   AEESMS_TYPE_BROADCAST: Incoming message is broadcast message

   AEESMS_TYPE_WAP: Incoming message is a WAP pus message

   AEESMS_TYPE_EMS: Incoming message is an EMS message

Comments:
   None

See Also:
   None

=======================================================================
AEESMSMsgWaitingType

Description:
   Specifies the message waiting.

Definition:

enum 
{
   AEESMS_MSGWAITINGTYPE_NONE           0
   AEESMS_MSGWAITINGTYPE_DISCARD        1
   AEESMS_MSGWAITINGTYPE_STORE          2
   AEESMS_MSGWAITINGTYPE_NONE_1111      3
};
typedef uint8 AEESMSMsgWaitingType;

Members:

   AEESMS_MSGWAITINGTYPE_NONE: No Message Waiting

   AEESMS_MSGWAITINGTYPE_DISCARD: Do not store the Message Waiting

   AEESMS_MSGWAITINGTYPE_STORE: Store the Message Waiting

   AEESMS_MSGWAITINGTYPE_NONE_1111: No Message Waiting (1111)

Comments:
   None

See Also:
   None

======================================================================= 
AEESMSMsgWaitingKind

Description:
   Specifies the message waiting kind.

Definition:

enum 
{
   AEESMS_MSGWAITINGKIND_VOICEMAIL      0
   AEESMS_MSGWAITINGKIND_FAX            1 
   AEESMS_MSGWAITINGKIND_EMAIL          2
   AEESMS_MSGWAITINGKIND_OTHER          3
};
typedef uint8 AEESMSMsgWaitingKind;

Members:

   AEESMS_MSGWAITINGKIND_VOICEMAIL: Voicemail Message Waiting

   AEESMS_MSGWAITINGKIND_FAX: Fax Message Waiting

   AEESMS_MSGWAITINGKIND_EMAIL: Email Message Waiting

   AEESMS_MSGWAITINGKIND_OTHER: Other Message Waiting

Comments:
   None

See Also:
   None

======================================================================= 
AEESMSUDHId

Description:
   Specifies the message user data header ID.

Definition:

enum 
{
   AEESMS_UDH_CONCAT_8            0
   AEESMS_UDH_SPECIAL_SM          1
   AEESMS_UDH_PORT_8              4
   AEESMS_UDH_PORT_16             5 
   AEESMS_UDH_SMSC_CONTROL        6
   AEESMS_UDH_SOURCE              7
   AEESMS_UDH_CONCAT_16           8
   AEESMS_UDH_WCMP                9
   AEESMS_UDH_TEXT_FORMATING     10
   AEESMS_UDH_PRE_DEF_SOUND      11
   AEESMS_UDH_USER_DEF_SOUND     12
   AEESMS_UDH_PRE_DEF_ANIM       13
   AEESMS_UDH_LARGE_ANIM         14
   AEESMS_UDH_SMALL_ANIM         15
   AEESMS_UDH_LARGE_PICTURE      16
   AEESMS_UDH_SMALL_PICTURE      17
   AEESMS_UDH_VAR_PICTURE        18
   AEESMS_UDH_RFC822             32
};
typedef uint8 AEESMSUDHId;

Comments:
   None

See Also:
   None

=======================================================================  
AEESMSBCType

Description:
   Specifies the message broadcast type.

Definition:

enum
{
   AEESMS_BC_UNKOWN          = 0,
   AEESMS_BC_EMERGENCY,      // 1
   AEESMS_BC_ADMIN,          // 2
   AEESMS_BC_MAINTENANCE,    // 3
   AEESMS_BC_GEN_NEWS_LOC,   // 4
   AEESMS_BC_GEN_NEWS_REG,   // 5
   AEESMS_BC_GEN_NEWS_NAT,   // 6
   AEESMS_BC_GEN_NEWS_INT,   // 7
   AEESMS_BC_FIN_NEWS_LOC,   // 8
   AEESMS_BC_FIN_NEWS_REG,   // 9
   AEESMS_BC_FIN_NEWS_NAT,   // 0xA
   AEESMS_BC_FIN_NEWS_INT,   // 0xB
   AEESMS_BC_SPT_NEWS_LOC,   // 0xC
   AEESMS_BC_SPT_NEWS_REG,   // 0xD
   AEESMS_BC_SPT_NEWS_NAT,   // 0xE
   AEESMS_BC_SPT_NEWS_INT,   // 0xF
   AEESMS_BC_ENT_NEWS_LOC,   // 0x10
   AEESMS_BC_ENT_NEWS_REG,   // 0x11
   AEESMS_BC_ENT_NEWS_NAT,   // 0x12
   AEESMS_BC_ENT_NEWS_INT,   // 0x13
   AEESMS_BC_LOC_WEATHER,    // 0x14
   AEESMS_BC_AREA_TRAFFIC,   // 0x15
   AEESMS_BC_AIRPORT_SCHED,  // 0x16
   AEESMS_BC_RESTAURANTS,    // 0x17
   AEESMS_BC_LODGINGS,       // 0x18
   AEESMS_BC_RETAILS,        // 0x19
   AEESMS_BC_ADS,            // 0x1A
   AEESMS_BC_STOCK_QUOTES,   // 0x1B
   AEESMS_BC_JOBS,           // 0x1C
   AEESMS_BC_MEDICAL,        // 0x1D
   AEESMS_BC_TECH_NEWS,      // 0x1E
   AEESMS_BC_MULTI,          // 0x1F
   AEESMS_BC_MAX             = 0xffff
};
typedef uint32 AEESMSBCType;

Members:
   AEESMS_BC_UNKOWN          = 0			~
   AEESMS_BC_EMERGENCY,      // 1           ~
   AEESMS_BC_ADMIN,          // 2			~
   AEESMS_BC_MAINTENANCE,    // 3			~
   AEESMS_BC_GEN_NEWS_LOC,   // 4			~			
   AEESMS_BC_GEN_NEWS_REG,   // 5			~
   AEESMS_BC_GEN_NEWS_NAT,   // 6			~
   AEESMS_BC_GEN_NEWS_INT,   // 7			~
   AEESMS_BC_FIN_NEWS_LOC,   // 8			~
   AEESMS_BC_FIN_NEWS_REG,   // 9			~
   AEESMS_BC_FIN_NEWS_NAT,   // 0xA			~
   AEESMS_BC_FIN_NEWS_INT,   // 0xB			~
   AEESMS_BC_SPT_NEWS_LOC,   // 0xC			~
   AEESMS_BC_SPT_NEWS_REG,   // 0xD			~
   AEESMS_BC_SPT_NEWS_NAT,   // 0xE			~
   AEESMS_BC_SPT_NEWS_INT,   // 0xF			~
   AEESMS_BC_ENT_NEWS_LOC,   // 0x10		~
   AEESMS_BC_ENT_NEWS_REG,   // 0x11		~
   AEESMS_BC_ENT_NEWS_NAT,   // 0x12		~
   AEESMS_BC_ENT_NEWS_INT,   // 0x13		~			
   AEESMS_BC_LOC_WEATHER,    // 0x14		~
   AEESMS_BC_AREA_TRAFFIC,   // 0x15		~
   AEESMS_BC_AIRPORT_SCHED,  // 0x16		~
   AEESMS_BC_RESTAURANTS,    // 0x17		~
   AEESMS_BC_LODGINGS,       // 0x18		~
   AEESMS_BC_RETAILS,        // 0x19		~
   AEESMS_BC_ADS,            // 0x1A		~
   AEESMS_BC_STOCK_QUOTES,   // 0x1B		~
   AEESMS_BC_JOBS,           // 0x1C		~
   AEESMS_BC_MEDICAL,        // 0x1D		~
   AEESMS_BC_TECH_NEWS,      // 0x1E		~
   AEESMS_BC_MULTI,          // 0x1F		~
   AEESMS_BC_MAX             = 0xffff		~

Comments:
   None

See Also:
   None

=======================================================================
SMSMsgOpt

Description:
   Holds an id, value pair for ISMSMsg.

Definition:
   typedef WebOpt SMSMsgOpt;

Members:
   int32  nId: option id, chosen from one of the message options

   void *pVal: option value, depends on nId

Comments:
   SMSMsgOpt structures indicate various parameters of an SMS message. The structures,
   when passed to AddOpt, are not themselves copied, the contents are copied out

See Also:
   None

=======================================================================
MSGOPT_

The prefix MSGOPT_ is used for SMS message options.
=======================================================================

message options

Description:
   Message option specifies message parameter to be set.

Definition:
   #define MSGOPT_TO_DEVICE_SZ     (WEBOPT_SZ + 0)
   #define MSGOPT_PAYLOAD_SZ       (WEBOPT_SZ + 1)
   #define MSGOPT_BREW_HANDLER_SZ  (WEBOPT_SZ + 2)
   #define MSGOPT_SC_ADDRESS_SZ    (WEBOPT_SZ + 3)
   #define MSGOPT_FROM_DEVICE_SZ   (WEBOPT_SZ + 4)
   #define MSGOPT_CALLBACK_SZ      (WEBOPT_SZ + 5)
   #define MSGOPT_TO_EMAIL_SZ      (WEBOPT_SZ + 6)

   #define MSGOPT_PAYLOAD_WSZ      (WEBOPT_WSZ + 0)

   #define MSGOPT_TIMESTAMP        (WEBOPT_VARIABLE + sizeof(JulianType))

   #define MSGOPT_BREW_CLASS       (WEBOPT_32BIT + 0)
   #define MSGOPT_PRIORITY         (WEBOPT_32BIT + 1)
   #define MSGOPT_PRIVACY          (WEBOPT_32BIT + 2)
   #define MSGOPT_PAYLOAD_ENCODING (WEBOPT_32BIT + 3)
   #define MSGOPT_LANG             (WEBOPT_32BIT + 4)
   #define MSGOPT_CLASS            (WEBOPT_32BIT + 5)
   #define MSGOPT_TAG              (WEBOPT_32BIT + 6)
   #define MSGOPT_MSGTYPE          (WEBOPT_32BIT + 7)
   #define MSGOPT_BCTYPE           (WEBOPT_32BIT + 8)
   #define MSGOPT_REQUEST_DL_ACK   (WEBOPT_32BIT + 9)
   #define MSGOPT_NUM              (WEBOPT_32BIT + 10)
   #define MSGOPT_REQUEST_USER_ACK (WEBOPT_32BIT + 11)
   #define MSGOPT_MOSMS_ENCODING   (WEBOPT_32BIT + 12)
   #define MSGOPT_MSG_ID           (WEBOPT_32BIT + 13)
   #define MSGOPT_REQUEST_READ_ACK (WEBOPT_32BIT + 14)
   #define MSGOPT_DL_ACK           (WEBOPT_32BIT + 15)
   #define MSGOPT_USER_ACK         (WEBOPT_32BIT + 16)
   #define MSGOPT_READ_ACK         (WEBOPT_32BIT + 17)

   #define MSGOPT_PAYLOAD_BINARY   (WEBOPT_VARBUFFER + 0)
   #define MSGOPT_UDH_CONCAT       (WEBOPT_VARBUFFER + 1)
   #define MSGOPT_UDH_SPECIAL_SM   (WEBOPT_VARBUFFER + 2)
   #define MSGOPT_UDH_PORT         (WEBOPT_VARBUFFER + 3)
   #define MSGOPT_UDH_TEXT_FORMAT  (WEBOPT_VARBUFFER + 4)
   #define MSGOPT_UDH_PREDEFINED   (WEBOPT_VARBUFFER + 5)
   #define MSGOPT_UDH_USERDEFINED  (WEBOPT_VARBUFFER + 6)
   #define MSGOPT_UDH_VAR_PICTURE  (WEBOPT_VARBUFFER + 7)
   #define MSGOPT_UDH_RFC822       (WEBOPT_VARBUFFER + 8)
   #define MSGOPT_UDH_OTHER        (WEBOPT_VARBUFFER + 9)

   #define MSGOPT_PAYLOAD_SOURCE   (WEBOPT_INTERFACE + 0)

   #define MSGOPT_END              WEBOPT_END
   #define MSGOPT_ANY              WEBOPT_ANY
   #define MSGOPT_COPYOPTS         WEBOPT_COPYOPTS

Members:
   MSGOPT_TO_DEVICE_SZ     : NULL terminated string providing destination device number. '+'
                             as first character signifies international number.

   MSGOPT_PAYLOAD_SZ       : Null terminated string payload. Good for single-byte formats with
                             encoding where NULL isn't valid character.

   MSGOPT_BREW_HANDLER_SZ  : Null terminated string identifying MIME type of BREW handler for
                             the message.

   MSGOPT_SC_ADDRESS_SZ    : Null terminated string identifying service center address.
                             Specific only for GSM messages.

   MSGOPT_FROM_DEVICE_SZ   : NULL terminated string providing address of the device sending
                             message. '+' as first character signifies international number.

   MSGOPT_CALLBACK_SZ      : NULL terminated string providing callabck number for page

   MSGOPT_TO_EMAIL_SZ      : NULL terminated string providing destination email address.

   MSGOPT_PAYLOAD_WSZ      : Null terminated wide string payload. Good for double-byte formats with
                             encoding where 0x0000 isn't valid character.

   MSGOPT_TIMESTAMP        : JulianType message timestamp for received messages. JulianType message
                             relative validity for MO messages.

   MSGOPT_BREW_CLASS       : AEECLSID Class ID of the destination applet.

   MSGOPT_PRIORITY         : AEESMSPriority message priority

   MSGOPT_PRIVACY          : AEESMSPrivacy message privacy

   MSGOPT_PAYLOAD_ENCODING : BREW encoding of payload buffer. Specified as AEE_ENC_XXX. If this
                             is not specified, payload buffer is assumed to be in default device
                             encoding.

   MSGOPT_LANG             : Message language. Specified as LNG_XXX.If this is not specified,
                             payload buffer is assumed to be in default device language.

   MSGOPT_CLASS            : AEESMSClass message class. Can be used by SMS app to decide
                             storage option for the message.

   MSGOPT_TAG              : AEESMSTag message status tag

   MSGOPT_MSGTYPE          : AEESMSType message type

   MSGOPT_BCTYPE           : AEESMSBCType message broadcast type

   MSGOPT_REQUEST_DL_ACK   : Set TRUE if delivery acknowledgement or status report is requested. 
                             FALSE otherwise.

   MSGOPT_NUM              : Number of messages for voice mail indication

   MSGOPT_REQUEST_USER_ACK : Set TRUE if user acknowledgement is requested. FALSE otherwise.

   MSGOPT_MOSMS_ENCODING   : AEESMSEncType mobile originated SMS encoding type. Specifies
                             encoding to use for sending message over the air. If not specified,
                             ISMS will use default mobile originated SMS encoding specified by
                             OEM.

   MSGOPT_MSG_ID           : Message reference number as received from the network. Applications 
                             can use this with MSGOPT_USER_ACK and MSGOPT_READ_ACK to send user and 
                             read acknowledgement respectively.

   MSGOPT_REQUEST_READ_ACK : Set TRUE if read acknowledgement is requested. FALSE otherwise.

   MSGOPT_DL_ACK           : Set TRUE if message is delivery acknowledgement or status report. FALSE otherwise. 
                             This is applicable only for MT SMS and is ignored, if specified, for MO SMS.

   MSGOPT_USER_ACK         : Set TRUE if message is user acknowledgement. FALSE otherwise.

   MSGOPT_READ_ACK         : Set TRUE if message is read acknowledgement. FALSE otherwise.

   MSGOPT_PAYLOAD_BINARY   : Binary payload.
   
                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Applications can use convenient MACROs 
                             WEBOPT_GETVARBUFFERLENGTH() and WEBOPT_GETVARBUFFERDATA() to get data 
                             length and data respectively. Likewise, applications can use 
                             WEBOPT_SETVARBUFFER() to set binary payload.

   MSGOPT_UDH_CONCAT       : Concatenation User Data Header. Used with AEESMS_UDH_CONCAT_8 and 
                             AEESMS_UDH_CONCAT_16 IDs.
                             
                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format: 
~							 
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (uint8) Sequence Number
                                    1 byte  : (uint8) Total Messages 
                                    2 bytes : (uint16) Message Reference Number                                  
*
   
                          Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHCONCAT8BUFFER() and
                             MSGOPT_SETUDHCONCAT16BUFFER() to set user data header buffer.

   MSGOPT_UDH_SPECIAL_SM   : Special SM User Data Header. Used with AEESMS_UDH_SPECIAL_SM ID.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format:
~
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (AEESMSMsgWaitingType)
                                    1 byte  : (AEESMSMsgWaitingKind)
                                    1 byte  : (uint8) Message Count
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHSPECIALSMBUFFER() to set user 
                             data header buffer.

   MSGOPT_UDH_PORT         : Port User Data Header. Used with AEESMS_UDH_PORT_8 and AEESMS_UDH_PORT_16 IDs.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first.  Next bytes have data in following
                             format: 
~							 
                                    1 byte  : (AEESMSUDHId)
                                    2 bytes : (uint16) Destination Port
                                    2 bytes : (uint16) Origination Port
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHPORT8BUFFER() and 
                             MSGOPT_SETUDHPORT16BUFFER() to set user data header buffer.

   MSGOPT_UDH_TEXT_FORMAT  : Text Formatting User Data Header. Used with AEESMS_UDH_TEXT_FORMATING ID.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format: 
~							 
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (uint8) Starting Position
                                    1 byte  : (uint8) Text Formatting Length 
                                    1 byte  : Text Formatting Style
~
                                              Bit 1 and Bit 0:
~											  
															   00  Left Alignment
                                                               01  Center Alignment
                                                               10  Right Alignment
                                                               11  Default Alignment
*
                                              Bit 3 and Bit 2: 
~											                   
															   00  Normal Font Size
                                                               01  Large Font Size
                                                               10  Small Font Size
*                                                              11  Reserved Font Size

                                              Bit 4:  1  Bold
                                              Bit 5:  1  Italic

                                              Bit 6:  1  Underlined
                                              Bit 7:  1  Strikethrough
*
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHTEXTFORMATBUFFER() to set user 
                             data header buffer.

   MSGOPT_UDH_PREDEFINED   : Predefined Animation / Sound User Data Header. Used with AEESMS_UDH_PRE_DEF_SOUND 
                             and AEESMS_UDH_PRE_DEF_ANIM IDs.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format:
~
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (uint8) Position
                                    1 byte  : (uint8) Animation / Sound Number
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHPREDEFSOUNDBUFFER() and 
                             MSGOPT_SETUDHPREDEFANIMBUFFER() to set user data header buffer.

   MSGOPT_UDH_USERDEFINED  : Userdefined Picture / Animation / Sound User Data Header. Used with 
                             AEESMS_UDH_USER_DEF_SOUND, AEESMS_UDH_LARGE_ANIM, AEESMS_UDH_SMALL_ANIM, 
                             AEESMS_UDH_LARGE_PIC and AEESMS_UDH_SMALL_PIC IDs.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format:
~							 
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (uint8) Positions
                                    1 byte  : (uint8) Data Length
*
                        <Data length> bytes : Data 
~
                                              Data Length for AEESMS_UDH_LARGE_ANIM =  128
                                              Data Length for AEESMS_UDH_SMALL_ANIM =   32
                                              Data Length for AEESMS_UDH_LARGE_PIC =   128
                                              Data Length for AEESMS_UDH_SMALL_PIC =    32
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. ~
                             Likewise, applications can use ~
							 MSGOPT_SETUDHUSERDEFSOUNDBUFFER(),~
                             MSGOPT_SETUDHLARGEANIMBUFFER(), ~
							 MSGOPT_SETUDHSMALLANIMBUFFER(), ~
                             MSGOPT_SETUDHLARGEPICBUFFER() ~
							 and MSGOPT_SETUDHSMALLPICBUFFER()~ 
                             to set user data header buffer.

   MSGOPT_UDH_VAR_PICTURE  : Variable Picture User Data Header. Used with AEESMS_UDH_VAR_PICTURE ID.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format: 
~							 
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (uint8) Positions
                                    1 byte  : (uint8) Width of Picture
                                    1 byte  : (uint8) Height of Picture
*
===pre>
           <((Width*Height) + 7) / 8> bytes : Data
===/pre>

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHVARPICBUFFER() to set user 
                             data header buffer.

   MSGOPT_UDH_RFC822       : RFC 822 (Email) User Data Header. Used with AEESMS_UDH_RFC822 ID.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format:
~							 
                                    1 byte  : (AEESMSUDHId)
                                    1 byte  : (uint8) Header Length
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETRFC822BUFFER() to set user 
                             data header buffer.

   MSGOPT_UDH_OTHER        : Other User Data Header. Used with the remaining AEESMSUDHId.

                             The first two bytes give the length of the following data. The length 
                             is little-endian, low byte first. Next bytes have data in following
                             format: 
~							 
                                    1 byte  : (AEESMSUDHId)
                                    2 bytes : (uint16) Header Length
===pre>
                      <Header Length> bytes : Data
===/pre>
*

                             Applications can use convenient MACROs MSGOPT_GETUDHBUFFERLENGTH() and 
                             MSGOPT_GETUDHBUFFERDATA() to get data length and data respectively. 
                             Likewise, applications can use MSGOPT_SETUDHOTHERBUFFER() to set user 
                             data header buffer.

   MSGOPT_PAYLOAD_SOURCE   : IAStream message stream

   MSGOPT_END              : No pVal, ignore rest, used for terminating a vector of SMSMsgOpts

   MSGOPT_ANY              : No pVal, matches any opt, used for enumeration

   MSGOPT_COPYOPTS         : pVal boolean, if set to TRUE, causes the ISMSMsg to copy current
                             and future SMSMsgOpt

Comments:
   1. Applications must specify only one of MSGOPT_BREW_CLASS and 
      MSGOPT_BREW_HANDLER_SZ options. Specifying both will result in one of
      the option being ignored. Implementation doesn't publish the order in which
      these options are checked.

   2. Applications must specify only one of MSGOPT_PAYLOAD_SZ, MSGOPT_PAYLOAD_WSZ 
      and MSGOPT_PAYLOAD_BINARY payload options. Specifying multiple options will 
      result in extra payload options being ignored. Implementation doesn't publish 
      the order in which these options are checked.

See Also:
   None

=======================================================================
AEESMSStorageType

Description:
   Specifies the message storage type.

Definition:

enum
{
   AEESMS_CARD_RUIM,
   AEESMS_CARD_SIM,
   AEESMS_NV_CDMA,
   AEESMS_NV_GW
};
typedef uint32 AEESMSStorageType;

Members:

   AEESMS_CARD_RUIM : RUIM Card
   AEESMS_CARD_SIM : SIM Card
   AEESMS_NV_CDMA : CDMA NV
   AEESMS_NV_GW : GW NV

Comments:
   None

See Also:
   None

=======================================================================
AEESMSStorageStatus

Description:
   Specifies the SMS storage status

Definition:

typedef struct
{
   uint32                     nSize;
   uint32                     nMaxSlots;
   uint32                     nFreeSlots;
   uint32                     nUsedTagSlots;
} AEESMSStorageStatus;


Members:
   nSize: struct size
   nMaxSlots: Maximum number of slots
   nFreeSlots: Number of free slots
   nUsedTagSlots: Used slot for specified tag type

Comments:
   None

See Also:
   None

=======================================================================
AEESMSBCAlertType

Description:
   Specifies the alert type for a broadcast message.

Definition:

enum
{
   AEESMS_BC_ALERT_NONE  = 0,
   AEESMS_BC_ALERT_DEFAULT,
   AEESMS_BC_ALERT_VIBRATE_ONCE,
   AEESMS_BC_ALERT_VIBRATE_REPEAT,
   AEESMS_BC_ALERT_VISUAL_ONCE,
   AEESMS_BC_ALERT_VISUAL_REPEAT,
   AEESMS_BC_ALERT_LOW_PRIORITY_ONCE,
   AEESMS_BC_ALERT_LOW_PRIORITY_REPEAT,
   AEESMS_BC_ALERT_MEDIUM_PRIORITY_ONCE,
   AEESMS_BC_ALERT_MEDIUM_PRIORITY_REPEAT,
   AEESMS_BC_ALERT_HIGH_PRIORITY_ONCE,
   AEESMS_BC_ALERT_HIGH_PRIORITY_REPEAT
};
typedef unit32 AEESMSBCAlertType;

Members:

   AEESMS_BC_ALERT_NONE	~						
   AEESMS_BC_ALERT_DEFAULT ~
   AEESMS_BC_ALERT_VIBRATE_ONCE ~
   AEESMS_BC_ALERT_VIBRATE_REPEAT ~
   AEESMS_BC_ALERT_VISUAL_ONCE ~
   AEESMS_BC_ALERT_VISUAL_REPEAT ~
   AEESMS_BC_ALERT_LOW_PRIORITY_ONCE ~
   AEESMS_BC_ALERT_LOW_PRIORITY_REPEAT ~
   AEESMS_BC_ALERT_MEDIUM_PRIORITY_ONCE ~
   AEESMS_BC_ALERT_MEDIUM_PRIORITY_REPEAT ~
   AEESMS_BC_ALERT_HIGH_PRIORITY_ONCE ~
   AEESMS_BC_ALERT_HIGH_PRIORITY_REPEAT ~

Comments:
   None

See Also:
   None

=======================================================================

SMSBCSrvOpts

Description:
   Holds an id, value pair for ISMSBCSrvOpts.

Definition:
   typedef WebOpt SMSBCSrvOpts;

Members:
   int32  nId: option id, chosen from one of the SMS broadcast service options

   void *pVal: option value, depends on nId

Comments:
   SMSBCSrvOpts structures indicate various parameters of SMS broadcast service.
   The structures, when passed to AddOpt, are not themselves copied, the contents
   are copied out.

See Also:
   None

=======================================================================
SMSBCSRVOPT_


The prefix SMSBCSRVOPT_ is used for SMS broadcast service options.
=======================================================================

SMS broadcast service options

Description:
   A SMS broadcast service option specifies message parameter to be set.

Definition:

   #define SMSBCSRVOPT_LABEL_SZ         (WEBOPT_SZ + 0)

   #define SMSBCSRVOPT_SELECTED         (WEBOPT_32BIT + 0)
   #define SMSBCSRVOPT_PRIORITY         (WEBOPT_32BIT + 1)
   #define SMSBCSRVOPT_LABEL_ENCODING   (WEBOPT_32BIT + 2)
   #define SMSBCSRVOPT_ALERT            (WEBOPT_32BIT + 3)
   #define SMSBCSRVOPT_MAX_MSGS         (WEBOPT_32BIT + 4)

   #define SMSBCSRVOPT_SERVICEID        (WEBOPT_VARIABLE + sizeof(AEESMSBCSrvID))

   #define SMSBCSRVOPT_END              WEBOPT_END
   #define SMSBCSRVOPT_ANY              WEBOPT_ANY
   #define SMSBCSRVOPT_COPYOPTS         WEBOPT_COPYOPTS

Members:
   SMSBCSRVOPT_LABEL_SZ       : Null terminated string identifying service label in the table.
                                Specific only to CDMA.

   SMSBCSRVOPT_SELECTED       : Set TRUE if service is selected. FALSE otherwise.

   SMSBCSRVOPT_PRIORITY       : Priority threshold for the service

   SMSBCSRVOPT_LABEL_ENCODING : BREW encoding of service label. Specified as AEE_ENC_XXX.If this
                                is not specified, label is assumed to be in default device encoding.

   SMSBCSRVOPT_ALERT          : AEESMSBCAlertType alert type for the service

   SMSBCSRVOPT_MAX_MSGS       : Limit on maximum messages which can be stored for the service

   SMSBCSRVOPT_SERVICEID      : AEESMSBCSrvID Service ID

   SMSBCSRVOPT_END            : No pVal, ignore rest, used for terminating a vector of SMSBCSrvOpts

   SMSBCSRVOPT_ANY            : No pVal, matches any opt, used for enumeration

   SMSBCSRVOPT_COPYOPTS       : pVal boolean, if set to TRUE, causes the ISMSBCSrvOpts to copy current
                                and future SMSBCSrvOpts

Comments:
   None

See Also:
   None

=======================================================================
AEESMSBCConfig

Description:
   Specifies carriers broadcast configuration.

Definition:

enum
{
   AEESMS_BC_CONFIG_DISALLOW,
   AEESMS_BC_CONFIG_ALLOW_TABLE,
   AEESMS_BC_CONFIG_ALLOW_ALL

};
typedef uint32 AEESMSBCConfig;

Members:

   AEESMS_BC_CONFIG_DISALLOW     : No broadcast to devices allowed
   AEESMS_BC_CONFIG_ALLOW_TABLE  : Allow broadcast of services specified
                                   in device service table only
   AEESMS_BC_CONFIG_ALLOW_ALL    : Allow broadcast of all services

Comments:
   None

See Also:
   None

=======================================================================
AEESMSBCPref

Description:
   Specifies clients broadcast preference.

Definition:

enum
{
   AEESMS_BC_PREF_DISALLOW,
   AEESMS_BC_PREF_ALLOW_TABLE,
   AEESMS_BC_PREF_ALLOW_ALL

};
typedef uint32 AEESMSBCPref;


Members:

   AEESMS_BC_PREF_DISALLOW     : Client doesn't want any broadcast message
   AEESMS_BC_PREF_ALLOW_TABLE  : Client wants broadcast messages of services specified in
                                 device service table only
   AEESMS_BC_PREF_ALLOW_ALL    : Client wants all broadcast messages

Comments:
   None

See Also:
   None

=======================================================================
AEESMSMode

Description:
   Specifies clients broadcast message mode.

Definition:

enum
{
   AEESMS_MODE_CDMA,
   AEESMS_MODE_GW
};
typedef uint32 AEESMSMode;


Members:

   AEESMS_MODE_CDMA            : CDMA Message Mode
   AEESMS_MODE_GW              : GSM / WCDMA Message Mode

Comments:
   None

See Also:
   None

======================================================================= 
AEESMSBCSrvID

Description:
   Broadcast service ID. Serves as identifier for a broadcast service.

Definition:

typedef struct
{
   AEESMSBCType srvType;
   uint32 dwLang;
   uint16 fromService;
   uint16 toService;
} AEESMSBCSrvID;

Members:
   srvType: Service Type
   dwLang: Language ID
   fromService: From Service ID
   toService  : To Service ID

Comments:
   srvType and dwLang are valid only for message mode AEESMS_MODE_CDMA.
   fromService and toService are valid only for message mode AEESMS_MODE_GW.

See Also:
   AEESMSBCType

=======================================================================
AEESMSClientStatus

Description:
   Specifies the status of main client. This status is used to decide
decide how OEM layer should acknowledge the incoming message.

Definition:

{
   AEESMS_CS_OK,
   AEESMS_CS_OUT_OF_RESOURCES
};
typedef uint32 AEESMSClientStatus;

Members:

   AEESMS_CS_OK : OK status
   AEESMS_CS_OUT_OF_RESOURCES : Out of resources

Comments:
   None

See Also:
   ISMS_SetClientStatus

=======================================================================
AEESMS Domain Preference

Description:
   Specify domain preference for GW (GSM, WCDMA) messages. Domain
preference can be set and get using ICONFIG_SetItem and ICONFIG_GetItem
respectively with CFGI_SMS_GW_DOMAIN_PREF.

Definition:

#define AEESMS_GW_DOMAIN_PREF_CS_PREFERRED      0
#define AEESMS_GW_DOMAIN_PREF_PS_PREFERRED      1
#define AEESMS_GW_DOMAIN_PREF_CS_ONLY           2
#define AEESMS_GW_DOMAIN_PREF_PS_ONLY           3

Members:

AEESMS_GW_DOMAIN_PREF_CS_PREFERRED: Circuit Switch Preferred
AEESMS_GW_DOMAIN_PREF_PS_PREFERRED: Packet Switch Preferred
AEESMS_GW_DOMAIN_PREF_CS_ONLY: Circuit Switch Only
AEESMS_GW_DOMAIN_PREF_PS_ONLY: Packet Switch Only

Comments:
   Return code for ICONFIG_SetItem(CFGI_SMS_GW_DOMAIN_PREF) only indicates
if request for domain preference change is accepted or not. Clients are advised 
to use ICONFIG_GetItem(CFGI_SMS_GW_DOMAIN_PREF) to check if request for domain
preference change is satisfied.
   Asynchronous implementation of this feature in OEM layer might make
immediate ICONFIG_GetItem(CFGI_SMS_GW_DOMAIN_PREF) call return previous
setting. Clients calling ICONFIG_GetItem(CFGI_SMS_GW_DOMAIN_PREF) to ascertain 
change in domain preference are advised to do so asynchronously.

See Also:
   ICONFIG_SetItem(), ICONFIG_GetItem(), CFGI_SMS_GW_DOMAIN_PREF

=======================================================================

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================

Interface Name: ISMSMsg

Description:
   ISMSMsg interface encapsulates message that can be sent/received by an
application using ISMS interface. It inherits from IWebOpts to let
application specify/access various parameters associated with the message.

For sending message, the ISMSMsg interface instance is obtained via
ISHELL_CreateInstance() mechanism. While receiving message, message ID
is provided in ((AEENotify *)dwParam)->pData of the EVT_NOTIFY. Applications 
can then receive message corresponding to the message ID using ISMS_ReceiveMsg()

=============================================================================

ISMSMSG_AddRef()

Description:
   This method increments the reference count of the ISMSMsg Interface object.
   This allows the object to be shared by multiple callers. The object is freed when
   the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSMSG_AddRef(ISMSMsg * po)

Parameters:

   po [in]: Pointer to the ISMSMsg Interface object

Return Value:
   Incremented reference count for the object

Comments:
   A valid object returns a positive reference count.

Side Effects:
   None

See Also:
   ISMSMSG_Release()

=============================================================================

ISMSMSG_Release()

Description:
   This method decrements the reference count of an object. The object is freed
   from memory and is no longer valid once the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSMSG_Release(ISMSMsg * po)

Parameters:

   po [in]: Pointer to the ISMSMsg Interface object

Return Value:
   Decremented reference count for the object. The object has been freed and is no
   longer valid if 0 (zero) is returned.

Comments:
   None

Side Effects:
   None

See Also:
   ISMSMSG_AddRef()

==============================================================================

Function: ISMSMSG_QueryInterface()

Description:

   This method retrieves a pointer to an interface conforming to the
   definition of the specified class ID.  This can be used to query for
   extended functionality, like future versions or proprietary extensions.

   Upon a successful query, the interace is returned AddRef'ed.  The caller is
   responsible for calling Release() at some point in the future.  One
   exception is when the pointer returned is not an interface pointer.  In
   that case, the memory will share the lifetime of the object being queried,
   and the returned pointer will not be used to free or release the object.

Prototype:

   int ISMSMSG_QueryInterface(ISMSMsg *po, AEECLSID id, void **p)

Parameters:

   po [in]: Pointer to ISMSMsg interface

   id [in]: A globally unique id to identify the entity (interface or data) that we
            are trying to query.

   p [out]: Pointer to the data or interface that we want to retrieve.  If the interface
            is not available, this is set to NULL.

Return Value:

   Return SUCCESS on success,

   ECLASSNOTSUPPORT if class ID not supported

Comments:

   On failure, QueryInterface() must set *po to NULL.

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMSMSG_AddOpt()

Description:
   Append the list of SMSMsgOpts to the current message option set

Prototype:

  int ISMSMSG_AddOpt(ISMSMsg *po, SMSMsgOpt *apwoz)

Parameters:

  po: the interface pointer

  apwoz: array of SMSMsgOpt structs, terminated by a SMSMsgOpt with
         nId set to MSGOPT_END

Return Value:
   SUCCESS if the options could be added successfully

   ENOMEMORY if enough memory couldn't be allocated

Comments:
   Even though multiple SMSMsgOpts corresponding to an option ID
   can be added, ISMSMsg uses only the most recently added
   SMSMsgOpt.

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMSMSG_RemoveOpt()

Description:
   Removes the most recently added SMSMsgOpt matching nOptId

Prototype:

   int ISMSMSG_RemoveOpt(ISMSMsg *po, int nOptId)

Parameters:

   po:  the interface pointer

   nOptId: id of the option to remove from the options list

Return Value:
   SUCCESS if the options could be added successfully

   EFAILED if the specified SMSMsgOpt couldn't be found

Comments:
   None

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMSMSG_GetOpt()

Description:

   Find most recently added SMSMsgOpt, in the list of SMSMsgOpts in po,
   matching nOptId. pwo is filled in with a the matching SMSMsgOpt contents.

Prototype:

   int ISMSMSG_GetOpt(ISMSMsg *po, int32 nOptId, SMSMsgOpt *pwo)

Parameters:
   po :  the interface pointer

   nOptId: id of the option to find in the options list

   pwo: where to stick the found SMSMsgOpt

Return Value:
   SUCCESS if the options could be added successfully

   EFAILED if the specified SMSMsgOpt couldn't be found

Comments:
   None

Side Effects:
   None

See Also:
   None

=============================================================================

Function: ISMSMSG_GetOptWithIndex()

Description: 
    
   Find most recently added SMSMsgOpt, in the list of SMSMsgOpts in po, 
   matching nOptId. pwo is filled in with a the matching SMSMsgOpt contents.

Prototype:

   int ISMSMSG_GetOptWithIndex(ISMSMsg *po, int32 nOptId, int32 index, SMSMsgOpt *pwo)

Parameters:
   po :  the interface pointer

   nOptId: id of the option to find in the options list

   index: Option Index.

   pwo: where to stick the found SMSMsgOpt

Return Value:  
   SUCCESS if the options could be added successfully

   EFAILED if the specified SMSMsgOpt couldn't be found
    
Comments:
   None

Side Effects:
   None

See Also:
   None

=============================================================================

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================

Interface Name: ISMS

Description:
   ISMS interface lets application send/receive messages encapsulated by
ISMSMsg interface.

The ISMS interface instance is obtained via ISHELL_CreateInstance()
mechanism.

=============================================================================

ISMS_AddRef()

Description:
   This method increments the reference count of the ISMS Interface object.
   This allows the object to be shared by multiple callers. The object is freed when
   the reference count reaches 0 (zero).

Prototype:
   uint32 ISMS_AddRef(ISMS * po)

Parameters:

   po [in]: Pointer to the ISMS Interface object

Return Value:
   Incremented reference count for the object

Comments:
   A valid object returns a positive reference count.

Side Effects:
   None

See Also:
   ISMS_Release()

=============================================================================

ISMS_Release()

Description:
   This method decrements the reference count of an object. The object is freed
   from memory and is no longer valid once the reference count reaches 0 (zero).

Prototype:
   uint32 ISMS_Release(ISMS * po)

Parameters:

   po [in]: Pointer to the ISMS Interface object

Return Value:
   Decremented reference count for the object. The object has been freed and is no
   longer valid if 0 (zero) is returned.

Comments:
   None

Side Effects:
   None

See Also:
   ISMS_AddRef()

==============================================================================

Function: ISMS_QueryInterface()

Description:

   This method retrieves a pointer to an interface conforming to the
   definition of the specified class ID.  This can be used to query for
   extended functionality, like future versions or proprietary extensions.

   Upon a successful query, the interace is returned AddRef'ed.  The caller is
   responsible for calling Release() at some point in the future.  One
   exception is when the pointer returned is not an interface pointer.  In
   that case, the memory will share the lifetime of the object being queried,
   and the returned pointer will not be used to free or release the object.

Prototype:

   int ISMS_QueryInterface(ISMS *po, AEECLSID id, void **p)

Parameters:

   po [in]: Pointer to ISMS interface.

   id [in]: A globally unique id to identify the entity (interface or data) that we
            are trying to query.

   p [out]: Pointer to the data or interface that we want to retrieve.  If the interface
            is not available, this is set to NULL.

Return Value:

   Return SUCCESS on success,
   ECLASSNOTSUPPORT if class ID not supported

Comments:

   On failure, QueryInterface() must set *po to NULL.

Side Effects:
   None

See Also:
  None
=======================================================================

Function: ISMS_SendMsg()

Description:
   This method is used to send messages from the handset.This method can be used to
   send messages to either a specific BREW application on another handset or a general
   text message to the handset.

Prototype:
   void ISMS_SendMsg(ISMS *po, const ISMSMsg * pISMSMsg, AEECallback * pcb, uint32 *pnRv)

Parameters:
   po [in]: Pointer to ISMS interface

   pISMSMsg [in]: Pointer to ISMSMsg interface pointing to the message to be sent

   pcb [in]: Pointer to callback to inform the status of the message sent

   pnRv [out]: Place holder for return value

Return Value:
   None

Comments:

   Following may be returned in pnRv:

   SUCCESS: If successful. After the message is sent to the other handset, the callback 
            will be invoked with the status.

   EITEMBUSY: EITEMBUSY is returned if ISMS cannot accommodate the message in its queue
              of message(s) pending for sending.

   EBADPARM: If ISMSMsg parameters are incomplete or incorrect

   EFAILED: General failure in sending the message

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMS_ReceiveMsg()

Description:
   Applications are notified of messages by EVT_NOTIFY where 
   ((AEENotify *)dwParam)->pData contains message ID. Using this method, 
   applications can receive the message.

Prototype:
   int ISMS_ReceiveMsg(ISMS *po, uint32 uMsgId, ISMSMsg **ppMsg)

Parameters:
   po [in]: Pointer to ISMS interface

   uMsgId [in]: Message ID

   ppMsg [out]: Place holder for ISMSMsg interface pointing to the message

Return Value:
   SUCCESS: IF successful.

Comments:
   Message payload of encoding AEE_ENC_UNICODE is specified using MSGOPT_PAYLOAD_WSZ.~
   Message payload of encoding AEE_ENC_ISOLATIN1 is specified using MSGOPT_PAYLOAD_SZ.~
   Message payload of other encoding types are specified using MSGOPT_PAYLOAD_BINARY.

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMS_SetClientStatus()

Description:
   Use of this API will expect that caller has AEECLSID_SMSMAINCLIENT privilege.
Using this API, main client can specify its status for a message type. This status 
is used to decide how ISMS should acknowledge the incoming message for the specified message
type.

Prototype:
   int ISMS_SetClientStatus(ISMS *po, AEESMSClientStatus cs, AEESMSType mt); 

Parameters:
   po [in]: Pointer to ISMS interface

   cs [in]: Client Status

   mt [in]: Message Type

Return Value:
   SUCCESS - If successful

   EFAILED - If failed

   EPRIVLEVEL - App doesn't have AEECLSID_SMSMAINCLIENT privilege

Comments:
   AEECLSID_SMSMAINCLIENT class ID is used solely for privilege to do set client
   status. This class ID only goes into the calling apps's extension list to get
   signed for permission to be able to set main client status.

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMS_GetBytesAvailableForPayload()

Description:
   Checks various ISMSMsg parameters and finds that how many more bytes and
   bits are available for payload. If pISMSMsg is NULL pointer, it returns
   maximum number of bytes allowed for payload.

Prototype:
   int ISMS_GetBytesAvailableForPayload(ISMS * po, ISMSMsg * pISMSMsg, int * pnBytes, int * pnPadding)

Parameters:
   po [in]: Pointer to ISMS interface

   pISMSMsg [in]: Pointer to ISMSMsg interface

   pnBytes [out]: Place holder for bytes available for payload

   pnPadding [out]: Place holder for bits padded. useful only if MSGOPT_MOSMS_ENCODING
                    is AEESMS_ENC_ASCII

Return Value:
   SUCCESS - If successful

   EFAILED - Otherwise

Comments:
   None

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMS_GetEncodingsAvailableForMOSMS()

Description:
   Queries OEM layer to list encodings available for MO SMS.

Prototype:
   int ISMS_GetEncodingsAvailableForMOSMS(ISMS * po, uint32 * pBuffer, uint32 * pnSize)

Parameters:
   po [in]: Pointer to ISMS interface

   pBuffer [out]: Place holder for available MO SMS encoding options

   pSize [out]: Place holder for size of the memory referred by pBuffer

Return Value:
   SUCCESS - If successful

   EFAILED - Otherwise

Comments:
   Applications can pass NULL pBuffer to query memory size required for holding
   MO SMS encoding options.

Side Effects:
   None

See Also:
   None

=======================================================================

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================

Interface Name: ISMSNotifier

Description:
  ISMSNotifier is the notifier class with which applications can register
  for SMS notifications in following ways:

  1. Using application MIF
  2. Using ISHELL_RegisterNotify()

  Applications are not required and cann't create an instance of ISMSNotifier.

Following are the notification masks supported by ISMSNotifier:

#define NMASK_SMS_TYPE         0x0001   Arrival of SMS for specific AEESMSType
#define NMASK_SMS_BROADCAST    0x0002   Arrival of broadcast SMS


=======================================================================

NMASK_SMS_TYPE

Description:

   This is a notification mask that allows applications to register for SMS message
of a specific message type. To construct the actual 32-bit mask to be used in the
MIF for the registration, the upper 16 bits of the mask must contain the message
type and the lower 16 bits must contain NMASK_SMS_TYPE.
For example: To register for voice mail notifications, a message with type
AEESMS_TYPE_VOICE_MAIL_NOTIFICATION, the 32-mask should be:
((AEESMS_TYPE_VOICE_MAIL_NOTIFICATION << 16) | NMASK_SMS_TYPE).
When the SMS message of specified message typeis received by the system, the application
is notified through the EVT_NOTIFY event. The dwParam of this event is of type AEENotify.
The pData member in this AEENotify structure will contain message ID. Apps can use
ISMS_ReceiveMsg() to receive message corresponding to the message ID.

Definition:
   #define NMASK_SMS_TYPE     0x0001

Members:
   None

Comments:
   None


See Also:
   None

=======================================================================

NMASK_SMS_BROADCAST

Description:

   This is a notification mask that allows applications to register for SMS
broadcast messages of a specific type. To construct the actual 32-bit mask to
be used in the MIF for the registration, the upper 16 bits of the mask must
contain the message broadcase and the lower 16 bits must contain NMASK_SMS_BROADCAST.
For example: To register for emergency broadcast messages, a message with type
AEESMS_BC_EMERGENCY, the 32-mask should be:
   ((AEESMS_BC_EMERGENCY << 16) | NMASK_SMS_BROADCAST).
When the broadcast SMS message of specified message type is received by the system,
the application is notified through the EVT_NOTIFY event. The dwParam of this event
is of type AEENotify. The pData member in this AEENotify structure will contain
message ID. Apps can use ISMS_ReceiveMsg() to receive message corresponding
to the message ID.

Definition:
   #define NMASK_SMS_BROADCAST     0x0002

Members:
   None

Comments:
   None


See Also:
   None

=======================================================================

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================

Interface Name: ISMSStorage

Description:
   ISMSStorage interface encapsulates SMS storage (RUIM/SIM).Use of this 
   interface will expect that caller has AEECLSID_SMSMAINCLIENT privilege.

=============================================================================

ISMSSTORAGE_AddRef()

Description:
   This method increments the reference count of the ISMSStorage Interface object.
   This allows the object to be shared by multiple callers. The object is freed when
   the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSSTORAGE_AddRef(ISMSStorage * po)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object

Return Value:
   Incremented reference count for the object

Comments:
   A valid object returns a positive reference count.

Side Effects:
   None

See Also:
   ISMSSTORAGE_Release()

=============================================================================

ISMSSTORAGE_Release()

Description:
   This method decrements the reference count of an object. The object is freed
   from memory and is no longer valid once the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSSTORAGE_Release(ISMSStorage * po)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object

Return Value:
   Decremented reference count for the object. The object has been freed and is no
   longer valid if 0 (zero) is returned.

Comments:
   None

Side Effects:
   None

See Also:
   ISMSSTORAGE_AddRef()

==============================================================================

Function: ISMSSTORAGE_QueryInterface()

Description:

   This method retrieves a pointer to an interface conforming to the
   definition of the specified class ID.  This can be used to query for
   extended functionality, like future versions or proprietary extensions.

   Upon a successful query, the interace is returned AddRef'ed.  The caller is
   responsible for calling Release() at some point in the future.  One
   exception is when the pointer returned is not an interface pointer.  In
   that case, the memory will share the lifetime of the object being queried,
   and the returned pointer will not be used to free or release the object.

Prototype:

   int ISMSSTORAGE_QueryInterface(ISMSStorage *po, AEECLSID id, void **p)

Parameters:

   po [in]: Pointer to ISMSStorage interface

   id [in]: A globally unique id to identify the entity (interface or data) that we
            are trying to query.

   p [out]: Pointer to the data or interface that we want to retrieve.  If the interface
            is not available, this is set to NULL.

Return Value:

   Return SUCCESS on success,

   ECLASSNOTSUPPORT if class ID not supported

Comments:

   On failure, QueryInterface() must set *po to NULL.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_GetStorageStatus()

Description:
   This method returns storage status corresponding to the specified storage type.
   This can also be used to count messages of a particular tag stored on the specified
   storage type.

Prototype:
   void ISMSSTORAGE_GetStorageStatus(ISMSStorage * po, AEESMSStorageType st, AEESMSTag mt, AEECallback *pcb, AEESMSStorageStatus * pss, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   mt [in]: Message Tag
   pcb [in]: Callback
   pss [out]: Place holder for storage status
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pss and pnErr must remain valid during entire transaction.These are filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_StoreMsg()

Description:
   This method stores a message on the specified storage type.

Prototype:
   void ISMSSTORAGE_StoreMsg(ISMSStorage * po, AEESMSStorageType st, ISMSMsg * pi, AEECallback *pcb, uint32 * pnIndex, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   pi [in]: Pointer to ISMSMsg interface
   pcb [in]: Callback
   pnIndex [out]: Place holder for message index in SMS storage
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnIndex and pnErr must remain valid during entire transaction. These are filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_ReadMsg()

Description:
   This method reads a message from the specified storage type.

Prototype:
   void ISMSSTORAGE_ReadMsg(ISMSStorage * po, AEESMSStorageType st, uint32 nIndex, AEECallback *pcb, ISMSMsg ** ppi, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   nIndex [in] : Message index in SMS storage
   pcb [in]: Callback
   ppi [out]: Place holder for pointer to ISMSMsg interface. Must be released by application.
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   ppi and pnErr must remain valid during entire transaction. These are filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_DeleteAll()

Description:
   This method deletes all the messages from the specified storage type.

Prototype:
   void ISMSSTORAGE_DeleteAll(ISMSStorage * po, AEESMSStorageType st, AEECallback *pcb, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction. This is filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_DeleteMsgTag()

Description:
   This method deletes all the messages of specified tag from the specified
   storage type.

Prototype:
   void ISMSSTORAGE_DeleteMsgTag(ISMSStorage * po, AEESMSStorageType st, AEESMSTag mt, AEECallback *pcb, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   mt [in]: Message Tag
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction. This is filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_DeleteMsg()

Description:
   This method deletes message of specified index from the specified
   storage type.

Prototype:
   void ISMSSTORAGE_DeleteMsg(ISMSStorage * po, AEESMSStorageType st, uint32 nIndex, AEECallback *pcb, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   nIndex [in]: Message Index
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction. This is filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_EnumMsgInit()

Description:
   This method initializes the specified storage type for enumeration of the
messages of the specified tag. If storage device is already being enumerated,
calling ISMSSTORAGE_EnumMsgInit() resets the enumeration criteria to new
criteria and prepares storage device for enumeration as per new criteria.

Prototype:
   void ISMSSTORAGE_EnumMsgInit(ISMSStorage * po, AEESMSStorageType st, AEESMSTag mt, AEECallback *pcb, uint32 *pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   mt [in]: Message Tag
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction. This is filled by
   ISMSSTORAGE and can be examined in the callback function.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSSTORAGE_EnumNextMsg()

Description:
   This method retrieves information about next message on specified storage type
that meets enumeration criteria specified in ISMSSTORAGE_EnumMsgInit()

Prototype:
   void ISMSSTORAGE_EnumNextMsg(ISMSStorage * po, AEESMSStorageType st, AEECallback *pcb, uint32 * pnIndex, ISMSMsg ** ppi, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSStorage Interface object
   st [in]: Storage Type
   pcb [in]: Callback
   pnIndex [out]: Place holder for message index in SMS storage
   ppi [out]: Place holder for pointer to ISMSMsg interface
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   Ensure that ISMSSTORAGE_EnumMsgInit() has been called before using this method.
   Client can specify pnIndex to get index of next message or ppi to get next message
   or both to get index as well as message.

   pnIndex, ppi and pnErr must remain valid during entire transaction. These are filled by
   ISMSSTORAGE and can be examined in the callback function.

   Callback is invoked with error if error occurs during enumeration.
   
   Callback is invoked with SUCCESS with ppi, if specified, set to NULL and pnIndex,
   if specified, set to 0xffffffff, if there is no item left to return as per the criteria 
   specified in ISMSSTORAGE_EnumMsgInit.

Side Effects:
   None

See Also:
   None
=======================================================================

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================

Interface Name: ISMSBCSrvOpts

Description:
   ISMSBCSrvOpts interface encapsulates various parameters of SMS broadcast
service identified by AEESMSBCSrvID.

The ISMSBCSrvOpts interface instance is obtained via ISHELL_CreateInstance()
mechanism.Use of this interface will expect that caller has AEECLSID_SMSMAINCLIENT 
privilege.

=============================================================================

ISMSBCSRVOPTS_AddRef()

Description:
   This method increments the reference count of the ISMSBCSrvOpts Interface object.
   This allows the object to be shared by multiple callers. The object is freed when
   the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSBCSRVOPTS_AddRef(ISMSBCSrvOpts * po)

Parameters:

   po [in]: Pointer to the ISMSBCSrvOpts Interface object

Return Value:
   Incremented reference count for the object

Comments:
   A valid object returns a positive reference count.

Side Effects:
   None

See Also:
   ISMSBCSRVOPTS_Release()

=============================================================================

ISMSBCSRVOPTS_Release()

Description:
   This method decrements the reference count of an object. The object is freed
   from memory and is no longer valid once the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSBCSRVOPTS_Release(ISMSBCSrvOpts * po)

Parameters:

   po [in]: Pointer to the ISMSBCSrvOpts Interface object

Return Value:
   Decremented reference count for the object. The object has been freed and is no
   longer valid if 0 (zero) is returned.

Comments:
   None

Side Effects:
   None

See Also:
   ISMSBCSRVOPTS_AddRef()

==============================================================================

Function: ISMSBCSRVOPTS_QueryInterface()

Description:

   This method retrieves a pointer to an interface conforming to the
   definition of the specified class ID.  This can be used to query for
   extended functionality, like future versions or proprietary extensions.

   Upon a successful query, the interace is returned AddRef'ed.  The caller is
   responsible for calling Release() at some point in the future.  One
   exception is when the pointer returned is not an interface pointer.  In
   that case, the memory will share the lifetime of the object being queried,
   and the returned pointer will not be used to free or release the object.

Prototype:

   int ISMSBCSRVOPTS_QueryInterface(ISMSBCSrvOpts *po, AEECLSID id, void **p)

Parameters:

   po [in]: Pointer to ISMSBCSrvOpts interface

   id [in]: A globally unique id to identify the entity (interface or data) that we
            are trying to query.

   p [out]: Pointer to the data or interface that we want to retrieve.  If the interface
            is not available, this is set to NULL.

Return Value:

   Return SUCCESS on success,

   ECLASSNOTSUPPORT if class ID not supported

Comments:

   On failure, QueryInterface() must set *po to NULL.

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMSBCSRVOPTS_AddOpt()

Description:
   Append the list of SMSBCSrvOpts to the current message option set

Prototype:

  int ISMSBCSRVOPTS_AddOpt(ISMSBCSrvOpts *po, SMSBCSrvOpts *apwoz)

Parameters:

  po: the interface pointer

  apwoz: array of SMSBCSrvOpts structs, terminated by a SMSBCSrvOpts with
         nId set to SMSBCSRVOPT_END

Return Value:
   SUCCESS if the options could be added successfully

   ENOMEMORY if enough memory couldn't be allocated

Comments:
   Even though multiple SMSBCSrvOpts corresponding to an option ID
   can be added, ISMSBCSrvOpts uses only the most recently added
   SMSBCSrvOpts.

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMSBCSRVOPTS_RemoveOpt()

Description:
   Removes the most recently added SMSBCSrvOpts matching nOptId

Prototype:

   int ISMSBCSRVOPTS_RemoveOpt(ISMSBCSrvOpts *po, int nOptId)

Parameters:

   po:  the interface pointer

   nOptId: id of the option to remove from the options list

Return Value:
   SUCCESS if the options could be added successfully

   EFAILED if the specified SMSBCSrvOpts couldn't be found

Comments:
   None

Side Effects:
   None

See Also:
   None

=======================================================================

Function: ISMSBCSRVOPTS_GetOpt()

Description:

   Find most recently added SMSBCSrvOpts, in the list of SMSBCSrvOpts in po,
   matching nOptId. pwo is filled in with a the matching SMSBCSrvOpts contents.

Prototype:

   int ISMSBCSRVOPTS_GetOpt(ISMSBCSrvOpts *po, int32 nOptId, SMSBCSrvOpts *pwo)

Parameters:
   po :  the interface pointer

   nOptId: id of the option to find in the options list

   pwo: where to stick the found SMSBCSrvOpts

Return Value:
   SUCCESS if the options could be added successfully

   EFAILED if the specified SMSBCSrvOpts couldn't be found

Comments:
   None

Side Effects:
   None

See Also:
   None

============================================================================

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================

Interface Name: ISMSBCConfig

Description:
   ISMSBCConfig interface lets applications configure SMS broadcast service.
Use of this interface will expect that caller has AEECLSID_SMSMAINCLIENT 
privilege.

=============================================================================

ISMSBCCONFIG_AddRef()

Description:
   This method increments the reference count of the ISMSBCConfig Interface object.
   This allows the object to be shared by multiple callers. The object is freed when
   the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSBCCONFIG_AddRef(ISMSBCConfig * po)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object

Return Value:
   Incremented reference count for the object

Comments:
   A valid object returns a positive reference count.

Side Effects:
   None

See Also:
   ISMSBCCONFIG_Release()

=============================================================================

ISMSBCCONFIG_Release()

Description:
   This method decrements the reference count of an object. The object is freed
   from memory and is no longer valid once the reference count reaches 0 (zero).

Prototype:
   uint32 ISMSBCCONFIG_Release(ISMSBCConfig * po)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object

Return Value:
   Decremented reference count for the object. The object has been freed and is no
   longer valid if 0 (zero) is returned.

Comments:
   None

Side Effects:
   None

See Also:
   ISMSBCCONFIG_AddRef()

==============================================================================

Function: ISMSBCCONFIG_QueryInterface()

Description:

   This method retrieves a pointer to an interface conforming to the
   definition of the specified class ID.  This can be used to query for
   extended functionality, like future versions or proprietary extensions.

   Upon a successful query, the interace is returned AddRef'ed.  The caller is
   responsible for calling Release() at some point in the future.  One
   exception is when the pointer returned is not an interface pointer.  In
   that case, the memory will share the lifetime of the object being queried,
   and the returned pointer will not be used to free or release the object.

Prototype:

   int ISMSBCCONFIG_QueryInterface(ISMSBCConfig *po, AEECLSID id, void **p)

Parameters:

   po [in]: Pointer to ISMSBCConfig interface

   id [in]: A globally unique id to identify the entity (interface or data) that we
            are trying to query.

   p [out]: Pointer to the data or interface that we want to retrieve.  If the interface
            is not available, this is set to NULL.

Return Value:

   Return SUCCESS on success,

   ECLASSNOTSUPPORT if class ID not supported

Comments:

   On failure, QueryInterface() must set *po to NULL.

Side Effects:
   None

See Also:
   None

=============================================================================

ISMSBCCONFIG_GetBCConfig()

Description:
   This method lets application access carriers broadcast configuration.

Prototype:
   void ISMSBCCONFIG_GetBCConfig(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, AEESMSBCConfig * pConfig, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   pcb [in]: Callback
   pConfig [out]: Place holder for carrier's broadcast configuration
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pConfig and pnErr must remain valid during entire transaction.These are filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   AEESMSBCConfig

=============================================================================

ISMSBCCONFIG_GetBCPref()

Description:
   This method lets application access its preference for broadcast messages.

Prototype:
   void ISMSBCCONFIG_GetBCPref(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, AEESMSBCPref * pPref, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   pcb [in]: Callback
   pPref [out]: Place holder for application's broadcast preference
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pPref and pnErr must remain valid during entire transaction.These are filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   AEESMSBCPref

=============================================================================

ISMSBCCONFIG_SetBCPref()

Description:
   This method lets application set its preference for broadcast messages.

Prototype:
   void ISMSBCCONFIG_SetBCPref(ISMSBCConfig * po, AEESMSMode mode, AEESMSBCPref nPref, AEECallback *pcb, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   nPref [in]: application's broadcast preference
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction.This is filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   AEESMSBCPref

=============================================================================

ISMSBCCONFIG_GetServiceIDs()

Description:
   This method lets application access service IDs from the broadcast SMS service
table on the device.

Prototype:
   void ISMSBCCONFIG_GetServiceIDs(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, uint32 * pnCount, AEESMSBCSrvID ** ppsid, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   pcb [in]: Callback
   pnCount [out]: Number of entries in service ID array returned in ppsid
   ppsid [out]: Place holder for service ID array. Need to be freed by application.
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnCount, ppsid and pnErr must remain valid during entire transaction. These are filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   AEESMSBCSrvID

=============================================================================

ISMSBCCONFIG_GetServiceOpts()

Description:
   This method lets application access ISMSBCSrvOpts service option interface,
corresponding to the specified service ID, which can be used to access service
options.

Prototype:
   void ISMSBCCONFIG_GetServiceOpts(ISMSBCConfig * po, AEESMSMode mode, AEESMSBCSrvID srvID, AEECallback *pcb, ISMSBCSrvOpts ** ppi, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   srvID [in]: Service ID
   pcb [in]: Callback
   ppi [out]: Place holder for ISMSBCSrvOpts interface corresponding to the
              specified service ID. Application must release interface by calling
              ISMSBCCONFIG_Release()
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   ppi and pnErr must remain valid during entire transaction. These are filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   AEESMSBCSrvID, ISMSBCConfig, ISMSBCCONFIG_SetServiceOpts()

=============================================================================

ISMSBCCONFIG_SetServiceOpts()

Description:
   This method lets application set or update service options corresponding to
the service ID specified in ISMSBCSrvOpts. If service is not there in device 
service table, this methods adds the service in device service table.

Prototype:
   void ISMSBCCONFIG_SetServiceOpts(ISMSBCConfig * po, AEESMSMode mode, ISMSBCSrvOpts * pi, AEECallback *pcb, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   pi [in]: ISMSBCSrvOpts interface
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction. This is filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   ISMSBCConfig, ISMSBCCONFIG_GetServiceOpts()

=============================================================================

ISMSBCCONFIG_GetAllServiceOpts()

Description: 
   This method lets application access ISMSBCSrvOpts service option interfaces
corresponding to all the service options present for the given Message Mode - CDMA or GW.

Prototype:
   void ISMSBCCONFIG_GetAllServiceOpts(ISMSBCConfig * po, AEESMSMode mode, AEECallback *pcb, uint32 * pnCount, ISMSBCSrvOpts *** pppi, uint32 * pnErr)

Parameters:
 
   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   pcb [in]: Callback
   pnCount [out]: Number of entries in list of ISMSBCSrvOpts interfaces returned in ppi
   pppi [out]: Place holder for array of ISMSBCSrvOpts interfaces corresponding to all
              service options present for the specified mode. Application must 
              release each interface by calling ISMSBCSRVOPTS_Release() on it. Application
              also need to free the memory containing interface pointers.
   pnErr [out]: Place holder for error

Return Value: 
   None 

Comments: 
   pppi and pnErr must remain valid during entire transaction. These are filled by 
   ISMSBCConfig and can be examined in the callback function.
   
   // Following is an example of how application should release interface pointers
   // and memory containing interface pointers

   ISMSBCSrvOpts ** ppISMSBCSrvOpts;
   pppi == &ppISMSBCSrvOpts;

   for (dwIndex = 0; dwIndex < *pnCount; dwIndex++)
   {
      ISMSBCSRVOPTS_Release(*(ppISMSBCSrvOpts + dwIndex));
   }
   FREE(ppISMSBCSrvOpts);

Side Effects: 
   None

=============================================================================

ISMSBCCONFIG_DeleteService()

Description:
   This method deletes specified service from the device service table.

Prototype:
   void ISMSBCCONFIG_DeleteService(ISMSBCConfig * po, AEESMSMode mode, AEESMSBCSrvID srvID, AEECallback *pcb, uint32 * pnErr)

Parameters:

   po [in]: Pointer to the ISMSBCConfig Interface object
   mode[in]: Broadcast Message Mode
   srvID [in]: Service ID
   pcb [in]: Callback
   pnErr [out]: Place holder for error

Return Value:
   None

Comments:
   pnErr must remain valid during entire transaction. This is filled by
   ISMSBCConfig and can be examined in the callback function.

Side Effects:
   None

See Also:
   AEESMSBCSrvID

=======================================================================*/

#endif   // AEESMS.h
