TizenRefApp-8368 Implement support MMS (audio, video, image) in dummy msg service. 95/125295/3
authorOleksander Kostenko <o.kostenko@samsung.com>
Fri, 14 Apr 2017 11:41:39 +0000 (14:41 +0300)
committerOleksander Kostenko <o.kostenko@samsung.com>
Fri, 14 Apr 2017 13:46:34 +0000 (16:46 +0300)
Change-Id: Ia85f6ebaef268161ff9979831f8341e8fb21d6c7
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
35 files changed:
res/dummy_res/Calendar1.vcs [new file with mode: 0644]
res/dummy_res/Contact.vcf [new file with mode: 0644]
res/dummy_res/Voice.m4a [new file with mode: 0644]
res/dummy_res/big.txt [new file with mode: 0644]
res/dummy_res/call.csv [new file with mode: 0644]
res/dummy_res/cat.png [new file with mode: 0644]
res/dummy_res/phone.jpg [new file with mode: 0644]
res/dummy_res/table.3gp [new file with mode: 0644]
res/images/cat.png [deleted file]
src/Common/MsgEngine/src/dummy/MessageDummy.cpp
src/Common/MsgEngine/src/dummy/MessageDummy.h
src/Common/MsgEngine/src/dummy/MessageMmsDummy.cpp
src/Common/MsgEngine/src/dummy/MessageMmsDummy.h
src/Common/MsgEngine/src/dummy/MessageSMSDummy.h
src/Common/MsgEngine/src/dummy/MsgAddressDummy.h
src/Common/MsgEngine/src/dummy/MsgAttachmentDummy.h
src/Common/MsgEngine/src/dummy/MsgConvMediaDummy.cpp
src/Common/MsgEngine/src/dummy/MsgConvMediaDummy.h
src/Common/MsgEngine/src/dummy/MsgConversationItemDummy.cpp
src/Common/MsgEngine/src/dummy/MsgConversationItemDummy.h
src/Common/MsgEngine/src/dummy/MsgListDummy.h [new file with mode: 0644]
src/Common/MsgEngine/src/dummy/MsgListHandleDummy.h [deleted file]
src/Common/MsgEngine/src/dummy/MsgMediaDummy.cpp
src/Common/MsgEngine/src/dummy/MsgMediaDummy.h
src/Common/MsgEngine/src/dummy/MsgPageDummy.cpp
src/Common/MsgEngine/src/dummy/MsgPageDummy.h
src/Common/MsgEngine/src/dummy/MsgReportDummy.h
src/Common/MsgEngine/src/dummy/MsgStorageDummy.cpp
src/Common/MsgEngine/src/dummy/MsgStructListDummy.h [deleted file]
src/Common/MsgEngine/src/dummy/MsgThreadItemDummy.h
src/Conversation/Controller/inc/BubbleAudioEntity.h [deleted file]
src/Conversation/Controller/inc/BubbleEntityFactory.h
src/Conversation/Controller/inc/BubbleVoiceEntity.h
src/Conversation/Controller/src/BubbleEntityFactory.cpp
src/Conversation/Controller/src/BubbleVideoEntity.cpp

diff --git a/res/dummy_res/Calendar1.vcs b/res/dummy_res/Calendar1.vcs
new file mode 100644 (file)
index 0000000..3e82f0b
--- /dev/null
@@ -0,0 +1,14 @@
+BEGIN:VCALENDAR\r
+PRODID:vCal ID Default\r
+VERSION:2.0\r
+BEGIN:VEVENT\r
+SUMMARY:Hdjdbfnf\r
+DTSTART;TZID=Europe/Kiev:20170414T140000\r
+DTEND;TZID=Europe/Kiev:20170414T150000\r
+CLASS:CONFIDENTIAL\r
+CREATED:20170414T102656Z\r
+LAST-MODIFIED:20170414T102656Z\r
+PRIORITY:0\r
+DTSTAMP:20170414T102935Z\r
+END:VEVENT\r
+END:VCALENDAR\r
diff --git a/res/dummy_res/Contact.vcf b/res/dummy_res/Contact.vcf
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/res/dummy_res/Voice.m4a b/res/dummy_res/Voice.m4a
new file mode 100644 (file)
index 0000000..be2a1e9
Binary files /dev/null and b/res/dummy_res/Voice.m4a differ
diff --git a/res/dummy_res/big.txt b/res/dummy_res/big.txt
new file mode 100644 (file)
index 0000000..879f60a
--- /dev/null
@@ -0,0 +1 @@
+Big text file
diff --git a/res/dummy_res/call.csv b/res/dummy_res/call.csv
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/res/dummy_res/cat.png b/res/dummy_res/cat.png
new file mode 100644 (file)
index 0000000..c3e20aa
Binary files /dev/null and b/res/dummy_res/cat.png differ
diff --git a/res/dummy_res/phone.jpg b/res/dummy_res/phone.jpg
new file mode 100644 (file)
index 0000000..f4fecb7
Binary files /dev/null and b/res/dummy_res/phone.jpg differ
diff --git a/res/dummy_res/table.3gp b/res/dummy_res/table.3gp
new file mode 100644 (file)
index 0000000..72c239d
Binary files /dev/null and b/res/dummy_res/table.3gp differ
diff --git a/res/images/cat.png b/res/images/cat.png
deleted file mode 100644 (file)
index c3e20aa..0000000
Binary files a/res/images/cat.png and /dev/null differ
index dd00235de63c865f7302468c279f984821672fe3..595ddd195f382126f29e3cc7293d57bdb2383b75 100644 (file)
@@ -27,7 +27,7 @@ MessageDummy::MessageDummy(bool release)
     : Message()
     , MsgStructDummy(release)
     , m_Address(false)
