#ifndef BREWMGR_H
#define BREWMGR_H
/*=========================================================================== 
                              BrewMgr.h                                       
                                                                              
  Brew Status Management                                                      
                                                                              
  This file contains implementation of the Brew Status Management             
                                                                              
        Copyright ｩ 1999-2002 QUALCOMM Incorporated.                          
               All Rights Reserved.                                           
            QUALCOMM Proprietary/GTDR                                         
============================================================================*/
/*===========================================================================

                        EDIT HISTORY FOR MODULE

when       who            what, where, why
--------   ----------     ---------------------------------------------------
06/11/04   ohmae@ISB     [PTX802-TRK6153]Myスポットから地図表示後、終了確認ダイアログ終了後不具合
04/24/04   uehara@ISB    [PTX802-TRK1202-2] オートロックPOPUP対応review指摘修正
04/28/04   kunugi@ISB    [PTX802-TRK933] EZNAVI終了確認画面不具合対応
04/24/04   uehara@ISB    [PTX802-TRK1202] オートロックPOPUP対応
03/29/04   ohmae@ISB     [PTX802-NetCtrl] BREW-NetCtrl配下対応
01/28/04   ohmae@ISB     [PTX633-TRK-2885] 終了POPUP終了時ちらつき対策       
10/16/03   tachibana@ISB [PTX633-BrewTask]                                   
                          BrewTask化対応                                     
===========================================================================*/

#include "AEE.h"
#include "BrewFeatures.h"

// [PTX802-NetCtrl] BREW-NetCtrl配下対応 [S]
typedef enum{
   BREWMGR_BASEAPPLET,    //ベースアプリの状態を登録。
   BREWMGR_SHIMAPPLET,    //シムアプリの状態を登録。
   BREWMGR_BASE2APPLET,   //ベース２アプリの状態を登録。
//ISBohmae Fixed tadan
   BREWMGR_MSHOPAPPLET,   //MSHOPの状態を登録   
//ISBohmae Fixed tadan
   BREWMGR_BREWUI,        //BREW  UIの状態を登録。
   BREWMGR_NATIVEINT,     //Native割り込み中
   BREWMGR_AEESUSPEND,    //強制Suspendの完了通知
   BREWMGR_AEERESUME,     //Resumeの完了通知
   BREWMGR_ACTIVECLSID_INFO,//ActiveクラスID通知
//準正常２
   BREWMGR_STARTCLSID_INFO,//ActiveクラスID通知 OEMNotifyのOEMNTF_APP_STARTによる
//準正常２
   BREWMGR_KIND_MAX
} BMGR_REGIST_KIND;

typedef enum{
   BREWMGR_ST_ACTIVE,    //Activeを登録
   BREWMGR_ST_SUSPEND,   //Suspendを登録。
   BREWMGR_ST_DEAD,      //Deadを登録
   BREWMGR_ST_START,     //Base専用
   BREWMGR_ST_RESUME,    //Base専用
   BREWMGR_ST_COMPLETE,
//PTX802-TRK6153[S]
   BREWMGR_ST_START_FAILED,
//PTX802-TRK6153[E]
   BREWMGR_ST_MAX
} BMGR_REGIST_STATUS;
// [PTX802-NetCtrl]BREW-NetCtrl配下対応 [E]

// [PTX802-TRK1202] オートロックPOPUP対応 [S]
typedef enum{
   BREWMGR_CLOSE_POPUP,
// [PTX802-TRK933] EZNAVI終了確認画面追加. [S]
   BREWMGR_CLOSENOSUSPEND_POPUP,
// [PTX802-TRK933] EZNAVI終了確認画面追加. [E]
   BREWMGR_KEYLOCK_POPUP,
   BREWMGR_AUTOLOCK_POPUP,
   BREWMGR_TRX_POPUP,
// [PTX802-TRK1202-2] アプリキー押下によるBase2起動完了追加 [S]
   BREWMGR_APLI_KEY
// [PTX802-TRK1202-2] アプリキー押下によるBase2起動完了追加 [E]
} BMGR_REGIST_POPKIND;
// [PTX802-TRK1202] オートロックPOPUP対応 [E]

