#ifndef IPTM_H
#define IPTM_H
/*===========================================================================================

FILE            : IPTM.h

SERVICES        : PTM Access Interface

DESCRIPTION     : 

PUBLIC CLASSES  : 

INITIALIZATION AND SEQUENCING REQUIREMENTS : 

      Copyright ｩ 1999-2005 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR

===========================================================================================*/

/*===========================================================================================

                        EDIT HISTORY FOR MODULE

When        Who    Keyword             what, where, why
----------  -----  ------------------  ------------------------------------------------------
01/12/05                               Create file
===========================================================================================*/

/*===========================================================================================
 INCLUDES AND VARIABLE DEFINITIONS
===========================================================================================*/
/*-------------------------------------------------------------------------------------------
   Defines
-------------------------------------------------------------------------------------------*/

#define IPTM_FUNCTION_RESET 0x0001  // 機能リセット
#define IPTM_MEMORY_RESET   0x0002  // メモリリセット
#define IPTM_ALL_RESET      0x0004  // オールリセット

// debug
#define IPTM_DEBUG
#undef  IPTM_DEBUG

//#define IPTM_DBG_MSG	MSG_SP1
#define IPTM_DBG_MSG	MSG_HIGH

/*-------------------------------------------------------------------------------------------
   Include Files
-------------------------------------------------------------------------------------------*/
#include "AEE.h"
#include "AEEInterface.h"
#include "AEESound.h"

#ifdef IPTM_DEBUG
#ifdef WIN32
#include "siodef_pc.h"
#else
//#include "siodef.h"
#include "msg.h"
#endif
#endif

/*-------------------------------------------------------------------------------------------
   Constant Declarations
-------------------------------------------------------------------------------------------*/

#define IPTM_STR_SIZE 30

/*===========================================================================================
 Macros
===========================================================================================*/

/*-------------------------------------------------------------------------------------------
   Type Declarations
-------------------------------------------------------------------------------------------*/
typedef struct _PTMKEYCODE{
   uint16 wPTMKey;     //話者権ボタン押下時にアプリに送られるキーコード
   uint16 wPageUp;     //上スクロールを行うキーのキーコード
   uint16 wPageDown;   //下スクロールを行うキーのキーコード
}PTMKEYCODE;


typedef struct IPTM IPTM;

/*-------------------------------------------------------------------------------------------
   Macros Declarations
-------------------------------------------------------------------------------------------*/

/*===========================================================================================
 FUNCTION DECLARATIONS AND INLINE FUNCTION DEFINITIONS
===========================================================================================*/
void ApiIPTMSetFunctionReset( unsigned short usFncReset );		// 機能リセット設定
void ApiIPTMSetMemoryReset( unsigned short usMemReset );		// メモリリセット設定
void ApiIPTMSetAllReset( unsigned short usAllReset );			// オールリセット設定

boolean ApiIPTMSetPPPNAI(unsigned char *nai, unsigned int len);	// PPP認証ID設定
boolean ApiIPTMSetPPPPW( unsigned char *pw,  unsigned int len);	// PPP認証Passward設定
boolean ApiIPTMSetPTMID( unsigned char *id,  unsigned int len);	// PTMユーザーID設定 (MDN)
boolean ApiIPTMSetPTMPW( unsigned char *pw,  unsigned int len);	// PTMユーザーPassward設定 (IMSI)
boolean ApiIPTMGetPPPNAI(unsigned char *nai);					// PPP認証ID取得
boolean ApiIPTMGetPPPPW( unsigned char *pw );					// PPP認証Passward取得
boolean ApiIPTMGetPTMID( unsigned char *id );					// PTMユーザーID取得 (MDN)
boolean ApiIPTMGetPTMPW( unsigned char *pw );					// PTMユーザーPassward取得 (IMSI)
boolean ApiIPTMGetInitPPPNAI(unsigned char *nai);				// PPP認証ID初期値取得
boolean ApiIPTMGetInitPPPPW( unsigned char *pw );				// PPP認証Passward初期値取得
boolean ApiIPTMGetInitPTMID( unsigned char *id );				// PTMユーザーID初期値取得 (MDN)
boolean ApiIPTMGetInitPTMPW( unsigned char *pw );				// PTMユーザーPassward初期値取得 (IMSI)
boolean ApiIPTMGetDbgMode(byte *mode);							// PTMデバッグモード設定 ( mode = 1:Debug 0:商用 )
boolean ApiIPTMSetDbgMode(byte *mode);							// PTMデバッグモード取得 ( mode = 1:Debug 0:商用 )

/* 初期化関数 */
void ApiPTMInitBoot();				// 端末起動時の初期化
void ApiPTMInitFactoryShipment();	// 工場出荷設定時の初期化

