/*
 * 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 __RADIO_POPUP_H__
#define __RADIO_POPUP_H__

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

#include "main-app.h"

typedef struct _radio_popup radio_popup;
typedef void (*radio_popup_item_selected_cb)(radio_popup *obj, void *user_data);
typedef void (*radio_popup_closed_cb)(radio_popup *obj, bool result, void *user_data);

/**
 * @brief Add new popup with radio 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 radio_popup
 */
radio_popup *radio_popup_add(Evas_Object *parent, Elm_Popup_Orient orient, const char *title);

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

/**
 * @brief Add item with text end radio button
 * @param[in] obj        Instance of radio_popup
 * @param[in] text       Text of item
 * @param[in] radio_val  Value of radio button
 * @return Genlist item
 */
Elm_Object_Item *radio_popup_item_add(radio_popup *obj, const char *text, int radio_val);

/**
 * @brief Select radio button
 * @param[in] obj        Instance of radio_popup
 * @param[in] radio_val  Value of radio button
 */
void radio_popup_select_item(radio_popup *obj, int radio_val);

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

/**
 * @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 radio_popup_callback_set(radio_popup *obj, radio_popup_item_selected_cb selected_cb,
        radio_popup_closed_cb closed_cb, const void *user_data);

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

#endif // __RADIO_POPUP_H__
