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

📄 mmismsmenu.c

📁 GSM手机设计软件代码
💻 C
📖 第 1 页 / 共 4 页
字号:
    switch (Reason)
    {
    // User want to delete the SMS
    case INFO_KCD_LEFT:
      // Trigger the deletion
      SmsMenu_sms_delete_all(win);
      break;

    case INFO_KCD_RIGHT:
    case INFO_KCD_HUP:
    case INFO_TIMEOUT:
	  // API - 17-01-03 - 1571 - Add this call to sms_delete() to free memory
      sms_delete(data->sms_hnd);
      /* Destroy the owner of the dialog box */
      M_DEL_ALL_destroy(win);
      /* Send E_RETURN event to parent of M_DEL_ALL */
      SEND_EVENT (l_parent, E_RETURN, l_id, NULL); /* forward event to parent */
      break;

    default:
      return MFW_EVENT_REJECTED;
    }

  case SMSMENU_ID_NOTREADY:
    break;

  case SMSMENU_ID_DELOK:
  case SMSMENU_ID_DELERR:
  case SMSMENU_ID_NOMESSAGES:
    /* Destroy the owner of the dialog box */
    M_DEL_ALL_destroy(win);
    /* Send E_EXIT event to parent of M_DEL_ALL_ACK */
  //JVJE  SEND_EVENT(l_parent, E_EXIT, l_id, NULL); /* forward event to parent */
    break;

  case SMSMENU_ID_WAIT:
    // No reaction to any event (wait to be destroyed when MFW event received)
    break;

  default:
    return MFW_EVENT_REJECTED;
  }
  return MFW_EVENT_CONSUMED;
}


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

 $Function:     SmsMenu_loadDialogDefault

 $Description:  Loads standard default data for SMS information dialogs.

 $Returns:    Execution status

 $Arguments:    DisplayInfo - display settings

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

void SmsMenu_loadDialogDefault(T_DISPLAY_DATA * DisplayInfo)
{
	dlg_initDisplayData_TextId( DisplayInfo, TxtNull, TxtNull, TxtNull,  TxtNull, COLOUR_STATUS);
	dlg_initDisplayData_events( DisplayInfo, (T_VOID_FUNC)SmsMenu_standard_dialog_cb, THREE_SECS, KEY_CLEAR);
	DisplayInfo->Identifier   = DIALOGS_REASON_NULL;
}


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

 $Function:     SmsMenu_call_voice

 $Description:  dummy function.

 $Returns:    none

 $Arguments:    none

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

void SmsMenu_call_voice(void)
{
    TRACE_FUNCTION ("call_voice");
}

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

 $Function:     SmsMenu_startcall

 $Description:  dummy function.

 $Returns:    Execution status

 $Arguments:    DisplayInfo - display settings

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

void SmsMenu_startcall(UBYTE * VoiceNumber)
{
    TRACE_FUNCTION ("startcall");
}

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

 $Function:     SmsMenu_sms_delete_all

 $Description:  Delete all SMS messages.

 $Returns:    Execution status

 $Arguments:    win - current window.

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

int SmsMenu_sms_delete_all(T_MFW_HND win)
{
    //T_MFW_HND  win  = mfw_parent (mfw_header());
//  T_DISPLAY_DATA DisplayInfo;
  T_MFW_WIN      * win_data = ((T_MFW_HDR *) win)->data;
    T_M_DEL_ALL    * data = (T_M_DEL_ALL *)win_data->user;

  g_ListLength2 = sms_message_list(MFW_SMS_ALL, data->g_SmsMenu_messages, MAX_MESSAGES);

  //NM 22.8 msgsLoadInfoDefaults2(&DisplayInfo);


    if (g_ListLength2 > 0)
    {
    /* Display "Please wait" on the screen*/
    /* it is start now to delete sms*/
    SEND_EVENT (win, E_BACK, SMSMENU_ID_WAIT,NULL);
    data->waiting_win = mmi_dialog_information_screen_forever(win,TxtPleaseWait, NULL, COLOUR_STATUS_WAIT);

      /* delete now the first sms and than wait */
      /* for the MFW EVENT "E_SMS_OK"           */

    g_ListLength2 --;

    sms_msg_delete(data->g_SmsMenu_messages[g_ListLength2].index);

    }
    else
    {
        /* Display "No Messages" on the screen */
        /* and go back to the parent           */
    SEND_EVENT (win, E_BACK, SMSMENU_ID_NOMESSAGES,NULL);
  }

    return 1;

}

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

 $Function:     SmsRead_convertMailbox

 $Description:

 $Returns:

 $Arguments:

