PowerOnOffDisplay.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:78k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * PowerOnOffDisplay.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for Resource IDs for the Power ON/Off Display
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef POWERONOFFDISPLAY_C
- #define POWERONOFFDISPLAY_C
- /*****************************************************************************
- * Include
- *****************************************************************************/
- #include "MMI_features.h"
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "Unicodexdcl.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "DownloadProtos.h"
- #include "CommonScreens.h"
- #include "EventsGprot.h"
- #include "historyGprot.h"
- #include "ProtocolEvents.h"
- #include "wgui_categories.h"
- #include "wgui_categories_idlescreen.h"
- #include "wgui_categories_multimedia.h"
- #include "MainMenuDef.h"
- #include "TimerEvents.h"
- #include "GlobalDefs.h"
- #include "SettingProt.h"
- #include "wgui_inline_edit.h"
- #include "DebugInitDef.h"
- #include "HistoryGprot.h"
- #include "WPSSProtos.h"
- #include "SettingGprots.h"
- #include "WallpaperDefs.h"
- #include "PowerOnOffDisplayDefs.h"
- #include "SettingDefs.h"
- #include "SettingProfile.h"
- #include "ProfileGprots.h"
- #include "DownloadDefs.h"
- #include "DownloadProtos.h"
- #include "PhoneSetup.h"
- #include "FileManagerGProt.h"
- #include "FileManagerDef.h" /* error string id */
- #include "IdleAppDef.h"
- /* For user defined file image */
- #ifdef __MMI_POWER_ON_OFF_DISPLAY_VIDEO__
- #include "VdoPlyStrEnum.h"
- #include "VdoPlyGProt.h"
- #endif /* __MMI_POWER_ON_OFF_DISPLAY_VIDEO__ */
- #ifdef __MMI_FILE_MANAGER__
- #include "FileMgr.h"
- #endif
- #include "Conversions.h"
- #include "Gdi_include.h" /* GDI_RESULT */
- #include "wgui_categories_multimedia.h" /* ShowCategory222Screen() */
- #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
- #include "ResMemMgrGprot.h"
- #endif /* defined(__MMI_RESOURCE_ENFB_SUPPORT__) */
- /*****************************************************************************
- * External Function
- *****************************************************************************/
- extern U8 PhnsetGetDefEncodingType(void);
- /*****************************************************************************
- * External Variable
- *****************************************************************************/
- /*****************************************************************************
- * Local Variable
- *****************************************************************************/
- static PHNSET_PWRONOFF_FILENAME_STRUCT phnset_pwronoff_filename;
- #ifdef __MMI_FILE_MANAGER__
- static FuncPtr phnset_pwronoff = NULL;
- #endif
- static FuncPtr CallbackPWRLSK = NULL; /* allow mix order of callback and user press OK */
- static U8 item_amount;
- /*****************************************************************************
- * Local Function
- *****************************************************************************/
- static void PhnsetPwrOnOffUsrDefFreeBuf(void);
- static void PhnsetPwrOnOffUsrDefGoBack(void);
- static void ExitPhnsetPwrOnOffSysView(void);
- /*****************************************************************************
- * FUNCTION
- * PhnsetReadPwrOnOffDisp
- * DESCRIPTION
- * This function is to read power on/off display from NVRAM at initialization
- * , and set as current
- * Functionality: Referenced at InitNvramData when bootup
- * PARAMETERS
- * void
- * a(?) [IN/OUT] Void *
- * b(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetReadPwrOnOffDisp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- PHNSET_TYPE_DISP type;
- phnset_wpss_type_enum temp_type = g_phnset_cntx_p->wpss_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dispchar_get_img_id(NVRAM_CURRENT_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetReadPwrOnOffDisp: On, id=%dn", g_phnset_cntx_p->curtPwrOnID));
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtPwrOnID)) == PHNSET_TYPE_DISP_INVALID)
- {
- PhnsetRstPwrOnDisplayDefault();
- }
- else if (type == PHNSET_TYPE_DISP_USER)
- {
- ReadRecord(NVRAM_EF_WPSS_FILENAME_LID, 2, &phnset_pwronoff_filename, sizeof(phnset_pwronoff_filename), &error);
- }
- mmi_dispchar_get_img_id(NVRAM_CURRENT_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetReadPwrOnOffDisp: Off, id=%dn", g_phnset_cntx_p->curtPwrOffID));
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtPwrOffID)) == PHNSET_TYPE_DISP_INVALID)
- {
- PhnsetRstPwrOffDisplayDefault();
- }
- else if (type == PHNSET_TYPE_DISP_USER && (g_phnset_cntx_p->curtPwrOnID) != 0x00)
- {
- ReadRecord(NVRAM_EF_WPSS_FILENAME_LID, 2, &phnset_pwronoff_filename, sizeof(phnset_pwronoff_filename), &error);
- }
- g_phnset_cntx_p->wpss_type = temp_type;
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetPowerOn
- * DESCRIPTION
- * hilight handler when move to power on display option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetPowerOn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWRON;
- #if (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__))
- /* Go to menu with 2 items: System, Download */
- SetLeftSoftkeyFunction(EntryPhnsetPowerOnOffSel, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPowerOnOffSel, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_ID_PHNSET_POWER_ON;
- #else /* (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__)) */
- /* Direct enter system wallpaper list menu */
- SetLeftSoftkeyFunction(EntryPhnsetPowerOnOffSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPowerOnOffSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_ID_PHNSET_POWER_ON_SYSTEM_LIST;
- #endif /* (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__)) */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetPowerOff
- * DESCRIPTION
- * hilight handler when move to power off display option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetPowerOff(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWROFF;
- #if (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__))
- /* Go to menu with 2 items: System, Download */
- SetLeftSoftkeyFunction(EntryPhnsetPowerOnOffSel, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPowerOnOffSel, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_ID_PHNSET_POWER_OFF;
- #else /* (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__)) */
- /* Direct enter system wallpaper list menu */
- SetLeftSoftkeyFunction(EntryPhnsetPowerOnOffSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPowerOnOffSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- g_phnset_cntx_p->ScrAnchor = SCR_ID_PHNSET_POWER_OFF_SYSTEM_LIST;
- #endif /* (defined(__MMI_FILE_MANAGER__) && !defined(__MMI_FILE_MANAGER_HIDE_MENU__)) */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetPwrOnFmgr
- * DESCRIPTION
- * hilight handler when move to power on display "user define" option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetPwrOnFmgr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWRON;
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperFmgr, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperFmgr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetPwrOffFmgr
- * DESCRIPTION
- * hilight handler when move to power off display "user define" option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetPwrOffFmgr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWROFF;
- SetLeftSoftkeyFunction(EntryPhnsetWallpaperFmgr, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetWallpaperFmgr, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetPowerOnSys
- * DESCRIPTION
- * hilight handler when move to power on display "System" option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetPowerOnSys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWRON;
- SetLeftSoftkeyFunction(EntryPhnsetPowerOnOffSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPowerOnOffSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetPowerOffSys
- * DESCRIPTION
- * hilight handler when move to power off display "System" option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetPowerOffSys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWROFF;
- SetLeftSoftkeyFunction(EntryPhnsetPowerOnOffSys, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPowerOnOffSys, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetPwrOnDisplay
- * DESCRIPTION
- * hint handler when move to power on display
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetPwrOnDisplay(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->curtPwrOnID == 0)
- {
- if (phnset_pwronoff_filename.isPwrOnShort == 1)
- {
- U8 *temp = phnset_dispchar_temp;
- /* rename short name file should pass converted short name to editor,
- so that the display will be the same as in File Manager */
- p = PhnsetGetFileNamePointer((PS8) phnset_pwronoff_filename.pwrondisplay);
- mmi_chset_mixed_text_to_ucs2_str(
- (U8*) temp,
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) p,
- (mmi_chset_enum) PhnsetGetDefEncodingType());
- p = (PS8) & temp[0];
- }
- else
- {
- p = PhnsetGetFileNamePointer((PS8) phnset_pwronoff_filename.pwrondisplay);
- }
- }
- else
- {
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- if (PhnsetGetDisplayType(g_phnset_cntx_p->curtPwrOnID) == PHNSET_TYPE_DISP_VIDEO)
- {
- p = GetString((U16)
- (STR_ID_PHNSET_DISPCHAR_VDOID_START +
- (g_phnset_cntx_p->curtPwrOnID - IMG_ID_PHNSET_ON_VDO_START)));
- }
- else
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- {
- p = GetString((U16)
- (STR_ID_PHNSET_DISPCHAR_ANMID_START +
- (g_phnset_cntx_p->curtPwrOnID - IMG_ID_PHNSET_ON_START)));
- }
- }
- if (p)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], p);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetPwrOffDisplay
- * DESCRIPTION
- * hint handler when move to power off display
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetPwrOffDisplay(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 p;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->curtPwrOffID == 0)
- {
- if (phnset_pwronoff_filename.isPwrOffShort == 1)
- {
- U8 temp[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH];
- /* rename short name file should pass converted short name to editor,
- so that the display will be the same as in File Manager */
- p = PhnsetGetFileNamePointer((PS8) phnset_pwronoff_filename.pwroffdisplay);
- mmi_chset_mixed_text_to_ucs2_str(
- (U8*) temp,
- (FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH,
- (U8*) p,
- (mmi_chset_enum) PhnsetGetDefEncodingType());
- p = (PS8) & temp[0];
- }
- else
- {
- p = PhnsetGetFileNamePointer((PS8) phnset_pwronoff_filename.pwroffdisplay);
- }
- }
- else
- {
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- if (PhnsetGetDisplayType(g_phnset_cntx_p->curtPwrOffID) == PHNSET_TYPE_DISP_VIDEO)
- {
- p = GetString((U16)
- (STR_ID_PHNSET_DISPCHAR_VDOID_START +
- (g_phnset_cntx_p->curtPwrOffID - IMG_ID_PHNSET_OFF_VDO_START)));
- }
- else
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- {
- p = GetString((U16)
- (STR_ID_PHNSET_DISPCHAR_ANMID_START +
- (g_phnset_cntx_p->curtPwrOffID - IMG_ID_PHNSET_OFF_START)));
- }
- }
- if (p)
- {
- pfnUnicodeStrcpy((PS8) hintData[index], p);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetPowerOnOffSel
- * DESCRIPTION
- * To enter the menu shows "System" and "User Defined"
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetPowerOnOffSel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 nNumofItem;
- U16 menuID = 0, scrID = 0, strID = 0, menuIDSys = 0, menuIDUsr = 0;
- U16 PowerOnOffSelectList[MAX_SUB_MENUS];
- FuncPtr hiliteFnSys = NULL, hiliteFnUsr = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- menuID = MENU_SETTING_POWER_ON_DISPLAY;
- scrID = SCR_ID_PHNSET_POWER_ON;
- strID = STR_SETTING_POWER_ON_DISPLAY;
- menuIDSys = MENU_SETTING_POWER_ON_SYSTEM;
- menuIDUsr = MENU_SETTING_POWER_ON_DOWNLOAD;
- hiliteFnSys = HighlightPhnsetPowerOnSys;
- hiliteFnUsr = HighlightPhnsetPwrOnFmgr;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPowerOnOffSel: Onn"));
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- menuID = MENU_SETTING_POWER_OFF_DISPLAY;
- scrID = SCR_ID_PHNSET_POWER_OFF;
- strID = STR_SETTING_POWER_OFF_DISPLAY;
- menuIDSys = MENU_SETTING_POWER_OFF_SYSTEM;
- menuIDUsr = MENU_SETTING_POWER_OFF_DOWNLOAD;
- hiliteFnSys = HighlightPhnsetPowerOffSys;
- hiliteFnUsr = HighlightPhnsetPwrOffFmgr;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPowerOnOffSel: Offn"));
- }
- else
- {
- MMI_ASSERT(0);
- }
- guiBuffer = GetCurrGuiBuffer(scrID);
- EntryNewScreen(scrID, NULL, EntryPhnsetPowerOnOffSel, NULL);
- nNumofItem = GetNumOfChild(menuID);
- GetSequenceStringIds(menuID, PowerOnOffSelectList);
- SetParentHandler(menuID);
- SetHiliteHandler(menuIDSys, hiliteFnSys);
- #if defined(__MMI_FILE_MANAGER__)
- SetHiliteHandler(menuIDUsr, hiliteFnUsr);
- #endif
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- strID,
- IMG_SCR_SETTING_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- PowerOnOffSelectList,
- (PU16) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetPowerOnOffSys
- * DESCRIPTION
- * To view build-in image/video list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetPowerOnOffSys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- EntryNewScreen(SCR_ID_PHNSET_POWER_ON_SYSTEM_LIST, NULL, EntryPhnsetPowerOnOffSys, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_POWER_ON_SYSTEM_LIST);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPowerOnOffSys: Onn"));
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- EntryNewScreen(SCR_ID_PHNSET_POWER_OFF_SYSTEM_LIST, NULL, EntryPhnsetPowerOnOffSys, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_POWER_OFF_SYSTEM_LIST);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPowerOnOffSys: Offn"));
- }
- else
- {
- ASSERT(0);
- }
- RegisterHighlightHandler(PhnsetPowerOnOffSysHiliteHandler);
- g_phnset_cntx_p->curHightlightItem = 0;
- item_amount = PhnsetConstSysPwrOnOffList(
- subMenuDataPtrs,
- g_phnset_cntx_p->SysWPSSList,
- (S16*) & (g_phnset_cntx_p->curHightlightItem));
- g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
- if ((g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON && !g_phnset_cntx_p->curtPwrOnID) ||
- (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF && !g_phnset_cntx_p->curtPwrOffID))
- g_phnset_cntx_p->curHightlightItem = 0;
- ShowCategory36Screen(
- STR_ID_PHNSET_ON_OFF_SYSTEM,
- IMG_SCR_SETTING_CAPTION,
- STR_GLOBAL_VIEW,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- item_amount,
- subMenuDataPtrs,
- (U16) (g_phnset_cntx_p->curHightlightItem),
- guiBuffer);
- SetLeftSoftkeyFunction(EntryPhnsetPwrOnOffSysView, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetPwrOnOffSysView, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetPwrOnOffSysView
- * DESCRIPTION
- * To preview build-in image/video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetPwrOnOffSysView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 strID;
- U16 resID;
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CallbackPWRLSK = PhnsetSetPwrOnOffDisplay;
- g_phnset_cntx_p->isCorrectSet = 0;
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_POWER_ON_SYSTEM_VIEW);
- if (g_phnset_cntx_p->WPSSPreviewScrFlag)
- {
- EntryNewScreen(
- SCR_ID_PHNSET_POWER_ON_SYSTEM_VIEW,
- ExitPhnsetPwrOnOffSysView,
- EntryPhnsetPwrOnOffSysView,
- NULL);
- }
- #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
- else
- {
- mmi_frm_resmem_reset(MMI_FRM_RESMEM_TYPE_LOD_ON_DEMAND);
- }
- #endif /* defined(__MMI_RESOURCE_ENFB_SUPPORT__) */
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- guiBuffer = GetCurrGuiBuffer(SCR_ID_PHNSET_POWER_OFF_SYSTEM_VIEW);
- if (g_phnset_cntx_p->WPSSPreviewScrFlag)
- {
- EntryNewScreen(
- SCR_ID_PHNSET_POWER_OFF_SYSTEM_VIEW,
- ExitPhnsetPwrOnOffSysView,
- EntryPhnsetPwrOnOffSysView,
- NULL);
- }
- #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
- else
- {
- mmi_frm_resmem_reset(MMI_FRM_RESMEM_TYPE_LOD_ON_DEMAND);
- }
- #endif /* defined(__MMI_RESOURCE_ENFB_SUPPORT__) */
- }
- else
- {
- MMI_ASSERT(0);
- }
- wgui_set_touch_title_bar_buttons(); /* enable the display of title bar buttons */
- #if defined(__MMI_TOUCH_SCREEN__)
- /* register the handlers for pen down event. */
- register_touch_button_handlers(NULL, PhnsetPwrOnOffSysViewPre, NULL, PhnsetPwrOnOffSysViewNext);
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- resID = g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem];
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- if ((g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON) && (g_phnset_cntx_p->curHightlightItem < MAX_POWER_ON_VDO)
- || (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF) &&
- (g_phnset_cntx_p->curHightlightItem < MAX_POWER_OFF_VDO))
- {
- /* This bucket handle build-in videos */
- strID = STR_ID_PHNSET_DISPCHAR_VDOID_START + g_phnset_cntx_p->curHightlightItem;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPwrOnOffSysView: Video strID=%d, resID=%dn", strID,
- resID));
- ShowCategory225Screen(
- strID, /* title_str */
- 0, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- resID, /* video_id */
- NULL, /* video_filename */
- 1, /* repeat_count */
- TRUE, /* is_visual_update */
- !IsSilentModeActivated(), /* is_play_audio */
- TRUE, /* is_lcd_no_sleep */
- GDI_COLOR_BLACK, /* bg_color */
- PhnsetPwrOnOffPlayCallBack, /* callback */
- guiBuffer); /* gui_buffer */
- SetLeftSoftkeyFunction(CallbackPWRLSK, KEY_EVENT_UP);
- SetRightSoftkeyFunction(PhnsetPwrOnOffUsrDefGoBack, KEY_EVENT_UP);
- }
- else
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- {
- /* This bucket handle build-in images */
- U8 imgName[MAX_IMAGE_NAME_WIDTH];
- #ifdef __MMI_SWFLASH__
- if (PhnsetGetDisplayType(resID) == PHNSET_TYPE_DISP_SWFLASH)
- {
- strID = STR_ID_DISPCHAR_SWFLASH_START + (resID - IMG_ID_DISPCHAR_SWFLASH_START);
- }
- else
- #endif /* __MMI_SWFLASH__ */
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- strID = STR_ID_PHNSET_DISPCHAR_ANMID_START + (resID - IMG_ID_PHNSET_ON_START);
- }
- else
- {
- strID = STR_ID_PHNSET_DISPCHAR_ANMID_START + (resID - IMG_ID_PHNSET_OFF_START);
- }
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPwrOnOffSysView: Image strID=%d, resID=%dn", strID,
- resID));
- pfnUnicodeStrcpy((PS8) imgName, GetString(strID));
- #ifdef __MMI_SWFLASH__
- if (PhnsetGetDisplayType(resID) == PHNSET_TYPE_DISP_SWFLASH)
- {
- ShowCategory229Screen(
- imgName, /* title_str */
- IMG_SCR_SETTING_CAPTION, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- resID, /* resource_id */
- NULL, /* resource_filename */
- 1, /* repeat_count */
- !IsSilentModeActivated(), /* is_play_audio */
- MMI_FALSE, /* is_vibrate_on */
- MMI_FALSE, /* is_interaction_on */
- MMI_TRUE, /* is_lcd_no_sleep */
- MMI_TRUE, /* is_full_screen */
- GDI_COLOR_WHITE, /* bg_color */
- PhnsetPwrOnOffPlayCallBack,
- guiBuffer);
- }
- else
- #endif
- ShowCategory129Screen(
- imgName,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- resID,
- guiBuffer);
- SetLeftSoftkeyFunction(PhnsetSetPwrOnOffDisplay, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /* changed the up-down arrow key handlers to left-right arrow key handlers
- for having the similar behaviour of keypad and touchscreen. */
- SetKeyHandler(PhnsetPwrOnOffSysViewPre, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(PhnsetPwrOnOffSysViewNext, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffUsrDefFreeBuf
- * DESCRIPTION
- * To release buffer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void PhnsetPwrOnOffUsrDefFreeBuf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (phnset_dispchar_strp)
- {
- OslMfree(phnset_dispchar_strp);
- phnset_dispchar_strp = NULL;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffUsrDefGoBack
- * DESCRIPTION
- * To release buffer before GoBackHistory
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void PhnsetPwrOnOffUsrDefGoBack(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PhnsetPwrOnOffUsrDefFreeBuf();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffSysViewPre
- * DESCRIPTION
- * To preview previous build-in image/video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffSysViewPre(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExitCategoryFunction();
- if (g_phnset_cntx_p->curHightlightItem <= 0)
- {
- g_phnset_cntx_p->curHightlightItem = item_amount;
- }
- g_phnset_cntx_p->curHightlightItem--;
- g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffSysViewPre: highlight=%dn",
- g_phnset_cntx_p->curHightlightItem));
- EntryPhnsetPwrOnOffSysView();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffSysViewNext
- * DESCRIPTION
- * To preview next build-in image/video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffSysViewNext(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExitCategoryFunction();
- if (g_phnset_cntx_p->curHightlightItem >= item_amount - 1)
- {
- g_phnset_cntx_p->curHightlightItem = -1;
- }
- g_phnset_cntx_p->curHightlightItem++;
- g_phnset_cntx_p->WPSSPreviewScrFlag = 0;
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffSysViewNext: highlight=%dn",
- g_phnset_cntx_p->curHightlightItem));
- EntryPhnsetPwrOnOffSysView();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPowerOnOffSysHiliteHandler
- * DESCRIPTION
- * Callback of highlight moving
- * PARAMETERS
- * nIndex [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPowerOnOffSysHiliteHandler(S32 nIndex)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- {
- U8 max_video = 0;
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- max_video = MAX_POWER_ON_VDO;
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- max_video = MAX_POWER_OFF_VDO;
- }
- if (nIndex < max_video)
- {
- ChangeLeftSoftkey(STR_ID_VDOPLY_PLAY, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_VIEW, 0);
- }
- }
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- g_phnset_cntx_p->curHightlightItem = (U16) nIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetConstSysPwrOnOffList
- * DESCRIPTION
- * To construct build-in power on/off disp. image/video list
- * PARAMETERS
- * pSysPwrOnOffStrList [IN]
- * pSysPwrOnOffImgIDList [?]
- * HighliteItem [?]
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetConstSysPwrOnOffList(U8 **pSysPwrOnOffStrList, U16 *pSysPwrOnOffImgIDList, S16 *HighliteItem)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- U16 currentID = 0;
- U16 max_animation = 0, max_video = 0;
- U16 vdoStart = 0, imgStart = 0;
- U16 strID = 0, imgID = 0;
- #ifdef __MMI_SWFLASH__
- U8 index_swflash = 0;
- #endif
- U8 index_img = 0; /* count of image */
- U8 index_vdo = 0; /* count of video */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Layout
- *
- * -- Video --
- *
- * -- Normal Images --
- * -- Normal Images -- SVG
- * -- Normal Images -- M3D
- * -- SWFLASH --
- *
- */
- max_animation = MAX_POWER_ON_IMG; /* same as MAX_POWER_OFF_IMG */
- max_video = MAX_POWER_ON_VDO; /* same as MAX_POWER_OFF_VDO */
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- if (max_video)
- {
- vdoStart = IMG_ID_PHNSET_ON_VDO_START;
- }
- imgStart = IMG_ID_PHNSET_ON_START;
- currentID = g_phnset_cntx_p->curtPwrOnID;
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- if (max_video)
- {
- vdoStart = IMG_ID_PHNSET_OFF_VDO_START;
- }
- imgStart = IMG_ID_PHNSET_OFF_START;
- currentID = g_phnset_cntx_p->curtPwrOffID;
- }
- for (i = 0; i < (max_animation + max_video); i++)
- {
- if (i < max_video)
- {
- imgID = vdoStart + i;
- }
- else if (i >= max_video &&
- i < (max_video + max_animation - MAX_DISPCHAR_SWFLASH))
- {
- imgID = imgStart + (i - max_video);
- }
- else
- {
- imgID = IMG_ID_DISPCHAR_SWFLASH_START + (i - (max_video + max_animation - MAX_DISPCHAR_SWFLASH));
- }
- if (imgID >= vdoStart && imgID < (vdoStart + max_video))
- {
- strID = STR_ID_PHNSET_DISPCHAR_VDOID_START + index_vdo;
- ++index_vdo;
- }
- else if ((imgID >= IMG_ID_PHNSET_ON_START && imgID <= IMG_ID_PHNSET_ON_MAX) ||
- (imgID >= IMG_ID_PHNSET_OFF_START && imgID <= IMG_ID_PHNSET_OFF_MAX))
- {
- strID = STR_ID_PHNSET_DISPCHAR_ANMID_START + index_img;
- index_img++;
- }
- #ifdef __MMI_SWFLASH__
- else
- {
- strID = STR_ID_DISPCHAR_SWFLASH_START + index_swflash;
- ++index_swflash;
- }
- #endif /* __MMI_SWFLASH__*/
- if (pSysPwrOnOffImgIDList)
- {
- pSysPwrOnOffImgIDList[i] = imgID;
- }
- if (pSysPwrOnOffStrList)
- {
- pSysPwrOnOffStrList[i] = (PU8) GetString(strID);
- }
- if (currentID == pSysPwrOnOffImgIDList[i])
- {
- *HighliteItem = i;
- }
- }
- i = max_video + max_animation;
- return i; /* amount, will be used to construct list */
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetPwrOnDisp
- * DESCRIPTION
- * To get power on disp. id
- * PARAMETERS
- * id [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetGetPwrOnDisp(U16 *id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetPwrOnDisp: ID=%dn", g_phnset_cntx_p->curtPwrOnID));
- *id = g_phnset_cntx_p->curtPwrOnID;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetPwrOnFileName
- * DESCRIPTION
- * To get power on disp. path
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- PS8 PhnsetGetPwrOnFileName(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetPwrOnFileName: path=%sn",
- phnset_pwronoff_filename.pwrondisplay));
- return (PS8) phnset_pwronoff_filename.pwrondisplay;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetPwrOffDisp
- * DESCRIPTION
- * To get power off disp. id
- * PARAMETERS
- * id [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetGetPwrOffDisp(U16 *id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetPwrOffDisp: ID=%dn", g_phnset_cntx_p->curtPwrOffID));
- *id = g_phnset_cntx_p->curtPwrOffID;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetPwrOffFileName
- * DESCRIPTION
- * To get power off disp. path
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- PS8 PhnsetGetPwrOffFileName(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetPwrOffFileName: path=%sn",
- phnset_pwronoff_filename.pwroffdisplay));
- return (PS8) phnset_pwronoff_filename.pwroffdisplay;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetRstPwrOnDisplayDefault
- * DESCRIPTION
- * To restore default power on build-in id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetRstPwrOnDisplayDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dispchar_get_img_id(NVRAM_RESTORE_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- #ifdef MMI_ON_WIN32
- g_phnset_cntx_p->curtPwrOnID = IMG_ID_PHNSET_ON_START;
- #endif
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetRstPwrOnDisplayDefault: On ID=%dn", g_phnset_cntx_p->curtPwrOnID));
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetPwrOnDisplayDefault
- * DESCRIPTION
- * To get default power on build-in id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 PhnsetGetPwrOnDisplayDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 id;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dispchar_get_img_id(NVRAM_RESTORE_POWER_ON_DISPLAY, &id);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetPwrOnDisplayDefault: On ID=%dn", id));
- return id;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetRstPwrOffDisplayDefault
- * DESCRIPTION
- * To restore default power off build-in id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetRstPwrOffDisplayDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dispchar_get_img_id(NVRAM_RESTORE_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- #ifdef MMI_ON_WIN32
- g_phnset_cntx_p->curtPwrOffID = IMG_ID_PHNSET_OFF_START;
- #endif
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetRstPwrOffDisplayDefault: Off ID=%dn",
- g_phnset_cntx_p->curtPwrOffID));
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetGetPwrOffDisplayDefault
- * DESCRIPTION
- * To get default power on build-in id
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 PhnsetGetPwrOffDisplayDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 id;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dispchar_get_img_id(NVRAM_RESTORE_POWER_OFF_DISPLAY, &id);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetGetPwrOffDisplayDefault: Off ID=%dn", id));
- return id;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffPlayCallBack
- * DESCRIPTION
- * This function is to set current wallpaper using index by AT command
- * PARAMETERS
- * result [IN] Play result
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffPlayCallBack(S32 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffPlayCallBack: result=%dn", result));
- if (result >= 0)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- CallbackPWRLSK = PhnsetSetPwrOnOffDisplay;
- }
- else
- {
- ChangeLeftSoftkey(0, 0);
- ChangeRightSoftkey(0, 0);
- CallbackPWRLSK = UI_dummy_function;
- PhnsetPwrOnOffBadDisplayPopup(NULL);
- PhnsetPwrOnOffUsrDefFreeBuf();
- /* delete to file select screen again */
- DeleteNHistory(1);
- }
- SetLeftSoftkeyFunction(CallbackPWRLSK, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffBadDisplayPopup
- * DESCRIPTION
- * Popup string when select/detect an invalid file
- * PARAMETERS
- * error_str [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffBadDisplayPopup(PS8 error_str)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffBadDisplayPopupn"));
- if (error_str == NULL)
- {
- DisplayPopup(
- (PU8) GetString(STR_FMGR_INVALID_FORMAT),
- IMG_GLOBAL_ERROR,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- else
- {
- DisplayPopup((PU8) error_str, IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitPhnsetPwrOnOffSysView
- * DESCRIPTION
- * Release/reset buffer/variables/history
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitPhnsetPwrOnOffSysView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "ExitPhnsetPwrOnOffSysView: isCorrectSet=%dn",
- g_phnset_cntx_p->isCorrectSet));
- if (g_phnset_cntx_p->isCorrectSet)
- {
- #ifdef __MMI_FILE_MANAGER__
- PhnsetPwrOnOffUsrDefFreeBuf();
- #endif
- DeleteUptoScrID(g_phnset_cntx_p->ScrAnchor);
- }
- g_phnset_cntx_p->WPSSPreviewScrFlag = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetPwrOnOffDisplay
- * DESCRIPTION
- * Set Current Power on/off disp. by current highlight or selected path
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetPwrOnOffDisplay(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetPwrOnOffDisplayn"));
- if (phnset_dispchar_strp)
- {
- PhnsetSetPwrOnOffDisplayByFileName(phnset_dispchar_strp);
- }
- else
- {
- PhnsetSetPwrOnOffDisplayByImgID(g_phnset_cntx_p->SysWPSSList[g_phnset_cntx_p->curHightlightItem]);
- }
- g_phnset_cntx_p->isCorrectSet = 1;
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- if (IsScreenPresent(SCR_ID_PHNSET_POWER_ON) || IsScreenPresent(SCR_ID_PHNSET_POWER_OFF))
- {
- fmgr_reset_app_select(); /* not forword from fmgr */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetPwrOnOffDisplayByImgID
- * DESCRIPTION
- * This function is to set current wallpaper using index by AT command
- * * PARAMETERS
- * imgID IN image id
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetPwrOnOffDisplayByImgID(U16 imgID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- g_phnset_cntx_p->curtPwrOnID = imgID;
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetPwrOnOffDisplayByImgID: On ID=%dn", imgID));
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- g_phnset_cntx_p->curtPwrOffID = imgID;
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetPwrOnOffDisplayByImgID: Off ID=%dn", imgID));
- }
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetSetPwrOnOffDisplayByFileName
- * DESCRIPTION
- * Set Current Power on/off disp. by given path
- * PARAMETERS
- * path [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetSetPwrOnOffDisplayByFileName(S8 *path)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- if (g_phnset_cntx_p->isShort)
- {
- phnset_pwronoff_filename.isPwrOnShort = 1;
- }
- else
- {
- phnset_pwronoff_filename.isPwrOnShort = 0;
- }
- g_phnset_cntx_p->curtPwrOnID = 0;
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_ON_DISPLAY, &(g_phnset_cntx_p->curtPwrOnID));
- pfnUnicodeStrcpy((S8*) phnset_pwronoff_filename.pwrondisplay, (S8*) path);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetPwrOnOffDisplayByFileName: On path=%s, short=%dn",
- phnset_dispchar_strp, g_phnset_cntx_p->isShort));
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- if (g_phnset_cntx_p->isShort)
- {
- phnset_pwronoff_filename.isPwrOffShort = 1;
- }
- else
- {
- phnset_pwronoff_filename.isPwrOffShort = 0;
- }
- g_phnset_cntx_p->curtPwrOffID = 0;
- mmi_dispchar_set_img_id(NVRAM_CURRENT_POWER_OFF_DISPLAY, &(g_phnset_cntx_p->curtPwrOffID));
- pfnUnicodeStrcpy((S8*) phnset_pwronoff_filename.pwroffdisplay, (S8*) path);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetSetPwrOnOffDisplayByFileName: Off path=%s, short=%dn",
- phnset_dispchar_strp, g_phnset_cntx_p->isShort));
- }
- WriteRecord(NVRAM_EF_WPSS_FILENAME_LID, 2, &phnset_pwronoff_filename, sizeof(phnset_pwronoff_filename), &error);
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- }
- #ifdef __MMI_FILE_MANAGER__
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffUsrDefPreViewScrDelCB
- * DESCRIPTION
- * ...
- * PARAMETERS
- * ptr [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 PhnsetPwrOnOffUsrDefPreViewScrDelCB(void *ptr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PhnsetPwrOnOffUsrDefFreeBuf();
- return MMI_FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffUsrDefPreViewENDKeyHdlr
- * DESCRIPTION
- * END key handler when preview image/video in file manager
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffUsrDefPreViewENDKeyHdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Has to free the file name string buffer */
- PhnsetPwrOnOffUsrDefFreeBuf();
- /* Execute the stored END key handler */
- if (phnset_pwronoff)
- {
- (*phnset_pwronoff) ();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetPwrOnOffUserView
- * DESCRIPTION
- * Preview image/video in file manager
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetPwrOnOffUserView(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 file_type = 0;
- PU8 gui_buffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- CallbackPWRLSK = PhnsetSetPwrOnOffDisplay;
- g_phnset_cntx_p->isCorrectSet = 0;
- file_type = mmi_fmgr_get_file_group(phnset_dispchar_strp);
- if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWRON)
- {
- gui_buffer = GetCurrGuiBuffer(SCR_ID_PHNSET_POWER_ON_USER_VIEW);
- EntryNewScreen(
- SCR_ID_PHNSET_POWER_ON_USER_VIEW,
- ExitPhnsetPwrOnOffSysView,
- EntryPhnsetPwrOnOffUserView,
- NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPwrOnOffUserView: On path=%sn", phnset_dispchar_strp));
- }
- else if (g_phnset_cntx_p->wpss_type == MMI_PHNSET_TYPE_PWROFF)
- {
- gui_buffer = GetCurrGuiBuffer(SCR_ID_PHNSET_POWER_OFF_USER_VIEW);
- EntryNewScreen(
- SCR_ID_PHNSET_POWER_OFF_USER_VIEW,
- ExitPhnsetPwrOnOffSysView,
- EntryPhnsetPwrOnOffUserView,
- NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPwrOnOffUserView: Off path=%sn",
- phnset_dispchar_strp));
- }
- else
- {
- MMI_ASSERT(0);
- }
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- if (file_type == FMGR_GROUP_VIDEO)
- {
- ShowCategory225Screen(
- STR_GLOBAL_VIEW, /* title_str */
- IMG_SCR_SETTING_CAPTION, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- 0, /* video_id */
- (S8*) phnset_dispchar_strp, /* video_filename */
- 1, /* repeat_count */
- TRUE, /* is_visual_update */
- !IsSilentModeActivated(), /* is_play_audio */
- TRUE, /* is_lcd_no_sleep */
- GDI_COLOR_WHITE, /* bg_color */
- PhnsetPwrOnOffPlayCallBack,
- gui_buffer);
- }
- else
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- #ifdef __MMI_SWFLASH__
- if (file_type == FMGR_GROUP_SWFLASH)
- {
- ShowCategory229Screen(
- (U8 *)GetString(STR_GLOBAL_VIEW), /* title_str */
- IMG_SCR_SETTING_CAPTION, /* title_icon */
- STR_GLOBAL_OK, /* lsk_str */
- IMG_GLOBAL_OK, /* lsk_icon */
- STR_GLOBAL_BACK, /* rsk_str */
- IMG_GLOBAL_BACK, /* rsk_icon */
- 0, /* resource_id */
- phnset_dispchar_strp, /* resource_filename */
- 1, /* repeat_count */
- !IsSilentModeActivated(), /* is_play_audio */
- MMI_FALSE, /* is_vibrate_on */
- MMI_FALSE, /* is_interaction_on */
- MMI_TRUE, /* is_lcd_no_sleep */
- MMI_FALSE, /* is_full_screen */
- GDI_COLOR_WHITE, /* bg_color */
- PhnsetPwrOnOffPlayCallBack,
- gui_buffer);
- }
- else
- #endif
- if (file_type == FMGR_GROUP_IMAGE)
- {
- ShowCategory222Screen(
- STR_GLOBAL_VIEW,
- GetRootTitleIcon(MENU_SETTING_POWER_ON_DOWNLOAD),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- GDI_COLOR_WHITE,
- NULL,
- (S8*) phnset_dispchar_strp,
- FALSE,
- PhnsetPwrOnOffPlayCallBack);
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "EntryPhnsetPwrOnOffUserView: On path=%sn", phnset_dispchar_strp));
- }
- SetDelScrnIDCallbackHandler(SCR_ID_PHNSET_POWER_OFF_USER_VIEW, PhnsetPwrOnOffUsrDefPreViewScrDelCB);
- phnset_pwronoff = GetKeyHandler(KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(PhnsetPwrOnOffUsrDefPreViewENDKeyHdlr, KEY_END, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(CallbackPWRLSK, KEY_EVENT_UP);
- SetRightSoftkeyFunction(PhnsetPwrOnOffUsrDefGoBack, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffSelectFmgrCallBack
- * DESCRIPTION
- * Callback function from filemanager after file selection
- * PARAMETERS
- * path [IN] Selected file path
- * is_short [IN]
- * RETURNS
- * void
- * BOOL
- *****************************************************************************/
- void PhnsetPwrOnOffSelectFmgrCallBack(void *path, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 error_str_ptr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffSelectFmgrCallBack: path=%s, is_short=%dn", path,
- is_short));
- g_phnset_cntx_p->isShort = (S32) is_short;
- if (path)
- {
- /* Prevent memory leck, after buffer is free, set pointer to NULL */
- ASSERT(phnset_dispchar_strp == NULL);
- phnset_dispchar_strp = OslMalloc(FMGR_PATH_BUFFER_SIZE);
- if (phnset_dispchar_strp)
- {
- pfnUnicodeStrcpy((S8*) phnset_dispchar_strp, (S8*) path);
- }
- else
- {
- GoBackToHistory(SCR_IDLE_SCR_DISP);
- return;
- }
- if (mmi_fmgr_forwardable_path((PS8) phnset_dispchar_strp))
- {
- error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
- PhnsetPwrOnOffBadDisplayPopup(error_str_ptr);
- PhnsetPwrOnOffUsrDefFreeBuf();
- return;
- }
- /* file limitation check - limitation is define in file manager util */
- if (!mmi_fmgr_util_file_limit_check(FMGR_LIMIT_POWER_ON_OFF_DSPL, (PS8) phnset_dispchar_strp, &error_str_ptr))
- {
- PhnsetPwrOnOffBadDisplayPopup(error_str_ptr);
- PhnsetPwrOnOffUsrDefFreeBuf();
- return;
- }
- EntryPhnsetPwrOnOffUserView();
- }
- else
- {
- GoBackToHistory(g_phnset_cntx_p->ScrAnchor);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffForwardFromFmgr
- * DESCRIPTION
- * Call back for File manager forwarding
- * PARAMETERS
- * path [?]
- * action [IN]
- * is_short [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffForwardFromFmgr(void *path, FMGR_FILTER *filter, fmgr_tree_action_enum action, int is_short)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PS8 error_str_ptr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffForwardFromFmgr: path=%s, action=%d, is_short=%dn", path,
- action, is_short));
- if (!FMGR_FILTER_IS_SET(filter, FMGR_TYPE_GIF) &&
- #ifdef JPG_DECODE
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPG) &&
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_JPEG) &&
- #endif /* JPG_DECODE */
- #if defined(GDI_USING_PNG)
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_PNG) &&
- #endif
- #if defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__)
- #ifdef MP4_CODEC
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_3GP) &&
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_MP4) &&
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_MPG) &&
- #endif /* MP4_CODEC */
- #ifdef MJPG_SUPPORT
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_AVI) &&
- #endif
- #endif /* defined(__MMI_POWER_ON_OFF_DISPLAY_VIDEO__) && defined(__MTK_TARGET__) */
- #ifdef M3D_MMI_SUPPORT
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_M3D) &&
- #endif
- #ifdef SVG_SUPPORT
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_SVG) &&
- #endif
- #ifdef __MMI_SWFLASH__
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_CMP) &&
- #endif
- !FMGR_FILTER_IS_SET(filter, FMGR_TYPE_BMP))
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT), IMG_GLOBAL_ERROR, 0, 1000, ERROR_TONE);
- return;
- }
- if (path)
- {
- /* Prevent memory leck, after buffer is free, set pointer to NULL */
- ASSERT(phnset_dispchar_strp == NULL);
- g_phnset_cntx_p->isShort = (S32) is_short;
- phnset_dispchar_strp = OslMalloc(FMGR_PATH_BUFFER_SIZE);
- if (phnset_dispchar_strp)
- {
- pfnUnicodeStrcpy((S8*) phnset_dispchar_strp, (S8*) path);
- }
- else
- {
- GoBackToHistory(SCR_IDLE_SCR_DISP);
- return;
- }
- if (mmi_fmgr_forwardable_path((PS8) phnset_dispchar_strp))
- {
- error_str_ptr = (PS8) GetString(STR_ID_PHNSET_DISPCHAR_INVALID_PATH);
- PhnsetPwrOnOffBadDisplayPopup(error_str_ptr);
- PhnsetPwrOnOffUsrDefFreeBuf();
- return;
- }
- /* file limitation check - limitation is define in file manager util */
- if (!mmi_fmgr_util_file_limit_check(FMGR_LIMIT_POWER_ON_OFF_DSPL, (PS8) phnset_dispchar_strp, &error_str_ptr))
- {
- PhnsetPwrOnOffBadDisplayPopup(error_str_ptr);
- PhnsetPwrOnOffUsrDefFreeBuf();
- return;
- }
- if (action == FMGR_ACTION_FWD_POWER_ON)
- {
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWRON;
- }
- else if (action == FMGR_ACTION_FWD_POWER_OFF)
- {
- g_phnset_cntx_p->wpss_type = MMI_PHNSET_TYPE_PWROFF;
- }
- g_phnset_cntx_p->ScrAnchor = GetCurrScrnId();
- EntryPhnsetPwrOnOffUserView();
- }
- else
- /* run to here means some kinds of image error occur */
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_UNFINISHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE);
- }
- }
- #endif /* __MMI_FILE_MANAGER__ */
- #ifdef __USB_IN_NORMAL_MODE__
- /*****************************************************************************
- * FUNCTION
- * PhnsetPwrOnOffUseDefault
- * DESCRIPTION
- * Use default build-in image/video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetPwrOnOffUseDefault(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PHNSET_TYPE_DISP type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtPwrOnID)) == PHNSET_TYPE_DISP_USER
- && (mmi_usb_check_path_exported((S8*) phnset_pwronoff_filename.pwrondisplay)))
- {
- g_phnset_cntx_p->curtPwrOnID = PhnsetGetPwrOnDisplayDefault();
- }
- if ((type = PhnsetGetDisplayType(g_phnset_cntx_p->curtPwrOffID)) == PHNSET_TYPE_DISP_USER
- && (mmi_usb_check_path_exported((S8*) phnset_pwronoff_filename.pwroffdisplay)))
- {
- g_phnset_cntx_p->curtPwrOffID = PhnsetGetPwrOffDisplayDefault();
- }
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "PhnsetPwrOnOffUseDefault: On ID=%d, Off ID=%dn",
- g_phnset_cntx_p->curtPwrOnID, g_phnset_cntx_p->curtPwrOffID));
- }
- #endif /* __USB_IN_NORMAL_MODE__ */
- #endif /* __MMI_POWER_ON_OFF_DISPLAY__ */
- #endif /* POWERONOFFDISPLAY_C */