TizenRefApp-8329 Implement skeleton of settings Frame 11/123411/1
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 5 Apr 2017 10:35:55 +0000 (13:35 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 5 Apr 2017 10:38:11 +0000 (13:38 +0300)
Change-Id: I585d8f40a9af9362bccb0250be9a28f8ca8a8684
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Common/View/inc/NaviFrameView.h
src/Common/View/src/MoreOption.cpp
src/Common/View/src/NaviFrameView.cpp
src/MsgThread/Controller/inc/MsgThreadFrame.h
src/MsgThread/Controller/src/MsgThreadFrame.cpp
src/Settings/Controller/inc/SettingsBlockListFrame.h [new file with mode: 0644]
src/Settings/Controller/inc/SettingsFrame.h
src/Settings/Controller/src/SettingsBlockListFrame.cpp [new file with mode: 0644]
src/Settings/Controller/src/SettingsFrame.cpp

index 39f4373b986fa960c5ca2157c7b279b980f58f11..063de360e536fbf2fb2dd23db51ceadc55a53b9c 100644 (file)
@@ -56,7 +56,7 @@ namespace Msg
             /**
              * @brief Pushes new frame. Attaches @content to frame. Updates @item with created frame.
              */
-            void push(NaviFrameItem &item, Evas_Object *content = nullptr);
+            void push(NaviFrameItem &item);
 
             /**
              * @brief Pops top item from Naviframe.
index 01892262fece5787c7bc7d069779763ac4ef4056..ee4a7451648a911c2e0bee3ea02397a3a0405942 100644 (file)
@@ -53,7 +53,12 @@ Eext_Object_Item *MoreOption::appendItem(const TText &mainText,
     Eext_Object_Item *item = eext_more_option_item_append(getEo());
     m_ItemMap[item] = {cb, userData};
     eext_more_option_item_part_content_set(item, "item,icon", icon);
-    eext_more_option_item_domain_translatable_part_text_set(item, "selector,main_text", mainText.getDomain(), mainText.getMsg());
+
+    if (mainText.isTranslatable())
+        eext_more_option_item_domain_translatable_part_text_set(item, "selector,main_text", mainText.getDomain(), mainText.getMsg());
+    else
+        eext_more_option_item_part_text_set(item, "selector,main_text", mainText.getMsg());
+
     return item;
 }
 
index 4a84be531adc6ebc5300007c19dc6ea47a6e17cb..1de4c2fd25b3ed4eb29726ec3194cb03ac94ae82 100644 (file)
@@ -111,11 +111,11 @@ bool NaviFrameView::isEmpty() const
     return getItemsCount() <= 0;
 }
 
-void NaviFrameView::push(NaviFrameItem &item, Evas_Object *content)
+void NaviFrameView::push(NaviFrameItem &item)
 {
     m_TransitionStatus = !isEmpty();
     pause();
-    Elm_Object_Item *it = elm_naviframe_item_push(getEo(), nullptr, nullptr, nullptr, content, naviTitleStyleEmpty);
+    Elm_Object_Item *it = elm_naviframe_item_push(getEo(), nullptr, nullptr, nullptr, nullptr, naviTitleStyleEmpty);
     item.setElmObjItem(it);
     processSignal();
     resume();
index df1f3d640c25ca2aac63b01f606501188f888ae3..9422175e41d921e8bfefd4fbcbe5799065c01775 100644 (file)
@@ -72,6 +72,7 @@ namespace Msg {
             // More option:
             void onNewMessageClicked(MoreOption &obj);
             void onDeleteClicked(MoreOption &obj);
+            void onSettingsClicked(MoreOption &obj);
 
             // IThreadListListener:
             void onItemSelected(ThreadId id) override;
index 455e1fa960e62b7a0edd9c07c4f8c346645f257a..b20a2286cc01df1bc01cb387faaf178207d145d2 100644 (file)
@@ -27,6 +27,7 @@
 #include "Resource.h"
 #include "RecipFrame.h"
 #include "ConvFrame.h"
+#include "SettingsFrame.h"
 
 using namespace Msg;
 
@@ -122,6 +123,7 @@ void MsgThreadFrame::prepareMoreOption()
         m_pMoreOption->setDirection(EEXT_MORE_OPTION_DIRECTION_RIGHT);
         m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_NEW_MESSAGE_ABB"), NEW_MSG_MORE_ICON, makeCbLast(&MsgThreadFrame::onNewMessageClicked), this);
         m_pMoreOption->appendItem(msgt("WDS_MSG_OPT_DELETE_ABB"), DELETEG_MORE_ICON, makeCbLast(&MsgThreadFrame::onDeleteClicked), this);
+        m_pMoreOption->appendItem("Settings", nullptr, makeCbLast(&MsgThreadFrame::onSettingsClicked), this); // TODO: only for test
         m_pLayout->setMoreOption(*m_pMoreOption);
     }
 }
@@ -237,6 +239,12 @@ void MsgThreadFrame::onDeleteClicked(MoreOption &obj)
     setMode(DeleteMode);
 }
 
+void MsgThreadFrame::onSettingsClicked(MoreOption &obj)
+{
+    MSG_LOG("");
+    getParent().push(*new SettingsFrame(getParent()));
+}
+
 void MsgThreadFrame::onItemSelected(ThreadId id)
 {
     MSG_LOG("");
diff --git a/src/Settings/Controller/inc/SettingsBlockListFrame.h b/src/Settings/Controller/inc/SettingsBlockListFrame.h
new file mode 100644 (file)
index 0000000..911c8a4
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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 SettingsBlockListFrame_h_
+#define SettingsBlockListFrame_h_
+
+#include "FrameController.h"
+#include "ListView.h"
+
+namespace Msg
+{
+    class SettingsBlockListFrame
+        : public FrameController
+        , private IListViewListener
+    {
+        public:
+            SettingsBlockListFrame(NaviFrameController &parent);
+            virtual ~SettingsBlockListFrame();
+
+        protected:
+            // NaviFrameItem:
+            void onAttached(ViewItem &item) override;
+
+        private:
+            // IListViewListener:
+            void onListItemSelected(ListItem &listItem) override;
+
+            void preapareList();
+
+        private:
+            ListView *m_pList;
+    };
+}
+
+#endif /* SettingsBlockListFrame_h_ */
index e22eda179138ca8baa2cb0a540ec088b54195861..a2620ab0d00fe16b3b39b0b49a9a411b0dbc855d 100644 (file)
@@ -18,6 +18,7 @@
 #define SettingsFrame_h_
 
 #include "FrameController.h"
+#include "SettingsBlockListFrame.h"
 
 namespace Msg
 {
@@ -26,7 +27,7 @@ namespace Msg
      *        sub-components of message settings.
      */
     class SettingsFrame
-        : public FrameController
+        : public SettingsBlockListFrame
     {
         public:
             /**
diff --git a/src/Settings/Controller/src/SettingsBlockListFrame.cpp b/src/Settings/Controller/src/SettingsBlockListFrame.cpp
new file mode 100644 (file)
index 0000000..9c9b426
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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 "SettingsBlockListFrame.h"
+#include "App.h"
+#include "Window.h"
+#include "Logger.h"
+
+using namespace Msg;
+
+SettingsBlockListFrame::SettingsBlockListFrame(NaviFrameController &parent)
+    : FrameController(parent)
+    , m_pList(nullptr)
+{
+    preapareList();
+}
+
+SettingsBlockListFrame::~SettingsBlockListFrame()
+{
+
+}
+
+void SettingsBlockListFrame::onAttached(ViewItem &item)
+{
+    FrameController::onAttached(item);
+    setContent(*m_pList);
+}
+
+void SettingsBlockListFrame::preapareList()
+{
+    if (!m_pList) {
+        m_pList = new ListView(getParent(), App::getInst().getWindow().getCircleSurface());
+        m_pList->setListener(this);
+        m_pList->setHomogeneous(false);
+        m_pList->setMultiSelection(false);
+    }
+}
+
+void SettingsBlockListFrame::onListItemSelected(ListItem &listItem)
+{
+
+}
index 80e06550e0cbacc19fa1c79859bce6a35843904a..65b4e148f95aba1e5e970dd3895df26c1addb236 100644 (file)
  */
 
 #include "SettingsFrame.h"
+#include "Logger.h"
 
 using namespace Msg;
 
 SettingsFrame::SettingsFrame(NaviFrameController &parent)
-    : FrameController(parent)
+    : SettingsBlockListFrame(parent)
 {
 }
 
@@ -29,4 +30,6 @@ SettingsFrame::~SettingsFrame()
 
 void SettingsFrame::onAttached(ViewItem &item)
 {
+    MSG_LOG("");
+    SettingsBlockListFrame::onAttached(item);
 }