TizenRefApp-8268 Implement BubbleUnknownFileEntity class 47/121847/4
authorOleksander Kostenko <o.kostenko@samsung.com>
Wed, 29 Mar 2017 07:35:26 +0000 (10:35 +0300)
committerOleksander Kostenko <o.kostenko@samsung.com>
Wed, 29 Mar 2017 10:38:34 +0000 (13:38 +0300)
Change-Id: I25f4eda977d81f763f020f45be213b510f87fc6c
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
inc/Resource.h
res/edje/images.edc
src/Conversation/Controller/inc/BubbleUnknownFileEntity.h [new file with mode: 0644]

index 7cc6ff8a9f3e80fe30af77d642af5387f4e942d3..f8d3ded91801aa062be94e7187471b58e072a247 100644 (file)
@@ -26,6 +26,7 @@
 #define ATTACH_MUSIC_ICON               "thread_view_msg_att_music.png"
 #define ATTACH_CALENDAR_ICON            "thread_view_msg_att_schedule.png"
 #define ATTACH_CONTACT_ICON             "thread_view_msg_att_vcf.png"
+#define ATTACH_UNKNOWN_ICON             "thread_view_msg_att_etc.png"
 
 #define TEST_IMAGE_PATH                  "images/cat.png"
 
index 551c3a1b86da414af436aab41bd44ad8b8e0a63e..9f3acc039f22aadb546f143e7762b21b0fed1a0f 100755 (executable)
@@ -37,6 +37,7 @@ collections {
    RES_IMAGE("thread_view_msg_att_voice.png");
    RES_IMAGE("thread_view_msg_att_music.png");
    RES_IMAGE("thread_view_msg_att_vcf.png");
+   RES_IMAGE("thread_view_msg_att_etc.png");
    RES_IMAGE("thread_view_msg_att_schedule.png");
    RES_IMAGE("sent_fail_icon.png");
 }
diff --git a/src/Conversation/Controller/inc/BubbleUnknownFileEntity.h b/src/Conversation/Controller/inc/BubbleUnknownFileEntity.h
new file mode 100644 (file)
index 0000000..0d75e33
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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 BubbleUnknownFileEntity_h_
+#define BubbleUnknownFileEntity_h_
+
+#include "BubbleEntity.h"
+#include "BubbleIconTextLayoutItem.h"
+
+namespace Msg {
+    class BubbleUnknownFileEntity
+        : public BubbleEntity {
+        public:
+            BubbleUnknownFileEntity(const std::string &filePath, const std::string fileName, Message::Direction direction);
+            virtual ~BubbleUnknownFileEntity();
+
+            BubbleIconTextLayoutItem *createView(Evas_Object *parent) override;
+
+        private:
+            std::string m_FileName;
+    };
+    inline BubbleUnknownFileEntity::BubbleUnknownFileEntity(const std::string &filePath, const std::string fileName, Message::Direction direction)
+        : BubbleEntity(UnknownFileItem, direction, filePath)
+        , m_FileName(std::move(fileName))
+    {
+    }
+
+    inline BubbleUnknownFileEntity::~BubbleUnknownFileEntity()
+    {
+    }
+
+    inline BubbleIconTextLayoutItem *BubbleUnknownFileEntity::createView(Evas_Object *parent)
+    {
+        auto *item = new BubbleIconTextLayoutItem(parent, *this);
+        item->setIcon(item->createIcon(ATTACH_UNKNOWN_ICON));
+        item->setMainText(m_FileName);
+        return item;
+    }
+}
+
+#endif /* BubbleUnknownFileEntity_h_ */