TizenRefApp-7097 remove unused enums from MsgMedia 28/87928/5
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Mon, 12 Sep 2016 07:11:14 +0000 (10:11 +0300)
committerDmytro Dragan <dm.dragan@samsung.com>
Mon, 12 Sep 2016 09:15:09 +0000 (02:15 -0700)
Change-Id: I906e8012c6dd188a12870fd02388c6d88efda10f
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Common/MsgEngine/inc/MsgMedia.h
src/Common/MsgEngine/src/private/MsgMediaPrivate.cpp
src/Common/MsgEngine/src/private/MsgUtilsPrivate.cpp
src/Common/MsgEngine/src/private/MsgUtilsPrivate.h

index d121ade..10286c2 100644 (file)
@@ -43,8 +43,6 @@ namespace Msg
                 AudioType,          /**< Audio file. Can be played with smil-player.*/
                 VideoType,          /**< Video file. Can be played with smil-player.*/
                 TextType,           /**< Text-section of page.*/
-                AnimateType,        /**< Animated vector graphics or other animated format supported by smil-player. */
-                ImageOrVideoType //TODO: I'm unused enum-item, remove me.
             };
 
         public:
index db15f07..cd9b9ed 100644 (file)
@@ -65,8 +65,6 @@ void MsgMediaPrivate::setType(Type type)
     {
         case ImageType:
         case VideoType:
-        case AnimateType:
-        case ImageOrVideoType:
         {
             MsgUtilsPrivate::setStr(m_MsgStruct, MSG_MMS_MEDIA_REGION_ID_STR, imageRegionId);
             break;
index 0e2e310..1797950 100644 (file)
@@ -220,27 +220,38 @@ Message::Type MsgUtilsPrivate::nativeToMessageType(int type)
     }
 }
 
-void MsgUtilsPrivate::checkSmilType()
-{
-    static_assert((int)MMS_SMIL_MEDIA_INVALID == (int)MsgMedia::UnknownType &&
-        (int)MMS_SMIL_MEDIA_IMG == (int)MsgMedia::ImageType &&
-        (int)MMS_SMIL_MEDIA_AUDIO == (int)MsgMedia::AudioType &&
-        (int)MMS_SMIL_MEDIA_VIDEO == (int)MsgMedia::VideoType &&
-        (int)MMS_SMIL_MEDIA_TEXT == (int)MsgMedia::TextType &&
-        (int)MMS_SMIL_MEDIA_ANIMATE == (int)MsgMedia::AnimateType &&
-        (int)MMS_SMIL_MEDIA_IMG_OR_VIDEO == (int)MsgMedia::ImageOrVideoType, "");
-}
-
 MsgMedia::Type MsgUtilsPrivate::nativeToSmilType(int type)
 {
-    checkSmilType();
-    return (MsgMedia::Type)type;
+    switch(type)
+    {
+        case MMS_SMIL_MEDIA_IMG:
+            return MsgMedia::ImageType;
+        case MMS_SMIL_MEDIA_AUDIO:
+            return MsgMedia::AudioType;
+        case MMS_SMIL_MEDIA_VIDEO:
+            return MsgMedia::VideoType;
+        case MMS_SMIL_MEDIA_TEXT:
+            return MsgMedia::TextType;
+    }
+    return MsgMedia::UnknownType;
 }
 
 int MsgUtilsPrivate::smilTypeToNative(MsgMedia::Type type)
 {
-    checkSmilType();
-    return (int)type;
+    switch(type)
+    {
+        case MsgMedia::ImageType:
+            return MMS_SMIL_MEDIA_IMG;
+        case MsgMedia::AudioType:
+            return MMS_SMIL_MEDIA_AUDIO;
+        case MsgMedia::VideoType:
+            return MMS_SMIL_MEDIA_VIDEO;
+        case MsgMedia::TextType:
+            return MMS_SMIL_MEDIA_TEXT;
+        case MsgMedia::UnknownType:
+            break;
+    }
+    return MMS_SMIL_MEDIA_INVALID;
 }
 
 std::string MsgUtilsPrivate::getStr(msg_struct_t msgStruct, int field, int maxStrLen)
index 866a2b8..ed0f42c 100644 (file)
@@ -52,9 +52,6 @@ namespace Msg
 
             static std::string getStr(msg_struct_t msgStruct, int field, int maxStrLen);
             static int setStr(msg_struct_t msgStruct, int field, const std::string &text);
-
-        private:
-            static void checkSmilType();
     };
 }