-    , m_AddressList(false)
+    , m_AddressList()
 {
 }
 
@@ -35,7 +35,7 @@ MessageDummy::~MessageDummy()
 {
 }
 
-const MsgAddressListHandleDummy &MessageDummy::getAddressList() const
+const MsgAddressListDummy &MessageDummy::getAddressList() const
 {
     return m_AddressList;
 }
index dcca079912d2e96b8fe5d8895d4546657ce2d360..5611c0c901fe343402fdd0138af9e26f3c97d8fb 100644 (file)
@@ -35,7 +35,7 @@ namespace Msg
             virtual MsgId getId() const;
             virtual ThreadId getThreadId() const;
             virtual time_t getTime() const;
-            virtual const MsgAddressListHandleDummy &getAddressList() const;
+            virtual const MsgAddressListDummy &getAddressList() const;
             virtual MsgAddressDummy &addAddress();
             virtual void addAddresses(const MsgAddressList &list);
             virtual void setText(const std::string &text);
@@ -57,11 +57,10 @@ namespace Msg
 
         protected:
             mutable MsgAddressDummy m_Address;
-            mutable MsgAddressListHandleDummy m_AddressList;
+            mutable MsgAddressListDummy m_AddressList;
     };
 
-    typedef class MsgListHandleDummy<MessageDummy, Message> MessageListHandleDummy;
-    typedef class MsgStructListDummy<MessageDummy, Message> MessageStructListDummy;
+    typedef class MsgListDummy<MessageDummy, Message> MessageListDummy;
 }
 
 #endif /* _MESSAGE_Dummy_H__ */
index d3e51af1e4fc82a79742fdd06a9fb5149f2ff520..3bf6e64b4bac9261a483a1a1655bb8385b7351b0 100644 (file)
@@ -25,8 +25,8 @@ using namespace Msg;
 MessageMmsDummy::MessageMmsDummy(bool release)
     : MessageDummy(release)
     , MessageMms()
-    , m_PageList(false)
-    , m_AttachmentList(false)
+    , m_PageList()
+    , m_AttachmentList()
     , m_Page(false)
     , m_Attachment(false)
 {
@@ -59,7 +59,7 @@ int MessageMmsDummy::getMediaCount() const
     return 5;
 }
 
-const MsgPageListHandleDummy &MessageMmsDummy::getPageList() const
+const MsgPageListDummy &MessageMmsDummy::getPageList() const
 {
     return m_PageList;
 }
@@ -69,7 +69,7 @@ MsgPageDummy &MessageMmsDummy::addPage()
     return m_Page;
 }
 
-const MsgAttachmentListHandleDummy &MessageMmsDummy::getAttachmentList() const
+const MsgAttachmentListDummy &MessageMmsDummy::getAttachmentList() const
 {
     return m_AttachmentList;
 }
index c708190937e720cf80672b3b9b11848b87fcc9f2..93efb1e06ffbda4c6c99b3fa1dd6391bf08efbdf 100644 (file)
@@ -37,10 +37,10 @@ namespace Msg
             virtual Type getType() const;
             virtual int getSize() const;
 
-            virtual const MsgPageListHandleDummy &getPageList() const;
+            virtual const MsgPageListDummy &getPageList() const;
             virtual MsgPageDummy &addPage();
 
