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

#include "window.h"
#include <Evas.h>
#include <Eina.h>

#include <app.h>

#define APP_EVENTS_COUNT 5

typedef struct
{
    app_pause_cb pause;
    app_resume_cb resume;
    app_event_handler_h event_handlers[APP_EVENTS_COUNT];
} app_cbs;

typedef struct _app_data
{
    Eina_List *hw_btn_list;
    window_obj  *win;
    Evas_Object *navi;
    app_cbs cb;
    void *user_data;
} app_data;

typedef void (*hw_btn_event_cb) (void *data);

/**
 * @brief Create application instance
 * @return Application instance on success, otherwise NULL
 */
app_data *app_create();

/**
 * @brief Destroy application instance
 * @param[in]   app     application instance
 */
void app_destroy(app_data * app);

/**
 * @brief Reset callbacks
 * @param[in]   app     application instance
 */
void app_reset_cbs(app_data *app);

/**
 * @brief Set callbacks.
 * @param[in]   app         application instance
 * @param[in]   cb          application's callbacks
 * @param[in]   user_data   user data
 */
void app_set_cbs(app_data *app, app_cbs cb, void *user_data);

/**
 * @brief Run Tizen application
 * @param[in]   app     application instance
 * @param[in]   argc    argc paremeter received in main
 * @param[in]   argv    argv parameter received in main
 * @return exit code
 */
int app_run(app_data *app, int argc, char **argv);

#endif // __MAIN_APP_H__

