TizenRefApp-8347 Implement SettingsBlockedMsgDetailFrame class 10/124110/2
authorOleksander Kostenko <o.kostenko@samsung.com>
Mon, 10 Apr 2017 08:05:03 +0000 (11:05 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 12 Apr 2017 07:49:45 +0000 (00:49 -0700)
Change-Id: I2a7b4b9f46ac14284a83f22830d571a859102970
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
src/Settings/Controller/inc/SettingsBlockListFrame.h
src/Settings/Controller/inc/SettingsBlockedMsgDetailFrame.h [new file with mode: 0644]
src/Settings/Controller/src/SettingsBlockListFrame.cpp
src/Settings/Controller/src/SettingsBlockedMsgDetailFrame.cpp [new file with mode: 0644]

index 003fb36b00e8d54ee104ac56d4e03007e05b77c7..a10dec3392f7fc47c71372994e9164f6ad1ce271 100644 (file)
@@ -33,7 +33,8 @@ namespace Msg {
     class NoContentListViewItem;
 
     class SettingsBlockListFrame
-        : public FrameController {
+        : public FrameController
+        , private IListViewListener {
 
         public:
             enum BlockListType {
@@ -59,6 +60,9 @@ namespace Msg {
             void onRestoreClicked(MoreOption &obj);
             void onDeleteClicked(MoreOption &obj);
 
+            // IListViewListener:
+            void onListItemSelected(ListItem &listItem) override;
+
             void prepareMainLayout();
             void prepareMoreOption();
             void prepareSelectViews();
diff --git a/src/Settings/Controller/inc/SettingsBlockedMsgDetailFrame.h b/src/Settings/Controller/inc/SettingsBlockedMsgDetailFrame.h
new file mode 100644 (file)
index 0000000..ecdf776
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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 SettingsBlockedMsgDetailFrame_h_
+#define SettingsBlockedMsgDetailFrame_h_
+
+#include "FrameController.h"
+
+namespace Msg {
+    class MoreOption;
+    class DefaultLayout;
+
+    class SettingsBlockedMsgDetailFrame
+        : public FrameController {
+        public:
+            SettingsBlockedMsgDetailFrame(NaviFrameController &parent);
+            virtual ~SettingsBlockedMsgDetailFrame();
+
+        protected:
+            // NaviFrameItem:
+            void onAttached(ViewItem &item) override;
+
+        private:
+            // More option:
+            void onRestoreClicked(MoreOption &obj);
+            void onDeleteClicked(MoreOption &obj);
+
+            void prepareMainLayout();
+            void prepareMoreOption();
+
+        private:
+            DefaultLayout *m_pLayout;
+            MoreOption *m_pMoreOption;
+    };
+}
+
+#endif // SettingsBlockedMsgDetailFrame_h_
index d7f528dc5bc8dde8bc32753d04102aca15aa0eb7..426ec2f8242222574c99421f6bb9f10e349acab8 100644 (file)
@@ -27,6 +27,7 @@
 #include "BlockedNumberListItem.h"
 #include "BlockedMsgListItem.h"
 #include "NoContentListViewItem.h"
+#include "SettingsBlockedMsgDetailFrame.h"
 
 using namespace Msg;
 
@@ -88,6 +89,7 @@ void SettingsBlockListFrame::preapareList()
         m_pList = new ListView(getParent(), App::getInst().getWindow().getCircleSurface());
         m_pList->setHomogeneous(false);
         m_pList->setMultiSelection(false);
+        m_pList->setListener(this);
         m_pLayout->setContent(*m_pList);
         fillList();
     }
@@ -112,7 +114,7 @@ void SettingsBlockListFrame::prepareMoreOption()
     if (!m_pMoreOption) {
         m_pMoreOption = new MoreOption(*m_pLayout);
         m_pMoreOption->setDirection(EEXT_MORE_OPTION_DIRECTION_RIGHT);
-        m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_NEW_MESSAGE_ABB"), NEW_MSG_MORE_ICON, makeCbLast(&SettingsBlockListFrame::onRestoreClicked), this);
+        m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_RESTORE_ABB"), RESTORE_MORE_ICON, makeCbLast(&SettingsBlockListFrame::onRestoreClicked), this);
         m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_DELETE_ABB"), DELETEG_MORE_ICON, makeCbLast(&SettingsBlockListFrame::onDeleteClicked), this);
         m_pLayout->setMoreOption(*m_pMoreOption);
     }
@@ -225,5 +227,10 @@ void SettingsBlockListFrame::onSelectButtonClicked(Evas_Object *obj, void *event
     MSG_LOG("");
 }
 
-
+void SettingsBlockListFrame::onListItemSelected(ListItem &listItem)
+{
+    MSG_LOG("");
+    auto *frame = new SettingsBlockedMsgDetailFrame(getParent());
+    getParent().push(*frame);
+}
 
diff --git a/src/Settings/Controller/src/SettingsBlockedMsgDetailFrame.cpp b/src/Settings/Controller/src/SettingsBlockedMsgDetailFrame.cpp
new file mode 100644 (file)
index 0000000..5aeec8a
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * 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 "SettingsBlockedMsgDetailFrame.h"
+#include "LangUtils.h"
+#include "DefaultLayout.h"
+#include "MoreOption.h"
+#include "IconTextPopup.h"
+
+using namespace Msg;
+
+SettingsBlockedMsgDetailFrame::SettingsBlockedMsgDetailFrame(NaviFrameController &parent)
+    : FrameController(parent)
+    , m_pLayout(nullptr)
+    , m_pMoreOption(nullptr)
+{
+    prepareMainLayout();
+    prepareMoreOption();
+}
+
+SettingsBlockedMsgDetailFrame::~SettingsBlockedMsgDetailFrame()
+{
+}
+
+void SettingsBlockedMsgDetailFrame::onAttached(ViewItem &item)
+{
+    MSG_LOG("");
+    FrameController::onAttached(item);
+    setContent(*m_pLayout);
+}
+
+void SettingsBlockedMsgDetailFrame::prepareMainLayout()
+{
+    if (!m_pLayout) {
+        m_pLayout = new DefaultLayout(getParent());
+        m_pLayout->showMoreOption(true);
+    }
+}
+
+void SettingsBlockedMsgDetailFrame::prepareMoreOption()
+{
+    if (!m_pMoreOption) {
+        m_pMoreOption = new MoreOption(*m_pLayout);
+        m_pMoreOption->setDirection(EEXT_MORE_OPTION_DIRECTION_RIGHT);
+        m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_RESTORE_ABB"), RESTORE_MORE_ICON, makeCbLast(&SettingsBlockedMsgDetailFrame::onRestoreClicked), this);
+        m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_DELETE_ABB"), DELETEG_MORE_ICON, makeCbLast(&SettingsBlockedMsgDetailFrame::onDeleteClicked), this);
+        m_pLayout->setMoreOption(*m_pMoreOption);
+    }
+}
+
+void SettingsBlockedMsgDetailFrame::onRestoreClicked(MoreOption &obj)
+{
+    MSG_LOG("");
+    auto *popup = new IconTextPopup;
+    popup->setIcon(IconTextPopup::CheckIcon);
+    popup->setText(msgt("WDS_MSG_TPOP_MESSAGE_RESTORED_ABB"));
+    popup->setTimeOut();
+    popup->show();
+}
+
+void SettingsBlockedMsgDetailFrame::onDeleteClicked(MoreOption &obj)
+{
+    MSG_LOG("");
+}