/* IPTMとOEMVocoderのみ使用 */
AEECLSID GetAppClassId( void );		// 起動元アプリのClass ID取得

/*-------------------------------------------------------------------------------------------
   Interface Definitions
-------------------------------------------------------------------------------------------*/
AEEINTERFACE(IPTM)
{
   INHERIT_IBase(IPTM);
   int     (* Shutdown)                 (IPTM * pIPTM);
   int     (* SIPID)                    (IPTM * pIPTM, char   * pszID,     int * pnSize);
   int     (* SIPPasswd)                (IPTM * pIPTM, char   * pszPasswd, int * pnSize);
   int     (* SetDevice)                (IPTM * pIPTM, AEESoundDevice eDevice);
   int     (* GetVolume)                (IPTM * pIPTM, uint16 * pwVolume);
   int     (* SetVolume)                (IPTM * pIPTM, uint16 * pwVolume);
   int     (* GetPTMRestrictionStatus)  (IPTM * pIPTM, boolean * pbIsRestriction);
   int     (* SearchAddr)               (IPTM * pIPTM, char   * pszTelNo,  char * pszName,  int * pnSize);
   int     (* GetPTMKey)                (IPTM * pIPTM, PTMKEYCODE * pPTM_KeyCode);
   int     (* SetLED)                   (IPTM * pIPTM, uint16   wColor,    uint16 wType);
   int     (* GetResetFlagStatus)       (IPTM * pIPTM, uint16 * pwReset);
   int     (* SetResetFlagStatus)       (IPTM * pIPTM, uint16   wReset);
};


/*-------------------------------------------------------------------------------------------
   Access Macros
-------------------------------------------------------------------------------------------*/
#define IPTM_AddRef(p)                                        AEEGETPVTBL((p),IPTM)->AddRef((p))
#define IPTM_Release(p)                                       AEEGETPVTBL((p),IPTM)->Release((p))
#define IPTM_Shutdown(p)                                      AEEGETPVTBL((p),IPTM)->Shutdown(p)
#define IPTM_SIPID(p, psI, pnS)                               AEEGETPVTBL((p),IPTM)->SIPID(p, psI, pnS)
#define IPTM_SIPPasswd(p, psP, pnS)                           AEEGETPVTBL((p),IPTM)->SIPPasswd(p, psP, pnS)
#define IPTM_SetDevice(p, eD)                                 AEEGETPVTBL((p),IPTM)->SetDevice(p, eD)
#define IPTM_GetVolume(p, pwV)                                AEEGETPVTBL((p),IPTM)->GetVolume(p, pwV)
#define IPTM_SetVolume(p, pwV)                                AEEGETPVTBL((p),IPTM)->SetVolume(p, pwV)
#define IPTM_GetPTMRestrictionStatus(p, pbI)                  AEEGETPVTBL((p),IPTM)->GetPTMRestrictionStatus(p, pbI)
#define IPTM_SearchAddr(p, pszT, pszN, pnS)                   AEEGETPVTBL((p),IPTM)->SearchAddr(p, pszT, pszN, pnS)
#define IPTM_GetPTMKey(p, pP)                                 AEEGETPVTBL((p),IPTM)->GetPTMKey(p, pP)
#define IPTM_SetLED(p, wC, wT)                                AEEGETPVTBL((p),IPTM)->SetLED(p, wC, wT)
#define IPTM_GetResetFlagStatus(p, pwR)                       AEEGETPVTBL((p),IPTM)->GetResetFlagStatus(p, pwR)
#define IPTM_SetResetFlagStatus(p, wR)                        AEEGETPVTBL((p),IPTM)->SetResetFlagStatus(p, wR)


/*===========================================================================================
   DATA STRUCTURE DOCUMENTATION
=============================================================================================
=============================================================================================
PTMKEYCODE

Description:
   各移動機におけるPTMアプリが用いる各種キーのキーコードを取得する

Definition:

typedef struct _PTMKEYCODE{
   uint16 wPTMKey;     //話者権ボタン押下時にアプリに送られるキーコード
   uint16 wPageUp;     //上スクロールを行うキーのキーコード
   uint16 wPageDown;   //下スクロールを行うキーのキーコード
}PTMKEYCODE


Members:
   メンバ              説明
   wPTMKey           : 話者権ボタン押下時にアプリに送られるキーコード
   wPageUp           : 上スクロールを行うキーのキーコード
   wPageDown         : 下スクロールを行うキーのキーコード


Comments:
   なし
   
See Also:
   なし

=============================================================================================
=============================================================================================
   INTERFACE DOCUMENTATION
=============================================================================================
TODO
*/
#endif // __IPTM_H__