-            virtual const MsgAttachmentListHandleDummy &getAttachmentList() const;
+            virtual const MsgAttachmentListDummy &getAttachmentList() const;
             virtual MsgAttachmentDummy &addAttachment();
             virtual time_t getExpired() const;
 
@@ -48,14 +48,13 @@ namespace Msg
             int getMediaCount() const;
 
         private:
-            mutable MsgPageListHandleDummy m_PageList;
-            mutable MsgAttachmentListHandleDummy m_AttachmentList;
+            mutable MsgPageListDummy m_PageList;
+            mutable MsgAttachmentListDummy m_AttachmentList;
             MsgPageDummy m_Page;
             MsgAttachmentDummy m_Attachment;
     };
 
-    typedef class MsgListHandleDummy<MessageMmsDummy, MessageMms> MmsListHandleDummy;
-    typedef class MsgStructListDummy<MessageMmsDummy, MessageMms> MmsStructListDummy;
+    typedef class MsgListDummy<MessageMmsDummy, MessageMms> MmsListDummy;
 }
 
 #endif /* _MESSAGE_MMS_Dummy_H__ */
index bbc026a27cb111fd0d6cf85acc76b213249c46a1..018f2597084825c116d9484b9da10a1611675428 100644 (file)
@@ -19,8 +19,7 @@
 
 #include "MessageSMS.h"
 #include "MessageDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+#include "MsgListDummy.h"
 
 namespace Msg
 {
@@ -37,8 +36,7 @@ namespace Msg
             virtual std::string getText() const;
     };
 
-    typedef class MsgListHandleDummy<MessageSMSDummy, MessageSMS> SmsListHandleDummy;
-    typedef class MsgStructListDummy<MessageSMSDummy, MessageSMS> SmsStructListDummy;
+    typedef class MsgListDummy<MessageSMSDummy, MessageSMS> SmsListDummy;
 }
 
 #endif /* _MESSAGE_SMS_Dummy_H__ */
index 623942e6011a8acb80e7c33e25a082241a9be6d6..98a4244ca0ed6c5a3b38ec32eb131c05ca9e2ac5 100644 (file)
@@ -18,8 +18,8 @@
 #define MsgAddressDummy_h_
 
 #include "MsgAddress.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+
+#include "MsgListDummy.h"
 #include "MsgStructDummy.h"
 
 namespace Msg
@@ -43,8 +43,7 @@ namespace Msg
             void setFields(const MsgAddress &addr);
     };
 
-    typedef class MsgListHandleDummy<MsgAddressDummy, MsgAddress> MsgAddressListHandleDummy;
-    typedef class MsgStructListDummy<MsgAddressDummy, MsgAddress> MsgAddressStructListDummy;
+    typedef class MsgListDummy<MsgAddressDummy, MsgAddress> MsgAddressListDummy;
 }
 
 #endif /* MsgAddressDummy_h_ */
index 3597b169b84200d03ab3d47afc9952d985d86456..9edf31a8f1b7413a02201468e20bc5c0312f7592 100644 (file)
@@ -18,9 +18,9 @@
 #define _MSG_ATTACHMENT_Dummy_H__
 
 #include "MsgAttachment.h"
+
+#include "MsgListDummy.h"
 #include "MsgStructDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
 
 namespace Msg
 {
@@ -43,8 +43,7 @@ namespace Msg
             void setMime(const std::string &mime);
     };
 
-    typedef class MsgListHandleDummy<MsgAttachmentDummy, MsgAttachment> MsgAttachmentListHandleDummy;
-    typedef class MsgStructListDummy<MsgAttachmentDummy, MsgAttachment> MsgAttachmentStructListDummy;
+    typedef class MsgListDummy<MsgAttachmentDummy, MsgAttachment> MsgAttachmentListDummy;
 }
 
 #endif /* _MSG_ATTACHMENT_Dummy_H__ */
index 26147dcb71165941f286a9354601e9a06526a81a..8f84a65a8039d817f09c09e4df05204915e4672b 100644 (file)
 #include "MsgConvMediaDummy.h"
 #include "MsgUtilsDummy.h"
 #include "fakeNames.h"
+#include "PathUtils.h"
 using namespace Msg;
 
+const std::vector<std::string> fileNames = {"cat.png", "Calendar1.vcs", "Contact.vcf",
+                                            "big.txt", "call.csv", "phone.jpg", "table.3gp", "Voice.m4a"};
+
 MsgConvMediaDummy::MsgConvMediaDummy(bool release)
     : MsgStructDummy(release)
     , MsgConvMedia()
+    , m_Number(0)
 {
 }
 
