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

#include <Evas.h>

/**
 * @typedef window_obj enum styles.
 * Enumeration of window object styles.
 */
typedef enum
{
    STYLE_NONE,
    STYLE_DEFAULT_WINDOW,
    STYLE_VIDEO_RECORDER_PLAYER
} window_view_style;


/**
 * @typedef window_obj.
 * Data of window object structure.
 */
typedef struct
{
    Evas_Object *win;/**< Main window */
    Evas_Object *bg;/**< Background object */
    Evas_Object *conform;/**< Conform host object */
    Evas_Object *layout;/**< User layout */

    window_view_style style;/**< Current window view style */
} window_obj;

/**
 * @brief Create window object.
 * @return instance of window object.
 *
 * To free the resources, use win_destroy().
 *
 * @see win_destroy().
 */
window_obj *win_create();

/**
 * Lower a window object.
 * @param[in] obj The window object.
 */
void win_lower(window_obj *obj);

/**
 * @brief Destroy created window object.
 * @param[in] obj The window object.
 *
 * @see win_create().
 */
void win_destroy(window_obj *obj);

/**
 * @brief Set window view style.
 * @param[in] obj The window object.
 * @param[in] style The window view style.
 */
void win_set_view_style(window_obj *obj, window_view_style style);

/**
 * @brief Get window view style.
 * @param[in] obj The window object.
 * @return Current window view style.
 */
window_view_style win_get_view_style(const window_obj *obj);

/**
 * @brief Set layout as window content.
 * @param[in] obj The window object.
 * @param[in] layout The layout content.
 *
 * Set @p layout as content of conform object.
 */
void win_set_layout(window_obj *win, Evas_Object *layout);

/**
 * @brief Set window rotation.
 * @param[in] win The window object.
 * @param[in] rotation rotation state.
 */
void win_set_rotation(window_obj *win, int rotation);

/**
 * @brief Get window rotation.
 * @param[in] win The window object.
 * @return rotation rotation state.
 */
int win_get_rotation(window_obj *obj);

/**
 * @brief Set indicator visibility.
 * @param[in] win The window object.
 * @param[in] indicator indicator visibility condition.
 */
void win_show_indicator(window_obj *win, Eina_Bool indicator);

/**
 * @brief Get host layout of window.
 * @param[in] win The window object.
 * @return The host Evas object.
 *
 * Return pointer to conform evas object.
 */
Evas_Object *win_get_host_layout(const window_obj *win);

#endif // __WINDOW_OBJ_H__
