TizenRefApp-7785 Implement general mechanism of app-control events handling 69/102869/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Tue, 6 Dec 2016 15:06:06 +0000 (17:06 +0200)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 7 Dec 2016 09:11:53 +0000 (11:11 +0200)
Change-Id: I58bdcae50f14ca6b9dae40294bed32aa90b2ba07
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
37 files changed:
Build/build_c.mk
project_def.prop
src/Common/AppControl/inc/AppControlLauncher.h [new file with mode: 0644]
src/Common/AppControl/inc/ContactEditor.h
src/Common/AppControl/inc/ContactViewer.h
src/Common/AppControl/inc/FileViewer.h
src/Common/AppControl/inc/Share.h
src/Common/AppControl/src/AppControlLauncher.cpp [new file with mode: 0644]
src/Common/AppControl/src/ContactEditor.cpp
src/Common/AppControl/src/ContactViewer.cpp
src/Common/AppControl/src/FileViewer.cpp
src/Common/AppControl/src/Share.cpp
src/Common/Controller/src/NaviFrameController.cpp
src/Conversation/AppControl/inc/ContactPicker.h
src/Conversation/AppControl/inc/SettingsNetwork.h [moved from src/Conversation/AppControl/src/LaunchSettings.cpp with 66% similarity]
src/Conversation/AppControl/src/ContactPicker.cpp
src/Conversation/AppControl/src/SettingsNetwork.cpp [moved from src/Conversation/AppControl/inc/LaunchSettings.h with 71% similarity]
src/Conversation/ConvList/Controller/inc/ComposeListItem.h
src/Conversation/ConvList/Controller/inc/ConvList.h
src/Conversation/ConvList/Controller/inc/ConvListItem.h
src/Conversation/ConvList/Controller/src/ComposeListItem.cpp
src/Conversation/ConvList/Controller/src/ConvList.cpp
src/Conversation/ConvList/Controller/src/ConvListItem.cpp
src/Conversation/Main/Controller/inc/Conversation.h
src/Conversation/Main/Controller/src/Conversation.cpp
src/Conversation/Recipients/Controller/inc/ConvRecipientsPanel.h
src/Conversation/Recipients/Controller/src/ConvRecipientsPanel.cpp
src/Settings/Controller/inc/Settings.h
src/Settings/Controller/inc/SettingsSound.h
src/Settings/Controller/src/Settings.cpp
src/Settings/Controller/src/SettingsSound.cpp
src/Viewer/Controller/inc/SmilPage.h
src/Viewer/Controller/inc/SmilPlayer.h
src/Viewer/Controller/inc/Viewer.h
src/Viewer/Controller/src/SmilPage.cpp
src/Viewer/Controller/src/SmilPlayer.cpp
src/Viewer/Controller/src/Viewer.cpp

index 81940cd..d818ab6 100644 (file)
@@ -31,7 +31,7 @@ $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),$(4)) : $(call DECODE_4MAKE,$(1)) $(7)
        @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
index 8cc37d0..6e64a2d 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/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 =  
diff --git a/src/Common/AppControl/inc/AppControlLauncher.h b/src/Common/AppControl/inc/AppControlLauncher.h
new file mode 100644 (file)
index 0000000..a87f5a7
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * 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_ */
index a5c0dc9..51e7612 100644 (file)
@@ -17,8 +17,9 @@
 #ifndef ContactEditor_h_
 #define ContactEditor_h_
 
+#include "AppControlLauncher.h"
+
 #include <string>
-#include <app_control.h>
 
 namespace Msg
 {
@@ -28,6 +29,7 @@ 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
@@ -38,7 +40,7 @@ namespace Msg
 
         public:
             ContactEditor();
-            ~ContactEditor();
+            virtual ~ContactEditor();
 
             /**
              * @brief Launches add-operation.
@@ -46,31 +48,8 @@ namespace Msg
              * @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) {};
     };
 }
 
index 9dcbf63..08947ba 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef ContactViewer_h_
 #define ContactViewer_h_
 
-#include "AppControlUtils.h"
+#include "AppControlLauncher.h"
 #include "ContactAddress.h"
 
 namespace Msg
@@ -26,9 +26,11 @@ 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.
@@ -46,15 +48,7 @@ namespace Msg
             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;
     };
 }
 
index a501779..868502f 100644 (file)
 #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;
     };
 }
index ca33525..2f08612 100644 (file)
 #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);
 
diff --git a/src/Common/AppControl/src/AppControlLauncher.cpp b/src/Common/AppControl/src/AppControlLauncher.cpp
new file mode 100644 (file)
index 0000000..26313d6
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * 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);
+    }
+}
+
+
index 9317832..374bb02 100644 (file)
@@ -27,9 +27,8 @@ namespace
 }
 
 ContactEditor::ContactEditor()
-    : m_pListener(nullptr)
-    , m_Handle()
 {
+    app_control_set_mime(m_Handle, mimeContact);
 }
 
 ContactEditor::~ContactEditor()
@@ -37,11 +36,6 @@ ContactEditor::~ContactEditor()
     terminate();
 }
 
-void ContactEditor::setListener(IContactEditorListener *l)
-{
-    m_pListener = l;
-}
-
 bool ContactEditor::launch(const std::string &address, Operation operation)
 {
     bool res = false;
@@ -66,53 +60,7 @@ bool ContactEditor::launch(const std::string &address, Operation operation)
 
 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);
 }
index 9be1f16..40d41f2 100644 (file)
@@ -30,49 +30,20 @@ namespace
 }
 
 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)
index 0309fac..a24f2a2 100644 (file)
 #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()
@@ -33,16 +32,12 @@ 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);
@@ -51,17 +46,12 @@ bool FileViewer::launch(const std::string &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;
@@ -70,14 +60,20 @@ bool FileViewer::launch(const std::string &file)
 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;
 }
 
index fda98aa..4385add 100644 (file)
@@ -33,12 +33,6 @@ Share::~Share()
     removeFiles();
 }
 
-Share &Share::getInst()
-{
-    static Share inst;
-    return inst;
-}
-
 void Share::removeFiles()
 {
     for (auto &&file : m_FileList)
@@ -59,54 +53,29 @@ void Share::addFiles(const std::list<std::string> &files)
 
 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);
 }
 
index 565ca2b..37be247 100644 (file)
@@ -21,6 +21,7 @@
 #include "Conversation.h"
 #include "Logger.h"
 #include "PopupManager.h"
+#include "AppControlLauncher.h"
 
 #include <memory>
 #include <notification.h>
@@ -72,13 +73,13 @@ void NaviFrameController::execCmd(const AppControlDefaultRef &cmd)
 {
     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)
         {
@@ -89,7 +90,7 @@ void NaviFrameController::execCmd(const AppControlDefaultRef &cmd)
             } 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);
                 }
@@ -102,7 +103,8 @@ void NaviFrameController::execCmd(const AppControlComposeRef &cmd)
 {
     if (prepare(*cmd))
     {
-        Conversation *conv = getTopFrame<Conversation>();
+        AppControlLauncher::getInst().terminate();
+        auto *conv = getTopFrame<Conversation>();
         if (conv)
         {
             promote(*conv);
index 0ea346d..643db17 100644 (file)
@@ -18,6 +18,7 @@
 #define ContactPicker_h_
 
 #include "AppControlUtils.h"
+#include "AppControlLauncher.h"
 
 namespace Msg
 {
@@ -27,6 +28,7 @@ namespace Msg
      * @brief An utility-class aimed to launch contacts-application with pick-operation passed via app-control.
      */
     class ContactPicker
+        : public AppControlHandle
     {
         public:
             ContactPicker();
@@ -44,9 +46,7 @@ namespace Msg
             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;
@@ -69,7 +69,6 @@ namespace Msg
         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_ */
index f5cf201..aee6357 100644 (file)
@@ -31,6 +31,8 @@ namespace
 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)
@@ -41,39 +43,27 @@ 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);
+}
index 4ec7634..ba1e942 100644 (file)
@@ -25,6 +25,7 @@
 namespace Msg
 {
     class IComposeListItemListener;
+    class FileViewer;
     typedef std::list<BubbleEntity*> BubbleEntityList;
 
     class ComposeListItem
@@ -32,7 +33,7 @@ namespace Msg
         , private IBubbleViewItemListener
     {
         public:
-            ComposeListItem(BubbleEntityFactory &entityFactory);
+            ComposeListItem(BubbleEntityFactory &entityFactory, FileViewer &fileViewer);
             virtual ~ComposeListItem();
 
             void clear(bool updateUi = true);
@@ -56,6 +57,7 @@ namespace Msg
             IComposeListItemListener *m_pListener;
             std::list<BubbleEntity*> m_BubbleEntityList;
             BubbleEntityFactory &m_BubbleEntityFactory;
+            FileViewer &m_FileViewer;
     };
 
     class IComposeListItemListener
index 964bcb8..cbcbce8 100644 (file)
@@ -26,6 +26,8 @@
 #include "ContactManager.h"
 #include "FileViewer.h"
 #include "ComposeListItem.h"
+#include "FileViewer.h"
+#include "Share.h"
 
 #include <unordered_map>
 #include <unordered_set>
@@ -207,6 +209,8 @@ namespace Msg
             BubbleEntityFactory m_BubbleEntityFactory;
             ComposeListItem *m_pComposeItem;
             std::function<bool()> m_BodyFocusFunc;
+            FileViewer m_FileViewer;
+            Share m_Share;
     };
 
     class IConvListListener
