⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmismsmenu.c

📁 GSM手机设计软件代码
💻 C
📖 第 1 页 / 共 4 页
字号:
/*******************************************************************************

          CONDAT (UK)

********************************************************************************

 This software product is the property of Condat (UK) Ltd and may not be
 disclosed to any third party without the express permission of the owner.

********************************************************************************

 $Project name: Basic MMI
 $Project code: BMI
 $Module:   SMS
 $File:       MmiSmsMenu.c
 $Revision:   1.0

 $Author:   Condat(UK)
 $Date:       25/10/00

********************************************************************************

 Description:

    Implementation SMS dynamic menu handling

********************************************************************************

 $History: MmiSmsMenu.c

  25/10/00      Original Condat(UK) BMI version.

 $End

*******************************************************************************/

#define MMI_SMSMENU_C

#define ENTITY_MFW

/* includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#if defined (NEW_FRAME)

#include "typedefs.h"
#include "vsi.h"
#include "pei.h"
#include "custom.h"
#include "gsm.h"

#else

#include "stddefs.h"
#include "custom.h"
#include "gsm.h"
#include "vsi.h"

#endif
#include "p_sim.h"

#include "mfw_mfw.h"
#include "mfw_win.h"
/* SPR#1428 - SH - New Editor changes */
#ifndef NEW_EDITOR
#include "mfw_edt.h"
#endif
#include "mfw_tim.h"
#include "mfw_phb.h"
#include "ksd.h"
#include "psa.h"
#include "mfw_sms.h"
#include "mfw_smsi.h"
#include "mfw_icn.h"
#include "mfw_mnu.h"
#include "mfw_lng.h"
#include "mfw_sat.h"
#include "mfw_kbd.h"
#include "mfw_nm.h"


#include "dspl.h"

#include "MmiMain.h"
#include "MmiDummy.h"
#include "MmiMmi.h"

#include "MmiDialogs.h"
#include "MmiLists.h"
#include "MmiMenu.h"
#include "MmiSoftKeys.h"
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
#include "ATBCommon.h"
#include "ATBDisplay.h"
#include "ATBEditor.h"
#include "AUIEditor.h"
#else
#include "MmiEditor.h"
#endif
#include "MmiBookShared.h"
#include "MmiSmsMenu.h"
#include "MmiSmsRead.h"
#include "MmiSmsSend.h"
#include "MmiSmsIdle.h"
#include "MmiSmsBroadcast.h"	/* reqd for info_screen function prototype */

#include "cus_aci.h"
#include "p_sim.h"
#include "mfw_ffs.h"
//#include "pcm.h"

#include "mmicolours.h"

extern T_MFW_HND SmsRead_R_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);

// Start functions of the windows
T_MFW_HND M_SND_SAV_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
T_MFW_HND M_DEL_ALL_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
T_MFW_HND M_DEL_ALL_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);
T_MFW_HND V_start(T_MFW_HND parent_window, MfwMnuAttr *menuAttr);

// Standard callback function for temporary dialog window
int SmsMenu_StandardDialog_cb(T_MFW_HND win, USHORT Identifier, USHORT Reason);
static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason);


/* This structure is used by 'Delete All' function that is common for SMS and SMS-CB */
typedef enum SmsType
{
  SMS_TYPE, /* interfered with macro -> renamed SMS to SMS_TYPE */
  SMSCB_TYPE
} MySmsType;

/* ID of the different windows (used in SEND_EVENT function to provide the callee the ID of the caller) */
typedef enum
{
  /* Logical frames */
  M_DEL_ALL_ID,
  M_SND_SAV_ID,
  V_ID_SET,
  V_ID_CALL,
  V_NUM_ID,
  /* Dialog windows */
  SMSMENU_ID_NOTREADY,
  SMSMENU_ID_DELETEALL,
  SMSMENU_ID_DELOK,
  SMSMENU_ID_DELERR,
  SMSMENU_ID_NOMESSAGES,
  SMSMENU_ID_WAIT
} sms_menu_id;

typedef enum              /* numbering plan identifier */
{
  MFW_MB_LINE1      = 1,
  MFW_MB_LINE2      = 2,
  MFW_MB_FAX        = 3,
  MFW_MB_DATA       = 4
} T_MFW_MAILBOX_ID;



typedef enum
{
  SMS_DELETING,
  SMS_DISPLAY,
  SMS_READY
} T_SmsMenu_state;

typedef struct
{
    /* administrative data */

    T_MMI_CONTROL   mmi_control;
    T_MFW_HND       win;
    SHORT           id;
    T_MFW_HND       parent;

    /* associated handlers */

    T_MFW_HND       kbd;
    T_MFW_HND       kbd_long;
    T_MFW_HND       menu;

    /* internal data */

  T_SmsUserData * user_data; // text and phone number of the message
} T_M_SND_SAV;

typedef struct
{
    /* administrative data */

    T_MMI_CONTROL   mmi_control;
    T_MFW_HND       win;
    SHORT           id;
    T_MFW_HND       parent;
  T_MFW_HND       waiting_win;

    /* associated handlers */
  T_MFW_HND       sms_hnd;         /* MFW sms handler      */

    /* internal data */

  enum SmsType  type; // The type of the SMS to delete (SMS or SMS-CB)
  T_MFW_SMS_MSG g_SmsMenu_messages[MAX_MESSAGES];
  T_MFW_HND   child_dialog;
} T_M_DEL_ALL;

typedef struct
{
    /* administrative data */

    T_MMI_CONTROL   mmi_control;
    T_MFW_HND       win;
    SHORT           id;
    T_MFW_HND       parent;

    /* associated handlers */

    T_MFW_HND       kbd;
    T_MFW_HND       kbd_long;
    T_MFW_HND       menu;


} T_V;



