From 4a00f8013016a6bbbf2aa9cac2239717f9fe027b Mon Sep 17 00:00:00 2001 From: Denis Dolzhenko Date: Mon, 1 Aug 2016 13:08:18 +0300 Subject: [PATCH] Display attachments in conversation in new way (base part) Change-Id: I765c47e528863423dc7c0674f61aa1f2a055e1c3 Signed-off-by: Denis Dolzhenko --- inc/Resource.h | 4 +- project_def.prop | 6 +- ...le_genlist_theme.edc => conv_genlist_theme.edc} | 18 ++- ...v_list_attachments.edc => conv_list_bubble.edc} | 157 ++++++++++++++++++++- src/Common/Controller/src/App.cpp | 4 +- .../ConvList/Controller/inc/BubbleAudioEntity.h | 6 +- .../ConvList/Controller/inc/BubbleBgEntity.h | 55 ++++++++ .../ConvList/Controller/inc/BubbleCalEventEntity.h | 6 +- .../ConvList/Controller/inc/BubbleContactEntity.h | 6 +- .../Controller/inc/BubbleDownloadButtonEntity.h | 6 +- .../ConvList/Controller/inc/BubbleEntity.h | 13 +- .../ConvList/Controller/inc/BubbleImageEntity.h | 6 +- .../ConvList/Controller/inc/BubbleTextEntity.h | 12 +- .../Controller/inc/BubbleUnknownFileEntity.h | 6 +- .../ConvList/Controller/inc/BubbleVideoEntity.h | 2 +- .../ConvList/Controller/inc/ConvListItem.h | 14 +- .../ConvList/Controller/src/BubbleAudioEntity.cpp | 6 +- .../Controller/src/BubbleCalEventEntity.cpp | 6 +- .../Controller/src/BubbleContactEntity.cpp | 7 +- .../Controller/src/BubbleUnknownFileEntity.cpp | 8 +- .../ConvList/Controller/src/BubbleVideoEntity.cpp | 4 +- .../ConvList/Controller/src/ConvListItem.cpp | 102 +++++++------ .../ConvList/View/inc/BubbleAudioViewItem.h | 9 +- .../ConvList/View/inc/BubbleBgViewItem.h | 47 ++++++ .../ConvList/View/inc/BubbleCalEventViewItem.h | 9 +- .../ConvList/View/inc/BubbleContactViewItem.h | 7 +- .../ConvList/View/inc/BubbleIconTextLayoutItem.h | 7 +- .../ConvList/View/inc/BubbleItemContainer.h | 3 +- .../ConvList/View/inc/BubbleTextViewItem.h | 6 +- .../ConvList/View/inc/BubbleUnknownFileViewItem.h | 9 +- .../ConvList/View/src/BubbleBgViewItem.cpp | 66 +++++++++ .../ConvList/View/src/BubbleIconTextLayoutItem.cpp | 21 ++- .../ConvList/View/src/BubbleImageViewItem.cpp | 2 +- .../ConvList/View/src/BubbleItemContainer.cpp | 13 +- .../ConvList/View/src/BubbleTextViewItem.cpp | 8 +- .../ConvList/View/src/BubbleVideoViewItem.cpp | 2 +- 36 files changed, 505 insertions(+), 158 deletions(-) rename res/edje/{bubble_genlist_theme.edc => conv_genlist_theme.edc} (97%) rename res/edje/{conv_list_attachments.edc => conv_list_bubble.edc} (50%) create mode 100644 src/Conversation/ConvList/Controller/inc/BubbleBgEntity.h create mode 100644 src/Conversation/ConvList/View/inc/BubbleBgViewItem.h create mode 100644 src/Conversation/ConvList/View/src/BubbleBgViewItem.cpp diff --git a/inc/Resource.h b/inc/Resource.h index 4db242a..0e367a0 100644 --- a/inc/Resource.h +++ b/inc/Resource.h @@ -37,7 +37,7 @@ #define BUTTON_THEME_EDJ_PATH EDJ_PATH"/button_theme.edj" #define THREAD_THEME_EDJ_PATH EDJ_PATH"/thread_genlist_theme.edj" -#define BUBBLE_GENLIST_THEME_EDJ_PATH EDJ_PATH"/bubble_genlist_theme.edj" +#define CONV_GENLIST_THEME_EDJ_PATH EDJ_PATH"/conv_genlist_theme.edj" #define MSG_INPUT_PANEL_EDJ_PATH EDJ_PATH"/msg_input_panel.edj" #define RECIPIENT_PANEL_EDJ_PATH EDJ_PATH"/recipient_panel.edj" @@ -51,7 +51,7 @@ #define VIEWER_PALYER_EDJ_PATH EDJ_PATH"/viewer_player.edj" #define VIEWER_SUBJECT_LAYOUT_EDJ_PATH EDJ_PATH"/viewer_subject_layout.edj" #define SMIL_ITEM_EDJ_PATH EDJ_PATH"/smil_item.edj" -#define CONV_LIST_ATTACHMENTS_EDJ_PATH EDJ_PATH"/conv_list_attachments.edj" +#define CONV_LIST_BUBBLE_EDJ_PATH EDJ_PATH"/conv_list_bubble.edj" #define CONV_LIST_EDJ_PATH EDJ_PATH"/conv_list.edj" #define CONV_LAYOUT_EDJ_PATH EDJ_PATH"/conv_layout.edj" diff --git a/project_def.prop b/project_def.prop index dc5b07a..76d6174 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/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/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/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/ConvList/Controller/src/BubbleVideoEntity.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/ContactManager/src/ContactVCardGenerator.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/Conversation/ConvList/Controller/src/BubbleAudioEntity.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/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp src/Common/Utils/src/FileUtils.cpp src/Common/Utils/src/LoggerImpl.cpp src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp src/Conversation/ConvList/View/src/BubbleItemContainer.cpp src/Common/Utils/src/VCalendarParser.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/ContactManager/src/ContactVCardParser.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/Conversation/ConvList/Controller/src/BubbleCalEventEntity.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/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/Conversation/ConvList/View/src/BubbleBgViewItem.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/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/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/ConvList/Controller/src/BubbleVideoEntity.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/ContactManager/src/ContactVCardGenerator.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/Conversation/ConvList/Controller/src/BubbleAudioEntity.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/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp src/Common/Utils/src/FileUtils.cpp src/Common/Utils/src/LoggerImpl.cpp src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp src/Conversation/ConvList/View/src/BubbleItemContainer.cpp src/Common/Utils/src/VCalendarParser.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/ContactManager/src/ContactVCardParser.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/Conversation/ConvList/Controller/src/BubbleCalEventEntity.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_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 = 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 = @@ -60,7 +60,7 @@ USER_EDCS_FONT_DIRS_ABS = # EDC Flags USER_EXT_EDC_KEYS = EDC0 -USER_EXT_EDC0_EDCS = res/edje/msg_title.edc res/edje/msg_body.edc res/edje/conv_layout.edc res/edje/bubble_theme.edc res/edje/viewer_layout.edc res/edje/conv_list_attachments.edc res/edje/msg_thread.edc res/edje/smil_item.edc res/edje/msg_input_panel.edc res/edje/select_all.edc res/edje/thread_genlist_theme.edc res/edje/recipient_panel.edc res/edje/viewer_player.edc res/edje/conv_list.edc res/edje/viewer_subject_layout.edc res/edje/conv_contact_list_layout.edc res/edje/contact_search.edc res/edje/button_theme.edc res/edje/msg_thumbnail.edc res/edje/images.edc +USER_EXT_EDC0_EDCS = res/edje/msg_title.edc res/edje/msg_body.edc res/edje/conv_layout.edc res/edje/viewer_layout.edc res/edje/msg_thread.edc res/edje/smil_item.edc res/edje/msg_input_panel.edc res/edje/select_all.edc res/edje/thread_genlist_theme.edc res/edje/recipient_panel.edc res/edje/viewer_player.edc res/edje/conv_list.edc res/edje/viewer_subject_layout.edc res/edje/conv_genlist_theme.edc res/edje/conv_contact_list_layout.edc res/edje/contact_search.edc res/edje/button_theme.edc res/edje/conv_list_bubble.edc res/edje/msg_thumbnail.edc res/edje/images.edc USER_EXT_EDC0_EDCS_IMAGE_DIRS = edje/images res/images USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS = USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds diff --git a/res/edje/bubble_genlist_theme.edc b/res/edje/conv_genlist_theme.edc similarity index 97% rename from res/edje/bubble_genlist_theme.edc rename to res/edje/conv_genlist_theme.edc index dbe5fe7..2206059 100755 --- a/res/edje/bubble_genlist_theme.edc +++ b/res/edje/conv_genlist_theme.edc @@ -5,8 +5,6 @@ #define BUBBLE_MSG_TYPE_PAD_WIDTH 8 #define BUBBLE_INFO_HEIGHT 88 #define BUBBLE_CONTENT_WIDTH_MAX 340 -#define BUBBLE_BG_IMAGE_MIN_WIDTH 0 -#define BUBBLE_BG_IMAGE_MIN_HEIGHT 0 #define BUBBLE_CONTENT_PAD_TOP_HEIGHT 0 #define BUBBLE_CONTENT_PAD_BOTTOM_HEIGHT 0 #define BUBBLE_CONTENT_PAD_LEFT_WIDTH 0 @@ -257,11 +255,11 @@ group { name: "elm/genlist/item/sentbubble/default"; } rect { "bubble.bg.image"; scale; desc { "default"; + visible: 0; rel1.to_x: "bubble.pad.left"; rel1.to_y: "bubble.pad.top"; rel2.to_x: "bubble.pad.right"; rel2.to_y: "bubble.pad.bottom"; - min: BUBBLE_BG_IMAGE_MIN_WIDTH BUBBLE_BG_IMAGE_MIN_HEIGHT; color: BUBBLE_BG_COLOR; } } @@ -297,6 +295,18 @@ group { name: "elm/genlist/item/sentbubble/default"; fixed: 1 0; } } + rect { "bubble.content_event_blocker"; scale; + desc { "default"; + rel1.to: "bubble.content"; + rel2.to: "bubble.content"; + color: 0 0 0 0; + max: 0 0; + } + desc { "selection"; + inherit: "default"; + max: -1 -1; + } + } spacer { "bubble.pad.right"; scale; desc { "default"; min: BUBBLE_CONTENT_PAD_RIGHT_WIDTH 0; @@ -346,6 +356,7 @@ group { name: "elm/genlist/item/sentbubble/default"; action: STATE_SET "selection" 0.0; target: "bubble.check"; target: "pad.check"; + target: "bubble.content_event_blocker"; } program { name: "default_mode"; signal: "elm,state,default"; @@ -353,6 +364,7 @@ group { name: "elm/genlist/item/sentbubble/default"; action: STATE_SET "default" 0.0; target: "bubble.check"; target: "pad.check"; + target: "bubble.content_event_blocker"; } } } diff --git a/res/edje/conv_list_attachments.edc b/res/edje/conv_list_bubble.edc similarity index 50% rename from res/edje/conv_list_attachments.edc rename to res/edje/conv_list_bubble.edc index 01c2c3e..4d40312 100644 --- a/res/edje/conv_list_attachments.edc +++ b/res/edje/conv_list_bubble.edc @@ -3,8 +3,26 @@ #define COLOR_BLUE_EDC 2 61 132 255 collections { + BASE_SCALE; + #define MAX_TEXT_LEN 300 + #define BUBBLE_BG_COLOR 90 111 199 230 + #define BUBBLE_BG_COLOR_PRESSED 78 97 173 230 + #define BUBBLE_BG_DRAFT_COLOR 106 126 204 255 + #define BUBBLE_BG_DRAFT_COLOR_PRESSED 80 94 153 255 + #define BUBBLE_BG_FAILED_COLOR 0 0 0 102 + #define BUBBLE_BG_FAILED_COLOR_PRESSED 0 0 0 133 + #define BUBBLE_BG_RECEIVED_COLOR 65 197 217 255 + #define BUBBLE_BG_RECEIVED_COLOR_PRESSED 50 150 166 255 + + images { + image: "messages_bubble_bg.#.png" RAW; + image: "messages_bubble_bg_ef.#.png" RAW; + image: "messages_bubble_bg_search.#.png" RAW; + image: "messages_bubble_line_draft.#.png" RAW; + } + styles { style { name: "main_text_style"; @@ -27,8 +45,9 @@ collections { tag: "match" "+ color=#FFFFFF color_class=T1067"; } } + group { - name: "conv/list/1icon_1text_attachment"; + name: "conv/list/1icon_1text"; parts { part { name: "padding.left"; @@ -74,9 +93,10 @@ collections { } } } + group { - name: "conv/list/1icon_2text_attachment"; - inherit: "conv/list/1icon_1text_attachment"; + name: "conv/list/1icon_2text"; + inherit: "conv/list/1icon_1text"; parts { PADDING_TOP("padding.top", 0); PADDING_BOTTOM("padding.bottom", 16); @@ -109,8 +129,9 @@ collections { } } } + group { - name: "conv/list/attachments/video_item"; + name: "conv/list/video_item"; images { image: "messages_play_btn.png" COMP; } @@ -150,4 +171,132 @@ collections { } } } + + group { + name: "conv/list/bubble_sent_bg"; + parts { + part { + name: "bg"; + type: IMAGE; + scale: 1; + description { + state: "default"; + image.normal: "messages_bubble_bg.#.png"; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + min: 120 122; + color: BUBBLE_BG_COLOR; + } + description { + state: "pressed"; + inherit: "default"; + color: BUBBLE_BG_COLOR_PRESSED; + } + } + part { + name: "bg.effect"; + type: IMAGE; + scale: 1; + description { + state: "default"; + image.normal: "messages_bubble_bg_ef.#.png"; + rel1.to: "bg"; + rel2.to: "bg"; + } + } + PADDING_TOP("pad.top", 10); + PADDING_BOTTOM("pad.bottom", 16); + PADDING_LEFT("pad.left", 34); + PADDING_RIGHT("pad.right", 34); + part { + name: "content"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + rel1 { to_x: "pad.left"; to_y: "pad.top"; relative: 1.0 1.0; } + rel2 { to_x: "pad.right"; to_y: "pad.bottom"; relative: 0.0 0.0; } + } + } + } + programs { + program { name: "pressed"; + signal: "mouse,down,1"; + source: "*"; + action: STATE_SET "pressed" 0.0; + target: "bg"; + } + program { name: "unpressed"; + signal: "mouse,up,1"; + source: "*"; + action: STATE_SET "default" 0.0; + target: "bg"; + } + } + } + + group { + name: "conv/list/bubble_received_bg"; + inherit: "conv/list/bubble_sent_bg"; + parts { + part { + name: "bg"; + description { + state: "default"; + color: BUBBLE_BG_RECEIVED_COLOR; + } + description { + state: "pressed"; + inherit: "default"; + color: BUBBLE_BG_RECEIVED_COLOR_PRESSED; + } + } + } + } + + group { + name: "conv/list/bubble_draft_bg"; + inherit: "conv/list/bubble_sent_bg"; + parts { + part { + name: "bg"; + description { + state: "default"; + image.normal: "messages_bubble_line_draft.#.png"; + color: BUBBLE_BG_DRAFT_COLOR; + } + description { + state: "pressed"; + inherit: "default"; + color: BUBBLE_BG_DRAFT_COLOR_PRESSED; + } + } + part { + name: "bg.effect"; + description { + state: "default"; + visible: 0; + } + } + } + } + + group { + name: "conv/list/bubble_failed_bg"; + inherit: "conv/list/bubble_draft_bg"; + parts { + part { + name: "bg"; + description { + state: "default"; + color: BUBBLE_BG_FAILED_COLOR; + } + description { + state: "pressed"; + inherit: "default"; + color: BUBBLE_BG_FAILED_COLOR_PRESSED; + } + } + } + } } diff --git a/src/Common/Controller/src/App.cpp b/src/Common/Controller/src/App.cpp index 8eaa291..f71619e 100644 --- a/src/Common/Controller/src/App.cpp +++ b/src/Common/Controller/src/App.cpp @@ -55,8 +55,8 @@ bool App::init() std::string imagesPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH); elm_theme_extension_add(nullptr, imagesPath.c_str()); - std::string bubbleThemePath = PathUtils::getResourcePath(BUBBLE_GENLIST_THEME_EDJ_PATH); - elm_theme_extension_add(nullptr, bubbleThemePath.c_str()); + std::string convGenlistThemePath = PathUtils::getResourcePath(CONV_GENLIST_THEME_EDJ_PATH); + elm_theme_extension_add(nullptr, convGenlistThemePath.c_str()); std::string buttonThemePath = PathUtils::getResourcePath(BUTTON_THEME_EDJ_PATH); elm_theme_extension_add(nullptr, buttonThemePath.c_str()); diff --git a/src/Conversation/ConvList/Controller/inc/BubbleAudioEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleAudioEntity.h index 4c722ce..722749f 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleAudioEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleAudioEntity.h @@ -19,15 +19,15 @@ #define BubbleAudioEntity_h_ #include "BubbleAudioViewItem.h" -#include "BubbleEntity.h" +#include "BubbleBgEntity.h" namespace Msg { class BubbleAudioEntity - : public BubbleEntity + : public BubbleBgEntity { public: - BubbleAudioEntity(const MsgConvMedia &media); + BubbleAudioEntity(const MsgConvMedia &media, BubbleBgViewItem::BgType bgType, Message::Direction direction); virtual ~BubbleAudioEntity(); virtual BubbleAudioViewItem *createView(Evas_Object *parent); diff --git a/src/Conversation/ConvList/Controller/inc/BubbleBgEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleBgEntity.h new file mode 100644 index 0000000..1ba01c2 --- /dev/null +++ b/src/Conversation/ConvList/Controller/inc/BubbleBgEntity.h @@ -0,0 +1,55 @@ +/* + * 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 BubbleBgEntity_h_ +#define BubbleBgEntity_h_ + +#include "BubbleEntity.h" +#include "BubbleBgViewItem.h" + +namespace Msg +{ + class BubbleBgEntity + : public BubbleEntity + { + public: + BubbleBgEntity(Type type, BubbleBgViewItem::BgType bgType, Message::Direction direction); + virtual ~BubbleBgEntity(); + + void setBgType(BubbleBgViewItem::BgType type); + + protected: + BubbleBgViewItem::BgType m_BgType; + }; + + inline BubbleBgEntity::BubbleBgEntity(Type type, BubbleBgViewItem::BgType bgType, Message::Direction direction) + : BubbleEntity(type, direction) + , m_BgType(bgType) + { + } + + inline BubbleBgEntity::~BubbleBgEntity() + { + } + + inline void BubbleBgEntity::setBgType(BubbleBgViewItem::BgType type) + { + m_BgType = type; + } +} + +#endif /* BubbleBgEntity_h_ */ diff --git a/src/Conversation/ConvList/Controller/inc/BubbleCalEventEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleCalEventEntity.h index a3cb458..e375c73 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleCalEventEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleCalEventEntity.h @@ -19,15 +19,15 @@ #define BubbleCalEventEntity_h_ #include "BubbleCalEventViewItem.h" -#include "BubbleEntity.h" +#include "BubbleBgEntity.h" namespace Msg { class BubbleCalEventEntity - : public BubbleEntity + : public BubbleBgEntity { public: - BubbleCalEventEntity(const MsgConvMedia &convMedia); + BubbleCalEventEntity(const MsgConvMedia &convMedia, BubbleBgViewItem::BgType bgType, Message::Direction direction); virtual ~BubbleCalEventEntity(); virtual BubbleCalEventViewItem *createView(Evas_Object *parent); diff --git a/src/Conversation/ConvList/Controller/inc/BubbleContactEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleContactEntity.h index 4f7a4cd..b96ab96 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleContactEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleContactEntity.h @@ -19,17 +19,17 @@ #define BubbleContactEntity_h_ #include "BubbleContactViewItem.h" -#include "BubbleEntity.h" +#include "BubbleBgEntity.h" #include "App.h" #include "Contact.h" namespace Msg { class BubbleContactEntity - : public BubbleEntity + : public BubbleBgEntity { public: - BubbleContactEntity(App &app, const MsgConvMedia &media); + BubbleContactEntity(App &app, const MsgConvMedia &media, BubbleBgViewItem::BgType bgType, Message::Direction direction); virtual ~BubbleContactEntity(); virtual BubbleContactViewItem *createView(Evas_Object *parent); diff --git a/src/Conversation/ConvList/Controller/inc/BubbleDownloadButtonEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleDownloadButtonEntity.h index b73a8ff..db75a70 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleDownloadButtonEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleDownloadButtonEntity.h @@ -27,15 +27,15 @@ namespace Msg : public BubbleEntity { public: - BubbleDownloadButtonEntity(); + BubbleDownloadButtonEntity(Message::Direction direction); virtual ~BubbleDownloadButtonEntity(); virtual BubbleDownloadButtonViewItem *createView(Evas_Object *parent); virtual std::string getFilePath() const; }; - inline BubbleDownloadButtonEntity::BubbleDownloadButtonEntity() - : BubbleEntity(DownloadButtonItem) + inline BubbleDownloadButtonEntity::BubbleDownloadButtonEntity(Message::Direction direction) + : BubbleEntity(DownloadButtonItem, direction) { } diff --git a/src/Conversation/ConvList/Controller/inc/BubbleEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleEntity.h index d694da5..7c7edf2 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleEntity.h @@ -22,6 +22,7 @@ #include "BubbleViewItem.h" #include "MsgConvMedia.h" #include "FileUtils.h" +#include "Message.h" #include @@ -43,10 +44,11 @@ namespace Msg }; public: - BubbleEntity(Type type); + BubbleEntity(Type type, Message::Direction direction); virtual ~BubbleEntity(); Type getType() const; + Message::Direction getDirection() const; virtual std::string getFilePath() const = 0; virtual BubbleViewItem *createView(Evas_Object *parent) = 0; @@ -54,10 +56,12 @@ namespace Msg private: Type m_Type; + Message::Direction m_Direction; }; - inline BubbleEntity::BubbleEntity(Type type) + inline BubbleEntity::BubbleEntity(Type type, Message::Direction direction) : m_Type(type) + , m_Direction(direction) { } @@ -70,6 +74,11 @@ namespace Msg return m_Type; } + inline Message::Direction BubbleEntity::getDirection() const + { + return m_Direction; + } + inline std::string BubbleEntity::getFileName(const MsgConvMedia &media) { std::string res = media.getName(); diff --git a/src/Conversation/ConvList/Controller/inc/BubbleImageEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleImageEntity.h index 86723b1..f3782ff 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleImageEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleImageEntity.h @@ -27,7 +27,7 @@ namespace Msg : public BubbleEntity { public: - BubbleImageEntity(const MsgConvMedia &media); + BubbleImageEntity(const MsgConvMedia &media, Message::Direction direction); virtual ~BubbleImageEntity(); virtual BubbleImageViewItem *createView(Evas_Object *parent); @@ -37,8 +37,8 @@ namespace Msg const std::string m_ImgPath; }; - inline BubbleImageEntity::BubbleImageEntity(const MsgConvMedia &media) - : BubbleEntity(ImageItem) + inline BubbleImageEntity::BubbleImageEntity(const MsgConvMedia &media, Message::Direction direction) + : BubbleEntity(ImageItem, direction) , m_ImgPath(media.getPath()) { } diff --git a/src/Conversation/ConvList/Controller/inc/BubbleTextEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleTextEntity.h index d093930..351d558 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleTextEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleTextEntity.h @@ -19,15 +19,15 @@ #define BubbleTextEntity_h_ #include "BubbleTextViewItem.h" -#include "BubbleEntity.h" +#include "BubbleBgEntity.h" namespace Msg { class BubbleTextEntity - : public BubbleEntity + : public BubbleBgEntity { public: - BubbleTextEntity(const std::string &text); + BubbleTextEntity(BubbleBgViewItem::BgType type, Message::Direction direction, const std::string &text); virtual ~BubbleTextEntity(); virtual std::string getFilePath() const; @@ -37,8 +37,8 @@ namespace Msg std::string m_Text; }; - inline BubbleTextEntity::BubbleTextEntity(const std::string &text) - : BubbleEntity(ImageItem) + inline BubbleTextEntity::BubbleTextEntity(BubbleBgViewItem::BgType type, Message::Direction direction, const std::string &text) + : BubbleBgEntity(TextItem, type, direction) , m_Text(text) { } @@ -55,7 +55,7 @@ namespace Msg inline BubbleTextViewItem *BubbleTextEntity::createView(Evas_Object *parent) { - auto *item = new BubbleTextViewItem(*this ,parent, m_Text); + auto *item = new BubbleTextViewItem(*this ,parent, m_BgType, m_Text); return item; } } diff --git a/src/Conversation/ConvList/Controller/inc/BubbleUnknownFileEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleUnknownFileEntity.h index 57e1667..29d55d0 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleUnknownFileEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleUnknownFileEntity.h @@ -19,15 +19,15 @@ #define BubbleUnknownFileEntity_h_ #include "BubbleUnknownFileViewItem.h" -#include "BubbleEntity.h" +#include "BubbleBgEntity.h" namespace Msg { class BubbleUnknownFileEntity - : public BubbleEntity + : public BubbleBgEntity { public: - BubbleUnknownFileEntity(const MsgConvMedia &convMedia); + BubbleUnknownFileEntity(const MsgConvMedia &convMedia, BubbleBgViewItem::BgType bgType, Message::Direction direction); virtual ~BubbleUnknownFileEntity(); virtual BubbleUnknownFileViewItem *createView(Evas_Object *parent); diff --git a/src/Conversation/ConvList/Controller/inc/BubbleVideoEntity.h b/src/Conversation/ConvList/Controller/inc/BubbleVideoEntity.h index ee982fb..29d90e0 100644 --- a/src/Conversation/ConvList/Controller/inc/BubbleVideoEntity.h +++ b/src/Conversation/ConvList/Controller/inc/BubbleVideoEntity.h @@ -28,7 +28,7 @@ namespace Msg : public BubbleEntity { public: - BubbleVideoEntity(WorkingDir &workingDir, const MsgConvMedia &media); + BubbleVideoEntity(WorkingDir &workingDir, const MsgConvMedia &media, Message::Direction direction); virtual ~BubbleVideoEntity(); virtual BubbleVideoViewItem *createView(Evas_Object *parent); diff --git a/src/Conversation/ConvList/Controller/inc/ConvListItem.h b/src/Conversation/ConvList/Controller/inc/ConvListItem.h index 98dd055..895cca7 100644 --- a/src/Conversation/ConvList/Controller/inc/ConvListItem.h +++ b/src/Conversation/ConvList/Controller/inc/ConvListItem.h @@ -30,6 +30,7 @@ #include "WorkingDir.h" #include "BubbleViewItem.h" #include "BubbleEntity.h" +#include "BubbleBgViewItem.h" namespace Msg { @@ -87,16 +88,11 @@ namespace Msg private: ConvListViewItem::ConvItemType getConvItemType(const MsgConversationItem &item); void prepareBubble(const MsgConversationItem &item, const std::string &searchWord); - BubbleEntity *createVideoEntity(const MsgConvMedia &media); - BubbleEntity *createAudioEntity(const MsgConvMedia &media); - BubbleEntity *createDownloadButtonEntity(); - BubbleEntity *createTextEntity(const MsgConvMedia &media, const std::string &searchWord); - BubbleEntity *createTextEntity(std::string text, bool markup, const std::string &searchWord); - BubbleEntity *createImageEntity(const MsgConvMedia &media); - BubbleEntity *createUnknownFileEntity(const MsgConvMedia &media); - BubbleEntity *createCalendarEntity(const MsgConvMedia &media); - BubbleEntity *createContactEntity(const MsgConvMedia &media); + BubbleEntity *createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, const MsgConvMedia &media, const std::string &searchWord); + BubbleEntity *createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, std::string text, bool markup, const std::string &searchWord); void addEntity(BubbleEntity *entity); + void updateEntityBgType(BubbleBgViewItem::BgType bgType); + BubbleBgViewItem::BgType getBubbleBgType(const MsgConversationItem &item); // Create Popup when message is clicked void showMainListPopup(); diff --git a/src/Conversation/ConvList/Controller/src/BubbleAudioEntity.cpp b/src/Conversation/ConvList/Controller/src/BubbleAudioEntity.cpp index 57274f1..86c6408 100644 --- a/src/Conversation/ConvList/Controller/src/BubbleAudioEntity.cpp +++ b/src/Conversation/ConvList/Controller/src/BubbleAudioEntity.cpp @@ -35,8 +35,8 @@ std::string makeDurationStr(const std::string &filePath) return ss.str(); } -BubbleAudioEntity::BubbleAudioEntity(const MsgConvMedia &media) - : BubbleEntity(AudioItem) +BubbleAudioEntity::BubbleAudioEntity(const MsgConvMedia &media, BubbleBgViewItem::BgType bgType, Message::Direction direction) + : BubbleBgEntity(AudioItem, bgType, direction) , m_FilePath(media.getPath()) , m_FileName(getFileName(media)) , m_Duration(makeDurationStr(media.getPath())) @@ -49,7 +49,7 @@ BubbleAudioEntity::~BubbleAudioEntity() BubbleAudioViewItem *BubbleAudioEntity::createView(Evas_Object *parent) { - auto *item = new BubbleAudioViewItem(*this, parent); + auto *item = new BubbleAudioViewItem(*this, parent, m_BgType); item->setMainText(m_FileName); item->setSubText(m_Duration); return item; diff --git a/src/Conversation/ConvList/Controller/src/BubbleCalEventEntity.cpp b/src/Conversation/ConvList/Controller/src/BubbleCalEventEntity.cpp index c14ab66..358625a 100644 --- a/src/Conversation/ConvList/Controller/src/BubbleCalEventEntity.cpp +++ b/src/Conversation/ConvList/Controller/src/BubbleCalEventEntity.cpp @@ -22,8 +22,8 @@ using namespace Msg; -BubbleCalEventEntity::BubbleCalEventEntity(const MsgConvMedia &convMedia) - : BubbleEntity(CalendarEventItem) +BubbleCalEventEntity::BubbleCalEventEntity(const MsgConvMedia &convMedia, BubbleBgViewItem::BgType bgType, Message::Direction direction) + : BubbleBgEntity(CalendarEventItem, bgType, direction) , m_FilePath(convMedia.getPath()) { auto list = VCalendarParser::getInst().parse(convMedia.getPath()); @@ -47,7 +47,7 @@ BubbleCalEventViewItem *BubbleCalEventEntity::createView(Evas_Object *parent) { BubbleCalEventViewItem::LayoutType type = m_DateTime.empty() ? BubbleCalEventViewItem::Layout1Icon1Text : BubbleCalEventViewItem::Layout1Icon2Text; - auto *item = new BubbleCalEventViewItem(*this, parent, type); + auto *item = new BubbleCalEventViewItem(*this, parent, m_BgType, type); item->setMainText(m_Name); if(!m_DateTime.empty()) item->setSubText(m_DateTime); diff --git a/src/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp b/src/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp index 90505e6..34558bd 100644 --- a/src/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp +++ b/src/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp @@ -23,9 +23,8 @@ using namespace Msg; - -BubbleContactEntity::BubbleContactEntity(App &app, const MsgConvMedia &media) - : BubbleEntity(ContactItem) +BubbleContactEntity::BubbleContactEntity(App &app, const MsgConvMedia &media, BubbleBgViewItem::BgType bgType, Message::Direction direction) + : BubbleBgEntity(ContactItem, bgType, direction) , m_ThumbMaker(app.getThumbnailMaker()) , m_FilePath(media.getPath()) { @@ -55,7 +54,7 @@ BubbleContactViewItem *BubbleContactEntity::createView(Evas_Object *parent) { BubbleContactViewItem::LayoutType type = m_Address.empty() ? BubbleContactViewItem::Layout1Icon1Text : BubbleContactViewItem::Layout1Icon2Text; - auto *item = new BubbleContactViewItem(*this, parent, type); + auto *item = new BubbleContactViewItem(*this, parent, m_BgType, type); item->setMainText(m_Name); Evas_Object *thumb = m_ThumbPath.empty() ? BubbleContactViewItem::createIcon(*item, ATTACH_CONTACT_ICON) diff --git a/src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp b/src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp index f3e010e..c837709 100644 --- a/src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp +++ b/src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp @@ -22,8 +22,8 @@ using namespace Msg; -BubbleUnknownFileEntity::BubbleUnknownFileEntity(const MsgConvMedia &convMedia) - : BubbleEntity(UnknownFileItem) +BubbleUnknownFileEntity::BubbleUnknownFileEntity(const MsgConvMedia &convMedia, BubbleBgViewItem::BgType bgType, Message::Direction direction) + : BubbleBgEntity(UnknownFileItem, bgType, direction) , m_FilePath(convMedia.getPath()) , m_FileName(getFileName(convMedia)) { @@ -35,7 +35,7 @@ BubbleUnknownFileEntity::~BubbleUnknownFileEntity() BubbleUnknownFileViewItem *BubbleUnknownFileEntity::createView(Evas_Object *parent) { - auto *item = new BubbleUnknownFileViewItem(*this, parent); + auto *item = new BubbleUnknownFileViewItem(*this, parent, m_BgType); item->setMainText(m_FileName); return item; } @@ -44,5 +44,3 @@ std::string BubbleUnknownFileEntity::getFilePath() const { return m_FilePath; } - - diff --git a/src/Conversation/ConvList/Controller/src/BubbleVideoEntity.cpp b/src/Conversation/ConvList/Controller/src/BubbleVideoEntity.cpp index 88b3072..99181cf 100644 --- a/src/Conversation/ConvList/Controller/src/BubbleVideoEntity.cpp +++ b/src/Conversation/ConvList/Controller/src/BubbleVideoEntity.cpp @@ -20,8 +20,8 @@ using namespace Msg; -BubbleVideoEntity::BubbleVideoEntity(WorkingDir &workingDir, const MsgConvMedia &media) - : BubbleEntity(VideoItem) +BubbleVideoEntity::BubbleVideoEntity(WorkingDir &workingDir, const MsgConvMedia &media, Message::Direction direction) + : BubbleEntity(VideoItem, direction) , m_VideoPath(media.getPath()) { static const std::string thumbFileName = "thumbnail.jpeg"; diff --git a/src/Conversation/ConvList/Controller/src/ConvListItem.cpp b/src/Conversation/ConvList/Controller/src/ConvListItem.cpp index d633eea..c877030 100644 --- a/src/Conversation/ConvList/Controller/src/ConvListItem.cpp +++ b/src/Conversation/ConvList/Controller/src/ConvListItem.cpp @@ -99,13 +99,26 @@ void ConvListItem::updateStatus() } if(m_NetworkStatus == Message::NS_Send_Fail) + { updateItemType(ConvItemType::Failed); + updateEntityBgType(BubbleBgViewItem::FailedStyle); + } else if(m_NetworkStatus == Message::NS_Send_Success || m_NetworkStatus == Message::NS_Sending) + { updateItemType(ConvItemType::Sent); + updateEntityBgType(BubbleBgViewItem::SentStyle); + } else if(m_NetworkStatus == Message::NS_Not_Send) + { updateItemType(ConvItemType::Draft); + updateEntityBgType(BubbleBgViewItem::DraftStyle); + } else if(m_NetworkStatus == Message::NS_Received) + { updateItemType(ConvItemType::Received); + updateEntityBgType(BubbleBgViewItem::ReceivedStyle); + } + update(); } @@ -131,60 +144,42 @@ ConvListViewItem::ConvItemType ConvListItem::getConvItemType(const MsgConversati return type; } -BubbleEntity *ConvListItem::createVideoEntity(const MsgConvMedia &media) -{ - return new BubbleVideoEntity(*m_WorkingDir, media); -} - -BubbleEntity * ConvListItem::createAudioEntity(const MsgConvMedia &media) -{ - return new BubbleAudioEntity(media); -} - -BubbleEntity *ConvListItem::createUnknownFileEntity(const MsgConvMedia &media) -{ - return new BubbleUnknownFileEntity(media); -} - -BubbleEntity *ConvListItem::createCalendarEntity(const MsgConvMedia &media) -{ - return new BubbleCalEventEntity(media); -} - -BubbleEntity *ConvListItem::createContactEntity(const MsgConvMedia &media) +BubbleBgViewItem::BgType ConvListItem::getBubbleBgType(const MsgConversationItem &item) { - return new BubbleContactEntity(m_App, media); + BubbleBgViewItem::BgType type = BubbleBgViewItem::SentStyle; + if(item.getDirection() == Message::Direction::MD_Sent) + { + if(item.isDraft()) + type = BubbleBgViewItem::DraftStyle; + else if(item.getNetworkStatus() == Message::NS_Send_Fail) + type = BubbleBgViewItem::FailedStyle; + } + else + { + type = BubbleBgViewItem::ReceivedStyle; + } + return type; } -BubbleEntity *ConvListItem::createDownloadButtonEntity() -{ - return new BubbleDownloadButtonEntity; -} -BubbleEntity *ConvListItem::createTextEntity(const MsgConvMedia &media, const std::string &searchWord) +BubbleEntity *ConvListItem::createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, const MsgConvMedia &media, const std::string &searchWord) { std::string text = FileUtils::readTextFile(media.getPath()); if(findText(text, searchWord)) showSearch(); - return new BubbleTextEntity(utf8ToMarkup(text)); + return new BubbleTextEntity(bgType, direction, utf8ToMarkup(text)); } -BubbleEntity *ConvListItem::createTextEntity(std::string text, bool markup, const std::string &searchWord) +BubbleEntity *ConvListItem::createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, std::string text, bool markup, const std::string &searchWord) { if(findText(text, searchWord)) showSearch(); std::string resText = markup ? utf8ToMarkup(text) : std::move(text); - return new BubbleTextEntity(resText); -} - -BubbleEntity *ConvListItem::createImageEntity(const MsgConvMedia &media) -{ - // TODO: msg service corrupts thumbnail's metadata, so it lost rotation. Use getPath instead getThumbPath until fix - return new BubbleImageEntity(media); + return new BubbleTextEntity(bgType, direction, resText); } void ConvListItem::addEntity(BubbleEntity *entity) @@ -193,17 +188,29 @@ void ConvListItem::addEntity(BubbleEntity *entity) m_BubbleEntityList.push_back(entity); } +void ConvListItem::updateEntityBgType(BubbleBgViewItem::BgType bgType) +{ + for(BubbleEntity *entity : m_BubbleEntityList) + { + auto *bgEntity = dynamic_cast(entity); + if(bgEntity) + bgEntity->setBgType(bgType); + } +} + void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::string &searchWord) { + BubbleBgViewItem::BgType bgType = getBubbleBgType(item); + Message::Direction direction = item.getDirection(); if(!MsgUtils::isMms(m_Type)) { - addEntity(createTextEntity(item.getText(), true, searchWord)); + addEntity(createTextEntity(bgType, direction, item.getText(), true, searchWord)); } else if(m_Type == Message::MT_MMS_Noti) { std::string text = MessageDetailContent::getMmsNotiConvListItemContent(m_App, m_MsgId); - addEntity(createTextEntity(text, false, searchWord)); - addEntity(createDownloadButtonEntity()); + addEntity(createTextEntity(bgType, direction, text, false, searchWord)); + addEntity(new BubbleDownloadButtonEntity(direction)); } else { @@ -219,24 +226,25 @@ void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::str switch(msgMediaType) { case MsgMedia::TextType: - entity = createTextEntity(media, searchWord); + entity = createTextEntity(bgType, direction, media, searchWord); break; case MsgMedia::ImageType: - entity = createImageEntity(media); + // TODO: msg service corrupts thumbnail's metadata, so it lost rotation. Use getPath instead getThumbPath until fix + entity = new BubbleImageEntity(media, direction); break; case MsgMedia::AudioType: - entity = createAudioEntity(media); + entity = new BubbleAudioEntity(media, bgType, direction); break; case MsgMedia::VideoType: - entity = createVideoEntity(media); + entity = new BubbleVideoEntity(*m_WorkingDir, media, direction); break; default: if(mime == "text/x-vcalendar" || mime == "text/calendar") - entity = createCalendarEntity(media); + entity = new BubbleCalEventEntity(media, bgType, direction); else if(mime == "text/x-vcard" || mime == "text/vcard") - entity = createContactEntity(media); + entity = new BubbleContactEntity(m_App, media, bgType, direction); else if(mime != "application/smil") - entity = createUnknownFileEntity(media); + entity = new BubbleUnknownFileEntity(media, bgType, direction); break; } addEntity(entity); @@ -250,7 +258,7 @@ Evas_Object *ConvListItem::getBubbleContent() for(BubbleEntity *entity : m_BubbleEntityList) { BubbleViewItem *item = entity->createView(*bubble); - bubble->append(*item); + bubble->append(*item, entity->getDirection()); item->setListener(this); } bubble->go(); diff --git a/src/Conversation/ConvList/View/inc/BubbleAudioViewItem.h b/src/Conversation/ConvList/View/inc/BubbleAudioViewItem.h index 38a2d18..6eee068 100644 --- a/src/Conversation/ConvList/View/inc/BubbleAudioViewItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleAudioViewItem.h @@ -27,15 +27,14 @@ namespace Msg : public BubbleIconTextLayoutItem { public: - BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent); + BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType); virtual ~BubbleAudioViewItem(); }; - inline BubbleAudioViewItem::BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent) - : BubbleIconTextLayoutItem(entity, parent, Layout1Icon2Text) + inline BubbleAudioViewItem::BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType) + : BubbleIconTextLayoutItem(entity, parent, bgType, Layout1Icon2Text) { - attachGestureTapLayer(getEo(), getEo()); - setIcon(createIcon(getEo(), ATTACH_MUSIC_ICON)); + setIcon(createIcon(getContent(), ATTACH_MUSIC_ICON)); } inline BubbleAudioViewItem::~BubbleAudioViewItem() diff --git a/src/Conversation/ConvList/View/inc/BubbleBgViewItem.h b/src/Conversation/ConvList/View/inc/BubbleBgViewItem.h new file mode 100644 index 0000000..d975dda --- /dev/null +++ b/src/Conversation/ConvList/View/inc/BubbleBgViewItem.h @@ -0,0 +1,47 @@ +/* + * 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 BubbleBgViewItem_h_ +#define BubbleBgViewItem_h_ + +#include "BubbleViewItem.h" + +namespace Msg +{ + class BubbleBgViewItem + : public BubbleViewItem + { + public: + enum BgType + { + SentStyle, + ReceivedStyle, + DraftStyle, + FailedStyle + }; + + public: + BubbleBgViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType); + virtual ~BubbleBgViewItem(); + + void showSearch(bool search); + void setContent(Evas_Object *obj); + Evas_Object *getContent() const; + }; +} + +#endif /* BubbleBgViewItem_h_ */ diff --git a/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h b/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h index 5987a78..0db86a2 100644 --- a/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleCalEventViewItem.h @@ -27,15 +27,14 @@ namespace Msg : public BubbleIconTextLayoutItem { public: - BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent, LayoutType layoutType); + BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType layoutType); virtual ~BubbleCalEventViewItem(); }; - inline BubbleCalEventViewItem::BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent, LayoutType layoutType) - : BubbleIconTextLayoutItem(entity, parent, layoutType) + inline BubbleCalEventViewItem::BubbleCalEventViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType layoutType) + : BubbleIconTextLayoutItem(entity, parent, bgType, layoutType) { - attachGestureTapLayer(getEo(), getEo()); - setIcon(createIcon(getEo(), ATTACH_CAL_ICON)); + setIcon(createIcon(getContent(), ATTACH_CAL_ICON)); } inline BubbleCalEventViewItem::~BubbleCalEventViewItem() diff --git a/src/Conversation/ConvList/View/inc/BubbleContactViewItem.h b/src/Conversation/ConvList/View/inc/BubbleContactViewItem.h index 1dad1c5..f56505b 100644 --- a/src/Conversation/ConvList/View/inc/BubbleContactViewItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleContactViewItem.h @@ -27,14 +27,13 @@ namespace Msg : public BubbleIconTextLayoutItem { public: - BubbleContactViewItem(BubbleEntity &entity, Evas_Object *parent, LayoutType type); + BubbleContactViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType type); virtual ~BubbleContactViewItem(); }; - inline BubbleContactViewItem::BubbleContactViewItem(BubbleEntity &entity, Evas_Object *parent, LayoutType type) - : BubbleIconTextLayoutItem(entity, parent, type) + inline BubbleContactViewItem::BubbleContactViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType type) + : BubbleIconTextLayoutItem(entity, parent, bgType, type) { - attachGestureTapLayer(getEo(), getEo()); } inline BubbleContactViewItem::~BubbleContactViewItem() diff --git a/src/Conversation/ConvList/View/inc/BubbleIconTextLayoutItem.h b/src/Conversation/ConvList/View/inc/BubbleIconTextLayoutItem.h index 1f2f348..bdd3f1d 100644 --- a/src/Conversation/ConvList/View/inc/BubbleIconTextLayoutItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleIconTextLayoutItem.h @@ -18,12 +18,12 @@ #ifndef BubbleIconTextLayoutItem_h_ #define BubbleIconTextLayoutItem_h_ -#include "BubbleViewItem.h" +#include "BubbleBgViewItem.h" namespace Msg { class BubbleIconTextLayoutItem - : public BubbleViewItem + : public BubbleBgViewItem { public: enum LayoutType @@ -34,7 +34,7 @@ namespace Msg static const int iconSize = 50; public: - BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, LayoutType layoutType); + BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType layoutType); virtual ~BubbleIconTextLayoutItem(); LayoutType getLayoutType() const; @@ -46,6 +46,7 @@ namespace Msg private: LayoutType m_LayoutType; + Evas_Object *m_pIconTextLayout; }; } diff --git a/src/Conversation/ConvList/View/inc/BubbleItemContainer.h b/src/Conversation/ConvList/View/inc/BubbleItemContainer.h index 1a592df..112f9b1 100644 --- a/src/Conversation/ConvList/View/inc/BubbleItemContainer.h +++ b/src/Conversation/ConvList/View/inc/BubbleItemContainer.h @@ -19,6 +19,7 @@ #define BubbleItemContainer_h_ #include "View.h" +#include "Message.h" namespace Msg { @@ -29,7 +30,7 @@ namespace Msg BubbleItemContainer(Evas_Object *parent); virtual ~BubbleItemContainer(); - void append(Evas_Object *item); + void append(Evas_Object *item, Message::Direction direction); void go(); }; } diff --git a/src/Conversation/ConvList/View/inc/BubbleTextViewItem.h b/src/Conversation/ConvList/View/inc/BubbleTextViewItem.h index bc19365..aab989c 100644 --- a/src/Conversation/ConvList/View/inc/BubbleTextViewItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleTextViewItem.h @@ -18,15 +18,15 @@ #ifndef BubbleTextViewItem_h_ #define BubbleTextViewItem_h_ -#include "BubbleViewItem.h" +#include "BubbleBgViewItem.h" namespace Msg { class BubbleTextViewItem - : public BubbleViewItem + : public BubbleBgViewItem { public: - BubbleTextViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &text); + BubbleTextViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, const std::string &text); virtual ~BubbleTextViewItem(); private: diff --git a/src/Conversation/ConvList/View/inc/BubbleUnknownFileViewItem.h b/src/Conversation/ConvList/View/inc/BubbleUnknownFileViewItem.h index 3ff622e..be261d7 100644 --- a/src/Conversation/ConvList/View/inc/BubbleUnknownFileViewItem.h +++ b/src/Conversation/ConvList/View/inc/BubbleUnknownFileViewItem.h @@ -27,15 +27,14 @@ namespace Msg : public BubbleIconTextLayoutItem { public: - BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent); + BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType); virtual ~BubbleUnknownFileViewItem(); }; - inline BubbleUnknownFileViewItem::BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent) - : BubbleIconTextLayoutItem(entity, parent, Layout1Icon1Text) + inline BubbleUnknownFileViewItem::BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType) + : BubbleIconTextLayoutItem(entity, parent, bgType, Layout1Icon1Text) { - attachGestureTapLayer(getEo(), getEo()); - setIcon(createIcon(getEo(), ATTACH_UNKNOWN_ICON)); + setIcon(createIcon(getContent(), ATTACH_UNKNOWN_ICON)); } inline BubbleUnknownFileViewItem::~BubbleUnknownFileViewItem() diff --git a/src/Conversation/ConvList/View/src/BubbleBgViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleBgViewItem.cpp new file mode 100644 index 0000000..6521ebe --- /dev/null +++ b/src/Conversation/ConvList/View/src/BubbleBgViewItem.cpp @@ -0,0 +1,66 @@ +/* + * 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 "BubbleBgViewItem.h" +#include "Resource.h" + +using namespace Msg; + +BubbleBgViewItem::BubbleBgViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType) + : BubbleViewItem(entity) +{ + const char *group = nullptr; + switch(bgType) + { + case SentStyle: + group = "conv/list/bubble_sent_bg"; + break; + case ReceivedStyle: + group = "conv/list/bubble_received_bg"; + break; + case DraftStyle: + group = "conv/list/bubble_draft_bg"; + break; + case FailedStyle: + group = "conv/list/bubble_failed_bg"; + break; + } + + setEo(addLayout(parent, CONV_LIST_BUBBLE_EDJ_PATH, group)); + evas_object_size_hint_align_set(getEo(), 1.0, EVAS_HINT_FILL); + attachGestureTapLayer(getEo(), getEo()); +} + +BubbleBgViewItem::~BubbleBgViewItem() +{ + +} + +void BubbleBgViewItem::setContent(Evas_Object *obj) +{ + View::setContent(obj, "content"); +} + +Evas_Object *BubbleBgViewItem::getContent() const +{ + return View::getContent("content"); +} + +void BubbleBgViewItem::showSearch(bool search) +{ + // TODO: impl +} diff --git a/src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp b/src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp index 00cb40a..133edf3 100644 --- a/src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp +++ b/src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp @@ -24,26 +24,25 @@ using namespace Msg; #define DEF_ICON_COLOR 128, 128, 128, 255 -BubbleIconTextLayoutItem::BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, LayoutType layoutType) - : BubbleViewItem(entity) +BubbleIconTextLayoutItem::BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, LayoutType layoutType) + : BubbleBgViewItem(entity, parent, bgType) , m_LayoutType(layoutType) + , m_pIconTextLayout(nullptr) { const char *group = nullptr; switch(layoutType) { case Layout1Icon1Text: - group = "conv/list/1icon_1text_attachment"; + group = "conv/list/1icon_1text"; break; case Layout1Icon2Text: - group = "conv/list/1icon_2text_attachment"; + group = "conv/list/1icon_2text"; break; } - Evas_Object *layout = addLayout(parent, CONV_LIST_ATTACHMENTS_EDJ_PATH, group); - evas_object_size_hint_align_set(layout, 0.0, EVAS_HINT_FILL); - setEo(layout); - + m_pIconTextLayout = addLayout(getEo(), CONV_LIST_BUBBLE_EDJ_PATH, group); + setContent(m_pIconTextLayout); } BubbleIconTextLayoutItem::~BubbleIconTextLayoutItem() @@ -52,17 +51,17 @@ BubbleIconTextLayoutItem::~BubbleIconTextLayoutItem() void BubbleIconTextLayoutItem::setIcon(Evas_Object *icon) { - setContent(icon, "icon"); + elm_object_part_content_set(m_pIconTextLayout, "icon", icon); } void BubbleIconTextLayoutItem::setMainText(const std::string &text) { - setText(text, "main.text"); + elm_object_part_text_set(m_pIconTextLayout, "main.text", text.c_str()); } void BubbleIconTextLayoutItem::setSubText(const std::string &text) { - setText(text, "sub.text"); + elm_object_part_text_set(m_pIconTextLayout, "sub.text", text.c_str()); } Evas_Object *BubbleIconTextLayoutItem::createIcon(Evas_Object *parent, const std::string &edjFileName) diff --git a/src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp index 083fe72..16a96d3 100644 --- a/src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp +++ b/src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp @@ -45,7 +45,7 @@ Evas_Object *BubbleImageViewItem::createImage(Evas_Object *parent, const std::st imageHeight *= scale; } evas_object_size_hint_min_set(image, imageWidth, imageHeight); - evas_object_size_hint_align_set(image, 0.0, EVAS_HINT_FILL); + evas_object_size_hint_align_set(image, 1.0, EVAS_HINT_FILL); evas_object_show(image); return image; } diff --git a/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp b/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp index 6de1fbf..ab7ce5f 100644 --- a/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp +++ b/src/Conversation/ConvList/View/src/BubbleItemContainer.cpp @@ -16,6 +16,9 @@ */ #include "BubbleItemContainer.h" +#include "Logger.h" + +#include using namespace Msg; @@ -39,8 +42,16 @@ BubbleItemContainer::~BubbleItemContainer() { } -void BubbleItemContainer::append(Evas_Object *item) +void BubbleItemContainer::append(Evas_Object *item, Message::Direction direction) { + const char *itemType = evas_object_type_get(item); + if(strcmp(itemType, "elm_button") == 0) + expand(item); + else if (direction == Message::MD_Sent) + evas_object_size_hint_align_set(item, 1.0, EVAS_HINT_FILL); + else + 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/BubbleTextViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp index 0391166..33967ae 100644 --- a/src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp +++ b/src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp @@ -24,10 +24,10 @@ namespace const char *textStyle = "DEFAULT='font=Tizen:style=Regular font_size=24 wrap=mixed text_class=label'"; } -BubbleTextViewItem::BubbleTextViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &text) - : BubbleViewItem(entity) +BubbleTextViewItem::BubbleTextViewItem(BubbleEntity &entity, Evas_Object *parent, BgType bgType, const std::string &text) + : BubbleBgViewItem(entity, parent, bgType) { - setEo(createText(parent, text)); + setContent(createText(*this, text)); } BubbleTextViewItem::~BubbleTextViewItem() @@ -56,10 +56,10 @@ Evas_Object *BubbleTextViewItem::createText(Evas_Object *parent, const std::stri evas_object_del(textBlock); int wrapWidth = ww > maxWidth ? (int)ELM_SCALE_SIZE(maxWidth) : (int)ELM_SCALE_SIZE(ww); + elm_label_line_wrap_set(label, ELM_WRAP_MIXED); elm_label_wrap_width_set(label, wrapWidth); elm_object_part_text_set(label, nullptr, text.c_str()); evas_object_show(label); - evas_object_size_hint_align_set(label, 0.0, EVAS_HINT_FILL); return label; } diff --git a/src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp b/src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp index b166c22..29ef7be 100644 --- a/src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp +++ b/src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp @@ -35,7 +35,7 @@ BubbleVideoViewItem::~BubbleVideoViewItem() Evas_Object *BubbleVideoViewItem::createLayout(Evas_Object *parent, const std::string &path) { - Evas_Object *layout = addLayout(parent, CONV_LIST_ATTACHMENTS_EDJ_PATH, "conv/list/attachments/video_item"); + Evas_Object *layout = addLayout(parent, CONV_LIST_BUBBLE_EDJ_PATH, "conv/list/video_item"); Evas_Object *image = elm_image_add(layout); elm_image_file_set(image, path.c_str(), nullptr); int imageWidth = 0; -- 2.7.4