index 13b4086..3b6ae51 100644 (file)
@@ -24,7 +24,6 @@
 #include "ContextPopup.h"
 #include "App.h"
 #include "MessageDetailContent.h"
-#include "FileViewer.h"
 #include "MsgUtils.h"
 #include "WorkingDir.h"
 #include "BubbleViewItem.h"
@@ -36,6 +35,8 @@ namespace Msg
 {
     class MsgConversationItem;
     class IConvListItemListener;
+    class FileViewer;
+    class Share;
 
     class ConvListItem
         : public ConvListViewItem
@@ -46,12 +47,16 @@ namespace Msg
              * @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);
@@ -127,6 +132,8 @@ namespace Msg
         private:
             IConvListItemListener *m_pListener;
             App &m_App;
+            FileViewer &m_FileViewer;
+            Share &m_Share;
             WorkingDirRef m_WorkingDir;
             MsgId m_MsgId;
             bool m_IsDraft;
index 3f67643..2875b62 100644 (file)
 #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)
 {
 }
 
@@ -136,7 +138,7 @@ void ComposeListItem::deleteEntity(BubbleEntity &entity)
 
 void ComposeListItem::onAction(BubbleViewItem &item)
 {
-    FileViewer::launch(item.getEntity().getFilePath());
+    m_FileViewer.launch(item.getEntity().getFilePath());
 }
 
 void ComposeListItem::onDelClicked(BubbleViewItem &item)
index a6a88bb..7b713cd 100644 (file)
@@ -211,9 +211,9 @@ ConvListItem *ConvList::getItem(MsgId msgId) const
 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)
@@ -363,7 +363,7 @@ ComposeListItem &ConvList::getComposeItem()
 {
     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);
     }
index d5f9a18..1cc3610 100644 (file)
@@ -45,12 +45,16 @@ using namespace Msg;
 
 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())
@@ -239,7 +243,7 @@ void ConvListItem::shareContent()
 {
     if (MsgUtils::isSms(m_Type))
     {
-        Share::getInst().launch(getAllMsgText());
+        m_Share.launch(getAllMsgText());
     } else {
         std::list<std::string> fileList;
         for (BubbleEntity *entity : m_BubbleEntityList)
@@ -248,7 +252,7 @@ void ConvListItem::shareContent()
             if (!filePath.empty())
                 fileList.push_back(filePath);
         }
-        Share::getInst().launch(fileList);
+        m_Share.launch(fileList);
     }
 }
 
@@ -447,7 +451,7 @@ void ConvListItem::onAction(BubbleViewItem &item)
         {
             const std::string &filePath = item.getEntity().getFilePath();
             if (!filePath.empty())
-                FileViewer::getInst().launchWithCopy(filePath);
+                m_FileViewer.launchWithCopy(filePath);
             break;
         }
     }
index 6a2a344..a911c65 100644 (file)
@@ -36,6 +36,8 @@
 #include "SystemSettingsManager.h"
 #include "WorkingDir.h"
 #include "MsgReport.h"
+#include "ContactViewer.h"
+#include "SettingsNetwork.h"
 
 #include <functional>
 
