/*
 * Copyright (c) 2014 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 __LIST_POPUP_H__
#define __LIST_POPUP_H__

#include <Elementary.h>
#include <stdbool.h>

#include "main-app.h"

typedef struct _list_popup list_popup;
typedef void (*list_popup_item_selected_cb)(list_popup *obj, void *user_data);
typedef void (*list_popup_closed_cb)(list_popup *obj, bool result, void *user_data);

/**
 * @brief Add new popup with list button
 * @param[in] parent    Parent of popup
 * @param[in] orient    Location of popup on the screen
 * @param[in] title     Top Title of popup
 * @return Instance to new list_popup
 */
list_popup *list_popup_add(Evas_Object *parent, Elm_Popup_Orient orient, const char *title);

/**
 * @brief Delete list_popup object
 * @param[in] obj    Instance of list_popup
 */
void list_popup_del(list_popup *obj);

/**
 * @brief Add item with text end list button
 * @param[in] obj        Instance of list_popup
 * @param[in] text       Text of item
 * @param[in] list_val  Value of list button
 */
void list_popup_item_add(list_popup *obj, const char *text, int list_val);

/**
 * @brief Set callbacks
 * @param[in] obj    Instance of radio_popup
 * @param[in] selected_cb item selected callbcak
 * @param[in] closed_cb popup closed callbcak
 * @param[in] user_data    User data to pass
 */
void list_popup_callback_set(list_popup *obj, list_popup_item_selected_cb selected_cb,
        list_popup_closed_cb closed_cb, const void *user_data);

/**
 * @brief Show popup
 * @param[in] obj          Instance of list_popup
 */
void list_popup_show(list_popup *obj);

/**
 * @brief Get value of selected item
 * @param[in] obj        Instance of list_popup
 * @return value of selected
 */
int list_popup_selected_item_value_get(const list_popup *obj);

#endif // __LIST_POPUP_H__
