TizenRefApp-7196 "Share" option is absent 11/88211/5
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 14 Sep 2016 14:26:49 +0000 (17:26 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 14 Sep 2016 15:00:11 +0000 (18:00 +0300)
Change-Id: I44e2423d8aab9d9d265f28fe753a0c327d582ad6
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
12 files changed:
project_def.prop
src/Common/AppControl/inc/FileShare.h [deleted file]
src/Common/AppControl/inc/FileViewer.h
src/Common/AppControl/inc/Share.h [new file with mode: 0644]
src/Common/AppControl/src/FileShare.cpp [deleted file]
src/Common/AppControl/src/FileViewer.cpp
src/Common/AppControl/src/Share.cpp [new file with mode: 0644]
src/Common/Utils/inc/FileUtils.h
src/Common/Utils/src/FileUtils.cpp
src/Conversation/ConvList/Controller/inc/BubbleEntity.h
src/Conversation/ConvList/Controller/inc/ConvListItem.h
src/Conversation/ConvList/Controller/src/ConvListItem.cpp

index add7b2af8cbf1c49440d568fa59b169dd2f9a9a5..e510273f66f093565b670547e00663b3619988ce 100644 (file)
@@ -9,7 +9,7 @@ type = app
 profile = mobile-3.0
 
 # C/CPP Sources
-USER_SRCS = src/Common/MsgEngine/src/MsgThreadItem.cpp src/Common/Utils/src/VCalendarParser.cpp src/Conversation/Body/View/src/BodyView.cpp src/Conversation/ConvList/Controller/src/ConvList.cpp src/MsgThread/Controller/src/MsgThread.cpp src/Conversation/ConvList/Controller/src/BubbleCalEventEntity.cpp src/Conversation/Utils/src/MessageDetailContent.cpp src/Common/MsgEngine/src/private/MsgAddressPrivate.cpp src/MainApp/MainApp.cpp src/Common/MsgEngine/src/private/MsgReportPrivate.cpp src/Conversation/Utils/src/WorkingDir.cpp src/Common/View/src/ListItem.cpp src/MsgThread/Controller/src/BaseThreadListItem.cpp src/Viewer/Controller/src/SmilPlayer.cpp src/Common/MsgEngine/src/private/MsgTransportPrivate.cpp src/MsgThread/View/src/MsgThreadLayout.cpp src/Conversation/ContactList/Controller/src/ConvContactList.cpp src/Common/MsgEngine/src/Message.cpp src/Viewer/Utils/src/MediaPlayer.cpp src/Common/AppControl/src/AppControlDefault.cpp src/Common/View/src/ListView.cpp src/Settings/Controller/src/MsgOnSimCard.cpp src/Common/MsgEngine/src/MessageMms.cpp src/Conversation/Main/Controller/src/Conversation.cpp src/Common/MsgEngine/src/private/MsgConvMediaPrivate.cpp src/Common/MsgEngine/src/MsgTransport.cpp src/Viewer/View/src/SmilImageItemView.cpp src/Common/ContactManager/src/ContactRecord.cpp src/Conversation/ContactList/View/src/ConvContactListView.cpp src/MsgThread/Controller/src/ThreadSearchList.cpp src/MsgThread/View/src/MsgThreadSearchPanel.cpp src/Common/Controller/src/SaveAttachmentsPopup.cpp src/Common/Utils/src/FileUtils.cpp src/Common/View/src/ContextPopup.cpp src/Common/MsgEngine/src/MessageSMS.cpp src/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp src/Conversation/ContactList/View/src/ContactListViewItem.cpp src/Common/MsgEngine/src/private/MessagePrivate.cpp src/Conversation/ConvList/Controller/src/BubbleAudioEntity.cpp src/Common/View/src/MbeRecipientsView.cpp src/MsgThread/Controller/src/ThreadListItem.cpp src/Settings/View/src/SettingsGroupListViewItem.cpp src/Common/View/src/Popup.cpp src/Common/Controller/src/ViewItemController.cpp src/Settings/Controller/src/Settings.cpp src/Common/ContactManager/src/ContactVCardParser.cpp src/Viewer/Controller/src/Viewer.cpp src/Viewer/Controller/src/SmilPage.cpp src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp src/Common/Utils/src/HwButtonListener.cpp src/Common/AppControl/src/AppControlCompose.cpp src/Common/MsgEngine/src/MsgUtils.cpp src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp src/Common/Utils/src/PhoneNumberUtils.cpp src/Common/MsgEngine/src/private/MessageSMSPrivate.cpp src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp src/Viewer/View/src/SmilPageLayout.cpp src/Common/View/src/View.cpp src/Conversation/Main/Controller/src/PopupRecipientListItem.cpp src/Common/MsgEngine/src/private/MsgConversationItemPrivate.cpp src/Common/Controller/src/FrameController.cpp src/Conversation/ConvList/View/src/DateLineViewItem.cpp src/Common/AppControl/src/AppControlCommand.cpp src/Viewer/View/src/SmilTextItemView.cpp src/Settings/View/src/SimMsgLayout.cpp src/Common/MsgEngine/src/private/MsgThreadItemPrivate.cpp src/Common/MsgEngine/src/MsgEngine.cpp src/Viewer/View/src/PlayerControl.cpp src/Common/AppControl/src/AppControlParser.cpp src/Common/Controller/src/ViewController.cpp src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp src/Common/View/src/NaviFrameView.cpp src/Common/AppControl/src/FileViewer.cpp src/Common/Utils/src/PathUtils.cpp src/Conversation/ConvList/Controller/src/ComposeListItem.cpp src/Conversation/ConvList/Controller/src/DateLineItem.cpp src/Conversation/ConvList/View/src/BubbleItemContainer.cpp src/Common/AppControl/src/VoiceCall.cpp src/Common/View/src/Scroller.cpp src/Conversation/ConvList/Controller/src/BubbleVideoEntity.cpp src/Common/MsgEngine/src/MsgSettings.cpp src/Conversation/ContactList/Controller/src/ContactListItem.cpp src/Common/ContactManager/src/ContactVCardGenerator.cpp src/Viewer/View/src/SmilAudioItemView.cpp src/Common/Utils/src/LoggerImpl.cpp src/Conversation/ConvList/View/src/ConvSelectAll.cpp src/Common/ContactManager/src/ContactManager.cpp src/Common/AppControl/src/FileShare.cpp src/Conversation/Utils/src/AttachmentHandler.cpp src/Conversation/ConvList/View/src/ComposeListViewItem.cpp src/Common/MsgEngine/src/private/MsgAttachmentPrivate.cpp src/Common/View/src/ViewItem.cpp src/Conversation/AppControl/src/ContactPicker.cpp src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp src/Viewer/View/src/SubjectLayout.cpp src/Conversation/Main/View/src/MessageInputPanel.cpp src/Conversation/Recipients/View/src/ConvRecipientsPanelView.cpp src/Common/Controller/src/BaseController.cpp src/Conversation/AppControl/src/AttachPanel.cpp src/Settings/Controller/src/SettingsSound.cpp src/Conversation/ConvList/View/src/ConvListViewItem.cpp src/Conversation/Body/Controller/src/Body.cpp src/Common/View/src/StandardWindow.cpp src/Common/MsgEngine/src/MsgConversationItem.cpp src/Common/MsgEngine/src/private/MessageMmsPrivate.cpp src/Viewer/View/src/SmilAttachmentItemView.cpp src/MsgThread/Controller/src/ThreadSearchListItem.cpp src/Common/View/src/DefaultLayout.cpp src/Conversation/Recipients/Controller/src/ConvRecipientsPanel.cpp src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp src/Common/View/src/PopupListItem.cpp src/Conversation/ConvList/View/src/BubbleViewItem.cpp src/Viewer/View/src/SmilVideoItemView.cpp src/Common/Controller/src/NaviFrameController.cpp src/MsgThread/Controller/src/ThreadList.cpp src/Common/Utils/src/TextDecorator.cpp src/Common/MsgEngine/src/MsgStorage.cpp src/Common/View/src/SelectAllListItem.cpp src/Conversation/ConvList/View/src/BubbleDownloadButtonViewItem.cpp src/Common/AppControl/src/ContactViewer.cpp src/Common/View/src/Box.cpp src/Common/Utils/src/ThumbnailMaker.cpp src/Common/View/src/NaviFrameItem.cpp src/Common/View/src/PopupList.cpp src/MsgThread/View/src/FloatingButton.cpp src/MsgThread/Controller/src/MsgSearchListItem.cpp src/Common/Controller/src/App.cpp src/Conversation/ConvList/View/src/ConvListLayout.cpp src/Common/View/src/PopupAttachmentListItem.cpp src/Common/MsgEngine/src/private/MsgComposerPrivate.cpp src/Viewer/View/src/ViewerLayout.cpp src/Common/Utils/src/MediaUtils.cpp src/Common/Controller/src/MbeRecipients.cpp src/Settings/Controller/src/SimListViewItem.cpp src/Common/Utils/src/TimeUtils.cpp src/Common/MsgEngine/src/private/MsgSettingsPrivate.cpp src/Viewer/View/src/SmilPlayerView.cpp src/MainApp/main.cpp src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp src/Common/View/src/NoContentLayout.cpp src/Common/SystemSettingsManager/src/SystemSettingsManager.cpp src/Common/MsgEngine/src/MsgPage.cpp src/Common/AppControl/src/ContactEditor.cpp src/Conversation/Main/View/src/ConversationLayout.cpp src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp src/Common/View/src/PopupManager.cpp src/Settings/View/src/SettingsListViewItem.cpp src/Common/MsgEngine/src/private/MsgStoragePrivate.cpp src/Conversation/ConvList/Controller/src/ConvListItem.cpp src/Conversation/ConvList/View/src/BubbleBgViewItem.cpp src/MsgThread/View/src/ThreadListViewItem.cpp src/Common/MsgEngine/src/private/MsgPagePrivate.cpp src/Common/AppControl/src/AppControlUtils.cpp src/Conversation/AppControl/src/LaunchSettings.cpp 
+USER_SRCS = src/Common/MsgEngine/src/MsgThreadItem.cpp src/Common/Utils/src/VCalendarParser.cpp src/Conversation/Body/View/src/BodyView.cpp src/Conversation/ConvList/Controller/src/ConvList.cpp src/MsgThread/Controller/src/MsgThread.cpp src/Conversation/ConvList/Controller/src/BubbleCalEventEntity.cpp src/Conversation/Utils/src/MessageDetailContent.cpp src/Common/MsgEngine/src/private/MsgAddressPrivate.cpp src/MainApp/MainApp.cpp src/Common/MsgEngine/src/private/MsgReportPrivate.cpp src/Conversation/Utils/src/WorkingDir.cpp src/Common/View/src/ListItem.cpp src/MsgThread/Controller/src/BaseThreadListItem.cpp src/Viewer/Controller/src/SmilPlayer.cpp src/Common/MsgEngine/src/private/MsgTransportPrivate.cpp src/MsgThread/View/src/MsgThreadLayout.cpp src/Conversation/ContactList/Controller/src/ConvContactList.cpp src/Common/MsgEngine/src/Message.cpp src/Viewer/Utils/src/MediaPlayer.cpp src/Common/AppControl/src/AppControlDefault.cpp src/Common/View/src/ListView.cpp src/Settings/Controller/src/MsgOnSimCard.cpp src/Common/MsgEngine/src/MessageMms.cpp src/Conversation/Main/Controller/src/Conversation.cpp src/Common/MsgEngine/src/private/MsgConvMediaPrivate.cpp src/Common/MsgEngine/src/MsgTransport.cpp src/Viewer/View/src/SmilImageItemView.cpp src/Common/ContactManager/src/ContactRecord.cpp src/Conversation/ContactList/View/src/ConvContactListView.cpp src/MsgThread/Controller/src/ThreadSearchList.cpp src/MsgThread/View/src/MsgThreadSearchPanel.cpp src/Common/Controller/src/SaveAttachmentsPopup.cpp src/Common/Utils/src/FileUtils.cpp src/Common/View/src/ContextPopup.cpp src/Common/MsgEngine/src/MessageSMS.cpp src/Conversation/ConvList/Controller/src/BubbleContactEntity.cpp src/Conversation/ContactList/View/src/ContactListViewItem.cpp src/Common/MsgEngine/src/private/MessagePrivate.cpp src/Conversation/ConvList/Controller/src/BubbleAudioEntity.cpp src/Common/View/src/MbeRecipientsView.cpp src/MsgThread/Controller/src/ThreadListItem.cpp src/Settings/View/src/SettingsGroupListViewItem.cpp src/Common/View/src/Popup.cpp src/Common/Controller/src/ViewItemController.cpp src/Settings/Controller/src/Settings.cpp src/Common/ContactManager/src/ContactVCardParser.cpp src/Viewer/Controller/src/Viewer.cpp src/Viewer/Controller/src/SmilPage.cpp src/Conversation/ConvList/Controller/src/BubbleUnknownFileEntity.cpp src/Common/Utils/src/HwButtonListener.cpp src/Common/AppControl/src/AppControlCompose.cpp src/Common/MsgEngine/src/MsgUtils.cpp src/Conversation/ConvList/View/src/BubbleTextViewItem.cpp src/Common/Utils/src/PhoneNumberUtils.cpp src/Common/MsgEngine/src/private/MessageSMSPrivate.cpp src/Conversation/ConvList/Controller/src/BubbleEntityFactory.cpp src/Viewer/View/src/SmilPageLayout.cpp src/Common/View/src/View.cpp src/Conversation/Main/Controller/src/PopupRecipientListItem.cpp src/Common/MsgEngine/src/private/MsgConversationItemPrivate.cpp src/Common/Controller/src/FrameController.cpp src/Conversation/ConvList/View/src/DateLineViewItem.cpp src/Common/AppControl/src/AppControlCommand.cpp src/Viewer/View/src/SmilTextItemView.cpp src/Settings/View/src/SimMsgLayout.cpp src/Common/MsgEngine/src/private/MsgThreadItemPrivate.cpp src/Common/MsgEngine/src/MsgEngine.cpp src/Viewer/View/src/PlayerControl.cpp src/Common/AppControl/src/AppControlParser.cpp src/Common/Controller/src/ViewController.cpp src/Conversation/ConvList/View/src/BubbleIconTextLayoutItem.cpp src/Common/View/src/NaviFrameView.cpp src/Common/AppControl/src/FileViewer.cpp src/Common/Utils/src/PathUtils.cpp src/Conversation/ConvList/Controller/src/ComposeListItem.cpp src/Conversation/ConvList/Controller/src/DateLineItem.cpp src/Conversation/ConvList/View/src/BubbleItemContainer.cpp src/Common/AppControl/src/VoiceCall.cpp src/Common/View/src/Scroller.cpp src/Conversation/ConvList/Controller/src/BubbleVideoEntity.cpp src/Common/MsgEngine/src/MsgSettings.cpp src/Conversation/ContactList/Controller/src/ContactListItem.cpp src/Common/ContactManager/src/ContactVCardGenerator.cpp src/Viewer/View/src/SmilAudioItemView.cpp src/Common/Utils/src/LoggerImpl.cpp src/Conversation/ConvList/View/src/ConvSelectAll.cpp src/Common/ContactManager/src/ContactManager.cpp src/Conversation/Utils/src/AttachmentHandler.cpp src/Conversation/ConvList/View/src/ComposeListViewItem.cpp src/Common/MsgEngine/src/private/MsgAttachmentPrivate.cpp src/Common/View/src/ViewItem.cpp src/Conversation/AppControl/src/ContactPicker.cpp src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp src/Viewer/View/src/SubjectLayout.cpp src/Conversation/Main/View/src/MessageInputPanel.cpp src/Conversation/Recipients/View/src/ConvRecipientsPanelView.cpp src/Common/Controller/src/BaseController.cpp src/Conversation/AppControl/src/AttachPanel.cpp src/Settings/Controller/src/SettingsSound.cpp src/Conversation/ConvList/View/src/ConvListViewItem.cpp src/Common/AppControl/src/Share.cpp src/Conversation/Body/Controller/src/Body.cpp src/Common/View/src/StandardWindow.cpp src/Common/MsgEngine/src/MsgConversationItem.cpp src/Common/MsgEngine/src/private/MessageMmsPrivate.cpp src/Viewer/View/src/SmilAttachmentItemView.cpp src/MsgThread/Controller/src/ThreadSearchListItem.cpp src/Common/View/src/DefaultLayout.cpp src/Conversation/Recipients/Controller/src/ConvRecipientsPanel.cpp src/Conversation/ConvList/View/src/BubbleVideoViewItem.cpp src/Common/View/src/PopupListItem.cpp src/Conversation/ConvList/View/src/BubbleViewItem.cpp src/Viewer/View/src/SmilVideoItemView.cpp src/Common/Controller/src/NaviFrameController.cpp src/MsgThread/Controller/src/ThreadList.cpp src/Common/Utils/src/TextDecorator.cpp src/Common/MsgEngine/src/MsgStorage.cpp src/Common/View/src/SelectAllListItem.cpp src/Conversation/ConvList/View/src/BubbleDownloadButtonViewItem.cpp src/Common/AppControl/src/ContactViewer.cpp src/Common/View/src/Box.cpp src/Common/Utils/src/ThumbnailMaker.cpp src/Common/View/src/NaviFrameItem.cpp src/Common/View/src/PopupList.cpp src/MsgThread/View/src/FloatingButton.cpp src/MsgThread/Controller/src/MsgSearchListItem.cpp src/Common/Controller/src/App.cpp src/Conversation/ConvList/View/src/ConvListLayout.cpp src/Common/View/src/PopupAttachmentListItem.cpp src/Common/MsgEngine/src/private/MsgComposerPrivate.cpp src/Viewer/View/src/ViewerLayout.cpp src/Common/Utils/src/MediaUtils.cpp src/Common/Controller/src/MbeRecipients.cpp src/Settings/Controller/src/SimListViewItem.cpp src/Common/Utils/src/TimeUtils.cpp src/Common/MsgEngine/src/private/MsgSettingsPrivate.cpp src/Viewer/View/src/SmilPlayerView.cpp src/MainApp/main.cpp src/Conversation/ConvList/View/src/BubbleImageViewItem.cpp src/Common/View/src/NoContentLayout.cpp src/Common/SystemSettingsManager/src/SystemSettingsManager.cpp src/Common/MsgEngine/src/MsgPage.cpp src/Common/AppControl/src/ContactEditor.cpp src/Conversation/Main/View/src/ConversationLayout.cpp src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp src/Common/View/src/PopupManager.cpp src/Settings/View/src/SettingsListViewItem.cpp src/Common/MsgEngine/src/private/MsgStoragePrivate.cpp src/Conversation/ConvList/Controller/src/ConvListItem.cpp src/Conversation/ConvList/View/src/BubbleBgViewItem.cpp src/MsgThread/View/src/ThreadListViewItem.cpp src/Common/MsgEngine/src/private/MsgPagePrivate.cpp src/Common/AppControl/src/AppControlUtils.cpp src/Conversation/AppControl/src/LaunchSettings.cpp 
 
 # EDC Sources
 USER_EDCS =  
diff --git a/src/Common/AppControl/inc/FileShare.h b/src/Common/AppControl/inc/FileShare.h
deleted file mode 100644 (file)
index 9b29511..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef FileShare_h_
-#define FileShare_h_
-
-#include <list>
-#include <string>
-
-
-namespace Msg
-{
-    class FileShare
-    {
-        public:
-            static bool launch(const std::list<std::string> &files);
-
-            FileShare(const FileShare&) = delete;
-            FileShare& operator=(const FileShare&) = delete;
-    };
-}
-
-#endif /* FileShare_h_ */
index 42dbb89e36f8ae3e7ae477a1654ab4cc63a655db..b76a454dde0fa79f1a0781450a3c01506dd75033 100644 (file)
@@ -36,8 +36,6 @@ namespace Msg
             FileViewer(const FileViewer&) = delete;
             FileViewer& operator=(const FileViewer&) = delete;
 
-            std::string addFile(const std::string &path);
-
         private:
             std::string m_FilePath;
     };
