@echo ' Building file: $$<'
@echo ' Invoking: $(3) Compiler'
$$(call MAKEDIRS,$$(@D))
- $(5) -c "$$<" -o "$$@" $(6) @$(7)
+ $(5) -c "$$<" -o "$$@" $(6) -Wp,@$(7)
@echo ' Finished building: $$<'
$(8) += $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),$(4))
endef
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/Common/Controller/src/SaveAttachmentsListItem.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/Common/Controller/src/SaveAttachments.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/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/Conversation/ConvList/Controller/src/MsgDetailsPopup.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
+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/Common/Controller/src/SaveAttachmentsListItem.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/Common/Controller/src/SaveAttachments.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/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/Conversation/ConvList/Controller/src/MsgDetailsPopup.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/Common/AppControl/src/AppControlLauncher.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/Conversation/AppControl/src/SettingsNetwork.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
# EDC Sources
USER_EDCS =
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 AppControlLauncher_h_
+#define AppControlLauncher_h_
+
+#include "AppControlUtils.h"
+
+#include <Ecore.h>
+
+namespace Msg
+{
+ class AppControlLauncher;
+ class AppControlHandle
+ {
+ friend class AppControlLauncher;
+
+ public:
+ AppControlHandle(app_control_launch_mode_e launchMode = APP_CONTROL_LAUNCH_MODE_GROUP);
+ virtual ~AppControlHandle();
+
+ /**
+ *@brief Terminate launch request related with this handle.
+ */
+ void terminate();
+
+ /**
+ *@brief Returns internal handle to app_control_h
+ */
+ operator app_control_h();
+
+ protected:
+ virtual void onReply(app_control_h request, app_control_h reply, app_control_result_e result) {};
+
+ AppControlHandle(const AppControlHandle&) = delete;
+ AppControlHandle& operator=(AppControlHandle) = delete;
+
+ protected:
+ app_control_h m_Handle;
+ };
+
+ class AppControlLauncher
+ {
+ friend class AppControlHandle;
+
+ public:
+ static AppControlLauncher &getInst();
+
+ /**
+ *@brief Launch application by AppControlHandle
+ *@param handle for launch
+ *@return true if launch is success, false otherwise
+ */
+ bool launch(AppControlHandle &handle);
+
+ /**
+ *@brief Terminate current launch request.
+ */
+ void terminate();
+
+ /**
+ *@brief Gets current launch status
+ *@return true if launch process in progress, false otherwise
+ */
+ bool isLaunchInProgress() const;
+
+ private:
+ AppControlLauncher();
+ ~AppControlLauncher();
+ AppControlLauncher(const AppControlLauncher&) = delete;
+ AppControlLauncher& operator=(const AppControlLauncher&) = delete;
+
+ void onReply(app_control_h request, app_control_h reply, app_control_result_e result);
+
+ private:
+ bool m_LaunchInProgress;
+ Ecore_Timer *m_pTimer;
+ AppControlHandle *m_pHandle;
+ };
+}
+
+#endif /* AppControlLauncher_h_ */
#ifndef ContactEditor_h_
#define ContactEditor_h_
+#include "AppControlLauncher.h"
+
#include <string>
-#include <app_control.h>
namespace Msg
{
*@brief An utility-class aimed to launch contacts-application with add-operation and edit-operation passed via app-control.
*/
class ContactEditor
+ : public AppControlHandle
{
public:
enum Operation
public:
ContactEditor();
- ~ContactEditor();
+ virtual ~ContactEditor();
/**
* @brief Launches add-operation.
* @return true in case of success, otherwise returns false.
*/
bool launch(const std::string &address, Operation operation);
-
- /**
- * @brief Set listener
- * @param[in] l listener
- */
- void setListener(IContactEditorListener *l);
-
private:
- ContactEditor(const ContactEditor&) = delete;
- ContactEditor& operator=(const ContactEditor&) = delete;
bool launch(const std::string &address, const char *operation, const char *addressType);
- void onResultCb(app_control_h request, app_control_h reply, app_control_result_e result);
- void terminate();
-
- private:
- IContactEditorListener *m_pListener;
- app_control_h m_Handle;
- };
-
- class IContactEditorListener
- {
- public:
- virtual ~IContactEditorListener() {}
- virtual void onContactCreated(ContactEditor &obj) {};
- virtual void onContactChanged(ContactEditor &obj) {};
};
}
#ifndef ContactViewer_h_
#define ContactViewer_h_
-#include "AppControlUtils.h"
+#include "AppControlLauncher.h"
#include "ContactAddress.h"
namespace Msg
*@brief An utility-class aimed to launch contacts-application with view-operation passed via app-control.
*/
class ContactViewer
+ : public AppControlHandle
{
public:
- static ContactViewer &getInst();
+ ContactViewer();
+ virtual ~ContactViewer();
/**
* @brief Launches view-operation.
bool launch(const ContactAddress &address);
private:
- ContactViewer();
- ~ContactViewer();
- ContactViewer(const ContactViewer&) = delete;
- ContactViewer& operator=(const ContactViewer&) = delete;
const char *toStr(ContactAddress::OwnerType type);
- void reset();
-
- private:
- app_control_h m_Handle;
};
}
#ifndef FileViewer_h_
#define FileViewer_h_
-#include "AppControlUtils.h"
+#include "AppControlLauncher.h"
namespace Msg
{
class FileViewer
+ : public AppControlHandle
{
public:
- static FileViewer &getInst();
+ FileViewer();
+ virtual ~FileViewer();
- static bool launch(const std::string &file);
+ bool launch(const std::string &file);
bool launchWithCopy(const std::string &file);
private:
- FileViewer();
- ~FileViewer();
- FileViewer(const FileViewer&) = delete;
- FileViewer& operator=(const FileViewer&) = delete;
-
- private:
std::string m_FilePath;
};
}
#ifndef Share_h_
#define Share_h_
+#include "AppControlLauncher.h"
+
#include <list>
#include <string>
namespace Msg
{
class Share
+ : public AppControlHandle
{
public:
- static Share &getInst();
+ Share();
+ virtual ~Share();
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);
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "AppControlLauncher.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+AppControlHandle::AppControlHandle(app_control_launch_mode_e launchMode)
+ : m_Handle()
+{
+ app_control_create(&m_Handle);
+ if (m_Handle)
+ app_control_set_launch_mode(m_Handle, launchMode);
+}
+
+AppControlHandle::~AppControlHandle()
+{
+ if (m_Handle)
+ {
+ terminate();
+ app_control_destroy(m_Handle);
+ }
+}
+
+AppControlHandle::operator app_control_h()
+{
+ return m_Handle;
+}
+
+void AppControlHandle::terminate()
+{
+ if (m_Handle && AppControlLauncher::getInst().m_pHandle == this)
+ AppControlLauncher::getInst().terminate();
+}
+
+AppControlLauncher::AppControlLauncher()
+ : m_LaunchInProgress(false)
+ , m_pTimer(nullptr)
+ , m_pHandle(nullptr)
+{
+}
+
+AppControlLauncher::~AppControlLauncher()
+{
+ if (m_pTimer)
+ ecore_timer_del(m_pTimer);
+}
+
+AppControlLauncher &AppControlLauncher::getInst()
+{
+ static AppControlLauncher inst;
+ return inst;
+}
+
+bool AppControlLauncher::launch(AppControlHandle &handle)
+{
+ if (isLaunchInProgress() || !handle)
+ return false;
+
+ terminate();
+ m_LaunchInProgress = true;
+ m_pHandle = &handle;
+ app_control_enable_app_started_result_event(handle);
+ int ret = app_control_send_launch_request(handle, APP_CONTROL_RES_CALLBACK(AppControlLauncher, onReply), this);
+ MSG_LOG("Launch result = ", ret);
+ m_LaunchInProgress = ret == 0;
+ if (ret != 0)
+ m_pHandle = nullptr;
+ return ret == 0;
+}
+
+bool AppControlLauncher::isLaunchInProgress() const
+{
+ return m_LaunchInProgress;
+}
+
+void AppControlLauncher::terminate()
+{
+ m_LaunchInProgress = false;
+ if (m_pHandle && m_pHandle->m_Handle)
+ app_control_send_terminate_request(*m_pHandle);
+ m_pHandle = nullptr;
+}
+
+void AppControlLauncher::onReply(app_control_h request, app_control_h reply, app_control_result_e result)
+{
+ MSG_LOG("Result = ", result);
+
+ if (m_pHandle)
+ m_pHandle->onReply(request, reply, result);
+
+ if (m_LaunchInProgress)
+ {
+ m_pTimer = ecore_timer_add(1.2, // Extra time for application startup.
+ [](void *data)->Eina_Bool
+ {
+ auto *self = (AppControlLauncher*)data;
+ self->m_LaunchInProgress = false;
+ self->m_pTimer = nullptr;
+ return false; // Delete timer.
+ },
+ this);
+ }
+}
+
+
}
ContactEditor::ContactEditor()
- : m_pListener(nullptr)
- , m_Handle()
{
+ app_control_set_mime(m_Handle, mimeContact);
}
ContactEditor::~ContactEditor()
terminate();
}
-void ContactEditor::setListener(IContactEditorListener *l)
-{
- m_pListener = l;
-}
-
bool ContactEditor::launch(const std::string &address, Operation operation)
{
bool res = false;
bool ContactEditor::launch(const std::string &address, const char *operation, const char *addressType)
{
- bool res = false;
- terminate();
- if (APP_CONTROL_ERROR_NONE == app_control_create(&m_Handle))
- {
- app_control_set_operation(m_Handle, operation);
- app_control_set_mime(m_Handle, mimeContact);
- app_control_add_extra_data(m_Handle, addressType, address.c_str());
- app_control_set_launch_mode(m_Handle, APP_CONTROL_LAUNCH_MODE_GROUP);
- int ret = app_control_send_launch_request(m_Handle, APP_CONTROL_RES_CALLBACK(ContactEditor, onResultCb), this);
- MSG_LOG("Result code: ", ret);
- res = ret == APP_CONTROL_ERROR_NONE;
- if (!res)
- terminate();
- }
-
- return res;
-}
-
-void ContactEditor::terminate()
-{
- if (m_Handle)
- {
- app_control_send_terminate_request(m_Handle);
- app_control_destroy(m_Handle);
- m_Handle = nullptr;
- }
-}
-
-void ContactEditor::onResultCb(app_control_h request, app_control_h reply, app_control_result_e result)
-{
- if (m_Handle)
- {
- if (result == APP_CONTROL_RESULT_SUCCEEDED && m_pListener)
- {
- char *op = nullptr;
- app_control_get_operation(m_Handle, &op);
-
- if (op)
- {
- terminate();
- if (strcmp(op, APP_CONTROL_OPERATION_EDIT) == 0)
- m_pListener->onContactChanged(*this);
- else if (strcmp(op, APP_CONTROL_OPERATION_ADD) == 0)
- m_pListener->onContactCreated(*this);
- free(op);
- }
- }
- terminate();
- }
+ app_control_set_operation(m_Handle, operation);
+ app_control_add_extra_data(m_Handle, addressType, address.c_str());
+ return AppControlLauncher::getInst().launch(*this);
}
}
ContactViewer::ContactViewer()
- : m_Handle()
{
+ app_control_set_operation(m_Handle, APP_CONTROL_OPERATION_VIEW);
+ app_control_set_mime(m_Handle, mimeContact);
}
ContactViewer::~ContactViewer()
{
- reset();
-}
-
-ContactViewer &ContactViewer::getInst()
-{
- static ContactViewer inst;
- return inst;
-}
-
-void ContactViewer::reset()
-{
- if (m_Handle)
- {
- app_control_send_terminate_request(m_Handle);
- app_control_destroy(m_Handle);
- m_Handle = nullptr;
- }
}
bool ContactViewer::launch(int id, ContactAddress::OwnerType ownerType)
{
- bool res = false;
-
- reset();
- if (APP_CONTROL_ERROR_NONE == app_control_create(&m_Handle))
- {
- app_control_set_operation(m_Handle, APP_CONTROL_OPERATION_VIEW);
- app_control_set_mime(m_Handle, mimeContact);
- app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_TYPE, toStr(ownerType));
- app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_ID, std::to_string(id).c_str());
- app_control_set_launch_mode(m_Handle, APP_CONTROL_LAUNCH_MODE_GROUP);
- int ret = app_control_send_launch_request(m_Handle, nullptr, nullptr);
- MSG_LOG("Result code: ", ret);
- res = ret == APP_CONTROL_ERROR_NONE;
- }
-
- return res;
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_TYPE, toStr(ownerType));
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_ID, std::to_string(id).c_str());
+ return AppControlLauncher::getInst().launch(*this);
}
bool ContactViewer::launch(const ContactAddress &address)
#include "FileUtils.h"
#include "PathUtils.h"
-#include <app_control.h>
-
using namespace Msg;
FileViewer::FileViewer()
{
+ app_control_set_operation(m_Handle, APP_CONTROL_OPERATION_VIEW);
}
FileViewer::~FileViewer()
FileUtils::remove(m_FilePath);
}
-FileViewer &FileViewer::getInst()
-{
- static FileViewer inst;
- return inst;
-}
-
bool FileViewer::launch(const std::string &file)
{
+ if (AppControlLauncher::getInst().isLaunchInProgress())
+ return false;
+
bool res = false;
- app_control_h svc_handle = nullptr;
std::string mime = FileUtils::getMimeType(file);
MSG_LOG("File path: ", file);
if (mime.empty() || file.empty())
return false;
- if (APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
+ if (m_Handle)
{
- app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_VIEW);
- app_control_set_mime(svc_handle, mime.c_str());
+ app_control_set_mime(m_Handle, mime.c_str());
std::string uri = "file://" + file;
- app_control_set_uri(svc_handle, uri.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);
+ app_control_set_uri(m_Handle, uri.c_str());
+ res = AppControlLauncher::getInst().launch(*this);
}
return res;
bool FileViewer::launchWithCopy(const std::string &file)
{
bool res = false;
- // Remove previous file (correct only for APP_CONTROL_LAUNCH_MODE_GROUP)
- if (!m_FilePath.empty())
- FileUtils::remove(m_FilePath);
- m_FilePath = FileUtils::addFileToDataDir(file);
- if (!m_FilePath.empty())
- res = launch(m_FilePath);
+ if (!AppControlLauncher::getInst().isLaunchInProgress())
+ {
+ // Remove previous file (correct only for APP_CONTROL_LAUNCH_MODE_GROUP)
+ if (!m_FilePath.empty())
+ FileUtils::remove(m_FilePath);
+ m_FilePath = FileUtils::addFileToDataDir(file);
+ if (!m_FilePath.empty())
+ {
+ FileUtils::saveFileToStorage(m_FilePath);
+ res = launch(m_FilePath);
+ }
+ }
return res;
}
removeFiles();
}
-Share &Share::getInst()
-{
- static Share inst;
- return inst;
-}
-
void Share::removeFiles()
{
for (auto &&file : m_FileList)
bool Share::launch(const std::list<std::string> &files)
{
- if (files.empty())
+ if (files.empty() || AppControlLauncher::getInst().isLaunchInProgress())
return false;
- bool res = false;
- app_control_h svc_handle = nullptr;
-
- if (APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
+ addFiles(files);
+ std::vector<const char*> nativePaths;
+ for (const std::string &file : m_FileList)
{
- 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);
+ if (!file.empty())
+ nativePaths.push_back(file.c_str());
}
- return res;
+ app_control_set_operation(m_Handle, APP_CONTROL_OPERATION_MULTI_SHARE);
+ app_control_add_extra_data_array(m_Handle, APP_CONTROL_DATA_PATH, nativePaths.data(), nativePaths.size());
+ return AppControlLauncher::getInst().launch(*this);
}
bool Share::launch(const std::string &text)
{
- if (text.empty())
+ if (text.empty() || AppControlLauncher::getInst().isLaunchInProgress())
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;
+ app_control_set_operation(m_Handle, APP_CONTROL_OPERATION_SHARE_TEXT);
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_TEXT, text.c_str());
+ return AppControlLauncher::getInst().launch(*this);
}
#include "Conversation.h"
#include "Logger.h"
#include "PopupManager.h"
+#include "AppControlLauncher.h"
#include <memory>
#include <notification.h>
{
if (prepare(*cmd))
{
+ AppControlLauncher::getInst().terminate();
AppControlDefault::DefaultType type = cmd->getDefaultType();
-
MsgThread *thread = getTopFrame<MsgThread>(); // Check if thread is open
if (!thread)
insertToBottom(*new MsgThread(*this)); // Push thread list to the bottom
- Conversation *conv = getTopFrame<Conversation>(); // Check if conversation is open
+ auto *conv = getTopFrame<Conversation>(); // Check if conversation is open
MessageRef msg = getMsgEngine().getStorage().getMessage(cmd->getMessageId()); //To avoid opening conversation if MsgId is invalid
if (type != AppControlDefault::MainType && msg != nullptr)
{
} else if (!conv) {
if (type == AppControlDefault::ViewType || type == AppControlDefault::ReplyType || isUnreadNotificationSingle(type))
{
- Conversation *conversation = new Conversation(*this);
+ auto *conversation = new Conversation(*this);
push(*conversation);
conversation->execCmd(cmd);
}
{
if (prepare(*cmd))
{
- Conversation *conv = getTopFrame<Conversation>();
+ AppControlLauncher::getInst().terminate();
+ auto *conv = getTopFrame<Conversation>();
if (conv)
{
promote(*conv);
#define ContactPicker_h_
#include "AppControlUtils.h"
+#include "AppControlLauncher.h"
namespace Msg
{
* @brief An utility-class aimed to launch contacts-application with pick-operation passed via app-control.
*/
class ContactPicker
+ : public AppControlHandle
{
public:
ContactPicker();
bool launch(size_t howManyToPick);
private:
- ContactPicker(const ContactPicker&) = delete;
- ContactPicker& operator=(const ContactPicker&) = delete;
- void onAppControlRes(app_control_h request, app_control_h reply, app_control_result_e result);
+ virtual void onReply(app_control_h request, app_control_h reply, app_control_result_e result);
private:
IContactPickerListener *m_pListener;
public:
virtual ~IContactPickerListener() {}
virtual void onContactsPicked(const std::list<ResultData> &numberIdList) {};
- virtual void onFinish() {};
};
}
* limitations under the License.
*/
-#include "LaunchSettings.h"
-#include <app.h>
+#ifndef _LAUNCH_SETTINGS_NETWORK_H_
+#define _LAUNCH_SETTINGS_NETWORK_H_
-using namespace Msg;
+#include "AppControlLauncher.h"
-void LaunchSettings::launch()
+namespace Msg
{
- app_control_h h;
- app_control_create(&h);
- app_control_set_app_id(h, "org.tizen.setting-network");
- app_control_send_launch_request(h, NULL, NULL);
- app_control_destroy(h);
+ class SettingsNetwork
+ : public AppControlHandle
+ {
+ public:
+ SettingsNetwork();
+ void launch();
+ };
}
+
+#endif /* _LAUNCH_SETTINGS_NETWORK_H_ */
ContactPicker::ContactPicker()
: m_pListener(nullptr)
{
+ app_control_set_operation(m_Handle, APP_CONTROL_OPERATION_PICK);
+ app_control_set_mime(m_Handle, mimeContact);
}
void ContactPicker::setListener(IContactPickerListener *pListener)
bool ContactPicker::launch(size_t howManyToPick)
{
bool res = false;
- app_control_h svc_handle = NULL;
-
- if (APP_CONTROL_ERROR_NONE == app_control_create(&svc_handle))
+ if (m_Handle)
{
- app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_PICK);
- app_control_set_mime(svc_handle, mimeContact);
if (howManyToPick > 1)
{
- app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_SELECTION_MODE, multiple);
- app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_TOTAL_COUNT, std::to_string(howManyToPick).c_str());
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_SELECTION_MODE, multiple);
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_TOTAL_COUNT, std::to_string(howManyToPick).c_str());
} else {
- app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_SELECTION_MODE, single);
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_SELECTION_MODE, single);
}
static const char *addressesTypes[] = {typePhone.c_str(), typeEmail.c_str()};
size_t len = sizeof(addressesTypes) / sizeof(addressesTypes[0]);
- app_control_add_extra_data_array(svc_handle, APP_CONTROL_DATA_TYPE, addressesTypes, len);
- app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);
- app_control_enable_app_started_result_event(svc_handle);
- int ret = app_control_send_launch_request(svc_handle, APP_CONTROL_RES_CALLBACK(ContactPicker, onAppControlRes), this);
- MSG_LOG("launching contacts, result-code: ", ret);
- res = (ret == APP_CONTROL_ERROR_NONE);
- app_control_destroy(svc_handle);
+ app_control_add_extra_data_array(m_Handle, APP_CONTROL_DATA_TYPE, addressesTypes, len);
+ res = AppControlLauncher::getInst().launch(*this);
}
return res;
}
-void ContactPicker::onAppControlRes(app_control_h request, app_control_h reply, app_control_result_e result)
+void ContactPicker::onReply(app_control_h request, app_control_h reply, app_control_result_e result)
{
- if (m_pListener)
- m_pListener->onFinish();
-
if (result == APP_CONTROL_RESULT_SUCCEEDED)
{
std::list<int> addressIds;
* limitations under the License.
*/
-#ifndef _LAUNCH_SETTINGS_H_
-#define _LAUNCH_SETTINGS_H_
-namespace Msg
+#include "SettingsNetwork.h"
+
+using namespace Msg;
+
+SettingsNetwork::SettingsNetwork()
{
- class LaunchSettings
- {
- public:
- static void launch();
- };
+ app_control_set_app_id(m_Handle, "org.tizen.setting-network");
}
-#endif /* _LAUNCH_SETTINGS_H_ */
+void SettingsNetwork::launch()
+{
+ AppControlLauncher::getInst().launch(*this);
+}
namespace Msg
{
class IComposeListItemListener;
+ class FileViewer;
typedef std::list<BubbleEntity*> BubbleEntityList;
class ComposeListItem
, private IBubbleViewItemListener
{
public:
- ComposeListItem(BubbleEntityFactory &entityFactory);
+ ComposeListItem(BubbleEntityFactory &entityFactory, FileViewer &fileViewer);
virtual ~ComposeListItem();
void clear(bool updateUi = true);
IComposeListItemListener *m_pListener;
std::list<BubbleEntity*> m_BubbleEntityList;
BubbleEntityFactory &m_BubbleEntityFactory;
+ FileViewer &m_FileViewer;
};
class IComposeListItemListener
#include "ContactManager.h"
#include "FileViewer.h"
#include "ComposeListItem.h"
+#include "FileViewer.h"
+#include "Share.h"
#include <unordered_map>
#include <unordered_set>
BubbleEntityFactory m_BubbleEntityFactory;
ComposeListItem *m_pComposeItem;
std::function<bool()> m_BodyFocusFunc;
+ FileViewer m_FileViewer;
+ Share m_Share;
};
class IConvListListener
#include "ContextPopup.h"
#include "App.h"
#include "MessageDetailContent.h"
-#include "FileViewer.h"
#include "MsgUtils.h"
#include "WorkingDir.h"
#include "BubbleViewItem.h"
{
class MsgConversationItem;
class IConvListItemListener;
+ class FileViewer;
+ class Share;
class ConvListItem
: public ConvListViewItem
* @brief Creates item for Conversation list
* @param[in] item MsgConversationItem model
* @param[in] app Main application
+ * @param[in] file viewer.
+ * @param[in] data share.
* @param[in] bubbleEntityFactory Bubble entity factory.
* @param[in] searchWord string for search in bubble
* @param[in] thumbId Reference to id of user thumbnail
*/
ConvListItem(const MsgConversationItem &item,
App &app,
+ FileViewer &fileViewer,
+ Share &share,
BubbleEntityFactory &bubbleEntityFactory,
const std::string &searchWord,
const ThumbId &thumbId = invalidThumbId);
private:
IConvListItemListener *m_pListener;
App &m_App;
+ FileViewer &m_FileViewer;
+ Share &m_Share;
WorkingDirRef m_WorkingDir;
MsgId m_MsgId;
bool m_IsDraft;
#include "BubbleUnknownFileEntity.h"
#include "BubbleCalEventEntity.h"
#include "BubbleContactEntity.h"
+#include "FileViewer.h"
#include <algorithm>
using namespace Msg;
-ComposeListItem::ComposeListItem(BubbleEntityFactory &entityFactory)
+ComposeListItem::ComposeListItem(BubbleEntityFactory &entityFactory, FileViewer &fileViewer)
: m_pListener(nullptr)
, m_BubbleEntityFactory(entityFactory)
+ , m_FileViewer(fileViewer)
{
}
void ComposeListItem::onAction(BubbleViewItem &item)
{
- FileViewer::launch(item.getEntity().getFilePath());
+ m_FileViewer.launch(item.getEntity().getFilePath());
}
void ComposeListItem::onDelClicked(BubbleViewItem &item)
void ConvList::insertItem(const MsgConversationItem &item)
{
if (item.getDirection() == Message::MD_Received)
- insertItem(new ConvListItem(item, m_App, m_BubbleEntityFactory, m_SearchWord, m_RecipThumbId));
+ insertItem(new ConvListItem(item, m_App, m_FileViewer, m_Share, m_BubbleEntityFactory, m_SearchWord, m_RecipThumbId));
else
- insertItem(new ConvListItem(item, m_App, m_BubbleEntityFactory, m_SearchWord));
+ insertItem(new ConvListItem(item, m_App, m_FileViewer, m_Share, m_BubbleEntityFactory, m_SearchWord));
}
void ConvList::insertItem(ConvListItem *item)
{
if (!m_pComposeItem)
{
- m_pComposeItem = new ComposeListItem(m_BubbleEntityFactory);
+ m_pComposeItem = new ComposeListItem(m_BubbleEntityFactory, m_FileViewer);
m_pList->appendItem(*m_pComposeItem);
m_pComposeItem->show(false);
}
ConvListItem::ConvListItem(const MsgConversationItem &item,
App &app,
+ FileViewer &fileViewer,
+ Share &share,
BubbleEntityFactory &bubbleEntityFactory,
const std::string &searchWord,
const ThumbId &thumbId)
: ConvListViewItem(getConvItemType(item))
, m_pListener(nullptr)
, m_App(app)
+ , m_FileViewer(fileViewer)
+ , m_Share(share)
, m_MsgId(item.getMsgId())
, m_IsDraft(item.isDraft())
, m_Direction(item.getDirection())
{
if (MsgUtils::isSms(m_Type))
{
- Share::getInst().launch(getAllMsgText());
+ m_Share.launch(getAllMsgText());
} else {
std::list<std::string> fileList;
for (BubbleEntity *entity : m_BubbleEntityList)
if (!filePath.empty())
fileList.push_back(filePath);
}
- Share::getInst().launch(fileList);
+ m_Share.launch(fileList);
}
}
{
const std::string &filePath = item.getEntity().getFilePath();
if (!filePath.empty())
- FileViewer::getInst().launchWithCopy(filePath);
+ m_FileViewer.launchWithCopy(filePath);
break;
}
}
#include "SystemSettingsManager.h"
#include "WorkingDir.h"
#include "MsgReport.h"
+#include "ContactViewer.h"
+#include "SettingsNetwork.h"
#include <functional>
AttachPanel m_AttachPanel;
DefferedCmd m_DefferedCmd;
ContactEditor m_ContactEditor;
+ ContactViewer m_ContactViewer;
+ SettingsNetwork m_SettingsNetwork;
IConversationListener *m_pListener;
std::function<void()> m_TransFinishedFunc;
};
#include "VoiceCall.h"
#include "Viewer.h"
#include "PopupRecipientListItem.h"
-#include "LaunchSettings.h"
-#include <Elementary.h>
+#include "SaveAttachments.h"
+
#include <sstream>
#include <notification.h>
-#include <SaveAttachments.h>
using namespace Msg;
} else if (m_Mode == ConversationMode) {
if (m_pRecipPanel)
m_pRecipPanel->unselectMbeItem();
- ContactViewer::getInst().launch(*contactAddress);
+ m_ContactViewer.launch(*contactAddress);
}
} else {
showUnsavedRecipientPopup(address);
void Conversation::onMsgSettingsButtonClicked(Popup &popup, int buttonId)
{
MSG_LOG("");
- LaunchSettings::launch();
+ m_SettingsNetwork.launch();
popup.destroy();
}
int id = static_cast<PopupPersonIdListItem&>(item).getContactId();
auto ownerType = static_cast<PopupPersonIdListItem&>(item).getContactOwnerType();
item.getParent().destroy();
- ContactViewer::getInst().launch(id, ownerType);
+ m_ContactViewer.launch(id, ownerType);
}
void Conversation::onAllConvItemsDeleted(ConvList &list)
// IContactPickerListener
virtual void onContactsPicked(const std::list<ResultData> &addressIdList);
- virtual void onFinish();
// IContactManagerListener:
virtual void onContactChanged();
MSG_LOG("");
int currentRecipientsCount = getItemsCount();
if (currentRecipientsCount < getMaxRecipientCount())
- {
- setButtonEnabled(ContactButton, false);
m_Picker.launch(getMaxRecipientCount() - currentRecipientsCount);
- }
else
showTooManyRecipientsNotif();
}
setEntryFocus(true);
}
-void ConvRecipientsPanel::onFinish()
-{
- MSG_LOG("");
- setButtonEnabled(ContactButton, true);
-}
-
void ConvRecipientsPanel::onPopupBtnClicked(Popup &popup, int buttonId)
{
popup.destroy();
#include "SettingsListItem.h"
#include "MsgSettings.h"
#include "SystemSettingsManager.h"
+#include "SettingsSound.h"
namespace Msg
{
SettingsListItem *m_pReadReportItem;
SettingsListItem *m_pAutoRetItem;
SettingsListItem *m_pAutoRetRoamingItem;
+ SettingsSound m_SoundPicker;
};
}
#ifndef SETTINGSSOUND_H_
#define SETTINGSSOUND_H_
+#include "AppControlLauncher.h"
+
namespace Msg
{
class MsgSettings;
* @brief This class is aimed to launch preinstalled utility from settings-app that allows to chose message-alert sound.
*/
class SettingsSound
+ : public AppControlHandle
{
public:
/**
* @param[in] settingsHandle an instance of message-settings api wrapper.
*/
SettingsSound(MsgSettings &settingsHandle);
- ~SettingsSound();
+ virtual ~SettingsSound();
/**
* @brief launches preinstalled sound-picker utility via app-control.
*/
- void launchSoundPicker();
+ bool launch();
private:
- SettingsSound(SettingsSound&) = delete;
- SettingsSound& operator=(SettingsSound&) = delete;
+ virtual void onReply(app_control_h request, app_control_h reply, app_control_result_e result);
private:
MsgSettings &m_SettingsHandle;
*/
#include "Settings.h"
-#include "SettingsSound.h"
#include "Config.h"
#include "MsgEngine.h"
#include "Logger.h"
, m_pReadReportItem(nullptr)
, m_pAutoRetItem(nullptr)
, m_pAutoRetRoamingItem(nullptr)
+ , m_SoundPicker(getMsgEngine().getSettings())
{
create();
}
void Settings::soundItemHandler(SettingsListItem &item)
{
MSG_LOG("soundItemHandler activated!");
- SettingsSound picker(getMsgSettings());
- picker.launchSoundPicker();
+ m_SoundPicker.launch();
}
void Settings::vibrationItemHandler(SettingsListItem &item)
namespace
{
const char *sRingtoneValuePath = "/opt/share/settings/Alerts";
- const char *sRingtoneKeySelectType = "select_type";
const char *sRingtoneKeyFileType = "file_type";
const char *sRingtoneValueSound = "SOUND";
const char *sRingtoneKeySilent = "silent";
SettingsSound::SettingsSound(MsgSettings &settingsHandle)
: m_SettingsHandle(settingsHandle)
{
+ app_control_set_app_id(m_Handle, sRingtoneAppId);
+ app_control_add_extra_data(m_Handle, APP_CONTROL_DATA_PATH, sRingtoneValuePath);
+ app_control_add_extra_data(m_Handle, sRingtoneKeyDomain, PACKAGE_NAME);
+ app_control_add_extra_data(m_Handle, sRingtoneKeyFileType, sRingtoneValueSound);
+ app_control_add_extra_data(m_Handle, sRingtoneKeySilent, sRingtoneValueSilentShow);
+ app_control_add_extra_data(m_Handle, sRingtoneKeyDefault, sRingtoneValueDefaultShow);
+ app_control_add_extra_data(m_Handle, sRingtoneKeyDrmType, sRingtoneValueDrmAll);
+ app_control_add_extra_data(m_Handle, sRingtoneKeyTitle, msg("IDS_MSG_HEADER_MESSAGE_TONE_ABB").get());
}
SettingsSound::~SettingsSound()
{
}
-static void soundPickerCb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+void SettingsSound::onReply(app_control_h request, app_control_h reply, app_control_result_e result)
{
char **ringtones = nullptr;
int count = 0;
return;
char *ringtone = ringtones[0];
- auto *settings = static_cast<MsgSettings*>(user_data);
if (strcmp(ringtone, sRingtoneKeySilent) == 0)
- settings->setRingtoneType(MsgSettings::SilentRingtone);
+ m_SettingsHandle.setRingtoneType(MsgSettings::SilentRingtone);
else if (strcmp(ringtone, sRingtoneKeyDefault) == 0)
- settings->setRingtoneType(MsgSettings::DefaultRingtone);
+ m_SettingsHandle.setRingtoneType(MsgSettings::DefaultRingtone);
else
{
- settings->setRingtoneType(MsgSettings::UserRingtone);
- settings->setRingtone(ringtone);
+ m_SettingsHandle.setRingtoneType(MsgSettings::UserRingtone);
+ m_SettingsHandle.setRingtone(ringtone);
}
for (int i = 0; i < count; ++i) {
free(ringtones);
}
-void SettingsSound::launchSoundPicker()
+bool SettingsSound::launch()
{
- app_control_h h;
- app_control_create(&h);
- app_control_set_launch_mode(h, APP_CONTROL_LAUNCH_MODE_GROUP);
-
- app_control_add_extra_data(h, APP_CONTROL_DATA_PATH, sRingtoneValuePath);
- app_control_add_extra_data(h, sRingtoneKeyDomain, PACKAGE_NAME);
- app_control_add_extra_data(h, sRingtoneKeyFileType, sRingtoneValueSound);
- app_control_add_extra_data(h, sRingtoneKeySilent, sRingtoneValueSilentShow);
- app_control_add_extra_data(h, sRingtoneKeyDefault, sRingtoneValueDefaultShow);
- app_control_add_extra_data(h, sRingtoneKeyDrmType, sRingtoneValueDrmAll);
- app_control_add_extra_data(h, sRingtoneKeyTitle, msg("IDS_MSG_HEADER_MESSAGE_TONE_ABB").get());
-
std::string selectedData;
if (m_SettingsHandle.getRingtoneType() == MsgSettings::SilentRingtone)
- selectedData = sRingtoneKeySilent;
+ selectedData = sRingtoneKeySilent;
else if (m_SettingsHandle.getRingtoneType() == MsgSettings::DefaultRingtone)
- selectedData = sRingtoneKeyDefault;
+ selectedData = sRingtoneKeyDefault;
else if (m_SettingsHandle.getRingtoneType() == MsgSettings::UserRingtone)
- selectedData = m_SettingsHandle.getRingtone();
+ selectedData = m_SettingsHandle.getRingtone();
const char *selectedDataArray[] = {selectedData.c_str()};
- app_control_add_extra_data_array(h, APP_CONTROL_DATA_SELECTED, selectedDataArray, 1);
-
- app_control_set_app_id(h, sRingtoneAppId);
- app_control_send_launch_request(h, soundPickerCb, &m_SettingsHandle);
+ app_control_add_extra_data_array(m_Handle, APP_CONTROL_DATA_SELECTED, selectedDataArray, 1);
- app_control_destroy(h);
+ return AppControlLauncher::getInst().launch(*this);
}
namespace Msg
{
class SmilImageItemView;
+ class FileViewer;
class SmilPage
: public SmilPageLayout
, private ISmilAttachmentItemViewListener
{
public:
- SmilPage(Evas_Object *parent, const MsgPage &page);
- SmilPage(Evas_Object *parent, const MsgAttachmentList &list);
+ SmilPage(Evas_Object *parent, FileViewer &fileViewer, const MsgPage &page);
+ SmilPage(Evas_Object *parent, FileViewer &fileViewer, const MsgAttachmentList &list);
virtual ~SmilPage();
int getDuration() const;
SmilImageItemView *m_pImageItem;
std::list<std::string> m_Attachments;
bool m_HasInvalidFiles;
+ FileViewer &m_FileViewer;
};
}
#include "MessageMms.h"
#include "SmilPage.h"
#include "MediaPlayer.h"
+#include "FileViewer.h"
#include <Ecore.h>
#include <vector>
int m_Duration;
State m_State;
int m_PageTickCounter;
+ FileViewer m_FileViewer;
};
class ISmilPlayerListener
#include "SubjectLayout.h"
#include "SystemSettingsManager.h"
#include "MsgStorage.h"
+#include "ContactViewer.h"
namespace Msg
{
ContactEditor m_ContactEditor;
SmilPlayer *m_pSmilPlayer;
SubjectLayout *m_pSubjectLayout;
+ ContactViewer m_ContactViewer;
};
}
#include "PathUtils.h"
#include "MediaPlayer.h"
#include "MediaUtils.h"
+#include "FileViewer.h"
+
#include <notification.h>
using namespace Msg;
const int defaultPageDuration = 5; // sec;
-SmilPage::SmilPage(Evas_Object *parent, const MsgPage &page)
+SmilPage::SmilPage(Evas_Object *parent, FileViewer &fileViewer, const MsgPage &page)
: SmilPageLayout(parent)
, m_Duration(0)
, m_pVideoSink(nullptr)
, m_HasAudio(false)
, m_pImageItem(nullptr)
, m_HasInvalidFiles(false)
+ , m_FileViewer(fileViewer)
{
build(page);
}
-SmilPage::SmilPage(Evas_Object *parent, const MsgAttachmentList &list)
+SmilPage::SmilPage(Evas_Object *parent, FileViewer &fileViewer, const MsgAttachmentList &list)
: SmilPageLayout(parent)
, m_Duration(0)
, m_pVideoSink(nullptr)
, m_HasAudio(false)
, m_pImageItem(nullptr)
, m_HasInvalidFiles(false)
+ , m_FileViewer(fileViewer)
{
build(list);
}
void SmilPage::onItemClicked(SmilAttachmentItemView &item)
{
MSG_LOG("");
- FileViewer::getInst().launchWithCopy(item.getFilePath());
+ m_FileViewer.launchWithCopy(item.getFilePath());
}
void SmilPage::onSaveButtonClicked(SmilAttachmentItemView &item)
const MsgPage &page = pages[i];
if (!SmilPage::isEmpty(page))
{
- SmilPage *smilPage = new SmilPage(getEo(), page);
+ SmilPage *smilPage = new SmilPage(getEo(), m_FileViewer, page);
m_Duration += smilPage->getDuration();
m_PageList.push_back(smilPage);
}
// Attachment:
if (!mms.getAttachmentList().isEmpty())
{
- SmilPage *smilPage = new SmilPage(getEo(), mms.getAttachmentList());
+ SmilPage *smilPage = new SmilPage(getEo(), m_FileViewer, mms.getAttachmentList());
m_Duration += smilPage->getDuration();
m_PageList.push_back(smilPage);
}
m_SelectedAddress = address;
ContactAddressRef contactAddress = getApp().getContactManager().getContactAddress(address);
if (contactAddress)
- ContactViewer::getInst().launch(*contactAddress);
+ m_ContactViewer.launch(*contactAddress);
else
showRecipPopup(address);
}
{
MSG_LOG("");
item.getParent().destroy();
- VoiceCall::launch(m_SelectedAddress);
+ VoiceCall::launch(m_SelectedAddress);
}
void Viewer::onCreateContactItemPressed(PopupListItem &item)