*******************************************************************************/
UBYTE SmsRead_convertMailbox(T_MFW_MAILBOX_ID i, char *mail_number, char *mail_alpha)
{
  USHORT max_rcd;
  USHORT nlen;

  char *international = mail_number; // Used to add '+' to the number if international

    TRACE_FUNCTION ("SmsRead_convertMailbox()");


    // If international number, add the '+' symbol
    if (FFS_flashData.mbn_numTp & 0x10)
    {
      international[0] = '+';
      international[1] = '\0';
      international ++;
    }
    // Convert BCD number into string
    cmhPHB_getAdrStr(international, PHB_MAX_LEN - 1, FFS_flashData.mbn_Num, FFS_flashData.mbn_len);

    // If the same number then we get the alpha identifier
    cmhPHB_getMfwTagNt((UBYTE*)FFS_flashData.mbn_AlphId, 10, (UBYTE*)mail_alpha, &nlen );
    mail_alpha[nlen] = '\0';

    return TRUE;

}

static void SmsMenu_StandardEditor_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
{
  T_MFW_WIN   * win_data = ((T_MFW_HDR *) win)->data;
  T_V     * voice_data = (T_V *)win_data->user;

  TRACE_FUNCTION ("SmsMenu_StandardEditor_cb()"); //Marcus: Issue 1490: 13/12/2002

  switch (reason)
  {
    case INFO_KCD_LEFT:


      if (Identifier EQ V_ID_CALL )
      {
        callNumber(FFS_flashData.voice_mail);
      }
      /* Marcus: Issue 1490: 13/12/2002: Start */
      else if (Identifier EQ V_ID_SET)
      {
      	  /*
      	  ** There is no need to copy the value entered into FFS_flashData.voicemail as the editor
      	  ** has already put the value there.
      	  */
  	  flash_write();
      }
      /* Marcus: Issue 1490: 13/12/2002: End */
      V_destroy(win);


      break;

    case INFO_KCD_RIGHT:
    case INFO_KCD_CLEAR:

    V_destroy(win);
    default:
      break;
  }
}

/* SPR#1428 - SH - New Editor: not required */
#ifndef NEW_EDITOR
/*******************************************************************************

 $Function:     SmsMenu_loadEditDefault

 $Description:

 $Returns:

 $Arguments:

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

void SmsMenu_loadEditDefault(T_EDITOR_DATA *editor_data)
{
    TRACE_FUNCTION ("SmsMenu_loadEditDefault()");

      editor_data->editor_attr.win.px   = 6;
      editor_data->editor_attr.win.py   = 12;
      editor_data->editor_attr.win.sx   = 80;
      editor_data->editor_attr.win.sy   = 20;
      editor_data->editor_attr.edtCol = COLOUR_EDITOR_XX;
      editor_data->editor_attr.font     = 0;
      editor_data->editor_attr.mode    = edtCurBar1;
      editor_data->editor_attr.controls   = 0;
      editor_data->editor_attr.text      = '\0';
        editor_data->editor_attr.size       = 0;
    editor_data->hide         = FALSE;
      editor_data->Identifier            = 0;  /* optional */
      editor_data->mode               = DIGITS_MODE;
    editor_data->destroyEditor      = TRUE;
    editor_data->LeftSoftKey          = TxtSoftSelect;
    editor_data->AlternateLeftSoftKey   = TxtNull;
    editor_data->RightSoftKey         = TxtSoftBack;
    editor_data->Identifier            =  0;
    editor_data->TextId              = '\0';
    editor_data->TextString           = NULL;
    editor_data->min_enter         = 1;  // Avoid to return empty strings
      editor_data->timeout              = FOREVER;
    editor_data->Callback             = (T_EDIT_CB)SmsMenu_StandardEditor_cb;

}

