void ListView::createListView(Evas_Object *parent, Eext_Circle_Surface *parentCircleSurface)
{
setEo(elm_genlist_add(parent));
- evas_object_smart_callback_add(getEo(), "realized", ListView::on_realized_cb, this);
- evas_object_smart_callback_add(getEo(), "unrealized", ListView::on_unrealized_cb, this);
- evas_object_smart_callback_add(getEo(), "longpressed", ListView::on_longpressed_cb, this);
+ setMode(ELM_LIST_COMPRESS);
+ addSmartCb("realized", ListView::on_realized_cb, this);
+ addSmartCb("unrealized", ListView::on_unrealized_cb, this);
+ addSmartCb("longpressed", ListView::on_longpressed_cb, this);
if (parentCircleSurface) {
// Default settings:
--- /dev/null
+/*
+ * 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 ContactFrame_h_
+#define ContactFrame_h_
+
+#include "FrameController.h"
+#include "ListView.h"
+#include "ContactAddress.h"
+
+namespace Msg {
+
+ class IContactFrameListener;
+
+ class ContactFrame
+ : public FrameController
+ , private IListViewListener {
+
+ public:
+ ContactFrame(NaviFrameController &parent);
+ virtual ~ContactFrame();
+
+ void setListener(IContactFrameListener *l);
+
+ private:
+ // NaviFrameItem:
+ void onAttached(ViewItem &item) override;
+
+ // Hw buttons:
+ void onHwBackButtonPreessed(Evas_Object *obj, void *event);
+
+ // IListViewListener:
+ void onListItemSelected(ListItem &listItem) override;
+
+ private:
+ void prepareList();
+
+ private:
+ ListView *m_pList;
+ IContactFrameListener *m_pListener;
+ };
+
+ class IContactFrameListener {
+ public:
+ virtual ~IContactFrameListener() {}
+ virtual void onContactSelected(ContactAddressRef &contact) {};
+ };
+}
+
+#endif /* ContactFrame_h_ */
--- /dev/null
+/*
+ * 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 "ContactFrame.h"
+
+using namespace Msg;
+
+ContactFrame::ContactFrame(NaviFrameController &parent)
+ : FrameController(parent)
+ , m_pList(nullptr)
+ , m_pListener(nullptr)
+{
+ MSG_LOG("");
+ prepareList();
+}
+
+ContactFrame::~ContactFrame()
+{
+ MSG_LOG("");
+}
+
+void ContactFrame::setListener(IContactFrameListener *l)
+{
+ m_pListener = l;
+}
+
+void ContactFrame::prepareList()
+{
+ if (!m_pList) {
+ m_pList = new ListView(getParent());
+ m_pList->addHwButtonEvent(EEXT_CALLBACK_BACK, makeCbFirst(&ContactFrame::onHwBackButtonPreessed), this);
+ m_pList->setHomogeneous(false);
+ m_pList->setMultiSelection(false);
+ m_pList->setListener(this);
+ }
+}
+
+void ContactFrame::onAttached(ViewItem &item)
+{
+ MSG_LOG("");
+ FrameController::onAttached(item);
+ setContent(*m_pList);
+}
+
+void ContactFrame::onListItemSelected(ListItem &listItem)
+{
+ MSG_LOG("");
+ if (m_pListener) {
+ // TODO: impl.
+ }
+}
+
+void ContactFrame::onHwBackButtonPreessed(Evas_Object *obj, void *event)
+{
+ MSG_LOG("");
+ pop();
+}
+