@@ -29,6 +34,11 @@ MsgConvMediaDummy::~MsgConvMediaDummy()
 {
 }
 
+int MsgConvMediaDummy::getNumberOfItems()
+{
+    return fileNames.size();
+}
+
 std::string MsgConvMediaDummy::getMime() const
 {
     return std::string();
@@ -36,12 +46,13 @@ std::string MsgConvMediaDummy::getMime() const
 
 std::string MsgConvMediaDummy::getName() const
 {
-    return fakeNames[rand()%fakeNames.size()];
+    return fileNames[m_Number];
 }
 
 std::string MsgConvMediaDummy::getPath() const
 {
-    return std::string();
+    m_Number = rand() % getNumberOfItems();
+    return PathUtils::getResourcePath("dummy_res/" + fileNames[m_Number]);
 }
 
 std::string MsgConvMediaDummy::getThumbPath() const
index ea158d13a0ba1acd643e83ac6a4d23831291ac5d..e783d96683fd2d224c3d2827bb713b223da01efb 100644 (file)
@@ -18,7 +18,8 @@
 #define MSGCONVMEDIADummy_H_
 
 #include "MsgConvMedia.h"
-#include "MsgListHandleDummy.h"
+
+#include "MsgListDummy.h"
 #include "MsgStructDummy.h"
 
 namespace Msg
@@ -31,15 +32,19 @@ namespace Msg
             MsgConvMediaDummy(bool release);
             virtual ~MsgConvMediaDummy();
 
+            static int getNumberOfItems();
             virtual std::string getMime() const;
             virtual std::string getName() const;
             virtual std::string getPath() const;
             virtual std::string getThumbPath() const;
             virtual std::string getContentId() const;
             virtual std::string getContentLocation() const;
+
+        private:
+            mutable int m_Number;
     };
 
-    typedef class MsgListHandleDummy<MsgConvMediaDummy, MsgConvMedia> MsgConvMediaListHandleDummy;
+    typedef class MsgListDummy<MsgConvMediaDummy, MsgConvMedia> MsgConvMediaListDummy;
 }
 
 #endif /* MSGCONVMEDIADummy_H_ */
index 774812460b67f797210870c32e728bce0f599d3a..ba7657dac9f3691acd1f6a133f7693989b4961c5 100644 (file)
@@ -25,7 +25,7 @@ using namespace Msg;
 
 MsgConversationItemDummy::MsgConversationItemDummy(bool release)
     : MsgStructDummy(release)
-    , m_MultipartList(false)
+    , m_MultipartList(rand() % MsgConvMediaDummy::getNumberOfItems())
 {
 }
 
@@ -109,7 +109,7 @@ int MsgConversationItemDummy::getAttachCount() const
     return attachments;
 }
 
-const MsgConvMediaListHandleDummy &MsgConversationItemDummy::getMediaList() const
+const MsgConvMediaListDummy &MsgConversationItemDummy::getMediaList() const
 {
     return m_MultipartList;
 }
index bdadec2090967562b2b9cb188f4ee9fd2352ef53..a4be87240a216735b783027d3c75113c3d928a09 100644 (file)
 #define __MSG_CONVERSATION_ITEM_Dummy_H__
 
 #include "MsgConversationItem.h"
-#include "MsgStructDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
 #include "MsgConvMediaDummy.h"
+#include "MsgListDummy.h"
 
 namespace Msg
 {
@@ -48,15 +46,14 @@ namespace Msg
             virtual bool isRead() const;
             virtual int getPagesCount() const;
             virtual int getAttachCount() const;
-            virtual const MsgConvMediaListHandleDummy &getMediaList() const;
+            virtual const MsgConvMediaListDummy &getMediaList() const;
             virtual bool isRestrictedByDpm() const;
 
         protected:
-            mutable MsgConvMediaListHandleDummy m_MultipartList;
+            mutable MsgConvMediaListDummy m_MultipartList;
     };
 
-    typedef class MsgListHandleDummy<MsgConversationItemDummy, MsgConversationItem> MsgConversationListHandleDummy;
-    typedef class MsgStructListDummy<MsgConversationItemDummy, MsgConversationItem> MsgConversationStructListDummy;
+    typedef class MsgListDummy<MsgConversationItemDummy, MsgConversationItem> MsgConversationListDummy;
 }
 
 #endif /* __MSG_CONVERSATION_ITEM_Dummy_H__ */
