--- /dev/null
+/*
+ * Copyright (c) 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_MANAGE_FAVORITES_POPUP_H
+#define CONTACTS_LIST_MANAGE_FAVORITES_POPUP_H
+
+#include "Ui/ListPopup.h"
+
+namespace Ui
+{
+ class Navigator;
+}
+
+namespace Contacts
+{
+ namespace List
+ {
+ /**
+ * @brief The popup provides ability to add/reorder favorites and
+ * remove most frequent and favorites contacts
+ */
+ class ManageFavoritesPopup : public Ui::ListPopup
+ {
+ public:
+ /**
+ * @brief Creates new popup
+ * @param[in] navigator Current navigator. Is needed to move to the next view.
+ */
+ ManageFavoritesPopup(Ui::Navigator *navigator);
+
+ protected:
+ /**
+ * @see Control::onCreated()
+ */
+ virtual void onCreated() override;
+
+ private:
+ ManageFavoritesPopup(const ManageFavoritesPopup &that) = delete;
+ ManageFavoritesPopup & operator=(const ManageFavoritesPopup &that) = delete;
+
+ void onAdd();
+ void onReorder();
+ void onRemove();
+
+ Ui::Navigator *m_Navigator;
+ };
+ }
+}
+
+#endif /* CONTACTS_LIST_MANAGE_FAVORITES_POPUP_H */
#include "Contacts/List/ListView.h"
#include "Contacts/List/GroupItem.h"
+#include "Contacts/List/ManageFavoritesPopup.h"
#include "Contacts/List/Model/Person.h"
#include "Contacts/List/MyProfileItem.h"
#include "Contacts/List/PersonGroupItem.h"
getNavigator()->navigateTo(view);
});
+ menu->addItem("IDS_PB_OPT_MANAGE_FAVOURITES_ABB", [this] {
+ auto manageFavPopup = new ManageFavoritesPopup(getNavigator());
+ manageFavPopup->create(getEvasObject());
+ });
+
menu->addItem("IDS_PB_OPT_SETTINGS", [this] {
getNavigator()->navigateTo(new Settings::MainView());
});
--- /dev/null
+/*
+ * Copyright (c) 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/ListView.h"
+#include "Contacts/List/ManageFavoritesPopup.h"
+
+#include "Ui/Navigator.h"
+
+using namespace Contacts::List;
+using namespace Ui;
+
+ManageFavoritesPopup::ManageFavoritesPopup(Navigator *navigator)
+ : m_Navigator(navigator)
+{
+}
+
+void ManageFavoritesPopup::onCreated()
+{
+ ListPopup::onCreated();
+
+ setTitle("IDS_PB_HEADER_MANAGE_FAVOURITES_ABB");
+
+ addItem("IDS_PB_OPT_ADD", std::bind(&ManageFavoritesPopup::onAdd, this));
+ addItem("IDS_PB_OPT_REORDER", std::bind(&ManageFavoritesPopup::onReorder, this));
+ addItem("IDS_PB_OPT_REMOVE", std::bind(&ManageFavoritesPopup::onRemove, this));
+}
+
+void ManageFavoritesPopup::onAdd()
+{
+ ListView *view = new ListView();
+ view->setSelectMode(SelectMulti);
+ view->setSelectCallback([](SelectResults results) {
+ //todo
+ return true;
+ });
+ m_Navigator->navigateTo(view);
+}
+
+void ManageFavoritesPopup::onReorder()
+{
+ //todo
+}
+
+void ManageFavoritesPopup::onRemove()
+{
+ //todo
+}