From: Denis Dolzhenko Date: Tue, 19 Jul 2016 14:36:47 +0000 (+0300) Subject: TizenRefApp-6278 Calendar event attachment support X-Git-Tag: submit/tizen/20160810.144952^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F80702%2F10;p=profile%2Fmobile%2Fapps%2Fnative%2Fmessage.git TizenRefApp-6278 Calendar event attachment support Change-Id: I4e28efdb8600e0cceca70dd4c69e42c436e80477 Signed-off-by: Denis Dolzhenko --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 10230acc..15945824 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ pkg_check_modules(pkgs REQUIRED storage attach-panel phonenumber-utils + calendar-service2 ) ADD_DEFINITIONS("-DAPP_DIR=\"${PKGDIR}\"") diff --git a/edje/images/U01_icon_etc.png b/edje/images/U01_icon_etc.png index 6ea35ead..ef2bc639 100755 Binary files a/edje/images/U01_icon_etc.png and b/edje/images/U01_icon_etc.png differ diff --git a/edje/images/U01_icon_vcs.png b/edje/images/U01_icon_vcs.png index b40edf4b..7fac5c86 100755 Binary files a/edje/images/U01_icon_vcs.png and b/edje/images/U01_icon_vcs.png differ diff --git a/inc/Resource.h b/inc/Resource.h index 2622a776..2f913129 100644 --- a/inc/Resource.h +++ b/inc/Resource.h @@ -20,7 +20,7 @@ #define EDJ_PATH "edje" #define IMAGE_PATH "images" -// Edj images: +// Res images: #define CONV_SEND_IMG "btn_conversation_message_sending.png" #define CONV_ADD_IMG "btn_conversation_add.png" #define CONTACT_IMG "icon_btn_contact.png" @@ -28,6 +28,8 @@ #define ATTACH_IMG "attach_icon.png" #define ADD_PLUS_ICON "core_button_add.png" #define ATTACH_MUSIC_ICON "messages_attach_ic_music.png" +#define ATTACH_CAL_ICON "U01_icon_vcs.png" +#define ATTACH_UNKNOWN_ICON "U01_icon_etc.png" // Edj: #define IMAGES_EDJ_PATH EDJ_PATH"/images.edj" diff --git a/packaging/message.spec b/packaging/message.spec index bca1c331..c7ab6be9 100755 --- a/packaging/message.spec +++ b/packaging/message.spec @@ -51,6 +51,7 @@ BuildRequires: pkgconfig(capi-system-runtime-info) BuildRequires: pkgconfig(storage) BuildRequires: pkgconfig(attach-panel) BuildRequires: pkgconfig(phonenumber-utils) +BuildRequires: pkgconfig(calendar-service2) %if %TIZEN_2_4_BUILD == 0 diff --git a/project_def.prop b/project_def.prop index 9944f31f..72f06acf 100644 --- a/project_def.prop +++ b/project_def.prop @@ -9,7 +9,7 @@ type = app profile = mobile-3.0 # C Sources -USER_SRCS = src/MainApp/MainApp.cpp src/Common/AppControl/src/ContactViewer.cpp src/Common/View/src/PopupManager.cpp src/Common/MsgEngine/src/MsgPage.cpp src/Conversation/ConvList/View/src/BubbleAudioViewItem.cpp src/Common/View/src/ViewItem.cpp src/Common/MsgEngine/src/private/MsgComposerPrivate.cpp src/Common/MsgEngine/src/MsgThreadItem.cpp src/Conversation/Body/View/src/TextPageViewItem.cpp src/Viewer/View/src/SmilImageItemView.cpp src/Common/MsgEngine/src/private/MsgAttachmentPrivate.cpp src/Viewer/View/src/SubjectLayout.cpp src/Settings/Controller/src/SimListViewItem.cpp src/Conversation/ContactList/View/src/ContactListViewItem.cpp src/Viewer/Controller/src/SmilPage.cpp src/Common/View/src/SelectAllListItem.cpp src/Common/AppControl/src/AppControlCommand.cpp src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp src/Common/ContactManager/src/VcfGenerator.cpp src/Common/View/src/Box.cpp src/Conversation/ConvList/View/src/DateLineViewItem.cpp src/Conversation/ConvList/View/src/ConvListViewItem.cpp src/Common/MsgEngine/src/private/MessageSMSPrivate.cpp src/Viewer/View/src/ViewerLayout.cpp src/Common/MsgEngine/src/private/MessagePrivate.cpp src/Conversation/ConvList/View/src/BubbleUnknownFileViewItem.cpp src/Common/AppControl/src/AppControlCompose.cpp src/MsgThread/Controller/src/ThreadSearchListItem.cpp src/Conversation/Recipients/View/src/ConvRecipientsPanelView.cpp src/Common/Utils/src/HwButtonListener.cpp src/Common/View/src/PopupAttachmentListItem.cpp src/Common/Controller/src/MbeRecipients.cpp src/Common/View/src/ContextPopup.cpp src/MsgThread/Controller/src/MsgSearchListItem.cpp src/Conversation/Body/View/src/BodyView.cpp src/Common/View/src/NoContentLayout.cpp src/Conversation/Body/View/src/PageSeparator.cpp src/Conversation/Main/Controller/src/PopupRecipientListItem.cpp src/Settings/Controller/src/MsgOnSimCard.cpp src/Common/View/src/MbeRecipientsView.cpp src/Conversation/Body/Controller/src/Page.cpp src/Conversation/AppControl/src/LaunchSettings.cpp src/Common/MsgEngine/src/MsgTransport.cpp src/Viewer/View/src/SmilAttachmentItemView.cpp src/Viewer/View/src/PlayerControl.cpp src/MsgThread/Controller/src/MsgThread.cpp src/Conversation/Body/View/src/ImagePageViewItem.cpp src/Conversation/ConvList/Controller/src/ConvListItem.cpp src/Conversation/Main/View/src/ConversationLayout.cpp src/Common/View/src/StandardWindow.cpp src/Common/MsgEngine/src/private/MsgConversationItemPrivate.cpp src/Conversation/Main/View/src/MessageInputPanel.cpp src/Conversation/ContactList/Controller/src/ConvContactList.cpp src/Viewer/Controller/src/Viewer.cpp src/Conversation/Body/View/src/MediaPageViewItem.cpp src/Common/Utils/src/PhoneNumberUtils.cpp src/Settings/Controller/src/Settings.cpp src/Common/View/src/PopupList.cpp src/Common/MsgEngine/src/private/MsgReportPrivate.cpp src/Common/View/src/ListView.cpp src/Conversation/Utils/src/WorkingDir.cpp src/Conversation/Body/View/src/SoundPageViewItem.cpp src/Conversation/Body/View/src/BodyAttachmentViewItem.cpp src/Conversation/AppControl/src/AttachPanel.cpp src/Conversation/Body/View/src/PageView.cpp src/Common/Utils/src/ThumbnailMaker.cpp src/Settings/View/src/SettingsGroupListViewItem.cpp src/Conversation/Utils/src/AttachmentHandler.cpp src/Common/AppControl/src/FileViewer.cpp src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp src/MsgThread/Controller/src/ThreadSearchList.cpp src/Common/MsgEngine/src/private/MsgPagePrivate.cpp src/Common/MsgEngine/src/private/MsgThreadItemPrivate.cpp src/Common/Controller/src/SaveAttachmentsPopup.cpp src/Viewer/View/src/SmilAudioItemView.cpp src/Common/AppControl/src/AppControlParser.cpp src/Common/MsgEngine/src/MsgSettings.cpp src/Common/MsgEngine/src/MsgUtils.cpp src/Viewer/Controller/src/SmilPlayer.cpp src/Common/Controller/src/ViewItemController.cpp src/MsgThread/Controller/src/ThreadList.cpp src/Conversation/ConvList/View/src/BubbleDownloadButtonViewItem.cpp src/Common/MsgEngine/src/MsgConversationItem.cpp src/MsgThread/Controller/src/BaseThreadListItem.cpp src/Conversation/Body/View/src/VideoPageViewItem.cpp src/Common/MsgEngine/src/MessageSMS.cpp src/Conversation/Body/Controller/src/PopupBodyAttachmentListItem.cpp src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp src/MsgThread/Controller/src/ThreadListItem.cpp src/Common/MsgEngine/src/private/MsgAddressPrivate.cpp src/Conversation/ConvList/View/src/BubbleViewItem.cpp src/Viewer/View/src/SmilPageLayout.cpp src/Common/View/src/Scroller.cpp src/Common/Controller/src/FrameController.cpp src/Common/AppControl/src/AppControlUtils.cpp src/Common/Controller/src/NaviFrameController.cpp src/Common/View/src/DefaultLayout.cpp src/Conversation/ContactList/Controller/src/ContactListItem.cpp src/Common/MsgEngine/src/private/MsgSettingsPrivate.cpp src/Common/MsgEngine/src/MsgStorage.cpp src/Common/Utils/src/FileUtils.cpp src/Common/Utils/src/LoggerImpl.cpp src/Conversation/ConvList/View/src/BubbleItemContainer.cpp src/Conversation/ConvList/Controller/src/DateLineItem.cpp src/Common/View/src/PopupListItem.cpp src/Common/View/src/View.cpp src/Common/Utils/src/TextDecorator.cpp src/MainApp/main.cpp src/Common/Utils/src/PathUtils.cpp src/Conversation/Body/View/src/BodyViewItem.cpp src/Common/MsgEngine/src/private/MsgTransportPrivate.cpp src/Common/Controller/src/BaseController.cpp src/Common/Controller/src/App.cpp src/Viewer/View/src/SmilVideoItemView.cpp src/MsgThread/View/src/ThreadListViewItem.cpp src/Common/AppControl/src/ContactEditor.cpp src/Conversation/ConvList/View/src/ConvListLayout.cpp src/Common/MsgEngine/src/private/MsgConvMediaPrivate.cpp src/Common/Utils/src/MediaUtils.cpp src/Conversation/Recipients/Controller/src/ConvRecipientsPanel.cpp src/Conversation/ConvList/View/src/ConvSelectAll.cpp src/Common/MsgEngine/src/Message.cpp src/Common/MsgEngine/src/private/MsgStoragePrivate.cpp src/Common/View/src/Popup.cpp src/Common/View/src/ListItem.cpp src/Viewer/Utils/src/MediaPlayer.cpp src/Common/Utils/src/TimeUtils.cpp src/Settings/View/src/SettingsListViewItem.cpp src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp src/Conversation/Body/Controller/src/Body.cpp src/Common/MsgEngine/src/MsgEngine.cpp src/Conversation/ContactList/View/src/ConvContactListView.cpp src/Conversation/AppControl/src/ContactPicker.cpp src/MsgThread/View/src/MsgThreadSearchPanel.cpp src/MsgThread/View/src/FloatingButton.cpp src/Settings/Controller/src/SettingsSound.cpp src/Settings/View/src/SimMsgLayout.cpp src/Common/AppControl/src/FileShare.cpp src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp src/Common/AppControl/src/AppControlDefault.cpp src/Viewer/View/src/SmilTextItemView.cpp src/Common/ContactManager/src/ContactManager.cpp src/Common/View/src/NaviFrameView.cpp src/Common/MsgEngine/src/private/MessageMmsPrivate.cpp src/Conversation/ConvList/Controller/src/ConvList.cpp src/Conversation/Body/View/src/PageViewItem.cpp src/Common/Controller/src/ViewController.cpp src/Conversation/Main/Controller/src/Conversation.cpp src/Common/SystemSettingsManager/src/SystemSettingsManager.cpp src/Common/ContactManager/src/ContactRecord.cpp src/MsgThread/View/src/MsgThreadLayout.cpp src/Common/View/src/NaviFrameItem.cpp src/Common/AppControl/src/VoiceCall.cpp src/Common/MsgEngine/src/MessageMms.cpp src/Conversation/Utils/src/MessageDetailContent.cpp src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp src/Viewer/View/src/SmilPlayerView.cpp +USER_SRCS = src/MainApp/MainApp.cpp src/Common/AppControl/src/ContactViewer.cpp src/Common/View/src/PopupManager.cpp src/Common/MsgEngine/src/MsgPage.cpp src/Conversation/ConvList/View/src/BubbleAudioViewItem.cpp src/Common/View/src/ViewItem.cpp src/Common/MsgEngine/src/private/MsgComposerPrivate.cpp src/Common/MsgEngine/src/MsgThreadItem.cpp src/Conversation/Body/View/src/TextPageViewItem.cpp src/Viewer/View/src/SmilImageItemView.cpp src/Common/MsgEngine/src/private/MsgAttachmentPrivate.cpp src/Viewer/View/src/SubjectLayout.cpp src/Settings/Controller/src/SimListViewItem.cpp src/Conversation/ContactList/View/src/ContactListViewItem.cpp src/Viewer/Controller/src/SmilPage.cpp src/Common/View/src/SelectAllListItem.cpp src/Common/AppControl/src/AppControlCommand.cpp src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp src/Common/ContactManager/src/ContactVCardGenerator.cpp src/Common/View/src/Box.cpp src/Conversation/ConvList/View/src/DateLineViewItem.cpp src/Conversation/ConvList/View/src/ConvListViewItem.cpp src/Common/MsgEngine/src/private/MessageSMSPrivate.cpp src/Viewer/View/src/ViewerLayout.cpp src/Common/MsgEngine/src/private/MessagePrivate.cpp src/Conversation/ConvList/View/src/BubbleUnknownFileViewItem.cpp src/Common/AppControl/src/AppControlCompose.cpp src/MsgThread/Controller/src/ThreadSearchListItem.cpp src/Conversation/Recipients/View/src/ConvRecipientsPanelView.cpp src/Common/Utils/src/HwButtonListener.cpp src/Common/View/src/PopupAttachmentListItem.cpp src/Common/Controller/src/MbeRecipients.cpp src/Common/View/src/ContextPopup.cpp src/MsgThread/Controller/src/MsgSearchListItem.cpp src/Conversation/Body/View/src/BodyView.cpp src/Common/View/src/NoContentLayout.cpp src/Conversation/Body/View/src/PageSeparator.cpp src/Conversation/Main/Controller/src/PopupRecipientListItem.cpp src/Settings/Controller/src/MsgOnSimCard.cpp src/Common/View/src/MbeRecipientsView.cpp src/Conversation/Body/Controller/src/Page.cpp src/Conversation/AppControl/src/LaunchSettings.cpp src/Common/MsgEngine/src/MsgTransport.cpp src/Viewer/View/src/SmilAttachmentItemView.cpp src/Viewer/View/src/PlayerControl.cpp src/MsgThread/Controller/src/MsgThread.cpp src/Conversation/Body/View/src/ImagePageViewItem.cpp src/Conversation/ConvList/Controller/src/ConvListItem.cpp src/Conversation/Main/View/src/ConversationLayout.cpp src/Common/View/src/StandardWindow.cpp src/Common/MsgEngine/src/private/MsgConversationItemPrivate.cpp src/Conversation/Main/View/src/MessageInputPanel.cpp src/Conversation/ContactList/Controller/src/ConvContactList.cpp src/Viewer/Controller/src/Viewer.cpp src/Conversation/Body/View/src/MediaPageViewItem.cpp src/Common/Utils/src/PhoneNumberUtils.cpp src/Settings/Controller/src/Settings.cpp src/Common/View/src/PopupList.cpp src/Common/MsgEngine/src/private/MsgReportPrivate.cpp src/Common/View/src/ListView.cpp src/Conversation/Utils/src/WorkingDir.cpp src/Conversation/Body/View/src/SoundPageViewItem.cpp src/Conversation/Body/View/src/BodyAttachmentViewItem.cpp src/Conversation/AppControl/src/AttachPanel.cpp src/Conversation/Body/View/src/PageView.cpp src/Common/Utils/src/ThumbnailMaker.cpp src/Settings/View/src/SettingsGroupListViewItem.cpp src/Conversation/Utils/src/AttachmentHandler.cpp src/Common/AppControl/src/FileViewer.cpp src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp src/MsgThread/Controller/src/ThreadSearchList.cpp src/Common/MsgEngine/src/private/MsgPagePrivate.cpp src/Common/MsgEngine/src/private/MsgThreadItemPrivate.cpp src/Common/Controller/src/SaveAttachmentsPopup.cpp src/Viewer/View/src/SmilAudioItemView.cpp src/Common/AppControl/src/AppControlParser.cpp src/Common/MsgEngine/src/MsgSettings.cpp src/Common/Utils/src/VCalendarParser.cpp src/Common/MsgEngine/src/MsgUtils.cpp src/Viewer/Controller/src/SmilPlayer.cpp src/Common/Controller/src/ViewItemController.cpp src/MsgThread/Controller/src/ThreadList.cpp src/Conversation/ConvList/View/src/BubbleDownloadButtonViewItem.cpp src/Common/MsgEngine/src/MsgConversationItem.cpp src/MsgThread/Controller/src/BaseThreadListItem.cpp src/Conversation/Body/View/src/VideoPageViewItem.cpp src/Common/MsgEngine/src/MessageSMS.cpp src/Conversation/Body/Controller/src/PopupBodyAttachmentListItem.cpp src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp src/MsgThread/Controller/src/ThreadListItem.cpp src/Common/MsgEngine/src/private/MsgAddressPrivate.cpp src/Conversation/ConvList/View/src/BubbleViewItem.cpp src/Viewer/View/src/SmilPageLayout.cpp src/Common/View/src/Scroller.cpp src/Common/Controller/src/FrameController.cpp src/Common/AppControl/src/AppControlUtils.cpp src/Common/Controller/src/NaviFrameController.cpp src/Common/View/src/DefaultLayout.cpp src/Conversation/ContactList/Controller/src/ContactListItem.cpp src/Common/MsgEngine/src/private/MsgSettingsPrivate.cpp src/Common/MsgEngine/src/MsgStorage.cpp src/Common/Utils/src/FileUtils.cpp src/Common/Utils/src/LoggerImpl.cpp src/Conversation/ConvList/View/src/BubbleItemContainer.cpp src/Conversation/ConvList/Controller/src/DateLineItem.cpp src/Common/View/src/PopupListItem.cpp src/Common/View/src/View.cpp src/Common/Utils/src/TextDecorator.cpp src/MainApp/main.cpp src/Common/Utils/src/PathUtils.cpp src/Common/MsgEngine/src/private/MsgTransportPrivate.cpp src/Conversation/Body/View/src/BodyViewItem.cpp src/Common/Controller/src/BaseController.cpp src/Common/Controller/src/App.cpp src/Viewer/View/src/SmilVideoItemView.cpp src/MsgThread/View/src/ThreadListViewItem.cpp src/Common/AppControl/src/ContactEditor.cpp src/Conversation/ConvList/View/src/ConvListLayout.cpp src/Common/MsgEngine/src/private/MsgConvMediaPrivate.cpp src/Common/Utils/src/MediaUtils.cpp src/Conversation/Recipients/Controller/src/ConvRecipientsPanel.cpp src/Conversation/ConvList/View/src/ConvSelectAll.cpp src/Common/MsgEngine/src/Message.cpp src/Common/MsgEngine/src/private/MsgStoragePrivate.cpp src/Common/View/src/Popup.cpp src/Common/View/src/ListItem.cpp src/Viewer/Utils/src/MediaPlayer.cpp src/Common/Utils/src/TimeUtils.cpp src/Settings/View/src/SettingsListViewItem.cpp src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp src/Conversation/Body/Controller/src/Body.cpp src/Common/MsgEngine/src/MsgEngine.cpp src/Conversation/ContactList/View/src/ConvContactListView.cpp src/Conversation/AppControl/src/ContactPicker.cpp src/MsgThread/View/src/MsgThreadSearchPanel.cpp src/MsgThread/View/src/FloatingButton.cpp src/Settings/Controller/src/SettingsSound.cpp src/Settings/View/src/SimMsgLayout.cpp src/Common/AppControl/src/FileShare.cpp src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp src/Common/AppControl/src/AppControlDefault.cpp src/Viewer/View/src/SmilTextItemView.cpp src/Conversation/ConvList/View/src/BubbleCalEventViewItem.cpp src/Common/ContactManager/src/ContactManager.cpp src/Common/View/src/NaviFrameView.cpp src/Common/MsgEngine/src/private/MessageMmsPrivate.cpp src/Conversation/ConvList/Controller/src/ConvList.cpp src/Conversation/Body/View/src/PageViewItem.cpp src/Common/Controller/src/ViewController.cpp src/Conversation/Main/Controller/src/Conversation.cpp src/Common/SystemSettingsManager/src/SystemSettingsManager.cpp src/Common/ContactManager/src/ContactRecord.cpp src/MsgThread/View/src/MsgThreadLayout.cpp src/Common/View/src/NaviFrameItem.cpp src/Common/AppControl/src/VoiceCall.cpp src/Common/MsgEngine/src/MessageMms.cpp src/Conversation/Utils/src/MessageDetailContent.cpp src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp src/Viewer/View/src/SmilPlayerView.cpp src/Common/ContactManager/src/ContactVCardParser.cpp USER_SRCS_ABS = # EDC Sources @@ -35,7 +35,7 @@ USER_OBJS_ABS = # User Includes ## C Compiler -USER_INC_DIRS = src/Conversation/Utils/inc src/Common/SystemSettingsManager/inc inc src/Conversation/AppControl/inc src/Conversation/ConvList/Controller/inc src/Conversation/ConvList/View/inc src/Conversation/Main/Controller/inc src/Conversation/Main/View/inc src/Conversation/Recipients/Controller/inc src/Conversation/Recipients/View/inc src/Common/ContactManager/inc src/Common/AppControl/inc src/Conversation/Body/Controller/inc src/Conversation/ContactList/Controller/inc src/Conversation/ContactList/View/inc src/Conversation/Body/View/inc src/Settings/Controller/inc src/Settings/View/inc src/Viewer/Controller/inc src/Viewer/View/inc src/Viewer/Utils/inc src/MsgThread/Controller/inc src/MsgThread/View/inc src/Common/MsgEngine/inc src/Common/Utils/inc src/Common/View/inc src/Common/Controller/inc +USER_INC_DIRS = src/Conversation/Utils/inc src/Common/SystemSettingsManager/inc inc src/Conversation/AppControl/inc src/Conversation/ConvList/Controller/inc src/Conversation/ConvList/View/inc src/Conversation/Main/Controller/inc src/Conversation/Main/View/inc src/Conversation/Recipients/Controller/inc src/Conversation/Recipients/View/inc src/Common/ContactManager/inc src/Common/AppControl/inc src/Conversation/Body/Controller/inc src/Conversation/ContactList/Controller/inc src/Conversation/ContactList/View/inc src/Conversation/Body/View/inc src/Settings/Controller/inc src/Settings/View/inc src/Viewer/Controller/inc src/Viewer/View/inc src/Viewer/Utils/inc src/MsgThread/Controller/inc src/MsgThread/View/inc src/Common/MsgEngine/inc src/Common/Utils/inc src/Common/View/inc src/Common/Controller/inc USER_INC_DIRS_ABS = USER_INC_FILES = USER_INC_FILES_ABS = diff --git a/src/Common/ContactManager/inc/Contact.h b/src/Common/ContactManager/inc/Contact.h new file mode 100644 index 00000000..d6778109 --- /dev/null +++ b/src/Common/ContactManager/inc/Contact.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2009-2015 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 __Contact_h__ +#define __Contact_h__ + +#include "ContactRecord.h" + +#include +#include +#include + +namespace Msg +{ + class Contact; + typedef std::shared_ptr ContactRef; + + class Contact + : public ContactRecord + { + public: + Contact(bool release, contacts_record_h record = nullptr); + + std::string getDispName() const; + std::string getPhoneNumber() const; + std::string getEmail() const; + std::string getThumb() const; + }; + + inline Contact::Contact(bool release, contacts_record_h record) + : ContactRecord(release, record) + { + } + + inline std::string Contact::getDispName() const + { + return getStr(_contacts_contact.display_name); + } + + inline std::string Contact::getPhoneNumber() const + { + return getStr(_contacts_contact.number); + } + + inline std::string Contact::getEmail() const + { + return getStr(_contacts_contact.email); + } + + inline std::string Contact::getThumb() const + { + return getStr(_contacts_contact.image_thumbnail_path); + } +} + +#endif /* __Contact_h__ */ diff --git a/src/Common/ContactManager/inc/ContactManager.h b/src/Common/ContactManager/inc/ContactManager.h index a8c9d962..b59230e4 100644 --- a/src/Common/ContactManager/inc/ContactManager.h +++ b/src/Common/ContactManager/inc/ContactManager.h @@ -31,6 +31,7 @@ #include "ContactMyProfile.h" #include "ContactMyProfileNumber.h" #include "ContactMyProfileEmail.h" +#include "Contact.h" namespace Msg { @@ -125,12 +126,19 @@ namespace Msg */ std::string makeVcard(const int personId, bool myProfile); - /** - *@brief Create content of contact by id list + /** +- *@brief Create content of contact by id list *@param[in] personId - contact id *@return Content with all info about contacts */ - std::string makeVcard(const std::list &idList); + std::string makeVcard(const std::list &idList); + + /** + *@brief Parse vCard file + *@param[in] filePath Path to file + *@return list of Contacts + */ + std::shared_ptr> parseVcard(const std::string &filePath); private: typedef std::unordered_map AddressMap; diff --git a/src/Common/ContactManager/src/ContactVCardGenerator.cpp b/src/Common/ContactManager/src/ContactVCardGenerator.cpp new file mode 100644 index 00000000..218c4994 --- /dev/null +++ b/src/Common/ContactManager/src/ContactVCardGenerator.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2009-2016 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. + * + */ + +#include "ContactManager.h" +#include +#include "Logger.h" +#include +#include +#include + +using namespace Msg; + +namespace +{ + const int avgLengthOfContent = 2048; +} + +std::string ContactManager::makeVcard(const int personId, bool myProfile) +{ + contacts_record_h record = nullptr; + std::string vcardContent; + + if(contacts_db_get_record((myProfile ? _contacts_my_profile._uri : _contacts_person._uri), personId, &record) != CONTACTS_ERROR_NONE) + { + MSG_LOG_ERROR("contacts_db_get_record() failed"); + record = nullptr; + return std::string(); + } + vcardContent = createContactContent(record, myProfile); + + if(record) + contacts_record_destroy(record, true); + + return vcardContent; +} + +std::string ContactManager::makeVcard(const std::list &idList) +{ + std::string vcardContent; + vcardContent.reserve(idList.size() * avgLengthOfContent); + for(auto it : idList) + vcardContent += createContentForContactList(it); + + return vcardContent; +} + +std::string ContactManager::createContactContent(contacts_record_h record, bool myProfile) +{ + char *vcardBuff = nullptr; + + myProfile ? contacts_vcard_make_from_my_profile(record, &vcardBuff) : contacts_vcard_make_from_person(record, &vcardBuff); + + if(!vcardBuff) + { + MSG_LOG_ERROR("vcardBuff is NULL"); + return std::string(); + } + + std::string result(vcardBuff); + free(vcardBuff); + return result; +} + +std::string ContactManager::createContentForContactList(int personId) +{ + contacts_record_h record = nullptr; + if(contacts_db_get_record(_contacts_person._uri, personId, &record) != CONTACTS_ERROR_NONE) + { + MSG_LOG_ERROR("contacts_db_get_record() failed!"); + record = nullptr; + return std::string(); + } + std::string result = createContactContent(record, false); + + if (record) + contacts_record_destroy(record, true); + + return result; +} diff --git a/src/Common/ContactManager/src/ContactVCardParser.cpp b/src/Common/ContactManager/src/ContactVCardParser.cpp new file mode 100644 index 00000000..6aa803d3 --- /dev/null +++ b/src/Common/ContactManager/src/ContactVCardParser.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2009-2016 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. + * + */ + +#include "ContactManager.h" +#include "Logger.h" +#include "FileUtils.h" + +#include +#include +#include +#include + +using namespace Msg; + +std::shared_ptr> ContactManager::parseVcard(const std::string &filePath) +{ + std::shared_ptr> res; + + if(filePath.empty()) + return res; + + std::string vcardStream = FileUtils::readTextFile(filePath); + if(vcardStream.empty()) + return res; + + contacts_list_h list = {}; + int parseRes = contacts_vcard_parse_to_contacts(vcardStream.c_str(), &list); + if(list) + res = std::make_shared>(list); + + MSG_LOG("Parse result: ", parseRes); + + return res; +} diff --git a/src/Common/ContactManager/src/VcfGenerator.cpp b/src/Common/ContactManager/src/VcfGenerator.cpp deleted file mode 100644 index 218c4994..00000000 --- a/src/Common/ContactManager/src/VcfGenerator.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2009-2016 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. - * - */ - -#include "ContactManager.h" -#include -#include "Logger.h" -#include -#include -#include - -using namespace Msg; - -namespace -{ - const int avgLengthOfContent = 2048; -} - -std::string ContactManager::makeVcard(const int personId, bool myProfile) -{ - contacts_record_h record = nullptr; - std::string vcardContent; - - if(contacts_db_get_record((myProfile ? _contacts_my_profile._uri : _contacts_person._uri), personId, &record) != CONTACTS_ERROR_NONE) - { - MSG_LOG_ERROR("contacts_db_get_record() failed"); - record = nullptr; - return std::string(); - } - vcardContent = createContactContent(record, myProfile); - - if(record) - contacts_record_destroy(record, true); - - return vcardContent; -} - -std::string ContactManager::makeVcard(const std::list &idList) -{ - std::string vcardContent; - vcardContent.reserve(idList.size() * avgLengthOfContent); - for(auto it : idList) - vcardContent += createContentForContactList(it); - - return vcardContent; -} - -std::string ContactManager::createContactContent(contacts_record_h record, bool myProfile) -{ - char *vcardBuff = nullptr; - - myProfile ? contacts_vcard_make_from_my_profile(record, &vcardBuff) : contacts_vcard_make_from_person(record, &vcardBuff); - - if(!vcardBuff) - { - MSG_LOG_ERROR("vcardBuff is NULL"); - return std::string(); - } - - std::string result(vcardBuff); - free(vcardBuff); - return result; -} - -std::string ContactManager::createContentForContactList(int personId) -{ - contacts_record_h record = nullptr; - if(contacts_db_get_record(_contacts_person._uri, personId, &record) != CONTACTS_ERROR_NONE) - { - MSG_LOG_ERROR("contacts_db_get_record() failed!"); - record = nullptr; - return std::string(); - } - std::string result = createContactContent(record, false); - - if (record) - contacts_record_destroy(record, true); - - return result; -} diff --git a/src/Common/Utils/inc/TimeUtils.h b/src/Common/Utils/inc/TimeUtils.h index 6185f12b..e2b3d44f 100644 --- a/src/Common/Utils/inc/TimeUtils.h +++ b/src/Common/Utils/inc/TimeUtils.h @@ -39,12 +39,14 @@ namespace Msg static std::string makeDateTimeString(time_t msgTime); static std::string makeSmsReportTimeString(time_t msgTime); static std::string makeMmsReportTimeString(time_t msgTime); + static std::string makeCalEventString(time_t time); + static std::string makeCalEventString(int year, int month, int mday, int hour, int min, const char *timezone = nullptr); protected: //made protected to allow inheritance of this class in tests static const std::string &getDefaultLocale(); static std::string getDateBestPattern(const std::string &locale, const std::string &skeleton); - static std::string getFormattedDate(const std::string &locale, const std::string &bestPattern, time_t time); + static std::string getFormattedDate(const std::string &locale, const std::string &bestPattern, time_t time, const char *timezone = nullptr); private: static int getTimeFormat(); diff --git a/src/Common/Utils/inc/VCalendarParser.h b/src/Common/Utils/inc/VCalendarParser.h new file mode 100644 index 00000000..3ff3b962 --- /dev/null +++ b/src/Common/Utils/inc/VCalendarParser.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2015 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 VCardParser_h_ +#define VCardParser_h_ + +#include +#include +#include + +class CalendarEvent +{ + public: + CalendarEvent(calendar_record_h record); + + const std::string &getSummary() const; + const std::string &getStartDate() const; + + private: + std::string m_Summary; + std::string m_StartDate; +}; + +class VCalendarParser +{ + public: + static VCalendarParser &getInst(); + static std::list parse(const std::string &filePath); + + private: + VCalendarParser(); + ~VCalendarParser(); + VCalendarParser& operator=(VCalendarParser&) = delete; + VCalendarParser(VCalendarParser&) = delete; + +}; + + +#endif /* VCardParser_h_ */ diff --git a/src/Common/Utils/src/TimeUtils.cpp b/src/Common/Utils/src/TimeUtils.cpp index 6a77db85..6bfcc797 100644 --- a/src/Common/Utils/src/TimeUtils.cpp +++ b/src/Common/Utils/src/TimeUtils.cpp @@ -115,6 +115,24 @@ std::string TimeUtils::makeMmsReportTimeString(time_t msgTime) return getFormattedDate(locale, getDateBestPattern(locale, timeFormat), msgTime); } +std::string TimeUtils::makeCalEventString(time_t time) +{ + const std::string &locale = getDefaultLocale(); + return getFormattedDate(locale, getDateBestPattern(locale, dateYear), time); +} + +std::string TimeUtils::makeCalEventString(int year, int month, int mday, int hour, int min, const char *timezone) +{ + struct tm time = {}; + time.tm_year = year - 1900; + time.tm_mon = month - 1; + time.tm_mday = mday; + time.tm_hour = hour; + time.tm_min = min; + const std::string &locale = getDefaultLocale(); + return getFormattedDate(locale, getDateBestPattern(locale, dateYear), mktime(&time), timezone); +} + int TimeUtils::getTimeFormat() { bool timeFormat = false; @@ -207,7 +225,7 @@ std::string TimeUtils::getDateBestPattern(const std::string &locale, const std:: return bestPatternString; } -std::string TimeUtils::getFormattedDate(const std::string &locale, const std::string &bestPattern, time_t time) +std::string TimeUtils::getFormattedDate(const std::string &locale, const std::string &bestPattern, time_t time, const char *timezone) { int status = I18N_ERROR_NONE; i18n_udate date; @@ -227,7 +245,7 @@ std::string TimeUtils::getFormattedDate(const std::string &locale, const std::st i18n_ustring_copy_ua_n(uBestPattern, bestPattern.c_str(), maxUcharLen); /* get current timezone and set as default timezone */ - i18n_ustring_copy_ua(utimezoneId, getTimezone().c_str()); + i18n_ustring_copy_ua(utimezoneId, timezone ? timezone : getTimezone().c_str()); status = i18n_ucalendar_set_default_timezone(utimezoneId); if (status != I18N_ERROR_NONE) diff --git a/src/Common/Utils/src/VCalendarParser.cpp b/src/Common/Utils/src/VCalendarParser.cpp new file mode 100644 index 00000000..240fe288 --- /dev/null +++ b/src/Common/Utils/src/VCalendarParser.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2009-2015 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. + * + */ + +#include "VCalendarParser.h" +#include "FileUtils.h" +#include "Logger.h" +#include "TimeUtils.h" + +#include + +using namespace Msg; + +CalendarEvent::CalendarEvent(calendar_record_h record) +{ + char *summary = nullptr; + calendar_record_get_str_p(record, _calendar_event.summary, &summary); + if(summary) + m_Summary = summary; + + calendar_time_s start = {}; + calendar_record_get_caltime(record, _calendar_event.start_time, &start); + if(start.type == CALENDAR_TIME_UTIME) // Unix time + { + m_StartDate = TimeUtils::makeCalEventString(start.time.utime); + } + else // Local time + { + // FIXME: timezone is null + char *timezone = nullptr; + calendar_record_get_str_p(record, _calendar_event.timezone, &timezone); + m_StartDate = TimeUtils::makeCalEventString + ( + start.time.date.year, + start.time.date.month, + start.time.date.mday, + start.time.date.hour, + start.time.date.minute, + timezone + ); + } + +} + +const std::string &CalendarEvent::getSummary() const +{ + return m_Summary; +} + +const std::string &CalendarEvent::getStartDate() const +{ + return m_StartDate; +} + +VCalendarParser::VCalendarParser() +{ + calendar_connect(); +} + +VCalendarParser::~VCalendarParser() +{ + calendar_disconnect(); +} + +VCalendarParser &VCalendarParser::getInst() +{ + static VCalendarParser inst; + return inst; +} + +std::list VCalendarParser::parse(const std::string &filePath) +{ + if(filePath.empty()) + return {}; + + std::list list; + std::string text = FileUtils::readTextFile(filePath); + + calendar_list_h records = nullptr; + int parseRes = calendar_vcalendar_parse_to_calendar(text.c_str(), &records); + MSG_LOG("Parse results: ", parseRes); + + int count = 0; + calendar_list_get_count(records, &count); + calendar_list_first(records); + + for(int i = 0; i < count; ++i) + { + calendar_record_h record = nullptr; + calendar_list_get_current_record_p(records, &record); + if(record) + { + char *viewUri = nullptr; + calendar_record_get_uri_p(record, &viewUri); + if(viewUri && !strcmp(viewUri, _calendar_event._uri)) + list.emplace_back(record); + } + } + + if(records) + calendar_list_destroy(records, true); + + return list; +} + + diff --git a/src/Conversation/ConvList/Controller/inc/ConvListItem.h b/src/Conversation/ConvList/Controller/inc/ConvListItem.h index 30c1e190..13f1baf3 100644 --- a/src/Conversation/ConvList/Controller/inc/ConvListItem.h +++ b/src/Conversation/ConvList/Controller/inc/ConvListItem.h @@ -93,6 +93,7 @@ namespace Msg void addTextItem(std::string text, bool markup, const std::string &searchWord); void addImageItem(const MsgConvMedia &media); void addAttachedFileItem(const MsgConvMedia &media); + void addCalendarItem(const MsgConvMedia &media); // Create Popup when message is clicked void showMainListPopup(); diff --git a/src/Conversation/ConvList/Controller/src/ConvListItem.cpp b/src/Conversation/ConvList/Controller/src/ConvListItem.cpp index 7a8cc35b..434b458b 100644 --- a/src/Conversation/ConvList/Controller/src/ConvListItem.cpp +++ b/src/Conversation/ConvList/Controller/src/ConvListItem.cpp @@ -21,6 +21,7 @@ #include "CallbackAssist.h" #include "FileUtils.h" #include "TimeUtils.h" +#include "VCalendarParser.h" #include "SaveAttachmentsPopup.h" #include "TextDecorator.h" #include "MediaType.h" @@ -28,16 +29,20 @@ #include "TimeUtils.h" #include "FileViewer.h" #include "BubbleItemContainer.h" + +// Bubble items: #include "BubbleTextViewItem.h" #include "BubbleImageViewItem.h" #include "BubbleVideoViewItem.h" #include "BubbleAudioViewItem.h" #include "BubbleDownloadButtonViewItem.h" #include "BubbleUnknownFileViewItem.h" +#include "BubbleCalEventViewItem.h" #include #include #include +#include using namespace Msg; @@ -181,6 +186,18 @@ void ConvListItem::addAttachedFileItem(const MsgConvMedia &media) m_BubbleEntityList.push_back(entity); } +void ConvListItem::addCalendarItem(const MsgConvMedia &media) +{ + auto list = VCalendarParser::getInst().parse(media.getPath()); + if(!list.empty()) + { + // TODO: if list.szie() > 1 ? + const CalendarEvent &event = list.front(); + auto *entity = new BubbleCalEventEntity(media.getPath(), event.getSummary(), event.getStartDate()); + m_BubbleEntityList.push_back(entity); + } +} + void ConvListItem::addDownloadButtonItem() { auto *entity = new BubbleDownloadButtonEntity; @@ -237,6 +254,7 @@ void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::str std::string mime = media.getMime(); MsgMedia::Type msgMediaType = getMsgMediaTypeByMime(mime); + std::transform(mime.begin(), mime.end(), mime.begin(), ::tolower); switch(msgMediaType) { case MsgMedia::TextType: @@ -252,7 +270,9 @@ void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::str addVideoItem(media); break; default: - if(mime != "application/smil") + if(mime == "text/x-vcalendar" || mime == "text/calendar") + addCalendarItem(media); + else if(mime != "application/smil") addAttachedFileItem(media); break; } @@ -266,7 +286,6 @@ Evas_Object *ConvListItem::getBubbleContent() for(BubbleEntity *entity : m_BubbleEntityList) { BubbleViewItem *item = entity->createView(*bubble); - item->show(); bubble->append(*item); item->setListener(this); } diff --git a/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h b/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h new file mode 100644 index 00000000..aa1b76f2 --- /dev/null +++ b/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2009-2015 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 BubbleCalEventViewItem_h_ +#define BubbleCalEventViewItem_h_ + +#include "BubbleIconTextLayoutItem.h" + +namespace Msg +{ + class BubbleCalEventViewItem + : public BubbleIconTextLayoutItem + { + public: + BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent); + virtual ~BubbleCalEventViewItem(); + }; + + class BubbleCalEventEntity + : public BubbleEntity + { + public: + BubbleCalEventEntity(const std::string &filePath, const std::string &name, const std::string &dateTime); + virtual ~BubbleCalEventEntity(); + + virtual BubbleCalEventViewItem *createView(Evas_Object *parent); + virtual const std::string &getFilePath() const; + + private: + const std::string m_FilePath; + const std::string m_Name; + const std::string m_DateTime; + }; +} + +#endif /* BubbleCalEventViewItem_h_ */ diff --git a/src/Conversation/ConvList/View/inc/BubbleViewItem.h b/src/Conversation/ConvList/View/inc/BubbleViewItem.h index 1532d3b9..fac1bbf3 100644 --- a/src/Conversation/ConvList/View/inc/BubbleViewItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleViewItem.h @@ -59,7 +59,7 @@ namespace Msg AudioItem, VideoItem, ContactItem, - CalendarItem, + CalendarEventItem, UnknownFileItem, DownloadButtonItem }; diff --git a/src/Conversation/ConvList/View/src/BubbleAudioViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleAudioViewItem.cpp index b320f317..0b75f074 100644 --- a/src/Conversation/ConvList/View/src/BubbleAudioViewItem.cpp +++ b/src/Conversation/ConvList/View/src/BubbleAudioViewItem.cpp @@ -24,6 +24,7 @@ BubbleAudioViewItem::BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *pare : BubbleIconTextLayoutItem(entity, parent, Layout1Icon2Text) { attachGestureTapLayer(getEo(), getEo()); + setIcon(createIcon(getEo(), ATTACH_MUSIC_ICON)); } BubbleAudioViewItem::~BubbleAudioViewItem() @@ -48,7 +49,6 @@ BubbleAudioEntity::~BubbleAudioEntity() BubbleAudioViewItem *BubbleAudioEntity::createView(Evas_Object *parent) { auto *item = new BubbleAudioViewItem(*this, parent); - item->setIcon(BubbleAudioViewItem::createIcon(*item, ATTACH_MUSIC_ICON)); item->setMainText(m_FileName); item->setSubText(m_Duration); return item; diff --git a/src/Conversation/ConvList/View/src/BubbleCalEventViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleCalEventViewItem.cpp new file mode 100644 index 00000000..a2dc75fe --- /dev/null +++ b/src/Conversation/ConvList/View/src/BubbleCalEventViewItem.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2009-2015 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. + * + */ + +#include "BubbleCalEventViewItem.h" +#include "Resource.h" + +using namespace Msg; + +BubbleCalEventViewItem::BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent) + : BubbleIconTextLayoutItem(entity, parent, Layout1Icon2Text) +{ + attachGestureTapLayer(getEo(), getEo()); + setIcon(createIcon(getEo(), ATTACH_CAL_ICON)); +} + +BubbleCalEventViewItem::~BubbleCalEventViewItem() +{ +} + +BubbleCalEventEntity::BubbleCalEventEntity(const std::string &filePath, const std::string &name, const std::string &dateTime) + : BubbleEntity(CalendarEventItem) + , m_FilePath(filePath) + , m_Name(name) + , m_DateTime(dateTime) + +{ +} + +BubbleCalEventEntity::~BubbleCalEventEntity() +{ +} + +BubbleCalEventViewItem *BubbleCalEventEntity::createView(Evas_Object *parent) +{ + auto *item = new BubbleCalEventViewItem(*this, parent); + item->setMainText(m_Name); + item->setSubText(m_DateTime); + return item; +} + +const std::string &BubbleCalEventEntity::getFilePath() const +{ + return m_FilePath; +} diff --git a/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp b/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp index 6de1fbf5..e74b4648 100644 --- a/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp +++ b/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp @@ -41,6 +41,7 @@ BubbleItemContainer::~BubbleItemContainer() void BubbleItemContainer::append(Evas_Object *item) { + evas_object_size_hint_align_set(item, 0.0, EVAS_HINT_FILL); evas_object_smart_calculate(item); evas_object_show(item); elm_box_pack_end(getEo(), item); diff --git a/src/Conversation/ConvList/View/src/BubbleUnknownFileViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleUnknownFileViewItem.cpp index e1abfe32..0d2971d2 100644 --- a/src/Conversation/ConvList/View/src/BubbleUnknownFileViewItem.cpp +++ b/src/Conversation/ConvList/View/src/BubbleUnknownFileViewItem.cpp @@ -24,6 +24,7 @@ BubbleUnknownFileViewItem::BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_ : BubbleIconTextLayoutItem(entity, parent, Layout1Icon1Text) { attachGestureTapLayer(getEo(), getEo()); + setIcon(createIcon(getEo(), ATTACH_UNKNOWN_ICON)); } BubbleUnknownFileViewItem::~BubbleUnknownFileViewItem()