diff --git a/src/Common/AppControl/inc/Share.h b/src/Common/AppControl/inc/Share.h
new file mode 100644 (file)
index 0000000..93c11b8
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef Share_h_
+#define Share_h_
+
+#include <list>
+#include <string>
+
+namespace Msg
+{
+    class Share
+    {
+        public:
+            static Share &getInst();
+
+            bool launch(const std::list<std::string> &files);
+            bool launch(const std::string &text);
+
+        private:
+            Share();
+            ~Share();
+            Share(const Share&) = delete;
+            Share& operator=(const Share&) = delete;
+
+            void removeFiles();
+            void addFiles(const std::list<std::string> &files);
+
+        private:
+            std::list<std::string> m_FileList;
+    };
+}
+
+#endif /* Share_h_ */
diff --git a/src/Common/AppControl/src/FileShare.cpp b/src/Common/AppControl/src/FileShare.cpp
deleted file mode 100644 (file)
index fa99427..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "FileShare.h"
-#include "AppControlUtils.h"
-#include "Logger.h"
-
-#include <app_control.h>
-#include <vector>
-
-using namespace Msg;
-
-
-bool FileShare::launch(const std::list<std::string> &files)
-{
-    if(files.empty())
-        return false;
-
-    bool res = false;
-    app_control_h svc_handle = nullptr;
-
-    if(APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
-    {
-        app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_MULTI_SHARE);
-        app_control_set_mime(svc_handle, "*/*");
-
-        app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
-
-        std::vector<const char*> paths;
-        for(const std::string &file : files)
-        {
-            if(!file.empty())
-                paths.push_back(file.c_str());
-        }
-
-        app_control_add_extra_data_array(svc_handle, APP_CONTROL_DATA_PATH, paths.data(), paths.size());
-
-        int ret = app_control_send_launch_request(svc_handle, nullptr, nullptr);
-        MSG_LOG("Result code: ", ret);
-        res = ret == APP_CONTROL_ERROR_NONE;
-        app_control_destroy(svc_handle);
-    }
-
-    return res;
-}
-
index ea100841d468d4fc985559d2edfcf8d39379b2d4..375b0c475515e28ae922e01a242111a963d3952f 100644 (file)
@@ -68,30 +68,6 @@ bool FileViewer::launch(const std::string &file)
     return res;
 }
 
-std::string FileViewer::addFile(const std::string &path)
-{
-    std::string newPath;
-
-    if(FileUtils::isExists(path))
-    {
-        std::string dataPath = PathUtils::getDataPath("");
-
-        if(path.find(dataPath) != std::string::npos)
-        {
-            newPath = path;
-            MSG_LOG("File is already exists: ", newPath);
-        }
-        else
-        {
-            newPath = FileUtils::genUniqueFilePath(dataPath, path);
-            if(!FileUtils::copy(path, newPath))
-                newPath.clear();
-        }
-    }
-
-    return newPath;
-}
-
 bool FileViewer::launchWithCopy(const std::string &file)
 {
     bool res = false;
@@ -99,7 +75,7 @@ bool FileViewer::launchWithCopy(const std::string &file)
     if(!m_FilePath.empty())
         FileUtils::remove(m_FilePath);
 
-    m_FilePath = addFile(file);
+    m_FilePath = FileUtils::addFileToDataDir(file);
     if(!m_FilePath.empty())
         res = launch(m_FilePath);
 
diff --git a/src/Common/AppControl/src/Share.cpp b/src/Common/AppControl/src/Share.cpp
new file mode 100644 (file)
index 0000000..830036b
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2009-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "AppControlUtils.h"
+#include "Logger.h"
+#include "Share.h"
+#include "FileUtils.h"
+
+#include <app_control.h>
+#include <vector>
+
+using namespace Msg;
+
+Share::Share()
+{
+
+}
+
+Share::~Share()
+{
+    removeFiles();
+}
+
+Share &Share::getInst()
+{
+    static Share inst;
+    return inst;
+}
+
+void Share::removeFiles()
+{
+    for(auto &&file : m_FileList)
+    {
+        FileUtils::remove(file);
+    }
+    m_FileList.clear();
+}
+
+void Share::addFiles(const std::list<std::string> &files)
+{
+    removeFiles();
+    for(auto &&file : files)
+    {
+        m_FileList.push_back(FileUtils::addFileToDataDir(file));
+    }
+}
+
+bool Share::launch(const std::list<std::string> &files)
+{
+    if(files.empty())
+        return false;
+
+    bool res = false;
+    app_control_h svc_handle = nullptr;
+
+    if(APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
+    {
+        addFiles(files);
+        app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_MULTI_SHARE);
+        app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
+
+        std::vector<const char*> nativePaths;
+        for(const std::string &file : m_FileList)
+        {
+            if(!file.empty())
+                nativePaths.push_back(file.c_str());
+        }
+
+        app_control_add_extra_data_array(svc_handle, APP_CONTROL_DATA_PATH, nativePaths.data(), nativePaths.size());
+        int ret = app_control_send_launch_request(svc_handle, nullptr, nullptr);
+        MSG_LOG("Result code: ", ret);
+        res = ret == APP_CONTROL_ERROR_NONE;
+        app_control_destroy(svc_handle);
+    }
+
+    return res;
+}
+
+bool Share::launch(const std::string &text)
+{
+    if(text.empty())
+        return false;
+
+    bool res = false;
+    app_control_h svc_handle = nullptr;
+
+    if(APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
+    {
+        app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_SHARE_TEXT);
+        app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_TEXT, text.c_str());
+        app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
+        int ret = app_control_send_launch_request(svc_handle, nullptr, nullptr);
+        MSG_LOG("Result code: ", ret);
+        res = ret == APP_CONTROL_ERROR_NONE;
+        app_control_destroy(svc_handle);
+    }
+
+    return res;
+}
+
index de2ea5944009b1e806d042debe230cb7ec59af0a..66197d6bc88cf511b20c49d7892c5c1653b2c790 100755 (executable)
@@ -48,6 +48,13 @@ namespace Msg
              */
             static bool copy(const std::string &src, const std::string &dst);
 
