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 =
+++ /dev/null
-/*
- * 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_ */
FileViewer(const FileViewer&) = delete;
FileViewer& operator=(const FileViewer&) = delete;
- std::string addFile(const std::string &path);
-
private:
std::string m_FilePath;
};
--- /dev/null
+/*
+ * 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_ */
+++ /dev/null
-/*
- * 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;
-}
-
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;
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);
--- /dev/null
+/*
+ * 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;
+}
+
*/
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
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;
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;
return m_FilePath;
}
+ inline void BubbleEntity::setFilePath(std::string file)
+ {
+ m_FilePath = std::move(file);
+ }
+
inline long long BubbleEntity::getFileSize() const
{
return m_FileSize;
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();
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);
#include "MediaUtils.h"
#include "FileViewer.h"
#include "BubbleItemContainer.h"
+#include "Share.h"
// Bubble items:
#include "BubbleTextEntity.h"
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);
}
}
+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());
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);
m_pListener->onForwardMsg(*this);
}
+void ConvListItem::onShareItemPressed(PopupListItem &item)
+{
+ MSG_LOG("");
+ item.getParent().destroy();
+ shareContent();
+}
+
void ConvListItem::onResendItemPressed(PopupListItem &item)
{
MSG_LOG("");