diff --git a/src/Common/MsgEngine/src/dummy/MsgListDummy.h b/src/Common/MsgEngine/src/dummy/MsgListDummy.h
new file mode 100644 (file)
index 0000000..4c362d2
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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 _MsgListDummy_H__
+#define _MsgListDummy_H__
+
+#include "MsgList.h"
+
+namespace Msg
+{
+    // class T : public BaseT {}
+    template<typename T, typename BaseT>
+    class MsgListDummy
+        : public MsgList<BaseT> // implement interface
+    {
+        public:
+            MsgListDummy(int size)
+                : m_Object(false)
+                , m_Length(size)
+            {
+            }
+            MsgListDummy()
+                : m_Object(false)
+                , m_Length(15)
+            {
+            }
+
+            virtual ~MsgListDummy()
+            {
+            }
+
+            virtual BaseT &at(int i)
+            {
+                return m_Object;
+            }
+
+            virtual const BaseT &at(int i) const
+            {
+                return m_Object;
+            }
+
+            virtual int getLength() const
+            {
+                return m_Length;
+            }
+
+            MsgListDummy(MsgListDummy&) = delete;
+            MsgListDummy &operator=(MsgListDummy&) = delete;
+
+        protected:
+            mutable T m_Object;
+            int m_Length;
+    };
+}
+
+#endif /* _MsgListDummy_H__ */
diff --git a/src/Common/MsgEngine/src/dummy/MsgListHandleDummy.h b/src/Common/MsgEngine/src/dummy/MsgListHandleDummy.h
deleted file mode 100644 (file)
index 2dfa806..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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 _MsgListHandleDummy_H__
-#define _MsgListHandleDummy_H__
-
-#include "MsgList.h"
-
-namespace Msg
-{
-    // class T : public BaseT {}
-    template<typename T, typename BaseT>
-    class MsgListHandleDummy
-        : public MsgList<BaseT> // implement interface
-    {
-        public:
-            MsgListHandleDummy(bool release)
-                : m_Object(false)
-                , m_Release(release)
-            {
-            }
-
-            virtual ~MsgListHandleDummy()
-            {
-            }
-
-            virtual BaseT &at(int i)
-            {
-                return m_Object;
-            }
-
-            virtual const BaseT &at(int i) const
-            {
-                return m_Object;
-            }
-
-            virtual int getLength() const
-            {
-                return 25;
-            }
-
-
-            MsgListHandleDummy(MsgListHandleDummy&) = delete;
-            MsgListHandleDummy &operator=(MsgListHandleDummy&) = delete;
-
-        protected:
-            mutable T m_Object;
-            bool m_Release;
-    };
-}
-
-#endif /* _MsgListHandleDummy_H__ */
index a933c692c92d13345045bc7dfe33ea25abb3ca94..9a69498420b46bafaf19e24662565c4a28994d09 100644 (file)
@@ -21,7 +21,7 @@
 #include "Logger.h"
 #include "MediaType.h"
 #include "FileUtils.h"
-
+#include "PathUtils.h"
 using namespace Msg;
 
 MsgMediaDummy::MsgMediaDummy(bool release)
@@ -41,12 +41,12 @@ MsgMediaDummy::Type MsgMediaDummy::getType() const
 
 std::string MsgMediaDummy::getFileName() const
 {
-    return std::string();
+    return "";
 }
 
 std::string MsgMediaDummy::getFilePath() const
 {
-    return std::string();
+    return "";
 }
 
 std::string MsgMediaDummy::getMime() const
index cc2988c3673957adffef58c421b68dfa9ca229b9..e62dd233c0addc6b9ab7fff29e2a60f21029b10c 100644 (file)
@@ -18,9 +18,9 @@
 #define _MSG_MEDIA_Dummy_H__
 
 #include "MsgMedia.h"
+
+#include "MsgListDummy.h"
 #include "MsgStructDummy.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
 
 namespace Msg
 {
@@ -43,8 +43,7 @@ namespace Msg
             void setType(Type type);
     };
 
-    typedef class MsgListHandleDummy<MsgMediaDummy, MsgMedia> MsgMediaListHandleDummy;
-    typedef class MsgStructListDummy<MsgMediaDummy, MsgMedia> MsgMediaStructListDummy;
+    typedef class MsgListDummy<MsgMediaDummy, MsgMedia> MsgMediaListDummy;
 }
 
 #endif /* _MSG_MEDIA_Dummy_H__ */
index b6df333d3ab1ceb222b9bb0802f33719042cdd6a..3d2e43c2416b55d1ebca1f493f4c08752475c108 100644 (file)
@@ -20,7 +20,7 @@ using namespace Msg;
 
 MsgPageDummy::MsgPageDummy(bool release)
     : MsgStructDummy(release)