typedef struct
{
    /* administrative data */

    T_MMI_CONTROL   mmi_control;
    T_MFW_HND       win;
    SHORT           id;
    T_MFW_HND       parent;

    /* associated handlers */


    /* internal data */
    UBYTE voice_number_buffer[NUMBER_LENGTH];

} T_V_NUM;

static T_MFW_HND M_SND_SAV_create (T_MFW_HND parent);
static void M_SND_SAV_destroy (T_MFW_HND window);
static void M_SND_SAV_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static int M_SND_SAV_win_cb (MfwEvt e, MfwWin *w);
static int M_SND_SAV_kbd_cb (MfwEvt e, MfwKbd *k);
static int M_SND_SAV_mnu_cb (MfwEvt e, MfwMnu *m);

static int ExeSms_sendM_SND_SAV(MfwMnu *, MfwMnuItem *);

static T_MFW_HND M_DEL_ALL_create (T_MFW_HND parent);
static void M_DEL_ALL_destroy (T_MFW_HND window);
static void M_DEL_ALL_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static int M_DEL_ALL_mfw_cb (MfwEvt event, void *parameter);
static int M_DEL_ALL_win_cb (MfwEvt e, MfwWin *w);

static T_MFW_HND V_create (T_MFW_HND parent);
static void V_destroy (T_MFW_HND window);
static void V_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
static int V_win_cb (MfwEvt e, MfwWin *w);
static int V_kbd_cb (MfwEvt e, MfwKbd *k);
static int V_mnu_cb (MfwEvt e, MfwMnu *m);


/* SPR#1428 - SH - New Editor: not required */
#ifndef NEW_EDITOR
void SmsMenu_loadEditDefault(T_EDITOR_DATA *editor_data);
#endif

// State of the SMS menu management
T_SmsMenu_state g_SmsMenu_state = SMS_DISPLAY;
MfwHnd g_ChildWindow2;
UBYTE g_CenterNumber[NUMBER_LENGTH];

/*******************************************************************************

 $Function:     M_exeSendNew

 $Description:  This function is called when the user press Send in the
        main SMS menu.

 $Returns:    Execution status

 $Arguments:  m - menu handler
        i - Menu item selected

*******************************************************************************/

int M_exeSendNew(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND       win  = mfwParent(mfw_header());
    T_SmsUserData   SmsData;

    /* Copy the number and name information to the SMS buffer
    */ 
	/*MC SPR 1257, clear whole buffer in case of Unicode entry*/
    if(FFS_flashData.ConcatenateStatus == TRUE)
 		memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN_SGL);
    else
    	memset(SmsData.TextBuffer, '\0', MAX_MSG_LEN);
    
    SmsData.NumberBuffer[0]='\0'; //set the number to null.
    SmsData.called_from_reply_item = FALSE;
    
  SmsSend_SEND_start(win, (void *) &SmsData);
  return 1;
}

/*******************************************************************************

 $Function:     M_exeRead

 $Description:  This function is called when the user press Read in the
          main SMS menu

 $Returns:    Execution status

 $Arguments:  m - menu handler
        i - Menu item selected

*******************************************************************************/

int M_exeRead(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND       win  = mfwParent(mfw_header());
  T_MFW_SMS_STAT  sms_list_type = MFW_SMS_ALL;

  /* Call the function that manages SMS reading */
  SmsRead_R_start(win, (MfwMnuAttr*)&sms_list_type);

  return 1;
}

/*******************************************************************************

 $Function:     M_exeDelAll

 $Description:  This function is called when the user press Delete all in the
          main SMS menu

 $Returns:    Execution status

 $Arguments:  m - menu handler
        i - Menu item selected

*******************************************************************************/

int M_exeDelAll(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND       win  = mfwParent(mfw_header());
  MySmsType sms_type;

  sms_type = SMS_TYPE;
  // Here we have to pass the type of sms to delete (SMS or SMS-CB)
  M_DEL_ALL_start(win, (void *)&sms_type);

  return 1;
}

/*******************************************************************************

 $Function:     M_exeSendSaved

 $Description:  This function is called when the user press Saved messages
          in the main SMS menu

 $Returns:    Execution status

 $Arguments:  m - menu handler
        i - Menu item selected

*******************************************************************************/

int M_exeSendSaved(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND       win  = mfwParent(mfw_header());

  M_SND_SAV_start(win, 0);

  return 1;
}



/*******************************************************************************

 $Function:     voice_mail_init

 $Description:  initialization the voice mail buffer


 $Returns:

 $Arguments:


*******************************************************************************/

int voice_mail_init (void)
{

  //nm, later have to read the voice mail number from FFS after switching-on the mobile

  //to clear the buffer is only temporary until we are able to save on Flash
  //memset(voice_mail, '\0', sizeof(voice_mail));



  return 1;
}




/*******************************************************************************

 $Function:     M_exeVoice

 $Description:  This function is called when the user press Voice Mail
          in the main SMS menu

 $Returns:    Execution status

 $Arguments:  m - menu handler
        i - Menu item selected

*******************************************************************************/

int M_exeVoice(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win;

    T_MFW_HND     parent_window  = mfwParent(mfw_header());

    TRACE_FUNCTION ("M_exeVoice()");

    win = V_create (parent_window);

    if (win NEQ NULL)
  {
      SEND_EVENT (win, E_INIT, V_ID_SET, 0);
  }
  return 1;
}


/*******************************************************************************

 $Function:     M_callVoice

 $Description:  This function is called when the user press set Voice Mail
          in the main SMS menu

 $Returns:    Execution status

 $Arguments:  m - menu handler
        i - Menu item selected

*******************************************************************************/

int M_callVoice(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND       win;
    T_MFW_HND       parent_win  = mfwParent(mfw_header());


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -