2 * Copyright 2012-2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef MMS_PLUGIN_DECODE_H
18 #define MMS_PLUGIN_DECODE_H
20 #include "MmsPluginTypes.h"
21 #include "MmsPluginCodecTypes.h"
23 typedef struct _MsgHeaderAddress MsgHeaderAddress;
28 MSG_PRESENTATION_NONE = -1,
29 MSG_PRESENTATION_FIRSTPART, //Content-type == type parameter
30 MSG_PRESENTATION_TYPE_BASE, //Content-type == type parameter
31 MSG_PRESENTATION_LOCATION, //Content-Location == start parameter
32 MSG_PRESENTATION_ID, //Content-ID == start parameter
33 } MsgPresentationFactor;
41 MsgPresentationFactor factor;
42 MsgMultipart *pPrevPart;
43 MsgMultipart *pCurPresentation;
46 struct _MsgHeaderAddress {
48 MsgHeaderAddress *pNext;
51 // for Decoding & Encoding
55 int msgID; // if noti.ind, msgID is -1.
58 char szTrID[MMS_TR_ID_LEN+1];
62 MsgHeaderAddress *pFrom; //"/TYPE=PLMN", /"TYPE=IPv4", "/TYPE=IPv6"
63 MsgHeaderAddress *pTo;
64 MsgHeaderAddress *pCc;
65 MsgHeaderAddress *pBcc;
66 char szSubject[MSG_LOCALE_SUBJ_LEN + 1];
67 MmsResponseStatus responseStatus;
68 MmsRetrieveStatus retrieveStatus;
69 char szResponseText[MMS_LOCALE_RESP_TEXT_LEN + 1];
70 char szRetrieveText[MMS_LOCALE_RESP_TEXT_LEN + 1];
73 MmsTimeStruct expiryTime;
74 MmsTimeStruct deliveryTime;
76 MmsSenderVisible hideAddress;
77 MmsReport deliveryReport;
79 MmsReportAllowed reportAllowed;
80 char szContentLocation[MMS_LOCATION_LEN + 1];
82 msg_delivery_report_status_t msgStatus;
83 msg_read_report_status_t readStatus;
85 MmsReplyCharge replyCharge;
87 // only used at Decoding module
88 char szMsgID[MMS_MSG_ID_LEN + 1];
91 #ifdef __SUPPORT_DRM__
95 // dependent to Client implementation
100 extern MmsHeader mmsHeader;
103 void MmsInitHeader();
104 void MmsReleaseHeader(MmsHeader *mms);
105 void MmsRegisterDecodeBuffer();
106 void MmsUnregisterDecodeBuffer(void);
107 bool MmsBinaryDecodeMsgHeader(FILE *pFile, int totalLength);
108 bool MmsBinaryDecodeMsgBody(FILE *pFile, char *szFilePath, int totalLength);
109 bool MmsReadMsgBody(msg_message_id_t msgID, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath);
112 char *MsgChangeHexString(char *pOrg);
113 char *MsgResolveContentURI(char *szSrc);
114 char *MsgRemoveQuoteFromFilename(char *pSrc);
115 bool MsgIsMultipart(int type);
116 bool MmsAddrUtilCompareAddr(char *pszAddr1, char *pszAddr2);
117 bool MmsDataUpdateLastStatus(MmsMsg *pMsg);
118 bool MmsAddrUtilRemovePlmnString(char *pszAddr);
119 bool MsgGetTypeByFileName(int *type, char *szFileName);
120 bool MsgGetFileNameWithoutExtension(char *szOutputName, char *szName);
121 int MmsGetMediaPartCount(msg_message_id_t msgId);
122 bool MmsGetMediaPartHeader(int index, MsgType *pHeader);
123 bool MmsGetMsgAttrib(MmsMsgID msgID, MmsAttrib *pAttrib);
125 #ifdef __SUPPORT_DRM__
126 bool MsgCopyDrmInfo(MsgType *pPartType);
127 bool MmsDrm2ConvertMsgBody(char *szOriginFilePath);
128 bool MmsDrm2ReadMsgConvertedBody(MSG_MESSAGE_INFO_S *pMsg, bool bSavePartsAsTempFiles, bool bRetrieved, char *retrievedPath);
131 #endif //MMS_PLUGIN_DECODE_H