#endif /* NEW_EDITOR */

/* SPR#1428 - SH - New Editor: These functions moved here from MmiEditor.c */
#ifdef EASY_TEXT_ENABLED

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

 $Function:     eZitextIcon

 $Description:  Icon to be displayed if eZiText has been selected.

 $Returns:    None.

 $Arguments:  None.

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

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

	TRACE_FUNCTION ("showeZiTextIcon()");

	if(Easy_Text_Available == TRUE)
	{
	  if(FFS_flashData.PredTextSelected == TRUE)
	  {
	    T_DISPLAY_DATA display_info;
		dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtNull,  TxtNull, COLOUR_STATUS_EZITEXT);
		dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)M_exeSendNew, FOUR_SECS, 0 );

	    mmi_dialogs_insert_animation(info_dialog(win, &display_info), 400, (MfwIcnAttr*)&IconTexteZiText,1);
	  }
	  else if(FFS_flashData.PredTextSelected == FALSE)
	  {
	    M_exeSendNew(m,i);
	  }
	}
	else
	    M_exeSendNew(m,i);

}


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

 $Function:     EasyActivate

 $Description:  Icon to be displayed if eZiText has been selected.

 $Returns:    MFW_EVENT_CONSUMED.

 $Arguments:  None.

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

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

	if(FFS_flashData.PredTextSelected == FALSE)
	{
	  FFS_flashData.PredTextSelected = TRUE;
	  flash_write();

		dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText,  TxtActivated, COLOUR_STATUS_EZITEXT);
		dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );

	  info_dialog(win, &display_info);

	  return MFW_EVENT_CONSUMED;
	}
}


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

 $Function:     EasyActivate

 $Description:  Icon to be displayed if eZiText has been selected.

 $Returns:    MFW_EVENT_CONSUMED.

 $Arguments:  None.

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

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

	if(FFS_flashData.PredTextSelected == TRUE)
	{
	  FFS_flashData.PredTextSelected =  FALSE;
	  flash_write();

	  dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtEasyText,  TxtDeActivated, COLOUR_STATUS_EZITEXT);
	  dlg_initDisplayData_events( &display_info, NULL, THREE_SECS, KEY_CLEAR|KEY_LEFT|KEY_RIGHT );
	  info_dialog(win, &display_info);

	  return MFW_EVENT_CONSUMED;

	}
}
#endif /* EASY_TEXT_ENABLED */

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

 $Function:     Concatenate_Status

 $Description:  Displays the Concatenation Satus

 $Returns:    MFW_EVENT_CONSUMED.

 $Arguments:  None.

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

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

	USHORT TextId2;

	if (FFS_flashData.ConcatenateStatus ==  TRUE )
		TextId2    = TxtActivate;
	else
		TextId2    = TxtDeActivated;

	/*
	** Display a standard dialog, with no keys processed, for 3 secs
	*/
	info_screen(win, TxtConcat, TextId2, (T_VOID_FUNC) NULL);

	return MFW_EVENT_CONSUMED;
}


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

 $Function:     ConcatenateDeActivate

 $Description:  Deactivates the Concatenation Switch

 $Returns:    MFW_EVENT_CONSUMED.

 $Arguments:  None.

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

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

	FFS_flashData.ConcatenateStatus =  FALSE;
	flash_write();

	/*
	** Display a standard dialog, with no keys processed, for 3 secs
	*/
	info_screen(win, TxtConcat, TxtDeActivated, (T_VOID_FUNC) NULL);

	return MFW_EVENT_CONSUMED;
}


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

 $Function:     ConcatenateActivate

 $Description:  Deactivates the Concatenation Switch

 $Returns:    MFW_EVENT_CONSUMED.

 $Arguments:  None.

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

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

	FFS_flashData.ConcatenateStatus =  TRUE;
	flash_write();

	/*
	** Display a standard dialog, with no keys processed, for 3 secs
	*/
	info_screen(win, TxtConcat, TxtActivated, (T_VOID_FUNC) NULL);

	return MFW_EVENT_CONSUMED;
}

#undef MMI_SMSMENU_C

⌨️ 快捷键说明

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