-    , m_MediaList(false)
+    , m_MediaList()
     , m_Media(false)
 {
 }
@@ -29,7 +29,7 @@ MsgPageDummy::~MsgPageDummy()
 {
 }
 
-MsgMediaListHandleDummy &MsgPageDummy::getMediaList()
+MsgMediaListDummy &MsgPageDummy::getMediaList()
 {
     return m_MediaList;
 }
index 834351f83b51e8c8bce1823104fc4e8e54b796d6..07035ecf44d4d9c76b24c145f1d9727f35bb9e62 100644 (file)
@@ -30,18 +30,17 @@ namespace Msg
             MsgPageDummy(bool release);
             virtual ~MsgPageDummy();
 
-            virtual MsgMediaListHandleDummy &getMediaList();
+            virtual MsgMediaListDummy &getMediaList();
             virtual MsgMediaDummy &addMedia();
             virtual void setPageDuration(int duration);
             virtual int getPageDuration() const;
 
         private:
-            MsgMediaListHandleDummy m_MediaList;
+            MsgMediaListDummy m_MediaList;
             MsgMediaDummy m_Media;
     };
 
-    typedef class MsgListHandleDummy<MsgPageDummy, MsgPage> MsgPageListHandleDummy;
-    typedef class MsgStructListDummy<MsgPageDummy, MsgPage> MsgPageStructListDummy;
+    typedef class MsgListDummy<MsgPageDummy, MsgPage> MsgPageListDummy;
 }
 
 #endif /* _MSG_PAGE_Dummy_H__ */
index 6a0f5c7bc7698681ec39dc1931bd12a785c563dc..c95194a40b9a1870e57b89970ddbd34bfb7ff3ec 100644 (file)
@@ -18,8 +18,8 @@
 #define MsgReportDummy_h_
 
 #include "MsgReport.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+
+#include "MsgListDummy.h"
 #include "MsgStructDummy.h"
 
 namespace Msg
@@ -39,8 +39,7 @@ namespace Msg
             virtual time_t getTime() const;
     };
 
-    typedef class MsgListHandleDummy<MsgReportDummy, MsgReport> MsgReportListHandleDummy;
-    typedef class MsgStructListDummy<MsgReportDummy, MsgReport> MsgReportStructListDummy;
+    typedef class MsgListDummy<MsgReportDummy, MsgReport> MsgReportListDummy;
 }
 
 #endif /* MsgReportDummy_h_ */
index 46a2371a34d1d076e6fcda581056720589388d57..63ea9fe83c6583497844e360c1ba31f5d984c76d 100644 (file)
@@ -44,14 +44,14 @@ MsgStorageDummy::~MsgStorageDummy()
 MsgThreadListRef MsgStorageDummy::getThreadList()
 {
        MsgThreadListRef res;
-       res.reset(new MsgThreadStructListDummy(true));
+       res.reset(new MsgThreadListDummy);
     return res;
 }
 
 MessageSMSListRef MsgStorageDummy::getSimMsgList()
 {
     MessageSMSListRef res;
-    res.reset(new SmsStructListDummy(true));
+    res.reset(new SmsListDummy);
     return res;
 }
 
@@ -67,7 +67,7 @@ ThreadId MsgStorageDummy::getThreadId(const std::list<std::string> &addressList)
 
 MsgAddressListRef MsgStorageDummy::getAddressList(ThreadId id)
 {
-    MsgAddressStructListDummy *result = new MsgAddressStructListDummy(true);
+    MsgAddressListDummy *result = new MsgAddressListDummy;
     return MsgAddressListRef(result);
 }
 
@@ -96,7 +96,7 @@ bool MsgStorageDummy::deleteThread(ThreadId id)
 MsgConversationListRef MsgStorageDummy::getConversationList(ThreadId id)
 {
     MsgConversationListRef res;
-    res.reset(new MsgConversationStructListDummy(true));
+    res.reset(new MsgConversationListDummy);
     return res;
 }
 
@@ -149,7 +149,7 @@ void MsgStorageDummy::setReadStatus(MsgId id, bool status)
 
 MsgReportListRef MsgStorageDummy::getMsgReportList(MsgId msgId)
 {
-    MsgReportStructListDummy *result = new MsgReportStructListDummy(true);
+    MsgReportListDummy *result = new MsgReportListDummy;
     return MsgReportListRef(result);
 }
 
