⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmstypes.h

📁 彩信MMS的全部代码
💻 H
📖 第 1 页 / 共 5 页
字号:
    MMS_TYPE_APP_VND_WAP_MMS_MESSAGE            = 0x3e,
    MMS_TYPE_APP_VND_WAP_ROLLOVER_CERTIFICATE   = 0x3f,
    MMS_TYPE_APP_VND_WAP_LOCC_WBXML             = 0x40,
    MMS_TYPE_APP_VND_WAP_LOC_XML                = 0x41,
    MMS_TYPE_APP_VND_WAP_SYNCML_DM_WBXML        = 0x42,
    MMS_TYPE_APP_VND_WAP_SYNCML_DM_XML          = 0x43,
    MMS_TYPE_APP_VND_WAP_SYNCML_NOTIFICATION    = 0x44,
    MMS_TYPE_APP_VND_WAP_XHTML_XML              = 0x45,
    MMS_TYPE_APP_VND_WV_CSP_CIR                 = 0x46,
    MMS_TYPE_APP_VND_OMA_DD_XML                 = 0x47,

    /* DRM related media types */
    MMS_TYPE_APP_VND_OMA_DRM_MESSAGE            = 0x48,
    MMS_TYPE_APP_VND_OMA_DRM_CONTENT            = 0x49,
    MMS_TYPE_APP_VND_OMA_DRM_R_XML              = 0x4A,
    MMS_TYPE_APP_VND_OMA_DRM_R_WBXML            = 0x4B,

    /* Application */
    MMS_TYPE_APP_VND_WV_CSP_XML                 = 0x4C,
    MMS_TYPE_APP_VND_WV_CSP_WBXML               = 0x4D,
        
    /* Not a well known value */
    MMS_VALUE_AS_STRING                         = 0xFF 
} MmsKnownMediaType;

/*! \enum MmsParam Contains possible parameter values for the content-type 
 *  and entry header fields. [WAP-203, Table 38]
 */
typedef enum
{
    MMS_CHARSET         = 0x01, /*!< Well-known-charset */
    MMS_LEVEL           = 0x02, /*!< Version-value */
    MMS_TYPE            = 0x03, /*!< Integer-value */
    MMS_TYPE_REL        = 0x09, /*!< Text-Value, used with multipart related */
    MMS_NAME            = 0x05, /*!< Text-Value */
    MMS_FILENAME        = 0x06, /*!< Text-Value */
    MMS_START_REL       = 0x0A, /*!< Text-Value, used with multipart related */
    MMS_START_INFO_REL  = 0x0B, /*!< Text-Value, used with multipart related */

    /* Parameters defined for compatibility to later encoding versions. These 
     * parameters should not be used but are included to be able to parse 
     * messages that are not fully MMS Encapsulation conformant. */
    MMS_NAME_ENCODING_14            = 0x17, /*!< Text-Value */
    MMS_FILENAME_ENCODING_14        = 0x18, /*!< Text-Value, only ascii atm */
    MMS_START_REL_ENCODING_14       = 0x19, /*!< Text-Value */
    MMS_START_INFO_REL_ENCODING_14  = 0x1a, /*!< Text-Value */

    MMS_UNHANDLED       = 0xFF  /*!< Parameters not handled by the MMS Client*/
} MmsParam;

/*! \enum MmsParamEnc Contains possible parameter values for the parameters 
 *  defined in [MMS-ENC, Table 23]
 */
typedef enum
{
    MMS_PARAM_ENC_TYPE      = 0x02, /*!< Constrained-encoding */
    MMS_PARAM_ENC_UNHANDLED = 0xFF  /*!< Parameters not handled by the MMS Client */
} MmsParamEnc;

/*! \enum MmsParamType Describes how the content type or entry header parameter
 *  is represented. e.g. as a string or as an integer value.
 */
typedef enum
{
    MMS_PARAM_STRING,
    MMS_PARAM_INTEGER 
} MmsParamType;

/*! \struct MmsAllParams 
 *  \brief Contains a list of all content-type or entry header parameters of 
 *  a message.
 */
typedef struct MmsAllParamsStruct
{
    MmsParam        param;  /*!< MmsParam enum */
    
    /*! Param value type. MMS_PARAM_STRING = String, MMS_PARAM_INTEGER = int */
    MmsParamType    type;   
    union
    {
        /*! The value is US-ASCII or NULL */
        unsigned char   *string;    
        /*! The value is a number (UINT32) */
        UINT32          integer;    
    } value;
    /*! Pointer to next param. NULL if no more params  */
    struct MmsAllParamsStruct *next;    
} MmsAllParams;

/*! \struct MmsAllParamsEnc
 *  \brief Contains a list of MMS Encapsulation type parameters
 */
typedef struct MmsAllParamsEncStruct
{
    MmsParamEnc     param;  /*!< MmsParamEnc enum */
    
    /*! Param value type. MMS_PARAM_STRING = String, MMS_PARAM_INTEGER = int */
    MmsParamType    type;   
    union
    {
        /*! The value is US-ASCII or NULL */
        unsigned char   *string;    
        /*! The value is a number (UINT32) */
        UINT32          integer;    
    } value;
    /*! Pointer to next param. NULL if no more params  */
    struct MmsAllParamsEncStruct *next;
} MmsAllParamsEnc;

/*! \struct MmsContentType 
 *  \brief Contains the content-type value and belonging parameters.
 *         If there are no parameters "params" must be set to NULL!
 */
typedef struct
{
    /*! The media type is a known value */
    MmsKnownMediaType   knownValue; 
    /*! The media type is a us-ascii string */
    unsigned char   *strValue;      
    /*! Pointer to the content type params, NULL if there is no parameters */
    MmsAllParams    *params;    
} MmsContentType;

/*! \enum MmsClassIdentifier An MMS message can have different message classes.
 *  Auto indicates a message that is automatically generated by the client. 
 *  When Message Class is AUTO, no Delivery-Report or Read-Reply should be 
 *  sent. When creating an MMS, the Message Class AUTO is not possible to set 
 *  from the TDA since this Message Class is reserved for automatically 
 *  generatedmessages in the Proxy-Relay or the MMS Client (below the TDA 
 *  level). The message class IS_TEXT is used when message class is set as a 
 *  text string value, for more information see: #MmsMessageClass. 
 */
typedef enum
{
    MMS_MESSAGE_CLASS_NOT_SET       = 0,
    MMS_MESSAGE_CLASS_PERSONAL      = 128,
    MMS_MESSAGE_CLASS_ADVERTISEMENT = 129,
    MMS_MESSAGE_CLASS_INFORMATIONAL = 130,
    MMS_MESSAGE_CLASS_AUTO          = 131,
    MMS_MESSAGE_CLASS_IS_TEXT       = 254
} MmsClassIdentifier;

/*! \struct MmsMessageClass 
 *  \brief Contains the Class of the message. 
 *  Class can be an MmsClassIdentifier or a string. If string is used the 
 *  MmsClassIdentifier must be set to #MMS_MESSAGE_CLASS_IS_TEXT. 
 *  If no Class is set the message is treated as Personal.
 */
typedef struct
{
    MmsClassIdentifier  classIdentifier;    /*!< Message class as an enum */
    char                *textString;        /*!< Message class as a string */
} MmsMessageClass;

/*! \enum MmsPriority An MMS message can have different priorities. This enum 
 *  lists the possible values.
 */
typedef enum
{
    MMS_PRIORITY_NOT_SET    = 0,
    MMS_PRIORITY_LOW        = 128,
    MMS_PRIORITY_NORMAL     = 129,
    MMS_PRIORITY_HIGH       = 130
} MmsPriority;

/*! \enum MmsDistributionIndicator An MMS message can have different priorities. 
 *  This enum lists the possible values.
 */
typedef enum
{
    MMS_DISTRIBUTION_INDICATOR_NOT_SET  = 0,    /*!< Distribution not specified */
    MMS_DISTRIBUTION_INDICATOR_YES      = 128,  /*!< Distribution allowed. */
    MMS_DISTRIBUTION_INDICATOR_NO       = 129   /*!< Message originator requests
                                                 *   the message not to be 
                                                 *   further distributed. */
} MmsDistributionIndicator;

/*! \enum MmsSenderVisibility The sender address in an MMS message can be shown
 *  or not for the recipient. Possible values are listen in this enum. 
 */
typedef enum
{
    MMS_SENDER_VISIBILITY_NOT_SET   = 0,    /*!< Show unless sender has secret address*/
    MMS_SENDER_HIDE                 = 128,  /*!< Don't show the address. */
    MMS_SENDER_SHOW                 = 129   /*!< Show even secret address. */
} MmsSenderVisibility;

/*! \enum MmsDeliveryReport Sending of a Delivery Report to the original 
 *  message sender can either be requested or not. This field is called 
 *  "Report-Allowed" in the MMS standard.
 */
typedef enum
{
    MMS_DELIVERY_REPORT_NOT_SET = 0,
    MMS_DELIVERY_REPORT_YES     = 128,  /*!< Delivery report is requested. */
    MMS_DELIVERY_REPORT_NO      = 129   /*!< Delivery report is not requested. */
} MmsDeliveryReport;

/*! \enum MmsReadReply This enum contains values possible for to set for the
 *  Read Reply request.
 */
typedef enum
{
    MMS_READ_REPLY_NOT_SET  = 0,
    MMS_READ_REPLY_YES      = 128,      /*!< Read reply is requested. */
    MMS_READ_REPLY_NO       = 129       /*!< Read reply is not requested. */
} MmsReadReply;

/*! \enum MmsStatus The status of an MMS message can be any of the following 
 *  values. 
 */
typedef enum
{
    MMS_STATUS_EXPIRED          = 128,
    MMS_STATUS_RETRIEVED        = 129,
    MMS_STATUS_REJECTED         = 130,
    MMS_STATUS_DEFERRED         = 131,
    MMS_STATUS_UNRECOGNIZED     = 132,
    MMS_STATUS_INDETERMINATE    = 133,
    MMS_STATUS_FORWARDED        = 134
} MmsStatus;

typedef UINT32 MmsTimeSec;  /*!< Time in sec from 1970-01-01 */ 

/*! \enum MmsTimeType Absolute or Relative time. 
 */
typedef enum
{
    MMS_TIME_ABSOLUTE = 128,    /*!< Time in sec from 1970-01-01 */ 
    MMS_TIME_RELATIVE = 129     /*!< Time in sec from reference time */ 
} MmsTimeType;

/*! \struct MmsTime 
 *  \brief Contains a time stamp
 *  The time stamp is either in seconds since 1970-01-01 or from some other time
 */
typedef struct
{
    MmsTimeType type;   /*!< Absolute or Relative */
    UINT32 sec;         /*!< Time in sec from 1970-01-01 */
} MmsTime;

typedef UINT32 MmsReplyChargingSize; /*!< Size allowed for a reply charging*/

/*! \enum MmsReplyCharging 
 *  Indicates that the originator is willing to pay for 
 *  the Reply-MM (requested) or that a reply to this MM is free of charge for 
 *  the recepient (accepted).
 */
typedef enum
{
    MMS_REPLY_CHARGING_NOT_SET              = 0,  /*!< Reply Charging is not used */

    /* Used only in M_Send.req */
    MMS_REPLY_CHARGING_REQUESTED            = 128,  /*!< Used when sending a message */
    MMS_REPLY_CHARGING_REQUESTED_TEXT_ONLY  = 129,  /*!< Used when sending a message */

    /* Used only in M_Retrieve.conf and M_Notification.ind */
    MMS_REPLY_CHARGING_ACCEPTED             = 130,  /*!< Used when retrieving a message or notification */
    MMS_REPLY_CHARGING_ACCEPTED_TEXT_ONLY   = 131   /*!< Used when retrieving a message or notification */
} MmsReplyCharging;

/*! \struct MmsElementDescriptor 
 *  \brief Contains a more detailed description of the message that a 
 *  notification points towards.
 */ 
typedef struct
{
    char *contentReference; /*!< A reference identifier to a message element. */
    MmsAllParamsEnc *params;/*!< Parameters to the content reference. */
} MmsElementDescriptor;

/*! \struct MmsPrevSentBy 
 *  \brief Addresses of clients that previously has sent a  message.
 */ 
typedef struct MmsPrevSentByStruct
{
    UINT32      forwardedCountValue;
    MmsAddress  sentBy;
    struct MmsPrevSentByStruct *next;
} MmsPrevSentBy;

/*! \struct MmsPrevSentDate 
 *  \brief  Date when a message previously has been sent.
 */ 
typedef struct MmsPrevSentDateStruct
{
    UINT32      forwardedCountValue;
    MmsTimeSec  date;
    struct MmsPrevSentDateStruct *next;
} MmsPrevSentDate;

/*! \struct MmsHeader 
 *  \brief A struct containing possible header fields. 
 *  All optional field must be set to 0 or NULL when not used.
 *
 *  Creation of MMS Message :
 *          Optional fields are marked with [O]
 *          and mandatory fields marked with [M] (i.e. must be set)
 */
typedef struct
{                            
    /*! [M] Address of the message sender. */ 
    MmsAddress from;                    

    /*! [O] Address of the recipient. At least one of the addresses
     *  (To, cc, bcc) MUST be present. If not used it must be set to NULL. */ 
    MmsAddressList *to;                 

    /*! [O] See To field. */    
    MmsAddressList *cc;                 

    /*! [O] See To field. */ 
    MmsAddressList *bcc;                

    /*! [O] The subject of the message. */ 
    MmsEncodedText subject;             

    /*! [O] Arrival time of the message at the MMSProxy-Relay. 
     *  MMSProxy-Relay will generate this field if not supplied. */
    MmsTimeSec date;                    

    /*! [M] The content type of the message. */ 
    MmsContentType *contentType;        

    /*! [O] Class of the Message. */ 
    MmsMessageClass msgClass;           

    /*! [O] Time until the message is removed from the server,
     *  not set equals max time.
     */
    MmsTime expiryTime;              

    /*! [O] Time the message should be delivered, not set equals immediate. */
    MmsTime deliveryTime;            

    /*! [O] Priority of the message. */ 
    MmsPriority priority;               

    /*! [O] Address visibility to the recipent of the message. */ 
    MmsSenderVisibility visibility;     

    /*! [O] Request for a Read Reply. */ 
    MmsReadReply readReply;             

    /*! [O] Request for a Delivery Report. */ 
    MmsDeliveryReport deliveryReport; 
    
    /*! [M] Id of the message.
     *  This field is only used when retrieving a message, NOT used when sending.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -