2 * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
4 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 MSG_MMS_MESSAGE_H
18 #define MSG_MMS_MESSAGE_H
20 /*==================================================================================================
22 ==================================================================================================*/
24 #include "MsgInternalTypes.h"
25 #include "MsgMmsTypes.h"
27 msg_error_t _MsgMmsAddPage(MMS_MESSAGE_DATA_S *pMsgData, MMS_PAGE_S *pPage);
28 msg_error_t _MsgMmsAddMedia(MMS_PAGE_S *pPage, MMS_MEDIA_S *pMedia);
29 msg_error_t _MsgMmsAddAttachment(MMS_MESSAGE_DATA_S *pMsgData, MMS_ATTACH_S *pMedia);
30 msg_error_t _MsgMmsAddRegion(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_REGION * pRegion);
31 msg_error_t _MsgMmsAddTransition(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_TRANSITION *pTransition);
32 msg_error_t _MsgMmsAddMeta(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_META *pMeta);
34 MMS_PAGE_S *_MsgMmsGetPage(MMS_MESSAGE_DATA_S *pMsgData, int pageIdx);
35 MMS_SMIL_REGION *_MsgMmsGetSmilRegion(MMS_MESSAGE_DATA_S *pMsgData, int regionIdx);
36 MMS_MEDIA_S *_MsgMmsGetMedia(MMS_PAGE_S *pPage, int mediaIdx);
37 MMS_ATTACH_S *_MsgMmsGetAttachment(MMS_MESSAGE_DATA_S *pMsgData, int attachIdx);
38 MMS_SMIL_TRANSITION *_MsgMmsGetTransition(MMS_MESSAGE_DATA_S *pMsgData, int transitionIdx);
39 MMS_SMIL_META *_MsgMmsGetMeta(MMS_MESSAGE_DATA_S *pMsgData, int metaIdx);
41 int _MsgMmsGetPageCount(MMS_MESSAGE_DATA_S *pMsgData);
42 int _MsgMmsGetAttachCount(MMS_MESSAGE_DATA_S *pMsgData);
43 int _MsgMmsGetTransitionCount(MMS_MESSAGE_DATA_S *pMsgData);
44 int _MsgMmsGetMetaCount(MMS_MESSAGE_DATA_S *pMsgData);
46 void MsgMmsReleaseMmsLists(MMS_MESSAGE_DATA_S *pMsgData);
48 char *_MsgMmsSerializeMessageData(const MMS_MESSAGE_DATA_S *pMsgData, unsigned int *pSize);
49 bool _MsgMmsDeserializeMessageData(MMS_MESSAGE_DATA_S *pMsgData, const char *pData);
51 bool _MsgMmsSetRootLayout(MMS_MESSAGE_DATA_S *pMsgData, MMS_SMIL_ROOTLAYOUT *pRootlayout);
53 void _MsgMmsPrint(MMS_MESSAGE_DATA_S *pMsgData);
54 void _MsgMmsAttachPrint(MMS_ATTACH_S *attach);
55 void _MsgMmsMediaPrint(MMS_MEDIA_S *media);
56 void _MsgMmsPagePrint(MMS_PAGE_S *page);
58 MMS_HEADER_DATA_S *MsgMmsCreateHeader();
59 void MsgMmsInitHeader(MMS_HEADER_DATA_S *pMmsHeaderData);
60 void MsgMmsReleaseHeader(MMS_HEADER_DATA_S **ppMmHeadersData);
62 MMS_MULTIPART_DATA_S *MsgMmsCreateMultipart();
63 void MsgMmsInitMultipart(MMS_MULTIPART_DATA_S *pMmsMultipart);
64 void MsgMmsReleaseMultipart(MMS_MULTIPART_DATA_S **ppMmsMultipart);
66 MMS_DATA_S *MsgMmsCreate();
68 void MsgMmsRelease(MMS_DATA_S **ppMmsData);
70 int MsgMmsReleaseMultipartList(MMSList **ppMultipartList);
72 int MsgMmsGetSmilMultipart(MMSList *pMultipartList, MMS_MULTIPART_DATA_S **smil_multipart); /*TODO : delete */
74 int MsgMmsConvertMmsDataToMmsMessageData(MMS_DATA_S *pSrc, MMS_MESSAGE_DATA_S *pDst);
76 int MsgMmsConvertMmsMessageDataToMmsData(MMS_MESSAGE_DATA_S *pSrc, MMS_DATA_S *pDst);
78 MMS_ADDRESS_DATA_S *MsgMmsCreateAddress(int addressType, const char *addressVal);
79 void MsgMmsReleaseAddress(MMS_ADDRESS_DATA_S **ppMmsAddressData);
80 int MsgMmsReleaseAddressList(MMSList **ppAddressList);
82 int MsgMmsSetMultipartData(MMS_MULTIPART_DATA_S *pMultipart);
83 int MsgMmsSetMultipartFilePath(const char *dirPath, MMS_MULTIPART_DATA_S *pMultipart);
85 int MsgMmsSetMultipartListData(MMS_DATA_S *pMmsData);
86 int MsgMmsSetMultipartListFilePath(const char *dirPath, MMS_DATA_S *pMmsData);
88 int printMultipart(MMS_MULTIPART_DATA_S *multipart);
89 int printMultipartList(MMSList *pMultipartList); /*for debug */
91 void _MsgMmsMultipartPrint(MMS_MULTIPART_DATA_S *multipart);
93 bool _MsgMmsRemoveEmptyObject(MMS_MESSAGE_DATA_S *pMmsMsg);
95 int MsgMmsCheckFilepathSmack(int fd, const char *ipc_filename);
97 #endif /* MSG_MMS_MESSAGE_H */