diff --git a/src/Common/MsgEngine/src/dummy/MsgStructListDummy.h b/src/Common/MsgEngine/src/dummy/MsgStructListDummy.h
deleted file mode 100644 (file)
index 0f56120..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 _MsgStructListDummy_H__
-#define _MsgStructListDummy_H__
-
-#include "MsgList.h"
-
-namespace Msg
-{
-    // class T : public BaseT {}
-    template<typename T, typename BaseT>
-    class MsgStructListDummy
-        : public MsgList<BaseT> // implement interface
-    {
-        public:
-            MsgStructListDummy(bool release)
-                : m_Object(false) // release = false
-                , m_Release(release)
-            {
-            }
-
-            virtual ~MsgStructListDummy()
-            {
-            }
-
-            virtual BaseT &at(int i)
-            {
-                return m_Object;
-            }
-
-            virtual const BaseT &at(int i) const
-            {
-                return m_Object;
-            }
-
-            virtual int getLength() const
-            {
-                return 16;
-            }
-
-            MsgStructListDummy(MsgStructListDummy&) = delete;
-            MsgStructListDummy &operator=(MsgStructListDummy&) = delete;
-
-        protected:
-            mutable T m_Object;
-            bool m_Release;
-    };
-}
-
-#endif /* _MsgStructListDummy_H__ */
index 1317d500e4eab7a86315b062def9d8f84f4a4482..571f8fdbde6d640ddc4ed4f2fc7a78db76b839ae 100644 (file)
@@ -18,8 +18,8 @@
 #define __MSG_THREAD_ITEM_H__
 
 #include "MsgThreadItem.h"
-#include "MsgListHandleDummy.h"
-#include "MsgStructListDummy.h"
+
+#include "MsgListDummy.h"
 #include "MsgStructDummy.h"
 
 namespace Msg
@@ -42,8 +42,7 @@ namespace Msg
             virtual int getUnreadCount() const;
     };
 
-    typedef class MsgListHandleDummy<MsgThreadItemDummy, MsgThreadItem> MsgThreadListHandleDummy;
-    typedef class MsgStructListDummy<MsgThreadItemDummy, MsgThreadItem> MsgThreadStructListDummy;
+    typedef class MsgListDummy<MsgThreadItemDummy, MsgThreadItem> MsgThreadListDummy;
 }
 
 #endif /* __MSG_THREAD_ITEM_H__ */