#define BREWMGR_NO_ERROR 0
#define BREWMGR_BADPARAM (-1)

//**********************************************************************
//	ログ取得マクロ (Brew 3.1 Porting   for PC-Shim Debug Log)
//**********************************************************************
#define BREWMGRMSG_LEGACY_LOW		(1 << 0)
#define BREWMGRMSG_LEGACY_MED		(1 << 1)
#define BREWMGRMSG_LEGACY_HIGH		(1 << 2)
#define BREWMGRMSG_LEGACY_ERROR		(1 << 3)
#define BREWMGRMSG_LEGACY_FATAL		(1 << 4)
#define BREWMGRMSG_LEVEL_FATAL		(BREWMGRMSG_LEGACY_FATAL)
#define BREWMGRMSG_LEVEL_ERROR		(BREWMGRMSG_LEGACY_ERROR | BREWMGRMSG_LEVEL_FATAL)
#define BREWMGRMSG_LEVEL_HIGH		(BREWMGRMSG_LEGACY_HIGH  | BREWMGRMSG_LEVEL_ERROR)
#define BREWMGRMSG_LEVEL_MED		(BREWMGRMSG_LEGACY_MED   | BREWMGRMSG_LEVEL_HIGH)
#define BREWMGRMSG_LEVEL_LOW		(BREWMGRMSG_LEGACY_LOW   | BREWMGRMSG_LEVEL_MED)
#define BREWMGRMSG_LEVEL_NONE		0
#if defined(WIN32)
#define BREWLOG_FNAME				"brew.log"
#define MSG_FATAL(f, p1, p2, p3)	BrewMsgLib_PutMsg(BREWMGRMSG_LEGACY_FATAL, __FILE__, __LINE__, (f), (p1), (p2), (p3))
#define MSG_ERROR(f, p1, p2, p3)	BrewMsgLib_PutMsg(BREWMGRMSG_LEGACY_ERROR, __FILE__, __LINE__, (f), (p1), (p2), (p3))
#define MSG_HIGH(f, p1, p2, p3)		BrewMsgLib_PutMsg(BREWMGRMSG_LEGACY_HIGH,  __FILE__, __LINE__, (f), (p1), (p2), (p3))
#define MSG_MED(f, p1, p2, p3)		BrewMsgLib_PutMsg(BREWMGRMSG_LEGACY_MED,   __FILE__, __LINE__, (f), (p1), (p2), (p3))
#define MSG_LOW(f, p1, p2, p3)		BrewMsgLib_PutMsg(BREWMGRMSG_LEGACY_LOW,   __FILE__, __LINE__, (f), (p1), (p2), (p3))
extern void BrewMsgLib_Initialize(unsigned int MsgLevel);
extern void BrewMsgLib_PutMsg(unsigned int MsgLevel, char *pFName, uint32 Line, const char *Format, int p1, int p2, int p3);
#else /* defined(WIN32) */
#endif /* defined(WIN32) */

//*********************************************************************/
//	Functions
//*********************************************************************/
void BrewMgrInitStatus();
int  BrewMgrRegisterStatus(BMGR_REGIST_KIND byRegistKind, BMGR_REGIST_STATUS byRegistStatus);

#ifdef __BREW_TASK__
// [PTX633-BrewTask] BrewTask化対応. [S]
int BrewMgrGetStatus(void);
// [PTX633-BrewTask] BrewTask化対応. [E]
#endif

// [PTX633-TRK-2885] 終了POPUP終了時ちらつき対策 [S]
extern void BrewMgr_SetNowStatus(void);
// [PTX633-TRK-2885] 終了POPUP終了時ちらつき対策 [E]

#endif   // BREWMGR_H
