.settings/
org.tizen.message-Test-result.xml
.package-stamp
+.svace-dir
# Usege : make -f <proj_root>/Build/makefile -C <proj_root>
#
-BUILD_SCRIPT_VERSION := 1.2.0
+BUILD_SCRIPT_VERSION := 1.2.1
.PHONY : app_version app_clean build_version
ifneq ($(strip $(USER_LIB_DIRS)),)
_ENC_USER_LIB_DIRS := $(call ENCODE_4MAKE,$(USER_LIB_DIRS))
-_ENC_USER_LIB_DIRS := $(addprefix -L,$(call $(_ENC_USER_LIB_DIRS))
+_ENC_USER_LIB_DIRS := $(addprefix -L,$(call $(_ENC_USER_LIB_DIRS)))
LIBPATHS := $(call DECODE_4MAKE,$(_ENC_USER_LIB_DIRS))
endif
#define SOFT_SEARCH_BACK_IMG "icon_soft_search_back.png"
#define ATTACH_IMG "attach_icon.png"
#define ADD_PLUS_ICON "core_button_add.png"
+#define ATTACH_MUSIC_ICON "messages_attach_ic_music.png"
// Edj:
#define IMAGES_EDJ_PATH EDJ_PATH"/images.edj"
#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_EDJ_PATH EDJ_PATH"/conv_list.edj"
#define CONV_LAYOUT_EDJ_PATH EDJ_PATH"/conv_layout.edj"
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/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/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/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/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/BubbleView.cpp src/MsgThread/Controller/src/ThreadListItem.cpp src/Common/MsgEngine/src/private/MsgAddressPrivate.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/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/View/src/Popup.cpp src/Common/MsgEngine/src/private/MsgStoragePrivate.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/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/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/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_ABS =
# EDC Sources
# 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 =
# 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/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/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_IMAGE_DIRS = edje/images res/images
USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
--- /dev/null
+#include "macros.inl"
+
+#define COLOR_BLUE_EDC 2 61 132 255
+
+collections {
+ BASE_SCALE;
+ #define MAX_TEXT_LEN 300
+ styles {
+ style {
+ name: "main_text_style";
+ base: "font=Tizen:style=Roman font_size="32" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
+ tag: "tab" "\t";
+ tag: "em" "+ font=Tizen:style=Oblique";
+ tag: "b" "+ font=Tizen:style=Bold";
+ tag: "link" "+ color=#800 underline=on underline_color=#8008";
+ tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "match" "+ color=#FFFFFF color_class=T1067";
+ }
+ style {
+ name: "sub_text_style";
+ base: "font=Tizen:style=Roman font_size="30" color=#000000 left_margin=1 right_margin=2 wrap=mixed ellipsis=1 align=left";
+ tag: "tab" "\t";
+ tag: "em" "+ font=Tizen:style=Oblique";
+ tag: "b" "+ font=Tizen:style=Bold";
+ tag: "link" "+ color=#800 underline=on underline_color=#8008";
+ tag: "hilight" "+ font=Tizen:style=Bold";
+ tag: "match" "+ color=#FFFFFF color_class=T1067";
+ }
+ }
+ group {
+ name: "conv/list/icon_text_attachment";
+ parts {
+ PADDING_TOP("padding.top", 10);
+ PADDING_BOTTOM("padding.bottom", 16);
+ part {
+ name: "padding.left";
+ type: SPACER;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 6 0;
+ max: 6 -1;
+ align: 0.0 0.5;
+ rel1 { to_x: "icon"; relative: 1.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ part {
+ name: "main.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 { to_x : "padding.left"; to_y: "padding.top"; relative: 1.0 1.0; }
+ max: MAX_TEXT_LEN 48;
+ text{
+ style: "main_text_style";
+ min: 1 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part {
+ name: "sub.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 0.0 0.0;
+ rel1 { to : "padding.left"; to_y: "main.text"; relative: 1.0 1.0; }
+ max: MAX_TEXT_LEN 43;
+ text{
+ style: "sub_text_style";
+ min: 1 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part {
+ name: "icon";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 50 50;
+ max: 50 50;
+ align: 0.0 0.5;
+ visible: 1;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ }
+ }
+}
} \
}
+#define RESOURCE_IMAGE_COLOR( FILE_NAME, COLOR ) \
+ group { \
+ name: FILE_NAME; \
+ images.image: FILE_NAME COMP; \
+ parts { \
+ part { name: "image"; \
+ description { \
+ state: "default" 0.0; \
+ color: COLOR; \
+ image.normal: FILE_NAME; \
+ aspect: 1 1; \
+ aspect_preference: BOTH; \
+ } \
+ } \
+ } \
+ }
+
#define RESOURCE_IMAGE_NO_ASPECT( FILE_NAME ) \
group { \
name: FILE_NAME; \
RESOURCE_IMAGE("icon_soft_search_back.png");
RESOURCE_IMAGE("list_ic_user_thumb_masking.png");
+ RESOURCE_IMAGE_COLOR("messages_attach_ic_music.png", 250 250 250 255);
+
RESOURCE_OVERLAP_IMAGE("title/thumb/contact", "title_thumbnail_image_bg.png", 255, 255, 255, 255, "title_thumbnail_image.png", 2, 61, 132, 255);
RESOURCE_OVERLAP_IMAGE("title/thumb/group", "title_thumbnail_image_bg.png", 255, 255, 255, 255, "title_thumbnail_image_group.png", 2, 61, 132, 255);
}
#include "ConvListViewItem.h"
#include "MsgTypes.h"
-#include "BubbleView.h"
#include "ThumbnailMaker.h"
#include "Message.h"
#include "ContextPopup.h"
#include "FileViewer.h"
#include "MsgUtils.h"
#include "WorkingDir.h"
+#include "BubbleViewItem.h"
namespace Msg
{
class ConvListItem
: public ConvListViewItem
- , public IBubbleViewListener
+ , public IBubbleViewItemListener
{
public:
/**
void prepareBubble(const MsgConversationItem &item, const std::string &searchWord);
void addVideoItem(const MsgConvMedia &media);
void addAudioItem(const MsgConvMedia &media);
+ void addDownloadButtonItem();
void addTextItem(const MsgConvMedia &media, const std::string &searchWord);
+ void addTextItem(std::string text, bool markup, const std::string &searchWord);
void addImageItem(const MsgConvMedia &media);
void addAttachedFileItem(const MsgConvMedia &media);
void onDeleteButtonClicked(Popup &popup, int buttonId);
void onPopupDel(Evas_Object *popup, void *eventInfo);
- // IBubbleViewListener
- virtual void onDownloadButtonClicked();
- virtual void onItemClicked(BubbleEntity::Item &item);
+ // IBubbleViewItemListener
+ virtual void onAction(BubbleViewItem &item);
private:
IConvListItemListener *m_pListener;
Message::Type m_Type;
time_t m_Time;
std::string m_TimeStr;
- BubbleEntity m_BubbleEntity;
+ std::list<BubbleEntity*> m_BubbleEntityList;
const ThumbnailMaker::ThumbId &m_ThumbId;
};
#include "MediaUtils.h"
#include "TimeUtils.h"
#include "FileViewer.h"
+#include "BubbleItemContainer.h"
+#include "BubbleTextViewItem.h"
+#include "BubbleImageViewItem.h"
+#include "BubbleVideoViewItem.h"
+#include "BubbleAudioViewItem.h"
+#include "BubbleDownloadButtonViewItem.h"
+#include "BubbleUnknownFileViewItem.h"
#include <notification_status.h>
+#include <sstream>
+#include <iomanip>
using namespace Msg;
+
namespace
{
-
- bool isContentFind(const std::string &str, const std::string &searchWord)
+ bool findText(const std::string &text, const std::string &searchWord)
{
- if(str.empty() || searchWord.empty())
+ if(text.empty() || searchWord.empty())
return false;
- std::string s(markupToUtf8(str));
+ std::string s(markupToUtf8(text));
std::transform(s.begin(), s.end(), s.begin(), tolower);
std::string sw(markupToUtf8(searchWord));
std::transform(sw.begin(), sw.end(), sw.begin(), tolower);
size_t size = s.find(sw);
return size != std::string::npos;
}
+
+ std::string makeDurationStr(const std::string &filePath)
+ {
+ int duration = MediaUtils::getDurationSec(filePath);
+ std::stringstream ss;
+ int h = duration / 60;
+ int m = duration % 60;
+ ss << std::setfill('0') << std::setw(2) << h << ':'
+ << std::setfill('0') << std::setw(2) << m;
+ return ss.str();
+ }
}
ConvListItem::ConvListItem(const MsgConversationItem &item,
, m_NetworkStatus(item.getNetworkStatus())
, m_Type(item.getType())
, m_Time(item.getTime())
- , m_BubbleEntity()
, m_ThumbId(thumbId)
{
prepareBubble(item, searchWord);
ConvListItem::~ConvListItem()
{
+ for(auto *entity : m_BubbleEntityList)
+ {
+ delete entity;
+ }
+ m_BubbleEntityList.clear();
}
void ConvListItem::updateStatus()
{
std::string path = media.getPath();
if(MediaUtils::getVideoFrame(path, thumbFilePath))
- m_BubbleEntity.addItem(BubbleEntity::VideoItem, thumbFilePath, path);
+ {
+ auto *entity = new BubbleVideoEntity(path, thumbFilePath);
+ m_BubbleEntityList.push_back(entity);
+ }
}
}
void ConvListItem::addAudioItem(const MsgConvMedia &media)
{
- std::string dsipName = media.getName();
std::string path = media.getPath();
+ if(path.empty())
+ return;
+
+ std::string dsipName = media.getName();
if(dsipName.empty())
dsipName = FileUtils::getFileName(path);
- m_BubbleEntity.addItem(BubbleEntity::AudioItem, dsipName, path);
+
+ auto *entity = new BubbleAudioEntity(path, dsipName, makeDurationStr(path));
+ m_BubbleEntityList.push_back(entity);
}
void ConvListItem::addAttachedFileItem(const MsgConvMedia &media)
std::string path = media.getPath();
if(dsipName.empty())
dsipName = FileUtils::getFileName(path);
- m_BubbleEntity.addItem(BubbleEntity::AttachedFileItem, dsipName, path);
+
+ auto *entity = new BubbleUnknownFileEntity(path, dsipName);
+ m_BubbleEntityList.push_back(entity);
+}
+
+void ConvListItem::addDownloadButtonItem()
+{
+ auto *entity = new BubbleDownloadButtonEntity;
+ m_BubbleEntityList.push_back(entity);
}
void ConvListItem::addTextItem(const MsgConvMedia &media, const std::string &searchWord)
{
- // TODO: How to detect text attachment and content(text) of MMS ?
std::string text = FileUtils::readTextFile(media.getPath());
- if(isContentFind(text, searchWord))
+
+ if(findText(text, searchWord))
showSearch();
- std::string markupText = utf8ToMarkup(text);
- // It may be required after update the UI document
- // std::string highlightedText = TextDecorator::highlightKeyword(markupText, utf8ToMarkup(searchWord));
- m_BubbleEntity.addItem(BubbleEntity::TextItem, markupText);
+ auto *entity = new BubbleTextEntity(utf8ToMarkup(text));
+ m_BubbleEntityList.push_back(entity);
+}
+
+void ConvListItem::addTextItem(std::string text, bool markup, const std::string &searchWord)
+{
+ if(findText(text, searchWord))
+ showSearch();
+
+ std::string resText = markup ? utf8ToMarkup(text) : std::move(text);
+
+ auto *entity = new BubbleTextEntity(resText);
+ m_BubbleEntityList.push_back(entity);
}
void ConvListItem::addImageItem(const MsgConvMedia &media)
{
// TODO: msg service corrupts thumbnail's metadata, so it lost rotation. Use getPath instead getThumbPath until fix
- m_BubbleEntity.addItem(BubbleEntity::ImageItem, media.getPath(), media.getPath());
+ auto *entity = new BubbleImageEntity(media.getPath());
+ m_BubbleEntityList.push_back(entity);
}
void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::string &searchWord)
{
if(!MsgUtils::isMms(m_Type))
{
- std::string textItem = item.getText();
- if(isContentFind(textItem, searchWord))
- showSearch();
-
- std::string markupText = utf8ToMarkup(textItem);
- // It may be after to update the UI document
- // std::string highlightedText = TextDecorator::highlightKeyword(markupText, utf8ToMarkup(searchWord));
- m_BubbleEntity.addItem(BubbleEntity::TextItem, markupText);
+ addTextItem(item.getText(), true, searchWord);
}
else if(m_Type == Message::MT_MMS_Noti)
{
std::string text = MessageDetailContent::getMmsNotiConvListItemContent(m_App, m_MsgId);
- m_BubbleEntity.addItem(BubbleEntity::TextItem, text);
- m_BubbleEntity.addItem(BubbleEntity::DownloadButtonItem);
+ addTextItem(text, false, searchWord);
+ addDownloadButtonItem();
}
else
{
Evas_Object *ConvListItem::getBubbleContent()
{
- BubbleView *bubble = new BubbleView(*getOwner());
- bubble->fill(m_BubbleEntity);
- bubble->setListener(this);
+ auto *bubble = new BubbleItemContainer(*getOwner());
+ for(BubbleEntity *entity : m_BubbleEntityList)
+ {
+ BubbleViewItem *item = entity->createView(*bubble);
+ item->show();
+ bubble->append(*item);
+ item->setListener(this);
+ }
+ bubble->go();
+ bubble->show();
return *bubble;
}
listPopup.appendItem(msg("IDS_MSG_OPT_COPY_TO_SIM_CARD_ABB"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onCopyToSimCardItemPressed), this);
listPopup.appendItem(msg("IDS_MSG_OPT_VIEW_DETAILS_ABB"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onViewDetailsItemPressed), this);
-
listPopup.show();
}
m_App.getMsgEngine().getTransport().retrieveMessage(m_MsgId);
}
-void ConvListItem::onDownloadButtonClicked()
+void ConvListItem::onAction(BubbleViewItem &item)
{
MSG_LOG("");
- m_App.getMsgEngine().getTransport().retrieveMessage(m_MsgId);
-}
-void ConvListItem::onItemClicked(BubbleEntity::Item &item)
-{
- MSG_LOG("");
- m_FileViewer.launchWithCopy(item.value2);
+ switch(item.getEntity().getType())
+ {
+ case BubbleEntity::DownloadButtonItem:
+ {
+ m_App.getMsgEngine().getTransport().retrieveMessage(m_MsgId);
+ break;
+ }
+ case BubbleEntity::TextItem:
+ {
+ break;
+ }
+ default:
+ {
+ const std::string &filePath = item.getEntity().getFilePath();
+ if(!filePath.empty())
+ m_FileViewer.launchWithCopy(filePath);
+ break;
+ }
+ }
}
void ConvListItem::onCopyTextItemPressed(PopupListItem &item)
--- /dev/null
+/*
+ * 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 BubbleAudioViewItem_h_
+#define BubbleAudioViewItem_h_
+
+#include "BubbleIconTextLayoutItem.h"
+
+namespace Msg
+{
+ class BubbleAudioViewItem
+ : public BubbleIconTextLayoutItem
+ {
+ public:
+ BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent);
+ virtual ~BubbleAudioViewItem();
+ };
+
+ class BubbleAudioEntity
+ : public BubbleEntity
+ {
+ public:
+ BubbleAudioEntity(const std::string &filePath, const std::string &fileName, const std::string &duration);
+ virtual ~BubbleAudioEntity();
+
+ virtual BubbleAudioViewItem *createView(Evas_Object *parent);
+ virtual const std::string &getFilePath() const;
+
+ private:
+ const std::string m_FilePath;
+ const std::string m_FileName;
+ const std::string m_Duration;
+ };
+}
+
+#endif /* BubbleAudioViewItem_h_ */
--- /dev/null
+/*
+ * 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 BubbleDownloadButtonViewItem_h_
+#define BubbleDownloadButtonViewItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg
+{
+ class BubbleDownloadButtonViewItem
+ : public BubbleViewItem
+ {
+ public:
+ BubbleDownloadButtonViewItem(BubbleEntity &entity, Evas_Object *parent);
+ virtual ~BubbleDownloadButtonViewItem();
+
+ private:
+ void onPressed(Evas_Object *obj, void *eventInfo);
+ };
+
+ class BubbleDownloadButtonEntity
+ : public BubbleEntity
+ {
+ public:
+ BubbleDownloadButtonEntity();
+ virtual ~BubbleDownloadButtonEntity();
+
+ virtual BubbleDownloadButtonViewItem *createView(Evas_Object *parent);
+ virtual const std::string &getFilePath() const;
+ };
+}
+
+#endif /* BubbleDownloadButtonViewItem_h_ */
--- /dev/null
+/*
+ * 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 BubbleIconTextLayoutItem_h_
+#define BubbleIconTextLayoutItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg
+{
+ class BubbleIconTextLayoutItem
+ : public BubbleViewItem
+ {
+ public:
+ enum LayoutType
+ {
+ Layout1Icon1Text,
+ Layout1Icon2Text
+ };
+
+ public:
+ BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, LayoutType layoutType);
+ virtual ~BubbleIconTextLayoutItem();
+
+ void setIcon(Evas_Object *icon);
+ void setMainText(const std::string &text);
+ void setSubText(const std::string &text);
+
+ static Evas_Object *createIcon(Evas_Object *parent, const std::string &edjFileName);
+ };
+}
+
+#endif /* BubbleIconTextLayoutItem_h_ */
--- /dev/null
+/*
+ * 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 BubbleImageViewItem_h_
+#define BubbleImageViewItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg
+{
+ class BubbleImageViewItem
+ : public BubbleViewItem
+ {
+ public:
+ BubbleImageViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath);
+ virtual ~BubbleImageViewItem();
+
+ private:
+ Evas_Object *createImage(Evas_Object *parent, const std::string &path);
+ };
+
+ class BubbleImageEntity
+ : public BubbleEntity
+ {
+ public:
+ BubbleImageEntity(const std::string &imgPath);
+ virtual ~BubbleImageEntity();
+
+ virtual BubbleImageViewItem *createView(Evas_Object *parent);
+ virtual const std::string &getFilePath() const;
+
+ private:
+ const std::string m_ImgPath;
+ };
+}
+
+#endif /* BubbleImageViewItem_h_ */
--- /dev/null
+/*
+ * 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 BubbleItemContainer_h_
+#define BubbleItemContainer_h_
+
+#include "View.h"
+
+namespace Msg
+{
+ class BubbleItemContainer
+ : public View
+ {
+ public:
+ BubbleItemContainer(Evas_Object *parent);
+ virtual ~BubbleItemContainer();
+
+ void append(Evas_Object *item);
+ void go();
+ };
+}
+
+#endif /* BubbleItemContainer_h_ */
--- /dev/null
+/*
+ * 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 BubbleTextViewItem_h_
+#define BubbleTextViewItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg
+{
+ class BubbleTextViewItem
+ : public BubbleViewItem
+ {
+ public:
+ BubbleTextViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &text);
+ virtual ~BubbleTextViewItem();
+
+ private:
+ Evas_Object *createText(Evas_Object *parent, const std::string &text);
+ };
+
+ class BubbleTextEntity
+ : public BubbleEntity
+ {
+ public:
+ BubbleTextEntity(const std::string &text);
+ virtual ~BubbleTextEntity();
+
+ virtual const std::string &getFilePath() const;
+ virtual BubbleTextViewItem *createView(Evas_Object *parent);
+
+ private:
+ std::string m_Text;
+ };
+}
+
+#endif /* BubbleTextViewItem_h_ */
--- /dev/null
+/*
+ * 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 BubbleUnknownFileViewItem_h_
+#define BubbleUnknownFileViewItem_h_
+
+#include "BubbleIconTextLayoutItem.h"
+
+namespace Msg
+{
+ class BubbleUnknownFileViewItem
+ : public BubbleIconTextLayoutItem
+ {
+ public:
+ BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent);
+ virtual ~BubbleUnknownFileViewItem();
+ };
+
+ class BubbleUnknownFileEntity
+ : public BubbleEntity
+ {
+ public:
+ BubbleUnknownFileEntity(const std::string &filePath, const std::string &fileName);
+ virtual ~BubbleUnknownFileEntity();
+
+ virtual BubbleUnknownFileViewItem *createView(Evas_Object *parent);
+ virtual const std::string &getFilePath() const;
+
+ private:
+ const std::string m_FilePath;
+ const std::string m_FileName;
+ };
+}
+
+#endif /* BubbleUnknownFileViewItem_h_ */
--- /dev/null
+/*
+ * 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 BubbleVideoViewItem_h_
+#define BubbleVideoViewItem_h_
+
+#include "BubbleViewItem.h"
+
+namespace Msg
+{
+ class BubbleVideoViewItem
+ : public BubbleViewItem
+ {
+ public:
+ BubbleVideoViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath);
+ virtual ~BubbleVideoViewItem();
+
+ private:
+ Evas_Object *createImage(Evas_Object *parent, const std::string &path);
+ };
+
+ class BubbleVideoEntity
+ : public BubbleEntity
+ {
+ public:
+ BubbleVideoEntity(const std::string &videoPath, const std::string &imgPath);
+ virtual ~BubbleVideoEntity();
+
+ virtual BubbleVideoViewItem *createView(Evas_Object *parent);
+ virtual const std::string &getFilePath() const;
+
+ private:
+ const std::string m_VideoPath;
+ const std::string m_ImgPath;
+ };
+}
+
+#endif /* BubbleVideoViewItem_h_ */
+++ /dev/null
-/*
- * 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 BubbleView_h_
-#define BubbleView_h_
-
-#include "View.h"
-#include "MsgTypes.h"
-
-#include <string>
-#include <list>
-
-namespace Msg
-{
- class BubbleView;
- class IBubbleViewListener;
-
- // TODO: refact. BubbleEntity
-
- class BubbleEntity
- {
- friend class BubbleView;
-
- public:
- BubbleEntity();
- ~BubbleEntity();
-
- enum ItemType
- {
- TextItem,
- ImageItem,
- VideoItem,
- AudioItem,
- AttachedFileItem,
- DownloadButtonItem
- };
-
- struct Item
- {
- ItemType type;
- std::string value;
- std::string value2;
- };
-
- /**
- * @brief Add new item to bubble entity
- * @param[in] type Set which type is @value
- * @param[in] value Resource path or raw text to display
- * @param[in] value Real resource path
- */
- void addItem(ItemType type, const std::string &value = std::string(), const std::string &value2 = std::string());
-
- private:
- BubbleEntity(BubbleEntity&) = delete;
- BubbleEntity &operator=(BubbleEntity&) = delete;
-
-
-
- private:
- std::vector<Item> m_Items;
- };
-
- class BubbleView
- : public View
- {
- public:
- BubbleView(Evas_Object *parent);
- virtual ~BubbleView();
-
- /**
- * @brief Draw content from @entity
- * @param[in] entity Filled list of contents
- */
- void fill(const BubbleEntity &entity);
- void setListener(IBubbleViewListener *listener);
-
- private:
- void create(Evas_Object *parent);
- Evas_Object *createText(const std::string &text);
- Evas_Object *createImage(const std::string &path);
- Evas_Object *createVideo(const std::string &path);
- Evas_Object *createDownloadButton();
- Evas_Object *createItemButton(Evas_Object *content, const void *data);
-
- void onDownloadPressed(Evas_Object *obj, void *event_info);
- void onItemClicked(Evas_Object *obj, void *event_info);
-
- private:
- IBubbleViewListener *m_pListener;
- };
-
- class IBubbleViewListener
- {
- public:
- virtual ~IBubbleViewListener() {}
- virtual void onDownloadButtonClicked() {};
- virtual void onItemClicked(BubbleEntity::Item &item) {};
- };
-}
-
-#endif /* BubbleView_h_ */
--- /dev/null
+/*
+ * 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 BubbleViewItem_h_
+#define BubbleViewItem_h_
+
+#include "View.h"
+#include "MsgTypes.h"
+
+#include <string>
+
+namespace Msg
+{
+ class IBubbleViewItemListener;
+ class BubbleEntity;
+
+ class BubbleViewItem
+ : public View
+ {
+ public:
+ static const int maxWidth = 340;
+
+ BubbleViewItem(BubbleEntity &entity);
+ virtual ~BubbleViewItem();
+
+ void setListener(IBubbleViewItemListener *l);
+ BubbleEntity &getEntity();
+
+ protected:
+ void emitActionEvent();
+ void attachGestureTapLayer(Evas_Object *parent, Evas_Object *obj);
+
+ private:
+ BubbleEntity &m_Entity;
+ IBubbleViewItemListener *m_pListener;
+ };
+
+ class BubbleEntity
+ {
+ public:
+ enum Type
+ {
+ TextItem,
+ ImageItem,
+ AudioItem,
+ VideoItem,
+ ContactItem,
+ CalendarItem,
+ UnknownFileItem,
+ DownloadButtonItem
+ };
+
+ public:
+ BubbleEntity(Type type);
+ virtual ~BubbleEntity();
+
+ Type getType() const;
+ virtual const std::string &getFilePath() const = 0;
+ virtual BubbleViewItem *createView(Evas_Object *parent) = 0;
+
+ private:
+ Type m_Type;
+ };
+
+ class IBubbleViewItemListener
+ {
+ public:
+ virtual ~IBubbleViewItemListener() {};
+ virtual void onAction(BubbleViewItem &item) {}; // Tap or Click
+ };
+}
+
+#endif /* BubbleViewItem_h_ */
--- /dev/null
+/*
+ * 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 "BubbleAudioViewItem.h"
+#include "Resource.h"
+
+using namespace Msg;
+
+BubbleAudioViewItem::BubbleAudioViewItem(BubbleEntity &entity, Evas_Object *parent)
+ : BubbleIconTextLayoutItem(entity, parent, Layout1Icon2Text)
+{
+ attachGestureTapLayer(getEo(), getEo());
+}
+
+BubbleAudioViewItem::~BubbleAudioViewItem()
+{
+}
+
+
+BubbleAudioEntity::BubbleAudioEntity(const std::string &filePath, const std::string &fileName, const std::string &duration)
+ : BubbleEntity(AudioItem)
+ , m_FilePath(filePath)
+ , m_FileName(fileName)
+ , m_Duration(duration)
+{
+
+}
+
+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;
+}
+
+const std::string &BubbleAudioEntity::getFilePath() const
+{
+ return m_FilePath;
+}
+
+
--- /dev/null
+/*
+ * 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 "BubbleDownloadButtonViewItem.h"
+#include "LangUtils.h"
+
+using namespace Msg;
+
+BubbleDownloadButtonViewItem::BubbleDownloadButtonViewItem(BubbleEntity &entity, Evas_Object *parent)
+ : BubbleViewItem(entity)
+{
+ Evas_Object *button = elm_button_add(parent);
+ setEo(button);
+ expand();
+ setText(msgt("IDS_MSG_BUTTON_DOWNLOAD_ABB3"));
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(BubbleDownloadButtonViewItem, onPressed), this);
+ evas_object_smart_calculate(button);
+ evas_object_show(button);
+}
+
+BubbleDownloadButtonViewItem::~BubbleDownloadButtonViewItem()
+{
+
+}
+
+void BubbleDownloadButtonViewItem::onPressed(Evas_Object *obj, void *eventInfo)
+{
+ emitActionEvent();
+}
+
+BubbleDownloadButtonEntity::BubbleDownloadButtonEntity()
+ : BubbleEntity(DownloadButtonItem)
+{
+}
+
+BubbleDownloadButtonEntity::~BubbleDownloadButtonEntity()
+{
+}
+
+BubbleDownloadButtonViewItem *BubbleDownloadButtonEntity::createView(Evas_Object *parent)
+{
+ auto *item = new BubbleDownloadButtonViewItem(*this, parent);
+ return item;
+}
+
+const std::string &BubbleDownloadButtonEntity::getFilePath() const
+{
+ static std::string empty;
+ return empty;
+}
--- /dev/null
+/*
+ * 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 "BubbleIconTextLayoutItem.h"
+#include "Resource.h"
+#include "TextDecorator.h"
+#include "Resource.h"
+
+using namespace Msg;
+
+#define DEF_ICON_COLOR 128, 128, 128, 255
+
+BubbleIconTextLayoutItem::BubbleIconTextLayoutItem(BubbleEntity &entity, Evas_Object *parent, LayoutType layoutType)
+ : BubbleViewItem(entity)
+{
+ // TODO: impl Layout1Icon1Text
+ Evas_Object *layout = addLayout(parent, CONV_LIST_ATTACHMENTS_EDJ_PATH, "conv/list/icon_text_attachment");
+ setEo(layout);
+}
+
+BubbleIconTextLayoutItem::~BubbleIconTextLayoutItem()
+{
+}
+
+void BubbleIconTextLayoutItem::setIcon(Evas_Object *icon)
+{
+ setContent(icon, "icon");
+}
+
+void BubbleIconTextLayoutItem::setMainText(const std::string &text)
+{
+ setText(text, "main.text");
+}
+
+void BubbleIconTextLayoutItem::setSubText(const std::string &text)
+{
+ setText(text, "sub.text");
+}
+
+Evas_Object *BubbleIconTextLayoutItem::createIcon(Evas_Object *parent, const std::string &edjFileName)
+{
+ Evas_Object *icon = elm_icon_add(parent);
+ std::string resPath = PathUtils::getResourcePath(IMAGES_EDJ_PATH);
+ elm_image_file_set(icon, resPath.c_str(), edjFileName.c_str());
+ evas_object_color_set(icon, DEF_ICON_COLOR);
+ evas_object_show(icon);
+ return icon;
+}
--- /dev/null
+/*
+ * 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 "BubbleImageViewItem.h"
+
+using namespace Msg;
+
+BubbleImageViewItem::BubbleImageViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath)
+ : BubbleViewItem(entity)
+{
+ Evas_Object *img = createImage(parent, imagePath);
+ attachGestureTapLayer(img, img);
+ setEo(img);
+}
+
+BubbleImageViewItem::~BubbleImageViewItem()
+{
+}
+
+Evas_Object *BubbleImageViewItem::createImage(Evas_Object *parent, const std::string &path)
+{
+ Evas_Object *image = elm_image_add(parent);
+ elm_image_file_set(image, path.c_str(), nullptr);
+ int imageWidth = 0;
+ int imageHeight = 0;
+ elm_image_object_size_get(image, &imageWidth, &imageHeight);
+ if(imageWidth > maxWidth)
+ {
+ double scale = maxWidth/(double)imageWidth;
+ imageWidth *= scale;
+ imageHeight *= scale;
+ }
+ evas_object_size_hint_min_set(image, imageWidth, imageHeight);
+ evas_object_show(image);
+ return image;
+}
+
+BubbleImageEntity::BubbleImageEntity(const std::string &imgPath)
+ : BubbleEntity(ImageItem)
+ , m_ImgPath(imgPath)
+{
+}
+
+BubbleImageEntity::~BubbleImageEntity()
+{
+}
+
+BubbleImageViewItem *BubbleImageEntity::createView(Evas_Object *parent)
+{
+ auto *item = new BubbleImageViewItem(*this, parent, m_ImgPath);
+ return item;
+}
+
+const std::string &BubbleImageEntity::getFilePath() const
+{
+ return m_ImgPath;
+}
+
--- /dev/null
+/*
+ * 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 "BubbleItemContainer.h"
+
+using namespace Msg;
+
+namespace
+{
+ const int verticalBoxPads = 10;
+ const int horizontalBoxPads = 0;
+}
+
+BubbleItemContainer::BubbleItemContainer(Evas_Object *parent)
+{
+ Evas_Object *box = elm_box_add(parent);
+ elm_box_homogeneous_set(box, false);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(horizontalBoxPads), ELM_SCALE_SIZE(verticalBoxPads));
+ setEo(box);
+ expand();
+ show();
+}
+
+BubbleItemContainer::~BubbleItemContainer()
+{
+}
+
+void BubbleItemContainer::append(Evas_Object *item)
+{
+ evas_object_smart_calculate(item);
+ evas_object_show(item);
+ elm_box_pack_end(getEo(), item);
+}
+
+void BubbleItemContainer::go()
+{
+ elm_box_recalculate(getEo());
+}
+
+
--- /dev/null
+/*
+ * 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 "BubbleTextViewItem.h"
+
+using namespace Msg;
+
+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)
+{
+ setEo(createText(parent, text));
+}
+
+BubbleTextViewItem::~BubbleTextViewItem()
+{
+}
+
+Evas_Object *BubbleTextViewItem::createText(Evas_Object *parent, const std::string &text)
+{
+ //TODO: apply to label the same text style as to textblock (figure out how-to)
+ if(text.empty())
+ return nullptr;
+
+ Evas_Coord ww = 0;
+ Evas_Coord hh = 0;
+
+ Evas_Object *label = elm_label_add(parent);
+ Evas_Object *textBlock = evas_object_textblock_add(evas_object_evas_get(label));
+ Evas_Textblock_Style *ts = evas_textblock_style_new();
+
+ evas_textblock_style_set(ts, textStyle);
+ evas_object_textblock_style_set(textBlock, ts);
+ evas_object_textblock_text_markup_set(textBlock, text.c_str());
+ evas_object_textblock_size_native_get(textBlock, &ww, &hh);
+
+ evas_textblock_style_free(ts);
+ 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;
+}
+
+BubbleTextEntity::BubbleTextEntity(const std::string &text)
+ : BubbleEntity(ImageItem)
+ , m_Text(text)
+{
+}
+
+BubbleTextEntity::~BubbleTextEntity()
+{
+}
+
+const std::string &BubbleTextEntity::getFilePath() const
+{
+ static std::string empty;
+ return empty;
+}
+
+BubbleTextViewItem *BubbleTextEntity::createView(Evas_Object *parent)
+{
+ auto *item = new BubbleTextViewItem(*this ,parent, m_Text);
+ return item;
+}
--- /dev/null
+/*
+ * 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 "BubbleUnknownFileViewItem.h"
+#include "Resource.h"
+
+using namespace Msg;
+
+BubbleUnknownFileViewItem::BubbleUnknownFileViewItem(BubbleEntity &entity, Evas_Object *parent)
+ : BubbleIconTextLayoutItem(entity, parent, Layout1Icon1Text)
+{
+ attachGestureTapLayer(getEo(), getEo());
+}
+
+BubbleUnknownFileViewItem::~BubbleUnknownFileViewItem()
+{
+}
+
+BubbleUnknownFileEntity::BubbleUnknownFileEntity(const std::string &filePath, const std::string &fileName)
+ : BubbleEntity(UnknownFileItem)
+ , m_FilePath(filePath)
+ , m_FileName(fileName)
+{
+}
+
+BubbleUnknownFileEntity::~BubbleUnknownFileEntity()
+{
+
+}
+
+BubbleUnknownFileViewItem *BubbleUnknownFileEntity::createView(Evas_Object *parent)
+{
+ auto *item = new BubbleUnknownFileViewItem(*this, parent);
+ item->setMainText(m_FileName);
+ return item;
+}
+
+const std::string &BubbleUnknownFileEntity::getFilePath() const
+{
+ return m_FilePath;
+}
+
+
--- /dev/null
+/*
+ * 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 "BubbleVideoViewItem.h"
+
+using namespace Msg;
+
+BubbleVideoViewItem::BubbleVideoViewItem(BubbleEntity &entity, Evas_Object *parent, const std::string &imagePath)
+ : BubbleViewItem(entity)
+{
+ Evas_Object *img = createImage(parent, imagePath);
+ attachGestureTapLayer(img, img);
+ setEo(img);
+}
+
+BubbleVideoViewItem::~BubbleVideoViewItem()
+{
+}
+
+Evas_Object *BubbleVideoViewItem::createImage(Evas_Object *parent, const std::string &path)
+{
+ Evas_Object *image = elm_image_add(parent);
+ elm_image_file_set(image, path.c_str(), nullptr);
+ int imageWidth = 0;
+ int imageHeight = 0;
+ elm_image_object_size_get(image, &imageWidth, &imageHeight);
+ if(imageWidth > maxWidth)
+ {
+ double scale = maxWidth/(double)imageWidth;
+ imageWidth *= scale;
+ imageHeight *= scale;
+ }
+ evas_object_size_hint_min_set(image, imageWidth, imageHeight);
+ evas_object_show(image);
+ return image;
+}
+
+BubbleVideoEntity::BubbleVideoEntity(const std::string &videoPath, const std::string &imgPath)
+ : BubbleEntity(VideoItem)
+ , m_VideoPath(videoPath)
+ , m_ImgPath(imgPath)
+{
+}
+
+BubbleVideoEntity::~BubbleVideoEntity()
+{
+}
+
+BubbleVideoViewItem *BubbleVideoEntity::createView(Evas_Object *parent)
+{
+ auto *item = new BubbleVideoViewItem(*this, parent, m_ImgPath);
+ return item;
+}
+
+const std::string &BubbleVideoEntity::getFilePath() const
+{
+ return m_VideoPath;
+}
+
+++ /dev/null
-/*
- * 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 "BubbleView.h"
-
-#include <Elementary.h>
-
-using namespace Msg;
-
-namespace
-{
- const int verticalBoxPads = 10;
- const int horizontalBoxPads = 0;
- const int maxWidth = 340;
- const char *textStyle = "DEFAULT='font=Tizen:style=Regular font_size=24 wrap=mixed text_class=label'";
- const int tapFingerSize = 12;
- const char *selfKey = "self";
- const char *itemButtonDataKey = "data";
-}
-
-BubbleView::BubbleView(Evas_Object *parent)
- : m_pListener(nullptr)
-{
- create(parent);
-}
-
-BubbleView::~BubbleView()
-{
-
-}
-
-void BubbleView::create(Evas_Object *parent)
-{
- Evas_Object *box = elm_box_add(parent);
- View::expand(box);
- elm_box_padding_set(box, (int)ELM_SCALE_SIZE(horizontalBoxPads), (int)ELM_SCALE_SIZE(verticalBoxPads));
-
- setEo(box);
-}
-
-void BubbleView::fill(const BubbleEntity &entity)
-{
- for(const BubbleEntity::Item &item : entity.m_Items)
- {
- switch (item.type)
- {
- case BubbleEntity::TextItem:
- elm_box_pack_end(*this, createText(item.value));
- break;
- case BubbleEntity::ImageItem:
- elm_box_pack_end(*this, createItemButton(createImage(item.value), &item));
- break;
- case BubbleEntity::VideoItem:
- elm_box_pack_end(*this, createItemButton(createVideo(item.value), &item));
- break;
- case BubbleEntity::AudioItem:
- elm_box_pack_end(*this, createItemButton(createText(item.value), &item));
- break;
- case BubbleEntity::AttachedFileItem:
- elm_box_pack_end(*this, createItemButton(createText(item.value), &item));
- break;
- case BubbleEntity::DownloadButtonItem:
- elm_box_pack_end(*this, createDownloadButton());
- break;
- default:
- break;
- }
- }
- elm_box_recalculate(*this);
-}
-
-Evas_Object *BubbleView::createText(const std::string &text)
-{
- //TODO: apply to label the same text style as to textblock (figure out how-to)
- if(text.empty())
- return nullptr;
-
- Evas_Coord ww, hh;
- Evas_Object *label = elm_label_add(*this);
- Evas_Object *textBlock = evas_object_textblock_add(evas_object_evas_get(label));
- Evas_Textblock_Style *ts = evas_textblock_style_new();
-
- evas_textblock_style_set(ts, textStyle);
- evas_object_textblock_style_set(textBlock, ts);
- evas_object_textblock_text_markup_set(textBlock, text.c_str());
- evas_object_textblock_size_native_get(textBlock, &ww, &hh);
-
- evas_textblock_style_free(ts);
- 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;
-}
-
-Evas_Object *BubbleView::createImage(const std::string &path)
-{
- Evas_Object *image = elm_image_add(*this);
- elm_image_file_set(image, path.c_str(), nullptr);
- int imageWidth = 0;
- int imageHeight = 0;
- elm_image_object_size_get(image, &imageWidth, &imageHeight);
- if(imageWidth > maxWidth)
- {
- double scale = maxWidth/(double)imageWidth;
- imageWidth *= scale;
- imageHeight *= scale;
- }
- evas_object_size_hint_min_set(image, imageWidth, imageHeight);
- evas_object_show(image);
- return image;
-}
-
-Evas_Object *BubbleView::createVideo(const std::string &path)
-{
- Evas_Object *image = elm_image_add(*this);
- elm_image_file_set(image, path.c_str(), nullptr);
- int imageWidth = 0;
- int imageHeight = 0;
- elm_image_object_size_get(image, &imageWidth, &imageHeight);
- if(imageWidth > maxWidth)
- {
- double scale = maxWidth/(double)imageWidth;
- imageWidth *= scale;
- imageHeight *= scale;
- }
- evas_object_size_hint_min_set(image, imageWidth, imageHeight);
- evas_object_show(image);
- return image;
-}
-
-Evas_Object *BubbleView::createDownloadButton()
-{
- Evas_Object *retrieveBtn = elm_button_add(*this);
- View::expand(retrieveBtn);
- elm_object_domain_translatable_text_set(retrieveBtn, MSG_DOMAIN, "IDS_MSG_BUTTON_DOWNLOAD_ABB3");
- evas_object_smart_callback_add(retrieveBtn, "clicked", SMART_CALLBACK(BubbleView, onDownloadPressed), this);
- evas_object_show(retrieveBtn);
-
- return retrieveBtn;
-}
-
-Evas_Object *BubbleView::createItemButton(Evas_Object *content, const void *data)
-{
- Evas_Object *button = elm_button_add(*this);
- evas_object_data_set(button, selfKey, this);
- evas_object_data_set(button, itemButtonDataKey, data);
- elm_object_style_set(button, "transparent");
-
- int w = 0;
- int h = 0;
-
- evas_object_size_hint_min_get(content, &w, &h);
- evas_object_size_hint_min_set(button, w, h);
-
- evas_object_size_hint_max_get(content, &w, &h);
- evas_object_size_hint_max_set(button, w, h);
-
- elm_object_content_set(button, content);
- evas_object_show(button);
-
- Evas_Object *layer = elm_gesture_layer_add(getEo());
- evas_object_smart_data_set(layer, button);
- evas_object_show(layer);
- elm_gesture_layer_tap_finger_size_set(layer, ELM_SCALE_SIZE(tapFingerSize));
- elm_gesture_layer_attach(layer, button);
-
- elm_gesture_layer_cb_add
- (
- layer,
- ELM_GESTURE_N_TAPS,
- ELM_GESTURE_STATE_END,
- [](void *data, void *event_info)->Evas_Event_Flags
- {
- auto *button = static_cast<Evas_Object*>(data);
- auto *self = static_cast<BubbleView*>(evas_object_data_get(button, selfKey));
- if(self)
- self->onItemClicked(button, event_info);
- return EVAS_EVENT_FLAG_NONE;
- },
- button
- );
-
- return button;
-}
-
-void BubbleView::setListener(IBubbleViewListener *listener)
-{
- m_pListener = listener;
-}
-
-void BubbleView::onDownloadPressed(Evas_Object *obj, void *event_info)
-{
- if(m_pListener)
- m_pListener->onDownloadButtonClicked();
-}
-
-void BubbleView::onItemClicked(Evas_Object *obj, void *event_info)
-{
- auto *item = static_cast<BubbleEntity::Item*>(evas_object_data_get(obj, itemButtonDataKey));
- if(m_pListener && item)
- m_pListener->onItemClicked(*item);
-}
-
-BubbleEntity::BubbleEntity()
-{
-}
-
-BubbleEntity::~BubbleEntity()
-{
-}
-
-void BubbleEntity::addItem(ItemType type, const std::string &value, const std::string &value2)
-{
- m_Items.push_back(Item{type, value, value2});
-}
--- /dev/null
+/*
+ * 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 "BubbleViewItem.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+const int tapFingerSize = 12;
+
+BubbleViewItem::BubbleViewItem(BubbleEntity &entity)
+ : m_Entity(entity)
+ , m_pListener(nullptr)
+{
+
+}
+
+BubbleViewItem::~BubbleViewItem()
+{
+
+}
+
+void BubbleViewItem::setListener(IBubbleViewItemListener *l)
+{
+ m_pListener = l;
+}
+
+BubbleEntity &BubbleViewItem::getEntity()
+{
+ return m_Entity;
+}
+
+void BubbleViewItem::attachGestureTapLayer(Evas_Object *parent, Evas_Object *obj)
+{
+ Evas_Object *layer = elm_gesture_layer_add(parent);
+ evas_object_show(layer);
+ elm_gesture_layer_attach(layer, obj);
+ elm_gesture_layer_tap_finger_size_set(layer, ELM_SCALE_SIZE(tapFingerSize));
+
+ elm_gesture_layer_cb_add
+ (
+ layer,
+ ELM_GESTURE_N_TAPS,
+ ELM_GESTURE_STATE_END,
+ [](void *data, void *event_info)->Evas_Event_Flags
+ {
+ auto *self = static_cast<BubbleViewItem*>(data);
+ if(self)
+ self->emitActionEvent();
+ return EVAS_EVENT_FLAG_NONE;
+ },
+ this
+ );
+}
+
+void BubbleViewItem::emitActionEvent()
+{
+ if(m_pListener)
+ m_pListener->onAction(*this);
+}
+
+BubbleEntity::BubbleEntity(Type type)
+ : m_Type(type)
+{
+}
+
+BubbleEntity::~BubbleEntity()
+{
+}
+
+BubbleEntity::Type BubbleEntity::getType() const
+{
+ return m_Type;
+}
+