diff --git a/src/Conversation/Controller/inc/BubbleAudioEntity.h b/src/Conversation/Controller/inc/BubbleAudioEntity.h
deleted file mode 100644 (file)
index f992953..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 BubbleAudioEntity_h_
-#define BubbleAudioEntity_h_
-
-#include "BubbleEntity.h"
-#include "BubbleIconTextLayoutItem.h"
-
-namespace Msg {
-    class BubbleAudioEntity
-        : public BubbleEntity {
-        public:
-            BubbleAudioEntity(const std::string &filePath, const std::string fileName, Message::Direction direction);
-            virtual ~BubbleAudioEntity();
-
-            BubbleIconTextLayoutItem *createView(Evas_Object *parent) override;
-
-        private:
-            std::string m_FileName;
-    };
-    inline BubbleAudioEntity::BubbleAudioEntity(const std::string &filePath, const std::string fileName, Message::Direction direction)
-        : BubbleEntity(AudioItem, direction, filePath)
-        , m_FileName(std::move(fileName))
-    {
-    }
-
-    inline BubbleAudioEntity::~BubbleAudioEntity()
-    {
-    }
-
-    inline BubbleIconTextLayoutItem *BubbleAudioEntity::createView(Evas_Object *parent)
-    {
-        auto *item = new BubbleIconTextLayoutItem(parent, *this);
-        item->setIcon(item->createIcon(ATTACH_MUSIC_ICON));
-        item->setMainText(m_FileName);
-        return item;
-    }
-}
-
-#endif /* BubbleAudioEntity_h_ */
index 023b43ba07df403c3a8ff01a0bbf2190d3a7f71b..137378a6cb03a4cff1323ea1af0caf5032acab0b 100644 (file)
@@ -30,7 +30,6 @@ namespace Msg {
     class BubbleTextEntity;
     class BubbleImageEntity;
     class BubbleVideoEntity;
-    class BubbleAudioEntity;
     class BubbleRetrieveEntity;
     class BubbleUnknownFileEntity;
     class BubbleCalEventEntity;
@@ -52,7 +51,6 @@ namespace Msg {
             BubbleEntity *createTextEntityFromFile(std::string filePath, Message::Direction direction);
             BubbleEntity *createSubjectEntity(const std::string subject, Message::Direction direction);
             BubbleEntity *createVideoEntity(std::string filePath, std::string fileName, Message::Direction direction);
-            BubbleEntity *createAudioEntity(std::string filePath, std::string fileName, Message::Direction direction);
             BubbleEntity *createVoiceEntity(std::string filePath, std::string fileName, Message::Direction direction);
             BubbleEntityFactory(BubbleEntityFactory&) = delete;
             BubbleEntityFactory& operator=(const BubbleEntityFactory&) = delete;
index 8ac757dacd2977e2a7b5a42ba473ad42fe336f2b..66acb37e3020ad49858ad864a518acce6970b6e1 100644 (file)
@@ -45,6 +45,7 @@ namespace Msg {
     inline BubbleVoiceViewItem *BubbleVoiceEntity::createView(Evas_Object *parent)
     {
         auto *item = new BubbleVoiceViewItem(parent, *this);
+        item->setMainText(m_FileName);
         return item;
     }
 }
index e8150f06b62b9601ba2e2ef42c1e261dfcf20921..675684587962173744d90ba24fb5927aed8e47d2 100644 (file)
@@ -28,7 +28,6 @@
 #include "BubbleCalEventEntity.h"
 #include "BubbleContactEntity.h"
 #include "BubbleNoContentEntity.h"
-#include "BubbleAudioEntity.h"
 #include "BubbleVoiceEntity.h"
 #include "BubbleUnknownFileEntity.h"
 #include "BubbleSubjectEntity.h"
@@ -112,10 +111,7 @@ BubbleEntity *BubbleEntityFactory::createEntity(const MsgConvMedia &msgMedia, Me
         case MsgMedia::ImageType:
             return new BubbleImageEntity(std::move(filePath), direction);
         case MsgMedia::AudioType:
-            if (mime == "audio/m4a")
-                return createVoiceEntity(std::move(filePath), std::move(fileName), direction);
-            else
-                return createAudioEntity(std::move(filePath), std::move(fileName), direction);
+            return createVoiceEntity(std::move(filePath), std::move(fileName), direction);
         case MsgMedia::VideoType:
             return createVideoEntity(std::move(filePath), std::move(fileName), direction);
         default:
@@ -149,15 +145,6 @@ BubbleNoContentEntity *BubbleEntityFactory::createNoContentEntity(Message::Direc
     return new BubbleNoContentEntity(direction);
 }
 
-BubbleEntity *BubbleEntityFactory::createAudioEntity(std::string filePath, std::string fileName, Message::Direction direction)
-{
-    if (MediaUtils::hasAudio(filePath))
-        return new BubbleAudioEntity(filePath, fileName, direction);
-
-    // File does not contain audio or broken:
-    return new BubbleUnknownFileEntity(filePath, fileName, direction);
-}
-
 BubbleEntity *BubbleEntityFactory::createVoiceEntity(std::string filePath, std::string fileName, Message::Direction direction)
 {
     if (MediaUtils::hasAudio(filePath))
@@ -173,7 +160,7 @@ BubbleEntity *BubbleEntityFactory::createVideoEntity(std::string filePath, std::
            return new BubbleVideoEntity(m_WorkingDir, std::move(filePath), direction);
 
     // Try to create Audio entity.
-    return createAudioEntity(std::move(filePath), std::move(fileName), direction);
+    return createVoiceEntity(std::move(filePath), std::move(fileName), direction);
 }
 
 BubbleEntity *BubbleEntityFactory::createTextEntityFromFile(std::string filePath, Message::Direction direction)
index 6ce71b81cc077e99319f2740a02a32a2cc77908d..3c2900696f89270a54e25a9f560d4161f24da604 100644 (file)
@@ -25,7 +25,7 @@ BubbleVideoEntity::BubbleVideoEntity(WorkingDirRef workingDir, const std::string
     , m_WorkingDir(workingDir)
 {
     static const std::string thumbFileName = "thumbnail.jpeg";
-    m_ImgPath =  m_WorkingDir->genUniqueFilePath(thumbFileName);
+    m_ImgPath = m_WorkingDir->genUniqueFilePath(thumbFileName);
     if (!m_ImgPath.empty())
         MediaUtils::getVideoFrame(getFilePath(), m_ImgPath);
 }
@@ -37,7 +37,7 @@ BubbleVideoEntity::~BubbleVideoEntity()
 
 BubbleVideoViewItem *BubbleVideoEntity::createView(Evas_Object *parent)
 {
-    auto *item = new BubbleVideoViewItem(*this, parent, getFilePath());
+    auto *item = new BubbleVideoViewItem(*this, parent, m_ImgPath);
     return item;
 }