📄 jmmsmessagesettings.c
字号:
IMG_GLOBAL_BACK,
(PU8) memoryStatus,
guiBuffer);
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
/* PMT VIKAS END 20060325 */
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_pre_entry_compose_settings
* DESCRIPTION
* this is pre entry fn for compose settings. Init the inline items for compose settings
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_pre_entry_compose_settings(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 temp_max_no_pages = g_jmms_context->nvram_compose_settings.max_no_pages;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_itoa(
(S32) g_jmms_context->nvram_compose_settings.default_slide_time,
(UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer,
10);
#ifdef __DRM_SUPPORT__
g_jmms_context->jmms_inline_items.compose_items_list.add_drm = g_jmms_context->nvram_compose_settings.add_drm;
#endif
//#ifdef __MMI_MMS_SIGNATURE__
g_jmms_context->jmms_inline_items.compose_items_list.auto_signature =
g_jmms_context->nvram_compose_settings.auto_signature;
//#endif /* __MMI_MMS_SIGNATURE__ */
g_jmms_context->jmms_inline_items.compose_items_list.best_page_duration =
g_jmms_context->nvram_compose_settings.best_page_duration;
g_jmms_context->jmms_inline_items.compose_items_list.creation_mode =
g_jmms_context->nvram_compose_settings.creation_mode;
/* HIMANSHU 05122006 START */
#ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
g_jmms_context->jmms_inline_items.compose_items_list.image_resize_option =
g_jmms_context->nvram_compose_settings.image_resize_option;
#endif /* __MMI_MMS_MEGA_PIXEL_SUPPORT__ */
/* HIMANSHU 05122006 END */
g_jmms_context->jmms_inline_items.compose_items_list.layout = g_jmms_context->nvram_compose_settings.layout;
gui_itoa(
temp_max_no_pages,
(UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer,
10);
mmi_jmms_entry_compose_settings();
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_entry_compose_settings
* DESCRIPTION
* This is entry fn for compose settings
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_entry_compose_settings(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer;
U8 *inputBuffer; /* added for inline edit history */
U16 inputBufferSize; /* added for inline edit history */
U16 image_list[COMPOSE_INLINE_TOTAL] = {0};
U8 count = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
EntryNewScreen(SCR_ID_JMMS_COMPOSE_SETTINGS, mmi_jmms_exit_compose_settings, NULL, NULL);
set_leading_zero(FALSE);
guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_COMPOSE_SETTINGS);
InitializeCategory57Screen();
mmi_jmms_compose_fill_inline_struct();
/* RegisterHighlightHandler(ExecuteCurrHiliteHandler); */
guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_COMPOSE_SETTINGS);
inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_COMPOSE_SETTINGS, &inputBufferSize); /* added for inline edit history */
if (inputBuffer) /* added for inline edit history */
{
SetCategory57Data(wgui_inline_items, COMPOSE_INLINE_TOTAL, inputBuffer); /* sets the data */
}
image_list[E_COMPOSE_DEFAULT_SLIDE_TIME_CAPTION] = gIndexIconsImageList[count];
image_list[E_COMPOSE_LAYOUT_CAPTION] = gIndexIconsImageList[++count];
#ifdef __DRM_SUPPORT__
image_list[E_COMPOSE_ADD_DRM_CAPTION] = gIndexIconsImageList[++count];
#endif
image_list[E_COMPOSE_CREATION_MODES_CAPTION] = gIndexIconsImageList[++count];
#ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
image_list[E_COMPOSE_IMAGE_RESIZE_CAPTION] = gIndexIconsImageList[++count];
#endif /* #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__ */
image_list[E_COMPOSE_MAX_NO_PAGES_CAPTION] = gIndexIconsImageList[++count];
image_list[E_COMPOSE_BEST_PAGE_DURATION_CAPTION] = gIndexIconsImageList[++count];
//#ifdef __MMI_MMS_SIGNATURE__
image_list[E_COMPOSE_AUTO_SIGNATURE_CAPTION] = gIndexIconsImageList[++count];
image_list[E_COMPOSE_AUTO_SIGNATURE_CONTENT] = IMG_ID_JMMS_WRITE_MESSAGE;
//#endif /* __MMI_MMS_SIGNATURE__ */
ShowCategory57Screen(
STR_ID_MESSAGE_SETTINGS_COMPOSE,
GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
NULL,
NULL,
STR_GLOBAL_BACK,
IMG_GLOBAL_BACK,
COMPOSE_INLINE_TOTAL,
image_list,
wgui_inline_items,
0,
guiBuffer);
SetCategory57RightSoftkeyFunctions(mmi_jmms_confirm_save_compose_settings, GoBackHistory);
if (isInCall() == FALSE)
SetKeyHandler(mmi_jmms_read_back_auto_sign_content, KEY_END, KEY_EVENT_DOWN);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_confirm_save_compose_settings
* DESCRIPTION
* It checks for default slide time value and auto sign (on/Off). If deafult slide time
* input 0 then error pop up. If auto sign is on buyt content is empty then also error pop up.
* If more than 20 slide then also error pop up.Otherwise ask confirmation to save compose settings
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_confirm_save_compose_settings(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 temp;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
temp = gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer);
//PMT VIKAS START 20060325
//For empty value of slide time and no of slide field.
if (pfnUnicodeStrncmp
((S8*) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer, "\0",
1 * ENCODING_LENGTH) == 0)
{
DisplayPopup((U8*) GetString(STR_ID_MAX_PAGES_LIMIT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
}
else if (pfnUnicodeStrncmp
((S8*) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer, "\0",
1 * ENCODING_LENGTH) == 0)
{
DisplayPopup((U8*) GetString(STR_ID_SLIDE_TIME_ZERO_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
}
else if (temp > MAX_POSSIBLE_SLIDES)
/* PMT VIKAS END 20060325 */
{
DisplayPopup((U8*) GetString(STR_ID_MAX_PAGES_LIMIT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
}
/* dilip 26 aug 2006 to prevent user from setting max page less than 1 */
else if (temp < 1)
/* PMT VIKAS END 20060325 */
{
DisplayPopup((U8*) GetString(STR_ID_MAX_PAGES_LIMIT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
}
//#ifdef __MMI_MMS_SIGNATURE__
else if ((g_jmms_context->jmms_inline_items.compose_items_list.auto_signature == E_ON)
&&
(pfnUnicodeStrncmp
((S8*) g_jmms_context->nvram_compose_settings.auto_signature_content, "\0",
MAX_AUTO_SIGN_LENGTH * ENCODING_LENGTH) == 0))
{
DisplayPopup((U8*) GetString(STR_ID_AUTO_SIGN_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
}
//#endif /* __MMI_MMS_SIGNATURE__ */
else
{
DisplayConfirm(
STR_GLOBAL_YES,
IMG_GLOBAL_YES,
STR_GLOBAL_NO,
IMG_GLOBAL_NO,
get_string(STR_GLOBAL_SAVE),
IMG_GLOBAL_QUESTION,
WARNING_TONE);
SetLeftSoftkeyFunction(mmi_jmms_save_compose_settings, KEY_EVENT_UP);
SetRightSoftkeyFunction(mmi_jmms_exit_confirm_screen, KEY_EVENT_UP);
if (isInCall() == FALSE)
SetKeyHandler(mmi_jmms_read_back_auto_sign_content, KEY_END, KEY_EVENT_DOWN);
}
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_exit_confirm_screen
* DESCRIPTION
* exit from the confirmation screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_exit_confirm_screen(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S16 error;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
///read back the auto sign content.Required because we are using the original auto sign buffer for input
///the auto sign content
ReadRecord(
NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
1,
&g_jmms_context->nvram_compose_settings,
NVRAM_JMMS_COMPOSE_SETTINGS_SIZE /* NVRAM_JMMS_COMPOSE_SETTINGS_SIZE */ ,
&error);
GoBacknHistory(1);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_save_compose_settings
* DESCRIPTION
* write the compose settings to nvram
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_jmms_save_compose_settings(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S16 temp_max_no_pages, error;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* /write global struct into values into NVRAM */
temp_max_no_pages = gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer);
g_jmms_context->nvram_compose_settings.default_slide_time =
(U32) gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer);
//#ifdef __MMI_MMS_SIGNATURE__
g_jmms_context->nvram_compose_settings.auto_signature =
g_jmms_context->jmms_inline_items.compose_items_list.auto_signature;
//#endif /* __MMI_MMS_SIGNATURE__ */
g_jmms_context->nvram_compose_settings.best_page_duration =
g_jmms_context->jmms_inline_items.compose_items_list.best_page_duration;
g_jmms_context->nvram_compose_settings.creation_mode =
g_jmms_context->jmms_inline_items.compose_items_list.creation_mode;
/* HIMANSHU 05122006 START */
#ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
g_jmms_context->nvram_compose_settings.image_resize_option =
g_jmms_context->jmms_inline_items.compose_items_list.image_resize_option;
#endif /* __MMI_MMS_MEGA_PIXEL_SUPPORT__ */
/* HIMANSHU 05122006 END */
#ifdef __DRM_SUPPORT__
g_jmms_context->nvram_compose_settings.add_drm = g_jmms_context->jmms_inline_items.compose_items_list.add_drm;
#endif
g_jmms_context->nvram_compose_settings.layout = g_jmms_context->jmms_inline_items.compose_items_list.layout;
g_jmms_context->nvram_compose_settings.max_no_pages = (U8) temp_max_no_pages;
WriteRecord(
NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
1,
&g_jmms_context->nvram_compose_settings,
NVRAM_JMMS_COMPOSE_SETTINGS_SIZE,
&error);
DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
DeleteUptoScrID(SCR_ID_JMMS_MESSAGE_SETTINGS);
}
/*****************************************************************************
* FUNCTION
* mmi_jmms_read_back_auto_sign_content
* DESCRIPTION
* Read the Compose setting from NVRAm for the auto sign content
* Read back is required because we are using the original auto sign buffer for input
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -