Updated Settings according to UX.
Change-Id: I10fc7daaeb558817d7295f3b73cfb5c3e0b823aa
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
#include "Ui/GenContainer.h"
#include "Ui/GenItem.h"
+
+#include <string>
#include <vector>
namespace Ui
class EXPORT_API GenGroupItem : virtual public GenItem
{
public:
+ /**
+ * @brief Create group item.
+ * @param[in] title Item title (can be translatable)
+ */
+ explicit GenGroupItem(const char *title = nullptr);
virtual ~GenGroupItem() override;
/**
virtual Elm_Gen_Item_Class *getItemClass() const override;
/**
+ * @brief Sets item title into "elm.text" part.
+ * @see GenItem::getText()
+ */
+ virtual char *getText(Evas_Object *parent, const char *part) override;
+
+ /**
+ * @brief Inserts all subitems.
* @see GenItem::onInserted()
*/
virtual void onInserted() override;
/**
+ * @brief Pops all subitems.
* @see GenItem::onPop()
*/
virtual void onPop() override;
void insertSubItems();
void popSubItems();
+ std::string m_Title;
std::vector<GenItemPtr> m_ItemsCache;
};
}
#include "Ui/GenGroupItem.h"
#include <algorithm>
+#include <app_i18n.h>
using namespace Ui;
+GenGroupItem::GenGroupItem(const char *title)
+{
+ if (title) {
+ m_Title = title;
+ }
+}
+
GenGroupItem::~GenGroupItem()
{
for (auto &&itemPtr : m_ItemsCache) {
return &itc;
}
+char *GenGroupItem::getText(Evas_Object *parent, const char *part)
+{
+ if (strcmp(part, "elm.text") == 0) {
+ return strdup(_(m_Title.c_str()));
+ }
+
+ return nullptr;
+}
+
void GenGroupItem::onInserted()
{
+ if (getType() == ELM_GENLIST_ITEM_GROUP) {
+ elm_genlist_item_select_mode_set(getObjectItem(), ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ }
if (isExpanded()) {
insertSubItems();
}
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 CONTACTS_GROUPS_GROUPS_ITEM_H
-#define CONTACTS_GROUPS_GROUPS_ITEM_H
-
-#include "Ui/GenGroupItem.h"
-
-namespace Contacts
-{
- namespace Groups
- {
- /**
- * @brief Represents the group containing groups genlist items.
- */
- class GroupsItem : public Ui::GenGroupItem
- {
- public:
- /**
- * @brief Create group item.
- * @param[in] title Item's title
- */
- GroupsItem(const char *title);
-
- private:
- virtual char *getText(Evas_Object *parent, const char *part) override;
-
- std::string m_Title;
- };
- }
-}
-
-
-
-#endif /* CONTACTS_GROUPS_GROUPS_ITEM_H */
{
class Genlist;
class GenItem;
+ class GenGroupItem;
}
namespace Contacts
namespace Groups
{
class GroupItem;
- class GroupsItem;
class CreateGroupItem;
namespace Model
Ui::Genlist *m_Genlist;
CreateGroupItem *m_CreateItem;
Model::GroupsProvider m_Provider;
- GroupsItem *m_GroupsItem;
+ Ui::GenGroupItem *m_GroupsItem;
bool m_IsAssignMode;
int m_NewGroupId;
* @param[in] provider Section provider
*
*/
- ListSection(std::string title, Model::PersonProvider *provider,
+ ListSection(const char *title, Model::PersonProvider *provider,
SectionMode mode = DefaultMode);
virtual ~ListSection() override;
protected:
void onPersonInserted(::Model::DataItem &person);
- ContactItem *createItem(Model::Person &person);
-
- private:
- virtual char *getText(Evas_Object *parent, const char *part) override;
-
void onPersonDeleted(ContactItem *item);
+ ContactItem *createItem(Model::Person &person);
- std::string m_Title;
UpdateCallback m_OnUpdated;
Model::PersonProvider *m_Provider;
SectionMode m_Mode;
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 CONTACTS_LIST_MY_PROFILE_GROUP_H
-#define CONTACTS_LIST_MY_PROFILE_GROUP_H
-
-#include "Ui/GenGroupItem.h"
-
-namespace Contacts
-{
- namespace List
- {
- /**
- * @brief Represents the group containing "My Profile" genlist item.
- */
- class MyProfileGroup : public Ui::GenGroupItem
- {
- public:
- MyProfileGroup();
-
- private:
- virtual char *getText(Evas_Object *parent, const char *part) override;
- };
- }
-}
-
-#endif /* CONTACTS_LIST_MY_PROFILE_GROUP_H */
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 "Contacts/Groups/GroupsItem.h"
-#include <app_i18n.h>
-
-using namespace Contacts::Groups;
-
-GroupsItem::GroupsItem(const char *title)
- : m_Title(title)
-{
-}
-
-char *GroupsItem::getText(Evas_Object *parent, const char *part)
-{
- if (strcmp(part, "elm.text") == 0) {
- return strdup(_(m_Title.c_str()));
- }
-
- return nullptr;
-}
#include "Contacts/Groups/CreateGroupItem.h"
#include "Contacts/Groups/GroupItem.h"
-#include "Contacts/Groups/GroupsItem.h"
#include "Contacts/Groups/InputView.h"
#include "Contacts/Groups/Model/Group.h"
#include "Common/Strings.h"
#include "Ui/Genlist.h"
+#include "Ui/GenGroupItem.h"
#include "Ui/Menu.h"
#include "Ui/Navigator.h"
m_Genlist = new Ui::Genlist();
m_Genlist->create(parent);
- m_GroupsItem = new GroupsItem("IDS_PB_OPT_GROUPS");
+ m_GroupsItem = new Ui::GenGroupItem("IDS_PB_OPT_GROUPS");
m_Genlist->insert(m_GroupsItem);
for (auto &&data : m_Provider.getDataList()) {
insertItem(createItem(*static_cast<Group *>(data)));
#include "Contacts/List/Model/Person.h"
#include "Contacts/List/Model/PersonProvider.h"
-#include <app_i18n.h>
-
using namespace Contacts::List;
using namespace Contacts::List::Model;
-ListSection::ListSection(std::string title, PersonProvider *provider, SectionMode mode)
- : m_Title(title), m_Provider(provider), m_Mode(mode)
+ListSection::ListSection(const char *title, PersonProvider *provider, SectionMode mode)
+ : GenGroupItem(title), m_Provider(provider), m_Mode(mode)
{
m_Provider->setInsertCallback(std::bind(&ListSection::onPersonInserted, this, std::placeholders::_1));
}
}
-char *ListSection::getText(Evas_Object *parent, const char *part)
-{
- if (strcmp(part, "elm.text") == 0) {
- return strdup(_(m_Title.c_str()));
- }
-
- return nullptr;
-}
-
void ListSection::onPersonInserted(::Model::DataItem &person)
{
ContactItem *item = createItem(static_cast<Person &>(person));
#include "Contacts/List/Model/PersonProvider.h"
#include "Contacts/List/Model/PersonSearchData.h"
-#include "Contacts/List/MyProfileGroup.h"
+#include "Contacts/List/MyProfileItem.h"
#include "Contacts/List/PersonGroupItem.h"
#include "Contacts/List/PersonSearchItem.h"
#include "Contacts/List/SearchItem.h"
Ui::GenGroupItem *ListView::createMyProfileSection()
{
- MyProfileGroup *section = new MyProfileGroup();
+ auto section = new Ui::GenGroupItem("IDS_PB_HEADER_ME");
+ section->insertSubItem(new MyProfileItem());
insertSection(section, SectionMyProfile);
return section;
}
void ListView::insertSection(Ui::GenGroupItem *section, SectionId sectionId)
{
m_Genlist->insert(section, nullptr, getNextSectionItem(sectionId));
- elm_genlist_item_select_mode_set(section->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
-
updateSearchItem();
}
PersonGroupItem *item = new PersonGroupItem(indexLetter);
item->setIndexItem(indexItem);
m_Genlist->insert(item, nullptr, nextGroupItem);
- elm_genlist_item_select_mode_set(item->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
return item;
}
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 "Contacts/List/MyProfileGroup.h"
-#include "Contacts/List/MyProfileItem.h"
-#include <app_i18n.h>
-
-using namespace Contacts::List;
-
-MyProfileGroup::MyProfileGroup()
-{
- insertSubItem(new MyProfileItem());
-}
-
-char *MyProfileGroup::getText(Evas_Object *parent, const char *part)
-{
- if (strcmp(part, "elm.text") == 0) {
- return strdup(_("IDS_PB_HEADER_ME"));
- }
-
- return nullptr;
-}
void RemoveFavView::insertSection(Ui::GenGroupItem *section, SectionId sectionId)
{
m_Genlist->insert(section, nullptr, getNextSectionItem(sectionId));
- elm_genlist_item_select_mode_set(section->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
}
void RemoveFavView::updateSection(SectionId sectionId)
new FavoritesProvider(), ListSection::ReorderMode);
m_Genlist->insert(m_Section);
- elm_genlist_item_select_mode_set(m_Section->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
evas_object_smart_callback_add(m_Genlist->getEvasObject(), "moved",
makeCallback(&ReorderView::onReorder), this);
#include "Contacts/Settings/NameFormatItem.h"
#include "Contacts/Settings/ExportItem.h"
#include "Contacts/Settings/ImportItem.h"
+
#include "Ui/Genlist.h"
+#include "Ui/GenGroupItem.h"
using namespace Contacts::Settings;
{
m_Genlist = new Ui::Genlist();
m_Genlist->create(parent);
- m_Genlist->insert(new SortByItem());
- m_Genlist->insert(new NameFormatItem());
- m_Genlist->insert(new ExportItem());
- m_Genlist->insert(new ImportItem());
+
+ auto groupItem = new Ui::GenGroupItem("IDS_PB_HEADER_MANAGE_AND_BACK_UP_CONTACTS_ABB2");
+ m_Genlist->insert(groupItem);
+ m_Genlist->insert(new ExportItem(), groupItem);
+ m_Genlist->insert(new ImportItem(), groupItem);
+
+ groupItem = new Ui::GenGroupItem("IDS_PB_HEADER_DISPLAY");
+ m_Genlist->insert(groupItem);
+ m_Genlist->insert(new SortByItem(), groupItem);
+ m_Genlist->insert(new NameFormatItem(), groupItem);
return m_Genlist->getEvasObject();
}
Log *log = group->getLogList().back();
LogGroupItem *groupItem = new LogGroupItem(log->getTime());
m_Genlist->insert(groupItem, nullptr, getLastGroupItem());
- elm_genlist_item_select_mode_set(groupItem->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
+
setLastGroupItem(groupItem);
group->setLogAddCallback(std::bind(&DetailsView::onLogAdded, this, _1));
group->addChangeCallback(std::bind(&DetailsView::onGroupChanged, this, group, groupItem, _1));
{
LogGroupItem *groupItem = new LogGroupItem(date);
m_Genlist->insert(groupItem, nullptr, getLastGroupItem());
- elm_genlist_item_select_mode_set(groupItem->getObjectItem(), ELM_OBJECT_SELECT_MODE_NONE);
-
setLastGroupItem(groupItem);
return groupItem;
}