@@ -227,6 +229,8 @@ namespace Msg
             AttachPanel m_AttachPanel;
             DefferedCmd m_DefferedCmd;
             ContactEditor m_ContactEditor;
+            ContactViewer m_ContactViewer;
+            SettingsNetwork m_SettingsNetwork;
             IConversationListener *m_pListener;
             std::function<void()> m_TransFinishedFunc;
     };
index b091850..e957031 100644 (file)
 #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;
 
@@ -197,7 +196,7 @@ void Conversation::recipientClickHandler(const std::string &address)
         } else if (m_Mode == ConversationMode) {
             if (m_pRecipPanel)
                 m_pRecipPanel->unselectMbeItem();
-            ContactViewer::getInst().launch(*contactAddress);
+            m_ContactViewer.launch(*contactAddress);
         }
     } else {
         showUnsavedRecipientPopup(address);
@@ -1290,7 +1289,7 @@ void Conversation::onMsgSendErrorButtonClicked(Popup &popup, int buttonId)
 void Conversation::onMsgSettingsButtonClicked(Popup &popup, int buttonId)
 {
     MSG_LOG("");
-    LaunchSettings::launch();
+    m_SettingsNetwork.launch();
     popup.destroy();
 }
 
@@ -1396,7 +1395,7 @@ void Conversation::onViewContactDetailsItemPressed(PopupListItem &item)
     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)
index e5140ae..24b33ed 100644 (file)
@@ -80,7 +80,6 @@ namespace Msg
 
             // IContactPickerListener
             virtual void onContactsPicked(const std::list<ResultData> &addressIdList);
-            virtual void onFinish();
 
             // IContactManagerListener:
             virtual void onContactChanged();
index 346a287..ac62108 100644 (file)
@@ -257,10 +257,7 @@ void ConvRecipientsPanel::onContactButtonClicked()
     MSG_LOG("");
     int currentRecipientsCount = getItemsCount();
     if (currentRecipientsCount < getMaxRecipientCount())
-    {
-        setButtonEnabled(ContactButton, false);
         m_Picker.launch(getMaxRecipientCount() - currentRecipientsCount);
-    }
     else
         showTooManyRecipientsNotif();
 }
@@ -301,12 +298,6 @@ void ConvRecipientsPanel::onContactsPicked(const std::list<ResultData> &addressI
     setEntryFocus(true);
 }
 
-void ConvRecipientsPanel::onFinish()
-{
-    MSG_LOG("");
-    setButtonEnabled(ContactButton, true);
-}
-
 void ConvRecipientsPanel::onPopupBtnClicked(Popup &popup, int buttonId)
 {
     popup.destroy();
index 4cf7b49..ec2efaf 100644 (file)
@@ -23,6 +23,7 @@
 #include "SettingsListItem.h"
 #include "MsgSettings.h"
 #include "SystemSettingsManager.h"
+#include "SettingsSound.h"
 
 namespace Msg
 {
@@ -127,6 +128,7 @@ namespace Msg
             SettingsListItem *m_pReadReportItem;
             SettingsListItem *m_pAutoRetItem;
             SettingsListItem *m_pAutoRetRoamingItem;
+            SettingsSound m_SoundPicker;
     };
 }
 
index ecc04b7..972625b 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef SETTINGSSOUND_H_
 #define SETTINGSSOUND_H_
 
