/**
* Copyright(c) 2011 Sunmedia Technologies - All Rights Reserved.
*
* @file
*
* @brief The header file of ai event module
*
*/

#ifndef _AI_EVENT_H_
#define _AI_EVNET_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "al_basictypes.h"
#include "al_database.h"
#include "al_event.h"

/**<Define message type of event component */
typedef enum
{
	AL_EVENT_NOWNEXT_EVNET_UPDATE,
	AL_EVENT_SCHEDULE_EVNET_UPDATE,
	AL_EVENT_PREF_SERVICE_NAME_UPDATE,
	AL_EVENT_SERIES_EVENT_UPDATE,
} AI_Event_Message_Type_t;

/**< call back function prototype for up layer to register */
typedef	al_int32 (* AI_EventCallback)(AI_Event_Message_Type_t EventType, al_void* pParam);

/**< Data struct to initialize al event module */
typedef struct
{
#ifdef CONFIG_USE_COMPRESSED_EPGMODULE
	al_uint32 TotalSize;
#else
	al_uint32 TotalChannel;
	al_uint32 TotalEvent;
	al_uint32 TotalExtendEvent;
#endif
	AI_EventCallback fpcallback;
} AI_Event_Init_t;

/**
* @brief Initializes the event component.
*
* @param DBType	- Specify database on which to build
*
* @param  pstInit	- pointer to initial parameters
*
* @retval  AL_SUCCESS means succss. AL_INITIALIZE_ALREADY means already initialised.
* AL_FAILURE means failed
*/
AL_Return_t AI_Event_Init(AL_DB_EDBType_t DBType, AI_Event_Init_t *pstInit);

/**
* @brief Terminates the event component.
*
* @param DBType	- Specify database on which to build
*
* @retval  AL_SUCCESS means succss. AL_INITIALIZE_ALREADY means already initialised.
* AL_FAILURE means failed
*/
AL_Return_t AI_Event_Term(AL_DB_EDBType_t DBType);

#ifdef __cplusplus
}
#endif

#endif /* _AI_EVENT_H_ */
