Remove hardcoded path for multiuser support
[platform/core/messaging/msg-service.git] / include / common / MsgInternalTypes.h
index 5c5dda5..3e31e3a 100755 (executable)
@@ -1,11 +1,11 @@
 /*
-* Copyright 2012  Samsung Electronics Co., Ltd
+* Copyright 2012-2013  Samsung Electronics Co., Ltd
 *
-* Licensed under the Flora License, Version 1.0 (the "License");
+* Licensed under the Flora License, Version 1.1 (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
+*    http://floralicense.org/license/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
                                          INCLUDE FILES
 ==================================================================================================*/
 #include "MsgMmsTypes.h"
-
+#include <inttypes.h>
+#include <tzplatform_config.h>
 
 /*==================================================================================================
                                     DEFINES
 ==================================================================================================*/
-#define MSG_DATA_ROOT_PATH             "/opt/usr/data/msg-service/"
-#define MSG_DATA_PATH                          MSG_DATA_ROOT_PATH"msgdata/"
-#define MSG_SMIL_FILE_PATH             MSG_DATA_ROOT_PATH"smildata/"
-#define MSG_IPC_DATA_PATH                      MSG_DATA_ROOT_PATH"ipcdata/"
-#define MSG_THUMBNAIL_PATH             MSG_DATA_PATH"thumbnails/"
+#define MSG_DATA_ROOT_PATH             tzplatform_mkpath(TZ_USER_DATA,"msg-service")
+#define MSG_DATA_PATH                  tzplatform_mkpath3(TZ_USER_DATA,"msg-service","msgdata")
+#define MSG_SMIL_FILE_PATH             tzplatform_mkpath3(TZ_USER_DATA,"msg-service","smildata")
+#define MSG_IPC_DATA_PATH              tzplatform_mkpath3(TZ_USER_DATA,"msg-service","ipcdata")
+#define MSG_THUMBNAIL_PATH             tzplatform_mkpath4(TZ_USER_DATA,"msg-service","ipcdata","thumbnails")
+// temporary
+#define TPDU_LOG_FILE                  tzplatform_mkpath3(TZ_USER_DATA,"msg-service","tpduLog.txt")
+#define MSG_NATIONAL_SIM       "memory/private/msg-service/national_sim"
+#define MSG_SIM_MSISDN "memory/private/msg-service/msisdn"
 #define MAX_FULL_PATH_SIZE             320     // max length for internal file path
-#define VALID_ADDRESS_LEN              8
 #define MAX_PRECONFIG_NUM              8
 #define MAX_THREAD_ADDR_LEN    40
 #define MAX_THREAD_NAME_LEN    195
@@ -54,7 +58,6 @@
 #define MSG_SIM_IMSI                   "memory/private/msg-service/sim_imsi"
 #define MSG_SIM_CHANGED        "memory/private/msg-service/sim_changed"
 
-
 #define DEFAULT_SETTING_PATH                           "db/private/msg-service"
 
 #define DEFAULT_GENERAL_OPT_PATH               DEFAULT_SETTING_PATH"/general"
@@ -213,23 +216,23 @@ typedef struct
        msg_storage_id_t                storageId;                                                                              /**< Indicates where the message is saved. */
        int                                             nAddressCnt;                                                                    /**< Indicates the count of addresses. */
        MSG_ADDRESS_INFO_S              addressList[MAX_TO_ADDRESS_CNT];                                /**< Indicates the address information list. */
-       char                                    replyAddress[MAX_PHONE_NUMBER_LEN+1];   /**< Indicates the reply address. */
+       char                                    replyAddress[MAX_PHONE_NUMBER_LEN+1];                   /**< Indicates the reply address. */
        char                                    subject[MAX_SUBJECT_LEN+1];                                             /**< Indicates the message subject. */
-       time_t                                  displayTime;                                                                                                    /**< Indicates the display time related to the specific operation. */
-       msg_network_status_t    networkStatus;                                                                                                  /**< Indicates the network status of the message. */
-       msg_encode_type_t               encodeType;                                                                                                     /**< Indicates the string encoding type. */
-       bool                                    bRead;                                                                                                                          /**< Indicates whether the message is read or not. */
-       bool                                    bProtected;                                                                                                             /**< Indicates whether the message is protected or not. */
-       bool                                    bBackup;                                                                                                                        /**< Indicates whether the message was restored from PC. */
-       msg_priority_type_t             priority;                                                                                                                       /**< Indicates the priority of the message. */
-       msg_direction_type_t    direction;                                                                                                                      /**< Indicates whether the message is MO or MT (affecting address). */
-       MSG_PORT_INFO_S                 msgPort;                                                                                                                        /**< Indicates the port number information. */
-       bool                                            bTextSms;                                                                                                               /**< Indicates whether the message is just a text message or not. */
-       size_t                                  dataSize;                                                                                                                       /**< Indicates the data size. The unit is byte. */
+       time_t                                  displayTime;                                                                    /**< Indicates the display time related to the specific operation. */
+       msg_network_status_t    networkStatus;                                                                  /**< Indicates the network status of the message. */
+       msg_encode_type_t               encodeType;                                                                             /**< Indicates the string encoding type. */
+       bool                                    bRead;                                                                                  /**< Indicates whether the message is read or not. */
+       bool                                    bProtected;                                                                             /**< Indicates whether the message is protected or not. */
+       bool                                    bBackup;                                                                                /**< Indicates whether the message was restored from PC. */
+       msg_priority_type_t             priority;                                                                               /**< Indicates the priority of the message. */
+       msg_direction_type_t    direction;                                                                              /**< Indicates whether the message is MO or MT (affecting address). */
+       MSG_PORT_INFO_S                 msgPort;                                                                                /**< Indicates the port number information. */
+       bool                                    bTextSms;                                                                               /**< Indicates whether the message is just a text message or not. */
+       size_t                                  dataSize;                                                                               /**< Indicates the data size. The unit is byte. */
        char                                    msgData[MAX_MSG_DATA_LEN+1];                                    /**< Indicates the message payload information as a body. */
        char                                    msgText[MAX_MSG_TEXT_LEN+1];
-       char                                                                            thumbPath[MSG_FILEPATH_LEN_MAX];
-       bool                                    bStore;
+       char                                    thumbPath[MSG_FILEPATH_LEN_MAX+1];
+       bool                                    bStore;                                                                                 /**< Indicates whether the message is stored or not if it is MWI message. */
 } MSG_MESSAGE_INFO_S;
 
 typedef struct
@@ -260,6 +263,7 @@ typedef struct
        size_t                                  dataSize;                                                               /**< Indicates the data size. The unit is byte. */
        void                                    *pData;                                                                 /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
        void                                    *pMmsData;                                                              /**< Indicates the message payload information as a body. default character encoding is UTF-8*/
+       size_t                                  mmsDataSize;
 } MSG_MESSAGE_HIDDEN_S;
 
 /**
@@ -342,10 +346,14 @@ typedef struct
 typedef struct
 {
        int                                             listenerFd;             /**< Rx fd for status cnf */
+#ifdef __x86_64__
+       uint64_t                                handleAddr;             /**< Handle address for status cnf */
+#else
        unsigned int                    handleAddr;             /**< Handle address for status cnf */
+#endif
        msg_message_id_t                sentMsgId;              /**< The ID of a sent message for updating message status */
-} MSG_PROXY_INFO_S;
 
+} MSG_PROXY_INFO_S;
 
 /**
  *     @brief  Aux data structure for MSG_CMD_REG_INCOMING_MSG_CB. \n
@@ -427,6 +435,7 @@ typedef struct
        int                             listenerFd;
        MSG_MAIN_TYPE_T         msgType;
        char appId[MAX_WAPPUSH_ID_LEN+1];
+       char content_type[MAX_WAPPUSH_CONTENT_TYPE_LEN+1];
 } MSG_CMD_REG_INCOMING_PUSH_MSG_CB_S;
 
 typedef struct