+#include "AppControlLauncher.h"
+
 namespace Msg
 {
     class MsgSettings;
@@ -25,6 +27,7 @@ namespace Msg
      * @brief This class is aimed to launch preinstalled utility from settings-app that allows to chose message-alert sound.
      */
     class SettingsSound
+        : public AppControlHandle
     {
         public:
             /**
@@ -32,16 +35,15 @@ namespace Msg
              * @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;
index 29eb5ce..ac014ff 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include "Settings.h"
-#include "SettingsSound.h"
 #include "Config.h"
 #include "MsgEngine.h"
 #include "Logger.h"
@@ -47,6 +46,7 @@ Settings::Settings(NaviFrameController &parent)
     , m_pReadReportItem(nullptr)
     , m_pAutoRetItem(nullptr)
     , m_pAutoRetRoamingItem(nullptr)
+    , m_SoundPicker(getMsgEngine().getSettings())
 {
     create();
 }
@@ -288,8 +288,7 @@ void Settings::alertsItemHandler(SettingsListItem &item)
 void Settings::soundItemHandler(SettingsListItem &item)
 {
     MSG_LOG("soundItemHandler activated!");
-    SettingsSound picker(getMsgSettings());
-    picker.launchSoundPicker();
+    m_SoundPicker.launch();
 }
 
 void Settings::vibrationItemHandler(SettingsListItem &item)
index ec40ed8..b5d7e8a 100644 (file)
@@ -25,7 +25,6 @@ using namespace Msg;
 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";
@@ -42,13 +41,21 @@ namespace
 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;
@@ -58,16 +65,15 @@ static void soundPickerCb(app_control_h request, app_control_h reply, app_contro
         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) {
@@ -76,34 +82,19 @@ static void soundPickerCb(app_control_h request, app_control_h reply, app_contro
     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);
 }
 
index 12b9e4d..e040e28 100644 (file)
@@ -28,6 +28,7 @@
 namespace Msg
 {
     class SmilImageItemView;
+    class FileViewer;
 
     class SmilPage
         : public SmilPageLayout
@@ -35,8 +36,8 @@ namespace Msg
         , 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;
@@ -78,6 +79,7 @@ namespace Msg
             SmilImageItemView *m_pImageItem;
             std::list<std::string> m_Attachments;
             bool m_HasInvalidFiles;
+            FileViewer &m_FileViewer;
     };
 }
 
index a02ee2f..bc5a1c6 100644 (file)
@@ -21,6 +21,7 @@
 #include "MessageMms.h"
 #include "SmilPage.h"
 #include "MediaPlayer.h"
+#include "FileViewer.h"
 
 #include <Ecore.h>
 #include <vector>
@@ -94,6 +95,7 @@ namespace Msg
             int m_Duration;
             State m_State;
             int m_PageTickCounter;
+            FileViewer m_FileViewer;
     };
 
     class ISmilPlayerListener
index 7154663..d348f14 100644 (file)
@@ -31,6 +31,7 @@
 #include "SubjectLayout.h"
 #include "SystemSettingsManager.h"
 #include "MsgStorage.h"
+#include "ContactViewer.h"
 
 namespace Msg
 {
@@ -131,6 +132,7 @@ namespace Msg
             ContactEditor m_ContactEditor;
             SmilPlayer *m_pSmilPlayer;
             SubjectLayout *m_pSubjectLayout;
+            ContactViewer m_ContactViewer;
     };
 }
 
index 771cc69..1d94c9c 100644 (file)
 #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);
 }
@@ -292,7 +296,7 @@ void SmilPage::buildAttachment(const MsgAttachment& attachment)
 void SmilPage::onItemClicked(SmilAttachmentItemView &item)
 {
     MSG_LOG("");
-    FileViewer::getInst().launchWithCopy(item.getFilePath());
+    m_FileViewer.launchWithCopy(item.getFilePath());
 }
 
 void SmilPage::onSaveButtonClicked(SmilAttachmentItemView &item)
index a001b5f..b87728e 100644 (file)
@@ -48,7 +48,7 @@ void SmilPlayer::create(const MessageMms &mms)
         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);
         }
@@ -57,7 +57,7 @@ void SmilPlayer::create(const MessageMms &mms)
     // 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);
     }
index 265b40d..d2a3d5d 100644 (file)
@@ -225,7 +225,7 @@ void Viewer::recipientClickHandler(const std::string &address)
     m_SelectedAddress = address;
     ContactAddressRef contactAddress = getApp().getContactManager().getContactAddress(address);
     if (contactAddress)
-        ContactViewer::getInst().launch(*contactAddress);
+        m_ContactViewer.launch(*contactAddress);
     else
         showRecipPopup(address);
 }
@@ -348,7 +348,7 @@ void Viewer::onMakeVoiceItemPressed(PopupListItem &item)
 {
     MSG_LOG("");
     item.getParent().destroy();
-    VoiceCall::launch(m_SelectedAddress);
+   VoiceCall::launch(m_SelectedAddress);
 }
 
 void Viewer::onCreateContactItemPressed(PopupListItem &item)