+            /**
+             * @brief Add file to data dir, if file not exists in data dir.
+             * @param[in] source file path
+             * @return new path in data dir
+             */
+            static std::string addFileToDataDir(const std::string &path);
+
             /**
              * @brief Make Directory.
              * @param[in] path to directory
index f2574dfac5116b341067ad4ca03d7883fe17f78d..6b723d83fe3e77895c546dc554752928b3e3d9c1 100755 (executable)
@@ -102,6 +102,28 @@ bool FileUtils::makeDir(const std::string &dir)
     return res;
 }
 
+std::string FileUtils::addFileToDataDir(const std::string &path)
+{
+    std::string newPath;
+    if(isExists(path))
+    {
+        std::string dataPath = PathUtils::getDataPath("");
+        if(path.find(dataPath) != std::string::npos)
+        {
+            newPath = path;
+            MSG_LOG("File is already exists: ", newPath);
+        }
+        else
+        {
+            newPath = FileUtils::genUniqueFilePath(dataPath, path);
+            if(!copy(path, newPath))
+                newPath.clear();
+        }
+    }
+
+    return newPath;
+}
+
 bool FileUtils::isDir(const std::string &file)
 {
     bool res = false;
index 3305e42b8f175d005e3fd816736f1d0d050f3777..e7e662b6abc7329451c22ac70e0ec926f5cca502 100644 (file)
@@ -50,6 +50,7 @@ namespace Msg
             Type getType() const;
             Message::Direction getDirection() const;
             const std::string &getFilePath() const;
+            void setFilePath(std::string file);
             long long getFileSize() const;
             virtual BubbleViewItem *createView(Evas_Object *parent) = 0;
 
@@ -87,6 +88,11 @@ namespace Msg
         return m_FilePath;
     }
 
+    inline void BubbleEntity::setFilePath(std::string file)
+    {
+        m_FilePath = std::move(file);
+    }
+
     inline long long BubbleEntity::getFileSize() const
     {
         return m_FileSize;
index 95e31a452d74064b10189d133bf6bfec33a7b29d..11c1d1242f939d65dddd39cac84d4665e79681fa 100644 (file)
@@ -88,14 +88,15 @@ namespace Msg
         private:
             ConvListViewItem::ConvItemType getConvItemType(const MsgConversationItem &item);
             void prepareBubble(const MsgConversationItem &item, const std::string &searchWord);
-            BubbleEntity *createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, const MsgConvMedia &media, std::string searchWord);
-            BubbleEntity *createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, std::string text, bool markup, std::string searchWord);
+            BubbleTextEntity *createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, const MsgConvMedia &media, std::string searchWord);
+            BubbleTextEntity *createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, std::string text, bool markup, std::string searchWord);
             void addEntity(BubbleEntity *entity);
             void updateEntityBgType(BubbleBgViewItem::BgType bgType);
             BubbleBgViewItem::BgType getBubbleBgType(const MsgConversationItem &item);
             void tryToDownloadMms(bool showToast = true);
             void updateDownloadButton();
             BubbleDownloadButtonEntity *findDownloadButton() const;
+            void shareContent();
 
             // Create Popup when message is clicked
             void showMainListPopup();
@@ -104,6 +105,7 @@ namespace Msg
             void onDeleteItemPressed(PopupListItem &item);
             void onCopyTextItemPressed(PopupListItem &item);
             void onForwardItemPressed(PopupListItem &item);
+            void onShareItemPressed(PopupListItem &item);
             void onResendItemPressed(PopupListItem &item);
             void onSlideShowItemPressed(PopupListItem &item);
             void onEditItemPressed(PopupListItem &item);
index 3dc569a235699f01f3b6c33e13af0843b87b91de..8b44778af55bbf22742421f9ecdbc3598f6ec88a 100644 (file)
@@ -27,6 +27,7 @@
 #include "MediaUtils.h"
 #include "FileViewer.h"
 #include "BubbleItemContainer.h"
+#include "Share.h"
 
 // Bubble items:
 #include "BubbleTextEntity.h"
@@ -147,14 +148,17 @@ BubbleBgViewItem::BgType ConvListItem::getBubbleBgType(const MsgConversationItem
     return type;
 }
 
-
-BubbleEntity *ConvListItem::createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, const MsgConvMedia &media, std::string searchWord)
+BubbleTextEntity *ConvListItem::createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, const MsgConvMedia &media, std::string searchWord)
 {
-    std::string text = FileUtils::readTextFile(media.getPath());
-    return createTextEntity(bgType, direction, std::move(text), true, std::move(searchWord));
+    std::string filePath = media.getPath();
+    std::string text = FileUtils::readTextFile(filePath);
+    BubbleTextEntity *entity = createTextEntity(bgType, direction, std::move(text), true, std::move(searchWord));
+    if(entity)
+        entity->setFilePath(std::move(filePath));
+    return entity;
 }
 
-BubbleEntity *ConvListItem::createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, std::string text, bool markup, std::string searchWord)
+BubbleTextEntity *ConvListItem::createTextEntity(BubbleBgViewItem::BgType bgType, Message::Direction direction, std::string text, bool markup, std::string searchWord)
 {
     bool found = false;
     std::string markupText = markup ? utf8ToMarkup(text) : std::move(text);
@@ -234,6 +238,25 @@ void ConvListItem::prepareBubble(const MsgConversationItem &item, const std::str
     }
 }
 
+void ConvListItem::shareContent()
+{
+    if(MsgUtils::isSms(m_Type))
+    {
+        Share::getInst().launch(getAllMsgText());
+    }
+    else
+    {
+        std::list<std::string> fileList;
+        for(BubbleEntity *entity : m_BubbleEntityList)
+        {
+            const std::string &filePath = entity->getFilePath();
+            if(!filePath.empty())
+                fileList.push_back(filePath);
+        }
+        Share::getInst().launch(fileList);
+    }
+}
+
 Evas_Object *ConvListItem::getBubbleContent()
 {
     auto *bubble = new BubbleItemContainer(*getOwner());
@@ -317,6 +340,7 @@ void ConvListItem::showMainListPopup()
         listPopup.appendItem(msg("IDS_MSG_OPT_COPY_TEXT"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onCopyTextItemPressed), this);
 
     listPopup.appendItem(msg("IDS_MSGF_OPT_FORWARD"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onForwardItemPressed), this);
+    listPopup.appendItem(msg("IDS_COM_BUTTON_SHARE"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onShareItemPressed), this);
 
     if(m_NetworkStatus == Message::NS_Send_Fail)
         listPopup.appendItem(msg("IDS_MSG_OPT_EDIT"), POPUPLIST_ITEM_PRESSED_CB(ConvListItem, onEditItemPressed), this);
@@ -438,6 +462,13 @@ void ConvListItem::onForwardItemPressed(PopupListItem &item)
         m_pListener->onForwardMsg(*this);
 }
 
+void ConvListItem::onShareItemPressed(PopupListItem &item)
+{
+    MSG_LOG("");
+    item.getParent().destroy();
+    shareContent();
+}
+
 void ConvListItem::onResendItemPressed(PopupListItem &item)
 {
     MSG_LOG("");