ManageCallMain.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:133k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*******************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  * ManageCallMain.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   <file description>.
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52.  *==============================================================================
  53.  *             HISTORY
  54.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  55.  *------------------------------------------------------------------------------
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  *------------------------------------------------------------------------------
  91.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  92.  *============================================================================== 
  93.  *******************************************************************************/
  94. /**
  95.  * Copyright Notice
  96.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  97.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  98.  *  (It is illegal to remove this copyright notice from this software or any
  99.  *  portion of it)
  100.  */
  101. /**************************************************************
  102.    FILENAME : ManageCall.c
  103.    PURPOSE     : CallSetup Main Menu 
  104.    REMARKS     : nil
  105.    AUTHOR      : Vanita Jain
  106.    DATE     : 
  107. **************************************************************/
  108. #include "stdC.h"
  109. #include "L4Dr1.h"
  110. #include "CSP.h"
  111. #include "MainMenuDef.h"
  112. #include "PhoneBookTypes.h"
  113. /* Start by Julia */
  114. #include "PhoneBookGprot.h"
  115. /* End by Julia */
  116. #include "NVRAMType.h"
  117. #include "NVRAMProt.h"
  118. #include "NVRAMEnum.h"
  119. #include "CallmanagementIdDef.h"
  120. #include "CallManagementStruct.h"
  121. /* MTK Leo add 20040321, for new simulator, used by CallSetup.h */
  122. #ifdef MMI_ON_HARDWARE_P
  123. #include "l4c_common_enum.h"
  124. #endif 
  125. /* MTK Leo end */
  126. #include "CallSetup.h"
  127. #include "ManageCallMain.h"
  128. #include "SettingProt.h"
  129. #include "SettingDefs.h"
  130. #include "CallSetUpEnum.h"
  131. #include "CommonScreens.h"
  132. #include "SettingGprots.h"
  133. #include "MessagesExDcl.h"
  134. #include "MMI_features.h"
  135. #include "wgui_categories_inputs.h"
  136. /* micha0901 */
  137. #include "ProfileGprots.h"
  138. #include "Wgui_categories_popup.h"
  139. #include "CallManagementStruct.h"
  140. #include "CallManagementGprot.h"
  141. #include "CallStructureManagementProt.h"
  142. CallSetupContext g_callset_context;
  143. extern MMI_OWNER_NUMBER_STRUCT gDispOwnerNumber[];
  144. #ifdef __IP_NUMBER__
  145. static U8 IPSetting = 0xff;
  146. static U8 IPNumber[MAX_IP_NUMBER][(MAX_IP_NUMBER_LEN + 1) * ENCODING_LENGTH];
  147. static U8 newIPNum[(MAX_IP_NUMBER_LEN + 1) * ENCODING_LENGTH];
  148. static S32 curIPNumIndex = 0;
  149. #endif /* __IP_NUMBER__ */ 
  150. /* Start by Julia */
  151. //KP Jerry modify on 2007-4-25 start
  152. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  153. static pBOOL gBlackListFlag = FALSE;
  154. static U8 BlackListNum[MAX_BLACK_LIST_NUMBER][(MAX_BLACK_LIST_NUMBER_LEN + 1) * ENCODING_LENGTH];       /* black list number stored in NVRAM */
  155. static U8 dispBlackListNum[MAX_BLACK_LIST_NUMBER][(MAX_BLACK_LIST_NUMBER_LEN + 1) * ENCODING_LENGTH];   /* temp black list number for displaying reason */
  156. static S32 curBlackListNumIndex = 0;
  157. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  158. static FIREWALL_SMSINFO Firewall_SmsInfo = {0,0};
  159. static FIREWALL_MODE gFirewallMode = FIREWALL_CLOSE;
  160. static U8 BlackListNum[MAX_BLACK_LIST_NUMBER][(MAX_BLACK_LIST_NUMBER_LEN + 1) * ENCODING_LENGTH];       /* black list number stored in NVRAM */
  161. static U8 WhiteListNum[MAX_BLACK_LIST_NUMBER][(MAX_BLACK_LIST_NUMBER_LEN + 1) * ENCODING_LENGTH];       /* white list number stored in NVRAM */
  162. static U8 dispFirewallListNum[MAX_BLACK_LIST_NUMBER][(MAX_BLACK_LIST_NUMBER_LEN + 1) * ENCODING_LENGTH];   /* temp black list number for displaying reason */
  163. static S32 curFirewallListNumIndex = 0;
  164. static U8 fieldStatesAvailableIn[2] = {0,0};
  165. #endif
  166. //KP Jerry modify on 2007-4-25 end
  167. /* End by Julia */
  168. #ifdef __MMI_SS_SHOW_CAUSE__
  169. const SSCauseDisplayStruct CauseDisplay[] = 
  170. {
  171.     {CM_UNASSIGNED_NUM, "cm unassigned num"},
  172.     {CM_NO_ROUTE_TO_DESTINATION, "cm no route to destination"},
  173.     {CM_CHANNEL_UN_ACCP, "cm channel un accp"},
  174.     {CM_OPR_DTR_BARRING, "cm opr dtr barring"},
  175.     {CM_CALL_BARRED, "cm call barred"},
  176.     {CM_RESERVED, "cm reserved"},
  177.     {CM_NORMAL_CALL_CLR, "cm normal call clr"},
  178.     {CM_USER_BUSY, "cm user busy"},
  179.     {CM_NO_USER_RESPONDING, "cm no user responding"},
  180.     {CM_NO_ANSWER_ON_ALERT, "cm no answer on alert"},
  181.     {CM_CALL_REJECTED, "cm call rejected"},
  182.     {CM_NUMBER_CHANGED, "cm number changed"},
  183.     {CM_PRE_EMPTION, "cm pre emption"},
  184.     {CM_NON_SEL_USER_CLEAR, "cm non sel user clear"},
  185.     {CM_DEST_OUT_OF_ORDER, "cm dest out of order"},
  186.     {CM_INVALID_NUMBER_FORMAT, "cm invalid number format"},
  187.     {CM_FACILITY_REJECT, "cm facility reject"},
  188.     {CM_RES_STATUS_ENQ, "cm res status enq"},
  189.     {CM_NORMAL_UNSPECIFIED, "cm normal unspecified"},
  190.     {CM_NO_CIRCUIT_CHANNEL_AVAIL, "cm no circuit channel avail"},
  191.     {CM_NETWORK_OUT_OF_ORDER, "cm network out of order"},
  192.     {CM_TEMPORARY_FAILURE, "cm temporary failure"},
  193.     {CM_SWITCH_EQUIPMENT_CONGESTION, "cm switch equipment congestion"},
  194.     {CM_ACCESS_INFO_DISCARDED, "cm access info discarded"},
  195.     {CM_REQUESTED_CKT_CHANEL_NOT_AVIL, "cm requested ckt chanel not avil"},
  196.     {CM_RESOURCE_UNAVAIL_UNSPECIFIED, "cm resource unavail unspecified"},
  197.     {CM_QOS_UNAVAIL, "cm qos unavail"},
  198.     {CM_REQ_FAC_NOT_SUBS, "cm req fac not subs"},
  199.     {CM_IC_BAR_CUG, "cm ic bar cug"},
  200.     {CM_BEARER_CAP_NOT_AUTHORISED, "cm bearer cap not authorised"},
  201.     {CM_BEARER_CAP_NOT_AVAIL, "cm bearer cap not avail"},
  202.     {CM_SER_UNAVAILABLE, "cm ser unavailable"},
  203.     {CM_BEARER_SER_UNIMPL, "cm bearer ser unimpl"},
  204.     {CM_ACM_EXCEEDED, "cm acm exceeded"},
  205.     {CM_REQ_FACILITY_UNAVAIL, "cm req facility unavail"},
  206.     {CM_RESTR_DIGITAL_INFO, "cm restr digital info"},
  207.     {CM_SER_OPT_UNIMPL, "cm ser opt unimpl"},
  208.     {CM_INVALID_TI_VALUE, "cm invalid ti value"},
  209.     {CM_USER_NOT_IN_CUG, "cm user not in cug"},
  210.     {CM_INCOMPATIBLE_DEST, "cm incompatible dest"},
  211.     {CM_INVALID_TRANSIT_NW_SEL, "cm invalid transit nw sel"},
  212.     {CM_SEMANTIC_ERR, "cm semantic err"},
  213.     {CM_INVALID_MANDATORY_INF, "cm invalid mandatory inf"},
  214.     {CM_MSG_TYPE_UNIMPL, "cm msg type unimpl"},
  215.     {CM_MSG_TYPE_NOT_COMPATIBLE, "cm msg type not compatible"},
  216.     {CM_IE_NON_EX, "cm ie non ex"},
  217.     {CM_COND_IE_ERR, "cm cond ie err"},
  218.     {CM_INCOMP_MESG_WITH_STATE, "cm incomp mesg with state"},
  219.     {CM_RECOVERY_ON_TIMER_EXPIRY, "cm recovery on timer expiry"},
  220.     {CM_PROTOCOL_ERR_UNSPECIFIED, "cm protocol err unspecified"},
  221.     {CM_INTER_WRK_UNSPECIFIED, "cm inter wrk unspecified"},
  222.     {TELEMATIC_INT_WRK_NOT_SUPPORT, "telematic int wrk not support"},
  223.     {SMS_TYPE0_NOT_SUPPORT, "sms type0 not support"},
  224.     {CANNOT_REPLACE_MSG, "cannot replace msg"},
  225.     {UNSPECIFIED_PID_ERROR, "unspecified pid error"},
  226.     {ALPHABET_NOT_SUPPORT, "alphabet not support"},
  227.     {MSG_CLASS_NOT_SUPPORT, "msg class not support"},
  228.     {UNSPECIFIED_TP_DCS, "unspecified tp dcs"},
  229.     {CMD_CANNOT_ACTION, "cmd cannot action"},
  230.     {CMD_NOT_SUPPORT, "cmd not support"},
  231.     {UNSPECIFIED_CMD_ERROR, "unspecified cmd error"},
  232.     {TPDU_NOT_SUPPORT, "tpdu not support"},
  233.     {SC_BUSY, "sc busy"},
  234.     {NO_SC_SUBSCRIPTION, "no sc subscription"},
  235.     {SC_SYS_FAILURE, "sc sys failure"},
  236.     {INVALID_SME_ADDR, "invalid sme addr"},
  237.     {DEST_SME_BARRED, "dest sme barred"},
  238.     {SM_REJ_DUP_SM, "sm rej dup sm"},
  239.     {TP_VPF_NOT_SUPPORT, "tp vpf not support"},
  240.     {TP_VP_NOT_SUPPORT, "tp vp not support"},
  241.     {SIM_STORAGE_FULL, "sim storage full"},
  242.     {NO_SMS_STO_IN_SIM, "no sms sto in sim"},
  243.     {ERROR_IN_MS, "error in ms"},
  244.     {MEM_CAP_EXCEEDED, "mem cap exceeded"},
  245.     {SMS_SAT_BUSY, "sms sat busy"},
  246.     {SMS_SAT_DL_ERROR, "sms sat dl error"},
  247.     {SMS_CP_RETRY_EXCEED, "sms cp retry exceed"},
  248.     {SMS_RP_TR1M_TIMEOUT, "sms rp tr1m timeout"},
  249.     {SMS_CONNECTION_BROKEN, "sms connection broken"},
  250.     {UNSPECIFIED_TP_FCS, "unspecified tp fcs"},
  251.     {INVALID_PDU_MODE_PARA, "invalid pdu mode para"},
  252.     {INVALID_TEXT_MODE_PARA, "invalid text mode para"},
  253.     {SMS_SIM_FAILURE, "sms sim failure"},
  254.     {MEM_FAILURE, "mem failure"},
  255.     {INVALID_MEM_INDEX, "invalid mem index"},
  256.     {MEM_FULL, "mem full"},
  257.     {SCA_UNKNOWN, "sca unknown"},
  258.     {NO_CNMA_EXPECTED, "no cnma expected"},
  259.     {SMSAL_UNSPECIFIED_ERROR_CAUSE, "smsal unspecified error cause"},
  260.     {SMSAL_NO_ERROR, "smsal no error"},
  261.     {MSG_LEN_EXCEEDED, "msg len exceeded"},
  262.     {INVALID_REQ_PARAMETER, "invalid req parameter"},
  263.     {SMS_ME_STORAGE_FAILURE, "sms me storage failure"},
  264.     {SMSAL_INVALID_BEARER, "smsal invalid bearer"},
  265.     {SMSAL_INVALID_SERVICE_MODE, "smsal invalid service mode"},
  266.     {SMSAL_INVALID_STORAGE_TYPE, "smsal invalid storage type"},
  267.     {SMSAL_INVALID_MSG_FORMAT, "smsal invalid msg format"},
  268.     {TOO_MANY_MO_CONCAT_MSG, "too many mo concat msg"},
  269.     {SMSAL_NOT_READY, "smsal not ready"},
  270.     {SMSAL_NO_MO_SERVICE, "smsal no mo service"},
  271.     {NOT_SUPP_SR_CMD_IN_STORAGE, "not supp sr cmd in storage"},
  272.     {SMSAL_NOT_SUPPORT_MSG_TYPE, "smsal not support msg type"},
  273.     {CSMCC_CMD_NOT_ALLOW, "csmcc cmd not allow"},
  274.     {CSMCC_ILLEGAL_CALL_ID, "csmcc illegal call id"},
  275.     {CSMCC_CALL_ALLOC_FAIL, "csmcc call alloc fail"},
  276.     {CSMCC_BC_FILL_FAIL, "csmcc bc fill fail"},
  277.     {CSMCC_CALL_RE_EST, "csmcc call re est"},
  278.     {CSMCC_ILLEGAL_DTMF_TONE, "csmcc illegal dtmf tone"},
  279.     {CSMCC_ILLEGAL_BC, "csmcc illegal bc"},
  280.     {CSMCC_MODIFY_ACTUAL_MODE, "csmcc modify actual mode"},
  281.     {CSMCC_DATA_ACT_FAIL, "csmcc data act fail"},
  282.     {CSMCC_NO_RESPONSE_FROM_NW, "csmcc no response from nw"},
  283.     {CSMCC_CALL_ACCEPT_NOT_ALLOW, "csmcc call accept not allow"},
  284.     {CM_SS_ERR_UNKNOWNSUBSCRIBER, "cm ss err unknownsubscriber"},
  285.     {CM_SS_ERR_ILLEGALSUBSCRIBER, "cm ss err illegalsubscriber"},
  286.     {CM_SS_ERR_BEARERSERVICENOTPROVISIONED, "cm ss err bearerservicenotprovisioned"},
  287.     {CM_SS_ERR_TELESERVICENOTPROVISIONED, "cm ss err teleservicenotprovisioned"},
  288.     {CM_SS_ERR_ILLEGALEQUIPMENT, "cm ss err illegalequipment"},
  289.     {CM_SS_ERR_CALLBARRED, "cm ss err callbarred"},
  290.     {CM_SS_ERR_ILLEGALSS_OPERATION, "cm ss err illegalss operation"},
  291.     {CM_SS_ERR_SS_ERRORSTATUS, "cm ss err ss errorstatus"},
  292.     {CM_SS_ERR_SS_NOTAVAILABLE, "cm ss err ss notavailable"},
  293.     {CM_SS_ERR_SS_SUBSCRIPTIONVIOLATION, "cm ss err ss subscriptionviolation"},
  294.     {CM_SS_ERR_SS_INCOMPABILITY, "cm ss err ss incompability"},
  295.     {CM_SS_ERR_FACILITYNOTSUPPORTED, "cm ss err facilitynotsupported"},
  296.     {CM_SS_ERR_ABSENTSUBSCRIBER, "cm ss err absentsubscriber"},
  297.     {CM_SS_ERR_SHORTTERMDENIAL, "cm ss err shorttermdenial"},
  298.     {CM_SS_ERR_LONGTERMDENIAL, "cm ss err longtermdenial"},
  299.     {CM_SS_ERR_SYSTEMFAILURE, "cm ss err systemfailure"},
  300.     {CM_SS_ERR_DATAMISSING, "cm ss err datamissing"},
  301.     {CM_SS_ERR_UNEXPECTEDDATAVALUE, "cm ss err unexpecteddatavalue"},
  302.     {CM_SS_ERR_PW_REGISTRATIONFAILURE, "cm ss err pw registrationfailure"},
  303.     {CM_SS_ERR_NEGATIVEPW_CHECK, "cm ss err negativepw check"},
  304.     {CM_SS_ERR_NUMBEROFPW_ATTEMPTSVIOLATION, "cm ss err numberofpw attemptsviolation"},
  305.     {CM_SS_ERR_POSITIONMETHODFAILURE, "cm ss err positionmethodfailure"},
  306.     {CM_SS_ERR_UNKNOWNALPHABET, "cm ss err unknownalphabet"},
  307.     {CM_SS_ERR_USSD_BUSY, "cm ss err ussd busy"},
  308.     {CM_SS_ERR_REJECTEDBYUSER, "cm ss err rejectedbyuser"},
  309.     {CM_SS_ERR_REJECTEDBYNETWORK, "cm ss err rejectedbynetwork"},
  310.     {CM_SS_ERR_DEFLECTIONTOSERVEDSUBSCRIBER, "cm ss err deflectiontoservedsubscriber"},
  311.     {CM_SS_ERR_SPECIALSERVICECODE, "cm ss err specialservicecode"},
  312.     {CM_SS_ERR_INVALIDDEFLECTIONTONUMBER, "cm ss err invaliddeflectiontonumber"},
  313.     {CM_SS_ERR_MAXNUMBEROFMPTY_PARTICIPANTSEXCEEDED, "cm ss err maxnumberofmpty participantsexceeded"},
  314.     {CM_SS_ERR_RESOURCESNOTAVAILABLE, "cm ss err resourcesnotavailable"},
  315.     {CM_SS_GENERALPROBLEM_UNRECOGNIZEDCOMPONENT, "cm ss generalproblem unrecognizedcomponent"},
  316.     {CM_SS_GENERALPROBLEM_MISTYPEDCOMPONENT, "cm ss generalproblem mistypedcomponent"},
  317.     {CM_SS_GENERALPROBLEM_BADLYSTRUCTUREDCOMPONENT, "cm ss generalproblem badlystructuredcomponent"},
  318.     {CM_SS_INVOKEPROBLEM_DUPLICATEINVOKEID, "cm ss invokeproblem duplicateinvokeid"},
  319.     {CM_SS_INVOKEPROBLEM_UNRECOGNIZEDOPERATION, "cm ss invokeproblem unrecognizedoperation"},
  320.     {CM_SS_INVOKEPROBLEM_MISTYPEDPARAMETER, "cm ss invokeproblem mistypedparameter"},
  321.     {CM_SS_INVOKEPROBLEM_RESOURCELIMITATION, "cm ss invokeproblem resourcelimitation"},
  322.     {CM_SS_INVOKEPROBLEM_INITIATINGRELEASE, "cm ss invokeproblem initiatingrelease"},
  323.     {CM_SS_INVOKEPROBLEM_UNRECOGNIZEDLINKDID, "cm ss invokeproblem unrecognizedlinkdid"},
  324.     {CM_SS_INVOKEPROBLEM_LINKEDRESONSEUNEXPECTED, "cm ss invokeproblem linkedresonseunexpected"},
  325.     {CM_SS_INVOKEPROBLEM_UNEXPECTEDLINKEDOPERATION, "cm ss invokeproblem unexpectedlinkedoperation"},
  326.     {CM_SS_RETURNRESULTPROBLEM_RR_UNRECOGNIZEDINVOKEID, "cm ss returnresultproblem rr unrecognizedinvokeid"},
  327.     {CM_SS_RETURNRESULTPROBLEM_RR_RETURNRESULTUNEXPECTED, "cm ss returnresultproblem rr returnresultunexpected"},
  328.     {CM_SS_RETURNRESULTPROBLEM_RR_MISTYPEDPARAMETER, "cm ss returnresultproblem rr mistypedparameter"},
  329.     {CM_SS_RETURNERRORPROBLEM_RE_UNRECOGNIZEDINVOKEID, "cm ss returnerrorproblem re unrecognizedinvokeid"},
  330.     {CM_SS_RETURNERRORPROBLEM_RE_RETURNERRORUNEXPECTED, "cm ss returnerrorproblem re returnerrorunexpected"},
  331.     {CM_SS_RETURNERRORPROBLEM_RE_UNRECOGNIZEDERROR, "cm ss returnerrorproblem re unrecognizederror"},
  332.     {CM_SS_RETURNERRORPROBLEM_RE_UNEXPECTEDERROR, "cm ss returnerrorproblem re unexpectederror"},
  333.     {CM_SS_RETURNERRORPROBLEM_RE_MISTYPEDPARAMETER, "cm ss returnerrorproblem re mistypedparameter"},
  334.     {CM_MM_CAUSE_NONE, "cm mm cause none"},
  335.     {CM_MM_IMSI_UNKNOWN_IN_HLR, "cm mm imsi unknown in hlr"},
  336.     {CM_MM_ILLEGAL_MS, "cm mm illegal ms"},
  337.     {CM_MM_IMSI_UNKNOWN_IN_VLR, "cm mm imsi unknown in vlr"},
  338.     {CM_MM_IMEI_NOT_ACCEPTED, "cm mm imei not accepted"},
  339.     {CM_MM_ILLEGAL_ME, "cm mm illegal me"},
  340.     {CM_MM_GPRS_NOT_ALLOWED, "cm mm gprs not allowed"},
  341.     {CM_MM_GPRS_NON_GPRS_NOT_ALLOWED, "cm mm gprs non gprs not allowed"},
  342.     {CM_MM_MS_ID_NOT_DERIVED_BY_NW, "cm mm ms id not derived by nw"},
  343.     {CM_MM_IMPLICIT_DETACH, "cm mm implicit detach"},
  344.     {CM_MM_PLMN_NOT_ALLOWED, "cm mm plmn not allowed"},
  345.     {CM_MM_LOCATION_AREA_NOT_ALLOWED, "cm mm location area not allowed"},
  346.     {CM_MM_ROAMING_AREA_NOT_ALLOWED, "cm mm roaming area not allowed"},
  347.     {CM_MM_GPRS_NOT_ALLOWED_IN_PLMN, "cm mm gprs not allowed in plmn"},
  348.     {CM_MM_NO_SUITABLE_CELLS_IN_LA, "cm mm no suitable cells in la"},
  349.     {CM_MM_MSC_TEMP_NOT_REACHABLE, "cm mm msc temp not reachable"},
  350.     {CM_MM_NETWORK_FAILURE, "cm mm network failure"},
  351.     {CM_MM_MAC_FAILURE, "cm mm mac failure"},
  352.     {CM_MM_SYNC_FAILURE, "cm mm sync failure"},
  353.     {CM_MM_CONGESTION, "cm mm congestion"},
  354.     {CM_MM_SERV_OPTION_NOT_SUPPORTED, "cm mm serv option not supported"},
  355.     {CM_MM_REQ_SERV_OPTION_NOT_SUBSCRIBED, "cm mm req serv option not subscribed"},
  356.     {CM_MM_SERV_OPTION_TEMP_OUT_OF_ORDER, "cm mm serv option temp out of order"},
  357.     {CM_MM_CALL_CANNOT_BE_IDENTIFIED, "cm mm call cannot be identified"},
  358.     {CM_MM_NO_PDP_CONTEXT_ACTIVATED, "cm mm no pdp context activated"},
  359.     {CM_MM_RETRY_UPON_ENTRY_INTO_NEWCELL_MIN, "cm mm retry upon entry into newcell min"},
  360.     {CM_MM_RETRY_UPON_ENTRY_INTO_NEWCELL_MAX, "cm mm retry upon entry into newcell max"},
  361.     {CM_MM_SEMANTICALLY_INCORRECT_MSG, "cm mm semantically incorrect msg"},
  362.     {CM_MM_INVALID_MM_MAND_INFO, "cm mm invalid mm mand info"},
  363.     {CM_MM_MSG_TYPE_NON_EXISTENT, "cm mm msg type non existent"},
  364.     {CM_MM_MSG_TYPE_NOT_IMPLEMENTED, "cm mm msg type not implemented"},
  365.     {CM_MM_MSG_TYPE_INCOMPAT_WITH_PROTO_STATE, "cm mm msg type incompat with proto state"},
  366.     {CM_MM_IE_NOT_IMPLEMENTED, "cm mm ie not implemented"},
  367.     {CM_MM_CONDITIONAL_MM_IE_ERROR, "cm mm conditional mm ie error"},
  368.     {CM_MM_MSG_NOT_COMPAT_WITH_PROTO_STATE, "cm mm msg not compat with proto state"},
  369.     {CM_MM_PROTO_ERROR_UNSPECIFIED, "cm mm proto error unspecified"},
  370.     {CM_MM_ACCESS_BARRED, "cm mm access barred"},
  371.     {CM_MM_ASSIGNMENT_REJECT, "cm mm assignment reject"},
  372.     {CM_MM_RANDOM_ACCES_FAILURE, "cm mm random acces failure"},
  373.     {CM_MM_RR_NO_SERVICE, "cm mm rr no service"},
  374.     {CM_MM_RR_CONN_RELEASE, "cm mm rr conn release"},
  375.     {CM_MM_AUTH_FAILURE, "cm mm auth failure"},
  376.     {CM_MM_IMSI_DETACH, "cm mm imsi detach"},
  377.     {CM_MM_ABORT_BY_NW, "cm mm abort by nw"},
  378.     {CM_MM_CONN_TIMEOUT, "cm mm conn timeout"},
  379.     {CM_MM_CM_ENQUEUE_FAIL, "cm mm cm enqueue fail"},
  380.     {CM_MM_NOT_UPDATED, "cm mm not updated"},
  381.     {CM_MM_STATE_NOT_ALLOWED_CM, "cm mm state not allowed cm"},
  382.     {CM_MM_EMERGENCY_NOT_ALLOWED, "cm mm emergency not allowed"},
  383.     {CM_MM_NO_SERVICE, "cm mm no service"},
  384.     {CM_MM_ACCESS_CLASS_BARRED, "cm mm access class barred"},
  385.     {SIM_CAUSE_CMD_SUCCESS, "sim cause cmd success"},
  386.     {SIM_CAUSE_CMD_FAIL, "sim cause cmd fail"},
  387.     {SIM_CAUSE_FATAL_ERROR, "sim cause fatal error"},
  388.     {SIM_CAUSE_NO_INSERTED, "sim cause no inserted"},
  389.     {SIM_CAUSE_CHV_NOT_INIT, "sim cause chv not init"},
  390.     {SIM_CAUSE_CHV_VERIFY_ERROR, "sim cause chv verify error"},
  391.     {SIM_CAUSE_CHV_BLOCK, "sim cause chv block"},
  392.     {SIM_CAUSE_ACCESS_NOT_ALLOW, "sim cause access not allow"},
  393.     {SIM_CAUSE_SAT_CMD_BUSY, "sim cause sat cmd busy"},
  394.     {SIM_CAUSE_DL_ERROR, "sim cause dl error"},
  395.     {SIM_CAUSE_MEMORY_PROBLEM, "sim cause memory problem"},
  396.     {SIM_CAUSE_TECHNICAL_PROBLEM, "sim cause technical problem"},
  397.     {SIM_CAUSE_PUK_UNLOCK, "sim cause puk unlock"},
  398.     {(U16) NULL, ""}
  399. };
  400. #endif /* __MMI_SS_SHOW_CAUSE__ */ 
  401. /*****************************************************************************
  402.  * FUNCTION
  403.  *  InitManageCalls
  404.  * DESCRIPTION
  405.  *  
  406.  * PARAMETERS
  407.  *  void
  408.  * RETURNS
  409.  *  void
  410.  *****************************************************************************/
  411. void InitManageCalls()
  412. {
  413.     /*----------------------------------------------------------------*/
  414.     /* Local Variables                                                */
  415.     /*----------------------------------------------------------------*/
  416.     /*----------------------------------------------------------------*/
  417.     /* Code Body                                                      */
  418.     /*----------------------------------------------------------------*/
  419.     InitCallerId();
  420.     InitCallWaiting();
  421.     InitCallForwarding();
  422.     InitCallBarring();
  423.     InitLineSwitch();
  424.     InitGroupListApp();
  425.     SetHiliteHandler(MENU8237_SCR8093_MNGCALL_MENU_MAIN, HighlightManageCalls);
  426.     SetHiliteHandler(MENU_SETTING_CALL_REMINDER, HighlightCALLSETCallTimeReminder);
  427.     SetHiliteHandler(MENU_SETTING_CALL_TIME_DISPLAY, HighlightCALLSETCallTimeDisplay);
  428.     SetHiliteHandler(MENU9140_AUTO_REDIAL, HighlightCALLSETAutoRedial);
  429.     /* micha0908 */
  430. #ifndef __MMI_REMOVE_CUG__
  431.     SetHiliteHandler(MENU_SETTING_CALL_CLOSED_GP, HighlightCALLSETClosedUserGroup);
  432. #endif 
  433.     SetHintHandler(MENU_CALLER_ID, HintCALLSETCallerID);
  434.     SetHintHandler(MENU_LINE_SWCH, HintCALLSETLineSwitch);
  435.     SetHintHandler(MENU_SETTING_CALL_REMINDER, HintCALLSETCallTimeReminder);
  436.     SetHintHandler(MENU_SETTING_CALL_TIME_DISPLAY, HintCALLSETCallTimeDisplay);
  437.     SetHintHandler(MENU9140_AUTO_REDIAL, HintCALLSETAutoRedial);
  438.     g_callset_context.SSCFNumFromPHB = FALSE;
  439. #ifdef __IP_NUMBER__
  440.     SetHiliteHandler(MENU_SETTING_IP_NUMBER, HighlightIPNumber);
  441.     InitIPNumber();
  442. #endif /* __IP_NUMBER__ */ 
  443.     /* Start by Julia */
  444. #ifdef __MMI_CM_BLACK_LIST__
  445. //KP Jerry modify on 2007-4-26 start
  446. #if defined(__MMI_CM_BLACK_LIST__) && !defined(__MMI_CM_WHITE_LIST__)
  447.     SetHiliteHandler(MENU_SETTING_BLACK_LIST, HighlightBlackList);
  448.     SetHintHandler(MENU_SETTING_BLACK_LIST, HintBlackList);
  449. #elif defined(__MMI_CM_BLACK_LIST__) && defined(__MMI_CM_WHITE_LIST__)
  450.     SetHiliteHandler(MENU_SETTING_FIREWALL, HighlightBlackList);
  451.     SetHintHandler(MENU_SETTING_FIREWALL, HintBlackList);
  452. #endif
  453. //KP Jerry modify on 2007-4-26 end
  454.     InitBlackList();
  455. #endif /* __MMI_CM_BLACK_LIST__ */ 
  456.     /* End by Julia */
  457. }
  458. /*****************************************************************************
  459.  * FUNCTION
  460.  *  HintCALLSETCallerID
  461.  * DESCRIPTION
  462.  *  
  463.  * PARAMETERS
  464.  *  index       [IN]        
  465.  * RETURNS
  466.  *  void
  467.  *****************************************************************************/
  468. void HintCALLSETCallerID(U16 index)
  469. {
  470.     /*----------------------------------------------------------------*/
  471.     /* Local Variables                                                */
  472.     /*----------------------------------------------------------------*/
  473.     /*----------------------------------------------------------------*/
  474.     /* Code Body                                                      */
  475.     /*----------------------------------------------------------------*/
  476.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  477.     switch (g_callset_context.CallerID)
  478.     {
  479.         case 0:
  480.             pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_CLI_HIDE_ID));
  481.             break;
  482.         case 1:
  483.             pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_CLI_SEND_ID));
  484.             break;
  485.         case 2:
  486.             pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_CLI_SET_NETWORK));
  487.             break;
  488.     }
  489. }
  490. /*****************************************************************************
  491.  * FUNCTION
  492.  *  HintCALLSETLineSwitch
  493.  * DESCRIPTION
  494.  *  
  495.  * PARAMETERS
  496.  *  index       [IN]        
  497.  * RETURNS
  498.  *  void
  499.  *****************************************************************************/
  500. void HintCALLSETLineSwitch(U16 index)
  501. {
  502.     /*----------------------------------------------------------------*/
  503.     /* Local Variables                                                */
  504.     /*----------------------------------------------------------------*/
  505. #ifdef __MMI_LINE_SWITCH_SHOW_NUMBER__
  506.     S8 tempstr[10];
  507. #endif 
  508.     /*----------------------------------------------------------------*/
  509.     /* Code Body                                                      */
  510.     /*----------------------------------------------------------------*/
  511.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  512.     if (g_callset_context.LineID == LINE1)
  513.     {
  514.         pfnUnicodeStrcpy((S8*) g_callset_context.LineInfo, (S8*) GetString(STR_LSW_LINE1));
  515.     #ifdef __MMI_LINE_SWITCH_SHOW_NUMBER__
  516.         if (pfnUnicodeStrlen((S8*) gDispOwnerNumber[0].name) > 0)
  517.         {
  518.             AnsiiToUnicodeString((S8*) tempstr, (S8*) ",");
  519.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) tempstr);
  520.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) gDispOwnerNumber[0].name);
  521.         }
  522.         else if (pfnUnicodeStrlen((S8*) gDispOwnerNumber[0].number) > 0)
  523.         {
  524.             AnsiiToUnicodeString((S8*) tempstr, (S8*) ",");
  525.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) tempstr);
  526.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) gDispOwnerNumber[0].number);
  527.         }
  528.     #endif /* __MMI_LINE_SWITCH_SHOW_NUMBER__ */ 
  529.     }
  530.     else
  531.     {
  532.         pfnUnicodeStrcpy((S8*) g_callset_context.LineInfo, (S8*) GetString(STR_LSW_LINE2));
  533.     #ifdef __MMI_LINE_SWITCH_SHOW_NUMBER__
  534.         if (pfnUnicodeStrlen((S8*) gDispOwnerNumber[1].name) > 0)
  535.         {
  536.             AnsiiToUnicodeString((S8*) tempstr, (S8*) ",");
  537.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) tempstr);
  538.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) gDispOwnerNumber[1].name);
  539.         }
  540.         else if (pfnUnicodeStrlen((S8*) gDispOwnerNumber[1].number) > 0)
  541.         {
  542.             AnsiiToUnicodeString((S8*) tempstr, (S8*) ",");
  543.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) tempstr);
  544.             pfnUnicodeStrcat((S8*) g_callset_context.LineInfo, (S8*) gDispOwnerNumber[1].number);
  545.         }
  546.     #endif /* __MMI_LINE_SWITCH_SHOW_NUMBER__ */ 
  547.     }
  548.     pfnUnicodeStrcpy((S8*) hintData[index], (PS8) g_callset_context.LineInfo);
  549. }
  550. /*****************************************************************************
  551.  * FUNCTION
  552.  *  HintCALLSETCallTimeReminder
  553.  * DESCRIPTION
  554.  *  
  555.  * PARAMETERS
  556.  *  index       [IN]        
  557.  * RETURNS
  558.  *  void
  559.  *****************************************************************************/
  560. void HintCALLSETCallTimeReminder(U16 index)
  561. {
  562.     /*----------------------------------------------------------------*/
  563.     /* Local Variables                                                */
  564.     /*----------------------------------------------------------------*/
  565.     /*----------------------------------------------------------------*/
  566.     /* Code Body                                                      */
  567.     /*----------------------------------------------------------------*/
  568.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  569.     switch (CallTimeReminderStatus())
  570.     {
  571.         case 0:
  572.             pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  573.             break;
  574.         case 1:
  575.             pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_CR_SING));
  576.             break;
  577.         case 2:
  578.             pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_SETTING_CR_PERIOD));
  579.             break;
  580.     }
  581. }
  582. /*****************************************************************************
  583.  * FUNCTION
  584.  *  HintCALLSETCallTimeDisplay
  585.  * DESCRIPTION
  586.  *  
  587.  * PARAMETERS
  588.  *  index       [IN]        
  589.  * RETURNS
  590.  *  void
  591.  *****************************************************************************/
  592. void HintCALLSETCallTimeDisplay(U16 index)
  593. {
  594.     /*----------------------------------------------------------------*/
  595.     /* Local Variables                                                */
  596.     /*----------------------------------------------------------------*/
  597.     /*----------------------------------------------------------------*/
  598.     /* Code Body                                                      */
  599.     /*----------------------------------------------------------------*/
  600.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  601.     if (GetCallTimeDisplay())
  602.     {
  603.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  604.     }
  605.     else
  606.     {
  607.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  608.     }
  609. }
  610. /*****************************************************************************
  611.  * FUNCTION
  612.  *  HintCALLSETAutoRedial
  613.  * DESCRIPTION
  614.  *  
  615.  * PARAMETERS
  616.  *  index       [IN]        
  617.  * RETURNS
  618.  *  void
  619.  *****************************************************************************/
  620. void HintCALLSETAutoRedial(U16 index)
  621. {
  622.     /*----------------------------------------------------------------*/
  623.     /* Local Variables                                                */
  624.     /*----------------------------------------------------------------*/
  625.     /*----------------------------------------------------------------*/
  626.     /* Code Body                                                      */
  627.     /*----------------------------------------------------------------*/
  628.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  629.     if (AutoRedialOnOffStatus())
  630.     {
  631.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_ON));
  632.     }
  633.     else
  634.     {
  635.         pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_OFF));
  636.     }
  637. }
  638. /*****************************************************************************
  639.  * FUNCTION
  640.  *  HighlightManageCalls
  641.  * DESCRIPTION
  642.  *  
  643.  * PARAMETERS
  644.  *  void
  645.  * RETURNS
  646.  *  void
  647.  *****************************************************************************/
  648. void HighlightManageCalls()
  649. {
  650.     /*----------------------------------------------------------------*/
  651.     /* Local Variables                                                */
  652.     /*----------------------------------------------------------------*/
  653.     /*----------------------------------------------------------------*/
  654.     /* Code Body                                                      */
  655.     /*----------------------------------------------------------------*/
  656.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  657.     SetKeyHandler(EntryCALLSETMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  658.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  659.     SetLeftSoftkeyFunction(EntryCALLSETMain, KEY_EVENT_UP);
  660.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  661.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  662. }
  663. /*****************************************************************************
  664.  * FUNCTION
  665.  *  EntryCALLSETMain
  666.  * DESCRIPTION
  667.  *  
  668.  * PARAMETERS
  669.  *  void
  670.  * RETURNS
  671.  *  void
  672.  *****************************************************************************/
  673. void EntryCALLSETMain()
  674. {
  675.     /*----------------------------------------------------------------*/
  676.     /* Local Variables                                                */
  677.     /*----------------------------------------------------------------*/
  678.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  679.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  680.     //micha1229
  681.     //      U16 nDispAttribute; /* Stores display attribue */
  682.     U8 *guiBuffer;              /* Buffer holding history data */
  683.     /* U32 maskingByte=0xFFFFFFFF;
  684.        U32 menuItemId=0xFFFFFFFF; */
  685.     U8 *CallSetupType[MAX_SUB_MENUS];
  686.     /*----------------------------------------------------------------*/
  687.     /* Code Body                                                      */
  688.     /*----------------------------------------------------------------*/
  689.     EntryNewScreen(SCR_ID_CALLSET_MAIN, NULL, EntryCALLSETMain, NULL);
  690.     /* 2 Get current screen to gui buffer  for history purposes */
  691.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_MAIN);
  692.     /* 3. Retrieve no of child of menu item to be displayed */
  693.     /* diamond, 2005/07/01 add _Ext to menu item functions */
  694.     nNumofItem = GetNumOfChild_Ext(MENU8237_SCR8093_MNGCALL_MENU_MAIN);
  695.     /* 4. Get attribute of menu to be displayed */
  696.     /* nDispAttribute = GetDispAttributeOfItem(MENU8237_SCR8093_MNGCALL_MENU_MAIN); */
  697.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  698.     /* diamond, 2005/07/01 add _Ext to menu item functions */
  699.     GetSequenceStringIds_Ext(MENU8237_SCR8093_MNGCALL_MENU_MAIN, nStrItemList);
  700.     /* 6 Set current parent id */
  701.     SetParentHandler(MENU8237_SCR8093_MNGCALL_MENU_MAIN);
  702.     ConstructHintsList(MENU8237_SCR8093_MNGCALL_MENU_MAIN, CallSetupType);
  703.     /* 7 Register highlight handler to be called in menu screen */
  704.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  705.     /* 8 Display Category1 Screen */
  706.     /* diamond, 2005/07/01 removed for new menu item architecture to CPHS */
  707. #if 0
  708. /* under construction !*/
  709. /* under construction !*/
  710. /* under construction !*/
  711. /* under construction !*/
  712. /* under construction !*/
  713. /* under construction !*/
  714. /* under construction !*/
  715. /* under construction !*/
  716. /* under construction !*/
  717. /* under construction !*/
  718. /* under construction !*/
  719. /* under construction !*/
  720. /* under construction !*/
  721. /* under construction !*/
  722. /* under construction !*/
  723. /* under construction !*/
  724. /* under construction !*/
  725. /* under construction !*/
  726. /* under construction !*/
  727. /* under construction !*/
  728. /* under construction !*/
  729. /* under construction !*/
  730. #endif /* 0 */ 
  731.     ShowCategory52Screen(
  732.         STR_SCR8093_MNGCALL_MENU_CAPTION,
  733.         MAIN_MENU_TITLE_SETTINGS_ICON,
  734.         STR_GLOBAL_OK,
  735.         IMG_GLOBAL_OK,
  736.         STR_GLOBAL_BACK,
  737.         IMG_GLOBAL_BACK,
  738.         nNumofItem,
  739.         nStrItemList,
  740.         (U16*) gIndexIconsImageList,
  741.         CallSetupType,
  742.         0,
  743.         0,
  744.         guiBuffer);
  745.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  746.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  747. }
  748. /*****************************************************************************
  749.  * FUNCTION
  750.  *  AppendBScodeString
  751.  * DESCRIPTION
  752.  *  
  753.  * PARAMETERS
  754.  *  bscode_input        [IN]        
  755.  *  temp_string         [IN]        
  756.  * RETURNS
  757.  *  void
  758.  *****************************************************************************/
  759. void AppendBScodeString(U8 bscode_input, PS8 temp_string)
  760. {
  761.     /*----------------------------------------------------------------*/
  762.     /* Local Variables                                                */
  763.     /*----------------------------------------------------------------*/
  764.     /*----------------------------------------------------------------*/
  765.     /* Code Body                                                      */
  766.     /*----------------------------------------------------------------*/
  767.     switch ((U8) bscode_input)
  768.     {
  769.         case L4_ALL_TELESERVICES:
  770.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_TELESERVICES));
  771.             break;
  772.         case L4_TELEPHONY:
  773.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_TELEPHONY));
  774.             break;
  775.         case L4_ALL_DATA_TELESERVICES:
  776.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_DATA_TELESERVICES));
  777.             break;
  778.         case L4_FACSIMILE_SERVICES:
  779.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_FACSIMILE_SERVICES));
  780.             break;
  781.         case L4_SHORT_MESSAGE_SERVICES:
  782.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_SHORT_MESSAGE_SERVICES));
  783.             break;
  784.         case L4_ALL_TELESERVICES_EXCEPT_SMS:
  785.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_TELESERVICES_EXCEPT_SMS));
  786.             break;
  787.         case L4_VOICE_GROUP_CALL_SERVICE:
  788.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_VOICE_GROUP_CALL_SERVICE));
  789.             break;
  790.         case L4_VOICE_BROADCAST_SERVICE:
  791.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_VOICE_BROADCAST_SERVICE));
  792.             break;
  793.         case L4_ALL_BEARER_SERVICES:
  794.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_BEARER_SERVICES));
  795.             break;
  796.         case L4_ALL_ASYNC_SERVICES:
  797.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_ASYNC_SERVICES));
  798.             break;
  799.         case L4_ALL_SYNC_SERVICES:
  800.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_SYNC_SERVICES));
  801.             break;
  802.         case L4_ALL_DATA_CIRCUIT_SYNC:
  803.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_DATA_CIRCUIT_SYNC));
  804.             break;
  805.         case L4_ALL_DATA_CIRCUIT_ASYNC:
  806.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_DATA_CIRCUIT_ASYNC));
  807.             break;
  808.         case L4_ALL_GPRS_BEARER_SERVICES:
  809.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_ALL_GPRS_BEARER_SERVICES));
  810.             break;
  811.         case L4_BS_ALLPADACCESSCA_SERVICES:
  812.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_BS_ALLPADACCESSCA_SERVICES));
  813.             break;
  814.         case L4_BS_ALLDATAPDS_SERVICES:
  815.             pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_L4_BS_ALLDATAPDS_SERVICES));
  816.             break;
  817.     }
  818. }
  819. /*****************************************************************************
  820.  * FUNCTION
  821.  *  HighlightCALLSETAutoRedial
  822.  * DESCRIPTION
  823.  *  
  824.  * PARAMETERS
  825.  *  void
  826.  * RETURNS
  827.  *  void
  828.  *****************************************************************************/
  829. void HighlightCALLSETAutoRedial(void)
  830. {
  831.     /*----------------------------------------------------------------*/
  832.     /* Local Variables                                                */
  833.     /*----------------------------------------------------------------*/
  834.     /*----------------------------------------------------------------*/
  835.     /* Code Body                                                      */
  836.     /*----------------------------------------------------------------*/
  837.     g_callset_context.AutoRedialInput = (U8) GetCurrHiliteID();
  838.     if (g_callset_context.AutoRedialStatus == 0)
  839.     {
  840.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  841.     }
  842.     else
  843.     {
  844.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  845.     }
  846.     /* 2 Change right soft key icon and label */
  847.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  848.     /* 1 Change left soft key icon and label */
  849.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  850.     /* 3 Register function for left soft key */
  851.     SetLeftSoftkeyFunction(EntryScrAutoRedial, KEY_EVENT_UP);
  852.     /* 4 Register function for right soft key */
  853.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  854.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  855. }
  856. /*****************************************************************************
  857.  * FUNCTION
  858.  *  EntryScrAutoRedial
  859.  * DESCRIPTION
  860.  *  
  861.  * PARAMETERS
  862.  *  void
  863.  * RETURNS
  864.  *  void
  865.  *****************************************************************************/
  866. void EntryScrAutoRedial(void)
  867. {
  868.     /*----------------------------------------------------------------*/
  869.     /* Local Variables                                                */
  870.     /*----------------------------------------------------------------*/
  871.     U8 data = 0;
  872.     S16 error;
  873.     /*----------------------------------------------------------------*/
  874.     /* Code Body                                                      */
  875.     /*----------------------------------------------------------------*/
  876.     /* Store the updated Value */
  877.     if (g_callset_context.AutoRedialStatus == 0)
  878.     {
  879.         data = 1;
  880.     }
  881.     WriteValue(NVRAM_SETTING_AUTOREDIAL, &data, DS_BYTE, &error);
  882.     if (data)
  883.     {
  884.         pfnUnicodeStrcpy((S8*) hintData[g_callset_context.AutoRedialInput], (PS8) GetString(STR_GLOBAL_ON));
  885.         Category52ChangeItemDescription(g_callset_context.AutoRedialInput, (U8*) GetString(STR_GLOBAL_ON));
  886.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  887.         g_callset_context.AutoRedialStatus = 1;
  888.     }
  889.     else
  890.     {
  891.         pfnUnicodeStrcpy((S8*) hintData[g_callset_context.AutoRedialInput], (PS8) GetString(STR_GLOBAL_OFF));
  892.         Category52ChangeItemDescription(g_callset_context.AutoRedialInput, (U8*) GetString(STR_GLOBAL_OFF));
  893.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  894.         g_callset_context.AutoRedialStatus = 0;
  895.     }
  896.     RedrawCategoryFunction();
  897.     HighlightCALLSETAutoRedial();
  898. }
  899. /*****************************************************************************
  900.  * FUNCTION
  901.  *  HighlightCALLSETCallTimeDisplay
  902.  * DESCRIPTION
  903.  *  
  904.  * PARAMETERS
  905.  *  void
  906.  * RETURNS
  907.  *  void
  908.  *****************************************************************************/
  909. void HighlightCALLSETCallTimeDisplay(void)
  910. {
  911.     /*----------------------------------------------------------------*/
  912.     /* Local Variables                                                */
  913.     /*----------------------------------------------------------------*/
  914.     /*----------------------------------------------------------------*/
  915.     /* Code Body                                                      */
  916.     /*----------------------------------------------------------------*/
  917.     g_callset_context.CTDInput = (U8) GetCurrHiliteID();
  918.     if (g_callset_context.CTDStatus == 1)
  919.     {
  920.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  921.     }
  922.     else
  923.     {
  924.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  925.     }
  926.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  927.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  928.     SetLeftSoftkeyFunction(EntryCallTimeDisplay, KEY_EVENT_UP);
  929.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  930.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  931. }
  932. /*****************************************************************************
  933.  * FUNCTION
  934.  *  EntryCallTimeDisplay
  935.  * DESCRIPTION
  936.  *  
  937.  * PARAMETERS
  938.  *  void
  939.  * RETURNS
  940.  *  void
  941.  *****************************************************************************/
  942. void EntryCallTimeDisplay(void)
  943. {
  944.     /*----------------------------------------------------------------*/
  945.     /* Local Variables                                                */
  946.     /*----------------------------------------------------------------*/
  947.     U8 data = 0;
  948.     S16 error;
  949.     /*----------------------------------------------------------------*/
  950.     /* Code Body                                                      */
  951.     /*----------------------------------------------------------------*/
  952.     if (g_callset_context.CTDStatus == 0)
  953.     {
  954.         data = 1;
  955.     }
  956.     WriteValue(NVRAM_SETTING_CALL_TIME_DISPLAY, &data, DS_BYTE, &error);
  957.     if (data)
  958.     {
  959.         pfnUnicodeStrcpy((S8*) hintData[g_callset_context.CTDInput], (PS8) GetString(STR_GLOBAL_ON));
  960.         Category52ChangeItemDescription(g_callset_context.CTDInput, (U8*) GetString(STR_GLOBAL_ON));
  961.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  962.         g_callset_context.CTDStatus = 1;
  963.     }
  964.     else
  965.     {
  966.         pfnUnicodeStrcpy((S8*) hintData[g_callset_context.CTDInput], (PS8) GetString(STR_GLOBAL_OFF));
  967.         Category52ChangeItemDescription(g_callset_context.CTDInput, (U8*) GetString(STR_GLOBAL_OFF));
  968.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  969.         g_callset_context.CTDStatus = 0;
  970.     }
  971.     RedrawCategoryFunction();
  972.     HighlightCALLSETCallTimeDisplay();
  973. }
  974. /* micha0908 */
  975. #ifndef __MMI_REMOVE_CUG__
  976. /*****************************************************************************
  977.  * FUNCTION
  978.  *  HighlightCALLSETClosedUserGroup
  979.  * DESCRIPTION
  980.  *  
  981.  * PARAMETERS
  982.  *  void
  983.  * RETURNS
  984.  *  void
  985.  *****************************************************************************/
  986. void HighlightCALLSETClosedUserGroup()
  987. {
  988.     /*----------------------------------------------------------------*/
  989.     /* Local Variables                                                */
  990.     /*----------------------------------------------------------------*/
  991.     /*----------------------------------------------------------------*/
  992.     /* Code Body                                                      */
  993.     /*----------------------------------------------------------------*/
  994.     /* 1 Change left soft key icon and label */
  995.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  996.     SetKeyHandler(EntryCALLSETCUGMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  997.     /* 2 Change right soft key icon and label */
  998.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  999.     SetLeftSoftkeyFunction(EntryCALLSETCUGMain, KEY_EVENT_UP);
  1000.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1001.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1002. }
  1003. #endif /* __MMI_REMOVE_CUG__ */ 
  1004. /*****************************************************************************
  1005.  * FUNCTION
  1006.  *  HighlightCALLSETCallTimeReminder
  1007.  * DESCRIPTION
  1008.  *  
  1009.  * PARAMETERS
  1010.  *  void
  1011.  * RETURNS
  1012.  *  void
  1013.  *****************************************************************************/
  1014. void HighlightCALLSETCallTimeReminder(void)
  1015. {
  1016.     /*----------------------------------------------------------------*/
  1017.     /* Local Variables                                                */
  1018.     /*----------------------------------------------------------------*/
  1019.     /*----------------------------------------------------------------*/
  1020.     /* Code Body                                                      */
  1021.     /*----------------------------------------------------------------*/
  1022.     /* 1 Change left soft key icon and label */
  1023.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  1024.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1025.     /* 2 Change right soft key icon and label */
  1026.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  1027.     SetLeftSoftkeyFunction(EntryCALLSETCallTimeReminder, KEY_EVENT_UP);
  1028.     /* micha0424 */
  1029.     SetKeyHandler(EntryCALLSETCallTimeReminder, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1030.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1031.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1032. }
  1033. /*****************************************************************************
  1034.  * FUNCTION
  1035.  *  EntryCALLSETCallTimeReminder
  1036.  * DESCRIPTION
  1037.  *  
  1038.  * PARAMETERS
  1039.  *  void
  1040.  * RETURNS
  1041.  *  void
  1042.  *****************************************************************************/
  1043. void EntryCALLSETCallTimeReminder(void)
  1044. {
  1045.     /*----------------------------------------------------------------*/
  1046.     /* Local Variables                                                */
  1047.     /*----------------------------------------------------------------*/
  1048.     U16 nStrItemList[3];    /* Stores the strings id of submenus returned */
  1049.     U16 nNumofItem;         /* Stores no of children in the submenu */
  1050.     //micha1229
  1051.     //      U16 nDispAttribute; /* Stores display attribue */
  1052.     U8 *guiBuffer;              /* Buffer holding history data */
  1053.     /*----------------------------------------------------------------*/
  1054.     /* Code Body                                                      */
  1055.     /*----------------------------------------------------------------*/
  1056.     EntryNewScreen(SCR_ID_CALLSET_CTR, NULL, EntryCALLSETCallTimeReminder, NULL);
  1057.     /* 2 Get current screen to gui buffer  for history purposes */
  1058.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_CTR);
  1059.     /* 3. Retrieve no of child of menu item to be displayed */
  1060.     nNumofItem = GetNumOfChild(MENU_SETTING_CALL_REMINDER);
  1061.     /* 4. Get attribute of menu to be displayed */
  1062.     /* nDispAttribute = GetDispAttributeOfItem(MENU_SETTING_CALL_REMINDER); */
  1063.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  1064.     GetSequenceStringIds(MENU_SETTING_CALL_REMINDER, nStrItemList);
  1065.     /* 6 Set current parent id */
  1066.     SetParentHandler(MENU_SETTING_CALL_REMINDER);
  1067.     /* 7 Register highlight handler to be called in menu screen */
  1068.     RegisterHighlightHandler(CtrHandler);
  1069.     /* 8 Display Category1 Screen */
  1070.     ShowCategory11Screen(
  1071.         STR_SETTING_CALL_REMINDER,
  1072.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1073.         STR_GLOBAL_OK,
  1074.         0,
  1075.         STR_GLOBAL_BACK,
  1076.         0,
  1077.         nNumofItem,
  1078.         nStrItemList,
  1079.         (U16) g_callset_context.CTRStatusInput,
  1080.         guiBuffer);
  1081.     /* 9.Register function with right softkey */
  1082.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1083.     SetLeftSoftkeyFunction(SendCtr, KEY_EVENT_UP);
  1084.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1085.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1086. }
  1087. /*****************************************************************************
  1088.  * FUNCTION
  1089.  *  CtrHandler
  1090.  * DESCRIPTION
  1091.  *  
  1092.  * PARAMETERS
  1093.  *  index       [IN]        
  1094.  * RETURNS
  1095.  *  void
  1096.  *  
  1097.  *  Author            : Vanita Jain(?)
  1098.  *****************************************************************************/
  1099. void CtrHandler(S32 index)
  1100. {
  1101.     /*----------------------------------------------------------------*/
  1102.     /* Local Variables                                                */
  1103.     /*----------------------------------------------------------------*/
  1104.     /*----------------------------------------------------------------*/
  1105.     /* Code Body                                                      */
  1106.     /*----------------------------------------------------------------*/
  1107.     g_callset_context.CTRStatusInput = (U8) index;
  1108. }
  1109. /*****************************************************************************
  1110.  * FUNCTION
  1111.  *  SendCtr
  1112.  * DESCRIPTION
  1113.  *  
  1114.  * PARAMETERS
  1115.  *  void
  1116.  * RETURNS
  1117.  *  void
  1118.  *****************************************************************************/
  1119. void SendCtr(void)
  1120. {
  1121.     /*----------------------------------------------------------------*/
  1122.     /* Local Variables                                                */
  1123.     /*----------------------------------------------------------------*/
  1124.     U8 data;
  1125.     S16 error;
  1126.     /*----------------------------------------------------------------*/
  1127.     /* Code Body                                                      */
  1128.     /*----------------------------------------------------------------*/
  1129.     data = g_callset_context.CTRStatusInput;
  1130.     if (data == 0)
  1131.     {
  1132.         WriteValue(NVRAM_SETTING_CTR, &data, DS_BYTE, &error);
  1133.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
  1134.         /* micha0706 */
  1135.         DeleteScreenIfPresent(SCR_ID_CALLSET_CTR);
  1136.     }
  1137.     else
  1138.     {
  1139.         EntryCALLSETCtrTime();
  1140.     }
  1141. }
  1142. /*****************************************************************************
  1143.  * FUNCTION
  1144.  *  EntryCALLSETCtrTime
  1145.  * DESCRIPTION
  1146.  *  
  1147.  * PARAMETERS
  1148.  *  void
  1149.  * RETURNS
  1150.  *  void
  1151.  *****************************************************************************/
  1152. void EntryCALLSETCtrTime(void)
  1153. {
  1154.     /*----------------------------------------------------------------*/
  1155.     /* Local Variables                                                */
  1156.     /*----------------------------------------------------------------*/
  1157.     U8 *guiBuffer;  /* Buffer holding history data */
  1158.     U8 *inputBuffer;
  1159.     /*----------------------------------------------------------------*/
  1160.     /* Code Body                                                      */
  1161.     /*----------------------------------------------------------------*/
  1162.     EntryNewScreen(SCR_ID_CALLSET_CTR_TIME, ExitCALLSETCtrTime, NULL, NULL);
  1163.     guiBuffer = GetCurrGuiBuffer(SCR_ID_CALLSET_CTR_TIME);
  1164.     inputBuffer = GetCurrInputBuffer(SCR_ID_CALLSET_CTR_TIME);
  1165.     if (inputBuffer == NULL)
  1166.     {
  1167.         if (g_callset_context.CTRStatusInput != 0 && gui_atoi((UI_string_type) g_callset_context.CTRNumber) != 0
  1168.             && g_callset_context.CTRStatus == g_callset_context.CTRStatusInput)
  1169.         {
  1170.         #ifdef __COUNTDOWN_PERIODIC_CTR_MODE__
  1171.             if (g_callset_context.CTRStatusInput != 1)
  1172.             {
  1173.                 S8 temp_buf[6];
  1174.                 S32 ctr_time = 0;
  1175.                 ctr_time = gui_atoi((UI_string_type) g_callset_context.CTRNumber);
  1176.                 if ((ctr_time <= 60) && (ctr_time >= 0))
  1177.                 {
  1178.                     ctr_time = 60 - ctr_time;
  1179.                     sprintf(temp_buf, "%d", ctr_time);
  1180.                     memset(g_callset_context.CTRNumberInput, 0, MAX_CTR_NUM_DIGITS * ENCODING_LENGTH);
  1181.                     AnsiiToUnicodeString((PS8) g_callset_context.CTRNumberInput, temp_buf);
  1182.                 }
  1183.                 else
  1184.                 {
  1185.                     memset(g_callset_context.CTRNumberInput, 0, 6 * ENCODING_LENGTH);
  1186.                 }
  1187.             }
  1188.             else
  1189.             {
  1190.                 pfnUnicodeStrcpy((S8*) g_callset_context.CTRNumberInput, (S8*) g_callset_context.CTRNumber);
  1191.             }
  1192.         #else /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1193.             pfnUnicodeStrcpy((S8*) g_callset_context.CTRNumberInput, (S8*) g_callset_context.CTRNumber);
  1194.         #endif /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1195.         }
  1196.         else
  1197.         {
  1198.             memset(g_callset_context.CTRNumberInput, 0, MAX_CTR_NUM_DIGITS * ENCODING_LENGTH);
  1199.         }
  1200.     }
  1201.     else
  1202.     {
  1203.         pfnUnicodeStrcpy((S8*) g_callset_context.CTRNumberInput, (S8*) inputBuffer);
  1204.     }
  1205.     if (g_callset_context.CTRStatusInput == 1)
  1206.     {
  1207.         ShowCategory69Screen(
  1208.             STR_CTR_REM,
  1209.             MAIN_MENU_TITLE_SETTINGS_ICON,
  1210.             STR_GLOBAL_OK,
  1211.             IMG_GLOBAL_OK,
  1212.             STR_GLOBAL_BACK,
  1213.             IMG_GLOBAL_BACK,
  1214.             STR_SETTING_CR_RANGE2,
  1215.             INPUT_TYPE_NUMERIC,
  1216.             g_callset_context.CTRNumberInput,
  1217.             5,
  1218.             guiBuffer);
  1219.     }
  1220.     else
  1221.     {
  1222.     #ifdef __COUNTDOWN_PERIODIC_CTR_MODE__
  1223.         ShowCategory69Screen(
  1224.             STR_CTR_REM,
  1225.             MAIN_MENU_TITLE_SETTINGS_ICON,
  1226.             STR_GLOBAL_OK,
  1227.             IMG_GLOBAL_OK,
  1228.             STR_GLOBAL_BACK,
  1229.             IMG_GLOBAL_BACK,
  1230.             STR_SETTING_CR_RANGE3,
  1231.             INPUT_TYPE_NUMERIC,
  1232.             g_callset_context.CTRNumberInput,
  1233.             3,
  1234.             guiBuffer);
  1235.     #else /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1236.         ShowCategory69Screen(
  1237.             STR_CTR_REM,
  1238.             MAIN_MENU_TITLE_SETTINGS_ICON,
  1239.             STR_GLOBAL_OK,
  1240.             IMG_GLOBAL_OK,
  1241.             STR_GLOBAL_BACK,
  1242.             IMG_GLOBAL_BACK,
  1243.             STR_SETTING_CR_RANGE1,
  1244.             INPUT_TYPE_NUMERIC,
  1245.             g_callset_context.CTRNumberInput,
  1246.             3,
  1247.             guiBuffer);
  1248.     #endif /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1249.     }
  1250.     SetLeftSoftkeyFunction(EntryCtrTimeDone, KEY_EVENT_UP);
  1251.     SetCategory69RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1252. }
  1253. /*****************************************************************************
  1254.  * FUNCTION
  1255.  *  EntryCtrTimeDone
  1256.  * DESCRIPTION
  1257.  *  gets name input from user
  1258.  * PARAMETERS
  1259.  *  void
  1260.  * RETURNS
  1261.  *  void
  1262.  *****************************************************************************/
  1263. void EntryCtrTimeDone(void)
  1264. {
  1265.     /*----------------------------------------------------------------*/
  1266.     /* Local Variables                                                */
  1267.     /*----------------------------------------------------------------*/
  1268.     U8 err = 0;
  1269.     historyNode *History;
  1270.     /*----------------------------------------------------------------*/
  1271.     /* Code Body                                                      */
  1272.     /*----------------------------------------------------------------*/
  1273.     if (g_callset_context.CTRStatusInput == 1)
  1274.     {
  1275.         if (gui_atoi((UI_string_type) g_callset_context.CTRNumberInput) < 1 ||
  1276.             gui_atoi((UI_string_type) g_callset_context.CTRNumberInput) > 3000)
  1277.         {
  1278.             err = 1;
  1279.         }
  1280.     }
  1281.     else
  1282.     {
  1283.     #ifdef __COUNTDOWN_PERIODIC_CTR_MODE__
  1284.         if (gui_atoi((UI_string_type) g_callset_context.CTRNumberInput) < 0 ||
  1285.             gui_atoi((UI_string_type) g_callset_context.CTRNumberInput) > 30)
  1286.     #else /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1287.         if (gui_atoi((UI_string_type) g_callset_context.CTRNumberInput) < 30 ||
  1288.             gui_atoi((UI_string_type) g_callset_context.CTRNumberInput) > 60)
  1289.     #endif /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1290.         {
  1291.             err = 1;
  1292.         }
  1293.     }
  1294.     if (pfnUnicodeStrlen((PS8) g_callset_context.CTRNumberInput) == 0)
  1295.     {
  1296.         err = 1;
  1297.     }
  1298.     if (err == 1)
  1299.     {
  1300.         err = 0;
  1301.         DisplayPopup((PU8) GetString(STR_GLOBAL_NOT_DONE), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  1302.         if (GetHistoryScrID(SCR_ID_CALLSET_CTR_TIME, &History) == ST_SUCCESS)
  1303.         {
  1304.             if (History->inputBuffer != NULL)
  1305.             {
  1306.                 memset(History->inputBuffer, 0, ENCODING_LENGTH);
  1307.             }
  1308.             if (History->guiBuffer != NULL)
  1309.             {
  1310.                 memset(History->guiBuffer, 0, 2);
  1311.             }
  1312.         }
  1313.     }
  1314.     else
  1315.     {
  1316.         SendCtrTime();
  1317.     }
  1318. }
  1319. /*****************************************************************************
  1320.  * FUNCTION
  1321.  *  ExitCtrTimeDone
  1322.  * DESCRIPTION
  1323.  *  
  1324.  * PARAMETERS
  1325.  *  void
  1326.  * RETURNS
  1327.  *  void
  1328.  *****************************************************************************/
  1329. void ExitCtrTimeDone(void)
  1330. {
  1331.     /*----------------------------------------------------------------*/
  1332.     /* Local Variables                                                */
  1333.     /*----------------------------------------------------------------*/
  1334.     history Scr;    /* Variable to hold the history data */
  1335.     S16 nHistory = 0;
  1336.     /*----------------------------------------------------------------*/
  1337.     /* Code Body                                                      */
  1338.     /*----------------------------------------------------------------*/
  1339.     stopRequestedTone(WARNING_TONE);
  1340.     Scr.scrnID = SCR_SETTING_CTR_TIME_DONE;
  1341.     Scr.entryFuncPtr = EntryCtrTimeDone;
  1342.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) & nHistory);
  1343.     GetCategoryHistory(Scr.guiBuffer);
  1344.     AddHistory(Scr);
  1345. }
  1346. /*****************************************************************************
  1347.  * FUNCTION
  1348.  *  SendCtrTime
  1349.  * DESCRIPTION
  1350.  *  
  1351.  * PARAMETERS
  1352.  *  void
  1353.  * RETURNS
  1354.  *  void
  1355.  *****************************************************************************/
  1356. void SendCtrTime()
  1357. {
  1358.     /*----------------------------------------------------------------*/
  1359.     /* Local Variables                                                */
  1360.     /*----------------------------------------------------------------*/
  1361.     S16 error;
  1362.     U16 time = 0;
  1363.     U16 data;
  1364.     /*----------------------------------------------------------------*/
  1365.     /* Code Body                                                      */
  1366.     /*----------------------------------------------------------------*/
  1367.     data = g_callset_context.CTRStatusInput;
  1368.     time = (U16) gui_atoi((UI_string_type) g_callset_context.CTRNumberInput);
  1369. #ifdef __COUNTDOWN_PERIODIC_CTR_MODE__
  1370.     if (data == 2)
  1371.     {
  1372.         time = 60 - time;
  1373.     }
  1374. #endif /* __COUNTDOWN_PERIODIC_CTR_MODE__ */ 
  1375.     WriteValue(NVRAM_SETTING_CTR, &data, DS_BYTE, &error);
  1376.     WriteValue(NVRAM_SETTING_CTR_TIME, &time, DS_SHORT, &error);
  1377.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
  1378.     /* micha0706 */
  1379.     DeleteScreenIfPresent(SCR_ID_CALLSET_CTR);
  1380.     DeleteScreenIfPresent(SCR_ID_CALLSET_CTR_TIME);
  1381. }
  1382. /*****************************************************************************
  1383.  * FUNCTION
  1384.  *  ExitCALLSETCtrTime
  1385.  * DESCRIPTION
  1386.  *  
  1387.  * PARAMETERS
  1388.  *  void
  1389.  * RETURNS
  1390.  *  void
  1391.  *****************************************************************************/
  1392. void ExitCALLSETCtrTime(void)
  1393. {
  1394.     /*----------------------------------------------------------------*/
  1395.     /* Local Variables                                                */
  1396.     /*----------------------------------------------------------------*/
  1397.     history Scr;    /* Variable to hold the history data */
  1398.     /*----------------------------------------------------------------*/
  1399.     /* Code Body                                                      */
  1400.     /*----------------------------------------------------------------*/
  1401.     Scr.scrnID = SCR_ID_CALLSET_CTR_TIME;
  1402.     Scr.entryFuncPtr = EntryCALLSETCtrTime;
  1403.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) g_callset_context.CTRNumberInput);
  1404.     GetCategoryHistory(Scr.guiBuffer);
  1405.     AddHistory(Scr);
  1406. }
  1407. #ifdef __MMI_SS_SHOW_CAUSE__
  1408. /*****************************************************************************
  1409.  * FUNCTION
  1410.  *  ShowCauseString
  1411.  * DESCRIPTION
  1412.  *  
  1413.  * PARAMETERS
  1414.  *  cause_number        [IN]        
  1415.  *  temp_string         [IN]        
  1416.  * RETURNS
  1417.  *  void
  1418.  *****************************************************************************/
  1419. void ShowCauseString(U16 cause_number, PS8 temp_string)
  1420. {
  1421.     /*----------------------------------------------------------------*/
  1422.     /* Local Variables                                                */
  1423.     /*----------------------------------------------------------------*/
  1424.     U8 i;
  1425.     S8 TempBuff[MAX_DISP_UCS2];
  1426.     /*----------------------------------------------------------------*/
  1427.     /* Code Body                                                      */
  1428.     /*----------------------------------------------------------------*/
  1429.     pfnUnicodeStrcpy((PS8) temp_string, (PS8) GetString(STR_GLOBAL_NOT_DONE));
  1430.     for (i = 0; CauseDisplay[i].cause_number != (U16) NULL; i++)
  1431.     {
  1432.         if (cause_number == CauseDisplay[i].cause_number)
  1433.         {
  1434.             AnsiiToUnicodeString((PS8) TempBuff, (PS8) CauseDisplay[i].cause_string);
  1435.             pfnUnicodeStrcat((PS8) temp_string, (PS8) TempBuff);
  1436.             return;
  1437.         }
  1438.     }
  1439.     pfnUnicodeStrcat((PS8) temp_string, (PS8) GetString(STR_UNKNOWN_CAUSE));
  1440. }
  1441. #endif /* __MMI_SS_SHOW_CAUSE__ */ 
  1442. /*****************************************************************************
  1443.  * FUNCTION
  1444.  *  GetCtrStatus
  1445.  * DESCRIPTION
  1446.  *  Show whether PowerSaving Feature is on or off
  1447.  * PARAMETERS
  1448.  *  void
  1449.  * RETURNS
  1450.  *  pBOOL
  1451.  *  
  1452.  *  Author            : Vanita Jain
  1453.  *****************************************************************************/
  1454. SETTING_CTR GetCtrStatus(void)
  1455. {
  1456.     /*----------------------------------------------------------------*/
  1457.     /* Local Variables                                                */
  1458.     /*----------------------------------------------------------------*/
  1459.     U8 data = 0;
  1460.     S16 error;
  1461.     /*----------------------------------------------------------------*/
  1462.     /* Code Body                                                      */
  1463.     /*----------------------------------------------------------------*/
  1464.     ReadValue(NVRAM_SETTING_CTR, &data, DS_BYTE, &error);
  1465.     /* micha1229 */
  1466.     return ((SETTING_CTR) data);
  1467. }
  1468. /*****************************************************************************
  1469.  * FUNCTION
  1470.  *  GetCtrTime
  1471.  * DESCRIPTION
  1472.  *  Show whether PowerSaving Feature is on or off
  1473.  * PARAMETERS
  1474.  *  void
  1475.  * RETURNS
  1476.  *  pBOOL
  1477.  *  
  1478.  *  Author            : Vanita Jain
  1479.  *****************************************************************************/
  1480. U16 GetCtrTime(void)
  1481. {
  1482.     /*----------------------------------------------------------------*/
  1483.     /* Local Variables                                                */
  1484.     /*----------------------------------------------------------------*/
  1485.     S16 error;
  1486.     U16 time = 0;
  1487.     /*----------------------------------------------------------------*/
  1488.     /* Code Body                                                      */
  1489.     /*----------------------------------------------------------------*/
  1490.     ReadValue(NVRAM_SETTING_CTR_TIME, &time, DS_SHORT, &error);
  1491.     return time;
  1492. }
  1493. /*****************************************************************************
  1494.  * FUNCTION
  1495.  *  AutoRedialOnOffStatus
  1496.  * DESCRIPTION
  1497.  *  Show whether AutoRedial Feature is on or off
  1498.  * PARAMETERS
  1499.  *  void
  1500.  * RETURNS
  1501.  *  pBOOL
  1502.  *  
  1503.  *  Author            : Vanita Jain
  1504.  *****************************************************************************/
  1505. MMI_BOOL AutoRedialOnOffStatus(void)
  1506. {
  1507.     /*----------------------------------------------------------------*/
  1508.     /* Local Variables                                                */
  1509.     /*----------------------------------------------------------------*/
  1510.     U8 data = 0;
  1511.     S16 error;
  1512.     /*----------------------------------------------------------------*/
  1513.     /* Code Body                                                      */
  1514.     /*----------------------------------------------------------------*/
  1515.     ReadValue(NVRAM_SETTING_AUTOREDIAL, &data, DS_BYTE, &error);
  1516.     if (data == 1)
  1517.     {
  1518.         g_callset_context.AutoRedialStatus = 1;
  1519.         return MMI_TRUE;
  1520.     }
  1521.     else if (data == 0xff)
  1522.     {
  1523.         data = 0;
  1524.         WriteValue(NVRAM_SETTING_AUTOREDIAL, &data, DS_BYTE, &error);
  1525.         g_callset_context.AutoRedialStatus = 0;
  1526.         return MMI_FALSE;
  1527.     }
  1528.     else
  1529.     {
  1530.         g_callset_context.AutoRedialStatus = 0;
  1531.         return MMI_FALSE;
  1532.     }
  1533. }
  1534. /*****************************************************************************
  1535.  * FUNCTION
  1536.  *  CallTimeReminderStatus
  1537.  * DESCRIPTION
  1538.  *  Show whether AutoRedial Feature is on or off
  1539.  * PARAMETERS
  1540.  *  void
  1541.  * RETURNS
  1542.  *  pBOOL
  1543.  *  
  1544.  *  Author            : Vanita Jain
  1545.  *****************************************************************************/
  1546. U8 CallTimeReminderStatus(void)
  1547. {
  1548.     /*----------------------------------------------------------------*/
  1549.     /* Local Variables                                                */
  1550.     /*----------------------------------------------------------------*/
  1551.     U8 data = 0;
  1552.     U16 ctrTime = 0;
  1553.     S16 error;
  1554.     S8 temp_buf[6];
  1555.     /*----------------------------------------------------------------*/
  1556.     /* Code Body                                                      */
  1557.     /*----------------------------------------------------------------*/
  1558.     ReadValue(NVRAM_SETTING_CTR, &data, DS_BYTE, &error);
  1559.     ReadValue(NVRAM_SETTING_CTR_TIME, &ctrTime, DS_SHORT, &error);
  1560.     if (ctrTime == 0xffff)
  1561.     {
  1562.         ctrTime = 0;
  1563.         WriteValue(NVRAM_SETTING_CTR_TIME, &ctrTime, DS_SHORT, &error);
  1564.     }
  1565.     if (data == 0xff)
  1566.     {
  1567.         data = 0;
  1568.         WriteValue(NVRAM_SETTING_CTR, &data, DS_BYTE, &error);
  1569.     }
  1570.     g_callset_context.CTRStatusInput = data;
  1571.     g_callset_context.CTRStatus = data;
  1572.     if (ctrTime == 0 || data == 0)
  1573.     {
  1574.         memset(g_callset_context.CTRNumberInput, 0, MAX_CTR_NUM_DIGITS * ENCODING_LENGTH);
  1575.         memset(g_callset_context.CTRNumber, 0, MAX_CTR_NUM_DIGITS * ENCODING_LENGTH);
  1576.     }
  1577.     else
  1578.     {
  1579.         sprintf(temp_buf, "%d", ctrTime);
  1580.         AnsiiToUnicodeString((PS8) g_callset_context.CTRNumberInput, temp_buf);
  1581.         pfnUnicodeStrcpy((PS8) g_callset_context.CTRNumber, (PS8) g_callset_context.CTRNumberInput);
  1582.     }
  1583.     return (data);
  1584. }
  1585. /*****************************************************************************
  1586.  * FUNCTION
  1587.  *  GetCallTimeDisplay
  1588.  * DESCRIPTION
  1589.  *  Show whether CallTime Display Feature is on or off
  1590.  * PARAMETERS
  1591.  *  void
  1592.  * RETURNS
  1593.  *  MMI_BOOL
  1594.  *  
  1595.  *  Author            : Vanita Jain
  1596.  *****************************************************************************/
  1597. MMI_BOOL GetCallTimeDisplay(void)
  1598. {
  1599. #ifdef __MMI_DISABLE_CALL_TIME_DISPLAY__
  1600.     /*----------------------------------------------------------------*/
  1601.     /* Local Variables                                                */
  1602.     /*----------------------------------------------------------------*/
  1603.     /*----------------------------------------------------------------*/
  1604.     /* Code Body                                                      */
  1605.     /*----------------------------------------------------------------*/
  1606.     return MMI_TRUE;
  1607. #else /* __MMI_DISABLE_CALL_TIME_DISPLAY__ */ 
  1608.     U8 data = 0;
  1609.     S16 error;
  1610.     ReadValue(NVRAM_SETTING_CALL_TIME_DISPLAY, &data, DS_BYTE, &error);
  1611.     if (data == 1)
  1612.     {
  1613.         g_callset_context.CTDStatus = 1;
  1614.         return MMI_TRUE;
  1615.     }
  1616.     else if (data == 0xff)
  1617.     {
  1618.         data = 1;   /* Default =ON */
  1619.         g_callset_context.CTDStatus = 1;
  1620.         WriteValue(NVRAM_SETTING_CALL_TIME_DISPLAY, &data, DS_BYTE, &error);
  1621.         return MMI_TRUE;
  1622.     }
  1623.     else
  1624.     {
  1625.         g_callset_context.CTDStatus = 0;
  1626.         return MMI_FALSE;
  1627.     }
  1628. #endif /* __MMI_DISABLE_CALL_TIME_DISPLAY__ */ 
  1629. }
  1630. /* micha0921 begin */
  1631. /*****************************************************************************
  1632.  * FUNCTION
  1633.  *  EntryCALLSETGeneralSSResutScr
  1634.  * DESCRIPTION
  1635.  *  entry function for call waiting result screen
  1636.  * NA
  1637.  *  
  1638.  * PARAMETERS
  1639.  *  void
  1640.  * RETURNS
  1641.  *  void
  1642.  *****************************************************************************/
  1643. void EntryCALLSETGeneralSSResutScr(void)
  1644. {
  1645.     /*----------------------------------------------------------------*/
  1646.     /* Local Variables                                                */
  1647.     /*----------------------------------------------------------------*/