📄 themearchiver.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:
* ---------
* ThemeArchiver.c
*
* Project:
* --------
* DLT
*
* Description:
* ------------
* This file defines all message sequence between WAP & Theme Archiver.
*
* Author: Deepali
* -------
* -------
*
*==============================================================================
* 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!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
#ifndef _MMI_THEME_ARCHIVER_C
#define _MMI_THEME_ARCHIVER_C
#include "MMI_features.h"
#ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
#include "stdC.h"
#include "PixtelDataTypes.h"
#include "EventsGprot.h"
#include "historyGprot.h"
#include "ProtocolEvents.h"
#include "QueueGprot.h"
#include "OslMemory.h"
#include "TimerEvents.h"
#include "wgui_categories.h"
#include "wgui_categories_inputs.h"
#include "wgui_categories_popup.h"
#include "wgui_categories_stopwatch.h"
#include "Globaldefs.h"
#include "GlobalScrEnum.h"
#include "FunAndGamesDefs.h"
#include "CommonScreens.h"
#include "FileSystemDef.h"
#include "FileManagerDef.h"
#include "FileSystemGProt.h"
#include "fs_type.h"
#include "fs_func.h"
#include "fs_errcode.h"
#include "FileMgr.h"
#include "SettingProfile.h"
#include "stack_common.h"
#include "Wap.h"
#include "xml_def.h"
#include "ThemeArchiverDef.h"
#include "ThemeArchiverMsgStruct.h"
#include "ThemeArchiverProt.h"
#include "Calculator.h"
#include "ThemeManager.h"
#include "DLAgentDef.h"
#include "DLAgentGprot.h"
#ifndef MMI_ON_WIN32
#include "app_ltlcom.h"
#endif
ta_da_context_struct g_ta_da_context;
/*****************************************************************************
* FUNCTION
* mmi_da_handle_theme_content
* DESCRIPTION
* Handles theme download through WAP
* PARAMETERS
* filename_p [IN]
* RETURNS
* void
*****************************************************************************/
void mmi_ta_handle_theme_content(S8 *filename_p)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
history currHistory;
U16 nHistory = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
currHistory.scrnID = SCR_ID_DOWNLOAD_THM_STORAGE;
currHistory.entryFuncPtr = mmi_ta_entry_select_storage_screen;
memset((void*)currHistory.guiBuffer, 0, sizeof(currHistory.guiBuffer));
pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
DisplayPopup(
(PU8) GetString(STR_THEME_FILE_DOWNLOADED),
IMG_GLOBAL_ACTIVATED,
1,
UI_POPUP_NOTIFYDURATION_TIME,
(U8) SUCCESS_TONE);
AddHistory(currHistory);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (filename_p)
{
pfnUnicodeStrcpy((S8*) g_ta_da_context.file_name_with_path, (S8*) filename_p);
}
}
/*****************************************************************************
* FUNCTION
* mmi_ta_receive_theme_file
* DESCRIPTION
* Handles theme download through DLA
* PARAMETERS
* session_id [IN]
* mime_type [IN]
* mime_subtype [IN]
* action [IN]
* file_path [IN]
* url [IN]
* mime_type_string [IN]
* RETURNS
* NONE
*****************************************************************************/
void mmi_ta_receive_theme_file(
S32 session_id,
S32 mime_type,
S32 mime_subtype,
S32 action,
PU16 file_path,
PS8 url,
PS8 mime_type_string)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
mmi_ta_handle_theme_content((S8*)file_path);
return;
}
/*****************************************************************************
* FUNCTION
* mmi_ta_check_theme_file_version_compatibility
* DESCRIPTION
* validates Theme version.
* PARAMETERS
* theme_version [IN]
* RETURNS
* true if compatible otherwise false
*****************************************************************************/
U16 mmi_ta_check_theme_file_version_compatibility(FLOAT theme_version)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 i;
FLOAT *VersionTable_p;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
VersionTable_p = (FLOAT*) mmi_tm_get_theme_version_table();
for (i = 0; i < MAX_SUPPORTED_VERSION_NUM; i++)
{
if (VersionTable_p[i] == theme_version)
{
return TRUE;
}
}
return FALSE;
}
/*****************************************************************************
* FUNCTION
* mmi_ta_check_theme_file_lcd_dim_compatibiltiy
* DESCRIPTION
* validates LCD dimensions.
* PARAMETERS
* lcd_width [IN]
* lcd_height [IN]
* RETURNS
* true if compatible otherwise false
*****************************************************************************/
U16 mmi_ta_check_theme_file_lcd_dim_compatibiltiy(U32 lcd_width, U32 lcd_height)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (lcd_height == LCD_HEIGHT && lcd_width == LCD_WIDTH)
{
return TRUE;
}
else
{
return FALSE;
}
}
/*****************************************************************************
* FUNCTION
* mmi_ta_check_theme_type_compatibility
* DESCRIPTION
* validates Theme type.
* PARAMETERS
* input_type_p [?]
* RETURNS
* true if compatible otherwise false
*****************************************************************************/
U16 mmi_ta_check_theme_type_compatibility(S8 *input_type_p)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 i = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
for (i = 0; i < MAX_ACCEPTABLE_THEME_FILE_TYPE; i++)
{
if (strcmp(input_type_p, g_tad_acceptable_theme_filetypes_p[i]) == 0)
{
return TRUE;
}
}
return FALSE;
}
/*****************************************************************************
* FUNCTION
* mmi_ta_entry_select_storage_screen
* DESCRIPTION
* Show select storage screen.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_ta_entry_select_storage_screen(void)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -