apply tizen c coding rule
[platform/core/messaging/msg-service.git] / include / common / MsgTypes.h
index 8b94151..12da13d 100755 (executable)
@@ -1,26 +1,26 @@
 /*
-* Copyright 2012-2013  Samsung Electronics Co., Ltd
-*
-* Licensed under the Flora License, Version 1.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*    http://www.tizenopensource.org/license
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
 */
 
 #ifndef MSG_TYPES_H
 #define MSG_TYPES_H
 
 /**
- *     @file           MsgTypes.h
- *     @brief          Defines common types of messaging framework
- *     @version        1.0
+ *     @file                   MsgTypes.h
+ *     @brief                  Defines common types of messaging framework
+ *     @version                1.0
  */
 
 /**
@@ -31,7 +31,7 @@
  */
 
 /*==================================================================================================
-                                         INCLUDE FILES
+                                                                                       INCLUDE FILES
 ==================================================================================================*/
 #include <stdlib.h>
 #include <stdio.h>
  */
 
 /*==================================================================================================
-                                         TYPES
+                                                                                       TYPES
 ==================================================================================================*/
 
 /**
  *     @brief  Defines the enabled MMS version
  */
-#define        MMS_V1_2                                                                // MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2
+#define        MMS_V1_2        /* MMS Version : MMS_V1_0 / MMS_V1_1 / MMS_V1_2 */
+
+
+/**
+ * @brief Defines the notification method
+ */
+#define MSG_NOTI_INTEGRATION
+
+/**
+ * @brief Defines the enabled drm
+ */
+#define MSG_DRM_SUPPORT        (0)
+
+#define MAX_TELEPHONY_HANDLE_CNT       (3)
 
 /**
  *     @brief  Defines message struct handle.
  */
 
-typedef struct _msg_struct{
+typedef struct _msg_struct {
        int type;
        void *data;
-}msg_struct_s;
+} msg_struct_s;
 
 /*==================================================================================================
-                                         STRUCTURES
+                                                                                       STRUCTURES
 ==================================================================================================*/
 
 /**
  *     @brief  Represents address information.
  */
 
-typedef struct
-{
+typedef struct {
        msg_address_type_t              addressType;                                                                                                    /**< The type of an address in case of an Email or a mobile phone */
        msg_recipient_type_t    recipientType;                                                                                                  /**< The type of recipient address in case of To, Cc, and Bcc */
        msg_contact_id_t                        contactId;                                                                                                                      /**< The contact ID of address */
@@ -85,8 +97,7 @@ typedef struct
 /**
  *     @brief  Represents port number information.
  */
-typedef struct
-{
+typedef struct {
        bool                            valid;          /**< Indicates whether port information is used or not. */
        unsigned short          dstPort;                /**< Recipient port number, not greater than 16 bit */
        unsigned short          srcPort;                /**< Sender port number, not greater than 16 bit */
@@ -96,8 +107,7 @@ typedef struct
 /**
  *     @brief  Represents MMS Sending Option Structure in application.
  */
-typedef struct
-{
+typedef struct {
        bool                                    bReadReq;
        time_t                          expiryTime;
        bool                                    bUseDeliveryCustomTime;
@@ -109,8 +119,7 @@ typedef struct
 /**
  *     @brief  Represents SMS Sending Option Structure in application.
  */
-typedef struct
-{
+typedef struct {
        bool bReplyPath;
 } SMS_SENDINGOPT_S;
 
@@ -118,38 +127,33 @@ typedef struct
 /**
  *     @brief  Represents MSG Sending Option Structure in application.
  */
-typedef struct
-{
+typedef struct {
        bool bSetting;
        bool bDeliverReq;
        bool bKeepCopy;
        msg_struct_t mmsSendOpt;
        msg_struct_t smsSendOpt;
-
 } MSG_SENDINGOPT_S;
 
 
-typedef        enum
-{
-       MMS_TIMETYPE_NONE               = -1,   // fixme: backward compatibility
-       MMS_TIMETYPE_ERROR              = -1,   // error return in Get method
-       MMS_TIMETYPE_RELATIVE   = 0,    // default
+typedef        enum {
+       MMS_TIMETYPE_NONE               = -1,   /**< fixme: backward compatibility */
+       MMS_TIMETYPE_ERROR              = -1,   /**< error return in Get method */
+       MMS_TIMETYPE_RELATIVE   = 0,    /**< default */
        MMS_TIMETYPE_ABSOLUTE   = 1
-}MmsTimeType;
+} MmsTimeType;
 
 
-typedef struct
-{
+typedef struct {
        MmsTimeType     type;
        unsigned int    time;
-}MmsTimeStruct;
+} MmsTimeStruct;
 
 
 /**
  *     @brief  Represents MMS Sending Option Structure in framework.
  */
-typedef struct
-{
+typedef struct {
        bool                                    bReadReq;
        bool                                    bUseDeliveryCustomTime;
        msg_priority_type_t     priority;
@@ -161,8 +165,7 @@ typedef struct
 /**
  *     @brief  Represents SMS Sending Option Structure in framework.
  */
-typedef struct
-{
+typedef struct {
        bool    bReplyPath;
 } SMS_SENDINGOPT_INFO_S;
 
@@ -170,16 +173,14 @@ typedef struct
 /**
  *     @brief  Represents MSG Sending Option Structure in framework.
  */
-typedef struct
-{
+typedef struct {
        bool bSetting;
        bool bDeliverReq;
        bool bKeepCopy;
 
-       union
-       {
-               MMS_SENDINGOPT_INFO_S   mmsSendOptInfo;
-               SMS_SENDINGOPT_INFO_S   smsSendOptInfo;
+       union {
+               MMS_SENDINGOPT_INFO_S   mmsSendOptInfo;
+               SMS_SENDINGOPT_INFO_S   smsSendOptInfo;
        } option;
 } MSG_SENDINGOPT_INFO_S;
 
@@ -189,8 +190,7 @@ typedef struct
  *     Applications compose a request and send it to the framework via Message handle. \n
  *     This request ID is used to manage the request by the framework.
  */
-typedef struct
-{
+typedef struct {
        msg_request_id_t        reqId;  /**< Indicates the request ID, which is unique.
                                                                        When applications submit a request to the framework, this value will be set by the framework. */
        msg_struct_t            msg;    /**< Indicates the message structure to be sent by applications. */
@@ -202,14 +202,12 @@ typedef struct
  *     @brief  Represents Address information list.
  */
 
-typedef struct
-{
+typedef struct {
        msg_contact_id_t                contactId;                      /**< The contact id of message common informatioin */
        MSG_ADDRESS_INFO_S              msgAddrInfo;            /**< The pointer to message common informatioin */
 } MSG_THREAD_LIST_INDEX_S;
 
-typedef struct
-{
+typedef struct {
        msg_contact_id_t                contactId;                      /**< The contact id of message common informatioin */
        msg_struct_t                    msgAddrInfo;            /**< The pointer to message common informatioin */
 } MSG_THREAD_LIST_INDEX_INFO_S;
@@ -218,21 +216,19 @@ typedef struct
 /**
  *     @brief  Represents Peer Count Info.
  */
-typedef struct
-{
+typedef struct {
        int totalCount;                 /**< Indicates the total number of messages from the Peer. */
        int unReadCount;                /**< Indicates the unread messages from the Peer. */
        int smsMsgCount;                /**< Indicates the SMS messages from the Peer. */
        int mmsMsgCount;                /**< Indicates the MMS messages from the Peer. */
-}MSG_THREAD_COUNT_INFO_S;
+} MSG_THREAD_COUNT_INFO_S;
 
 
 /**
  *     @brief  Represents the request information of Push Message (SI, SL).
  */
-typedef struct
-{
-       msg_push_action_t       action;
+typedef struct {
+       msg_push_action_t       action;
        unsigned long                   received;
        unsigned long                   created;
        unsigned long                   expires;
@@ -245,8 +241,7 @@ typedef struct
 /**
  *     @brief  Represents the request information of Push Message (CO).
  */
-typedef struct
-{
+typedef struct {
        int             invalObjectCnt;
        int             invalServiceCnt;
        char            invalObjectUrl[MAX_PUSH_CACHEOP_INVALID_OBJECT_MAX][MAX_PUSH_CACHEOP_MAX_URL_LEN + 1];
@@ -257,52 +252,48 @@ typedef struct
 /**
  *     @brief  Represents the SyncML Message Information.
  */
-typedef struct
-{
+typedef struct {
        int                                     extId;
        int                                     pinCode;
        msg_struct_t            msg;
-}MSG_SYNCML_MESSAGE_S;
+} MSG_SYNCML_MESSAGE_S;
 
 
 /**
  *     @brief  Represents the SyncML Message Data.
  */
- typedef struct
-{
-       msg_syncml_message_type_t       syncmlType;
-       int                                                     pushBodyLen;
-       char                                                    pushBody[MAX_WAPPUSH_CONTENTS_LEN + 1];
-       int                                                             wspHeaderLen;
-       char                                                    wspHeader[MAX_WAPPUSH_CONTENTS_LEN + 1];
-}MSG_SYNCML_MESSAGE_DATA_S;
+typedef struct {
+       msg_syncml_message_type_t       syncmlType;
+       int                                                             pushBodyLen;
+       char                                                    pushBody[MAX_WAPPUSH_CONTENTS_LEN + 1];
+       int                                                             wspHeaderLen;
+       char                                                    wspHeader[MAX_WAPPUSH_CONTENTS_LEN + 1];
+       int                                                     simIndex;
+} MSG_SYNCML_MESSAGE_DATA_S;
 
 
 /**
  *     @brief  Represents the SyncML Message Data.
  */
- typedef struct
-{
+typedef struct {
        char                                                    pushHeader[MAX_WAPPUSH_CONTENTS_LEN + 1];
-       int                                                     pushBodyLen;
+       int                                                     pushBodyLen;
        char                                                    pushBody[MAX_WAPPUSH_CONTENTS_LEN + 1];
-}MSG_LBS_MESSAGE_DATA_S;
+} MSG_LBS_MESSAGE_DATA_S;
 
 
-typedef struct
-{
+typedef struct {
        char                                                    pushHeader[MAX_WAPPUSH_CONTENTS_LEN + 1];
-       int                                                     pushBodyLen;
+       int                                                     pushBodyLen;
        char                                                    pushBody[MAX_WAPPUSH_CONTENTS_LEN + 1];
        char                                                    pushAppId[MAX_WAPPUSH_ID_LEN + 1];
        char                                                    pushContentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1];
-}MSG_PUSH_MESSAGE_DATA_S;
+} MSG_PUSH_MESSAGE_DATA_S;
 
 /**
  *     @brief  Represents the Report Status Data.
  */
-typedef struct
-{
+typedef struct {
        char addressVal[MAX_ADDRESS_VAL_LEN + 1];
        int type;
        int status;
@@ -310,17 +301,24 @@ typedef struct
 } MSG_REPORT_STATUS_INFO_S;
 
 
-typedef struct
-{
+typedef struct {
        char contentType[MAX_WAPPUSH_CONTENT_TYPE_LEN + 1];
        char appId[MAX_WAPPUSH_ID_LEN + 1];
        char pkgName[MSG_FILEPATH_LEN_MAX + 1];
        bool bLaunch;
-}MSG_PUSH_EVENT_INFO_S;
+} MSG_PUSH_EVENT_INFO_S;
+
+
+typedef struct {
+       msg_message_id_t msg_id;
+       char mime_type[MAX_MIME_TYPE_LEN+1];
+       char media_item[MSG_FILEPATH_LEN_MAX+1];
+       char thumb_path[MSG_FILEPATH_LEN_MAX+1];
+} MSG_MEDIA_INFO_S;
 
 /**
  *     @}
  */
 
-#endif // MSG_TYPES_H
+#endif /* MSG_TYPES_H */