--- /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 ContactListItemView_h_
+#define ContactListItemView_h_
+
+#include "ListItem.h"
+#include <string>
+
+namespace Msg {
+ class ContactListViewItem
+ : public ListItem {
+ public:
+ ContactListViewItem();
+ virtual ~ContactListViewItem();
+
+ protected:
+ static ListItemStyleRef logStyle;
+ static ListItemStyleRef nameOrEmailStyle;
+
+ virtual std::string getSubText() = 0;
+ virtual std::string getMainText() = 0;
+
+ private:
+ std::string getText(ListItem &item, const char *part) override;
+ };
+}
+
+#endif // ContactListItemView_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 "ContactListViewItem.h"
+#include <string.h>
+
+using namespace Msg;
+
+ListItemStyleRef ContactListViewItem::logStyle = ListItemStyle::create("1text");
+ListItemStyleRef ContactListViewItem::nameOrEmailStyle = ListItemStyle::create("2text");
+
+namespace {
+ const char *mainTextPart = "elm.text";
+ const char *subTextPart = "elm.text.1";
+}
+
+ContactListViewItem::ContactListViewItem()
+ : ListItem(ELM_GENLIST_ITEM_NONE)
+{
+}
+
+ContactListViewItem::~ContactListViewItem()
+{
+}
+
+std::string ContactListViewItem::getText(ListItem &item, const char *part)
+{
+ if (strcmp(part, mainTextPart) == 0)
+ return getMainText();
+
+ if (getStyle() == nameOrEmailStyle && strcmp(part, subTextPart) == 0)
+ return getSubText();
+
+ return "";
+}