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

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

#include "main-app.h"

typedef struct _slider_popup slider_popup;

typedef void (*slider_popup_changed_cb)(slider_popup *obj, void *user_data);
typedef void (*slider_popup_closed_cb)(slider_popup *obj, bool result, void *user_data);

/**
 * @brief Add new popup with slider
 * @param[in] app       Main application data structure.
 * @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 slider_popup
 */
slider_popup *slider_popup_add(app_data *app, Evas_Object *parent, Elm_Popup_Orient orient, const char *title);

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

/**
 * @brief Set label text
 * @param[in] obj    Instance of slider_popup
 * @param[in] label  Label of slider
 */
void slider_popup_label_set(slider_popup *obj, const char *label);

/**
 * @brief Set value of slider
 * @param[in] obj  Instance of slider_popup
 * @param[in] value  Value state of slider
 */
void slider_popup_value_set(slider_popup *obj, int value);

/**
 * @brief Set min and max state of slider
 * @param[in] obj    Instance of slider_popup
 * @param[in] min  Min state
 * @param[in] max  Max state
 */
void slider_popup_min_max_set(slider_popup *obj, int min, int max);

/**
 * @brief Show and prepare slider
 * @param[in] obj    Instance of slider_popup
 */
void slider_popup_show(slider_popup *obj);

/**
 * @brief Set callbacks
 * @param[in] obj    Instance of radio_popup
 * @param[in] changed_cb slider changed callbcak
 * @param[in] closed_cb popup closed callbcak
 * @param[in] user_data    User data to pass
 */
void slider_popup_callback_set(slider_popup *obj, slider_popup_changed_cb changed_cb,
        slider_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 slider_popup_value_get(const slider_popup *obj);


#endif /* SLIDER_POPUP_H_ */
