TizenRefApp-9102 Implement blocked message detail 97/143797/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Fri, 11 Aug 2017 09:26:35 +0000 (12:26 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Fri, 11 Aug 2017 09:32:48 +0000 (12:32 +0300)
Change-Id: Ibbefa7b783ff3002cdc11dd47060cf799c4bec75
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
18 files changed:
src/Common/Utils/inc/TimeUtils.h
src/Common/Utils/src/TimeUtils.cpp
src/Settings/Controller/inc/BlockedMsgDetailListItem.h [new file with mode: 0644]
src/Settings/Controller/inc/BlockedMsgListItem.h
src/Settings/Controller/inc/BlockedNumberListItem.h
src/Settings/Controller/inc/SettingsBlockedMessagesFrame.h
src/Settings/Controller/inc/SettingsBlockedMsgDetailFrame.h
src/Settings/Controller/inc/SettingsBlockedNumbersFrame.h
src/Settings/Controller/src/BlockedMsgDetailListItem.cpp [new file with mode: 0644]
src/Settings/Controller/src/BlockedMsgListItem.cpp
src/Settings/Controller/src/BlockedNumberListItem.cpp
src/Settings/Controller/src/SettingsBlockedMessagesFrame.cpp
src/Settings/Controller/src/SettingsBlockedMsgDetailFrame.cpp
src/Settings/Controller/src/SettingsBlockedNumbersFrame.cpp
src/Settings/View/inc/BlockedMsgDetailListViewItem.h [new file with mode: 0644]
src/Settings/View/inc/SettingsBlockedMsgDetailView.h [deleted file]
src/Settings/View/src/BlockedMsgDetailListViewItem.cpp [new file with mode: 0644]
src/Settings/View/src/SettingsBlockedMsgDetailView.cpp [deleted file]

index a08e09e3da2f534cae4adb9b389682059ddf1ac0..14af149c57e58ba20ba26ddacbadbce5adf5442f 100644 (file)
@@ -28,7 +28,6 @@ namespace Msg {
                        TimeFormat24H,
                        TimeFormat12H
                };
-
                std::string makeThreadTimeString(time_t msgTime);
                std::string makeBubbleTimeString(time_t msgTime);
                std::string makeBubbleDateLineString(time_t msgTime);
@@ -37,6 +36,7 @@ namespace Msg {
                std::string makeSmsReportTimeString(time_t msgTime);
                std::string makeMmsReportTimeString(time_t msgTime);
                std::string makeCalEventString(time_t time);
+               std::string makeBlockedMsgDetailString(time_t time);
                std::string makeCalEventString(int year, int month, int mday, int hour, int min, const char *timezone = nullptr);
        };
 }
index b5b7ec81b3ce9ff99cf6246ff3de72b08e7f28a1..e24894b52ac01fea2ab86eb4457b2c9a1c7a16e6 100644 (file)
@@ -44,6 +44,8 @@ const std::string delivReportSms24H = "MMM/dd/yyyy HHmm"; //SMS Delivery report
 const std::string delivReportSms12H = "MMM/dd/yyyy hma"; //SMS Delivery report 12H format
 const std::string delivReportMms24H = "HH:mm, d MMM"; //MMS Delivery report 24H format
 const std::string delivReportMms12H = "hh:mm a, d MMM"; //MMS Delivery report 12H format
+const std::string blockedMsgDetail24H = "yyyy/dd/MM HHmm"; // Blocked message detail 24H format
+const std::string blockedMsgDetail12H = "yyyy/dd/MM hma"; // Blocked message detail 12H format
 
 int getTimeFormat();
 std::string getTimezone();
@@ -70,7 +72,7 @@ std::string makeThreadTimeString(time_t msgTime)
 
        if (isToday)
        {
-               const std::string &timeFormat = getTimeFormat() == TimeFormat24H        ? time24H : time12H;
+               const std::string &timeFormat = getTimeFormat() == TimeFormat24H ? time24H : time12H;
                return getFormattedDate(locale, getDateBestPattern(locale, timeFormat), msgTime);
        } else {
                bool notThisYear = (msgTimeTm.tm_year - curTimeTm.tm_year != 0);
@@ -104,7 +106,7 @@ std::string makeDateTimeString(time_t msgTime) //the same for Sim Message List
        std::string res = getFormattedDate(locale, getDateBestPattern(locale, dateTimeSceleton), msgTime);
 
        res.append(" ");
-       const std::string &timeFormat = getTimeFormat() == TimeFormat24H        ? time24H : time12H;
+       const std::string &timeFormat = getTimeFormat() == TimeFormat24H ? time24H : time12H;
        res += getFormattedDate(locale, getDateBestPattern(locale, timeFormat), msgTime);
 
        return res;
@@ -130,6 +132,13 @@ std::string makeCalEventString(time_t time)
        return getFormattedDate(locale, getDateBestPattern(locale, dateYear), time);
 }
 
+std::string makeBlockedMsgDetailString(time_t time)
+{
+       const std::string &locale = getDefaultLocale();
+       const std::string &timeFormat = getTimeFormat() == TimeFormat24H ? blockedMsgDetail24H : blockedMsgDetail12H;
+       return getFormattedDate(locale, getDateBestPattern(locale, timeFormat), time);
+}
+
 std::string makeCalEventString(int year, int month, int mday, int hour, int min, const char *timezone)
 {
        struct tm time = {};
diff --git a/src/Settings/Controller/inc/BlockedMsgDetailListItem.h b/src/Settings/Controller/inc/BlockedMsgDetailListItem.h
new file mode 100644 (file)
index 0000000..3120f27
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017 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 BlockedMsgDetailListItem_h_
+#define BlockedMsgDetailListItem_h_
+
+#include "BlockedMsgDetailListViewItem.h"
+#include "MsgTypes.h"
+
+#include <time.h>
+
+namespace Msg {
+       class BlockedMsgDetailListItem
+               : public BlockedMsgDetailListViewItem {
+
+               public:
+                       BlockedMsgDetailListItem(MsgId id);
+                       virtual ~BlockedMsgDetailListItem();
+
+                       void updateTimeInfo();
+
+               protected:
+                       std::string getTime() override;
+                       std::string getMessage() override;
+
+               private:
+                       MsgId m_MsgId;
+                       time_t m_Time;
+                       std::string m_TimeStr;
+                       std::string m_Message;
+       };
+}
+
+#endif // BlockedMsgDetailListItem_h_
index 575b6c973ae24d89abb226ed2d5ffff7b4133e63..01c6ee4788268d8d16e1d61b192e38bc168fbf30 100644 (file)
@@ -35,6 +35,7 @@ namespace Msg {
 
                        MsgId getMsgId() const;
                        time_t getRawTime() const;
+                       const Recipient &getRecip() const;
                        void updateMsgInfo(const Message &msg);
                        void updateMsgInfo();
                        void updateContactInfo();
index a0cdbc210682bc10e3ab4f6c1497a7443da254b4..cd057bfae68f6ca7081493f1ad94aa0fe218eed1 100644 (file)
@@ -29,6 +29,7 @@ namespace Msg {
                        virtual ~BlockedNumberListItem();
 
                        Recipient &getRecip();
+                       void updateContactInfo();
 
                private:
                        std::string getAddress() override;
index 8206d925d062a3c99615992ec4f091bccc9d6b94..9b985a489a9129253e17072dd3a468cb5cbb2ba4 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "SystemSettingsManager.h"
 #include "FrameController.h"
+#include "ContactManager.h"
 #include "ListView.h"
 #include "MsgStorage.h"
 
@@ -41,6 +42,7 @@ namespace Msg {
                : public FrameController
                , private IListViewListener
                , private ISystemSettingsManager
+               , private IContactManagerListener
                , private IMsgStorageListener {
 
                public:
@@ -67,6 +69,9 @@ namespace Msg {
                        void onListItemLongPressed(ListItem &listItem) override;
                        void onListItemChecked(ListItem &listItem) override;
 
+                       // IContactManagerListener:
+                       void onContactChanged() override;
+
                        // ISystemSettingsManager:
                        void onTimeFormatChanged() override;
                        void onLanguageChanged() override;
@@ -91,6 +96,7 @@ namespace Msg {
                        void hideSelectPopup();
                        void updateNoContent();
                        void updateLangInfo();
+                       void updateContactInfo();
                        void updateTimeInfo();
                        void checkHandler(ListItem &item);
                        void deleteMessages(const std::vector<BlockedMsgListItem*> &items);
index b2c181b8d803fb749f0438fc759a3d83e1f9e0f0..d2a5ab180747a0c8d5ad2eed71a83f3a48e77bcf 100644 (file)
 #define SettingsBlockedMsgDetailFrame_h_
 
 #include "FrameController.h"
+#include "SystemSettingsManager.h"
+#include "ContactManager.h"
+#include "MsgTypes.h"
+#include "ListView.h"
+#include "Recipient.h"
 
 namespace Msg {
        class MoreOption;
        class DefaultLayout;
+       class TitleListItem;
+       class BlockedMsgDetailListItem;
 
        class SettingsBlockedMsgDetailFrame
-               : public FrameController {
+               : public FrameController
+               , private ISystemSettingsManager
+               , private IContactManagerListener {
+
                public:
-                       SettingsBlockedMsgDetailFrame(NaviFrameController &parent);
+                       SettingsBlockedMsgDetailFrame(NaviFrameController &parent, MsgId msgId, Recipient recip);
                        virtual ~SettingsBlockedMsgDetailFrame();
 
                protected:
@@ -34,16 +44,32 @@ namespace Msg {
                        void onAttached(ViewItem &item) override;
 
                private:
+                       // ISystemSettingsManager:
+                       void onTimeFormatChanged() override;
+
+                       // IContactManagerListener:
+                       void onContactChanged() override;
+
                        // More option:
                        void onRestoreClicked(MoreOption &obj);
                        void onDeleteClicked(MoreOption &obj);
 
+                       void showRestorePopup();
                        void prepareMainLayout();
                        void prepareMoreOption();
+                       void preapareList();
+                       void fillList();
+
+                       void updateSenderListItem();
 
                private:
                        DefaultLayout *m_pLayout;
                        MoreOption *m_pMoreOption;
+                       ListView *m_pList;
+                       MsgId m_MsgId;
+                       Recipient m_Recip;
+                       TitleListItem *m_pSenderListItem;
+                       BlockedMsgDetailListItem *m_pMsgItem;
        };
 }
 
index ef520f8524820cb596617abef8c867029eba69ca..e424b3f2b27c79d6dddaed666dac8bdcfdc447bb 100644 (file)
@@ -74,7 +74,6 @@ namespace Msg {
                        // Hw buttons:
                        void onHwBackButtonPressed(Evas_Object *obj, void *event);
 
-
                        void prepareMainLayout();
                        void prepareMoreOption();
                        void prepareSelectViews();
@@ -88,6 +87,7 @@ namespace Msg {
                        void updateNoContent();
                        void updateLangInfo();
                        void updateContactInfo();
+
                        void insertItem(ListItem *item);
                        void checkHandler(ListItem &item);
                        void deleteNumbers(const std::vector<BlockedNumberListItem*> &items);
diff --git a/src/Settings/Controller/src/BlockedMsgDetailListItem.cpp b/src/Settings/Controller/src/BlockedMsgDetailListItem.cpp
new file mode 100644 (file)
index 0000000..27f7edf
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2017 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 "BlockedMsgDetailListItem.h"
+#include "App.h"
+#include "MsgEngine.h"
+#include "TimeUtils.h"
+
+using namespace Msg;
+
+BlockedMsgDetailListItem::BlockedMsgDetailListItem(MsgId id)
+       : m_MsgId(id)
+{
+       auto msg = App::getInst().getMsgEngine().getStorage().getMessage(id);
+       if (msg) {
+               m_Time = msg->getTime();
+               m_Message = msg->getText();
+       }
+}
+
+BlockedMsgDetailListItem::~BlockedMsgDetailListItem()
+{
+}
+
+void BlockedMsgDetailListItem::updateTimeInfo()
+{
+       m_TimeStr.clear();
+       BlockedMsgDetailListViewItem::update();
+}
+
+std::string BlockedMsgDetailListItem::getTime()
+{
+       if (m_TimeStr.empty())
+               m_TimeStr = TimeUtils::makeBlockedMsgDetailString(m_Time);
+       return m_TimeStr;
+}
+
+std::string BlockedMsgDetailListItem::getMessage()
+{
+       return m_Message;
+}
index 923ecffa36cff9419d2871c49453cf457a96b1fc..f172c07894d13a30c487ccb65ef07d26902b97a1 100644 (file)
@@ -97,3 +97,8 @@ time_t BlockedMsgListItem::getRawTime() const
        return m_Time;
 }
 
+const Recipient &BlockedMsgListItem::getRecip() const
+{
+       return m_Recip;
+}
+
index f12b97e7ac36feb897716ba532fccf5a24e3a0e8..55fd59cce5fa02f2565ab42a52a04a2c785e524e 100644 (file)
@@ -29,6 +29,11 @@ BlockedNumberListItem::~BlockedNumberListItem()
 {
 }
 
+void BlockedNumberListItem::updateContactInfo()
+{
+       m_Recip.updateContactInfo();
+}
+
 std::string BlockedNumberListItem::getAddress()
 {
        return m_Recip.getAddress();
index 35fde73c6106b585a869cfa0daacb6ee402fc04d..cab6f30ca280ae615e16d94916ecab9c8cfd5e6f 100644 (file)
@@ -52,6 +52,7 @@ SettingsBlockedMessagesFrame::SettingsBlockedMessagesFrame(NaviFrameController &
        prepareMoreOption();
        preapareList();
        updateNoContent();
+       App::getInst().getContactManager().addListener(*this);
        App::getInst().getSysSettingsManager().addListener(*this);
        App::getInst().getMsgEngine().getStorage().addListener(*this);
 }
@@ -59,6 +60,7 @@ SettingsBlockedMessagesFrame::SettingsBlockedMessagesFrame(NaviFrameController &
 SettingsBlockedMessagesFrame::~SettingsBlockedMessagesFrame()
 {
        hideSelectPopup();
+       App::getInst().getContactManager().removeListener(*this);
        App::getInst().getSysSettingsManager().removeListener(*this);
        App::getInst().getMsgEngine().getStorage().removeListener(*this);
 }
@@ -251,6 +253,15 @@ void SettingsBlockedMessagesFrame::updateLangInfo()
        m_pList->updateRealizedItems();
 }
 
+void SettingsBlockedMessagesFrame::updateContactInfo()
+{
+       auto items = m_pList->getItems<BlockedMsgListItem>();
+       for (BlockedMsgListItem *item : items) {
+               item->updateContactInfo();
+       }
+       m_pList->updateRealizedItems();
+}
+
 void SettingsBlockedMessagesFrame::updateTimeInfo()
 {
        auto items = m_pList->getItems<BlockedMsgListItem>();
@@ -431,7 +442,7 @@ void SettingsBlockedMessagesFrame::onListItemSelected(ListItem &listItem)
 {
        MSG_LOG("");
        if (auto blockedMsgItem = dynamic_cast<BlockedMsgListItem*>(&listItem)) {
-               auto frame = new SettingsBlockedMsgDetailFrame(getParent());
+               auto frame = new SettingsBlockedMsgDetailFrame(getParent(), blockedMsgItem->getMsgId(), blockedMsgItem->getRecip());
                getParent().push(*frame);
        }
 }
@@ -464,6 +475,12 @@ void SettingsBlockedMessagesFrame::onLanguageChanged()
        updateLangInfo();
 }
 
+void SettingsBlockedMessagesFrame::onContactChanged()
+{
+       MSG_LOG("");
+       updateContactInfo();
+}
+
 void SettingsBlockedMessagesFrame::onHwBackButtonPressed(Evas_Object *obj, void *event)
 {
        MSG_LOG("");
index 683e6304e805aa416ede2b649de2d9089b829adb..854f7627aad1c8f1aee6a4526b5b1a48af149257 100644 (file)
  * limitations under the License.
  */
 
+#include <BlockedMsgDetailListItem.h>
 #include "SettingsBlockedMsgDetailFrame.h"
 #include "LangUtils.h"
 #include "DefaultLayout.h"
 #include "MoreOption.h"
 #include "IconTextPopup.h"
 #include "NaviFrameController.h"
+#include "App.h"
+#include "Window.h"
+#include "TitleListItem.h"
+#include "MsgEngine.h"
+#include "PaddingListViewItem.h"
 
 using namespace Msg;
 
-SettingsBlockedMsgDetailFrame::SettingsBlockedMsgDetailFrame(NaviFrameController &parent)
+SettingsBlockedMsgDetailFrame::SettingsBlockedMsgDetailFrame(NaviFrameController &parent, MsgId msgId, Recipient recip)
        : FrameController(parent, SettingsGroup)
        , m_pLayout(nullptr)
        , m_pMoreOption(nullptr)
+       , m_pList(nullptr)
+       , m_MsgId(msgId)
+       , m_Recip(std::move(recip))
+       , m_pSenderListItem(nullptr)
+       , m_pMsgItem(nullptr)
 {
+       App::getInst().getContactManager().addListener(*this);
+       App::getInst().getSysSettingsManager().addListener(*this);
        prepareMainLayout();
        prepareMoreOption();
+       preapareList();
 }
 
 SettingsBlockedMsgDetailFrame::~SettingsBlockedMsgDetailFrame()
 {
+       App::getInst().getContactManager().removeListener(*this);
+       App::getInst().getSysSettingsManager().removeListener(*this);
+}
+
+void SettingsBlockedMsgDetailFrame::preapareList()
+{
+       if (!m_pList) {
+               m_pList = new ListView(getParent(), App::getInst().getWindow().getCircleSurface());
+               m_pList->setHomogeneous(false);
+               m_pList->setMultiSelection(false);
+               m_pLayout->setContent(*m_pList);
+               fillList();
+       }
+}
+
+void SettingsBlockedMsgDetailFrame::fillList()
+{
+       // Append Sender:
+       m_pSenderListItem = new TitleListItem;
+       m_pList->appendItem(*m_pSenderListItem);
+       updateSenderListItem();
+
+       // Msg item:
+       if (m_MsgId.isValid()) {
+               m_pMsgItem = new BlockedMsgDetailListItem(m_MsgId);
+               m_pList->appendItem(*m_pMsgItem);
+       }
+
+       // Bottom padding:
+       auto *bottomItem = new PaddingListViewItem;
+       m_pList->appendItem(*bottomItem);
+}
+
+void SettingsBlockedMsgDetailFrame::updateSenderListItem()
+{
+       m_Recip.updateContactInfo();
+       m_pSenderListItem->setTitle(m_Recip.getDispName());
 }
 
 void SettingsBlockedMsgDetailFrame::onAttached(ViewItem &item)
@@ -62,9 +113,8 @@ void SettingsBlockedMsgDetailFrame::prepareMoreOption()
        }
 }
 
-void SettingsBlockedMsgDetailFrame::onRestoreClicked(MoreOption &obj)
+void SettingsBlockedMsgDetailFrame::showRestorePopup()
 {
-       MSG_LOG("");
        auto *popup = new IconTextPopup;
        popup->setIcon(IconTextPopup::CheckIcon);
        popup->setText(msgt("WDS_MSG_TPOP_MESSAGE_RESTORED_ABB"));
@@ -72,7 +122,31 @@ void SettingsBlockedMsgDetailFrame::onRestoreClicked(MoreOption &obj)
        popup->show();
 }
 
+void SettingsBlockedMsgDetailFrame::onRestoreClicked(MoreOption &obj)
+{
+       MSG_LOG("");
+       if (App::getInst().getMsgEngine().getStorage().moveMsgToInBox(m_MsgId)) {
+               showRestorePopup();
+               pop();
+       }
+}
+
 void SettingsBlockedMsgDetailFrame::onDeleteClicked(MoreOption &obj)
 {
        MSG_LOG("");
+       if (App::getInst().getMsgEngine().getStorage().deleteMessage(m_MsgId))
+               pop();
+}
+
+void SettingsBlockedMsgDetailFrame::onTimeFormatChanged()
+{
+       MSG_LOG("");
+       if (m_pMsgItem)
+               m_pMsgItem->updateTimeInfo();
+}
+
+void SettingsBlockedMsgDetailFrame::onContactChanged()
+{
+       MSG_LOG("");
+       updateSenderListItem();
 }
index 6db97dc2df29190d8afaae449a84dacb57dec207..d42605933a919528a0ca1f94edc4c78e106c08fb 100644 (file)
@@ -234,7 +234,7 @@ void SettingsBlockedNumbersFrame::updateContactInfo()
 {
        auto items = m_pList->getItems<BlockedNumberListItem>();
        for (BlockedNumberListItem *item : items) {
-               item->getRecip().updateContactInfo();
+               item->updateContactInfo();
        }
        m_pList->updateRealizedItems();
 }
@@ -324,6 +324,7 @@ void SettingsBlockedNumbersFrame::onLanguageChanged()
 void SettingsBlockedNumbersFrame::onContactChanged()
 {
        MSG_LOG("");
+       updateContactInfo();
 }
 
 void SettingsBlockedNumbersFrame::onHwBackButtonPressed(Evas_Object *obj, void *event)
diff --git a/src/Settings/View/inc/BlockedMsgDetailListViewItem.h b/src/Settings/View/inc/BlockedMsgDetailListViewItem.h
new file mode 100644 (file)
index 0000000..a76744a
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2017 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 BlockedMsgDetailListViewItem_h_
+#define BlockedMsgDetailListViewItem_h_
+
+#include "ListItem.h"
+
+namespace Msg {
+       class BlockedMsgDetailListViewItem
+               : public ListItem {
+
+               public:
+                       BlockedMsgDetailListViewItem();
+                       virtual ~BlockedMsgDetailListViewItem();
+
+               protected:
+                       virtual std::string getTime() = 0;
+                       virtual std::string getMessage() = 0;
+
+               private:
+                       std::string getText(ListItem &item, const char *part) override;
+       };
+}
+
+#endif // BlockedMsgDetailListViewItem_h_
diff --git a/src/Settings/View/inc/SettingsBlockedMsgDetailView.h b/src/Settings/View/inc/SettingsBlockedMsgDetailView.h
deleted file mode 100644 (file)
index fc56bdb..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017 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 SettingsBlockedMsgDetailView_h_
-#define SettingsBlockedMsgDetailView_h_
-
-#include "ListItem.h"
-#include "LangUtils.h"
-
-namespace Msg {
-       class SettingsBlockedMsgDetailView
-               : public ListItem {
-               public:
-                       SettingsBlockedMsgDetailView();
-                       virtual ~SettingsBlockedMsgDetailView();
-
-                       void setTime(std::string time);
-                       void setMessage(std::string message);
-
-               private:
-                       std::string getText(ListItem &item, const char *part) override;
-
-               private:
-                       std::string m_Time;
-                       std::string m_Message;
-       };
-}
-
-#endif // SettingsBlockedMsgDetailView_h_
diff --git a/src/Settings/View/src/BlockedMsgDetailListViewItem.cpp b/src/Settings/View/src/BlockedMsgDetailListViewItem.cpp
new file mode 100644 (file)
index 0000000..4d30ca4
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2017 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 "BlockedMsgDetailListViewItem.h"
+#include "TimeUtils.h"
+
+#include <string.h>
+
+using namespace Msg;
+
+namespace {
+       const char *msgTime = "elm.text";
+       const char *msgText = "elm.text.1";
+}
+
+BlockedMsgDetailListViewItem::BlockedMsgDetailListViewItem()
+       : ListItem(ListItemStyle::create("message_detail"))
+{
+}
+
+BlockedMsgDetailListViewItem::~BlockedMsgDetailListViewItem()
+{
+}
+
+std::string BlockedMsgDetailListViewItem::getText(ListItem &item, const char *part)
+{
+       if (!strcmp(part, msgTime))
+               return getTime();
+       else if (!strcmp(part, msgText)) {
+               return getMessage();
+       }
+
+       return "";
+}
+
diff --git a/src/Settings/View/src/SettingsBlockedMsgDetailView.cpp b/src/Settings/View/src/SettingsBlockedMsgDetailView.cpp
deleted file mode 100644 (file)
index bebf240..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017 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 <string.h>
-#include "SettingsBlockedMsgDetailView.h"
-#include "TimeUtils.h"
-
-using namespace Msg;
-
-namespace {
-       const char *msgTime = "elm.text";
-       const char *msgText = "elm.text.1";
-}
-
-SettingsBlockedMsgDetailView::SettingsBlockedMsgDetailView()
-       : ListItem(ListItemStyle::create("message_detail"))
-{
-}
-
-SettingsBlockedMsgDetailView::~SettingsBlockedMsgDetailView()
-{
-}
-
-void SettingsBlockedMsgDetailView::setTime(std::string time)
-{
-       m_Time = std::move(time);
-}
-
-void SettingsBlockedMsgDetailView::setMessage(std::string message)
-{
-       m_Message = std::move(message);
-}
-
-std::string SettingsBlockedMsgDetailView::getText(ListItem &item, const char *part)
-{
-       if (!strcmp(part, msgTime))
-               return m_Time;
-       else if (!strcmp(part, msgText)) {
-               return m_Message;
-       }
-
-       return "";
-}
-