# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270058913 -10800 # Node ID 4ce476e64c59436ad5c789ecc1786e514eac2d16 # Parent 0396474f30f5a2cd1610cf5062962a4a6b261238 Revision: 201011 Kit: 201013 diff -r 0396474f30f5 -r 4ce476e64c59 email_plat/email_crkeys_api/group/bld.inf --- a/email_plat/email_crkeys_api/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/email_plat/email_crkeys_api/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,8 +1,8 @@ /* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * @@ -22,6 +22,6 @@ DEFAULT PRJ_EXPORTS -../inc/commonemailcrkeys.h APP_LAYER_PLATFORM_EXPORT_PATH(commonemailcrkeys.h) +../inc/commonemailcrkeys.h APP_LAYER_PLATFORM_EXPORT_PATH(commonemailcrkeys.h) // End of File diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/conf/fscremotecontactlookup.confml Binary file emailcontacts/remotecontactlookup/conf/fscremotecontactlookup.confml has changed diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/conf/fscremotecontactlookup_2001F3FE.crml Binary file emailcontacts/remotecontactlookup/conf/fscremotecontactlookup_2001F3FE.crml has changed diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/data/service.rss --- a/emailcontacts/remotecontactlookup/data/service.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project Remote Contact Lookup Service -* -*/ - - -// INCLUDE FILES -#include - -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber - -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x2001F461; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x2001FE0C; - implementations = - { - // Info for the implementation - IMPLEMENTATION_INFO - { - implementation_uid = 0x2001FE0D; - version_no = KEmailEcomVersionNumber; - } - }; - } - }; - } - -// End of file diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/BWINS/pbkxrclengineU.DEF --- a/emailcontacts/remotecontactlookup/engine/BWINS/pbkxrclengineU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -EXPORTS - ?NewL@CPbkxRclSearchEngine@@SAPAV1@XZ @ 1 NONAME ; class CPbkxRclSearchEngine * CPbkxRclSearchEngine::NewL(void) - ?NewL@CPbkxRclSettingsEngine@@SAPAV1@XZ @ 2 NONAME ; class CPbkxRclSettingsEngine * CPbkxRclSettingsEngine::NewL(void) - ?NewLC@CPbkxRclSearchEngine@@SAPAV1@XZ @ 3 NONAME ; class CPbkxRclSearchEngine * CPbkxRclSearchEngine::NewLC(void) - ?NewLC@CPbkxRclSettingsEngine@@SAPAV1@XZ @ 4 NONAME ; class CPbkxRclSettingsEngine * CPbkxRclSettingsEngine::NewLC(void) - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/EABI/pbkxrclengineU.DEF --- a/emailcontacts/remotecontactlookup/engine/EABI/pbkxrclengineU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -EXPORTS - _ZN20CPbkxRclSearchEngine4NewLEv @ 1 NONAME - _ZN20CPbkxRclSearchEngine5NewLCEv @ 2 NONAME - _ZN22CPbkxRclSettingsEngine4NewLEv @ 3 NONAME - _ZN22CPbkxRclSettingsEngine5NewLCEv @ 4 NONAME - _ZTI17CPbkxRclCbRSender @ 5 NONAME ; ## - _ZTI19CPbkxRclQueryEditor @ 6 NONAME ; ## - _ZTI19CPbkxRclSettingItem @ 7 NONAME ; ## - _ZTI19CPbkxRclvCardSender @ 8 NONAME ; ## - _ZTI20CPbkxRclSearchEngine @ 9 NONAME ; ## - _ZTI21CPbkxRclResultInfoDlg @ 10 NONAME ; ## - _ZTI22CPbkxRclContactUpdater @ 11 NONAME ; ## - _ZTI22CPbkxRclEventScheduler @ 12 NONAME ; ## - _ZTI22CPbkxRclSettingsEngine @ 13 NONAME ; ## - _ZTI23CPbkxRclProtocolEnvImpl @ 14 NONAME ; ## - _ZTI23CPbkxRclSearchResultDlg @ 15 NONAME ; ## - _ZTI26CPbkxRclProtocolResultImpl @ 16 NONAME ; ## - _ZTI27CPbkxRclProtocolAccountImpl @ 17 NONAME ; ## - _ZTI28CPbkxRclActionServiceWrapper @ 18 NONAME ; ## - _ZTI28CPbkxRclServiceUiContextImpl @ 19 NONAME ; ## - _ZTV17CPbkxRclCbRSender @ 20 NONAME ; ## - _ZTV19CPbkxRclQueryEditor @ 21 NONAME ; ## - _ZTV19CPbkxRclSettingItem @ 22 NONAME ; ## - _ZTV19CPbkxRclvCardSender @ 23 NONAME ; ## - _ZTV20CPbkxRclSearchEngine @ 24 NONAME ; ## - _ZTV21CPbkxRclResultInfoDlg @ 25 NONAME ; ## - _ZTV22CPbkxRclContactUpdater @ 26 NONAME ; ## - _ZTV22CPbkxRclEventScheduler @ 27 NONAME ; ## - _ZTV22CPbkxRclSettingsEngine @ 28 NONAME ; ## - _ZTV23CPbkxRclProtocolEnvImpl @ 29 NONAME ; ## - _ZTV23CPbkxRclSearchResultDlg @ 30 NONAME ; ## - _ZTV26CPbkxRclProtocolResultImpl @ 31 NONAME ; ## - _ZTV27CPbkxRclProtocolAccountImpl @ 32 NONAME ; ## - _ZTV28CPbkxRclActionServiceWrapper @ 33 NONAME ; ## - _ZTV28CPbkxRclServiceUiContextImpl @ 34 NONAME ; ## - _ZTI15CPbkxRclBaseDlg @ 35 NONAME ; ## - _ZTV15CPbkxRclBaseDlg @ 36 NONAME ; ## - _ZTI25CPbkxRclResultInfoListBox @ 37 NONAME ; ## - _ZTI27CPbkxRclSearchResultListBox @ 38 NONAME ; ## - _ZTI28CPbkxRclResultInfoItemDrawer @ 39 NONAME ; ## - _ZTI30CPbkxRclSearchResultItemDrawer @ 40 NONAME ; ## - _ZTV25CPbkxRclResultInfoListBox @ 41 NONAME ; ## - _ZTV27CPbkxRclSearchResultListBox @ 42 NONAME ; ## - _ZTV28CPbkxRclResultInfoItemDrawer @ 43 NONAME ; ## - _ZTV30CPbkxRclSearchResultItemDrawer @ 44 NONAME ; ## - _ZTI28CPbkxRclSearchResultListView @ 45 NONAME - _ZTV28CPbkxRclSearchResultListView @ 46 NONAME - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/data/engine.rss --- a/emailcontacts/remotecontactlookup/engine/data/engine.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,676 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for the engine. -* -*/ - - -NAME RCLE - -#include -#include -#include -#include -#include -#include -#include "engine.hrh" -#include // -#include -#include -#include - -RESOURCE RSS_SIGNATURE { } -RESOURCE TBUF { buf=""; } -// -// --------------------------------------------------------------------------- -// Message resources -// --------------------------------------------------------------------------- -// - -RESOURCE TBUF r_qtn_rcl_search { buf = qtn_rcl_search; } - -RESOURCE TBUF r_qtn_rcl_search_wait_note { buf = qtn_rcl_search_wait_note; } - -RESOURCE TBUF r_qtn_rcl_result_navi { buf = qtn_rcl_result_navi; } - -RESOURCE TBUF r_qtn_rcl_one_result_navi { buf = qtn_rcl_one_result_navi; } - -RESOURCE TBUF r_qtn_rcl_info_navi { buf = qtn_rcl_info_navi; } - -RESOURCE TBUF r_qtn_rcl_opening_wait_note { buf = qtn_rcl_opening_wait_note; } - -RESOURCE TBUF r_qtn_rcl_retrieval_wait_note { buf = qtn_rcl_retrieval_wait_note; } - -RESOURCE TBUF r_qtn_rcl_saving_wait_note { buf = qtn_rcl_saving_wait_note; } - -RESOURCE TBUF r_qtn_rcl_no_results { buf = qtn_rcl_no_results; } - -RESOURCE TBUF r_qtn_rcl_too_many_results_note { buf = qtn_rcl_too_many_results_note; } - -RESOURCE TBUF r_qtn_rcl_error_note { buf = qtn_rcl_error_note; } - -RESOURCE TBUF r_qtn_rcl_update_note { buf = qtn_rcl_update_note; } - -RESOURCE TBUF r_qtn_rcl_add_recipient_action_menu_text { buf = qtn_fs_action_recipient; } - -RESOURCE TBUF r_qtn_rcl_setting_rcl_server { buf = qtn_fs_setting_rcl_server; } - -RESOURCE TBUF r_qtn_rcl_setting_rcl_server_none { buf = qtn_fs_setting_rcl_server_none; } - -RESOURCE TBUF r_qtn_rcl_setting_rcl_not_defined { buf = qtn_fs_setting_rcl_not_defined; } - -RESOURCE TBUF r_qtn_rcl_replace_existing_detail_note { buf = qtn_rcl_replace_existing_detail_note; } - -// -//---------------------------------------------------------------------------- -// Menu pane for search result dialog -//---------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_search_result_dialog_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdViewDetails; txt = qtn_rcl_opt_details; }, - MENU_ITEM { command = ERclCmdAddAsRecipient; txt = qtn_rcl_opt_add_recipient; }, - MENU_ITEM { command = ERclCmdSaveToContacts; txt = qtn_rcl_opt_save_contact; }, - MENU_ITEM { command = ERclCmdNewSearch; txt = qtn_rcl_opt_new_search; }, - MENU_ITEM { command = ERclCmdCall; cascade = r_rcl_call_menu_pane; txt = qtn_rcl_opt_call; }, - MENU_ITEM { command = ERclCmdSend; cascade = r_rcl_send_menu_pane; txt = qtn_rcl_opt_send; }, -// MENU_ITEM { command = ERclCmdHelp; txt = qtn_options_help; }, - MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu sub pane for call options -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_call_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdVoiceCall; txt = qtn_rcl_opt_voice_call; }, - MENU_ITEM { command = ERclCmdVideoCall; txt = qtn_rcl_opt_video_call; }, - MENU_ITEM { command = ERclCmdVoip; txt = qtn_rcl_opt_voip; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu sub pane for send options -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_send_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdSendMsg; txt = qtn_rcl_opt_msg; }, - MENU_ITEM { command = ERclCmdSendEmail; txt = qtn_rcl_opt_email; }, - MENU_ITEM { command = ERclCmdSendMeetingReq; txt = qtn_rcl_opt_mreq; }, - MENU_ITEM { command = ERclCmdSendBusinessCard; txt = qtn_rcl_opt_bcard; }, - MENU_ITEM { command = ERclCmdSendAudioMsg; txt = qtn_rcl_opt_audio; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu sub pane for send options for context sensitive menu -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_context_send_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdSendMsg; txt = qtn_rcl_opt_msg; }, - MENU_ITEM { command = ERclCmdSendEmail; txt = qtn_rcl_opt_email; }, - MENU_ITEM { command = ERclCmdSendMeetingReq; txt = qtn_rcl_opt_mreq; }, - MENU_ITEM { command = ERclCmdSendBusinessCard; txt = qtn_rcl_opt_bcard; }, - MENU_ITEM { command = ERclCmdSendAudioMsg; txt = qtn_rcl_opt_audio; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu sub pane for talk options -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_talk_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdToContact; txt = qtn_rcl_opt_talk_1to1; }, - MENU_ITEM { command = ERclCmdSendCallbackReq; txt = qtn_rcl_opt_talk_cbr; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu pane for result info dialog -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_result_info_dialog_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdAddAsRecipient; txt = qtn_rcl_opt_add_recipient; }, - MENU_ITEM { command = ERclCmdAddToContacts; cascade = r_rcl_add_to_contacts_menu_pane; txt = qtn_rcl_opt_add_contacts; }, - MENU_ITEM { command = ERclCmdCall; cascade = r_rcl_call_menu_pane; txt = qtn_rcl_opt_call; }, - MENU_ITEM { command = ERclCmdTalk; cascade = r_rcl_talk_menu_pane; txt = qtn_rcl_opt_talk; }, - MENU_ITEM { command = ERclCmdSend; cascade = r_rcl_send_menu_pane; txt = qtn_rcl_opt_send; }, - MENU_ITEM { command = ERclCmdHelp; txt = qtn_options_help; }, - MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; } - }; - } - -// -// --------------------------------------------------------------------------- -// Context menu pane for result info dialog -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_result_info_dialog_context_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdAddAsRecipient; txt = qtn_rcl_opt_add_recipient; }, - MENU_ITEM { command = ERclCmdAddToContacts; cascade = r_rcl_add_to_contacts_menu_pane; txt = qtn_rcl_opt_add_contacts; }, - MENU_ITEM { command = ERclCmdCall; cascade = r_rcl_call_menu_pane; txt = qtn_rcl_opt_call; }, - MENU_ITEM { command = ERclCmdSend; cascade = r_rcl_context_send_menu_pane; txt = qtn_rcl_opt_send; } - }; - } - -// -// --------------------------------------------------------------------------- -// Sub menu pane for add to contacts menu option -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_PANE r_rcl_add_to_contacts_menu_pane - { - items = - { - MENU_ITEM { command = ERclCmdCreateNew; txt = qtn_rcl_opt_create_new; }, - MENU_ITEM { command = ERclCmdUpdateExisting; txt = qtn_rcl_opt_update_existing; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu bar for search result dialog -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_BAR r_rcl_search_result_dialog_menu_bar - { - titles = - { - MENU_TITLE { menu_pane = r_rcl_search_result_dialog_menu_pane; } - }; - } - -// -// --------------------------------------------------------------------------- -// Menu bar for result info fialog -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_BAR r_rcl_result_info_dialog_menu_bar - { - titles = - { - MENU_TITLE { menu_pane = r_rcl_result_info_dialog_menu_pane; } - }; - } - -// -// --------------------------------------------------------------------------- -// Context sensitive menu bar for info dialog -// --------------------------------------------------------------------------- -// - -RESOURCE MENU_BAR r_rcl_result_info_dialog_context_menu_bar - { - titles = - { - MENU_TITLE { menu_pane = r_rcl_result_info_dialog_context_menu_pane; } - }; - } - -// -// --------------------------------------------------------------------------- -// RCL setting item page for selecting account -// --------------------------------------------------------------------------- -// - -RESOURCE AVKON_SETTING_PAGE r_rcl_setting_item_page - { - type = EAknCtPopupSettingList; - editor_resource_id = r_rcl_popup_setting_list; - } - -// -// --------------------------------------------------------------------------- -// RCL popup setting list for selecting account -// --------------------------------------------------------------------------- -// - -RESOURCE POPUP_SETTING_LIST r_rcl_popup_setting_list - { - flags = 0; - } - -// -// --------------------------------------------------------------------------- -// RCL popup setting texts -// --------------------------------------------------------------------------- -// - -RESOURCE AVKON_POPUP_SETTING_TEXTS r_rcl_popup_setting_texts - { - setting_texts_resource = r_rcl_setting_text_array; - } - -// -// --------------------------------------------------------------------------- -// RCL popup setting text array -// --------------------------------------------------------------------------- -// - -RESOURCE ARRAY r_rcl_setting_text_array - { - items = - { - }; - } - -// -// --------------------------------------------------------------------------- -// Wait dialog while executing remote search -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_search_wait_dialog_cancel - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = KRclWaitDialogId; - control = AVKON_NOTE - { - layout = EWaitLayout; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Confirmation note -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_confirmation_note - { - flags = EAknConfirmationNoteFlags | EEikDialogFlagWait; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - imagefile = AVKON_BITMAP_FILE; - imageid = EMbmAvkonQgn_note_ok; - imagemask = EMbmAvkonQgn_note_ok_mask; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Query dialog with softkeys Ok - Refine -// --------------------------------------------------------------------------- -// -//Fix for: EASV-7KFGG3 -RESOURCE DIALOG r_rcl_confirmation_note_ok_refine - { - flags=EGeneralQueryFlags; - buttons=r_rcl_ok_refine_cba; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - animation = R_QGN_NOTE_WARNING_ANIM; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Confirmation note with softkeys Yes - Cancel -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_confirmation_note_yes_cancel - { - flags = EAknConfirmationNoteFlags | EEikDialogFlagWait; - buttons = r_rcl_yes_cancel_cba; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - imagefile = AVKON_BITMAP_FILE; - imageid = EMbmAvkonQgn_note_ok; - imagemask = EMbmAvkonQgn_note_ok_mask; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Warning note -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_warning_note - { - flags = EAknErrorNoteFlags | EEikDialogFlagWait; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - imagefile = AVKON_BITMAP_FILE; - imageid = EMbmAvkonQgn_note_warning; - imagemask = EMbmAvkonQgn_note_warning_mask; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Remote lookup search result dialog -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_search_result_dialog - { - flags = EAknDialogSelectionList; - buttons = r_rcl_options_back_open; - items = - { - DLG_LINE - { - type = ERclSearchResultListBox; - id = ESelectionListControl; - control = LISTBOX - { - flags = EAknListBoxSelectionList; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Result information dialog -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_result_info_dialog - { - flags = EAknDialogSelectionList; - buttons = r_rcl_options_back_contextmenu; - items = - { - DLG_LINE - { - type = ERclResultInfoListBox; - id = ESelectionListControl; - control = LISTBOX - { - flags = EAknListBoxSelectionList; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Query editor dialog -// --------------------------------------------------------------------------- -// - -RESOURCE DIALOG r_rcl_query_dialog - { - flags = EGeneralQueryFlags; - buttons = r_rcl_search_cancel_cba; - items = - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control = AVKON_DATA_QUERY - { - layout = EDataLayout; - control = EDWIN - { - flags = EAknEditorFlagDefault; - maxlength = KRclQueryTextMaxLength; - allowed_input_modes = EAknEditorNumericInputMode | EAknEditorTextInputMode; - }; - }; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Search cancel cba -// --------------------------------------------------------------------------- -// - -RESOURCE CBA r_rcl_search_cancel_cba - { - breadth = 80; - buttons = - { - CBA_BUTTON - { - id = EAknSoftkeyOk; - txt = qtn_rcl_softkey_search; - }, - CBA_BUTTON - { - id = EAknSoftkeyCancel; - txt = text_softkey_cancel; - }, - CBA_BUTTON - { - id = EAknSoftkeyOk; - txt = qgn_prop_msk_select; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Ok refine cba -// --------------------------------------------------------------------------- -// - -RESOURCE CBA r_rcl_ok_refine_cba - { - breadth = 80; - buttons = - { - CBA_BUTTON - { - id = EAknSoftkeyOk; - txt = text_softkey_ok; - }, - CBA_BUTTON - { - id = EAknSoftkeyCancel; - txt = qtn_rcl_softkey_refine; - }, - CBA_BUTTON - { - id = EAknSoftkeyOk; - txt = text_softkey_ok; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Yes cancel cba -// --------------------------------------------------------------------------- -// - -RESOURCE CBA r_rcl_yes_cancel_cba - { - breadth = 80; - buttons = - { - CBA_BUTTON - { - id = EAknSoftkeyOk; - txt = text_softkey_yes; - }, - CBA_BUTTON - { - id = EAknSoftkeyCancel; - txt = text_softkey_cancel; - }, - CBA_BUTTON - { - id = EAknSoftkeyOk; - txt = text_softkey_yes; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Poc aiw interest -// --------------------------------------------------------------------------- -// - -RESOURCE AIW_INTEREST r_rcl_poc_interest - { - items = - { - AIW_CRITERIA_ITEM - { - id = KAiwCmdPoC; - serviceCmd = KAiwCmdPoC; - contentType = "*"; - serviceClass = KAiwClassBase; - defaultProvider = KS60PoCAiwProviderImplUid; - maxProviders = 1; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Options - Open - Back cba -// --------------------------------------------------------------------------- -// -RESOURCE CBA r_rcl_options_back_open - { - breadth = 80; - buttons = - { - CBA_BUTTON - { - id = EAknSoftkeyOptions; - txt = text_softkey_option; - }, - CBA_BUTTON - { - id = EAknSoftkeyBack; - txt = text_softkey_back; - }, - CBA_BUTTON - { - id = EAknSoftkeyOpen; - txt = text_softkey_open; - } - }; - } - -// -// --------------------------------------------------------------------------- -// Options Back cba -// --------------------------------------------------------------------------- -// - -RESOURCE CBA r_rcl_options_back_contextmenu - { - breadth = 80; - buttons = - { - CBA_BUTTON - { - id = EAknSoftkeyOptions; - txt = text_softkey_option; - }, - CBA_BUTTON - { - id = EAknSoftkeyBack; - txt = text_softkey_back; - }, - CBA_BUTTON - { - id = EAknSoftkeyContextOptions; - txt = text_softkey_option; - } - }; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/group/bld.inf --- a/emailcontacts/remotecontactlookup/engine/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for project Remote Contact Lookup Engine -* -*/ - -#include // - -PRJ_PLATFORMS -WINSCW ARMV5 - -PRJ_EXPORTS -../inc/cpbkxremotecontactlookupserviceuicontext.h |../../../../inc/cpbkxremotecontactlookupserviceuicontext.h -../inc/mpbkxremotecontactlookupserviceui.h |../../../../inc/mpbkxremotecontactlookupserviceui.h -../inc/mpbkxremotecontactlookupsettingsui.h |../../../../inc/mpbkxremotecontactlookupsettingsui.h -// Protocol adaptation -../inc/cpbkxremotecontactlookupprotocoladapter.h |../../../../inc/cpbkxremotecontactlookupprotocoladapter.h -../inc/cpbkxremotecontactlookupprotocoladapter.inl |../../../../inc/cpbkxremotecontactlookupprotocoladapter.inl -../inc/mpbkxremotecontactlookupprotocolenv.h |../../../../inc/mpbkxremotecontactlookupprotocolenv.h -../inc/cpbkxremotecontactlookupprotocolresult.h |../../../../inc/cpbkxremotecontactlookupprotocolresult.h -../inc/cpbkxremotecontactlookupprotocolsession.h |../../../../inc/cpbkxremotecontactlookupprotocolsession.h -../inc/mpbkxremotecontactlookupprotocolsessionobserver.h |../../../../inc/mpbkxremotecontactlookupprotocolsessionobserver.h -../inc/tpbkxremotecontactlookupprotocolaccountid.h |../../../../inc/tpbkxremotecontactlookupprotocolaccountid.h -../inc/cpbkxremotecontactlookupprotocolaccount.h |../../../../inc/cpbkxremotecontactlookupprotocolaccount.h -../loc/rclengine.loc APP_LAYER_LOC_EXPORT_PATH(rclengine.loc) - -PRJ_MMPFILES -// Mifconv extension taken into use. IMPORTANT! Still, keep the mk-files -// similar to Freestyle (merge all the changes), but in addition to that update -// PRJ_EXTENSIONS below. - -//gnumakefile engineicons.mk - -pbkxrclengine.mmp - -PRJ_EXTENSIONS - -START EXTENSION s60/mifconv -OPTION TARGETFILE pbkxrclengine.mif -OPTION HEADERFILE pbkxrclengine.mbg -OPTION SOURCEDIR ../data -OPTION SOURCEFILE iconlist.txt -END diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/group/engineicons.mk --- a/emailcontacts/remotecontactlookup/engine/group/engineicons.mk Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -# -# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: Make file for remotecontactlookup engine icons. -# - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=\epoc32\data\z -endif - -TARGETDIR=$(ZDIR)\RESOURCE\APPS -HEADERDIR=\epoc32\include -ICONTARGETFILENAME=$(TARGETDIR)\pbkxrclengine.mif -HEADERFILENAME=$(HEADERDIR)\pbkxrclengine.mbg -# icons changed -SOURCEDIR=$(EPOCROOT)\epoc32\s60\icons - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -RESOURCE : - mifconv $(ICONTARGETFILENAME) /H$(HEADERFILENAME) \ - /c16,8 $(SOURCEDIR)\qgn_prop_cmail_contacts_group.svg \ - /c16,8 $(SOURCEDIR)\qgn_indi_cmail_action_arrow_right.svg - -# - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/group/iconlist.txt --- a/emailcontacts/remotecontactlookup/engine/group/iconlist.txt Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ --c16,8 qgn_prop_cmail_contacts_group.svg --c16,8 qgn_indi_cmail_action_arrow_right.svg diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/group/pbkxrclengine.mmp --- a/emailcontacts/remotecontactlookup/engine/group/pbkxrclengine.mmp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2007,2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for the engine. -* -*/ - - -#include -#include - -#include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../../inc/emailtraceconfig.hrh" -#include "../inc/pbkxrclengineuids.hrh" - -OPTION CW -frame on - -TARGET pbkxrclengine.dll -TARGETTYPE DLL -UID 0x1000008d KPbkxRclEngineUid - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - -SOURCEPATH ../src -SOURCE cpbkxrclsearchengine.cpp -SOURCE cpbkxrclsettingsengine.cpp -SOURCE cpbkxrclqueryeditor.cpp -SOURCE cpbkxrclresultinfodlg.cpp -SOURCE cpbkxrclsearchresultdlg.cpp -SOURCE cpbkxrclserviceuicontextimpl.cpp -SOURCE cpbkxrclprotocolresultimpl.cpp -SOURCE cpbkxrclprotocolenvimpl.cpp -SOURCE cpbkxrclprotocolaccountimpl.cpp -SOURCE pbkxrclutils.cpp -SOURCE cpbkxrcleventscheduler.cpp -SOURCE cpbkxrclvcardsender.cpp -SOURCE cpbkxrclcbrsender.cpp -SOURCE cpbkxrclactionservicewrapper.cpp -SOURCE cpbkxrclcontactupdater.cpp -SOURCE cpbkxrclsettingitem.cpp -SOURCE cpbkxrclbasedlg.cpp -SOURCE cpbkxrclsearchresultlistbox.cpp -SOURCE cpbkxrclresultinfolistbox.cpp -SOURCE cpbkxrclcontactconverter.cpp - -USERINCLUDE ../inc -USERINCLUDE ../loc -USERINCLUDE ../../inc - -APP_LAYER_SYSTEMINCLUDE - -USERINCLUDE ../../../../inc - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY centralrepository.lib -LIBRARY commonengine.lib -LIBRARY cone.lib -LIBRARY cntmodel.lib -LIBRARY avkon.lib -LIBRARY eikcoctl.lib -LIBRARY eikctl.lib -LIBRARY eikdlg.lib -LIBRARY eikcore.lib -LIBRARY bafl.lib -LIBRARY pbkeng.lib -LIBRARY pbkview.lib -LIBRARY aknskins.lib -LIBRARY aknskinsrv.lib -LIBRARY efsrv.lib -LIBRARY estor.lib -LIBRARY bcardeng.lib -LIBRARY sendui.lib -LIBRARY etext.lib -LIBRARY featmgr.lib -LIBRARY servicehandler.lib -LIBRARY ws32.lib -LIBRARY egul.lib -LIBRARY aknicon.lib -LIBRARY fepbase.lib -LIBRARY hlplch.lib -LIBRARY VPbkEng.lib -LIBRARY VPbkVCardEng.lib -LIBRARY PlatformEnv.lib -LIBRARY cmaillogger.lib -#if (PBKX_DEBUG_LEVEL > 0) -LIBRARY pbkxdebug.lib -#endif - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE - -SOURCEPATH ../data -START RESOURCE engine.rss -HEADER -TARGET pbkxrclengine.rsc -TARGETPATH resource/apps -LANGUAGE_IDS -END - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclactionservicewrapper.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclactionservicewrapper.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclActionServiceWrapper. -* -*/ - - -#ifndef CPBKXRCLACTIONSERVICEWRAPPER_H -#define CPBKXRCLACTIONSERVICEWRAPPER_H - -#include -// -#include "fsccontactactionservicedefines.h" -#include "mfsccontactactionserviceobserver.h" -// -#include - -class CFscContactActionService; -class TFscContactActionQueryResult; -class CVPbkContactManager; -class CPbkContactEngine; -class CPbkxRclContactConverter; -class MVPbkContactStore; -class CPbkContactItem; - -/** -* Wrapper for contact action service. -* -* Available actions can be queried and actions can be executed. -* -* Save as action is not included in queries, since it is handled -* by ourselves. -*/ -class CPbkxRclActionServiceWrapper : - public CBase, - public MVPbkContactStoreObserver, - public MFscContactActionServiceObserver - { -public: // constructor and destructor - - /** - * Constructs new object. - * - * @return Created object. - */ - static CPbkxRclActionServiceWrapper* NewL( CPbkContactEngine& aContactEngine ); - - /** - * Destructor. - */ - virtual ~CPbkxRclActionServiceWrapper(); - -public: // new methods - - /** - * Sets contact selector mode on or off. - * - * ETrue is for setting mode on, EFalse is for setting mode off. - * - * Queried actions depend on the given mode. This method is called only once - * in the beginning of the execution. After calling this, SetActionMenuMode - * is called each time when search result view or result info view is set - * topmost. - * - * @param aContactSelectorMode Contact selector mode. - */ - void SetContactSelectorMode( TBool aContactSelectorMode ); - - /** - * Sets action menu mode on or off. - * - * ETrue is for setting mode on, EFalse is for setting mode off. - * - * Queried actions depend on the given mode. This method is called every - * time search result view or result info view is set topmost. - * - * @param aActionMenuMode Action menu mode. - */ - void SetActionMenuMode( TBool aActionMenuMode ); - - /** - * Sets contact to contact action service. - * - * After setting the contact actions are queried. - * - * @param aContactItem Contact item. - */ - void SetCurrentContactL( CPbkContactItem* aContactItem ); - - /** - * Checks whether given action is enabled by contact action service. - * - * @param aActionType Action type. - * @return ETrue if action is enabled, EFalse otherwise. - */ - TBool IsActionEnabled( const TUint64 aActionType ) const; - - /** - * Executes given action. - * - * @param aActionType Action type. - */ - void ExecuteActionL( const TUint64 aActionType ); - - /** - * Returns contact action service used by this wrapper. - * - * Ownership is not transferred. - * - * @return Contact action service. - */ - CFscContactActionService* ActionService(); - - /** - * Searches for a query result of given type. - * - * If such is not found, NULL is returned. - * - * @param aType Type of result. - * @return Query result or NULL. - */ - const TFscContactActionQueryResult* GetResult( const TUint64 aType ) const; - - /** - * Returns contact converter used by this wrapper. - * - * Ownership is not transferred. - * - * @return Contact converter. - */ - CPbkxRclContactConverter* ContactConverter(); - - /** - * Cancels action service requests. - */ - void CancelQuery(); - - // from base class MVPbkContactStoreObserver - void StoreReady( MVPbkContactStore& aContactStore ); - - void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason ); - - void HandleStoreEventL( MVPbkContactStore& aContactStore, - TVPbkContactStoreEvent aStoreEvent ); - - // from base class MFscContactActionServiceObserver - void QueryActionsComplete(); - - void QueryActionsFailed( TInt aError ); - - void ExecuteComplete(); - - void ExecuteFailed( TInt aError ); - - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclActionServiceWrapper( CPbkContactEngine& aContactEngine ); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Contact Manger. Owned. - CVPbkContactManager* iContactManager; - // Contact Store. Not owned. - MVPbkContactStore* iContactStore; - - // Contact converter. Owned. - CPbkxRclContactConverter* iContactConverter; - - // Contact engine - CPbkContactEngine& iContactEngine; - - // Contact action service. Owned. - CFscContactActionService* iContactActionService; - - // Array to hold converted Contact item. Contains only one contact at time. - RFscStoreContactList iConvertedContact; - - // For asyncronous operation. Owned. - CActiveSchedulerWait* iWait; - - // Flag indicating whether contact selector mode is on. - TBool iContactSelectorMode; - - // Flags used in action querying. - TUint64 iFlags; - - // Flag indicating whether we have save as contact action. - TBool iSaveAsContactActionExists; - - // Save as contact query result. - // We need custom implementation in search result view and this - // is why it is stored. - TFscContactActionQueryResult iSaveAsContactResult; - - // Error code from Observer - TInt iLastError; - - // Query flag - TBool iQueryComplete; - - // Action execute flag - TBool iExecuteComplete; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclbasedlg.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclbasedlg.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclBaseDlg. -* -*/ - - -#ifndef CPBKXRCLBASEDLG_H -#define CPBKXRCLBASEDLG_H - -#include -#include -#include - -class CAknsListBoxBackgroundControlContext; - -/** -* Base class for CAknSelectionListDialog based views. -*/ -class CPbkxRclBaseDlg : public CAknSelectionListDialog - { -public: // destructors - - virtual ~CPbkxRclBaseDlg(); - -protected: // methods from base classes - - /** - * Handles resource change. - * - * @param aType Type of the change. - */ - virtual void HandleResourceChange( TInt aType ); - - /** - * Checks if listbox type is acceptable. - * - * @param aControlType Type of the listbox. - * @param aIsFormattedCellList ETrue if listbox is formatted cell listbox. - * @return ETrue if listbox is acceptable type. - */ - virtual TBool IsAcceptableListBoxType( - TInt aControlType, - TBool &aIsFormattedCellList ) const; - - /** - * Creates custom control of given type. - * - * @param aControlType Type of the control. - * @return Information about created control. - */ - virtual SEikControlInfo CreateCustomControlL( TInt aControlType ); - -protected: // constructors - - /** - * Constructor. - * - * @param aIndex Index which user selected from the list (probably not used?) - * @param aArray Array of items. - * @param aCommand Command observer for observing menu commands. - * @param aColumnListBox ETrue if listbox type is column. - */ - CPbkxRclBaseDlg( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - TBool aColumnListBox ); - - /** - * Second-phase constructor. - * - * @param aResourceId Resource identifier. - */ - void ConstructL( TInt aResourceId ); - -protected: // new methods - - /** - * Updates graphics used in the component. - */ - void UpdateGraphics(); - - /** - * Updates colors used in the component. - */ - void UpdateColors(); - -private: // data - - // Skin ids. - TAknsItemID iListItemId; - TAknsItemID iListBottomId; - TAknsItemID iHighlightId; - TAknsItemID iHighlightCenterId; - TAknsItemID iHighlightTextColorId; - TAknsItemID iTextColorId; - - TBool iColumnListBox; - }; - -#endif - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclcbrsender.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclcbrsender.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclCbRSender. -* -*/ - - -#ifndef CPBKXRCLCBRSENDER_H -#define CPBKXRCLCBRSENDER_H - -#include - -class CPbkContactItem; -class CAiwServiceHandler; - -/** -* Class that sends call back request using CAiwServiceHandler. -* -* @lib pbkxrclengine.lib -* @since 3.1 -*/ -class CPbkxRclCbRSender : public CBase - { -public: // constructor and destructor - - /** - * Two-phased constructor. - * - * @return Created object. - */ - static CPbkxRclCbRSender* NewL(); - - /** - * Two-phased constructor. - * - * Leaves pointer to the created object in cleanupstack. - * - * @return Created object. - */ - static CPbkxRclCbRSender* NewLC(); - - /** - * Destructor. - */ - virtual ~CPbkxRclCbRSender(); - -public: // new methods - - /** - * Sends callback request to the given contact. - * - * @param aContactItem Contact item for which callback request is sent. - */ - void SendCallbackRequestL( CPbkContactItem& aContactItem ); - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclCbRSender(); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Service handler for sending the callback request. Owned. - CAiwServiceHandler* iServiceHandler; - - }; - -#endif - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclcontactconverter.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclcontactconverter.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Converting CPbkContactItem to MVPbkStoreContact -* -*/ - - -#ifndef CPBKXRCLCONTACTCONVERTER_H -#define CPBKXRCLCONTACTCONVERTER_H - -// INCLUDES -#include -#include -#include -#include -// -#include "fsccontactactionservicedefines.h" // rfscstorecontactlist -// - -// FORWARD DECLARATIONS -class CBCardEngine; -class CPbkContactEngine; -class MVPbkContactStore; -class CVPbkVCardEng; -class MVPbkStoreContact; -class CVPbkContactManager; -class RWriteStream; - -// CLASS DECLARATION - -/** - * CPbkxRclContactConverter - * Convert contact to MVPbkStoreContact objects. - * - */ - -NONSHARABLE_CLASS( CPbkxRclContactConverter ): public CBase, public MVPbkSingleContactOperationObserver - { -public: - // Constructors and destructor - - /** - * Destructor. - */ - ~CPbkxRclContactConverter(); - - /** - * Two-phased constructor. - */ - static CPbkxRclContactConverter* NewL( - CPbkContactEngine& aContactEngine, - CVPbkContactManager& aContactManager, - MVPbkContactStore& aContactStore ); - - /** - * Two-phased constructor. - */ - static CPbkxRclContactConverter* NewLC( - CPbkContactEngine& aContactEngine, - CVPbkContactManager& aContactManager, - MVPbkContactStore& aContactStore ); - - /** - * Convert contact to MVPbkStoreContact - * MVPbkStoreContact is stored to RFscStoreContactList. - * - * @param aContactItem Contact item to convert - * @param aConvertedContact Reference to list where result is stored. - * Calling client is responsible to delete MVPbkStoreContact object. - */ - void ConvertContactL( - CPbkContactItem& aContactItem, - RFscStoreContactList& aConvertedContact ); - - /** - * Convert contact to MVPbkStoreContact - * end export it to stream as VCard - * - * @param aContactItem Contact item to convert - * @param stream to save VCard - * - */ - void ConvertAndExportContactL( - CPbkContactItem& aContactItem, - RWriteStream& aStream ); - - // from base class MVPbkSingleContactOperationObserver - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ); - - void VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, TInt aError ); - -private: - - /** - * Constructor for performing 1st stage construction - */ - CPbkxRclContactConverter(CPbkContactEngine& aContactEngine, - CVPbkContactManager& aContactManager, - MVPbkContactStore& aContactStore ); - - /** - * Default constructor for performing 2nd stage construction - */ - void ConstructL(); - - // DATA - /** - * Reference to CPbkContactEngine - */ - CPbkContactEngine& iContactEngine; - /** - * Old vCard engine. - * Own. - */ - CBCardEngine* iCardEngine; - /** - * Reference to CPbkContactEngine - */ - CVPbkContactManager& iContactManager; - /** - * New Virtual Phonebook vCard engine. - * Own. - */ - CVPbkVCardEng* iVPbkCardEngine; - /** - * Active scheduler waiter - * Own. - */ - CActiveSchedulerWait* iWait; - /** - * Reference to MVPbkContactStore - */ - MVPbkContactStore& iContactStore; - /** - * Last error from Operation execution - */ - TInt iLastError; - }; - -#endif // CPBKXRCLCONTACTCONVERTER_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclcontactupdater.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclcontactupdater.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclContactUpdater -* -*/ - - -#ifndef CPBKXRCLCONTACTUPDATER_H -#define CPBKXRCLCONTACTUPDATER_H - -#include - -class CPbkContactEngine; -class CPbkContactItem; -class TPbkContactItemField; -class CPbkFieldInfo; - -/** -* Class that updates existing contact data. -* -* @lib pbkxrclengine.lib -* @since 3.1 -*/ -class CPbkxRclContactUpdater : public CBase - { -public: // constructors and destructor - - /** - * Constructs contact updater. - * - * @param aEngine Contact engine. - * @return Created object. - */ - static CPbkxRclContactUpdater* NewL( CPbkContactEngine& aEngine ); - - /** - * Constructs contact updater. - * - * Pointer to the created object is left on cleanupstack. - * - * @param aEngine Contact engine. - * @return Created object. - */ - static CPbkxRclContactUpdater* NewLC( CPbkContactEngine& aEngine ); - - /** - * Destructor. - */ - virtual ~CPbkxRclContactUpdater(); - -public: // new methods - - /** - * Updates the given field to the user selected contact. - * - * @param aField Field to be updated to the contact. - * - * @return Update text shown to the user. Ownership is transferred. - */ - HBufC* UpdateContactL( TPbkContactItemField& aField ); - -private: // methods used internally - - /** - * Constructs the list of possible fields and if there are several, - * user is asked to select a field. - * - * If there is already selected field, user is asked if he wants to - * replace the existing field. - * - * NULL is returned if user cancels the updating. - * - * @param aContactItem Contact for which field is updated. - * @param aFieldInfo Field info of the field which data is updated - * to the contact. - * @return Field which is updated. - */ - TPbkContactItemField* SelectUpdatedFieldL( - CPbkContactItem& aContactItem, - CPbkFieldInfo& aFieldInfo ); - - /** - * Constructs update text shown to the user after successfull updating. - * - * @param aContactItem Contact item that was updated. - * @param aField Updated field. - * @return Update text. - */ - HBufC* ConstructUpdatedTextL( - CPbkContactItem& aContactItem, - TPbkContactItemField& aField ); - - /** - * Constructs a list of possible fields of given type. - * - * There are three possible types: home, work, and none. If at least two - * types are found, user is asked to select a type. - * - * @param aFieldInfo Source field info of the field that is updated - * to the contact. - * @param aFieldCount Number of possible fields. - * @return Destination field info which is updated. - * Ownership is not transferred. - */ - CPbkFieldInfo* SelectFieldL( - CPbkFieldInfo& aFieldInfo, - TInt& aFieldCount ); - -private: // constructors - - /** - * Constructor. - * - * @param aEngine Contact engine. - */ - CPbkxRclContactUpdater( CPbkContactEngine& aEngine ); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Contact engine. - CPbkContactEngine& iEngine; - // Offset to resource file. - TInt iResourceFileOffset; - }; - -#endif - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrcleventscheduler.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrcleventscheduler.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclEventScheduler. -* -*/ - - -#ifndef CPBKXRCLEVENTSCHEDULER_H -#define CPBKXRCLEVENTSCHEDULER_H - -#include - -/** -* Class that is notified when event is triggered. -* -* @lib pbkxrclengine.lib -* @since 3.1 -*/ -class MPbkxRclEventHandler - { -public: - - /** - * This method is called when event is triggered. - */ - virtual void EventTriggered() = 0; - - }; - -/** -* Class that generates events with a little delay. -* -* @lib pbkxrclengine.lib -* @since 3.1 -*/ -class CPbkxRclEventScheduler : public CActive - { - -public: // constructor and destructor - - /** - * Two-phased constructor. - * - * @param aHandler Interface which is notified when event is triggered. - * @return Created object. - */ - static CPbkxRclEventScheduler* NewL( MPbkxRclEventHandler& aHandler ); - - /** - * Destructor. - */ - virtual ~CPbkxRclEventScheduler(); - -public: // new methods - - /** - * Triggers event with a little delay. - */ - void TriggerEvent(); - -protected: // from CActive - - /** - * Handles asynchronous request. - */ - virtual void RunL(); - - /** - * Cancels asynchronous request. - */ - virtual void DoCancel(); - -private: // constructors - - /** - * Constructor. - * - * @param aHandler Interface which is notified when event is triggered. - */ - CPbkxRclEventScheduler( MPbkxRclEventHandler& aHandler ); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Handles triggered event. - MPbkxRclEventHandler& iEventHandler; - - // Timer for creating a little delays in triggering events. - RTimer iTimer; - - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclprotocolaccountimpl.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclprotocolaccountimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclProtocolAccountImpl. -* -*/ - - -#ifndef CPBKXRCLPROTOCOLACCOUNTIMPL_H -#define CPBKXRCLPROTOCOLACCOUNTIMPL_H - -#include "cpbkxremotecontactlookupprotocolaccount.h" - -/** -* Class for holding information of protocol account. -* -* @lib pbkxrclengine.lib -* @since 3.1 -*/ -class CPbkxRclProtocolAccountImpl : public CPbkxRemoteContactLookupProtocolAccount - { -public: // constructors and destructor - - /** - * Two-phased constructor. - * - * @param aId Protocol account id. - * @param aName Protocol name. - * @return Created object. - */ - static CPbkxRclProtocolAccountImpl* NewL( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ); - - /** - * Two-phased constructor. - * - * Leaves pointer to the created object on cleanupstack. - * - * @param aId Protocol account id. - * @param aName Name of the protocol. - * @return Created object. - */ - static CPbkxRclProtocolAccountImpl* NewLC( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ); - - /** - * Destructor. - */ - virtual ~CPbkxRclProtocolAccountImpl(); - -public: // methods from CPbkxRemoteContactLookupProtocolAccount - - /** - * Returns account identifier. - * - * @return account identifier - */ - virtual TPbkxRemoteContactLookupProtocolAccountId Id() const; - - /** - * Returns value of the account identifier. - * - * @return account name - */ - virtual const TDesC& Name() const; - -private: // constructors - - /** - * Constructor. - * - * @param aId Protocol account id. - */ - CPbkxRclProtocolAccountImpl( - TPbkxRemoteContactLookupProtocolAccountId aId ); - - /** - * Second-phase constructor. - * - * @param aName Name of the account. - */ - void ConstructL( const TDesC& aName ); - -private: // data - - // Protocol account id. - TPbkxRemoteContactLookupProtocolAccountId iId; - - // Name of the protocol. - RBuf iName; - - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclprotocolenvimpl.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclprotocolenvimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclProtocolEnvImpl. -* -*/ - - -#ifndef CPBKXRCLPROTOCOLENVIMPL_H -#define CPBKXRCLPROTOCOLENVIMPL_H - -#include "mpbkxremotecontactlookupprotocolenv.h" - -/** -* Factory class for creating data objects. -* -* @lib pbkxengine.lib -* @since S60 3.1 -*/ -class CPbkxRclProtocolEnvImpl : - public CBase, - public MPbkxRemoteContactLookupProtocolEnv - { -public: // constructors and destructor - - /** - * Two-phased constructor. - * - * @return Created object. - */ - static CPbkxRclProtocolEnvImpl* NewL(); - - /** - * Two-phased constructor. - * - * Leaves pointer to the created object on cleanupstack. - * - * @return Created object. - */ - static CPbkxRclProtocolEnvImpl* NewLC(); - - /** - * Destructor. - */ - virtual ~CPbkxRclProtocolEnvImpl(); - -public: // functions from MPbkxRemoteContactLookupProtocolEnv - - /** - * Creates a new protocol account instance. - * - * Ownership is transferred to caller. - * - * @param aId protocol account ID - * @param aName protocol account name - * @return Created account. - */ - virtual CPbkxRemoteContactLookupProtocolAccount* NewProtocolAccountL( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ); - - /** - * Creates a new protocol result instance. - * - * Ownership is transferred to caller. - * - * @param aIsComplete is search result complete? - * @param aContactItem contact item, owernship is transfered to this object - * @param aExtraProtocolData extra protocol data for two-phase search - * @return Created protocol result. - */ - virtual CPbkxRemoteContactLookupProtocolResult* NewProtocolResultL( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ); - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclProtocolEnvImpl(); - - /** - * Second-phase constructor. - */ - void ConstructL(); - - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclprotocolresultimpl.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclprotocolresultimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclProtocolResultImpl. -* -*/ - - -#ifndef CPBKXRCLPROTOCOLRESULTIMPL_H -#define CPBKXRCLPROTOCOLRESULTIMPL_H - -#include "cpbkxremotecontactlookupprotocolresult.h" - -/** -* Class that holds remote contact search results. -* -* @lib pbkxengine.lib -* @since S60 3.1 -*/ -class CPbkxRclProtocolResultImpl : public CPbkxRemoteContactLookupProtocolResult - { -public: // constructors and destructor - - /** - * Two-phased constructor. - * - * @param aIsComplete Flag indicating whether result is complete or not. - * @param aContactItem Result contact item. - * @param aExtraProtocolData Extra protocol specific data. - * @return Create object. - */ - static CPbkxRclProtocolResultImpl* NewL( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ); - - /** - * Two-phased constructor. - * - * Leaves pointer to the created object on cleanupstack. - * - * @param aIsComplete Flag indicating whether result is complete or not. - * @param aContactItem Result contact item. - * @param aExtraProtocolData Extra protocol specific data. - * @return Create object. - */ - static CPbkxRclProtocolResultImpl* NewLC( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ); - - /** - * Destructor. - */ - virtual ~CPbkxRclProtocolResultImpl(); - -public: // methods from CPbkxRemoteContactLookupProtocolResult - - /** - * Is the search result complete or do we need a second phase? - * - * @return ETrue if the search result is complete. - */ - virtual TBool IsComplete() const; - - /** - * Sets result as complete. - * - * This means that result now contains all possible fields and no more - * fields can be retrieved. - */ - virtual void Complete(); - - /** - * Returns extra protocol data need for mapping contact item to protocol - * level entries. - * - * @return extra protocol data - */ - virtual const TDesC& ExtraProtocolData() const; - - /** - * Returns contact item. - * - * @return contact item - */ - virtual CContactItem& ContactItem(); - -private: // constructor - - /** - * Constructor. - * - * @param aIsComplete Flag indicating whether result is complete or not. - * @param aContactItem Result contact item. - */ - CPbkxRclProtocolResultImpl( TBool aIsComplete, CContactItem& aContactItem ); - - /** - * Second-phase constructor. - * - * @param aExtraProtocolData Extra protocol data. - */ - void ConstructL( const TDesC& aExtraProtocolData ); - -private: // data - - // Flag indicating whether result is complete or not. - // If result is not complete, second-phase search is needed. - TBool iIsComplete; - - // Result contact item. Not owned. - CContactItem* iContactItem; - - // Extra protocol data. - RBuf iExtraProtocolData; - - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclqueryeditor.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclqueryeditor.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclQueryEditor. -* -*/ - - -#ifndef CPBKXRCLQUERYEDITOR_H -#define CPBKXRCLQUERYEDITOR_H - -#include - -/** -* Provides an UI that lets user to edit the search query. -* -* @lib pbkxrclengine.lib -* @since S60 3.1 -*/ -class CPbkxRclQueryEditor : public CAknTextQueryDialog - { -public: // constructor and destructor - - /** - * Two-phased constructor. - * - * @param aAccountName name of the remote lookup account - * @param aQueryText query text - * @return Created object. - */ - static CPbkxRclQueryEditor* NewL( - const TDesC& aAccountName, - TDes& aQueryText ); - - /** - * Destructor. - */ - virtual ~CPbkxRclQueryEditor(); - -public: // new methods - - /** - * Execute UI that lets the user edit the query and returns the edited - * query back to the user. - * - * @return ETrue if user selected Ok, EFalse otherwise. - */ - TBool ExecuteDialogLD(); - -private: // methods used internally - - /** - * Sets editor input mode based on user input. - * - * If there is at least one alpha character then text input mode is - * selected. Otherwise input mode is numerical. - */ - void SetEditorInputModeL(); - -private: // constructors - - /** - * Constructor. - * - * @param aQueryText Handle to query text. - */ - CPbkxRclQueryEditor( TDes& aQueryText ); - - /** - * Second-phase constructor. - * - * @param aAccountName Account name used to create prompt text. - */ - void ConstructL( const TDesC& aAccountName ); - - }; - -#endif // CPBKXRCLQUERYEDITOR_H - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclresultinfodlg.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclresultinfodlg.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,324 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclResultInfoDlg -* -*/ - - -#ifndef CPBKXRCLRESULTINFODLG_H -#define CPBKXRCLRESULTINFODLG_H - -#include "cpbkxrclbasedlg.h" -#include "pbkxrclengineconstants.h" -#include // MEikListBoxObserver - -class CAknNavigationControlContainer; -class CAknNavigationDecorator; -class CAknTabGroup; -class CAknTitlePane; -class MPbkxRclContactRetrieval; -class CPbkContactItem; -class CPbkContactEngine; -class CPbkxRclCbRSender; -class CPbkxRclActionServiceWrapper; -class TPbkContactItemField; -class CPbkFieldArray; - -/** - * Result information view implementation. - * - * @lib pbkxrclengine.lib - * @since S60 3.1 - */ -class CPbkxRclResultInfoDlg : public CPbkxRclBaseDlg, - public MEikListBoxObserver - { -public: // constructor and destructor - - /** - * Two-phase constructor. - * - * @param aIndex Selected item index, is updated by dialog after selection - * is made. - * @param aArray Array of list box items. - * @param aCommand Observer which executes dialog menu commands. - * @param aContactRetrieval Used to get more information about contacts. - * @param aContactEngine Used to create pbk contacts. - * @param aActionService Contact action service. - * @param aContactSelectorEnabled Flag indicating whether contact - * selection is enabled. - * @param aActiveItemIndex Initial active item index. - * @return Created object. - */ - static CPbkxRclResultInfoDlg* NewL( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - MPbkxRclContactRetrieval* aContactRetrieval, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled, - TInt aActiveItemIndex ); - - /** - * Destructor. - */ - virtual ~CPbkxRclResultInfoDlg(); - -public: // methods from base classes - - /** - * Hides option menu items that are not supposed to be shown. - * - * @param aResourceId Menu resource id. - * @param aMenuPane Menu pane. - */ - virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); - - /** - * Gets help context for this view. - * - * @param aContext On return, contains help context information - */ - virtual void GetHelpContext( TCoeHelpContext& aContext ) const; - -public: // new methods - - /** - * Executes dialog and destroys it after it is closed. - */ - void ExecuteLD(); - - /** - * Closes dialog. - */ - void Close(); - - /** - * Sends callback request to selected contact. - */ - void SendCallbackRequestL(); - - /** - * Sends bussiness card of currently selected contact. - */ - void SendBusinessCardL(); - - /** - * Updates existing contact with currently selected field. - * - * If update is successful, a string is constructed which is shown - * to the user. - * - * @return Constructed string to be shown to the user or NULL, if - * operation failed. - */ - HBufC* UpdateExistingContactL(); - -protected: // redefinition of functions in the base class - - /** - * Handles key events. - * - * @param aKeyEvent Key event. - * @param aType Type of the key event. - * @return Key response (handled/not handled). - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - - // MEikListBoxObserver - - /** - * Listbox event handler. - * - * @param aListBox that invoked the event. - * @param aEventType Type of the event. - */ - virtual void HandleListBoxEventL( - CEikListBox* aListBox, - TListBoxEvent aEventType ); - - TBool OkToExitL( TInt aButtonId ); - -private: // methods used internally - - /** - * Setup status pane (tab group and title pane text). - */ - void SetupStatusPaneL(); - - /** - * Setup tab group. - * - * Each contact gets its own tab. - */ - void SetupTabGroupL(); - - /** - * Sets the visibility of navi indicators. - */ - void SetNaviIndicatorsL(); - - /** - * Sets title pane text. - */ - void SetTitlePaneTextL(); - - /** - * Reverts changes made to status pane. - */ - void ResetStatusPane(); - - /** - * Removes tab group and frees the resources. - */ - void ResetTabGroup(); - - /** - * Creates list box entries of the currently selected contact. - */ - void CreateListBoxEntriesL(); - - /** - * Fetches current contact from contact retrieval interface. - * - * @return ETrue if fetching is successful, EFalse otherwise. - */ - TBool FetchCurrentContactL(); - - /** - * Updates both list box entries and status pane. - */ - void UpdateDialogL(); - - /** - * Returns ETrue if there are call actions available, EFalse - * otherwise. - * - * @return ETrue if there is call actions available. - */ - TBool CallActionsAvailable() const; - - /** - * Returns ETrue if focus is on phone number field. - * - * @return ETrue if focus is on phone number field. - */ - TBool FocusOnPhoneNumberField() const; - - /** - * Returns ETrue if focus is on email address field. - * - * @return ETrue if focus is on email address field. - */ - TBool FocusOnEmailAddressField() const; - - /** - * Returns ETrue if focus is on voip field. - * - * @return ETrue if focus is on voip field. - */ - TBool FocusOnVoipField() const; - - /** - * Returns current field focused. - */ - TPbkContactItemField& CurrentField() const; - -private: // constructors - - /** - * Constructor. - * - * @param aIndex Selected item index, is updated by dialog after selection - * is made. - * @param aArray Array of list box items. - * @param aCommand Observer which executes dialog menu commands. - * @param aContactRetrieval Used to get more information about contacts. - * @param aContactEngine Used to create pbk contacts. - * @param aActionService Contact action service. - * @param aContactSelectorEnabled Flag indicating whether contact - * selection is enabled. - * @param aActiveItemIndex Initial active item index. - */ - CPbkxRclResultInfoDlg( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - MPbkxRclContactRetrieval* aContactRetrieval, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled, - TInt aActiveItemIndex ); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Array of items. Not owned. - CDesCArray* iItems; - - // Contacts which information are shown. Owned. - CPbkContactItem* iCurrentContact; - - // Navi pane of the current UI application. Not owned. - CAknNavigationControlContainer* iNaviPane; - - // Navigation decorator. Owned. - CAknNavigationDecorator* iNaviDecorator; - - // Navigation tab group. Not owned. - CAknTabGroup* iTabGroup; - - // Title pane of the application. Not owned. - CAknTitlePane* iTitlePane; - - // Currently active tab. - TInt iActiveTabIndex; - - // Flag indicating whether contact selector is enabled or not. - TBool iContactSelectorEnabled; - - // Interface through which contact details are retrieved. Not owned. - MPbkxRclContactRetrieval* iContactRetrieval; - - // Contact engine to fetch the correct item priorities. - CPbkContactEngine& iContactEngine; - - // Action service wrapper for handling menu commands. - CPbkxRclActionServiceWrapper& iContactActionService; - - // Text shown in wait note when details are retrieved. Owned. - RBuf iWaitNoteText; - - // Original title pane text. Owned. - HBufC* iTitlePaneText; - - // Class for making callback requests. Owned. - CPbkxRclCbRSender* iCallbackReqSender; - - // Currently visible fields. Owned. - CPbkFieldArray* iVisibleFields; - - // Flag indicating that we are exiting dialog. After this is set - // no key presses are handled. - TBool iExit; - - }; - -#endif // CPBKXRCLRESULTINFODLG_H - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclresultinfolistbox.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclresultinfolistbox.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclResultInfoBox. -* -*/ - - -#ifndef CPBKXRCLRESULTINFOLISTBOX_H -#define CPBKXRCLRESULTINFOLISTBOX_H - -#include -#include - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclResultInfoListBox -//////////////////////////////////////////////////////////////////////////// - -/** -* Listbox for result info dialog. -*/ -class CPbkxRclResultInfoListBox : public CAknDoubleStyleListBox - { -public: // constructor and destructor - - /** - * Constructor. - */ - CPbkxRclResultInfoListBox(); - - /** - * Destructor. - */ - virtual ~CPbkxRclResultInfoListBox(); - -protected: // methods from base classes - - /** - * Creates item drawer for the listbox. - */ - virtual void CreateItemDrawerL(); - - }; - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclResultInfoItemDrawer -//////////////////////////////////////////////////////////////////////////// - -/** -* Item drawer for result info listbox. -*/ -class CPbkxRclResultInfoItemDrawer : public CFormattedCellListBoxItemDrawer - { -public: // constructor and destructor - - /** - * Constructor. - * - * @param aTextListBoxModel Listbox model. - * @param aFont Used font. - * @param aFormattedCellData Data class. - */ - CPbkxRclResultInfoItemDrawer( - MTextListBoxModel* aTextListBoxModel, - const CFont* aFont, - CFormattedCellListBoxData* aFormattedCellData ); - - /** - * Destructor. - */ - virtual ~CPbkxRclResultInfoItemDrawer(); - -public: // new methods - - /** - * Sets color used in highlighted text. - * - * @param aColor Color. - */ - void SetHighlightColor( TRgb aColor ); - - /** - * Sets color used in normal text. - * - * @param aColor Color. - */ - void SetColor( TRgb aColor ); - - /** - * Reset color settings. - * - * @param aHighlightColor ETrue if highlight is reset, EFalse for normal. - */ - void ResetColors( TBool aHighlightColor = EFalse ); - -public: // from base classes - - /** - * Draws item text. - * - * @param aItemIndex Item index. - * @param aItemTextRect Rect for text. - * @param aItemIsCurrent - * @param aViewIsEmphasized - * @param aItemIsSelected - */ - virtual void DrawItemText( - TInt aItemIndex, - const TRect& aItemTextRect, - TBool aItemIsCurrent, - TBool aViewIsEmphasized, - TBool aItemIsSelected ) const; - -private: // data - - enum TColors - { - EColorSet = 0x1, - EHighlighColorSet = 0x2 - }; - - // Color used in normal text. - TRgb iColor; - - // Color used in highlighted text. - TRgb iHighlightColor; - - // Flag indicating that colors are set. - TInt iColorsSet; - - }; - -#endif - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchengine.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchengine.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchEngine. -* -*/ - - -#ifndef CPBKXRCLSEARCHENGINE_H -#define CPBKXRCLSEARCHENGINE_H - -#include -#include -#include -#include "tpbkxremotecontactlookupprotocolaccountid.h" -#include "mpbkxremotecontactlookupserviceui.h" - -class CPbkxRemoteContactLookupProtocolAdapter; -class CPbkxRclProtocolEnvImpl; - -/** -* Class that creates accounts and context that executes the actual -* search. -* -* @lib pbkxrclengine.lib -* @since S60 3.1 -*/ -class CPbkxRclSearchEngine : - public CBase, - public MPbkxRemoteContactLookupServiceUi - { - -public: // constructors and destructors - - /** - * Two-phased constructor. - * - * @return Created object. - */ - IMPORT_C static CPbkxRclSearchEngine* NewL(); - - /** - * Two-phased constructor. - * - * Leaves pointer of the created object on the cleanupstack. - * - * @return Created object. - */ - IMPORT_C static CPbkxRclSearchEngine* NewLC(); - - /** - * Destructor. - */ - virtual ~CPbkxRclSearchEngine(); - -public: // from MPbkxRemoteContactLookupServiceUi - - /** - * Returns default account identifier. - * - * @return default account identifier - */ - virtual TPbkxRemoteContactLookupProtocolAccountId DefaultAccountIdL() const; - - /** - * Creates new account with given protocol account identifier. - * - * @param aProtocolAccountId protocol account ID. - * @return protocol account - */ - virtual CPbkxRemoteContactLookupProtocolAccount* NewAccountL( - const TPbkxRemoteContactLookupProtocolAccountId& aProtocolAccountId ) const; - - /** - * Create new execution context. - * - * @param aParams Construction parameters. - * @return execution context - */ - virtual CPbkxRemoteContactLookupServiceUiContext* NewContextL( - TContextParams& aParams ) const; - -private: // methods used internally - - /** - * Tries to create adapter with a given account id. - * - * @param aId Account id. - * @return Created object. - */ - CPbkxRemoteContactLookupProtocolAdapter* CreateAdapterLC( - const TPbkxRemoteContactLookupProtocolAccountId& aId ) const; - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclSearchEngine(); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Environment given to adapters. Owned. - CPbkxRclProtocolEnvImpl* iEnvironment; - - }; - -#endif // CPBKXRCLSEARCHENGINE_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchresultdlg.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchresultdlg.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,390 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchResultDlg. -* -*/ - - -#ifndef CPBKXRCLSEARCHRESULTDIALOG_H -#define CPBKXRCLSEARCHRESULTDIALOG_H - -#include -#include // MEikListBoxObserver -#include "cpbkxrclbasedlg.h" -#include "pbkxrclengineconstants.h" -#include "fsccontactactionmenudefines.h" //"pbkxcontactactionmenudefines.h" - - -class CAknNavigationControlContainer; -class CAknNavigationDecorator; -class CContactCard; -class CPbkContactEngine; -class CPbkxRclActionServiceWrapper; -class CPbkxContactActionMenu; -class CGulIcon; -class CFscContactActionMenu; - -/** -* Dialog for showing remote contact lookup search results. -* -* Offers menu options and acion menu to initiate actions for contacts. -*/ -class CPbkxRclSearchResultDlg : - public CPbkxRclBaseDlg, - public MEikListBoxObserver, - public MCoeForegroundObserver - { -public: // constructor and destructor - - /** - * Creates new object and returns pointer to it. - * - * @param aIndex Index which user selected from the list (probably not used?) - * @param aArray Array of items. - * @param aCommand Command observer for observing menu commands. - * @param aContactItems Contact items to be shown on the dialog. - * @param aContactEngine Contact engine for creating pbk contact items. - * @param aActionService Action service wrapper. - * @param aNaviText Navi text to be displayed. - * @param aContactSelectorEnabled Flag indicating whether RCL is in contact - * selector mode or not. - * @return Created object. - */ - static CPbkxRclSearchResultDlg* NewL( - TInt &aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - RPointerArray& aContactItems, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled ); - - /** - * Destructor. - */ - virtual ~CPbkxRclSearchResultDlg(); - -public: // methods from base classes - - /** - * Hides menu items that are not usable. - * - * @param aResourceId Menu resource id. - * @param aMenu Menu pane. - */ - virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane *aMenuPane ); - - /** - * Gets help context for this view. - * - * @param aContext On return, contains help context information - */ - virtual void GetHelpContext( TCoeHelpContext& aContext ) const; - - /** - * Dialog is popped on foreground. - */ - virtual void HandleGainingForeground(); - - /** - * Dialog is popped background. - */ - virtual void HandleLosingForeground(); - -public: // new methods - - /** - * Executes dialog and destroys it after dialog is closed. - */ - void ExecuteLD(); - - /** - * Returns index of the currently selected item. - * - * @return Index of the currently selected item. - */ - TInt CurrentItemIndex() const; - - /** - * Sets index of the currently selected item. - * - * @param aIndex Index to be set. - */ - void SetCurrentItemIndexL( TInt aIndex ); - - /** - * Sets current contact to action service. - * - * This affect menu item visibility. - */ - void SetCurrentContactToActionServiceL(); - - /** - * Closes dialog. - */ - void Close(); - - /** - * Updates search result dialog. - * - * @param aNaviText New navi text. - */ - void UpdateDialogL(); - - /** - * Sends business card of the currently selected contact. - */ - void SendBusinessCardL(); - - //Fix for: PKAO-7NNCJ2 - /** - * Informs dialog that info dialog is visible. - */ - void InfoDlgVisible( TBool aVisible ); - - -protected: // redefinition of functions of the base class - - /** - * From CAknSelectionListDialog. - * - * Handles key events. - * - * @param aKeyEvent Key event. - * @param aType Type of the key event. - * @return Key response (handled/not handled). - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - - // MEikListBoxObserver - - /** - * Listbox event handler. - * - * @param aListBox that invoked the event. - * @param aEventType Type of the event. - */ - virtual void HandleListBoxEventL( - CEikListBox* aListBox, - TListBoxEvent aEventType ); - - - TBool OkToExitL( TInt aButtonId ); - -private: // methods used internally - - /** - * Sets up status pane. - */ - void SetupStatusPaneL(); - - /** - * Updates status pane. - */ - void UpdateStatusPaneL(); - - /** - * Resets status pane. - */ - void ResetStatusPane(); - - /** - * Creates list box entries. - */ - void CreateListBoxEntriesL(); - - /** - * Creates list box icons. - */ - void CreateListBoxIconsL(); - - /** - * Creates given list box entry. - * - * @param aIndex Index of the list box entry. - */ - void CreateListBoxEntryL( TInt aIndex ); - - /** - * Updates given list box entry. - * - * @param aIndex List box entry index. - */ - void UpdateListBoxEntryL( TInt aIndex ); - - /** - * Loads navi text from resources. - * - * @return Navi text. - */ - void LoadNaviTextL(); - - /** - * Returns ETrue if there is at least one call action available. - * - * @return ETrue if there is at least one call action available. - */ - TBool CallActionsAvailable() const; - - /** - * Creates and initializes action menu. - */ - void InitializeActionMenuL(); - - /** - * Shows action menu and handles possible custom command. - */ - void ShowActionMenuL(); - - /** - * Calculates action menu position based on currently selected - * item. - * - * @return Action menu position. - */ - TFscContactActionMenuPosition GetActionMenuPosition(); - - /** - * Returns ETrue if action menu is available. - * - * @return ETrue if action menu is available. - */ - TBool ActionMenuAvailable() const; - - /** - * Creates and adds save as contact action to action menu. - */ - void CreateAndAddSaveAsContactActionL(); - - /** - * Returns ETrue if scrolling is in progress. - * - * Scrolling means that user is pressing up or down arrow so that - * it creates multiple key presses. - * - * @return ETrue if scrolling is enabled. - */ - TBool ScrollingInProgress() const; - - /** - * This method is called when scrolling has stopped. - */ - void ScrollingStoppedL(); - -private: // constructors - - /** - * Constructor. - * - * @param aIndex Index which user selected from the list (probably not used?) - * @param aArray Array of items. - * @param aCommand Command observer for observing menu commands. - * @param aContactItems Contact items to be shown on the dialog. - * @param aContactEngine Contact engine for creating pbk contact items. - * @param aActionService For executing menu commands. - * @param aContactSelectorEnabled Flag indicating whether RCL is in contact - * selector mode or not. - */ - CPbkxRclSearchResultDlg( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - RPointerArray& aContactItems, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled ); - - - /** - * Second-phase constructor. - * - * @param aNaviText Navi text to be displayed. - */ - void ConstructL(); - - /** - * Constructs menu bar. - * - * @param aResourceId - menubar resource id - */ - void ConstructMenuBarL( TInt aResourceId ); - -private: // data - - // Indexes of icon array. - enum TIconIndex - { - EActionMenuEnabled = 0 // Action menu enabled icon - }; - - // Contact engine. - CPbkContactEngine& iContactEngine; - - // Contact action service wrapper. Used to execute menu commands. - CPbkxRclActionServiceWrapper& iContactActionService; - - // Contact action menu for executing commands. Owned. - CFscContactActionMenu* iActionMenu; - - // Items. Not owned. - CDesCArray* iItems; - - // Navi pane of the current UI application. Not owned. - CAknNavigationControlContainer* iNaviPane; - - // Navigation label to be shown while result dialog is shown. Owned. - CAknNavigationDecorator* iNaviDecorator; - - // Contact items. Not owned. - RPointerArray& iContactItems; - - // Flag indicating if contact selector is enabled. - TBool iContactSelectorEnabled; - - // Flag indicating whether dialog should be closed after processing user command. - TBool iClose; - - // Selected item index. - TInt& iSelectedItemIndex; - - // Navigation label text. Owned. - RBuf iNaviText; - - // Icon for add recipient action menu item. Owned. - CGulIcon* iAddRecipientIcon; - - // Flag indicating whether save as contact action menu item is - // already added. - TBool iSaveAsAdded; - - // Set when dialog is exiting. After that no key presses are handled. - TBool iExit; - - // Flag indicating that up or down arrow is held down. - TBool iKeyDown; - - // Counter how many keypresses has occurred since key has been pressed - // down. - TInt iKeyCounter; - - //Fix for: PWAN-7MC7WA - //Flag indicating that CAS query was performed - TBool iIsScrollLaunched; - - //Fix for: PKAO-7NNCJ2 - //Flag indicating that info dialog is visible. Owned. - TBool iIsInfoDlgVisible; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchresultlistbox.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsearchresultlistbox.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchResultListBox. -* -*/ - - -#ifndef CPBKXRCLSEARCHRESULTLISTBOX_H -#define CPBKXRCLSEARCHRESULTLISTBOX_H - -#include -#include - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclSearchResultListBox -//////////////////////////////////////////////////////////////////////////// - -/** -* Listbox for search result dialog. -*/ -class CPbkxRclSearchResultListBox : public CAknSingleStyleListBox - { -public: // constructor and destructor - - /** - * Constructor. - */ - CPbkxRclSearchResultListBox(); - - /** - * Destructor. - */ - virtual ~CPbkxRclSearchResultListBox(); - -protected: // methods from base classes - - /** - * Creates item drawer for the listbox. - */ - virtual void CreateItemDrawerL(); - - /** - * Creates view for the listbox. - */ - virtual CListBoxView* MakeViewClassInstanceL(); - }; - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclSearchResultItemDrawer -//////////////////////////////////////////////////////////////////////////// - -/** -* Item drawer for search result listbox. -*/ -class CPbkxRclSearchResultItemDrawer : public CColumnListBoxItemDrawer - { -public: // constructor and destructor - - /** - * Constructor. - * - * @param aTextListBoxModel Listbox model. - * @param aFont Used font. - * @param aColumnData Data class. - */ - CPbkxRclSearchResultItemDrawer( - MTextListBoxModel* aTextListBoxModel, - const CFont* aFont, - CColumnListBoxData* aColumnData ); - - /** - * Destructor. - */ - virtual ~CPbkxRclSearchResultItemDrawer(); - -public: // new methods - - /** - * Sets highlighted text color. - * - * @param aColor Color. - */ - void SetHighlightColor( TRgb aColor ); - - /** - * Sets normal text color. - * - * @param aColor Color. - */ - void SetColor( TRgb aColor ); - - /** - * Reset color settings. - * - * @param aHighlightColor ETrue if highlight is reset, EFalse for normal. - */ - void ResetColors( TBool aHighlightColor = EFalse ); - -public: // from base classes - - /** - * Draws item text. - * - * @param aItemIndex Item index. - * @param aItemTextRect Item text rect. - * @param aItemIsCurrent - * @param aViewIsEmphasized - * @param aItemIsSelected - */ - virtual void DrawItemText( - TInt aItemIndex, - const TRect& aItemTextRect, - TBool aItemIsCurrent, - TBool aViewIsEmphasized, - TBool aItemIsSelected ) const; - -private: // data - - enum TColors - { - EColorSet = 0x1, - EHighlighColorSet = 0x2 - }; - - // Normal text color. - TRgb iColor; - - // Highlighted text color. - TRgb iHighlightColor; - - // Flag indicating that colors are set. - TInt iColorsSet; - - }; - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclSearchResultListView -//////////////////////////////////////////////////////////////////////////// - -/** -* View for search result listbox. -*/ -class CPbkxRclSearchResultListView: public CAknColumnListBoxView - { -protected: - // From CListBoxView - - /** - * Called when drawing empty list - * - * @param aClientRect Not used. - */ - void DrawEmptyList(const TRect &aClientRect) const; - }; -#endif - - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclserviceuicontextimpl.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclserviceuicontextimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,604 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclServiceUiContext -* -*/ - -#ifndef CPBKXRCLSERVICEUICONTEXTIMPL_H -#define CPBKXRCLSERVICEUICONTEXTIMPL_H - -#include "cpbkxremotecontactlookupserviceuicontext.h" -#include "tpbkxremotecontactlookupprotocolaccountid.h" -#include "mpbkxremotecontactlookupprotocolsessionobserver.h" -#include "mpbkxrclcontactretrieval.h" -#include "cpbkxrcleventscheduler.h" - -#include - -class CPbkxRclSearchResultDlg; -class CPbkxRclResultInfoDlg; -class CPbkxRemoteContactLookupProtocolSession; -class CCoeEnv; -class CPbkContactEngine; -class CPbkxRemoteContactLookupProtocolAdapter; -class CPbkxRclProtocolEnvImpl; -class CPbkxRemoteContactLookupProtocolAccount; -class CPbkxRclActionServiceWrapper; - -/** -* Implementation class of service ui context. -* -* This class implements the RCL search logic and UI flow. -* -* @lib pbkxrclengine.lib -* @since S60 3.1 -*/ - -class CPbkxRclServiceUiContextImpl : - public CPbkxRemoteContactLookupServiceUiContext, - public MPbkxRemoteContactLookupProtocolSessionObserver, - public MPbkxRclContactRetrieval, - public MPbkxRclEventHandler, - public MEikCommandObserver, - public MProgressDialogCallback - { - -public: // constructors and destructor - - /** - * Constructs new object. - * - * @param aId Acccount id. - * @param aMode Mode in which context operates. - * @return Created object. - */ - - static CPbkxRclServiceUiContextImpl* NewL( - TPbkxRemoteContactLookupProtocolAccountId aId, - TMode aMode ); - - /** - * Constructs new object. - * - * Constructed object is leaved in cleanup stack. - * - * @param aId Acccount id. - * @param aMode Mode in which context operates. - * @return Created object. - */ - static CPbkxRclServiceUiContextImpl* NewLC( - TPbkxRemoteContactLookupProtocolAccountId aId, - TMode aMode ); - - - /** - * Destructor. - */ - virtual ~CPbkxRclServiceUiContextImpl(); - - -public: // methods from CPbkxRemoteContactLookupServiceUiContext - - /** - * Execute UI flow. - * - * @param aQueryText loose query text - * @param aResult remote lookup results - */ - virtual void ExecuteL( const TDesC& aQueryText, TResult& aResult ); - - -public: // from MPbkxRemoteContactLookupProtocolSessionObserver - - /** - * Notifies that the loose search has been completed. - * - * @param aStatus error code that tells how search went - * @param aResults search results, ownership is moved to the caller of the - * loose search. - */ - - virtual void LooseSearchCompleted( - TInt aStatus, - RPointerArray& aResults ); - - /** - * Notifies that the contact fields retrieval has been completed. - * - * @param aStatus error code that tells how retrieval went - */ - - virtual void ContactFieldsRetrievalCompleted( TInt aStatus ); - -public: // from MPbkxRclContactRetrieval - - /** - * Retrieves details of the contact with given index. - * - * @param aContactIndex Index of the contact for which details are retrieved. - * @param aWaitNoteText Text shown in wait note. - * @return ContactCard with details retrieved or NULL. NULL is returned - * when either contact retrieval failed or user cancelled - * contact retrieval. - */ - - virtual CContactCard* RetrieveDetailsL( - TInt aContactIndex, - const TDesC& aWaitNoteText ); - - /** - * Returns the number of contacts. - * - * @return The number of contacts. - */ - - virtual TInt ContactCount() const; - - /** - * Sets the index of currently selected contact. - * - * @param aIndex Index of the currently selected contact. - */ - - virtual void SetSelectedContactL( TInt aIndex ); - -public: // from MPbkxRclEventHandler - - /** - * Callback method from event scheduler. - * - * Operation is executed each time this method is called. - */ - - virtual void EventTriggered(); - -public: // methods from MEikCommandObserver - - /** - * Processes command from search result view or result information view. - * - * @param aCommand Command id. - */ - - virtual void ProcessCommandL( TInt aCommandId ); - -public: // from MProgressDialogCallback - - /** - * This method is called when wait note closed by either user pressing - * cancel or dialog closed by code. - */ - virtual void DialogDismissedL( TInt aButtonId ); - -private: // enumerations used internally - - - // Possible operations for context. - - enum TOperation - { - ENoOperation, // No operation - EOpenSearchResultDlg, // Opens search result dialog - EOpenResultInfoDlg, // Opens result info dialog - ECloseSearchResultDlg, // Closes search result dialog - ECloseResultInfoDlg, // Closes result info dialog - EOpenSearchQueryDefault, // Opens default search query - EOpenSearchQueryEmpty, // Opens empty search query - EExecuteSearchWithNoQuery, // Executes search without prompting query - EExit // Stop context execution - }; - - // Possible state values for context. - - enum TState - { - EInitial = 0x1, // Initial state - EResultDlgOnTop = 0x2, // Result dialog topmost - EInfoDlgOnTop = 0x4, // Info dialog topmost - EResultSelected = 0x8, // Result is selected - EReturnToCaller = 0x10 // Return to the calling application - }; - - - // Wait object indexes. - - enum TWaitObjectIndex - { - EMainWait = 0, // Main wait loop. - EContactRetrievalWait = 1 // Contact retrieval wait loop - }; - -private: // methods used internally - - /** - * Executes search. - * - * @param aShowQueryDialog Flag indicating whether search query dialog is - * shown. - * @param aQueryText Default value for query text. - */ - - void ExecuteSearchL( TBool aShowQueryDialog, const TDesC& aQueryText ); - - /** - * Displays wait dialog. - * - * @param aDialogResourceId Dialog resource id. - * @param aText Text shown in wait dialog. - */ - - void DisplayWaitDialogL( TInt aDialogResourceId, const TDesC& aText ); - - /** - * Displays note dialog. - * - * @param aDialogResourceId Dialog resource id. - * @param aText Text shown in dialog. - * @param aTimeout Flag indicating whether note has timeout. - * @return Possible return value from note. - */ - - TBool DisplayNoteDialogL( - TInt aDialogResourceId, - const TDesC& aText, - TBool aTimeout = EFalse ); - - /** - * Displays query dialog. - * - * @param aDialogResourceId Dialog resource id. - * @param aText Text shown in dialog. - * @return Possible return value from note. - */ - //Fix for: EASV-7KFGG3 - TBool DisplayQueryDialogL( - TInt aDialogResourceId, - const TDesC& aText ); - - /** - * Closes wait dialog. - */ - - void CloseWaitDialogL(); - - /** - * Displays search result dialog. - */ - - void DisplaySearchResultDialogL(); - - /** - * Displays result info dialog. - */ - - void DisplayResultInfoDialogL(); - - - /** - * Creates contact card array. - * - * Contact items are casted to contact cards. - */ - - void CreateContactCardArray(); - - /** - * Does actions after loose search has been completed. - * - * @param aStatus Status returned from adapter. - * @param aResults Search results. - */ - - void DoLooseSearchCompletedL( - TInt aStatus, - RPointerArray& aResults ); - - - /** - * Does actions after contact field retrieval has been completed. - * - * @param aStatus Status received from adapter. - */ - - void DoContactFieldsRetrievalCompletedL( TInt aStatus ); - - - /** - * Executes operation. - */ - - void DoHandleOperationL(); - - - - /** - * Handles actions after search result dialog is closed based - * on state of the context. - */ - - void HandleSearchResultDialogExitL(); - - - /** - * This method is called when we are about to exit the context. - * - * Exit reason is set and possible error note is shown. - */ - - void HandleContextExitL(); - - - /** - * Creates new contact item of the selected contact item. - * - * Ownership is transferred. - * - * @return Selected contact item. - */ - - CContactItem* GetSelectedContactL(); - - - /** - * Searches for a result which corresponding contact item has given index. - * - * This method is needed because contact items are sorted and they are - * in different order as results. So we must find a result which contains - * the contact item with given index. - * - * Ownership is not transferred. - * - * @param aIndex Index of the contact item which result is searched. - * @return Protocol result. - */ - - CPbkxRemoteContactLookupProtocolResult* GetResultByIndex( TInt aIndex ); - - /** - * Starts active wait. - * - * Execution is halted until corresponding stop is called. - * - * @param aIndex Index of the wait object to be started. - */ - - void StartActiveWaitL( TWaitObjectIndex aIndex ); - - - /** - * Stops active wait with given index. - * - * @param aIndex Index of the wait object to be stopped. - */ - - void StopActiveWait( TWaitObjectIndex aIndex ); - - - /** - * Changes the state of the context. - * - * @param aState The state in which context is set. - */ - - void SetState( TState aState ); - - - /** - * Unsets state. - * - * @param aState State to be unset. - */ - - void UnsetState( TState aState ); - - - /** - * Returns ETrue if given state is set. - * - * @param aState State which status is checked. - * @return ETrue if context is in given state, EFalse otherwise. - */ - - TBool IsStateSet( TState aState ); - - - /** - * Resets all state flags of context. - */ - - void ResetState(); - - /** - * Adds new operation to be executed. - * - * @param aOperation Operation to be added. - */ - - void AddOperation( TOperation aOperation ); - - - /** - * Handles fatal error based on current state. - * - * @param aError Occurred error. - */ - - void HandleError( TInt aError ); - - - /** - * Sorts contacts based on last name. - */ - - static TInt Sort( const CContactCard& aFirst, const CContactCard& aSecond ); - - /** - * Static callback for CPeriodic timer - */ - static TInt TimerCallBack(TAny* aAny); - - /** - * This method is called in TimerCallBack() when time is out - */ - void TimeOut(); - -private: // constructors - - /** - * Constructors. - * - * @param aId Protocol account id. - * @param aMode Mode. - */ - - CPbkxRclServiceUiContextImpl( - TPbkxRemoteContactLookupProtocolAccountId aId, - TMode aMode ); - - /** - * Second-phase constructor. - */ - - void ConstructL(); - -private: // data structure used internally - - class TOperationQueue - { - public: // constructor - - /** - * Constructor. - */ - - TOperationQueue(); - - public: // new methods - - /** - * Adds new operation to queue. - * - * @param aOperation Operation to be added. - */ - - void Add( TOperation aOperation ); - - /** - * Pops operation to be executed from the queue. - * - * @return Operation to be executed. - */ - - TOperation Pop(); - - - /** - * Returns number of the operations in the queue. - */ - - TInt Count() const; - - private: // data - - // Maximum number of operations. - static const TInt KMaxOperations = 10; - - // Current operation index. - TInt iCurrent; - - // Count of operations. - TInt iCount; - - // Fixed size operation array. - TOperation iOperations[KMaxOperations]; - }; - - -private: // data - - // Account id. - TPbkxRemoteContactLookupProtocolAccountId iAccountId; - - // State in which context is in. - TInt iState; - - // Resource file offset. - TInt iResourceFileOffset; - - // Original query criteria given to context. Owned. - RBuf iQueryCriteria; - - // Query text given to execute. Owned. - RBuf iQueryText; - - // Search mode. - TMode iMode; - - // Selected contact index. - TInt iSelectedIndex; - - // For waiting asynchronous operations to finish. Owned. - RPointerArray iWaitObjects; - - // Wait dialog. Owned. - CAknWaitDialog* iWaitDialog; - - // Search result dialog. Owned. - CPbkxRclSearchResultDlg* iSearchResultDialog; - - // Result information dialog. Owned. - CPbkxRclResultInfoDlg* iResultInfoDialog; - - // Remote contact query results. Owned. - RPointerArray iSearchResults; - - // Contact cards from the results. Not owned. - RPointerArray iContactCards; - - // Adapter used in searches. Owned. - CPbkxRemoteContactLookupProtocolAdapter* iAdapter; - - // Session used to execute remote searches. Owned. - CPbkxRemoteContactLookupProtocolSession* iSession; - - // Protocol environment given to adapter. Owned. - CPbkxRclProtocolEnvImpl* iEnvImpl; - - // Account which is used. Owned. - CPbkxRemoteContactLookupProtocolAccount* iAccount; - - // Search result. Not owned. - TResult* iResult; - - // Contact engine used to help create phone book contact items. Owned. - CPbkContactEngine* iContactEngine; - - // Action service wrapper used by search result dialog and - // result information dialog. Owned. - CPbkxRclActionServiceWrapper* iActionServiceWrapper; - - // For generating timed events. Owned. - CPbkxRclEventScheduler* iEventScheduler; - - // Operation queue. - TOperationQueue iOperations; - - // Context exit code. If something goes wrong, this code is set. - TInt iExitCode; - - // Timer for generating time out event - CPeriodic* iTimer; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsettingitem.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsettingitem.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclResultI -* -*/ - - -#ifndef CPBKXRCLSETTINGITEM_H -#define CPBKXRCLSETTINGITEM_H - -#include - -class CPbkxRemoteContactLookupProtocolAccount; - -/** -* Class for showing RCL account selection setting item. -* -* Selected value is written to central repository. -*/ -class CPbkxRclSettingItem : public CAknEnumeratedTextPopupSettingItem - { -public: // constructor and destructor - - /** - * Creates new setting item. - * - * @return New setting item. - */ - static CPbkxRclSettingItem* NewL(); - - /** - * Creates new setting item. - * - * Created item is left on cleanup stack. - * - * @return New setting item. - */ - static CPbkxRclSettingItem* NewLC(); - - /** - * Destructor. - */ - virtual ~CPbkxRclSettingItem(); - -public: // virtual methods from base class - - /** - * @see CAknEnumeratedTextPopupSettingItem - */ - virtual void EditItemL( TBool aCalledFromMenu ); - -private: // methods used internally - - /** - * Creates all protocol adapters and asks all protocol accounts from - * each. - */ - void LoadProtocolAccountsL(); - - /** - * Initializes text arrays which are shown to the user. - */ - void FillTextArraysL(); - - /** - * Reads account information from central repository and sets the correct - * account as selected. - */ - void SetSelectedAccountL(); - - /** - * Stores selected account information to central repository. - */ - void StoreSettingL(); - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclSettingItem(); - - /** - * Second-phase constructor. - */ - void ConstructL(); - -private: // data - - // Selected item index. - TInt iSelectedItem; - - // Enumeration texts. Not owned. - CArrayPtr* iEnumTexts; - - // Popped up texts. Not owned. - CArrayPtr* iPoppedUpTexts; - - // Protocol accounts. Owned. - RPointerArray iProtocolAccounts; - - // Offset to resource file. - TInt iResourceFileOffset; - - }; - -#endif - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsettingsengine.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclsettingsengine.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSettingsEngine. -* -*/ - - -#ifndef CPBKXRCLSETTINGSENGINE_H -#define CPBKXRCLSETTINGSENGINE_H - -#include "mpbkxremotecontactlookupsettingsui.h" - -/** -* Provides functionality to store and retrieve settings. -* -* @lib pbkxrclengine.lib -* @since S60 3.1 -*/ -class CPbkxRclSettingsEngine : public CBase, public MPbkxRemoteContactLookupSettingsUi - { - -public: // Constructors and destructor - - /** - * Two-phased constructor. - * - * @return instance - */ - IMPORT_C static CPbkxRclSettingsEngine* NewL(); - - /** - * Two-phased constructor. - * - * Leaves a pointer to the created object on the cleanupstack. - * - * @return instance - */ - IMPORT_C static CPbkxRclSettingsEngine* NewLC(); - - /** - * Destructor. - */ - virtual ~CPbkxRclSettingsEngine(); - -private: // from MPbkxRemoteContactLookupSettingsUi - - /** - * Creates new protocol account selector setting item. - * - * @return Created setting item. - */ - CAknSettingItem* NewDefaultProtocolAccountSelectorSettingItemL() const; - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclSettingsEngine(); - - /** - * Second-phase constructor. - */ - void ConstructL(); - - }; - -#endif // CPBKXRCLSETTINGSENGINE_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxrclvcardsender.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxrclvcardsender.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclvCardSender. -* -*/ - - -#ifndef CPBKXRCLVCARDSENDER_H -#define CPBKXRCLVCARDSENDER_H - -#include - -class CPbkContactEngine; -class CPbkContactItem; -class CBCardEngine; -class CSendUi; -class CEikonEnv; -class CRichText; -class CPbkxRclContactConverter; - -/** -* Class that handles sending business card using CSendUI. -* -* @lib pbkxrclengine.lib -* @since 3.1 -*/ -class CPbkxRclvCardSender : public CBase - { -public: // constructor and destructor - - /** - * Creates new object. - * - * @param aContactEngine Handle to contact engine. - * @return Created object. - */ - static CPbkxRclvCardSender* NewL( CPbkContactEngine& aContactEngine ); - - /** - * Creates new object. - * - * Pointer to the created object is left in the cleanupstack. - * - * @param aContactEngine Handle to contact engine. - * @return Created object. - */ - static CPbkxRclvCardSender* NewLC( CPbkContactEngine& aContactEngine ); - - /** - * Destructor. - */ - virtual ~CPbkxRclvCardSender(); - -public: // new methods - - /** - * Send business card of the given contact item. - * - * @param aContactItem Contact item which is sent as business card. - */ - void SendvCardL( - CPbkContactItem& aContactItem, - CPbkxRclContactConverter& aContactConverter ); - -private: // methods used internally - - /** - * Creates temporary file of the contact item. - * - * @param aContactItem Contact item. - */ - void CreateTempFileL( - CPbkContactItem& aContactItem, - CPbkxRclContactConverter& aContactConverter ); - - /** - * Destroys temporary file. - */ - void DestroyTempFileL(); - - /** - * Creates rich text object of the temporary file. - * - * @return Created rich text object. Ownership is transferred. - */ - CRichText* CreateRichTextFromFileLC(); - - /** - * Creates filter. - */ - void CreateFilterL(); - - // getting temporary file name is not hard coded - /** - * Creates a temporary file name on device memory, in private - * folder of the process, which loads this dll. - * - * @param aFileName file name is returned here - * @return error code - */ - TInt GetTemporaryFileNameL( TFileName& aFileName, CPbkContactItem& aContactItem ); - // - -private: // constructors - - /** - * Constructor. - */ - CPbkxRclvCardSender(); - - /** - * Second-phase constructor. - * - * @param aContactEngine Handle to contact engine. - */ - void ConstructL( CPbkContactEngine& aContactEngine ); - -private: // data - - // Used to send the business card. Owned. - CSendUi* iSendUi; - - // Card engine. Owned. - CBCardEngine* iCardEngine; - - // Filter. Owned. - CArrayFixFlat* iFilter; - - // Eikon environment. Not owned. - CEikonEnv* iEikEnv; - // - // file name for temporary storage - TFileName iTempFileName; - // - - }; - -#endif - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocolaccount.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocolaccount.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupAccount -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPACCOUNT_H -#define CPBKXREMOTECONTACTLOOKUPACCOUNT_H - -#include -#include "tpbkxremotecontactlookupprotocolaccountid.h" - -/** - * Describes a protocol account that is used to identify and account to a - * remote server, which has a database of contacts. - * - * @since S60 3.1 - */ -class CPbkxRemoteContactLookupProtocolAccount : public CBase - { - -public: - - /** - * Returns protocol accounts identifier. - * - * @return account identifier - */ - virtual TPbkxRemoteContactLookupProtocolAccountId Id() const = 0; - - /** - * Returns protocol accounts name. - * - * @return account name - */ - virtual const TDesC& Name() const = 0; - }; - -#endif // CPBKXREMOTECONTACTLOOKUPACCOUNT_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocoladapter.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocoladapter.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupProtocolAdapter. -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPADAPTER_H -#define CPBKXREMOTECONTACTLOOKUPADAPTER_H - -#include -#include -#include "cpbkxremotecontactlookupprotocolaccount.h" -#include "cpbkxremotecontactlookupprotocolsession.h" -#include "mpbkxremotecontactlookupprotocolenv.h" - -/** -* Adaptation interface for different synchronization protocols. -* -* @since S60 3.1 -*/ -class CPbkxRemoteContactLookupProtocolAdapter : public CBase - { - -public: - - /** - * Two-phased constructor. - * - * @param aProtocolUid UID of the protocol ECom plugin - * @param aProtocolEnv factory for the data objects needed by the adapter - */ - static CPbkxRemoteContactLookupProtocolAdapter* NewL( - TUid aProtocolUid, - MPbkxRemoteContactLookupProtocolEnv& aProtocolEnv ); - - /** - * Destructor. - */ - virtual ~CPbkxRemoteContactLookupProtocolAdapter(); - - /** - * Factory method for creating protocol accounts. The creation of the account will - * be only succesful if protocol account for the given identifier exists. Ownership - * of the instance is given to the caller. - * - * @param aAccountId account identifier - * @return protocol account - */ - virtual CPbkxRemoteContactLookupProtocolAccount* NewProtocolAccountL( - const TPbkxRemoteContactLookupProtocolAccountId& aAccountId ) = 0; - - /** - * Appends all the available protocol accounts to the array. Owernship of the - * accounts is transfered to the caller. - * - * Given array MUST NOT be reset. - * - * @param aAccounts an array containing all the available protocol - * accounts. - */ - virtual void GetAllProtocolAccountsL( - RPointerArray& aAccounts ) = 0; - - /** - * Factory method for creating protocol sessions that are used to perform remote - * lookups. Owernship of the instance is given to the caller. - * - * @return protocol session - */ - virtual CPbkxRemoteContactLookupProtocolSession* NewSessionL() = 0; - -private: // data - - /** iDtor_ID_Key Instance identifier key. When instance of an - * implementation is created by ECOM framework, the - * framework will assign UID for it. The UID is used in - * destructor to notify framework that this instance is - * being destroyed and resources can be released. - */ - TUid iDtor_ID_Key; - }; - -#include "cpbkxremotecontactlookupprotocoladapter.inl" - -#endif // CPBKXREMOTECONTACTLOOKUPADAPTER_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocoladapter.inl --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocoladapter.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRemoteContactLookupProtocolAdapter -* -*/ - - -// ----------------------------------------------------------------------------- -// CPbkxRemoteContactLookupProtocolAdapter::NewL -// ----------------------------------------------------------------------------- -// -inline CPbkxRemoteContactLookupProtocolAdapter* CPbkxRemoteContactLookupProtocolAdapter::NewL( - TUid aProtocolUid, - MPbkxRemoteContactLookupProtocolEnv& aProtocolEnv ) - { - CPbkxRemoteContactLookupProtocolAdapter* self = NULL; - - TAny* interface = REComSession::CreateImplementationL ( - aProtocolUid, - _FOFF( CPbkxRemoteContactLookupProtocolAdapter, iDtor_ID_Key ), - &aProtocolEnv ); - - return reinterpret_cast< CPbkxRemoteContactLookupProtocolAdapter* >( interface ); - } - -// ----------------------------------------------------------------------------- -// CPbkxRemoteContactLookupProtocolAdapter::~CPbkxRemoteContactLookupProtocolAdapter -// ----------------------------------------------------------------------------- -// -inline CPbkxRemoteContactLookupProtocolAdapter::~CPbkxRemoteContactLookupProtocolAdapter() - { - REComSession::DestroyedImplementation( iDtor_ID_Key ); - } diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocolresult.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocolresult.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupProtocolResult. -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPPROTOCOLRESULT_H -#define CPBKXREMOTECONTACTLOOKUPPROTOCOLRESULT_H - -#include - -/** - * Results are returned through this interface. Results ownership is always - * transfered to the client so it must take care of deleting them. - * - * @since S60 3.1 - */ -class CPbkxRemoteContactLookupProtocolResult : public CBase - { - -public: - - /** - * Is the search result complete or do we need a second phase? - * - * @return ETrue if the search result is complete. - */ - virtual TBool IsComplete() const = 0; - - /** - * Sets result as complete. - * - * This means that result now contains all possible fields and no more - * fields can be retrieved. - */ - virtual void Complete() = 0; - - /** - * Returns extra protocol data need for mapping contact item to protocol - * level entries. - * - * @return extra protocol data - */ - virtual const TDesC& ExtraProtocolData() const = 0; - - /** - * Returns contact item. - * - * @return contact item - */ - virtual CContactItem& ContactItem() = 0; - }; - - -#endif // CPBKXREMOTECONTACTLOOKUPPROTOCOLRESULT_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocolsession.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupprotocolsession.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupProtocolSession. -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPPROTOCOLSESSION_H -#define CPBKXREMOTECONTACTLOOKUPPROTOCOLSESSION_H - -#include "cpbkxremotecontactlookupprotocolresult.h" -#include "mpbkxremotecontactlookupprotocolsessionobserver.h" -#include "tpbkxremotecontactlookupprotocolaccountid.h" - -/** - * Protocol session. - * - * @since S60 3.1 - */ -class CPbkxRemoteContactLookupProtocolSession : public CBase - { - -public: - - /** - * Initialize session search session. - * - * @param aObserver observer for the session - * @param aAccountId remote account that is searched - */ - virtual void InitializeL( - MPbkxRemoteContactLookupProtocolSessionObserver& aObserver, - const TPbkxRemoteContactLookupProtocolAccountId& aAccountId ) = 0; - - - /** - * Start loose search with given query. - * - * @param aQueryText query text - * @param aMaxMatches maximum number of matches - */ - virtual void LooseSearchL( const TDesC& aQueryText, TInt aMaxMatches ) = 0; - - /** - * Retrieves rest of the contact fields. Contact items in the results - * array are reused and new fields are just added to them. - * - * @param aResults set of results for which the - */ - virtual void RetrieveContactFieldsL( - RPointerArray& aResults ) = 0; - - /** - * Cancels either the search or detail retrieval process. - */ - virtual void Cancel() = 0; - }; - -#endif // CPBKXREMOTECONTACTLOOKUPPROTOCOLSESSION_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupserviceuicontext.h --- a/emailcontacts/remotecontactlookup/engine/inc/cpbkxremotecontactlookupserviceuicontext.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupServiceUiContext -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPSERVICEUICONTEXT_H -#define CPBKXREMOTECONTACTLOOKUPSERVICEUICONTEXT_H - -#include - -/** - * Execution context for Service UI. This class provides functionality to - * execute the actual UI flow of this service. - * - * @since S60 3.1 - */ -class CPbkxRemoteContactLookupServiceUiContext : public CBase - { - -public: - - /** Describes the mode in which the remote lookup is performed. */ - enum TMode - { - /** Normal mode - all the common contact actions are available. - Search query editor is displayed. - */ - EModeNormal, - - /* Like normal mode, but search query editor is not displayed. - In this mode, search query text must be given. - */ - EModeExistingCriteria, - - /** Contact selector mode - remote lookup is used to select contact - for the caller. - Search query editor is displayed. - */ - EModeContactSelector - }; - - class TResult - { - public: - - /** - * Possible exit reasons. - */ - enum TExitReason - { - EExitUndefined, // Undefined exit reason. This should never be returned. - EExitUserClosed, // User closed rcl without selecting anything. - EExitContactSelected, // User selected contact and rcl was closed. - EExitError, // RCL closed because of error. - EExitApplication // User selected exit from menu. Also calling application - // should exit when receiving this. - }; - - TResult() : iSelectedContactItem( NULL), iExitReason( EExitUndefined ) {} - - /** - * Selected contact item. - */ - CContactItem* iSelectedContactItem; - - /** - * Exit reason. - */ - TExitReason iExitReason; - }; - - /** - * Execute remote lookup UI flow. - * - * @param aQueryText loose query text - * @param aResult remote lookup results are populated here. - */ - virtual void ExecuteL( const TDesC& aQueryText, TResult& aResult ) = 0; - }; - -#endif // CPBKXREMOTECONTACTLOOKUPSERVICEUICONTEXT_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/engine.hrh --- a/emailcontacts/remotecontactlookup/engine/inc/engine.hrh Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for the engine. -* -*/ - - -#ifndef ENGINE_HRH -#define ENGINE_HRH - -enum TRclCommands - { - ERclCmdViewDetails = 1, - ERclCmdAddAsRecipient, - ERclCmdAddToContacts, - ERclCmdSaveToContacts, - ERclCmdNewSearch, - ERclCmdCall, - ERclCmdVoiceCall, - ERclCmdVideoCall, - ERclCmdVoip, - ERclCmdSend, - ERclCmdSendMsg, - ERclCmdSendBusinessCard, - ERclCmdSendAudioMsg, - ERclCmdSendEmail, - ERclCmdSendMeetingReq, - ERclCmdToContact, - ERclCmdSendCallbackReq, - ERclCmdUpdateExisting, - ERclCmdCreateNew, - ERclCmdTalk, - ERclCmdHelp - }; - -enum TListBoxType - { - ERclSearchResultListBox = 9, - ERclResultInfoListBox - }; - -#define KRclWaitDialogId 1001 - -#define KRclQueryTextMaxLength 40 - -#endif // ENGINE_HRH diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/mpbkxrclcontactretrieval.h --- a/emailcontacts/remotecontactlookup/engine/inc/mpbkxrclcontactretrieval.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class MPbkxRclContactRetrieval. -* -*/ - - -#ifndef MPBKXRCLCONTACTRETRIEVAL_H -#define MPBKXRCLCONTACTRETRIEVAL_H - -/** -* Class through which contact details can be updated. -*/ -class MPbkxRclContactRetrieval - { -public: // pure virtual methods - - /** - * Retrieves details of the contact with given index. - * - * @param aContactIndex Index of the contact for which details are retrieved. - * @param aWaitNoteText Text shown in wait note. - * @return ContactCard with details retrieved or NULL, if something went wrong. - */ - virtual CContactCard* RetrieveDetailsL( - TInt aContactIndex, - const TDesC& aWaitNoteText ) = 0; - - /** - * Returns the number of contacts. - * - * @return The number of contacts. - */ - virtual TInt ContactCount() const = 0; - - /** - * Sets the index of currently selected contact. - * - * @param aIndex Index of the currently selected contact. - */ - virtual void SetSelectedContactL( TInt aIndex ) = 0; - - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupprotocolenv.h --- a/emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupprotocolenv.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class MPbkxRemoteContactLookupProtocolEnv -* -*/ - - -#ifndef MPBKXREMOTECONTACTLOOKUPPROTOCOLENV_H -#define MPBKXREMOTECONTACTLOOKUPPROTOCOLENV_H - -#include -#include "cpbkxremotecontactlookupprotocolaccount.h" -#include "cpbkxremotecontactlookupprotocolresult.h" - -/** - * Interface to construct instances of classes needed by the protocol adaptation. - * - * @since S60 3.1 - */ -class MPbkxRemoteContactLookupProtocolEnv - { -public: - - /** - * Factory method to create a new protocol account instance. Ownership - * is given to the caller. - * - * @param aId protocol account identifier - * @param aName protocol account name - * - * @return protocol account - */ - virtual CPbkxRemoteContactLookupProtocolAccount* NewProtocolAccountL( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ) = 0; - - /** - * Factory method to create a new protocol result instance. Ownership is - * given to the caller. - * - * @param aIsComplete is search result complete? - * @param aContactItem contact item, owernship is transfered to this object - * @param aExtraProtocolData extra protocol data for two-phase search - * - * @return protocol result - */ - virtual CPbkxRemoteContactLookupProtocolResult* NewProtocolResultL( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ) = 0; - }; - -#endif // MPBKXREMOTECONTACTLOOKUPPROTOCOLENV_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupprotocolsessionobserver.h --- a/emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupprotocolsessionobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class MPbkxRemoteContactLookupProtocolSessionObserver. -* -*/ - - - -#ifndef MPBKXREMOTECONTACTLOOKUPPROTOCOLSESSIONOBSERVER_H -#define MPBKXREMOTECONTACTLOOKUPPROTOCOLSESSIONOBSERVER_H - -#include "cpbkxremotecontactlookupprotocolresult.h" - -/** - * Observer for the protocol adapter execution. - * - * @since S60 3.1 - */ -class MPbkxRemoteContactLookupProtocolSessionObserver - { - -public: - - /** - * Notifies that the loose search has been completed. - * - * @param aStatus error code that tells how search went - * @param aResults search results, ownership is moved to the caller of the - * loose search. - */ - virtual void LooseSearchCompleted( - TInt aStatus, - RPointerArray& aResults ) = 0; - - /** - * Notifies that the contact fields retrieval has been completed. - * - * @param aStatus error code that tells how retrieval went - */ - virtual void ContactFieldsRetrievalCompleted( TInt aStatus ) = 0; - }; - -#endif // MPBKXREMOTECONTACTLOOKUPPROTOCOLSESSIONOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupserviceui.h --- a/emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupserviceui.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Service UI interface definition -* -*/ - - -#ifndef MPBKXREMOTECONTACTLOOKUPSERVICEUI_H -#define MPBKXREMOTECONTACTLOOKUPSERVICEUI_H - -#include -#include -#include "cpbkxremotecontactlookupserviceuicontext.h" -#include "cpbkxremotecontactlookupprotocolaccount.h" -#include "tpbkxremotecontactlookupprotocolaccountid.h" - -/** - * Remote Contact Lookup Service UI API - * - * @since S60 3.1 - */ -class MPbkxRemoteContactLookupServiceUi - { - -public: - - /** - * Execution context construction parameters. - */ - class TContextParams - { - public: - /** Protocol account identifier */ - TPbkxRemoteContactLookupProtocolAccountId iProtocolAccountId; - - /** Execution mode */ - CPbkxRemoteContactLookupServiceUiContext::TMode iMode; - }; - - /** - * Returns default account identifier. - * - * @return default account identifier - */ - virtual TPbkxRemoteContactLookupProtocolAccountId DefaultAccountIdL() const = 0; - - /** - * Creates new account with given protocol account identifier. - * - * @param aProtocolAccountId protocol account ID. - * @return protocol account - */ - virtual CPbkxRemoteContactLookupProtocolAccount* NewAccountL( - const TPbkxRemoteContactLookupProtocolAccountId& aProtocolAccountId ) const = 0; - - /** - * Create new execution context. - * - * @param aParams construction parameters - * @return execution context - */ - virtual CPbkxRemoteContactLookupServiceUiContext* NewContextL( - TContextParams& aParams ) const = 0; - }; - -#endif // MPBKXREMOTECONTACTLOOKUPSERVICEUI_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupsettingsui.h --- a/emailcontacts/remotecontactlookup/engine/inc/mpbkxremotecontactlookupsettingsui.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Settings UI interface definition -* -*/ - - -#ifndef MPBKXREMOTECONTACTLOOKUPSETTINGSUI_H -#define MPBKXREMOTECONTACTLOOKUPSETTINGSUI_H - -#include -#include "cpbkxremotecontactlookupprotocolaccount.h" - -/** - * Remote Contact Lookup Settings UI interface definition. - * - * @since S60 3.1 - */ -class MPbkxRemoteContactLookupSettingsUi - { - -public: - - /** - * Create a setting item for selecting the default account. - * - * @return setting item - */ - virtual CAknSettingItem* NewDefaultProtocolAccountSelectorSettingItemL() const = 0; - }; - -#endif // MPBKXREMOTECONTACTLOOKUPSETTINGSUI_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/pbkxrclengineconstants.h --- a/emailcontacts/remotecontactlookup/engine/inc/pbkxrclengineconstants.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchEngine. -* -*/ - - -#ifndef PBKXRCLENGINECONSTANTS_H -#define PBKXRCLENGINECONSTANTS_H - -// engine resource file -_LIT( KResourceFile, "pbkxrclengine.rsc" ); - -// engine icon file -_LIT( KEngineIconFile, "pbkxrclengine.mif" ); - -// Max matches. -const TInt KMaxMatches = 50; - -// Default array granularity in RCL. -const TInt KArrayGranularity = 10; - -// Add recipient action menu icon. -// S60 UID update -#define KPbkxRclAddRecipientActionUid TUid::Uid( 0x2001FE14 ) -// S60 UID update - -// Add recipient action menu priority. -const TInt KPbkxRclAddRecipientPriority = KMaxTInt; - -// Path to avkon mif file. -// removing hard coded paths -_LIT( KAvkonMif, "avkon2.mif" ); -// - -// Unique identified to rcl setting item. -const TInt KPbkxRclSettingItemId = 0x53EF82CB; - -// Extra space in list box entry item because of inserted tabulators -const TInt KExtraSpaceInListboxEntry = 10; - -// Name format. -_LIT( KNameFormat, "%S %S" ); - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/pbkxrclengineuids.hrh --- a/emailcontacts/remotecontactlookup/engine/inc/pbkxrclengineuids.hrh Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: UID definition for remotecontactlookup engine pbkxrclengine.dll. -* -*/ -#ifndef PBKXRCLENGINEUIDS_HRH - -#define PBKXRCLENGINEUIDS_HRH - - - -// S60 UID update -#define KPbkxRclEngineUid 0x2001FE20 //Old FS 1.0 uid: 0x2000264F -// S60 UID update - - - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/pbkxrclsettings.hrh --- a/emailcontacts/remotecontactlookup/engine/inc/pbkxrclsettings.hrh Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Contains central repository related defines. -* -*/ - - -#ifndef PBKXREMOTECONTACTLOOKUPSETTINGS_HRH -#define PBKXREMOTECONTACTLOOKUPSETTINGS_HRH - -// S60 UID update -#define KPbkxRclCrUid 0x2001F3FE -// S60 UID update -#define KPbkxRclProtocolUidKey 1 -#define KPbkxRclAccountUidKey 2 - -#endif // PBKXREMOTECONTACTLOOKUPSETTINGS_HRH diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/pbkxrclutils.h --- a/emailcontacts/remotecontactlookup/engine/inc/pbkxrclutils.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class PbkxRclUtils. -* -*/ - - -#ifndef PBKXRCLUTILS_H -#define PBKXRCLUTILS_H - -#include -// -#include "tpbkxremotecontactlookupprotocolaccountid.h" -// - -class CPbkContactEngine; - -/** -* Class that offers static helper methods. -* -* @lib pbkxrclengine.lib -* @since S60 3.1 -*/ -class PbkxRclUtils - { -public: // static methods - - /** - * Returns text of the given field of the given contact. - * - * If there are multiple fields with given id, first one is returned. - * - * @param aItem Contact item which field text is asked. - * @param aId Field id. - * @return Text of the field or empty text if none is found. - */ - static HBufC* FieldTextL( const CPbkContactItem* aItem, TPbkFieldId aId ); - - /** - * Returns tet of the given field. - * - * @param aField Field which text is wanted. - * @return Field text. - */ - static HBufC* FieldTextL( TPbkContactItemField& aField ); - - /** - * Returns the text in the given field, if such field exists and it's type is - * text. - * - * If there are more than one fields with given type, the first one is returned. - * - * @param aCard Contact card. - * @param aFieldType Type of the field. - */ - static TPtrC FieldText( const CContactCard* aCard, TFieldType aFieldType ); - - /** - * Gets the default protocol account id. - * - * Leaves with KErrNotFound if default account id is not set. - */ - static TPbkxRemoteContactLookupProtocolAccountId DefaultProtocolAccountIdL(); - - /** - * Stores default protocol account id. - * - * @param aId Account id to be stored. - */ - static void StoreDefaultProtocolAccountIdL( - TPbkxRemoteContactLookupProtocolAccountId aId ); - - /** - * Returns ETrue if given text contains at least one alpha - * characters. - * - * @param aText Text to be investigated. - * @return ETrue if given text contains at least one alpha character. - */ - static TBool HasAlphaCharsInString( const TDesC& aText ); - - /** - * Creates new contact item of the given contact card. - * - * @param aCard Contact card. - * @param aEngine Contact engine. - * @return Created item. Ownership is transferred. - */ - static CPbkContactItem* CreateContactItemL( - CContactCard* aCard, - CPbkContactEngine& aEngine ); - - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/pbkxremotecontactlookupdebug.hrh --- a/emailcontacts/remotecontactlookup/engine/inc/pbkxremotecontactlookupdebug.hrh Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Defines for debug logging -* -*/ - - -#ifndef PBKXREMOTECONTACTLOOKUPDEBUG_HRH -#define PBKXREMOTECONTACTLOOKUPDEBUG_HRH - -#define PBKX_DEBUG_LEVEL 0 - -#endif // PBKXREMOTECONTACTLOOKUPDEBUG_HRH \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/pbkxremotecontactlookuppanic.h --- a/emailcontacts/remotecontactlookup/engine/inc/pbkxremotecontactlookuppanic.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Panic codes for the service -* -*/ - - - -#ifndef PBKXREMOTECONTACTLOOKUPPANIC_H -#define PBKXREMOTECONTACTLOOKUPPANIC_H - -#include - -enum TPbkxRemoteContactLookupPanic - { - EPbkxRclPanicGeneral = 1 - }; - -_LIT( KPbkxRclPanicText, "PBKXRCL" ); - -#define PbkxRclPanic( aReason ) User::Panic( KPbkxRclPanicText, (aReason) ) - -#endif // PBKXREMOTECONTACTLOOKUPPANIC_H \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/inc/tpbkxremotecontactlookupprotocolaccountid.h --- a/emailcontacts/remotecontactlookup/engine/inc/tpbkxremotecontactlookupprotocolaccountid.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class TPbkxRemoteContactLookupProtocolAccountId -* -*/ - - -#ifndef TPBKXREMOTECONTACTLOOKUPPROTOCOLACCOUNTID_H -#define TPBKXREMOTECONTACTLOOKUPPROTOCOLACCOUNTID_H - -#include - -/** - * Represents a protocol account identifier. - * - * @since S60 3.1 - */ -class TPbkxRemoteContactLookupProtocolAccountId - { - -public: - - /** - * Constructor. - * - * @param aProtocolUid protocol ECOM plugin identifier - * @param aAccountId account identifier - */ - TPbkxRemoteContactLookupProtocolAccountId( TUid aProtocolUid, TUint aAccountId ) - : iProtocolUid( aProtocolUid ), iAccountId( aAccountId ) {}; - - /** - * Protocol ECOM plugin identifier - */ - TUid iProtocolUid; - - /** - * Account identifier - */ - TUint iAccountId; - }; - -#endif // TPBKXREMOTECONTACTLOOKUPPROTOCOLACCOUNTID_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/loc/rclengine.loc --- a/emailcontacts/remotecontactlookup/engine/loc/rclengine.loc Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,247 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for project Remote Contact Lookup -* -*/ - - -// d:Search query editor prompt. -// d:%U stands for name of the account from which search is done. -// l:popup_query_data_window -// r:TB9.1 -#define qtn_rcl_search "Search from '%U'" - -// d:Wait note text while doing remote search. -// d:%U stands for the user entered search string. -// l:popup_note_wait_window -// r:TB9.1 -#define qtn_rcl_search_wait_note "Searching \"%U\"" - -// d:Wait note text while opening result information view. -// l:popup_note_wait_window -// r:TB9.1 -#define qtn_rcl_opening_wait_note "Opening details" - -// d:Wait note text while retrieving details before exiting RCL. -// l:popup_note_wait_window -// r:TB9.1 -#define qtn_rcl_retrieval_wait_note "Retrieving details" - -// d:Wait note text while retrieving details and saving contact. -// l:popup_note_wait_window -// r:TB9.1 -#define qtn_rcl_saving_wait_note "Saving contact" - -// d:Confirmation note shown to user when contact details is updated -// d:but there is already existing detail. -// d:%U stands for the name of the detail being replaced. -// l:popup_note_window -// r:TB9.1 -#define qtn_rcl_replace_existing_detail_note "Do you want to replace existing %U?" - -// d:Search result view navipane text. -// d:%N stands for the number of results found. -// l:navi_text_pane_t1 -// r:TB9.1 -#define qtn_rcl_result_navi "%N results" - -// d:Search result view navipane text when one result found. -// l:navi_text_pane_t1 -// r:TB9.1 -#define qtn_rcl_one_result_navi "1 result" - -// d:Result information view navipane text. -// d:%0N stands for the ordinal number of the result being shown. -// d:%1N stands for the total number of the results. -// l:navi_text_pane_t1 -// r:TB9.1 -#define qtn_rcl_info_navi "%0N/%1N" - -// d:Menu option view details. -// d:Opens result information view. -// l:list_single_pane_t1_cp2 -// r:TB9.1 -#define qtn_rcl_opt_details "View details" - -// d:Menu option add recipient. -// d:Return to the calling application with selected contact. -// l:list_single_pane_t1_cp2 -// r:TB9.1 -#define qtn_rcl_opt_add_recipient "Add as recipient" - -// d:Menu option add to contacts. -// d:Opens sub menu. -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -#define qtn_rcl_opt_add_contacts "Add to Contacts" - -// d:Menu option save to contacts. -// d:Saves selected contact in to contact database. -// l:list_single_pane_t1_cp2 -// r:TB9.1 -#define qtn_rcl_opt_save_contact "Save to contacts" - -// d:Menu option new search. -// d:Starts new remote search. -// l:list_single_pane_t1_cp2 -// r:TB9.1 -#define qtn_rcl_opt_new_search "New search" - -// d:Menu option call. -// d:Opens sub menu. -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -#define qtn_rcl_opt_call "Call" - -// d:Menu option send. -// d:Opens sub menu. -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -#define qtn_rcl_opt_send "Send" - -// d:Menu option talk. -// d:Opens sub menu. -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -#define qtn_rcl_opt_talk "Talk" - -// d:Menu option to contact. -// d:Part of Talk sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_talk_1to1 "To contact" - -// d:Menu option send callback request. -// d:Part of Talk sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_talk_cbr "Send callback request" - -// d:Menu option create new. -// d:Part of Save to contacts sub menu. -// d:Creates new contact to contacts database from selected contact. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_create_new "Create new" - -// d:Menu option update existing. -// d:Part of Save to contacts sub menu. -// d:Updates existing contact from selected contact data. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_update_existing "Update existing" - -// d:Menu option voice call. -// d:Part of Call sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_voice_call "Voice call" - -// d:Menu option Video call. -// d:Part of Call sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_video_call "Video call" - -// d:Menu option voip call. -// d:Part of Call sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_voip "Internet call" - -// d:Menu option message. -// d:Part of Send sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_msg "Message" - -// d:Menu option email. -// d:Part of Send sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_email "Email" - -// d:Menu option meeting request. -// d:Part of Send sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_mreq "Meeting request" - -// d:Menu option business card. -// d:Part of Send sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_bcard "Business card" - -// d:Menu option audio message. -// d:Part of Send sub menu. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -#define qtn_rcl_opt_audio "Audio message" - -// d:Softkey text. -// l:control_pane_t1 -// r:TB9.1 -#define qtn_rcl_softkey_search "Search" - -// d:Softkey text -// l:control_pane_t2 -// r:TB9.1 -#define qtn_rcl_softkey_refine "Refine" - -// d:No item text in search result view. -// d:Shown when search produced zero results. -// l:main_list_empty_pane -// r:TB9.1 -#define qtn_rcl_no_results "No results" - -// d:Too many results note text. -// d:Shown when remote search produced too many results. -// d:%N stands for the maximum number of results. -// l:popup_note_window -// r:TB9.1 -#define qtn_rcl_too_many_results_note "Too many search results, only %N can be displayed. Use refine to search again." - -// d:General RCL error note text. -// d:Shown when there is no better error message available from CTextResolver. -// l:popup_note_window -// r:TB9.1 -#define qtn_rcl_error_note "Remote contact lookup failed. Try again later." - -// d:Note text shown when contact information is updated. -// d:%0U stands for the name of the detail that is added -// d:%1U stands for the name of contact for which detail is added -// l:popup_note_window -// r:TB9.1 -#define qtn_rcl_update_note "%0U successfully added to %1U" - -// d:Action menu text for add as recipient action. -// l:fs_action_menu_text -// r:TB9.1 -#define qtn_fs_action_recipient "Add as recipient" - -// d:Heading for RCL account setting item. -// l:list_setting_pane_t1 -// r:TB9.1 -#define qtn_fs_setting_rcl_server "Remote Contact Lookup server" - -// d:Selection text for no account selection. -// l:list_set_graphic_pane_t1 -// r:TB9.1 -#define qtn_fs_setting_rcl_server_none "None" - -// d:Value shown in setting item when no account is defined. -// l:set_value_pane_t1 -// r:TB9.1 -#define qtn_fs_setting_rcl_not_defined "Not defined" diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclactionservicewrapper.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclactionservicewrapper.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,431 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchEngine. -* -*/ - - -#include "emailtrace.h" -#include -// -#include "cfsccontactactionservice.h" -#include "mfsccontactaction.h" -#include "fscactionpluginactionuids.h" - -#include "tfsccontactactionqueryresult.h" -// -#include -#include - -#include -#include -#include -#include -#include -#include -#include // for RFscStoreContactList items - -#include "cpbkxrclactionservicewrapper.h" -#include "pbkxrclengineconstants.h" -#include "cpbkxrclcontactconverter.h" - - -// Contact databases -_LIT(KRclDefaultCntDbURI, "cntdb://c:contacts.cdb"); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclActionServiceWrapper* CPbkxRclActionServiceWrapper::NewL( - CPbkContactEngine& aContactEngine ) - { - FUNC_LOG; - CPbkxRclActionServiceWrapper* wrapper = new ( ELeave ) - CPbkxRclActionServiceWrapper( aContactEngine ); - CleanupStack::PushL( wrapper ); - wrapper->ConstructL(); - CleanupStack::Pop( wrapper ); - return wrapper; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::CPbkxRclActionServiceWrapper -// --------------------------------------------------------------------------- -// -CPbkxRclActionServiceWrapper::CPbkxRclActionServiceWrapper( CPbkContactEngine& - aContactEngine ) : CBase(), iContactEngine( aContactEngine ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::~CPbkxRclActionServiceWrapper -// --------------------------------------------------------------------------- -// -CPbkxRclActionServiceWrapper::~CPbkxRclActionServiceWrapper() - { - FUNC_LOG; - - iConvertedContact.ResetAndDestroy(); - - if( iContactManager ) - { - if ( iContactStore ) - { - iContactStore->Close(*this); - } - } - delete iContactManager; - delete iContactActionService; - delete iContactConverter; - delete iWait; - - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::ConstructL() - { - FUNC_LOG; - // Create Contact Manager - CVPbkContactStoreUriArray* uriList = CVPbkContactStoreUriArray::NewLC(); - uriList->AppendL( TVPbkContactStoreUriPtr( KRclDefaultCntDbURI ) ); - iContactManager = CVPbkContactManager::NewL( *uriList, &(CCoeEnv::Static()->FsSession()) ); - CleanupStack::PopAndDestroy( uriList ); - - // Get store list - MVPbkContactStoreList& defaultstore = iContactManager->ContactStoresL(); - - // Open contact store - iContactStore = &defaultstore.At( 0 ); - iContactStore->OpenL( *this ); - - iContactActionService = CFscContactActionService::NewL( *iContactManager ); - - iContactConverter = CPbkxRclContactConverter::NewL( - iContactEngine, *iContactManager, *iContactStore ); - - iWait = new ( ELeave ) CActiveSchedulerWait(); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::SetContactSelectorMode -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::SetContactSelectorMode( - TBool aContactSelectorMode ) - { - FUNC_LOG; - iContactSelectorMode = aContactSelectorMode; - if ( aContactSelectorMode ) - { - // in contact selector mode the flags are static - - // all actions except save as is queried - iFlags = KFscAtMan & ( ~KFscAtManSaveAs ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::SetActionMenuMode -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::SetActionMenuMode( - TBool aActionMenuMode ) - { - FUNC_LOG; - // if not in contact selector mode, flags depend on whether - // we are showing the action menu or not - if ( !iContactSelectorMode ) - { - if ( aActionMenuMode ) - { - // in action menu mode poc and save as are disabled - iFlags = KFscAtAll & ( ~KFscAtComCallPoc ) & ( ~KFscAtManSaveAs ); - } - else - { - // when not in action menu mode, all actions but save as contact - // are enabled - iFlags = KFscAtAll & ( ~KFscAtManSaveAs ); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::SetCurrentContactL -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::SetCurrentContactL( CPbkContactItem* aContactItem ) - { - FUNC_LOG; - - iConvertedContact.ResetAndDestroy(); // clean before new use - - // Convert contact to MVPbkStoreContact object, only one item in - if ( aContactItem ) - { - iContactConverter->ConvertContactL( *aContactItem, iConvertedContact ); - } - - iContactActionService->SetContactSetL( iConvertedContact ); - - iSaveAsContactActionExists = EFalse; - - iQueryComplete = EFalse; - // first query for save as contact - iContactActionService->QueryActionsL( this, EFalse, KFscAtManSaveAs ); - - // Wait async operation callback. If operation is completed before returning method call - // don't start waiting - if (!iQueryComplete) - { - iWait->Start(); - } - - const CFscContactActionList& actions = iContactActionService->QueryResults(); - - // look for save as contact - for ( TInt i = 0; i < actions.Count(); i++ ) - { - const TFscContactActionQueryResult& result = actions[i]; - if ( result.iAction->Uid() == KFscActionUidSaveAsContact ) - { - iSaveAsContactResult = TFscContactActionQueryResult( - result.iAction, - result.iPriority, - result.iActionMenuVisibility, - result.iOptionsMenuVisibility ); - - iSaveAsContactActionExists = ETrue; - break; - } - } - - // Wait async operation callback. If operation is completed before returning method call - // don't start waiting - iQueryComplete = EFalse; - iContactActionService->QueryActionsL( this, EFalse, iFlags ); - if (!iQueryComplete) - { - iWait->Start(); - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::IsActionEnabled -// --------------------------------------------------------------------------- -// -TBool CPbkxRclActionServiceWrapper::IsActionEnabled( - const TUint64 aActionType ) const - { - FUNC_LOG; - TBool enabled = EFalse; - - const TFscContactActionQueryResult* result = GetResult( aActionType ); - - if ( result != NULL ) - { - enabled = ( result->iOptionsMenuVisibility.iVisibility == - TFscContactActionVisibility::EFscActionVisible && - result->iPriority >= 0 ); - } - - return enabled; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ExecuteActionL -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::ExecuteActionL( const TUint64 aActionType ) - { - FUNC_LOG; - const TFscContactActionQueryResult* result = GetResult( aActionType ); - - if ( result == NULL ) - { - User::Leave( KErrNotFound ); - } - iExecuteComplete = EFalse; - iContactActionService->ExecuteL( result->iAction->Uid(), this ); - // Wait async operation callback. If operation is completed before returning method call - // don't start waiting - if (!iExecuteComplete) - { - iWait->Start(); - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ActionService -// --------------------------------------------------------------------------- -// -CFscContactActionService* CPbkxRclActionServiceWrapper::ActionService() - { - FUNC_LOG; - return iContactActionService; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::GetResult -// --------------------------------------------------------------------------- -// -const TFscContactActionQueryResult* CPbkxRclActionServiceWrapper::GetResult( - const TUint64 aType ) const - { - FUNC_LOG; - if ( iSaveAsContactActionExists && aType == iSaveAsContactResult.iAction->Type() ) - { - return &iSaveAsContactResult; - } - else - { - const CFscContactActionList& actions = iContactActionService->QueryResults(); - - for ( TInt i = 0; i < actions.Count(); i++ ) - { - const TFscContactActionQueryResult& queryResult = actions[i]; - if ( queryResult.iAction->Type() == aType ) - { - return &queryResult; - } - } - } - return NULL; - } -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ContactConverter -// --------------------------------------------------------------------------- -// -CPbkxRclContactConverter* CPbkxRclActionServiceWrapper::ContactConverter() - { - FUNC_LOG; - return iContactConverter; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::StoreReady -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::StoreReady( - MVPbkContactStore& /* aContactStore */ ) - { - FUNC_LOG; - iLastError = KErrNone; - } -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::StoreUnavailable() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::StoreUnavailable( - MVPbkContactStore& /* aContactStore */, - TInt aReason ) - { - FUNC_LOG; - iLastError = aReason; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::HandleStoreEventL() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::HandleStoreEventL( - MVPbkContactStore& /* aContactStore */, - TVPbkContactStoreEvent /* aStoreEvent */ ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::QueryActionsComplete() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::QueryActionsComplete() - { - FUNC_LOG; - iLastError = KErrNone; - iQueryComplete = ETrue; - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::QueryActionsFailed() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::QueryActionsFailed( TInt aError ) - { - FUNC_LOG; - iLastError = aError; - iQueryComplete = ETrue; - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ExecuteComplete() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::ExecuteComplete() - { - FUNC_LOG; - iLastError = KErrNone; - iExecuteComplete = ETrue; - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ExecuteFailed() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::ExecuteFailed( TInt aError ) - { - FUNC_LOG; - iLastError = aError; - iExecuteComplete = ETrue; - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclActionServiceWrapper::ExecuteFailed() -// --------------------------------------------------------------------------- -// -void CPbkxRclActionServiceWrapper::CancelQuery() - { - FUNC_LOG; - iContactActionService->CancelQueryActions(); - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclbasedlg.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclbasedlg.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,336 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclBaseDlg. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include - -#include "cpbkxrclbasedlg.h" -#include "cpbkxrclsearchresultlistbox.h" -#include "cpbkxrclresultinfolistbox.h" -#include "cpbkxrclsearchresultlistbox.h" -#include "cpbkxrclresultinfolistbox.h" -#include "engine.hrh" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::CPbkxRclBaseDlg -// --------------------------------------------------------------------------- -// -CPbkxRclBaseDlg::CPbkxRclBaseDlg( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - TBool aColumnListBox ) : - CAknSelectionListDialog( aIndex, aArray, aCommand ), - iListItemId( KAknsIIDQgnFsGrafContactsContent ), - iListBottomId( KAknsIIDQsnBgColumnA ), - iHighlightId( KAknsIIDQgnFsList ), - iHighlightCenterId( KAknsIIDQgnFsListCenter ), - iHighlightTextColorId( KAknsIIDFsHighlightColors ), - iTextColorId( KAknsIIDFsTextColors ), - iColumnListBox( aColumnListBox ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclBaseDlg::ConstructL( TInt aResourceId ) - { - FUNC_LOG; - CAknDialog::ConstructL( aResourceId ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::~CPbkxRclBaseDlg -// --------------------------------------------------------------------------- -// -CPbkxRclBaseDlg::~CPbkxRclBaseDlg() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::HandleResourceChange -// --------------------------------------------------------------------------- -// -void CPbkxRclBaseDlg::HandleResourceChange( TInt aType ) - { - FUNC_LOG; - CEikDialog::HandleResourceChange( aType ); - if ( aType == KAknsMessageSkinChange ) - { - UpdateGraphics(); - UpdateColors(); - } - else if ( aType == KEikMessageColorSchemeChange ) - { - UpdateColors(); - } - else if ( aType == KEikDynamicLayoutVariantSwitch ) - { - - // for some reason formatted cell listbox loses settings - // when layout is switched - if ( !iColumnListBox ) - { - UpdateGraphics(); - UpdateColors(); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::IsAcceptableListBoxType -// --------------------------------------------------------------------------- -// -TBool CPbkxRclBaseDlg::IsAcceptableListBoxType( - TInt aControlType, - TBool& aIsFormattedCellList ) const - { - FUNC_LOG; - if ( aControlType == ERclSearchResultListBox ) - { - aIsFormattedCellList = EFalse; - return ETrue; - } - else if ( aControlType == ERclResultInfoListBox ) - { - aIsFormattedCellList = ETrue; - return ETrue; - } - else - { - return CAknSelectionListDialog::IsAcceptableListBoxType( - aControlType, - aIsFormattedCellList ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::CreateCustomControlL -// --------------------------------------------------------------------------- -// -SEikControlInfo CPbkxRclBaseDlg::CreateCustomControlL( TInt aControlType ) - { - FUNC_LOG; - if ( aControlType == ERclSearchResultListBox ) - { - CCoeControl* control = new ( ELeave ) CPbkxRclSearchResultListBox(); - SEikControlInfo info = { control, 0, 0 }; - return info; - } - else if ( aControlType == ERclResultInfoListBox ) - { - CCoeControl* control = new ( ELeave ) CPbkxRclResultInfoListBox(); - SEikControlInfo info = { control, 0, 0 }; - return info; - } - else - { - return CAknSelectionListDialog::CreateCustomControlL( aControlType ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::UpdateGraphics -// --------------------------------------------------------------------------- -// -void CPbkxRclBaseDlg::UpdateGraphics() - { - FUNC_LOG; - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - CAknsListBoxBackgroundControlContext* bgContext = NULL; - CFormattedCellListBoxItemDrawer* fItemDrawer = NULL; - CColumnListBoxItemDrawer* cItemDrawer = NULL; - - // set first to this value, then change if those are not found - iHighlightId = KAknsIIDQgnFsList; - iHighlightCenterId = KAknsIIDQgnFsListCenter; - - if ( iColumnListBox ) - { - CEikColumnListBox* listBox = - static_cast( ListBox() ); - cItemDrawer = listBox->ItemDrawer(); - bgContext = - static_cast( - cItemDrawer->ColumnData()->SkinBackgroundContext() ); - } - else - { - CEikFormattedCellListBox* listBox = - static_cast( ListBox() ); - fItemDrawer = listBox->ItemDrawer(); - bgContext = - static_cast( - fItemDrawer->FormattedCellData()->SkinBackgroundContext() ); - } - - if ( skin->GetCachedItemData( iListItemId ) ) - { - bgContext->SetBitmap( iListItemId ); - bgContext->SetTiledBitmap( iListItemId ); - } - - if ( skin->GetCachedItemData( iListBottomId ) ) - { - bgContext->SetBottomBitmap( iListBottomId ); - } - - if ( skin->GetCachedItemData( iHighlightId ) && - skin->GetCachedItemData( iHighlightCenterId ) ) - { - if ( iColumnListBox ) - { - cItemDrawer->ColumnData()->SetSkinHighlightFrame( - &iHighlightId, - &iHighlightCenterId ); - } - else - { - fItemDrawer->FormattedCellData()->SetSkinHighlightFrame( - &iHighlightId, - &iHighlightCenterId ); - } - } - else - { - // put defaults if fs specific items are not found - iHighlightId = KAknsIIDQsnFrList; - iHighlightCenterId = KAknsIIDQsnFrListCenter; - if ( iColumnListBox ) - { - cItemDrawer->ColumnData()->SetSkinHighlightFrame( - &iHighlightId, - &iHighlightCenterId ); - } - else - { - fItemDrawer->FormattedCellData()->SetSkinHighlightFrame( - &iHighlightId, - &iHighlightCenterId ); - } - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclBaseDlg::UpdateColors -// --------------------------------------------------------------------------- -// -void CPbkxRclBaseDlg::UpdateColors() - { - FUNC_LOG; - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - CPbkxRclResultInfoItemDrawer* fItemDrawer = NULL; - CPbkxRclSearchResultItemDrawer* cItemDrawer = NULL; - - if ( iColumnListBox ) - { - CEikColumnListBox* listBox = - static_cast( ListBox() ); - cItemDrawer = static_cast( - listBox->ItemDrawer() ); - } - else - { - CEikFormattedCellListBox* listBox = - static_cast( ListBox() ); - fItemDrawer = static_cast( - listBox->ItemDrawer() ); - } - - TRgb newColor; - - // highlight text color - TInt error = AknsUtils::GetCachedColor( - skin, - newColor, - iHighlightTextColorId, - EAknsCIFsHighlightColorsCG1 ); - - - if ( error == KErrNone ) - { - if ( iColumnListBox ) - { - cItemDrawer->SetHighlightColor( newColor ); - } - else - { - fItemDrawer->SetHighlightColor( newColor ); - } - } - else - { - if ( iColumnListBox ) - { - cItemDrawer->ResetColors( ETrue ); - } - else - { - fItemDrawer->ResetColors( ETrue ); - } - } - - // text color - error = AknsUtils::GetCachedColor( - skin, - newColor, - iTextColorId, - EAknsCIFsTextColorsCG7 ); - - - if ( error == KErrNone ) - { - if ( iColumnListBox ) - { - cItemDrawer->SetColor( newColor ); - } - else - { - fItemDrawer->SetColor( newColor ); - } - } - else - { - if ( iColumnListBox ) - { - cItemDrawer->ResetColors(); - } - else - { - fItemDrawer->ResetColors(); - } - } - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclcbrsender.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclcbrsender.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclCbRSender. - -* -*/ - - - - -#include "emailtrace.h" -#include - -#include - -#include - -#include - -#include - - - -#include "cpbkxrclcbrsender.h" - -#include "pbkxrclutils.h" - -#include "pbkxrclengineuids.hrh" - - - -// ======== MEMBER FUNCTIONS ======== - - - -// --------------------------------------------------------------------------- - -// CPbkxRclCbRSender::NewL - -// --------------------------------------------------------------------------- - -// - -CPbkxRclCbRSender* CPbkxRclCbRSender::NewL() - - { - FUNC_LOG; - CPbkxRclCbRSender* sender = CPbkxRclCbRSender::NewLC(); - - CleanupStack::Pop( sender ); - - return sender; - - } - - - -// --------------------------------------------------------------------------- - -// CPbkxRclCbRSender::NewLC - -// --------------------------------------------------------------------------- - -// - -CPbkxRclCbRSender* CPbkxRclCbRSender::NewLC() - - { - FUNC_LOG; - CPbkxRclCbRSender* sender = new ( ELeave ) CPbkxRclCbRSender(); - - CleanupStack::PushL( sender ); - - sender->ConstructL(); - - return sender; - - } - - - -// --------------------------------------------------------------------------- - -// CPbkxRclCbRSender::CPbkxRclCbRSender - -// --------------------------------------------------------------------------- - -// - -CPbkxRclCbRSender::CPbkxRclCbRSender() : CBase() - - { - FUNC_LOG; - } - - - -// --------------------------------------------------------------------------- - -// CPbkxRclCbRSender::~CPbkxRclCbRSender - -// --------------------------------------------------------------------------- - -// - -CPbkxRclCbRSender::~CPbkxRclCbRSender() - - { - FUNC_LOG; - delete iServiceHandler; - - } - - - -// --------------------------------------------------------------------------- - -// CPbkxRclCbRSender::ConstructL - -// --------------------------------------------------------------------------- - -// - -void CPbkxRclCbRSender::ConstructL() - - { - FUNC_LOG; - iServiceHandler = CAiwServiceHandler::NewL(); - - iServiceHandler->AttachL( R_RCL_POC_INTEREST ); - - } - - - -// --------------------------------------------------------------------------- - -// CPbkxRclCbRSender::SendCallbackRequestL - -// --------------------------------------------------------------------------- - -// - -void CPbkxRclCbRSender::SendCallbackRequestL( CPbkContactItem& aContactItem ) - - { - FUNC_LOG; - - - // check for PTT settings - - HBufC* ptt = PbkxRclUtils::FieldTextL( &aContactItem, EPbkFieldIdPushToTalk ); - - if ( ptt == NULL ) - - { - - User::Leave( KErrNotSupported ); - - } - - else - - { - - CleanupStack::PushL( ptt ); - - } - - - - CAiwGenericParamList& params = iServiceHandler->InParamListL(); - - TAiwPocParameterData pocParameter; - - pocParameter.iConsumerAppUid = TUid::Uid( KPbkxRclEngineUid ); - - pocParameter.iConsumerWindowGroup = - - CCoeEnv::Static()->RootWin().Identifier(); - - - - pocParameter.iCommandId = EAiwPoCCmdSendCallBackRequest; - - - - TAiwGenericParam param = TAiwGenericParam( - - EGenericParamPoCData, - - TAiwVariant( TAiwPocParameterDataPckg( pocParameter ) ) ); - - params.AppendL(param); - - - - TAiwGenericParam addressParam = TAiwGenericParam( - - EGenericParamSIPAddress, - - TAiwVariant( *ptt ) ); - - - - params.AppendL( addressParam ); - - - - iServiceHandler->ExecuteServiceCmdL( - - KAiwCmdPoC, - - params, - - iServiceHandler->OutParamListL(), - - 0, - - NULL ); - - - - CleanupStack::PopAndDestroy( ptt ); - - - - } - - - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclcontactconverter.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclcontactconverter.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Converting CPbkContactItem to MVPbkStoreContact -* -*/ - -#include "emailtrace.h" -#include // CActiveSchedulerWait -#include -#include // Old VCard engine -#include // Memory based streams -#include // Stream -#include // Old phonebook contact engine -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cpbkxrclcontactconverter.h" - -const TInt KGranularitySize = 128; // "Granularity" of dynamic buffer - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter::CPbkxRclContactConverter() -// --------------------------------------------------------------------------- -// -CPbkxRclContactConverter::CPbkxRclContactConverter( - CPbkContactEngine& aContactEngine, - CVPbkContactManager& aContactManager, - MVPbkContactStore& aContactStore ): - iContactEngine( aContactEngine ), - iContactManager( aContactManager ), - iContactStore( aContactStore ) - { - FUNC_LOG; - // No implementation required - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CPbkxRclContactConverter::~CPbkxRclContactConverter() - { - FUNC_LOG; - delete iCardEngine; - delete iVPbkCardEngine; - delete iWait; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter* CPbkxRclContactConverter::NewLC() -// --------------------------------------------------------------------------- -// -CPbkxRclContactConverter* CPbkxRclContactConverter::NewLC( - CPbkContactEngine& aContactEngine, - CVPbkContactManager& aContactManager, - MVPbkContactStore& aContactStore ) - { - FUNC_LOG; - CPbkxRclContactConverter* self = new (ELeave)CPbkxRclContactConverter( - aContactEngine, aContactManager, aContactStore ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter* CPbkxRclContactConverter::NewL() -// --------------------------------------------------------------------------- -// -CPbkxRclContactConverter* CPbkxRclContactConverter::NewL( - CPbkContactEngine& aContactEngine, - CVPbkContactManager& aContactManager, - MVPbkContactStore& aContactStore ) - { - FUNC_LOG; - CPbkxRclContactConverter* self = CPbkxRclContactConverter::NewLC( - aContactEngine, aContactManager, aContactStore ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter::ConstructL() -// --------------------------------------------------------------------------- -// -void CPbkxRclContactConverter::ConstructL() - { - FUNC_LOG; - // Crete Old VCard engine - iCardEngine = CBCardEngine::NewL( &iContactEngine ); - - // New Virtual Phonebook VCard engine - iVPbkCardEngine = CVPbkVCardEng::NewL( iContactManager ); - - iWait = new ( ELeave ) CActiveSchedulerWait(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter::ConvertContactL() -// --------------------------------------------------------------------------- -// -void CPbkxRclContactConverter::ConvertContactL( - CPbkContactItem& aContactItem, - RFscStoreContactList& aConvertedContact ) - { - FUNC_LOG; - CBufFlat* buf = CBufFlat::NewL(KGranularitySize); - RBufWriteStream bufWriteStream; - bufWriteStream.Open(*buf); - CleanupClosePushL(bufWriteStream); - - // Export ContactCard (ContactItem ) to VCard. Sync operation. - iCardEngine->ExportBusinessCardL( bufWriteStream, aContactItem ); - - CleanupStack::PopAndDestroy( &bufWriteStream ); - - // Create ReadStrem for VPbk VCard engine and associate it with received buf - RBufReadStream bufReadStream; - bufReadStream.Open(*buf); - CleanupClosePushL(bufReadStream); - - // Pass new ReadStream for VPbk VCard engine and receive MVPbkStoreContact object - MVPbkContactOperationBase* oper = iVPbkCardEngine->ImportVCardL( - aConvertedContact, - iContactStore, - bufReadStream, - *this ); - CleanupDeletePushL( oper ); - - // Now wait until async ready - if ( !(iWait->IsStarted()) ) - { - iWait->Start(); - } - - CleanupStack::PopAndDestroy(2, &bufReadStream); // bufReadStream, oper - delete buf; - } -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter::ConvertAndExportContactL() -// --------------------------------------------------------------------------- -// -void CPbkxRclContactConverter::ConvertAndExportContactL( - CPbkContactItem& aContactItem, - RWriteStream& aStream ) - { - FUNC_LOG; - RFscStoreContactList convertedContact; - CleanupClosePushL( convertedContact ); - - ConvertContactL( aContactItem, convertedContact ); - CleanupDeletePushL( convertedContact[0] ); - - MVPbkContactOperationBase* oper = iVPbkCardEngine->ExportVCardL( - aStream, - *convertedContact[0], - *this); - CleanupDeletePushL( oper ); - // Now wait until async ready - iWait->Start(); - - CleanupStack::PopAndDestroy(3, &convertedContact ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter::VPbkSingleContactOperationComplete() -// --------------------------------------------------------------------------- -// -void CPbkxRclContactConverter::VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& /*aOperation*/, - MVPbkStoreContact* /* aContact */ ) - { - FUNC_LOG; - // The aContact in the call back is always NULL. - iLastError = KErrNone; - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactConverter::VPbkSingleContactOperationFailed() -// --------------------------------------------------------------------------- -// -void CPbkxRclContactConverter::VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& /*aOperation*/, TInt aError ) - { - FUNC_LOG; - iLastError = aError; - if (iWait->IsStarted()) - { - iWait->AsyncStop(); - } - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclcontactupdater.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclcontactupdater.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,327 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclContactUpdater. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cpbkxrclcontactupdater.h" -#include "pbkxrclutils.h" -#include "pbkxrclengineconstants.h" -#include "pbkxremotecontactlookuppanic.h" - -// Local constants -_LIT(KPbkRomFileDrive, "z:"); -_LIT(KPbkViewResourceFile, "PbkView.rsc"); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclContactUpdater* CPbkxRclContactUpdater::NewL( - CPbkContactEngine& aEngine ) - { - FUNC_LOG; - CPbkxRclContactUpdater* updater = CPbkxRclContactUpdater::NewLC( aEngine ); - CleanupStack::Pop( updater ); - return updater; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclContactUpdater* CPbkxRclContactUpdater::NewLC( - CPbkContactEngine& aEngine ) - { - FUNC_LOG; - CPbkxRclContactUpdater* updater = - new ( ELeave ) CPbkxRclContactUpdater( aEngine ); - CleanupStack::PushL( updater ); - updater->ConstructL(); - return updater; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::CPbkxRclContactUpdater -// --------------------------------------------------------------------------- -// -CPbkxRclContactUpdater::CPbkxRclContactUpdater( CPbkContactEngine& aEngine ) : - CBase(), iEngine( aEngine ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::~CPbkxRclContactUpdater -// --------------------------------------------------------------------------- -// -CPbkxRclContactUpdater::~CPbkxRclContactUpdater() - { - FUNC_LOG; - CCoeEnv::Static()->DeleteResourceFile( iResourceFileOffset ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclContactUpdater::ConstructL() - { - FUNC_LOG; - - // First load Phonebook resource file so that dialog will find resources - CCoeEnv* coeEnv = CCoeEnv::Static(); - TFileName resourceFile; - resourceFile.Copy( KPbkRomFileDrive ); - resourceFile.Append( KDC_RESOURCE_FILES_DIR ); - resourceFile.Append( KPbkViewResourceFile ); - - BaflUtils::NearestLanguageFile( coeEnv->FsSession(), resourceFile ); - - TRAPD( status, - iResourceFileOffset = coeEnv->AddResourceFileL( resourceFile ) ); - - if( status != KErrNone ) - { - PbkxRclPanic( EPbkxRclPanicGeneral ); - } - else - { - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::UpdateContactL -// --------------------------------------------------------------------------- -// -HBufC* CPbkxRclContactUpdater::UpdateContactL( TPbkContactItemField& aField ) - { - FUNC_LOG; - - // first ask user to select the contact in which the field is added - CPbkSingleEntryFetchDlg::TParams params; - params.iContactView = &iEngine.AllContactsView(); - - CPbkSingleEntryFetchDlg* fetchDlg = CPbkSingleEntryFetchDlg::NewL( params ); - fetchDlg->ResetWhenDestroyed( &fetchDlg ); - TInt res = 0; - res = fetchDlg->ExecuteLD(); - - CPbkContactItem* contactItem = NULL; - HBufC* text = NULL; - if ( res != 0 && params.iSelectedEntry != KNullContactId ) - { - contactItem = iEngine.OpenContactL( params.iSelectedEntry ); - CleanupStack::PushL( contactItem ); - - CPbkFieldInfo& fieldInfo = aField.FieldInfo(); - TPbkContactItemField* field = NULL; - if ( fieldInfo.Multiplicity() == EPbkFieldMultiplicityOne ) - { - // there can be only one field of this type. query user to select - // a field in which data is to be saved - field = SelectUpdatedFieldL( *contactItem, fieldInfo ); - } - else - { - // add new field to contact - field = &( contactItem->AddFieldL( aField.FieldInfo() ) ); - } - - if ( field != NULL ) - { - if ( field->StorageType() == KStorageTypeText ) - { - field->TextStorage()->SetTextL( aField.Text() ); - } - else if ( field->StorageType() == KStorageTypeDateTime ) - { - field->DateTimeStorage()->SetTime( aField.Time() ); - } - iEngine.CommitContactL( *contactItem ); - // build string returned to the caller - text = ConstructUpdatedTextL( *contactItem, *field ); - } - else - { - iEngine.CloseContactL( contactItem->Id() ); - } - - CleanupStack::PopAndDestroy( contactItem ); - } - return text; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::SelectUpdatedFieldL -// --------------------------------------------------------------------------- -// -TPbkContactItemField* CPbkxRclContactUpdater::SelectUpdatedFieldL( - CPbkContactItem& aContactItem, - CPbkFieldInfo& aFieldInfo ) - { - FUNC_LOG; - TPbkContactItemField* retField = NULL; - TInt fieldCount = 0; - CPbkFieldInfo* info = SelectFieldL( aFieldInfo, fieldCount ); - while ( info != NULL && retField == NULL ) - { - retField = aContactItem.AddOrReturnUnusedFieldL( *info ); - // iterate until user selects field or cancels - if ( retField == NULL ) - { - // there is already given field. ask user if it is ok to replace - // existing data - HBufC* dlgText = StringLoader::LoadLC( - R_QTN_RCL_REPLACE_EXISTING_DETAIL_NOTE, - info->FieldName() ); - CAknNoteDialog* dialog = new ( ELeave ) CAknNoteDialog(); - dialog->PrepareLC( R_RCL_CONFIRMATION_NOTE_YES_CANCEL ); - dialog->SetTextL( *dlgText ); - - if ( dialog->RunLD() ) - { - retField = aContactItem.FindField( *info ); - } - else - { - // user cancelled dialog - if ( fieldCount > 1 ) - { - // show select field dialog again - info = SelectFieldL( aFieldInfo, fieldCount ); - } - else - { - // exit the loop because user refused to update existing - // field and there are no other choices for the fields - // to be updated - info = NULL; - } - } - CleanupStack::PopAndDestroy( dlgText ); - } - } - return retField; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::ConstructUpdatedTextL -// --------------------------------------------------------------------------- -// -HBufC* CPbkxRclContactUpdater::ConstructUpdatedTextL( - CPbkContactItem& aContactItem, - TPbkContactItemField& aField ) - { - FUNC_LOG; - - HBufC* firstName = PbkxRclUtils::FieldTextL( - &aContactItem, - EPbkFieldIdFirstName ); - CleanupStack::PushL( firstName ); - - HBufC* lastName = PbkxRclUtils::FieldTextL( - &aContactItem, - EPbkFieldIdLastName ); - CleanupStack::PushL( lastName ); - - RBuf name; - CleanupClosePushL( name ); - // +1 comes for the space in the format - name.CreateL( firstName->Length() + lastName->Length() + 1 ); - - name.Format( KNameFormat, firstName, lastName ); - - CDesCArrayFlat* textArray = - new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - CleanupStack::PushL( textArray ); - textArray->AppendL( aField.FieldInfo().FieldName() ); - textArray->AppendL( name ); - - HBufC* text = StringLoader::LoadL( - R_QTN_RCL_UPDATE_NOTE, - *textArray ); - - CleanupStack::PopAndDestroy( textArray ); - CleanupStack::PopAndDestroy( &name ); - CleanupStack::PopAndDestroy( lastName ); - CleanupStack::PopAndDestroy( firstName ); - - return text; - } - -// --------------------------------------------------------------------------- -// CPbkxRclContactUpdater::SelectFieldL -// --------------------------------------------------------------------------- -// -CPbkFieldInfo* CPbkxRclContactUpdater::SelectFieldL( - CPbkFieldInfo& aFieldInfo, - TInt& aFieldCount ) - { - FUNC_LOG; - // construct possible field types - const CPbkFieldsInfo& fields = iEngine.FieldsInfo(); - CArrayPtrFlat* fieldArray = - new ( ELeave ) CArrayPtrFlat( KArrayGranularity ); - CleanupStack::PushL( fieldArray ); - - TPbkFieldLocation locs[] = { - EPbkFieldLocationNone, - EPbkFieldLocationHome, - EPbkFieldLocationWork }; - - TInt locCount = sizeof( locs ) / sizeof( TPbkFieldLocation ); - - for ( TInt i = 0; i < locCount; i++ ) - { - CPbkFieldInfo* field = fields.Find( aFieldInfo.FieldId(), locs[i] ); - if ( field != NULL ) - { - fieldArray->AppendL( field ); - } - } - - aFieldCount = fieldArray->Count(); - CPbkFieldInfo* retField = NULL; - if ( fieldArray->Count() == 1 ) - { - retField = ( *fieldArray )[0]; - } - else - { - CPbkItemTypeSelectAddToExisting* selectionDlg = - new ( ELeave ) CPbkItemTypeSelectAddToExisting(); - retField = selectionDlg->ExecuteLD( *fieldArray ); - } - CleanupStack::PopAndDestroy( fieldArray ); - return retField; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrcleventscheduler.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrcleventscheduler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclServiceUiContextImpl. -* -*/ - - -#include "emailtrace.h" -#include "cpbkxrcleventscheduler.h" - -const TInt KDelay = 1; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclEventScheduler::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclEventScheduler* CPbkxRclEventScheduler::NewL( MPbkxRclEventHandler& aHandler ) - { - FUNC_LOG; - CPbkxRclEventScheduler* scheduler = new ( ELeave ) CPbkxRclEventScheduler( aHandler ); - CleanupStack::PushL( scheduler ); - scheduler->ConstructL(); - CleanupStack::Pop( scheduler ); - return scheduler; - } - -// --------------------------------------------------------------------------- -// CPbkxRclEventScheduler::CPbkxRclEventScheduler -// --------------------------------------------------------------------------- -// -CPbkxRclEventScheduler::CPbkxRclEventScheduler( MPbkxRclEventHandler& aHandler ) : - CActive( EPriorityStandard ), iEventHandler( aHandler ) - { - FUNC_LOG; - } - -CPbkxRclEventScheduler::~CPbkxRclEventScheduler() - { - FUNC_LOG; - Cancel(); - iTimer.Close(); - } - -void CPbkxRclEventScheduler::ConstructL() - { - FUNC_LOG; - CActiveScheduler::Add( this ); - User::LeaveIfError( iTimer.CreateLocal() ); - } - -void CPbkxRclEventScheduler::TriggerEvent() - { - FUNC_LOG; - if ( !IsActive() ) - { - iTimer.After( iStatus, TTimeIntervalMicroSeconds32( KDelay ) ); - SetActive(); - } - } - -void CPbkxRclEventScheduler::RunL() - { - FUNC_LOG; - if ( iStatus.Int() == KErrNone ) - { - iEventHandler.EventTriggered(); - } - } - -void CPbkxRclEventScheduler::DoCancel() - { - FUNC_LOG; - iTimer.Cancel(); - } - - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclprotocolaccountimpl.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclprotocolaccountimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclProtocolAccountImpl. -* -*/ - - -#include "emailtrace.h" -#include "cpbkxrclprotocolaccountimpl.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolAccountImpl* CPbkxRclProtocolAccountImpl::NewL( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ) - { - FUNC_LOG; - CPbkxRclProtocolAccountImpl* account = CPbkxRclProtocolAccountImpl::NewLC( aId, aName ); - CleanupStack::Pop( account ); - return account; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolAccountImpl* CPbkxRclProtocolAccountImpl::NewLC( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ) - { - FUNC_LOG; - CPbkxRclProtocolAccountImpl* account = new ( ELeave ) CPbkxRclProtocolAccountImpl( aId ); - CleanupStack::PushL( account ); - account->ConstructL( aName ); - return account; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::CPbkxRclProtocolAccountImpl -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolAccountImpl::CPbkxRclProtocolAccountImpl( - TPbkxRemoteContactLookupProtocolAccountId aId ) : iId( aId ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::~CPbkxRclProtocolAccountImpl -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolAccountImpl::~CPbkxRclProtocolAccountImpl() - { - FUNC_LOG; - iName.Close(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclProtocolAccountImpl::ConstructL( const TDesC& aName ) - { - FUNC_LOG; - iName.CreateL( aName ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::Id -// --------------------------------------------------------------------------- -// -TPbkxRemoteContactLookupProtocolAccountId CPbkxRclProtocolAccountImpl::Id() const - { - FUNC_LOG; - return iId; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolAccountImpl::Name -// --------------------------------------------------------------------------- -// -const TDesC& CPbkxRclProtocolAccountImpl::Name() const - { - FUNC_LOG; - return iName; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclprotocolenvimpl.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclprotocolenvimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclProtocolEnvImpl. -* -*/ - - -#include "emailtrace.h" -#include "cpbkxrclprotocolenvimpl.h" -#include "cpbkxrclprotocolresultimpl.h" -#include "cpbkxrclprotocolaccountimpl.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolEnvImpl* CPbkxRclProtocolEnvImpl::NewL() - { - FUNC_LOG; - CPbkxRclProtocolEnvImpl* env = CPbkxRclProtocolEnvImpl::NewLC(); - CleanupStack::Pop( env ); - return env; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolEnvImpl* CPbkxRclProtocolEnvImpl::NewLC() - { - FUNC_LOG; - CPbkxRclProtocolEnvImpl* env = new ( ELeave ) CPbkxRclProtocolEnvImpl(); - CleanupStack::PushL( env ); - env->ConstructL(); - return env; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::CPbkxRclProtocolEnvImpl -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolEnvImpl::CPbkxRclProtocolEnvImpl() : CBase() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::~CPbkxRclProtocolEnvImpl -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolEnvImpl::~CPbkxRclProtocolEnvImpl() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclProtocolEnvImpl::ConstructL() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::NewProtocolAccountL -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupProtocolAccount* CPbkxRclProtocolEnvImpl::NewProtocolAccountL( - TPbkxRemoteContactLookupProtocolAccountId aId, - const TDesC& aName ) - { - FUNC_LOG; - CPbkxRclProtocolAccountImpl* account = CPbkxRclProtocolAccountImpl::NewL( aId, aName ); - return account; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolEnvImpl::NewProtocolResultL -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupProtocolResult* CPbkxRclProtocolEnvImpl::NewProtocolResultL( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ) - { - FUNC_LOG; - CPbkxRclProtocolResultImpl* result = CPbkxRclProtocolResultImpl::NewL( - aIsComplete, - aContactItem, - aExtraProtocolData ); - return result; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclprotocolresultimpl.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclprotocolresultimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclProtocolResultImpl. -* -*/ - - -#include "emailtrace.h" -#include "cpbkxrclprotocolresultimpl.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolResultImpl* CPbkxRclProtocolResultImpl::NewL( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ) - { - FUNC_LOG; - CPbkxRclProtocolResultImpl* result = CPbkxRclProtocolResultImpl::NewLC( - aIsComplete, - aContactItem, - aExtraProtocolData ); - CleanupStack::Pop( result ); - return result; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolResultImpl* CPbkxRclProtocolResultImpl::NewLC( - TBool aIsComplete, - CContactItem& aContactItem, - const TDesC& aExtraProtocolData ) - { - FUNC_LOG; - CPbkxRclProtocolResultImpl* result = new ( ELeave ) CPbkxRclProtocolResultImpl( - aIsComplete, - aContactItem ); - CleanupStack::PushL( result ); - result->ConstructL( aExtraProtocolData ); - return result; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::CPbkxRclProtocolResultImpl -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolResultImpl::CPbkxRclProtocolResultImpl( - TBool aIsComplete, - CContactItem& aContactItem ) : iIsComplete( aIsComplete ), iContactItem( &aContactItem ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::~CPbkxRclProtocolResultImpl -// --------------------------------------------------------------------------- -// -CPbkxRclProtocolResultImpl::~CPbkxRclProtocolResultImpl() - { - FUNC_LOG; - delete iContactItem; - iExtraProtocolData.Close(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclProtocolResultImpl::ConstructL( const TDesC& aExtraProtocolData ) - { - FUNC_LOG; - iExtraProtocolData.CreateL( aExtraProtocolData ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::IsComplete -// --------------------------------------------------------------------------- -// -TBool CPbkxRclProtocolResultImpl::IsComplete() const - { - FUNC_LOG; - return iIsComplete; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::Complete -// --------------------------------------------------------------------------- -// -void CPbkxRclProtocolResultImpl::Complete() - { - FUNC_LOG; - iIsComplete = ETrue; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::ExtraProtocolData -// --------------------------------------------------------------------------- -// -const TDesC& CPbkxRclProtocolResultImpl::ExtraProtocolData() const - { - FUNC_LOG; - return iExtraProtocolData; - } - -// --------------------------------------------------------------------------- -// CPbkxRclProtocolResultImpl::ContactItem -// --------------------------------------------------------------------------- -// -CContactItem& CPbkxRclProtocolResultImpl::ContactItem() - { - FUNC_LOG; - return *iContactItem; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclqueryeditor.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclqueryeditor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclQueryEditor. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include - -#include "pbkxremotecontactlookuppanic.h" -#include "cpbkxrclqueryeditor.h" -#include "pbkxrclengineconstants.h" -#include "pbkxrclutils.h" -#include "engine.hrh" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclQueryEditor::CPbkxRclQueryEditor -// --------------------------------------------------------------------------- -// -CPbkxRclQueryEditor::CPbkxRclQueryEditor( TDes& aQueryText ) : - CAknTextQueryDialog( aQueryText ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclQueryEditor::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclQueryEditor::ConstructL( const TDesC& aAccountName ) - { - FUNC_LOG; - - PrepareLC( R_RCL_QUERY_DIALOG ); - - HBufC* promptBuf = StringLoader::LoadLC( R_QTN_RCL_SEARCH, aAccountName ); - SetPromptL( *promptBuf ); - CleanupStack::PopAndDestroy( promptBuf ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclQueryEditor::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclQueryEditor* CPbkxRclQueryEditor::NewL( - const TDesC& aAccountName, - TDes& aQueryText ) - { - FUNC_LOG; - CPbkxRclQueryEditor* self = new ( ELeave ) CPbkxRclQueryEditor( aQueryText ); - CleanupStack::PushL( self ); - self->ConstructL( aAccountName ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclQueryEditor::~CPbkxRclQueryEditor -// --------------------------------------------------------------------------- -// -CPbkxRclQueryEditor::~CPbkxRclQueryEditor() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclQueryEditor::ExecuteDialogLD -// --------------------------------------------------------------------------- -// -TBool CPbkxRclQueryEditor::ExecuteDialogLD() - { - FUNC_LOG; - - SetEditorInputModeL(); - TInt ret = CAknQueryDialog::RunLD(); - return ( TBool )ret; - } - -// --------------------------------------------------------------------------- -// CPbkxRclQueryEditor::SetEditorInputModeL -// --------------------------------------------------------------------------- -// -void CPbkxRclQueryEditor::SetEditorInputModeL() - { - FUNC_LOG; - - CAknQueryControl* control = QueryControl(); - CEikEdwin* edwin = static_cast( - control->ControlByLayoutOrNull( EDataLayout ) ); - - User::LeaveIfNull( edwin ); - - TDes& text = Text(); - - TCoeInputCapabilities inputCapabilities( edwin->InputCapabilities() ); - if ( inputCapabilities.FepAwareTextEditor() - && inputCapabilities.FepAwareTextEditor()->Extension1() ) - { - CAknEdwinState* state = static_cast( - inputCapabilities.FepAwareTextEditor()->Extension1()->State( - KNullUid ) ); - - if ( text == KNullDesC || - PbkxRclUtils::HasAlphaCharsInString( text ) ) - { - state->SetCurrentInputMode( EAknEditorTextInputMode ); - } - else - { - state->SetCurrentInputMode( EAknEditorNumericInputMode ); - } - } - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclresultinfodlg.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclresultinfodlg.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,808 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclResultInfoDlg. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // MEikListBoxObserver - -// -#include - -#include "cpbkxrclresultinfodlg.h" -#include "cpbkxrclcbrsender.h" -#include "cpbkxrclvcardsender.h" -#include "cpbkxrclactionservicewrapper.h" -#include "mpbkxrclcontactretrieval.h" -#include "cpbkxrclcontactupdater.h" -#include "pbkxrclutils.h" -#include "pbkxrclengineconstants.h" -#include "engine.hrh" - -#include "fsccontactactionservicedefines.h" -// - -// S60 UID update -const TInt KPbkxRemoteContactLookupServiceImplImpUid = 0x2001FE0D; -// S60 UID update - -// list box field format -_LIT( KFieldFormat, "\t%S\t%S" ); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::CPbkxRclResultInfoDlg -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoDlg::CPbkxRclResultInfoDlg( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - MPbkxRclContactRetrieval* aContactRetrieval, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled, - TInt aActiveItemIndex ) : - CPbkxRclBaseDlg( aIndex, aArray, aCommand, EFalse ), iItems( aArray ), - iActiveTabIndex( aActiveItemIndex ), - iContactSelectorEnabled( aContactSelectorEnabled ), - iContactRetrieval( aContactRetrieval ), iContactEngine( aContactEngine ), - iContactActionService( aActionService ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::ConstructL() - { - FUNC_LOG; - - CPbkxRclBaseDlg::ConstructL( R_RCL_RESULT_INFO_DIALOG_MENU_BAR ); - - HBufC* text = StringLoader::LoadLC( R_QTN_RCL_OPENING_WAIT_NOTE ); - iWaitNoteText.CreateL( *text ); - CleanupStack::PopAndDestroy( text ); - - iCallbackReqSender = CPbkxRclCbRSender::NewL(); - - iVisibleFields = new ( ELeave ) CPbkFieldArray; - - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoDlg* CPbkxRclResultInfoDlg::NewL( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - MPbkxRclContactRetrieval* aContactRetrieval, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled, - TInt aActiveItemIndex ) - { - FUNC_LOG; - - CPbkxRclResultInfoDlg* self = new( ELeave ) CPbkxRclResultInfoDlg( - aIndex, - aArray, - aCommand, - aContactRetrieval, - aContactEngine, - aActionService, - aContactSelectorEnabled, - aActiveItemIndex ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::~CPbkxRclResultInfoDlg -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoDlg::~CPbkxRclResultInfoDlg() - { - FUNC_LOG; - ResetStatusPane(); - delete iCurrentContact; - iWaitNoteText.Close(); - delete iTitlePaneText; - delete iCallbackReqSender; - delete iVisibleFields; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::DynInitMenuPaneL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - FUNC_LOG; - - if ( aResourceId == R_RCL_RESULT_INFO_DIALOG_MENU_PANE ) - { - - if ( !iContactSelectorEnabled ) - { - aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); - - aMenuPane->SetItemDimmed( - ERclCmdCall, - !CallActionsAvailable() ); - - // send menu is always available, since business card can - // always be sent - } - else - { - aMenuPane->SetItemDimmed( ERclCmdCall, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdSend, ETrue ); - } - - // talk menu is shown if we have PTT enabled - aMenuPane->SetItemDimmed( - ERclCmdTalk, - !iContactActionService.IsActionEnabled( KFscAtComCallPoc ) ); - - } - else if ( aResourceId == R_RCL_ADD_TO_CONTACTS_MENU_PANE ) - { - - aMenuPane->SetItemDimmed( - ERclCmdCreateNew, - !iContactActionService.IsActionEnabled( KFscAtManSaveAs ) ); - - } - else if ( aResourceId == R_RCL_CALL_MENU_PANE ) - { - - aMenuPane->SetItemDimmed( - ERclCmdVoiceCall, - !iContactActionService.IsActionEnabled( KFscAtComCallGSM ) ); - - aMenuPane->SetItemDimmed( - ERclCmdVideoCall, - !iContactActionService.IsActionEnabled( KFscAtComCallVideo ) ); - - aMenuPane->SetItemDimmed( - ERclCmdVoip, - !iContactActionService.IsActionEnabled( KFscAtComCallVoip ) ); - - } - else if ( aResourceId == R_RCL_TALK_MENU_PANE ) - { - // PTT settings available, no need to hide items - } - else if ( aResourceId == R_RCL_SEND_MENU_PANE ) - { - aMenuPane->SetItemDimmed( - ERclCmdSendMsg, - !iContactActionService.IsActionEnabled( KFscAtComSendMsg ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendEmail, - !iContactActionService.IsActionEnabled( KFscAtComSendEmail ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendMeetingReq, - !iContactActionService.IsActionEnabled( KFscAtComSendCalReq ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendAudioMsg, - !iContactActionService.IsActionEnabled( KFscAtComSendAudio ) ); - - } - else if ( aResourceId == R_RCL_CONTEXT_SEND_MENU_PANE ) - { - aMenuPane->SetItemDimmed( - ERclCmdSendMsg, - ( !( FocusOnPhoneNumberField() || FocusOnEmailAddressField() ) || - !iContactActionService.IsActionEnabled( KFscAtComSendMsg ) ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendEmail, - ( !FocusOnEmailAddressField() || - !iContactActionService.IsActionEnabled( KFscAtComSendEmail ) ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendMeetingReq, - ( !FocusOnEmailAddressField() || - !iContactActionService.IsActionEnabled( KFscAtComSendCalReq ) ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendAudioMsg, - ( !( FocusOnPhoneNumberField() || FocusOnEmailAddressField() ) || - !iContactActionService.IsActionEnabled(KFscAtComSendAudio ) ) ); - - } - else if ( aResourceId == R_RCL_RESULT_INFO_DIALOG_CONTEXT_MENU_PANE ) - { - if ( !iContactSelectorEnabled ) - { - aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); - - aMenuPane->SetItemDimmed( - ERclCmdCall, - !( FocusOnPhoneNumberField() || FocusOnVoipField() ) ); - - // send menu is always visible, because business card can always - // be sent - } - else - { - aMenuPane->SetItemDimmed( ERclCmdCall, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdSend, ETrue ); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::GetHelpContext -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - FUNC_LOG; - aContext.iMajor = TUid::Uid( KPbkxRemoteContactLookupServiceImplImpUid ); - aContext.iContext = KRLOOK_HLP_INFO_VIEW; - } - -// ---------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::HandleListBoxEventL() -// ---------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::HandleListBoxEventL( - CEikListBox* /* aListBox */, - TListBoxEvent aEventType ) - { - FUNC_LOG; - switch ( aEventType ) - { - case EEventEnterKeyPressed: - case EEventItemClicked: - case EEventItemActioned: - { - break; - } - - case EEventItemDoubleClicked: - { - // open context sensitive menu - iMenuBar->TryDisplayContextMenuBarL(); - break; - } - - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CPbkxRclResultInfoDlg::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - FUNC_LOG; - - if ( iExit || aType != EEventKey ) - { - return EKeyWasConsumed; - } - - switch ( aKeyEvent.iCode ) - { - case EKeyOK: - { - // open context sensitive menu - iMenuBar->TryDisplayContextMenuBarL(); - } - break; - case EKeyUpArrow: // fall through, same functionality - case EKeyDownArrow: - { - CAknSelectionListDialog::OfferKeyEventL( aKeyEvent, aType ); - } - break; - case EKeyRightArrow: - { - TInt oldIndex = iActiveTabIndex; - iActiveTabIndex = ( iActiveTabIndex + 1 ) % iTabGroup->TabCount(); - - if ( FetchCurrentContactL() ) - { - UpdateDialogL(); - } - else - { - iActiveTabIndex = oldIndex; - } - } - break; - case EKeyLeftArrow: - { - TInt oldIndex = iActiveTabIndex; - if ( iActiveTabIndex > 0 ) - { - iActiveTabIndex--; - } - else - { - iActiveTabIndex = iTabGroup->TabCount() - 1; - } - - if ( FetchCurrentContactL() ) - { - UpdateDialogL(); - } - else - { - iActiveTabIndex = oldIndex; - } - } - break; - case EKeyEscape: - { - // exit application - iExit = ETrue; - ProcessCommandL( EAknCmdExit ); - } - break; - default: - break; - } - return EKeyWasConsumed; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::OkToExitL -// --------------------------------------------------------------------------- -// -TBool CPbkxRclResultInfoDlg::OkToExitL( TInt aButtonId ) - { - FUNC_LOG; - if( aButtonId == EAknSoftkeyContextOptions ) - { - iMenuBar->TryDisplayContextMenuBarL(); - return EFalse; - } - else - { - return CAknDialog::OkToExitL( aButtonId ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::ExecuteLD -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::ExecuteLD() - { - FUNC_LOG; - - // if current contact cannot be fetched, result info dialog is not opened - if ( !FetchCurrentContactL() ) - { - delete this; - return; - } - - PrepareLC( R_RCL_RESULT_INFO_DIALOG ); - - UpdateGraphics(); - UpdateColors(); - - iMenuBar->SetContextMenuTitleResourceId( - R_RCL_RESULT_INFO_DIALOG_CONTEXT_MENU_BAR ); - - SetupStatusPaneL(); - - CreateListBoxEntriesL(); - CAknSelectionListDialog::RunLD(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::Close -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::Close() - { - FUNC_LOG; - // this will not leave, because TryExitL doesn't call leaving methods - // when EAknSoftkeyCancel is used - iExit = ETrue; - TRAP_IGNORE( TryExitL( EAknSoftkeyCancel ) ); // - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::SendCallbackRequestL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::SendCallbackRequestL() - { - FUNC_LOG; - iCallbackReqSender->SendCallbackRequestL( *iCurrentContact ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::SendBusinessCardL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::SendBusinessCardL() - { - FUNC_LOG; - CPbkxRclvCardSender* sender = CPbkxRclvCardSender::NewLC( iContactEngine ); - sender->SendvCardL( *iCurrentContact, *(iContactActionService.ContactConverter()) ); - CleanupStack::PopAndDestroy( sender ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::UpdateExistingContactL -// --------------------------------------------------------------------------- -// -HBufC* CPbkxRclResultInfoDlg::UpdateExistingContactL() - { - FUNC_LOG; - CPbkxRclContactUpdater* updater = CPbkxRclContactUpdater::NewLC( - iContactEngine ); - TPbkContactItemField& field = CurrentField(); - - HBufC* resultText = updater->UpdateContactL( field ); - CleanupStack::PopAndDestroy( updater ); - return resultText; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::SetupStatusPaneL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::SetupStatusPaneL() - { - FUNC_LOG; - CAknAppUi* appUi = static_cast( CCoeEnv::Static()->AppUi() ); - CEikStatusPane* statusPane = appUi->StatusPane(); - iNaviPane = reinterpret_cast( - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - iTitlePane = reinterpret_cast( - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); - - const TDesC* titleText = iTitlePane->Text(); - iTitlePaneText = titleText->AllocL(); - - SetTitlePaneTextL(); - - SetupTabGroupL(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::ResetStatusPane -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::ResetStatusPane() - { - FUNC_LOG; - // title pane may be null if dialog constructing failed - if ( iTitlePane != NULL ) - { - // ownership of iTitlePaneText is transferred to title pane - iTitlePane->SetText( iTitlePaneText ); - iTitlePaneText = NULL; - } - ResetTabGroup(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::SetupTabGroupL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::SetupTabGroupL() - { - FUNC_LOG; - TInt contactCount = iContactRetrieval->ContactCount(); - iNaviDecorator = iNaviPane->CreateTabGroupL(); - iTabGroup = reinterpret_cast( - iNaviDecorator->DecoratedControl() ); - - - CArrayFixFlat* array = - new ( ELeave ) CArrayFixFlat( KArrayGranularity ); - CleanupStack::PushL( array ); - - // add initial values - array->AppendL( 0 ); - array->AppendL( contactCount ); - - iTabGroup->SetTabFixedWidthL( KTabWidthWithOneTab ); - for ( TInt i = 0; i < contactCount; i++ ) - { - ( *array )[0] = i + 1; - HBufC* text = StringLoader::LoadLC( R_QTN_RCL_INFO_NAVI, *array ); - iTabGroup->AddTabL( i, *text ); - CleanupStack::PopAndDestroy( text ); - } - - CleanupStack::PopAndDestroy( array ); - iTabGroup->SetActiveTabById( iActiveTabIndex ); - - SetNaviIndicatorsL(); - - iNaviPane->PushL( *iNaviDecorator ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::SetNaviIndicatorsL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::SetNaviIndicatorsL() - { - FUNC_LOG; - if ( iNaviPane != NULL && iNaviDecorator != NULL && iTabGroup != NULL ) - { - TInt contactCount = iTabGroup->TabCount(); - if ( contactCount > 1 ) - { - iNaviDecorator->MakeScrollButtonVisible( ETrue ); - - iNaviDecorator->SetScrollButtonDimmed( - CAknNavigationDecorator::ERightButton, - EFalse); - - iNaviDecorator->SetScrollButtonDimmed( - CAknNavigationDecorator::ELeftButton, - EFalse); - - iNaviPane->PushL( *iNaviDecorator ); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::SetTitlePaneTextL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::SetTitlePaneTextL() - { - FUNC_LOG; - - HBufC* firstName = PbkxRclUtils::FieldTextL( - iCurrentContact, - EPbkFieldIdFirstName ); - CleanupStack::PushL( firstName ); - - HBufC* lastName = PbkxRclUtils::FieldTextL( - iCurrentContact, - EPbkFieldIdLastName ); - CleanupStack::PushL( lastName ); - - RBuf name; - CleanupClosePushL( name ); - name.CreateL( firstName->Length() + lastName->Length() + 1 ); - name.Format( KNameFormat, firstName, lastName ); - - iTitlePane->SetTextL( name ); - - CleanupStack::PopAndDestroy( &name ); - CleanupStack::PopAndDestroy( lastName ); - CleanupStack::PopAndDestroy( firstName ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::ResetTabGroup -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::ResetTabGroup() - { - FUNC_LOG; - // navi pane and navi decorator may be null if dialog construction failed - if ( iNaviPane != NULL && iNaviDecorator != NULL ) - { - iNaviPane->Pop( iNaviDecorator ); - delete iNaviDecorator; - iNaviDecorator = NULL; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::CreateListBoxEntriesL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::CreateListBoxEntriesL() - { - FUNC_LOG; - - iItems->Reset(); - iVisibleFields->Reset(); - - CPbkFieldArray& fieldArray = iCurrentContact->CardFields(); - TInt count = fieldArray.Count(); - - for ( TInt i = 0; i < count; i++ ) - { - - TPbkContactItemField field = fieldArray[i]; - - HBufC* text = PbkxRclUtils::FieldTextL( field ); - CleanupStack::PushL( text ); - - if ( text->Length() > 0 ) - { - iVisibleFields->AppendL( field ); - const TDesC& header = field.FieldInfo().FieldName(); - - RBuf entry; - CleanupClosePushL( entry ); - entry.CreateL( - header.Length() + text->Length() + - KExtraSpaceInListboxEntry ); - - entry.Format( KFieldFormat, &header, text ); - iItems->AppendL( entry ); - CleanupStack::PopAndDestroy( &entry ); - } - CleanupStack::PopAndDestroy( text ); - } - - CEikListBox* listBox = ListBox(); - - if ( count > 0 ) - { - // if there are items, set top item as selected - listBox->SetTopItemIndex( 0 ); - listBox->SetCurrentItemIndex( 0 ); - } - - listBox->HandleItemAdditionL(); - - // update contact action service - iContactActionService.SetCurrentContactL( - iCurrentContact ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::FetchCurrentContactL -// --------------------------------------------------------------------------- -// -TBool CPbkxRclResultInfoDlg::FetchCurrentContactL() - { - FUNC_LOG; - CContactCard* currentCard = iContactRetrieval->RetrieveDetailsL( - iActiveTabIndex, - iWaitNoteText ); - - if ( currentCard != NULL ) - { - - delete iCurrentContact; - iCurrentContact = NULL; - - iCurrentContact = PbkxRclUtils::CreateContactItemL( - currentCard, - iContactEngine ); - - return ETrue; - } - else - { - return EFalse; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::UpdateDialogL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoDlg::UpdateDialogL() - { - FUNC_LOG; - iContactRetrieval->SetSelectedContactL( iActiveTabIndex ); - CreateListBoxEntriesL(); - SetTitlePaneTextL(); - iTabGroup->SetActiveTabById( iActiveTabIndex ); - - // set navi indicators if needed - if ( iActiveTabIndex == 0 || iActiveTabIndex == iTabGroup->TabCount() - 1 ) - { - SetNaviIndicatorsL(); - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::CallActionsAvailable -// --------------------------------------------------------------------------- -// -TBool CPbkxRclResultInfoDlg::CallActionsAvailable() const - { - FUNC_LOG; - return iContactActionService.IsActionEnabled( KFscAtComCallGSM ) || - iContactActionService.IsActionEnabled( KFscAtComCallVideo ) || - iContactActionService.IsActionEnabled( KFscAtComCallVoip ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::FocusOnPhoneNumberField -// --------------------------------------------------------------------------- -// -TBool CPbkxRclResultInfoDlg::FocusOnPhoneNumberField() const - { - FUNC_LOG; - TPbkContactItemField& field = CurrentField(); - return field.FieldInfo().IsPhoneNumberField(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::FocusOnEmailAddressField -// --------------------------------------------------------------------------- -// -TBool CPbkxRclResultInfoDlg::FocusOnEmailAddressField() const - { - FUNC_LOG; - TPbkContactItemField& field = CurrentField(); - return field.FieldInfo().IsEmailField(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::FocusOnVoipField -// --------------------------------------------------------------------------- -// -TBool CPbkxRclResultInfoDlg::FocusOnVoipField() const - { - FUNC_LOG; - TPbkContactItemField& field = CurrentField(); - return field.FieldInfo().FieldId() == EPbkFieldIdVOIP; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoDlg::CurrentField -// --------------------------------------------------------------------------- -// -TPbkContactItemField& CPbkxRclResultInfoDlg::CurrentField() const - { - FUNC_LOG; - TInt curIndex = ListBox()->CurrentItemIndex(); - return ( *iVisibleFields )[curIndex]; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclresultinfolistbox.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclresultinfolistbox.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclResultInfoListBox. -* -*/ - - -#include "emailtrace.h" -#include -#include - -#include "cpbkxrclresultinfolistbox.h" - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclResultInfoListBox -//////////////////////////////////////////////////////////////////////////// - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoListBox::CPbkxRclResultInfoListBox -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoListBox::CPbkxRclResultInfoListBox() : - CAknDoubleStyleListBox() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoListBox::~CPbkxRclResultInfoListBox -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoListBox::~CPbkxRclResultInfoListBox() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoListBox::CreateItemDrawerL -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoListBox::CreateItemDrawerL() - { - FUNC_LOG; - CFormattedCellListBoxData* data = CFormattedCellListBoxData::NewL(); - CleanupStack::PushL( data ); - iItemDrawer = new ( ELeave ) CPbkxRclResultInfoItemDrawer( - Model(), - iEikonEnv->NormalFont(), - data ); - data->SetSkinEnabledL( ETrue ); - CleanupStack::Pop( data ); - } - - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclResultInfoItemDrawer -//////////////////////////////////////////////////////////////////////////// - - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoItemDrawer::CPbkxRclResultInfoItemDrawer -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoItemDrawer::CPbkxRclResultInfoItemDrawer( - MTextListBoxModel* aTextListBoxModel, - const CFont* aFont, - CFormattedCellListBoxData* aFormattedCellData ) : - CFormattedCellListBoxItemDrawer( - aTextListBoxModel, - aFont, - aFormattedCellData ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoItemDrawer::~CPbkxRclResultInfoItemDrawer -// --------------------------------------------------------------------------- -// -CPbkxRclResultInfoItemDrawer::~CPbkxRclResultInfoItemDrawer() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoItemDrawer::SetHighlightColor -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoItemDrawer::SetHighlightColor( TRgb aColor ) - { - FUNC_LOG; - iHighlightColor = aColor; - iColorsSet = iColorsSet | EHighlighColorSet; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoItemDrawer::SetColor -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoItemDrawer::SetColor( TRgb aColor ) - { - FUNC_LOG; - iColor = aColor; - iColorsSet = iColorsSet | EColorSet; - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoItemDrawer::ResetColors -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoItemDrawer::ResetColors( TBool aHighlightColor ) - { - FUNC_LOG; - if ( aHighlightColor ) - { - iColorsSet = iColorsSet & ( ~EHighlighColorSet ); - } - else - { - iColorsSet = iColorsSet & ( ~EColorSet ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclResultInfoItemDrawer::DrawItemText -// --------------------------------------------------------------------------- -// -void CPbkxRclResultInfoItemDrawer::DrawItemText( - TInt aItemIndex, - const TRect& aItemTextRect, - TBool aItemIsCurrent, - TBool aViewIsEmphasized, - TBool aItemIsSelected ) const - { - FUNC_LOG; - - // force our own colors to itemdrawer - CPbkxRclResultInfoItemDrawer* ptr = - const_cast( this ); - - if ( iColorsSet & EColorSet ) - { - ptr->iTextColor = iColor; - } - - if ( iColorsSet & EHighlighColorSet ) - { - ptr->iHighlightedTextColor = iHighlightColor; - } - - // Disable AVKON skinning so that our own color definitions apply - TBool skinEnabled = AknsUtils::AvkonSkinEnabled(); - // Safe to ignore error - TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( EFalse ) ); - CFormattedCellListBoxItemDrawer::DrawItemText( - aItemIndex, - aItemTextRect, - aItemIsCurrent, - aViewIsEmphasized, - aItemIsSelected ); - // Safe to ignore error - TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( skinEnabled ) ); - - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclsearchengine.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclsearchengine.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclSearchEngine. -* -*/ - - -#include "emailtrace.h" -#include "cpbkxrclsearchengine.h" -#include "cpbkxrclprotocolenvimpl.h" -#include "cpbkxremotecontactlookupprotocoladapter.h" -#include "cpbkxrclserviceuicontextimpl.h" -#include "pbkxrclutils.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::CPbkxRclSearchEngine -// --------------------------------------------------------------------------- -// -CPbkxRclSearchEngine::CPbkxRclSearchEngine() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchEngine::ConstructL() - { - FUNC_LOG; - iEnvironment = CPbkxRclProtocolEnvImpl::NewL(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CPbkxRclSearchEngine* CPbkxRclSearchEngine::NewL() - { - FUNC_LOG; - CPbkxRclSearchEngine* self = CPbkxRclSearchEngine::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::NewLC -// --------------------------------------------------------------------------- -// -EXPORT_C CPbkxRclSearchEngine* CPbkxRclSearchEngine::NewLC() - { - FUNC_LOG; - CPbkxRclSearchEngine* self = new( ELeave ) CPbkxRclSearchEngine; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::~CPbkxRclSearchEngine -// --------------------------------------------------------------------------- -// -CPbkxRclSearchEngine::~CPbkxRclSearchEngine() - { - FUNC_LOG; - delete iEnvironment; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::DefaultAccountIdL -// --------------------------------------------------------------------------- -// -TPbkxRemoteContactLookupProtocolAccountId CPbkxRclSearchEngine::DefaultAccountIdL() const - { - FUNC_LOG; - return PbkxRclUtils::DefaultProtocolAccountIdL(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::NewAccountL -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupProtocolAccount* CPbkxRclSearchEngine::NewAccountL( - const TPbkxRemoteContactLookupProtocolAccountId& aId ) const - { - FUNC_LOG; - CPbkxRemoteContactLookupProtocolAdapter* adapter = CreateAdapterLC( aId ); - CPbkxRemoteContactLookupProtocolAccount* account = adapter->NewProtocolAccountL( aId ); - CleanupStack::PopAndDestroy( adapter ); - return account; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::NewContextL -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupServiceUiContext* CPbkxRclSearchEngine::NewContextL( - TContextParams& aParams ) const - { - FUNC_LOG; - CPbkxRclServiceUiContextImpl* context = CPbkxRclServiceUiContextImpl::NewL( - aParams.iProtocolAccountId, - aParams.iMode ); - return context; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchEngine::CreateAdapterLC -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupProtocolAdapter* CPbkxRclSearchEngine::CreateAdapterLC( - const TPbkxRemoteContactLookupProtocolAccountId& aId ) const - { - FUNC_LOG; - CPbkxRemoteContactLookupProtocolAdapter* adapter = - CPbkxRemoteContactLookupProtocolAdapter::NewL( - aId.iProtocolUid, - *iEnvironment ); - CleanupStack::PushL( adapter ); - return adapter; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclsearchresultdlg.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclsearchresultdlg.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1102 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchResultDlg. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// -#include "cfsccontactactionmenu.h" -#include "mfsccontactactionmenumodel.h" -#include "mfsccontactaction.h" -#include "cfsccontactactionmenuitem.h" -#include "fsccontactactionservicedefines.h" -#include "fsccontactactionmenudefines.h" -// - -#include -#include -#include -#include -#include // MEikListBoxObserver - -#include - -#include "cpbkxrclsearchresultdlg.h" -#include "pbkxremotecontactlookuppanic.h" -#include "engine.hrh" -#include "pbkxrclutils.h" -#include "cpbkxrclvcardsender.h" -#include "cpbkxrclactionservicewrapper.h" - -// list box field formats -_LIT( KFieldFormat, "\t%S %S" ); -_LIT( KFieldFormatWithIcon, "\t%S %S\t%d" ); - -_LIT( KFieldFormatDispName, "\t%S" ); -_LIT( KFieldFormatDispNameWithIcon, "\t%S\t%d" ); - -// Constant to measure when user is scrolling. -const TInt KKeyScrolling = 1; -// S60 UID update -const TInt KPbkxRemoteContactLookupServiceImplImpUid = 0x2001FE0D; -// S60 UID update - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultDlg* CPbkxRclSearchResultDlg::NewL( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - RPointerArray& aContactItems, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled ) - { - FUNC_LOG; - CPbkxRclSearchResultDlg* dialog = new ( ELeave ) CPbkxRclSearchResultDlg( - aIndex, - aArray, - aCommand, - aContactItems, - aContactEngine, - aActionService, - aContactSelectorEnabled ); - - CleanupStack::PushL( dialog ); - dialog->ConstructL(); - CleanupStack::Pop( dialog ); - return dialog; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CPbkxRclSearchResultDlg -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultDlg::CPbkxRclSearchResultDlg( - TInt& aIndex, - CDesCArray* aArray, - MEikCommandObserver* aCommand, - RPointerArray& aContactItems, - CPbkContactEngine& aContactEngine, - CPbkxRclActionServiceWrapper& aActionService, - TBool aContactSelectorEnabled ) : - CPbkxRclBaseDlg( aIndex, aArray, aCommand, ETrue ), - iContactEngine( aContactEngine ), - iContactActionService( aActionService ), - iItems( aArray ), iContactItems( aContactItems ), - iContactSelectorEnabled( aContactSelectorEnabled ), - iSelectedItemIndex( aIndex ), - iIsInfoDlgVisible( EFalse ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::ConstructL() - { - FUNC_LOG; - CPbkxRclBaseDlg::ConstructL( R_RCL_SEARCH_RESULT_DIALOG_MENU_BAR ); - LoadNaviTextL(); - - // add foreground observer - CCoeEnv::Static()->AddForegroundObserverL( *this ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::~CPbkxRclSearchResultDlg -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultDlg::~CPbkxRclSearchResultDlg() - { - FUNC_LOG; - CCoeEnv::Static()->RemoveForegroundObserver( *this ); - ResetStatusPane(); - iNaviText.Close(); - delete iAddRecipientIcon; - - iContactActionService.CancelQuery(); - if ( iActionMenu ) - { - delete iActionMenu; - iActionMenu = NULL; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ExecuteLD -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::ExecuteLD() - { - FUNC_LOG; - - PrepareLC( R_RCL_SEARCH_RESULT_DIALOG ); - - UpdateGraphics(); - UpdateColors(); - - HBufC* noItemText = StringLoader::LoadLC( R_QTN_RCL_NO_RESULTS ); - ListBox()->View()->SetListEmptyTextL( *noItemText ); - CleanupStack::PopAndDestroy( noItemText ); - - CreateListBoxIconsL(); - - InitializeActionMenuL(); - - SetupStatusPaneL(); - CreateListBoxEntriesL(); - - if ( iContactItems.Count() == 0 ) - { - ConstructMenuBarL( R_RCL_OPTIONS_BACK_CONTEXTMENU ); - } - - CAknSelectionListDialog::RunLD(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CurrentItemIndex -// --------------------------------------------------------------------------- -// -TInt CPbkxRclSearchResultDlg::CurrentItemIndex() const - { - FUNC_LOG; - return ListBox()->CurrentItemIndex(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::SetCurrentItemIndex -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::SetCurrentItemIndexL( TInt aIndex ) - { - FUNC_LOG; - if ( aIndex >= 0 && aIndex < iContactItems.Count() ) - { - // update list box entrys first - TInt oldIndex = iSelectedItemIndex; - - ListBox()->SetCurrentItemIndex( aIndex ); - iSelectedItemIndex = aIndex; - - UpdateListBoxEntryL( iSelectedItemIndex ); - UpdateListBoxEntryL( oldIndex ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::Close -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::Close() - { - FUNC_LOG; - // this will not leave, because TryExitL doesn't call leaving methods - // when EAknSoftkeyCancel is used - iExit = ETrue; - TRAP_IGNORE( TryExitL( EAknSoftkeyCancel ) ); // - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::UpdateDialogL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::UpdateDialogL() - { - FUNC_LOG; - LoadNaviTextL(); - CreateListBoxEntriesL(); - UpdateStatusPaneL(); - - if ( iContactItems.Count() == 0 ) - { - ConstructMenuBarL( R_RCL_OPTIONS_BACK_CONTEXTMENU ); - } - else - { - ConstructMenuBarL( R_RCL_OPTIONS_BACK_OPEN ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::SendBusinessCardL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::SendBusinessCardL() - { - FUNC_LOG; - CPbkxRclvCardSender* sender = CPbkxRclvCardSender::NewLC( iContactEngine ); - - TInt curIndex = CurrentItemIndex(); - - - CContactCard* current = iContactItems[curIndex]; - - CPbkContactItem* contactItem = PbkxRclUtils::CreateContactItemL( - current, - iContactEngine ); - CleanupStack::PushL( contactItem ); - - sender->SendvCardL( *contactItem, *(iContactActionService.ContactConverter()) ); - - CleanupStack::PopAndDestroy( contactItem ); - CleanupStack::PopAndDestroy( sender ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::DynInitMenuPaneL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - FUNC_LOG; - if ( aResourceId == R_RCL_SEARCH_RESULT_DIALOG_MENU_PANE ) - { - - if ( iContactItems.Count() == 0 ) - { - // when there are 0 results, only new search option is available - aMenuPane->SetItemDimmed( ERclCmdViewDetails, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdSaveToContacts, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdCall, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdSend, ETrue ); - } - else - { - if ( !iContactSelectorEnabled ) - { - - aMenuPane->SetItemDimmed( ERclCmdAddAsRecipient, ETrue ); - - aMenuPane->SetItemDimmed( - ERclCmdCall, - !CallActionsAvailable() ); - - // send menu is always visible, since business card can - // always be sent - } - else - { - aMenuPane->SetItemDimmed( ERclCmdCall, ETrue ); - aMenuPane->SetItemDimmed( ERclCmdSend, ETrue ); - } - - aMenuPane->SetItemDimmed( - ERclCmdSaveToContacts, - !iContactActionService.IsActionEnabled( KFscAtManSaveAs ) ); - } - } - else if ( aResourceId == R_RCL_CALL_MENU_PANE ) - { - - aMenuPane->SetItemDimmed( - ERclCmdVoiceCall, - !iContactActionService.IsActionEnabled( KFscAtComCallGSM ) ); - - aMenuPane->SetItemDimmed( - ERclCmdVideoCall, - !iContactActionService.IsActionEnabled( KFscAtComCallVideo ) ); - - aMenuPane->SetItemDimmed( - ERclCmdVoip, - !iContactActionService.IsActionEnabled( KFscAtComCallVoip ) ); - - } - else if ( aResourceId == R_RCL_SEND_MENU_PANE ) - { - aMenuPane->SetItemDimmed( - ERclCmdSendMsg, - !iContactActionService.IsActionEnabled( KFscAtComSendMsg ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendEmail, - !iContactActionService.IsActionEnabled( KFscAtComSendEmail ) ); - - aMenuPane->SetItemDimmed( - ERclCmdSendMeetingReq, - ETrue /*!iContactActionService.IsActionEnabled( KFscAtComSendCalReq )*/ ); - // "Send meeting request" option should not be available - - aMenuPane->SetItemDimmed( - ERclCmdSendAudioMsg, - !iContactActionService.IsActionEnabled( KFscAtComSendAudio ) ); - - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::GetHelpContext -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::GetHelpContext( TCoeHelpContext& aContext ) const - { - FUNC_LOG; - - if ( !iIsInfoDlgVisible ) - { - aContext.iMajor = TUid::Uid( KPbkxRemoteContactLookupServiceImplImpUid ); - aContext.iContext = KRLOOK_HLP_RESULT_VIEW; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::HandleGainingForeground -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::HandleGainingForeground() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::HandleLosingForeground -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::HandleLosingForeground() - { - FUNC_LOG; - if ( ScrollingInProgress() ) - { - // scrolling was in progress - TRAP_IGNORE( ScrollingStoppedL() ); - iKeyDown = EFalse; - iKeyCounter = 0; - } - } - -// ---------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::HandleListBoxEventL() -// ---------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::HandleListBoxEventL( - CEikListBox* /* aListBox */, - TListBoxEvent aEventType ) - { - FUNC_LOG; - switch ( aEventType ) - { - case EEventEnterKeyPressed: - case EEventItemClicked: - { - if ( iContactItems.Count() > 0 ) - { - TInt oldIndex = iSelectedItemIndex; - iSelectedItemIndex = CurrentItemIndex(); - if ( oldIndex != iSelectedItemIndex ) - { - UpdateListBoxEntryL( oldIndex ); - // update listbox entry if we are not yet fast scrolling - if ( !ScrollingInProgress() ) - { - SetCurrentContactToActionServiceL(); - UpdateListBoxEntryL( iSelectedItemIndex ); - } - } - } - break; - } - case EEventItemActioned: - { - break; - } - - case EEventItemDoubleClicked: - { - ProcessCommandL( ERclCmdViewDetails ); - break; - } - - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CPbkxRclSearchResultDlg::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - FUNC_LOG; - - // if there are no items, don't handle key presses - TInt count = iContactItems.Count(); - - if ( iExit || aType != EEventKey ) - { - if ( aType == EEventKeyUp ) - { - // added count condition - if ( count && ScrollingInProgress() && !iIsScrollLaunched ) - { - // scrolling ended - iIsScrollLaunched = ETrue; - ScrollingStoppedL(); - } - iKeyCounter = 0; - iKeyDown = EFalse; - } - - return EKeyWasConsumed; - } - - if ( aKeyEvent.iCode == EKeyUpArrow || - aKeyEvent.iCode == EKeyDownArrow ) - { - iKeyDown = ETrue; - iKeyCounter++; - } - else - { - // make sure that if we were scrolling we stop it now - if ( ScrollingInProgress() ) - { - ScrollingStoppedL(); - } - iKeyDown = EFalse; - iKeyCounter = 0; - } - - switch ( aKeyEvent.iCode ) - { - case EKeyPhoneSend: - { - ProcessCommandL( ERclCmdVoiceCall ); - break; - } - case EKeyOK: - { - if ( count > 0 ) - { - // opens result information view - ProcessCommandL( ERclCmdViewDetails ); - } - } - break; - case EKeyUpArrow: // fall through, same functionality with these two - case EKeyDownArrow: - { - if ( count > 0 ) - { - TInt oldIndex = iSelectedItemIndex; - CAknSelectionListDialog::OfferKeyEventL( aKeyEvent, aType ); - iSelectedItemIndex = CurrentItemIndex(); - if ( oldIndex != iSelectedItemIndex ) - { - UpdateListBoxEntryL( oldIndex ); - // update listbox entry if we are not yet fast scrolling - if ( !ScrollingInProgress() ) - { - SetCurrentContactToActionServiceL(); - UpdateListBoxEntryL( iSelectedItemIndex ); - } - } - } - } - break; - case EKeyRightArrow: - { - if ( !AknLayoutUtils::LayoutMirrored() && ActionMenuAvailable() ) - { - // opens action menu - ShowActionMenuL(); - } - } - break; - case EKeyLeftArrow: - { - if ( AknLayoutUtils::LayoutMirrored() && ActionMenuAvailable() ) - { - ShowActionMenuL(); - } - } - break; - case EKeyEscape: - { - // exit application - iExit = ETrue; - ProcessCommandL( EAknCmdExit ); - } - break; - default: - break; - } - return EKeyWasConsumed; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::OkToExitL -// --------------------------------------------------------------------------- -// -TBool CPbkxRclSearchResultDlg::OkToExitL( TInt aButtonId ) - { - FUNC_LOG; - if( aButtonId == EAknSoftkeyOpen ) - { - ProcessCommandL( ERclCmdViewDetails ); - return EFalse; - } - else if ( aButtonId == EAknSoftkeyContextOptions ) - { - iMenuBar->TryDisplayMenuBarL(); - return EFalse; - } - else - { - return CAknDialog::OkToExitL( aButtonId ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::SetupStatusPaneL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::SetupStatusPaneL() - { - FUNC_LOG; - CAknAppUi* appUi = static_cast( CCoeEnv::Static()->AppUi() ); - CEikStatusPane* statusPane = appUi->StatusPane(); - iNaviPane = reinterpret_cast( - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - - iNaviDecorator = iNaviPane->CreateNavigationLabelL( iNaviText ); - - iNaviPane->PushL( *iNaviDecorator ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::UpdateStatusPaneL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::UpdateStatusPaneL() - { - FUNC_LOG; - - ResetStatusPane(); - iNaviDecorator = iNaviPane->CreateNavigationLabelL( iNaviText ); - iNaviPane->PushL( *iNaviDecorator ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ResetStatusPane -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::ResetStatusPane() - { - FUNC_LOG; - // navi pane and navi decorator may be null if dialog construction - // failed - if ( iNaviPane != NULL && iNaviDecorator != NULL ) - { - iNaviPane->Pop( iNaviDecorator ); - delete iNaviDecorator; - iNaviDecorator = NULL; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CreateListBoxEntriesL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::CreateListBoxEntriesL() - { - FUNC_LOG; - iItems->Delete( 0, iItems->Count() ); - TInt count = iContactItems.Count(); - - if ( count > 0 ) - { - iSelectedItemIndex = 0; - } - - SetCurrentContactToActionServiceL(); - - for ( TInt i = 0; i < count; i++ ) - { - CreateListBoxEntryL( i ); - } - - CEikListBox* listBox = ListBox(); - - if ( count > 0 ) - { - listBox->SetTopItemIndex( 0 ); - listBox->SetCurrentItemIndex( 0 ); - } - - listBox->HandleItemAdditionL(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CreateListBoxIconsL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::CreateListBoxIconsL() - { - FUNC_LOG; - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - TFileName dllFileName; - Dll::FileName( dllFileName ); - TParse parse; - parse.Set( KEngineIconFile, &KDC_APP_RESOURCE_DIR, &dllFileName ); - -// icons changed - if ( iContactSelectorEnabled ) - { - // add as recipient icon - AknsUtils::CreateIconL( - AknsUtils::SkinInstance(), - KAknsIIDQgnFsRclActionRecipient, - bitmap, - mask, - parse.FullName(), - EMbmPbkxrclengineQgn_prop_cmail_contacts_group, - EMbmPbkxrclengineQgn_prop_cmail_contacts_group_mask ); - - CleanupStack::PushL( bitmap ); - CleanupStack::PushL( mask ); - - iAddRecipientIcon = CGulIcon::NewL( bitmap, mask ); - - CleanupStack::Pop( mask ); - CleanupStack::Pop( bitmap ); - } - - // action menu icon - AknsUtils::CreateIconL( - AknsUtils::SkinInstance(), - KAknsIIDQgnFsHscrActionArrowRight, - bitmap, - mask, - parse.FullName(), - EMbmPbkxrclengineQgn_indi_cmail_action_arrow_right, - EMbmPbkxrclengineQgn_indi_cmail_action_arrow_right_mask ); -// - CleanupStack::PushL( bitmap ); - CleanupStack::PushL( mask ); - - CGulIcon* icon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::PushL( icon ); - - CArrayPtr* iconArray = - new ( ELeave ) CArrayPtrFlat( KArrayGranularity ); - CleanupStack::PushL( iconArray ); - iconArray->AppendL( icon ); - - SetIconArrayL( iconArray ); - - CleanupStack::Pop( iconArray ); - - CleanupStack::Pop( icon ); - CleanupStack::Pop( mask ); - CleanupStack::Pop( bitmap ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CreateListBoxEntryL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::CreateListBoxEntryL( TInt aIndex ) - { - FUNC_LOG; - - CContactCard* card = iContactItems[aIndex]; - TPtrC dispName = PbkxRclUtils::FieldText( card, KUidContactFieldDefinedText ); - TPtrC firstName = PbkxRclUtils::FieldText( card, KUidContactFieldGivenName ); - TPtrC lastName = PbkxRclUtils::FieldText( card, KUidContactFieldFamilyName ); - - RBuf entry; - TPtrC entryFirstName; - - if ( dispName.Length() != 0 ) - { - entryFirstName.Set(dispName); - entry.CreateL( entryFirstName.Length() + KExtraSpaceInListboxEntry ); - } - else - { - entryFirstName.Set(firstName); - entry.CreateL( firstName.Length() + lastName.Length() + KExtraSpaceInListboxEntry ); - } - - CleanupClosePushL( entry ); - if ( dispName.Length() != 0 ) - { - if ( aIndex == iSelectedItemIndex && ActionMenuAvailable() ) - { - entry.Format( - KFieldFormatDispNameWithIcon, - &entryFirstName, - EActionMenuEnabled ); - } - else - { - entry.Format( KFieldFormatDispName, &entryFirstName ); - } - } - else - { - if ( aIndex == iSelectedItemIndex && ActionMenuAvailable() ) - { - entry.Format( - KFieldFormatWithIcon, - &firstName, - &lastName, - EActionMenuEnabled ); - } - else - { - entry.Format( KFieldFormat, &firstName, &lastName ); - } - } - iItems->InsertL( aIndex, entry ); - CleanupStack::PopAndDestroy( &entry ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::UpdateListBoxEntryL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::UpdateListBoxEntryL( TInt aIndex ) - { - FUNC_LOG; - iItems->Delete( aIndex ); - CreateListBoxEntryL( aIndex ); - ListBox()->DrawItem( aIndex ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::SetCurrentContactToActionServiceL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::SetCurrentContactToActionServiceL() - { - FUNC_LOG; - - if ( iActionMenu ) - { - if ( iContactItems.Count() > 0 ) - { - // set current contact to action service - - CPbkContactItem* currentContact = PbkxRclUtils::CreateContactItemL( - iContactItems[iSelectedItemIndex], - iContactEngine ); - CleanupStack::PushL( currentContact ); - - iContactActionService.SetCurrentContactL( - currentContact ); - - CleanupStack::PopAndDestroy( currentContact ); - - } - else - { - iContactActionService.SetCurrentContactL( NULL ); - } - - if ( iActionMenu ) - { - // update action menu - iActionMenu->Model().AddPreQueriedCasItemsL(); - // save as contact not added for this contact - iSaveAsAdded = EFalse; - } - } - iIsScrollLaunched = EFalse; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::LoadNaviTextL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::LoadNaviTextL() - { - FUNC_LOG; - iNaviText.Close(); - HBufC* naviText = NULL; - if ( iContactItems.Count() == 1 ) - { - naviText = StringLoader::LoadLC( R_QTN_RCL_ONE_RESULT_NAVI ); - } - else if ( iContactItems.Count() == 0 ) - { - naviText = NULL; - } - else - { - naviText = StringLoader::LoadLC( - R_QTN_RCL_RESULT_NAVI, - iContactItems.Count() ); - } - - if (naviText) - { - iNaviText.CreateL( *naviText ); - CleanupStack::PopAndDestroy( naviText ); - } - else - { - iNaviText = KNullDesC; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CallActionsAvailable -// --------------------------------------------------------------------------- -// -TBool CPbkxRclSearchResultDlg::CallActionsAvailable() const - { - FUNC_LOG; - return iContactActionService.IsActionEnabled( KFscAtComCallGSM ) || - iContactActionService.IsActionEnabled( KFscAtComCallVideo ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::InitializeActionMenuL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::InitializeActionMenuL() - { - FUNC_LOG; - - iActionMenu = CFscContactActionMenu::NewL( - *(iContactActionService.ActionService()) ); - - MFscContactActionMenuModel& model = iActionMenu->Model(); - - if ( iContactSelectorEnabled && iContactItems.Count() > 0 ) - { - - // add static custom item - HBufC* menuText = StringLoader::LoadLC( - R_QTN_RCL_ADD_RECIPIENT_ACTION_MENU_TEXT ); - - CFscContactActionMenuItem* item = model.NewMenuItemL( - *menuText, - iAddRecipientIcon, - KPbkxRclAddRecipientPriority, - ETrue, - KPbkxRclAddRecipientActionUid ); - - CleanupStack::PushL( item ); - - model.AddItemL( item ); - - CleanupStack::Pop( item ); - CleanupStack::PopAndDestroy( menuText ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ShowActionMenuL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::ShowActionMenuL() - { - FUNC_LOG; - - CreateAndAddSaveAsContactActionL(); - - TFscContactActionMenuPosition pos = GetActionMenuPosition(); - TFscActionMenuResult result = iActionMenu->ExecuteL( pos ); - - // if custom item was selected, it was our add to recipient or - // save as contact - if ( result == EFscCustomItemSelected ) - { - const TFscContactActionQueryResult* saveAsContact = - iContactActionService.GetResult( KFscAtManSaveAs ); - TInt itemIndex = iActionMenu->FocusedItemIndex(); - CFscContactActionMenuItem& item = - iActionMenu->Model().ItemL( itemIndex ); - - if ( item.ImplementationUid() == KPbkxRclAddRecipientActionUid ) - { - ProcessCommandL( ERclCmdAddAsRecipient ); - } - else if ( saveAsContact != NULL && - item.ImplementationUid() == saveAsContact->iAction->Uid() ) - { - ProcessCommandL( ERclCmdSaveToContacts ); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::GetActionMenuPosition -// --------------------------------------------------------------------------- -// -TFscContactActionMenuPosition CPbkxRclSearchResultDlg::GetActionMenuPosition() - { - FUNC_LOG; - const TInt KNumberOfMenuPositions = 3; - - CEikListBox* listBox = ListBox(); - TInt itemsInView = listBox->View()->NumberOfItemsThatFitInRect( Rect() ); - - TInt topIndex = listBox->TopItemIndex(); - TInt curIndex = listBox->CurrentItemIndex(); - - TInt normalizedIndex = curIndex - topIndex; - - TInt segmentSize = itemsInView / KNumberOfMenuPositions; - - if ( normalizedIndex < segmentSize ) - { - return EFscTop; - } - else if ( normalizedIndex < ( 2 * segmentSize) ) - { - return EFscCenter; - } - else - { - return EFscBottom; - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ActionMenuAvailable -// --------------------------------------------------------------------------- -// -TBool CPbkxRclSearchResultDlg::ActionMenuAvailable() const - { - FUNC_LOG; - TInt count = iActionMenu->Model().ItemCount() > 0; - if ( !iSaveAsAdded ) - { - if ( iContactActionService.IsActionEnabled( KFscAtManSaveAs ) ) - { - count++; - } - } - - return count > 0; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::CreateAndAddSaveAsContactActionL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::CreateAndAddSaveAsContactActionL() - { - FUNC_LOG; - if ( !iSaveAsAdded ) - { - const TFscContactActionQueryResult* saveAsContact = - iContactActionService.GetResult( KFscAtManSaveAs ); - if ( saveAsContact != NULL ) - { - MFscContactActionMenuModel& model = iActionMenu->Model(); - - const MFscContactAction* action = saveAsContact->iAction; - - CFscContactActionMenuItem* item = model.NewMenuItemL( - action->ActionMenuText(), - action->Icon(), - saveAsContact->iPriority, - EFalse, - action->Uid() ); - - CleanupStack::PushL( item ); - - model.AddItemL( item ); - - iSaveAsAdded = ETrue; - - CleanupStack::Pop( item ); - } - } - } - - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ScrollingInProgress -// --------------------------------------------------------------------------- -// -TBool CPbkxRclSearchResultDlg::ScrollingInProgress() const - { - FUNC_LOG; - return iKeyDown && iKeyCounter > KKeyScrolling; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ScrollingStopped -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::ScrollingStoppedL() - { - FUNC_LOG; - SetCurrentContactToActionServiceL(); - UpdateListBoxEntryL( iSelectedItemIndex ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::ConstructContextMenuL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::ConstructMenuBarL( TInt aResourceId ) - { - FUNC_LOG; - CEikButtonGroupContainer& butContainer = ButtonGroupContainer(); - butContainer.SetCommandSetL( aResourceId ); - butContainer.DrawNow(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultDlg::InfoDlgVisible -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultDlg::InfoDlgVisible( TBool aVisible ) - { - FUNC_LOG; - iIsInfoDlgVisible = aVisible; - } diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclsearchresultlistbox.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclsearchresultlistbox.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRclSearchResultListBox. -* -*/ - - -#include "emailtrace.h" -#include -#include - -#include "cpbkxrclsearchresultlistbox.h" - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclSearchResultListBox -//////////////////////////////////////////////////////////////////////////// - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultListBox::CPbkxRclSearchResultListBox -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultListBox::CPbkxRclSearchResultListBox() : - CAknSingleStyleListBox() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultListBox::~CPbkxRclSearchResultListBox -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultListBox::~CPbkxRclSearchResultListBox() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultListBox::CreateItemDrawerL -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultListBox::CreateItemDrawerL() - { - FUNC_LOG; - CColumnListBoxData* data = CColumnListBoxData::NewL(); - CleanupStack::PushL( data ); - iItemDrawer = new ( ELeave ) CPbkxRclSearchResultItemDrawer( - Model(), - iEikonEnv->NormalFont(), - data ); - data->SetSkinEnabledL( ETrue ); - CleanupStack::Pop( data ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultListBox::MakeViewClassInstanceL -// --------------------------------------------------------------------------- -// -CListBoxView* CPbkxRclSearchResultListBox::MakeViewClassInstanceL() - { - return ( new (ELeave) CPbkxRclSearchResultListView() ); - } - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclSearchResultItemDrawer -//////////////////////////////////////////////////////////////////////////// - - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultItemDrawer::CPbkxRclSearchResultItemDrawer -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultItemDrawer::CPbkxRclSearchResultItemDrawer( - MTextListBoxModel* aTextListBoxModel, - const CFont* aFont, - CColumnListBoxData* aColumnData ) : - CColumnListBoxItemDrawer( aTextListBoxModel, aFont, aColumnData ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultItemDrawer::~CPbkxRclSearchResultItemDrawer -// --------------------------------------------------------------------------- -// -CPbkxRclSearchResultItemDrawer::~CPbkxRclSearchResultItemDrawer() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultItemDrawer::SetHighlightColor -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultItemDrawer::SetHighlightColor( TRgb aColor ) - { - FUNC_LOG; - iHighlightColor = aColor; - iColorsSet = iColorsSet | EHighlighColorSet; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultItemDrawer::SetColor -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultItemDrawer::SetColor( TRgb aColor ) - { - FUNC_LOG; - iColor = aColor; - iColorsSet = iColorsSet | EColorSet; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultItemDrawer::ResetColors -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultItemDrawer::ResetColors( TBool aHighlightColor ) - { - FUNC_LOG; - if ( aHighlightColor ) - { - iColorsSet = iColorsSet & ( ~EHighlighColorSet ); - } - else - { - iColorsSet = iColorsSet & ( ~EColorSet ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultItemDrawer::DrawItemText -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultItemDrawer::DrawItemText( - TInt aItemIndex, - const TRect& aItemTextRect, - TBool aItemIsCurrent, - TBool aViewIsEmphasized, - TBool aItemIsSelected ) const - { - FUNC_LOG; - - // force our own text colors to item drawer - CPbkxRclSearchResultItemDrawer* ptr = - const_cast( this ); - if ( iColorsSet & EColorSet ) - { - ptr->iTextColor = iColor; - } - - if ( iColorsSet & EHighlighColorSet ) - { - ptr->iHighlightedTextColor = iHighlightColor; - } - - // Disable AVKON skinning so that our own color definitions apply - TBool skinEnabled = AknsUtils::AvkonSkinEnabled(); - // Safe to ignore error - TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( EFalse ) ); - CColumnListBoxItemDrawer::DrawItemText( - aItemIndex, - aItemTextRect, - aItemIsCurrent, - aViewIsEmphasized, - aItemIsSelected ); - // Safe to ignore error - TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( skinEnabled ) ); - } - -//////////////////////////////////////////////////////////////////////////// -// CPbkxRclSearchResultListView -//////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------------------------- -// CPbkxRclSearchResultListView::DrawEmptyList -// --------------------------------------------------------------------------- -// -void CPbkxRclSearchResultListView::DrawEmptyList(const TRect &aClientRect) const - { - // Disable AVKON skinning so that our own color definitions apply - TBool skinEnabled = AknsUtils::AvkonSkinEnabled(); - // Safe to ignore error - TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( EFalse ) ); - CAknColumnListBoxView::DrawEmptyList( aClientRect ); - // Safe to ignore error - TRAP_IGNORE( AknsUtils::SetAvkonSkinEnabledL( skinEnabled ) ); - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclserviceuicontextimpl.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclserviceuicontextimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1478 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclServiceUiContextImpl. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -// -#include "fsccontactactionservicedefines.h" -// -#include -#include -#include - -#include "cpbkxrclserviceuicontextimpl.h" -#include "pbkxremotecontactlookuppanic.h" -#include "cpbkxremotecontactlookupprotocolsession.h" -#include "cpbkxrclprotocolenvimpl.h" -#include "cpbkxremotecontactlookupprotocoladapter.h" -#include "cpbkxremotecontactlookupprotocolaccount.h" - -#include "cpbkxrclsearchresultdlg.h" -#include "cpbkxrclresultinfodlg.h" -#include "cpbkxrclqueryeditor.h" -#include "cpbkxrclactionservicewrapper.h" - -#include "pbkxrclutils.h" -#include "pbkxrclengineconstants.h" - -#include "engine.hrh" -#include - -// own macro to handle errors in traps -// Do not use, produces Codescanner warnings -//#define EXIT_IF_ERROR( xxx ) { TRAPD( err, xxx ); if ( err != KErrNone ) HandleError( err ); } -// - -/// Unnamed namespace for local definitions -namespace { -const TInt KTwoMinutesTimerInterval(120000000); -} /// namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclServiceUiContextImpl* CPbkxRclServiceUiContextImpl::NewL( - TPbkxRemoteContactLookupProtocolAccountId aId, - TMode aMode ) - { - FUNC_LOG; - CPbkxRclServiceUiContextImpl* context = - CPbkxRclServiceUiContextImpl::NewLC( aId, aMode ); - CleanupStack::Pop( context ); - return context; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclServiceUiContextImpl* CPbkxRclServiceUiContextImpl::NewLC( - TPbkxRemoteContactLookupProtocolAccountId aId, - TMode aMode ) - { - FUNC_LOG; - CPbkxRclServiceUiContextImpl* context = - new ( ELeave ) CPbkxRclServiceUiContextImpl( aId, aMode ); - CleanupStack::PushL( context ); - context->ConstructL(); - return context; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::CPbkxRclServiceUiContextImpl -// --------------------------------------------------------------------------- -// -CPbkxRclServiceUiContextImpl::CPbkxRclServiceUiContextImpl( - TPbkxRemoteContactLookupProtocolAccountId aId, - TMode aMode ) : - iAccountId( aId ), iMode( aMode ), iSelectedIndex( KErrNotFound ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::~CPbkxRclServiceUiContextImpl -// --------------------------------------------------------------------------- -// -CPbkxRclServiceUiContextImpl::~CPbkxRclServiceUiContextImpl() - { - FUNC_LOG; - - if( iTimer ) - { - iTimer->Cancel(); - } - delete iTimer; - - iQueryText.Close(); - iQueryCriteria.Close(); - - CCoeEnv::Static()->DeleteResourceFile( iResourceFileOffset ); - - iContactCards.Reset(); - iSearchResults.ResetAndDestroy(); - iWaitObjects.ResetAndDestroy(); - delete iContactEngine; - - delete iActionServiceWrapper; - - delete iAccount; - delete iSession; - delete iAdapter; - delete iEnvImpl; - - delete iEventScheduler; - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::ConstructL() - { - FUNC_LOG; - - CCoeEnv* coeEnv = CCoeEnv::Static(); - - TFileName dllFileName; - Dll::FileName( dllFileName ); - - TParse parse; - parse.Set( KResourceFile, &KDC_APP_RESOURCE_DIR, &dllFileName ); - TFileName resourceFile = parse.FullName(); - BaflUtils::NearestLanguageFile( coeEnv->FsSession(), resourceFile ); - - TRAPD( status, - iResourceFileOffset = coeEnv->AddResourceFileL( resourceFile ) ); - - if( status != KErrNone ) - { - PbkxRclPanic( EPbkxRclPanicGeneral ); - } - else - { - } - - // create default contact engine to use to create CPbkContactItems - iContactEngine = CPbkContactEngine::NewL(); - - // create actions service wrapper used by UI views - iActionServiceWrapper = CPbkxRclActionServiceWrapper::NewL( *iContactEngine ); - - iActionServiceWrapper->SetContactSelectorMode( - iMode == EModeContactSelector ); - - // Create objects needed for executing the search - iEnvImpl = CPbkxRclProtocolEnvImpl::NewL(); - - iAdapter = CPbkxRemoteContactLookupProtocolAdapter::NewL( - iAccountId.iProtocolUid, - *iEnvImpl ); - - iAccount = iAdapter->NewProtocolAccountL( iAccountId ); - - if ( iAccount == NULL ) - { - User::Leave( KErrNotFound ); - } - - iSession = iAdapter->NewSessionL(); - iSession->InitializeL( *this, iAccountId ); - - iEventScheduler = CPbkxRclEventScheduler::NewL( *this ); - - iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::GetSelectedContactL -// --------------------------------------------------------------------------- -// -CContactItem* CPbkxRclServiceUiContextImpl::GetSelectedContactL() - { - FUNC_LOG; - __ASSERT_ALWAYS( iSelectedIndex >= 0 && iSelectedIndex < iContactCards.Count(), - PbkxRclPanic( EPbkxRclPanicGeneral ) ); - CContactCard* selected = iContactCards[iSelectedIndex]; - CContactCard* copy = CContactCard::NewL( selected ); - return copy; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::GetResultByIndex -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupProtocolResult* -CPbkxRclServiceUiContextImpl::GetResultByIndex( TInt aIndex ) - { - __ASSERT_ALWAYS( aIndex >= 0 && aIndex < iContactCards.Count(), - PbkxRclPanic( EPbkxRclPanicGeneral ) ); - - CContactCard* card = iContactCards[aIndex]; - CPbkxRemoteContactLookupProtocolResult* result = NULL; - for ( TInt i = 0; i < iSearchResults.Count(); i++ ) - { - if ( card == &( iSearchResults[i]->ContactItem() ) ) - { - result = iSearchResults[i]; - break; - } - } - - __ASSERT_ALWAYS( result != NULL, PbkxRclPanic( EPbkxRclPanicGeneral ) ); - - return result; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ExecuteL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::ExecuteL( const TDesC& aQueryText, TResult& aResult ) - { - FUNC_LOG; - - // set state as initial - ResetState(); - SetState( EInitial ); - iExitCode = KErrNone; - - iSearchResults.ResetAndDestroy(); - - iQueryCriteria.Close(); - iQueryCriteria.CreateL( KRclQueryTextMaxLength ); - iQueryCriteria = aQueryText.Left( KRclQueryTextMaxLength ); - - iResult = &aResult; - - TOperation op = ( iMode != EModeExistingCriteria ) ? - EOpenSearchQueryDefault : EExecuteSearchWithNoQuery; - - AddOperation( op ); - - StartActiveWaitL( EMainWait ); - - - HandleContextExitL(); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::LooseSearchCompleted -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::LooseSearchCompleted( - TInt aStatus, - RPointerArray& aResults ) - { - FUNC_LOG; - - // - TRAPD( err, DoLooseSearchCompletedL( aStatus, aResults ) ); - if ( err != KErrNone ) - { - HandleError( err ); - } - // - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ContactFieldsRetrievalCompleted -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::ContactFieldsRetrievalCompleted( TInt aStatus ) - { - FUNC_LOG; - - // - TRAPD( err, DoContactFieldsRetrievalCompletedL( aStatus ) ); - if ( err != KErrNone ) - { - HandleError( err ); - } - // - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::RetrieveDetailsL -// --------------------------------------------------------------------------- -// -CContactCard* CPbkxRclServiceUiContextImpl::RetrieveDetailsL( - TInt aContactIndex, - const TDesC& aWaitNoteText ) - { - FUNC_LOG; - - CPbkxRemoteContactLookupProtocolResult* result = GetResultByIndex( aContactIndex ); - - CContactCard* card = static_cast( &result->ContactItem() ); - - if ( !result->IsComplete() ) - { - - RPointerArray array; - CleanupClosePushL( array ); - array.AppendL( result ); - - iSession->RetrieveContactFieldsL( array ); - - // Start time for time out event - iTimer->Start( - KTwoMinutesTimerInterval, KTwoMinutesTimerInterval, - TCallBack(TimerCallBack, this)); - - DisplayWaitDialogL( R_RCL_SEARCH_WAIT_DIALOG_CANCEL, aWaitNoteText ); - - // Start active wait. When contact retrieval is completed, - // ContactFieldsRetrievalCompleted is called. If user cancels - // retrieval, DialogDismissedL is called. TimeOut is called when time is out. - StartActiveWaitL( EContactRetrievalWait ); - - CleanupStack::PopAndDestroy( &array ); - - - // if contact retrieval was canceledor retrieval failed, - // result is not yet complete - if ( !result->IsComplete() ) - { - card = NULL; - } - - } - - return card; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ContactCount -// --------------------------------------------------------------------------- -// -TInt CPbkxRclServiceUiContextImpl::ContactCount() const - { - FUNC_LOG; - return iContactCards.Count(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::SetSelectedContact -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::SetSelectedContactL( TInt aIndex ) - { - FUNC_LOG; - iSearchResultDialog->SetCurrentItemIndexL( aIndex ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::EventTriggered -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::EventTriggered() - { - FUNC_LOG; - - // - TRAPD( err, DoHandleOperationL() ); - if ( err != KErrNone ) - { - HandleError( err ); - } - // - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ProcessCommandL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::ProcessCommandL( TInt aCommandId ) - { - FUNC_LOG; - - // some commands are handled the same way no matter which dialog is on top - TBool handled = ETrue; - - switch ( aCommandId ) - { - case ERclCmdVoiceCall: - iActionServiceWrapper->ExecuteActionL( - KFscAtComCallGSM ); - break; - case ERclCmdVideoCall: - iActionServiceWrapper->ExecuteActionL( - KFscAtComCallVideo ); - break; - case ERclCmdVoip: - iActionServiceWrapper->ExecuteActionL( - KFscAtComCallVoip ); - break; - case ERclCmdSendMsg: - iActionServiceWrapper->ExecuteActionL( - KFscAtComSendMsg ); - break; - - case ERclCmdSendEmail: - iActionServiceWrapper->ExecuteActionL( - KFscAtComSendEmail ); - break; - - case ERclCmdSendMeetingReq: - iActionServiceWrapper->ExecuteActionL( - KFscAtComSendCalReq ); - break; - case ERclCmdSendAudioMsg: - iActionServiceWrapper->ExecuteActionL( - KFscAtComSendAudio ); - break; - case ERclCmdToContact: - iActionServiceWrapper->ExecuteActionL( - KFscAtComCallPoc ); - break; - case ERclCmdHelp: - { - CCoeAppUi* appUi = CCoeEnv::Static()->AppUi(); - CArrayFix* contexts = appUi->AppHelpContextL(); - HlpLauncher::LaunchHelpApplicationL( - CCoeEnv::Static()->WsSession(), - contexts ); - } - break; - default: - handled = EFalse; - break; - } - - if ( !handled ) - { - if ( IsStateSet( EResultDlgOnTop ) ) - { - switch ( aCommandId ) - { - case ERclCmdAddAsRecipient: - // close the dialog, selected contact is stored in iSelectedContact - AddOperation( ECloseSearchResultDlg ); - SetState( EReturnToCaller ); - SetState( EResultSelected ); - break; - case ERclCmdViewDetails: - AddOperation( EOpenResultInfoDlg ); - break; - case ERclCmdNewSearch: - // open empty search query - AddOperation( EOpenSearchQueryEmpty ); - break; - case ERclCmdSendBusinessCard: - { - // first fetch details if they are not already - // fetched - HBufC* waitNoteText = StringLoader::LoadLC( - R_QTN_RCL_RETRIEVAL_WAIT_NOTE ); - if ( RetrieveDetailsL( - iSearchResultDialog->CurrentItemIndex(), - *waitNoteText ) != NULL ) - { - iSearchResultDialog->SendBusinessCardL(); - } - CleanupStack::PopAndDestroy( waitNoteText ); - } - break; - case ERclCmdSaveToContacts: - { - // first retrieve all the details - HBufC* waitNoteText = StringLoader::LoadLC( - R_QTN_RCL_SAVING_WAIT_NOTE ); - if ( RetrieveDetailsL( - iSearchResultDialog->CurrentItemIndex(), - *waitNoteText ) != NULL ) - { - - iActionServiceWrapper->ExecuteActionL( - KFscAtManSaveAs ); - - // in contact selector mode, return to the calling - // application - if ( iMode == EModeContactSelector ) - { - AddOperation( ECloseSearchResultDlg ); - SetState( EReturnToCaller ); - SetState( EResultSelected ); - } - } - CleanupStack::PopAndDestroy( waitNoteText ); - } - break; - case EAknCmdExit: - iResult->iExitReason = TResult::EExitApplication; - AddOperation( ECloseSearchResultDlg ); - SetState( EReturnToCaller ); - break; - default: - break; - } - } - else if ( IsStateSet( EInfoDlgOnTop ) ) - { - switch ( aCommandId ) - { - case ERclCmdAddAsRecipient: - // close both dialogs, selected contact is in iSelectedContact - AddOperation( ECloseResultInfoDlg ); - AddOperation( ECloseSearchResultDlg ); - SetState( EResultSelected ); - SetState( EReturnToCaller ); - break; - case ERclCmdSendCallbackReq: - iResultInfoDialog->SendCallbackRequestL(); - break; - case ERclCmdCreateNew: - iActionServiceWrapper->ExecuteActionL( - KFscAtManSaveAs ); - // in contact selector mode, return to the calling - // application - if ( iMode == EModeContactSelector ) - { - AddOperation( ECloseResultInfoDlg ); - AddOperation( ECloseSearchResultDlg ); - SetState( EReturnToCaller ); - SetState( EResultSelected ); - } - break; - case ERclCmdUpdateExisting: - { - HBufC* resultText = - iResultInfoDialog->UpdateExistingContactL(); - if ( resultText != NULL ) - { - CleanupStack::PushL( resultText ); - DisplayNoteDialogL( - R_RCL_CONFIRMATION_NOTE, - *resultText, - ETrue ); - CleanupStack::PopAndDestroy( resultText ); - } - } - break; - case ERclCmdSendBusinessCard: - iResultInfoDialog->SendBusinessCardL(); - break; - case EAknCmdExit: - // again close both dialogs - AddOperation( ECloseResultInfoDlg ); - AddOperation( ECloseSearchResultDlg ); - SetState( EReturnToCaller ); - iResult->iExitReason = TResult::EExitApplication; - break; - default: - break; - } - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DialogDismissedL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DialogDismissedL( TInt aButtonId ) - { - FUNC_LOG; - - if ( aButtonId == EAknSoftkeyCancel ) - { - - // Action was canceled. Don't need to inform about errors - iExitCode = KErrNone; - // cancel search or detail retrieval - if (iSession) - { - iSession->Cancel(); - } - - // cancel time out timer - if (iTimer) - { - iTimer->Cancel(); - } - - // do actions based on state - if ( IsStateSet( EInitial ) ) - { - if ( iMode != EModeExistingCriteria ) - { - // show new search query dialog - AddOperation( EOpenSearchQueryDefault ); - } - else - { - // with existing criteria, exit - AddOperation( EExit ); - } - } - else if ( IsStateSet( EResultDlgOnTop ) ) - { - if ( iWaitObjects.Count() == EContactRetrievalWait + 1 ) - { - // contact retrieval was in progress - StopActiveWait( EContactRetrievalWait ); - } // else new search was in progress, no actions needed - } - else if ( IsStateSet( EInfoDlgOnTop ) ) - { - // details retrieval was in progress, stop active wait - StopActiveWait( EContactRetrievalWait ); - } - - } - else - { - // wait dialog closed by itself. exit now if exiting - if ( IsStateSet( EReturnToCaller ) && - ( IsStateSet( EResultSelected ) || IsStateSet( EInitial ) ) ) - { - AddOperation( EExit ); - } - - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ExecuteSearchL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::ExecuteSearchL( - TBool aShowQueryDialog, - const TDesC& aQueryText ) - { - FUNC_LOG; - - - iQueryText.Close(); - iQueryText.CreateMaxL( KRclQueryTextMaxLength ); - iQueryText = aQueryText; - - TBool result = EFalse; - if ( aShowQueryDialog ) - { - CPbkxRclQueryEditor* queryEditor = CPbkxRclQueryEditor::NewL( - iAccount->Name(), - iQueryText ); - result = queryEditor->ExecuteDialogLD(); - - // save initial query text given by user - if ( !IsStateSet( EResultDlgOnTop ) ) - { - iQueryCriteria = iQueryText; - } - } - else - { - result = ETrue; - } - - if ( result ) - { - - // Start time for time out event - iTimer->Start( - KTwoMinutesTimerInterval, KTwoMinutesTimerInterval, - TCallBack(TimerCallBack, this)); - - // execute search based on query text - // use KMaxMatches + 1 to be able to catch "too many results error" - iSession->LooseSearchL( iQueryText, KMaxMatches + 1 ); - HBufC* text = StringLoader::LoadLC( R_QTN_RCL_SEARCH_WAIT_NOTE, iQueryText ); - DisplayWaitDialogL( R_RCL_SEARCH_WAIT_DIALOG_CANCEL, *text ); - CleanupStack::PopAndDestroy( text ); - } - else - { - if ( !IsStateSet( EResultDlgOnTop ) ) - { - AddOperation( EExit ); - } // otherwise just return to search result dlg - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DisplayWaitDialogL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DisplayWaitDialogL( - TInt aDialogResourceId, - const TDesC& aText ) - { - FUNC_LOG; - - iWaitDialog = new ( ELeave ) CAknWaitDialog( NULL, ETrue ); - iWaitDialog->SetTextL( aText ); - iWaitDialog->SetCallback( this ); - iWaitDialog->ExecuteLD( aDialogResourceId ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DisplayNoteDialogL -// --------------------------------------------------------------------------- -// -TBool CPbkxRclServiceUiContextImpl::DisplayNoteDialogL( - TInt aDialogResourceId, - const TDesC& aText, - TBool aTimeout ) - { - FUNC_LOG; - CAknNoteDialog* dialog = NULL; - - if ( aTimeout ) - { - dialog = new ( ELeave ) CAknNoteDialog( - CAknNoteDialog::ENoTone, - CAknNoteDialog::ELongTimeout ); - } - else - { - dialog = new ( ELeave ) CAknNoteDialog(); - } - - dialog->PrepareLC( aDialogResourceId ); - dialog->SetTextL( aText ); - - TBool ret = ( TBool )dialog->RunLD(); - - - return ret; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DisplayQueryDialogL -// --------------------------------------------------------------------------- -// -//Fix for: EASV-7KFGG3 -TBool CPbkxRclServiceUiContextImpl::DisplayQueryDialogL( - TInt aDialogResourceId, - const TDesC& aText ) - { - FUNC_LOG; - CAknQueryDialog* dialog = NULL; - - dialog = new ( ELeave ) CAknQueryDialog(); - dialog->PrepareLC( aDialogResourceId ); - dialog->SetPromptL( aText ); - - TBool ret = ( TBool )dialog->RunLD(); - - - return ret; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::CloseWaitDialogL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::CloseWaitDialogL() - { - FUNC_LOG; - iWaitDialog->ProcessFinishedL(); - iWaitDialog = NULL; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DisplaySearchResultDialogL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DisplaySearchResultDialogL() - { - FUNC_LOG; - - if ( iSearchResultDialog == NULL ) - { - // no search result dialog on screen, show new one - - // result array holds list box items and it is filled inside search - // result dialog - CDesCArrayFlat* resultArray = - new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - CleanupStack::PushL( resultArray ); - - TBool contactSelectorEnabled = iMode == EModeContactSelector; - - iSearchResultDialog = CPbkxRclSearchResultDlg::NewL( - iSelectedIndex, - resultArray, - this, - iContactCards, - *iContactEngine, - *iActionServiceWrapper, - contactSelectorEnabled ); - - UnsetState( EInitial ); - SetState( EResultDlgOnTop ); - - // set action service mode - iActionServiceWrapper->SetActionMenuMode( ETrue ); - - iSearchResultDialog->ExecuteLD(); - - iActionServiceWrapper->SetActionMenuMode( EFalse ); - - - iSearchResultDialog = NULL; - - CleanupStack::PopAndDestroy( resultArray ); - - HandleSearchResultDialogExitL(); - - UnsetState( EResultDlgOnTop ); - SetState( EInitial ); - } - else - { // iSearchResultDialog != NULL - - - iSearchResultDialog->UpdateDialogL(); - } - } -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DisplayResultInfoDialogL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DisplayResultInfoDialogL() - { - FUNC_LOG; - - // items array holds the list box items in result info dialog and it is filled - // result info dialog - CDesCArrayFlat* items = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - CleanupStack::PushL( items ); - - TInt index = 0; - - TBool contactSelectorEnabled = iMode == EModeContactSelector; - - TInt itemIndex = iSearchResultDialog->CurrentItemIndex(); - - // creation fails if item details cannot be retrieved or user cancels - // retrieval - iResultInfoDialog = CPbkxRclResultInfoDlg::NewL( - index, - items, - this, - this, - *iContactEngine, - *iActionServiceWrapper, - contactSelectorEnabled, - itemIndex ); - - UnsetState( EResultDlgOnTop ); - SetState( EInfoDlgOnTop ); - - // set action service mode - iActionServiceWrapper->SetActionMenuMode( EFalse ); - - //Fix for: PKAO-7NNCJ2 - if ( iSearchResultDialog ) - { - iSearchResultDialog->InfoDlgVisible( ETrue ); - } - - iResultInfoDialog->ExecuteLD(); - - // update action service since now search result dialog is on top - iActionServiceWrapper->SetActionMenuMode( ETrue ); - - if ( !IsStateSet( EReturnToCaller ) && iResult->iExitReason != TResult::EExitApplication ) - { - iSearchResultDialog->SetCurrentContactToActionServiceL(); - } - - //Fix for: PKAO-7NNCJ2 - if ( iSearchResultDialog ) - { - iSearchResultDialog->InfoDlgVisible( EFalse ); - } - - iResultInfoDialog = NULL; - - UnsetState( EInfoDlgOnTop ); - SetState( EResultDlgOnTop ); - - CleanupStack::PopAndDestroy( items ); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::CreateContactCardArray -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::CreateContactCardArray() - { - FUNC_LOG; - - // remove possible old contact cards - iContactCards.Reset(); - - - for ( TInt i = 0; i < iSearchResults.Count(); i++ ) - { - CContactItem& item = iSearchResults[i]->ContactItem(); - CContactCard* card = dynamic_cast( &item ); - if ( card != NULL ) - { - iContactCards.Append( card ); - } - } - - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DoLooseSearchCompletedL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DoLooseSearchCompletedL( - TInt aStatus, - RPointerArray& aResults ) - { - FUNC_LOG; - - // cancel time out timer - if (iTimer) - { - iTimer->Cancel(); - } - - CloseWaitDialogL(); - - if ( aStatus == KErrNone ) - { - if ( aResults.Count() > KMaxMatches ) - { - - HBufC* text = StringLoader::LoadLC( - R_QTN_RCL_TOO_MANY_RESULTS_NOTE, - KMaxMatches ); - - TBool ret = DisplayQueryDialogL( - R_RCL_CONFIRMATION_NOTE_OK_REFINE, - *text ); - - CleanupStack::PopAndDestroy( text ); - - if ( !ret ) - { - // user wants new search - AddOperation( EOpenSearchQueryDefault ); - - // reset the old results - aResults.ResetAndDestroy(); - return; - } - } - - // delete old results - iSearchResults.ResetAndDestroy(); - TInt count = aResults.Count() <= KMaxMatches ? aResults.Count() : KMaxMatches; - for ( TInt i = 0; i < count; i++ ) - { - iSearchResults.AppendL( aResults[i] ); - } - - // delete the extra results - for ( TInt j = aResults.Count() - 1; j >= KMaxMatches; j-- ) - { - delete aResults[j]; - aResults.Remove( j ); - } - - CreateContactCardArray(); - TLinearOrder sort( CPbkxRclServiceUiContextImpl::Sort ); - iContactCards.Sort( sort ); - - AddOperation( EOpenSearchResultDlg ); - } - else - { - - // reset the array just in case - aResults.ResetAndDestroy(); - - // remote contact lookup failed, exit - HandleError( aStatus ); - - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DoContactFieldsRetrievalCompletedL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DoContactFieldsRetrievalCompletedL( TInt aStatus ) - { - FUNC_LOG; - - // cancel time out timer - if (iTimer) - { - iTimer->Cancel(); - } - - StopActiveWait( EContactRetrievalWait ); - - CloseWaitDialogL(); - - if ( aStatus != KErrNone ) - { - // error occurred, so contact is not complete. this is checked - // in RetrieveContactDetailsL method and it returns NULL - // to the caller - - // exit application - HandleError( aStatus ); - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::DoHandleOperationL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::DoHandleOperationL() - { - FUNC_LOG; - - if ( iOperations.Count() > 0 ) - { - TOperation operation = iOperations.Pop(); - - - switch ( operation ) - { - case EOpenSearchResultDlg: - DisplaySearchResultDialogL(); - break; - case EOpenResultInfoDlg: - DisplayResultInfoDialogL(); - break; - case ECloseSearchResultDlg: - if ( iSearchResultDialog != NULL ) - { - iSearchResultDialog->Close(); - } - break; - case ECloseResultInfoDlg: - if ( iResultInfoDialog != NULL ) - { - iResultInfoDialog->Close(); - } - break; - case EOpenSearchQueryDefault: - ExecuteSearchL( ETrue, iQueryCriteria ); - break; - case EOpenSearchQueryEmpty: - ExecuteSearchL( ETrue, KNullDesC ); - break; - case EExecuteSearchWithNoQuery: - ExecuteSearchL( EFalse, iQueryCriteria ); - break; - case EExit: - StopActiveWait( EMainWait ); - break; - default: - PbkxRclPanic( EPbkxRclPanicGeneral ); - break; - } - - if ( iOperations.Count() > 0 ) - { - iEventScheduler->TriggerEvent(); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::HandleSearchResultDialogExitL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::HandleSearchResultDialogExitL() - { - FUNC_LOG; - - // this flag is set if wait dialog on the screen and we cannot exit before - // wait dialog is closed itself - TBool waitDlgOnScreen = EFalse; - - if ( IsStateSet( EResultSelected ) ) - { - // if contact details are not retrieved, we must do that before exiting - CPbkxRemoteContactLookupProtocolResult* result = GetResultByIndex( iSelectedIndex ); - if ( !result->IsComplete() ) - { - HBufC* text = StringLoader::LoadLC( R_QTN_RCL_RETRIEVAL_WAIT_NOTE ); - RetrieveDetailsL( iSelectedIndex, *text ); - CleanupStack::PopAndDestroy( text ); - - // if wait dialog is NULL, it is closed by CloseWaitDialogL method - // and not by user. so it is still on the screen - waitDlgOnScreen = iWaitDialog == NULL; - - // make sure we succeeded in detail retrieving. if not, return nothing. - if ( result->IsComplete() ) - { - iResult->iSelectedContactItem = GetSelectedContactL(); - } - } - else - { - iResult->iSelectedContactItem = GetSelectedContactL(); - } - } - - if ( !waitDlgOnScreen ) - { - // exit - - AddOperation( EExit ); - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::HandleContextExitL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::HandleContextExitL() - { - FUNC_LOG; - - // set exit reason - if ( iResult->iExitReason == TResult::EExitUndefined ) - { - if ( iExitCode != KErrNone ) - { - iResult->iExitReason = TResult::EExitError; - } - else if ( iResult->iSelectedContactItem != NULL ) - { - iResult->iExitReason = TResult::EExitContactSelected; - } - else - { - iResult->iExitReason = TResult::EExitUserClosed; - } - } - - if ( iExitCode != KErrNone ) - { - // show error note - CTextResolver* resolver = CTextResolver::NewLC( *( CCoeEnv::Static() ) ); - - // on return, contains information about the loaded error text - TUint textFlags; - TInt textId; - - const TDesC& errorText = resolver->ResolveErrorString( - iExitCode, - textId, - textFlags, - CTextResolver::ECtxNoCtxNoSeparator ); - - if ( textFlags & EErrorResBlankErrorFlag || - textFlags & ETextResolverUnknownErrorFlag ) - { - // show general error message, because there was no good error - // message available - HBufC* text = StringLoader::LoadLC( R_QTN_RCL_ERROR_NOTE ); - DisplayNoteDialogL( R_RCL_WARNING_NOTE, *text, ETrue ); - CleanupStack::PopAndDestroy( text ); - } - else - { - DisplayNoteDialogL( R_RCL_WARNING_NOTE, errorText, ETrue ); - } - CleanupStack::PopAndDestroy( resolver ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::StartActiveWaitL -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::StartActiveWaitL( TWaitObjectIndex aIndex ) - { - FUNC_LOG; - - if ( aIndex != iWaitObjects.Count() ) - { - // wait object index invalid, panic - PbkxRclPanic( EPbkxRclPanicGeneral ); - } - - // starts new active wait and appends it in the list of wait objects - CActiveSchedulerWait* wait = new ( ELeave ) CActiveSchedulerWait(); - CleanupStack::PushL( wait ); - iWaitObjects.AppendL( wait ); - CleanupStack::Pop( wait ); - wait->Start(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::StopActiveWait -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::StopActiveWait( TWaitObjectIndex aIndex ) - { - FUNC_LOG; - if ( iWaitObjects.Count() != aIndex + 1 ) - { - // invalid wait object count, panic - PbkxRclPanic( EPbkxRclPanicGeneral ); - } - - // stops active wait of the most recently started wait - CActiveSchedulerWait* wait = iWaitObjects[aIndex]; - iWaitObjects.Remove( aIndex ); - wait->AsyncStop(); - delete wait; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::SetState -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::SetState( TState aState ) - { - FUNC_LOG; - iState |= aState; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::UnsetState -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::UnsetState( TState aState ) - { - FUNC_LOG; - iState &= ~aState; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::IsStateSet -// --------------------------------------------------------------------------- -// -TBool CPbkxRclServiceUiContextImpl::IsStateSet( TState aState ) - { - FUNC_LOG; - return ( iState & aState ) != 0; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::ResetState -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::ResetState() - { - FUNC_LOG; - iState = 0; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::AddOperation -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::AddOperation( TOperation aOperation ) - { - FUNC_LOG; - iOperations.Add( aOperation ); - iEventScheduler->TriggerEvent(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::HandleError -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::HandleError( TInt aError ) - { - FUNC_LOG; - iExitCode = aError; - SetState( EReturnToCaller ); - if ( IsStateSet( EInfoDlgOnTop ) ) - { - AddOperation( ECloseResultInfoDlg ); - AddOperation( ECloseSearchResultDlg ); - } - else if ( IsStateSet( EResultDlgOnTop ) ) - { - AddOperation( ECloseSearchResultDlg ); - } - - // If dialog is NULL and state is EInitial & EReturnToCaller - // EExit operation is added in DialogDismissedL callback - if ( !iWaitDialog && IsStateSet( EInitial ) && IsStateSet( EReturnToCaller ) ) - { - return; - } - else - { - AddOperation( EExit ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::Sort -// --------------------------------------------------------------------------- -// -TInt CPbkxRclServiceUiContextImpl::Sort( - const CContactCard& aFirst, - const CContactCard& aSecond ) - { - FUNC_LOG; - - TPtrC lastName1 = PbkxRclUtils::FieldText( &aFirst, KUidContactFieldFamilyName ); - TPtrC lastName2 = PbkxRclUtils::FieldText( &aSecond, KUidContactFieldFamilyName ); - - TInt ret = 0; - if ( lastName1 < lastName2 ) - { - ret = -1; - } - else if ( lastName1 > lastName2 ) - { - ret = 1; - } - return ret; - } - -// ---------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::TimerCallBack -// ---------------------------------------------------------------------------- -// -TInt CPbkxRclServiceUiContextImpl::TimerCallBack(TAny* aAny) - { - FUNC_LOG; - CPbkxRclServiceUiContextImpl* self = static_cast( aAny ); - self->TimeOut(); - return KErrNone; - } - -// ---------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::TimeOut -// ---------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::TimeOut() - { - FUNC_LOG; - iTimer->Cancel(); - - if (iSession) - { - iSession->Cancel(); - } - - if (IsStateSet( EInfoDlgOnTop ) || IsStateSet( EResultDlgOnTop )) - { - StopActiveWait( EContactRetrievalWait ); - } - - TRAP_IGNORE( CloseWaitDialogL() ); - HandleError( KErrTimedOut ); - } - -////////////////////////////////////////////////////////////////////////////// -// TOperationQueue class definition -////////////////////////////////////////////////////////////////////////////// - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::TOperationQueue::TOperationQueue -// --------------------------------------------------------------------------- -// -CPbkxRclServiceUiContextImpl::TOperationQueue::TOperationQueue() : - iCurrent( 0 ), iCount( 0 ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::TOperationQueue::Add -// --------------------------------------------------------------------------- -// -void CPbkxRclServiceUiContextImpl::TOperationQueue::Add( TOperation aOperation ) - { - FUNC_LOG; - if ( iCount == KMaxOperations ) - { - PbkxRclPanic( EPbkxRclPanicGeneral ); - } - - TBool exists = EFalse; - for ( TInt i = iCurrent, count = 0; - count < iCount; - ( ++i ) % KMaxOperations, count++ ) - { - if ( iOperations[i] == aOperation ) - { - exists = ETrue; - break; - } - } - - if ( !exists ) - { - TInt newIndex = ( iCurrent + iCount ) % KMaxOperations; - iOperations[newIndex] = aOperation; - iCount++; - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclServiceUiContextImpl::TOperationQueue::Pop -// --------------------------------------------------------------------------- -// -CPbkxRclServiceUiContextImpl::TOperation -CPbkxRclServiceUiContextImpl::TOperationQueue::Pop() - { - if ( iCount > 0 ) - { - TOperation op = iOperations[iCurrent]; - iOperations[iCurrent] = ENoOperation; - iCount--; - - if ( iCount > 0 ) - { - iCurrent = ( ++iCurrent ) % KMaxOperations; - } - else - { - iCurrent = 0; - } - return op; - } - else - { - return ENoOperation; - } - } - -TInt CPbkxRclServiceUiContextImpl::TOperationQueue::Count() const - { - FUNC_LOG; - return iCount; - } - - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclsettingitem.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclsettingitem.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclSettingItem. -* -*/ - - -#include "emailtrace.h" -#include -#include -// -#include "cpbkxremotecontactlookupprotocoladapter.h" -#include "cpbkxremotecontactlookupprotocolaccount.h" -// -#include -#include -#include - -#include "cpbkxrclsettingitem.h" -#include "pbkxrclutils.h" -#include "cpbkxrclprotocolenvimpl.h" -#include "pbkxrclengineconstants.h" -#include "pbkxremotecontactlookuppanic.h" - -// S60 UID update -const TInt KPbkxRemoteContactLookupAdapterIfUid = 0x2001FE1F; -// - -_LIT( KEmpty, "Empty" ); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclSettingItem* CPbkxRclSettingItem::NewL() - { - FUNC_LOG; - CPbkxRclSettingItem* item = CPbkxRclSettingItem::NewLC(); - CleanupStack::Pop( item ); - return item; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclSettingItem* CPbkxRclSettingItem::NewLC() - { - FUNC_LOG; - CPbkxRclSettingItem* item = new ( ELeave ) CPbkxRclSettingItem(); - CleanupStack::PushL( item ); - item->ConstructL(); - return item; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::CPbkxRclSettingItem -// --------------------------------------------------------------------------- -// -CPbkxRclSettingItem::CPbkxRclSettingItem() : - CAknEnumeratedTextPopupSettingItem( KPbkxRclSettingItemId, iSelectedItem ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::~CPbkxRclSettingItem -// --------------------------------------------------------------------------- -// -CPbkxRclSettingItem::~CPbkxRclSettingItem() - { - FUNC_LOG; - iProtocolAccounts.ResetAndDestroy(); - CCoeEnv::Static()->DeleteResourceFile( iResourceFileOffset ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingItem::ConstructL() - { - FUNC_LOG; - - // first load resource file - CCoeEnv* coeEnv = CCoeEnv::Static(); - TFileName dllFileName; - Dll::FileName( dllFileName ); - - TParse parse; - parse.Set( KResourceFile, &KDC_APP_RESOURCE_DIR, &dllFileName ); - TFileName resourceFile = parse.FullName(); - BaflUtils::NearestLanguageFile( coeEnv->FsSession(), resourceFile ); - - TRAPD( status, - iResourceFileOffset = coeEnv->AddResourceFileL( resourceFile ) ); - - if( status != KErrNone ) - { - PbkxRclPanic( EPbkxRclPanicGeneral ); - } - else - { - } - - // set empty item text although it should not be used ever - SetEmptyItemTextL( KEmpty ); - - HBufC* settingName = StringLoader::LoadLC( R_QTN_RCL_SETTING_RCL_SERVER ); - - // call base class ConstructL, this will create stuff we need - CAknSettingItem::ConstructL( - EFalse, - KPbkxRclSettingItemId, - *settingName, - NULL, - R_RCL_SETTING_ITEM_PAGE, - -1, - 0, - R_RCL_POPUP_SETTING_TEXTS ); - - CleanupStack::PopAndDestroy( settingName ); - - // get text arrays - iEnumTexts = EnumeratedTextArray(); - iPoppedUpTexts = PoppedUpTextArray(); - - // get all accounts - LoadProtocolAccountsL(); - - // Fills enumeration and popup text array - FillTextArraysL(); - - // sets selected account - SetSelectedAccountL(); - - // load the selection - LoadL(); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::EditItemL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingItem::EditItemL( TBool aCalledFromMenu ) - { - FUNC_LOG; - TInt oldSelection = iSelectedItem; - CAknEnumeratedTextPopupSettingItem::EditItemL( aCalledFromMenu ); - StoreL(); - - if ( oldSelection != iSelectedItem ) - { - StoreSettingL(); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::LoadProtocolAccountsL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingItem::LoadProtocolAccountsL() - { - FUNC_LOG; - - // create environment given to plugins - CPbkxRclProtocolEnvImpl* env = CPbkxRclProtocolEnvImpl::NewLC(); - - // load all adapter information - RImplInfoPtrArray implArray; - TUid pluginIfUid = {KPbkxRemoteContactLookupAdapterIfUid }; - REComSession::ListImplementationsL( pluginIfUid, implArray ); - - // create adapters - CPbkxRemoteContactLookupProtocolAdapter* adapter = NULL; - for ( TInt i = 0; i < implArray.Count(); i++ ) - { - TRAPD( err, - { - adapter = CPbkxRemoteContactLookupProtocolAdapter::NewL( - implArray[i]->ImplementationUid(), - *env ); - CleanupStack::PushL( adapter ); - adapter->GetAllProtocolAccountsL( iProtocolAccounts ); - CleanupStack::PopAndDestroy( adapter ); - } ); - if ( err != KErrNone ) - { - // log error - } - } - - implArray.ResetAndDestroy(); - CleanupStack::PopAndDestroy( env ); - - // if no protocol accounts found, leave - if ( iProtocolAccounts.Count() == 0 ) - { - User::Leave( KErrNotReady ); - } - - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::FillTextArraysL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingItem::FillTextArraysL() - { - FUNC_LOG; - - // add "none" selection in first place - HBufC* noneText = StringLoader::LoadLC( R_QTN_RCL_SETTING_RCL_NOT_DEFINED ); - - CAknEnumeratedText* enumItem = - new ( ELeave ) CAknEnumeratedText( 0, noneText ); - CleanupStack::PushL( enumItem ); - iEnumTexts->AppendL( enumItem ); - CleanupStack::Pop( enumItem ); - CleanupStack::Pop( noneText ); - - HBufC* notDefinedText = - StringLoader::LoadLC( R_QTN_RCL_SETTING_RCL_SERVER_NONE ); - - iPoppedUpTexts->AppendL( notDefinedText ); - - CleanupStack::Pop( notDefinedText ); - - for ( TInt i = 0; i < iProtocolAccounts.Count(); i++ ) - { - CPbkxRemoteContactLookupProtocolAccount* account = iProtocolAccounts[i]; - TUint accountId = account->Id().iAccountId; - const TDesC& accountName = account->Name(); - enumItem = - new ( ELeave ) CAknEnumeratedText( i + 1, accountName.AllocL() ); - CleanupStack::PushL( enumItem ); - iEnumTexts->AppendL( enumItem ); - iPoppedUpTexts->AppendL( accountName.AllocL() ); - CleanupStack::Pop( enumItem ); - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::SetSelectedAccountL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingItem::SetSelectedAccountL() - { - FUNC_LOG; - TPbkxRemoteContactLookupProtocolAccountId id = - PbkxRclUtils::DefaultProtocolAccountIdL(); - - if ( id.iProtocolUid == KNullUid ) - { - // no default account selected - iSelectedItem = 0; - } - else - { - for ( TInt i = 0; i < iProtocolAccounts.Count(); i++ ) - { - if ( iProtocolAccounts[i]->Id().iProtocolUid == id.iProtocolUid && - iProtocolAccounts[i]->Id().iAccountId == id.iAccountId ) - { - iSelectedItem = i + 1; - break; - } - } - - if ( iSelectedItem == 0 ) - { - // adapter stored in cenrep not found, store new value - StoreSettingL(); - } - } - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingItem::StoreSettingL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingItem::StoreSettingL() - { - FUNC_LOG; - if ( iSelectedItem == 0 ) - { - // none selected - TPbkxRemoteContactLookupProtocolAccountId emptyId( TUid::Uid( 0 ), 0 ); - PbkxRclUtils::StoreDefaultProtocolAccountIdL( emptyId ); - } - else - { - // none selection is not in the array, so decrease by one - CPbkxRemoteContactLookupProtocolAccount* account = - iProtocolAccounts[iSelectedItem - 1]; - PbkxRclUtils::StoreDefaultProtocolAccountIdL( account->Id() ); - } - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclsettingsengine.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclsettingsengine.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclSettingsEngine. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include "cpbkxrclsettingsengine.h" -#include "pbkxrclsettings.hrh" -#include "cpbkxremotecontactlookupprotocoladapter.h" -#include "cpbkxrclsettingitem.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclSettingsEngine::CPbkxRclSettingsEngine -// --------------------------------------------------------------------------- -// -CPbkxRclSettingsEngine::CPbkxRclSettingsEngine() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingsEngine::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclSettingsEngine::ConstructL() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingsEngine::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CPbkxRclSettingsEngine* CPbkxRclSettingsEngine::NewL() - { - FUNC_LOG; - CPbkxRclSettingsEngine* self = CPbkxRclSettingsEngine::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingsEngine::NewLC -// --------------------------------------------------------------------------- -// -EXPORT_C CPbkxRclSettingsEngine* CPbkxRclSettingsEngine::NewLC() - { - FUNC_LOG; - CPbkxRclSettingsEngine* self = new( ELeave ) CPbkxRclSettingsEngine; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingsEngine::~CPbkxRclSettingsEngine -// --------------------------------------------------------------------------- -// -CPbkxRclSettingsEngine::~CPbkxRclSettingsEngine() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclSettingsEngine::NewDefaultProtocolAccountSelectorSettingItemL -// --------------------------------------------------------------------------- -// -CAknSettingItem* CPbkxRclSettingsEngine::NewDefaultProtocolAccountSelectorSettingItemL() const - { - FUNC_LOG; - return CPbkxRclSettingItem::NewL(); - } - - - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,320 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRclvCardSender. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cpbkxrclvcardsender.h" -#include "cpbkxrclcontactconverter.h" -#include "pbkxrclengineconstants.h" -#include "pbkxremotecontactlookuppanic.h" - -// temp file created for the business card to be sent -// file path is not hardcoded -_LIT( KVcardExtension, ".vcf" ); -#include -// - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::NewL -// --------------------------------------------------------------------------- -// -CPbkxRclvCardSender* CPbkxRclvCardSender::NewL( - CPbkContactEngine& aContactEngine ) - { - FUNC_LOG; - CPbkxRclvCardSender* sender = CPbkxRclvCardSender::NewLC( aContactEngine ); - CleanupStack::Pop( sender ); - return sender; - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::NewLC -// --------------------------------------------------------------------------- -// -CPbkxRclvCardSender* CPbkxRclvCardSender::NewLC( - CPbkContactEngine& aContactEngine ) - { - FUNC_LOG; - CPbkxRclvCardSender* sender = new ( ELeave ) CPbkxRclvCardSender(); - CleanupStack::PushL( sender ); - sender->ConstructL( aContactEngine ); - return sender; - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::CPbkxRclvCardSender -// --------------------------------------------------------------------------- -// -CPbkxRclvCardSender::CPbkxRclvCardSender() : CBase() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::~CPbkxRclvCardSender -// --------------------------------------------------------------------------- -// -CPbkxRclvCardSender::~CPbkxRclvCardSender() - { - FUNC_LOG; - delete iSendUi; - delete iCardEngine; - delete iFilter; - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::ConstructL -// --------------------------------------------------------------------------- -// -void CPbkxRclvCardSender::ConstructL( CPbkContactEngine& aContactEngine ) - { - FUNC_LOG; - iEikEnv = CEikonEnv::Static(); - - __ASSERT_ALWAYS( iEikEnv != NULL, PbkxRclPanic( EPbkxRclPanicGeneral ) ); - - iSendUi = CSendUi::NewL(); - iCardEngine = CBCardEngine::NewL( &aContactEngine ); - CreateFilterL(); - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::SendvCardL -// --------------------------------------------------------------------------- -// -void CPbkxRclvCardSender::SendvCardL( - CPbkContactItem& aContactItem, - CPbkxRclContactConverter& aContactConverter ) - { - FUNC_LOG; - User::LeaveIfError( GetTemporaryFileNameL( iTempFileName, aContactItem ) ); - CreateTempFileL( aContactItem, aContactConverter ); - - TUid mtmUid = iSendUi->ShowSendQueryL( - NULL, - KCapabilitiesForAllServices, - iFilter ); - - if ( mtmUid == KNullUid ) - { - // user pressed cancel - DestroyTempFileL(); - return; - } - - CMessageData* messageData = CMessageData::NewLC(); - - // - RFs fs; - RFile attachament; - - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - User::LeaveIfError( attachament.Open( fs, iTempFileName, EFileShareAny ) ); - CleanupClosePushL( attachament ); - - messageData->AppendAttachmentHandleL( attachament ); - - // Send the message using Send Ui - iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard ); - - CleanupStack::PopAndDestroy( &attachament ); - CleanupStack::PopAndDestroy( &fs ); - CleanupStack::PopAndDestroy( messageData ); - - // - - DestroyTempFileL(); - - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::CreateTempFileL -// --------------------------------------------------------------------------- -// -void CPbkxRclvCardSender::CreateTempFileL( - CPbkContactItem& aContactItem, - CPbkxRclContactConverter& aContactConverter ) - { - FUNC_LOG; - RFileWriteStream stream; - User::LeaveIfError( - stream.Replace( - iEikEnv->FsSession(), - iTempFileName, // - EFileWrite ) ); - CleanupClosePushL( stream ); - // Convert and export to vcard - aContactConverter.ConvertAndExportContactL( aContactItem, stream ); - - stream.CommitL(); - CleanupStack::PopAndDestroy( &stream ); - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::DestroyTempFileL -// --------------------------------------------------------------------------- -// -void CPbkxRclvCardSender::DestroyTempFileL() - { - FUNC_LOG; - // - User::LeaveIfError( iEikEnv->FsSession().Delete( iTempFileName ) ); - // - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::CreateRichTextFromFileLC -// --------------------------------------------------------------------------- -// -CRichText* CPbkxRclvCardSender::CreateRichTextFromFileLC() - { - FUNC_LOG; - - // Common allocation granularity and buffer size for rich text and - // file reading - const TInt KBufSize = CEditableText::EDefaultTextGranularity; - - // Create a rich text object with default formatting - CRichText* richText = CRichText::NewL( - iEikEnv->SystemParaFormatLayerL(), - iEikEnv->SystemCharFormatLayerL(), - CEditableText::ESegmentedStorage, - KBufSize // Allocation granularity - ); - CleanupStack::PushL( richText ); - - // Open the file for reading - RFile file; - // take away double line break - User::LeaveIfError( file.Open( iEikEnv->FsSession(), - iTempFileName, // - EFileRead | EFileStream | EFileShareReadersOnly ) ); - // - CleanupClosePushL( file ); - - // Create two buffers: 8-bit for reading from file and 16-bit for - // converting to 16-bit format - HBufC8* buf8 = HBufC8::NewLC( KBufSize ); - TPtr8 ptr8 = buf8->Des(); - HBufC16* buf16 = HBufC16::NewLC( ptr8.MaxLength() ); - TPtr16 ptr16 = buf16->Des(); - - // Read, convert and append to rich text until the file ends - User::LeaveIfError( file.Read( ptr8 ) ); - while ( ptr8.Length() > 0 ) - { - ptr16.Copy( ptr8 ); - richText->InsertL( richText->DocumentLength(), ptr16 ); - User::LeaveIfError( file.Read( ptr8 ) ); - } - - // Cleanup and return - CleanupStack::PopAndDestroy( buf16 ); - CleanupStack::PopAndDestroy( buf8 ); - CleanupStack::PopAndDestroy( &file ); - return richText; - } - -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::CreateFilterL -// --------------------------------------------------------------------------- -// -void CPbkxRclvCardSender::CreateFilterL() - { - FUNC_LOG; - if ( iFilter == NULL ) - { - iFilter = new ( ELeave ) CArrayFixFlat( KArrayGranularity ); - } - else - { - iFilter->Reset(); - } - - const TUid KPostcardMtmUid = { KSenduiMtmPostcardUidValue }; - - iFilter->AppendL( KPostcardMtmUid ); // hide postcard - iFilter->AppendL( KSenduiMtmAudioMessageUid ); // hide audio message - - // Check must we disable SMS menuitem - if ( !iSendUi->CanSendBioMessage( KMsgBioUidVCard ) ) - { - iFilter->AppendL( KSenduiMtmSmsUid ); // hide SMS - } - - // Hide MMS if not supported - if ( !FeatureManager::FeatureSupported( KFeatureIdMMS ) ) - { - iFilter->AppendL(KSenduiMtmMmsUid); - } - - // Hide Email if not supported - if ( !FeatureManager::FeatureSupported( KFeatureIdEmailUi ) ) - { - iFilter->AppendL( KSenduiMtmSmtpUid ); - iFilter->AppendL( KSenduiMtmImap4Uid ); - iFilter->AppendL( KSenduiMtmPop3Uid ); - iFilter->AppendL( KSenduiMtmSyncMLEmailUid ); - } - - } -// hard coded paths removed -// --------------------------------------------------------------------------- -// CPbkxRclvCardSender::GetTemporaryFileName -// --------------------------------------------------------------------------- -// -TInt CPbkxRclvCardSender::GetTemporaryFileNameL( TFileName& aFileName, CPbkContactItem& aContactItem ) - { - TFileName KPath; - RFs fsSession; - TInt result = fsSession.Connect(); - if( result==KErrNone ) - { - fsSession.PrivatePath( KPath ); - TFindFile findFile( fsSession ); - aFileName = KPath; - result = findFile.FindByDir( KPath, KNullDesC ); - if (result != KErrNone ) //create path if doesn't exists - { - fsSession.CreatePrivatePath( TDriveUnit(PathInfo::PhoneMemoryRootPath() ) ); - result = findFile.FindByDir( KPath, KNullDesC ); - } - aFileName = findFile.File(); - aFileName.Append( *aContactItem.GetContactTitleL() ); // getting name from contact - aFileName.Append( KVcardExtension ); // postfix extension - fsSession.Close(); - } - return result; - } -// - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/engine/src/pbkxrclutils.cpp --- a/emailcontacts/remotecontactlookup/engine/src/pbkxrclutils.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class PbkxRclUtils. -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include - -#include "pbkxrclutils.h" -#include "pbkxrclsettings.hrh" -#include "pbkxrclengineconstants.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// PbkxRclUtils::FieldTextL -// --------------------------------------------------------------------------- -// -HBufC* PbkxRclUtils::FieldTextL( const CPbkContactItem* aItem, TPbkFieldId aId ) - { - FUNC_LOG; - - TPbkContactItemField* field = aItem->FindField( aId ); - if ( field != NULL ) - { - return PbkxRclUtils::FieldTextL( *field ); - } - return KNullDesC().AllocL(); - } - -// --------------------------------------------------------------------------- -// PbkxRclUtils::FieldTextL -// --------------------------------------------------------------------------- -// -HBufC* PbkxRclUtils::FieldTextL( TPbkContactItemField& aField ) - { - FUNC_LOG; - if ( aField.StorageType() == KStorageTypeText ) - { - TPtrC text = aField.Text(); - HBufC* textBuffer = HBufC::NewL( text.Length() ); - textBuffer->Des() = text; - return textBuffer; - } - else if ( aField.StorageType() == KStorageTypeDateTime ) - { - HBufC* textBuffer = HBufC::NewL( 50 ); - TPtr des = textBuffer->Des(); - TTime time = aField.Time(); - time.FormatL( des, _L("%D%M%Y%/0%1%/1%2%/2%3%/3") ); - return textBuffer; - } - else - { - return KNullDesC().AllocL(); - } - } - -// --------------------------------------------------------------------------- -// PbkxRclUtils::FieldText -// --------------------------------------------------------------------------- -// -TPtrC PbkxRclUtils::FieldText( const CContactCard* aCard, TFieldType aFieldType ) - { - FUNC_LOG; - CContactItemFieldSet& fields = aCard->CardFields(); - - TInt index = fields.Find( aFieldType ); - if ( index != KErrNotFound ) - { - const CContactItemField& field = fields[index]; - if ( field.StorageType() == KStorageTypeText ) - { - return field.TextStorage()->Text(); - } - } - TPtrC empty; - return empty; - } - -// --------------------------------------------------------------------------- -// PbkxRclUtils::DefaultProtocolAccountIdL -// --------------------------------------------------------------------------- -// -TPbkxRemoteContactLookupProtocolAccountId PbkxRclUtils::DefaultProtocolAccountIdL() - { - FUNC_LOG; - CRepository *cr = CRepository::NewLC( TUid::Uid( KPbkxRclCrUid ) ); - - TInt protocolUid( 0 ); - User::LeaveIfError( cr->Get( KPbkxRclProtocolUidKey, protocolUid ) ); - - TInt accountId( 0 ); - User::LeaveIfError( cr->Get( KPbkxRclAccountUidKey, accountId ) ); - - CleanupStack::PopAndDestroy( cr ); - - TPbkxRemoteContactLookupProtocolAccountId account( - TUid::Uid( protocolUid ), - accountId ); - - return account; - } - -// --------------------------------------------------------------------------- -// PbkxRclUtils::StoreDefaultProtocolAccountIdL -// --------------------------------------------------------------------------- -// -void PbkxRclUtils::StoreDefaultProtocolAccountIdL( - TPbkxRemoteContactLookupProtocolAccountId aId ) - { - FUNC_LOG; - CRepository* cr = CRepository::NewLC( TUid::Uid( KPbkxRclCrUid ) ); - TInt uidValue = aId.iProtocolUid.iUid; - TInt accountValue = ( TInt )aId.iAccountId; - - User::LeaveIfError( cr->Set( KPbkxRclProtocolUidKey, uidValue ) ); - User::LeaveIfError( cr->Set( KPbkxRclAccountUidKey, accountValue ) ); - - CleanupStack::PopAndDestroy( cr ); - } - -// --------------------------------------------------------------------------- -// PbkxRclUtils::IsAlphaString -// --------------------------------------------------------------------------- -// -TBool PbkxRclUtils::HasAlphaCharsInString( const TDesC& aText ) - { - FUNC_LOG; - for ( TInt i = 0; i < aText.Length(); i++ ) - { - TChar c( aText[i] ); - if ( c.IsAlpha() ) - { - return ETrue; - } - } - return ETrue; - } - -// --------------------------------------------------------------------------- -// PbkxRclUtils::CreateContactItemL -// --------------------------------------------------------------------------- -// -CPbkContactItem* PbkxRclUtils::CreateContactItemL( - CContactCard* aCard, - CPbkContactEngine& aEngine ) - { - FUNC_LOG; - CContactCard* copy = CContactCard::NewLC( aCard ); - - CPbkContactItem* contactItem = CPbkContactItem::NewL( - copy, - aEngine.FieldsInfo(), - aEngine.ContactNameFormat() ); - - CleanupStack::Pop( copy ); - - return contactItem; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/group/bld.inf --- a/emailcontacts/remotecontactlookup/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for Remote Contact Lookup Service -* -*/ - - -PRJ_PLATFORMS -WINSCW ARMV5 - -// SF path -#include -// -#include "../engine/group/bld.inf" -#include "../settingplugin/group/bld.inf" - -PRJ_EXPORTS -../inc/cpbkxremotecontactlookupenv.h |../../../inc/cpbkxremotecontactlookupenv.h -../inc/cpbkxremotecontactlookupenv.inl |../../../inc/cpbkxremotecontactlookupenv.inl -../inc/pbkxremotecontactlookupuid.hrh |../../../inc/pbkxremotecontactlookupuid.hrh -// Removed other exports or moved into subcomponents -// - -// per component stubs are removed and replaced by one stub under emailui. -//../data/pbkxremotecontactlookupstub.sis /epoc32/data/z/system/install/pbkxremotecontactlookupstub.sis -// -// -../rom/pbkxremotecontactlookup.iby CORE_APP_LAYER_IBY_EXPORT_PATH(pbkxremotecontactlookup.iby) -../rom/pbkxremotecontactlookupresources.iby CORE_APP_LAYER_IBY_EXPORT_PATH(pbkxremotecontactlookupresources.iby) -../rom/fscrclsetting.iby CORE_APP_LAYER_IBY_EXPORT_PATH(fscrclsetting.iby) - -// Generic configuration interface for component cenrep settings -// component_1000292B implementation specifics for cenrep data -../conf/fscremotecontactlookup.confml APP_LAYER_CONFML(fscremotecontactlookup.confml) -// S60 UID update -../conf/fscremotecontactlookup_2001F3FE.crml APP_LAYER_CRML(fscremotecontactlookup_2001F3FE.crml) -// S60 UID update - -PRJ_MMPFILES -pbkxrclservice.mmp - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/group/pbkxrclservice.mmp --- a/emailcontacts/remotecontactlookup/group/pbkxrclservice.mmp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for Remote Contact Lookup Service implementation -* -*/ - - -#include -#include - -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/emailtraceconfig.hrh" - -OPTION CW -frame on - -TARGET pbkxrclservice.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x2001F461 - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - -SOURCEPATH ../src -SOURCE cpbkxremotecontactlookupenvimpl.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc -USERINCLUDE ../engine/inc - -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY pbkxrclengine.lib -LIBRARY cmaillogger.lib -#if (PBKX_DEBUG_LEVEL > 0) -LIBRARY pbkxdebug.lib -#endif - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE - -SOURCEPATH ../data -START RESOURCE service.rss -TARGET pbkxrclservice.rsc -END - - - - - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/inc/cpbkxremotecontactlookupenv.h --- a/emailcontacts/remotecontactlookup/inc/cpbkxremotecontactlookupenv.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupEnv. -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPENV_H -#define CPBKXREMOTECONTACTLOOKUPENV_H - -#include -#include -#include "mpbkxremotecontactlookupserviceui.h" -#include "mpbkxremotecontactlookupsettingsui.h" - -// S60 UID update -const TInt KPbkxRemoteContactLookupServiceImplImpUid = 0x2001FE0D; -// S60 UID update - -/** - * Remote Contact Lookup UI API. - * Defines an ECom interface for the Remote Contact Lookup UI - * - * @since S60 3.1 - */ -class CPbkxRemoteContactLookupEnv : public CBase - { - -public: - - /** - * Two-phased constructor. - * - * @return instance of CPbkxRemoteContactLookupEnv - */ - static CPbkxRemoteContactLookupEnv* NewL(); - - /** - * Destructor. - */ - virtual ~CPbkxRemoteContactLookupEnv(); - - /** - * Return instance of Service UI API. The ownership is not transfered - * to the caller and the same instance will be returned for every - * call. - * - * @return instance of MPbkxRemoteContactLookupServiceUi - */ - virtual MPbkxRemoteContactLookupServiceUi* ServiceUiL() = 0; - - /** - * Return instance of Settings UI API. The ownership is not transfered - * to the caller and the same instance will be returned for every - * call. - * - * @return instance of MPbkxRemoteContactLookupSettingsUi - */ - virtual MPbkxRemoteContactLookupSettingsUi* SettingsUiL() = 0; - -private: // data - - /** iDtor_ID_Key Instance identifier key. When instance of an - * implementation is created by ECOM framework, the - * framework will assign UID for it. The UID is used in - * destructor to notify framework that this instance is - * being destroyed and resources can be released. - */ - TUid iDtor_ID_Key; - }; - -#include "cpbkxremotecontactlookupenv.inl" - -#endif // CPBKXREMOTECONTACTLOOKUPENV_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/inc/cpbkxremotecontactlookupenv.inl --- a/emailcontacts/remotecontactlookup/inc/cpbkxremotecontactlookupenv.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRemoteContactLookupEnv. -* -*/ - - -#include -#include - -// ----------------------------------------------------------------------------- -// CPbkxRemoteContactLookupEnv::NewL -// ----------------------------------------------------------------------------- -// -inline CPbkxRemoteContactLookupEnv* CPbkxRemoteContactLookupEnv::NewL() - { - CPbkxRemoteContactLookupEnv* self = NULL; - - TUid implUid = {KPbkxRemoteContactLookupServiceImplImpUid}; - - TAny* interface = REComSession::CreateImplementationL ( - implUid, _FOFF( CPbkxRemoteContactLookupEnv, iDtor_ID_Key ) ); - - return reinterpret_cast< CPbkxRemoteContactLookupEnv* >( interface ); - } - -// ----------------------------------------------------------------------------- -// CPbkxRemoteContactLookupEnv::~CPbkxRemoteContactLookupEnv -// ----------------------------------------------------------------------------- -// -inline CPbkxRemoteContactLookupEnv::~CPbkxRemoteContactLookupEnv() - { - REComSession::DestroyedImplementation( iDtor_ID_Key ); - } diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/inc/cpbkxremotecontactlookupenvimpl.h --- a/emailcontacts/remotecontactlookup/inc/cpbkxremotecontactlookupenvimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of the class CPbkxRemoteContactLookupEnvImpl. -* -*/ - - -#ifndef CPBKXREMOTECONTACTLOOKUPENVIMPL_H -#define CPBKXREMOTECONTACTLOOKUPENVIMPL_H - -#include "cpbkxremotecontactlookupenv.h" - -class CPbkxRclSearchEngine; -class CPbkxRclSettingsEngine; - -/** - * Remote Contact Lookup Ui API implementation class. - * @see CPbkxRemoteContactLookupEnv - * - * @lib pbkxrclservice.lib - * @since S60 3.1 - */ -class CPbkxRemoteContactLookupEnvImpl : public CPbkxRemoteContactLookupEnv - { - -public: - - /** - * Two-phased constructor. - */ - static CPbkxRemoteContactLookupEnvImpl* NewL(); - - /** - * Destructor. - */ - virtual ~CPbkxRemoteContactLookupEnvImpl(); - -public: - -// from base class CPbkxRemoteContactLookupEnv - - MPbkxRemoteContactLookupServiceUi* ServiceUiL(); - - MPbkxRemoteContactLookupSettingsUi* SettingsUiL(); - -private: - - CPbkxRemoteContactLookupEnvImpl(); - - void ConstructL(); - -private: // data - - CPbkxRclSearchEngine* iServiceUi; - CPbkxRclSettingsEngine* iSettingsUi; - }; - -#endif // CPBKXREMOTECONTACTLOOKUPENVIMPL_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/inc/pbkxremotecontactlookupuid.hrh --- a/emailcontacts/remotecontactlookup/inc/pbkxremotecontactlookupuid.hrh Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource headers for project -* -*/ - - - -#ifndef PBKXREMOTECONTACTLOOKUPSERVICEIMPLDEFINES_HRH -#define PBKXREMOTECONTACTLOOKUPSERVICEIMPLDEFINES_HRH - -// S60 UID update -#define KPbkxRemoteContactLookupServiceIfUid 0x2001FE0C // OLD FS 1.0 uid: 0x2000264D -#define KPbkxRemoteContactLookupAdapterIfUid 0x2001FE1F -// S60 UID update - -// S60 UID update -#define KPbkxRemoteContactLookupServiceImplDllUid 0x2001F461 // OLD FS 1.0 uid: 0x2000264B -#define KPbkxRemoteContactLookupServiceImplImpUid 0x2001FE0D // OLD FS 1.0 uid: 0x2000264C -// S60 UID update - -#endif // PBKXREMOTECONTACTLOOKUPSERVICEIMPLDEFINES_HRH diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/rom/fscrclsetting.iby --- a/emailcontacts/remotecontactlookup/rom/fscrclsetting.iby Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup rom file definitions. - * -*/ - - - -#ifndef FSCONTACTS_REMOTE_CONTACT_LOOKUP_SETTING_IBY -#define FSCONTACTS_REMOTE_CONTACT_LOOKUP_SETTING_IBY - -// -#ifdef FF_EMAIL_FRAMEWORK -// - -ECOM_PLUGIN(fscrclsetting.dll,fscrclsetting.rsc) - -// -#endif //FF_EMAIL_FRAMEWORK -// - -#endif //FSCONTACTS_REMOTE_CONTACT_LOOKUP_SETTING_IBY diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/rom/pbkxremotecontactlookup.iby --- a/emailcontacts/remotecontactlookup/rom/pbkxremotecontactlookup.iby Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup rom file definitions. - * -*/ - - - -#ifndef FSCONTACTS_REMOTE_CONTACT_LOOKUP_IBY -#define FSCONTACTS_REMOTE_CONTACT_LOOKUP_IBY - -#include - -// -#ifdef FF_EMAIL_FRAMEWORK -// - -ECOM_PLUGIN(pbkxrclservice.dll,pbkxrclservice.rsc) - -file=ABI_DIR\BUILD_DIR\pbkxrclengine.dll SHARED_LIB_DIR\pbkxrclengine.dll -S60_APP_BITMAP(pbkxrclengine) - -// -#endif //FF_EMAIL_FRAMEWORK -// - -#endif // FSCONTACTS_REMOTE_CONTACT_LOOKUP_IBY - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/rom/pbkxremotecontactlookupresources.iby --- a/emailcontacts/remotecontactlookup/rom/pbkxremotecontactlookupresources.iby Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup resource rom file definitions. - * -*/ - - -#ifndef FSCONTACTS_REMOTE_CONTACT_LOOKUP_RESOURCES_IBY -#define FSCONTACTS_REMOTE_CONTACT_LOOKUP_RESOURCES_IBY - -// -#ifdef FF_EMAIL_FRAMEWORK -// - -S60_APP_RESOURCE(pbkxrclengine) - -// -#endif //FF_EMAIL_FRAMEWORK -// - -#endif // FSCONTACTS_REMOTE_CONTACT_LOOKUP_RESOURCES_IBY \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/data/fscrclsetting.rss --- a/emailcontacts/remotecontactlookup/settingplugin/data/fscrclsetting.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for Freestyle 2 Contacts -* RemoteContactLookup setting plugin. -* -*/ - - -// INCLUDES -#include "fscrclsettingextensionuid.h" -#include -#include - -#include "../../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber - -/** - * The registry information. - */ -RESOURCE REGISTRY_INFO theInfo - { - // use resource format version 2 to enable ROM only plugins - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KFscRclSettingExtensionImplementationUID; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KPbk2UiExtensionInterfaceUID; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KFscRclSettingExtensionImplementationUID; - version_no = KEmailEcomVersionNumber; - display_name = ""; - default_data = KPbkUiExtensionDefaultDataString; - opaque_data = "\\resource\\fscrclsettingres.rsc"; - rom_only = 0; - } - }; - } - }; - } -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/data/fscrclsettinginformation.rss --- a/emailcontacts/remotecontactlookup/settingplugin/data/fscrclsettinginformation.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project Freestyle 2 Contacts -* RemoteContactLookup setting plugin. -* -*/ - - -#include "fscrclsettingextensionuid.h" - -// -------------------------------------------------------------------------- -// r_fsc_rcl_setting_extension_information -// Extension information -// -------------------------------------------------------------------------- -// -RESOURCE PHONEBOOK2_EXTENSION_INFORMATION r_fsc_rcl_setting_extension_information - { - version = 0; - implementationUid = KFscRclSettingExtensionImplementationUID; - loadingPolicy = KPbk2LoadInStartup; - - // NO Commands - menuCommandRange = PHONEBOOK2_EXTENSION_RANGE - { - firstId = 0; - lastId = 0; - }; - - overwrittenCommands = {}; - - extensionMenus = {}; - } - -// --------------------------------------------------------- -// The RCL settings list -// --------------------------------------------------------- -// -RESOURCE AVKON_SETTING_ITEM_LIST r_rcl_setting_list - { - title = "Settings"; - } - -//END OF FILE diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/data/fscrclsettingres.rss --- a/emailcontacts/remotecontactlookup/settingplugin/data/fscrclsettingres.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Extension setting resources -* -*/ - - - -#include -#include - -#include -#include - -// -------------------------------------------------------------------------- -// Resource identifier -// -------------------------------------------------------------------------- -// -NAME FCRC // From Freestyle Contacts 2.0 Remote Contact Lookup - -// -------------------------------------------------------------------------- -// Standard resource signature -// -------------------------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE { } - -// Additional include files -#include "fscrclsettinginformation.rss" - -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/group/bld.inf --- a/emailcontacts/remotecontactlookup/settingplugin/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information file for Freestyle 2 Contacts -* RemoteContactLookup setting plugin. -* -*/ - - -PRJ_PLATFORMS -WINSCW ARMV5 - -PRJ_MMPFILES -fscrclsetting.mmp diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/group/fscrclsetting.mmp --- a/emailcontacts/remotecontactlookup/settingplugin/group/fscrclsetting.mmp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for Freestyle 2 Contacts -* RemoteContactLookup setting plugin. -* -*/ - - -#include -#include - -#include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../../inc/emailtraceconfig.hrh" -#include "../inc/fscrclsettingextensionuid.h" - -macro FSC_CHANGES -#define FSC_CHANGES - -TARGET fscrclsetting.dll -TARGETTYPE PLUGIN -UID 0x10009D8D KFscRclSettingExtensionImplementationUID - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - -SOURCEPATH ../src -SOURCE dllmain.cpp -SOURCE cfscrclsettingextensionplugin.cpp -SOURCE cfscrclsettingview.cpp -SOURCE cfscrclsettingcontrol.cpp - - -START RESOURCE ../data/fscrclsettingres.rss -HEADER -TARGET fscrclsettingres -TARGETPATH RESOURCE_FILES_DIR -LANG SC -END // RESOURCE - -START RESOURCE ../data/fscrclsetting.rss -TARGET fscrclsetting -TARGETPATH ECOM_RESOURCE_DIR -END // RESOURCE - -USERINCLUDE ../inc -USERINCLUDE ../../../../inc - -APP_LAYER_SYSTEMINCLUDE - -// Dependencies to Symbian OS components -LIBRARY euser.lib -LIBRARY commonengine.lib -LIBRARY ecom.lib -LIBRARY cone.lib -LIBRARY eikcoctl.lib -LIBRARY avkon.lib -LIBRARY cmaillogger.lib - - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/inc/cfscrclsettingcontrol.h --- a/emailcontacts/remotecontactlookup/settingplugin/inc/cfscrclsettingcontrol.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: RemoteContactLookup Setting Extension view control -* -*/ - -#ifndef CFSCRCLSETTINGCONTROL_H -#define CFSCRCLSETTINGCONTROL_H - -// INCLUDES -#include -#include -#include -#include - -// FORWARD DECLARATIONS -class CAknSettingItem; -class CPbkxRemoteContactLookupEnv; - -/** -* CFscRclSettingControl - Remote Contact Lookup setting control for Phonebook 2. -* -*/ -class CFscRclSettingControl : public CAknSettingItemList, - public MPbk2SettingsControlExtension - { - public: // CFscRclSettingControl public constructors and destructor - - /** - * Two-phased constructor. - */ - static CFscRclSettingControl* NewL(); - - static CFscRclSettingControl* NewLC(); - - /** - * Destructor. - */ - ~CFscRclSettingControl(); - - // Methods from MPbk2SettingsControlExtension - - /** - * Modifies the setting item list to contain settings - * from extensions. - * - * @param aSettingItemList The setting item list to modify. - */ - void ModifySettingItemListL(CAknSettingItemList& aSettingItemList); - - /** - * Creates a setting item from extension. - * - * @param aSettingId Id of the setting item. - * @return Created setting item. - */ - CAknSettingItem* CreateSettingItemL(TInt aSettingId); - - // Methods from MPbk2UiReleasable - - /** - * Implement to release this object and any resources it owns. - */ - void DoRelease(); - - private: // CFscRclSettingControl private constructors - - /** - * Default constructor - */ - CFscRclSettingControl(); - - /** - * ConstructL - */ - void ConstructL(); - - private: // data - CAknSettingItem* iRclSettingItem; - // Own: freestyle remote contact lookup for its setting item - CPbkxRemoteContactLookupEnv* iRclEnv; - }; - -#endif // CFSCRCLSETTINGCONTROL_H \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/inc/cfscrclsettingextensionplugin.h --- a/emailcontacts/remotecontactlookup/settingplugin/inc/cfscrclsettingextensionplugin.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: RemoteContactLookup Setting Extension plug-in. -* -*/ - - -#ifndef CFSCRCLSETTINGEXTENSIONPLUGIN_H -#define CFSCRCLSETTINGEXTENSIONPLUGIN_H - -#include - -// FORWARD DECLARATIONS - -/** - * RemoteContactLookup Setting Extension plugin. - * Adds RemoteContactLookup setting menu to the Phonebook2 Settings menu - * - * @lib cfscrclsetting.lib - * @since S60 v3.2 - */ -class CFscRclSettingExtensionPlugin : public CPbk2UIExtensionPlugin - { - -public: - - /** - * Two-phased constructor. - */ - static CFscRclSettingExtensionPlugin* NewL(); - - /** - * Destructor. - */ - virtual ~CFscRclSettingExtensionPlugin(); - -// from base class CPbk2UIExtensionPlugin - MPbk2UIExtensionView* CreateExtensionViewL( - TUid aViewId, - CPbk2UIExtensionView& aView ); - - void DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane, - MPbk2ContactUiControl& aControl ); - - - void UpdateStorePropertiesL( - CPbk2StorePropertyArray& aPropertyArray ); - - TBool GetHelpContextL( - TCoeHelpContext& aContext, - const CPbk2AppViewBase& aView, - MPbk2ContactUiControl& aUiControl ); - - void ApplyDynamicViewGraphChangesL( - CPbk2ViewGraph& aViewGraph ); - - void ApplyDynamicPluginInformationDataL( - CPbk2UIExtensionInformation& aUiExtensionInformation ); - -// from base class MPbk2UIExtensionFactory - - MPbk2ContactEditorExtension* CreatePbk2ContactEditorExtensionL( - CVPbkContactManager& aContactManager, - MVPbkStoreContact& aContact, - MPbk2ContactEditorControl& aEditorControl ); - - MPbk2ContactUiControlExtension* CreatePbk2UiControlExtensionL( - CVPbkContactManager& aContactManager ); - - MPbk2SettingsViewExtension* CreatePbk2SettingsViewExtensionL( - CVPbkContactManager& aContactManager ); - - MPbk2AppUiExtension* CreatePbk2AppUiExtensionL( - CVPbkContactManager& aContactManager ); - - MPbk2Command* CreatePbk2CommandForIdL( - TInt aCommandId, - MPbk2ContactUiControl& aUiControl ) const; - - MPbk2AiwInterestItem* CreatePbk2AiwInterestForIdL( - TInt aInterestId, - CAiwServiceHandler& aServiceHandler ) const; - -private: - - CFscRclSettingExtensionPlugin(); - - void ConstructL(); - -private: // data - }; - -#endif // CFSCRCLSETTINGEXTENSIONPLUGIN_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/inc/cfscrclsettingview.h --- a/emailcontacts/remotecontactlookup/settingplugin/inc/cfscrclsettingview.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Extension setting view. -* -*/ - - -#ifndef CFSCRCLSETTINGVIEW_H -#define CFSCRCLSETTINGVIEW_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CFscRclSettingControl; -/** -* CFscRclSettingView - phonebook settings view extension -* -*/ -class CFscRclSettingView : public CBase, public MPbk2SettingsViewExtension - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @return A new instance of this class. - */ - static CFscRclSettingView* NewL(); - - /** - * Creates a new instance of this class. - * - * @return A new instance of this class. - */ - static CFscRclSettingView* NewLC(); - - /** - * Destructor. - */ - ~CFscRclSettingView(); - - public: // Methods from MPbk2SettingsViewExtension - - MPbk2SettingsControlExtension* CreatePbk2SettingsControlExtensionL(); - - void DynInitMenuPaneL(TInt aMenuId,CEikMenuPane* aMenuPane); - - TBool HandleCommandL(TInt aCommand); - - public: // Methods from MPbk2UiReleasable - void DoRelease(); - - private: // CFscRclSettingView private constructors - - CFscRclSettingView(); - - void ConstructL(); - - private: // CFscRclSettingView private member variables - - // Phonebook2 settings extension reference - CFscRclSettingControl* iSettingsControl; - }; - -#endif // CFSCRCLSETTINGVIEW_H diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/inc/fscrclsettingextensionuid.h --- a/emailcontacts/remotecontactlookup/settingplugin/inc/fscrclsettingextensionuid.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: RemoteContactLookup Setting Extension plug-in UID definitions. -* -*/ - - -#ifndef CFSCRCLSETTINGEXTENSIONUID_H -#define CFSCRCLSETTINGEXTENSIONUID_H - -// Phonebook 2 / Freestyle 2.0 Contacts RemoteContactLookup setting Extension implementation UID -// S60 UID update -#define KFscRclSettingExtensionImplementationUID 0x2001F464 -// S60 UID update - - -#endif // CFSCRCLSETTINGEXTENSIONUID_H - -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/src/cfscrclsettingcontrol.cpp --- a/emailcontacts/remotecontactlookup/settingplugin/src/cfscrclsettingcontrol.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Extension setting control -* -*/ - - -// INCLUDE FILES -#include "emailtrace.h" -#include -#include -// -#include "cpbkxremotecontactlookupenv.h" -// -#include -#include "cfscrclsettingcontrol.h" - -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::CFscRclSettingControl -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CFscRclSettingControl::CFscRclSettingControl() - { - FUNC_LOG; - // No implementation required - } - -// ---------------------------------------------------------------------------- -// CFscRclSettingControl::ConstructL -// Actual constructor. -// ---------------------------------------------------------------------------- -// -void CFscRclSettingControl::ConstructL() - { - FUNC_LOG; - ConstructFromResourceL( R_RCL_SETTING_LIST ); - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::NewLC -// CFscRclSettingControl two-phased constructor. -// ----------------------------------------------------------------------------- -// -CFscRclSettingControl* CFscRclSettingControl::NewLC() - { - FUNC_LOG; - CFscRclSettingControl* self = new (ELeave)CFscRclSettingControl(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::NewL -// CFscRclSettingControl two-phased constructor. -// ----------------------------------------------------------------------------- -// -CFscRclSettingControl* CFscRclSettingControl::NewL() - { - FUNC_LOG; - CFscRclSettingControl* self = CFscRclSettingControl::NewLC(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::~CFscRclSettingControl -// CFscRclSettingControl Destructor -// ----------------------------------------------------------------------------- -// -CFscRclSettingControl::~CFscRclSettingControl() - { - FUNC_LOG; - delete iRclEnv; - } - -// ----------------------------------------------------------------------------- -// MPbk2SettingsControlExtension implementation -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::ModifySettingItemListL -// Adds RCL settings top item into the Phonebook2 settings list -// ----------------------------------------------------------------------------- -// -void CFscRclSettingControl::ModifySettingItemListL( - CAknSettingItemList& aSettingItemList ) - { - FUNC_LOG; - // Get Phonebook2 settings list - CAknSettingItemArray *pbk2settings = aSettingItemList.SettingItemArray(); - - TRAP_IGNORE( iRclEnv = CPbkxRemoteContactLookupEnv::NewL() ); - - if ( iRclEnv ) - { - // try to add Remote Contact Lookup setting item - // if adding fails, continue without rcl setting item - TRAP_IGNORE( - { - MPbkxRemoteContactLookupSettingsUi* rclSettingsUi = - iRclEnv->SettingsUiL(); - iRclSettingItem = rclSettingsUi-> - NewDefaultProtocolAccountSelectorSettingItemL(); - - pbk2settings->AppendL( iRclSettingItem ); - pbk2settings->RecalculateVisibleIndicesL(); - iRclSettingItem->SetHidden( EFalse ); - - }); - } - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::CreateSettingItemL -// Creates settings item -// ----------------------------------------------------------------------------- -// -CAknSettingItem* CFscRclSettingControl::CreateSettingItemL(TInt /*aSettingId*/) - { - FUNC_LOG; - return iRclSettingItem; - } - -// ----------------------------------------------------------------------------- -// MPbk2UiReleasable implementation -// ----------------------------------------------------------------------------- -// CFscRclSettingControl::DoRelease -// Release this -// ----------------------------------------------------------------------------- -// -void CFscRclSettingControl::DoRelease() - { - FUNC_LOG; - delete this; - } - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/src/cfscrclsettingextensionplugin.cpp --- a/emailcontacts/remotecontactlookup/settingplugin/src/cfscrclsettingextensionplugin.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Extension plug-in. -* -*/ - - -#include "emailtrace.h" -#include -#include "cfscrclsettingextensionplugin.h" -#include "cfscrclsettingview.h" - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::NewL -// -------------------------------------------------------------------------- -// -CFscRclSettingExtensionPlugin* CFscRclSettingExtensionPlugin::NewL() - { - FUNC_LOG; - CFscRclSettingExtensionPlugin* self = - new( ELeave ) CFscRclSettingExtensionPlugin(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::~CFscRclSettingExtensionPlugin -// -------------------------------------------------------------------------- -// -CFscRclSettingExtensionPlugin::~CFscRclSettingExtensionPlugin() - { - FUNC_LOG; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreateExtensionViewL -// -------------------------------------------------------------------------- -// -MPbk2UIExtensionView* CFscRclSettingExtensionPlugin::CreateExtensionViewL - ( TUid /*aViewId*/, CPbk2UIExtensionView& /*aView*/ ) - { - FUNC_LOG; - return NULL; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -void CFscRclSettingExtensionPlugin::DynInitMenuPaneL - ( TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/, - MPbk2ContactUiControl& /*aControl*/ ) - { - FUNC_LOG; - // Do nothing - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::UpdateStorePropertiesL -// -------------------------------------------------------------------------- -// -void CFscRclSettingExtensionPlugin::UpdateStorePropertiesL - ( CPbk2StorePropertyArray& /*aPropertyArray*/ ) - { - FUNC_LOG; - // Do nothing - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::GetHelpContextL -// -------------------------------------------------------------------------- -// -TBool CFscRclSettingExtensionPlugin::GetHelpContextL - ( TCoeHelpContext& /*aContext*/, const CPbk2AppViewBase& /*aView*/, - MPbk2ContactUiControl& /*aUiControl*/ ) - { - FUNC_LOG; - return EFalse; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::ApplyDynamicViewGraphChangesL -// -------------------------------------------------------------------------- -// -void CFscRclSettingExtensionPlugin::ApplyDynamicViewGraphChangesL - ( CPbk2ViewGraph& /*aViewGraph*/ ) - { - FUNC_LOG; - // Do nothing - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::ApplyDynamicPluginInformationDataL -// -------------------------------------------------------------------------- -// -void CFscRclSettingExtensionPlugin::ApplyDynamicPluginInformationDataL - ( CPbk2UIExtensionInformation& /*aUiExtensionInformation*/ ) - { - FUNC_LOG; - // Do nothing - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreatePbk2ContactEditorExtensionL -// -------------------------------------------------------------------------- -// -MPbk2ContactEditorExtension* - CFscRclSettingExtensionPlugin::CreatePbk2ContactEditorExtensionL - ( CVPbkContactManager& /*aContactManager*/, - MVPbkStoreContact& /*aContact*/, - MPbk2ContactEditorControl& /*aEditorControl*/ ) - { - return NULL; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreatePbk2UiControlExtensionL -// -------------------------------------------------------------------------- -// -MPbk2ContactUiControlExtension* - CFscRclSettingExtensionPlugin::CreatePbk2UiControlExtensionL - ( CVPbkContactManager& /*aContactManager*/ ) - { - return NULL; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreatePbk2SettingsViewExtensionL -// -------------------------------------------------------------------------- -// -MPbk2SettingsViewExtension* CFscRclSettingExtensionPlugin::CreatePbk2SettingsViewExtensionL( CVPbkContactManager& /*aContactManager*/ ) - { - FUNC_LOG; - return CFscRclSettingView::NewL(); - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreatePbk2AppUiExtensionL -// -------------------------------------------------------------------------- -// -MPbk2AppUiExtension* CFscRclSettingExtensionPlugin::CreatePbk2AppUiExtensionL - ( CVPbkContactManager& /*aContactManager*/ ) - { - FUNC_LOG; - return NULL; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreatePbk2CommandForIdL -// -------------------------------------------------------------------------- -// -MPbk2Command* CFscRclSettingExtensionPlugin::CreatePbk2CommandForIdL - ( TInt /*aCommandId*/, MPbk2ContactUiControl& /*aUiControl*/) const - { - FUNC_LOG; - MPbk2Command* result = NULL; - return result; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CreatePbk2AiwInterestForIdL -// -------------------------------------------------------------------------- -// -MPbk2AiwInterestItem* CFscRclSettingExtensionPlugin::CreatePbk2AiwInterestForIdL - ( TInt /*aInterestId*/, CAiwServiceHandler& /*aServiceHandler*/ ) const - { - FUNC_LOG; - return NULL; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::CFscRclSettingExtensionPlugin -// -------------------------------------------------------------------------- -// -CFscRclSettingExtensionPlugin::CFscRclSettingExtensionPlugin() - { - FUNC_LOG; - } - -// -------------------------------------------------------------------------- -// CFscRclSettingExtensionPlugin::ConstructL -// -------------------------------------------------------------------------- -// -void CFscRclSettingExtensionPlugin::ConstructL() - { - FUNC_LOG; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/src/cfscrclsettingview.cpp --- a/emailcontacts/remotecontactlookup/settingplugin/src/cfscrclsettingview.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Remote Contact Lookup Extension setting view -* -*/ - - -// INCLUDE FILES -#include "emailtrace.h" -#include "cfscrclsettingview.h" -#include "cfscrclsettingcontrol.h" - -// ----------------------------------------------------------------------------- -// CFscRclSettingView::CFscRclSettingView -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CFscRclSettingView::CFscRclSettingView() - { - FUNC_LOG; - // No implementation required - } - -// ---------------------------------------------------------------------------- -// CFscRclSettingView::ConstructL -// Actual constructor. -// ---------------------------------------------------------------------------- -// -void CFscRclSettingView::ConstructL() - { - FUNC_LOG; - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingView::NewLC -// CFscRclSettingView two-phased constructor. -// ----------------------------------------------------------------------------- -// -CFscRclSettingView* CFscRclSettingView::NewLC() - { - FUNC_LOG; - CFscRclSettingView* self = new (ELeave)CFscRclSettingView(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingView::NewL -// CFscRclSettingView two-phased constructor. -// ----------------------------------------------------------------------------- -// -CFscRclSettingView* CFscRclSettingView::NewL() - { - FUNC_LOG; - CFscRclSettingView* self = CFscRclSettingView::NewLC(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingView::~CFscRclSettingView -// CFscRclSettingView Destructor -// ----------------------------------------------------------------------------- -// -CFscRclSettingView::~CFscRclSettingView() - { - FUNC_LOG; - // iSettingsControl is released by Phonebook extension manager - } - -// ----------------------------------------------------------------------------- -// MPbk2SettingsViewExtension public methods -// ----------------------------------------------------------------------------- -// CFscRclSettingView::CreatePbk2SettingsControlExtensionL -// Phonebook2 Settings control extension object. -// ----------------------------------------------------------------------------- -// -MPbk2SettingsControlExtension* -CFscRclSettingView::CreatePbk2SettingsControlExtensionL() - { - FUNC_LOG; - return (iSettingsControl = CFscRclSettingControl::NewL()); - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingView::DynInitMenuPaneL() -// Dynamic menu content -// ----------------------------------------------------------------------------- -// -void CFscRclSettingView::DynInitMenuPaneL(TInt /*aMenuId*/,CEikMenuPane* /*aMenuPane*/) - { - FUNC_LOG; - // No implementation required - } - -// ----------------------------------------------------------------------------- -// CFscRclSettingView::HandleCommandL -// Settings view command handler -// ----------------------------------------------------------------------------- -// -TBool CFscRclSettingView::HandleCommandL(TInt /*aCommand*/) - { - FUNC_LOG; - return EFalse; - } - -// ----------------------------------------------------------------------------- -// MPbk2UiReleasable implementation -// ----------------------------------------------------------------------------- -// CFscRclSettingView::DoRelease -// Release this -// ----------------------------------------------------------------------------- -// -void CFscRclSettingView::DoRelease() - { - FUNC_LOG; - delete this; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/settingplugin/src/dllmain.cpp --- a/emailcontacts/remotecontactlookup/settingplugin/src/dllmain.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Standard Symbian OS DLL entry point function. -* -*/ - - -#include "emailtrace.h" -#include "cfscrclsettingextensionplugin.h" -#include "fscrclsettingextensionuid.h" -// System includes -#include - -/// Implementation table -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KFscRclSettingExtensionImplementationUID, - CFscRclSettingExtensionPlugin::NewL ) - }; - -// -------------------------------------------------------------------------- -// ImplementationGroupProxy -// The one and only exported function that is the ECom entry point. -// -------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy - (TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 emailcontacts/remotecontactlookup/src/cpbkxremotecontactlookupenvimpl.cpp --- a/emailcontacts/remotecontactlookup/src/cpbkxremotecontactlookupenvimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of the class CPbkxRemoteContactLookupEnvImpl. -* -*/ - - -#include "emailtrace.h" -#include -#include "cpbkxremotecontactlookupenvimpl.h" -#include "cpbkxrclsearchengine.h" -#include "cpbkxrclsettingsengine.h" - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( - KPbkxRemoteContactLookupServiceImplImpUid, - CPbkxRemoteContactLookupEnvImpl::NewL ) - }; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupEnvImpl::CPbkxRemoteContactLookupEnvImpl() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -void CPbkxRemoteContactLookupEnvImpl::ConstructL() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupEnvImpl* CPbkxRemoteContactLookupEnvImpl::NewL() - { - FUNC_LOG; - CPbkxRemoteContactLookupEnvImpl* self = new (ELeave) CPbkxRemoteContactLookupEnvImpl(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// ?description_if_needed -// --------------------------------------------------------------------------- -// -CPbkxRemoteContactLookupEnvImpl::~CPbkxRemoteContactLookupEnvImpl() - { - FUNC_LOG; - delete iServiceUi; - delete iSettingsUi; - } - -// --------------------------------------------------------------------------- -// From class MPbkxRemoteContactLookupUi -// ?implementation_description -// --------------------------------------------------------------------------- -// -MPbkxRemoteContactLookupServiceUi* CPbkxRemoteContactLookupEnvImpl::ServiceUiL() - { - FUNC_LOG; - - if( iServiceUi == NULL ) - { - iServiceUi = CPbkxRclSearchEngine::NewL(); - } - - return static_cast(iServiceUi); - } - -// --------------------------------------------------------------------------- -// From class MPbkxRemoteContactLookupUi -// ?implementation_description -// --------------------------------------------------------------------------- -// -MPbkxRemoteContactLookupSettingsUi* CPbkxRemoteContactLookupEnvImpl::SettingsUiL() - { - FUNC_LOG; - - if( iSettingsUi == NULL ) - { - iSettingsUi = CPbkxRclSettingsEngine::NewL(); - } - - return static_cast(iSettingsUi); - } - -// ======== GLOBAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// ?implementation_description -// --------------------------------------------------------------------------- -// - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - FUNC_LOG; - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/inc/emailclientapiimpl.h --- a/emailservices/emailclientapi/inc/emailclientapiimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailclientapiimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -51,11 +51,6 @@ static CEmailClientApi* NewL(); /** - * Destructor - */ - ~CEmailClientApi(); - - /** * */ CEmailClientApi(); @@ -101,6 +96,11 @@ * Constructor */ void ConstructL(); + + /** + * Destructor + */ + ~CEmailClientApi(); /** * Push ECom implementation info to cleanup operation to cleanup stack @@ -251,6 +251,9 @@ private: // plugin data array for all protocol plugins RPluginDataArray iPluginDataArray; + + // singleton instance counter + TInt iInstanceCounter; // book keeping of loaded plugins RArray iLoadedPluginsArray; diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/inc/emailmessage.h --- a/emailservices/emailclientapi/inc/emailmessage.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailmessage.h Wed Mar 31 21:08:33 2010 +0300 @@ -170,6 +170,20 @@ TDataOwner iOwner; }; +//Class for compare email content type +class TContentType +{ +public: + TContentType( const TDesC& aContentType ); + // Returns ETrue iff the content type represented by this object + // (after parameters have been removed) is equal to the given content type. + TBool Equals( const TDesC& aContentType ); + +private: + // Content type (without parameters) + TPtrC iContentType; +}; + #endif // EMAILMESSAGE_H diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/inc/emailtextcontent.h --- a/emailservices/emailclientapi/inc/emailtextcontent.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailtextcontent.h Wed Mar 31 21:08:33 2010 +0300 @@ -34,7 +34,7 @@ * */ NONSHARABLE_CLASS( CEmailTextContent ) : public CBase, - public MEmailTextContent + public MEmailTextContent { public: static CEmailTextContent* NewL( CPluginData& aPluginData, @@ -102,8 +102,7 @@ public: // for internal usage void SetOwner( const TDataOwner aOwner ); - - static const TDesC& CheckParameterFormatL( const TDesC& aParam ); + private: CEmailTextContent( const TDataOwner aOwner ); diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/src/emailclientapiimpl.cpp --- a/emailservices/emailclientapi/src/emailclientapiimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/src/emailclientapiimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -39,6 +39,7 @@ #include "emailclientapi.hrh" #include "freestyleemailcenrepkeys.h" #include "FreestyleEmailUiConstants.h" + // --------------------------------------------------------------------------- // CEmailClientApi::MailboxL // --------------------------------------------------------------------------- @@ -201,11 +202,20 @@ // ----------------------------------------------------------------------------- CEmailClientApi* CEmailClientApi::NewL() { - CEmailClientApi* self = new ( ELeave ) CEmailClientApi(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - return self; + CEmailClientApi* instance = static_cast( Dll::Tls() ); + + if ( instance == NULL ) + { + instance = new ( ELeave ) CEmailClientApi(); + CleanupStack::PushL( instance ); + instance->ConstructL(); + User::LeaveIfError( Dll::SetTls( instance ) ); + CleanupStack::Pop(); + } + + instance->iInstanceCounter++; + + return instance; } // ----------------------------------------------------------------------------- @@ -226,12 +236,13 @@ iLoadedPluginsArray.Close(); delete iMailboxCache; delete iClientAPI; + Dll::FreeTls(); } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- -CEmailClientApi::CEmailClientApi() +CEmailClientApi::CEmailClientApi() : iInstanceCounter( 0 ) { } @@ -297,7 +308,14 @@ // ----------------------------------------------------------------------------- void CEmailClientApi::Release() { - delete this; + if( this->iInstanceCounter == 1 ) + { + delete this; + } + else + { + this->iInstanceCounter--; + } } // ----------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/src/emailmessage.cpp --- a/emailservices/emailclientapi/src/emailmessage.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/src/emailmessage.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -514,27 +514,27 @@ return NULL; } CFSMailMessagePart* part = parts[0]; - const TDesC& contentType = part->GetContentType(); + TContentType contentType( part->GetContentType() ); TMessageContentId msgContentId = TMessageContentId( part->GetPartId().Id(), iMessageId.iId, iMessageId.iFolderId.iId, iMessageId.iFolderId.iMailboxId ); - if (!contentType.Find(KFSMailContentTypeTextPlain) || - !contentType.Find(KFSMailContentTypeTextHtml)) + if ( contentType.Equals( KFSMailContentTypeTextPlain ) || + contentType.Equals( KFSMailContentTypeTextHtml ) ) { iTextContent = CEmailTextContent::NewL(iPluginData, msgContentId, part, EAPIOwns ); } - else if (!contentType.Find(KFSMailContentTypeMultipartMixed) || - !contentType.Find(KFSMailContentTypeMultipartAlternative) || - !contentType.Find(KFSMailContentTypeMultipartDigest) || - !contentType.Find(KFSMailContentTypeMultipartRelated) || - !contentType.Find(KFSMailContentTypeMultipartParallel)) + else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) || + contentType.Equals( KFSMailContentTypeMultipartAlternative ) || + contentType.Equals( KFSMailContentTypeMultipartDigest ) || + contentType.Equals( KFSMailContentTypeMultipartRelated ) || + contentType.Equals( KFSMailContentTypeMultipartParallel ) ) { iContent = CEmailMultipart::NewL(iPluginData, msgContentId, part, EAPIOwns); } - if (count == 2 ) + if ( count == 2 ) { CFSMailMessagePart* part = parts[1]; const TDesC& contentType = part->GetContentType(); @@ -857,4 +857,32 @@ viewSrvSession->ActivateView(TVwsViewId(KFSEmailUiUid, MailEditorId), command, pckgData); CleanupStack::PopAndDestroy(); } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TContentType::TContentType( const TDesC& aContentType ) : iContentType( aContentType ) + { + _LIT( KSeparator, ";" ); + TInt end = aContentType.Find( KSeparator ); + if ( end != KErrNotFound ) + { + iContentType.Set( aContentType.Left( end ) ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +TBool TContentType::Equals( const TDesC& aContentType ) + { + TBool ret = iContentType.CompareF( aContentType ); + if ( ret == 0 ) + return ETrue; + else + return EFalse; + } + // End of file. diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/src/emailmultipart.cpp --- a/emailservices/emailclientapi/src/emailmultipart.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/src/emailmultipart.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -19,6 +19,7 @@ #include "emailtextcontent.h" #include "emailattachment.h" #include "emailmultipart.h" +#include "emailmessage.h" #include "emailclientapi.hrh" @@ -102,27 +103,24 @@ } MEmailMessageContent* content = NULL; TFSMailMsgId partId = iChildParts[aIndex]; - CFSMailMessagePart* copy = iEmailMsgContent->Part().ChildPartL(partId); - - const TDesC& contentType = copy->GetContentType(); - const TDesC& compareString = CEmailTextContent::CheckParameterFormatL( contentType ); - + CFSMailMessagePart* copy = iEmailMsgContent->Part().ChildPartL( partId ); + TContentType contentType( copy->GetContentType() ); TMessageContentId msgContentId = TMessageContentId( copy->GetPartId().Id(), Id().iMessageId.iId, Id().iMessageId.iFolderId.iId, Id().iMessageId.iFolderId.iMailboxId ); - if (!compareString.Compare(KFSMailContentTypeTextPlain) || - !compareString.Compare(KFSMailContentTypeTextHtml)) + if ( contentType.Equals( KFSMailContentTypeTextPlain ) || + contentType.Equals( KFSMailContentTypeTextHtml ) ) { content = CEmailTextContent::NewL( iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns ); } - else if (!compareString.Compare(KFSMailContentTypeMultipartMixed) || - !compareString.Compare(KFSMailContentTypeMultipartAlternative) || - !compareString.Compare(KFSMailContentTypeMultipartDigest) || - !compareString.Compare(KFSMailContentTypeMultipartRelated) || - !compareString.Compare(KFSMailContentTypeMultipartParallel)) + else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) || + contentType.Equals( KFSMailContentTypeMultipartAlternative ) || + contentType.Equals( KFSMailContentTypeMultipartDigest ) || + contentType.Equals( KFSMailContentTypeMultipartRelated ) || + contentType.Equals( KFSMailContentTypeMultipartParallel ) ) { content = CEmailMultipart::NewL( iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns ); } diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailclientapi/src/emailtextcontent.cpp --- a/emailservices/emailclientapi/src/emailtextcontent.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailclientapi/src/emailtextcontent.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -17,6 +17,7 @@ #include "emailcontent.h" #include "emailtextcontent.h" +#include "emailmessage.h" #include "emailclientapi.hrh" // CEmailTextContent @@ -48,8 +49,8 @@ CFSMailMessagePart* aPart ) { iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aPart ); - - if (!CheckParameterFormatL( aPart->GetContentType() ).Compare(KFSMailContentTypeTextHtml)) + TContentType contentType( aPart->GetContentType() ); + if ( contentType.Equals( KFSMailContentTypeTextHtml ) ) { iTextType = EHtmlText; } @@ -314,46 +315,6 @@ return NULL; } -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -const TDesC& CEmailTextContent::CheckParameterFormatL( const TDesC& aParam ) - { - _LIT( KSeparator, ";" ); - _LIT( KSlash, "/" ); - // Check for a type separator in the string - TInt endPos = aParam.Find( KSeparator ); - // Construct the compare string - TPtrC extractString( aParam.Left( endPos ) ); - HBufC* compareBuf = extractString.AllocLC(); - TPtr compareString = compareBuf->Des(); - TInt slashPos = aParam.Find( KSlash ); - TInt stringLen = compareString.Length(); - - const TDesC& leftPart = extractString.Left( slashPos ); - HBufC* leftPartBuf = leftPart.AllocLC(); - TPtr leftPartString = leftPartBuf->Des(); - leftPartString.Trim(); - - const TDesC& rightPart = extractString.Right( stringLen - ( slashPos + 1 ) ); - HBufC* rightPartBuf = rightPart.AllocLC(); - TPtr rightPartString = rightPartBuf->Des(); - rightPartString.Trim(); - - compareString.Delete( 0, endPos ); - compareString.Append( leftPartString ); - compareString.Append( KSlash ); - compareString.Append( rightPartString ); - compareString.LowerCase(); - CleanupStack::PopAndDestroy( rightPartBuf ); - CleanupStack::PopAndDestroy( leftPartBuf ); - - const TDesC& retParam = compareString; - CleanupStack::PopAndDestroy( compareBuf ); - - return retParam; - } // ----------------------------------------------------------------------------- // diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/commonlib/BWINS/FSFWCommonLibU.DEF --- a/emailservices/emailframework/commonlib/BWINS/FSFWCommonLibU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/commonlib/BWINS/FSFWCommonLibU.DEF Wed Mar 31 21:08:33 2010 +0300 @@ -187,34 +187,33 @@ ?SetEmailAddress@CFSMailAddress@@QAEXABVTDesC16@@@Z @ 186 NONAME ; void CFSMailAddress::SetEmailAddress(class TDesC16 const &) ?GetLastSyncStatusL@CFSMailBox@@QAE?AVTFSProgress@@XZ @ 187 NONAME ; class TFSProgress CFSMailBox::GetLastSyncStatusL(void) ?NextL@CFSMailIterator@@UAEHVTFSMailMsgId@@IAAV?$RPointerArray@VCFSMailMessage@@@@@Z @ 188 NONAME ; int CFSMailIterator::NextL(class TFSMailMsgId, unsigned int, class RPointerArray &) - ?ConstructL@CFSMailMessageBase@@AAEXVTFSMailMsgId@@@Z @ 189 NONAME ; void CFSMailMessageBase::ConstructL(class TFSMailMsgId) - ?SetUnreadCount@CFSMailFolderBase@@QAEXI@Z @ 190 NONAME ; void CFSMailFolderBase::SetUnreadCount(unsigned int) - ?ChildPartsL@CFSMailMessagePart@@QAEXAAV?$RPointerArray@VCFSMailMessagePart@@@@@Z @ 191 NONAME ; void CFSMailMessagePart::ChildPartsL(class RPointerArray &) - ?SetRCLInfo@CFSMailBoxBase@@QAEXVTUid@@I@Z @ 192 NONAME ; void CFSMailBoxBase::SetRCLInfo(class TUid, unsigned int) - ?NewLC@CFSMailFolderBase@@SAPAV1@VTFSMailMsgId@@@Z @ 193 NONAME ; class CFSMailFolderBase * CFSMailFolderBase::NewLC(class TFSMailMsgId) - ?AppendCCRecipient@CFSMailMessageBase@@QAEXPAVCFSMailAddress@@@Z @ 194 NONAME ; void CFSMailMessageBase::AppendCCRecipient(class CFSMailAddress *) - ?HasCapability@CFSMailBox@@QBEHW4TFSMailBoxCapabilities@@@Z @ 195 NONAME ; int CFSMailBox::HasCapability(enum TFSMailBoxCapabilities) const - ?GetMessageId@CFSMailMessageBase@@QBE?AVTFSMailMsgId@@XZ @ 196 NONAME ; class TFSMailMsgId CFSMailMessageBase::GetMessageId(void) const - ?GetSubject@CFSMailMessageBase@@QBEAAVTDesC16@@XZ @ 197 NONAME ; class TDesC16 & CFSMailMessageBase::GetSubject(void) const - ?NewL@CFSMailIterator@@SAPAV1@AAVMFSMailIterator@@PAVCFSMailRequestHandler@@@Z @ 198 NONAME ; class CFSMailIterator * CFSMailIterator::NewL(class MFSMailIterator &, class CFSMailRequestHandler *) - ?RefreshNowL@CFSMailBox@@QAEHAAVMFSMailRequestObserver@@@Z @ 199 NONAME ; int CFSMailBox::RefreshNowL(class MFSMailRequestObserver &) - ?Extension@TEmailExtensions@@QBEPAVCEmailExtension@@H@Z @ 200 NONAME ; class CEmailExtension * TEmailExtensions::Extension(int) const - ??1CFSMailRequestHandler@@UAE@XZ @ 201 NONAME ; CFSMailRequestHandler::~CFSMailRequestHandler(void) - ?SetSubFolderCount@CFSMailFolderBase@@QAEXI@Z @ 202 NONAME ; void CFSMailFolderBase::SetSubFolderCount(unsigned int) - ?AddL@TEmailExtensions@@QAEXPAVCEmailExtension@@@Z @ 203 NONAME ; void TEmailExtensions::AddL(class CEmailExtension *) - ?ClearCcRecipients@CFSMailMessageBase@@QAEXXZ @ 204 NONAME ; void CFSMailMessageBase::ClearCcRecipients(void) - ?GetPartId@CFSMailMessagePart@@QBE?AVTFSMailMsgId@@XZ @ 205 NONAME ; class TFSMailMsgId CFSMailMessagePart::GetPartId(void) const - ?RemoveDownLoadedAttachmentsL@CFSMailBox@@QAEXXZ @ 206 NONAME ; void CFSMailBox::RemoveDownLoadedAttachmentsL(void) - ?ExtensionL@CFSMailMessageBase@@UAEPAVCEmailExtension@@ABVTUid@@@Z @ 207 NONAME ; class CEmailExtension * CFSMailMessageBase::ExtensionL(class TUid const &) - ?GetReplyToAddress@CFSMailMessageBase@@QAEABVCFSMailAddress@@XZ @ 208 NONAME ; class CFSMailAddress const & CFSMailMessageBase::GetReplyToAddress(void) - ?GetMailBoxId@CFSMailFolderBase@@QBE?AVTFSMailMsgId@@XZ @ 209 NONAME ; class TFSMailMsgId CFSMailFolderBase::GetMailBoxId(void) const - ?SearchL@CFSMailBox@@QAEXABV?$RPointerArray@VTDesC16@@@@ABVTFSMailSortCriteria@@AAVMFSMailBoxSearchObserver@@V?$RArray@VTFSMailMsgId@@@@@Z @ 210 NONAME ; void CFSMailBox::SearchL(class RPointerArray const &, class TFSMailSortCriteria const &, class MFSMailBoxSearchObserver &, class RArray) - ??1CFSMailBox@@UAE@XZ @ 211 NONAME ; CFSMailBox::~CFSMailBox(void) - ?FetchedContentSize@CFSMailMessagePart@@QBEIXZ @ 212 NONAME ; unsigned int CFSMailMessagePart::FetchedContentSize(void) const - ?GetSubFoldersL@CFSMailFolder@@QAEXAAV?$RPointerArray@VCFSMailFolder@@@@@Z @ 213 NONAME ; void CFSMailFolder::GetSubFoldersL(class RPointerArray &) - ?SetFlag@CFSMailMessageBase@@QAEXH@Z @ 214 NONAME ; void CFSMailMessageBase::SetFlag(int) - ?NewLC@CFSMailIterator@@SAPAV1@AAVMFSMailIterator@@PAVCFSMailRequestHandler@@@Z @ 215 NONAME ; class CFSMailIterator * CFSMailIterator::NewLC(class MFSMailIterator &, class CFSMailRequestHandler *) - ?MoveMessagesL@CFSMailBox@@QAEHAAVMFSMailRequestObserver@@ABV?$RArray@VTFSMailMsgId@@@@VTFSMailMsgId@@2@Z @ 216 NONAME ; int CFSMailBox::MoveMessagesL(class MFSMailRequestObserver &, class RArray const &, class TFSMailMsgId, class TFSMailMsgId) - ?SetContentSize@CFSMailMessagePart@@QAEXI@Z @ 217 NONAME ; void CFSMailMessagePart::SetContentSize(unsigned int) - ?NewL@CFSMailMessagePart@@SAPAV1@VTFSMailMsgId@@0@Z @ 218 NONAME ; class CFSMailMessagePart * CFSMailMessagePart::NewL(class TFSMailMsgId, class TFSMailMsgId) + ?SetUnreadCount@CFSMailFolderBase@@QAEXI@Z @ 189 NONAME ; void CFSMailFolderBase::SetUnreadCount(unsigned int) + ?ChildPartsL@CFSMailMessagePart@@QAEXAAV?$RPointerArray@VCFSMailMessagePart@@@@@Z @ 190 NONAME ; void CFSMailMessagePart::ChildPartsL(class RPointerArray &) + ?SetRCLInfo@CFSMailBoxBase@@QAEXVTUid@@I@Z @ 191 NONAME ; void CFSMailBoxBase::SetRCLInfo(class TUid, unsigned int) + ?NewLC@CFSMailFolderBase@@SAPAV1@VTFSMailMsgId@@@Z @ 192 NONAME ; class CFSMailFolderBase * CFSMailFolderBase::NewLC(class TFSMailMsgId) + ?AppendCCRecipient@CFSMailMessageBase@@QAEXPAVCFSMailAddress@@@Z @ 193 NONAME ; void CFSMailMessageBase::AppendCCRecipient(class CFSMailAddress *) + ?HasCapability@CFSMailBox@@QBEHW4TFSMailBoxCapabilities@@@Z @ 194 NONAME ; int CFSMailBox::HasCapability(enum TFSMailBoxCapabilities) const + ?GetMessageId@CFSMailMessageBase@@QBE?AVTFSMailMsgId@@XZ @ 195 NONAME ; class TFSMailMsgId CFSMailMessageBase::GetMessageId(void) const + ?GetSubject@CFSMailMessageBase@@QBEAAVTDesC16@@XZ @ 196 NONAME ; class TDesC16 & CFSMailMessageBase::GetSubject(void) const + ?NewL@CFSMailIterator@@SAPAV1@AAVMFSMailIterator@@PAVCFSMailRequestHandler@@@Z @ 197 NONAME ; class CFSMailIterator * CFSMailIterator::NewL(class MFSMailIterator &, class CFSMailRequestHandler *) + ?RefreshNowL@CFSMailBox@@QAEHAAVMFSMailRequestObserver@@@Z @ 198 NONAME ; int CFSMailBox::RefreshNowL(class MFSMailRequestObserver &) + ?Extension@TEmailExtensions@@QBEPAVCEmailExtension@@H@Z @ 199 NONAME ; class CEmailExtension * TEmailExtensions::Extension(int) const + ??1CFSMailRequestHandler@@UAE@XZ @ 200 NONAME ; CFSMailRequestHandler::~CFSMailRequestHandler(void) + ?SetSubFolderCount@CFSMailFolderBase@@QAEXI@Z @ 201 NONAME ; void CFSMailFolderBase::SetSubFolderCount(unsigned int) + ?AddL@TEmailExtensions@@QAEXPAVCEmailExtension@@@Z @ 202 NONAME ; void TEmailExtensions::AddL(class CEmailExtension *) + ?ClearCcRecipients@CFSMailMessageBase@@QAEXXZ @ 203 NONAME ; void CFSMailMessageBase::ClearCcRecipients(void) + ?GetPartId@CFSMailMessagePart@@QBE?AVTFSMailMsgId@@XZ @ 204 NONAME ; class TFSMailMsgId CFSMailMessagePart::GetPartId(void) const + ?RemoveDownLoadedAttachmentsL@CFSMailBox@@QAEXXZ @ 205 NONAME ; void CFSMailBox::RemoveDownLoadedAttachmentsL(void) + ?ExtensionL@CFSMailMessageBase@@UAEPAVCEmailExtension@@ABVTUid@@@Z @ 206 NONAME ; class CEmailExtension * CFSMailMessageBase::ExtensionL(class TUid const &) + ?GetReplyToAddress@CFSMailMessageBase@@QAEABVCFSMailAddress@@XZ @ 207 NONAME ; class CFSMailAddress const & CFSMailMessageBase::GetReplyToAddress(void) + ?GetMailBoxId@CFSMailFolderBase@@QBE?AVTFSMailMsgId@@XZ @ 208 NONAME ; class TFSMailMsgId CFSMailFolderBase::GetMailBoxId(void) const + ?SearchL@CFSMailBox@@QAEXABV?$RPointerArray@VTDesC16@@@@ABVTFSMailSortCriteria@@AAVMFSMailBoxSearchObserver@@V?$RArray@VTFSMailMsgId@@@@@Z @ 209 NONAME ; void CFSMailBox::SearchL(class RPointerArray const &, class TFSMailSortCriteria const &, class MFSMailBoxSearchObserver &, class RArray) + ??1CFSMailBox@@UAE@XZ @ 210 NONAME ; CFSMailBox::~CFSMailBox(void) + ?FetchedContentSize@CFSMailMessagePart@@QBEIXZ @ 211 NONAME ; unsigned int CFSMailMessagePart::FetchedContentSize(void) const + ?GetSubFoldersL@CFSMailFolder@@QAEXAAV?$RPointerArray@VCFSMailFolder@@@@@Z @ 212 NONAME ; void CFSMailFolder::GetSubFoldersL(class RPointerArray &) + ?SetFlag@CFSMailMessageBase@@QAEXH@Z @ 213 NONAME ; void CFSMailMessageBase::SetFlag(int) + ?NewLC@CFSMailIterator@@SAPAV1@AAVMFSMailIterator@@PAVCFSMailRequestHandler@@@Z @ 214 NONAME ; class CFSMailIterator * CFSMailIterator::NewLC(class MFSMailIterator &, class CFSMailRequestHandler *) + ?MoveMessagesL@CFSMailBox@@QAEHAAVMFSMailRequestObserver@@ABV?$RArray@VTFSMailMsgId@@@@VTFSMailMsgId@@2@Z @ 215 NONAME ; int CFSMailBox::MoveMessagesL(class MFSMailRequestObserver &, class RArray const &, class TFSMailMsgId, class TFSMailMsgId) + ?SetContentSize@CFSMailMessagePart@@QAEXI@Z @ 216 NONAME ; void CFSMailMessagePart::SetContentSize(unsigned int) + ?NewL@CFSMailMessagePart@@SAPAV1@VTFSMailMsgId@@0@Z @ 217 NONAME ; class CFSMailMessagePart * CFSMailMessagePart::NewL(class TFSMailMsgId, class TFSMailMsgId) diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/commonlib/EABI/FSFWCommonLibU.DEF --- a/emailservices/emailframework/commonlib/EABI/FSFWCommonLibU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/commonlib/EABI/FSFWCommonLibU.DEF Wed Mar 31 21:08:33 2010 +0300 @@ -119,162 +119,161 @@ _ZN17CFSMailFolderBaseD0Ev @ 118 NONAME _ZN17CFSMailFolderBaseD1Ev @ 119 NONAME _ZN17CFSMailFolderBaseD2Ev @ 120 NONAME - _ZN18CFSMailMessageBase10ConstructLE12TFSMailMsgId @ 121 NONAME - _ZN18CFSMailMessageBase10ExtensionLERK4TUid @ 122 NONAME - _ZN18CFSMailMessageBase10SetSubjectERK7TDesC16 @ 123 NONAME - _ZN18CFSMailMessageBase11SetFolderIdE12TFSMailMsgId @ 124 NONAME - _ZN18CFSMailMessageBase12SetMailBoxIdE12TFSMailMsgId @ 125 NONAME - _ZN18CFSMailMessageBase12SetRelatedToE12TFSMailMsgId @ 126 NONAME - _ZN18CFSMailMessageBase14RequestHandlerEv @ 127 NONAME - _ZN18CFSMailMessageBase15GetCCRecipientsEv @ 128 NONAME - _ZN18CFSMailMessageBase15GetToRecipientsEv @ 129 NONAME - _ZN18CFSMailMessageBase16GetBCCRecipientsEv @ 130 NONAME - _ZN18CFSMailMessageBase16ReleaseExtensionEP15CEmailExtension @ 131 NONAME - _ZN18CFSMailMessageBase17AppendCCRecipientEP14CFSMailAddress @ 132 NONAME - _ZN18CFSMailMessageBase17AppendToRecipientEP14CFSMailAddress @ 133 NONAME - _ZN18CFSMailMessageBase17ClearCcRecipientsEv @ 134 NONAME - _ZN18CFSMailMessageBase17ClearToRecipientsEv @ 135 NONAME - _ZN18CFSMailMessageBase17GetReplyToAddressEv @ 136 NONAME - _ZN18CFSMailMessageBase17SetReplyToAddressEP14CFSMailAddress @ 137 NONAME - _ZN18CFSMailMessageBase18AppendBCCRecipientEP14CFSMailAddress @ 138 NONAME - _ZN18CFSMailMessageBase18ClearBccRecipientsEv @ 139 NONAME - _ZN18CFSMailMessageBase4NewLE12TFSMailMsgId @ 140 NONAME - _ZN18CFSMailMessageBase5NewLCE12TFSMailMsgId @ 141 NONAME - _ZN18CFSMailMessageBase7SetDateE5TTime @ 142 NONAME - _ZN18CFSMailMessageBase7SetFlagEi @ 143 NONAME - _ZN18CFSMailMessageBase9ResetFlagEi @ 144 NONAME - _ZN18CFSMailMessageBase9SetSenderEP14CFSMailAddress @ 145 NONAME - _ZN18CFSMailMessageBaseD0Ev @ 146 NONAME - _ZN18CFSMailMessageBaseD1Ev @ 147 NONAME - _ZN18CFSMailMessageBaseD2Ev @ 148 NONAME - _ZN18CFSMailMessagePart10ChildPartLE12TFSMailMsgId @ 149 NONAME - _ZN18CFSMailMessagePart10SetContentER6TDes16 @ 150 NONAME - _ZN18CFSMailMessagePart11ChildPartsLER13RPointerArrayIS_E @ 151 NONAME - _ZN18CFSMailMessagePart11IsMRInfoSetEv @ 152 NONAME - _ZN18CFSMailMessagePart13FindBodyPartLERK7TDesC16 @ 153 NONAME - _ZN18CFSMailMessagePart13NewChildPartLE12TFSMailMsgIdRK7TDesC16 @ 154 NONAME - _ZN18CFSMailMessagePart13SetContentIDLERK7TDesC16 @ 155 NONAME - _ZN18CFSMailMessagePart14GetContentTypeEv @ 156 NONAME - _ZN18CFSMailMessagePart14RemoveContentLEv @ 157 NONAME - _ZN18CFSMailMessagePart14SetContentSizeEj @ 158 NONAME - _ZN18CFSMailMessagePart14SetContentTypeERK7TDesC16 @ 159 NONAME - _ZN18CFSMailMessagePart15AttachmentNameLEv @ 160 NONAME - _ZN18CFSMailMessagePart15GetContentClassEv @ 161 NONAME - _ZN18CFSMailMessagePart15GetContentFileLEv @ 162 NONAME - _ZN18CFSMailMessagePart15SetContentClassERK7TDesC16 @ 163 NONAME - _ZN18CFSMailMessagePart16CopyContentFileLERK7TDesC16 @ 164 NONAME - _ZN18CFSMailMessagePart16RemoveChildPartLE12TFSMailMsgId @ 165 NONAME - _ZN18CFSMailMessagePart17AddNewAttachmentLERK7TDesC1612TFSMailMsgIdS2_ @ 166 NONAME - _ZN18CFSMailMessagePart17FetchMessagePartLE12TFSMailMsgIdR22MFSMailRequestObserverj @ 167 NONAME - _ZN18CFSMailMessagePart18AppendAttachmentsLER13RPointerArrayIS_E @ 168 NONAME - _ZN18CFSMailMessagePart18ContentDescriptionEv @ 169 NONAME - _ZN18CFSMailMessagePart18ContentDispositionEv @ 170 NONAME - _ZN18CFSMailMessagePart18ContentTypeMatchesERK7TDesC16 @ 171 NONAME - _ZN18CFSMailMessagePart18SetAttachmentNameLERK7TDesC16 @ 172 NONAME - _ZN18CFSMailMessagePart19FetchMessagesPartsLERK6RArrayI12TFSMailMsgIdER22MFSMailRequestObserverj @ 173 NONAME - _ZN18CFSMailMessagePart19GetContentToBufferLER6TDes16j @ 174 NONAME - _ZN18CFSMailMessagePart19SetContentFromFileLERK7TDesC16 @ 175 NONAME - _ZN18CFSMailMessagePart19SetReadOnlyPartSizeEj @ 176 NONAME - _ZN18CFSMailMessagePart21ContentTypeParametersEv @ 177 NONAME - _ZN18CFSMailMessagePart21SetContentDescriptionERK7TDesC16 @ 178 NONAME - _ZN18CFSMailMessagePart21SetContentDispositionERK7TDesC16 @ 179 NONAME - _ZN18CFSMailMessagePart21SetFetchedContentSizeEj @ 180 NONAME - _ZN18CFSMailMessagePart21SetMessagePartsStatusE17TFSPartFetchState @ 181 NONAME - _ZN18CFSMailMessagePart23CopyMessageAsChildPartLE12TFSMailMsgIdP14CFSMailMessage @ 182 NONAME - _ZN18CFSMailMessagePart28ContentDispositionParametersEv @ 183 NONAME - _ZN18CFSMailMessagePart28RemoveDownLoadedAttachmentsLEv @ 184 NONAME - _ZN18CFSMailMessagePart4NewLE12TFSMailMsgIdS0_ @ 185 NONAME - _ZN18CFSMailMessagePart5NewLCE12TFSMailMsgIdS0_ @ 186 NONAME - _ZN18CFSMailMessagePart5SaveLEv @ 187 NONAME - _ZN18CFSMailMessagePart9ContentIDEv @ 188 NONAME - _ZN18CFSMailMessagePart9GetMRInfoEv @ 189 NONAME - _ZN18CFSMailMessagePart9SetMRInfoEP13MMRInfoObject @ 190 NONAME - _ZN18CFSMailMessagePartD0Ev @ 191 NONAME - _ZN18CFSMailMessagePartD1Ev @ 192 NONAME - _ZN18CFSMailMessagePartD2Ev @ 193 NONAME - _ZN21CFSMailRequestHandler10AddPluginLE4TUidP13CFSMailPlugin @ 194 NONAME - _ZN21CFSMailRequestHandler11GetTempDirLEv @ 195 NONAME - _ZN21CFSMailRequestHandler13CleanTempDirLEv @ 196 NONAME - _ZN21CFSMailRequestHandler14CancelRequestLEi @ 197 NONAME - _ZN21CFSMailRequestHandler14GetPluginByUidE12TFSMailMsgId @ 198 NONAME - _ZN21CFSMailRequestHandler15CompleteRequestEi @ 199 NONAME - _ZN21CFSMailRequestHandler17InitAsyncRequestLE4TUidR22MFSMailRequestObserver @ 200 NONAME - _ZN21CFSMailRequestHandler18CancelAllRequestsLEv @ 201 NONAME - _ZN21CFSMailRequestHandler4NewLER13RPointerArrayI26CImplementationInformationERS0_I13CFSMailPluginE @ 202 NONAME - _ZN21CFSMailRequestHandler5NewLCER13RPointerArrayI26CImplementationInformationERS0_I13CFSMailPluginE @ 203 NONAME - _ZN21CFSMailRequestHandlerC1Ev @ 204 NONAME - _ZN21CFSMailRequestHandlerC2Ev @ 205 NONAME - _ZN21CFSMailRequestHandlerD0Ev @ 206 NONAME - _ZN21CFSMailRequestHandlerD1Ev @ 207 NONAME - _ZN21CFSMailRequestHandlerD2Ev @ 208 NONAME - _ZNK10CFSMailBox13HasCapabilityE22TFSMailBoxCapabilities @ 209 NONAME - _ZNK10CFSMailBox16CurrentSyncStateEv @ 210 NONAME - _ZNK10CFSMailBox9ListMrusLEv @ 211 NONAME - _ZNK14CFSMailAddress14GetDisplayNameEv @ 212 NONAME - _ZNK14CFSMailAddress15GetEmailAddressEv @ 213 NONAME - _ZNK14CFSMailBoxBase5GetIdEv @ 214 NONAME - _ZNK14CFSMailBoxBase7GetNameEv @ 215 NONAME - _ZNK14CFSMailBoxBase9GetStatusEv @ 216 NONAME - _ZNK14CFSMailMessage10IsMessageLEv @ 217 NONAME - _ZNK15CEmailExtension3UidEv @ 218 NONAME - _ZNK16TEmailExtensions13FindExtensionERK4TUid @ 219 NONAME - _ZNK16TEmailExtensions9ExtensionEi @ 220 NONAME - _ZNK17CFSMailFolderBase11GetFolderIdEv @ 221 NONAME - _ZNK17CFSMailFolderBase12GetMailBoxIdEv @ 222 NONAME - _ZNK17CFSMailFolderBase13GetFolderNameEv @ 223 NONAME - _ZNK17CFSMailFolderBase13GetFolderTypeEv @ 224 NONAME - _ZNK17CFSMailFolderBase14GetUnreadCountEv @ 225 NONAME - _ZNK17CFSMailFolderBase14GetUnseenCountEv @ 226 NONAME - _ZNK17CFSMailFolderBase15GetMessageCountEv @ 227 NONAME - _ZNK17CFSMailFolderBase17GetParentFolderIdEv @ 228 NONAME - _ZNK17CFSMailFolderBase17GetSubFolderCountEv @ 229 NONAME - _ZNK18CFSMailMessageBase10GetSubjectEv @ 230 NONAME - _ZNK18CFSMailMessageBase11GetFolderIdEv @ 231 NONAME - _ZNK18CFSMailMessageBase11IsRelatedToEv @ 232 NONAME - _ZNK18CFSMailMessageBase12GetMailBoxIdEv @ 233 NONAME - _ZNK18CFSMailMessageBase12GetMessageIdEv @ 234 NONAME - _ZNK18CFSMailMessageBase7GetDateEv @ 235 NONAME - _ZNK18CFSMailMessageBase8GetFlagsEv @ 236 NONAME - _ZNK18CFSMailMessageBase9GetSenderEv @ 237 NONAME - _ZNK18CFSMailMessageBase9IsFlagSetEi @ 238 NONAME - _ZNK18CFSMailMessagePart10IsMessageLEv @ 239 NONAME - _ZNK18CFSMailMessagePart11ContentSizeEv @ 240 NONAME - _ZNK18CFSMailMessagePart14FetchLoadStateEv @ 241 NONAME - _ZNK18CFSMailMessagePart16ReadOnlyPartSizeEv @ 242 NONAME - _ZNK18CFSMailMessagePart18FetchedContentSizeEv @ 243 NONAME - _ZNK18CFSMailMessagePart9GetPartIdEv @ 244 NONAME - _ZTI10CFSMailBox @ 245 NONAME - _ZTI13CFSMailFolder @ 246 NONAME - _ZTI14CFSMailAddress @ 247 NONAME - _ZTI14CFSMailBoxBase @ 248 NONAME - _ZTI14CFSMailMessage @ 249 NONAME - _ZTI15CEmailExtension @ 250 NONAME - _ZTI15CFSMailIterator @ 251 NONAME - _ZTI16CExtendableEmail @ 252 NONAME - _ZTI17CFSMailFolderBase @ 253 NONAME - _ZTI17CFSMailPluginData @ 254 NONAME - _ZTI18CFSMailMessageBase @ 255 NONAME - _ZTI18CFSMailMessagePart @ 256 NONAME - _ZTI21CFSMailRequestHandler @ 257 NONAME - _ZTI22CFSMailRequestObserver @ 258 NONAME - _ZTV10CFSMailBox @ 259 NONAME - _ZTV13CFSMailFolder @ 260 NONAME - _ZTV14CFSMailAddress @ 261 NONAME - _ZTV14CFSMailBoxBase @ 262 NONAME - _ZTV14CFSMailMessage @ 263 NONAME - _ZTV15CEmailExtension @ 264 NONAME - _ZTV15CFSMailIterator @ 265 NONAME - _ZTV16CExtendableEmail @ 266 NONAME - _ZTV17CFSMailFolderBase @ 267 NONAME - _ZTV17CFSMailPluginData @ 268 NONAME - _ZTV18CFSMailMessageBase @ 269 NONAME - _ZTV18CFSMailMessagePart @ 270 NONAME - _ZTV21CFSMailRequestHandler @ 271 NONAME - _ZTV22CFSMailRequestObserver @ 272 NONAME - _ZThn4_N15CFSMailIterator5NextLE12TFSMailMsgIdjR13RPointerArrayI14CFSMailMessageE @ 273 NONAME - _ZThn4_N15CFSMailIterator5NextLERK7TDesC16jR13RPointerArrayI14CFSMailMessageE @ 274 NONAME - _ZThn4_N15CFSMailIterator9PreviousLE12TFSMailMsgIdjR13RPointerArrayI14CFSMailMessageE @ 275 NONAME - _ZThn4_N15CFSMailIterator9PreviousLERK7TDesC16jR13RPointerArrayI14CFSMailMessageE @ 276 NONAME - _ZThn4_N15CFSMailIteratorD0Ev @ 277 NONAME - _ZThn4_N15CFSMailIteratorD1Ev @ 278 NONAME + _ZN18CFSMailMessageBase10ExtensionLERK4TUid @ 121 NONAME + _ZN18CFSMailMessageBase10SetSubjectERK7TDesC16 @ 122 NONAME + _ZN18CFSMailMessageBase11SetFolderIdE12TFSMailMsgId @ 123 NONAME + _ZN18CFSMailMessageBase12SetMailBoxIdE12TFSMailMsgId @ 124 NONAME + _ZN18CFSMailMessageBase12SetRelatedToE12TFSMailMsgId @ 125 NONAME + _ZN18CFSMailMessageBase14RequestHandlerEv @ 126 NONAME + _ZN18CFSMailMessageBase15GetCCRecipientsEv @ 127 NONAME + _ZN18CFSMailMessageBase15GetToRecipientsEv @ 128 NONAME + _ZN18CFSMailMessageBase16GetBCCRecipientsEv @ 129 NONAME + _ZN18CFSMailMessageBase16ReleaseExtensionEP15CEmailExtension @ 130 NONAME + _ZN18CFSMailMessageBase17AppendCCRecipientEP14CFSMailAddress @ 131 NONAME + _ZN18CFSMailMessageBase17AppendToRecipientEP14CFSMailAddress @ 132 NONAME + _ZN18CFSMailMessageBase17ClearCcRecipientsEv @ 133 NONAME + _ZN18CFSMailMessageBase17ClearToRecipientsEv @ 134 NONAME + _ZN18CFSMailMessageBase17GetReplyToAddressEv @ 135 NONAME + _ZN18CFSMailMessageBase17SetReplyToAddressEP14CFSMailAddress @ 136 NONAME + _ZN18CFSMailMessageBase18AppendBCCRecipientEP14CFSMailAddress @ 137 NONAME + _ZN18CFSMailMessageBase18ClearBccRecipientsEv @ 138 NONAME + _ZN18CFSMailMessageBase4NewLE12TFSMailMsgId @ 139 NONAME + _ZN18CFSMailMessageBase5NewLCE12TFSMailMsgId @ 140 NONAME + _ZN18CFSMailMessageBase7SetDateE5TTime @ 141 NONAME + _ZN18CFSMailMessageBase7SetFlagEi @ 142 NONAME + _ZN18CFSMailMessageBase9ResetFlagEi @ 143 NONAME + _ZN18CFSMailMessageBase9SetSenderEP14CFSMailAddress @ 144 NONAME + _ZN18CFSMailMessageBaseD0Ev @ 145 NONAME + _ZN18CFSMailMessageBaseD1Ev @ 146 NONAME + _ZN18CFSMailMessageBaseD2Ev @ 147 NONAME + _ZN18CFSMailMessagePart10ChildPartLE12TFSMailMsgId @ 148 NONAME + _ZN18CFSMailMessagePart10SetContentER6TDes16 @ 149 NONAME + _ZN18CFSMailMessagePart11ChildPartsLER13RPointerArrayIS_E @ 150 NONAME + _ZN18CFSMailMessagePart11IsMRInfoSetEv @ 151 NONAME + _ZN18CFSMailMessagePart13FindBodyPartLERK7TDesC16 @ 152 NONAME + _ZN18CFSMailMessagePart13NewChildPartLE12TFSMailMsgIdRK7TDesC16 @ 153 NONAME + _ZN18CFSMailMessagePart13SetContentIDLERK7TDesC16 @ 154 NONAME + _ZN18CFSMailMessagePart14GetContentTypeEv @ 155 NONAME + _ZN18CFSMailMessagePart14RemoveContentLEv @ 156 NONAME + _ZN18CFSMailMessagePart14SetContentSizeEj @ 157 NONAME + _ZN18CFSMailMessagePart14SetContentTypeERK7TDesC16 @ 158 NONAME + _ZN18CFSMailMessagePart15AttachmentNameLEv @ 159 NONAME + _ZN18CFSMailMessagePart15GetContentClassEv @ 160 NONAME + _ZN18CFSMailMessagePart15GetContentFileLEv @ 161 NONAME + _ZN18CFSMailMessagePart15SetContentClassERK7TDesC16 @ 162 NONAME + _ZN18CFSMailMessagePart16CopyContentFileLERK7TDesC16 @ 163 NONAME + _ZN18CFSMailMessagePart16RemoveChildPartLE12TFSMailMsgId @ 164 NONAME + _ZN18CFSMailMessagePart17AddNewAttachmentLERK7TDesC1612TFSMailMsgIdS2_ @ 165 NONAME + _ZN18CFSMailMessagePart17FetchMessagePartLE12TFSMailMsgIdR22MFSMailRequestObserverj @ 166 NONAME + _ZN18CFSMailMessagePart18AppendAttachmentsLER13RPointerArrayIS_E @ 167 NONAME + _ZN18CFSMailMessagePart18ContentDescriptionEv @ 168 NONAME + _ZN18CFSMailMessagePart18ContentDispositionEv @ 169 NONAME + _ZN18CFSMailMessagePart18ContentTypeMatchesERK7TDesC16 @ 170 NONAME + _ZN18CFSMailMessagePart18SetAttachmentNameLERK7TDesC16 @ 171 NONAME + _ZN18CFSMailMessagePart19FetchMessagesPartsLERK6RArrayI12TFSMailMsgIdER22MFSMailRequestObserverj @ 172 NONAME + _ZN18CFSMailMessagePart19GetContentToBufferLER6TDes16j @ 173 NONAME + _ZN18CFSMailMessagePart19SetContentFromFileLERK7TDesC16 @ 174 NONAME + _ZN18CFSMailMessagePart19SetReadOnlyPartSizeEj @ 175 NONAME + _ZN18CFSMailMessagePart21ContentTypeParametersEv @ 176 NONAME + _ZN18CFSMailMessagePart21SetContentDescriptionERK7TDesC16 @ 177 NONAME + _ZN18CFSMailMessagePart21SetContentDispositionERK7TDesC16 @ 178 NONAME + _ZN18CFSMailMessagePart21SetFetchedContentSizeEj @ 179 NONAME + _ZN18CFSMailMessagePart21SetMessagePartsStatusE17TFSPartFetchState @ 180 NONAME + _ZN18CFSMailMessagePart23CopyMessageAsChildPartLE12TFSMailMsgIdP14CFSMailMessage @ 181 NONAME + _ZN18CFSMailMessagePart28ContentDispositionParametersEv @ 182 NONAME + _ZN18CFSMailMessagePart28RemoveDownLoadedAttachmentsLEv @ 183 NONAME + _ZN18CFSMailMessagePart4NewLE12TFSMailMsgIdS0_ @ 184 NONAME + _ZN18CFSMailMessagePart5NewLCE12TFSMailMsgIdS0_ @ 185 NONAME + _ZN18CFSMailMessagePart5SaveLEv @ 186 NONAME + _ZN18CFSMailMessagePart9ContentIDEv @ 187 NONAME + _ZN18CFSMailMessagePart9GetMRInfoEv @ 188 NONAME + _ZN18CFSMailMessagePart9SetMRInfoEP13MMRInfoObject @ 189 NONAME + _ZN18CFSMailMessagePartD0Ev @ 190 NONAME + _ZN18CFSMailMessagePartD1Ev @ 191 NONAME + _ZN18CFSMailMessagePartD2Ev @ 192 NONAME + _ZN21CFSMailRequestHandler10AddPluginLE4TUidP13CFSMailPlugin @ 193 NONAME + _ZN21CFSMailRequestHandler11GetTempDirLEv @ 194 NONAME + _ZN21CFSMailRequestHandler13CleanTempDirLEv @ 195 NONAME + _ZN21CFSMailRequestHandler14CancelRequestLEi @ 196 NONAME + _ZN21CFSMailRequestHandler14GetPluginByUidE12TFSMailMsgId @ 197 NONAME + _ZN21CFSMailRequestHandler15CompleteRequestEi @ 198 NONAME + _ZN21CFSMailRequestHandler17InitAsyncRequestLE4TUidR22MFSMailRequestObserver @ 199 NONAME + _ZN21CFSMailRequestHandler18CancelAllRequestsLEv @ 200 NONAME + _ZN21CFSMailRequestHandler4NewLER13RPointerArrayI26CImplementationInformationERS0_I13CFSMailPluginE @ 201 NONAME + _ZN21CFSMailRequestHandler5NewLCER13RPointerArrayI26CImplementationInformationERS0_I13CFSMailPluginE @ 202 NONAME + _ZN21CFSMailRequestHandlerC1Ev @ 203 NONAME + _ZN21CFSMailRequestHandlerC2Ev @ 204 NONAME + _ZN21CFSMailRequestHandlerD0Ev @ 205 NONAME + _ZN21CFSMailRequestHandlerD1Ev @ 206 NONAME + _ZN21CFSMailRequestHandlerD2Ev @ 207 NONAME + _ZNK10CFSMailBox13HasCapabilityE22TFSMailBoxCapabilities @ 208 NONAME + _ZNK10CFSMailBox16CurrentSyncStateEv @ 209 NONAME + _ZNK10CFSMailBox9ListMrusLEv @ 210 NONAME + _ZNK14CFSMailAddress14GetDisplayNameEv @ 211 NONAME + _ZNK14CFSMailAddress15GetEmailAddressEv @ 212 NONAME + _ZNK14CFSMailBoxBase5GetIdEv @ 213 NONAME + _ZNK14CFSMailBoxBase7GetNameEv @ 214 NONAME + _ZNK14CFSMailBoxBase9GetStatusEv @ 215 NONAME + _ZNK14CFSMailMessage10IsMessageLEv @ 216 NONAME + _ZNK15CEmailExtension3UidEv @ 217 NONAME + _ZNK16TEmailExtensions13FindExtensionERK4TUid @ 218 NONAME + _ZNK16TEmailExtensions9ExtensionEi @ 219 NONAME + _ZNK17CFSMailFolderBase11GetFolderIdEv @ 220 NONAME + _ZNK17CFSMailFolderBase12GetMailBoxIdEv @ 221 NONAME + _ZNK17CFSMailFolderBase13GetFolderNameEv @ 222 NONAME + _ZNK17CFSMailFolderBase13GetFolderTypeEv @ 223 NONAME + _ZNK17CFSMailFolderBase14GetUnreadCountEv @ 224 NONAME + _ZNK17CFSMailFolderBase14GetUnseenCountEv @ 225 NONAME + _ZNK17CFSMailFolderBase15GetMessageCountEv @ 226 NONAME + _ZNK17CFSMailFolderBase17GetParentFolderIdEv @ 227 NONAME + _ZNK17CFSMailFolderBase17GetSubFolderCountEv @ 228 NONAME + _ZNK18CFSMailMessageBase10GetSubjectEv @ 229 NONAME + _ZNK18CFSMailMessageBase11GetFolderIdEv @ 230 NONAME + _ZNK18CFSMailMessageBase11IsRelatedToEv @ 231 NONAME + _ZNK18CFSMailMessageBase12GetMailBoxIdEv @ 232 NONAME + _ZNK18CFSMailMessageBase12GetMessageIdEv @ 233 NONAME + _ZNK18CFSMailMessageBase7GetDateEv @ 234 NONAME + _ZNK18CFSMailMessageBase8GetFlagsEv @ 235 NONAME + _ZNK18CFSMailMessageBase9GetSenderEv @ 236 NONAME + _ZNK18CFSMailMessageBase9IsFlagSetEi @ 237 NONAME + _ZNK18CFSMailMessagePart10IsMessageLEv @ 238 NONAME + _ZNK18CFSMailMessagePart11ContentSizeEv @ 239 NONAME + _ZNK18CFSMailMessagePart14FetchLoadStateEv @ 240 NONAME + _ZNK18CFSMailMessagePart16ReadOnlyPartSizeEv @ 241 NONAME + _ZNK18CFSMailMessagePart18FetchedContentSizeEv @ 242 NONAME + _ZNK18CFSMailMessagePart9GetPartIdEv @ 243 NONAME + _ZTI10CFSMailBox @ 244 NONAME + _ZTI13CFSMailFolder @ 245 NONAME + _ZTI14CFSMailAddress @ 246 NONAME + _ZTI14CFSMailBoxBase @ 247 NONAME + _ZTI14CFSMailMessage @ 248 NONAME + _ZTI15CEmailExtension @ 249 NONAME + _ZTI15CFSMailIterator @ 250 NONAME + _ZTI16CExtendableEmail @ 251 NONAME + _ZTI17CFSMailFolderBase @ 252 NONAME + _ZTI17CFSMailPluginData @ 253 NONAME + _ZTI18CFSMailMessageBase @ 254 NONAME + _ZTI18CFSMailMessagePart @ 255 NONAME + _ZTI21CFSMailRequestHandler @ 256 NONAME + _ZTI22CFSMailRequestObserver @ 257 NONAME + _ZTV10CFSMailBox @ 258 NONAME + _ZTV13CFSMailFolder @ 259 NONAME + _ZTV14CFSMailAddress @ 260 NONAME + _ZTV14CFSMailBoxBase @ 261 NONAME + _ZTV14CFSMailMessage @ 262 NONAME + _ZTV15CEmailExtension @ 263 NONAME + _ZTV15CFSMailIterator @ 264 NONAME + _ZTV16CExtendableEmail @ 265 NONAME + _ZTV17CFSMailFolderBase @ 266 NONAME + _ZTV17CFSMailPluginData @ 267 NONAME + _ZTV18CFSMailMessageBase @ 268 NONAME + _ZTV18CFSMailMessagePart @ 269 NONAME + _ZTV21CFSMailRequestHandler @ 270 NONAME + _ZTV22CFSMailRequestObserver @ 271 NONAME + _ZThn4_N15CFSMailIterator5NextLE12TFSMailMsgIdjR13RPointerArrayI14CFSMailMessageE @ 272 NONAME + _ZThn4_N15CFSMailIterator5NextLERK7TDesC16jR13RPointerArrayI14CFSMailMessageE @ 273 NONAME + _ZThn4_N15CFSMailIterator9PreviousLE12TFSMailMsgIdjR13RPointerArrayI14CFSMailMessageE @ 274 NONAME + _ZThn4_N15CFSMailIterator9PreviousLERK7TDesC16jR13RPointerArrayI14CFSMailMessageE @ 275 NONAME + _ZThn4_N15CFSMailIteratorD0Ev @ 276 NONAME + _ZThn4_N15CFSMailIteratorD1Ev @ 277 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/commonlib/inc/CFSMailCommon.h --- a/emailservices/emailframework/commonlib/inc/CFSMailCommon.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailCommon.h Wed Mar 31 21:08:33 2010 +0300 @@ -209,8 +209,11 @@ EFSMboxCapaSupportsAttahmentsInMR, // Mailbox supports saving of embedded messages - EFSMboxCapaSupportsSavingOfEmbeddedMessages + EFSMboxCapaSupportsSavingOfEmbeddedMessages, + // Mailbox supports smart editing feature. + // Returned by Intellisync and ActiveSync. If defined, UI will fetch message body fully. + EFSMBoxCapaSmartEdit }; /** email details included in plugin responses */ diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/commonlib/inc/cmailmessageext.h --- a/emailservices/emailframework/commonlib/inc/cmailmessageext.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/cmailmessageext.h Wed Mar 31 21:08:33 2010 +0300 @@ -30,7 +30,7 @@ * // below message is of type CFSMailMessageBase (or its derived type) * CEmailExtension* extension = message->ExtensionL( KEmailMessageExtensionUid ); * CMailMessageExtension* mExt = reinterpret_cast( extension ); - * mExt->CommitL(); + * mExt->CommitL(CFSMailMessage&); * // Release extension when not needed any more. * message->ReleaseExtension( extension ); * @endcode @@ -42,9 +42,9 @@ /** * Commits changes of the message to store. - * + * @param aMessage a message to commit. */ - virtual void CommitL() = 0; + virtual void CommitL(CFSMailMessage& aMessage) = 0; protected: inline CMailMessageExtension(); diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/commonlib/src/CFSMailBox.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailBox.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailBox.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -822,7 +822,7 @@ } // ----------------------------------------------------------------------------- -// CFSMailBox::ExtensionL +// CFSMailBox::ReleaseExtension // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension ) { diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -64,7 +64,7 @@ // ----------------------------------------------------------------------------- // CFSMailMessageBase::ConstructL // ----------------------------------------------------------------------------- -EXPORT_C void CFSMailMessageBase::ConstructL( TFSMailMsgId aMessageId ) +void CFSMailMessageBase::ConstructL( TFSMailMsgId aMessageId ) { FUNC_LOG; iMessageId = aMessageId; diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/inc/CFSClientAPIRequestHandler.h --- a/emailservices/emailframework/inc/CFSClientAPIRequestHandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/inc/CFSClientAPIRequestHandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -36,16 +36,17 @@ { public: - + /** - * To prevent deleting handler when is still needed - */ - void ReleaseInstance(); - + * destructor. + */ + ~CFSClientAPIRequestHandler(); + /** - * Returns instance of request handler - */ - static CFSClientAPIRequestHandler* GetInstanceL( MEmailClientPluginManager* aPluginManager ); + * two based constructor + * + */ + static CFSClientAPIRequestHandler* NewL( MEmailClientPluginManager* aPluginManager); /** * returns plugin pointer related to plugin id @@ -63,26 +64,13 @@ CFSClientAPIRequestHandler( MEmailClientPluginManager* aPluginManager ); /** - * two phased constructor + * two based constructor */ void ConstructL( ); -private: // methods - - /** - * destructor. - */ - ~CFSClientAPIRequestHandler(); - - /** - * two phased constructor - * - */ - static CFSClientAPIRequestHandler* NewL( MEmailClientPluginManager* aPluginManager); private: // data - TInt iInstanceCounter; MEmailClientPluginManager* iPluginManager; }; diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/inc/emailversionnumbers.hrh --- a/emailservices/emailframework/inc/emailversionnumbers.hrh Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/inc/emailversionnumbers.hrh Wed Mar 31 21:08:33 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description : Common email version number definitions -* Version : %version: 10.1.3 % +* Version : %version: 10.1.5 % * */ @@ -25,14 +25,14 @@ * version number both major and minor version are stored in separate 32 bit * location. */ -#define KEmailBinaryVersionNumber 10.5 +#define KEmailBinaryVersionNumber 10.7 /** ECom version number to be used in Cmail related ECom registeration * resource files. * NOTE: Version number in ECom registeration resource file is saved as one * byte, so 255 is the maximum version number. */ -#define KEmailEcomVersionNumber 5 +#define KEmailEcomVersionNumber 7 /** Binary paging setting (paged/non-paged) */ diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/src/CFSClientAPI.cpp --- a/emailservices/emailframework/src/CFSClientAPI.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/src/CFSClientAPI.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -33,7 +33,7 @@ CFSClientAPI::~CFSClientAPI() { FUNC_LOG; - iAPIRequestHandler->ReleaseInstance(); + delete iAPIRequestHandler; } // ----------------------------------------------------------------------------- @@ -55,6 +55,6 @@ void CFSClientAPI::ConstructL(MEmailClientPluginManager* aPluginManager) { FUNC_LOG; - iAPIRequestHandler = CFSClientAPIRequestHandler::GetInstanceL( aPluginManager ); + iAPIRequestHandler = CFSClientAPIRequestHandler::NewL(aPluginManager); } diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp --- a/emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -26,53 +26,24 @@ // CFSMailRequestHandler::CFSMailRequestHandler // ----------------------------------------------------------------------------- CFSClientAPIRequestHandler::CFSClientAPIRequestHandler( - MEmailClientPluginManager* aPluginManager ) : iPluginManager(aPluginManager), iInstanceCounter( 1 ) + MEmailClientPluginManager* aPluginManager ) : iPluginManager(aPluginManager) { FUNC_LOG; + + // store pointer to TLS + TInt err = Dll::SetTls(static_cast(this)); } // ----------------------------------------------------------------------------- // CFSMailRequestHandler::~CFSMailRequestHandler // ----------------------------------------------------------------------------- + CFSClientAPIRequestHandler::~CFSClientAPIRequestHandler() { FUNC_LOG; } // ----------------------------------------------------------------------------- -// CFSMailRequestHandler::GetInstanceL -// ----------------------------------------------------------------------------- -CFSClientAPIRequestHandler* CFSClientAPIRequestHandler::GetInstanceL( MEmailClientPluginManager* aPluginManager ) - { - CFSClientAPIRequestHandler *requestHandler = static_cast( Dll::Tls() ); - if ( requestHandler == NULL ) - { - requestHandler = CFSClientAPIRequestHandler::NewL( aPluginManager ); - } - else - { - requestHandler->iInstanceCounter++; - } - - return requestHandler; - } - -// ----------------------------------------------------------------------------- -// CFSMailRequestHandler::ReleaseInstance -// ----------------------------------------------------------------------------- -void CFSClientAPIRequestHandler::ReleaseInstance() - { - if( iInstanceCounter > 1 ) - { - iInstanceCounter--; - } - else - { - delete this; - } - } - -// ----------------------------------------------------------------------------- // CFSMailRequestHandler::NewL // ----------------------------------------------------------------------------- CFSClientAPIRequestHandler* CFSClientAPIRequestHandler::NewL( diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/cmailhandlerplugin/group/bld.inf --- a/emailservices/emailserver/cmailhandlerplugin/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -41,10 +41,3 @@ ../conf/CommonemailCRKeys_20029F4A.crml CRML_EXPORT_PATH(CommonemailCRKeys_20029F4A.crml,s60) ../inc/commonemailcrkeys.h |../../../../inc/commonemailcrkeys.h - -// TEMP fiz for wk05/10 SDK, please remvve after wk07 -../conf/20029F4A.txt /epoc32/winscw/c/private/10202be9/20029F4A.txt -../conf/20029F4A.txt /epoc32/release/winscw/UDEB/Z/private/10202be9/20029F4A.txt -../conf/20029F4A.txt /epoc32/release/winscw/UREL/Z/private/10202be9/20029F4A.txt -../conf/20029F4A.txt /epoc32/data/Z/private/10202BE9/20029F4A.txt - diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/cmailhandlerplugin/inc/commonemailcrkeys.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/commonemailcrkeys.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/commonemailcrkeys.h Wed Mar 31 21:08:33 2010 +0300 @@ -2,7 +2,7 @@ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * @@ -20,7 +20,7 @@ #define _COMMONEMAILCRKEYS_H_ // central repository key for email data -const TUid KCmailDataRepository = { 0x20029F4A }; +const TUid KCmailDataRepository = { 0x20029F4A }; // key for display text (mailbox name?) of email indicator popup const TUint32 KCmailNewEmailDisplayText = 0x00000001 ; diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1031,7 +1031,10 @@ inParam->AppendL( item ); // Execute command - iMsgInterface->ExecuteCmdL( KDelete , *inParam, *outParam ); + if ( iMsgInterface ) + { + iMsgInterface->ExecuteCmdL( KDelete , *inParam, *outParam ); + } CleanupStack::PopAndDestroy( cpData ); item.Reset(); diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/cmailhandlerplugin/src/fsmailiconhandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailiconhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailiconhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -210,14 +210,20 @@ void CFSMailIconHandler::TurnNotificationOn() { FUNC_LOG; - SetProperty( KPSUidCoreApplicationUIs, - KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail ); + /* + * Mailindicator handling was removed fomr 9.2 + */ + /*SetProperty( KPSUidCoreApplicationUIs, + KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail );*/ } void CFSMailIconHandler::TurnNotificationOff() { FUNC_LOG; - SetProperty( KPSUidCoreApplicationUIs, - KCoreAppUIsNewEmailStatus, ECoreAppUIsNoNewEmail ); + /* + * Mailindicator handling was removed fomr 9.2 + */ + /*SetProperty( KPSUidCoreApplicationUIs, + KCoreAppUIsNewEmailStatus, ECoreAppUIsNoNewEmail );*/ } diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -239,9 +239,7 @@ *parentFolder, *newEntries ) ) { - // it doesn't matter if the mailindicator won't get updated - // its better have it not updated compared to a leave - TRAP_IGNORE(MailIndicatorHandlingL(aMailbox)); + TurnNotificationOn(); } } else @@ -259,74 +257,6 @@ } } -void CFSNotificationHandlerBase::MailIndicatorHandlingL(TFSMailMsgId aMailbox) - { - /** - * There is always a pair of keys for one mailbox - * 1st keys is the plugin id (numberOfMailboxes*2-1) - * 2nd is the mailboxId (numberOfMailboxes*2) - */ - TInt numberOfMailboxes(0); - CRepository* emailRepository = CRepository::NewL( KFreestyleEmailCenRep ); - CleanupStack::PushL(emailRepository); - emailRepository->Get(KNumberOfMailboxesWithNewEmails, numberOfMailboxes); - CRepository* commonEmailRepository = CRepository::NewL( KCmailDataRepository ); - CleanupStack::PushL(commonEmailRepository); - if(numberOfMailboxes != 0) - { - RArray repositoryIds; - CleanupClosePushL(repositoryIds); - TInt tmp(0); - for(TInt i = 1 ; i <= numberOfMailboxes * 2; i++ ) - { - emailRepository->Get(KNumberOfMailboxesWithNewEmails+i, tmp); - repositoryIds.Append(tmp); - } - TInt index = repositoryIds.Find(static_cast(aMailbox.Id())); - // If it is we delete it from the array - if(index != KErrNotFound ) - { - //unless it is the last item, then we don't have to do anything - if(index != (repositoryIds.Count()-1)) - { - repositoryIds.Remove(index); - repositoryIds.Remove(index-1); - // Rearrange the mailbox/mailplugin ids - // in the repository - for(TInt j = 0; j < repositoryIds.Count(); j++) - { - emailRepository->Set(KNumberOfMailboxesWithNewEmails + 1 + j, repositoryIds.operator [](j)); - } - // And write the current mailbox/plugin ids back to repository as the last items - emailRepository->Set(KNumberOfMailboxesWithNewEmails + ( numberOfMailboxes * 2 - 1 ), static_cast(aMailbox.PluginId().iUid)); - emailRepository->Set(KNumberOfMailboxesWithNewEmails + ( numberOfMailboxes * 2 ),static_cast(aMailbox.Id()) ); - commonEmailRepository->Set(KCmailNewEmailDisplayText,MailClient().GetMailBoxByUidL(aMailbox)->GetName()); - } - } - else - { - //Create keys with right values and update the number of mailboxes - numberOfMailboxes += 1; - emailRepository->Set(KNumberOfMailboxesWithNewEmails, numberOfMailboxes); - emailRepository->Create(KNumberOfMailboxesWithNewEmails + (numberOfMailboxes * 2 - 1), static_cast(aMailbox.PluginId().iUid)); - emailRepository->Create(KNumberOfMailboxesWithNewEmails + (numberOfMailboxes * 2), static_cast(aMailbox.Id())); - commonEmailRepository->Set(KCmailNewEmailDisplayText,MailClient().GetMailBoxByUidL(aMailbox)->GetName()); - } - repositoryIds.Reset(); - CleanupStack::PopAndDestroy();//repositoryIds - } - else - { - //Create keys with right values and pudate the number of mailboxes - numberOfMailboxes += 1; - emailRepository->Set(KNumberOfMailboxesWithNewEmails, numberOfMailboxes); - emailRepository->Create(KNumberOfMailboxesWithNewEmails + (numberOfMailboxes * 2 - 1), static_cast(aMailbox.PluginId().iUid)); - emailRepository->Create(KNumberOfMailboxesWithNewEmails + (numberOfMailboxes * 2), static_cast(aMailbox.Id())); - commonEmailRepository->Set(KCmailNewEmailDisplayText,MailClient().GetMailBoxByUidL(aMailbox)->GetName()); - } - CleanupStack::PopAndDestroy(2);// emailRepository, CommonEmailRepository - TurnNotificationOn(); - } CFSMailMessage* CFSNotificationHandlerBase::NewestMsgInFolderL( /*const*/ CFSMailFolder& aFolder ) const diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/group/fsmailserver.mmp --- a/emailservices/emailserver/group/fsmailserver.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/group/fsmailserver.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -28,7 +28,7 @@ TARGETTYPE exe UID 0x100039CE KFSMailServerUid -CAPABILITY CAP_APPLICATION NetworkControl +CAPABILITY CAP_APPLICATION NetworkControl MultimediaDD VENDORID VID_DEFAULT EPOCSTACKSIZE 0x5000 diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/inc/fsnotificationhandlerbase.h --- a/emailservices/emailserver/inc/fsnotificationhandlerbase.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/inc/fsnotificationhandlerbase.h Wed Mar 31 21:08:33 2010 +0300 @@ -216,12 +216,7 @@ */ CFSMailMessage* NewestMsgInFolderL( /*const*/ CFSMailFolder& aFolder ) const; - - - /* - * function that handles the mailindicator - */ - void MailIndicatorHandlingL(TFSMailMsgId aMailbox); + private: diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailserver/src/FsEmailGlobalDialogsAppUi.cpp --- a/emailservices/emailserver/src/FsEmailGlobalDialogsAppUi.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailserver/src/FsEmailGlobalDialogsAppUi.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -2,9 +2,9 @@ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. @@ -142,7 +142,7 @@ delete iNotificationHandlerMgr; iNotificationHandlerMgr = NULL; - // Call base class Exit + // Call base class Exit CAknAppUi::Exit(); } @@ -211,9 +211,9 @@ KFsEmailDialogsWinPriorityActive ); iEikonEnv->RootWin().EnableGroupListChangeEvents(); - + // Enable keyboard focus when showing some content - iEikonEnv->RootWin().EnableReceiptOfFocus( ETrue ); + iEikonEnv->RootWin().EnableReceiptOfFocus( ETrue ); } // --------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF --- a/emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF Wed Mar 31 21:08:33 2010 +0300 @@ -186,4 +186,10 @@ ?NewL@CResourceLoader@@SAPAV1@ABVTDesC16@@@Z @ 185 NONAME ; class CResourceLoader * CResourceLoader::NewL(class TDesC16 const &) ??1CResourceLoader@@UAE@XZ @ 186 NONAME ; CResourceLoader::~CResourceLoader(void) ?CreateResourceReaderLC@CResourceLoader@@QBEPAVHBufC8@@AAVTResourceReader@@H@Z @ 187 NONAME ; class HBufC8 * CResourceLoader::CreateResourceReaderLC(class TResourceReader &, int) const + ?Load2LC@CResourceLoader@@QAEPAVHBufC16@@HH@Z @ 188 NONAME ; class HBufC16 * CResourceLoader::Load2LC(int, int) + ?Load2L@CResourceLoader@@QAEPAVHBufC16@@H@Z @ 189 NONAME ; class HBufC16 * CResourceLoader::Load2L(int) + ?Load2LC@CResourceLoader@@QAEPAVHBufC16@@HABVTDesC16@@@Z @ 190 NONAME ; class HBufC16 * CResourceLoader::Load2LC(int, class TDesC16 const &) + ?Load2L@CResourceLoader@@QAEPAVHBufC16@@HH@Z @ 191 NONAME ; class HBufC16 * CResourceLoader::Load2L(int, int) + ?Load2LC@CResourceLoader@@QAEPAVHBufC16@@H@Z @ 192 NONAME ; class HBufC16 * CResourceLoader::Load2LC(int) + ?Load2L@CResourceLoader@@QAEPAVHBufC16@@HABVTDesC16@@@Z @ 193 NONAME ; class HBufC16 * CResourceLoader::Load2L(int, class TDesC16 const &) diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailstore/base_plugin/EABI/basepluginU.DEF --- a/emailservices/emailstore/base_plugin/EABI/basepluginU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailstore/base_plugin/EABI/basepluginU.DEF Wed Mar 31 21:08:33 2010 +0300 @@ -290,4 +290,10 @@ _ZNK15CResourceLoader22CreateResourceReaderLCER15TResourceReaderi @ 289 NONAME _ZTI15CResourceLoader @ 290 NONAME _ZTV15CResourceLoader @ 291 NONAME + _ZN15CResourceLoader6Load2LEi @ 292 NONAME + _ZN15CResourceLoader6Load2LEiRK7TDesC16 @ 293 NONAME + _ZN15CResourceLoader6Load2LEii @ 294 NONAME + _ZN15CResourceLoader7Load2LCEi @ 295 NONAME + _ZN15CResourceLoader7Load2LCEiRK7TDesC16 @ 296 NONAME + _ZN15CResourceLoader7Load2LCEii @ 297 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailstore/base_plugin/group/BasePlugin.mmp --- a/emailservices/emailstore/base_plugin/group/BasePlugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailstore/base_plugin/group/BasePlugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -76,6 +76,7 @@ LIBRARY charconv.lib LIBRARY bafl.lib LIBRARY efsrv.lib +LIBRARY gdi.lib LIBRARY messagestoreclient.lib LIBRARY fsfwcommonlib.lib diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailstore/base_plugin/inc/basepluginresourceloader.h --- a/emailservices/emailstore/base_plugin/inc/basepluginresourceloader.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailstore/base_plugin/inc/basepluginresourceloader.h Wed Mar 31 21:08:33 2010 +0300 @@ -22,6 +22,7 @@ #include #include #include +#include /** * Library to handle resource loading when CCoeEnv is not available. @@ -48,17 +49,57 @@ IMPORT_C RFs& Fs(); /** - * @param aResourceId a resource key + * @param aResourceId a resource key of a resource defined as LBUF * @return resource value from resource, instance ownership is transferred */ IMPORT_C HBufC* LoadLC(TInt aResourceId ); /** + * @param aResourceId a resource key of a resource defined as TBUF + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* Load2L( TInt aResourceId ); + + /** + * @param aResourceId a resource key of a resource defined as TBUF + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* Load2LC( TInt aResourceId ); + + /** + * @param aResourceId a resource key of a resource defined as TBUF + * @param aString a string value used as parameter in formatting + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* Load2LC( TInt aResourceId, const TDesC& aString ); + + /** + * @param aResourceId a resource key of a resource defined as TBUF + * @param aString a string value used as parameter in formatting + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* Load2L( TInt aResourceId, const TDesC& aString ); + + /** + * @param aResourceId a resource key of a resource defined as TBUF + * @param aInt a number to be inserted into the string + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* Load2LC( TInt aResourceId, TInt aInt ); + + /** + * @param aResourceId a resource key of a resource defined as TBUF + * @param aInt a number to be inserted into the string + * @return resource value from resource, instance ownership is transferred + */ + IMPORT_C HBufC* Load2L( TInt aResourceId, TInt aInt ); + + /** * @param aReader a reader * @param aResourceId a resource key * @return pointer to resource buffer placed on leave stack */ - IMPORT_C HBufC8* CreateResourceReaderLC( TResourceReader& aReader,TInt aResourceId ) const; + IMPORT_C HBufC8* CreateResourceReaderLC( TResourceReader& aReader, TInt aResourceId ) const; private: @@ -73,8 +114,30 @@ */ void ConstructL( const TDesC& aName ); + TInt GetSubStringCount( const TDesC& aText ); + HBufC* ResolveSubStringDirsL( TDes& aText, TInt aCount, TBool* aMarker ); + void RemoveNoDirMarkers(TDes& aText); + TBidiText::TDirectionality DirectionalityL(const TDesC& aText, TBool* aFound); + TBidiText::TDirectionality ResolveDirectionality(TDes& aText, TBool* aFound); + HBufC* FormatStringL(const TDesC& aSource, const TDesC& aKey, const TDesC& aSubs, TBidiText::TDirectionality aDir); + HBufC* FormatStringL( const TDesC& aSource, const TDesC& aKey, const TDesC& aSubs, + TBidiText::TDirectionality aDirectionality, TInt& aParamCount, TInt aSubCount ); + TInt Formater( TDes& aDest, const TDesC& aSource, const TDesC& aKey, + const TDesC& aSubs, TBidiText::TDirectionality aDirectionality ); + HBufC* ResolveSubStringL(TDes& aText, TBool* aMarker); + TInt GetParamCount(const TDesC& aText, TInt aIndex = -1); + private: +class LanguageSpecificNumberConverter + { +public: + static void Convert(TDes &aDes); + static void ConvertToWesternNumbers(TDes &aDes); + static TBool IsConversionNeeded(); + }; + +private: RFs iFs; RResourceFile iResFile; }; diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailstore/base_plugin/src/basepluginresourceloader.cpp --- a/emailservices/emailstore/base_plugin/src/basepluginresourceloader.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/basepluginresourceloader.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -17,10 +17,45 @@ */ + #include #include +#include +#include + #include "basepluginresourceloader.h" +// panic category constant +#ifdef _DEBUG +_LIT( KPanicCategory, "CResourceLoader" ); +#endif + +// CP1252 ellipsis character value. +#define KEllipsis 0x2026 // cp1252=133 + +// Key characters to format key strings. +const TText KKeyPrefix('%'); +const TText KSubStringSeparator(0x0001); // pipe ('|') character +const TText KDirNotFound( 0x0002 ); + +const TInt KExtraSpaceForMainStringDirMarker = 1; +const TInt KExtraSpaceForSubStringDirMarkers = 2; +const TText KLRMarker = 0x200E; +const TText KRLMarker = 0x200F; + +// KIntSize and KKeySize define maximum number of characters +// in input TInts and in keystring. KNumOfParams is maximum number of +// parameters in the resource string. +const TInt KIntSize(11); //Max 11 digits. +const TInt KNumOfParams(20); //Max 20 parameters + +// Key strings for number and unicode data. +_LIT(KNumKeyBuf, "%N"); //Number data +_LIT(KStringKeyBuf, "%U"); //Unicode data + +// KUnknownCount is used as default value for param count in FormatStringL +const TInt KUnknownCount(-99); + EXPORT_C CResourceLoader* CResourceLoader::NewL( const TDesC& aName ) { CResourceLoader* temp = new( ELeave ) CResourceLoader(); @@ -54,7 +89,7 @@ return iFs; } -EXPORT_C HBufC* CResourceLoader::LoadLC(TInt aResourceId) +EXPORT_C HBufC* CResourceLoader::LoadLC( TInt aResourceId ) { TResourceReader reader; HBufC8* readBuffer = CreateResourceReaderLC( reader, aResourceId ); @@ -62,11 +97,136 @@ HBufC16* textBuffer = HBufC16::NewL( textdata.Length() ); *textBuffer = textdata; - CleanupStack::PopAndDestroy(readBuffer); + CleanupStack::PopAndDestroy( readBuffer ); CleanupStack::PushL( textBuffer ); return textBuffer; } +EXPORT_C HBufC* CResourceLoader::Load2L( TInt aResourceId ) + { + HBufC8* readBuffer = iResFile.AllocReadLC( aResourceId ); + const TPtrC16 ptrReadBuffer( ( TText16* ) readBuffer->Ptr(), ( readBuffer->Length()+1 )>>1 ); + HBufC16* textBuffer=HBufC16::NewL( ptrReadBuffer.Length() ); + *textBuffer=ptrReadBuffer; + CleanupStack::PopAndDestroy( readBuffer ); + return textBuffer; + } + +EXPORT_C HBufC* CResourceLoader::Load2LC( TInt aResourceId ) + { + HBufC* retbuf = Load2L( aResourceId ); + CleanupStack::PushL( retbuf ); + return retbuf; + } + +EXPORT_C HBufC* CResourceLoader::Load2L( TInt aResourceId, const TDesC& aString ) + { + HBufC* resbuf = Load2LC( aResourceId ); + TPtr retptr(resbuf->Des()); + + // Get number of sub strings + TInt count = GetSubStringCount( retptr ); + TBool marker(EFalse); + + if (count >= 1) + { + HBufC* buffer = ResolveSubStringDirsL( retptr, count, &marker ); + CleanupStack::PushL(buffer); + + TBool found(EFalse); + TBidiText::TDirectionality mainDir = DirectionalityL(*buffer , &found); + + //Formating the return string with FormatStringL. + HBufC* retbuf = FormatStringL(*buffer, KStringKeyBuf, aString, mainDir); + + CleanupStack::PopAndDestroy(buffer); + CleanupStack::PopAndDestroy(resbuf); + + if (marker && retbuf->Length()) + { + TPtr ptr = retbuf->Des(); + RemoveNoDirMarkers(ptr); + } + + __ASSERT_DEBUG(retbuf->Length(), + User::Panic(KPanicCategory, EKeyStringNotFound)); + return retbuf; + } + else + { + CleanupStack::PopAndDestroy(resbuf); + HBufC* retbuf = HBufC::NewL(0); // return empty buffer + __ASSERT_DEBUG(retbuf->Length(), + User::Panic(KPanicCategory, EKeyStringNotFound)); + return retbuf; + } + } + +EXPORT_C HBufC* CResourceLoader::Load2LC( TInt aResourceId, const TDesC& aString ) + { + HBufC* retbuf = Load2L( aResourceId, aString ); + CleanupStack::PushL( retbuf ); + return retbuf; + } + +EXPORT_C HBufC* CResourceLoader::Load2L(TInt aResourceId, TInt aInt ) + { + HBufC* resbuf = Load2LC( aResourceId ); + TPtr retptr = resbuf->Des(); + // + //Converting input TInt to a descriptor. This way the size + //of the return string can be controlled. + // + TBuf intbuf; + intbuf.Num(aInt); + + if (LanguageSpecificNumberConverter::IsConversionNeeded()) + LanguageSpecificNumberConverter::Convert(intbuf); + // + // Get number of sub strings + TInt count = GetSubStringCount(retptr); + TBool marker(EFalse); + + if (count >= 1) + { + HBufC* buffer = ResolveSubStringDirsL(retptr, count, &marker); + CleanupStack::PushL(buffer); + + TBool found(EFalse); + TBidiText::TDirectionality mainDir = DirectionalityL(*buffer , &found); + + //Adding int + HBufC* retbuf = FormatStringL(*buffer, KNumKeyBuf, intbuf, mainDir); + + CleanupStack::PopAndDestroy(buffer); + CleanupStack::PopAndDestroy(resbuf); + + if (marker && retbuf->Length()) + { + TPtr ptr = retbuf->Des(); + RemoveNoDirMarkers(ptr); + } + __ASSERT_DEBUG(retbuf->Length(), + User::Panic(KPanicCategory, EKeyStringNotFound)); + return retbuf; + } + else + { + CleanupStack::PopAndDestroy(resbuf); + HBufC* retbuf = HBufC::NewL(0); // return empty buffer + __ASSERT_DEBUG(retbuf->Length(), + User::Panic(KPanicCategory, EKeyStringNotFound)); + return retbuf; + } + } + +EXPORT_C HBufC* CResourceLoader::Load2LC( TInt aResourceId, TInt aInt ) + { + HBufC* retbuf = Load2L( aResourceId, aInt ); + CleanupStack::PushL( retbuf ); + return retbuf; + } + EXPORT_C HBufC8* CResourceLoader::CreateResourceReaderLC(TResourceReader& aReader,TInt aResourceId) const { HBufC8* readBuffer = iResFile.AllocReadLC( aResourceId ); @@ -74,3 +234,657 @@ return readBuffer; } +/** +Counts the number of substrings (separated by KSubStringSeparators) in the text. +Needed for correct memory allocations. +*/ +TInt CResourceLoader::GetSubStringCount(const TDesC& aText) + { + TInt subCount = 0; + TInt i = 0; + + while (i < aText.Length()) + { + TPtrC remainder = aText.Right(aText.Length() - i); + TInt nextKey = remainder.Locate(KSubStringSeparator); + i += nextKey; + + // Always increase subcount, as a string without any separators counts as one substring. + // However, if string length is zero, then there are no substrings. + subCount++; + + if (nextKey != KErrNotFound && i < aText.Length() - 1) + { + i++; // skip separator + } + else + break; + } + + return subCount; + } + +HBufC* CResourceLoader::ResolveSubStringDirsL(TDes& aText, TInt aCount, TBool* aMarker) + { + // Allocating heap buffer for return string. + TInt destlength(aText.Length()); + destlength = destlength + (KExtraSpaceForMainStringDirMarker) * aCount; + HBufC* retbuf = HBufC::NewLC(destlength); + TPtr retptr(retbuf->Des()); + TInt freeSpace(destlength); + TInt i(0); + TInt j(0); + TBuf<1> subsMarker; + subsMarker.Append(KSubStringSeparator); + TInt count(aCount - 1); + + while (i < aCount) + { + // Resolve sub string + HBufC* buffer = ResolveSubStringL(aText, aMarker); + TPtr ptr = buffer->Des(); + CleanupStack::PushL(buffer); + + // Restore sub string separators + if (freeSpace >= ptr.Length()) + { + retptr.Insert(j, ptr); + freeSpace -= ptr.Length(); + j += ptr.Length(); + if (freeSpace > KExtraSpaceForMainStringDirMarker && i < count) + { + retptr.Append(subsMarker); + j ++; + } + } + CleanupStack::PopAndDestroy(buffer); + i++; + } + + retbuf = retbuf->ReAllocL(retptr.Length()); + CleanupStack::Pop(); //retbuf + return retbuf; + } + +TBidiText::TDirectionality CResourceLoader::DirectionalityL(const TDesC& aText, TBool* aFound) + { + // Resolve directionality of sub string + HBufC* dirbuf = aText.AllocL(); + TPtr dirptr = dirbuf->Des(); + TBidiText::TDirectionality dir = ResolveDirectionality(dirptr, aFound); + delete dirbuf; + return dir; + } + +/** +Resolves directionality of the given source text. +Place-holder strings are removed so that they don't affect the result. +*/ +TBidiText::TDirectionality CResourceLoader::ResolveDirectionality(TDes& aText, TBool* aFound) + { + TInt i = 0; + + // Remove place-holders from string so they don't affect directionality + // length parameters e.g. "[29]" do not contain strongly directional + // characters so can ignore them. + while (i < aText.Length()) + { + TPtrC remainder = aText.Right(aText.Length() - i); + TInt nextKey = remainder.Locate(KKeyPrefix); + i += nextKey; + + if (nextKey != KErrNotFound && i < aText.Length() - 1) + { + TInt lastCharInKey = i + 1; + + // skip possible key index + TText t = aText[lastCharInKey]; + if (t >= '0' && t <= '9') + { + lastCharInKey++; + + if (lastCharInKey < aText.Length()) + { + t = aText[lastCharInKey]; + if (t >= '0' && t <= '9') + { + lastCharInKey++; + } + } + } + + // lastCharInKey is now the index of 'N' or 'U' in the key + + if (lastCharInKey < aText.Length()) + { + TText t = aText[lastCharInKey]; + if (t == 'U' || t == 'N') + { + // found key, delete it and continue loop to + // search for the next key + aText.Delete(i, lastCharInKey - i + 1); + } + // This was not a proper key - check the remaining string + else + { + i = lastCharInKey + 1; + } + } + // end of string encountered - stop + else + { + break; + } + } + // no key found - stop + else + { + break; + } + } + + return TBidiText::TextDirectionality(aText, aFound); + } + +/** +Finds the keystring from the source string and replaces it with the +replacement string. +*/ +HBufC* CResourceLoader::FormatStringL(const TDesC& aSource, const TDesC& aKey, const TDesC& aSubs,TBidiText::TDirectionality aDir) + { + TInt paramCount(KUnknownCount); // variable needed as it may be updated + return FormatStringL(aSource, aKey, aSubs, aDir, paramCount, KUnknownCount); + } + +/** +Finds the keystring from the source string and replaces it with the +replacement string. +*/ +HBufC* CResourceLoader::FormatStringL(const TDesC& aSource, const TDesC& aKey, const TDesC& aSubs, TBidiText::TDirectionality aDirectionality, + TInt& aParamCount, TInt aSubCount) + { + if (aParamCount == KUnknownCount) + aParamCount = GetParamCount(aSource); + + if (aSubCount == KUnknownCount) + aSubCount = GetSubStringCount(aSource); + + // determine lenght of needed buffer + TInt sourcelength(aSource.Length()); + TInt keylength(aKey.Length()); + TInt subslength(aSubs.Length()); + TInt destlength = 0; + if (subslength >= keylength) + { + destlength = sourcelength + ((subslength - keylength) * aParamCount); + } + else + { + destlength = sourcelength; + } + + destlength += KExtraSpaceForMainStringDirMarker * aSubCount; + destlength += KExtraSpaceForSubStringDirMarkers * aParamCount; + // + // Allocating heap buffer for return string. + // + + HBufC* retbuf = HBufC::NewL(destlength); + TPtr retptr(retbuf->Des()); + + // Formating the resource string. Don't bother with format, + // if parameter count is not above zero + if (aParamCount > 0) + { + aParamCount -= Formater(retptr, aSource, aKey, aSubs, aDirectionality); + __ASSERT_DEBUG(aParamCount >= 0, User::Invariant()); + } + + // + // If the key string wasn't found, retbuf is empty. + // + return retbuf; + } + +/** +Finds the keystring from the source string and replaces it with the +replacement string. The formated string is stored in the destination +descriptor. +*/ +TInt CResourceLoader::Formater(TDes& aDest, const TDesC& aSource, const TDesC& aKey, const TDesC& aSubs, TBidiText::TDirectionality aDirectionality) + { + // substitute string must not contain KSubStringSeparator, + // or results will be unpredictable + __ASSERT_DEBUG(aSubs.Locate(KSubStringSeparator) == KErrNotFound, + User::Panic(KPanicCategory, EInvalidSubstitute)); + + TInt keylength(aKey.Length()); + + //aDest must be empty. + aDest.Zero(); + + // offset indicates end of last handled key in source + TInt offset(0); + + // offset in destination string + TInt desOffset(0); + + // Substring directionalities are adjusted after all changes are done. + TBool checkSubstringDirectionalities(EFalse); + + // count is the position in the source from which the substring starts + TInt count(0); + + // Replaced parameters count + TInt replaceCount(0); + + while (count != KErrNotFound) + { + // desCount is the position of the substring starts in destination. + TInt desCount(0); + + TPtrC remainder = aSource.Right(aSource.Length() - offset); + count = remainder.Find(aKey); + + TInt maxSubLength = -1; + if (count != KErrNotFound) + { + replaceCount++; + desOffset += count; + offset += count; + count = offset; + desCount = desOffset; + + // copy source to destination if first time + if (aDest.Length() == 0) + aDest.Append(aSource); + + // delete found key from destination + aDest.Delete(desCount, keylength); + + offset += keylength; // increase offset by key length + + if (count + keylength < (aSource.Length()-1)) // aKey is not at the end of string + { + if (aSource[count+keylength] == '[') // Key includes max datalength + { + maxSubLength = 10*(aSource[count+keylength+1]-'0') + + (aSource[count+keylength+2]-'0'); + aDest.Delete(desCount,4); // Length information stored->delete from descriptor + offset += 4; // increase offset by max sub length indicator + } + } + + aDest.Insert(desCount, aSubs); + + desOffset = desCount + aSubs.Length(); + + if (maxSubLength > 0 && aSubs.Length() > maxSubLength) + { + aDest.Delete(desCount+maxSubLength-1, aSubs.Length()+1-maxSubLength); + TText ellipsis(KEllipsis); + aDest.Insert(desCount+maxSubLength-1, TPtrC(&ellipsis,1)); + desOffset = desCount + maxSubLength; + } + + TBidiText::TDirectionality subsDir = + TBidiText::TextDirectionality(aDest.Mid(desCount, desOffset - desCount)); + + // If inserted string has different directionality, + // insert directionality markers so that bidi algorithm works in a desired way. + if (aDirectionality != subsDir) + { + checkSubstringDirectionalities = ETrue; + + TInt freeSpace = aDest.MaxLength() - aDest.Length(); + + // Protect the directionality of the inserted string. + if (freeSpace >= KExtraSpaceForSubStringDirMarkers) + { + TBuf<1> subsMarker; + subsMarker.Append(subsDir == TBidiText::ELeftToRight ? + KLRMarker : KRLMarker); + + aDest.Insert(desOffset, subsMarker); + aDest.Insert(desCount, subsMarker); + desOffset += KExtraSpaceForSubStringDirMarkers; + } + } + } + } + + // Adjust substring directionality markers if necessary + // and if there is enough room in destination string + if (checkSubstringDirectionalities) + { + TText mainMarker = (aDirectionality == TBidiText::ELeftToRight ? + KLRMarker : KRLMarker); + + TInt freeSpace = aDest.MaxLength() - aDest.Length(); + + // If not already done, protect the directionality of the original string + // and all of the KSubStringSeparator separated substrings. + if (freeSpace > 0 + && aDest.Length() + && aDest[0] != mainMarker + && aDest[0] != KSubStringSeparator + && aDest[0] != KDirNotFound) + { + aDest.Insert(0, TPtrC(&mainMarker, 1)); + freeSpace--; + } + + // Find and protect KSubStringSeparator separated substrings. + // Go through string backwards so that any changes will not affect indexes + // that are not yet checked. + TInt j(aDest.Length()-1); + while (freeSpace > 0 && j >= 0) + { + if (aDest[j] == KSubStringSeparator && j < (aDest.Length() - 1) + && aDest[j+1] != mainMarker && aDest[j+1] != KDirNotFound) + { + aDest.Insert(j+1, TPtrC(&mainMarker, 1)); + freeSpace--; + } + j--; + } + } + + return replaceCount; + } + +/** +Counts the number of parameters in the text. +Needed for correct memory allocations. +*/ +TInt CResourceLoader::GetParamCount(const TDesC& aText, TInt aIndex) + { + TInt paramCount(0); + TInt i(0); + TBool singleIndex((aIndex < 0) || (aIndex > KNumOfParams) ? EFalse : ETrue); + + while (i < aText.Length()) + { + TPtrC remainder = aText.Right(aText.Length() - i); + TInt nextKey = remainder.Locate(KKeyPrefix); + i += nextKey; + + if (nextKey != KErrNotFound && i < aText.Length() - 1) + { + TInt lastCharInKey = i + 1; + + // skip possible key index + TText t = aText[lastCharInKey]; + TInt foundIndex(-1); + + if (t >= '0' && t <= '9') + { + lastCharInKey++; + foundIndex = t - '0'; + + if (lastCharInKey < aText.Length()) + { + t = aText[lastCharInKey]; + if (t >= '0' && t <= '9') + { + foundIndex *= 10; + foundIndex += t - '0'; + lastCharInKey++; + } + } + } + + // lastCharInKey is now the index of 'N' or 'U' in the key + + if (lastCharInKey < aText.Length()) + { + // Only count parameter, if index matches + if (!singleIndex || (foundIndex == aIndex)) + { + TText t = aText[lastCharInKey]; + if (t == 'U' || t == 'N') + { + // found legit key, count it + paramCount++; + // continue search after index + i = lastCharInKey + 1; + } + else if (t == '%') + i = lastCharInKey; + else // continue search after index + i = lastCharInKey + 1; + } + else // continue search after index + i = lastCharInKey + 1; + } + else // end of string encountered - stop + break; + } + else // no key found - stop + break; + } + + return paramCount; + } + +/** +Resolves sub string and directionality of the sub string. +Adds no dir marker if directionality of the string not found. +*/ +HBufC* CResourceLoader::ResolveSubStringL(TDes& aText, TBool* aMarker) + { + // Allocating heap buffer for return string. + TInt destlength(aText.Length()); + HBufC* retbuf = HBufC::NewLC(destlength + 1); // no dir marker + TPtr retptr(retbuf->Des()); + + TBuf<1> marker; + marker.Append(KDirNotFound); + + TPtrC remainder = aText.Right(aText.Length()); + TInt nextKey = remainder.Locate(KSubStringSeparator); + + if (nextKey == 0) + { + remainder.Set(remainder.Mid(1)); + nextKey = remainder.Locate(KSubStringSeparator); + if (nextKey != KErrNotFound) + { + retptr.Insert(0, aText.Mid(1, nextKey)); + // Remove string from aText + aText.Delete(0, nextKey + 1); + } + else + { + TInt length = aText.Length(); + retptr.Insert(0, aText.Mid(1, length - 1)); + // Remove string from aText + aText.Delete(0, length); + } + } + else if (nextKey == KErrNotFound) + { + retptr.Insert(0, aText); + // Remove string from aText + aText.Delete(0, aText.Length()); + } + else + { + retptr.Insert(0, aText.Mid(0, nextKey)); + // Remove string from aText + aText.Delete(0, nextKey); + } + + // Resolve directionality of sub string + HBufC* dirbuf = retbuf->AllocL(); + TPtr dirptr = dirbuf->Des(); + TBool found(EFalse); + TBidiText::TDirectionality mainDir = ResolveDirectionality(dirptr, &found); + delete dirbuf; + + if (!found) + { + retptr.Insert(0, marker); + *aMarker = ETrue; + } + else + { + *aMarker = EFalse; + } + + retbuf = retbuf->ReAllocL(retptr.Length()); + CleanupStack::Pop(); //retbuf + // If the key string wasn't found, retbuf is empty. + return retbuf; + } + +/** +Removes no dir markers from source text. +*/ +void CResourceLoader::RemoveNoDirMarkers(TDes& aText) + { + TInt nextkey(0); + while (nextkey < aText.Length()) + { + nextkey = aText.Locate(KDirNotFound); + if (nextkey != KErrNotFound) + { + aText.Delete(nextkey, 1); + nextkey++; + } + else + { + break; + } + } + } + +// ============================ MEMBER FUNCTIONS =============================== + +static TChar NumberToBase(const TChar& aCharacter ) + { + const TDigitType d[] = { EDigitTypeWestern, + EDigitTypeArabicIndic, + EDigitTypeEasternArabicIndic, + EDigitTypeDevanagari, + EDigitTypeThai }; + + const TInt num = sizeof( d ) / sizeof( d[0] ); + + TInt i = 0; + while( i < num ) + { + if (aCharacter > TChar( d[i] ) && aCharacter < TChar( d[i]+10 )) + return d[i]; + + i++; + } + + return aCharacter; + } + +/** +This routine is used to convert between European digits and +Arabic-Indic, Eastern Arabic-Indic, Devanagari or Thai digits +based on existing digit type setting. + +@param aDes Parameter to change +*/ +void CResourceLoader::LanguageSpecificNumberConverter::Convert( TDes &aDes ) + { + TLocale locale; + locale.Refresh(); + const TDigitType digitType = locale.DigitType(); + TChar toArea = 0x030; + switch( digitType ) + { + case EDigitTypeWestern: + case EDigitTypeArabicIndic: + case EDigitTypeEasternArabicIndic: + case EDigitTypeDevanagari: + case EDigitTypeThai: + toArea = digitType; + break; + case EDigitTypeUnknown: + case EDigitTypeAllTypes: + return; + } + + const TInt length = aDes.Length(); + for( TInt i = 0; i < length; i++ ) + { + TChar character = aDes[i]; + TChar fromArea = NumberToBase( character ); + TChar::TBdCategory cat = character.GetBdCategory(); + switch( cat ) + { + case TChar::EArabicNumber: + case TChar::EEuropeanNumber: + character += toArea; + character -= fromArea; + aDes[i] = TUint16( character ); + break; + default: + break; + } + } + } + +/** +This routine is used to convert Arabic-Indic, Eastern Arabic-Indic +or Devanagari digits to European digits. + +@param aDes Parameter to change +*/ +void CResourceLoader::LanguageSpecificNumberConverter::ConvertToWesternNumbers( TDes &aDes ) + { + const TChar toArea = 0x030; + const TInt KLastDevanagariDigit = 0x96F; + const TInt KFirstDevanagariDigit = 0x966; + const TInt length = aDes.Length(); + + for( TInt i=0; iiObjects.Count() == 0 ) { + iFiles.Remove( iFiles.Find(aHandler) ); delete aHandler; - - iFiles.Remove( iFiles.Find(aHandler) ); } // end if } else diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/emailstore/message_store/server/src/ContainerStoreUtils.cpp --- a/emailservices/emailstore/message_store/server/src/ContainerStoreUtils.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/emailstore/message_store/server/src/ContainerStoreUtils.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -211,7 +211,7 @@ __LOG_ENTER( "CreateDatabaseL" ); // Create the file store. - iFileStore = CPermanentFileStore::ReplaceL( iFs, iDbFilename, EFileRead|EFileWrite ); + iFileStore = CPermanentFileStore::ReplaceL( iFs, iDbFilename, EFileRead|EFileWrite|EFileWriteDirectIO ); iFileStore->SetTypeL( iFileStore->Layout() ); @@ -237,7 +237,7 @@ __LOG_ENTER( "OpenDatabaseL" ) // construct a file store object - iFileStore = CPermanentFileStore::OpenL( iFs, iDbFilename, EFileRead|EFileWrite ); + iFileStore = CPermanentFileStore::OpenL( iFs, iDbFilename, EFileRead|EFileWrite|EFileWriteDirectIO ); // open database from the root of the store iDatabase.OpenL( iFileStore, iFileStore->Root() ); diff -r 0396474f30f5 -r 4ce476e64c59 emailservices/psmruadapter/src/CPsMruAdapter.cpp --- a/emailservices/psmruadapter/src/CPsMruAdapter.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailservices/psmruadapter/src/CPsMruAdapter.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -125,8 +125,8 @@ } if(iDelayMailboxCreationPtr) { - iDelayMailboxCreationPtr->Deque(); delete iDelayMailboxCreationPtr; + iDelayMailboxCreationPtr = NULL; } iDelayedCreatedMailboxes.Reset(); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/data/FreestyleEmailUi.rss --- a/emailuis/emailui/data/FreestyleEmailUi.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/data/FreestyleEmailUi.rss Wed Mar 31 21:08:33 2010 +0300 @@ -468,109 +468,6 @@ } //------------------------------------------------------------------------------ -// Message viewer toolbar -//------------------------------------------------------------------------------ -// -RESOURCE AVKON_TOOLBAR r_freestyle_email_ui_toolbar_message_viewer - { - flags = KAknToolbarFixed; - items = - { - TBAR_CTRL - { - type = EAknCtToolbarExtension; - id = EFsEmailUiTbCmdActions; - control = AVKON_TOOLBAR_EXTENSION - { - helptxt = qtn_fse_tb_actions; - bmpFile = EMAILUI_ICON_FILE; - bmpId = EMbmFreestyleemailuiQgn_indi_tb_email_extend; - bmpMask = EMbmFreestyleemailuiQgn_indi_tb_email_extend_mask; - items = - { - TBAR_CTRL - { - type = EAknCtButton; - id = EFsEmailUiTbCmdReplyAll; - control = AVKON_BUTTON - { - flags = KAknButtonRequestExitOnButtonUpEvent; - states = - { - AVKON_BUTTON_STATE - { - txt = qtn_fse_tb_ext_reply_all; - bmpfile = EMAILUI_ICON_FILE; - bmpid=EMbmFreestyleemailuiQgn_indi_tb_email_reply_all; - bmpmask=EMbmFreestyleemailuiQgn_indi_tb_email_reply_all_mask; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = EFsEmailUiTbCmdForward; - control = AVKON_BUTTON - { - flags = KAknButtonRequestExitOnButtonUpEvent; - states = - { - AVKON_BUTTON_STATE - { - txt = qtn_fse_tb_ext_forward; - bmpfile = EMAILUI_ICON_FILE; - bmpid=EMbmFreestyleemailuiQgn_indi_tb_email_forward; - bmpmask=EMbmFreestyleemailuiQgn_indi_tb_email_forward_mask; - } - }; - }; - } - }; // eof extension items - }; // eof AVKON_TOOLBAR_EXTENSION control - }, - TBAR_CTRL - { - type = EAknCtButton; - id = EFsEmailUiTbCmdReply; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_fse_tb_reply; - bmpfile = EMAILUI_ICON_FILE; - bmpid=EMbmFreestyleemailuiQgn_indi_tb_email_reply; - bmpmask=EMbmFreestyleemailuiQgn_indi_tb_email_reply_mask; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = EFsEmailUiTbCmdDelete; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_fse_tb_delete; - bmpfile = EMAILUI_ICON_FILE; - bmpid=EMbmFreestyleemailuiQgn_indi_tb_delete; - bmpmask=EMbmFreestyleemailuiQgn_indi_tb_delete_mask; - } - }; - }; - } - }; - } - -//------------------------------------------------------------------------------ // Html message viewer toolbar with Reply all //------------------------------------------------------------------------------ // @@ -597,7 +494,7 @@ id = EFsEmailUiTbCmdReply; control = AVKON_BUTTON { - flags = KAknButtonSizeFitText; + flags = KAknButtonRequestExitOnButtonUpEvent; states = { AVKON_BUTTON_STATE @@ -638,7 +535,7 @@ id = EFsEmailUiTbCmdForward; control = AVKON_BUTTON { - flags = KAknButtonRequestExitOnButtonUpEvent; + flags = KAknButtonSizeFitText; states = { AVKON_BUTTON_STATE @@ -708,7 +605,7 @@ id = EFsEmailUiTbCmdForward; control = AVKON_BUTTON { - flags = KAknButtonRequestExitOnButtonUpEvent; + flags = KAknButtonSizeFitText; states = { AVKON_BUTTON_STATE @@ -743,7 +640,10 @@ }; } - +//------------------------------------------------------------------------------ +// Attachment list toolbar +//------------------------------------------------------------------------------ +// RESOURCE AVKON_TOOLBAR r_freestyle_email_ui_toolbar_attachment_list { flags = KAknToolbarFixed; @@ -809,21 +709,20 @@ }; } +RESOURCE LOCALISABLE_APP_INFO r_freestyle_email_ui_loc_app_info + { + short_caption = qtn_fse_short_app_name; + caption_and_icon = + { + CAPTION_AND_ICON_INFO + { + caption = qtn_fse_app_name; + number_of_icons = 1; + icon_file = APP_BITMAP_DIR"\\FreestyleEmailUi_aif.mif"; + } + }; + } -RESOURCE LOCALISABLE_APP_INFO r_freestyle_email_ui_loc_app_info - { - short_caption = qtn_fse_short_app_name; - caption_and_icon = - { - CAPTION_AND_ICON_INFO - { - caption = qtn_fse_app_name; - number_of_icons = 1; - icon_file = APP_BITMAP_DIR"\\FreestyleEmailUi_aif.mif"; - } - }; - } - // VIEW RESOURCES OF THE APPLICATION RESOURCE AVKON_VIEW r_fsemailui_dummy_view { @@ -841,11 +740,11 @@ cba = r_freestyle_emauil_ui_sk_options_back; } -RESOURCE AVKON_VIEW r_fsemailui_mail_viewer_view +RESOURCE AVKON_VIEW r_fsemailui_mail_list_view_marking_mode { - menubar = r_fsemailui_mailviewer_menubar; - cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; - } + menubar = r_fsemailui_maillist_menubar_marking_mode; + cba = r_freestyle_emauil_ui_sk_options_cancel; + } RESOURCE AVKON_VIEW r_fsemailui_mail_details_view { @@ -952,6 +851,23 @@ }; } +RESOURCE CBA r_freestyle_emauil_ui_sk_options_cancel + { + buttons = + { + CBA_BUTTON + { + id = EAknSoftkeyOptions; + txt = text_softkey_option; + }, + CBA_BUTTON + { + id = EAknSoftkeyCancel; + txt = text_softkey_cancel; + } + }; + } + RESOURCE CBA r_freestyle_emauil_ui_sk_options_back__open { buttons = @@ -1155,6 +1071,7 @@ RESOURCE TBUF r_freestyle_email_ui_message_to_folder { buf=qtn_fse_confirm_note_message_moved; } RESOURCE TBUF r_freestyle_email_ui_messages_to_folder { buf=qtn_fse_confirm_note_messages_moved; } RESOURCE TBUF r_freestyle_email_ui_settings_ips_text { buf=qtn_fse_message_list_options_settings_mailbox; } +RESOURCE TBUF r_freestyle_email_ui_markingmode { buf=qtn_fse_message_list_options_mark; } // OUTBOX NOTE RESOURCE TBUF r_freestyle_email_ui_open_from_outbox_note { buf=qtn_fse_info_note_cannot_open; } @@ -1432,14 +1349,35 @@ MENU_ITEM { command = EFsEmailUiCmdMailActions; txt = qtn_cmail_message_list_options_actions; cascade=r_fsemailui_maillist_submenu_mail_actions;}, MENU_ITEM { command = EFsEmailUiCmdSync; txt = qtn_cmail_message_list_options_send_receive; }, MENU_ITEM { command = EFsEmailUiCmdCancelSync; txt = qtn_fse_launcher_options_cancel_sync; }, - MENU_ITEM { command = EFsEmailUiCmdSubMenuMark; txt = qtn_fse_message_list_options_mark; cascade=r_fsemailui_maillist_submenu_mark;}, - MENU_ITEM { command = EFsEmailUiCmdSubMenuUnmark; txt = qtn_fse_message_list_options_unmark; cascade=r_fsemailui_maillist_submenu_unmark;}, + MENU_ITEM { command = EFsEmailUiCmdMarkingMode; txt = qtn_fse_message_list_options_mark; }, MENU_ITEM { command = EFsEmailUiCmdSettings; txt = qtn_fse_message_list_options_settings; }, MENU_ITEM { command = EFsEmailUiCmdHelp; txt = qtn_options_help; }, MENU_ITEM { command = EFsEmailUiCmdExit; txt = qtn_options_exit; } }; } - + +RESOURCE MENU_BAR r_fsemailui_maillist_menubar_marking_mode + { + titles = + { + MENU_TITLE { menu_pane = r_fsemailui_maillist_marking_mode_menupane; txt = ""; } + }; + } + +RESOURCE MENU_PANE r_fsemailui_maillist_marking_mode_menupane + { + items = + { + MENU_ITEM { command = EFsEmailUiCmdMarkingModeDelete; txt = qtn_fse_action_menu_delete; }, + MENU_ITEM { command = EFsEmailUiCmdMarkingModeUnread; txt = qtn_fse_message_list_options_mark_unread; }, + MENU_ITEM { command = EFsEmailUiCmdMarkingModeRead; txt = qtn_fse_message_list_options_mark_read; }, + MENU_ITEM { command = EFsEmailUiCmdMarkingModeMove; txt = qtn_fse_action_menu_move_message; }, + MENU_ITEM { command = EFsEmailUiCmdMarkingModeFollowUp; txt = qtn_fse_message_list_flag_followup; }, + MENU_ITEM { command = EFsEmailUiCmdMarkingModeMarkAll; txt = qtn_options_list_mark_all; }, + MENU_ITEM { command = EFsEmailUiCmdMarkingModeUnmarkAll; txt = qtn_options_list_unmark_all; } + }; + } + RESOURCE MENU_PANE r_fsemailui_maillist_submenu_mail_actions { items = @@ -1453,26 +1391,8 @@ MENU_ITEM { command = EFsEmailUiCmdActionsCollapseAll; txt = qtn_fse_message_list_options_collapse_all; }, MENU_ITEM { command = EFsEmailUiCmdActionsExpandAll; txt = qtn_fse_message_list_options_expand_all; } }; - } + } -RESOURCE MENU_PANE r_fsemailui_maillist_submenu_mark - { - items = - { - MENU_ITEM { command = EFsEmailUiCmdMarkMark; txt = qtn_cmail_message_list_options_sub_mark; }, - MENU_ITEM { command = EFsEmailUiCmdMarkMarkAll; txt = qtn_cmail_message_list_options_sub_mark_all; }, - MENU_ITEM { command = EFsEmailUiCmdMarkSubAll; txt = qtn_cmail_message_list_options_sub_all; } - }; - } - -RESOURCE MENU_PANE r_fsemailui_maillist_submenu_unmark - { - items = - { - MENU_ITEM { command = EFsEmailUiCmdUnmarkSubAll; txt = qtn_cmail_message_list_options_sub_all; } - }; - } - RESOURCE MENU_PANE r_fsemailui_maillist_submenu_mail_settings { items = @@ -1484,36 +1404,7 @@ } }; } - -RESOURCE MENU_BAR r_fsemailui_mailviewer_menubar - { - titles = - { - MENU_TITLE { menu_pane = r_fsemailui_mailviewer_menupane; txt = ""; } - }; - } -RESOURCE MENU_PANE r_fsemailui_mailviewer_menupane - { - items = - { - MENU_ITEM { command = EFsEmailUiCmdActionsMoveToDrafts; txt = qtn_fse_message_list_options_move_to_drafts; }, - MENU_ITEM { command = EFsEmailUiCmdActionsForward; txt = qtn_fse_message_list_options_forward; }, - MENU_ITEM { command = EFsEmailUiCmdActionsReply; txt = qtn_fse_message_list_options_reply; }, - MENU_ITEM { command = EFsEmailUiCmdActionsReplyAll; txt = qtn_fse_message_list_options_reply_all; }, - MENU_ITEM { command = EFsEmailUiCmdActionsForward2; txt = qtn_fse_message_list_options_forward; }, - MENU_ITEM { command = EFsEmailUiCmdActionsDelete; txt = qtn_fse_message_list_options_delete; }, - MENU_ITEM { command = EFsEmailUiCmdReadEmail; txt = qtn_fse_message_list_options_read; }, - MENU_ITEM { command = EFsEmailUiCmdMailActions; txt = qtn_fse_message_list_options_actions; cascade=r_fsemailui_mailviewer_submenu_actions;}, - MENU_ITEM { command = EFsEmailUiCmdMore; txt = qtn_fse_message_list_options_more; cascade=r_fsemailui_mailviewer_submenu_more;}, - MENU_ITEM { command = EFsEmailUiCmdActionsCopyToClipboard; txt = qtn_fse_viewer_options_copy_to_clipboard; }, - MENU_ITEM { command = EFsEmailUiCmdPreviousMessage; txt = qtn_fse_viewer_options_previous_message; }, - MENU_ITEM { command = EFsEmailUiCmdNextMessage; txt = qtn_fse_viewer_options_next_message; }, - MENU_ITEM { command = EFsEmailUiCmdHelp; txt = qtn_options_help; }, - MENU_ITEM { command = EFsEmailUiCmdExit; txt = qtn_options_exit; } - }; - } - //menu for msk in mail viewer RESOURCE MENU_BAR r_fsemailui_mailviewer_msk_menubar { @@ -1591,47 +1482,6 @@ }; } -// MailViewer actions menu -// All items are hidden by default; appropriate items are made visible in DynInitMenuPaneL() -RESOURCE MENU_PANE r_fsemailui_mailviewer_submenu_actions - { - items = - { - MENU_ITEM { command = EFsEmailUiCmdActionsCall; txt = qtn_fse_viewer_options_call; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsAddContact; txt = qtn_fse_viewer_options_add_to_contacts; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsCreateMessage; txt = qtn_fse_viewer_options_create_message; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsCreateMail; txt = qtn_fse_viewer_options_create_email; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsContactDetails; txt = qtn_fse_viewer_options_contact_details; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsAddContact2; txt = qtn_fse_viewer_options_add_to_contacts; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsRemoteLookup; txt = qtn_fse_viewer_options_remote_lookup; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsOpenWeb; txt = qtn_fse_viewer_options_open_web; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsOpenInIntranetMenu; txt = qtn_intra_fseoptions_open_intra; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdActionsAddBookmark; txt = qtn_fse_viewer_options_bookmark; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdOpenAttachment; txt = qtn_options_open; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdDownload; txt = qtn_fse_viewer_options_attach_download; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdCancelDownload; txt = qtn_fse_viewer_options_attach_cancel_download; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdSave; txt = qtn_fse_viewer_options_attach_save; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdClearFetchedAttachment; txt = qtn_fse_viewer_options_attach_clear_fetched; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdOpenAttachmentList; txt = qtn_fse_viewer_options_attach_view_list; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdDownloadAll; txt = qtn_fse_viewer_options_attach_download_all; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdCancelAllDownloads; txt = qtn_fse_viewer_options_attach_cancel_all_downloads; flags = EEikMenuItemDimmed; }, - MENU_ITEM { command = EFsEmailUiCmdSaveAll; txt = qtn_fse_viewer_options_attach_save_all; flags = EEikMenuItemDimmed; } - }; - } - -RESOURCE MENU_PANE r_fsemailui_mailviewer_submenu_more - { - items = - { - MENU_ITEM { command = EFsEmailUiCmdMarkAsUnread; txt = qtn_fse_message_list_options_mark_unread; }, - MENU_ITEM { command = EFsEmailUiCmdMarkAsRead; txt = qtn_fse_message_list_options_mark_read; }, - MENU_ITEM { command = EFsEmailUiCmdActionsMoveMessage; txt = qtn_fse_message_list_options_move_message; }, - MENU_ITEM { command = EFsEmailUiCmdActionsFlag; txt = qtn_fse_message_list_options_flag; }, - MENU_ITEM { command = EFsEmailUiCmdCompose; txt=qtn_fse_message_list_options_compose; }, - MENU_ITEM { command = EFsEmailUiCmdMessageDetails; txt = qtn_fse_message_list_options_message_details; } - }; - } - RESOURCE TBUF r_freestyle_email_ui_viewer_fetching_content_text { buf=qtn_fse_viewer_view_fetching_content; } RESOURCE TBUF r_freestyle_email_ui_viewer_flag_dialog_header { buf=qtn_fse_list_flag_follow_up_title; } @@ -2913,8 +2763,8 @@ }, STYLUS_POPUP_MENU_ITEM { - txt = qtn_cmail_action_menu_mark; // Marks the message, puts the list view to mark mode - command = EFsEmailUiCmdMarkUnmarkToggle; + txt = qtn_cmail_action_menu_mark; // Enter to marking mode + command = EFsEmailUiCmdMarkingModeFromPopUp; }, STYLUS_POPUP_MENU_ITEM { diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/data/cmail_marking_mode_bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/emailui/data/cmail_marking_mode_bg.svg Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/data/html/email_rtl.html --- a/emailuis/emailui/data/html/email_rtl.html Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/data/html/email_rtl.html Wed Mar 31 21:08:33 2010 +0300 @@ -5,7 +5,7 @@ { var bodyFrame = document.getElementById("body_frame"); bodyFrame.contentWindow.document.body.dir = "rtl"; - bodyFrame.contentWindow.document.body.align = "left" + bodyFrame.contentWindow.document.body.align = "right" } onload=setEmailBodyDirection; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/data/iconlist.txt --- a/emailuis/emailui/data/iconlist.txt Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/data/iconlist.txt Wed Mar 31 21:08:33 2010 +0300 @@ -195,3 +195,4 @@ -c16,8 qgn_indi_tb_show_bcc.svg -c16,8 qgn_indi_tb_hide_bcc.svg -c16,8 qgn_indi_tb_extension.svg +-c16,8 cmail_marking_mode_bg.svg diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/group/FreestyleEmailUi.mmp --- a/emailuis/emailui/group/FreestyleEmailUi.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/group/FreestyleEmailUi.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -30,8 +30,8 @@ CAPABILITY CAP_APPLICATION NetworkControl SwEvent UID 0x0 0x2001E277 -EPOCHEAPSIZE 0x1000 0x800000 -EPOCSTACKSIZE 0x5000 +EPOCHEAPSIZE 0x5000 0x800000 +EPOCSTACKSIZE 0x13880 VERSION KEmailBinaryVersionNumber KEmailBinaryDemandPaging @@ -47,9 +47,6 @@ SOURCE FreestyleEmailUiLauncherGridVisualiser.cpp SOURCE FreestyleEmailUiLauncherGridModel.cpp SOURCE FreestyleEmailUiLayoutHandler.cpp -SOURCE FreestyleEmailUiMailViewerVisualiser.cpp -SOURCE FreestyleEmailUiMailViewerRichText.cpp -SOURCE FreestyleEmailUiMailViewerControl.cpp SOURCE FreestyleEmailUiMailListModel.cpp SOURCE FreestyleEmailUiMailListControl.cpp SOURCE FreestyleEmailUiMailListVisualiser.cpp diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/group/bld.inf --- a/emailuis/emailui/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -94,6 +94,8 @@ ../data/html/btn_middle.png /epoc32/release/winscw/urel/z/private/2001E277/HtmlFile/btn_middle.png ../data/html/todo_low_add.png /epoc32/release/winscw/urel/z/private/2001E277/todo_low_add.png +../data/cmail_marking_mode_bg.svg /epoc32/s60/icons/cmail_marking_mode_bg.svg + ../sis/commonemailstub.sis /epoc32/data/z/system/install/commonemailstub.sis /* Plugin settings exports */ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUi.hrh --- a/emailuis/emailui/inc/FreestyleEmailUi.hrh Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUi.hrh Wed Mar 31 21:08:33 2010 +0300 @@ -151,12 +151,17 @@ EFsEmailUiCmdGoToSwitchSorting, EFsEmailUiCmdGoToSwitchNewEmail, EFsEmailUiCmdGoToActionMenu, - EFsEmailUiCmdMark, + EFsEmailUiCmdMarkingModeFromPopUp, + EFsEmailUiCmdMarkingMode, + EFsEmailUiCmdMarkingModeDelete, + EFsEmailUiCmdMarkingModeUnread, + EFsEmailUiCmdMarkingModeRead, + EFsEmailUiCmdMarkingModeMove, + EFsEmailUiCmdMarkingModeFollowUp, + EFsEmailUiCmdMarkingModeMarkAll, + EFsEmailUiCmdMarkingModeUnmarkAll, EFsEmailUiCmdMarkMark, - EFsEmailUiCmdMarkMarkAll, EFsEmailUiCmdMarkUnmark, - EFsEmailUiCmdMarkUnmarkAll, - EFsEmailUiCmdMarkUnmarkToggle, EFsEmailUiCmdMailActions, EFsEmailUiCmdMore, EFsEmailUiCmdSearch, @@ -319,13 +324,8 @@ EFsEmailUiTbCmdSaveAll, EFsEmailUiTbCmdActions, - EFsEmailUiTbCmdReplyAll, + EFsEmailUiTbCmdReplyAll // Toolbar - - EFsEmailUiCmdSubMenuMark, - EFsEmailUiCmdSubMenuUnmark, - EFsEmailUiCmdMarkSubAll, - EFsEmailUiCmdUnmarkSubAll }; enum TFsEmailUiViewerOpenInIntranetCmds diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiAppui.h --- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h Wed Mar 31 21:08:33 2010 +0300 @@ -65,7 +65,6 @@ class CFSEmailUiLayoutHandler; class CFSEmailUiViewSwitchTimer; class CFSEmailUiList; -class CFSEmailUiMailViewerVisualiser; class CFSEmailUiMailListVisualiser; class CFSMailClient; class CFSMailMessage; @@ -677,9 +676,6 @@ // Mail view CFSEmailUiMailListVisualiser* iMailListVisualiser; - // Plain text viewer view, control inside text view; - CFSEmailUiMailViewerVisualiser* iViewerVisualiser; - // Message editor view CNcsComposeView* iComposeView; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiContactHandler.h --- a/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -45,6 +45,7 @@ class CAiwServiceHandler; class CContactItem; class MPbkGlobalSetting; +class CEikonEnv; /** Contact handler commands. */ enum TContactHandlerCmd @@ -457,6 +458,8 @@ // connection to CCMA launcher MCCAConnection* iConnection; + + CEikonEnv* iEnv; }; #endif /*FREESTYLEEMAILUICONTACTHANDLER_H_*/ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h --- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h Wed Mar 31 21:08:33 2010 +0300 @@ -318,11 +318,11 @@ void CopyHTMLResourceL(); // Ensure all resource files (eg. images) required by HTML display to be ready in C:\[private]\HtmlFile void EnsureHTMLResourceL(); - void ConvertToHTML( const TDesC8& aContent, + void ConvertToHTML( const TDesC& aContent, const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ); HBufC8* GetCharacterSetL( CFSMailMessagePart& aHtmlBodyPart ); TBool IsMessageBodyURLL(const TDesC& aUrl); - void CreateHyperlinksFromUrlsL( CBufBase& aSource ); + void CreateHyperlinksFromUrlsL( RBuf& aSource ); //Returns ETrue of clicking on a link requires a browser to be launched TBool NeedToLaunchBrowserL( const TDesC& aUrl ); //Launch the browser as a standalone app diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h --- a/emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -22,14 +22,10 @@ // SYSTEM INCLUDES #include #include -// SF #include #include -// SF -// Platform layout change #include #include -// Platform layout change // INTERNAL INCLUDES #include "FreestyleEmailUiLayoutData.h" @@ -39,7 +35,6 @@ // CLASS DECLARATION class CFSEmailUiLayoutHandler : public CBase { - // public: /* @@ -50,20 +45,13 @@ ELeft, ERight }; - // public: static CFSEmailUiLayoutHandler* NewL( CAlfEnv& aEnv ); ~CFSEmailUiLayoutHandler(); - - // Function returns currently used screen resolution - TScreenResolution ScreenResolution() const; - + // Function returns orientation of the currect screen resolution TScreenOrientation ScreenOrientation() const; - - // Function can be used to request screen resolution value update - void ScreenResolutionChanged(); // Main UI grid icon size TSize GridIconSize() const; @@ -276,9 +264,7 @@ TRect GetListRect( TBool aControlsOnTop = EFalse ) const; CAlfTextStyle& FSTextStyleFromLayoutL( const TAknTextComponentLayout& aLayout ); -// TInt TitleCaptionPadding() const; - TRect ListCmailPaneRect() const; TAknLayoutText GetSearchListHeaderTextLayout() const; @@ -292,28 +278,16 @@ // Padding value for drop down menu TInt DropDownMenuListPadding() const; -// - private: CFSEmailUiLayoutHandler( CAlfEnv& aEnv ); void ConstructL(); TRgb GetSkinColor( const TAknsItemID& aID, TInt aIndex, const TRgb& aFallbackColor ) const; -// Platform layout change void DeleteTextStyles(); -// Platform layout change private: CAlfEnv& iEnv; - TScreenResolution iScreenResolution; -// Platform layout change RHashMap< TAknTextComponentLayout, CAlfTextStyle* > iTextStyleMap; -// Platform layout change -// Text Styles - TInt iNormalTextStyle; - TInt iLargeTextStyle; - TInt iSmallTextStyle; -// }; #endif //__FREESTYLEEMAILUI_LAYOUTHANDLER_H__ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Wed Mar 31 21:08:33 2010 +0300 @@ -378,7 +378,7 @@ TRect SortButtonRect(); // Update theme colors - void UpdateTheme(const TBool aSystemUpdate = ETrue); + void UpdateThemeL(const TBool aSystemUpdate = ETrue); // Navigation functions, used mainly from viewer TBool IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId, TFSMailMsgId& aFoundNextMsgFolder ) const; @@ -538,10 +538,91 @@ void ExpandOrCollapseL(); // Mark control functions + /** + * Mark all items + */ void MarkAllItemsL(); + + /** + * Unmark all items + */ void UnmarkAllItemsL(); + + /** + * Exit from marking mode + * @return TInt count of marked items + */ TInt CountMarkedItemsL(); + /** + * Check if all items are marked + */ + TBool AreAllItemsMarked(); + + /** + * Check if all items are unmarked + */ + TBool AreAllItemsUnmarked(); + + /** + * Check if all marked items are read + */ + TBool AreAllMarkedItemsReadL(); + + /** + * Check if all marked items are unread + */ + TBool AreAllMarkedItemsUnreadL(); + + /** + * Exit from marking mode + */ + void ExitMarkingModeL(); + + /** + * Enter to marking mode + */ + void EnterMarkingModeL(); + + /** + * Refresh marking mode + */ + void RefreshMarkingModeL(); + + /** + * Display marking mode title text + */ + void DisplayMarkingModeTitleTextL(); + + /** + * Remove marking mode title text + */ + void RemoveMarkingModeTitleTextL(); + + /** + * Displays or remove marking mode background + */ + void DisplayMarkingModeBgL( TBool aDisplay ); + + /** + * Mark/unmark items under current separator. + * + * @param aMarked If ETrue mark all items else unmark. + * @param aSeparatorId Id of the separator. + */ + void MarkItemsUnderSeparatorL( TBool aMarked, TInt aSeparatorId ); + + /** + * Check if all items are marked under separator + * + * @param aSeparatorId Id of the separator. + * @return TBool ETrue if all items are marked under separator + */ + TBool AreAllItemsMarkedUnderSeparatorL( TInt aSeparatorId ); + + /** + * Restore marking status + */ void MarkMessagesIfFoundL( const RArray& aMessageIDs ); // Message deletion internal functions @@ -650,14 +731,6 @@ // scrolling. Returns ETrue if the highlighted item is markable. TBool DoScrollMarkUnmarkL(); - /** - * Mark/unmark items under current separator. - * - * @param aMarked If ETrue mark all items else unmark. - * @param aSeparatorId Id of the separator. - */ - void MarkItemsUnderSeparatorL( TBool aMarked, TInt aSeparatorId ); - //When maillist is activated this method handles the connection icon change void ConnectionIconHandling(); @@ -808,6 +881,17 @@ TBool iMailOpened; // tactile feed back -- not owned MTouchFeedback* iTouchFeedBack; + // Is device in marking mode + TBool iMarkingMode; + // Exit marking mode when view is back to mail list view + TBool iMarkingModeWaitingToExit; + // Marking mode title variables + CAlfTextVisual* iMarkingModeTextVisual; + CAlfLayout* iMarkingModeTextParentLayout; + CAlfAnchorLayout* iMarkingModeTextContentLayout; + TPoint iMarkingModeTextPos; + TSize iMarkingModeTextSize; + TRect iMarkingModeTextRect; }; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiMailViewerControl.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailViewerControl.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declares top control class for email viewer -* -*/ - - - -#ifndef FREESTYLEEMAILUIMAILVIEWERCONTROL_H -#define FREESTYLEEMAILUIMAILVIEWERCONTROL_H - -// SYSTEM INCLUDES -// SF -#include -// - -// FORWARD DECLARATIONS -class CFSEmailUiMailViewerVisualiser; - -/** -* CFreestyleEmailUiMailViewerControl is top control class for capturing option and -* key events for the email viewer visualiser to handle -*/ -class CFreestyleEmailUiMailViewerControl : public CAlfControl - { - -public: - - /** - * Two-phased constructor. - * - * @param aEnv Reference to the ALF environment. - */ - static CFreestyleEmailUiMailViewerControl* NewL( CAlfEnv& aEnv, CFSEmailUiMailViewerVisualiser& aVisualiser ); - - /** - * Two-phased constructor. - * - * @param aEnv Reference to the ALF environment. - */ - static CFreestyleEmailUiMailViewerControl* NewLC( CAlfEnv& aEnv, CFSEmailUiMailViewerVisualiser& aVisualiser); - - /** - * Virtual destructor. - */ - virtual ~CFreestyleEmailUiMailViewerControl(); - -public: // From CAlfControl - - TBool OfferEventL( const TAlfEvent& aEvent ); - - void HandleCommandL( TInt aCommand ); - -private: - - /** - * Constructor. - * - * @param aEnv Reference to the ALF environment. - * @param aVisualiser Reference to visualiser for command handling. - */ - CFreestyleEmailUiMailViewerControl( CFSEmailUiMailViewerVisualiser& aVisualiser); - - /** - * Two-phased constructor. - */ - void ConstructL(CAlfEnv& aEnv); - -private: - - // Handle to viewer visualiser - CFSEmailUiMailViewerVisualiser& iVisualiser; - - }; - -#endif /*FREESTYLEEMAILUIMAILVIEWERCONTROL_H*/ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiMailViewerRichText.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailViewerRichText.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,360 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FreestyleEmailUi mail viewer rich text definition -* -*/ - - - -#ifndef __FREESTYLEEMAILUI_MAILVIEWERRICHTEXT_H__ -#define __FREESTYLEEMAILUI_MAILVIEWERRICHTEXT_H__ - -// SYSTEM INCLUDE FILES -#include -#include -// -#include -// - -// Forward declarations -class CAknLayoutFont; -class CFSMailMessage; -class CFSMailBox; -class CFsTextViewer; -class CFsRichText; -class CFreestyleEmailUiAppUi; -class CAlfTextVisual; - -// Header data -struct SMailMsgHeaderInfo - { - TInt iHeaderLineCount; - TInt iToLineCount; - TInt iCcLineCount; - TInt iSubjectLineCount; - TBool iFlagIconOnHtmlLine; - }; - -// Different hotspot types -enum TViewerHeadingHotspotType - { - ETypeFromAddressDisplayName = 0, - ETypeToAddressDisplayName, - ETypeCcAddressDisplayName, - ETypeBccAddressDisplayName, - ETypeEmailAddress, - ETypeToNMoreRecipients, - ETypeCcNMoreRecipients, - ETypeBccNMoreRecipients, - ETypeAttachment, - ETypeAttachments, - ETypeHtml - }; - -// Different recipient types -enum TViewerRecipientType - { - EViewerRecipientTypeTo = 0, - EViewerRecipientTypeCc, - EViewerRecipientTypeBcc - }; - - -// Struct for one header hotspot data -struct SViewerHeadingHotSpotData - { - TViewerHeadingHotspotType iType; - TInt iStart; - TInt iEnd; - TInt iDisplayNameArrayIndex; - TInt iHotspotLine; - }; - -// Body and header hotspots are different -enum THotspotType - { - ENoHotspot, - EHeaderHotspot, - EBodyHotspot - }; - - -/** -* CFSEmailUiMailViewerRichText is a rich text for the mail viewer visualiser -* -*/ -class CFSEmailUiMailViewerRichText : public CBase - { -public: - static CFSEmailUiMailViewerRichText* NewL( CFreestyleEmailUiAppUi& aFsTextureManager ); - static CFSEmailUiMailViewerRichText* NewLC( CFreestyleEmailUiAppUi& aFsTextureManager ); - - virtual ~CFSEmailUiMailViewerRichText(); - - void RefreshRichTextL( CFsTextViewer& aTextViewer, CFSMailMessage& aMessage, CFSMailBox& aMailBox ); - void Reset(); - - // Provides handle to richtext - CFsRichText& RichText(); - - // Getters for text lines - TInt SentTextLine() const; - TInt SubjectTextLine() const; - TInt AttachmentTextLine() const; - TInt ViewHtmlTextLine() const; - TInt HeaderLengthInCharacters() const; - - // Getters for hotspot indicies - TInt AttachmentHotSpotIndex() const; - TInt ViewHtmlHotSpotIndex() const; - - // Icon updating - - // Different icon types presented in message viewer. - enum TViewerIconType - { - // status icon - EViewerEmailStatus, - // follow up - EViewerIconFollowUp, - EViewerIconFollowUpComplete, - EViewerIconFollowUpNone, - // attachment icon - EViewerAttachment, - // used for layouting - EViewerIconIndentation, - EViewerIconSpacing, - // - EViewerIconSeparatorLine - // - }; - - // Append given icon type to rich text - void UpdateIconL( TViewerIconType aViewerIconType ); - - // Helpers to get possible current hotpots asked - TBool FindCurrentHeaderHotSpotL( SViewerHeadingHotSpotData& aHotSpot ) const; - TBool FindCurrentBodyHotSpotL( CFindItemEngine::SFoundItem& aHotSpot ) const; - - THotspotType FindCurrentHotSpotL( SViewerHeadingHotSpotData& aHeaderHotspot, - CFindItemEngine::SFoundItem& aBodyHotspot ) const; - - // Getters for current hotspot texts - HBufC* GetHotspotTextLC( const SViewerHeadingHotSpotData& aCurrentHotSpot ) const; - HBufC* GetHotspotTextLC( const CFindItemEngine::SFoundItem& aCurrentHotSpot ) const; - HBufC* GetEmailAddressLC( const SViewerHeadingHotSpotData& aCurrentHotSpot ) const; - - HBufC* GetHeaderHotspotEmailAddressLC( const SViewerHeadingHotSpotData& aCurrentHeaderHotSpotData ) const; - - // Appending newly fetched text to the end of the body - void AppendFetchedBodytextLinesL( CFSMailMessage& aMessagePtr ); - - // Status layout to show "Fetching More - - -" - void CreateStatusLayoutL( TBool aSetEmptyContents = ETrue ); - - // For fetching updating "Fetching more" -text - void AppendFetchingMoreTextL(); - void SetEmptyStatusLayoutTextL(); - - void SetHotspotHighlightedColorL( TInt aStartIndx, TInt aLenght, TBool aHighlight ); - - TInt CurrentHotspotIndexL(); - - void SetHotspotByIndexL( TInt aIndex ); - - TInt EmailStatusIconLine(); - TInt FollowupIconLine(); - -private: - - // Helper function for getting hotspot text from rich text data - HBufC* GetHotspotTextLC( TInt aStartPos, TInt aLength ) const; - -private: // Methods for constructing the view's rich text - - // Helper functions for constructing the rich text from the message - void AppendRecipientIndetationL(); - void AppendNewLineL(); - void AppendSpaceL(); - void AppendMessageIconL(); - TBool AppendFollowUpIconL( CFSMailMessage& aMessagePtr ); - void AppendAttachmentIconL(); - - // - HBufC* ClipHeaderInfoToFitLC( const TDesC& aText, TBool aIsDisplayName = EFalse ); - TInt HeaderIndentedTextAreaWidth( const TBool aAddExtra = ETrue ) const; - // - - // These functions read actual data from the message and appends it in the - // correct format to the rich text - void AppendFromLineL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ); - - void AppendRecipientLinesL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo, - TViewerRecipientType aRecipientType ); - - void AppendSentLineL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ); - void AppendSubjectLinesL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ); - void AppendAttachmentLinesL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ); - void AppendInitialBodytextLinesL( CFSMailMessage& aMessagePtr ); - void AppendHtmlTextLineL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ); - void AppendRecipientsL( const RPointerArray& aRecipientArray, SMailMsgHeaderInfo& aHeaderInfo, TViewerRecipientType aRecipientType ); - // separator line - void AppendSeparatorLineL(); - TInt SeparatorLineWidth() const; - // separator line - - void FindBodyTextHotSpotsL( const TDesC& aBodyContent ); - -private: // Methods for handling font and layout spesific things. - - // Different fonts types - enum TViewerFontType - { - EViewerFontTitle = 0, - EViewerFontText, - EViewerFontBody, - EViewerFontHotspotNormal, - EViewerFontHotspotHighLighted, - EViewerFontSent, - EViewerFontIndentation - }; - - // - // Constructs all used fonts in on array for current text size. - //void ReConstructFontArrayL(); - - // For getting spesific font - //CAknLayoutFont& FontFromFontArray( TViewerFontType aFontType ); - const CAknLayoutFont* GetCorrectFontL( TViewerFontType aFontType ) const; - // - - // For getting different font colors - TRgb SkinFontColorByType( TViewerFontType aFontType ); - - // - // For constructing different fonts. - const CAknLayoutFont* CurrentTitleFontL() const; - const CAknLayoutFont* CurrentTextFontL() const; - const CAknLayoutFont* CurrentSentTextFontL() const; - // - - // Transparent icons are used for layouting purpose. - // Only way for setting spesific size of indentations or spaces between - // lines in pixels - // See LAF documents for more information and for exact sizes. - - // Different transparent icon types used for layout. - enum TViewerSpacingIconType - { - ETopMostSpace = 0, // top most space in the view before any text - ERecipientSpace, // space that is after header info text and actual recipient text - EHeaderInfoSpace, // space that is always after recipient text and before next header info text. - EBottomMostSpace, // bottom most space in the header after all text - ESpaceBetweenIconAndSubject - }; - - // Returns the needed height for the given spacing icon type - TInt CurrentSpacingHeight( TViewerSpacingIconType aSpacingIconType ) const; - - // Appends the given spacig icon type to the rich text - void InsertTransparentSpacingIconL( TViewerSpacingIconType aSpacingIconType ); - - // Append certain size spacing icon after the email status or follow up icon. - void InsertSpaceAfterIconL(); - - // Appends given text with the hotspot font type formating to the rich text as a hotspot - void InsertHotspotTextAndFontL( const TDesC& aText ); - - // Appends given text with the given font type formatting to the rich text - void AppendFormattedTextL( const TDesC& aText, TViewerFontType aFontType ); - - // Inserts given text with the given font type formatting to the given - // position in the rich text - void InsertFormattedTextL( const TDesC& aText, TViewerFontType aFontType, - TInt aPosition ); - - // - // Applies formating information to the rich text. - void ApplyFontToTextL( const CAknLayoutFont* aFont, TInt aStartInx, - TInt aLength, TRgb& aColor, TFontUnderline aUnderline ); - // - - // Appends hotspot formating to given body hotspot - void AddBodyHotsSpotWithTextFormatingL( const CFindItemEngine::SFoundItem& aBodyHotSpotData ); - -private: // Construction - - CFSEmailUiMailViewerRichText( CFreestyleEmailUiAppUi& aFsTextureManager ); - - void ConstructL(); - -private: - - // Text Viewer component's rich text - CFsRichText* iViewerRichText; - - // App Ui handle for getting the texture manager - CFreestyleEmailUiAppUi& iAppUi; - - // Mail message pointer, changes always in do activate - CFsTextViewer* iTextViewer; // not owned - // Used to display Fetching more Text - CAlfTextVisual* iStatusVisual; // not owned - - // Used to display Fetching more Text - CAlfAnchorLayout* iStatusLayout; // not owned - - CFSMailMessage* iMessage; // not owned - CFSMailBox* iMailBox; // not owned - - // Header data storage - SMailMsgHeaderInfo iHeaderLineInfo; - - // Header and body hotspot arrays - RArray iViewerHeadingHotSpotData; - RArray iBodyTextHotSpotData; - - // Total length of the header text after the text has been constructed - TInt iHeaderLength; - - // Helper variable to store current document lenght while constructing rich text - TInt iRichTextDocumentLength; - - // Amount of characters currently shown from the body part - TInt iBodyLength; - - // Autofetch animation ellipsis count - TInt iCurrentEllipsisCount; - - // Array fonts - RPointerArray iFontsArray; - - // Size of the next spacing icon to be drawn. - TSize iCurrentSpacingIconSize; - - // Icon places - TInt iEmailStatusIconPlace; - TInt iEmailStatusIconLine; - TInt iFollowupIconPlace; - TInt iFollowupIconLine; - TInt iAttachmentIconPlace; - - // Lines and hotsopt indicies for initial scrolling position handling - TInt iSentTextLine; - TInt iSubjectTextLine; - TInt iAttachmentHotSpotIndex; - TInt iViewHtmlHotSpotIndex; - }; - -#endif //__FREESTYLEEMAILUI_MAILVIEWERRICHTEXT_H__ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,496 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FreestyleEmailUi mail viewer visualiser definition -* -*/ - - -#ifndef __FREESTYLEEMAILUI_MAILVIEWERVISUALISER_H__ -#define __FREESTYLEEMAILUI_MAILVIEWERVISUALISER_H__ - -// SYSTEM INCLUDE FILES -#include -#include -#include -// -#include "fstextviewerobserver.h" -//#include -#include -#include -// -// -#include "mfsmailrequestobserver.h" -#include "mesmricalviewercallback.h" -#include "mesmricalviewerobserver.h" -// - -// INTERNAL INCLUDE FILES -#include "FreestyleEmailUiViewBase.h" -#include "FreestyleEmailUiListVisualiser.h" -#include "FreestyleEmailDownloadInformationMediator.h" -#include "FreestyleEmailUiConstants.h" -#include "FreestyleEmailUiControlBarCallback.h" -#include "FreestyleEmailUiUtilities.h" -#include "FreestyleEmailUiContactHandlerObserver.h" -#include "FreestyleEmailUiMailViewerRichText.h" - -// FORWARD DECLARATIONS -class CFSMailMessage; -class CFreestyleEmailUiAppUi; -class CFsTextViewer; -class CFsTextViewerWatermark; -class CFsSmileyDictionary; -class CFreestyleEmailUiMailViewerControl; -class CAiwServiceHandler; -class CBrowserLauncher; -class CFSEmailUiStatusIndicator; -class CFlagSelectionGlobalNoteHandler; -class CAknGlobalListQuery; -class CAknGlobalNote; -class CAknWaitDialog; // -class CAknNavigationDecorator; - -// list of different types of action menus to be shown. -enum TActionMenuType - { - ENoActionMenuFocused = 0, - EFocusOnNumberWithinMessage, - EFocusOnHyperLinkWithinMessage, - EFocusOnNameInAddressField, - EFocusOnEMailInBodyText, - EFocusOnAttachmentName, - EFocusOnAttachmentsText - }; - - -/** -* CFSEmailUiMailViewerVisualiser implements message viewer view. -* It uses FS Generic TV component, which displays rich text with hotspots. -* View contains hotspot related action menu handling and many options menu -*/ -class CFSEmailUiMailViewerVisualiser : public CFsEmailUiViewBase, - public MFsTextViewerObserver, - public MFSEmailDownloadInformationObserver, - public MFSMailRequestObserver, - public MFSEmailUiFolderListCallback, - public MProgressDialogCallback, //cmail - public MFSEmailUiGenericTimerCallback, - public MFSEmailUiContactHandlerObserver, - public MESMRIcalViewerCallback, - public MESMRIcalViewerObserver, - public MAknNaviDecoratorObserver - { -public: // construction and destruction - static CFSEmailUiMailViewerVisualiser* NewL( CAlfEnv& aEnv, CFreestyleEmailUiAppUi& aAppUi, CAlfControlGroup& aMailViewerControlGroup ); - static CFSEmailUiMailViewerVisualiser* NewLC( CAlfEnv& aEnv, CFreestyleEmailUiAppUi& aAppUi, CAlfControlGroup& aMailViewerControlGroup ); - ~CFSEmailUiMailViewerVisualiser(); - void PrepareForExit(); - -public: // methods - CAlfControl* ViewerControl(); - void SetMskL(); - // Event handling forwarded from control - TBool OfferEventL( const TAlfEvent& aEvent ); - - // Handle accept/decline/tentative/remove commands given for meeting request message directly from list UI. - void HandleMrCommandL( TInt aCommandId, TFSMailMsgId aMailboxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId ); - - void CompletePendingMrCommand(); - void CancelPendingMrCommandL(); - - // Helper funcitons to get viewed message ID and Folder id - TFSMailMsgId ViewedMessageFolderId(); - TFSMailMsgId ViewedMessageId(); - - // Called from global flag selection dialog - void FlagselectionCompleteL( TInt aSelection ); - - void HandleMailBoxEventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, - TAny* aParam1, TAny* aParam2, TAny* aParam3 ); - -public: // from CFsEmailUiViewBase - void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); - void HandleCommandL( TInt aCommand ); - - TUid Id() const; - - void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); - void HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType ); - void HandleForegroundEventL(); - -protected: // from CFsEmailUiViewBase - /*void DoDoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage );*/ - void ChildDoDeactivate(); - void ActivateControlGroup( TInt aDelay = 0 ); - void GetParentLayoutsL( RPointerArray& aLayoutArray ) const; - void NavigateBackL(); - -public: // from MFsTextViewerObserver - void HandleTextViewerEventL( TFsTextViewerEvent aEvent ); - -public : // from MFSEmailDownloadInformationObserver - void RequestResponseL( const TFSProgress& aEvent, const TPartData& aPart ); - -public : // for MFSMailRequestObserver - void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); - -public: // from MFSEmailUiFolderListCallback - void FolderSelectedL( TFSMailMsgId aSelectedFolderId, - TFSEmailUiCtrlBarResponse aResponse ); - -public: // from MAknBackgroundProcess - // we are using different wait note - //void StepL(); - //TBool IsProcessDone() const; - //void ProcessFinished(); - //void DialogDismissedL( TInt /*aButtonId*/ ); - //TInt CycleError( TInt aError ); - - // from MProgressDialogCallback - void DialogDismissedL( TInt aButtonId); - // - -public: // from MFSEmailUiGenericTimerCallback - void TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ); - -public: // from MFSEmailUiContactHandlerObserver - void OperationCompleteL( TContactHandlerCmd aCmd, - const RPointerArray& aContacts ); - void OperationErrorL( TContactHandlerCmd, TInt aError ); - -public: // from MESMRIcalViewerCallback - void ProcessAsyncCommandL( TESMRIcalViewerOperationType aCommandId, const CFSMailMessage& aMessage, MESMRIcalViewerObserver* aObserver = NULL ); - void ProcessSyncCommandL( TESMRIcalViewerOperationType aCommandId, const CFSMailMessage& aMessage ); - TBool CanProcessCommand( TESMRIcalViewerOperationType aCommandId ) const; - -public: // from MESMRIcalViewerObserver - void OperationCompleted( TIcalViewerOperationResult aResult ); - void OperationError( TIcalViewerOperationResult aResult ); - -public: // from MAknNaviDecoratorObserver - - /** - * Called by navigationDecorator if navi arrows (left/right) have been pressed - * @aParam aEventID specifies a tapping of either left or right arrow - */ - void HandleNaviDecoratorEventL( TInt aEventID ); - -// Toolbar -private: // from - - /** - * @see CFsEmailUiViewBase::ChildDoActivateL - */ - void ChildDoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * @see CFsEmailUiViewBase::OfferToolbarEventL - */ - void OfferToolbarEventL( TInt aCommand ); - - /** - * @see CFsEmailUiViewBase::ToolbarResourceId - */ - TInt ToolbarResourceId() const; -// Toolbar - -private: // methods - - // Class constructing - CFSEmailUiMailViewerVisualiser( CAlfEnv& aEnv, CFreestyleEmailUiAppUi& aAppUi, - CAlfControlGroup& aMailViewerControlGroup ); - void ConstructL(); - - // Constructing & refreshing the view - void AddBackgroundPicturesL(); - void ClearMailViewer(); - void UpdateMailViewerL(); - void RefreshL( TBool aFirstStart = EFalse ); - // Callback function to encapsulate actions which are deferred form RefreshL() to - // make it complete faster - static TInt DoPostRefresh( TAny* aSelfPtr ); - void PostRefreshL(); - void SetActionButtonIconAndHighLight(); - void CheckMessageStructureL(); - void UpdateDownloadIndicatorL( TFSProgress::TFSProgressStatus aStatus = TFSProgress::EFSStatus_Waiting ); - - // Update our message pointer and change observed message - void UpdateMessagePtrL( TFSMailMsgId aNewMailbox, TFSMailMsgId aNewFolder, TFSMailMsgId aNewMessage ); - void UpdateMessagePtr( CFSMailMessage* aNewMessagePtr ); - - // Message stack handling. Ownership of message is transferred when succesful. - void PushMessageL( CFSMailMessage* aMessage, TBool aIsEmbedded ); - CFSMailMessage* PopMessage(); - void EraseMessageStack(); - // Html viewer opening - void LaunchHtmlViewerL(); - - // Changing message states - void SetMessageFollowupFlagL(); - void ChangeMsgReadStatusL( TBool aRead, TBool aCmdFromMrui ); - - // For deleting current mail - // Return value indicating whether message was deleted - TBool DeleteMailL( CFSMailMessage& aMessagePtr, TBool aReturnPreviousView, TBool aDisableNote = EFalse ); - - // Options menu dimm checking - TBool ShowActionsMenuInOptionsL() const; - TBool ShowDownloadManagerMenuInOptions() const; - TBool ShowNextMessageMenuInOptions() const; - TBool ShowPreviousMessageMenuInOptions() const; - void ShowNextMessageL(); - void ShowPreviousMessageL(); - - // Action menu lauching and selection handling - void LaunchActionMenuL(); - void CreateActionMenuItemsL( TActionMenuType aActionMenuType ); - void HandleActionMenuCommandL( TActionMenuCustomItemId aSelectedActionMenuItem, TActionMenuType aActionMenuType ); - - - // Action menu command handling - void OpenLinkInIntranetL( TBool aMenuSelection = ETrue ); - void OpenHotSpotUrlInBrowserL( CFindItemEngine::SFoundItem& aHotSpot ); - void CallToBodyHotSpotNumberL( CFindItemEngine::SFoundItem& aHotSpot ); - void ComposeMailL(); - void WriteEmailToHotSpotAddressL( CFindItemEngine::SFoundItem& aHotSpot ); - - void OpenContactDetailsL(); - - void LaunchRemoteLookupL( const TDesC& aHotspotText ) const; - void AddToBookmarksL( const CFindItemEngine::SFoundItem& aBodyHotspotData ) const; - - void CallHotSpotAddressL(); - void CreateMessageL() const; - - TBool IsCopyToClipBoardAvailableL() const; - void CopyCurrentHotspotToClipBoardL() const; - - // Attachment handling - TBool ShowOpenAttachmentOptionL(); - TBool ShowSaveAttachmentOptionL(); - TBool ShowDownloadOptionL(); - TBool ShowMskDownloadOptionL(); - TBool ShowCancelDownloadOption(); - void OpenAttachmentL(); - void OpenAttachmentsViewL(); - void StartDowloadingAttachmentsL(); - void CancelDowloadingAttachmentsL(); - void SaveAllAttachmentsL(); - void RemoveFetchedAttachmentL(); - - // Helper method for creating Part data needed when calling to download mediator - TPartData MailData(); - - // Content fecthing - - // list of different types of content - enum TFetchedContentType - { - EMessagePlainTextBodyPart = 0, - EMessageHtmlBodyPart, - EMessageStructure - }; - TBool StartFetchingBodyAfterOpeningL() const; - TBool MessageStructureKnown( CFSMailMessage& aMsg ) const; - TBool MessagePartFullyFetchedL( TFetchedContentType aFetchedContentType ) const; - void StartFetchingMessagePartL( CFSMailMessage& aMessagePtr, - TFetchedContentType aFetchedContentType ); - void StartFetchingMessageStructureL( CFSMailMessage& aMsg ); - void StartWaitedFetchingL( TFetchedContentType aFetchedContentType ); - void StartFetchingRemaininBodyLinesIfAtBottomL(); - void CancelFetchings(); - - void SaveEmailAsContactL( const TDesC& aEmailAddress ); - void SavePhoneNumberAsContactL( const TDesC& aPhoneNumber ); - - void SetMailboxNameToStatusPaneL(); - - TInt ResolveBodyTextSchemaUrlTypeL( CFindItemEngine::SFoundItem aHotSpot ); - - void SetActionMenuIconVisbilityL(); - - void SendEventToAppUiL( TFSMailEvent aEventType ); - - void DoFirstStartL(); - - /** - * Initiates the hotspot action, if currently focused header hotspot has - * some direct hotspot action defined (not opening action menu). Returns - * ETrue if direct action specified (and initiated) for the focused - * hotspot, otherwise EFalse. - */ - TBool HandleHeaderHotspotActionL( TViewerHeadingHotspotType aHotspotType ); - - /** - * Handles updating of navigation pane content - * (navi arrows + priority and followup icons) - * - * @param aForESMR Whether the navi pane update is for meeting - * request or not. - */ - void UpdateNaviPaneL( TBool aForESMR = EFalse ); - - /** - * Sets mailviewer's navipane to background - */ - void HideNaviPane(); - -private: // Methods for moving message - - // Start moving current visible message to different folder - // Return EFalse if moving is not a supported function - TBool OpenFolderListForMessageMovingL(); - - // Message is moved and viewer is closed asynchronously after selecting a folder - // from the move to folder dialog. This is necessary because view swithching is asynchronous. - static TInt MoveToFolderAndExitL( TAny* aMailViewerVisualiser ); - -private: // data for moving message to different folder action - - TBool iMoveToFolderOngoing; - TBool iMovingMeetingRequest; - CAsyncCallBack* iAsyncCallback; - TFSMailMsgId iMoveDestinationFolder; - -private: // data related to fetching - - TBool iFetchingMessageStructure; - TInt iCurrentStructureFetchRequestId; - - TBool iFetchingPlainTextMessageBody; - TInt iCurrentPlainTextBodyFetchRequestId; - - TBool iFetchingHtmlMessageBody; - TInt iCurrentHtmlBodyFetchRequestId; - - TFetchedContentType iStartAsyncFetchType; - - // Wait note stuff - // - //CAknWaitNoteWrapper* iAsyncWaitNote; - CAknWaitDialog* iWaitDialog; - CAknWaitDialog* iWaitDialogOpening; - TBool iDialogNotDismissed; - // - TBool iFetchingAlready; - TBool iAsyncProcessComplete; - -private: // data for fetching timer - - CFSEmailUiGenericTimer* iFetchingAnimationTimer; - -private: // other class data - - // Handle to ALF environment - CAlfEnv& iEnv; - - // Stack of open messages. Messages are owned by this stack. - CStack* iOpenMessages; - // Stack of embedded messages. Message are NOT owned by this stack. Similar to iOpenMessages - // but has NULL pointer in slots which correspond non-embedded messages. - CStack* iEmbeddedMessages; - // Mail message pointer, changes always in do activate - CFSMailMessage* iMessage; - - // Mail box where the iMessage object is. - CFSMailBox* iMailBox; - - // AlfControl for capturing right and left navigation key events - CFreestyleEmailUiMailViewerControl* iControl; - - // Text viewer and control object - CFsTextViewer* iTextViewer; - - // Pointer to TV component control - CAlfControl* iTextViewerControl; // not owned - - // Rich text for the view. - CFSEmailUiMailViewerRichText* iViewerRichText; - - // Basic smileys for the - CFsSmileyDictionary* iSmDictionary; - - // For opening the intranet app - CAiwServiceHandler* iIBServiceHandler; - - // Boolean to indicate that layout has changed while some other view was active - TBool iLayoutChangedWhileNotActive; - - // Temporary mail address for opening editor - CFSMailAddress* iNewMailTempAddress; - - // Meeting request observer stuff. - // Pointer to observer to inform, not owned. - MESMRIcalViewerObserver* iMrObserverToInform; - MESMRIcalViewerObserver::TIcalViewerOperationResult iOpResult; - TBool iMrUiActive; - - // Flag to indicate that we are moving into next or previous message - TBool iNextOrPevMessageSelected; - - CAlfControlGroup* iDownloadProgressControlGroup; // owned by AlfEnv - CFSEmailUiStatusIndicator* iDownloadProgressIndicator; - - // Flag selection handler active object for global note - CFlagSelectionGlobalNoteHandler* iFlagSelectionHanler; - - TBool iFirstStartCompleted; - TBool iShowMskDownloadOption; - - // Flag to indicate we are viewing an embedded message. Many UI options need to be hidden in that case. - TBool iEmbeddedMessageMode; - - // - // Message pointer to a deleted mail from Mrui - TFSMailMsgId iDeletedMessageFromMrui; - // - }; - - -//////////////////////////////////////// -// FLAG selection dialog global note handler -///////////////////////////////////////// -class CFlagSelectionGlobalNoteHandler : public CActive - { - public: // Constructors and destructor - static CFlagSelectionGlobalNoteHandler* NewL( CFSEmailUiMailViewerVisualiser& aViewerVisualiser ); - virtual ~CFlagSelectionGlobalNoteHandler(); - void Cancel(); - void LaunchFlagListQueryDialogL(); - - private: - - void RunL(); - void DoCancel(); - TInt RunError( TInt aError ); - - private: - CFlagSelectionGlobalNoteHandler( CFSEmailUiMailViewerVisualiser& aVoIPDialogObserver ); - - - private: - CFSEmailUiMailViewerVisualiser& iViewerVisualiser; - CAknGlobalListQuery* iGlobalFlagQuery; - HBufC* iPrompt; - TInt iSelection; - }; - - -#endif //__FREESTYLEEMAILUI_MAILVIEWERVISUALISER_H__ - - diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Wed Mar 31 21:08:33 2010 +0300 @@ -271,8 +271,6 @@ CAlfAnchorLayout* iSearchTopBarComponentLayout; // Top bar visuals and layout - CAlfDeckLayout* iSearchTopBarLayout; - CAlfImageVisual* iBarBgVisual; //CAlfImageVisual* iBarFindImage; not in cmail CAlfTextVisual* iBarTextVisual; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/FreestyleEmailUiTextureManager.h --- a/emailuis/emailui/inc/FreestyleEmailUiTextureManager.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiTextureManager.h Wed Mar 31 21:08:33 2010 +0300 @@ -50,6 +50,7 @@ EListTextureControlButton, EListTextureMailboxDefaultIcon, EListTextureNewEmailDefaultIcon, + EListTextureCreateNewMessageIcon, EListControlBarMailboxDefaultIcon, EBackgroundTextureViewerHeading, EBackgroundTextureBar, @@ -209,7 +210,9 @@ EAttachmentsSaveAll, EAttachmentsCancelAll, EAttachmentsViewAll, - + + EMarkingModeBackgroundIcon, + // TEXTURE COUNT ETextureCount, @@ -268,6 +271,9 @@ // Get new mail list separator brush // Ownership IS transferred to caller. CAlfFrameBrush* NewMailListSeparatorBgBrushLC(); + // Get marking mode background brush + // Ownership IS transferred to caller. + CAlfImageBrush* NewMailListMarkingModeBgBrushLC(); // Get new mail list separator brush // Ownership IS transferred to caller. CAlfImageBrush* NewControlBarListBgBrushLC(); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/inc/cmailcustomstatuspaneindicators.h --- a/emailuis/emailui/inc/cmailcustomstatuspaneindicators.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/inc/cmailcustomstatuspaneindicators.h Wed Mar 31 21:08:33 2010 +0300 @@ -56,6 +56,11 @@ void SetFollowUpFlag( TFollowUpFlagType aFlagType ); /** + * Clears flags from pane + */ + void ClearStatusPaneFlags(); + + /** * Hide all status pane flags */ void HideStatusPaneIndicators(); @@ -64,7 +69,7 @@ * Show status pane flags, whan called flags are sett OFF */ void ShowStatusPaneIndicators(); - + private: /** * Construction @@ -86,7 +91,13 @@ * Sets this control's window rect */ void DoSetRectL(); - + + /** + * Draws itself by clearing with KRgbTransparent color. + * Usefull for removing prority icon + */ + void Draw( const TRect& aRect ) const; + public: // From CCoeControl TSize MinimumSize(); TInt CountComponentControls() const; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/loc/freestyleemailui.loc --- a/emailuis/emailui/loc/freestyleemailui.loc Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/loc/freestyleemailui.loc Wed Mar 31 21:08:33 2010 +0300 @@ -2517,19 +2517,19 @@ #define qtn_fse_tb_actions "Actions" // d:Extended toolbar button reply, creates a reply to email message sender -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // #define qtn_fse_tb_ext_reply "Reply" // d:Extended toolbar button reply, creates a reply to email message sender and other recipients -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // #define qtn_fse_tb_ext_reply_all "Reply to all" // d:Extended toolbar button forward, creates a forward email message to the sender -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // #define qtn_fse_tb_ext_forward "Forward" @@ -2829,44 +2829,44 @@ #define qtn_mail_tb_tooltip_actions "Actions" // d:Toolbar extension command for setting low priority flag in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // #define qtn_mail_tb_ext_priority_low "Low" // d:Toolbar extension command for setting high priority flag in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // #define qtn_mail_tb_ext_priority_high "High" // d:Toolbar extension command for setting follow up flag in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // #define qtn_mail_tb_ext_follow_up "Follow up" // d:Toolbar extension command for showing cc field in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // -#define qtn_mail_tb_ext_show_cc "Show Cc field" +#define qtn_mail_tb_ext_show_cc "Show Cc" // d:Toolbar extension command for hiding cc field in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // -#define qtn_mail_tb_ext_hide_cc "Hide Cc field" +#define qtn_mail_tb_ext_hide_cc "Hide Cc" // d:Toolbar extension command for showin bcc field in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // -#define qtn_mail_tb_ext_show_bcc "Show Bcc field" +#define qtn_mail_tb_ext_show_bcc "Show Bcc" // d:Toolbar extension command for hiding bcc field in editor -// l:cell_tb_ext_pane_t1 +// l:cell_tb_ext_pane_t1/opt1 // r:TB9.2 // -#define qtn_mail_tb_ext_hide_bcc "Hide Bcc field" - +#define qtn_mail_tb_ext_hide_bcc "Hide Bcc" + diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FSComposerFetchLogic.cpp --- a/emailuis/emailui/src/FSComposerFetchLogic.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FSComposerFetchLogic.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -16,13 +16,10 @@ */ -// #include "emailtrace.h" #include "cfsmailclient.h" #include "cfsmailcommon.h" -// #include -//#include // #include #include "FreestyleEmailUiAppui.h" @@ -35,18 +32,18 @@ // ----------------------------------------------------------------------------- // CFsComposerFetchLogic* CFsComposerFetchLogic::NewL( CFSMailClient& aClient, - TFSMailMsgId aMailBoxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId, - MComposerFetchLogicCallback& aObserver, CFreestyleEmailUiAppUi& aAppUi ) - { + TFSMailMsgId aMailBoxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId, + MComposerFetchLogicCallback& aObserver, CFreestyleEmailUiAppUi& aAppUi ) + { FUNC_LOG; - CFsComposerFetchLogic* self = new (ELeave) CFsComposerFetchLogic( aClient, aObserver, aAppUi ); - CleanupStack::PushL( self ); - self->ConstructL( aMailBoxId, aFolderId, aMessageId ); - CleanupStack::Pop( self ); + CFsComposerFetchLogic* self = new (ELeave) CFsComposerFetchLogic( aClient, aObserver, aAppUi ); + CleanupStack::PushL( self ); + self->ConstructL( aMailBoxId, aFolderId, aMessageId ); + CleanupStack::Pop( self ); return self; - } + } // ----------------------------------------------------------------------------- @@ -54,13 +51,13 @@ // ----------------------------------------------------------------------------- // CFsComposerFetchLogic::CFsComposerFetchLogic( CFSMailClient& aClient, - MComposerFetchLogicCallback& aObserver, CFreestyleEmailUiAppUi& aAppUi ): - iRunMode( EModeInvalid ), iState( EStateNotStarted ), iAppUi( aAppUi ), - iClient( aClient ), iObserver( aObserver ),iFetchingCancelGoingOn(EFalse),// - iFetchingStructure(EFalse), iFetchingBody(EFalse),iRequestCompleted(EFalse)// - { + MComposerFetchLogicCallback& aObserver, CFreestyleEmailUiAppUi& aAppUi ): + iRunMode( EModeInvalid ), iState( EStateNotStarted ), iAppUi( aAppUi ), + iClient( aClient ), iObserver( aObserver ),iFetchingCancelGoingOn(EFalse), + iFetchingStructure(EFalse), iFetchingBody(EFalse),iRequestCompleted(EFalse) + { FUNC_LOG; - } + } // ----------------------------------------------------------------------------- @@ -68,23 +65,21 @@ // ----------------------------------------------------------------------------- // CFsComposerFetchLogic::~CFsComposerFetchLogic() - { + { FUNC_LOG; - //CancelFetchings(); if ( iAppUi.DownloadInfoMediator() ) { iAppUi.DownloadInfoMediator()->StopObserving( this ); } - iParts.Close(); + iParts.Close(); - //delete iAsyncWaitNote; // - delete iMessage; - delete iFolder; - delete iMailBox; + delete iMessage; + delete iFolder; + delete iMailBox; - } + } // ----------------------------------------------------------------------------- @@ -92,15 +87,15 @@ // ----------------------------------------------------------------------------- // void CFsComposerFetchLogic::ConstructL( TFSMailMsgId aMailBoxId, - TFSMailMsgId aFolderId, TFSMailMsgId aMessageId ) - { + TFSMailMsgId aFolderId, TFSMailMsgId aMessageId ) + { FUNC_LOG; - iMailBox = iClient.GetMailBoxByUidL( aMailBoxId ); - iFolder = iClient.GetFolderByUidL( aMailBoxId, aFolderId ); - iMessage = iClient.GetMessageByUidL( aMailBoxId, aFolderId, aMessageId, EFSMsgDataStructure ); + iMailBox = iClient.GetMailBoxByUidL( aMailBoxId ); + iFolder = iClient.GetFolderByUidL( aMailBoxId, aFolderId ); + iMessage = iClient.GetMessageByUidL( aMailBoxId, aFolderId, aMessageId, EFSMsgDataStructure ); - } + } // ----------------------------------------------------------------------------- @@ -108,14 +103,14 @@ // ----------------------------------------------------------------------------- // void CFsComposerFetchLogic::RunReplyLogicL() - { + { FUNC_LOG; - iRunMode = EModeReply; - iState = EStateSmartReply; - iError = KErrNone; - RunStateL(); - } + iRunMode = EModeReply; + iState = EStateSmartReply; + iError = KErrNone; + RunStateL(); + } // ----------------------------------------------------------------------------- @@ -123,19 +118,19 @@ // ----------------------------------------------------------------------------- // void CFsComposerFetchLogic::RunForwardLogicL() - { + { FUNC_LOG; - iRunMode = EModeForward; - iState = EStateSmartForward; - iError = KErrNone; - if ( iAppUi.DownloadInfoMediator() ) - { - iAppUi.DownloadInfoMediator()->AddObserver( this, iMessage->GetMessageId() ); - } - RunStateL(); + iRunMode = EModeForward; + iState = EStateSmartForward; + iError = KErrNone; + if ( iAppUi.DownloadInfoMediator() ) + { + iAppUi.DownloadInfoMediator()->AddObserver( this, iMessage->GetMessageId() ); + } + RunStateL(); - } + } // ----------------------------------------------------------------------------- @@ -201,14 +196,14 @@ } } - + // ----------------------------------------------------------------------------- // CFsComposerFetchLogic::RequestResponseL // ----------------------------------------------------------------------------- // void CFsComposerFetchLogic::RequestResponseL( const TFSProgress& aEvent, const TPartData& aPart ) - { + { FUNC_LOG; // Ignore all responses when cancelling is in progress. @@ -241,156 +236,86 @@ } } - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::StepL -// ----------------------------------------------------------------------------- -// -// -/* -void CFsComposerFetchLogic::StepL() - { - FUNC_LOG; - }*/ -// - - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::IsProcessDone -// ----------------------------------------------------------------------------- -// -// -/* -TBool CFsComposerFetchLogic::IsProcessDone() const - { - FUNC_LOG; - return iFetchComplete; - }*/ -// - - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::ProcessFinished -// ----------------------------------------------------------------------------- -// -// -/* -void CFsComposerFetchLogic::ProcessFinished() - { - FUNC_LOG; - }*/ -// - - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::DialogDismissedL -// ----------------------------------------------------------------------------- -// -/*void CFsComposerFetchLogic::DialogDismissedL( TInt aButtonId )// - { - if(aButtonId == EAknSoftkeyCancel) - { - CancelFetchings(); - iError = KErrCancel; - } - FUNC_LOG; - }*/// - - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::CycleError -// ----------------------------------------------------------------------------- -// -// -/* -TInt CFsComposerFetchLogic::CycleError( TInt aError ) - { - FUNC_LOG; - return aError; - }*/ -// - - // ----------------------------------------------------------------------------- // CFsComposerFetchLogic::RunState // ----------------------------------------------------------------------------- // void CFsComposerFetchLogic::RunStateL() - { + { FUNC_LOG; - TBool doNextState = EFalse; + TBool doNextState = EFalse; - do - { - doNextState = EFalse; + do + { + doNextState = EFalse; - switch ( iState ) - { - case EStateSmartReply: - { - TBool supported = iMailBox->HasCapability( EFSMBoxCapaSmartReply ); - if ( supported ) - { - Complete(); - } - else - { - iState = EStateStructure; - doNextState = ETrue; - } - } - break; + switch ( iState ) + { + case EStateSmartReply: + { + TBool supported = iMailBox->HasCapability( EFSMBoxCapaSmartReply ); + TBool smartEdit = iMailBox->HasCapability( EFSMBoxCapaSmartEdit ); + if ( supported && !smartEdit ) + { + Complete(); + } + else + { + iState = EStateStructure; + doNextState = ETrue; + } + } + break; - case EStateSmartForward: - { - TBool supported = iMailBox->HasCapability( EFSMBoxCapaSmartForward ); - if ( supported ) - { - Complete(); - } - else - { - iState = EStateStructure; - doNextState = ETrue; - } - } - break; + case EStateSmartForward: + { + TBool supported = iMailBox->HasCapability( EFSMBoxCapaSmartForward ); + TBool smartEdit = iMailBox->HasCapability( EFSMBoxCapaSmartEdit ); + if ( supported && !smartEdit ) + { + Complete(); + } + else + { + iState = EStateStructure; + doNextState = ETrue; + } + } + break; - case EStateStructure: - { - TBool hasStructure = TFsEmailUiUtility::IsMessageStructureKnown( *iMessage ); - if ( hasStructure ) - { - iState = EStateBody; - doNextState = ETrue; - } - else - { - RArray ids; - CleanupClosePushL( ids ); - ids.AppendL( iMessage->GetMessageId() ); - TRAP( iError, iStructureRequestId = iFolder->FetchMessagesL( ids, EFSMsgDataStructure, *this ) ); - CleanupStack::PopAndDestroy( &ids ); - if ( KErrNone == iError ) - { - // fetching started successfully - iFetchingStructure = ETrue; - // show wait note - //ShowWaitNoteL(); // - } - else - { - // error occurred - Complete(); - } - } - } - break; + case EStateStructure: + { + TBool hasStructure = TFsEmailUiUtility::IsMessageStructureKnown( *iMessage ); + if ( hasStructure ) + { + iState = EStateBody; + doNextState = ETrue; + } + else + { + RArray ids; + CleanupClosePushL( ids ); + ids.AppendL( iMessage->GetMessageId() ); + TRAP( iError, iStructureRequestId = iFolder->FetchMessagesL( ids, EFSMsgDataStructure, *this ) ); + CleanupStack::PopAndDestroy( &ids ); + if ( KErrNone == iError ) + { + // fetching started successfully + iFetchingStructure = ETrue; + } + else + { + // error occurred + Complete(); + } + } + } + break; - case EStateBody: - { - CFSMailMessagePart* body = iMessage->PlainTextBodyPartL(); + case EStateBody: + { + CFSMailMessagePart* body = iMessage->PlainTextBodyPartL(); TBool fetched = EFalse; // Do we have plain text body part if ( !body ) @@ -414,14 +339,26 @@ CleanupStack::PushL( body ); if ( fetched ) { + // with Smart if ( EModeReply == iRunMode ) { Complete(); } else if ( EModeForward == iRunMode ) { - iState = EStateAttachments; - doNextState = ETrue; + TBool smartForward = iMailBox->HasCapability( EFSMBoxCapaSmartForward ); + if ( smartForward ) + { + // do not download attachments if smartforward + Complete(); + } + else + { + // if smartforward is not suppported fetch attachments + iState = EStateAttachments; + doNextState = ETrue; + } +// Smart Edit changes end } else { @@ -438,8 +375,6 @@ { // fetching started successfully iFetchingBody = ETrue; - // show wait note if not already visible - //ShowWaitNoteL(); // } else { @@ -448,107 +383,50 @@ } } CleanupStack::PopAndDestroy( body ); - } - break; - - case EStateAttachments: - { - if ( TFsEmailUiUtility::HasUnfetchedAttachmentsL( *iMessage ) ) - { - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); + } + break; + + case EStateAttachments: + { + if ( TFsEmailUiUtility::HasUnfetchedAttachmentsL( *iMessage ) ) + { + RPointerArray attachments; + CleanupResetAndDestroyClosePushL( attachments ); iMessage->AttachmentListL( attachments ); for ( TInt i=0; iGetId(); - data.iFolderId = iMessage->GetFolderId(); - data.iMessageId = iMessage->GetMessageId(); - data.iMessagePartId = attachments[i]->GetPartId(); - iParts.AppendL( data ); - iAppUi.DownloadInfoMediator()->DownloadL( data, EFalse ); - } - else - { - iError = KErrGeneral; - Complete(); - } - } - } - CleanupStack::PopAndDestroy( &attachments ); - // show wait note if not already visible - //ShowWaitNoteL(); // - } - else - { - Complete(); - } - } - break; - } - } - while ( doNextState ); - - } - - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::ShowWaitNoteL -// ----------------------------------------------------------------------------- -// -/*void CFsComposerFetchLogic::ShowWaitNoteL() // - { - FUNC_LOG; + { + if ( !TFsEmailUiUtility::IsMessagePartFullyFetched( *attachments[i] ) ) + { + if ( iAppUi.DownloadInfoMediator() ) + { + TPartData data; + data.iMailBoxId = iMailBox->GetId(); + data.iFolderId = iMessage->GetFolderId(); + data.iMessageId = iMessage->GetMessageId(); + data.iMessagePartId = attachments[i]->GetPartId(); + iParts.AppendL( data ); + iAppUi.DownloadInfoMediator()->DownloadL( data, EFalse ); + } + else + { + iError = KErrGeneral; + Complete(); + } + } + } + CleanupStack::PopAndDestroy( &attachments ); + } + else + { + Complete(); + } + } + break; + } + } + while ( doNextState ); + } - if ( !iAsyncWaitNote ) - { - iFetchComplete = EFalse; - - // - iAsyncWaitNote = new(ELeave)CAknWaitDialog( - (REINTERPRET_CAST(CEikDialog**,&iAsyncWaitNote)), ETrue); - iAsyncWaitNote->SetCallback(this); - //iError = KErrNone; - iAsyncWaitNote->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG); - - iAsyncWaitNote = CAknWaitNoteWrapper::NewL(); // - TBool result = iAsyncWaitNote->ExecuteL( R_FSE_FETCHING_WAIT_DIALOG, *this, ETrue ); - if ( !result ) - { - // dialog was canceled - iError = KErrCancel; - // stop downloads - CancelFetchings(); - }// - // - - //iObserver.FetchLogicComplete( iState, iError ); //cmail - } - - }*/ // - -// ----------------------------------------------------------------------------- -// CFsComposerFetchLogic::AskIfUserWantsToFetchAttachmentsL -// ----------------------------------------------------------------------------- -// -/* -TBool CFsComposerFetchLogic::AskIfUserWantsToFetchAttachmentsL() - { - - CAknQueryDialog* dlg = CAknQueryDialog::NewL( CAknQueryDialog::ENoTone ); - dlg->PrepareLC( R_FSE_EDITOR_CONFIRM_ATTACHMENT_DOWNLOAD_DIALOG ); - CAknQueryControl* control = STATIC_CAST( CAknQueryControl*, dlg->ControlOrNull( EGeneralQuery ) ); - HBufC* prompt = StringLoader::LoadLC( R_FSE_EDITOR_CONFIRM_ATTACHMENT_DOWNLOAD ); - control->SetPromptL( *prompt ); - CleanupStack::PopAndDestroy( prompt ); - return TBool( dlg->RunLD() ); - - } -*/ // ----------------------------------------------------------------------------- // CFsComposerFetchLogic::CancelFetchings @@ -596,7 +474,6 @@ } } - // if( !iRequestCompleted ) { if ( iObserver.FetchLogicComplete( iState, KErrCancel )) @@ -609,7 +486,6 @@ } iFetchingCancelGoingOn = EFalse; - // } // ----------------------------------------------------------------------------- @@ -617,38 +493,20 @@ // ----------------------------------------------------------------------------- // void CFsComposerFetchLogic::Complete() - { + { FUNC_LOG; - // if(!iRequestCompleted) { - // - if ( iAppUi.DownloadInfoMediator() ) - { - iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); - } - - /*if ( iAsyncWaitNote ) // - { - iFetchComplete = ETrue; - // new note stops like this and not with IsProcessFinished method - iAsyncWaitNote->ProcessFinishedL(); - // - // observer is called in ShowWaitNoteL where showing - // wait note returns - } - else - {*/ // - // wait note not active, call observer - // + if ( iAppUi.DownloadInfoMediator() ) + { + iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); + } + // wait note not active, call observer iFetchingStructure = EFalse; iFetchingBody = EFalse; iRequestCompleted = ETrue; - // - iObserver.FetchLogicComplete( iState, iError ); - //} // - } + iObserver.FetchLogicComplete( iState, iError ); + } + } - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiAppui.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -95,7 +95,6 @@ #include "FreestyleEmailUi.hrh" #include "FreestyleEmailUiLauncherGrid.h" #include "FreestyleEmailUiLayoutHandler.h" -#include "FreestyleEmailUiMailViewerVisualiser.h" #include "FreestyleEmailUiMailListControl.h" #include "FreestyleEmailUiMailListModel.h" #include "FreestyleEmailUiMailListVisualiser.h" @@ -483,7 +482,6 @@ // Set up layouthandler iLayoutHandler = CFSEmailUiLayoutHandler::NewL( *iEnv ); - iLayoutHandler->ScreenResolutionChanged(); // Create mail client, list mailboxes iMailClient = CFSMailClient::NewL(); @@ -534,16 +532,13 @@ AddViewL( globalSettingsView ); CleanupStack::Pop( globalSettingsView ); - // Create and start view load in idle. Loads rest of the views when in idle. - iViewLoadIdle = CIdle::NewL( CActive::EPriorityIdle ); - iViewLoadIdleCallback = new (ELeave) TCallBack( DelayedViewLoaderCallBackL, this ); - iViewLoadIdle->Start( *iViewLoadIdleCallback ); - - // Create mail viewer - iViewerVisualiser = CFSEmailUiMailViewerVisualiser::NewL( *iEnv, *this, *iEmailViewerControlGroup ); - AddViewL( iViewerVisualiser ); - // Create html viewer - iHtmlViewerControlGroup = &iEnv->NewControlGroupL( KHtmlViewerDisplayGroup ); + // Create and start view load in idle. Loads rest of the views when in idle. + iViewLoadIdle = CIdle::NewL( CActive::EPriorityIdle ); + iViewLoadIdleCallback = new (ELeave) TCallBack( DelayedViewLoaderCallBackL, this ); + iViewLoadIdle->Start( *iViewLoadIdleCallback ); + + // Create html viewer + iHtmlViewerControlGroup = &iEnv->NewControlGroupL( KHtmlViewerDisplayGroup ); iHtmlViewerView = CFsEmailUiHtmlViewerView::NewL( *iEnv, *this, *iHtmlViewerControlGroup ); AddViewL( iHtmlViewerView ); @@ -607,7 +602,7 @@ phCltResPath.Append(KETelCallEngPhCltResourceFile); // BaflUtils::NearestLanguageFile( iEikonEnv->FsSession(), phCltResPath ); - iPhCltResHandle = CCoeEnv::Static()->AddResourceFileL( phCltResPath ); + iPhCltResHandle = iEikonEnv->AddResourceFileL( phCltResPath ); // Create attachment list visualiser and control iAttachmentControlGroup = &iEnv->NewControlGroupL( KAttachmentManagerDisplayGroup ); @@ -984,11 +979,6 @@ const TPckgBuf pkgOut( tmp ); ActivateLocalViewL( SearchListViewId, KStartWithPreviousResults, pkgOut ); } - else if ( viewId == MailViewerId ) - { - const TPckgBuf pkgOut; - ActivateLocalViewL( MailViewerId, KStartViewerReturnToPreviousMsg, pkgOut); - } else if ( viewId == HtmlViewerId ) { // launch html viewer @@ -1179,10 +1169,6 @@ { iMailListVisualiser->PrepareForExit(); } - if ( iViewerVisualiser ) - { - iViewerVisualiser->PrepareForExit(); - } if ( iHtmlViewerView ) { iHtmlViewerView->PrepareForExit(); @@ -1454,6 +1440,15 @@ // resource change handling in list views. Trap any leaves so that we set // the automatic refresh mode back on even in case of error. iEnv->SetRefreshMode( EAlfRefreshModeManual ); + switch ( aType ) + { + case KEikDynamicLayoutVariantSwitch: + iEnv->NotifyLayoutChangedL(); + break; + case KAknsMessageSkinChange: + iEnv->NotifySkinChangedL(); + break; + } TRAPD( error, DoHandleResourceChangeL( aType ) ); iEnv->SetRefreshMode( EAlfRefreshModeAutomatic ); User::LeaveIfError( error ); @@ -1469,11 +1464,12 @@ // { // CAlfEnv::Static()->NotifySkinChangedL(); // } - - if( aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange ) - { + + if ( aType == KEikDynamicLayoutVariantSwitch ) + { // Changing layout for status pane (just in case it is not switched // correctly), fix for HMNN-82BAGR error + // it's not related with skin change so "moved up" TJOS-83DELP fix TBool landscape(Layout_Meta_Data::IsLandscapeOrientation()); CEikStatusPane* statusPane = StatusPane(); if(landscape) @@ -1489,13 +1485,14 @@ { statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT); } - } + } + } + + if( aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange ) + { TRect screenRect; AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); - // layout manager call removed - // Notify layouthandler of changed screen resolution. - iLayoutHandler->ScreenResolutionChanged(); StatusPane()->DrawNow(); if(iEnv) { @@ -1967,7 +1964,7 @@ CleanupStack::PopAndDestroy( &markedMsgIdArray ); } // Check if view is in mail viewer - else if ( mb && ( View(MailViewerId)->IsForeground() || View(SearchListViewId)->IsForeground() ) ) + else if ( mb && ( View(HtmlViewerId)->IsForeground() || View(SearchListViewId)->IsForeground() ) ) { delete iCustomMessageToMessageReader; iCustomMessageToMessageReader = NULL; @@ -1979,7 +1976,7 @@ outStream.WriteUint32L( mb->GetId().Id() ); TFSMailMsgId folderId; TFSMailMsgId msgId; - if ( View(MailViewerId)->IsForeground() && iHtmlViewerView ) + if ( View(HtmlViewerId)->IsForeground() && iHtmlViewerView ) { folderId = iHtmlViewerView->ViewedMessageFolderId(); msgId = iHtmlViewerView->ViewedMessageId(); @@ -2103,6 +2100,7 @@ TAny* aParam1, TAny* aParam2, TAny* aParam3 ) { FUNC_LOG; + INFO_1( "CMAIL Received event: %d", aEvent ); if (iExitGuardian) { @@ -2192,12 +2190,15 @@ TIMESTAMP( "Sync error" ); if ( iManualMailBoxSync ) { - // since error id is not provided by plugin, lets popup general note - HBufC* text = StringLoader::LoadL( R_FS_MSERVER_TEXT_UNABLE_TO_COMPLETE ); - CleanupStack::PushL( text ); - CAknInformationNote* infoNote = new ( ELeave ) CAknInformationNote; - infoNote->ExecuteLD( *text ); - CleanupStack::PopAndDestroy( text ); + /* + * As a fix to TJOS-82ZFCW, this general popup is no longer needed + * // since error id is not provided by plugin, lets popup general note + * HBufC* text = StringLoader::LoadL( R_FS_MSERVER_TEXT_UNABLE_TO_COMPLETE ); + * CleanupStack::PushL( text ); + * CAknInformationNote* infoNote = new ( ELeave ) CAknInformationNote; + * infoNote->ExecuteLD( *text ); + * CleanupStack::PopAndDestroy( text ); + */ ManualMailBoxSync( EFalse ); } } @@ -2290,21 +2291,17 @@ // // MAIL DELETED EVENT HANDLING BASED ON VIEW ACTIVE STATE. - // Handle mail deleted event in mail viewer, as viewed mail could be open - if ( iViewerVisualiser && aEvent == TFSEventMailDeleted && - iCurrentActiveView->Id() == MailViewerId ) - { - iViewerVisualiser->HandleMailBoxEventL( aEvent, aMailbox, aParam1, aParam2, aParam3 ); - } // Handle mail deleted event in attachment list, as the viewed mail could be open - else if ( iAttachmentListVisualiser && aEvent == TFSEventMailDeleted && + if ( iAttachmentListVisualiser && aEvent == TFSEventMailDeleted && iCurrentActiveView->Id() == AttachmentMngrViewId) { iAttachmentListVisualiser->HandleMailBoxEventL( aEvent, aMailbox, aParam1, aParam2, aParam3 ); } // Handle mail deleted event in Html view list, as the mails might become obsolete + // Pass sync finished event there too in order to dismiss status dialogs else if ( iHtmlViewerView && (aEvent == TFSEventMailDeleted || - aEvent == TFSEventMailDeletedFromViewer || + aEvent == TFSEventMailDeletedFromViewer || + aEvent == TFSEventMailboxSyncStateChanged || aEvent == TFSEventNewMail) && iCurrentActiveView->Id() == HtmlViewerId) { iHtmlViewerView->HandleMailBoxEventL( aEvent, aMailbox, aParam1, aParam2, aParam3 ); @@ -3191,12 +3188,13 @@ case RMobilePhone::ENotRegisteredSearching: case RMobilePhone::ERegisteredBusy: case RMobilePhone::ERegistrationDenied: - case RMobilePhone::ERegisteredRoaming: + //case RMobilePhone::ERegisteredRoaming: // No autoconnect in these cases break; // This is ok case RMobilePhone::ERegisteredOnHomeNetwork: - // TRAP autoconnect, because list UI must open regardless success + case RMobilePhone::ERegisteredRoaming: + // TRAP autoconnect, because list UI must open regardless success // or failure of the auto-connect TRAP_IGNORE( iAppUi.DoAutoConnectL() ); break; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -79,6 +79,7 @@ #include "FreestyleEmailUiLiterals.h" #include "FreestyleEmailUiContactHandlerObserver.h" #include "FreestyleEmailUiCLSItem.h" +#include "FreestyleEmailUiAppui.h" //Constants const TInt KInternetCallPreferred = 1; @@ -1713,7 +1714,31 @@ Pbk2RemoteContactLookupFactory::NewContextL( params ); CleanupStack::PushL( context ); + if ( !iEnv ) + { + iEnv = CEikonEnv::Static(); + } + + CFreestyleEmailUiAppUi* fsAppUi = + static_cast( iEnv->AppUi() ); + + TBool indicatorsWereOn = EFalse; + CCustomStatuspaneIndicators* indicators = fsAppUi->GetStatusPaneIndicatorContainer(); + + if ( indicators->IsVisible() ) + { + indicatorsWereOn = ETrue; + // hide message indicators + indicators->HideStatusPaneIndicators(); + } + context->ExecuteL( aQueryString, aResult ); + if ( indicatorsWereOn ) + { + // show message indicators + indicators->ShowStatusPaneIndicators(); + } + CleanupStack::PopAndDestroy( context ); } diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -291,7 +291,7 @@ iListLayout = CAlfDeckLayout::AddNewL( *iControl, iParentLayout ); iListLayout->SetFlags(EAlfVisualFlagLayoutUpdateNotification|EAlfVisualFlagAutomaticLocaleMirroringEnabled); - iTreeVisualizer = CFsTreeVisualizerBase::NewL(iControl, *iListLayout); + iTreeVisualizer = CFsTreeVisualizerBase::NewL(iControl, *iListLayout, !iFullScreen); iTreeVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() ); iTreeVisualizer->SetScrollTime( iAppUi.LayoutHandler()->ListScrollingTime() ); iTreeVisualizer->SetFadeInEffectTime( iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); @@ -486,7 +486,7 @@ bgOpacity.SetTarget( 0, 0 ); iParentLayout->SetOpacity( bgOpacity ); iTreeList->HideListL(); - iTreeList->DisableKineticScrolling( EFalse ); + //iTreeList->DisableKineticScrolling( EFalse ); ClearPopupSoftkeys(); iPopupListShown = EFalse; } @@ -631,7 +631,7 @@ iParentLayout->SetOpacity( opacity ); iParentLayout->SetRect( iScreenRect, iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() ); iParentLayout->UpdateChildrenLayout(); - iTreeList->DisableKineticScrolling( ETrue ); + //iTreeList->DisableKineticScrolling( ETrue ); iTreeList->ShowListL( ETrue ); iTreeList->SetFocusedL( ETrue ); iFocusVisible = iAppUi.IsFocusShown(); @@ -1564,9 +1564,10 @@ void CFSEmailUiFolderListVisualiser::SetHeaderTextAttributesL() { iHeaderTextVisual->SetOpacity( KFSVisible ); - CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( - EFSFontTypeNormalBold ); - iHeaderTextVisual->SetTextStyle ( textStyle->Id() ); + CAlfTextStyle& textStyle = + iAppUi.LayoutHandler()->FSTextStyleFromLayoutL( + AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1(0)); + iHeaderTextVisual->SetTextStyle ( textStyle.Id() ); iHeaderTextVisual->SetColor( iAppUi.LayoutHandler()-> ListNormalStateTextSkinColor() ); iHeaderTextVisual->SetPadding( @@ -1925,23 +1926,23 @@ // TBool CFSEmailUiFolderListVisualiser::GetStandardFolderResouceIdAndIconL( const TInt aFolderType, TInt &aResourceId, CAlfTexture* &aIcon ) const { - FUNC_LOG; + FUNC_LOG; TBool found(EFalse); if( aFolderType == EFSInbox ) { if( iFullScreen ) { aResourceId = R_FREESTYLE_EMAIL_UI_FOLDER_LIST_INBOX; - aIcon = iIconArray[EFolderListIconInbox]; } else { aResourceId = R_FREESTYLE_EMAIL_UI_DROPDOWN_LIST_INBOX; // Get branded mailbox icon - aIcon = &iAppUi.FsTextureManager()->TextureByMailboxIdL( iActiveMailbox->GetId().PluginId(), - iActiveMailbox->GetId().Id(), - iListIconSize); + //aIcon = &iAppUi.FsTextureManager()->TextureByMailboxIdL( iActiveMailbox->GetId().PluginId(), + // iActiveMailbox->GetId().Id(), + // iListIconSize); } + aIcon = iIconArray[EFolderListIconInbox]; found = ETrue; } else if( aFolderType == EFSOutbox ) @@ -1949,25 +1950,25 @@ if( iFullScreen ) { aResourceId = R_FREESTYLE_EMAIL_UI_FOLDER_LIST_OUTBOX; - aIcon = iIconArray[EFolderListIconOutbox]; } else { aResourceId = R_FREESTYLE_EMAIL_UI_DROPDOWN_LIST_OUTBOX; } + aIcon = iIconArray[EFolderListIconOutbox]; found = ETrue; - } + } else if( aFolderType == EFSDraftsFolder ) { if( iFullScreen ) { aResourceId = R_FREESTYLE_EMAIL_UI_FOLDER_LIST_DRAFTS; - aIcon = iIconArray[EFolderListIconDrafts]; } else { aResourceId = R_FREESTYLE_EMAIL_UI_DROPDOWN_LIST_DRAFTS; } + aIcon = iIconArray[EFolderListIconDrafts]; found = ETrue; } else if( aFolderType == EFSSentFolder ) @@ -1975,12 +1976,12 @@ if( iFullScreen ) { aResourceId = R_FREESTYLE_EMAIL_UI_FOLDER_LIST_SENT; - aIcon = iIconArray[EFolderListIconSent]; } else { aResourceId = R_FREESTYLE_EMAIL_UI_DROPDOWN_LIST_SENT; - } + } + aIcon = iIconArray[EFolderListIconSent]; found = ETrue; } else if( aFolderType == EFSDeleted ) @@ -1988,12 +1989,12 @@ if( iFullScreen ) { aResourceId = R_FREESTYLE_EMAIL_UI_FOLDER_LIST_DELETED; - aIcon = iIconArray[EFolderListIconDeleted]; } else { aResourceId = R_FREESTYLE_EMAIL_UI_DROPDOWN_LIST_DELETED; } + aIcon = iIconArray[EFolderListIconDeleted]; found = ETrue; } return found; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -73,15 +73,15 @@ _LIT( KHTMLDataScheme, "data:0"); -_LIT8( KHtmlLineBreak, "
" ); -_LIT8( KHtmlLineBreakCRLF, "
\xD\xA" ); -_LIT8( KHtmlLessThan, "<" ); -_LIT8( KHtmlGreaterThan, ">" ); -_LIT8( KHtmlAmpersand, "&" ); -_LIT8( KHtmlQuotation, """ ); -_LIT8( KHtmlLinkTag, "" ); -_LIT8( KHtmlLinkTagWWW, "" ); -_LIT8( KHtmlLinkEndTag, "" ); +_LIT( KHtmlLineBreak, "
" ); +_LIT( KHtmlLineBreakCRLF, "
\xD\xA" ); +_LIT( KHtmlLessThan, "<" ); +_LIT( KHtmlGreaterThan, ">" ); +_LIT( KHtmlAmpersand, "&" ); +_LIT( KHtmlQuotation, """ ); +_LIT( KHtmlLinkTag, "" ); +_LIT( KHtmlLinkTagWWW, "" ); +_LIT( KHtmlLinkEndTag, "" ); _LIT( KURLTypeBody, "body"); _LIT( KURLDisplayImages, "cmail://displayImages/" ); @@ -89,15 +89,17 @@ _LIT( KURLCollapseHeader, "cmail://collapseHeader/" ); _LIT( KURLExpandHeader, "cmail://expandHeader/" ); -const TText8 KGreaterThan = 0x3e; -const TText8 KLessThan = 0x3c; -const TText8 KAmpersand = 0x26; -const TText8 KQuotation = 0x22; -const TText8 KCharacterSpace = 0x20; -const TText8 KSOH = 0x01; // Start Of Heading -const TText8 KCR = 0x0d; // Carriage Return -const TText8 KLF = 0x0a; // Line Feed -const TText8 KHT = 0x09; // Horizontal Tab +const TText KGreaterThan = 0x3e; +const TText KLessThan = 0x3c; +const TText KAmpersand = 0x26; +const TText KQuotation = 0x22; +const TText KCharacterSpace = 0x20; +const TText KSOH = 0x01; // Start Of Heading +const TText KCR = 0x0d; // Carriage Return +const TText KLF = 0x0a; // Line Feed +const TText KHT = 0x09; // Horizontal Tab +const TText KUnicodeNewLineCharacter = 0x2028; +const TText KUnicodeParagraphCharacter = 0x2029; const TReal KOverlayButtonMarginX = 0.01; // 1% const TReal KOverlayButtonMarginY = 0.01; // 1% const TReal KOverlayButtonSizeP = 0.15; // 15% @@ -1018,15 +1020,10 @@ aTextBodyPart.GetContentToBufferL( contentPtr, 0 ); - HBufC8* content8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *content ); + ConvertToHTML( *content, targetFileName, aTextBodyPart ); CleanupStack::PopAndDestroy( content ); - CleanupStack::PushL( content8 ); - - ConvertToHTML( *content8, targetFileName, aTextBodyPart ); - CleanupStack::PopAndDestroy( content8 ); - } // --------------------------------------------------------------------------- @@ -1242,31 +1239,35 @@ else { TPartData partData; - partData.iMailBoxId = iMessage->GetMailBoxId(); - partData.iFolderId = iMessage->GetFolderId(); - partData.iMessageId = iMessage->GetMessageId(); - partData.iMessagePartId = aAttachment.GetPartId(); - - if ( iAppUi.DownloadInfoMediator() && - iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) + if( iMessage ) { - ASSERT( iLinkContents.Count() == iMessageParts.Count() ); + partData.iMailBoxId = iMessage->GetMailBoxId(); + partData.iFolderId = iMessage->GetFolderId(); + partData.iMessageId = iMessage->GetMessageId(); + + partData.iMessagePartId = aAttachment.GetPartId(); - // Append message part details and embedded link content interface - // to corresponding arrays so that the content can be returned - // when the download is completed. - iLinkContents.AppendL( &aEmbeddedLinkContent ); - if ( iMessageParts.Append( partData ) != KErrNone ) + if ( iAppUi.DownloadInfoMediator() && + iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) { - iLinkContents.Remove( iLinkContents.Count() - 1 ); - } - - ASSERT( iLinkContents.Count() == iMessageParts.Count() ); - if(!iView.GetAsyncFetchStatus()) - { - iAppUi.DownloadInfoMediator()->AddObserver( this, aAttachment.GetMessageId() ); - iObservingDownload=ETrue; - iAppUi.DownloadInfoMediator()->DownloadL( partData, EFalse ); + ASSERT( iLinkContents.Count() == iMessageParts.Count() ); + + // Append message part details and embedded link content interface + // to corresponding arrays so that the content can be returned + // when the download is completed. + iLinkContents.AppendL( &aEmbeddedLinkContent ); + if ( iMessageParts.Append( partData ) != KErrNone ) + { + iLinkContents.Remove( iLinkContents.Count() - 1 ); + } + + ASSERT( iLinkContents.Count() == iMessageParts.Count() ); + if(!iView.GetAsyncFetchStatus()) + { + iAppUi.DownloadInfoMediator()->AddObserver( this, aAttachment.GetMessageId() ); + iObservingDownload=ETrue; + iAppUi.DownloadInfoMediator()->DownloadL( partData, EFalse ); + } } } } @@ -1352,11 +1353,11 @@ // --------------------------------------------------------------------------- // // -void CFsEmailUiHtmlViewerContainer::ConvertToHTML( const TDesC8& aContent, +void CFsEmailUiHtmlViewerContainer::ConvertToHTML( const TDesC& aContent, const TDesC& aFileName, CFSMailMessagePart& /*aTextBodyPart*/ ) { FUNC_LOG; - const TInt KBodyTextChunkSizeBytes = 1024; + const TInt KBodyTextChunkSize = 2048; if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFs, aContent.Size(), EDriveC ) ) { @@ -1365,69 +1366,77 @@ } else { - CBufBase* bodyBuf = CBufSeg::NewL( KBodyTextChunkSizeBytes ); - CleanupStack::PushL( bodyBuf ); - - bodyBuf->InsertL( 0, aContent ); + RBuf bodyBuf; + bodyBuf.CreateL( aContent.Size() + KBodyTextChunkSize ); + bodyBuf.CleanupClosePushL(); + bodyBuf.Insert( 0, aContent); + TInt maxlength = bodyBuf.MaxSize(); TInt position( 0 ); - TText8 previous = 0; + TText previous = 0; TBool EndOfString( EFalse ); while ( !EndOfString ) { TInt startPosition = position; - TPtr8 segment( bodyBuf->Ptr( startPosition ) ); - int i = 0; + TPtr segment( bodyBuf.MidTPtr( startPosition ) ); + TInt i = 0; while(i < segment.Length()) { TInt currentPos = position + i; - TText8 ch = segment[i]; + TText ch = segment[i]; switch( ch ) { case KSOH: // end of line for IMAP and POP - bodyBuf->Delete( currentPos, 1 ); - bodyBuf->InsertL( currentPos, KHtmlLineBreakCRLF ); + bodyBuf.Delete( currentPos, 1 ); + maxlength = maxlength + KHtmlLineBreakCRLF().Length(); + bodyBuf.ReAlloc( maxlength ); + bodyBuf.Insert( currentPos, KHtmlLineBreakCRLF ); i += KHtmlLineBreakCRLF().Length(); - segment.Set( bodyBuf->Ptr( startPosition ) ); + segment.Set( bodyBuf.MidTPtr( startPosition ) ); break; case KLF: // line feed - if ( previous == KCR ) - { - bodyBuf->InsertL( currentPos, KHtmlLineBreak ); - i += KHtmlLineBreak().Length(); - segment.Set( bodyBuf->Ptr( startPosition ) ); - } - else - { - i++; - } + case KUnicodeNewLineCharacter: + case KUnicodeParagraphCharacter: + maxlength = maxlength + KHtmlLineBreak().Length(); + bodyBuf.ReAlloc( maxlength ); + bodyBuf.Insert( currentPos, KHtmlLineBreak ); + i += KHtmlLineBreak().Length() + 1; + segment.Set( bodyBuf.MidTPtr( startPosition ) ); break; case KQuotation: - bodyBuf->Delete( currentPos, 1 ); - bodyBuf->InsertL( currentPos, KHtmlQuotation ); + bodyBuf.Delete( currentPos, 1 ); + maxlength = maxlength + KHtmlQuotation().Length(); + bodyBuf.ReAlloc( maxlength ); + bodyBuf.Insert( currentPos, KHtmlQuotation ); i += KHtmlQuotation().Length(); - segment.Set( bodyBuf->Ptr( startPosition ) ); + segment.Set( bodyBuf.MidTPtr( startPosition ) ); break; case KAmpersand: - bodyBuf->Delete( currentPos, 1 ); - bodyBuf->InsertL( currentPos, KHtmlAmpersand ); + bodyBuf.Delete( currentPos, 1 ); + maxlength = maxlength + KHtmlAmpersand().Length(); + bodyBuf.ReAlloc( maxlength ); + bodyBuf.Insert( currentPos, KHtmlAmpersand ); i += KHtmlAmpersand().Length(); - segment.Set( bodyBuf->Ptr( startPosition ) ); + segment.Set( bodyBuf.MidTPtr( startPosition ) ); break; case KGreaterThan: - bodyBuf->Delete( currentPos, 1 ); - bodyBuf->InsertL( currentPos, KHtmlGreaterThan ); + bodyBuf.Delete( currentPos, 1 ); + maxlength = maxlength + KHtmlGreaterThan().Length(); + bodyBuf.ReAlloc( maxlength ); + bodyBuf.Insert( currentPos, KHtmlGreaterThan ); i += KHtmlGreaterThan().Length(); - segment.Set( bodyBuf->Ptr( startPosition ) ); + segment.Set( bodyBuf.MidTPtr( startPosition ) ); break; case KLessThan: - bodyBuf->Delete( currentPos, 1 ); - bodyBuf->InsertL( currentPos, KHtmlLessThan ); + bodyBuf.Delete( currentPos, 1 ); + maxlength = maxlength + KHtmlLessThan().Length(); + bodyBuf.ReAlloc( maxlength ); + bodyBuf.Insert( currentPos, KHtmlLessThan ); i += KHtmlLessThan().Length(); - segment.Set( bodyBuf->Ptr( startPosition ) ); + segment.Set( bodyBuf.MidTPtr( startPosition ) ); break; default: i++; @@ -1436,20 +1445,23 @@ previous = ch; } position += segment.Length(); - if ( ( bodyBuf->Size() - position ) <= 0 ) + if ( ( bodyBuf.Length() - position ) <= 0 ) { EndOfString = ETrue; } } - CreateHyperlinksFromUrlsL( *bodyBuf ); + CreateHyperlinksFromUrlsL( bodyBuf ); + + HBufC8* content8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( bodyBuf ); + CleanupStack::PushL( content8 ); RFile targetFile; CleanupClosePushL( targetFile ); User::LeaveIfError( targetFile.Replace( iFs, aFileName, EFileWrite ) ); RBuf8 messageHeader; - _LIT8( KCharsetUtf8, "UTF-8" ); + _LIT( KCharsetUtf8, "UTF-8" ); TInt bufSize = KHtmlHeader1().Length() + KCharsetUtf8().Length() + KHtmlHeader2().Length(); messageHeader.CreateL( bufSize ); messageHeader.CleanupClosePushL(); @@ -1463,12 +1475,12 @@ fileStream.WriteL( messageHeader.Ptr(), messageHeader.Length() ); TInt bufPos( 0 ); - TInt bufTotalSize = bodyBuf->Size(); + TInt bufTotalSize = content8->Size(); while ( bufPos < bufTotalSize ) { - TInt segmentLength = bodyBuf->Ptr( bufPos ).Length(); - fileStream.WriteL( bodyBuf->Ptr( bufPos ).Ptr(), segmentLength ); + TInt segmentLength = content8->Mid( bufPos ).Length(); + fileStream.WriteL( content8->Mid( bufPos ).Ptr(), segmentLength ); bufPos += segmentLength; } @@ -1477,7 +1489,8 @@ CleanupStack::PopAndDestroy( &fileStream ); CleanupStack::PopAndDestroy( &messageHeader ); CleanupStack::PopAndDestroy( &targetFile ); - CleanupStack::PopAndDestroy( bodyBuf ); + CleanupStack::PopAndDestroy( content8 ); + CleanupStack::PopAndDestroy( &bodyBuf ); // calls bodyBuf.Close(); // } @@ -1488,34 +1501,34 @@ // --------------------------------------------------------------------------- // // -void CFsEmailUiHtmlViewerContainer::CreateHyperlinksFromUrlsL( CBufBase& aSource ) +void CFsEmailUiHtmlViewerContainer::CreateHyperlinksFromUrlsL( RBuf& aSource ) { FUNC_LOG; const TInt urlMaxLength = 2048; - _LIT8( KHttp, "http://" ); - _LIT8( KHttps, "https://"); - _LIT8( KWww, "www."); + _LIT( KHttp, "http://" ); + _LIT( KHttps, "https://"); + _LIT( KWww, "www."); TBool eos( aSource.Size() <= 0 ); TInt position( 0 ); TInt carryOverInc( 0 ); - + TInt maxlength = aSource.Length(); while ( !eos ) { - while ( carryOverInc >= aSource.Ptr( position ).Length() && aSource.Size() != 0 ) + while ( carryOverInc >= aSource.MidTPtr( position ).Length() && aSource.Size() != 0 ) { // Skip segments of overlapping url string - carryOverInc -= aSource.Ptr( position ).Length(); - position += aSource.Ptr( position ).Length(); + carryOverInc -= aSource.MidTPtr( position ).Length(); + position += aSource.MidTPtr( position ).Length(); } - TPtr8 segment( aSource.Ptr( position ) ); - TLex8 lexSegment( segment ); + TPtr16 segment( aSource.MidTPtr( position ) ); + TLex16 lexSegment( segment ); lexSegment.Inc( carryOverInc ); carryOverInc = 0; while (!lexSegment.Eos()) { - TPtrC8 nextToken( lexSegment.NextToken() ); + TPtrC nextToken( lexSegment.NextToken() ); TInt foundAt( KErrNotFound ); // Find HTTP, HTTPS, or WWW link in CBufSeg segment of size 1024 bytes. @@ -1527,7 +1540,7 @@ { if ( !foundAt ) { // Token starts with http/https/www.x - TPtrC8 url; + TPtrC url; TInt lineBreakPos( KErrNotFound ); if ( ( lineBreakPos = nextToken.FindC( KHtmlLineBreak ) ) != KErrNotFound ) { // Token contains html line break -> remove @@ -1540,7 +1553,7 @@ if ( url.CompareC( KWww ) != KErrNone ) // if token=www., validate format { // www.x - RBuf8 urlBuf; + RBuf urlBuf; TBool wwwLink( EFalse ); if ( url.Left( KWww().Length() ).CompareF( KWww ) == 0 ) { @@ -1577,13 +1590,14 @@ //Test TInt offset = lexSegment.Offset() - nextToken.Length(); - TLexMark8 tokenMark; + TLexMark tokenMark; // Move next character last token back lexSegment.Inc( - nextToken.Length() ); lexSegment.Mark( tokenMark ); aSource.Delete( offset + position, nextToken.Length() ); - aSource.InsertL( offset + position, urlBuf ); - segment.Set( aSource.Ptr( position ) ); + aSource.ReAlloc( maxlength + urlBuf.Length() ); + aSource.Insert( offset + position, urlBuf ); + segment.Set( aSource.MidTPtr( position ) ); lexSegment.Assign( segment ); // Set next character to the position of inserted hyperlink lexSegment.UnGetToMark( tokenMark ); @@ -1610,11 +1624,11 @@ else // Next token is end of string, here we handle the last token of a segment { - _LIT8( KUrlEnd, "<" ); + _LIT( KUrlEnd, "<" ); TInt endOfUrlPos( KErrNotFound ); - TText8 ch = segment[ segment.Length() - 1]; - RBuf8 url; + TText ch = segment[ segment.Length() - 1]; + RBuf url; url.CreateL( urlMaxLength ); url.CleanupClosePushL(); @@ -1630,12 +1644,12 @@ else { // Handle hyperlink spread in multiple segments TInt nextPos = position; - TPtrC8 nextSegment( aSource.Ptr( nextPos ) ); - TLex8 lexNextSegment( nextSegment ); - TPtrC8 nextNextToken( nextToken ); + TPtrC nextSegment( aSource.MidTPtr( nextPos ) ); + TLex lexNextSegment( nextSegment ); + TPtrC nextNextToken( nextToken ); TBool firstPass( ETrue ); - while ( endOfUrlPos == KErrNotFound || nextPos >= aSource.Size() ) + while ( endOfUrlPos == KErrNotFound || nextPos >= aSource.Length() ) { if ( ( url.Length() + nextNextToken.Length() ) > urlMaxLength ) { // URL exceeds limit of 2K, do nothing @@ -1648,7 +1662,7 @@ // with last token where hyperlink does not end within segment's // boundaries, move to next segment nextPos += nextSegment.Length(); - nextSegment.Set( aSource.Ptr( nextPos ) ); + nextSegment.Set( aSource.MidTPtr( nextPos ) ); if( nextSegment.Length() == 0 ) { break; @@ -1676,7 +1690,7 @@ if ( endOfUrlPos != KErrNotFound ) { // Handle hyperlink that is within 2K limit - RBuf8 urlBuf; + RBuf urlBuf; TBool wwwLink( EFalse ); if ( url.Left( KWww().Length() ).CompareF( KWww ) == 0 ) @@ -1710,8 +1724,9 @@ // Remove hyperlink from the original message body aSource.Delete( offset + position, url.Length() ); // Insert html formated hyperlink - aSource.InsertL( offset + position, urlBuf ); - segment.Set( aSource.Ptr( position ) ); + aSource.ReAlloc( maxlength + urlBuf.Length() ); + aSource.Insert( offset + position, urlBuf ); + segment.Set( aSource.MidTPtr( position ) ); // Set carry on value to mark where new token should start in following segment carryOverInc = endOfUrlPos; @@ -1725,7 +1740,7 @@ } } position += segment.Length(); - if ( ( aSource.Size() - position ) <= 0 ) + if ( ( aSource.Length() - position ) <= 0 ) { eos = ETrue; } @@ -1809,8 +1824,9 @@ if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged ) { RefreshCurrentMailHeader(); + SetRect( iView.ContainerRect() ); } - } + } void CFsEmailUiHtmlViewerContainer::RefreshCurrentMailHeader() { @@ -1833,8 +1849,9 @@ } else { - //Load page asynchronously after dismissing menu - iEventHandler->DismissMenuAndReload(); + //Load page asynchronously after dismissing menu + //this is outdated call because it cancels Action menu which is no longer used in 9.2 + // iEventHandler->DismissMenuAndReload(); } } } @@ -2026,7 +2043,10 @@ else if (aUrl.Compare(KURLDisplayImages()) == 0) { DisplayStatusIndicatorL(KStatusIndicatorAutomaticHidingDuration); + if( iMessage ) + { iAppUi.DisplayImagesCache().AddMessageL(*iMessage); + } iBrCtlInterface->HandleCommandL(TBrCtlDefs::ECommandLoadImages + TBrCtlDefs::ECommandIdBase); return ETrue; } @@ -2163,29 +2183,33 @@ void CFsEmailUiHtmlViewerContainer::PrepareBodyHtmlL( const TDesC& aFileName ) { - CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); - if ( htmlBodyPart ) + if( iMessage ) { - CleanupStack::PushL( htmlBodyPart ); - // Copy html body part to email html file - CopyToHtmlFileL( *htmlBodyPart, aFileName ); - CleanupStack::PopAndDestroy( htmlBodyPart ); - } - else - { - CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL(); + CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); - if ( textBodyPart ) + if ( htmlBodyPart ) { - CleanupStack::PushL( textBodyPart ); + CleanupStack::PushL( htmlBodyPart ); // Copy html body part to email html file - ConvertToHtmlFileL( *textBodyPart, aFileName ); - CleanupStack::PopAndDestroy( textBodyPart ); + CopyToHtmlFileL( *htmlBodyPart, aFileName ); + CleanupStack::PopAndDestroy( htmlBodyPart ); } else { - User::Leave( KErrNotFound ); + CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL(); + + if ( textBodyPart ) + { + CleanupStack::PushL( textBodyPart ); + // Copy html body part to email html file + ConvertToHtmlFileL( *textBodyPart, aFileName ); + CleanupStack::PopAndDestroy( textBodyPart ); + } + else + { + User::Leave( KErrNotFound ); + } } } } diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -252,13 +252,6 @@ params.iMailboxId = iAppUi.GetActiveMailboxId(); params.iMsgId = iMessage->GetMessageId(); params.iActivatedExternally = EFalse; - - if ( iContainer ) - { - HideContainer(); - iContainer->ResetContent(); - } - iAppUi.LaunchEditorL( KEditorCmdReply, params ); } } @@ -272,13 +265,6 @@ params.iMailboxId = iAppUi.GetActiveMailboxId(); params.iMsgId = iMessage->GetMessageId(); params.iActivatedExternally = EFalse; - - if ( iContainer ) - { - HideContainer(); - iContainer->ResetContent(); - } - iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); } } @@ -292,13 +278,6 @@ params.iMailboxId = iAppUi.GetActiveMailboxId(); params.iMsgId = iMessage->GetMessageId(); params.iActivatedExternally = EFalse; - - if ( iContainer ) - { - HideContainer(); - iContainer->ResetContent(); - } - iForwardingMessage = ETrue; iAppUi.LaunchEditorL( KEditorCmdForward, params ); } @@ -338,14 +317,18 @@ break; case EFsEmailUiCmdOpenAttachmentList: { - TAttachmentListActivationData params; - params.iMailBoxId = iMessage->GetMailBoxId(); - params.iFolderId = iMessage->GetFolderId(); - params.iMessageId = iMessage->GetMessageId(); - // use package buffer to pass the params - TPckgBuf buf( params ); - TUid emptyCustomMessageId = { 0 }; - iAppUi.EnterFsEmailViewL( AttachmentMngrViewId, emptyCustomMessageId, buf ); + if( iMessage ) + { + TAttachmentListActivationData params; + params.iMailBoxId = iMessage->GetMailBoxId(); + params.iFolderId = iMessage->GetFolderId(); + params.iMessageId = iMessage->GetMessageId(); + + // use package buffer to pass the params + TPckgBuf buf( params ); + TUid emptyCustomMessageId = { 0 }; + iAppUi.EnterFsEmailViewL( AttachmentMngrViewId, emptyCustomMessageId, buf ); + } } break; @@ -529,6 +512,7 @@ if ( !iMessage && iContainer ) { + iContainer->ResetContent(); iAppUi.RemoveFromStack( iContainer ); iContainer->CancelFetch(); iContainer->ClearCacheAndLoadEmptyContent(); @@ -619,7 +603,7 @@ User::Leave( KErrNotFound ); } - if ( aCustomMessageId != KStartViewerReturnToPreviousMsg ) + if ( aCustomMessageId != KStartViewerReturnToPreviousMsg && iMessage ) { delete iMailBox; iMailBox = NULL; iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); @@ -743,6 +727,12 @@ iNextOrPrevMessageSelected = EFalse; iForwardingMessage = EFalse; + //update rect only if it has changed from previous time. + if ( iContainer->Rect() != ContainerRect() ) + { + iContainer->SetRect( ContainerRect() ); + } + TIMESTAMP( "Html viewer opened" ); } @@ -839,7 +829,11 @@ iContainer->ResetContent(ETrue); iAppUi.RemoveFromStack(iContainer); iContainer->CancelFetch(); - iContainer->ClearCacheAndLoadEmptyContent(); + if ( !iAppUi.AppUiExitOngoing() ) + { + // if app ui is exiting, a call to this function causes a KERN-EXEC 3 crash in iBrCtlInterface->ClearCache(); + iContainer->ClearCacheAndLoadEmptyContent(); + } } Toolbar()->SetToolbarObserver( this ); iMessage = NULL; @@ -875,6 +869,7 @@ if( iContainer ) { iContainer->StopObserving(); + iContainer->ResetContent(); } CFSMailMessage* tmp = PopMessage(); if( tmp ) @@ -1038,56 +1033,6 @@ { DynInitZoomMenuL( aMenuPane ); } - else if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_MORE ) - { - if( iActivationData.iEmbeddedMessageMode ) - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); - } - else - { - CFSMailFolder* currentFolder = NULL; - if ( iMessage ) - { - TRAP_IGNORE( currentFolder = - iAppUi.GetMailClient()->GetFolderByUidL( - iMessage->GetMailBoxId(), - iMessage->GetFolderId() ) ); - } - - if ( currentFolder && - currentFolder->GetFolderType() != EFSOutbox ) - { - // Mark as read/unread options - TBool messageIsRead( iMessage->IsFlagSet( EFSMsgFlag_Read ) ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); - - // Move to another folder option - aMenuPane->SetItemDimmed( - EFsEmailUiCmdActionsMoveMessage, - !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ) ); - - // Follow-up flag option - aMenuPane->SetItemDimmed( - EFsEmailUiCmdActionsFlag, - !( iMailBox && TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) ) ); - } - else - { - // In case of outbox, all these are dimmed - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); - } - delete currentFolder; - } - aMenuPane->SetItemDimmed( EFsEmailUiCmdMessageDetails, ETrue ); - } iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, CFSEmailUiShortcutBinding::EContextHtmlViewer ); } @@ -1107,7 +1052,7 @@ ///any init required? UpdateMessagePtrL( aMailboxId, aFolderId, aMessageId ); - if ( aCommandId == EFsEmailUiCmdCalRemoveFromCalendar ) + if ( aCommandId == EFsEmailUiCmdCalRemoveFromCalendar && iMessage ) { iAppUi.MrViewerInstanceL()->RemoveMeetingRequestFromCalendarL( *iMessage, *this ); @@ -1127,8 +1072,11 @@ { respondStatus = EESMRAttendeeStatusDecline; } - iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( - respondStatus, *iMessage, *this ); + if( iMessage ) + { + iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( + respondStatus, *iMessage, *this ); + } } } @@ -1324,12 +1272,29 @@ } } - if (iContainer && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() && - ( aEvent == TFSEventNewMail || - aEvent == TFSEventMailDeleted || - aEvent == TFSEventMailChanged ) ) + if ( iContainer && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() ) { - iContainer->MailListModelUpdatedL(); + if ( aEvent == TFSEventNewMail || + aEvent == TFSEventMailDeleted || + aEvent == TFSEventMailChanged ) + { + iContainer->MailListModelUpdatedL(); + } + + // DSW fix for FAMZ-82YJQ2 + // Dismiss the download status dialog after sync has been finished or cancelled + + if ( aEvent == TFSEventMailboxSyncStateChanged ) + { + TSSMailSyncState* newSyncState = static_cast( aParam1 ); + if ( newSyncState && ( *newSyncState == FinishedSuccessfully || + *newSyncState == SyncCancelled || + *newSyncState == Idle || + *newSyncState == SyncError )) + { + iContainer->HideDownloadStatus(); + } + } } } @@ -2187,7 +2152,7 @@ { FUNC_LOG; TBool retVal = ETrue; - if( aFetchedContentType == EMessagePlainTextBodyPart ) + if( aFetchedContentType == EMessagePlainTextBodyPart && iMessage ) { CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); if( textPart ) @@ -2200,7 +2165,7 @@ } delete textPart; } - else if( aFetchedContentType == EMessageHtmlBodyPart ) + else if( aFetchedContentType == EMessageHtmlBodyPart && iMessage ) { CFSMailMessagePart* htmlPart = iMessage->HtmlBodyPartL(); if( htmlPart ) @@ -2213,7 +2178,7 @@ } delete htmlPart; } - else if( aFetchedContentType == EMessageStructure ) + else if( aFetchedContentType == EMessageStructure && iMessage ) { retVal = MessageStructureKnown( *iMessage ); } @@ -2519,8 +2484,11 @@ iWaitDialog->SetCallback(this); iDialogNotDismissed = ETrue; iWaitDialog->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG); - */ + */ + if( iMessage ) + { StartFetchingMessagePartL( *iMessage, iStartAsyncFetchType ); + } // iFetchingAlready = ETrue; // } @@ -3190,58 +3158,65 @@ */ void CFsEmailUiHtmlViewerView::StartFetchingMessageL() { - CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); - TFetchedType type; - if( htmlBodyPart ) - { - type = EMessageHtmlBodyPart; - } - else - { - type = EMessagePlainTextBodyPart; - } - - if ( !MessagePartFullyFetchedL( type )) - { - iAsyncProcessComplete = EFalse; - iStartAsyncFetchType = type; - //check to make sure we don't kick off fetch twice for the cases where bodypart - //not found(OZ) - if(iMessage && !GetAsyncFetchStatus()) + if( iMessage ) + { + CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); + TFetchedType type; + if( htmlBodyPart ) + { + type = EMessageHtmlBodyPart; + } + else { - StartFetchingMessagePartL( *iMessage, type ); + type = EMessagePlainTextBodyPart; + } + + + if ( !MessagePartFullyFetchedL( type )) + { + iAsyncProcessComplete = EFalse; + iStartAsyncFetchType = type; + //check to make sure we don't kick off fetch twice for the cases where bodypart + //not found(OZ) + if(iMessage && !GetAsyncFetchStatus()) + { + StartFetchingMessagePartL( *iMessage, type ); + } } } } void CFsEmailUiHtmlViewerView::CheckMessageBodyL( CFSMailMessage& /*aMessage*/, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent) { - CFSMailMessagePart* bodyPart = iMessage->HtmlBodyPartL(); - if ( !bodyPart ) + if( iMessage ) { - bodyPart = iMessage->PlainTextBodyPartL(); - } + CFSMailMessagePart* bodyPart = iMessage->HtmlBodyPartL(); + if ( !bodyPart ) + { + bodyPart = iMessage->PlainTextBodyPartL(); + } + + if ( bodyPart ) + { + aMessageBodyStructurePresent = ETrue; + CleanupStack::PushL( bodyPart ); - if ( bodyPart ) - { - aMessageBodyStructurePresent = ETrue; - CleanupStack::PushL( bodyPart ); - - if ( bodyPart->FetchedContentSize() == 0 && bodyPart->ContentSize() != 0 ) - { - aMessageBodyContentPresent = EFalse; + if ( bodyPart->FetchedContentSize() == 0 && bodyPart->ContentSize() != 0 ) + { + aMessageBodyContentPresent = EFalse; + } + else + { + aMessageBodyContentPresent = ETrue; + } + + CleanupStack::PopAndDestroy( bodyPart ); } else { - aMessageBodyContentPresent = ETrue; + aMessageBodyStructurePresent = EFalse; + aMessageBodyContentPresent = EFalse; } - - CleanupStack::PopAndDestroy( bodyPart ); - } - else - { - aMessageBodyStructurePresent = EFalse; - aMessageBodyContentPresent = EFalse; } } diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -171,9 +171,8 @@ TRect gridRect = mainPaneRect; gridRect.iBr.iX -= scrollBarRect.Rect().Width(); - TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; - iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastRow() + 1; - iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastColumn() + 1; + iVisibleRows = iAppUi.LayoutHandler()->GridRowsInThisResolution(); + iVisibleColumns = iAppUi.LayoutHandler()->GridColumnsInThisResolution(); iStartupAnimation = ETrue; iCurrentLevel.iSelected = KDefaultSelection; @@ -214,8 +213,9 @@ iSelectorImageVisual = CAlfImageVisual::AddNewL( *iControl, iSelector ); iSelectorImageVisual->SetScaleMode( CAlfImageVisual::EScaleFit ); + const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 ); + // Use layout data instead of hard-coded values - iSelectorImageVisual->SetSize( iAppUi.LayoutHandler()->SelectorVisualSizeInThisResolution() ); TAknLayoutRect itemRect; itemRect.LayoutRect( gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane( var, 0, 0 ) ); @@ -2058,12 +2058,12 @@ selectorRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::grid_highlight_pane_cp018(var)); CFSEmailUiLayoutHandler* layoutHandler = iAppUi.LayoutHandler(); - iSelectorImageVisual->SetSize( selectorRect.Rect().Size() ); // layoutHandler->SelectorVisualSizeInThisResolution() ); + iSelectorImageVisual->SetSize( selectorRect.Rect().Size() ); - TSize displaySize = mainPaneRect.Size();//iControl->DisplayArea().Size(); + TSize displaySize = mainPaneRect.Size(); - TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; //layoutHandler->GridColumnsInThisResolution(); - TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; //layoutHandler->GridRowsInThisResolution(); + TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; + TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; //
@@ -2159,6 +2159,7 @@ scrollbarRect.SetRect(scrollbarTopLeftX, scrollbarTopLeftY, scrollbarBottomRightX, scrollbarBottomRightY); scrollbarRect.Move(mainPaneRect.iTl); iScrollbar->SetRect(scrollbarRect); + iScrollbar->DrawDeferred(); //
iRefreshNeeded = EFalse; } @@ -2689,27 +2690,35 @@ } void CFSEmailUiLauncherGridVisualiser::HandleAppForegroundEventL( TBool aForeground ) - { - CFsEmailUiViewBase::HandleAppForegroundEventL( aForeground ); - // If the view is not visible try to visualise it after a while - if ( aForeground && ( !iWasActiveControlGroup ) ) - { - // - iStartupCallbackTimer->Cancel(); // just in case - iStartupCallbackTimer->SetPriority( CActive::EPriorityIdle ); - // EPriorityIdle, EPriorityLow, EPriorityStandard - iStartupCallbackTimer->Start( 200 ); - } - } + { + FUNC_LOG; + + // If the view is not visible try to visualise it after a while + if ( aForeground && !iWasActiveControlGroup ) + { + iStartupCallbackTimer->Cancel(); // just in case + iStartupCallbackTimer->SetPriority( CActive::EPriorityIdle ); + iStartupCallbackTimer->Start( 200 ); + } + + CFsEmailUiViewBase::HandleAppForegroundEventL( aForeground ); + } +// ---------------------------------------------------------------------------- +// CFSEmailUiLauncherGridVisualiser::TimerEventL() // Fire timer callback +// ---------------------------------------------------------------------------- void CFSEmailUiLauncherGridVisualiser::TimerEventL( CFSEmailUiGenericTimer* /* aTriggeredTimer */ ) -{ - // if view is still active then - if ( ( NULL != iAppUi.CurrentActiveView() ) && ( iAppUi.CurrentActiveView()->Id() == Id() ) ) - { - iWasActiveControlGroup = ETrue; - HandleAppForegroundEventL( ETrue ); - } -}; + { + FUNC_LOG; + // if view is still active then + if ( iAppUi.CurrentActiveView() && iAppUi.CurrentActiveView()->Id() == Id() ) + { + iWasActiveControlGroup = ETrue; + CFsEmailUiViewBase::HandleAppForegroundEventL( ETrue ); + } + + iStartupCallbackTimer->Cancel(); + } + diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -37,12 +37,20 @@ const TInt KPopupMargin = 8; +// ----------------------------------------------------------------------------- +// GeneralHash +// ----------------------------------------------------------------------------- +// template< typename T > TUint32 GeneralHash( const T& aValue ) { return DefaultHash::Des8( TPckgC< T >( aValue ) ); } +// ----------------------------------------------------------------------------- +// GeneralPtrIdentity +// ----------------------------------------------------------------------------- +// template< typename T > TBool GeneralPtrIdentity( const T& aP1, const T& aP2 ) { @@ -56,14 +64,8 @@ // CFSEmailUiLayoutHandler::CFSEmailUiLayoutHandler( CAlfEnv& aEnv ) : iEnv(aEnv), - iScreenResolution( EQvgaPortrait ), iTextStyleMap( THashFunction32< TAknTextComponentLayout >( GeneralHash ), - TIdentityRelation< TAknTextComponentLayout >( GeneralPtrIdentity< TAknTextComponentLayout > ) ), - // - iNormalTextStyle( KErrNotFound ), - iLargeTextStyle( KErrNotFound ), - iSmallTextStyle( KErrNotFound ) - // + TIdentityRelation< TAknTextComponentLayout >( GeneralPtrIdentity< TAknTextComponentLayout > ) ) { FUNC_LOG; } @@ -102,35 +104,9 @@ { FUNC_LOG; DeleteTextStyles(); - if ( iNormalTextStyle != KErrNotFound ) - { - CAlfStatic::Env().TextStyleManager().DeleteTextStyle( - iNormalTextStyle ); - } - if( iLargeTextStyle != KErrNotFound ) - { - CAlfStatic::Env().TextStyleManager().DeleteTextStyle( - iLargeTextStyle ); - } - if( iSmallTextStyle != KErrNotFound ) - { - CAlfStatic::Env().TextStyleManager().DeleteTextStyle( - iSmallTextStyle ); - } } // ----------------------------------------------------------------------------- -// CFSEmailUiLayoutHandler::ScreenResolution -// Function can be used to fetch currently active screen resolution -// ----------------------------------------------------------------------------- -// -TScreenResolution CFSEmailUiLayoutHandler::ScreenResolution() const - { - FUNC_LOG; - return iScreenResolution; - } - -// ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ScreenOrientation // Function can be used to fetch orientation of the current screen resolution // ----------------------------------------------------------------------------- @@ -142,136 +118,32 @@ } // ----------------------------------------------------------------------------- -// CTeamUiAppLayoutHandler::ScreenResolutionChanged -// Function can be used to update internal resolution value. Typically called -// by UI in startup and when dynamic layout variant switch has occured +// CFSEmailUiLayoutHandler::GridRowsInThisResolution // ----------------------------------------------------------------------------- -// -void CFSEmailUiLayoutHandler::ScreenResolutionChanged() +// +TInt CFSEmailUiLayoutHandler::GridRowsInThisResolution() const { FUNC_LOG; - TRect screenRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); - switch ( screenRect.Width() ) - { - case KLowResPortraitWidth: - iScreenResolution = ELowResPortrait; - break; - case KLowResLandscapeWidth: - iScreenResolution = ELowResLandscape; - break; - case KQvgaPortraitWidth: - iScreenResolution = EQvgaPortrait; - break; - case KQvgaLandscapeWidth: // Also KHvgaPortraitWidth - { - if ( screenRect.Height() == KQvgaLandscapeHeight ) - { - iScreenResolution = EQvgaLandscape; - } - else - { - iScreenResolution = EHvgaPortrait; - } - } - break; - case KDrPortraitWidth: - iScreenResolution = EDrPortrait; - break; - case KDrLandscapeWidth: - iScreenResolution = EDrLandscape; - break; - case KVgaPortraitWidth: // Also KHvgaLandscapeWidth - { - if ( screenRect.Height() == KHvgaLandscapeHeight ) - { - iScreenResolution = EHvgaLandscape; - } - else - { - iScreenResolution = EVgaPortrait; - } - } - break; - case KVgaLandscapeWidth: - iScreenResolution = EVgaLandscape; - break; - case KWideLandscapeWidth: - iScreenResolution = EWideLandscape; - break; - default: - break; - } + const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 ); + return AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastRow() + 1; } -TInt CFSEmailUiLayoutHandler::GridRowsInThisResolution() const - { - FUNC_LOG; - TInt rowCount(0); - switch ( iScreenResolution ) - { - case ELowResPortrait: - case EQvgaPortrait: - case EVgaPortrait: - case EHvgaPortrait: - case EDrPortrait: - - case ELowResLandscape: - case EQvgaLandscape: - case EVgaLandscape: - case EHvgaLandscape: - case EDrLandscape: - rowCount = 3; - break; - - case EWideLandscape: - rowCount = 2; - break; - - default: - rowCount = 3; - break; - } - return rowCount; - } - - +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::GridColumnsInThisResolution +// ----------------------------------------------------------------------------- +// TInt CFSEmailUiLayoutHandler::GridColumnsInThisResolution() const { FUNC_LOG; - TInt columnCount(0); - switch ( iScreenResolution ) - { - case ELowResPortrait: - case EQvgaPortrait: - case EVgaPortrait: - case EHvgaPortrait: - case EDrPortrait: - columnCount = 3; - break; - - case ELowResLandscape: - case EQvgaLandscape: - case EVgaLandscape: - case EHvgaLandscape: - case EDrLandscape: - columnCount = 4; - break; - - case EWideLandscape: - columnCount = 5; - break; - - default: - columnCount = 3; - break; - } - return columnCount; + const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 ); + return AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastColumn() + 1; } - -// Grid normal state text color, same as focused +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::GridIconSize +// ----------------------------------------------------------------------------- +// TRgb CFSEmailUiLayoutHandler::GridNormalStateTextSkinColor() const { FUNC_LOG; @@ -288,7 +160,6 @@ // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::GridIconSize -// // ----------------------------------------------------------------------------- // TSize CFSEmailUiLayoutHandler::GridIconSize() const @@ -512,50 +383,6 @@ } // ----------------------------------------------------------------------------- -// CFSEmailUiLayoutHandler::SelectorVisualSizeInThisResolution -// Selector ring image visual size -// ----------------------------------------------------------------------------- -// -TSize CFSEmailUiLayoutHandler::SelectorVisualSizeInThisResolution() const - { - FUNC_LOG; - TSize selectorVisualSize(0,0); - switch ( iScreenResolution ) - { - case EQvgaPortrait: - selectorVisualSize = KSelectorVisualSizeInQvgaPort; - break; - case EQvgaLandscape: - selectorVisualSize = KSelectorVisualSizeInQvgaLand; - break; - case EVgaPortrait: - selectorVisualSize = KSelectorVisualSizeInVgaPort; - break; - case EVgaLandscape: - selectorVisualSize = KSelectorVisualSizeInVgaLand; - break; - case EHvgaPortrait: - selectorVisualSize = KSelectorVisualSizeInHvgaPort; - break; - case EHvgaLandscape: - selectorVisualSize = KSelectorVisualSizeInHvgaLand; - break; - case EWideLandscape: - selectorVisualSize = KSelectorVisualSizeInWideLand; - break; - case EDrPortrait: - selectorVisualSize = KSelectorVisualSizeInDoubleResPort; - break; - case EDrLandscape: - default: - selectorVisualSize = KSelectorVisualSizeInDoubleResLand; - break; - } - return selectorVisualSize; - } - - -// ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::OneLineListNodeHeight // List node item height // ----------------------------------------------------------------------------- @@ -563,16 +390,13 @@ TInt CFSEmailUiLayoutHandler::OneLineListNodeHeight() const { FUNC_LOG; - // TRect mainPaneRect; TAknLayoutRect listItem; AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ); listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 0 ) ); return listItem.Rect().Height(); - // } - // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::OneLineListItemHeight // List item height @@ -597,7 +421,6 @@ return listItem.Rect().Height(); } -// // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::FolderListOneLineItemHeight // List item height for folder list @@ -611,16 +434,8 @@ { return OneLineListItemHeight(); } -/* else - { - const TRect ddMenuRect( DropDownMenuListRect( ELeft ) ); - TAknLayoutRect ddMenuPane; - bg_sp_fs_ctrlbar_ddmenu_pane - return 0; - }*/ return 0; } -// // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ControlBarHeight @@ -637,221 +452,170 @@ return ctrlBarRect.Rect().Height(); } -// changes to avoid unnecessary creating new text styles objects. -CAlfTextStyle* CFSEmailUiLayoutHandler::FSTextStyleFromIdL( TFSEmailFont aFontId ) - { - FUNC_LOG; - CAlfTextStyle* style = NULL; - - switch ( aFontId ) - { - case EFSFontTypeNormal: - case EFSFontTypeNormalBold: - case EFSFontTypeNormalItalic: - if ( iNormalTextStyle == KErrNotFound ) - { - iNormalTextStyle = CAlfStatic::Env().TextStyleManager(). - CreatePlatformTextStyleL( - EAknLogicalFontPrimaryFont, - EAlfTextStyleNormal ); - } - style = CAlfStatic::Env().TextStyleManager().TextStyle( - iNormalTextStyle ); - break; - case EFSFontTypeLarge: - case EFSFontTypeLargeBold: - case EFSFontTypeLargeItalic: - if ( iLargeTextStyle == KErrNotFound ) - { - iLargeTextStyle = CAlfStatic::Env().TextStyleManager(). - CreatePlatformTextStyleL( - EAknLogicalFontTitleFont, - EAlfTextStyleNormal ); - } - style = CAlfStatic::Env().TextStyleManager().TextStyle( - iLargeTextStyle ); - break; - case EFSFontTypeSmallItalic: - case EFSFontTypeSmallBold: - case EFSFontTypeSmall: - default: - if ( iSmallTextStyle == KErrNotFound ) - { - iSmallTextStyle = CAlfStatic::Env().TextStyleManager(). - CreatePlatformTextStyleL( - EAknLogicalFontSecondaryFont, - EAlfTextStyleNormal ); - } - style = CAlfStatic::Env().TextStyleManager().TextStyle( - iSmallTextStyle ); - break; - } - - switch ( aFontId ) - { - case EFSFontTypeSmallBold: - style->SetBold( EStrokeWeightBold ); - break; - case EFSFontTypeSmallItalic: - style->SetBold( EStrokeWeightNormal ); - style->SetItalic( EPostureItalic ); - break; - case EFSFontTypeNormal: - style->SetBold( EStrokeWeightNormal ); - break; - case EFSFontTypeNormalBold: - style->SetBold( EStrokeWeightBold ); - break; - case EFSFontTypeNormalItalic: - style->SetBold( EStrokeWeightNormal ); - style->SetItalic( EPostureItalic ); - break; - case EFSFontTypeLarge: - style->SetBold( EStrokeWeightNormal ); - break; - case EFSFontTypeLargeBold: - style->SetBold( EStrokeWeightBold ); - break; - case EFSFontTypeLargeItalic: - style->SetBold( EStrokeWeightNormal ); - style->SetItalic( EPostureItalic ); - break; - case EFSFontTypeSmall: - default: - { - style->SetBold( EStrokeWeightNormal ); - } - break; - } - - return style; - } -// - +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ControlBarListPadding +// ----------------------------------------------------------------------------- TPoint CFSEmailUiLayoutHandler::ControlBarListPadding() const { FUNC_LOG; return KControlBarListPadding; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize() const { FUNC_LOG; return KControlBarListBorderRoundingSize; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize() const { FUNC_LOG; return KControlBarbuttonBorderRoundingSize; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListFadeInEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ListFadeInEffectTime() const { FUNC_LOG; return KListFadeInEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListFadeOutEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ListFadeOutEffectTime() const { FUNC_LOG; return KListFadeOutEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime() const { FUNC_LOG; return KStatusIndicatorFadeEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime() const { FUNC_LOG; return KCtrlBarListFadeEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ViewSlideEffectActive +// ----------------------------------------------------------------------------- TBool CFSEmailUiLayoutHandler::ViewSlideEffectActive() const { FUNC_LOG; return KListSlideEffectActive; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ViewFadeEffectActive +// ----------------------------------------------------------------------------- TBool CFSEmailUiLayoutHandler::ViewFadeEffectActive() const { FUNC_LOG; return KListFadeEffectActive; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ViewSlideEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ViewSlideEffectTime() const { FUNC_LOG; return KListSlideEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ViewFadeInEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ViewFadeInEffectTime() const { FUNC_LOG; return KListFadeInEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ViewFadeOutEffectTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ViewFadeOutEffectTime() const { FUNC_LOG; return KListFadeOutEffectTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListScrollingTime +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ListScrollingTime() const { FUNC_LOG; return KListScrollingTime; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListItemExpansionDelay +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ListItemExpansionDelay() const { FUNC_LOG; return KListItemExpansionDelay; } -TInt CFSEmailUiLayoutHandler::ViewHidingDelay() const - { - FUNC_LOG; - return KViewChangeDelay; - } - +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor +// ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor() const { FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - // Skin support if( AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ) != KErrNone ) { textColor = KRgbBlack; } - // return textColor; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor +// ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor() const { FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - // S60 Skin support if ( AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) { textColor = KRgbBlack; } - // return textColor; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListNodeBackgroundColor +// ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::ListNodeBackgroundColor() const { FUNC_LOG; -// skin support MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb nodeBgColor; if ( AknsUtils::GetCachedColor( skin, nodeBgColor, @@ -859,40 +623,40 @@ { nodeBgColor = KRgbDarkGray; } -// return nodeBgColor; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListNodeTextColor +// ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::ListNodeTextColor() const { FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - // S60 Skin support TRgb nodeTextColor; if ( AknsUtils::GetCachedColor( skin, nodeTextColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) { nodeTextColor = KRgbWhite; } - // return nodeTextColor; } +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListHeaderBackgroundColor +// ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::ListHeaderBackgroundColor() const { FUNC_LOG; // The header item bg color is gained by mixing 50/50 node bg color // and list item bg color. - // MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb listItemBgColor; if ( AknsUtils::GetCachedColor( skin, listItemBgColor, KAknsIIDQsnLineColors, EAknsCIFsTextColorsCG3 ) != KErrNone ) - //KAknsIIDQsnLineColors, EAknsCIFsTextColorsCG5 ) != KErrNone ) { listItemBgColor = KRgbWhite; } - // TRgb nodeItemBgColor = ListNodeBackgroundColor(); TRgb headerBgColor; headerBgColor.SetRed( (listItemBgColor.Red()+nodeItemBgColor.Red()) / 2 ); @@ -901,80 +665,25 @@ return headerBgColor; } -TInt CFSEmailUiLayoutHandler::ListTextStyle() const - { - FUNC_LOG; - TInt listTextStyle( EAlfTextStyleSmall ); - TAknUiZoom zoomLevel(EAknUiZoomNormal); - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - listTextStyle = EAlfTextStyleSmall; - } - break; - case EAknUiZoomLarge: - { - listTextStyle = EAlfTextStyleLarge; - } - break; - case EAknUiZoomNormal: - default: - { - listTextStyle = EAlfTextStyleNormal; - } - break; - } - return listTextStyle; - } - +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::DropdownMenuTextColor +// ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::DropdownMenuTextColor() const { FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - - // S60 Skin support if ( AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) { textColor = KRgbBlack; } - // - return textColor; } - -TInt CFSEmailUiLayoutHandler::ViewerFontHeightInTwips() const - { - FUNC_LOG; - TAknUiZoom zoomLevel(EAknUiZoomNormal); - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInTwips(0); - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInTwips = 130; - } - break; - case EAknUiZoomLarge: - { - heightInTwips = 190; - } - break; - case EAknUiZoomNormal: - default: - { - heightInTwips = 160; - } - break; - } - return heightInTwips; - } - +// ----------------------------------------------------------------------------- +// CFSEmailUiLayoutHandler::ListItemFontHeightInTwips +// ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ListItemFontHeightInTwips( const TBool aPopup ) const { FUNC_LOG; @@ -996,7 +705,6 @@ } } - // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId // ----------------------------------------------------------------------------- @@ -1005,6 +713,7 @@ FUNC_LOG; return KViewerLogicalTitleFontId; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId // ----------------------------------------------------------------------------- @@ -1013,44 +722,18 @@ FUNC_LOG; return KViewerLogicalTextFontId; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerTitleFontHeight // ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ViewerTitleFontHeight() const { FUNC_LOG; - // Platform layout changes - /* - TAknUiZoom zoomLevel; - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInPixels = 0; - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInPixels = KViewerTitleFontSizeSmall; - } - break; - case EAknUiZoomLarge: - { - heightInPixels = KViewerTitleFontSizeLarge; - } - break; - case EAknUiZoomNormal: - default: - { - heightInPixels = KViewerTitleFontSizeNormal; - } - break; - } - return heightInPixels; - */ TAknLayoutRect labelRect; labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane() ); TAknLayoutText layoutText; layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() ); return layoutText.Font()->FontMaxHeight(); - // Platform layout changes } // ----------------------------------------------------------------------------- @@ -1059,38 +742,11 @@ TInt CFSEmailUiLayoutHandler::ViewerTextFontHeight() const { FUNC_LOG; - // Platform layout changes - /* - TAknUiZoom zoomLevel; - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInPixels = 0; - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInPixels = KViewerTextFontSizeSmall; - } - break; - case EAknUiZoomLarge: - { - heightInPixels = KViewerTextFontSizeLarge; - } - break; - case EAknUiZoomNormal: - default: - { - heightInPixels = KViewerTextFontSizeNormal; - } - break; - } - return heightInPixels; - */ TAknLayoutRect labelRect; labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) ); TAknLayoutText layoutText; layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_t1( 0 ) ); return layoutText.Font()->FontMaxHeight(); - // Platform layout changes } // ----------------------------------------------------------------------------- @@ -1099,36 +755,9 @@ TInt CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight() const { FUNC_LOG; - // Platform layout changes - /* - TAknUiZoom zoomLevel; - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInPixels = 0; - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInPixels = KViewerTopMostSpaceSmall; - } - break; - case EAknUiZoomLarge: - { - heightInPixels = KViewerTopMostSpaceLarge; - } - break; - case EAknUiZoomNormal: - default: - { - heightInPixels = KViewerTopMostSpaceNormal; - } - break; - } - return heightInPixels; - */ TAknLayoutRect labelRect; labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane( 0 ) ); return labelRect.Rect().Height(); - // Platform layout changes } // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight @@ -1136,36 +765,9 @@ TInt CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight() const { FUNC_LOG; - // Platform layout changes - /* - TAknUiZoom zoomLevel; - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInPixels = 0; - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInPixels = KViewerRecipientSpaceSmall; - } - break; - case EAknUiZoomLarge: - { - heightInPixels = KViewerRecipientSpaceLarge; - } - break; - case EAknUiZoomNormal: - default: - { - heightInPixels = KViewerRecipientSpaceNormal; - } - break; - } - return heightInPixels; - */ TAknLayoutRect labelRect; labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) ); return labelRect.Rect().Height(); - // Platform layout changes } // ----------------------------------------------------------------------------- @@ -1174,34 +776,7 @@ TInt CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight() const { FUNC_LOG; - // Platform layout changes - /* - TAknUiZoom zoomLevel; - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInPixels = 0; - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInPixels = KViewerHeaderInfoSpaceSmall; - } - break; - case EAknUiZoomLarge: - { - heightInPixels = KViewerHeaderInfoSpaceLarge; - } - break; - case EAknUiZoomNormal: - default: - { - heightInPixels = KViewerHeaderInfoSpaceNormal; - } - break; - } - return heightInPixels; - */ return ViewerTopMostSpaceHeight(); - // Platform layout changes } // ----------------------------------------------------------------------------- @@ -1210,35 +785,9 @@ TInt CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight() const { FUNC_LOG; - // Platform layout changes - /* - TAknUiZoom zoomLevel; - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel ); - TInt heightInPixels = 0; - switch ( zoomLevel ) - { - case EAknUiZoomSmall: - { - heightInPixels = KViewerBottomMostSpaceSmall; - } - break; - case EAknUiZoomLarge: - { - heightInPixels = KViewerBottomMostSpaceLarge; - } - break; - case EAknUiZoomNormal: - default: - { - heightInPixels = KViewerBottomMostSpaceNormal; - } - break; - } - return heightInPixels; - */ return ViewerRecipientSpaceHeight(); - // Platform layout changes } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount // ----------------------------------------------------------------------------- @@ -1247,6 +796,7 @@ FUNC_LOG; return KViewerMaxRecipientLineCount; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount // ----------------------------------------------------------------------------- @@ -1255,6 +805,7 @@ FUNC_LOG; return KViewerMaxSubjectLineCount; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerTitleTextColor // ----------------------------------------------------------------------------- @@ -1263,16 +814,14 @@ FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - // S60 Skin support if (AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) { textColor = KBlackFallbackTextColor; } - // - return textColor; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerTextTextColor // ----------------------------------------------------------------------------- @@ -1281,16 +830,14 @@ FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - // S60 Skin support if (AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) { textColor = KBlackFallbackTextColor; } - // - return textColor; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerBodyTextColor // ----------------------------------------------------------------------------- @@ -1300,13 +847,13 @@ MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; if ( AknsUtils::GetCachedColor( skin, textColor, - //KAknsIIDFsTextColors, EAknsCIFsTextColorsCG3 ) != KErrNone ) - KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG13 ) != KErrNone ) // + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG13 ) != KErrNone ) { textColor = KBlackFallbackTextColor; } return textColor; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor // ----------------------------------------------------------------------------- @@ -1315,17 +862,15 @@ FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - // S60 Skin support if ( AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG3 ) != KErrNone ) { textColor = KLightBlueFallbackTextColor; } - // - return textColor; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor // ----------------------------------------------------------------------------- @@ -1334,15 +879,12 @@ FUNC_LOG; MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb textColor; - // S60 Skin support if ( AknsUtils::GetCachedColor( skin, textColor, - KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG3 ) != KErrNone ) + KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG3 ) + != KErrNone ) { textColor = KLightBlueFallbackTextColor; } - // - return textColor; } // ----------------------------------------------------------------------------- @@ -1360,16 +902,13 @@ } return textColor; } + // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject // ----------------------------------------------------------------------------- TInt CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject() const { FUNC_LOG; - // Platform layout changes - /* - return KViewerSpaceBetweenIconAndSubject; - */ const TRect cmailPaneRect( ListCmailPaneRect() ); TAknLayoutRect layoutRect; layoutRect.LayoutRect( cmailPaneRect, AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) ); @@ -1383,8 +922,6 @@ { return Abs( cmailPaneRect.iTl.iX - iconRect.Rect().iTl.iX ); } - - // Platform layout changes } // ----------------------------------------------------------------------------- @@ -1393,15 +930,10 @@ TSize CFSEmailUiLayoutHandler::ViewerIconSize() const { FUNC_LOG; - // Platform layout changes - /* - return KViewerIconSize; - */ TAknLayoutRect layoutRect; layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) ); layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 2 ) ); return layoutRect.Rect().Size(); - // Platform layout changes } // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerIndentationIconSize @@ -1409,12 +941,7 @@ TSize CFSEmailUiLayoutHandler::ViewerIndentationIconSize() const { FUNC_LOG; - // Platform layout changes - /* - return KViewerTransparentIndentationIconSize; - */ return ViewerIconSize(); - // Platform layout changes } // ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ViewerActionMenuIconSize @@ -1422,15 +949,10 @@ TSize CFSEmailUiLayoutHandler::ViewerActionMenuIconSize() const { FUNC_LOG; - // Platform layout changes - /* - return KViewerActionMenuIconSize; - */ TAknLayoutRect layoutRect; layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) ); layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g2( 0 ) ); return layoutRect.Rect().Size(); - // Platform layout changes } // ----------------------------------------------------------------------------- @@ -1495,62 +1017,6 @@ } // ----------------------------------------------------------------------------- -// CFSEmailUiLayoutHandler::ViewerWaterMarkSizeInThisResolution -// ----------------------------------------------------------------------------- -TSize CFSEmailUiLayoutHandler::ViewerWaterMarkSizeInThisResolution() const - { - FUNC_LOG; - TSize sizeWithCurrentResolution; - // For now, set same size with all resolutions - switch ( iScreenResolution ) - { - case ELowResPortrait: - case EQvgaPortrait: - case EVgaPortrait: - case EHvgaPortrait: - case EDrPortrait: - case ELowResLandscape: - case EQvgaLandscape: - case EVgaLandscape: - case EHvgaLandscape: - case EDrLandscape: - case EWideLandscape: - default: - sizeWithCurrentResolution = KViewerDefaultWaterMarkSizeInViewer; - break; - } - return sizeWithCurrentResolution; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiLayoutHandler::ViewerWaterMarkPositionFromBottomRightCornerInThisResolution -// ----------------------------------------------------------------------------- -TPoint CFSEmailUiLayoutHandler::ViewerWaterMarkPlaceFromBottomRightCornerInThisResolution() const - { - FUNC_LOG; - TPoint placeFromBottomRightCorner; - // For now, set place with all resolutions - switch ( iScreenResolution ) - { - case ELowResPortrait: - case EQvgaPortrait: - case EVgaPortrait: - case EHvgaPortrait: - case EDrPortrait: - case ELowResLandscape: - case EQvgaLandscape: - case EVgaLandscape: - case EHvgaLandscape: - case EDrLandscape: - case EWideLandscape: - default: - placeFromBottomRightCorner = KViewerWaterMarkPositionFromBottomRightCorner; - break; - } - return placeFromBottomRightCorner; - } - -// ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::ComposerFieldBorderColor // ----------------------------------------------------------------------------- TRgb CFSEmailUiLayoutHandler::ComposerFieldBorderColor() const @@ -1954,10 +1420,9 @@ // if control bar is required, reserve space on top of the listbox if( aControlsOnTop && landscape ) { - TAknLayoutRect listRect2; - listRect2.LayoutRect( mainPaneRect, + listRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_listscroll_pane_te_cp01( 0 )); - rect.Intersection(listRect2.Rect()); + rect = listRect.Rect(); } return rect; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -76,7 +76,6 @@ #include "FreestyleEmailUi.hrh" #include "FreestyleEmailUiTextureManager.h" #include "FreestyleEmailUiMailListControl.h" -#include "FreestyleEmailUiMailViewerVisualiser.h" #include "FreestyleEmailUiStatusIndicator.h" #include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiFolderListVisualiser.h" @@ -420,6 +419,10 @@ iTouchFeedBack = MTouchFeedback::Instance(); } +// --------------------------------------------------------------------------- +// Second phase constructor. +// --------------------------------------------------------------------------- +// // CFSEmailUiMailListVisualiser::DoFirstStartL() // Purpose of this function is to do first start things only when list is // really needed to be shown. Implemented to make app startuo faster. @@ -438,16 +441,12 @@ iScreenAnchorLayout = CAlfAnchorLayout::AddNewL( *iMailListControl ); iScreenAnchorLayout->SetFlags(EAlfVisualFlagAutomaticLocaleMirroringEnabled); - // iTouchManager = CEUiEmailListTouchManager::NewL(*this); - // // Create control bar control and append to control group and anchor layout iControlBarControl = CFsControlBar::NewL( iEnv ); iControlBarControl->AddObserverL( *this ); - // iControlBarControl->AddObserverL( *iTouchManager ); - // CreateControlBarLayoutL(); SetMailListLayoutAnchors(); @@ -469,12 +468,9 @@ iMailList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable ); iMailList->SetIndentationL(0); - // Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in - // opposite order. ControlGroup().AppendL( iMailListControl ); ControlGroup().AppendL( iControlBarControl ); ControlGroup().AppendL( iMailList->TreeControl() ); - // iTreeItemArray.Reset(); @@ -503,13 +499,8 @@ // Set menu, mark and background icons iMailTreeListVisualizer->SetMarkIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkIcon ) ); iMailTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); - // s60 skin support - //iMailTreeListVisualizer->SetBackgroundTextureL( iAppUi.FsTextureManager()->TextureByIndex( EBackgroundTextureMailList ) ); - // iMailList->AddObserverL( *this ); - // iMailList->AddObserverL( *iTouchManager ); - // // Initializing the default stylus long tap popup menu if( !iStylusPopUpMenu ) { @@ -549,7 +540,10 @@ iListMarkItemsState( ETrue ), //Initlly list has no markings iMoveToFolderOngoing( EFalse ), iConsumeStdKeyYes_KeyUp( EFalse ), // use to prevent Call application execution if call for contact processed - iMailOpened(EFalse) + iMailOpened( EFalse ), + iMarkingMode( EFalse ), + iMarkingModeWaitingToExit( EFalse ), + iMarkingModeTextVisual( NULL ) { FUNC_LOG; } @@ -1585,7 +1579,6 @@ iAppUi.StartMonitoringL(); } SetListAndCtrlBarFocusL(); // ShowListL() makes list focused and this may need to be reverted - UnmarkAllItemsL(); if ( aCustomMessageId == TUid::Uid(KMailSettingsReturnFromPluginSettings) ) { // Better to refresh launcher grid view because mailbox branding might be changed. @@ -1721,6 +1714,57 @@ currentFolderType = iMailFolder->GetFolderType(); } + if ( aResourceId == R_FSEMAILUI_MAILLIST_MARKING_MODE_MENUPANE ) + { + if (!CountMarkedItemsL()) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeDelete, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnread, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeRead, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeMove, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeFollowUp, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeMarkAll, EFalse ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnmarkAll, ETrue ); + } + else + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeDelete, EFalse ); + if ( AreAllMarkedItemsUnreadL() ) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnread, ETrue ); + } + else + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnread, EFalse ); + } + if ( AreAllMarkedItemsReadL() ) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeRead, ETrue ); + } + else + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeRead, EFalse ); + } + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeMove, !supportsMoving ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeFollowUp, !supportsFlag ); + if ( AreAllItemsMarked() ) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeMarkAll, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnmarkAll, EFalse ); + } + else if ( AreAllItemsUnmarked() ) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeMarkAll, EFalse ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnmarkAll, ETrue ); + } + else + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeMarkAll, EFalse ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingModeUnmarkAll, EFalse ); + } + } + } + // MAIN MENU *************************************************************************** if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE ) { @@ -1782,18 +1826,6 @@ aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, ETrue ); aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, ETrue ); aMenuPane->SetItemDimmed( EFsEmailUiCmdMailActions, ETrue); - - TInt markedCount = CountMarkedItemsL(); - // Hide mark/unmark all when not applicable - if ( markedCount == EmailsInModelL() ) // Hide mark all - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdSubMenuMark, ETrue ); - } - if ( markedCount == 0 ) // Hide unmark all - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdSubMenuUnmark, ETrue ); - } - } else { @@ -1825,17 +1857,14 @@ { aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, ETrue ); } - - aMenuPane->SetItemDimmed( EFsEmailUiCmdSubMenuUnmark, ETrue); } // EMPTY LIST, MOST OPTIONS ARE HIDDEN if ( !iModel->Count() || !iMailFolder ) { aMenuPane->SetItemDimmed( EFsEmailUiCmdMailActions, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdSubMenuMark, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdSubMenuUnmark, ETrue ); aMenuPane->SetItemDimmed( EFsEmailUiCmdSearch, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkingMode, ETrue ); } // FOLDER SPECIFIC COMMAND HIDING @@ -1904,35 +1933,6 @@ } // ACTIONS SUBMENU ********************************************************************* - - // MARK SUBMENU ************************************************************************ - // Mark submenu show only when focus is visible - if ( aResourceId == R_FSEMAILUI_MAILLIST_SUBMENU_MARK) - { - // Checks if a device has a keyboard or not. - if( !iLastFocus ) - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkMark, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkMarkAll, ETrue ); - } - else - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkSubAll, ETrue ); - } - } - - // MARK SUBMENU ************************************************************************ - - - // UNMARK SUBMENU ************************************************************************ - // Unmark submenu show only when focus is not visible - if ( aResourceId == R_FSEMAILUI_MAILLIST_SUBMENU_UNMARK) - { - // Nothing to do yet - } - // UNMARK SUBMENU ************************************************************************ - - CleanupStack::PopAndDestroy( &targetEntries ); // Add shortcut hints @@ -1998,6 +1998,130 @@ // // --------------------------------------------------------------------------- // +TBool CFSEmailUiMailListVisualiser::AreAllItemsMarked() + { + FUNC_LOG; + + TBool ret(ETrue); + + if ( iTreeItemArray.Count() ) + { + for ( TInt i=0;iIsNode(iTreeItemArray[i].iListItemId ) && + !iMailList->IsMarked( iTreeItemArray[i].iListItemId )) + { + ret = EFalse; + break; + } + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +TBool CFSEmailUiMailListVisualiser::AreAllItemsUnmarked() + { + FUNC_LOG; + + TBool ret(ETrue); + + if ( iTreeItemArray.Count() ) + { + for ( TInt i=0;iIsNode(iTreeItemArray[i].iListItemId ) && + iMailList->IsMarked( iTreeItemArray[i].iListItemId )) + { + ret = EFalse; + break; + } + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +TBool CFSEmailUiMailListVisualiser::AreAllMarkedItemsReadL() + { + FUNC_LOG; + + TBool ret(ETrue); + + if ( iTreeItemArray.Count() ) + { + for ( TInt i=0;iIsNode(iTreeItemArray[i].iListItemId ) && + iMailList->IsMarked( iTreeItemArray[i].iListItemId )) + { + CFSEmailUiMailListModelItem* item = + static_cast( Model()->Item(i) ); + CFSMailMessage* confirmedMsgPtr(0); + confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL(iAppUi.GetActiveMailboxId(), + iMailFolder->GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope ); + TBool isReadMessage = confirmedMsgPtr->IsFlagSet( EFSMsgFlag_Read ); + delete confirmedMsgPtr; + if ( !isReadMessage ) + { + ret = EFalse; + break; + } + } + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +TBool CFSEmailUiMailListVisualiser::AreAllMarkedItemsUnreadL() + { + FUNC_LOG; + + TBool ret(ETrue); + + if ( iTreeItemArray.Count() ) + { + for ( TInt i=0;iIsNode(iTreeItemArray[i].iListItemId ) && + iMailList->IsMarked( iTreeItemArray[i].iListItemId )) + { + CFSEmailUiMailListModelItem* item = + static_cast( Model()->Item(i) ); + CFSMailMessage* confirmedMsgPtr(0); + confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL(iAppUi.GetActiveMailboxId(), + iMailFolder->GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope ); + TBool isReadMessage = confirmedMsgPtr->IsFlagSet( EFSMsgFlag_Read ); + delete confirmedMsgPtr; + if ( isReadMessage ) + { + ret = EFalse; + break; + } + } + } + } + return ret; + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// void CFSEmailUiMailListVisualiser::GetMarkedMessagesL( RArray& aMessageIDs ) const { FUNC_LOG; @@ -2047,6 +2171,192 @@ // // --------------------------------------------------------------------------- // +void CFSEmailUiMailListVisualiser::ExitMarkingModeL() + { + FUNC_LOG; + iMarkingMode = EFalse; + UnmarkAllItemsL(); + // Change softkeys back to normal + SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK ); + // Change options menu back to normal + CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); + menu->StopDisplayingMenuBar(); + menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR); + // Change background back to normal + DisplayMarkingModeBgL( EFalse ); + // Display drop down menu buttons + iNewEmailButton->ShowButtonL(); + iFolderListButton->ShowButtonL(); + iSortButton->ShowButtonL(); + iNewEmailButton->SetDimmed( EFalse ); + iFolderListButton->SetDimmed( EFalse ); + iSortButton->SetDimmed( EFalse ); + // Hide marking mode text on the place of drop down menus + RemoveMarkingModeTitleTextL(); + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::EnterMarkingModeL() + { + FUNC_LOG; + iMarkingMode = ETrue; + iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked + HandleCommandL( EFsEmailUiCmdActionsExpandAll ); + // Change softkeys for marking mode + SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_CANCEL ); + // Change options menu for marking mode + CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); + menu->StopDisplayingMenuBar(); + menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR_MARKING_MODE); + // Change background to marking mode + DisplayMarkingModeBgL( ETrue ); + // Hide drop down menu buttons + if( Layout_Meta_Data::IsLandscapeOrientation() ) + { + iNewEmailButton->SetDimmed(); + iFolderListButton->SetDimmed(); + iSortButton->SetDimmed(); + } + else + { + iNewEmailButton->HideButton(); + iFolderListButton->HideButton(); + iSortButton->HideButton(); + } + // Display marking mode text on the place of drop down menus + DisplayMarkingModeTitleTextL(); + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::RefreshMarkingModeL() + { + FUNC_LOG; + if ( iMarkingMode ) + { + // Hide drop down menu buttons + if( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + iNewEmailButton->ShowButtonL(); + iNewEmailButton->HideButton(); + iFolderListButton->ShowButtonL(); + iFolderListButton->HideButton(); + iSortButton->ShowButtonL(); + iSortButton->HideButton(); + } + else + { + iNewEmailButton->ShowButtonL(); + iNewEmailButton->SetDimmed(); + iFolderListButton->ShowButtonL(); + iFolderListButton->SetDimmed(); + iSortButton->ShowButtonL(); + iSortButton->SetDimmed(); + } + + RemoveMarkingModeTitleTextL(); + DisplayMarkingModeTitleTextL(); + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::DisplayMarkingModeTitleTextL() + { + FUNC_LOG; + if (!iMarkingModeTextVisual) + { + const TRect sortButtonRect( iAppUi.LayoutHandler()->GetControlBarSortButtonRect() ); + const TRect newMailButtonRect( iAppUi.LayoutHandler()->GetControlBarNewEmailButtonRect() ); + + iMarkingModeTextRect = TRect( newMailButtonRect.iTl, sortButtonRect.iBr ); + iMarkingModeTextParentLayout = CAlfDeckLayout::AddNewL( *iMailListControl ); + iMarkingModeTextParentLayout->SetFlags( EAlfVisualFlagManualLayout ); + iMarkingModeTextParentLayout->SetRect( iMarkingModeTextRect ); + + iMarkingModeTextContentLayout = CAlfAnchorLayout::AddNewL( *iMailListControl, iMarkingModeTextParentLayout ); + + iMarkingModeTextVisual = CAlfTextVisual::AddNewL( *iMailListControl, iMarkingModeTextContentLayout ); + iMarkingModeTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate ); + if ( AknLayoutUtils::LayoutMirrored() ) + { + iMarkingModeTextVisual->SetAlign( EAlfAlignHRight, EAlfAlignVCenter ); + } + else + { + iMarkingModeTextVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVCenter ); + } + iMarkingModeTextVisual->SetStyle( EAlfTextStyleTitle ); + TRgb color = iAppUi.LayoutHandler()->ListNodeTextColor(); + iMarkingModeTextVisual->SetColor ( color ); + if( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + HBufC* msg = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_MARKINGMODE ); + iMarkingModeTextVisual->SetTextL( *msg ); + CleanupStack::PopAndDestroy( msg ); + } + else + { + iMarkingModeTextVisual->SetTextL( KNullDesC ); + } + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::RemoveMarkingModeTitleTextL() + { + FUNC_LOG; + if (iMarkingModeTextVisual) + { + iMarkingModeTextVisual->SetTextL( KNullDesC ); + iMarkingModeTextVisual->RemoveAndDestroyAllD(); + iMarkingModeTextVisual = NULL; + iMarkingModeTextContentLayout->RemoveAndDestroyAllD(); + iMarkingModeTextContentLayout = NULL; + iMarkingModeTextParentLayout->RemoveAndDestroyAllD(); + iMarkingModeTextParentLayout = NULL; + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::DisplayMarkingModeBgL( TBool aDisplay ) + { + FUNC_LOG; + if (aDisplay) + { + CAlfBrush* brush = iAppUi.FsTextureManager()->NewMailListMarkingModeBgBrushLC(); + iMailTreeListVisualizer->SetBackgroundBrushL( brush ); + CleanupStack::Pop( brush ); + } + else + { + iMailTreeListVisualizer->ClearBackground(); + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// void CFSEmailUiMailListVisualiser::RefreshL( TFSMailMsgId* aFocusToMessage ) { FUNC_LOG; @@ -2206,6 +2516,14 @@ DoRefresh( this ); } + if (iMarkingModeWaitingToExit) + { + if ( iAppUi.CurrentActiveView()->Id() == MailListId ) + { + iMarkingModeWaitingToExit = EFalse; + TRAP_IGNORE( ExitMarkingModeL() ); + } + } } // --------------------------------------------------------------------------- @@ -2720,7 +3038,7 @@ if ( aType == ESkinChanged ) { - UpdateTheme(); + UpdateThemeL(); } else { @@ -2742,6 +3060,10 @@ iAppUi.FolderList().HandleDynamicVariantSwitchL( aType ); } } + if (iMarkingMode) + { + RefreshMarkingModeL(); + } } // --------------------------------------------------------------------------- @@ -2756,7 +3078,7 @@ CFsEmailUiViewBase::HandleDynamicVariantSwitchOnBackgroundL( aType ); if ( aType == ESkinChanged ) { - UpdateTheme(); + UpdateThemeL(); } else if ( aType == EScreenLayoutChanged ) { @@ -3129,7 +3451,7 @@ // // --------------------------------------------------------------------------- // -void CFSEmailUiMailListVisualiser::UpdateTheme(const TBool aSystemUpdate) +void CFSEmailUiMailListVisualiser::UpdateThemeL(const TBool aSystemUpdate) { iSkinChanged = aSystemUpdate; @@ -3144,6 +3466,17 @@ iSortButton->SetNormalTextColor( normalTextColor ); iSortButton->SetFocusedTextColor( focusedTextColor ); + + //TJOS-83DELP fix/workaround + //sometimes theme wasn't properly refreshed on buttons, this helps + iNewEmailButton->HideButton(); + iNewEmailButton->ShowButtonL(); + + iFolderListButton->HideButton(); + iFolderListButton->ShowButtonL(); + + iSortButton->HideButton(); + iSortButton->ShowButtonL(); } // --------------------------------------------------------------------------- @@ -3225,6 +3558,10 @@ iSkinChanged = EFalse; // Toggle handled iDateChanged = EFalse; // Toggle handled } + if (iMarkingMode) + { + RefreshMarkingModeL(); + } } } @@ -3281,7 +3618,7 @@ aCommand == EFsEmailUiCmdMarkAsUnread || aCommand == EFsEmailUiCmdActionsMove || aCommand == EFsEmailUiCmdActionsMoveMessage || - aCommand == EFsEmailUiCmdMarkUnmarkToggle || + aCommand == EFsEmailUiCmdMarkingModeFromPopUp || aCommand == EFsEmailUiCmdActionsCollapseAll || aCommand == EFsEmailUiCmdActionsExpandAll ) ) { @@ -3373,6 +3710,12 @@ NavigateBackL(); } break; + case EAknSoftkeyCancel: + if (iMarkingMode) + { + ExitMarkingModeL(); + } + break; case EEikCmdExit: case EAknSoftkeyExit: case EFsEmailUiCmdExit: @@ -3656,39 +3999,63 @@ // iAppUi.EnterFsEmailViewL( DownloadManagerViewId ); // break; // - case EFsEmailUiCmdMarkMark: - { - iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked - iMailList->MarkItemL( iMailList->FocusedItem(), ETrue ); - } - break; - case EFsEmailUiCmdMarkMarkAll: - { - MarkAllItemsL(); - } - break; - case EFsEmailUiCmdMarkUnmark: - { - iListMarkItemsState = EFalse; // shift-scrolling does unmarking after one item is unmarked - iMailList->MarkItemL( iMailList->FocusedItem(), EFalse ); - } - break; - case EFsEmailUiCmdMarkUnmarkAll: - { - UnmarkAllItemsL(); - } - break; - - case EFsEmailUiCmdMarkSubAll: - { - MarkAllItemsL(); - } - break; - case EFsEmailUiCmdUnmarkSubAll: - { - UnmarkAllItemsL(); - } - break; + case EFsEmailUiCmdMarkingModeFromPopUp: + { + EnterMarkingModeL(); + // Mark current item first + TInt focusedItem = iMailList->FocusedItem(); + if ( focusedItem > 0 && iFocusedControl == EMailListComponent ) + { + CFSEmailUiMailListModelItem* item = dynamic_cast(iModel->Item(HighlightedIndex())); + if ( item && item->ModelItemType() == ETypeMailItem ) + { + iMailList->MarkItemL( iMailList->FocusedItem(), ETrue ); + } + else if ( item && item->ModelItemType() == ETypeSeparator ) + { + TInt index = HighlightedIndex(); + MarkItemsUnderSeparatorL( ETrue, index ); + } + } + } + break; + case EFsEmailUiCmdMarkingMode: + { + EnterMarkingModeL(); + } + break; + case EFsEmailUiCmdMarkingModeDelete: + { + DeleteMessagesL(); + } + break; + case EFsEmailUiCmdMarkingModeUnread: + { + ChangeReadStatusOfMarkedL( EFalse ); + ExitMarkingModeL(); + } + break; + case EFsEmailUiCmdMarkingModeRead: + { + ChangeReadStatusOfMarkedL( ETrue ); + ExitMarkingModeL(); + } + break; + case EFsEmailUiCmdMarkingModeFollowUp: + { + SetMessageFollowupFlagL(); + } + break; + case EFsEmailUiCmdMarkingModeMarkAll: + { + MarkAllItemsL(); + } + break; + case EFsEmailUiCmdMarkingModeUnmarkAll: + { + UnmarkAllItemsL(); + } + break; case EFsEmailUiCmdReadEmail: { iAppUi.StartReadingEmailsL(); @@ -3793,6 +4160,11 @@ } } break; + case EFsEmailUiCmdMarkingModeMove: + { + iMarkingModeWaitingToExit = ETrue; + } + // Flow through case EFsEmailUiCmdActionsMove: case EFsEmailUiCmdActionsMoveMessage: { @@ -3820,33 +4192,6 @@ ShortcutReadUnreadToggleL(); } break; - case EFsEmailUiCmdMarkUnmarkToggle: - { - TInt focusedItem = iMailList->FocusedItem(); - if ( focusedItem > 0 && iFocusedControl == EMailListComponent ) - { - CFSEmailUiMailListModelItem* item = dynamic_cast(iModel->Item(HighlightedIndex())); - if ( item && item->ModelItemType() == ETypeMailItem ) - { - if ( iMailList->IsMarked( focusedItem ) ) - { - HandleCommandL(EFsEmailUiCmdMarkUnmark); - } - else - { - HandleCommandL(EFsEmailUiCmdMarkMark); - } - } - else if ( item && item->ModelItemType() == ETypeSeparator ) - { - // Currently only mark is done since mark should activate - // marking mode for messages. Unmark can be done via message long tap menu. - TInt index = HighlightedIndex(); - MarkItemsUnderSeparatorL( ETrue, index ); - } - } - } - break; case EFsEmailUiCmdGoToSwitchFolder: { iControlBarControl->SetFocusByIdL( iFolderListButtonId ); @@ -4201,6 +4546,10 @@ } } } + if ( iMarkingMode ) + { + ExitMarkingModeL(); + } } CleanupStack::PopAndDestroy( &targetMsgIds ); } @@ -4512,32 +4861,33 @@ TInt modelCount( modelCount = iModel->Count() ); if ( modelCount ) // Safety check { - CFSEmailUiMailListModelItem* item = - dynamic_cast( iModel->Item( HighlightedIndex() ) ); - // MAIL ITEM; OPEN MAIL - if ( item && item->ModelItemType() == ETypeMailItem ) + if (iMarkingMode) + { + //Do not open mail or expand/collapse separator in marking mode + DoHandleListItemOpenL(); + } + else { - CFSMailMessage* messagePtr = &item->MessagePtr(); - if ( messagePtr ) + CFSEmailUiMailListModelItem* item = + dynamic_cast( iModel->Item( HighlightedIndex() ) ); + // MAIL ITEM; OPEN MAIL + if ( item && item->ModelItemType() == ETypeMailItem ) { - TIMESTAMP( "Open email selected from message list" ); - OpenHighlightedMailL(); + CFSMailMessage* messagePtr = &item->MessagePtr(); + if ( messagePtr ) + { + TIMESTAMP( "Open email selected from message list" ); + OpenHighlightedMailL(); + return EKeyWasConsumed; + } + } + // SEPARAOR ITEM; COLLAPSE / EXPAND NODE + else if ( item && item->ModelItemType() == ETypeSeparator ) + { + ExpandOrCollapseL(); return EKeyWasConsumed; } } - // SEPARAOR ITEM; COLLAPSE / EXPAND NODE - else if ( item && item->ModelItemType() == ETypeSeparator ) - { - if ( iMailList->IsExpanded( iMailList->FocusedItem()) ) - { - ExpandOrCollapseL(); - } - else - { - ExpandOrCollapseL(); - } - return EKeyWasConsumed; - } } } else @@ -4727,25 +5077,56 @@ { CFSEmailUiMailListModelItem* item = dynamic_cast( iModel->Item( HighlightedIndex() ) ); - // MAIL ITEM; OPEN MAIL - if ( item && item->ModelItemType() == ETypeMailItem ) - { - CFSMailMessage* messagePtr = &item->MessagePtr(); - if ( messagePtr ) - { - TIMESTAMP( "Open email selected from message list" ); - OpenHighlightedMailL(); - } - - // Give feedback to user (vibration) - iTouchFeedBack->InstantFeedback(ETouchFeedbackBasic); - } - // SEPARATOR ITEM; COLLAPSE / EXPAND NODE - else if ( item && item->ModelItemType() == ETypeSeparator ) - { - ExpandOrCollapseL(); - SetMskL(); - } + if ( iMarkingMode ) + { + // In marking mode. Mark/unmark it instead of opening it. + if ( item && item->ModelItemType() == ETypeMailItem ) + { + if (iMailList->IsMarked( iMailList->FocusedItem() )) + { + iMailList->MarkItemL( iMailList->FocusedItem(), EFalse ); + } + else + { + iMailList->MarkItemL( iMailList->FocusedItem(), ETrue ); + } + } + else if ( item && item->ModelItemType() == ETypeSeparator ) + { + TInt index = HighlightedIndex(); + if ( AreAllItemsMarkedUnderSeparatorL( index ) ) + { + MarkItemsUnderSeparatorL( EFalse, index ); + } + else + { + MarkItemsUnderSeparatorL( ETrue, index ); + } + } + } + else + { + + // MAIL ITEM; OPEN MAIL + if ( item && item->ModelItemType() == ETypeMailItem ) + { + CFSMailMessage* messagePtr = &item->MessagePtr(); + if ( messagePtr ) + { + TIMESTAMP( "Open email selected from message list" ); + OpenHighlightedMailL(); + } + + // Give feedback to user (vibration) + iTouchFeedBack->InstantFeedback(ETouchFeedbackBasic); + } + // SEPARATOR ITEM; COLLAPSE / EXPAND NODE + else if ( item && item->ModelItemType() == ETypeSeparator ) + { + ExpandOrCollapseL(); + SetMskL(); + } + } } } @@ -4805,10 +5186,41 @@ if ( 0 < iModel->Count() ) // Safety check { - RFsTreeItemIdList markedEntries; - iMailList->GetMarkedItemsL( markedEntries ); - if ( markedEntries.Count() >= 0 ) - { + if ( iMarkingMode ) + { + iMailTreeListVisualizer->SetFocusVisibility( EFalse ); + TInt currentFocusState = iMailList->IsFocused(); + iMailList->SetFocusedL( EFalse ); + iMailList->SetFocusedL( currentFocusState ); + CFSEmailUiMailListModelItem* item = + dynamic_cast( iModel->Item( HighlightedIndex() ) ); + // In marking mode. Mark/unmark it instead of open popup. + if ( item && item->ModelItemType() == ETypeMailItem ) + { + if (iMailList->IsMarked( iMailList->FocusedItem() )) + { + iMailList->MarkItemL( iMailList->FocusedItem(), EFalse ); + } + else + { + iMailList->MarkItemL( iMailList->FocusedItem(), ETrue ); + } + } + else if ( item && item->ModelItemType() == ETypeSeparator ) + { + TInt index = HighlightedIndex(); + if ( AreAllItemsMarkedUnderSeparatorL( index ) ) + { + MarkItemsUnderSeparatorL( EFalse, index ); + } + else + { + MarkItemsUnderSeparatorL( ETrue, index ); + } + } + } + else + { LaunchStylusPopupMenuL( aPoint ); } } @@ -5185,7 +5597,7 @@ // Icons and sort button text iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); - iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNewEmailDefaultIcon ) ); + iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); SetSortButtonTextAndIconL(); iNewEmailButton->SetElemAlignL( @@ -5244,11 +5656,13 @@ iFolderListButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() ); iSortButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() ); - UpdateTheme(EFalse); - - iNewEmailButton->ShowButtonL(); - iFolderListButton->ShowButtonL(); - iSortButton->ShowButtonL(); + UpdateThemeL(EFalse); + if (!iMarkingMode) + { + iNewEmailButton->ShowButtonL(); + iFolderListButton->ShowButtonL(); + iSortButton->ShowButtonL(); + } } // --------------------------------------------------------------------------- @@ -5517,7 +5931,7 @@ msgPtr.SaveMessageL(); // Save flag // Switch icon to correct one if mail list is visible - // UpdateMsgIconAndBoldingL( aIndex ); + UpdateMsgIconAndBoldingL( aIndex ); if ( iCurrentSortCriteria.iField == EFSMailSortByUnread ) { @@ -5750,23 +6164,15 @@ if ( aItemData && aItemVis && aMsgPtr ) { CAlfTexture* itemTexture = &TFsEmailUiUtility::GetMsgIcon( aMsgPtr, *iAppUi.FsTextureManager() ); - aItemData->SetIcon( *itemTexture ); - - // Set font according the read status - if ( aMsgPtr->IsFlagSet( EFSMsgFlag_Read ) ) - { - CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall ); - aItemVis->SetTextStyleId ( textStyle->Id() ); - aItemVis->SetTextBold( EFalse ); - } - else - { - CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmallBold ); - aItemVis->SetTextStyleId ( textStyle->Id() ); - aItemVis->SetTextBold( ETrue ); - } - + TInt variety( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 ); + CAlfTextStyle& textStyle = + iAppUi.LayoutHandler()->FSTextStyleFromLayoutL( + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( variety ) ); + const TBool isNotRead( !aMsgPtr->IsFlagSet( EFSMsgFlag_Read ) ); + textStyle.SetBold( isNotRead ); + aItemVis->SetTextBold( isNotRead ); + aItemVis->SetTextStyleId ( textStyle.Id() ); // Set follow up flag icon if ( aMsgPtr->IsFlagSet( EFSMsgFlag_FollowUp ) ) { @@ -5793,7 +6199,9 @@ void CFSEmailUiMailListVisualiser::RemoveMsgItemsFromListIfFoundL( const RArray& aEntryIds ) { FUNC_LOG; - for ( TInt i=0 ; iRemoveL( iTreeItemArray[idx].iListItemId ); // remove from list iTreeItemArray.Remove( idx ); // remove from internal array. iModel->RemoveAndDestroy( idx ); // Remove from model + itemFound = ETrue; } } } - if ( aEntryIds.Count() > 0 ) - { - if ( iMailListUpdater ) - { - if ( iMailListUpdater->IsActive() ) - { - iMailListUpdater->Stop(); - } - iMailListUpdater->StartL(); - } - } + + if ( !itemFound ) + { + return; // no items to be removed + } + if ( iNodesInUse ) { RemoveUnnecessaryNodesL(); @@ -5932,6 +6336,7 @@ { if (ConfirmDeleteL(entries.Count(), entries[0])) { + ExitMarkingModeL(); if (entries.Count() > KMsgDeletionWaitNoteAmount) { TFsEmailUiUtility::ShowWaitNoteL(iDeletingWaitNote, @@ -6376,6 +6781,7 @@ switch ( aResponse ) { case EFSEmailUiCtrlBarResponseCancel: + iMarkingModeWaitingToExit = EFalse; SetMskL(); return; case EFSEmailUiCtrlBarResponseSelect: @@ -6416,6 +6822,7 @@ } return; case EFSEmailUiCtrlBarResponseCancel: + iMarkingModeWaitingToExit = EFalse; SetMskL(); // Touch //Set touchmanager back to active @@ -6840,12 +7247,6 @@ TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ); iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag ); - // Hide mark if applicable - if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) - { - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue ); - } - // Hide collapse / expand all iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); @@ -7367,6 +7768,11 @@ FUNC_LOG; TBool ret = EFalse; + if ( !iMarkingMode ) + { + EnterMarkingModeL(); + } + // if ( iFocusedControl == EMailListComponent && iModel->Count() ) // @@ -7419,6 +7825,44 @@ } } } + +// Check if all items under current separator are marked +TBool CFSEmailUiMailListVisualiser::AreAllItemsMarkedUnderSeparatorL( TInt aSeparatorId ) + { + FUNC_LOG; + + TBool ret(ETrue); + + if ( iTreeItemArray.Count() ) + { + // Find all items under wanted separator. + for ( TInt i = aSeparatorId + 1; i < iTreeItemArray.Count(); i++ ) + { + CFSEmailUiMailListModelItem* item = + static_cast( iModel->Item( i ) ); + + // Mark / unmark mail items. + if ( item && + item->ModelItemType() == ETypeMailItem && + !iMailList->IsNode( iTreeItemArray[i].iListItemId ) ) + { + if ( !iMailList->IsMarked( iTreeItemArray[i].iListItemId )) + { + // Att least one unmarked item found + ret = EFalse; + break; + } + } + else + { + // Stop iteration since another iterator was reached. + break; + } + } + } + return ret; + } + // Navigation functions, used mainly from viewer TBool CFSEmailUiMailListVisualiser::IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId, diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiMailViewerControl.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailViewerControl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implements top control class for email viewer -* -*/ - - - -#include "emailtrace.h" -#include "FreestyleEmailUiMailViewerControl.h" -#include "FreestyleEmailUiMailViewerVisualiser.h" - - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CFreestyleEmailUiMailViewerControl* CFreestyleEmailUiMailViewerControl::NewL(CAlfEnv& aEnv, CFSEmailUiMailViewerVisualiser& aVisualiser) - { - FUNC_LOG; - CFreestyleEmailUiMailViewerControl* self = CFreestyleEmailUiMailViewerControl::NewLC(aEnv, aVisualiser); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CFreestyleEmailUiMailViewerControl* CFreestyleEmailUiMailViewerControl::NewLC(CAlfEnv& aEnv, CFSEmailUiMailViewerVisualiser& aVisualiser) - { - FUNC_LOG; - CFreestyleEmailUiMailViewerControl* self = new (ELeave) CFreestyleEmailUiMailViewerControl(aVisualiser); - CleanupStack::PushL(self); - self->ConstructL(aEnv); - return self; - } - -// --------------------------------------------------------------------------- -//C++ constructor. -// --------------------------------------------------------------------------- -// -CFreestyleEmailUiMailViewerControl::CFreestyleEmailUiMailViewerControl(CFSEmailUiMailViewerVisualiser& aVisualiser) - : CAlfControl(), - iVisualiser(aVisualiser) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -void CFreestyleEmailUiMailViewerControl::ConstructL(CAlfEnv& aEnv) - { - FUNC_LOG; - CAlfControl::ConstructL(aEnv); - } - -// --------------------------------------------------------------------------- -// Virtual destructor. -// --------------------------------------------------------------------------- -// -CFreestyleEmailUiMailViewerControl::~CFreestyleEmailUiMailViewerControl() - { - FUNC_LOG; - } - - - -// --------------------------------------------------------------------------- -// Forwards key events for visualiser to handle -// --------------------------------------------------------------------------- -// -TBool CFreestyleEmailUiMailViewerControl::OfferEventL( const TAlfEvent& aEvent ) - { - FUNC_LOG; - return iVisualiser.OfferEventL( aEvent ); - } - -// --------------------------------------------------------------------------- -// Forwards aCommand to the visualiser to handle -// --------------------------------------------------------------------------- -// -void CFreestyleEmailUiMailViewerControl::HandleCommandL(TInt aCommand) - { - FUNC_LOG; - iVisualiser.HandleCommandL( aCommand ); - } - - diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2267 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: FreestyleEmailUi mail viewer rich text implementation -* Version : %version: e003sa37#49 % -* -*/ - - -// SYSTEM INCLUDES -#include "emailtrace.h" -#include -#include -#include -#include -#include -// -#include "fstextviewer.h" -#include "fsrichtext.h" -#include "cfsmailmessagepart.h" -#include "cfsmailclient.h" -#include "cfsmailcommon.h" -// -#include -// SF -#include -// -// Platform layout changes -#include -#include -// Platform layout changes - -// for fonts -#include -#include - -// separator line -#include -#include -// separator line - -// INTERNAL INCLUDES -#include "FreestyleEmailUiMailViewerRichText.h" -#include "FreestyleEmailUiAppui.h" -#include "FreestyleEmailUiConstants.h" -#include "FreestyleEmailUiLiterals.h" -#include "FreestyleEmailUiFileSystemInfo.h" -#include "FreestyleEmailUi.hrh" -#include "FreestyleEmailUiTextureManager.h" -#include "FreestyleEmailUiUtilities.h" -#include "FreestyleEmailUiLayoutHandler.h" -#include "FreestyleEmailUiMailViewerConstants.h" -#include "ncsconstants.h" // for KSentLineDateAndTimeSeparatorText - - -// CONST VALUES -static const TInt KHotspotHighlightOn = 1; -// Max hotspot count is a maximum number of hotspots allowed to be placed into -// fs_generic text viewer component. -static const TInt KMaxHotspotCount = 300; - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::NewL -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerRichText* CFSEmailUiMailViewerRichText::NewL( - CFreestyleEmailUiAppUi& aAppUi ) - { - FUNC_LOG; - CFSEmailUiMailViewerRichText* self = - CFSEmailUiMailViewerRichText::NewLC( aAppUi ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::NewLC -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerRichText* CFSEmailUiMailViewerRichText::NewLC( - CFreestyleEmailUiAppUi& aAppUi ) - { - FUNC_LOG; - CFSEmailUiMailViewerRichText* self = - new (ELeave) CFSEmailUiMailViewerRichText( aAppUi ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::ConstructL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::ConstructL() - { - FUNC_LOG; - - CEikonEnv* env = CEikonEnv::Static(); - iViewerRichText = CFsRichText::NewL( env->SystemParaFormatLayerL(), - env->SystemCharFormatLayerL() ); - - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CFSEmailUiMailViewerRichText -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerRichText::CFSEmailUiMailViewerRichText( - CFreestyleEmailUiAppUi& aAppUi ) - : iAppUi( aAppUi ) - { - FUNC_LOG; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::~CFSEmailUiMailViewerRichText -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerRichText::~CFSEmailUiMailViewerRichText() - { - FUNC_LOG; - delete iViewerRichText; - - iFontsArray.ResetAndDestroy(); - - iViewerHeadingHotSpotData.Reset(); - iBodyTextHotSpotData.Reset(); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SetHotspotByIndexL -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerRichText::SetHotspotByIndexL( TInt aIndex ) - { - FUNC_LOG; - /*TInt headingHotspotCount = iViewerHeadingHotSpotData.Count(); - TInt bodyHotspotCount = iBodyTextHotSpotData.Count(); - - if ( iTextViewer ) - { - if ( aIndex < headingHotspotCount ) - { - iTextViewer->FocusLineL( iViewerHeadingHotSpotData[aIndex].iHotspotLine , EFalse ); - iTextViewer->SetCurrentHotspotByOrderL( aIndex ); - } - else if ( (aIndex - headingHotspotCount) < bodyHotspotCount ) - { - iTextViewer->FocusLineL( iViewerHeadingHotSpotData[headingHotspotCount - 1].iHotspotLine , ETrue ); - iTextViewer->SetCurrentHotspotByOrderL( headingHotspotCount - 1 ); - } - }*/ - // Remove the if/elseif contents above and replace them with the commented line below, once it becomes available in fs_generic - iTextViewer->SetCurrentHotspotByOrderL( aIndex, ETrue ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentHotspotIndexL -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::CurrentHotspotIndexL() - { - FUNC_LOG; - /*TInt hotspotIndex(0); - - if ( iTextViewer ) - { - TInt start(0); - TInt end(0); - TInt headingHotspotCount = iViewerHeadingHotSpotData.Count(); - TInt bodyHotspotCount = iBodyTextHotSpotData.Count(); - TBool foundHotspot = EFalse; - - iTextViewer->GetCurrentHotspotL( start, end ); - - if ( headingHotspotCount > 0 ) - { - TInt headingHotspotEnd = iViewerHeadingHotSpotData[ headingHotspotCount-1 ].iEnd; - if ( start < headingHotspotEnd ) - { - for ( TInt i = 0; i < headingHotspotCount; ++i) - { - if ( iViewerHeadingHotSpotData[i].iStart == start ) - { - foundHotspot = ETrue; - hotspotIndex = i; - break; - } - } - } - } - - if ( !foundHotspot ) - { - for ( TInt i = 0; i < bodyHotspotCount; ++i) - { - if ( iBodyTextHotSpotData[i].iStartPos + iHeaderLength == start ) - { - hotspotIndex = i + headingHotspotCount; - break; - } - } - } - } - - return hotspotIndex;*/ - - return iTextViewer->GetCurrentHotspotByOrder(); - } -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::EmailStatusIconLine -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::EmailStatusIconLine() - { - FUNC_LOG; - return iEmailStatusIconLine; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::FollowupIconLine -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::FollowupIconLine() - { - FUNC_LOG; - return iFollowupIconLine; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::RefreshRichTextL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::RefreshRichTextL( CFsTextViewer& aTextViewer, - CFSMailMessage& aMessage, - CFSMailBox& aMailBox ) - { - FUNC_LOG; - - Reset(); - - // Save new pointers - iTextViewer = &aTextViewer; - iMessage = &aMessage; - iMailBox = &aMailBox; - - // Reconstruct the whole rich text - // line by line according to information found from current message - AppendFromLineL( *iMessage, iHeaderLineInfo ); - AppendRecipientLinesL( *iMessage, iHeaderLineInfo, EViewerRecipientTypeTo ); - AppendRecipientLinesL( *iMessage, iHeaderLineInfo, EViewerRecipientTypeCc ); - - // show bcc field only if opened from sent folder - TFSMailMsgId currentMessageFolderId = iMessage->GetFolderId(); - CFSMailFolder* currentFolder = NULL; - - TRAP_IGNORE( currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( - iMessage->GetMailBoxId(), currentMessageFolderId ) ); - - CleanupStack::PushL( currentFolder ); - if ( currentFolder && currentFolder->GetFolderType() == EFSSentFolder ) - { - AppendRecipientLinesL( *iMessage, iHeaderLineInfo, EViewerRecipientTypeBcc ); - } - CleanupStack::PopAndDestroy( currentFolder ); - - AppendSentLineL( *iMessage, iHeaderLineInfo ); - - AppendSubjectLinesL( *iMessage, iHeaderLineInfo ); - AppendHtmlTextLineL( *iMessage, iHeaderLineInfo ); - AppendAttachmentLinesL( *iMessage, iHeaderLineInfo ); - - // Append little bit of vertical space before the header area ends. - InsertTransparentSpacingIconL( EBottomMostSpace ); - - // separator line - AppendSeparatorLineL(); - // separator line - - // Add the upmost space also just before the body text. - InsertTransparentSpacingIconL( ETopMostSpace ); - - // Save the total header lenght in characters - iHeaderLength = iViewerRichText->DocumentLength(); - - // Add body text - AppendInitialBodytextLinesL( *iMessage ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::Reset -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::Reset() - { - FUNC_LOG; - - // reset all the data - iTextViewer = NULL; - iMessage = NULL; - iMailBox = NULL; - - iViewerRichText->Reset(); - iViewerHeadingHotSpotData.Reset(); - iBodyTextHotSpotData.Reset(); - iStatusLayout = NULL; - iStatusVisual = NULL; - - iHeaderLength = 0; - iHeaderLineInfo.iHeaderLineCount = 0; - iHeaderLineInfo.iToLineCount = 0; - iHeaderLineInfo.iCcLineCount = 0; - iHeaderLineInfo.iSubjectLineCount = 0; - - iAttachmentHotSpotIndex = KErrNotFound; - iViewHtmlHotSpotIndex = KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::RichText -// ----------------------------------------------------------------------------- -CFsRichText& CFSEmailUiMailViewerRichText::RichText() - { - FUNC_LOG; - return *iViewerRichText; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SentTextLine -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::SentTextLine() const - { - FUNC_LOG; - return iSentTextLine; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SubjectTextLine -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::SubjectTextLine() const - { - FUNC_LOG; - return iSubjectTextLine; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AttachmentTextLine -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::AttachmentTextLine() const - { - FUNC_LOG; - TInt line = KErrNotFound; - if ( iAttachmentHotSpotIndex >= 0 && - iAttachmentHotSpotIndex < iViewerHeadingHotSpotData.Count() ) - { - line = iViewerHeadingHotSpotData[ iAttachmentHotSpotIndex ].iHotspotLine; - } - return line; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::ViewHtmlTextLine -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::ViewHtmlTextLine() const - { - FUNC_LOG; - TInt line = KErrNotFound; - if ( iViewHtmlHotSpotIndex >= 0 && - iViewHtmlHotSpotIndex < iViewerHeadingHotSpotData.Count() ) - { - line = iViewerHeadingHotSpotData[ iViewHtmlHotSpotIndex ].iHotspotLine; - } - return line; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::HeaderLengthInCharacters -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::HeaderLengthInCharacters() const - { - FUNC_LOG; - return iHeaderLength; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::UpdateIconL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::UpdateIconL( TViewerIconType aViewerIconType ) - { - FUNC_LOG; - TInt place = 0; - -// icons changed - - CFbsBitmap* imageImage = NULL; - CFbsBitmap* mask = NULL; - TSize newIconSize = iAppUi.LayoutHandler()->ViewerIconSize(); - TFileName iconFile; - TFsEmailUiUtility::GetFullIconFileNameL( iconFile ); - // Load right icon according to type - // Email status and follow up icons have their fixed places. - // Spacing and indentation icons are always appended to the end of the rich text and - // they are always transparent. - switch ( aViewerIconType ) - { - case EViewerEmailStatus: - { - TFSEmailUiTextures textureId = TFsEmailUiUtility::GetMsgIconTextureId( iMessage ); - iAppUi.FsTextureManager()->ProvideBitmapL( textureId, imageImage, mask ); - place = iEmailStatusIconPlace; - } - break; - case EViewerIconFollowUp: - { - AknsUtils::CreateColorIconL( - AknsUtils::SkinInstance(), - KAknsIIDNone, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG7, - imageImage, - mask, - iconFile, - EMbmFreestyleemailuiQgn_indi_navi_follow_up, - EMbmFreestyleemailuiQgn_indi_navi_follow_up_mask, - KRgbBlack ); - AknIconUtils::DisableCompression( imageImage ); - AknIconUtils::DisableCompression( mask ); - place = iFollowupIconPlace; - } - break; - case EViewerIconFollowUpComplete: - { - AknsUtils::CreateColorIconL( - AknsUtils::SkinInstance(), - KAknsIIDNone, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG7, - imageImage, - mask, - iconFile, - EMbmFreestyleemailuiQgn_indi_navi_follow_up_complete, - EMbmFreestyleemailuiQgn_indi_navi_follow_up_complete_mask, - KRgbBlack ); - AknIconUtils::DisableCompression( imageImage ); - AknIconUtils::DisableCompression( mask ); - place = iFollowupIconPlace; - } - break; - case EViewerIconFollowUpNone: - { - AknIconUtils::CreateIconL( imageImage, mask, iconFile, - EMbmFreestyleemailuiQgn_graf_cmail_blank, - EMbmFreestyleemailuiQgn_graf_cmail_blank_mask ); - AknIconUtils::DisableCompression( imageImage ); - AknIconUtils::DisableCompression( mask ); - place = iFollowupIconPlace; - } - break; - case EViewerAttachment: - { - AknIconUtils::CreateIconL( imageImage, mask, iconFile, - EMbmFreestyleemailuiQgn_indi_cmail_attachment, - EMbmFreestyleemailuiQgn_indi_cmail_attachment_mask ); - AknIconUtils::DisableCompression( imageImage ); - AknIconUtils::DisableCompression( mask ); - place = iAttachmentIconPlace; - // Make the attachment icon a bit smaller than other icons. Shrink only the height: - // when aspect ratio is preserved, the shrinked image will be centered within the standard width icon. - // Platform layout change - //newIconSize.iHeight = newIconSize.iHeight * 3 / 4; - // Platform layout change - } - break; - case EViewerIconIndentation: - { - AknIconUtils::CreateIconL( imageImage, mask, iconFile, - EMbmFreestyleemailuiQgn_graf_cmail_blank, - EMbmFreestyleemailuiQgn_graf_cmail_blank_mask ); - AknIconUtils::DisableCompression( imageImage ); - AknIconUtils::DisableCompression( mask ); - place = iViewerRichText->DocumentLength(); - } - break; - case EViewerIconSpacing: - { - AknIconUtils::CreateIconL( imageImage, mask, iconFile, - EMbmFreestyleemailuiQgn_graf_cmail_blank, - EMbmFreestyleemailuiQgn_graf_cmail_blank_mask ); - AknIconUtils::DisableCompression( imageImage ); - AknIconUtils::DisableCompression( mask ); - place = iViewerRichText->DocumentLength(); - // for spacing icon iCurrentSpacingIconSize need to be calculated beforehand - // and set properly - newIconSize = iCurrentSpacingIconSize; - } - break; - // separator line - case EViewerIconSeparatorLine: - { - TRgb colorToFetch = iAppUi.LayoutHandler()->SeparatorLineColor(); - TSize lineSize = iAppUi.LayoutHandler()->SeparatorGraphicSizeInThisResolution(); - TInt KMyTempHigh = lineSize.iHeight; - // Graphic elments width is too large for these rich text classes - // and thus we have to calculate proper width by ourself. - TInt KMyTempWidth = SeparatorLineWidth(); - - // create a bitmap to be used off-screen - CFbsBitmap* offScreenBitmap = new (ELeave) CFbsBitmap(); - User::LeaveIfError(offScreenBitmap->Create(TSize(KMyTempWidth,KMyTempHigh), - iAppUi.DisplayMode())); - CleanupStack::PushL(offScreenBitmap); - - mask = new (ELeave) CFbsBitmap(); - CleanupStack::PushL(mask); - - // create an off-screen device and context - CGraphicsContext* bitmapContext=NULL; - CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(offScreenBitmap); - CleanupStack::PushL(bitmapDevice); - User::LeaveIfError(bitmapDevice->CreateContext(bitmapContext)); - CleanupStack::PushL(bitmapContext); - - TRect rect(0,0,KMyTempWidth,KMyTempHigh); - bitmapContext->SetBrushColor(colorToFetch); - bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush); - bitmapContext->SetPenColor(colorToFetch); - bitmapContext->DrawRect(rect); - - imageImage = offScreenBitmap; - AknIconUtils::DisableCompression( imageImage ); - place = iViewerRichText->DocumentLength(); - newIconSize = TSize( KMyTempWidth,KMyTempHigh); - // cleanup - CleanupStack::PopAndDestroy(2); - CleanupStack::Pop(2); - } - break; - // separator line - default: - { - User::Leave( KErrNotSupported ); - } - break; - } -// - - AknIconUtils::SetSize( imageImage, newIconSize, EAspectRatioPreserved ); - AknIconUtils::SetSize( mask, newIconSize, EAspectRatioPreserved ); - - // Create picture object, which takes ownership of bitmaps - CleanupStack::PushL( imageImage ); - CleanupStack::PushL( mask ); - CMyPicture* picture = new ( ELeave ) CMyPicture( newIconSize, *imageImage, *mask ); - CleanupStack::Pop( mask ); - CleanupStack::Pop( imageImage ); - - CleanupStack::PushL( picture ); - - // remove old picture if there is one. - if ( place < iViewerRichText->DocumentLength() ) - { - iViewerRichText->DeleteL( place, 1 ); - } - - // Insert header object to the right spot - TPictureHeader header; - header.iPicture = TSwizzle( picture ); - CleanupStack::Pop( picture ); // The following call will always take the ownership of the picture pointed in the header. Not only when succesful. - iViewerRichText->InsertL( place, header ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::FindCurrentHeaderHotSpotL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerRichText::FindCurrentHeaderHotSpotL( SViewerHeadingHotSpotData& aCurrentHotSpot ) const - { - FUNC_LOG; - TBool foundHotSpot = EFalse; - TInt start(0); - TInt end(0); - if ( iTextViewer ) - { - iTextViewer->GetCurrentHotspotL( start, end ); - TInt headingHotSpotCount = iViewerHeadingHotSpotData.Count(); - if ( headingHotSpotCount > 0 ) - { - TInt headingHotspotEnd = iViewerHeadingHotSpotData[ headingHotSpotCount-1 ].iEnd; - if ( start < headingHotspotEnd ) - { - for ( TInt i = 0 ; i < headingHotSpotCount ; i++ ) - { - if ( iViewerHeadingHotSpotData[ i ].iStart == start ) - { - aCurrentHotSpot = iViewerHeadingHotSpotData[ i ]; - foundHotSpot = ETrue; - break; - } - } - } - } - } - return foundHotSpot; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::FindCurrentBodyHotSpotL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerRichText::FindCurrentBodyHotSpotL( CFindItemEngine::SFoundItem& aCurrentHotSpot ) const - { - FUNC_LOG; - TBool foundHotSpot = EFalse; - TInt start(0); - TInt end(0); - if ( iTextViewer ) - { - iTextViewer->GetCurrentHotspotL( start, end ); - for ( TInt a = 0 ; a < iBodyTextHotSpotData.Count() ; a++ ) - { - if ( start == iBodyTextHotSpotData[a].iStartPos + iHeaderLength ) - { - aCurrentHotSpot = iBodyTextHotSpotData[a]; - foundHotSpot = ETrue; - break; - } - } - } - return foundHotSpot; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::FindCurrentHotSpotL -// ----------------------------------------------------------------------------- -THotspotType CFSEmailUiMailViewerRichText::FindCurrentHotSpotL( - SViewerHeadingHotSpotData& aHeaderHotspot, - CFindItemEngine::SFoundItem& aBodyHotspot ) const - { - FUNC_LOG; - THotspotType retVal = ENoHotspot; - if ( FindCurrentHeaderHotSpotL( aHeaderHotspot ) ) - { - retVal = EHeaderHotspot; - } - else if ( FindCurrentBodyHotSpotL( aBodyHotspot ) ) - { - retVal = EBodyHotspot; - } - return retVal; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::GetHotspotTextLC, heading hotspots -// ----------------------------------------------------------------------------- -HBufC* CFSEmailUiMailViewerRichText::GetHotspotTextLC( - const SViewerHeadingHotSpotData& aHotSpot ) const - { - FUNC_LOG; - TInt hotspotTextLength = aHotSpot.iEnd - aHotSpot.iStart; - if ( aHotSpot.iEnd == aHotSpot.iStart ) // check for special case - { - hotspotTextLength = 1; - } - - return GetHotspotTextLC( aHotSpot.iStart, hotspotTextLength ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::GetHotspotTextLC, body text hotspots -// ----------------------------------------------------------------------------- -HBufC* CFSEmailUiMailViewerRichText::GetHotspotTextLC( - const CFindItemEngine::SFoundItem& /*aHotSpot*/ ) const - { - FUNC_LOG; - HBufC* hotspotText = iTextViewer->GetCurrentHotspotTextL(); - CleanupStack::PushL( hotspotText ); - return hotspotText; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::GetEmailAddressLC -// ----------------------------------------------------------------------------- -HBufC* CFSEmailUiMailViewerRichText::GetEmailAddressLC( - const SViewerHeadingHotSpotData& aCurrentHotSpot ) const - { - FUNC_LOG; - HBufC* emailAddress = NULL; - if( aCurrentHotSpot.iType == ETypeFromAddressDisplayName ) - { - CFSMailAddress* mailAddressObject = iMessage->GetSender(); - emailAddress = mailAddressObject->GetEmailAddress().AllocLC(); - } - else if( aCurrentHotSpot.iType == ETypeToAddressDisplayName ) - { - RPointerArray& addressArray = iMessage->GetToRecipients(); - emailAddress = addressArray[aCurrentHotSpot.iDisplayNameArrayIndex]->GetEmailAddress().AllocLC(); - } - else if( aCurrentHotSpot.iType == ETypeCcAddressDisplayName ) - { - RPointerArray& addressArray = iMessage->GetCCRecipients(); - emailAddress = addressArray[aCurrentHotSpot.iDisplayNameArrayIndex]->GetEmailAddress().AllocLC(); - } - else if( aCurrentHotSpot.iType == ETypeBccAddressDisplayName ) - { - RPointerArray& addressArray = iMessage->GetBCCRecipients(); - emailAddress = addressArray[aCurrentHotSpot.iDisplayNameArrayIndex]->GetEmailAddress().AllocLC(); - } - else if( aCurrentHotSpot.iType == ETypeEmailAddress ) - { - emailAddress = GetHotspotTextLC( aCurrentHotSpot ); - } - else - { - User::Leave( KErrNotSupported ); - } - return emailAddress; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::GetHeaderHotspotEmailAddressLC -// ----------------------------------------------------------------------------- -HBufC* CFSEmailUiMailViewerRichText::GetHeaderHotspotEmailAddressLC( - const SViewerHeadingHotSpotData& aCurrentHeaderHotSpotData ) const - { - FUNC_LOG; - return GetEmailAddressLC( aCurrentHeaderHotSpotData ); - } - - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendRecipientIndetationL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendRecipientIndetationL() - { - FUNC_LOG; - // add transparent indentation icon here, to get right indentation in pixels - UpdateIconL( EViewerIconIndentation ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendNewLineL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendNewLineL() - { - FUNC_LOG; - AppendFormattedTextL( KLineFeed, EViewerFontText ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendSpaceL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendSpaceL() - { - FUNC_LOG; - AppendFormattedTextL( KSpace, EViewerFontText ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::ClipHeaderInfoToFitLC -// ----------------------------------------------------------------------------- -// -HBufC* CFSEmailUiMailViewerRichText::ClipHeaderInfoToFitLC( const TDesC& aText, TBool aIsDisplayName ) - { - FUNC_LOG; - // Clip to fit in available amouth of pixels - const CAknLayoutFont* textNameFont = GetCorrectFontL( EViewerFontHotspotNormal ); - // Platform layout change - TInt textWidthInPixels = HeaderIndentedTextAreaWidth( EFalse ); - // Platform layout change - // create new descriptor for the clipped text. - HBufC* textBuffer = aText.AllocLC(); - // Drop out unwanted characters from display name such as <> and "" - if ( aIsDisplayName && textBuffer ) - { - TFsEmailUiUtility::StripDisplayName( *textBuffer ); - textWidthInPixels -= iAppUi.LayoutHandler()->ViewerIconSize().iWidth; - } - TPtr textBufferModDes = textBuffer->Des(); - AknTextUtils::ClipToFit( textBufferModDes, *textNameFont, textWidthInPixels ); - return textBuffer; - } -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::HeaderIndentedTextAreaWidth -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::HeaderIndentedTextAreaWidth( const TBool aAddExtra ) const - { - FUNC_LOG; - // For some reason, the ratioanally calculated text width seems to be a bit - // wider than the width where GenericTextViewer does line wrapping. Reserve - // some extra pixels to overcome this. Maybe there is some difference in - // the ways the text width is calculated? - // Platform layout change - //const TInt KExtraPixels = 10; - TInt extraPixels( 10 ); - if ( aAddExtra ) - { - const CAknLayoutFont* newFont = NULL; - TRAP_IGNORE( newFont = GetCorrectFontL( EViewerFontText ) ); - if ( newFont ) - { - TOpenFontMetrics fontMetrics; - newFont->GetFontMetrics( fontMetrics ); - extraPixels = fontMetrics.MaxWidth(); - } - } - // Platform layout change - - TRect screenRect = iTextViewer->GetControl()->DisplayArea(); - - TInt recipientIndenInpixels = iAppUi.LayoutHandler()->ViewerIndentationIconSize().iWidth; - TInt scrollBarBreadth = CEikScrollBar::DefaultScrollBarBreadth(); - - // Calculate space left for actual text - TInt rightMargin = iAppUi.LayoutHandler()->ViewerRightMarginInPixels() + scrollBarBreadth; - TInt leftMargin = iAppUi.LayoutHandler()->ViewerLeftMarginInPixels(); - TInt textWidthInPixels = screenRect.iBr.iX - recipientIndenInpixels - rightMargin - leftMargin - extraPixels; - - return textWidthInPixels; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendFromLineL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendFromLineL( CFSMailMessage& aMessagePtr, - SMailMsgHeaderInfo& aHeaderInfo ) - { - FUNC_LOG; - - // Add the upmost space before the header information - InsertTransparentSpacingIconL( ETopMostSpace ); - - CFSMailAddress* fromAddress = aMessagePtr.GetSender(); - if ( fromAddress ) - { - // Append "from:" text - HBufC* fromHeadingText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_FROM ); - AppendFormattedTextL( *fromHeadingText, EViewerFontTitle ); - CleanupStack::PopAndDestroy( fromHeadingText ); - - // Append new line - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - - AppendRecipientIndetationL(); - - TDesC* displayName = &fromAddress->GetDisplayName(); - TDesC* emailAddrs = &fromAddress->GetEmailAddress(); - if ( displayName && displayName->Length() != 0 ) - { - HBufC* clippedDisplayName = ClipHeaderInfoToFitLC( *displayName, ETrue ); - - // Append display name and hotspot - InsertHotspotTextAndFontL( *clippedDisplayName ); - - // Add hotspot information to rich text and hotspot data to header hotspots array - TInt hotSpotLength = clippedDisplayName->Length(); - iViewerRichText->SetHotSpotL( iRichTextDocumentLength, hotSpotLength, KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - hsData.iType = ETypeFromAddressDisplayName; - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength + hotSpotLength; - hsData.iDisplayNameArrayIndex = 0; - hsData.iHotspotLine = aHeaderInfo.iHeaderLineCount; - iViewerHeadingHotSpotData.Append( hsData ); - - CleanupStack::PopAndDestroy( clippedDisplayName ); - - // Append new line - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - else if ( emailAddrs && emailAddrs->Length() != 0 ) - { - // clip emailAddress to fit in one line. - HBufC* clippedDisplayName = ClipHeaderInfoToFitLC( *displayName, ETrue ); - - // Append email address and hotspot - InsertHotspotTextAndFontL( *clippedDisplayName ); - TInt hotSpotLength = clippedDisplayName->Length(); - iViewerRichText->SetHotSpotL(iRichTextDocumentLength, hotSpotLength, KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - hsData.iType = ETypeEmailAddress; - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength + hotSpotLength; - hsData.iDisplayNameArrayIndex = 0; - hsData.iHotspotLine = aHeaderInfo.iHeaderLineCount; - iViewerHeadingHotSpotData.Append( hsData ); - - CleanupStack::PopAndDestroy( clippedDisplayName ); - - // Append new line - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - } - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendRecipientsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendRecipientsL( - const RPointerArray& aRecipientArray, SMailMsgHeaderInfo& aHeaderInfo, - TViewerRecipientType aRecipientType ) - { - FUNC_LOG; - - TInt showAddresses(0); - TInt recipientCount = aRecipientArray.Count(); - TInt maxRecipientCount = iAppUi.LayoutHandler()->ViewerMaxRecipientLineCount(); - - if ( recipientCount <= maxRecipientCount ) - { - // All recipients fit to screen - showAddresses = recipientCount; - } - else - { - // Reserve space for additional recipients count - showAddresses = maxRecipientCount - 1; - } - - for ( TInt i = 0; i < showAddresses; i++ ) - { - iRichTextDocumentLength = iViewerRichText->DocumentLength(); - TDesC* displayName = &( aRecipientArray[i]->GetDisplayName() ); - TDesC* emailAddrs = &( aRecipientArray[i]->GetEmailAddress() ); - if ( displayName && displayName->Length() != 0 ) - { - AppendRecipientIndetationL(); - - HBufC* clippedDisplayName = ClipHeaderInfoToFitLC( *displayName, ETrue ); - - // Append display name and set hotspot data - InsertHotspotTextAndFontL( *clippedDisplayName ); - - iViewerRichText->SetHotSpotL( iRichTextDocumentLength, clippedDisplayName->Length(), KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - switch ( aRecipientType ) - { - case EViewerRecipientTypeCc: - hsData.iType = ETypeCcAddressDisplayName; - break; - case EViewerRecipientTypeBcc: - hsData.iType = ETypeBccAddressDisplayName; - break; - case EViewerRecipientTypeTo: - default: - hsData.iType = ETypeToAddressDisplayName; - break; - } - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength + clippedDisplayName->Length(); - hsData.iDisplayNameArrayIndex = i; - hsData.iHotspotLine = aHeaderInfo.iHeaderLineCount; - iViewerHeadingHotSpotData.Append( hsData ); - - CleanupStack::PopAndDestroy( clippedDisplayName ); - - // Append new line - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - else if ( emailAddrs && emailAddrs->Length() != 0 ) - { - AppendRecipientIndetationL(); - - // clip emailAddress to fit in one line. - HBufC* clippedDisplayName = ClipHeaderInfoToFitLC( *displayName, ETrue ); - - // Append email address name and set hotspot data - InsertHotspotTextAndFontL( *clippedDisplayName ); - iViewerRichText->SetHotSpotL( iRichTextDocumentLength, clippedDisplayName->Length(), KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - hsData.iType = ETypeEmailAddress; - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength + clippedDisplayName->Length(); - hsData.iHotspotLine = aHeaderInfo.iHeaderLineCount; - iViewerHeadingHotSpotData.Append( hsData ); - - CleanupStack::PopAndDestroy( clippedDisplayName ); - - // Append new line - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - } - if ( recipientCount > showAddresses ) - { - InsertTransparentSpacingIconL( EHeaderInfoSpace ); - - AppendRecipientIndetationL(); - - HBufC* nMoreRecipientsText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_N_MORE_RECIPIENTS, recipientCount ); - // Append n more recipients address name and set hotspot data - InsertHotspotTextAndFontL( *nMoreRecipientsText ); - iViewerRichText->SetHotSpotL(iRichTextDocumentLength, nMoreRecipientsText->Length(), KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - switch ( aRecipientType ) - { - case EViewerRecipientTypeCc: - hsData.iType = ETypeCcNMoreRecipients; - break; - case EViewerRecipientTypeBcc: - hsData.iType = ETypeBccNMoreRecipients; - break; - case EViewerRecipientTypeTo: - default: - hsData.iType = ETypeToNMoreRecipients; - break; - } - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength+nMoreRecipientsText->Length(); - hsData.iHotspotLine = aHeaderInfo.iHeaderLineCount; - iViewerHeadingHotSpotData.Append( hsData ); - // Append new line - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - CleanupStack::PopAndDestroy( nMoreRecipientsText ); - } - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendRecipientLinesL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendRecipientLinesL( CFSMailMessage& aMessagePtr, - SMailMsgHeaderInfo& aHeaderInfo, TViewerRecipientType aRecipientType ) - { - FUNC_LOG; - - RPointerArray* mailAddressArray = NULL; - HBufC* headingText = NULL; - switch ( aRecipientType ) - { - case EViewerRecipientTypeTo: - { - mailAddressArray = &aMessagePtr.GetToRecipients(); // ownership is not transfered. - headingText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_TO ); - } - break; - case EViewerRecipientTypeCc: - { - mailAddressArray = &aMessagePtr.GetCCRecipients(); // ownership is not transfered. - headingText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CC ); - } - break; - case EViewerRecipientTypeBcc: - { - mailAddressArray = &aMessagePtr.GetBCCRecipients(); // ownership is not transfered. - headingText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_BCC ); - } - break; - default: - { - // nothing here. - } - break; - } - - if ( mailAddressArray && mailAddressArray->Count() ) - { - // Add vertical empty space between last recipient and new heading info text - InsertTransparentSpacingIconL( EHeaderInfoSpace ); - - AppendFormattedTextL( *headingText, EViewerFontTitle ); - - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - - // Append the recipients - AppendRecipientsL( *mailAddressArray, aHeaderInfo, aRecipientType ); - } - - // cleanup if heading text was created - if ( headingText ) - { - CleanupStack::PopAndDestroy( headingText ); - } - - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendSentLineL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendSentLineL( CFSMailMessage& aMessagePtr, - SMailMsgHeaderInfo& aHeaderInfo ) - { - FUNC_LOG; - - InsertTransparentSpacingIconL( EHeaderInfoSpace ); - - // Save "Sent ..." text line number for initial focus setting - iSentTextLine = aHeaderInfo.iHeaderLineCount; - - HBufC* dateText = TFsEmailUiUtility::DateTextFromMsgLC( &aMessagePtr ); - HBufC* timeText = TFsEmailUiUtility::TimeTextFromMsgLC( &aMessagePtr ); - HBufC* sentHeadingText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_SENT ); - HBufC* combinedSentText = sentHeadingText->ReAllocL( sentHeadingText->Length() + KSpace().Length() + - dateText->Length() + - KSentLineDateAndTimeSeparatorText().Length() + - timeText->Length() ); - CleanupStack::Pop( sentHeadingText ); - CleanupStack::PushL( combinedSentText ); - TPtr combinedSentTextPtr = combinedSentText->Des(); - combinedSentTextPtr.Append( KSpace ); - combinedSentTextPtr.Append( *dateText ); - combinedSentTextPtr.Append( KSentLineDateAndTimeSeparatorText ); - combinedSentTextPtr.Append( *timeText ); - - AppendFormattedTextL( *combinedSentText, EViewerFontSent ); - - CleanupStack::PopAndDestroy( combinedSentText ); - CleanupStack::PopAndDestroy( timeText ); - CleanupStack::PopAndDestroy( dateText ); - - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendSubjectLinesL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendSubjectLinesL( CFSMailMessage& aMessagePtr, - SMailMsgHeaderInfo& aHeaderInfo ) - { - FUNC_LOG; - InsertTransparentSpacingIconL( EHeaderInfoSpace ); - - // "Subject:" text - HBufC* subjectHeadingText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_SUBJECT ); - AppendFormattedTextL( *subjectHeadingText, EViewerFontTitle ); - CleanupStack::PopAndDestroy( subjectHeadingText ); - - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - - // Save "subject:" text line number for initial focus setting - iSubjectTextLine = aHeaderInfo.iHeaderLineCount; - - TInt subjectLineCount = 0; - - // Get the subject text to modifyable buffer because truncation may be needed. - // Use "no subject" text if not available. - HBufC* subjectBuf = TFsEmailUiUtility::CreateSubjectTextLC( &aMessagePtr ); - TPtr subjectPtr = subjectBuf->Des(); - - // Wrap and clip to maximum number of lines - TInt subjectWidthInPixels = HeaderIndentedTextAreaWidth(); - TInt maxSubjectLines = iAppUi.LayoutHandler()->ViewerMaxSubjectLineCount(); - CArrayFixFlat* wrappedArray = new (ELeave) CArrayFixFlat( maxSubjectLines ); - CleanupStack::PushL( wrappedArray ); - CArrayFixFlat* lineWidthArray = new (ELeave) CArrayFixFlat( maxSubjectLines ); - CleanupStack::PushL( lineWidthArray ); - for ( TInt i = 0 ; i < maxSubjectLines ; ++i ) - { - lineWidthArray->AppendL( subjectWidthInPixels ); - } - // - const CAknLayoutFont* subjectFont = GetCorrectFontL( EViewerFontText ); - - AknTextUtils::WrapToArrayAndClipL( subjectPtr, *lineWidthArray, *subjectFont, *wrappedArray ); - // - subjectLineCount = wrappedArray->Count(); - - TInt i = 1; // indicating current subject line, starting as 1 = first line, 2 = second line - for( ; i <= subjectLineCount ; i++ ) - { - // Rest of the lines have no preceeding icon, just indentation - AppendRecipientIndetationL(); - - TPtrC temp = (*wrappedArray)[i-1]; - AppendFormattedTextL( temp, EViewerFontText ); - - // add line break - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - aHeaderInfo.iSubjectLineCount++; - } - - CleanupStack::PopAndDestroy( lineWidthArray ); - CleanupStack::PopAndDestroy( wrappedArray ); - CleanupStack::PopAndDestroy( subjectBuf ); - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendMessageIconL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendMessageIconL() - { - FUNC_LOG; - // append embedded icon. - iEmailStatusIconPlace = iViewerRichText->DocumentLength(); - iEmailStatusIconLine = iHeaderLineInfo.iHeaderLineCount; - UpdateIconL( EViewerEmailStatus ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendFollowUpIconL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerRichText::AppendFollowUpIconL( CFSMailMessage& aMessagePtr ) - { - FUNC_LOG; - TBool added = EFalse; - - if ( TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) ) - { - iFollowupIconPlace = iViewerRichText->DocumentLength(); - iFollowupIconLine = iHeaderLineInfo.iHeaderLineCount; - if ( aMessagePtr.IsFlagSet( EFSMsgFlag_FollowUpComplete ) ) - { - UpdateIconL( EViewerIconFollowUpComplete ); - } - else if ( aMessagePtr.IsFlagSet( EFSMsgFlag_FollowUp ) ) - { - UpdateIconL( EViewerIconFollowUp ); - } - else - { - UpdateIconL( EViewerIconFollowUpNone ); - } - added = ETrue; - } - - return added; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendAttachmentIconL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendAttachmentIconL() - { - FUNC_LOG; - // append embedded icon. - iAttachmentIconPlace = iViewerRichText->DocumentLength(); - UpdateIconL( EViewerAttachment ); - - InsertSpaceAfterIconL(); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendAttachmentLinesL -// Append attachement(s) line to the rich text. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendAttachmentLinesL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ) - { - FUNC_LOG; - if ( aMessagePtr.IsFlagSet( EFSMsgFlag_Attachments ) ) - { - // get attachments and count - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - aMessagePtr.AttachmentListL( attachments ); - TInt attachmentsCount = attachments.Count(); - HBufC* attachmentText = NULL; - if ( attachmentsCount == 1 ) - { - TDesC& attachmentName = attachments[0]->AttachmentNameL(); - TUint attachmentSize = attachments[0]->ContentSize(); // bytes - - // create size text including the unit and preceeding space character - HBufC* sizeWithUnit = TFsEmailUiUtility::CreateSizeDescLC( attachmentSize ); - HBufC* sizeText = HBufC::NewL( sizeWithUnit->Length()+1 ); - sizeText->Des().Append( ' ' ); - sizeText->Des().Append( *sizeWithUnit ); - CleanupStack::PopAndDestroy( sizeWithUnit ); - CleanupStack::PushL( sizeText ); - - // clip attachment name to fit in one line so that size information has enough space too. - // - const CAknLayoutFont* attachmentFont = GetCorrectFontL( EViewerFontHotspotNormal ); - - TInt attachmentTextWidthInPixels = HeaderIndentedTextAreaWidth(); - TInt sizeTextInPixels = attachmentFont->TextWidthInPixels( *sizeText ); - TInt pixelsLeftForAttachmentName = attachmentTextWidthInPixels - sizeTextInPixels; - - // safe check if the size information is too wide for some reason. - if ( pixelsLeftForAttachmentName < 0 ) - { - attachmentText = HBufC::NewL( attachmentName.Length() + sizeText->Length() ); - attachmentText->Des().Append( attachmentName ); - attachmentText->Des().Append( *sizeText ); - TPtr attachmentTextBufferModDes = attachmentText->Des(); - AknTextUtils::ClipToFit( attachmentTextBufferModDes, *attachmentFont, attachmentTextWidthInPixels ); - } - else - { // normal case - HBufC* attacmentNameBuffer = attachmentName.AllocLC(); - TPtr attachmentNameBufferModDes = attacmentNameBuffer->Des(); - AknTextUtils::ClipToFit( attachmentNameBufferModDes, *attachmentFont, pixelsLeftForAttachmentName ); - - attachmentText = HBufC::NewL( attacmentNameBuffer->Length() + sizeText->Length() ); - attachmentText->Des().Append( *attacmentNameBuffer ); - attachmentText->Des().Append( *sizeText ); - CleanupStack::PopAndDestroy( attacmentNameBuffer ); - } - CleanupStack::PopAndDestroy( sizeText ); - } - // - else if ( attachmentsCount > 1 ) - { - TInt totalSize = 0; - for( TInt i = 0; i < attachmentsCount ; i++ ) - { - totalSize += attachments[i]->ContentSize(); - } - HBufC* sizeText = TFsEmailUiUtility::CreateSizeDescLC( totalSize ); - attachmentText = StringLoader::LoadL( R_FSE_VIEWER_ATTACHMENTS_TEXT_WITH_SIZE, - *sizeText, attachmentsCount ); - CleanupStack::PopAndDestroy( sizeText ); - } - - // Append attachment line to rich text if there was attachments - if ( attachmentText ) - { - CleanupStack::PushL( attachmentText ); - - InsertTransparentSpacingIconL( EHeaderInfoSpace ); - - AppendAttachmentIconL(); - - InsertHotspotTextAndFontL( *attachmentText ); - iViewerRichText->SetHotSpotL( iRichTextDocumentLength, attachmentText->Length(), KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - if ( attachmentsCount == 1 ) - { - hsData.iType = ETypeAttachment; - } - else - { - hsData.iType = ETypeAttachments; - } - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength + attachmentText->Length(); - hsData.iHotspotLine = aHeaderInfo.iHeaderLineCount; - iAttachmentHotSpotIndex = iViewerHeadingHotSpotData.Count(); - iViewerHeadingHotSpotData.Append( hsData ); - CleanupStack::PopAndDestroy( attachmentText ); - - // Append new lines - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - CleanupStack::PopAndDestroy( &attachments ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendHtmlTextLineL -// Appends "View as HTML" selection hotspot to the rich text if message has HTML text part -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendHtmlTextLineL( CFSMailMessage& aMessagePtr, SMailMsgHeaderInfo& aHeaderInfo ) - { - FUNC_LOG; - - CFSMailMessagePart* htmlBodyPart = aMessagePtr.HtmlBodyPartL(); - if ( htmlBodyPart ) - { - CleanupStack::PushL( htmlBodyPart ); - - // Add just a little bit of vertical space before the next lines - InsertTransparentSpacingIconL( EHeaderInfoSpace ); - - // Indent the "View as HTML" link - AppendRecipientIndetationL(); - - HBufC* htmlLineText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_HTML ); - HBufC* clippedHtmlLine = ClipHeaderInfoToFitLC( *htmlLineText, EFalse ); - - InsertHotspotTextAndFontL( *clippedHtmlLine ); - iViewerRichText->SetHotSpotL( iRichTextDocumentLength, clippedHtmlLine->Length(), KHotspotHighlightOn ); - SViewerHeadingHotSpotData hsData; - hsData.iType = ETypeHtml; - hsData.iStart = iRichTextDocumentLength; - hsData.iEnd = iRichTextDocumentLength + htmlLineText->Length(); - hsData.iHotspotLine = iHeaderLineInfo.iHeaderLineCount; - iViewHtmlHotSpotIndex = iViewerHeadingHotSpotData.Count(); - iViewerHeadingHotSpotData.Append( hsData ); - - CleanupStack::PopAndDestroy( clippedHtmlLine ); - CleanupStack::PopAndDestroy( htmlLineText ); - CleanupStack::PopAndDestroy( htmlBodyPart ); - - // Append one line feed plus little extra vertical space - AppendNewLineL(); - aHeaderInfo.iHeaderLineCount++; - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendInitialBodytextLinesL -// Append body text which is found from the message to the end of the rich text. -// If plain text body part is not found, tries to convert body from html part -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendInitialBodytextLinesL( CFSMailMessage& aMessagePtr ) - { - FUNC_LOG; - CFSMailMessagePart* plainTextBodyPart = aMessagePtr.PlainTextBodyPartL(); - - if ( plainTextBodyPart ) - { - CleanupStack::PushL( plainTextBodyPart ); - - TInt fetchedSize = plainTextBodyPart->FetchedContentSize(); - if ( fetchedSize > 0 ) - { - // Limit displayed plain text body size to KPlainTextLimitationInBytes - // currently set to 150K characters of text that should be more than enough for mobile email - TInt bufSize = Min( fetchedSize, KPlainTextLimitationInChars ); - HBufC* plainTextData16 = HBufC::NewLC( bufSize ); - - TPtr pointer = plainTextData16->Des(); - plainTextBodyPart->GetContentToBufferL( pointer, 0 ); - - // Store body length - iBodyLength = plainTextData16->Length(); - - // append everything we have now - AppendFormattedTextL( *plainTextData16, EViewerFontText ); - - // Append hotspot data for content - iBodyTextHotSpotData.Reset(); - FindBodyTextHotSpotsL( *plainTextData16 ); - CleanupStack::PopAndDestroy( plainTextData16 ); - // Make sure that text viewer is not filled with more than max - // number of hotspot count - TInt hotspotCount = iBodyTextHotSpotData.Count(); - if ( hotspotCount > KMaxHotspotCount ) - { - hotspotCount = KMaxHotspotCount; - } - for ( TInt i=0; i < hotspotCount; i++ ) - { - AddBodyHotsSpotWithTextFormatingL( iBodyTextHotSpotData[i] ); - } - } - CleanupStack::PopAndDestroy( plainTextBodyPart ); - } - else - { - CFSMailMessagePart* htmlBodyPart = aMessagePtr.HtmlBodyPartL(); - if ( htmlBodyPart ) - { - CleanupStack::PushL( htmlBodyPart ); - - TInt fetchedBodySize = htmlBodyPart->FetchedContentSize(); - TInt wholeContentSize = htmlBodyPart->ContentSize(); - if ( fetchedBodySize == wholeContentSize ) - { - HBufC* htmlData = HBufC::NewLC( fetchedBodySize ); - TPtr pointer = htmlData->Des(); - htmlBodyPart->GetContentToBufferL( pointer, 0 ); - HBufC* txtData = TFsEmailUiUtility::ConvertHtmlToTxtL( *htmlData ); - CleanupStack::PopAndDestroy( htmlData ); - CleanupStack::PushL( txtData ); - - // User large fixed maximum amount of characters to append. - // In normal cases all text is included. - TPtrC truncatedText = txtData->Left( KPlainTextLimitationInChars ); - iBodyLength = truncatedText.Length(); - AppendFormattedTextL( truncatedText, EViewerFontText ); - // Append hotspot data for content - iBodyTextHotSpotData.Reset(); - FindBodyTextHotSpotsL( truncatedText ); - CleanupStack::PopAndDestroy( txtData ); - // Make sure that text viewer is not filled with more than max - // number of hotspot count - TInt hotspotCount = iBodyTextHotSpotData.Count(); - if ( hotspotCount > KMaxHotspotCount ) - { - hotspotCount = KMaxHotspotCount; - } - for ( TInt i=0; i < hotspotCount; i++ ) - { - AddBodyHotsSpotWithTextFormatingL( iBodyTextHotSpotData[i] ); - } - } - - CleanupStack::PopAndDestroy( htmlBodyPart ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendFetchedBodytextLinesL -// Append rest of the body text replacing "Fetching more text" -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendFetchedBodytextLinesL( CFSMailMessage& aMessagePtr ) - { - FUNC_LOG; - TInt startBodyPoint = iBodyLength; - CFSMailMessagePart* plainTextBodyPart = aMessagePtr.PlainTextBodyPartL(); - if ( plainTextBodyPart ) - { - CleanupStack::PushL( plainTextBodyPart ); - // Fetching More text is not required any more - SetEmptyStatusLayoutTextL(); - - // Limit the whole data reading to KPlainTextLimitationInChars, usually this is more than - // enough for mobile email client - TInt fetchedSize = plainTextBodyPart->FetchedContentSize(); - TInt bufSize = Min( fetchedSize, KPlainTextLimitationInChars ); - HBufC* plainTextData16 = HBufC::NewLC( bufSize ); - - // Get more fetched content to buffer - TPtr pointer = plainTextData16->Des(); - plainTextBodyPart->GetContentToBufferL( pointer, 0 ); - - // Store body length - iBodyLength = plainTextData16->Length(); - - // Safety check required by POP protocol. Sometimes iBodyLength changes - // when message has been fetched. Following is added to prevent crashes related to that. - if ( startBodyPoint > iBodyLength ) - { - startBodyPoint = iBodyLength; - } - - // Insert rest of the body text after previously added body text - TPtrC restOfThePlainText = plainTextData16->Mid( startBodyPoint ); - InsertFormattedTextL( restOfThePlainText, EViewerFontText, - iHeaderLength + startBodyPoint ); - - // Find hotspots from the added body text - TInt previousBodyHotspotCount = iBodyTextHotSpotData.Count(); - FindBodyTextHotSpotsL( restOfThePlainText ); - // Make sure that text viewer is not filled with more than max - // number of hotspot count - TInt hotspotCount = iBodyTextHotSpotData.Count(); - if ( hotspotCount > KMaxHotspotCount ) - { - hotspotCount = KMaxHotspotCount; - } - for ( TInt i = previousBodyHotspotCount; i < hotspotCount; i++ ) - { - iBodyTextHotSpotData[i].iStartPos += startBodyPoint; - AddBodyHotsSpotWithTextFormatingL( iBodyTextHotSpotData[i] ); - } - - iTextViewer->ReloadTextL(); - CleanupStack::PopAndDestroy( plainTextData16 ); - CleanupStack::PopAndDestroy( plainTextBodyPart ); - } - - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CreateStatusLayoutL -// Creates status layout to display fetching more text. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::CreateStatusLayoutL( TBool aSetEmptyContents /*= ETrue*/ ) - { - FUNC_LOG; - // ensure not created twice - if ( !iStatusVisual && iTextViewer ) - { - iStatusLayout = static_cast( iTextViewer->GetStatusLayout() ); - CAlfControl* textViewerControl = iTextViewer->GetControl(); - iStatusVisual = CAlfTextVisual::AddNewL( *textViewerControl, iStatusLayout ); - iStatusVisual->EnableShadow( EFalse ); - iStatusVisual->SetColor( iAppUi.LayoutHandler()->ViewerBodyTextColor() ); - - TAlfTimedValue statusVisualOpacity; - statusVisualOpacity.SetValueNow ( 1 ); - iStatusVisual->SetOpacity( statusVisualOpacity ); - - // Platform layout change - /*iStatusVisual->SetTextStyle( iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmallBold )->Id() );*/ - iStatusVisual->SetTextStyle( iAppUi.LayoutHandler()->FSTextStyleFromLayoutL( AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() ).Id() ); - // Platform layout change - iStatusVisual->SetAlign( EAlfAlignHCenter, EAlfAlignVTop ); - - if ( aSetEmptyContents ) - { - SetEmptyStatusLayoutTextL(); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendFetchingMoreTextL -// metdod for updating the animated text while rest of the message is been fetched -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendFetchingMoreTextL() - { - FUNC_LOG; - // Create status layout if it doesn't exist yet - CreateStatusLayoutL( EFalse ); - - // add fetching content text with current animation - HBufC* fetchingContentText = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_FETCHING_CONTENT_TEXT ); - - // create buffer for "Fetching more text" and dots animation - HBufC* newDes = HBufC::NewLC( fetchingContentText->Length() + KTotalNumberOfLines + KTotalNumberOfLines); - TPtr des = newDes->Des(); - - // add KTotalNumberOfLines always at the beginning - for( TInt i = 0 ; i < KTotalNumberOfLines / KNumberOfLines ; i++ ) - { - des.Append( KThreeLines ); - } - - // append fething text - des.Append( *fetchingContentText ); - - // add dots according to current ellipsis count - for( TInt i = 0 ; i < iCurrentEllipsisCount ; i++ ) - { - des.Append( KThreeLines ); - } - - // ellipses count counter going through 0,1,2,3,0,1,2,3,0,... sequence - if( iCurrentEllipsisCount >= KTotalNumberOfLines / KNumberOfLines ) - { - iCurrentEllipsisCount = 0; - } - else - { - iCurrentEllipsisCount++; - } - - // just in case, try clipping the text if it doesn't fit in one line for some reason. - TRect screenRect = iTextViewer->GetControl()->DisplayArea(); - // - const CAknLayoutFont* bodyTextFont = GetCorrectFontL( EViewerFontBody ); - TInt rightMargin = iAppUi.LayoutHandler()->ViewerRightMarginInPixels(); - TInt leftMargin = iAppUi.LayoutHandler()->ViewerLeftMarginInPixels(); - TInt pixelsToFit = screenRect.iBr.iX - rightMargin - leftMargin; - AknTextUtils::ClipToFit( des, *bodyTextFont, pixelsToFit ); - // - - // Assign the text to status layout. - iStatusVisual->SetTextL( *newDes ); - iStatusLayout->SetClipping( EFalse ); - TSize statusSize = iStatusVisual->TextExtents(); - iStatusLayout->SetSize( statusSize ); - iStatusVisual->SetRect( TRect( TPoint( 0, 0 ), statusSize ) ); - iTextViewer->UpdateStatusLayout(); - - CleanupStack::PopAndDestroy( newDes ); - CleanupStack::PopAndDestroy( fetchingContentText ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SetEmptyStatusLayoutTextL -// The text in status layout is updated to contain only a couple of line feeds. -// This ensures, that the whole body can be scrolled visible also when the -// attachment downloading popup is shown in the bottom. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::SetEmptyStatusLayoutTextL() - { - FUNC_LOG; - _LIT( KEmptyStatusText, "\n " ); - if ( iStatusVisual && iStatusLayout && iTextViewer ) - { - iStatusVisual->SetTextL( KEmptyStatusText ); - iStatusLayout->SetClipping( EFalse ); - TSize statusSize = iStatusVisual->TextExtents(); - iStatusLayout->SetSize( statusSize ); - iStatusVisual->SetRect( TRect( TPoint( 0, 0 ), statusSize ) ); - iTextViewer->UpdateStatusLayout(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SetHotspotHighlightedColorL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::SetHotspotHighlightedColorL( TInt aStartIndx, TInt aLenght, TBool aHighlight ) - { - FUNC_LOG; - TCharFormat charFormat; - TCharFormatMask charFormatMask; - if ( aHighlight ) - { - charFormat.iFontPresentation.iTextColor = SkinFontColorByType( EViewerFontHotspotHighLighted ); - } - else - { - charFormat.iFontPresentation.iTextColor = SkinFontColorByType( EViewerFontHotspotNormal ); - } - - charFormatMask.SetAttrib( EAttColor ); - iViewerRichText->ApplyCharFormatL( charFormat, charFormatMask, aStartIndx, aLenght ); - iTextViewer->ReloadTextL(); - } - -// --------------------------------------------------------------------------- -// Getter for the index of the attachment hotspot -// --------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::AttachmentHotSpotIndex() const - { - FUNC_LOG; - return iAttachmentHotSpotIndex; - } - -// --------------------------------------------------------------------------- -// Getter for the index of the View HTML hotspot -// --------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::ViewHtmlHotSpotIndex() const - { - FUNC_LOG; - return iViewHtmlHotSpotIndex; - } - -// --------------------------------------------------------------------------- -// Helper function for getting hotspot text from rich text data -// --------------------------------------------------------------------------- -HBufC* CFSEmailUiMailViewerRichText::GetHotspotTextLC( TInt aStartPos, - TInt aLength ) const - { - FUNC_LOG; - __ASSERT_DEBUG( aStartPos >= 0, User::Invariant() ); - __ASSERT_DEBUG( aLength > 0, User::Invariant() ); - - HBufC* des = HBufC::NewLC( aLength ); - - // Hotspot text is retrived in a loop, because the CPlainText::Read - // method may return only part of the requested text - TInt documentLength = iViewerRichText->DocumentLength(); - while ( aLength > 0 && aStartPos < documentLength ) - { - TPtrC text = iViewerRichText->Read( aStartPos, aLength ); - des->Des().Append( text ); - aLength -= text.Length(); - aStartPos += text.Length(); - } - - return des; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::FindBodyTextHotSpotsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::FindBodyTextHotSpotsL( const TDesC& aBodyContent ) - { - FUNC_LOG; - // Use s60 find item engine to find hotspots from the body text - CFindItemEngine* hotspotSearch = CFindItemEngine::NewL - ( - aBodyContent, - // define wanted - (CFindItemEngine::TFindItemSearchCase) - (CFindItemEngine::EFindItemSearchMailAddressBin | - CFindItemEngine::EFindItemSearchPhoneNumberBin | - CFindItemEngine::EFindItemSearchURLBin | - CFindItemEngine::EFindItemSearchScheme ) - ); - CleanupStack::PushL( hotspotSearch ); - - // - // insert found data to member variable iHotSpotData - const CArrayFixFlat* itemArray = hotspotSearch->ItemArray(); - TInt itemCount = hotspotSearch->ItemCount(); - for ( TInt i = 0; i < itemCount; i++ ) - { - CFindItemEngine::SFoundItem* foundItem = const_cast ( &itemArray->At( i ) ); - TBool foundSameHotspotTwice = EFalse; - // Check if same hotspot is found twice. This may happen when both flags - // EFindItemSearchScheme and EFindItemSearchURLBin are ON for search request. - for ( TInt j = i + 1; j < itemCount; j++ ) - { - if ( foundItem->iStartPos == itemArray->At( j ).iStartPos ) - { - foundSameHotspotTwice = ETrue; - break; - } - } - if ( !foundSameHotspotTwice ) - { - // At this phase hotspot is one character too early - // Change it to right place. If FindItemEngine implementation - // will change then following line must be removed. - //foundItem->iStartPos++; - iBodyTextHotSpotData.AppendL( itemArray->At( i ) ); - } - } - // - - CleanupStack::PopAndDestroy( hotspotSearch ); - } - - -// -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::GetCorrectFontL -// ----------------------------------------------------------------------------- -const CAknLayoutFont* CFSEmailUiMailViewerRichText::GetCorrectFontL( TViewerFontType aFontType ) const - { - FUNC_LOG; - /* - EViewerFontTitle = 0, - EViewerFontText, - EViewerFontBody, - EViewerFontHotspotNormal, - EViewerFontHotspotHighLighted, - EViewerFontSent, - EViewerFontIndentation - */ - const CAknLayoutFont* font = NULL; - - switch ( aFontType ) - { - case EViewerFontTitle: - case EViewerFontSent: - { - font = CurrentTitleFontL(); - } - break; - case EViewerFontText: - case EViewerFontBody: - case EViewerFontHotspotNormal: - case EViewerFontHotspotHighLighted: - case EViewerFontIndentation: - default: - { - font = CurrentTextFontL(); - } - break; - } - - if (NULL == font) - User::Leave(KErrGeneral); - - return font; - - } - -/* -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::ReConstructFontArrayL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::ReConstructFontArrayL() - { - FUNC_LOG; - iFontsArray.ResetAndDestroy(); - - // append title font - CAknLayoutFont* titleFont = CurrentTitleFontLC(); - iFontsArray.AppendL( titleFont ); - CleanupStack::Pop( titleFont ); - - // append text font - CAknLayoutFont* textFont = CurrentTextFontLC(); - iFontsArray.AppendL( textFont ); - CleanupStack::Pop( textFont ); - - // append body font - CAknLayoutFont* bodyFont = CurrentTextFontLC(); - iFontsArray.AppendL( bodyFont ); - CleanupStack::Pop( bodyFont ); - - // append not highlighted hotspot font - CAknLayoutFont* normalHotspotFont = CurrentTextFontLC(); - iFontsArray.AppendL( normalHotspotFont ); - CleanupStack::Pop( normalHotspotFont ); - - // append highlighted hotspot font - CAknLayoutFont* highLightedHotspotFont = CurrentTextFontLC(); - iFontsArray.AppendL( highLightedHotspotFont ); - CleanupStack::Pop( highLightedHotspotFont ); - - // append sent line font - CAknLayoutFont* sentLineFont = CurrentSentTextFontLC(); - iFontsArray.AppendL( sentLineFont ); - CleanupStack::Pop( sentLineFont ); - - // append indentation font - CAknLayoutFont* indentationFont = CurrentTextFontLC(); - iFontsArray.AppendL( indentationFont ); - CleanupStack::Pop( indentationFont ); - } -*/ - -/* -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::FontFromFontArray -// ----------------------------------------------------------------------------- -CAknLayoutFont& CFSEmailUiMailViewerRichText::FontFromFontArray( TViewerFontType aFontType ) const - { - FUNC_LOG; - return *iFontsArray[aFontType]; - } -*/ -// - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SkinFontColorByType -// ----------------------------------------------------------------------------- -TRgb CFSEmailUiMailViewerRichText::SkinFontColorByType( TViewerFontType aFontType ) - { - FUNC_LOG; - TRgb returnedColor; - switch ( aFontType ) - { - case EViewerFontTitle: - { - returnedColor = iAppUi.LayoutHandler()->ViewerTitleTextColor(); - } - break; - case EViewerFontBody: - { - returnedColor = iAppUi.LayoutHandler()->ViewerBodyTextColor(); - } - break; - case EViewerFontHotspotNormal: - { - returnedColor = iAppUi.LayoutHandler()->ViewerNormalHotspotTextColor(); - } - break; - case EViewerFontHotspotHighLighted: - { - returnedColor = iAppUi.LayoutHandler()->ViewerHighlightedHotspotTextColor(); - } - break; - case EViewerFontSent: - { - // - //returnedColor = iAppUi.LayoutHandler()->ViewerTitleFontHeight(); - returnedColor = iAppUi.LayoutHandler()->ViewerTitleTextColor(); - // - } - break; - case EViewerFontText: - default: - { - returnedColor = iAppUi.LayoutHandler()->ViewerTextTextColor(); - } - break; - } - return returnedColor; - } - -// LAYOUT CHANGES - -/* -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentTitleFontLC -// ----------------------------------------------------------------------------- -CAknLayoutFont* CFSEmailUiMailViewerRichText::CurrentTitleFontLC() - { - FUNC_LOG; - TAknLogicalFontId logicalFontId = iAppUi.LayoutHandler()->ViewerTitleFontAknLogicalFontId(); - TAknFontSpecification spec( logicalFontId ); - TInt heightInPixels = iAppUi.LayoutHandler()->ViewerTitleFontHeight(); - spec.SetTextPaneHeight( heightInPixels ); - CWsScreenDevice* dev = CCoeEnv::Static()->ScreenDevice(); - CAknLayoutFont* font = AknFontAccess::CreateLayoutFontFromSpecificationL( *dev, spec ); - CleanupStack::PushL( font ); - return font; - } -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentTextFontLC -// ----------------------------------------------------------------------------- -CAknLayoutFont* CFSEmailUiMailViewerRichText::CurrentTextFontLC() - { - FUNC_LOG; - TAknLogicalFontId logicalFontId = iAppUi.LayoutHandler()->ViewerTextFontAknLogicalFontId(); - TAknFontSpecification spec( logicalFontId ); - TInt heightInPixels = iAppUi.LayoutHandler()->ViewerTextFontHeight(); - spec.SetTextPaneHeight( heightInPixels ); - CWsScreenDevice* dev = CCoeEnv::Static()->ScreenDevice(); - CAknLayoutFont* font = AknFontAccess::CreateLayoutFontFromSpecificationL( *dev, spec ); - CleanupStack::PushL( font ); - return font; - } -*/ - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentTitleFontL -// ----------------------------------------------------------------------------- -const CAknLayoutFont* CFSEmailUiMailViewerRichText::CurrentTitleFontL() const - { - FUNC_LOG; - TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); - - TAknLayoutRect cmailPaneRect; - cmailPaneRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::list_cmail_pane()); - - TAknLayoutRect labelRect; - labelRect.LayoutRect(cmailPaneRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane()); - - TAknLayoutText layoutText; - layoutText.LayoutText(labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1()); - - const CAknLayoutFont* font = CAknLayoutFont::AsCAknLayoutFontOrNull( layoutText.Font() ); - - //All fonts must be loaded properly? Leave if something is failing. - if(NULL == font) - User::Leave(KErrGeneral); - - return font; - - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentTextFontL -// ----------------------------------------------------------------------------- -const CAknLayoutFont* CFSEmailUiMailViewerRichText::CurrentTextFontL() const - { - FUNC_LOG; - TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); - - TAknLayoutRect cmailPaneRect; - cmailPaneRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::list_cmail_pane()); - - //Using variety 0 -> 1 row line by default - TAknLayoutRect labelRect; - labelRect.LayoutRect(cmailPaneRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 )); - - TAknLayoutText layoutText; - layoutText.LayoutText(labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_t1( 0 )); - - const CAknLayoutFont* font = CAknLayoutFont::AsCAknLayoutFontOrNull( layoutText.Font() ); - - //All fonts must be loaded properly? Leave if something is failing. - if(NULL == font) - User::Leave(KErrGeneral); - - return font; - - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentSentTextFontLC -// ----------------------------------------------------------------------------- -const CAknLayoutFont* CFSEmailUiMailViewerRichText::CurrentSentTextFontL() const - { - return CurrentTitleFontL(); - } -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::CurrentSpacingHeight -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::CurrentSpacingHeight( TViewerSpacingIconType aSpacingIconType ) const - { - FUNC_LOG; - TInt heightInPixels = 0; - switch( aSpacingIconType ) - { - case ETopMostSpace: - { - heightInPixels = iAppUi.LayoutHandler()->ViewerTopMostSpaceHeight(); - } - break; - case ERecipientSpace: - { - heightInPixels = iAppUi.LayoutHandler()->ViewerRecipientSpaceHeight(); - } - break; - case EHeaderInfoSpace: - { - heightInPixels = iAppUi.LayoutHandler()->ViewerHeaderInfoSpaceHeight(); - } - break; - case EBottomMostSpace: - { - heightInPixels = iAppUi.LayoutHandler()->ViewerBottomMostSpaceHeight(); - } - break; - } - return heightInPixels; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::InsertTransparentSpacingIconL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::InsertTransparentSpacingIconL( TViewerSpacingIconType aSpacingIconType ) - { - FUNC_LOG; - TInt currentSpace = CurrentSpacingHeight( aSpacingIconType ); - TInt fontSide = 0; - switch ( aSpacingIconType ) - { - case ETopMostSpace: - case EBottomMostSpace: - { - TInt currentTextHeight = iAppUi.LayoutHandler()->ViewerTitleFontHeight(); - fontSide = currentSpace - currentTextHeight; - } - break; - case ERecipientSpace: - { - TInt currentTextHeight = iAppUi.LayoutHandler()->ViewerTextFontHeight(); - fontSide = currentSpace - currentTextHeight; - } - break; - case EHeaderInfoSpace: - { - TInt currentTextHeight = iAppUi.LayoutHandler()->ViewerTitleFontHeight(); - fontSide = currentSpace - currentTextHeight; - } - break; - } - iCurrentSpacingIconSize.SetSize( fontSide, fontSide ); - - UpdateIconL( EViewerIconSpacing ); - - // Add extra space before line ending so that we can modify the line height - AppendSpaceL(); - - AppendNewLineL(); - iHeaderLineInfo.iHeaderLineCount++; - - // to make the icon need less space. - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontSpec.iHeight = CEikonEnv::Static()->ScreenDevice()->VerticalPixelsToTwips( fontSide ); - charFormat.iFontPresentation.iUnderline = EUnderlineOff; - charFormatMask.SetAttrib( EAttFontHeight ); - charFormatMask.SetAttrib( EAttFontUnderline ); - iViewerRichText->ApplyCharFormatL( charFormat, charFormatMask, iViewerRichText->DocumentLength() - 3, 3 ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::InsertSpaceAfterIconL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::InsertSpaceAfterIconL() - { - FUNC_LOG; - TInt spaceInPixels = iAppUi.LayoutHandler()->ViewerPixelsBetweenMsgStatusIconAndSubject(); - iCurrentSpacingIconSize.SetSize( spaceInPixels, spaceInPixels ); - UpdateIconL( EViewerIconSpacing ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::InsertHotspotTextAndFontL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::InsertHotspotTextAndFontL( const TDesC& aText ) - { - FUNC_LOG; - AppendFormattedTextL( aText, EViewerFontHotspotNormal ); - } - -// ----------------------------------------------------------------------------- -// Appends formatted text to the rich text -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendFormattedTextL( const TDesC& aText, - TViewerFontType aFontType ) - { - FUNC_LOG; - iRichTextDocumentLength = iViewerRichText->DocumentLength(); - InsertFormattedTextL( aText, aFontType, iRichTextDocumentLength ); - } - -// ----------------------------------------------------------------------------- -// Inserts formatted text to the rich text -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::InsertFormattedTextL( const TDesC& aText, - TViewerFontType aFontType, TInt aPosition ) - { - FUNC_LOG; - ASSERT( aPosition >= 0 ); - ASSERT( aPosition <= iViewerRichText->DocumentLength() ); - - // Insert text at given position - iViewerRichText->InsertL( aPosition, aText ); - - // - const CAknLayoutFont* newFont = GetCorrectFontL( aFontType ); - - TRgb fontColor = SkinFontColorByType( aFontType ); - TFontUnderline underline = EUnderlineOff; - if ( aFontType == EViewerFontHotspotNormal ) - { - underline = EUnderlineOn; - } - - ApplyFontToTextL( newFont, aPosition, aText.Length(), fontColor, underline ); - // - } - -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::ApplyFontToTextL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::ApplyFontToTextL( const CAknLayoutFont* aFont, - TInt aStartInx, - TInt aLength, - TRgb& aColor, - TFontUnderline aUnderline ) - { - FUNC_LOG; - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontSpec = aFont->FontSpecInTwips(); - // Applies antialiasing for all text in mail viewer. - charFormat.iFontSpec.iFontStyle.SetBitmapType( EAntiAliasedGlyphBitmap ); - charFormat.iFontPresentation.iTextColor = aColor; - charFormat.iFontPresentation.iUnderline = aUnderline; - charFormatMask.SetAll(); - iViewerRichText->ApplyCharFormatL( charFormat, charFormatMask, aStartInx, aLength ); - } -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AddBodyHotsSpotWithTextFormatingL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AddBodyHotsSpotWithTextFormatingL( const CFindItemEngine::SFoundItem& aBodyHotSpotData ) - { - FUNC_LOG; - iViewerRichText->SetHotSpotL( aBodyHotSpotData.iStartPos + iHeaderLength, - aBodyHotSpotData.iLength, KHotspotHighlightOn ); - - // add underlining and right color the the hotspots - // - const CAknLayoutFont* newFont = GetCorrectFontL( EViewerFontText ); - TRgb fontColor = SkinFontColorByType( EViewerFontHotspotNormal ); - - TFontUnderline underline = EUnderlineOn; - ApplyFontToTextL( newFont, aBodyHotSpotData.iStartPos + iHeaderLength, - aBodyHotSpotData.iLength, fontColor, underline ); - // - - } - -// separator line - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::AppendSeparatorLineL -// Append attachement(s) line to the rich text. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerRichText::AppendSeparatorLineL() - { - FUNC_LOG; - UpdateIconL( EViewerIconSeparatorLine ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerRichText::SeparatorLineWidth -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerRichText::SeparatorLineWidth() const - { - FUNC_LOG; - // For some reason, the ratioanally calculated text width seems to be a bit - // wider than the width where GenericTextViewer does line wrapping. Reserve - // some extra pixels to overcome this. Maybe there is some difference in - // the ways the text width is calculated? - const TInt KExtraPixels( 10 ); - - TRect screenRect = iTextViewer->GetControl()->DisplayArea(); - TInt scrollBarBreadth = CEikScrollBar::DefaultScrollBarBreadth(); - - // Calculate space left for actual text - TInt rightMargin = iAppUi.LayoutHandler()->ViewerRightMarginInPixels() + scrollBarBreadth; - TInt leftMargin = iAppUi.LayoutHandler()->ViewerLeftMarginInPixels(); - TInt widthInPixels = screenRect.iBr.iX - rightMargin - leftMargin - KExtraPixels; - - return widthInPixels; - } - -// separator line - -// End of the file - diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5211 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description : FreestyleEmailUi list implementation -* -*/ - - - -// SYSTEM INCLUDES -#include "emailtrace.h" -#include -#include -#include -#include -#include - -#ifndef FF_CMAIL_INTEGRATION -#include -#endif // FF_CMAIL_INTEGRATION - -// -#include "fstextviewer.h" -#include "fsrichtext.h" -/// -#include -// -#include "fssmileydictionary.h" -/// -#include -#include -// -#include "cfsmailmessagepart.h" -#include "cfsmailclient.h" -// -#include -// -#include "cfsmailcommon.h" -// -#include -// - -#include -#include // CAknSinglePopupMenuStyleListBox -#include // for clipboard copy -// -#include "fstextviewerkeys.h" -#include "fstextviewerwatermark.h" -#include -#include -#include -#include -// -// -#include "AknWaitDialog.h" -// -#include -#include -#include - -// Meeting request -#include -// -#include "cesmricalviewer.h" -// - -// for intranet application opening -#include -#include - -// for opening normal browser -#include -#include - -// for bookmarks -#include // KBrowserBookmarks -#include - -// for fonts -#include -#include - -// for action menu -#include -#include -#include -#include -#include -#include -#include - -// -#include "cfsccontactactionmenu.h" -#include "mfsccontactactionmenumodel.h" -#include "cfsccontactactionservice.h" -#include "cfsccontactactionmenuitem.h" -#include "fsccontactactionmenuuids.hrh" -#include "fsccontactactionmenudefines.h" -// - -// -#include "cfsccontactactionservice.h" -#include -// -#include - -#include // CSchemeHandler - -// -#include "FreestyleEmailUiConstants.h" -// -// INTERNAL INCLUDES -#include "FreestyleEmailUiAppui.h" -#include "FreestyleEmailUiMailViewerControl.h" -#include "FreestyleEmailUiMailListVisualiser.h" -#include "FreestyleEmailUiFileSystemInfo.h" -#include "FreestyleEmailUi.hrh" -#include "freestyleemailcenrephandler.h" -#include "FreestyleEmailUiLayoutHandler.h" -#include "FreestyleEmailUiTextureManager.h" -#include "FreestyleEmailUiMsgDetailsVisualiser.h" -#include "FreestyleEmailUiFolderListVisualiser.h" -#include "FreestyleEmailUiAttachmentsListVisualiser.h" -#include "FreestyleEmailUiShortcutBinding.h" -#include "FreestyleEmailUiContactHandler.h" -#include "FreestyleEmailUiUtilities.h" -#include "FreestyleEmailUiStatusIndicator.h" -#include "FSEmail.pan" -#include "FSDelayedLoader.h" - -#include "FreestyleEmailUiMailViewerVisualiser.h" -#include "FreestyleEmailUiMailViewerRichText.h" -#include "FreestyleEmailUiMailViewerConstants.h" - -#include -#include -#include -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::NewL -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerVisualiser* CFSEmailUiMailViewerVisualiser::NewL( CAlfEnv& aEnv, CFreestyleEmailUiAppUi& aAppUi, CAlfControlGroup& aMailViewerControlGroup ) - { - FUNC_LOG; - CFSEmailUiMailViewerVisualiser* self = CFSEmailUiMailViewerVisualiser::NewLC( aEnv, aAppUi, aMailViewerControlGroup ); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::NewLC -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerVisualiser* CFSEmailUiMailViewerVisualiser::NewLC( CAlfEnv& aEnv, CFreestyleEmailUiAppUi& aAppUi, CAlfControlGroup& aMailViewerControlGroup ) - { - FUNC_LOG; - CFSEmailUiMailViewerVisualiser* self = new (ELeave) CFSEmailUiMailViewerVisualiser( aEnv, aAppUi, aMailViewerControlGroup ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ConstructL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ConstructL() - { - FUNC_LOG; - BaseConstructL( R_FSEMAILUI_MAIL_VIEWER_VIEW ); - iMessage = NULL; - iNextOrPevMessageSelected = EFalse; - iFirstStartCompleted = EFalse; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::DoFirstStartL() -// Purpose of this function is to do first start only when viewer is -// really needed to be shown. Implemented to make app start up faster. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::DoFirstStartL() - { - FUNC_LOG; - iOpenMessages = new (ELeave) CStack(); - iEmbeddedMessages = new (ELeave) CStack(); - iSmDictionary = CFsSmileyDictionary::NewL(); - iIBServiceHandler = CAiwServiceHandler::NewL(); - iIBServiceHandler->AttachMenuL( R_FSEMAILUI_MAILVIEWER_SUBMENU_ACTIONS, R_INTRANET_AIW_INTEREST_MENU ); - iIBServiceHandler->AttachL( R_INTRANET_AIW_INTEREST_BASE ); - - // Initialize browser laucher api - iFetchingAnimationTimer = CFSEmailUiGenericTimer::NewL( this ); - iAsyncCallback = new (ELeave) CAsyncCallBack( CActive::EPriorityLow ); - iDownloadProgressControlGroup = &iEnv.NewControlGroupL( KDownloadIndicatorControlGroup ); - iDownloadProgressIndicator = CFSEmailUiStatusIndicator::NewL( iEnv, *iDownloadProgressControlGroup, - &iAppUi ); - - iViewerRichText = CFSEmailUiMailViewerRichText::NewL( iAppUi ); - - //here is set menu for msk - MenuBar()->SetContextMenuTitleResourceId( R_FSEMAILUI_MAILVIEWER_MSK_MENUBAR ); - - iFirstStartCompleted = ETrue; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CFSEmailUiMailViewerVisualiser -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerVisualiser::CFSEmailUiMailViewerVisualiser( CAlfEnv& aEnv, - CFreestyleEmailUiAppUi& aAppUi, CAlfControlGroup& aMailViewerControlGroup ) - : CFsEmailUiViewBase( aMailViewerControlGroup, aAppUi ), - iMoveToFolderOngoing( EFalse ), - iFetchingMessageStructure( EFalse ), - iFetchingPlainTextMessageBody( EFalse ), - iFetchingHtmlMessageBody( EFalse ), - iAsyncProcessComplete( ETrue ), - iEnv( aEnv ) - { - FUNC_LOG; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::~CFSEmailUiMailViewerVisualiser -// ----------------------------------------------------------------------------- -CFSEmailUiMailViewerVisualiser::~CFSEmailUiMailViewerVisualiser() - { - FUNC_LOG; - // notewrapper is replaced by iWaitDialog - //delete iAsyncWaitNote; - // - if( iIBServiceHandler ) - { - iIBServiceHandler->Reset(); - delete iIBServiceHandler; - } - - if ( iAsyncCallback ) - { - iAsyncCallback->Cancel(); - delete iAsyncCallback; - } - - iDownloadProgressControlGroup = NULL; // owned by AlfEnv - } - -void CFSEmailUiMailViewerVisualiser::PrepareForExit() - { - FUNC_LOG; - delete iSmDictionary; - iSmDictionary = NULL; - delete iNewMailTempAddress; - iNewMailTempAddress = NULL; - - // Text viewer control need to be removed control group and deleted here, - // because akn physics (used by text viewer control) object's destructor - // ends up calling CoeEnv->AppUi, so AppUi must be alive when deleting - // text viewer control - if ( iTextViewerControl ) - { - ControlGroup().Remove( iTextViewerControl ); - } - - delete iTextViewer; - iTextViewer = NULL; - - delete iTextViewerControl; - iTextViewerControl = NULL; - - delete iViewerRichText; - iViewerRichText = NULL; - - if ( iFlagSelectionHanler ) - { - iFlagSelectionHanler->Cancel(); - delete iFlagSelectionHanler; - iFlagSelectionHanler = NULL; - } - if ( iFetchingAnimationTimer ) - { - iFetchingAnimationTimer->Stop(); - delete iFetchingAnimationTimer; - iFetchingAnimationTimer = NULL; - } - if ( iAppUi.DownloadInfoMediator() && iMessage ) - { - iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); - } - - delete iOpenMessages; - iOpenMessages = NULL; - delete iEmbeddedMessages; - iEmbeddedMessages = NULL; - iMessage = NULL; - - delete iMailBox; - iMailBox = NULL; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleForegroundEventL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleForegroundEventL() - { - FUNC_LOG; - if ( iFirstStartCompleted ) //Safety - { - // Resize the download indicator after returning from the screensaver - iDownloadProgressIndicator->HandleForegroundEventL(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::RequestResponseL -// for MFSEmailDownloadInformationObserver callback -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::RequestResponseL( const TFSProgress& aEvent, const TPartData& /*aPart*/ ) - { - FUNC_LOG; - if ( iFirstStartCompleted && iAppUi.CurrentActiveView() == this ) - { - UpdateDownloadIndicatorL( aEvent.iProgressStatus ); - - // Action menu is dismissed if it's opened on an attachment - // and the download has completed (to prevent canceling after completion). - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - - if( aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete && - hotspotType == EHeaderHotspot && - (currentHeaderHotSpotData.iType == ETypeAttachment || - currentHeaderHotSpotData.iType == ETypeAttachments) ) - { - CFSEmailUiActionMenu::Dismiss( ETrue ); - - // close actions menu if open - CEikMenuBar* menu = MenuBar(); - - if( menu->IsDisplayed() ) - { - menu->MenuPane()->CloseCascadeMenu(); - } - } - // - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::RequestResponseL -// for MFSMailRequestObserver callback -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::RequestResponseL( TFSProgress aEvent, TInt aRequestId ) - { - FUNC_LOG; - if ( iFirstStartCompleted ) // Safety - { - if ( aRequestId == iCurrentPlainTextBodyFetchRequestId && iFetchingPlainTextMessageBody ) - { - if ( aEvent.iError != KErrNone || - aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled ) - { - iAsyncProcessComplete = ETrue; - iFetchingPlainTextMessageBody = EFalse; - iFetchingAnimationTimer->Stop(); - - // Clear the "fetching body" text from the end of the message - iViewerRichText->SetEmptyStatusLayoutTextL(); - } - else if ( aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) - { - iAsyncProcessComplete = ETrue; - iFetchingPlainTextMessageBody = EFalse; - iFetchingAnimationTimer->Stop(); - - // get message again, there might be new information (in case of POP protocol) - TFSMailMsgId mailboxId = iMessage->GetMailBoxId(); - TFSMailMsgId folderId = iMessage->GetFolderId(); - TFSMailMsgId messageId = iMessage->GetMessageId(); - UpdateMessagePtrL( mailboxId, folderId, messageId ); - - // Refresh viewer to show newly fetched content. - // Prevent screen flickering by stopping automatic screen refresh during the update - iEnv.SetRefreshMode( EAlfRefreshModeManual ); - // Make sure we don't leave and forget the refresh mode as manual. - TRAP_IGNORE( - // Try to preserve the scroll position on the same line. - iAppUi.Display().Roster().Hide( ControlGroup() ); - TInt firstLine = iTextViewer->GetFirstDisplayedLine(); - RefreshL(); - iTextViewer->FocusLineL( firstLine, ETrue ); - iAppUi.Display().Roster().ShowL( ControlGroup() ); - ); - iEnv.SetRefreshMode( EAlfRefreshModeAutomatic ); - } - } - - else if ( aRequestId == iCurrentHtmlBodyFetchRequestId && iFetchingHtmlMessageBody ) - { - if ( aEvent.iError != KErrNone || - aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled ) - { - iAsyncProcessComplete = ETrue; - iFetchingHtmlMessageBody = EFalse; - } - else if ( aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) - { - iAsyncProcessComplete = ETrue; - iFetchingHtmlMessageBody = EFalse; - LaunchHtmlViewerL(); - } - } - else if ( aRequestId == iCurrentStructureFetchRequestId && iFetchingMessageStructure ) - { - if ( aEvent.iError != KErrNone || - aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled ) - { - iAsyncProcessComplete = ETrue; - iFetchingMessageStructure = EFalse; - } - else if ( aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) - { - iAsyncProcessComplete = ETrue; - iFetchingMessageStructure = EFalse; - - // get message again, there might be new information - TFSMailMsgId mailboxId = iMessage->GetMailBoxId(); - TFSMailMsgId folderId = iMessage->GetFolderId(); - TFSMailMsgId messageId = iMessage->GetMessageId(); - - UpdateMessagePtrL( mailboxId, folderId, messageId ); - if ( iMessage ) - { - // Stop automatic screen refresh temporarily to prevent flickering - iEnv.SetRefreshMode( EAlfRefreshModeManual ); - // we must not leave before the update mode has been restored - TRAP_IGNORE( - iAppUi.Display().Roster().Hide( ControlGroup() ); - RefreshL( ETrue ); - iAppUi.Display().Roster().ShowL( ControlGroup() ); - ); - iEnv.SetRefreshMode( EAlfRefreshModeAutomatic ); - } - } - } - } - // - if(iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed) - iWaitDialog->ProcessFinishedL(); // deletes the dialog - // - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::FolderSelectedL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::FolderSelectedL( - TFSMailMsgId aSelectedFolderId, TFSEmailUiCtrlBarResponse aResponse ) - { - FUNC_LOG; - - if ( iMoveToFolderOngoing ) - { - iMoveToFolderOngoing = EFalse; - if ( !iMovingMeetingRequest ) - { - switch ( aResponse ) - { - case EFSEmailUiCtrlBarResponseSelect: - { - iMoveDestinationFolder = aSelectedFolderId; - iAsyncCallback->Cancel(); // cancel any outstanding callback just to be safe - iAsyncCallback->Set( TCallBack( MoveToFolderAndExitL, this ) ); - iAsyncCallback->CallBack(); - } - break; - case EFSEmailUiCtrlBarResponseCancel: - default: - break; - } - } - else - { - iMovingMeetingRequest = EFalse; - switch ( aResponse ) - { - case EFSEmailUiCtrlBarResponseCancel: - iOpResult.iResultCode = KErrCancel; - break; - case EFSEmailUiCtrlBarResponseSelect: - { - // Do moving here, do not exit, because mrui exists itself. - iOpResult.iResultCode = KErrNone; - iMoveDestinationFolder = aSelectedFolderId; - RArray messageIds; - CleanupClosePushL( messageIds ); - messageIds.Append( iMessage->GetMessageId() ); - // Trap is needed because protocol might return KErrNotSupported - // if move away from current folder is not supprted - TRAPD(errMove, iAppUi.GetActiveMailbox()->MoveMessagesL( messageIds, - iMessage->GetFolderId(), iMoveDestinationFolder )); - if ( errMove != KErrNotSupported ) - { - if ( errMove == KErrNone ) - { - TFsEmailUiUtility::DisplayMsgsMovedNoteL( 1, iMoveDestinationFolder, ETrue ); - } - else - { - User::Leave( errMove ); - } - } - CleanupStack::PopAndDestroy( &messageIds ); - } - break; - default: - break; - } - } - } - - } - -// --------------------------------------------------------------------------- -// From MFSEmailUiContactHandlerObserver -// The ownership of the CLS items in the contacts array is transferred to the -// observer, and they must be deleted by the observer. -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::OperationCompleteL( - TContactHandlerCmd /*aCmd*/, const RPointerArray& /*aContacts*/ ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// From MFSEmailUiContactHandlerObserver -// Handles error in contatct handler operation. -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::OperationErrorL( - TContactHandlerCmd /*aCmd*/, TInt /*aError*/ ) - { - FUNC_LOG; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::MoveToFolderAndExitL -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerVisualiser::MoveToFolderAndExitL( TAny* aMailViewerVisualiser ) - { - FUNC_LOG; - CFSEmailUiMailViewerVisualiser* self = - static_cast(aMailViewerVisualiser); - - RArray messageIds; - CleanupClosePushL( messageIds ); - messageIds.Append( self->iMessage->GetMessageId() ); - - // Trap is needed because protocol might return KErrNotSupported - // if move away from current folder is not supprted - TRAPD(errMove, self->iAppUi.GetActiveMailbox()->MoveMessagesL( messageIds, - self->iMessage->GetFolderId(), - self->iMoveDestinationFolder ) ); - if ( errMove != KErrNotSupported ) - { - if ( errMove == KErrNone ) - { - // move successfull, display note - TFsEmailUiUtility::DisplayMsgsMovedNoteL( 1, self->iMoveDestinationFolder, ETrue ); - } - else - { - // Leave with any other err code than KErrNone or KErrNotSupported. - User::Leave( errMove ); - } - } - CleanupStack::PopAndDestroy( &messageIds ); - - // return to previous view - self->HandleCommandL( EAknSoftkeyBack ); - - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OpenFolderListForMessageMovingL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::OpenFolderListForMessageMovingL() - { - FUNC_LOG; - TBool ret = EFalse; - // Ignore if mailbox doesn't support moving or we are viewing embedded message - if ( iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ) && - !iEmbeddedMessageMode ) - { - // Activate folder selection view and handle moving after callback gets destination - iMoveToFolderOngoing = ETrue; - TFolderListActivationData folderListData; - folderListData.iCallback = this; - CFSMailFolder* folder = iAppUi.GetMailClient()->GetFolderByUidL( iMessage->GetMailBoxId(), iMessage->GetFolderId() ); - folderListData.iSourceFolderType = TFSFolderType( folder->GetFolderType() ); - delete folder; - const TPckgBuf pkgOut( folderListData ); - iAppUi.EnterFsEmailViewL( FolderListId, KFolderListMoveMessage, pkgOut ); - ret = ETrue; - } - return ret; - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ViewerControl -// ----------------------------------------------------------------------------- -CAlfControl* CFSEmailUiMailViewerVisualiser::ViewerControl() - { - FUNC_LOG; - return iTextViewerControl; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::Id -// ----------------------------------------------------------------------------- -TUid CFSEmailUiMailViewerVisualiser::Id() const - { - FUNC_LOG; - return MailViewerId; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ChildDoActivateL -// ----------------------------------------------------------------------------- -// Toolbar -/*void CFSEmailUiMailViewerVisualiser::DoActivateL( - const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage )*/ -// Toolbar -void CFSEmailUiMailViewerVisualiser::ChildDoActivateL( - const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ) - { - FUNC_LOG; - - // Read the activation parameters - TMsgViewerActivationData activationData; - if ( &aCustomMessage && aCustomMessage.Length() ) - { - TPckgBuf pkgBuf; - pkgBuf.Copy( aCustomMessage ); - activationData = pkgBuf(); - } - - // Take ownership of the passed message pointer. No pointer should be passed - // in other than embedded message cases. - // No leaving functions may be called before this step. - if ( aCustomMessageId != KStartViewerWithEmbeddedMsgPtr && activationData.iEmbeddedMessage ) - { - delete activationData.iEmbeddedMessage; - activationData.iEmbeddedMessage = NULL; - __ASSERT_DEBUG( EFalse, Panic(EFSEmailUiUnexpectedValue) ); - } - - CleanupStack::PushL( activationData.iEmbeddedMessage ); - - if ( !iFirstStartCompleted ) - { - DoFirstStartL(); - } - if ( aCustomMessageId == KStartViewerWithEmbeddedMsgPtr ) - { - PushMessageL( activationData.iEmbeddedMessage, ETrue ); - } - CleanupStack::Pop( activationData.iEmbeddedMessage ); // ownership transferred - - // Clear MSK to prevent unintentional presses before viewer is fully constructed - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - - // If returning from view launched by MRUI, just complete the ongoing async process. - // This will cause MRUI to be reopened and no other activation actions are needed. - if ( iMrObserverToInform && aCustomMessageId == KStartViewerReturnToPreviousMsg ) - { - CompletePendingMrCommand(); - } - // Otherwise go on with the standard view activation - else - { - // Cancel any pending asynchronous MR operation. There may be one at least if we - // have navigated from MRUI to Donwload manager and from there to another message - // or if external view activation happens while MRUI is open. - CancelPendingMrCommandL(); - - // Get message object unless returning to previously shown message. - // In KStartViewerReturnToPreviousMsg the UI assumes that iMessage is alive. - if ( aCustomMessageId == KStartViewerWithMsgId ) - { - // Inform base view if view has been forward navigated to get correct back - // navigation functionality in case of external activation. - ViewEntered( aPrevViewId ); - UpdateMessagePtrL( activationData.iMailBoxId, activationData.iFolderId, activationData.iMessageId ); - } - else if ( aCustomMessageId == KStartViewerWithEmbeddedMsgPtr || - aCustomMessageId == KStartViewerReturnFromEmbeddedMsg ) - { - if ( !iOpenMessages || iOpenMessages->IsEmpty() ) - { - User::Leave( KErrNotFound ); - } - UpdateMessagePtr( iOpenMessages->Head() ); - } - - // Regardless of the activation mode, we should now have a valid message pointer. - // Otherwise we cannot go on. - User::LeaveIfNull( iMessage ); - - iEmbeddedMessageMode = (iEmbeddedMessages->Head() != NULL); - - // Update mailbox unless returning to previously open message - if ( aCustomMessageId != KStartViewerReturnToPreviousMsg ) - { - delete iMailBox; iMailBox = NULL; - iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); - - // Change active mailbox if necessary - if ( !iMessage->GetMailBoxId().IsNullId() ) - { - iAppUi.SetActiveMailboxL( iMessage->GetMailBoxId(), EFalse ); - } - } - - // Check if MSG should be shown in the Meeting Request viewer - TBool msgSentToMrUi( EFalse ); - if ( iMessage->IsFlagSet( EFSMsgFlag_CalendarMsg ) && - iAppUi.MrViewerInstanceL() && - !iEmbeddedMessageMode ) - { - // Resolve meeting requst method - TESMRMeetingRequestMethod mrMethod( EESMRMeetingRequestMethodUnknown ); - mrMethod = iAppUi.MrViewerInstanceL()->ResolveMeetingRequestMethodL( *iMessage ); - if ( mrMethod == EESMRMeetingRequestMethodRequest || // Request is shown in mrui - mrMethod == EESMRMeetingRequestMethodCancellation || // Cancellation is shown in mrui - mrMethod == EESMRMeetingRequestMethodUnknown ) // Unknown MR needs to be to resolved in MRUI (Usually IMAP) - { - // Setting MSK empty. This blocks unwanted MSK keypresses before MrViewer is initialized. - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - - msgSentToMrUi = ETrue; - ClearMailViewer(); // clear prev message to avoid it becoming visible before MRUI opens - iMrUiActive = ETrue; - // Same navi pane shown in MR viewer - UpdateNaviPaneL( ETrue ); - SetMailboxNameToStatusPaneL(); - iAppUi.MrViewerInstanceL()->ExecuteViewL( *iMessage, *this ); - } - } - - // MSG is not sent to MRUI, display in internal mail viewer - // Message is either normal email message or response to meeting request - if ( !msgSentToMrUi ) - { - iMrUiActive = EFalse; - - // Update the viewer if new message has been opened or layout has changed while we were in some other view - TBool changeMsg = (aCustomMessageId != KStartViewerReturnToPreviousMsg); - if ( changeMsg || iLayoutChangedWhileNotActive ) - { - RefreshL( changeMsg ); - } - else // update MSK anyway as the attachment status may have changed - { - iShowMskDownloadOption = ShowMskDownloadOptionL(); - SetMskL(); - } - - SetMailboxNameToStatusPaneL(); - - // Update navipane content - UpdateNaviPaneL(); - } - - // Set email indicator off.. user has checked the new emails - TFsEmailUiUtility::ToggleEmailIconL( EFalse, activationData.iMailBoxId ); - } - - iNextOrPevMessageSelected = EFalse; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OfferToolbarEventL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::OfferToolbarEventL( TInt aCommand ) - { - FUNC_LOG; - switch (aCommand) - { - case EFsEmailUiTbCmdReply: - { - HandleCommandL(EFsEmailUiCmdActionsReply); - break; - } - - case EFsEmailUiTbCmdForward: - { - HandleCommandL(EFsEmailUiCmdActionsForward); - break; - } - case EFsEmailUiTbCmdDelete: - { - HandleCommandL(EFsEmailUiCmdActionsDelete); - break; - } - case EFsEmailUiTbCmdReplyAll: - { - HandleCommandL(EFsEmailUiCmdActionsReplyAll); - break; - } - default: - break; - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ToolbarResourceId -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerVisualiser::ToolbarResourceId() const - { - return R_FREESTYLE_EMAIL_UI_TOOLBAR_MESSAGE_VIEWER; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ChildDoDeactivate -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ChildDoDeactivate() - { - FUNC_LOG; - CancelFetchings(); - if ( iFetchingAnimationTimer ) - { - iFetchingAnimationTimer->Stop(); - } - if ( iDownloadProgressIndicator ) - { - iDownloadProgressIndicator->HideIndicator(); - } - - // Hide this view's navipane - HideNaviPane(); - - // set view itself as toolbar observer again (e.g. MRGUI could have been changed it) - Toolbar()->SetToolbarObserver( this ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HideNaviPane -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HideNaviPane() - { - FUNC_LOG; - CAknNavigationControlContainer* naviPaneContainer = NULL; - TRAP_IGNORE( naviPaneContainer = static_cast( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ) ); - TRAP_IGNORE( naviPaneContainer->PushDefaultL() ); - - CCustomStatuspaneIndicators* indicators = iAppUi.GetStatusPaneIndicatorContainer(); - if ( indicators) - { - indicators->HideStatusPaneIndicators(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ActivateControlGroup -// Overriden to make any running download progress bar visible after -// control group has been swithced -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ActivateControlGroup( TInt aDelay /*= 0*/ ) - { - CFsEmailUiViewBase::ActivateControlGroup( aDelay ); - TRAP_IGNORE( UpdateDownloadIndicatorL() ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleMrCommandL -// Handle accept/decline/tentative/remove commands given for meeting request -// message directly from list UI. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleMrCommandL( - TInt aCommandId, - TFSMailMsgId aMailboxId, - TFSMailMsgId aFolderId, - TFSMailMsgId aMessageId ) - { - FUNC_LOG; - - // All items should be run - if ( !iFirstStartCompleted ) - { - DoFirstStartL(); - } - - UpdateMessagePtrL( aMailboxId, aFolderId, aMessageId ); - - if ( aCommandId == EFsEmailUiCmdCalRemoveFromCalendar ) - { - iAppUi.MrViewerInstanceL()->RemoveMeetingRequestFromCalendarL( - *iMessage, *this ); - } - else - { - TESMRAttendeeStatus respondStatus; - if ( aCommandId == EFsEmailUiCmdCalActionsAccept ) - { - respondStatus = EESMRAttendeeStatusAccept; - } - else if ( aCommandId == EFsEmailUiCmdCalActionsTentative ) - { - respondStatus = EESMRAttendeeStatusTentative; - } - else // ( aCommandId == EFsEmailUiCmdCalActionsDecline ) - { - respondStatus = EESMRAttendeeStatusDecline; - } - iAppUi.MrViewerInstanceL()->ResponseToMeetingRequestL( - respondStatus, *iMessage, *this ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleTextViewerEventL -// From viewer observer for CFsTextViewer callbacks -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleTextViewerEventL( TFsTextViewerEvent aEvent ) - { - FUNC_LOG; - if ( iFirstStartCompleted ) // Safety - { - if ( aEvent == EFsTextViewerHotspotClicked ) - { - // Get currently focused hotspot data - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - - // Some header hotspots have some immediate action defined, so - // in case of header hotspot, try to handle the action first - TBool actionTaken( EFalse ); - if ( hotspotType == EHeaderHotspot ) - { - actionTaken = HandleHeaderHotspotActionL( currentHeaderHotSpotData.iType ); - } - - // If the current item is valid hotspot but it didn't have any - // immediate action defined, launch item specific action menu - if( ( hotspotType == EHeaderHotspot || hotspotType == EBodyHotspot ) && - !actionTaken ) - { - LaunchActionMenuL(); - } - } - else if ( aEvent == EFsTextViewerHotspotLongTap ) - { - LaunchActionMenuL(); - } - else if ( aEvent == EFsTextViewerScrollDown ) - { - // check if user has scroll to the bottom for start fetching rest of the message. - // if whole message has already been fetched, no actions are needed - StartFetchingRemaininBodyLinesIfAtBottomL(); - - // Hide action menu icon if current hotspot does not have action menu. - // Seems that this needs to be checked also here because "hotspot changed" events - // are not received reliably when scrolling down. - SetActionMenuIconVisbilityL(); - } - - else if ( aEvent == EFsTextViewerHotspotChanged ) - { - // Hide action menu icon if current hotspot does not have action menu. - SetActionMenuIconVisbilityL(); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleHeaderHotspotActionL -// Handle appropriate command for the selected header hotspot, if the currently -// focused item has some action specified. Returns ETrue, if current item has -// some action defined (and the action is initiated), EFalse if not. -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::HandleHeaderHotspotActionL( - TViewerHeadingHotspotType aHotspotType ) - { - TBool actionTaken( EFalse ); - - switch( aHotspotType ) - { - case ETypeToNMoreRecipients: - case ETypeCcNMoreRecipients: - case ETypeBccNMoreRecipients: - { - HandleCommandL( EFsEmailUiCmdViewAll ); - actionTaken = ETrue; - } - break; - case ETypeAttachment: - { - HandleCommandL( EFsEmailUiCmdOpenAttachment ); - actionTaken = ETrue; - } - break; - case ETypeAttachments: - { - HandleCommandL( EFsEmailUiCmdOpenAttachmentList ); - actionTaken = ETrue; - } - break; - case ETypeHtml: - { - HandleCommandL( EFsEmailUiCmdActionsOpenHtmlViewer ); - actionTaken = ETrue; - } - break; - } - - return actionTaken; - } - -// Helper funcitons to get viewed message ID and Folder id -TFSMailMsgId CFSEmailUiMailViewerVisualiser::ViewedMessageFolderId() - { - FUNC_LOG; - TFSMailMsgId ret; - if ( iMessage ) - { - ret = iMessage->GetFolderId(); - } - return ret; - } - -TFSMailMsgId CFSEmailUiMailViewerVisualiser::ViewedMessageId() - { - FUNC_LOG; - TFSMailMsgId ret; - if ( iMessage ) - { - ret = iMessage->GetMessageId(); - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::RefreshL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::RefreshL( TBool aFirstRefresh /*= EFalse*/ ) - { - FUNC_LOG; - if ( iFirstStartCompleted ) // Safety - { - // Show "Opening" wait note if the viewed message is a large one - // - //TInt waitNoteId = KErrNotFound; - // - if ( TFsEmailUiUtility::IsMessageBodyLargeL( iMessage ) ) - { - // using normal wait note instead of using global - //waitNoteId = TFsEmailUiUtility::ShowGlobalWaitNoteLC( R_FSE_WAIT_OPENING_TEXT ); - iWaitDialogOpening = new(ELeave)CAknWaitDialog( - (REINTERPRET_CAST(CEikDialog**,&iWaitDialogOpening))); - HBufC* noteText = StringLoader::LoadLC( R_FSE_WAIT_OPENING_TEXT ); - iWaitDialogOpening->SetTextL(*noteText); - //iWaitDialogOpening->DrawableWindow()->SetOrdinalPosition(0); - CleanupStack::PopAndDestroy(noteText); - iWaitDialogOpening->ExecuteLD(R_FSE_WAIT_DIALOG_NO_CANCEL); - // - } - - // Do the update - UpdateMailViewerL(); - AddBackgroundPicturesL(); - - // scroll to Sent line after updating if requested - if ( aFirstRefresh ) - { - iTextViewer->FocusLineL( iViewerRichText->SentTextLine(), ETrue ); - - iAsyncCallback->Cancel(); // just in case - iAsyncCallback->Set( TCallBack( DoPostRefresh, this ) ); - iAsyncCallback->CallBack(); - } - - // Close the wait note if it was opened - if ( iWaitDialogOpening )// - { - // - //CleanupStack::PopAndDestroy( (TAny*)waitNoteId ); - iWaitDialogOpening->ProcessFinishedL(); //it destroys the waitnote also - // - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::DoPostActivation -// Callback function for deferred activation actions -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerVisualiser::DoPostRefresh( TAny* aSelfPtr ) - { - FUNC_LOG; - CFSEmailUiMailViewerVisualiser* self = - static_cast( aSelfPtr ); - TRAPD( err, self->PostRefreshL() ); - return err; - } - -void CFSEmailUiMailViewerVisualiser::PostRefreshL() - { - FUNC_LOG; - // Focus attahcment line if available - TInt attachmentTextLine = iViewerRichText->AttachmentTextLine(); - TInt viewHtmlTextLine = iViewerRichText->ViewHtmlTextLine(); - if ( attachmentTextLine > 0 ) - { - iTextViewer->FocusLineL( attachmentTextLine, EFalse ); - iViewerRichText->SetHotspotByIndexL( iViewerRichText->AttachmentHotSpotIndex() ); - } - else if ( viewHtmlTextLine > 0 ) - { - iTextViewer->FocusLineL( viewHtmlTextLine, EFalse ); - iViewerRichText->SetHotspotByIndexL( iViewerRichText->ViewHtmlHotSpotIndex() ); - } - SetActionMenuIconVisbilityL(); - - // Set initial value for downloaded status for one attachment case - iShowMskDownloadOption = ShowMskDownloadOptionL(); - SetMskL(); - - // check if we know whole message, starts fetching if structure is unknown - // or body doesn't found - CheckMessageStructureL(); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CheckMessageStructureL -// Starts fetching message structure if it is unknown. -// If the structure is known but message body is not fetched yet, start fetching it. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CheckMessageStructureL() - { - FUNC_LOG; - if ( iFirstStartCompleted && iMessage ) - { - if ( !MessageStructureKnown( *iMessage ) ) - { // fetch structure - StartWaitedFetchingL( EMessageStructure ); - } - else if ( StartFetchingBodyAfterOpeningL() ) - { - iViewerRichText->AppendFetchingMoreTextL(); - StartFetchingMessagePartL( *iMessage, EMessagePlainTextBodyPart ); - iFetchingAnimationTimer->Start( KAnimationRefreshTimeIntervalInMilliseconds ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::UpdateDownloadIndicatorL -// Show or hide download progress indicator popup and update its contents if -// necessary. -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::UpdateDownloadIndicatorL( TFSProgress::TFSProgressStatus aStatus - /*= TFSProgress::EFSStatus_Waiting*/ ) - { - FUNC_LOG; - if ( iFirstStartCompleted && iMessage && iTextViewer ) // Safety - { - TFSMailMsgId messId = iMessage->GetMessageId(); - HBufC* progressString = NULL; - if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads( messId ) ) - { - TInt percentage = iAppUi.DownloadInfoMediator()->GetDownloadPercentageL( messId ); - progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, - percentage ); - } - else if ( aStatus == TFSProgress::EFSStatus_RequestComplete ) - { - progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 ); - } - else if ( aStatus == TFSProgress::EFSStatus_RequestCancelled ) - { - progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED ); - } - else - { - progressString = KNullDesC().AllocLC(); - } - - if ( progressString->Length() ) - { - if ( iDownloadProgressIndicator->IsVisible() ) - { - // pop-up already visible, just reset the text - iDownloadProgressIndicator->SetContentsL( progressString ); - } - else - { - // pop-up should be launched - - // Create fetching status layout first to ensure there's empty space in the end of the message - iViewerRichText->CreateStatusLayoutL(); - - iDownloadProgressIndicator->ShowIndicatorL( CFSEmailUiStatusIndicator::EIndicationDownloadProgress, - progressString, - CFSEmailUiStatusIndicator::EIndicationNoAutomaticHiding ); - iShowMskDownloadOption = EFalse; - } - } - CleanupStack::PopAndDestroy( progressString ); - - // Hide the progress popup after small delay if the download was completed or cancelled - if ( iAppUi.DownloadInfoMediator() && !iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads( messId ) && - iDownloadProgressIndicator->IsVisible() ) - { - iShowMskDownloadOption = ShowMskDownloadOptionL(); - iDownloadProgressIndicator->HideIndicator( KDownloadProgreeNoteHideDelay ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::DynInitMenuPaneL -// For dynamically dimm/undimm menu options according to currect message and focus in the viewer -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::DynInitMenuPaneL( - TInt aResourceId, CEikMenuPane* aMenuPane ) - { - FUNC_LOG; - if ( !iMessage || !iTextViewer ) - { - User::Leave( KErrNotReady ); - } - - if ( aResourceId == R_FSEMAILUI_MAILVIEWER_MENUPANE ) - { - - if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); - } - - // Folder independent options - - // hide/show MessageReader - TBool hideMessageReader = iEmbeddedMessageMode || !iAppUi.MessageReaderSupportsFreestyle(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdReadEmail, hideMessageReader ); - - // hide/show actions sub menu - TBool hideActions = !ShowActionsMenuInOptionsL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMailActions, hideActions ); - - // hide/show next and previous message options - TBool hideNext = !ShowNextMessageMenuInOptions(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdNextMessage, hideNext ); - TBool hidePrev = !ShowPreviousMessageMenuInOptions(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdPreviousMessage, hidePrev ); - - // hide/show copy to clipboard - TBool hideCopyToClipBoard = !IsCopyToClipBoardAvailableL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCopyToClipboard, hideCopyToClipBoard ); - - - // Folder dependent options - TFSMailMsgId currentMessageFolderId = iMessage->GetFolderId(); - CFSMailFolder* currentFolder = NULL; - if ( !iEmbeddedMessageMode ) - { - TRAP_IGNORE( currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( - iMessage->GetMailBoxId(), currentMessageFolderId ) ); - } - CleanupStack::PushL( currentFolder ); - if ( !currentFolder || currentFolder->GetFolderType() == EFSOutbox ) - { // outbox folder or embedded message - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReply, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward2, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveToDrafts, !currentFolder ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsDelete, !currentFolder ); - } - else - { // other folders - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveToDrafts, ETrue ); - - // hide reply all if there's no multiple recipients - TInt numRecipients(0); - if ( iMessage ) - { - //Get # of recipients - numRecipients =TFsEmailUiUtility::CountRecepients( iMessage ); - if ( numRecipients == 1 ) - { - //check if the malbox ownmailaddress is same as the recipients email address. If not, then assume that the - //email is a distribution list and we need to inc num of Recipients so that "Reply ALL" option appears in UI. - if ( iMessage->GetToRecipients().Count() ) - { - if ( iMailBox->OwnMailAddress().GetEmailAddress().Compare(iMessage->GetToRecipients()[0]->GetEmailAddress()) ) - { - numRecipients++; - } - } - if ( iMessage->GetCCRecipients().Count() ) - { - if ( iMailBox->OwnMailAddress().GetEmailAddress().Compare(iMessage->GetCCRecipients()[0]->GetEmailAddress()) ) - { - numRecipients++; - } - } - if( iMessage->GetBCCRecipients().Count() ) - { - if( iMailBox->OwnMailAddress().GetEmailAddress().Compare(iMessage->GetBCCRecipients()[0]->GetEmailAddress()) ) - { - numRecipients++; - } - } - } - } - - TBool hideReplyAll = ( numRecipients <= 1 ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, hideReplyAll ); - - // In Sent folder, option forward is shown above options reply and reply all - TBool forwardAboveReply = ( currentFolder->GetFolderType() == EFSSentFolder ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, !forwardAboveReply ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward2, forwardAboveReply ); - } - CleanupStack::PopAndDestroy( currentFolder ); - } - - if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_MORE ) - { - TFSMailMsgId currentMessageFolderId = iMessage->GetFolderId(); - CFSMailFolder* currentFolder = NULL; - if ( !iEmbeddedMessageMode ) - { - TRAP_IGNORE( currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( - iMessage->GetMailBoxId(), currentMessageFolderId ) ); - } - CleanupStack::PushL( currentFolder ); - if ( !currentFolder || currentFolder->GetFolderType() == EFSOutbox ) - { // outbox folder or embedded message - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); -// Prevent Download Manager opening with attachments -// aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadManager, ETrue ); -// Prevent Download Manager opening with attachments - } - else // other folders - { - // show read/unread according to current state - TBool messageIsRead = iMessage->IsFlagSet( EFSMsgFlag_Read ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); - - // show/hide move message - TBool hideMove = !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, hideMove ); - - // show/hide flag for followup - TBool hideFlag = !TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, hideFlag ); - - // hide/show download manager option -// Prevent Download Manager opening with attachments -// TBool hideDownloadMan = !ShowDownloadManagerMenuInOptions(); -// aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadManager, hideDownloadMan ); -// - } - CleanupStack::PopAndDestroy( currentFolder ); - } - - if ( aResourceId == R_FSEMAILUI_MAILVIEWER_SUBMENU_ACTIONS ) - { - // All menu items are hidden by default. - // Undimm items that should be visible in action menu. - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - - TBool remoteLookupAvailable = - TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ); - - if ( ( hotspotType == EHeaderHotspot && ( - currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeEmailAddress ) ) - || - ( hotspotType == EBodyHotspot && - currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchMailAddressBin ) ) - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMail, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsContactDetails, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact2, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); - } - else if ( hotspotType == EHeaderHotspot && - currentHeaderHotSpotData.iType == ETypeAttachment ) - { - TBool hideOpen = !ShowOpenAttachmentOptionL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdOpenAttachment, hideOpen ); - TBool hideDownload = !ShowDownloadOptionL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdDownload, hideDownload ); - TBool hideCancel = !ShowCancelDownloadOption(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelDownload, hideCancel ); - TBool hideSave = !ShowSaveAttachmentOptionL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdSave, hideSave ); - - TBool hideRemove = hideOpen; - aMenuPane->SetItemDimmed( EFsEmailUiCmdClearFetchedAttachment, hideRemove ); - } - else if ( hotspotType == EHeaderHotspot && - currentHeaderHotSpotData.iType == ETypeAttachments ) - { - TBool hideOpen = !ShowOpenAttachmentOptionL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdOpenAttachmentList, hideOpen ); - TBool hideDownload = !ShowDownloadOptionL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdDownloadAll, hideDownload ); - TBool hideCancel = !ShowCancelDownloadOption(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelAllDownloads, hideCancel ); - TBool hideSave = !ShowSaveAttachmentOptionL(); - aMenuPane->SetItemDimmed( EFsEmailUiCmdSaveAll, hideSave ); - } - else if ( hotspotType == EBodyHotspot && - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); - } - else if ( hotspotType == EBodyHotspot && - ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchURLBin || - currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchScheme ) ) - { - // Handle action menu for different search scheme, e.g mailto: and call: - TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); - switch ( schemaLinkType ) - { - case EFocusOnEMailInBodyText: - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsContactDetails, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact2, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); - } - break; - case EFocusOnNumberWithinMessage: - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCall, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddContact, EFalse ); - // Drop out "Create message" selection for SIP addresses - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - if ( schemeText && schemeText->FindC( KVoipPrefix ) != 0 ) - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsCreateMessage, EFalse ); - } - CleanupStack::PopAndDestroy( schemeText ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, !remoteLookupAvailable ); - } - break; - default: - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsOpenWeb, EFalse ); - - // Handle intranet browsing item by using AIW service - // handler's InitializeMenuPaneL-function, it will remove - // the IB menu item if IB is not available, or make the - // item visible if IB is available - if ( iIBServiceHandler && iIBServiceHandler->IsAiwMenu( aResourceId ) ) - { - TAiwGenericParam param( EGenericParamURL ); - CAiwGenericParamList* list = CAiwGenericParamList::NewLC(); - list->AppendL( param ); - iIBServiceHandler->InitializeMenuPaneL( *aMenuPane, aResourceId, - EFsEmailUiCmdActionsOpenInIntranetMenu, *list, ETrue ); - CleanupStack::PopAndDestroy( list ); - } - - aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsAddBookmark, EFalse ); - } - break; - } - } - } - - iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, - CFSEmailUiShortcutBinding::EContextMailViewer ); - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleCommandL -// Handles menu selections -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleCommandL( TInt aCommand ) - { - FUNC_LOG; - if ( !iAppUi.ViewSwitchingOngoing() ) - { - switch ( aCommand ) - { - case EAknSoftkeyBack: - { - // Set empty MSK when navigating back - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - // Cancel MR viewer launching if Back is pressed in the middle - // of launching process. - CancelPendingMrCommandL(); - NavigateBackL(); - } - break; - // top level options - case EFsEmailUiCmdActionsMoveToDrafts: - { - TFsEmailUiUtility::MoveMessageToDraftsL( - *iAppUi.GetActiveMailbox(), *iMessage ); - } - break; - case EFsEmailUiCmdCalActionsReplyAsMail: - case EFsEmailUiCmdActionsReply: - { - if ( !iEmbeddedMessageMode ) - { - TEditorLaunchParams params; - params.iMailboxId = iAppUi.GetActiveMailboxId(); - params.iMsgId = iMessage->GetMessageId(); - params.iActivatedExternally = EFalse; - iAppUi.LaunchEditorL( KEditorCmdReply, params ); - } - } - break; - case EFsEmailUiCmdActionsReplyAll: - { - if ( !iEmbeddedMessageMode ) - { - TEditorLaunchParams params; - params.iMailboxId = iAppUi.GetActiveMailboxId(); - params.iMsgId = iMessage->GetMessageId(); - params.iActivatedExternally = EFalse; - iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); - } - } - break; - case EFsEmailUiCmdCalActionsForwardAsMail: - case EFsEmailUiCmdActionsForward: - case EFsEmailUiCmdActionsForward2: - { - if ( !iEmbeddedMessageMode ) - { - TEditorLaunchParams params; - params.iMailboxId = iAppUi.GetActiveMailboxId(); - params.iMsgId = iMessage->GetMessageId(); - params.iActivatedExternally = EFalse; - iAppUi.LaunchEditorL( KEditorCmdForward, params ); - } - } - break; - case EFsEmailUiCmdActionsDelete: - { - DeleteMailL( *iMessage, ETrue ); - } - break; - case EFsEmailUiCmdActionsCopyToClipboard: - { - CopyCurrentHotspotToClipBoardL(); - } - break; - case EFsEmailUiCmdPreviousMessage: - { - ShowPreviousMessageL(); - } - break; - case EFsEmailUiCmdNextMessage: - { - ShowNextMessageL(); - } - break; - case EFsEmailUiCmdHelp: - { - TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); - } - break; - case EFsEmailUiCmdExit: - { - iAppUi.Exit(); - } - break; - case EFsEmailUiCmdReadEmail: - { - iAppUi.StartReadingEmailsL(); - } - break; - - // "actions" -sub menu options - case EFsEmailUiCmdActionsCall: - { - CallHotSpotAddressL(); - } - break; - case EFsEmailUiCmdActionsCreateMessage: - { - CreateMessageL(); - } - break; - case EFsEmailUiCmdActionsCreateMail: - { - ComposeMailL(); - } - break; - case EFsEmailUiCmdActionsContactDetails: - { - OpenContactDetailsL(); - } - break; - case EFsEmailUiCmdActionsAddContact: - case EFsEmailUiCmdActionsAddContact2: - { - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = - iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - if ( hotspotType == EHeaderHotspot ) - { - HBufC* emailAddress = - iViewerRichText->GetHeaderHotspotEmailAddressLC( - currentHeaderHotSpotData ); - SaveEmailAsContactL( *emailAddress ); - CleanupStack::PopAndDestroy( emailAddress ); - } - else if ( hotspotType == EBodyHotspot ) - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( - currentBodyHotSpotData ); - if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - SavePhoneNumberAsContactL( *hotspotText ); - } - else if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchMailAddressBin ) - { - SaveEmailAsContactL( *hotspotText ); - } - else if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchScheme) - { - if ( hotspotText->FindC( KMailtoPrefix ) == 0 ) - { - // Save email address, prefix is stripped in SaveEmailAsContactL - SaveEmailAsContactL( *hotspotText ); - } - else if ( hotspotText->FindC( KCallPrefix ) == 0 || - hotspotText->FindC( KTelPrefix ) == 0 || - hotspotText->FindC( KSmsPrefix ) == 0 || - hotspotText->FindC( KMmsPrefix ) == 0 ) - { - // Save phone nukmber, prefix is stripped in SavePhoneNumberAsContactL - SavePhoneNumberAsContactL( *hotspotText ); - } - } - CleanupStack::PopAndDestroy( hotspotText ); - } - } - break; - case EFsEmailUiCmdActionsRemoteLookup: - { - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = - iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - if ( hotspotType == EHeaderHotspot ) - { - HBufC* emailAddress = - iViewerRichText->GetHeaderHotspotEmailAddressLC( - currentHeaderHotSpotData ); - LaunchRemoteLookupL( *emailAddress ); - CleanupStack::PopAndDestroy( emailAddress ); - } - else if ( hotspotType == EBodyHotspot ) - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( - currentBodyHotSpotData ); - LaunchRemoteLookupL( *hotspotText ); - CleanupStack::PopAndDestroy( hotspotText ); - } - } - break; - case EFsEmailUiCmdActionsOpenHtmlViewer: - { - LaunchHtmlViewerL(); - } - break; - case EFsEmailUiCmdActionsOpenWeb: - { - CFindItemEngine::SFoundItem currentBodyHotSpotData; - TBool bodyHotSpotFound = - iViewerRichText->FindCurrentBodyHotSpotL( - currentBodyHotSpotData ); - OpenHotSpotUrlInBrowserL( currentBodyHotSpotData ); - } - break; - case EFsEmailUiCmdActionsOpenInIntranetMenu: - { - OpenLinkInIntranetL( ETrue ); - } - break; - case EFsEmailUiCmdActionsAddBookmark: - { - CFindItemEngine::SFoundItem currentBodyHotSpotData; - TBool bodyHotSpotFound = - iViewerRichText->FindCurrentBodyHotSpotL( - currentBodyHotSpotData ); - AddToBookmarksL( currentBodyHotSpotData ); - } - break; - case EAknSoftkeyOpen: - case EFsEmailUiCmdOpenAttachment: - { - OpenAttachmentL(); - } - break; - case EFsEmailUiCmdOpenAttachmentList: - { - OpenAttachmentsViewL(); - } - break; - case EFsEmailUiCmdDownload: - case EFsEmailUiCmdDownloadAll: - { - StartDowloadingAttachmentsL(); - } - break; - case EFsEmailUiCmdCancelDownload: - case EFsEmailUiCmdCancelAllDownloads: - { - CancelDowloadingAttachmentsL(); - } - break; - case EFsEmailUiCmdSave: - case EFsEmailUiCmdSaveAll: - { - SaveAllAttachmentsL(); - } - break; - case EFsEmailUiCmdClearFetchedAttachment: - { - RemoveFetchedAttachmentL(); - } - break; - - // "more" -sub menu options - case EFsEmailUiCmdMarkAsUnread: - { - ChangeMsgReadStatusL( EFalse, EFalse ); - } - break; - case EFsEmailUiCmdMarkAsRead: - { - ChangeMsgReadStatusL( ETrue, EFalse ); - } - break; - case EFsEmailUiCmdActionsMoveMessage: - { - OpenFolderListForMessageMovingL(); - } - break; - case EFsEmailUiCmdActionsFlag: - { - SetMessageFollowupFlagL(); - } - break; - case EFsEmailUiCmdCompose: - { - iAppUi.CreateNewMailL(); - } - break; - case EFsEmailUiCmdComposeTo: - { - ComposeMailL(); - } - break; - case EFsEmailUiCmdMessageDetails: - case EFsEmailUiCmdViewAll: - { - TUid activationCmdId = KStartMsgDetailsToBeginning; - if ( aCommand == EFsEmailUiCmdViewAll ) - { - SViewerHeadingHotSpotData currentHeaderHotSpotData; - iViewerRichText->FindCurrentHeaderHotSpotL( currentHeaderHotSpotData ); - if( currentHeaderHotSpotData.iType == ETypeToNMoreRecipients ) - { - activationCmdId = KStartMsgDetailsToTo; - } - else if( currentHeaderHotSpotData.iType == ETypeCcNMoreRecipients ) - { - activationCmdId = KStartMsgDetailsToCc; - } - else if( currentHeaderHotSpotData.iType == ETypeBccNMoreRecipients ) - { - activationCmdId = KStartMsgDetailsToBcc; - } - } - - TMsgDetailsActivationData msgDetailsData; - msgDetailsData.iMailBoxId = iMessage->GetMailBoxId(); - msgDetailsData.iFolderId = iMessage->GetFolderId(); - msgDetailsData.iMessageId = iMessage->GetMessageId(); - const TPckgBuf pkgOut( msgDetailsData ); - iAppUi.EnterFsEmailViewL( - MsgDetailsViewId, activationCmdId, pkgOut ); - } - break; -// Prevent Download Manager opening with attachments -// case EFsEmailUiCmdDownloadManager: -// { -// iAppUi.EnterFsEmailViewL( DownloadManagerViewId ); -// } -// break; -// - case EFsEmailUiCmdMarkAsReadUnreadToggle: - { - if ( iMessage && !iEmbeddedMessageMode ) - { - if ( iMessage->IsFlagSet( EFSMsgFlag_Read ) ) - { - HandleCommandL( EFsEmailUiCmdMarkAsUnread ); - } - else - { - HandleCommandL( EFsEmailUiCmdMarkAsRead ); - } - } - } - break; - - // Moving to top or to bottom of the text. Zero seems to be - // treated as illegal value in FocusLineL (it is skipped), - // so assuming that line range is [1, total lines count]. - // It is not documented anywhere though. - case EFsEmailUiCmdGoToTop: - { - // - // Do nothing if focus is already in top - if ( iTextViewer->GetFirstDisplayedLine() > 1 ) - { - iTextViewer->FocusLineL( 1 ); - } - } - // - break; - case EFsEmailUiCmdGoToBottom: - { - iTextViewer->FocusLineL( iTextViewer->GetTotalLines() ); - } - break; - - // The Generic text viewer API supports setting only one key for scroll up - // and one key for scroll down. To have multiple scroll up/down keys, - // we have set artificial keys for the generic viewer and simulate those - // when one of the shortcut keys is pressed. - // Another reason to use these artificial keys is that the TextViewer identifies - // keys by iCodes. This doesn't fit our concept at least in product where iCode - // of certain keys contains the value of the character found behind Fn on that key, - // and the Fn mappings vary between variants. - // Similar mechanism is used inside AknFep with key codes EKeyF19...EKeyF24, - // so collisions with these must be avoided. - case EFsEmailUiCmdScrollUp: - { - TKeyEvent simEvent = { KKeyCodeArtificialScrollUp, EStdKeyNull, 0, 0 }; - iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); - } - break; - case EFsEmailUiCmdScrollDown: - { - TKeyEvent simEvent = { KKeyCodeArtificialScrollDown, EStdKeyNull, 0, 0 }; - iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); - } - break; - case EFsEmailUiCmdPageUp: - { - TKeyEvent simEvent = { EKeyPageUp, EStdKeyNull, 0, 0 }; - iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); - } - break; - case EFsEmailUiCmdPageDown: - { - TKeyEvent simEvent = { EKeyPageDown, EStdKeyNull, 0, 0 }; - iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); - // Check if we reached the end of truncated message body - StartFetchingRemaininBodyLinesIfAtBottomL(); - } - break; - - default: - break; - } - } - } - - -void CFSEmailUiMailViewerVisualiser::ComposeMailL() - { - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - if ( hotspotType == EHeaderHotspot ) - { - // Regular email address - if ( currentHeaderHotSpotData.iType == ETypeEmailAddress ) - { - HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); - if ( emailAddress && emailAddress->Length() ) - { - delete iNewMailTempAddress; - iNewMailTempAddress = NULL; - iNewMailTempAddress = CFSMailAddress::NewL(); - iNewMailTempAddress->SetEmailAddress( *emailAddress ); - iAppUi.LaunchEditorL( iNewMailTempAddress ); - } - CleanupStack::PopAndDestroy( emailAddress ); - } - // Sender addr with display name - else if ( currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName ) - { - CFSMailAddress* senderAddress = iMessage->GetSender(); // not owned - iAppUi.LaunchEditorL( senderAddress ); - } - // To addr with display name - else if ( currentHeaderHotSpotData.iType == ETypeToAddressDisplayName ) - { - RPointerArray& toArray = iMessage->GetToRecipients(); // not owned - CFSMailAddress* toAddress = toArray[ currentHeaderHotSpotData.iDisplayNameArrayIndex ]; - iAppUi.LaunchEditorL( toAddress ); - } - // CC addr with display name - else if ( currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName ) - { - RPointerArray& ccArray = iMessage->GetCCRecipients(); // not owned - CFSMailAddress* ccAddress = ccArray[ currentHeaderHotSpotData.iDisplayNameArrayIndex ]; - iAppUi.LaunchEditorL( ccAddress ); - } - // BCC addr with display name - else if ( currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName ) - { - RPointerArray& bccArray = iMessage->GetBCCRecipients(); // not owned - CFSMailAddress* bccAddress = bccArray[ currentHeaderHotSpotData.iDisplayNameArrayIndex ]; - iAppUi.LaunchEditorL( bccAddress ); - } - } - // Email address hotspot in body text clicked - else if ( hotspotType == EBodyHotspot && ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin || - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) ) - { - WriteEmailToHotSpotAddressL( currentBodyHotSpotData ); - } - } - - - - -void CFSEmailUiMailViewerVisualiser::ProcessAsyncCommandL( TESMRIcalViewerOperationType aCommandId, - const CFSMailMessage& aMessage, - MESMRIcalViewerObserver* aObserver ) - { - FUNC_LOG; - if ( aObserver ) - { - iMrObserverToInform = aObserver; - } - // we must cast constness away from message because of flaws in MRUI API - CFSMailMessage* messagePtr = const_cast(&aMessage); - if ( messagePtr ) - { - // Fill in result struct - iOpResult.iOpType = aCommandId; - iOpResult.iMessage = messagePtr; - iOpResult.iResultCode = KErrNotFound; - - switch ( aCommandId ) - { - case EESMRCmdMailMessageDetails: - { - iOpResult.iResultCode = KErrNone; - TMsgDetailsActivationData msgDetailsData; - msgDetailsData.iMailBoxId = messagePtr->GetMailBoxId(); - msgDetailsData.iFolderId = messagePtr->GetFolderId(); - msgDetailsData.iMessageId = messagePtr->GetMessageId(); - const TPckgBuf pkgOut( msgDetailsData ); - iAppUi.EnterFsEmailViewL( MsgDetailsViewId, KStartMsgDetailsToBeginning, pkgOut); - } - break; - case EESMRCmdMailDelete: - { - if ( iMessage ) - { - iDeletedMessageFromMrui = iMessage->GetMessageId(); // - iOpResult.iResultCode = DeleteMailL( *iMessage, EFalse, ETrue ); - } - - // Information is returned immediately after delete has completed. - CompletePendingMrCommand(); - } - break; - case EESMRCmdMailMoveMessage: - { - if ( iMessage ) - { - if ( OpenFolderListForMessageMovingL() ) - { - iOpResult.iResultCode = KErrNone; - iMovingMeetingRequest = ETrue; - } - } - } - break; -// - case EESMRCmdOpenAttachment: - { - // Check that message has attachments to display - if ( messagePtr->IsFlagSet( EFSMsgFlag_Attachments ) ) - { - iOpResult.iResultCode = KErrNone; - OpenAttachmentL(); - CompletePendingMrCommand(); - } - } - break; - case EESMRCmdDownloadAttachment: - case EESMRCmdDownloadAllAttachments: - { - // Check that message has attachments to display - if ( messagePtr->IsFlagSet( EFSMsgFlag_Attachments ) ) - { - iOpResult.iResultCode = KErrNone; - StartDowloadingAttachmentsL(); - CompletePendingMrCommand(); - } - } - break; - case EESMRCmdSaveAttachment: - case EESMRCmdSaveAllAttachments: - { - // Check that message has attachments to display - if ( messagePtr->IsFlagSet( EFSMsgFlag_Attachments ) ) - { - iOpResult.iResultCode = KErrNone; - SaveAllAttachmentsL(); - CompletePendingMrCommand(); - } - } - break; -// - case EESMRCmdOpenAttachmentView: - { - // Check that message has attachments to display - if ( messagePtr->IsFlagSet( EFSMsgFlag_Attachments ) ) - { - iOpResult.iResultCode = KErrNone; - TAttachmentListActivationData params; - params.iMailBoxId = messagePtr->GetMailBoxId(); - params.iFolderId = messagePtr->GetFolderId(); - params.iMessageId = messagePtr->GetMessageId(); - TPckgBuf buf( params ); - TUid emptyCustomMessageId = { 0 }; - iAppUi.EnterFsEmailViewL( AttachmentMngrViewId, emptyCustomMessageId, buf ); -// - CompletePendingMrCommand(); -// - } - } - break; - case EESMRCmdDownloadManager: - { - // Check that there is something in dwnld manager to show - if ( ShowDownloadManagerMenuInOptions() ) - { - iOpResult.iResultCode = KErrNone; - iAppUi.EnterFsEmailViewL( DownloadManagerViewId ); - } - } - break; - case EESMRCmdMailComposeMessage: - { - iOpResult.iResultCode = KErrNone; - iAppUi.CreateNewMailL(); - } - break; - case EESMRCmdMailReply: - case EESMRCmdMailReplyAll: - case EESMRCmdMailForwardAsMessage: - { - // Fill result codes for mrui - iOpResult.iResultCode = KErrNone; - // Fill launc params - TEditorLaunchParams params; - params.iMailboxId = iAppUi.GetActiveMailboxId(); - params.iActivatedExternally = EFalse; - params.iMsgId = messagePtr->GetMessageId(); - if ( aCommandId == EESMRCmdMailForwardAsMessage ) - { - iAppUi.LaunchEditorL( KEditorCmdForward, params ); - } - else if ( aCommandId == EESMRCmdMailReply ) - { - iAppUi.LaunchEditorL( KEditorCmdReply, params ); - } - else if ( aCommandId == EESMRCmdMailReplyAll ) - { - iAppUi.LaunchEditorL( KEditorCmdReplyAll, params ); - } - } - break; - case EESMRCmdMailPreviousMessage: - { - iNextOrPevMessageSelected = ETrue; // prevent back navigation when operation completed received - ShowPreviousMessageL(); - iOpResult.iResultCode = KErrNone; - CompletePendingMrCommand(); - } - break; - case EESMRCmdMailNextMessage: - { - iNextOrPevMessageSelected = ETrue; // prevent back navigation when operation completed received - ShowNextMessageL(); - iOpResult.iResultCode = KErrNone; - CompletePendingMrCommand(); - } - break; - default: - break; - } - } - - // Complete immediately if handling command failed. It makes no harm if following - // function gets called several times in some case. - if ( iOpResult.iResultCode < 0 ) - { - CompletePendingMrCommand(); - } - } - - -void CFSEmailUiMailViewerVisualiser::ProcessSyncCommandL( - TESMRIcalViewerOperationType aCommandId, - const CFSMailMessage& aMessage ) - { - FUNC_LOG; - if ( &aMessage ) - { - switch ( aCommandId ) - { - case EESMRCmdMailMarkUnread: - { - ChangeMsgReadStatusL( EFalse, ETrue ); - } - break; - case EESMRCmdMailMarkRead: - { - ChangeMsgReadStatusL( ETrue, ETrue ); - } - break; - case EESMRCmdMailFlagMessage: - { - if ( iMessage ) - { - if ( !iFlagSelectionHanler ) - { - // Create when used for the first time - iFlagSelectionHanler = - CFlagSelectionGlobalNoteHandler::NewL( *this ); - } - // Call to LaunchFlagListQueryDialogL will lead - // to FlagselectionCompleteL - iFlagSelectionHanler->LaunchFlagListQueryDialogL(); - } - } - break; - default: - break; - } - } - } - - -// --------------------------------------------------------------------------- -// CanProcessCommand -// Callback from meeting request UI. Determines what functionality is provided -// to mrui by this UI -// --------------------------------------------------------------------------- -// -TBool CFSEmailUiMailViewerVisualiser::CanProcessCommand( - TESMRIcalViewerOperationType aCommandId ) const - { - FUNC_LOG; - TBool ret( EFalse ); - TInt numRecipients(0); - switch ( aCommandId ) - { - case EESMRCmdMailReply: - ret = ETrue; - break; - case EESMRCmdMailReplyAll: - //Get # of recipients - if ( iMessage ) - { - numRecipients=TFsEmailUiUtility::CountRecepients( iMessage ); - if ( numRecipients == 1 ) - { - //check if the malbox ownmailaddress is same as the recipients email address. If not, then assume that the - //email is a distribution list and we need to inc num of Recipients so that "Reply ALL" option appears in UI. - if ( iMessage->GetToRecipients().Count() ) - { - if ( iMailBox->OwnMailAddress().GetEmailAddress().Compare(iMessage->GetToRecipients()[0]->GetEmailAddress()) ) - { - numRecipients++; - } - } - if ( iMessage->GetCCRecipients().Count() ) - { - if ( iMailBox->OwnMailAddress().GetEmailAddress().Compare(iMessage->GetCCRecipients()[0]->GetEmailAddress()) ) - { - numRecipients++; - } - } - if ( iMessage->GetBCCRecipients().Count() ) - { - if ( iMailBox->OwnMailAddress().GetEmailAddress().Compare(iMessage->GetBCCRecipients()[0]->GetEmailAddress()) ) - { - numRecipients++; - } - } - } - } - ret = ( iMessage && numRecipients > 1 ); - break; - case EESMRCmdDownloadManager: - ret = ShowDownloadManagerMenuInOptions(); - break; -// - case EESMRCmdOpenAttachment: - case EESMRCmdSaveAttachment: - case EESMRCmdSaveAllAttachments: - case EESMRCmdDownloadAttachment: - case EESMRCmdDownloadAllAttachments: -// - case EESMRCmdOpenAttachmentView: - ret = ETrue; - break; - case EESMRCmdMailComposeMessage: - ret = ETrue; - break; - case EESMRCmdMailMarkUnread: - { - ret = EFalse; - if ( iMessage && iMessage->IsFlagSet(EFSMsgFlag_Read) ) - { - // Read, unread should be available - ret = ETrue; - } - } - break; - case EESMRCmdMailMarkRead: - { - ret = EFalse; - if ( iMessage && !iMessage->IsFlagSet(EFSMsgFlag_Read) ) - { - // Read, unread should be available - ret = ETrue; - } - } - break; - case EESMRCmdMailMoveMessage: - { - ret = EFalse; - if ( iMessage ) - { - // confirmed pointer exists, check whether mb has capa - ret = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); - } - } - break; - case EESMRCmdMailForwardAsMessage: - ret = ETrue; - break; - case EESMRCmdMailFlagMessage: - ret = TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ); - break; - case EESMRCmdMailMessageDetails: - ret = ETrue; - break; - case EESMRCmdMailDelete: - ret = ETrue; - break; - case EESMRCmdMailPreviousMessage: - ret = ShowPreviousMessageMenuInOptions(); - break; - case EESMRCmdMailNextMessage: - ret = ShowNextMessageMenuInOptions(); - break; - default: - ret = EFalse; - break; - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CompletePendingMrCommand() -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::CompletePendingMrCommand() - { - FUNC_LOG; - if ( iMrObserverToInform ) - { - iMrObserverToInform->OperationCompleted( iOpResult ); - } - iMrObserverToInform = NULL; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CancelPendingMrCommandL() -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::CancelPendingMrCommandL() - { - FUNC_LOG; - // Be sure not to call cancel if the MRUI is not active. This is because - // calling cancel after closing a newly fetched MR causes the MRUI to - // be reopened. - if ( iMrUiActive && iAppUi.MrViewerInstanceL() ) - { - iAppUi.MrViewerInstanceL()->CancelOperation(); - } - iMrUiActive = EFalse; - iMrObserverToInform = NULL; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OperationCompleted() -// From MRUI observer -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::OperationCompleted( TIcalViewerOperationResult aResult ) - { - FUNC_LOG; - if ( aResult.iOpType == EESMRViewLaunch ) - { - iMrUiActive = EFalse; - if ( !iNextOrPevMessageSelected && iAppUi.CurrentActiveView() == this ) - { - TRAP_IGNORE( NavigateBackL() ); - } - if ( aResult.iAttendeeStatus == EESMRAttendeeStatusAccept || - aResult.iAttendeeStatus == EESMRAttendeeStatusTentative ) - { - TInt noteTextId = R_FREESTYLE_EMAIL_CONFIRM_NOTE_MEETING_ON_CALENDAR_AFTER_SYNC; - TRAP_IGNORE( TFsEmailUiUtility::ShowGlobalInfoNoteL( noteTextId ) ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OperationError() -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::OperationError( TIcalViewerOperationResult aResult ) - { - FUNC_LOG; - // Show message in standard mail viewer in case launchin MRUI fails for any - // other reason than viewer being cancelled by calling CancelPendingMrCommand(). - if ( aResult.iOpType == EESMRViewLaunch ) - { - iMrUiActive = EFalse; - if ( iAppUi.CurrentActiveView() == this && aResult.iResultCode != KErrCancel ) - { - TRAP_IGNORE( - SetMailboxNameToStatusPaneL(); - iAppUi.Display().Roster().Hide( ControlGroup() ); - RefreshL( ETrue ); - iAppUi.Display().Roster().ShowL( ControlGroup() ); - UpdateDownloadIndicatorL(); - ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::SetMskL() -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::SetMskL() - { - FUNC_LOG; - if ( iFirstStartCompleted && iTextViewer ) // Safety - { - TInt ignoreThis( 0 ); - TBool visibleHotsSpot = - iTextViewer->GetVisibleFocusedHotspotLine( ignoreThis ); - if ( visibleHotsSpot ) - { - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - - if ( hotspotType == EHeaderHotspot ) - { - if ( currentHeaderHotSpotData.iType == - ETypeToAddressDisplayName || - currentHeaderHotSpotData.iType == - ETypeCcAddressDisplayName || - currentHeaderHotSpotData.iType == - ETypeBccAddressDisplayName || - currentHeaderHotSpotData.iType == - ETypeEmailAddress ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_COMPOSE ); - } - else if ( currentHeaderHotSpotData.iType == - ETypeFromAddressDisplayName ) - { - if ( !iEmbeddedMessageMode ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_REPLY ); - } - else - { - // Reply option is not available in the embedded mode - ChangeMskCommandL( R_FSE_QTN_MSK_COMPOSE ); - } - } - else if ( currentHeaderHotSpotData.iType == ETypeHtml ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_OPENHTMLVIEWER ); - } - else if ( currentHeaderHotSpotData.iType == ETypeAttachment ) - { - if ( iShowMskDownloadOption ) - { // attachment not yet downloaded - ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD ); - } - else if ( ShowCancelDownloadOption() ) - { // attachment is being downloaded - ChangeMskCommandL( R_FSE_QTN_MSK_OPEN_BLOCKED ); - } - else // attachment is already downloaded - { - ChangeMskCommandL( R_FSE_QTN_MSK_VIEWATTACHMENT ); - } - } - else if ( currentHeaderHotSpotData.iType == ETypeAttachments ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_VIEWATTACHMENTS ); - } - else if ( currentHeaderHotSpotData.iType == - ETypeToNMoreRecipients || - currentHeaderHotSpotData.iType == - ETypeCcNMoreRecipients || - currentHeaderHotSpotData.iType == - ETypeBccNMoreRecipients ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_VIEWALL ); - } - } - else if ( hotspotType == EBodyHotspot ) - { - if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchMailAddressBin ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_COMPOSE ); - } - else if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_CALL ); - } - else if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchURLBin || - currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchScheme ) - { - TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); - switch ( schemaLinkType ) - { - case EFocusOnEMailInBodyText: - ChangeMskCommandL( R_FSE_QTN_MSK_COMPOSE ); - break; - case EFocusOnNumberWithinMessage: - ChangeMskCommandL( R_FSE_QTN_MSK_CALL ); - break; - default: - ChangeMskCommandL( R_FSE_QTN_MSK_OPENURL ); - break; - } - } - } - else // if hotspot is not known - { - //it will set context menu for email (reply, forward, etc.) - ChangeMskCommandL( R_FSE_QTN_MSK_BODY_MENU ); - } - } - else - { - //it will set context menu for email (reply, forward, etc.) - ChangeMskCommandL( R_FSE_QTN_MSK_BODY_MENU ); - } - } - } - -// CFSEmailUiMailViewerVisualiser::OfferEventL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::OfferEventL(const TAlfEvent& aEvent) - { - FUNC_LOG; - // Consume most keys to be safe. Let only few keys to flow to - // text viewer because text viewer does some unexcepted actions - // with some keys events (at least left arrow and 0 keys) - TBool consumed( ETrue ); - - // Handle key presses if we are ready to process them - if ( iAsyncProcessComplete && !iAppUi.ViewSwitchingOngoing() && aEvent.IsKeyEvent() ) - { - // Check keyboard shortcuts on key down event since half-QWERTY keyboard - // has shortcuts on keys which do not send key event at all - if ( aEvent.Code() == EEventKeyDown ) - { - TInt shortcutCommand = - iAppUi.ShortcutBinding().CommandForShortcutKey( aEvent.KeyEvent(), - CFSEmailUiShortcutBinding::EContextMailViewer ); - if ( shortcutCommand != KErrNotFound ) - { - HandleCommandL( shortcutCommand ); - } - } - - // Update MSK label when key released to avoid constant updating - // on fast scrolling - else if ( aEvent.Code() == EEventKeyUp ) - { - SetMskL(); - } - - // Handle key events - else if ( aEvent.Code() == EEventKey ) - { - // Swap right and left controls in mirrored layout - TInt scanCode = aEvent.KeyEvent().iScanCode; - if ( AknLayoutUtils::LayoutMirrored() ) - { - if ( scanCode == EStdKeyRightArrow ) scanCode = EStdKeyLeftArrow; - else if ( scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; - } - - switch ( scanCode ) - { - case EStdKeyRightArrow: - { - // Open action menu if it is available to current hotspot item - LaunchActionMenuL(); - break; - } - case EStdKeyYes: - { - // call current header hotspot name or current body hotspot number - CallHotSpotAddressL(); - break; - } - case EStdKeyDownArrow: - case EStdKeyUpArrow: - case EStdKeyNull: // simulated keys events - { - // These keys are passed on to TextViewer - consumed = EFalse; - break; - } - default: - { - break; - } - } - } - } - - return consumed; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ClearMailViewer -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ClearMailViewer() - { - FUNC_LOG; - iAppUi.Display().Roster().Hide( ControlGroup() ); - if ( iTextViewer ) - { - if ( iTextViewerControl ) - { - ControlGroup().Remove( iTextViewerControl ); - } - if ( iControl ) - { - ControlGroup().Remove( iControl ); - } - delete iTextViewer; iTextViewer = NULL; - delete iTextViewerControl; iTextViewerControl = NULL; - delete iControl; iControl = NULL; - } - if ( iViewerRichText ) - { - iViewerRichText->Reset(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::UpdateMailViewerL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::UpdateMailViewerL() - { - FUNC_LOG; - if ( iFirstStartCompleted ) // Safety - { - ClearMailViewer(); - - // Create text viewer and store control pointer - iTextViewer = CFsTextViewer::NewL( iEnv ); - iTextViewerControl = iTextViewer->GetControl(); - iTextViewer->SetObserver( this ); - - // Set the artificial shortcut keys used to command the viewer to scroll up/down. - // These are simulated when corresponding shortcut command is received from the - // standard shortcut binder of FsEmailUI. - CFsTextViewerKeys* keys = CFsTextViewerKeys::NewL(); - keys->SetKeyPgUp( EKeyPageUp ); - keys->SetKeyPgDown( EKeyPageDown ); - keys->SetKeyScrollUp( KKeyCodeArtificialScrollUp ); - keys->SetKeyScrollDown( KKeyCodeArtificialScrollDown ); - iTextViewer->SetCustomKeys( keys ); - - iTextViewer->SetMirroring( AknLayoutUtils::LayoutMirrored() ); - - iViewerRichText->RefreshRichTextL( *iTextViewer, *iMessage, *iMailBox ); - - // These need to be called before setting text to the viewer. - iTextViewer->SetLeftMargin( iAppUi.LayoutHandler()->ViewerLeftMarginInPixels() ); - iTextViewer->SetRightMargin( iAppUi.LayoutHandler()->ViewerRightMarginInPixels() ); - - SetActionButtonIconAndHighLight(); - - iTextViewer->SetTextL( &iViewerRichText->RichText(), iSmDictionary ); - - // ownerships are transfered to AlfEnviroment. - // Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in - // opposite order. - // Create control for capturing left and right navigation events - iControl = CFreestyleEmailUiMailViewerControl::NewL( iEnv, *this ); - ControlGroup().AppendL( iControl ); - ControlGroup().AppendL( iTextViewerControl ); - // - - iLayoutChangedWhileNotActive = EFalse; - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::SetActionButtonIconAndHighLight -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::SetActionButtonIconAndHighLight() - { - FUNC_LOG; - CFreestyleEmailUiTextureManager* textureMgr = iAppUi.FsTextureManager(); - CFSEmailUiLayoutHandler* layoutMgr = iAppUi.LayoutHandler(); - - // get textures from texture manager - CAlfTexture& menuTexture = textureMgr->TextureByIndex( EListControlMenuIcon ); - CAlfTexture& selectortexture = textureMgr->TextureByIndex( EViewerHighlightTexture ); - - iTextViewer->SetLiteLineBg( selectortexture, layoutMgr->ViewerSelectorOpacity() ); - - iTextViewer->SetActionButton( menuTexture, 1 ); - iTextViewer->SetActionButtonMargin( layoutMgr->ViewerActionMenuIconMargin() ); - TSize btnSize = layoutMgr->ViewerActionMenuIconSize(); - iTextViewer->SetActionButtonSize( btnSize.iWidth, btnSize.iHeight ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::LaunchActionMenuL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::LaunchActionMenuL() - { - FUNC_LOG; - // check that current hotspot is visible - TInt ignoreThis; // not used here. Only return value is used not this mandatory reference parameter - TBool visibleHotsSpot = iTextViewer->GetVisibleFocusedHotspotLine( ignoreThis ); - if( visibleHotsSpot ) - { - // Remove items - CFSEmailUiActionMenu::RemoveAllL(); - - // check which hotspot is active. - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - - TActionMenuType currentActionMenuType = ENoActionMenuFocused; - if( hotspotType == EHeaderHotspot && ( - currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeEmailAddress ) ) - { - currentActionMenuType = EFocusOnNameInAddressField; - } - else if( hotspotType == EHeaderHotspot && ( - currentHeaderHotSpotData.iType == ETypeAttachment ) ) - { - currentActionMenuType = EFocusOnAttachmentName; - } - else if( hotspotType == EHeaderHotspot && ( - currentHeaderHotSpotData.iType == ETypeAttachments ) ) - { - currentActionMenuType = EFocusOnAttachmentsText; - } - else if( hotspotType == EBodyHotspot && - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - currentActionMenuType = EFocusOnNumberWithinMessage; - } - else if( hotspotType == EBodyHotspot && ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchURLBin || - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) ) - { - TInt schemaLinkType = ResolveBodyTextSchemaUrlTypeL( currentBodyHotSpotData ); - switch ( schemaLinkType ) - { - case EFocusOnEMailInBodyText: - currentActionMenuType = EFocusOnEMailInBodyText; - break; - case EFocusOnNumberWithinMessage: - currentActionMenuType = EFocusOnNumberWithinMessage; - break; - default: - currentActionMenuType = EFocusOnHyperLinkWithinMessage; - break; - - } - } - else if( hotspotType == EBodyHotspot && - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) - { - currentActionMenuType = EFocusOnEMailInBodyText; - } - - - if( currentActionMenuType != ENoActionMenuFocused ) - { - CreateActionMenuItemsL( currentActionMenuType ); - TActionMenuCustomItemId menuResult = CFSEmailUiActionMenu::ExecuteL( EFscCenter ); - if ( menuResult != FsEActionMenuCasItemSelectedAndExecuted && - menuResult != FsEActionMenuDismissed ) - { - HandleActionMenuCommandL( menuResult, currentActionMenuType ); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ResolveBodyTextSchemaUrlTypeL -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerVisualiser::ResolveBodyTextSchemaUrlTypeL( CFindItemEngine::SFoundItem aHotSpot ) - { - FUNC_LOG; - TInt ret( EFocusOnHyperLinkWithinMessage ); - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); - if ( schemeText->FindC( KMailtoPrefix ) == 0 ) - { - ret = EFocusOnEMailInBodyText; - } - else if ( schemeText->FindC( KCallPrefix ) == 0 || - schemeText->FindC( KTelPrefix ) == 0 || - schemeText->FindC( KSmsPrefix ) == 0 || - schemeText->FindC( KMmsPrefix ) == 0 || - schemeText->FindC( KVoipPrefix ) == 0 ) - { - ret = EFocusOnNumberWithinMessage; - } - else - { - ret = EFocusOnHyperLinkWithinMessage; - } - CleanupStack::PopAndDestroy( schemeText ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::SetActionMenuIconVisbilityL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::SetActionMenuIconVisbilityL() - { - FUNC_LOG; - if ( iTextViewer ) - { - if ( ShowActionsMenuInOptionsL() ) - { - iTextViewer->ShowActionButtonForCurrentHighlightedHotspotL(); - } - else - { - iTextViewer->HideActionButtonFromCurrentHighlightedHotspot(); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CreateActionMenuItemsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CreateActionMenuItemsL( - TActionMenuType aActionMenuType ) - { - FUNC_LOG; - // See the ui spec for all the right action menus according to - // currently selected hotspot - RArray uids; - CleanupClosePushL( uids ); - if ( aActionMenuType == EFocusOnNumberWithinMessage ) - { - uids.Append( FsEActionMenuCall ); - uids.Append( FsEActionMenuAddToContacts ); - // Drop FsEActionMenuCreateMessage from sip: addresses - // First check which hotspot is active. - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - if ( schemeText && schemeText->FindC( KVoipPrefix ) != 0 ) - { - uids.Append( FsEActionMenuCreateMessage ); - } - CleanupStack::PopAndDestroy( schemeText ); - if ( TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ) ) - { - uids.Append( FsEActionMenuRemoteLookup ); - } - } - else if ( aActionMenuType == EFocusOnNameInAddressField || - aActionMenuType == EFocusOnEMailInBodyText ) - { - uids.Append( FsEActionMenuCall ); - uids.Append( FsEActionMenuCreateMessage ); - uids.Append( FsEActionMenuCreateEmail ); - uids.Append( FsEActionMenuContactDetails ); - uids.Append( FsEActionMenuAddToContacts ); - if ( TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ) ) - { - uids.Append( FsEActionMenuRemoteLookup ); - } - } - else if ( aActionMenuType == EFocusOnHyperLinkWithinMessage ) - { - uids.Append( FsEActionMenuOpenInWeb ); - uids.Append( FsEActionMenuOpenInIntranet ); - uids.Append( FsEActionMenuBookmark ); - } - else if ( aActionMenuType == EFocusOnAttachmentName ) - { - if ( ShowOpenAttachmentOptionL() ) - { - uids.Append( FsEActionAttachmentOpen ); - } - if ( ShowDownloadOptionL() ) - { - uids.Append( FsEActionAttachmentDownload ); - } - if ( ShowCancelDownloadOption() ) - { - uids.Append( FsEActionAttachmentCancelDownload ); - } - if ( ShowSaveAttachmentOptionL() ) - { - uids.Append( FsEActionAttachmentSave ); - } - if ( ShowOpenAttachmentOptionL() ) - { - uids.Append( FsEActionAttachmentClearFetchedContent ); - } - } - else if ( aActionMenuType == EFocusOnAttachmentsText ) - { - if ( ShowOpenAttachmentOptionL() ) - { - uids.Append( FsEActionAttachmentViewAll ); - } - if ( ShowDownloadOptionL() ) - { - uids.Append( FsEActionAttachmentDownloadAll ); - } - if ( ShowCancelDownloadOption() ) - { - uids.Append( FsEActionAttachmentCancelAllDownloads ); - } - if ( ShowSaveAttachmentOptionL() ) - { - uids.Append( FsEActionAttachmentSaveAll ); - } - } - - TInt uidsCount = uids.Count(); - for ( TInt i = 0; i < uidsCount; i++ ) - { - CFSEmailUiActionMenu::AddCustomItemL( uids[i] ); - } - CleanupStack::PopAndDestroy( &uids ); - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleActionMenuCommandL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleActionMenuCommandL( - TActionMenuCustomItemId aSelectedActionMenuItem, - TActionMenuType aActionMenuType ) - { - FUNC_LOG; - // check which hotspot is active. - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - - if ( aActionMenuType == EFocusOnNumberWithinMessage ) - { - switch ( aSelectedActionMenuItem ) - { - case FsEActionMenuCall: // Call - { - CallToBodyHotSpotNumberL( currentBodyHotSpotData ); - } - break; - case FsEActionMenuAddToContacts: // Add to Contacts - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( - currentBodyHotSpotData ); - SavePhoneNumberAsContactL( *hotspotText ); - CleanupStack::PopAndDestroy( hotspotText ); - } - break; - case FsEActionMenuCreateMessage: // Create message - { - CreateMessageL(); - } - break; - case FsEActionMenuRemoteLookup: // Remote lookup - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( - currentBodyHotSpotData ); - LaunchRemoteLookupL( *hotspotText ); - CleanupStack::PopAndDestroy( hotspotText ); - } - break; - } - } - else if ( aActionMenuType == EFocusOnNameInAddressField ) - { - switch( aSelectedActionMenuItem ) - { - case FsEActionMenuCall: // Call - { - CallHotSpotAddressL(); - } - break; - case FsEActionMenuCreateMessage: // Create message - { - CreateMessageL(); - } - break; - case FsEActionMenuCreateEmail: // Create message - { - ComposeMailL(); - } - break; - case FsEActionMenuContactDetails: // Contact details - { - OpenContactDetailsL(); - } - break; - case FsEActionMenuAddToContacts: // Add to Contacts - { - HBufC* emailAddress = - iViewerRichText->GetHeaderHotspotEmailAddressLC( - currentHeaderHotSpotData ); - SaveEmailAsContactL( *emailAddress ); - CleanupStack::PopAndDestroy( emailAddress ); - } - break; - case FsEActionMenuRemoteLookup: // Remote lookup - { - HBufC* emailAddress = - iViewerRichText->GetHeaderHotspotEmailAddressLC( - currentHeaderHotSpotData ); - LaunchRemoteLookupL( *emailAddress ); - CleanupStack::PopAndDestroy( emailAddress ); - } - break; - } - } - else if ( aActionMenuType == EFocusOnHyperLinkWithinMessage ) - { - switch ( aSelectedActionMenuItem ) - { - case FsEActionMenuOpenInWeb: // Open in web - { - OpenHotSpotUrlInBrowserL( currentBodyHotSpotData ); - } - break; - case FsEActionMenuOpenInIntranet: // Open in intranet - { - OpenLinkInIntranetL( EFalse ); - } - break; - case FsEActionMenuBookmark: // Bookmark - { - AddToBookmarksL( currentBodyHotSpotData ); - } - break; - } - } - else if ( aActionMenuType == EFocusOnAttachmentName || - aActionMenuType == EFocusOnAttachmentsText ) - { - switch ( aSelectedActionMenuItem ) - { - case FsEActionAttachmentOpen: // Open single attachment - { - OpenAttachmentL(); - } - break; - case FsEActionAttachmentViewAll: // Open attachments list - { - OpenAttachmentsViewL(); - } - break; - case FsEActionAttachmentDownload: // Dowload one - case FsEActionAttachmentDownloadAll : /// all attachments - { - StartDowloadingAttachmentsL(); - } - break; - case FsEActionAttachmentCancelDownload: // Cancel one / all downloads - case FsEActionAttachmentCancelAllDownloads: - { - CancelDowloadingAttachmentsL(); - } - break; - case FsEActionAttachmentSave: // Save one / all attachments - case FsEActionAttachmentSaveAll: - { - SaveAllAttachmentsL(); - } - break; - case FsEActionAttachmentClearFetchedContent: - { - RemoveFetchedAttachmentL(); - } - break; - } - } - else if ( aActionMenuType == EFocusOnEMailInBodyText ) - { - switch ( aSelectedActionMenuItem ) - { - case FsEActionMenuCall: // Call - { - CallHotSpotAddressL(); - } - break; - case FsEActionMenuCreateMessage: // Create message - { - CreateMessageL(); - } - break; - case FsEActionMenuCreateEmail: // Create message - { - ComposeMailL(); - } - break; - case FsEActionMenuContactDetails: // Contact details - { - OpenContactDetailsL(); - } - break; - case FsEActionMenuAddToContacts: // Add to Contacts - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( - currentBodyHotSpotData ); - if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - SavePhoneNumberAsContactL( *hotspotText ); - } - else if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchMailAddressBin ) - { - SaveEmailAsContactL( *hotspotText ); - } - else if ( currentBodyHotSpotData.iItemType == - CFindItemEngine::EFindItemSearchScheme ) - { - if ( hotspotText->FindC( KMailtoPrefix ) == 0 ) - { - // Save email as contact, address mailto: strip is done in SaveEmailAsContactL - SaveEmailAsContactL( *hotspotText ); - } - } - CleanupStack::PopAndDestroy( hotspotText ); - } - break; - case FsEActionMenuRemoteLookup: // Remote lookup - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( - currentBodyHotSpotData ); - LaunchRemoteLookupL( *hotspotText ); - CleanupStack::PopAndDestroy( hotspotText ); - } - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OpenContactDetailsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::OpenContactDetailsL() - { - FUNC_LOG; - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - - HBufC* emailAddress = NULL; - if ( hotspotType == EHeaderHotspot ) - { - emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); - } - else if ( hotspotType == EBodyHotspot ) - { - emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - // Delete "mailto:" prefix if found - if ( emailAddress->FindC( KMailtoPrefix ) == 0 ) - { - emailAddress->Des().Delete( 0, KMailtoPrefix().Length() ); - } - } - else - { - return; - } - - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->ShowContactDetailsL( - *emailAddress, EContactUpdateEmail, NULL ); - - CleanupStack::PopAndDestroy( emailAddress ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::LaunchHtmlViewerL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::LaunchHtmlViewerL() - { - FUNC_LOG; - if ( MessagePartFullyFetchedL( EMessageHtmlBodyPart ) ) - { - THtmlViewerActivationData htmlData; - htmlData.iActivationDataType = THtmlViewerActivationData::EMailMessage; - htmlData.iMailBoxId = iMessage->GetMailBoxId(); - htmlData.iFolderId = iMessage->GetFolderId(); - htmlData.iMessageId = iMessage->GetMessageId(); - htmlData.iEmbeddedMessageMode = iEmbeddedMessageMode; - TPckgBuf pckgData( htmlData ); - - iAppUi.EnterFsEmailViewL( HtmlViewerId, KHtmlViewerOpenNew, pckgData ); - } - else - { - StartWaitedFetchingL( EMessageHtmlBodyPart ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::LaunchRemoteLookupL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::LaunchRemoteLookupL( const TDesC& aDes ) const - { - FUNC_LOG; - // this method assumes that remote lookup is available with current plugin. - HBufC* textData = HBufC::NewLC( aDes.Length() ); - textData->Des().Append( aDes ); - if ( textData->FindC( KMailtoPrefix ) == 0 ) - { - textData->Des().Delete( 0, KMailtoPrefix().Length() ); - } - else if ( textData->FindC( KCallPrefix ) == 0 ) - { - textData->Des().Delete( 0, KCallPrefix().Length() ); - } - else if ( textData->FindC( KTelPrefix ) == 0 ) - { - textData->Des().Delete( 0, KTelPrefix().Length() ); - } - else if ( textData->FindC( KSmsPrefix ) == 0 ) - { - textData->Des().Delete( 0, KSmsPrefix().Length() ); - } - else if ( textData->FindC( KMmsPrefix ) == 0 ) - { - textData->Des().Delete( 0, KMmsPrefix().Length() ); - } - else if ( textData->FindC( KVoipPrefix ) == 0 ) - { - textData->Des().Delete( 0, KVoipPrefix().Length() ); - } - - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->LaunchRemoteLookupWithQueryL( *iMailBox, *textData ); - CleanupStack::PopAndDestroy( textData ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::AddToBookmarksL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::AddToBookmarksL( - const CFindItemEngine::SFoundItem& aBodyHotspotData ) const - { - FUNC_LOG; - HBufC* hotspotText = - iViewerRichText->GetHotspotTextLC( aBodyHotspotData ); - - RFavouritesSession fSession; - User::LeaveIfError( fSession.Connect() ); - CleanupClosePushL( fSession ); - - RFavouritesDb favoris; - User::LeaveIfError( favoris.Open( fSession, KBrowserBookmarks ) ); - CleanupClosePushL( favoris ); - - CFavouritesItem *favorisItem = CFavouritesItem::NewLC(); - favorisItem->SetType( CFavouritesItem::EItem ); - favorisItem->SetUrlL( *hotspotText ); - // Should be less than KFavouritesMaxName ( 50 ) - if ( hotspotText->Length() > KFavouritesMaxName ) - { - favorisItem->SetNameL( hotspotText->Left( KFavouritesMaxName ) ); - } - else - { - favorisItem->SetNameL( *hotspotText ); - } - - favorisItem->SetParentFolder( KFavouritesRootUid ); - - TInt error = favoris.Add( *favorisItem, ETrue ); - - CleanupStack::PopAndDestroy( favorisItem ); - CleanupStack::PopAndDestroy( &favoris ); - CleanupStack::PopAndDestroy( &fSession ); - - CleanupStack::PopAndDestroy( hotspotText ); - - if ( error == KErrNone ) - { - TFsEmailUiUtility::ShowInfoNoteL( - R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue ); - } - else // Error in bookmark creation, show could not complete message - { - TFsEmailUiUtility::ShowErrorNoteL( - R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CallHotSpotAddressL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CallHotSpotAddressL() - { - FUNC_LOG; - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - - if( hotspotType == EHeaderHotspot && currentHeaderHotSpotData.iType == ETypeFromAddressDisplayName ) - { - HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, - iAppUi.GetActiveMailbox(), this, ETrue /*use call sender text*/); - CleanupStack::PopAndDestroy( emailAddress ); - } - else if( ( hotspotType == EHeaderHotspot && - ( currentHeaderHotSpotData.iType == ETypeToAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeCcAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeBccAddressDisplayName || - currentHeaderHotSpotData.iType == ETypeEmailAddress ) - ) - ) - { - HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, - iAppUi.GetActiveMailbox(), this, EFalse /*use call sender text*/); - CleanupStack::PopAndDestroy( emailAddress ); - } - else if( hotspotType == EBodyHotspot && - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) - { - HBufC* emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *emailAddress, - iAppUi.GetActiveMailbox(), this, EFalse ); - CleanupStack::PopAndDestroy( emailAddress ); - } - else if( hotspotType == EBodyHotspot && - currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - CallToBodyHotSpotNumberL( currentBodyHotSpotData ); - } - else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) - { - // Get scheme text and make sure there is "mailto:" text or "call:" text - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - if ( schemeText && schemeText->FindC( KMailtoPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->FindAndCallToContactByEmailL( *schemeText, - iAppUi.GetActiveMailbox(), this, EFalse); - } - else if ( schemeText->FindC( KCallPrefix ) == 0 || - schemeText->FindC( KTelPrefix ) == 0 || - schemeText->FindC( KSmsPrefix ) == 0 || - schemeText->FindC( KMmsPrefix ) == 0 || - schemeText->FindC( KVoipPrefix ) == 0 ) - { - CallToBodyHotSpotNumberL( currentBodyHotSpotData ); - } - CleanupStack::PopAndDestroy( schemeText ); - } - - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CreateMessageL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CreateMessageL() const - { - FUNC_LOG; - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - - if( hotspotType == EHeaderHotspot ) - { - HBufC* emailAddress = iViewerRichText->GetHeaderHotspotEmailAddressLC( currentHeaderHotSpotData ); - CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); - cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *emailAddress, iAppUi.GetActiveMailbox() ); - CleanupStack::PopAndDestroy( emailAddress ); - } - else if( hotspotType == EBodyHotspot ) - { - // Sending based on email address, goes to contact handler - if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) - { - HBufC* emailAddress = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); - cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *emailAddress, iAppUi.GetActiveMailbox() ); - CleanupStack::PopAndDestroy( emailAddress ); - } - // Sending based on found number, goes to utility class - else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - HBufC* hotspotText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - TFsEmailUiUtility::ShowCreateMessageQueryL( *hotspotText ); - CleanupStack::PopAndDestroy( hotspotText ); - } - else if ( currentBodyHotSpotData.iItemType == CFindItemEngine::EFindItemSearchScheme ) - { - // Get scheme text and make sure there is "mailto:" text or "call:" text - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - if ( schemeText && ( schemeText->FindC( KMailtoPrefix ) == 0 || - schemeText->FindC( KVoipPrefix ) == 0) ) - { - schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); - CFSEmailUiContactHandler* cntHandlerInstance = CFsDelayedLoader::InstanceL()->GetContactHandlerL(); - cntHandlerInstance->FindAndCreateMsgToContactByEmailL( *schemeText, iAppUi.GetActiveMailbox() ); - } - else if ( schemeText && schemeText->FindC( KCallPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KCallPrefix().Length() ); - TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); - } - else if ( schemeText && schemeText->FindC( KTelPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KTelPrefix().Length() ); - TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); - } - else if ( schemeText && schemeText->FindC( KSmsPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KSmsPrefix().Length() ); - TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); - } - else if ( schemeText && schemeText->FindC( KMmsPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KMmsPrefix().Length() ); - TFsEmailUiUtility::ShowCreateMessageQueryL( *schemeText ); - } - CleanupStack::PopAndDestroy( schemeText ); - } - } - } - -TBool CFSEmailUiMailViewerVisualiser::IsCopyToClipBoardAvailableL() const - { - FUNC_LOG; - TBool available = EFalse; - TInt ignoreThis( 0 ); - TBool visibleHotsSpot = - iTextViewer->GetVisibleFocusedHotspotLine( ignoreThis ); - - // Copy to clipboard is hidden if there's no visible hotspot focus - if ( visibleHotsSpot ) - { - // Check the type of focused hotspot - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( - currentHeaderHotSpotData, currentBodyHotSpotData ); - - if ( hotspotType == EBodyHotspot ) - { - // copying is available for all body hotspots - available = ETrue; - } - else if ( hotspotType == EHeaderHotspot ) - { - // in header, copying is available for email addresses - switch ( currentHeaderHotSpotData.iType ) - { - case ETypeFromAddressDisplayName: - case ETypeToAddressDisplayName: - case ETypeCcAddressDisplayName: - case ETypeBccAddressDisplayName: - case ETypeEmailAddress: - available = ETrue; - break; - default: - available = EFalse; - break; - } - } - else // hotspotType == ENoHotspot - { - available = EFalse; - } - } - - return available; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CopyCurrentHotspotToClipBoardL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CopyCurrentHotspotToClipBoardL() const - { - FUNC_LOG; - TInt ignoreThis( 0 ); - TBool visibleHotsSpot = - iTextViewer->GetVisibleFocusedHotspotLine( ignoreThis ); - - // Copy to clipboard is disabled if there's no visible hotspot focus - if ( visibleHotsSpot ) - { - HBufC* clipBoardText = NULL; - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - - if ( hotspotType == EHeaderHotspot ) - { - switch ( currentHeaderHotSpotData.iType ) - { - case ETypeFromAddressDisplayName: - case ETypeToAddressDisplayName: - case ETypeCcAddressDisplayName: - case ETypeBccAddressDisplayName: - { - // Get email address attachned to display name, cropped display name has no use - clipBoardText = iViewerRichText->GetEmailAddressLC( currentHeaderHotSpotData ); - } - break; - case ETypeEmailAddress: - { - clipBoardText = iViewerRichText->GetHotspotTextLC( currentHeaderHotSpotData ); - } - break; - } - } - else if ( hotspotType == EBodyHotspot ) - { - clipBoardText = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - } - - if ( clipBoardText ) - { - CClipboard* cb = CClipboard::NewForWritingLC( CCoeEnv::Static()->FsSession() ); - cb->StreamDictionary().At( KClipboardUidTypePlainText ); - CPlainText* plainText = CPlainText::NewL(); - CleanupStack::PushL( plainText ); - plainText->InsertL( 0 , *clipBoardText ); - plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() ); - CleanupStack::PopAndDestroy( plainText ); - cb->CommitL(); - CleanupStack::PopAndDestroy( cb ); - CleanupStack::PopAndDestroy( clipBoardText ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowOpenAttachmentOptionL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowOpenAttachmentOptionL() - { - FUNC_LOG; - TInt ret = EFalse; - - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - - // The Open option is always available when focus on the multiple - // attachments item. - if ( attachments.Count() > 1 ) - { - ret = ETrue; - } - // When focus on single attachment item, the Open is shown only when the - // attachment is fully downloaded - else if ( attachments.Count() == 1 ) - { - TPartData partData = MailData(); - partData.iMessagePartId = attachments[0]->GetPartId(); - if ( iAppUi.DownloadInfoMediator() && !iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) && - !iAppUi.DownloadInfoMediator()->IsDownloading( partData.iMessagePartId ) ) - { - ret = ETrue; - } - } - else - { - ret = EFalse; - } - - CleanupStack::PopAndDestroy( &attachments ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowSaveAttachmentOptionL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowSaveAttachmentOptionL() - { - FUNC_LOG; - // Save (all) is displayed if there are no ongoing downloads. - TBool saveAvailable = !ShowCancelDownloadOption(); - - // When viewing an embedded message object, saving needs to be disabled - // in case there are any attachments of message type. This is due to - // limitations in the Activesync plugin. - if ( saveAvailable && iEmbeddedMessageMode ) - { - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - - for ( TInt i = 0 ; i < attachments.Count() && saveAvailable ; ++i ) - { - const TDesC& attName = attachments[i]->AttachmentNameL(); - const TDesC& attMime = attachments[i]->GetContentType(); - TFileType attType = TFsEmailUiUtility::GetFileType( attName, attMime ); - if ( attType == EMessageType ) - { - saveAvailable = EFalse; - } - } - - CleanupStack::PopAndDestroy( &attachments ); - } - return saveAvailable; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowDownloadOptionL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowDownloadOptionL() - { - FUNC_LOG; - TBool retVal = EFalse; - - TPartData partData = MailData(); - - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - TInt attachmentsCount = attachments.Count(); - for ( TInt i = 0; i < attachmentsCount; i++ ) - { - partData.iMessagePartId = attachments[i]->GetPartId(); - if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) - { - retVal = ETrue; - break; - } - } - CleanupStack::PopAndDestroy( &attachments ); - return retVal; - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowDownloadOptionL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowMskDownloadOptionL() - { - FUNC_LOG; - // Check status only if download status might have changed - TBool ret( EFalse ); - if ( iMessage && iMessage->IsFlagSet(EFSMsgFlag_Attachments) ) - { - TPartData partData = MailData(); - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - // Safety, this function should not be called for any other amount than 1 - if ( attachments.Count() == 1 ) - { - partData.iMessagePartId = attachments[0]->GetPartId(); - if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) - { - ret = ETrue; - } - } - CleanupStack::PopAndDestroy( &attachments ); - } - return ret; - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowCancelDownloadOption -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowCancelDownloadOption() - { - FUNC_LOG; - TBool ret( EFalse ); - if ( iMessage && iAppUi.DownloadInfoMediator() ) - { - ret = iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads( - iMessage->GetMessageId() ); - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OpenAttachmentL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::OpenAttachmentL() - { - FUNC_LOG; - if ( !iMessage ) - { - User::Leave( KErrNotReady ); - } - - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - - // start downloading if not yet downloaded. - if ( ShowDownloadOptionL() ) - { - StartDowloadingAttachmentsL(); - } - else if ( ShowCancelDownloadOption() ) // show download ongoing info - { - TFsEmailUiUtility::ShowInfoNoteL( - R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS ); - } - else // open if attachment is already downloaded - { - TInt attachmentsCount = attachments.Count(); - if ( attachmentsCount ) - { - // - TFsEmailUiUtility::OpenAttachmentL( *attachments[attachmentsCount-1] ); - // - } - } - - CleanupStack::PopAndDestroy( &attachments ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OpenAttachmentsViewL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::OpenAttachmentsViewL() - { - FUNC_LOG; - // give pointer to current for attachments list view - TAttachmentListActivationData params; - params.iMailBoxId = iMessage->GetMailBoxId(); - params.iFolderId = iMessage->GetFolderId(); - params.iMessageId = iMessage->GetMessageId(); - params.iEmbeddedMsgMode = iEmbeddedMessageMode; - // use package buffer to pass the params - TPckgBuf buf( params ); - TUid emptyCustomMessageId = { 0 }; - iAppUi.EnterFsEmailViewL( - AttachmentMngrViewId, emptyCustomMessageId, buf ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StartDowloadingAttachmentsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::StartDowloadingAttachmentsL() - { - FUNC_LOG; - TPartData partData = MailData(); - - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - TInt attachmentsCount = attachments.Count(); - for( TInt i = 0; i < attachmentsCount; i++) - { - if ( attachments[i]->FetchLoadState() == EFSNone || - attachments[i]->FetchLoadState() == EFSPartial ) - { - partData.iMessagePartId = attachments[i]->GetPartId(); - if ( iAppUi.DownloadInfoMediator() ) - { - iAppUi.DownloadInfoMediator()->DownloadL( partData ); - } - } - } - CleanupStack::PopAndDestroy( &attachments ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CancelDowloadingAttachmentsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CancelDowloadingAttachmentsL() - { - FUNC_LOG; - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - TInt attachmentsCount = attachments.Count(); - - // ask confirmation for cancel - TInt promptTextId = R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY; - if ( attachmentsCount > 1 ) - { - promptTextId = R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY; - } - - if ( TFsEmailUiUtility::ShowConfirmationQueryL(promptTextId) && iAppUi.DownloadInfoMediator() ) - { - for ( TInt i = 0 ; i < attachmentsCount ; i++ ) - { - TFSPartFetchState fetchState = attachments[i]->FetchLoadState(); - if ( fetchState == EFSPartial || fetchState == EFSNone ) - { - iAppUi.DownloadInfoMediator()->CancelDownloadL( attachments[i]->GetPartId() ); - } - } - } - CleanupStack::PopAndDestroy( &attachments ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::SaveAllAttachmentsL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::SaveAllAttachmentsL() - { - FUNC_LOG; - TFileName fileName; - if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) - { - // start downloading attachemts which are not downloaded. - // Save all attachment which all already downloaded - TPartData partData = MailData(); - - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - TInt attachmentsCount = attachments.Count(); - - // remove the MRUI part of the message so we - // don't save unnecessary .ics file - CFSMailMessagePart* calendarPart = iMessage->FindBodyPartL( KFSMailContentTypeTextCalendar ); - CleanupStack::PushL( calendarPart ); - // - - TInt savedCount( 0 ); - for ( TInt i = 0; i < attachmentsCount; i++ ) - { - partData.iMessagePartId = attachments[i]->GetPartId(); - if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloadableL( partData ) ) - { // start download and let mediator do the saving - iAppUi.DownloadInfoMediator()->DownloadAndSaveL( partData, fileName ); - } - else // save immediately. - { - // - if( (calendarPart && partData.iMessagePartId != calendarPart->GetPartId() || - !calendarPart) && TFsEmailUiUtility::OkToSaveFileL( fileName, *attachments[i] ) ) - { - attachments[i]->CopyContentFileL( fileName ); - savedCount++; - } - // - } - } - if ( savedCount ) - { - TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount ); - } - // - CleanupStack::PopAndDestroy( calendarPart ); - // - CleanupStack::PopAndDestroy( &attachments ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::RemoveFetchedAttachmentL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::RemoveFetchedAttachmentL() - { - FUNC_LOG; - TInt reallyClear = - TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CLEAR_FETCHED_QUERY ); - if ( reallyClear ) - { - RPointerArray attachments; - CleanupResetAndDestroyClosePushL( attachments ); - iMessage->AttachmentListL( attachments ); - TInt attachmentsCount = attachments.Count(); - for ( TInt i = 0; i < attachmentsCount; i++ ) - { - attachments[i]->RemoveContentL(); - } - CleanupStack::PopAndDestroy( &attachments ); - iShowMskDownloadOption = ShowMskDownloadOptionL(); - SetMskL(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::MailData -// ----------------------------------------------------------------------------- -TPartData CFSEmailUiMailViewerVisualiser::MailData() - { - FUNC_LOG; - TPartData newPartData; - newPartData.iMailBoxId = iMessage->GetMailBoxId(); - newPartData.iFolderId = iMessage->GetFolderId(); - newPartData.iMessageId = iMessage->GetMessageId(); - return newPartData; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StartFetchingBodyAfterOpeningL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::StartFetchingBodyAfterOpeningL() const - { - FUNC_LOG; - TBool retVal = EFalse; - CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); - if ( textPart ) - { - TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); - if ( currentPlainTextFetchState == EFSNone ) - { - retVal = ETrue; - } - } - delete textPart; - return retVal; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::MessagePartFullyFetchedL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::MessagePartFullyFetchedL( TFetchedContentType aFetchedContentType ) const - { - FUNC_LOG; - TBool retVal = ETrue; - if( aFetchedContentType == EMessagePlainTextBodyPart ) - { - CFSMailMessagePart* textPart = iMessage->PlainTextBodyPartL(); - if( textPart ) - { - TFSPartFetchState currentPlainTextFetchState = textPart->FetchLoadState(); - if( currentPlainTextFetchState != EFSFull ) - { - retVal = EFalse; - } - } - delete textPart; - } - else if( aFetchedContentType == EMessageHtmlBodyPart ) - { - CFSMailMessagePart* htmlPart = iMessage->HtmlBodyPartL(); - if( htmlPart ) - { - TFSPartFetchState currentHtmlTextFetchState = htmlPart->FetchLoadState(); - if( currentHtmlTextFetchState != EFSFull ) - { - retVal = EFalse; - } - } - delete htmlPart; - } - else if( aFetchedContentType == EMessageStructure ) - { - retVal = MessageStructureKnown( *iMessage ); - } - else - { - User::Leave( KErrNotSupported ); - } - return retVal; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StartFetchingMessagePartL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::StartFetchingMessagePartL( CFSMailMessage& aMessagePtr, - TFetchedContentType aFetchedContentType ) - { - FUNC_LOG; - if( aFetchedContentType == EMessagePlainTextBodyPart ) - { - CFSMailMessagePart* textPart = aMessagePtr.PlainTextBodyPartL(); - CleanupStack::PushL( textPart ); - TFSMailMsgId textPartId = textPart->GetPartId(); - iFetchingPlainTextMessageBody = ETrue; - iCurrentPlainTextBodyFetchRequestId = textPart->FetchMessagePartL( textPartId, *this, 0 ); - CleanupStack::PopAndDestroy( textPart ); - } - else if( aFetchedContentType == EMessageHtmlBodyPart ) - { - CFSMailMessagePart* htmlPart = aMessagePtr.HtmlBodyPartL(); - CleanupStack::PushL( htmlPart ); - TFSMailMsgId htmlPartId = htmlPart->GetPartId(); - iFetchingHtmlMessageBody = ETrue; - iCurrentHtmlBodyFetchRequestId = htmlPart->FetchMessagePartL( htmlPartId, *this, 0 ); - CleanupStack::PopAndDestroy( htmlPart ); - } - else if( aFetchedContentType == EMessageStructure ) - { - StartFetchingMessageStructureL( aMessagePtr ); - } - else - { - User::Leave( KErrNotSupported ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CancelFetchings -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CancelFetchings() - { - FUNC_LOG; - if( iFetchingPlainTextMessageBody ) - { - TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentPlainTextBodyFetchRequestId ) ); - iFetchingPlainTextMessageBody = EFalse; - } - if( iFetchingHtmlMessageBody ) - { - TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentHtmlBodyFetchRequestId ) ); - iFetchingHtmlMessageBody = EFalse; - } - if( iFetchingMessageStructure ) - { - TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentStructureFetchRequestId ) ); - iFetchingMessageStructure = EFalse; - } - iAsyncProcessComplete = ETrue; - // - if(iWaitDialog && iDialogNotDismissed) - TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog - // - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::MessageStructureKnownL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::MessageStructureKnown( CFSMailMessage& aMsg ) const - { - FUNC_LOG; - return TFsEmailUiUtility::IsMessageStructureKnown( aMsg ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StartFetchingMessageStructureL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::StartFetchingMessageStructureL( CFSMailMessage& aMsg ) - { - FUNC_LOG; - TFSMailMsgId currentMailboxId = aMsg.GetMailBoxId(); - TFSMailMsgId currentMessageFolderId = aMsg.GetFolderId(); - CFSMailFolder* currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( currentMailboxId, currentMessageFolderId ); - CleanupStack::PushL( currentFolder ); - RArray messageIds; - CleanupClosePushL( messageIds ); - messageIds.Append( aMsg.GetMessageId() ); - iFetchingMessageStructure = ETrue; - iCurrentStructureFetchRequestId = currentFolder->FetchMessagesL( messageIds, EFSMsgDataStructure, *this ); - CleanupStack::PopAndDestroy( &messageIds ); - CleanupStack::PopAndDestroy( currentFolder ); - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StartWaitedFetchingL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::StartWaitedFetchingL( TFetchedContentType aFetchedContentType ) - { - FUNC_LOG; - iAsyncProcessComplete = EFalse; - iFetchingAlready = EFalse; - iStartAsyncFetchType = aFetchedContentType; - // in cmail we are using different wait dialog, since this wrapper dialog gives - // problems in red key exit, when its active - //delete iAsyncWaitNote; iAsyncWaitNote = NULL; - //iAsyncWaitNote = CAknWaitNoteWrapper::NewL(); - // surpress start delay to prevent situation where wait note gets visible - // only after the structure has been fetched - //iAsyncWaitNote->ExecuteL( R_FSE_FETCHING_WAIT_DIALOG, *this, ETrue ); - // - - // - iWaitDialog = new(ELeave)CAknWaitDialog( - (REINTERPRET_CAST(CEikDialog**,&iWaitDialog)), ETrue); - iWaitDialog->SetCallback(this); - iDialogNotDismissed = ETrue; - iWaitDialog->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG); - StartFetchingMessagePartL( *iMessage, iStartAsyncFetchType ); - iFetchingAlready = ETrue; - // - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StartFetchingRemaininBodyLinesIfAtBottomL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::StartFetchingRemaininBodyLinesIfAtBottomL() - { - FUNC_LOG; - TInt totalLines = iTextViewer->GetTotalLines(); - TInt currentLastDisplayedLine = iTextViewer->GetLastDisplayedLine(); - - if ( totalLines == currentLastDisplayedLine ) - { - // check if there is something to be fetched - if ( !MessagePartFullyFetchedL( EMessagePlainTextBodyPart ) && !iFetchingPlainTextMessageBody ) - { - iViewerRichText->AppendFetchingMoreTextL(); - // ensure the status layout in the bottom of the screen is visible - iTextViewer->FocusLineL( iTextViewer->GetTotalLines() ); - // start fetching - StartFetchingMessagePartL( *iMessage, EMessagePlainTextBodyPart ); - iFetchingAnimationTimer->Start( KAnimationRefreshTimeIntervalInMilliseconds ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::TimerEventL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) - { - FUNC_LOG; - if ( aTriggeredTimer == iFetchingAnimationTimer ) - { - iViewerRichText->AppendFetchingMoreTextL(); - iFetchingAnimationTimer->Start( KAnimationRefreshTimeIntervalInMilliseconds ); - } - } - -// MAknBackgroundProcess methods -// -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::StepL -// ----------------------------------------------------------------------------- -// -/* -void CFSEmailUiMailViewerVisualiser::StepL() - { - FUNC_LOG; - if( !iFetchingAlready ) - { - StartFetchingMessagePartL( *iMessage, iStartAsyncFetchType ); - iFetchingAlready = ETrue; - } - }*/ -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::IsProcessDone -// ----------------------------------------------------------------------------- -// -/* -TBool CFSEmailUiMailViewerVisualiser::IsProcessDone() const - { - FUNC_LOG; - return iAsyncProcessComplete; - }*/ -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ProcessFinished -// ----------------------------------------------------------------------------- -// -//void CFSEmailUiMailViewerVisualiser::ProcessFinished() {/* nothing here */ } -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::DialogDismissedL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::DialogDismissedL( TInt aButtonId ) - { - FUNC_LOG; - iDialogNotDismissed = EFalse; - if( aButtonId == EAknSoftkeyCancel ) - { - CancelFetchings(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CycleError -// ----------------------------------------------------------------------------- -// -//TInt CFSEmailUiMailViewerVisualiser::CycleError( TInt /*aError*/ ) -/* - { - FUNC_LOG; - iAsyncProcessComplete = ETrue; - CancelFetchings(); - return KErrNone; - }*/ -// - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::AddBackgroundPicturesL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::AddBackgroundPicturesL() - { - CAlfTexture& headerTexture = iAppUi.FsTextureManager()->TextureByIndex( EViewerTextureHeaderBackGround ); - CAlfTexture& backgroundTexture = iAppUi.FsTextureManager()->TextureByIndex( EBackgroundTextureMailList ); - - // add header texture - // -1 is here for to bottom space icon - // // S60 Skin support - // iTextViewer->SetPartBgImageL( 0, iViewerRichText->HeaderLengthInCharacters()-2, headerTexture ); - // - - // add bg texture - // S60 skin support - //iTextViewer->SetBackgroundImageL( backgroundTexture ); - // - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::SetMessageFollowupFlagL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::SetMessageFollowupFlagL() - { - FUNC_LOG; - if ( iMessage && - iTextViewer && - iViewerRichText && - TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) && - !iEmbeddedMessageMode ) - { - TFollowUpNewState newState = TFsEmailUiUtility::SetMessageFollowupFlagL( *iMessage ); - - switch ( newState ) - { - case EFollowUp: - { - iViewerRichText->UpdateIconL( CFSEmailUiMailViewerRichText::EViewerIconFollowUp ); - } - break; - case EFollowUpComplete: - { - iViewerRichText->UpdateIconL( CFSEmailUiMailViewerRichText::EViewerIconFollowUpComplete ); - } - break; - case EFollowUpClear: - { - iViewerRichText->UpdateIconL( CFSEmailUiMailViewerRichText::EViewerIconFollowUpNone ); - } - break; - case EFollowUpNoChanges: - default: - { - // do nothing. - } - break; - } - - if ( newState != EFollowUpNoChanges ) - { - // Update icon in viewer - TInt iconLine = iViewerRichText->FollowupIconLine(); - iTextViewer->ReloadPicturesL( iconLine ); - // Notify appui of changed mail item - SendEventToAppUiL( TFSEventMailChanged ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::DeleteMailL -// ----------------------------------------------------------------------------- -TInt CFSEmailUiMailViewerVisualiser::DeleteMailL( CFSMailMessage& aMessagePtr, TBool aReturnPreviousView, TBool aDisableNote ) - { - FUNC_LOG; - TInt ret( KErrCancel ); - - if ( iEmbeddedMessageMode ) - { - // embedded messages can't be deleted - ret = KErrNotSupported; - } - else - { - TInt okToDelete( ETrue ); - if ( !aDisableNote ) - { - if(iAppUi.GetCRHandler()->WarnBeforeDelete()) - { - okToDelete = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_UI_DELETE_MESSAGE_CONFIRMATION ); - } - } - if ( okToDelete ) - { - CFSMailMessage* confirmedMsgPtr = NULL; - TRAP_IGNORE( confirmedMsgPtr = iAppUi.GetMailClient()->GetMessageByUidL( iAppUi.GetActiveMailboxId(), - aMessagePtr.GetFolderId(), - aMessagePtr.GetMessageId() , - EFSMsgDataEnvelope ) ); - if ( confirmedMsgPtr ) - { - CleanupStack::PushL( confirmedMsgPtr ); - RArray msgIds; - CleanupClosePushL( msgIds ); - msgIds.Append( confirmedMsgPtr->GetMessageId() ); - TFSMailMsgId mailBox = iAppUi.GetActiveMailbox()->GetId(); - iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, confirmedMsgPtr->GetFolderId(), msgIds ); - // Notify appui of deleted mail item - SendEventToAppUiL( TFSEventMailDeleted ); - CleanupStack::PopAndDestroy( &msgIds ); - CleanupStack::PopAndDestroy( confirmedMsgPtr ); - } - - // return to previous view - if ( aReturnPreviousView ) - { - // return only if we are in mail viewer - if ( iAppUi.CurrentActiveView()->Id() == MailViewerId ) - { - HandleCommandL( EAknSoftkeyBack ); - } - } - } - if ( okToDelete ) - { - ret = KErrNone; - } - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowActionsMenuInOptionsL -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowActionsMenuInOptionsL() const - { - FUNC_LOG; - TBool retVal = ETrue; - - SViewerHeadingHotSpotData currentHeaderHotSpotData; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - THotspotType hotspotType = iViewerRichText->FindCurrentHotSpotL( currentHeaderHotSpotData, currentBodyHotSpotData ); - - if( hotspotType == ENoHotspot || ( hotspotType == EHeaderHotspot && ( - currentHeaderHotSpotData.iType == ETypeToNMoreRecipients || - currentHeaderHotSpotData.iType == ETypeCcNMoreRecipients || - currentHeaderHotSpotData.iType == ETypeBccNMoreRecipients || - currentHeaderHotSpotData.iType == ETypeHtml ) ) ) - { - retVal = EFalse; - } - return retVal; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowDownloadManagerMenuInOptions -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowDownloadManagerMenuInOptions() const - { - FUNC_LOG; - TBool ret(EFalse); -/* Download Manager blocked - if ( iAppUi.DownloadInfoMediator() ) - { - ret = iAppUi.DownloadInfoMediator()->IsAnyAttachmentDownloads(); - } - */ - return ret; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowNextMessageMenuInOptions -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowNextMessageMenuInOptions() const - { - FUNC_LOG; - TBool available = EFalse; - // Next/previous message options are inavailable in the embedded mode - if ( iMessage && !iEmbeddedMessageMode ) - { - TFSMailMsgId currentMsgId = iMessage->GetMessageId(); - TFSMailMsgId nextMsgId; - TFSMailMsgId nextMsgFolderId; - available = iAppUi.IsNextMsgAvailable( currentMsgId, nextMsgId, nextMsgFolderId ); - } - return available; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowPreviousMessageMenuInOptions -// ----------------------------------------------------------------------------- -TBool CFSEmailUiMailViewerVisualiser::ShowPreviousMessageMenuInOptions() const - { - FUNC_LOG; - TBool available = EFalse; - // Next/previous message options are inavailable in the embedded mode - if ( iMessage && !iEmbeddedMessageMode ) - { - TFSMailMsgId currentMsgId = iMessage->GetMessageId(); - TFSMailMsgId prevMsgId; - TFSMailMsgId prevMsgFolderId; - available = iAppUi.IsPreviousMsgAvailable( currentMsgId, prevMsgId, prevMsgFolderId ); - } - return available; - } - - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowNextMessageL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ShowNextMessageL() - { - FUNC_LOG; - if ( iMessage && !iEmbeddedMessageMode ) - { - TFSMailMsgId currentMsgId = iMessage->GetMessageId(); - TFSMailMsgId nextMsgId; - TFSMailMsgId nextMsgFolderId; - if ( iAppUi.IsNextMsgAvailable( currentMsgId, nextMsgId, nextMsgFolderId ) ) - { - // Stop timer and cancel fetchings before showing next message - iFetchingAnimationTimer->Stop(); - CancelFetchings(); - - // Change empty msk when moving to next - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - - iAppUi.MoveToNextMsgL( currentMsgId, nextMsgId ); - // Next message is displayed in this view through doactivate, because view is re-activate by mail list - } - } - } -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ShowPreviousMessageL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ShowPreviousMessageL() - { - FUNC_LOG; - if ( iMessage && !iEmbeddedMessageMode ) - { - TFSMailMsgId currentMsgId = iMessage->GetMessageId(); - TFSMailMsgId prevMsgId; - TFSMailMsgId prevMsgFolderId; - if ( iAppUi.IsPreviousMsgAvailable( currentMsgId, prevMsgId, prevMsgFolderId ) ) - { - // Stop timer and cancel fetchings before showing prev message - iFetchingAnimationTimer->Stop(); - CancelFetchings(); - - // Change empty msk when moving to previous - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - - iAppUi.MoveToPreviousMsgL( currentMsgId, prevMsgId ); - // Previous message is displayed in this view through doactivate, because view is re-activate by mail list - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::UpdateMessagePtrL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::UpdateMessagePtrL( TFSMailMsgId aNewMailboxId, - TFSMailMsgId aNewFolderId, - TFSMailMsgId aNewMessageId ) - { - FUNC_LOG; - TBool messageChanged = ETrue; - - if ( iMessage ) - { - // Check is the message going to be changed or are we just updating the - // same message object which has been previously shown. - messageChanged = ( iMessage->GetMessageId() != aNewMessageId ); - - // stop observing downloads from the previous message in case the message was changed - if ( iAppUi.DownloadInfoMediator() && messageChanged ) - { - iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); - } - delete iMessage; - iMessage = NULL; - PopMessage(); - } - - iMessage = iAppUi.GetMailClient()->GetMessageByUidL( aNewMailboxId, - aNewFolderId, - aNewMessageId, - EFSMsgDataEnvelope ); - if ( iMessage ) - { - - UpdateMessagePtr( iMessage ); - // Update the open messages stack. - EraseMessageStack(); // takes care of deallocating any previous messages - PushMessageL( iMessage, EFalse ); // this is non-embedded message - // Opened to viewer -> set message as read - if ( !iMessage->IsFlagSet( EFSMsgFlag_Read ) ) - { - iMessage->SetFlag( EFSMsgFlag_Read ); - iMessage->SaveMessageL(); // Save read status - // Notify appui of changed mail item, it seems that protocols don't do this - SendEventToAppUiL( TFSEventMailChanged ); - } - // Start observing attachment downloads from the new message - if ( iAppUi.DownloadInfoMediator() && messageChanged ) - { - iAppUi.DownloadInfoMediator()->AddObserver( this, iMessage->GetMessageId() ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::UpdateMessagePtr -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::UpdateMessagePtr( CFSMailMessage* aNewMessagePtr ) - { - ASSERT( aNewMessagePtr ); - - TBool messageChanged = ETrue; - - // Stop observing any previous message and update iMessage pointer - if ( iMessage ) - { - // Check is the message going to be changed or are we just updating the - // same message object which has been previously shown. - messageChanged = ( iMessage->GetMessageId() != aNewMessagePtr->GetMessageId() ); - - // stop observing downloads from the previous message in case the message was changed - if ( iAppUi.DownloadInfoMediator() && messageChanged ) - { - iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); - } - } - iMessage = aNewMessagePtr; - - // Start observing attachment downloads from the new message - if ( iAppUi.DownloadInfoMediator() && messageChanged ) - { - iAppUi.DownloadInfoMediator()->AddObserver( this, iMessage->GetMessageId() ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::PushMessageL -// Message stack handling. Ownership of message is transferred when succesful. -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::PushMessageL( CFSMailMessage* aMessage, TBool aIsEmbedded ) - { - if ( !iOpenMessages || !iEmbeddedMessages ) - { - User::Leave( KErrNotReady ); - } - - // We must ensure that push is done succesfully either to both stacks or to neither one. - if ( aIsEmbedded ) - { - iEmbeddedMessages->PushL( aMessage ); - } - else - { - iEmbeddedMessages->PushL( NULL ); - } - TRAPD( err, iOpenMessages->PushL( aMessage ) ); - if ( err ) - { - iEmbeddedMessages->Pop(); - User::Leave( err ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::PopMessage -// Message stack handling. Ownership of message is returned. -// ----------------------------------------------------------------------------- -// -CFSMailMessage* CFSEmailUiMailViewerVisualiser::PopMessage() - { - ASSERT( iOpenMessages && iEmbeddedMessages ); - ASSERT( iOpenMessages->Count() == iEmbeddedMessages->Count() ); - - CFSMailMessage* msg = NULL; - if ( !iOpenMessages->IsEmpty() ) - { - msg = iOpenMessages->Pop(); - } - if ( !iEmbeddedMessages->IsEmpty() ) - { - iEmbeddedMessages->Pop(); - } - return msg; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::EraseMessageStack -// Message stack handling. All messages in stack are deallocated -// ----------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::EraseMessageStack() - { - ASSERT( iOpenMessages && iEmbeddedMessages ); - ASSERT( iOpenMessages->Count() == iEmbeddedMessages->Count() ); - - iOpenMessages->ResetAndDestroy(); - iEmbeddedMessages->Reset(); - } -// CFSEmailUiMailViewerVisualiser::NavigateBackL -// Overriden from base class -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::NavigateBackL() - { - FUNC_LOG; - // clean up current message - if ( iMessage && iAppUi.DownloadInfoMediator() ) - { - iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); - } - delete iMessage; - iMessage = NULL; - PopMessage(); - // Return to previous message in the stack if there is still some left - if ( !iOpenMessages->IsEmpty() ) - { - iAppUi.EnterFsEmailViewL( MailViewerId, KStartViewerReturnFromEmbeddedMsg, KNullDesC8 ); - } - // In usual case we use the base view implementation - else - { - CFsEmailUiViewBase::NavigateBackL(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleDynamicVariantSwitchL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType /*aType*/ ) - { - FUNC_LOG; - // Set scroll offset to match screen height - if ( iFirstStartCompleted && iTextViewer && iMessage ) - { - // - TInt firstLine = iTextViewer->GetFirstDisplayedLine(); // get first line number - TInt firstChar = iTextViewer->GetFirstCharInLine(firstLine); // get first char offset - // - - iAppUi.Display().Roster().Hide( ControlGroup() ); - RefreshL(); - - // - TInt newLine = iTextViewer->GetLineNumber(firstChar); // get the new line number for this offset - if(newLine<0) newLine = firstLine; // in case of error go to the prev. line number - iTextViewer->FocusLineL(newLine,ETrue); // focus on the found line number - // - // - SetActionMenuIconVisbilityL(); - // - iAppUi.Display().Roster().ShowL( ControlGroup() ); - iDownloadProgressIndicator->NotifyLayoutChange(); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::HandleDynamicVariantSwitchOnBackgroundL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType /*aType*/ ) - { - FUNC_LOG; - iLayoutChangedWhileNotActive = ETrue; - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OpenLinkInIntranetL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::OpenLinkInIntranetL( TBool aMenuSelection ) - { - FUNC_LOG; - CFindItemEngine::SFoundItem currentBodyHotSpotData; - TBool bodyHotSpotFound = iViewerRichText->FindCurrentBodyHotSpotL( currentBodyHotSpotData ); - if ( bodyHotSpotFound ) - { - HBufC* intranetUrl = iViewerRichText->GetHotspotTextLC( currentBodyHotSpotData ); - TInt len = intranetUrl->Length(); - HBufC8* eightBitUrl = HBufC8::NewLC( len ); - eightBitUrl->Des().Copy( *intranetUrl ); - - TAiwGenericParam param( EGenericParamURL, TAiwVariant(*eightBitUrl) ); - CAiwGenericParamList& paramList = iIBServiceHandler->InParamListL(); - paramList.AppendL( param ); - if ( aMenuSelection ) - { - iIBServiceHandler->ExecuteMenuCmdL( EFsEmailUiCmdActionsOpenInIntranetMenu, - paramList, iIBServiceHandler->OutParamListL() ); - } - else - { - iIBServiceHandler->ExecuteServiceCmdL( KAiwCmdView, - paramList, iIBServiceHandler->OutParamListL() ); - } - CleanupStack::PopAndDestroy( eightBitUrl ); - CleanupStack::PopAndDestroy( intranetUrl ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::ChangeMsgReadStatusL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::ChangeMsgReadStatusL( - TBool aRead, TBool aCmdFromMrui ) - { - FUNC_LOG; - if ( iMessage && !iEmbeddedMessageMode ) - { - if ( aRead ) - { - // Send flags, local and server - iMessage->SetFlag( EFSMsgFlag_Read ); - } - else - { - // Send flags, local and server - iMessage->ResetFlag( EFSMsgFlag_Read ); - } - iMessage->SaveMessageL(); // Save read status - SendEventToAppUiL( TFSEventMailChanged ); - - if ( !aCmdFromMrui && iViewerRichText && iTextViewer ) - { - iViewerRichText->UpdateIconL( - CFSEmailUiMailViewerRichText::EViewerEmailStatus ); - TInt iconLine = iViewerRichText->EmailStatusIconLine(); - iTextViewer->ReloadPicturesL( iconLine ); - } - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::OpenHotSpotUrlInBrowserL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::OpenHotSpotUrlInBrowserL( CFindItemEngine::SFoundItem& aHotSpot ) - { - FUNC_LOG; - if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchURLBin || - aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) // Scheme is needed also - { - // use browser launcher API here - HBufC* urlToOpen = iViewerRichText->GetHotspotTextLC( aHotSpot ); - // Check if the address is rtsp url and send it media player - if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme && - urlToOpen->FindC( KRtspUrlPrefix ) == 0 ) - { - RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - TThreadId id; - appArcSession.StartDocument( urlToOpen->Des(), KUidMediaPlayer , id ); - appArcSession.Close(); - } - else - { - // Check wheter the url text has some prefix (http, https, ftp, etc.). - // If no prefix found, try with the default prefix http. - TInt urlPos = urlToOpen->Find( KUrlPrefixIdentifier ); - if ( urlPos == KErrNotFound ) - { - HBufC* newBuf = urlToOpen->ReAllocL( urlToOpen->Length() + KHttpUrlPrefix().Length() ); - CleanupStack::Pop( urlToOpen ); - urlToOpen = newBuf; - CleanupStack::PushL( urlToOpen ); - TPtr urlToOpenPtr = urlToOpen->Des(); - urlToOpenPtr.Insert( 0, KHttpUrlPrefix ); - } - - // Use scheme handler to launch the browser as a stand alone application - CSchemeHandler* handler = CSchemeHandler::NewL( *urlToOpen ); - CleanupStack::PushL( handler ); - handler->HandleUrlStandaloneL(); - CleanupStack::PopAndDestroy( handler ); - } - - CleanupStack::PopAndDestroy( urlToOpen ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::CallToBodyHotSpotNumberL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::CallToBodyHotSpotNumberL( CFindItemEngine::SFoundItem& aHotSpot ) - { - FUNC_LOG; - - if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - HBufC* phoneNumber = iViewerRichText->GetHotspotTextLC( aHotSpot ); - TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( - R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, *phoneNumber ); - if ( answer ) - { - TPtr numberPtr = phoneNumber->Des(); - CommonPhoneParser::ParsePhoneNumber( numberPtr, - CommonPhoneParser::EPhoneClientNumber); - - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->MakeAiwCallL( NULL, *phoneNumber ); - } - CleanupStack::PopAndDestroy( phoneNumber ); - } - else if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) - { - TBool voipCall( EFalse ); - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); - // Strip scheme prefix text if found - if ( schemeText && schemeText->FindC( KCallPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KCallPrefix().Length() ); - } - else if ( schemeText && schemeText->FindC( KTelPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KTelPrefix().Length() ); - } - else if ( schemeText && schemeText->FindC( KSmsPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KSmsPrefix().Length() ); - } - else if ( schemeText && schemeText->FindC( KMmsPrefix ) == 0 ) - { - schemeText->Des().Delete( 0, KMmsPrefix().Length() ); - } - else if ( schemeText && schemeText->FindC( KVoipPrefix ) == 0 ) - { - voipCall = ETrue; - schemeText->Des().Delete( 0, KVoipPrefix().Length() ); - } - - TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( - R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, *schemeText ); - if ( answer ) - { - if ( !voipCall ) - { - // use common phone parser for other than voip numbers - TPtr numberPtr = schemeText->Des(); - CommonPhoneParser::ParsePhoneNumber( numberPtr, - CommonPhoneParser::EPhoneClientNumber ); - } - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->MakeAiwCallL( NULL, *schemeText, voipCall ); - } - CleanupStack::PopAndDestroy( schemeText ); - } - } - -// ----------------------------------------------------------------------------- -// CFSEmailUiMailViewerVisualiser::WriteEmailToHotSpotAddressL -// ----------------------------------------------------------------------------- -void CFSEmailUiMailViewerVisualiser::WriteEmailToHotSpotAddressL( CFindItemEngine::SFoundItem& aHotSpot ) - { - FUNC_LOG; - if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin ) - { - delete iNewMailTempAddress; iNewMailTempAddress = NULL; - iNewMailTempAddress = CFSMailAddress::NewL(); - HBufC* mailAddress = iViewerRichText->GetHotspotTextLC( aHotSpot ); - iNewMailTempAddress->SetEmailAddress( *mailAddress ); - CleanupStack::PopAndDestroy( mailAddress ); - iAppUi.LaunchEditorL( iNewMailTempAddress ); - } - else if ( aHotSpot.iItemType == CFindItemEngine::EFindItemSearchScheme ) - { - HBufC* schemeText = iViewerRichText->GetHotspotTextLC( aHotSpot ); - if ( schemeText && schemeText->FindC( KMailtoPrefix ) == 0) - { - schemeText->Des().Delete( 0, KMailtoPrefix().Length() ); - delete iNewMailTempAddress; iNewMailTempAddress = NULL; - iNewMailTempAddress = CFSMailAddress::NewL(); - iNewMailTempAddress->SetEmailAddress( *schemeText ); - iAppUi.LaunchEditorL( iNewMailTempAddress ); - } - CleanupStack::PopAndDestroy( schemeText ); - } - } - -void CFSEmailUiMailViewerVisualiser::SaveEmailAsContactL( - const TDesC& aEmailAddress ) - { - FUNC_LOG; - TAddToContactsType type; - // Query to "update existing" or "Create new" - // --> EFALSE = user chose "cancel" - if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> - AddtoContactsQueryL( type ) ) - { - // Create buffer and strip scheme data such as mailto: and call: - HBufC* textData = aEmailAddress.AllocLC(); - if ( textData->FindC( KMailtoPrefix ) == 0 ) - { - textData->Des().Delete( 0, KMailtoPrefix().Length() ); - } - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( - *textData, EContactUpdateEmail, type, this ); - CleanupStack::PopAndDestroy( textData ); - } - } - -void CFSEmailUiMailViewerVisualiser::SavePhoneNumberAsContactL( - const TDesC& aPhoneNumber ) - { - FUNC_LOG; - TAddToContactsType type; - // Query to "update existing" or "Create new" - // --> EFALSE = user chose "cancel" - if ( CFsDelayedLoader::InstanceL()->GetContactHandlerL()-> - AddtoContactsQueryL( type ) ) - { - // Create buffer and strip scheme data such as mailto: and call: - HBufC* textData = aPhoneNumber.AllocLC(); - // Strip scheme prefix text if found - if ( textData && textData->FindC( KCallPrefix ) == 0 ) - { - textData->Des().Delete( 0, KCallPrefix().Length() ); - } - else if ( textData && textData->FindC( KTelPrefix ) == 0 ) - { - textData->Des().Delete( 0, KTelPrefix().Length() ); - } - else if ( textData && textData->FindC( KSmsPrefix ) == 0 ) - { - textData->Des().Delete( 0, KSmsPrefix().Length() ); - } - else if ( textData && textData->FindC( KMmsPrefix ) == 0 ) - { - textData->Des().Delete( 0, KMmsPrefix().Length() ); - } - CFsDelayedLoader::InstanceL()->GetContactHandlerL()->AddToContactL( - *textData, EContactUpdateNumber, type, this ); - CleanupStack::PopAndDestroy( textData ); - } - } - - -void CFSEmailUiMailViewerVisualiser::FlagselectionCompleteL( TInt aSelection ) - { - FUNC_LOG; - // Set message follow up flag - if ( iMessage && aSelection != KErrNotFound ) - { - switch ( aSelection ) - { - case EFollowUp: - { - iMessage->SetFlag( EFSMsgFlag_FollowUp ); - iMessage->ResetFlag( EFSMsgFlag_FollowUpComplete ); - iMessage->SaveMessageL(); - } - break; - case EFollowUpComplete: - { - iMessage->SetFlag( EFSMsgFlag_FollowUpComplete ); - iMessage->ResetFlag( EFSMsgFlag_FollowUp ); - iMessage->SaveMessageL(); - } - break; - case EFollowUpClear: - { - iMessage->ResetFlag( EFSMsgFlag_FollowUp | EFSMsgFlag_FollowUpComplete ); - iMessage->SaveMessageL(); - } - break; - default: - break; - } - } - } - - -void CFSEmailUiMailViewerVisualiser::SetMailboxNameToStatusPaneL() - { - FUNC_LOG; - iAppUi.SetActiveMailboxNameToStatusPaneL(); - } - -void CFSEmailUiMailViewerVisualiser::GetParentLayoutsL( RPointerArray& aLayoutArray ) const - { - if ( iTextViewer ) - { - aLayoutArray.AppendL( iTextViewer->RootLayout() ); - } - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::UpdateNaviPaneL( TBool aForESMR ) - { - FUNC_LOG; - // Get navigation decorator for mail viewer - CAknNavigationDecorator* naviDecorator = iAppUi.NaviDecoratorL( MailViewerId ); - if ( naviDecorator ) - { - // Check if there's next and previous message available, and set - // the navipane arrows accordingly - TFSMailMsgId currentMsgId = iMessage->GetMessageId(); - TFSMailMsgId tmpMsgId; - TFSMailMsgId tmpMsgFolderId; - if ( iAppUi.IsNextMsgAvailable( currentMsgId, tmpMsgId, tmpMsgFolderId ) ) - { - naviDecorator->SetScrollButtonDimmed( CAknNavigationDecorator::ERightButton, EFalse ); - } - else - { - naviDecorator->SetScrollButtonDimmed( CAknNavigationDecorator::ERightButton, ETrue ); - } - if ( iAppUi.IsPreviousMsgAvailable( currentMsgId, tmpMsgId, tmpMsgFolderId ) ) - { - naviDecorator->SetScrollButtonDimmed( CAknNavigationDecorator::ELeftButton, EFalse ); - } - else - { - naviDecorator->SetScrollButtonDimmed( CAknNavigationDecorator::ELeftButton, ETrue ); - } - - // Set this view's navipane to the top of the navipane control stack - CAknNavigationControlContainer* naviPaneContainer = - static_cast( - StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - naviPaneContainer->PushL( *naviDecorator ); - naviDecorator->SetNaviDecoratorObserver( aForESMR ? NULL : this ); - } - - // Set priority and follow-up flags - CCustomStatuspaneIndicators* indicators = iAppUi.GetStatusPaneIndicatorContainer(); - if ( indicators) - { - indicators->ShowStatusPaneIndicators(); - - if ( iMessage->IsFlagSet( EFSMsgFlag_Low ) ) - { - indicators->SetPriorityFlag( EMsgPriorityLow ); - } - else if ( iMessage->IsFlagSet( EFSMsgFlag_Important ) ) - { - indicators->SetPriorityFlag( EMsgPriorityHigh ); - } - else - { - indicators->SetPriorityFlag( EMsgPriorityNormal ); - } - - CCustomStatuspaneIndicators::TFollowUpFlagType flagType = CCustomStatuspaneIndicators::EFollowUpNone; - if (iMessage->IsFlagSet(EFSMsgFlag_FollowUp)) - { - flagType = CCustomStatuspaneIndicators::EFollowUp; - } - if (iMessage->IsFlagSet(EFSMsgFlag_FollowUpComplete)) - { - flagType = CCustomStatuspaneIndicators::EFollowUpComplete; - } - indicators->SetFollowUpFlag( flagType ); - - indicators->DrawNow(); - } - - } - -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::HandleNaviDecoratorEventL( TInt aEventID ) - { - FUNC_LOG; - CAknNavigationDecorator* naviDecorator = iAppUi.NaviDecoratorL( MailViewerId ); - if ( naviDecorator ) - { - naviDecorator->SetNaviDecoratorObserver( NULL ); - } - if( aEventID == MAknNaviDecoratorObserver::EAknNaviDecoratorEventRightTabArrow ) - { - ShowNextMessageL(); - } - else - { - ShowPreviousMessageL(); - } - } - -// --------------------------------------------------------------------------- -// HandleMailBoxEventL -// Mailbox event handler, responds to events sent by the plugin. -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailViewerVisualiser::HandleMailBoxEventL( TFSMailEvent aEvent, - TFSMailMsgId aMailbox, TAny* aParam1, TAny* /*aParam2*/, TAny* /*aParam3*/ ) - { - FUNC_LOG; - if ( iFirstStartCompleted && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() && - aEvent == TFSEventMailDeleted && aParam1 ) // Safety, in list events that only concern active mailbox are handled - { - TFSMailMsgId curMsgId = iMessage->GetMessageId(); - RArray* removedEntries = static_cast*>(aParam1); - for ( TInt i=0 ; i < removedEntries->Count() ; i++ ) - { - // - if ( (curMsgId == (*removedEntries)[i]) && - (iDeletedMessageFromMrui != curMsgId) ) - { - // - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - NavigateBackL(); - break; - } - } - } - } - -void CFSEmailUiMailViewerVisualiser::SendEventToAppUiL( TFSMailEvent aEventType ) - { - RArray msgIdArray; - CleanupClosePushL( msgIdArray ); - msgIdArray.AppendL( iMessage->GetMessageId() ); - TFSMailMsgId folderId = iMessage->GetFolderId(); - iAppUi.EventL( aEventType, - iAppUi.GetActiveMailboxId(), - &msgIdArray, &folderId, NULL ); - CleanupStack::PopAndDestroy( &msgIdArray ); - } - -////////////////////////////////////////////////////////////////////////////////////// -// CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE -/////////////////////////////////////////////////////////////////////////////////// -CFlagSelectionGlobalNoteHandler* CFlagSelectionGlobalNoteHandler::NewL( CFSEmailUiMailViewerVisualiser& aViewerVisualiser ) - { - FUNC_LOG; - CFlagSelectionGlobalNoteHandler* self = - new (ELeave) CFlagSelectionGlobalNoteHandler( aViewerVisualiser ); - return self; - } - - -CFlagSelectionGlobalNoteHandler::~CFlagSelectionGlobalNoteHandler() - { - FUNC_LOG; - delete iPrompt; - delete iGlobalFlagQuery; - } - -void CFlagSelectionGlobalNoteHandler::Cancel() - { - FUNC_LOG; - } - -void CFlagSelectionGlobalNoteHandler::LaunchFlagListQueryDialogL() - { - FUNC_LOG; - iSelection = 0; - if ( !iPrompt ) - { - iPrompt = StringLoader::LoadL( R_FREESTYLE_EMAIL_UI_VIEWER_FLAG_DIALOG_HEADER ); - } - if ( !iGlobalFlagQuery ) - { - iGlobalFlagQuery = CAknGlobalListQuery::NewL(); - iGlobalFlagQuery->SetHeadingL( *iPrompt ); // Set query heading. - } - - CDesCArrayFlat* array = new (ELeave) CDesCArrayFlat( 3 ); - CleanupStack::PushL( array ); - // Add follow up text - HBufC* followUp = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FLAG_FOLLOW_UP ); - array->AppendL( *followUp ); - CleanupStack::PopAndDestroy( followUp ); - - // Add flag complete text - HBufC* completeFlag = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FLAG_COMPLETE ); - array->AppendL( *completeFlag ); - CleanupStack::PopAndDestroy( completeFlag ); - - // Add clear flag text - HBufC* clearFlag = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_FLAG_CLEAR ); - array->AppendL( *clearFlag ); - CleanupStack::PopAndDestroy( clearFlag ); - - // Show query - iGlobalFlagQuery->ShowListQueryL( array, iStatus, iSelection ); - CleanupStack::PopAndDestroy( array ); - - // Set active - SetActive(); - } - -void CFlagSelectionGlobalNoteHandler::RunL() - { - FUNC_LOG; - TInt status = iStatus.Int(); - iViewerVisualiser.FlagselectionCompleteL( status ); - } - -void CFlagSelectionGlobalNoteHandler::DoCancel() - { - FUNC_LOG; - } - -TInt CFlagSelectionGlobalNoteHandler::RunError( TInt /*aError*/ ) - { - FUNC_LOG; - TInt err( KErrNone ); - return err; - } - -CFlagSelectionGlobalNoteHandler::CFlagSelectionGlobalNoteHandler( CFSEmailUiMailViewerVisualiser& aViewerVisualiser ) - : CActive ( EPriorityHigh ), - iViewerVisualiser( aViewerVisualiser ) - { - FUNC_LOG; - CActiveScheduler::Add( this ); - iSelection = 0; - } - diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -84,7 +84,6 @@ #include "FreestyleEmailUiAppui.h" #include "FreestyleEmailUi.hrh" #include "FreestyleEmailUiTextureManager.h" -#include "FreestyleEmailUiMailViewerVisualiser.h" #include "FreestyleEmailUiUtilities.h" #include "FreestyleEmailUiLiterals.h" #include "FreestyleEmailUiShortcutBinding.h" @@ -97,7 +96,7 @@ static const TInt KMaxLengthOfSearchString = 255; // s60 platform layouts //static const TInt KSearchIconWidth = 30; -const TReal KFSHeaderTextBackgroundOpacity = 0.3f; +//const TReal KFSHeaderTextBackgroundOpacity = 0.3f; // static const TInt KItemExpansionDelay = 400; static const TInt KListScrollingDelay = 200; @@ -154,9 +153,7 @@ iScreenAnchorLayout->SetFlags(EAlfVisualFlagAutomaticLocaleMirroringEnabled); SetSearchListLayoutAnchors(); - // Create top bar layout - iSearchTopBarLayout = CAlfDeckLayout::AddNewL( *iSearchListControl, iScreenAnchorLayout ); - iBarBgVisual = CAlfImageVisual::AddNewL( *iSearchListControl, iSearchTopBarLayout ); + /* paltform layout changes to cmail TAlfTimedValue barBgTextureOpacity; barBgTextureOpacity.SetValueNow( 1 ); @@ -507,7 +504,23 @@ aMenuPane->SetItemDimmed(EFsEmailUiCmdMailActions, EFalse); aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActions, ETrue); } - aMenuPane->SetItemDimmed(EFsEmailUiCmdOpen, EFalse); + + // showing of mail-related options is dependent on focus + // important for touch-only devices + if ( IsFocusShown() ) + { + aMenuPane->SetItemDimmed(EFsEmailUiCmdOpen, EFalse); + } + else + { + aMenuPane->SetItemDimmed(EFsEmailUiCmdMore, ETrue); + aMenuPane->SetItemDimmed(EFsEmailUiCmdMailActions, ETrue); + aMenuPane->SetItemDimmed(EFsEmailUiCmdCalActions, ETrue); + aMenuPane->SetItemDimmed(EFsEmailUiCmdOpen, ETrue); + } + + // remove message reader support because of problems with reading HTML mails + aMenuPane->SetItemDimmed(EFsEmailUiCmdReadEmail, ETrue); } } else @@ -1114,7 +1127,7 @@ aCommand == EFsEmailUiCmdMarkAsRead || aCommand == EFsEmailUiCmdMarkAsUnread || aCommand == EFsEmailUiCmdActionsMove || - aCommand == EFsEmailUiCmdMarkUnmarkToggle ) ) + aCommand == EFsEmailUiCmdMarkingModeFromPopUp ) ) { // We end up here if the user selects an option from the pop up menu // or exits the menu by tapping outside of it's area. @@ -1323,45 +1336,32 @@ void CFSEmailUiSearchListVisualiser::SetSearchListLayoutAnchors() { FUNC_LOG; - // Set anchors so that list leaves space for control bar + // Set anchors // The anchor layout mirrors itself automatically when necessary. // There's no need to mirror anything manually here. - // BAR BACGROUND IMAGE - TRect contBarRect = iAppUi.LayoutHandler()->GetControlBarRect(); - TPoint& tl( contBarRect.iTl ); + // TEXT + TRect textRect = iAppUi.LayoutHandler()->GetSearchListHeaderTextLayout().TextRect(); + TPoint tl = textRect.iTl; iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 0, EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint( tl.iX, tl.iY )); - TPoint& br( contBarRect.iBr ); + TPoint br = textRect.iBr; iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 0, EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint( br.iX, br.iY )); - // TEXT - TRect textRect = iAppUi.LayoutHandler()->GetSearchListHeaderTextLayout().TextRect(); - tl = textRect.iTl; + TRect listRect = iAppUi.LayoutHandler()->GetListRect( ETrue ); iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 1, EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, - TAlfTimedPoint( tl.iX, tl.iY )); - br = textRect.iBr; + TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY)); iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, - TAlfTimedPoint( br.iX, br.iY )); - - TRect listRect = iAppUi.LayoutHandler()->GetListRect( ETrue ); - iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 2, - EAlfAnchorOriginLeft, EAlfAnchorOriginTop, - EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, - TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY)); - iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 2, - EAlfAnchorOriginLeft, EAlfAnchorOriginTop, - EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint(listRect.iBr.iX, listRect.iBr.iY)); } @@ -2564,16 +2564,6 @@ iBarTextVisual->SetColor( iAppUi.LayoutHandler()-> ListNormalStateTextSkinColor() ); - if( iBarBgVisual->Brushes() ) - { - iBarBgVisual->Brushes()->Reset(); - } - iBarBgVisual->EnableBrushesL(); - CAlfBrush* selectorBrush = iAppUi.FsTextureManager()-> - NewCtrlBarSelectorBrushLC(); - selectorBrush->SetOpacity( KFSHeaderTextBackgroundOpacity ); - iBarBgVisual->Brushes()->AppendL( selectorBrush, EAlfHasOwnership ); - CleanupStack::Pop( selectorBrush ); } // diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -434,8 +434,6 @@ // header and dividers CreateListSkeletonL(); - //moved from CreateListSkeletonL(); - SetupTitlePaneTextL(); // list model items CreateListItemsL(); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -60,7 +60,7 @@ #include "FreestyleEmailUiShortcutBinding.h" #include "FreestyleEmailUiUtilities.h" #include "FSEmail.pan" -#include "fsemailstatuspaneindicatorhandler.h" + // CONSTANTS @@ -1589,8 +1589,8 @@ iWaitDialog->SetCallback( this ); iWaitDialog->RunLD(); - //emailindicator handling, we dont care if something goes wrong in the mailindicator update. - TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( mailBox->GetId().Id())); + //emailindicator handling, is removed from 9.2 + //TRAP_IGNORE(TFsEmailStatusPaneIndicatorHandler::StatusPaneMailIndicatorHandlingL( mailBox->GetId().Id())); // delete mailbox and wait event (RequestResponseL) iDeleteMailboxId = iMailClient.DeleteMailBoxByUidL( mailBox->GetId(), *this ); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp --- a/emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -71,7 +71,14 @@ { 0, 'I', 0, EFsEmailUiCmdActionsCollapseAll }, { 0, 'I', 0, EFsEmailUiCmdActionsExpandAll }, - { 0, 0, 0, EFsEmailUiCmdMarkUnmarkToggle }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeFromPopUp }, + { 0, 0, 0, EFsEmailUiCmdMarkingMode }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeDelete }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeUnread }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeRead }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeMove }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeFollowUp }, + { 0, 0, 0, EFsEmailUiCmdMarkingModeMarkAll }, { 0, 0, 0, EFsEmailUiCmdMarkMark }, { 0, 0, 0, EFsEmailUiCmdMarkUnmark } }; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp --- a/emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -348,6 +348,20 @@ } // ----------------------------------------------------------------------------- +// CFreestyleEmailUiTextureManager::NewMailListMarkingModeBgBrushLC +// ----------------------------------------------------------------------------- +// +CAlfImageBrush* CFreestyleEmailUiTextureManager::NewMailListMarkingModeBgBrushLC() + { + FUNC_LOG; + CAlfTexture& circle = TextureByIndex( EMarkingModeBackgroundIcon ); + CAlfImageBrush* bgBrush = CAlfImageBrush::NewLC( *iEnv, TAlfImage(circle) ); + bgBrush->SetLayer( EAlfBrushLayerBackground ); + bgBrush->SetScaleMode( CAlfImageVisual::EScaleNormal ); + return bgBrush; + } + +// ----------------------------------------------------------------------------- // CFreestyleEmailUiTextureManager::NewControlBarListBgBrushLC // ----------------------------------------------------------------------------- // @@ -655,6 +669,16 @@ } break; + case EListTextureCreateNewMessageIcon: + { + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_cmail_action_create_msg, + EMbmFreestyleemailuiQgn_prop_cmail_action_create_msg_mask ); + } + break; + // MESSAGE TEXTURE READING STARTS HERE // case EMessageReadIcon: @@ -1725,7 +1749,22 @@ KRgbBlack ); } break; - + case EMarkingModeBackgroundIcon: + { + TRect mailListRect(iAppUi->LayoutHandler()->GetListRect()); + if ( mailListRect.Width() > mailListRect.Height() ) + { + iconSize.SetSize( mailListRect.Width(), mailListRect.Width() ); + } + else + { + iconSize.SetSize( mailListRect.Height(), mailListRect.Height() ); + } + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiCmail_marking_mode_bg, + EMbmFreestyleemailuiCmail_marking_mode_bg); + } + break; case EGridAboutTexture: default: // Branded mailbox icon @@ -1917,14 +1956,12 @@ break; case EListTextureControlButton: ; break; case EListTextureMailboxDefaultIcon: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EListTextureMailboxDefaultIcon, this, EAlfTextureFlagDefault); break; - case EListTextureNewEmailDefaultIcon: + case EListTextureNewEmailDefaultIcon: + case EListTextureCreateNewMessageIcon: { - iTextures[aTextureId] = - &CAlfStatic::Env().TextureManager().CreateTextureL( - EListTextureNewEmailDefaultIcon, this, - EAlfTextureFlagDefault ); - break; + iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( aTextureId, this, EAlfTextureFlagDefault ); } + break; case EListControlBarMailboxDefaultIcon: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EListControlBarMailboxDefaultIcon, this, EAlfTextureFlagDefault); break; case EBackgroundTextureViewerHeading: ; break; case EBackgroundTextureBar: ; break; @@ -1970,6 +2007,12 @@ iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EControlBarDescendingArrowTexture, this, EAlfTextureFlagSkinContent); } break; + case EMarkingModeBackgroundIcon: + { + iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EMarkingModeBackgroundIcon, this, EAlfTextureFlagRetainResolution); + } + break; + // MESSAGE TEXTURES case EMessageReadIcon: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EMessageReadIcon, this, EAlfTextureFlagDefault); break; case EMessageLowPrioReadIcon: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EMessageLowPrioReadIcon, this, EAlfTextureFlagDefault); break; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleEmailUiViewBase.cpp --- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -100,6 +100,16 @@ // Clear the flag of long transition effect SetNextTransitionOutLong( EFalse ); + + // Clear status pane indicators + CCustomStatuspaneIndicators* indicators = + iAppUi.GetStatusPaneIndicatorContainer(); + if ( indicators ) + { + indicators->ClearStatusPaneFlags(); + indicators->HideStatusPaneIndicators(); + } + UpdateToolbarL(); // Make sure Alfred display is of correct size (there is some problems with toolbar) diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -971,15 +971,8 @@ iWriteStream.WriteL( *attnName8 ); CleanupStack::PopAndDestroy( attnName8 ); - TUint size = aAttachment.ContentSize(); - TUint sizeInKB = size / 1024; - - if ( size % 1024 ) - { - // round up - ++sizeInKB; - } - + HBufC* sizeDesc = TFsEmailUiUtility::CreateSizeDescLC(aAttachment.ContentSize(), EFalse); + TBuf8<32> sizeText; // Add right to left marker as "(" and ")" are messing up the html language markers @@ -992,9 +985,8 @@ sizeText.Append( KSpace8 ); sizeText.Append( _L8("(") ); - sizeText.AppendNum( sizeInKB ); - sizeText.Append( KSpace8 ); - sizeText.Append( KAttachmentSizeUnit ); + sizeText.Append( sizeDesc->Des() ); + CleanupStack::PopAndDestroy( sizeDesc ); sizeText.Append( _L8(")") ); if( iMirrorLayout ) diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -245,7 +245,10 @@ { // Probably, only the headers were downloaded. Check if attachments // were downloaded later. - iAttachmentsListModel->UpdateListL( iMailMessage ); + if( iMailMessage ) + { + iAttachmentsListModel->UpdateListL( iMailMessage ); + } for (TInt i=0; iGetModel().Count(); i++) { if ( iAttachmentsListModel->GetModel()[i].partData.iMessagePartId.Id() == id ) diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/cmailcustomstatuspaneindicators.cpp --- a/emailuis/emailui/src/cmailcustomstatuspaneindicators.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/cmailcustomstatuspaneindicators.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -323,14 +323,22 @@ } // --------------------------------------------------------------------------- +// CCustomStatuspaneIndicators::ClearStatusPaneFlags +// --------------------------------------------------------------------------- +// +void CCustomStatuspaneIndicators::ClearStatusPaneFlags() + { + SetPriorityFlag( EMsgPriorityNormal ); + SetFollowUpFlag( EFollowUpNone ); + } + +// --------------------------------------------------------------------------- // CCustomStatuspaneIndicators::HideStatusPaneIndicatorsL // --------------------------------------------------------------------------- // void CCustomStatuspaneIndicators::HideStatusPaneIndicators() { MakeVisible( EFalse ); - SetPriorityFlag( EMsgPriorityNormal ); - SetFollowUpFlag( EFollowUpNone ); DrawNow(); } @@ -342,12 +350,20 @@ { MakeVisible( ETrue ); TRAP_IGNORE( DoSetRectL() ); - SetPriorityFlag( EMsgPriorityNormal ); - SetFollowUpFlag( EFollowUpNone ); DrawNow(); } // --------------------------------------------------------------------------- +// CCustomStatuspaneIndicators::Draw +// --------------------------------------------------------------------------- +// +void CCustomStatuspaneIndicators::Draw( const TRect& aRect ) const + { + SystemGc().SetBrushColor( KRgbTransparent ); + SystemGc().Clear( aRect ); + } + +// --------------------------------------------------------------------------- // CCustomStatuspaneIndicators::CheckScrollButtonState // --------------------------------------------------------------------------- // diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/fsemailstatuspaneindicatorhandler.cpp --- a/emailuis/emailui/src/fsemailstatuspaneindicatorhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/fsemailstatuspaneindicatorhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -90,7 +90,11 @@ CFreestyleEmailUiAppUi* appUi = static_cast( CCoeEnv::Static()->AppUi() ); //Write the name commonEmailRepository - commonEmailRepository->Set(KCmailNewEmailDisplayText,appUi->GetMailClient()->GetMailBoxByUidL(prevMboxId)->GetName()); + CFSMailBox* prevMbox = appUi->GetMailClient()->GetMailBoxByUidL( prevMboxId ); + if ( prevMbox ) + { + commonEmailRepository->Set( KCmailNewEmailDisplayText, prevMbox->GetName() ); + } } } if(numberOfMailboxes == 0) diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/ncsaddressinputfield.cpp --- a/emailuis/emailui/src/ncsaddressinputfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/ncsaddressinputfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -506,9 +506,10 @@ TInt ret( EFalse ); TInt htLine = iTextEditor->GetLineHeightL(); TInt numLinesDesired = aDesirableEdwinSize.iHeight / htLine; - CEikScrollBarFrame& scrollBarFrame( *iTextEditor->CreateScrollBarFrameL() ); + // commented because of EGWG-83ECSR, no negative feedback after removing + //CEikScrollBarFrame& scrollBarFrame( *iTextEditor->CreateScrollBarFrameL() ); iEditorLineCount = numLinesDesired; - scrollBarFrame.SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); + //scrollBarFrame.SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); if ( iSizeObserver ) { ret = iSizeObserver->UpdateFieldSizeL(); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/ncsaifeditor.cpp --- a/emailuis/emailui/src/ncsaifeditor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/ncsaifeditor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -588,7 +588,7 @@ // First, add all the addresses without updating the editor text contents for ( TInt i=0 ; iDocumentLength() ) diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/ncscomposeview.cpp --- a/emailuis/emailui/src/ncscomposeview.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/ncscomposeview.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -949,9 +949,16 @@ { // show the toolbar UpdateToolbarL(); - if ( Toolbar() && Toolbar()->ToolbarExtension() ) + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) { - Toolbar()->ToolbarExtension()->SetShown( ETrue ); + CAknToolbarExtension* extension = + static_cast( + toolbar->ControlOrNull( EFsEmailUiTbCmdExpandInsert ) ); + if ( extension ) + { + extension->SetShown( ETrue ); + } } } else diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/ncseditor.cpp --- a/emailuis/emailui/src/ncseditor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/ncseditor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -70,8 +70,7 @@ CEikEdwin::EAvkonEditor | CEikEdwin::EResizable | CEikEdwin::ENoAutoSelection | CEikEdwin::EInclusiveSizeFixed | CEikEdwin::ENoHorizScrolling | CEikRichTextEditor::EPasteAsPlainText ); - - EnableKineticScrollingL( ETrue ); + iGlobalCharFormat = CCharFormatLayer::NewL(); iGlobalCharFormat->SetBase( GlobalText()->GlobalCharFormatLayer() ); GlobalText()->SetGlobalCharFormat( iGlobalCharFormat ); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/ncsheadercontainer.cpp --- a/emailuis/emailui/src/ncsheadercontainer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/ncsheadercontainer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -227,6 +227,7 @@ CCoeControlArray::TCursor cur = Components().End(); cur.Prev(); cur.Control()->SetFocus( ETrue, aDrawNow ); + iFocused = cur.Control(); } } @@ -961,6 +962,7 @@ focused->SetFocus( EFalse ); } iBccField->SetFocus( ETrue ); + iFocused = iBccField; iBccField->SelectAllTextL(); } } @@ -977,6 +979,7 @@ cur.Control()->SetFocus( ETrue ); } Components().Remove( iBccField ); + iFocused = iSubjectField; } TRAP_IGNORE( iFieldSizeObserver.UpdateFieldSizeL() ); @@ -1012,6 +1015,7 @@ focused->SetFocus( EFalse ); } iCcField->SetFocus( ETrue ); + iFocused = iCcField; iCcField->SelectAllTextL(); } } @@ -1023,6 +1027,7 @@ iToField->SetFocus( ETrue ); } Components().Remove( iCcField ); + iFocused = iToField; } TRAP_IGNORE( iFieldSizeObserver.UpdateFieldSizeL() ); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/emailui/src/ncssubjectfield.cpp --- a/emailuis/emailui/src/ncssubjectfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/emailui/src/ncssubjectfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -388,9 +388,10 @@ TInt ret( EFalse ); TInt htLine = iTextEditor->GetLineHeightL(); TInt numLinesDesired = aDesirableEdwinSize.iHeight / htLine; - CEikScrollBarFrame& scrollBarFrame( *iTextEditor->CreateScrollBarFrameL() ); + // commented because of EGWG-83ECSR, no negative feedback after removing + //CEikScrollBarFrame& scrollBarFrame( *iTextEditor->CreateScrollBarFrameL() ); iEditorLineCount = numLinesDesired; - scrollBarFrame.SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); + //scrollBarFrame.SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); if ( iSizeObserver ) { ret = iSizeObserver->UpdateFieldSizeL(); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/group/bld.inf --- a/emailuis/uicomponents/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -83,24 +83,19 @@ ../inc/fsfadeeffectobserver.h |../../inc/fsfadeeffectobserver.h ../inc/fsslideeffectobserver.h |../../inc/fsslideeffectobserver.h //../inc/fsactionmenudefines.h |../../..|../../../inc/fsactionmenudefines.h -// removed //../inc/fsactionmenu.h |../../..|../../../inc/fsactionmenu.h -// ../inc/fstextviewer.h |../../inc/fstextviewer.h ../inc/fstextviewerobserver.h |../../inc/fstextviewerobserver.h ../inc/fssmileydictionary.h |../../inc/fssmileydictionary.h ../inc/fstextviewerwatermark.h |../../inc/fstextviewerwatermark.h ../inc/fstextviewerkeys.h |../../inc/fstextviewerkeys.h -// +../inc/tuicscrollbarmodel.h |../../inc/tuicscrollbarmodel.h +../inc/muicscrollbar.h |../../inc/muicscrollbar.h -// ../conf/fsgenericui_2001E280.confml APP_LAYER_CONFML(fsgenericui_2001E280.confml) ../conf/fsgenericui_2001E280.crml APP_LAYER_CRML(fsgenericui_2001E280.crml) -// -// Export macros taken into use ../rom/fs_generic.iby CORE_APP_LAYER_IBY_EXPORT_PATH(fs_generic.iby) -// PRJ_MMPFILES fs_generic.mmp diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/group/fs_generic.mmp --- a/emailuis/uicomponents/group/fs_generic.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/group/fs_generic.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -102,6 +102,9 @@ SOURCE fsactionmenu.cpp SOURCE fsactionmenucontrol.cpp SOURCE fsalfwatermark.cpp +SOURCE cuicscrollbar.cpp +SOURCE cuicaknscrollbaradapter.cpp +SOURCE tuicscrollbarmodel.cpp APP_LAYER_SYSTEMINCLUDE SYSTEMINCLUDE /epoc32/include/icl @@ -137,4 +140,6 @@ LIBRARY flogger.lib LIBRARY aknphysics.lib LIBRARY cmaillogger.lib +LIBRARY aknicon.lib + DEFFILE fs_generic_alf.def diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/inc/cuicaknscrollbaradapter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/inc/cuicaknscrollbaradapter.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: cuicaknscrollbaradapter.h +* +*/ + +#ifndef C_UICAKNSCROLLBARADAPTER_H +#define C_UICAKNSCROLLBARADAPTER_H + +#include "muicscrollbar.h" +#include + +/** + * CUiCAknScrollBarAdapter + * + */ +NONSHARABLE_CLASS( CUiCAknScrollBarAdapter ) : + private CBase, + public MUiCScrollBar, + public MEikScrollBarObserver + { + +public: + + /** + * Leave safe constructor + */ + static MUiCScrollBar* NewL( MUiCScrollBar::MObserver& aObserver ); + +public: // from MUiCScrollBar + + /** + * @see MUiCScrollBar::Destroy + */ + virtual void Destroy(); + + /** + * @see MUiCScrollBar::Show + */ + virtual void Show( const TBool aShow ); + + /** + * @see MUiCScrollBar::UpdateModelL + */ + virtual void UpdateModelL( const TUiCScrollBarModel& aModel ); + + /** + * @see MUiCScrollBar::ThumbPosition + */ + virtual TInt ThumbPosition() const; + + /** + * @see MUiCScrollBar::SetRect + */ + virtual void SetRect( const TRect& aRect ); + + /** + * @see MUiCScrollBar::Redraw + */ + virtual void Redraw(); + + /** + * @see MUiCScrollBar::NotifyThemeChanged + */ + virtual void NotifyThemeChanged(); + + /** + * @see MUiCScrollBar::LayoutHints + */ + virtual TInt LayoutHints() const; + +public: // from MEikScrollBarObserver + + virtual void HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ); + +private: + + /** + * Constructor + */ + CUiCAknScrollBarAdapter( MUiCScrollBar::MObserver& aObserver ); + + /** + * Destructor + */ + ~CUiCAknScrollBarAdapter(); + + /** + * 2nd constructor + */ + void ConstructL(); + +private: + + // Scrollbar observer + MUiCScrollBar::MObserver& iObserver; + + // Scrollbar instance + CAknDoubleSpanScrollBar* iScrollBar; + + // Model for aknscrollbar + TAknDoubleSpanScrollBarModel iModel; + + }; + +#endif /* C_UICAKNSCROLLBARADAPTER_H */ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/inc/cuicscrollbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/inc/cuicscrollbar.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: cuicscrollbar.h +* +*/ + +#ifndef C_UICSCROLLBAR_H +#define C_UICSCROLLBAR_H + +#include +#include + +#include "muicscrollbar.h" + +// Forward declarations + +class CAlfAnchorLayout; +class CAlfDeckLayout; +class CAlfImageVisual; +class CAlfLayout; +class CAlfTexture; + +/** + * Composite image + */ +NONSHARABLE_CLASS( CUiCCompositeImage ) : public CBase + { +public: + + /** + * Leave safe constructor + */ + static CUiCCompositeImage* NewL( CAlfControl& aControl, CAlfLayout* aParentLayout, + CAlfTexture& aTop, CAlfTexture& aMiddle, CAlfTexture& aBottom ); + + /** + * Destructor + */ + ~CUiCCompositeImage(); + + /** + * Returns layout for this component + */ + CAlfLayout& Layout(); + +private: + + CUiCCompositeImage(); + void ConstructL( CAlfControl& aControl, CAlfLayout* aParentLayout, + CAlfTexture& aTop, CAlfTexture& aMiddle, CAlfTexture& aBottom ); + void SetAnchors(); + +private: + + CAlfAnchorLayout* iLayout; + CAlfImageVisual* iTop; + CAlfImageVisual* iMiddle; + CAlfImageVisual* iBottom; + + }; + +/** + * CUiCScrollBar + * + */ +NONSHARABLE_CLASS( CUiCScrollBar ) : public CAlfControl, public MUiCScrollBar, + public MAlfBitmapProvider + { + +public: + + /** + * Leave safe constructor + */ + static CUiCScrollBar* NewL( CAlfEnv& aEnv, CAlfLayout* aParentLayout ); + +public: // from MUiCScrollBar + + /** + * @see MUiCScrollBar::Destroy + */ + virtual void Destroy(); + + /** + * @see MUiCScrollBar::Show + */ + virtual void Show( const TBool aShow ); + + /** + * @see MUiCScrollBar::UpdateModelL + */ + virtual void UpdateModelL( const TUiCScrollBarModel& aModel ); + + /** + * @see MUiCScrollBar::ThumbPosition + */ + virtual TInt ThumbPosition() const; + + /** + * @see MUiCScrollBar::SetRect + */ + virtual void SetRect( const TRect& aRect ); + + /** + * @see MUiCScrollBar::Redraw + */ + virtual void Redraw(); + + /** + * @see MUiCScrollBar::NotifyThemeChanged + */ + virtual void NotifyThemeChanged(); + + /** + * @see MUiCScrollBar::LayoutHints + */ + virtual TInt LayoutHints() const; + +private: // from MAlfEventHandler + + /** + * @see MAlfEventHandler::OfferEventL + */ + virtual TBool OfferEventL( const TAlfEvent& aEvent ); + +private: // from MAlfBitmapProvider + + /** + * @see MAlfBitmapProvider::ProvideBitmapL + */ + virtual void ProvideBitmapL( TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap ); + +private: + + /** + * Destructor + */ + ~CUiCScrollBar(); + + /** + * Constructor + */ + CUiCScrollBar(); + + /** + * 2nd constructor + */ + void ConstructL( CAlfEnv& aEnv, CAlfLayout* aParentLayout ); + + /** + * Sets anchors for background image and thumb + */ + void SetAnchors(); + + /** + * Sets anchors for background + */ + void SetBgAnchors(); + + /** + * Sets anchors for thumb + */ + void SetThumbAnchors(); + +private: + + /** + * Custom events + */ + enum TEvent + { + EFadeOut + }; + + /** + * Unique bitmaps IDs, make sure these do no overlap with the ones defined + * in UI + */ + enum TBitmapId + { + EThumbTop = 0x10000, + EThumbMiddle, + EThumbBottom, + EBackgroundTop, + EBackgroundMiddle, + EBackgroundBottom + }; + +private: + + // Container layout + CAlfDeckLayout* iDeck; + + // Scrollbar background layout + CAlfAnchorLayout* iBgLayout; + + // Scrollbar layout + CAlfAnchorLayout* iThumbLayout; + + // Scrollbar background visual + CUiCCompositeImage* iBackGroundVisual; + + // Scrollbar thumb visual + CUiCCompositeImage* iThumbVisual; + + // Scrollbar model + TUiCScrollBarModel iModel; + + }; + +#endif /* C_UICSCROLLBAR_H */ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/inc/fslayoutmanager.h --- a/emailuis/uicomponents/inc/fslayoutmanager.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/inc/fslayoutmanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -72,7 +72,6 @@ /** Layout Metrics. */ enum TFsLayoutMetrics { - // EFsLmApplicationWindow, EFsLmAreaTopPane, EFsLmBgSpFsCtrlbarPane, @@ -192,8 +191,27 @@ EFsLmScreen, EFsLmSpFsScrollPane, EFsLmSpFsActionMenuListGenePaneG1, - EFsLmSpFsActionMenuListGenePaneT1 - // + EFsLmSpFsActionMenuListGenePaneT1, + + // command button area + + ECmailDdmenuBtn01Pane, + ECmailDdmenuBtn01PaneG1, + ECmailDdmenuBtn01PaneT1, + ECmailDdmenuBtn01PaneG2, + ECmailDdmenuBtn01PaneCP, + + ECmailDdmenuBtn02Pane, + ECmailDdmenuBtn02PaneG1, + ECmailDdmenuBtn02PaneG2, + ECmailDdmenuBtn02PaneT1, + ECmailDdmenuBtn02PaneT2, + ECmailDdmenuBtn02PaneCP, + + ECmailDdmenuBtn03Pane, + ECmailDdmenuBtn03PaneG1, + ECmailDdmenuBtn03PaneT1, + ECmailDdmenuBtn03PaneCP }; /** Collection of data of text position and font. */ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/inc/fstreevisualizerbase.h --- a/emailuis/uicomponents/inc/fstreevisualizerbase.h Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/inc/fstreevisualizerbase.h Wed Mar 31 21:08:33 2010 +0300 @@ -25,14 +25,9 @@ #include //////TOOLKIT INCLUDES -// SF #include //MAlfActionObserver -// //////PROJECT INCLUDES -// removed __FS_ALFRED_SUPPORT flag -//#include -// removed __FS_ALFRED_SUPPORT flag #include #include "fstreevisualizer.h" @@ -40,6 +35,7 @@ #include "fsfadeeffectobserver.h" #include "fsslideeffectobserver.h" #include "fsscrollbarset.h" +#include "muicscrollbar.h" //////TOOLKIT CLASSES class CAlfLayout; @@ -65,9 +61,8 @@ class MFsTreeItemVisualizer; class CFsInteractionInterval; class CFsAlfTextStyleManager; -class CAknDoubleSpanScrollBar; - class CAknPhysics; +class CAlfAnchorLayout; /** * Contains the visual structure of the list. @@ -398,7 +393,7 @@ * Get items visible in viewport's area. */ void GetVisibleItemsL(RArray& aVisible, TInt& aOffset); - + /** * Returns ETrue if the world is higher than viewport. */ @@ -474,8 +469,8 @@ * Called when viewport is updated. */ void UpdatedL(TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic); - - + + private: // from TWorld::MObserver @@ -561,7 +556,7 @@ // Viewport cache TCache iCache; - + // Wold index of the first item in Cache TInt iWorldIndex; @@ -588,7 +583,7 @@ public MFsFadeEffectObserver, public MFsSlideEffectObserver, public MAlfActionObserver, - public MEikScrollBarObserver, + public MUiCScrollBar::MObserver, public TWorld::MObserver, public TViewPort::MObserver, public MAknPhysicsObserver @@ -779,7 +774,7 @@ * @return Pointer to the newly constructed object. */ IMPORT_C static CFsTreeVisualizerBase* NewL( CAlfControl* aOwnerControl, - CAlfLayout& aParent, const TBool aDirectTouchMode = EFalse ); + CAlfLayout& aParent, const TBool aPopUpMode = EFalse ); /** * C++ destructor @@ -1018,13 +1013,13 @@ virtual void SetFocusedItemL( const TFsTreeItemId aItem, TBool aCheckFocus = ETrue ); // - /** - * Gets item vertical position in the list - * + /** + * Gets item vertical position in the list + * * @param aIdx indicates item index */ virtual TInt GetItemWorldPosition( const TInt aIdx ); - + /** * Returns item id of the currently focused item. * @@ -1628,21 +1623,13 @@ */ virtual void HandleActionL(const TAlfActionCommand& aActionCommand); -// Change scrollbar to avkon (to support skinning & touch) public: /** - * From MEikScrollBarObserver - * - * Callback method for scroll bar events - * - * Scroll bar observer should implement this method to get scroll bar events. - * - * @since S60 0.9 - * @param aScrollBar A pointer to scrollbar which created the event - * @param aEventType The event occured on the scroll bar + * @see MUiCScrollBar::MObserver::HandleScrollEventL */ - void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType); + void HandleScrollEventL( const MUiCScrollBar& aScrollBar, + MUiCScrollBar::TEvent aEvent ); /** * @@ -1662,7 +1649,7 @@ * @return ETrue if kinetic scrolling is disabled. */ TBool IsKineticScrollingDisabled() const; - + /** * Returns viewPort top-left position */ @@ -1778,7 +1765,8 @@ void UpdateScrollBarL( const TInt aTimeout = 0 ); TInt UpdateScrollBar( const TInt aTimeout = 0 ); void UpdateScrollBarIfNeededL(); - + void SetScrollBarModelValues(); + /** * Finds next focusable item. * @@ -1932,7 +1920,8 @@ * @param aParent Parent layout for all the new layouts constructed by * this class. */ - CFsTreeVisualizerBase( CAlfControl* aOwnerControl, CAlfLayout& aParent, const TBool aDirectTouchMode ); + CFsTreeVisualizerBase( CAlfControl* aOwnerControl, + CAlfLayout& aParent, const TBool aPopUpMode ); /** * Second phase constructor @@ -2059,6 +2048,11 @@ CAlfFlowLayout* iListLayout; /** + * Layout in which scroll bar is shown (on top of others) + */ + CAlfAnchorLayout* iScrollBarLayout; + + /** * Layout in which watermark is placed. */ CAlfDeckLayout* iWatermarkLayout; @@ -2097,8 +2091,8 @@ * Scrollbar */ CAlfImageVisual* iDummyScrollbar; - CAknDoubleSpanScrollBar* iScrollBar; - TAknDoubleSpanScrollBarModel iScrollbarModel; + MUiCScrollBar* iScrollBar; + TUiCScrollBarModel iScrollBarModel; TFsScrollbarVisibility iScrollbarVisibility; /** @@ -2355,11 +2349,16 @@ * Do physics update when simulation has finished. */ EUpdatePhysicsAfterSimulationFinished, - + /** * Ignore next pointer up event. */ - EIgnorePointerUpAction + EIgnorePointerUpAction, + + /** + * List is shown in popup mode. + */ + EPopupMode }; // Flags diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/inc/muicscrollbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/inc/muicscrollbar.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: muicscrollbar.h +* +*/ + +#ifndef M_UICSCROLLBAR_H +#define M_UICSCROLLBAR_H + +#include +#include "tuicscrollbarmodel.h" + +/** + * MUiCScrollBar + * + */ +class MUiCScrollBar + { + +public: + + /** + * Scroll events + */ + enum TEvent + { + EScrollHome, + EScrollEnd, + EScrollPosition + }; + + /** + * Layouting hints + */ + enum TLayoutHint + { + // Scroll bar is shown on top of the list, not on side + ELayoutOnTopOfList = (1 << 0), + + // Coordinates must be given relative to the list, not screen + ELayoutRelativeToList = (1 << 1), + + // Scroll bar will do automatic mirroring + ELayoutAutomaticMirroring = (1 << 2) + }; + +public: + + /** + * Scrollbar observer + */ + class MObserver + { + public: + virtual void HandleScrollEventL( const MUiCScrollBar& aScrollBar, + TEvent aEvent ) = 0; + }; + +public: + + /** + * Destroys instance and frees resources + */ + virtual void Destroy() = 0; + + /** + * Shows scrollbar + */ + virtual void Show( const TBool aShow ) = 0; + + /** + * Updates scrollbar model + */ + virtual void UpdateModelL( const TUiCScrollBarModel& aModel ) = 0; + + /** + * Returns thumb position + */ + virtual TInt ThumbPosition() const = 0; + + /** + * Sets scrollbar rect + */ + virtual void SetRect( const TRect& aRect ) = 0; + + /** + * Force scrollbar redraw + */ + virtual void Redraw() = 0; + + /** + * Called when theme is changed + */ + virtual void NotifyThemeChanged() = 0; + + /** + * Returns layouting hints for the scrollbar + */ + virtual TInt LayoutHints() const = 0; + + }; + +#endif /* M_UICSCROLLBAR_H */ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/inc/tuicscrollbarmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/inc/tuicscrollbarmodel.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: tuicscrollbarmodel.h +* +*/ + +#ifndef T_UICSCROLLBARMODEL_H +#define T_UICSCROLLBARMODEL_H + +#include + +/** + * TUiCScrollBarModel + * + */ +class TUiCScrollBarModel + { + +public: + + /** + * Constructor + */ + TUiCScrollBarModel(); + +public: // model + + /** + * Set total height + */ + void SetHeight( TInt aHeight ); + + /** + * Total height + */ + TInt Height() const; + + /** + * Set window height + */ + void SetWindowHeight( TInt aHeight ); + + /** + * Window height + */ + TInt WindowHeight() const; + + /** + * Sets top position of the window + */ + void SetWindowPosition( TInt aPosition ); + + /** + * Top position of the window + */ + TInt WindowPosition() const; + + /** + * Height of the thumb + */ + TInt ThumbHeight() const; + + /** + * Position of thumb inside the window + */ + TInt ThumbPosition() const; + + /** + * Returns ETrue if total height is greater than window height + */ + TBool ScrollBarNeeded() const; + +private: + + /** + * Returns minimum thumb height (from layout data) + */ + TInt MinimumThumbHeight() const; + + /** + * Returns calculated thumb height. Thumb height is calculated, + * unless this result is smaller than MinimumThumbHeight(). + */ + TInt CalculatedThumbHeight() const; + +private: + + TInt iHeight; + TInt iWindowHeight; + TInt iWindowPosition; + + }; + +#endif /* T_UICSCROLLBARMODEL_H */ diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/cuicaknscrollbaradapter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/src/cuicaknscrollbaradapter.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: cuicaknscrollbaradapter.cpp +* +*/ + +#include "cuicaknscrollbaradapter.h" +#include "emailtrace.h" + +#include + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::NewL +// --------------------------------------------------------------------------- +// +MUiCScrollBar* CUiCAknScrollBarAdapter::NewL( MUiCScrollBar::MObserver& aObserver ) + { + FUNC_LOG; + CUiCAknScrollBarAdapter* self = + new (ELeave) CUiCAknScrollBarAdapter( aObserver ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::Destroy +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::Destroy() + { + FUNC_LOG; + delete this; + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::Show +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::Show( const TBool aShow ) + { + FUNC_LOG; + iScrollBar->MakeVisible( aShow ); + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::~CUiCScrollBar +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::UpdateModelL( const TUiCScrollBarModel& aModel ) + { + FUNC_LOG; + iModel.SetScrollSpan( aModel.Height() ); + iModel.SetFocusPosition( aModel.WindowPosition() ); + iModel.SetWindowSize( aModel.WindowHeight() ); + iScrollBar->SetModelL( &iModel ); + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::ThumbPosition +// --------------------------------------------------------------------------- +// +TInt CUiCAknScrollBarAdapter::ThumbPosition() const + { + FUNC_LOG; + return iScrollBar->ThumbPosition(); + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::SetRect +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::SetRect( const TRect& aRect ) + { + FUNC_LOG; + iScrollBar->SetRect( aRect ); + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::Redraw +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::Redraw() + { + FUNC_LOG; + iScrollBar->DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::NotifyThemeChanged +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::NotifyThemeChanged() + { + FUNC_LOG; + iScrollBar->HandleResourceChange( KAknsMessageSkinChange ); + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::LayoutHints +// --------------------------------------------------------------------------- +// +TInt CUiCAknScrollBarAdapter::LayoutHints() const + { + FUNC_LOG; + return 0; + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::HandleScrollEventL +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ) + { + FUNC_LOG; + if ( aScrollBar == iScrollBar ) + { + switch ( aEventType ) + { + case EEikScrollHome: + iObserver.HandleScrollEventL( *this, EScrollHome ); + break; + case EEikScrollEnd: + iObserver.HandleScrollEventL( *this, EScrollEnd ); + break; + default: + iObserver.HandleScrollEventL( *this, EScrollPosition ); + break; + } + } + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::CUiCAknScrollBarAdapter +// --------------------------------------------------------------------------- +// +CUiCAknScrollBarAdapter::CUiCAknScrollBarAdapter( MUiCScrollBar::MObserver& aObserver ) + : iObserver( aObserver ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::~CUiCAknScrollBarAdapter +// --------------------------------------------------------------------------- +// +CUiCAknScrollBarAdapter::~CUiCAknScrollBarAdapter() + { + FUNC_LOG; + delete iScrollBar; + } + +// --------------------------------------------------------------------------- +// CUiCAknScrollBarAdapter::ConstructL +// --------------------------------------------------------------------------- +// +void CUiCAknScrollBarAdapter::ConstructL() + { + FUNC_LOG; + iScrollBar = new (ELeave) CAknDoubleSpanScrollBar( NULL ); + iScrollBar->ConstructL( ETrue, this, 0, CEikScrollBar::EVertical, 1000 ); + } + +// end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/cuicscrollbar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/src/cuicscrollbar.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,457 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: cuicscrollbar.cpp +* +*/ + +#include "cuicscrollbar.h" +#include "emailtrace.h" + +#include +#include +#include +#include +#include +#include + +// Constants + +// Scroll bar opacity (visible) +const TReal32 KVisibleOpacity = 1.0f; +// Thumb opacity (visible) +const TReal32 KVisibleOpacityThumb = 0.85f; +// Background opacity (visible) +const TReal32 KVisibleOpacityBackground = 0.65f; +// How long scrollbar will be visible after change +const TReal32 KVisibleTimeout = 500; +// How long fading will take +const TReal32 KFadeTimeout = 500; +// Width of the scrollbar (this will be replaced with value from layout) +const TInt KScrollBarWidth = 18; + +// CUiCCompositeImage + +// --------------------------------------------------------------------------- +// CUiCCompositeImage::NewL +// --------------------------------------------------------------------------- +// +CUiCCompositeImage* CUiCCompositeImage::NewL( CAlfControl& aControl, + CAlfLayout* aParentLayout, CAlfTexture& aTop, + CAlfTexture& aMiddle, CAlfTexture& aBottom ) + { + FUNC_LOG; + CUiCCompositeImage* self = new (ELeave) CUiCCompositeImage(); + CleanupStack::PushL( self ); + self->ConstructL( aControl, aParentLayout, aTop, aMiddle, aBottom ); + CleanupStack::Pop(); // self + return self; + } + +// --------------------------------------------------------------------------- +// CUiCCompositeImage::~CUiCCompositeImage +// --------------------------------------------------------------------------- +// +CUiCCompositeImage::~CUiCCompositeImage() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CUiCCompositeImage::Layout +// --------------------------------------------------------------------------- +// +CAlfLayout& CUiCCompositeImage::Layout() + { + FUNC_LOG; + return *iLayout; + } + +// --------------------------------------------------------------------------- +// CUiCCompositeImage::CUiCCompositeImage +// --------------------------------------------------------------------------- +// +CUiCCompositeImage::CUiCCompositeImage() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CUiCCompositeImage::ConstructL +// --------------------------------------------------------------------------- +// +void CUiCCompositeImage::ConstructL( CAlfControl& aControl, CAlfLayout* aParentLayout, + CAlfTexture& aTop, CAlfTexture& aMiddle, CAlfTexture& aBottom ) + { + FUNC_LOG; + iLayout = CAlfAnchorLayout::AddNewL( aControl, aParentLayout ); + iTop = CAlfImageVisual::AddNewL( aControl, iLayout ); + iTop->SetImage( TAlfImage( aTop ) ); + iMiddle = CAlfImageVisual::AddNewL( aControl, iLayout ); + iMiddle->SetImage( TAlfImage( aMiddle ) ); + iBottom = CAlfImageVisual::AddNewL( aControl, iLayout ); + iBottom->SetImage( TAlfImage( aBottom ) ); + SetAnchors(); + } + +// --------------------------------------------------------------------------- +// CUiCCompositeImage::SetAnchors +// --------------------------------------------------------------------------- +// +void CUiCCompositeImage::SetAnchors() + { + FUNC_LOG; + // iTop + iLayout->SetAnchor( + EAlfAnchorTopLeft, 0, + EAlfAnchorOriginLeft, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, 0 ) ); + iLayout->SetAnchor( + EAlfAnchorBottomRight, 0, + EAlfAnchorOriginRight, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, KScrollBarWidth ) ); + + // iMiddle + iLayout->SetAnchor( + EAlfAnchorTopLeft, 1, + EAlfAnchorOriginLeft, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, KScrollBarWidth ) ); + iLayout->SetAnchor( + EAlfAnchorBottomRight, 1, + EAlfAnchorOriginRight, EAlfAnchorOriginBottom, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, -KScrollBarWidth ) ); + + // iBottom + iLayout->SetAnchor( + EAlfAnchorTopLeft, 2, + EAlfAnchorOriginLeft, EAlfAnchorOriginBottom, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, -KScrollBarWidth ) ); + iLayout->SetAnchor( + EAlfAnchorBottomRight, 2, + EAlfAnchorOriginRight, EAlfAnchorOriginBottom, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, 0 ) ); + + iLayout->UpdateChildrenLayout(); + } + +// CUiCScrollBar + +// --------------------------------------------------------------------------- +// CUiCScrollBar::NewL +// --------------------------------------------------------------------------- +// +CUiCScrollBar* CUiCScrollBar::NewL( CAlfEnv& aEnv, CAlfLayout* aParentLayout ) + { + FUNC_LOG; + CUiCScrollBar* self = new (ELeave) CUiCScrollBar(); + CleanupStack::PushL( self ); + self->ConstructL( aEnv, aParentLayout ); + CleanupStack::Pop(); // self + return self; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::~CUiCScrollBar +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::Destroy() + { + FUNC_LOG; + delete this; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::Show +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::Show( const TBool aShow ) + { + FUNC_LOG; + Env().CancelCustomCommands( this ); + TAlfTimedValue opacity( aShow ? KVisibleOpacity : 0 ); + iDeck->SetOpacity( opacity ); + if ( aShow ) + { + iThumbVisual->Layout().SetOpacity( KVisibleOpacityThumb ); + iBackGroundVisual->Layout().SetOpacity( KVisibleOpacityBackground ); + TAlfCustomEventCommand command( EFadeOut, this ); + Env().Send( command, KVisibleTimeout ); + } + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::UpdateModelL +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::UpdateModelL( const TUiCScrollBarModel& aModel ) + { + FUNC_LOG; + iModel = aModel; + if ( iModel.ScrollBarNeeded() ) + { + SetThumbAnchors(); + Show( ETrue ); + } + else + { + Show( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::ThumbPosition +// --------------------------------------------------------------------------- +// +TInt CUiCScrollBar::ThumbPosition() const + { + FUNC_LOG; + return iModel.ThumbPosition(); + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::SetRect +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::SetRect( const TRect& aRect ) + { + FUNC_LOG; + TAlfRealRect realRect( aRect ); + iDeck->SetRect( realRect ); + iDeck->UpdateChildrenLayout(); + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::Redraw +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::Redraw() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::NotifyThemeChanged +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::NotifyThemeChanged() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::LayoutHints +// --------------------------------------------------------------------------- +// +TInt CUiCScrollBar::LayoutHints() const + { + FUNC_LOG; + return ELayoutOnTopOfList | ELayoutRelativeToList | + ELayoutAutomaticMirroring; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::OfferEventL +// --------------------------------------------------------------------------- +// +TBool CUiCScrollBar::OfferEventL( const TAlfEvent& aEvent ) + { + FUNC_LOG; + TBool handled( EFalse ); + if ( aEvent.Type() == TAlfEvent::ETypeCustom ) + { + if ( aEvent.CustomParameter() == EFadeOut ) + { + handled = ETrue; + TAlfTimedValue opacity( 0, KFadeTimeout ); + iDeck->SetOpacity( opacity ); + } + } + else + { + handled = CAlfControl::OfferEventL( aEvent ); + } + return handled; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::ProvideBitmapL +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::ProvideBitmapL( TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap ) + { + FUNC_LOG; + TAknsItemID itemId; + + switch ( aId ) + { + case EThumbTop: + itemId = KAknsIIDQsnCpScrollHandleTop; + break; + + case EThumbMiddle: + itemId = KAknsIIDQsnCpScrollHandleMiddle; + break; + + case EThumbBottom: + itemId = KAknsIIDQsnCpScrollHandleBottom; + break; + + case EBackgroundTop: + itemId = KAknsIIDQsnCpScrollBgTop; + break; + + case EBackgroundMiddle: + itemId = KAknsIIDQsnCpScrollBgMiddle; + break; + + case EBackgroundBottom: + itemId = KAknsIIDQsnCpScrollBgBottom; + break; + + default: + User::Leave( KErrNotFound ); + } + + AknsUtils::CreateIconL( AknsUtils::SkinInstance(), itemId, aBitmap, aMaskBitmap, KNullDesC, -1, -1 ); + + if ( aBitmap ) + { + TAknContentDimensions origDim; + AknIconUtils::GetContentDimensions( aBitmap, origDim ); + TSize iconSize( origDim.iWidth, origDim.iHeight ); + if (iconSize.iWidth != KScrollBarWidth && iconSize.iWidth > 0) + { + iconSize.iHeight = iconSize.iHeight * KScrollBarWidth / iconSize.iWidth; + iconSize.iWidth = KScrollBarWidth; + } + AknIconUtils::DisableCompression( aBitmap ); + AknIconUtils::SetSize( aBitmap, iconSize, EAspectRatioNotPreserved ); + if ( aMaskBitmap ) + { + AknIconUtils::DisableCompression( aMaskBitmap ); + AknIconUtils::SetSize( aMaskBitmap, iconSize, EAspectRatioNotPreserved ); + } + } + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::~CUiCScrollBar +// --------------------------------------------------------------------------- +// +CUiCScrollBar::~CUiCScrollBar() + { + FUNC_LOG; + Env().CancelCommands( this ); + if ( iDeck ) + { + iDeck->RemoveAndDestroyAllD(); + } + delete iBackGroundVisual; + delete iThumbVisual; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::CUiCScrollBar +// --------------------------------------------------------------------------- +// +CUiCScrollBar::CUiCScrollBar() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::ConstructL +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::ConstructL( CAlfEnv& aEnv, CAlfLayout* aParentLayout ) + { + FUNC_LOG; + CAlfControl::ConstructL( aEnv ); + iDeck = CAlfDeckLayout::AddNewL( *this, aParentLayout ); + iDeck->SetFlags( EAlfVisualFlagManualLayout | + EAlfVisualFlagAutomaticLocaleMirroringEnabled ); + iBgLayout = CAlfAnchorLayout::AddNewL( *this, iDeck ); + iBgLayout->SetFlags( EAlfVisualFlagAutomaticLocaleMirroringEnabled ); + iBackGroundVisual = CUiCCompositeImage::NewL( *this, iBgLayout, + Env().TextureManager().CreateTextureL( EBackgroundTop, this, EAlfTextureFlagSkinContent ), + Env().TextureManager().CreateTextureL( EBackgroundMiddle, this, EAlfTextureFlagSkinContent ), + Env().TextureManager().CreateTextureL( EBackgroundBottom, this, EAlfTextureFlagSkinContent ) ); + iThumbLayout = CAlfAnchorLayout::AddNewL( *this, iDeck ); + iThumbLayout->SetFlags( EAlfVisualFlagAutomaticLocaleMirroringEnabled ); + iThumbLayout->SetClipping( ETrue ); + iThumbVisual = CUiCCompositeImage::NewL( *this, iThumbLayout, + Env().TextureManager().CreateTextureL( EThumbTop, this, EAlfTextureFlagSkinContent ), + Env().TextureManager().CreateTextureL( EThumbMiddle, this, EAlfTextureFlagSkinContent ), + Env().TextureManager().CreateTextureL( EThumbBottom, this, EAlfTextureFlagSkinContent ) ); + iThumbVisual->Layout().SetFlags( EAlfVisualFlagDrawAfterOthers ); + SetAnchors(); + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::ConstructL +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::SetAnchors() + { + FUNC_LOG; + SetBgAnchors(); + SetThumbAnchors(); + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::SetBgAnchors +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::SetBgAnchors() + { + FUNC_LOG; + iBgLayout->SetAnchor( + EAlfAnchorTopLeft, 0, + EAlfAnchorOriginRight, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( -KScrollBarWidth, 0 ) ); + iBgLayout->SetAnchor( + EAlfAnchorBottomRight, 0, + EAlfAnchorOriginRight, EAlfAnchorOriginBottom, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, 0 ) ); + iBgLayout->UpdateChildrenLayout(); + } + +// --------------------------------------------------------------------------- +// CUiCScrollBar::SetThumbAnchors +// --------------------------------------------------------------------------- +// +void CUiCScrollBar::SetThumbAnchors() + { + FUNC_LOG; + iThumbLayout->SetAnchor( + EAlfAnchorTopLeft, 0, + EAlfAnchorOriginRight, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( -KScrollBarWidth, iModel.ThumbPosition() ) ); + iThumbLayout->SetAnchor( + EAlfAnchorBottomRight, 0, + EAlfAnchorOriginRight, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint( 0, iModel.ThumbPosition() + iModel.ThumbHeight() ) ); + iThumbLayout->UpdateChildrenLayout(); + } + +// end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp --- a/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -33,6 +33,7 @@ #include #include #include +#include #include "fscontrolbuttonvisualiser.h" #include "fscontrolbuttonmodel.h" @@ -101,6 +102,11 @@ // Request callback after image is loaded to refresh it's size and // position. iParent->Env().TextureManager().AddLoadObserverL( this ); + + iParentLayout->SetFlag( EAlfVisualFlagLayoutUpdateNotification ); + iButtonLayout->SetFlags( EAlfVisualFlagManualSize | EAlfVisualFlagManualPosition ); + iButtonContentLayout->SetFlags( EAlfVisualFlagManualSize | EAlfVisualFlagManualPosition ); + } } @@ -323,8 +329,6 @@ } // Set new position for background visual and it's content. - iButtonLayout->SetFlag( EAlfVisualFlagManualPosition ); - iButtonContentLayout->SetFlag( EAlfVisualFlagManualPosition ); iButtonLayout->SetPos( pos ); iButtonContentLayout->SetPos( pos ); } @@ -642,9 +646,6 @@ const TPoint oldSize( iButtonContentLayout->Size().Target() ); - iButtonLayout->SetFlag( EAlfVisualFlagManualSize ); - iButtonContentLayout->SetFlag( EAlfVisualFlagManualSize ); - switch( iButtonModel->AutoSizeMode() ) { case MFsControlButtonInterface::EFsLayout: @@ -708,6 +709,8 @@ TRAP_IGNORE( UpdateElementsSizeL( iButtonModel->Type() ) ); + iButtonContentLayout->UpdateChildrenLayout(); + // update text styles if needed (at least one text line) const TPoint newSize( iButtonContentLayout->Size().Target() ); if ( newSize != oldSize ) @@ -1140,7 +1143,6 @@ const TInt newWidth( parentRect.Width() + textRect.Width() - text.iTextRect.Width() ); - iParentLayout->SetFlags( EAlfVisualFlagLayoutUpdateNotification ); return newWidth; } } @@ -1166,9 +1168,6 @@ void CFsControlButtonVisualiser::UpdateButtonPos() { FUNC_LOG; - iButtonLayout->SetFlag( EAlfVisualFlagManualPosition ); - iButtonContentLayout->SetFlag( EAlfVisualFlagManualPosition ); - // Set position for button background and for the content. iButtonLayout->SetPos( iButtonModel->TopLeftPoint() ); iButtonContentLayout->SetPos( iButtonModel->TopLeftPoint() ); @@ -1200,34 +1199,47 @@ break; case ECBTypeOneLineLabelOnly: CFsLayoutManager::LayoutMetricsText( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneT1, text, 0 ); + CFsLayoutManager::ECmailDdmenuBtn01PaneT1, text, 1 ); text1 = text.iTextRect; break; case ECBTypeOneLineLabelIconA: - CFsLayoutManager::LayoutMetricsRect( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneG2, - iconA, 0 ); - CFsLayoutManager::LayoutMetricsText( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneT1, text, 2 ); - text1 = text.iTextRect; + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + CFsLayoutManager::LayoutMetricsRect( parentRect, + CFsLayoutManager::ECmailDdmenuBtn02PaneG2, + iconA, 0 ); + CFsLayoutManager::LayoutMetricsText( parentRect, + CFsLayoutManager::ECmailDdmenuBtn02PaneT2, + text, 0 ); + } + else + { + CFsLayoutManager::LayoutMetricsRect( parentRect, + CFsLayoutManager::ECmailDdmenuBtn01PaneG1, + iconA, 1 ); + CFsLayoutManager::LayoutMetricsText( parentRect, + CFsLayoutManager::ECmailDdmenuBtn01PaneT1, + text, 0 ); + } + text1 = text.iTextRect; break; case ECBTypeOneLineLabelIconB: CFsLayoutManager::LayoutMetricsText( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneT1, text, 1 ); + CFsLayoutManager::ECmailDdmenuBtn01PaneT1, text, 1 ); text1 = text.iTextRect; CFsLayoutManager::LayoutMetricsRect( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneG1, - iconB, 0 ); + CFsLayoutManager::ECmailDdmenuBtn01PaneG2, + iconB, 2 ); break; case ECBTypeOneLineLabelTwoIcons: CFsLayoutManager::LayoutMetricsRect( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneG2, + CFsLayoutManager::ECmailDdmenuBtn01PaneG1, iconA, 1 ); CFsLayoutManager::LayoutMetricsText( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneT1, text, 3 ); + CFsLayoutManager::ECmailDdmenuBtn01PaneT1, text, 0 ); text1 = text.iTextRect; CFsLayoutManager::LayoutMetricsRect( parentRect, - CFsLayoutManager::EFsLmMainSpFsCtrlbarDdmenuPaneG1, + CFsLayoutManager::ECmailDdmenuBtn01PaneG2, iconB, 1 ); break; default: @@ -1247,8 +1259,6 @@ ( buttonSize.iHeight - oldIconSize.iHeight ) / 2 ), oldIconSize ); } - iconA.SetHeight( buttonSize.iHeight ); - text1.SetHeight( buttonSize.iHeight ); if ( iButtonModel->ContainsElement( ECBElemIconA ) ) { @@ -1270,6 +1280,14 @@ { iLabelFirstLine->SetSize( text1.Size() ); iLabelFirstLine->SetPos( text1.iTl ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + iLabelFirstLine->SetAlign( EAlfAlignHCenter, EAlfAlignVCenter ); + } + else + { + iLabelFirstLine->SetAlign( EAlfAlignHLocale, EAlfAlignVCenter ); + } } } if ( iButtonModel->ContainsElement( ECBElemLabelSndLine ) ) @@ -1555,7 +1573,6 @@ if ( iParentLayout ) { // This flag is cleared when the layout is updated. - iParentLayout->SetFlags( EAlfVisualFlagLayoutUpdateNotification ); iParentLayout->UpdateChildrenLayout(); } } diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fslayoutmanager.cpp --- a/emailuis/uicomponents/src/fslayoutmanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fslayoutmanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -24,7 +24,6 @@ #include #include #include -#include // SF #include #include @@ -94,8 +93,6 @@ { FUNC_LOG; - // - TBool retVal( ETrue ); TAknLayoutRect rect; @@ -116,162 +113,60 @@ case EFsLmBgSpFsCtrlbarPane: rect.LayoutRect( aParent, AknLayoutScalable_Apps::bg_sp_fs_ctrlbar_pane( aVariety ).LayoutLine() ); - break; -/* case EFsLmListMediumLine: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line().LayoutLine() ); - break;*/ + break; case EFsLmListMediumLineG1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_g1( aVariety ).LayoutLine() ); - break; + case EFsLmListMediumLineX2G1: + case EFsLmListMediumLineT2G2G1: + case EFsLmListMediumLineT3G2G1: + case EFsLmListMediumLineT3G1: + case EFsLmListMediumLineT2G3G1: + case EFsLmListMediumLineT3G3G1: + case EFsLmListMediumLineX2T3G4G1: + case EFsLmListMediumLineX2T4G4G4: + case EFsLmListMediumLineX2T3G3G1: case EFsLmListMediumLineG2G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_g2_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineG2G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_g2_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineG3G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_g3_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineG3G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_g3_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineG3G3: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_g3_g3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineRightIconG1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_right_icon_g1().LayoutLine() ); - break; - case EFsLmListMediumLineRightIconx2G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_right_iconx2_g1().LayoutLine() ); - break; - case EFsLmListMediumLineRightIconx2G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_right_iconx2_g2().LayoutLine() ); - break; + case EFsLmListMediumLineG3G1: case EFsLmListMediumLineT2G1: rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G2G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g2_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G2G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g2_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G3G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g3_g1( aVariety ).LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( aVariety ).LayoutLine() ); + break; + case EFsLmListMediumLineG3G2: case EFsLmListMediumLineT2G3G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g3_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G3G3: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g3_g3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2RightIconG1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_icon_g1().LayoutLine() ); - break; + case EFsLmListMediumLineT3G3G2: + case EFsLmListMediumLineX2T3G4G2: + case EFsLmListMediumLineRightIconx2G1: case EFsLmListMediumLineT2RightIconx2G1: + case EFsLmListMediumLineT3RightIconx2G1: rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_iconx2_g1().LayoutLine() ); - break; - case EFsLmListMediumLineT2RightIconx2G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_iconx2_g2().LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_pane_g3( aVariety ).LayoutLine() ); break; - case EFsLmListMediumLineT3G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G2G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g2_g1( aVariety ).LayoutLine() ); - break; + case EFsLmListMediumLineG2G2: + case EFsLmListMediumLineT2G2G2: case EFsLmListMediumLineT3G2G2: + case EFsLmListMediumLineX2T3G3G2: + case EFsLmListMediumLineRightIconG1: + case EFsLmListMediumLineT2RightIconG1: + case EFsLmListMediumLineRightIconx2G2: + case EFsLmListMediumLineT2RightIconx2G2: + case EFsLmListMediumLineT3RightIconx2G2: + case EFsLmListMediumLineG3G3: + case EFsLmListMediumLineT2G3G3: + case EFsLmListMediumLineT3G3G3: + case EFsLmListMediumLineX2T3G4G3: rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g2_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G3G1: + AknLayoutScalable_Apps::list_single_dyc_row_pane_g4( aVariety ).LayoutLine() ); + break; + case EFsLmListMediumLineX2: rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g3_g1( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_fs_dyc_pane(1).LayoutLine() ); break; - case EFsLmListMediumLineT3G3G2: + case EFsLmListMediumLineX3: rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g3_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G3G3: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g3_g3( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_fs_dyc_pane(2).LayoutLine() ); break; case EFsLmFolderListMediumLineG1: // Values for folderlist rect.LayoutRect( aParent, AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( aVariety ).LayoutLine() ); break; - case EFsLmListMediumLineT3RightIconx2G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_right_iconx2_g1().LayoutLine() ); - break; - case EFsLmListMediumLineT3RightIconx2G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_right_iconx2_g2().LayoutLine() ); - break; - case EFsLmListMediumLineX2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2().LayoutLine() ); - break; - case EFsLmListMediumLineX2G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G3G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g3_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G3G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g3_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G3G3: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g3_g3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G4G1: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g4_g1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G4G2: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g4_g2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G4G3: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g4_g3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T4G4G4: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t4_g4_g4( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX3: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x3().LayoutLine() ); - break; - case EFsLmListMediumLineX3T4G4G4: - rect.LayoutRect( aParent, - AknLayoutScalable_Apps::list_medium_line_x3_t4_g4_g4( aVariety ).LayoutLine() ); - break; case EFsLmListSingleDycRowPane: rect.LayoutRect( aParent, AknLayoutScalable_Apps::list_single_dyc_row_pane( aVariety, 0, aRow ).LayoutLine() ); @@ -354,8 +249,61 @@ AknLayoutScalable_Apps::sp_fs_action_menu_list_gene_pane_g1( aVariety ).LayoutLine() ); break; - // + case ECmailDdmenuBtn01Pane: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn01PaneG1: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane_g1( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn01PaneG2: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane_g2( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn01PaneCP: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::bg_button_pane_cp028( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn02Pane: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn02PaneG1: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_g1( aVariety ).LayoutLine() ); + break; + case ECmailDdmenuBtn02PaneG2: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_g2( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn02PaneCP: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::bg_button_pane_cp029( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn03Pane: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn03PaneG1: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane_g1( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn03PaneCP: + rect.LayoutRect( aParent, + AknLayoutScalable_Apps::bg_button_pane_cp031( aVariety ).LayoutLine() ); + break; + default: // This is error case retVal = EFalse; @@ -449,207 +397,90 @@ { FUNC_LOG; - // - TBool retVal( ETrue ); TAknLayoutText textLayout; - + switch ( aParam ) { + case EFsLmListMediumLineG2T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_g2_t1( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 22 ).LayoutLine() ); break; case EFsLmListMediumLineT2RightIconT1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_icon_t1().LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 25 ).LayoutLine() ); break; case EFsLmListMediumLineT2RightIconT2: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_icon_t2().LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 16 ).LayoutLine() ); break; case EFsLmListMediumLineX2T3G3T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g3_t1( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 13 ).LayoutLine() ); break; case EFsLmListMediumLineX2T3G3T2: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g3_t2( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 4 ).LayoutLine() ); break; case EFsLmListMediumLineX2T3G2T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g2_t1( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 23 ).LayoutLine() ); break; case EFsLmListMediumLineX2T3G2T2: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g2_t2( aVariety ).LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 14 ).LayoutLine() ); + break; case EFsLmListMediumLineX2T2G4T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t2_g4_t1( aVariety ).LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 3 ).LayoutLine() ); + break; case EFsLmListMediumLineX2T2G3T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t2_g3_t1( aVariety ).LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 2 ).LayoutLine() ); + break; case EFsLmListMediumLineX2T2G2T1: + case EFsLmListMediumLineT4G4T3: + case EFsLmListMediumLineX3T4G4T3: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t2_g2_t1( aVariety ).LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 5 ).LayoutLine() ); + break; case EFsLmListMediumLineX2T3T3: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_t3().LayoutLine() ); - break; - case EFsLmListMediumLineT4G4T3: - /* - TAknLayoutRect textParent; - textParent.LayoutRect(ListSingleDycRow(aParent, 3, 3), - AknLayoutScalable_Apps::list_single_dyc_row_text_pane( 5 ).LayoutLine()); - textLayout.LayoutText( textParent.Rect(), - AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 5 ).LayoutLine() ); //list_medium_line_t4_g4_t3*/ - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t4_g4_t3( aVariety ).LayoutLine() ); //list_medium_line_t4_g4_t3*/ + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 8 ).LayoutLine() ); break; case EFsLmListMediumLineX3T4G4T2: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x3_t4_g4_t2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX3T4G4T3: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x3_t4_g4_t3( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 13 ).LayoutLine() ); break; case EFsLmListMediumLineX3T4G4T4: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x3_t4_g4_t4( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3RightIconx2T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_right_iconx2_t1().LayoutLine() ); - break; - case EFsLmListMediumLineT3RightIconx2T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_right_iconx2_t2().LayoutLine() ); - break; - case EFsLmListMediumLineT2RightIconx2T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_iconx2_t1().LayoutLine() ); - break; - case EFsLmListMediumLineT2RightIconx2T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_right_iconx2_t2().LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 7 ).LayoutLine() ); break; case EFsLmListMediumLineRightIconx2T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_right_iconx2_t1().LayoutLine() ); - break; - case EFsLmListMediumLineT3G3T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g3_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G3T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g3_t2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G3T3: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g3_t3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G3T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g3_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G3T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g3_t2( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 6 ).LayoutLine() ); break; case EFsLmListMediumLineG3T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_g3_t1( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 3 ).LayoutLine() ); break; case EFsLmListMediumLinePlainT1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_plain_t1().LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 8 ).LayoutLine() ); break; case EFsLmListMediumLineT3T1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_t2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3T3: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_t3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_t2( aVariety ).LayoutLine() ); + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 35 ).LayoutLine() ); break; case EFsLmListMediumLineRightIconT1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_right_icon_t1().LayoutLine() ); - break; - case EFsLmListMediumLineT3G2T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g2_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G2T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g2_t2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT3G2T3: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t3_g2_t3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G2T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g2_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineT2G2T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t2_g2_t2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G4T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g4_t1( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G4T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g4_t2( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLineX2T3G4T3: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_x2_t3_g4_t3( aVariety ).LayoutLine() ); - break; - case EFsLmListMediumLinePlainT3T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_plain_t3_t1().LayoutLine() ); - break; - case EFsLmListMediumLinePlainT3T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_plain_t3_t2().LayoutLine() ); - break; - case EFsLmListMediumLinePlainT3T3: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_plain_t3_t3().LayoutLine() ); - break; - case EFsLmListMediumLinePlainT2T1: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_plain_t2_t1().LayoutLine() ); - break; - case EFsLmListMediumLinePlainT2T2: - textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_plain_t2_t2().LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 7 ).LayoutLine() ); + break; case EFsLmListMediumLineT1: textLayout.LayoutText( aParent, - AknLayoutScalable_Apps::list_medium_line_t1( aVariety ).LayoutLine() ); - break; + AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 5 ).LayoutLine() ); + break; case EFsLmFolderListMediumLineT1: // Values for folderlist textLayout.LayoutText( aParent, AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( aVariety ).LayoutLine() ); break; @@ -674,14 +505,31 @@ AknLayoutScalable_Apps::sp_fs_action_menu_list_gene_pane_t1( aVariety ).LayoutLine() ); break; - // + case ECmailDdmenuBtn01PaneT1: + textLayout.LayoutText( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane_t1( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn02PaneT1: + textLayout.LayoutText( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_t1( aVariety ).LayoutLine() ); + break; + case ECmailDdmenuBtn02PaneT2: + textLayout.LayoutText( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_t2( aVariety ).LayoutLine() ); + break; + + case ECmailDdmenuBtn03PaneT1: + textLayout.LayoutText( aParent, + AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane_t1( aVariety ).LayoutLine() ); + break; default: retVal = EFalse; break; } - + if ( retVal ) { aText.iTextRect = textLayout.TextRect(); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstextviewervisualizerdata.cpp --- a/emailuis/uicomponents/src/fstextviewervisualizerdata.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstextviewervisualizerdata.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -709,7 +709,7 @@ } CAlfVisual* visual = NULL; - CFsTexture *texture = NULL; +// CFsTexture *texture = NULL; if ( aVisual->iIsText ) { visual = CAlfTextVisual::AddNewL( *iControl, aVisual->iLayout ); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstreeitemvisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreeitemvisualizerbase.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstreeitemvisualizerbase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -895,10 +895,6 @@ charFormat.iFontSpec = text.iFont->FontSpecInTwips(); } - if (iFontHeight>0) - { - charFormat.iFontSpec.iHeight = iFontHeight; - } TBool isBold(EFalse); isBold = iFlags & KFsTreeListItemTextBold; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstreenodevisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreenodevisualizerbase.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstreenodevisualizerbase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -885,10 +885,6 @@ charFormat.iFontSpec = text.iFont->FontSpecInTwips(); } - if (iFontHeight>0) - { - charFormat.iFontSpec.iHeight = iFontHeight; - } TBool isBold(EFalse); isBold = iFlags & KFsTreeListItemTextBold; diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -241,6 +241,12 @@ mainIconMetrics, rect, mainIconVariety ); + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (rect.iTl.iY < 15) + { + rect.Move(0, 15 - rect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMainIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMainIconBr.SetTarget(TAlfRealPoint(rect.iBr)); @@ -249,6 +255,12 @@ markIconMetrics, rect, markIconVariety ); + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (rect.iTl.iY < 15) + { + rect.Move(0, 15 - rect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMarkIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMarkIconBr.SetTarget(TAlfRealPoint(rect.iBr)); @@ -257,6 +269,12 @@ menuIconMetrics, rect, menuIconVariety ); + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (rect.iTl.iY < 15) + { + rect.Move(0, 15 - rect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMenuIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMenuIconBr.SetTarget(TAlfRealPoint(rect.iBr)); @@ -275,6 +293,12 @@ CFsLayoutManager::LayoutMetricsText(textRect, textMetrics, textInfo, textPaneVariety); + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (textInfo.iTextRect.iTl.iY < 15) + { + textInfo.iTextRect.Move(0, 15 - textInfo.iTextRect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpTextTl.SetTarget(TAlfRealPoint(textInfo.iTextRect.iTl)); tpTextBr.SetTarget(TAlfRealPoint(textInfo.iTextRect.iBr)); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -227,15 +227,6 @@ TAlfTimedPoint tpMarkIconTl, tpMarkIconBr; TAlfTimedPoint tpMenuIconTl, tpMenuIconBr; - // Platform layout change - /*CFsLayoutManager::TFsLayoutMetrics - mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG3G1, - markIconMetrics = CFsLayoutManager::EFsLmListMediumLineG3G2, - menuIconMetrics = CFsLayoutManager::EFsLmListMediumLineG3G3, - textMetrics = CFsLayoutManager::EFsLmListMediumLineG3T1, - sizeMetrics = CFsLayoutManager::EFsLmListSingleDycRowPane;*/ - - CFsLayoutManager::TFsLayoutMetrics mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1; CFsLayoutManager::TFsLayoutMetrics markIconMetrics = @@ -249,7 +240,6 @@ TInt markIconVariety( 0 ); TInt menuIconVariety( 0 ); TInt textPaneVariety( 0 ); - // Platform layout change if (aData->IsIconCollapsedSet()) { @@ -258,7 +248,6 @@ if ((iFlags & KFsTreeListItemHasMenu) && (iFlags & KFsTreeListItemFocused)) { - // Platform layout change //mainIcon + markIcon + menuIcon //the metrics defined when declared mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1; @@ -268,23 +257,15 @@ textPaneVariety = 3; menuIconVariety = 1; markIconVariety = 2; - // Platform layout change } else { - // Platform layout change //mainIcon + markIcon - /* - mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G1; - markIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G2; - textMetrics = CFsLayoutManager::EFsLmListMediumLineG2T1; - */ mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1; markIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4; mainIconVariety = 4; textPaneVariety = 4; markIconVariety = 3; - // Platform layout change } } else @@ -292,17 +273,12 @@ if ((iFlags & KFsTreeListItemHasMenu) && (iFlags & KFsTreeListItemFocused)) { - // Platform layout change //mainIcon + menuIcon - /*mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G1; - menuIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G2; - textMetrics = CFsLayoutManager::EFsLmListMediumLineG2T1;*/ mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1; menuIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4; mainIconVariety = 4; textPaneVariety = 4; menuIconVariety = 3; - // Platform layout change } else { @@ -314,15 +290,10 @@ } else { - // Platform layout change //mainIcon - /* - mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG1; - textMetrics = CFsLayoutManager::EFsLmListMediumLineT1;*/ mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1; mainIconVariety = 5; textPaneVariety = 5; - // Platform layout change } } } @@ -334,35 +305,19 @@ if ((iFlags & KFsTreeListItemHasMenu) && (iFlags & KFsTreeListItemFocused)) { - // Platform layout change //markIcon + menuIcon - /* - markIconMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconx2G1; - menuIconMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconx2G2; - textMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconx2T1;*/ menuIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG3; markIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4; menuIconVariety = 2; markIconVariety = 4; textPaneVariety = 6; - // Platform layout change } else { - // Platform layout change //markIcon - /* - markIconMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconG1; - textMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconT1;*/ markIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4; markIconVariety = 5; textPaneVariety = 7; - // Platform layout change } } else @@ -370,26 +325,15 @@ if ((iFlags & KFsTreeListItemHasMenu) && (iFlags & KFsTreeListItemFocused)) { - // Platform layout change //menuIcon - /* - menuIconMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconG1; - textMetrics = - CFsLayoutManager::EFsLmListMediumLineRightIconT1;*/ menuIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4; menuIconVariety = 5; textPaneVariety = 7; - // Platform layout change } else { - // Platform layout change //plain item - /*textMetrics = - CFsLayoutManager::EFsLmListMediumLinePlainT1;*/ textPaneVariety = 8; - // Platform layout change } } } @@ -400,16 +344,10 @@ if (iFlags & KFsTreeListItemManagedLayout) { - // Platform layout change - /*CFsLayoutManager::LayoutMetricsSize( - parentLayoutRect, - sizeMetrics, - iSize );*/ CFsLayoutManager::LayoutMetricsSize( parentLayoutRect, CFsLayoutManager::EFsLmListSingleFsDycPane, iSize ); - // Platform layout change } //one line node is not extendable @@ -428,49 +366,48 @@ } - // Platform layout change - /*CFsLayoutManager::LayoutMetricsRect( - currentSize, - mainIconMetrics, - rect );*/ CFsLayoutManager::LayoutMetricsRect( currentSize, mainIconMetrics, rect, mainIconVariety ); - // Platform layout change + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (rect.iTl.iY < 15) + { + rect.Move(0, 15 - rect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMainIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMainIconBr.SetTarget(TAlfRealPoint(rect.iBr)); - // Platform layout change - /*CFsLayoutManager::LayoutMetricsRect( - currentSize, - markIconMetrics, - rect );*/ CFsLayoutManager::LayoutMetricsRect( currentSize, markIconMetrics, rect, markIconVariety ); - // Platform layout change + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (rect.iTl.iY < 15) + { + rect.Move(0, 15 - rect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMarkIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMarkIconBr.SetTarget(TAlfRealPoint(rect.iBr)); - // Platform layout change - /*CFsLayoutManager::LayoutMetricsRect( - currentSize, - menuIconMetrics, - rect );*/ CFsLayoutManager::LayoutMetricsRect( currentSize, menuIconMetrics, rect, menuIconVariety ); - // Platform layout change + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (rect.iTl.iY < 15) + { + rect.Move(0, 15 - rect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMenuIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMenuIconBr.SetTarget(TAlfRealPoint(rect.iBr)); - // Platform layout change TRect textRect( currentSize ); if (textMetrics == CFsLayoutManager::EFsLmListSingleDycRowTextPaneT1) { @@ -482,14 +419,15 @@ } CFsLayoutManager::TFsText textInfo; - /*CFsLayoutManager::LayoutMetricsText(currentSize, textMetrics, textInfo, - textVariety);*/ - CFsLayoutManager::LayoutMetricsText(textRect, textMetrics, textInfo, textPaneVariety); - // Platform layout change - - tpTextTl.SetTarget(TAlfRealPoint(textInfo.iTextRect.iTl)); + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + if (textInfo.iTextRect.iTl.iY < 15) + { + textInfo.iTextRect.Move(0, 15 - textInfo.iTextRect.iTl.iY); + } + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + tpTextTl.SetTarget(TAlfRealPoint(textInfo.iTextRect.iTl)); tpTextBr.SetTarget(TAlfRealPoint(textInfo.iTextRect.iBr)); TInt visualIconIndex = iLayout->FindVisual(iIconVisual); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstreeplaintwolineitemvisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplaintwolineitemvisualizer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstreeplaintwolineitemvisualizer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description : A visualizer for data items with plain text. -* Version : %version: tr1sido#15 % +* Version : %version: tr1sido#16 % * */ @@ -270,21 +270,6 @@ TAlfTimedPoint tpSubjTextTl, tpSubjTextBr; TAlfTimedPoint tpPrevTextTl, tpPrevTextBr; - // Layouts - -/* - CFsLayoutManager::TFsLayoutMetrics - mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineT2G3G1, - markIconMetrics = CFsLayoutManager::EFsLmListMediumLineT2G3G2, - menuIconMetrics = CFsLayoutManager::EFsLmListMediumLineT2G3G3, - // ??? - sizeMetrics = CFsLayoutManager::EFsLmListSingleDycRowPane, - // - exSizeMetrics = CFsLayoutManager::EFsLmListMediumLineX2, - preSizeMetrics = CFsLayoutManager::EFsLmListMediumLineX3, - flagIconMetrics = CFsLayoutManager::EFsLmListMediumLineX2G1; -*/ - CFsLayoutManager::TFsLayoutMetrics mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1, markIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4, @@ -365,19 +350,19 @@ { //mainIcon + markIcon + menuIcon mainIconMetrics = - CFsLayoutManager::EFsLmListSingleDycRowPaneG1;//EFsLmListMediumLineX2T3G4G1; + CFsLayoutManager::EFsLmListSingleDycRowPaneG1; mainIconVariety = 3; if (IsPreviewPaneOn()) { markIconMetrics = - CFsLayoutManager::EFsLmListSingleDycRowPaneG4;//EFsLmListMediumLineX3T4G4G4; + CFsLayoutManager::EFsLmListSingleDycRowPaneG4; markIconVariety = 5; markIconRow = 2; } else { markIconMetrics = - CFsLayoutManager::EFsLmListSingleDycRowPaneG3;//EFsLmListMediumLineX2T3G4G2; + CFsLayoutManager::EFsLmListSingleDycRowPaneG3; markIconVariety = 1; markIconRow = 0; } @@ -999,8 +984,6 @@ firstLineTextMetrics[1] = CFsLayoutManager::EFsLmListSingleDycRowTextPaneT3; firstLineTextVarieties[1] = 24; -// firstLineTextMetrics[2] = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconx2T3; } } else @@ -1030,14 +1013,6 @@ } else if (firstLineTextFields==3) { -// markIconMetrics = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconG1; -// firstLineTextMetrics[0] = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconT1; -// firstLineTextMetrics[1] = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconT2; -// firstLineTextMetrics[2] = -// CFsLayoutManager::EFsLmListMediumLineT32RightIconT2; } } } @@ -1071,14 +1046,6 @@ } else if (firstLineTextFields==3) { -// menuIconMetrics = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconG1; -// firstLineTextMetrics[0] = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconT1; -// firstLineTextMetrics[1] = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconT2; -// firstLineTextMetrics[2] = -// CFsLayoutManager::EFsLmListMediumLineT3RightIconT2; } } else @@ -1281,7 +1248,12 @@ (iFlags & KFsTreeListItemExtended)) { TRect secondLineParentRect; - CFsLayoutManager::LayoutMetricsRect(currentSize, CFsLayoutManager::EFsLmListSingleDycRowPane, secondLineParentRect, 1, 1); + + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + //CFsLayoutManager::LayoutMetricsRect(currentSize, CFsLayoutManager::EFsLmListSingleDycRowPane, secondLineParentRect, 1, 1); + CFsLayoutManager::LayoutMetricsRect(currentSize, CFsLayoutManager::EFsLmListSingleDycRowPane, secondLineParentRect, 2, 1); + // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK + CFsLayoutManager::LayoutMetricsRect(secondLineParentRect, CFsLayoutManager::EFsLmListSingleDycRowTextPane, secondLineParentRect, secondLineTextVariety); CFsLayoutManager::LayoutMetricsText(secondLineParentRect, secondLineTextMetrics, subjTextInfo, secondLineTextVariety); diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/fstreevisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreevisualizerbase.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/uicomponents/src/fstreevisualizerbase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -35,6 +35,7 @@ #include #include #include +#include //brushes #include #include @@ -72,9 +73,13 @@ #include "fsalfscrollbarlayout.h" #include "fsalftextstylemanager.h" #include "fsinteractioninterval.h" +#include "muicscrollbar.h" +#include "cuicaknscrollbaradapter.h" +#include "cuicscrollbar.h" #include + //CONSTANTS const TInt KDefaultShadowWidth = 4; const TInt KFSListDefaultSelectorBorderWidth = 0; @@ -83,7 +88,7 @@ // check from aknphysicsconstants.h const TInt KFlickMaxDuration( 500000 ); -const TInt KDefaultFriction( 35 ); // avkon default is 10 +const TInt KDefaultFriction( 25 ); // avkon default is 10 // ======== LOCAL FUNCTIONS ======== @@ -456,7 +461,7 @@ // --------------------------------------------------------------------------- // TWorld::GetItemRect // --------------------------------------------------------------------------- -TInt TWorld::GetItemRect(const TFsTreeItemId aItemId, TRect& aRect, +TInt TWorld::GetItemRect(const TFsTreeItemId aItemId, TRect& aRect, const TInt aStartIndex ) const { TInt result(KErrNotFound); @@ -913,11 +918,11 @@ // EXPORT_C CFsTreeVisualizerBase* CFsTreeVisualizerBase::NewL( CAlfControl* aOwnerControl, CAlfLayout& aParent, - const TBool aDirectTouchMode) + const TBool aPopUpMode) { FUNC_LOG; CFsTreeVisualizerBase* self = new (ELeave) CFsTreeVisualizerBase( - aOwnerControl, aParent, aDirectTouchMode); + aOwnerControl, aParent, aPopUpMode); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); @@ -947,9 +952,10 @@ delete iWatermark; delete iTextStyleManager; delete iIntx; - // Change scrollbar to avkon (to support skinning & touch) - delete iScrollBar; - // + if ( iScrollBar ) + { + iScrollBar->Destroy(); + } } // --------------------------------------------------------------------------- @@ -1726,7 +1732,7 @@ } // --------------------------------------------------------------------------- -// Gets item vertical position in the list +// Gets item vertical position in the list // --------------------------------------------------------------------------- // TInt CFsTreeVisualizerBase::GetItemWorldPosition( const TInt aIdx ) @@ -1932,7 +1938,7 @@ const TBool aSlideOut) { FUNC_LOG; - iScrollBar->MakeVisible(EFalse); + iScrollBar->Show( EFalse ); if (iDragHandler) { iDragHandler->Reset(); @@ -2529,41 +2535,44 @@ void CFsTreeVisualizerBase::SetItemsAlwaysExtendedL(TBool aAlwaysExtended) { FUNC_LOG; - iFlags.Assign(EItemsAlwaysExtended, aAlwaysExtended); - TFsTreeIterator treeIter( - iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID)); - while (treeIter.HasNext()) - { - TFsTreeItemId itemId(treeIter.Next()); - if (itemId != KFsTreeNoneID && !iTreeData->IsNode(itemId)) + if (iFlags.IsSet(EItemsAlwaysExtended) != aAlwaysExtended ) + { + iFlags.Assign(EItemsAlwaysExtended, aAlwaysExtended); + TFsTreeIterator treeIter( + iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID)); + while (treeIter.HasNext()) { - MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId)); - ApplyListSpecificValuesToItem(itemviz); + TFsTreeItemId itemId(treeIter.Next()); + if (itemId != KFsTreeNoneID && !iTreeData->IsNode(itemId)) + { + MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId)); + ApplyListSpecificValuesToItem(itemviz); + } + } + const TBool isUpdating(iWorld.IsUpdating()); + if (!isUpdating) + { + iWorld.BeginUpdate(); } - } - const TBool isUpdating(iWorld.IsUpdating()); - if (!isUpdating) - { - iWorld.BeginUpdate(); - } - iWorld.RemoveAllL(); - treeIter = iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID, - KFsTreeIteratorSkipCollapsedFlag); - while (treeIter.HasNext()) - { - TFsTreeItemId itemId(treeIter.Next()); - if (itemId != KFsTreeNoneID) + iWorld.RemoveAllL(); + treeIter = iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID, + KFsTreeIteratorSkipCollapsedFlag); + while (treeIter.HasNext()) { - MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId)); - iWorld.AppendL(itemId, itemviz->Size()); + TFsTreeItemId itemId(treeIter.Next()); + if (itemId != KFsTreeNoneID) + { + MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId)); + iWorld.AppendL(itemId, itemviz->Size()); + } } - } - // Below line commetned out. ViewPort is now not moved to the top of mail list - //iViewPort.SetPositionL(TPoint(), EFalse); - iViewPort.ClearCache(); - if (!isUpdating) - { - iWorld.EndUpdateL(); + // Below line commetned out. ViewPort is now not moved to the top of mail list + //iViewPort.SetPositionL(TPoint(), EFalse); + iViewPort.ClearCache(); + if (!isUpdating) + { + iWorld.EndUpdateL(); + } } } @@ -2820,6 +2829,10 @@ break; case EFsTreeRemovedAll: { + if ( iPhysics ) + { + iPhysics->StopPhysics(); + } if (!iWorld.IsUpdating()) { iRootVisualizer->ShowL(*iRootLayout); @@ -3229,7 +3242,7 @@ } else if (iVisualizationState == EFsTreeFadingOut) { - iScrollBar->MakeVisible(EFalse); + iScrollBar->Show( EFalse ); iVisualizationState = EFsTreeHidden; } break; @@ -3291,7 +3304,7 @@ } else if (iVisualizationState == EFsTreeSlidingOut) { - iScrollBar->MakeVisible(EFalse); + iScrollBar->Show( EFalse ); iVisualizationState = EFsTreeHidden; } break; @@ -3328,24 +3341,18 @@ void CFsTreeVisualizerBase::HandleActionL( const TAlfActionCommand& aActionCommand) { - // Change scrollbar to avkon (to support skinning & touch) if (KAknsMessageSkinChange == aActionCommand.Id()) - {//layoout has changed - // HideList(EFalse, EFalse); - // ShowListL(ETrue, EFalse); - iScrollBar->HandleResourceChange(KAknsMessageSkinChange); - } - // + { + iScrollBar->NotifyThemeChanged(); + } } // --------------------------------------------------------------------------- // Hides visible list items. Clears the visible items table. // --------------------------------------------------------------------------- // -// void CFsTreeVisualizerBase::ClearVisibleItemsListL(TBool /*aRemoveAll*/, TBool /*aScrollList*/) -// { FUNC_LOG; } @@ -3665,10 +3672,22 @@ FUNC_LOG; if (iScrollBar->ThumbPosition() != iViewPort.Position().iY) { - iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); - iScrollBar->SetModelL(&iScrollbarModel); - iScrollBar->DrawDeferred(); - } + SetScrollBarModelValues(); + iScrollBar->UpdateModelL(iScrollBarModel); + iScrollBar->Redraw(); + } + } + +// --------------------------------------------------------------------------- +// Sets scrollbar model values. +// --------------------------------------------------------------------------- +// +void CFsTreeVisualizerBase::SetScrollBarModelValues() + { + const TInt pageSize(iViewPort.Size().iHeight); + iScrollBarModel.SetHeight(Max(iWorld.Height(), pageSize)); + iScrollBarModel.SetWindowHeight(pageSize); + iScrollBarModel.SetWindowPosition(iViewPort.Position().iY); } // --------------------------------------------------------------------------- @@ -3682,19 +3701,23 @@ TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); TRect listRect(iRootLayout->DisplayRectTarget()); - listRect.Move(mainPaneRect.iTl); + if (!(iScrollBar->LayoutHints() & MUiCScrollBar::ELayoutRelativeToList)) + { + listRect.Move(mainPaneRect.iTl); + } + else + { + const TPoint& tl( listRect.iTl ); + listRect.Move( -tl.iX, -tl.iY ); + } TRect scrollPane, listPane; CFsLayoutManager::LayoutMetricsRect(listRect, CFsLayoutManager::EFsLmSpFsScrollPane, scrollPane); CFsLayoutManager::LayoutMetricsRect(listRect, CFsLayoutManager::EFsLmMainSpFsListPane, listPane); - - const TInt pageSize(iViewPort.Size().iHeight); - iScrollbarModel.SetScrollSpan(Max(iWorld.Height(), pageSize)); - iScrollbarModel.SetWindowSize(pageSize); - iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); - iScrollBar->SetModelL(&iScrollbarModel); - iScrollBar->DrawDeferred(); + SetScrollBarModelValues(); + iScrollBar->UpdateModelL(iScrollBarModel); + iScrollBar->Redraw(); RArray columns; CleanupClosePushL(columns); @@ -3705,16 +3728,32 @@ iScrollBar->SetRect(scrollPane); if (AknLayoutUtils::LayoutMirrored()) { - columns.AppendL(scrollPane.Width()); - columns.AppendL(listPane.Width()); + if (iScrollBar->LayoutHints() & MUiCScrollBar::ELayoutOnTopOfList) + { + columns.AppendL(0); + columns.AppendL(listRect.Width()); + } + else + { + columns.AppendL(scrollPane.Width()); + columns.AppendL(listPane.Width()); + } } else { - columns.AppendL(listPane.Width()); - columns.AppendL(scrollPane.Width()); + if (iScrollBar->LayoutHints() & MUiCScrollBar::ELayoutOnTopOfList) + { + columns.AppendL(listRect.Width()); + columns.AppendL(0); + } + else + { + columns.AppendL(listPane.Width()); + columns.AppendL(scrollPane.Width()); + } } iComponentLayout->SetColumnsL(columns); - iScrollBar->MakeVisible(ETrue); + iScrollBar->Show(ETrue); updateLayouts = ETrue; } else if (!iViewPort.IsScrollBarNeeded()) @@ -3722,15 +3761,15 @@ if (AknLayoutUtils::LayoutMirrored()) { columns.AppendL(0); - columns.AppendL(listPane.Width()); + columns.AppendL(listRect.Width()); } else { - columns.AppendL(listPane.Width()); + columns.AppendL(listRect.Width()); columns.AppendL(0); } iComponentLayout->SetColumnsL(columns); - iScrollBar->MakeVisible(EFalse); + iScrollBar->Show(EFalse); updateLayouts = ETrue; } CleanupStack::PopAndDestroy(); // columns.Close() @@ -4604,7 +4643,7 @@ // --------------------------------------------------------------------------- // CFsTreeVisualizerBase::CFsTreeVisualizerBase( CAlfControl* aOwnerControl, - CAlfLayout& aParent, const TBool aDirectTouchMode ) + CAlfLayout& aParent, const TBool aPopUpMode ) : iVisualizationState(EFsTreeHidden), iOwnerControl ( aOwnerControl ), iParentLayout ( aParent ), @@ -4640,8 +4679,8 @@ iViewPort( *this, iWorld ) { FUNC_LOG; - iFlags.Set(EAutoRefresh); - iFlags.Assign(EDirectTouchMode, aDirectTouchMode); + iFlags.Set( EAutoRefresh ); + iFlags.Assign( EPopupMode, aPopUpMode ); iFlags.Set( EExpandCollapseOnLongTap ); } // @@ -4660,7 +4699,7 @@ iPhysics = CAknPhysics::NewL(*this, NULL ); iDragHandler = CDragHandler::NewL(*this, iPhysics->HighlightTimeout(), iFlags); - iPhysics->SetFriction(KDefaultFriction); + iPhysics->SetFriction(KDefaultFriction); } iRootData = CFsTreePlainOneLineItemData::NewL(); @@ -4746,17 +4785,24 @@ iScrollbarVisibility = EFsScrollbarShowAlways; - iScrollBar = new (ELeave) CAknDoubleSpanScrollBar(0); - iScrollBar->ConstructL(ETrue, this, 0, CEikScrollBar::EVertical, 1000); - - iScrollbarModel.SetScrollSpan(iComponentLayout->Size().Target().iY); - iScrollbarModel.SetFocusPosition(iViewPort.Position().iY); - iScrollbarModel.SetWindowSize(iListLayout->Size().iY.Target()); - - iScrollBar->MakeVisible(EFalse); - iScrollBar->SetModelL(&iScrollbarModel); - - // + iScrollBarLayout = CAlfAnchorLayout::AddNewL( *iOwnerControl, iListDeck ); + iScrollBarLayout->SetFlags( EAlfVisualFlagIgnorePointer ); + + if ( iFlags.IsSet( EPopupMode ) ) + { + iScrollBar = CUiCAknScrollBarAdapter::NewL( *this ); + } + else + { + iScrollBar = CUiCScrollBar::NewL( iOwnerControl->Env(), iScrollBarLayout ); + } + + iScrollBarModel.SetHeight(iComponentLayout->Size().Target().iY); + iScrollBarModel.SetWindowPosition(iViewPort.Position().iY); + iScrollBarModel.SetWindowHeight(iListLayout->Size().iY.Target()); + + iScrollBar->Show( EFalse ); + iScrollBar->UpdateModelL( iScrollBarModel ); iFadeEffect = CFsFadeEffect::NewL(iOwnerControl, this, iRootLayout, 0); iSlideEffect = CFsSlideEffect::NewL(iOwnerControl, this, iRootLayout, 0); @@ -4773,38 +4819,27 @@ UpdateViewPortL(); } -// Change scrollbar to avkon (to support skinning & touch) // --------------------------------------------------------------------------- // Handle scrollbar events // --------------------------------------------------------------------------- // -void CFsTreeVisualizerBase::HandleScrollEventL(CEikScrollBar* aScrollBar, - TEikScrollEvent aEventType) +void CFsTreeVisualizerBase::HandleScrollEventL( const MUiCScrollBar& aScrollBar, + MUiCScrollBar::TEvent aEvent ) { FUNC_LOG; - - if (iPhysics) - { - iPhysics->StopPhysics(); - } - - if (aScrollBar == iScrollBar) - { - - switch (aEventType) - { - case EEikScrollHome: - //Jump to beginning - break; - case EEikScrollEnd: - //Jump to end - break; - default: - TPoint position(iViewPort.Position()); - position.iY = aScrollBar->ThumbPosition(); - iViewPort.SetPositionL(position); - break; - } + switch (aEvent) + { + case MUiCScrollBar::EScrollHome: + // Home + break; + case MUiCScrollBar::EScrollEnd: + // End + break; + default: + TPoint position(iViewPort.Position()); + position.iY = aScrollBar.ThumbPosition(); + iViewPort.SetPositionL(position); + break; } } @@ -4822,7 +4857,7 @@ } else { - iScrollBar->MakeVisible(EFalse); + iScrollBar->Show( EFalse ); } } @@ -4891,14 +4926,14 @@ rm = CAlfStatic::Env().RefreshMode(); CAlfStatic::Env().SetRefreshMode(EAlfRefreshModeManual); iListLayout->SetFlag(EAlfVisualFlagFreezeLayout); - + if(aUpdateByPhysic == EUpdatedByPhisicEnd) { RArray myVisibleItems; TInt myOffset; CleanupClosePushL(myVisibleItems); aViewPort.GetVisibleItemsL(myVisibleItems, myOffset); - + for (TInt i = 0; i < myVisibleItems.Count(); i++) { const TFsTreeItemId itemId(myVisibleItems[i]); @@ -4906,7 +4941,7 @@ { MFsTreeItemVisualizer* visualizer = iTreeData->ItemVisualizer( itemId); - visualizer->UpdateL(iTreeData->ItemData(itemId), + visualizer->UpdateL(iTreeData->ItemData(itemId), IsItemFocused(itemId) && IsFocusShown(), iTreeData->Level(itemId), iMarkIcon, iMenuIcon, 0); @@ -4960,21 +4995,14 @@ visualizer->ShowL(*iListLayout); TSize size(visualizer->Size()); TInt listInnerWidth(iListLayout->Size().IntTarget().iX); - TAlfTimedPoint tpItemSize(listInnerWidth, size.iHeight); - tpItemSize.SetTarget(TAlfRealPoint(listInnerWidth, size.iHeight), - 0); + TAlfTimedPoint tpItemSize( listInnerWidth, size.iHeight ); CAlfLayout& visualizerLayout(visualizer->Layout()); visualizerLayout.SetSize(tpItemSize); + visualizer->UpdateL(iTreeData->ItemData(itemId), + IsItemFocused(itemId) && IsFocusShown(), + iTreeData->Level(itemId), iMarkIcon, iMenuIcon, + 0); visualizerLayout.PropertySetIntegerL(KPropertyItemId(), itemId); - -// if(aUpdateByPhysic != EUpdatedByPhisic) -// { - visualizer->UpdateL(iTreeData->ItemData(itemId), - IsItemFocused(itemId) && IsFocusShown(), - iTreeData->Level(itemId), iMarkIcon, iMenuIcon, - 0); -// } - visualizerLayout.Brushes()->AppendL(iBorderBrush, EAlfDoesNotHaveOwnership); CAlfBrush* bgBrush(NULL); @@ -5054,7 +5082,7 @@ const TSize worldSize(viewSize.iWidth, Max(iWorld.Height(), viewSize.iHeight)); iPhysics->InitPhysicsL(worldSize, viewSize, EFalse); - iPhysics->SetFriction(KDefaultFriction); + iPhysics->SetFriction(KDefaultFriction); } } @@ -5089,9 +5117,9 @@ void CFsTreeVisualizerBase::PhysicEmulationEnded() { FUNC_LOG; - + TRAP_IGNORE( iViewPort.SetCenterPositionL(iViewPort.CenterPosition(), ETrue, EUpdatedByPhisicEnd)); - + iFlags.Clear(EPhysicsOn); if (iFlags.IsSet(EUpdatePhysicsAfterSimulationFinished)) { diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/uicomponents/src/tuicscrollbarmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/uicomponents/src/tuicscrollbarmodel.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: tuicscrollbarmodel.cpp +* +*/ + +#include "tuicscrollbarmodel.h" +#include "emailtrace.h" + +#include +#include + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::TUiCScrollbarModel +// --------------------------------------------------------------------------- +// +TUiCScrollBarModel::TUiCScrollBarModel() + : iHeight( 0 ), iWindowHeight( 0 ), iWindowPosition( 0 ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::SetHeight +// --------------------------------------------------------------------------- +// +void TUiCScrollBarModel::SetHeight( TInt aHeight ) + { + FUNC_LOG; + iHeight = aHeight; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::Height +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::Height() const + { + FUNC_LOG; + return iHeight; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::SetWindowHeight +// --------------------------------------------------------------------------- +// +void TUiCScrollBarModel::SetWindowHeight( TInt aHeight ) + { + FUNC_LOG; + iWindowHeight = aHeight; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::WindowHeight +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::WindowHeight() const + { + FUNC_LOG; + return iWindowHeight; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::SetWindowPosition +// --------------------------------------------------------------------------- +// +void TUiCScrollBarModel::SetWindowPosition( TInt aPosition ) + { + FUNC_LOG; + iWindowPosition = aPosition; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::WindowPosition +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::WindowPosition() const + { + FUNC_LOG; + return iWindowPosition; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::ThumbHeight +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::ThumbHeight() const + { + FUNC_LOG; + TInt thumbHeight( 0 ); + if ( iHeight > 0 ) + { + thumbHeight = Min( + Max( CalculatedThumbHeight(), MinimumThumbHeight() ), + iWindowHeight ); + } + return thumbHeight; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::ThumbPosition +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::ThumbPosition() const + { + FUNC_LOG; + TInt thumbPosition( 0 ); + if ( iHeight > 0 ) + { + thumbPosition = iWindowHeight * iWindowPosition / iHeight; + if ( iWindowHeight > 0 ) + { + thumbPosition -= (ThumbHeight() - CalculatedThumbHeight()) + * thumbPosition / iWindowHeight; + } + } + return thumbPosition; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::ScrollBarNeeded +// --------------------------------------------------------------------------- +// +TBool TUiCScrollBarModel::ScrollBarNeeded() const + { + FUNC_LOG; + return iWindowHeight < iHeight; + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::MinimumThumbHeight +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::MinimumThumbHeight() const + { + FUNC_LOG; + TAknLayoutRect layoutRect; + TAknWindowComponentLayout layout = AknLayoutScalable_Avkon::aid_size_min_handle(); + layoutRect.LayoutRect( TRect(), layout.LayoutLine() ); + return layoutRect.Rect().Height(); + } + +// --------------------------------------------------------------------------- +// TUiCScrollBarModel::CalculatedThumbHeight +// --------------------------------------------------------------------------- +// +TInt TUiCScrollBarModel::CalculatedThumbHeight() const + { + FUNC_LOG; + TInt thumbHeight( 0 ); + if ( iHeight > 0 ) + { + thumbHeight = iWindowHeight * iWindowHeight / iHeight; + } + return thumbHeight; + } + +// end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/emailwidgetsettings/data/emailwidgetsettings.rss --- a/emailuis/widget/emailwidgetsettings/data/emailwidgetsettings.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/data/emailwidgetsettings.rss Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -27,7 +27,7 @@ #include #include #include "emailwidgetsettings.hrh" -#include "emailwidgetsettings.loc" +#include // RESOURCE DEFINITIONS // ----------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/00/EW.o0000 Binary file emailuis/widget/xuikon/00/EW.o0000 has changed diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/00/emailwidget.css --- a/emailuis/widget/xuikon/00/emailwidget.css Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/xuikon/00/emailwidget.css Wed Mar 31 21:08:33 2010 +0300 @@ -37,15 +37,24 @@ box.row_container { display: block; - padding-top: 0.25u; /* From layout data */ - padding-bottom: 0u; /* From layout data: Padding between rows is included in top padding */ - width: auto; /* From layout data: Fit to screen */ - height: 3.5u; /* From layout data: Height inside padding */ + padding-top: 0.1u; + padding-bottom: 0.2u; + width: auto; + height: 3.5u; block-progression:lr; direction: ltr; nav-index: auto; } +box.line_container +{ + display: block; + padding-top: 2px; + padding-bottom: 0u; + width: auto; + height: 2px; +} + box.setup_row_2_container { display: block; @@ -67,28 +76,6 @@ direction: ltr; } -box.image_container -{ - display: block; - padding-left: 0.5u; /* From layout data */ - padding-right: 0.5u; /* From layout data */ - width: 3.5u; /* From layout data */ - height: auto; /* From layout data: Fills whole row_container height (3.5u) */ - block-progression:lr; - direction: ltr; -} - -box.indicator_image_container -{ - display: block; - padding-left: 0.5u; - padding-right: 0.5u; - width: 3.5u; - height: 3.5u; - block-progression:lr; - direction: ltr; -} - text { display: block; @@ -103,7 +90,7 @@ height: auto; /* From layout data: Fills whole row_container height (3.5u) */ } -text.text_mailbox +text.mailbox_text { padding-left: 0.5u; width: auto; @@ -130,7 +117,28 @@ padding-left: 0.2u; } -image +image.mailbox_icon +{ + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: auto; + _s60-aspect-ratio:preserve +} + +image.indicator_icon { - _s60-aspect-ratio:preserve; + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: 3.5u; + _s60-aspect-ratio:preserve } + +image.horizontal_line +{ + height: auto; + width: auto; + + path: "SKIN(270501603 4967)"; +} \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/00/emailwidget.xml --- a/emailuis/widget/xuikon/00/emailwidget.xml Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/xuikon/00/emailwidget.xml Wed Mar 31 21:08:33 2010 +0300 @@ -19,18 +19,16 @@ - - - - - - + + + + - + @@ -69,43 +67,40 @@ - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - + + + + + + + + + - - - - - - + + + + @@ -122,12 +117,10 @@ - - - - - - + + + + diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/37/emailwidget.css --- a/emailuis/widget/xuikon/37/emailwidget.css Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/xuikon/37/emailwidget.css Wed Mar 31 21:08:33 2010 +0300 @@ -37,15 +37,24 @@ box.row_container { display: block; - padding-top: 0.25u; /* From layout data */ - padding-bottom: 0u; /* From layout data: Padding between rows is included in top padding */ - width: auto; /* From layout data: Fit to screen */ - height: 3.5u; /* From layout data: Height inside padding */ + padding-top: 0.1u; + padding-bottom: 0.2u; + width: auto; + height: 3.5u; block-progression:lr; direction: rtl; nav-index: auto; } +box.line_container +{ + display: block; + padding-top: 2px; + padding-bottom: 0u; + width: auto; + height: 2px; +} + box.setup_row_2_container { display: block; @@ -67,28 +76,6 @@ direction: ltr; } -box.image_container -{ - display: block; - padding-left: 0.5u; /* From layout data */ - padding-right: 0.5u; /* From layout data */ - width: 3.5u; /* From layout data */ - height: auto; /* From layout data: Fills whole row_container height (3.5u) */ - block-progression:lr; - direction: ltr; -} - -box.indicator_image_container -{ - display: block; - padding-left: 0.5u; - padding-right: 0.5u; - width: 3.5u; - height: 3.5u; - block-progression:lr; - direction: ltr; -} - text { display: block; @@ -103,7 +90,7 @@ height: auto; /* From layout data: Fills whole row_container height (3.5u) */ } -text.text_mailbox +text.mailbox_text { padding-left: 0.5u; width: auto; @@ -130,7 +117,28 @@ padding-left: 0.2u; } -image +image.mailbox_icon +{ + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: auto; + _s60-aspect-ratio:preserve +} + +image.indicator_icon { - _s60-aspect-ratio:preserve; + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: 3.5u; + _s60-aspect-ratio:preserve } + +image.horizontal_line +{ + height: auto; + width: auto; + + path: "SKIN(270501603 4967)"; +} \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/50/emailwidget.css --- a/emailuis/widget/xuikon/50/emailwidget.css Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/xuikon/50/emailwidget.css Wed Mar 31 21:08:33 2010 +0300 @@ -37,15 +37,24 @@ box.row_container { display: block; - padding-top: 0.25u; /* From layout data */ - padding-bottom: 0u; /* From layout data: Padding between rows is included in top padding */ - width: auto; /* From layout data: Fit to screen */ - height: 3.5u; /* From layout data: Height inside padding */ + padding-top: 0.1u; + padding-bottom: 0.2u; + width: auto; + height: 3.5u; block-progression:lr; direction: rtl; nav-index: auto; } +box.line_container +{ + display: block; + padding-top: 2px; + padding-bottom: 0u; + width: auto; + height: 2px; +} + box.setup_row_2_container { display: block; @@ -67,28 +76,6 @@ direction: ltr; } -box.image_container -{ - display: block; - padding-left: 0.5u; /* From layout data */ - padding-right: 0.5u; /* From layout data */ - width: 3.5u; /* From layout data */ - height: auto; /* From layout data: Fills whole row_container height (3.5u) */ - block-progression:lr; - direction: ltr; -} - -box.indicator_image_container -{ - display: block; - padding-left: 0.5u; - padding-right: 0.5u; - width: 3.5u; - height: 3.5u; - block-progression:lr; - direction: ltr; -} - text { display: block; @@ -103,7 +90,7 @@ height: auto; /* From layout data: Fills whole row_container height (3.5u) */ } -text.text_mailbox +text.mailbox_text { padding-left: 0.5u; width: auto; @@ -130,7 +117,28 @@ padding-left: 0.2u; } -image +image.mailbox_icon +{ + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: auto; + _s60-aspect-ratio:preserve +} + +image.indicator_icon { - _s60-aspect-ratio:preserve; + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: 3.5u; + _s60-aspect-ratio:preserve } + +image.horizontal_line +{ + height: auto; + width: auto; + + path: "SKIN(270501603 4967)"; +} \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/57/emailwidget.css --- a/emailuis/widget/xuikon/57/emailwidget.css Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/xuikon/57/emailwidget.css Wed Mar 31 21:08:33 2010 +0300 @@ -37,15 +37,24 @@ box.row_container { display: block; - padding-top: 0.25u; /* From layout data */ - padding-bottom: 0u; /* From layout data: Padding between rows is included in top padding */ - width: auto; /* From layout data: Fit to screen */ - height: 3.5u; /* From layout data: Height inside padding */ + padding-top: 0.1u; + padding-bottom: 0.2u; + width: auto; + height: 3.5u; block-progression:lr; direction: rtl; nav-index: auto; } +box.line_container +{ + display: block; + padding-top: 2px; + padding-bottom: 0u; + width: auto; + height: 2px; +} + box.setup_row_2_container { display: block; @@ -67,28 +76,6 @@ direction: ltr; } -box.image_container -{ - display: block; - padding-left: 0.5u; /* From layout data */ - padding-right: 0.5u; /* From layout data */ - width: 3.5u; /* From layout data */ - height: auto; /* From layout data: Fills whole row_container height (3.5u) */ - block-progression:lr; - direction: ltr; -} - -box.indicator_image_container -{ - display: block; - padding-left: 0.5u; - padding-right: 0.5u; - width: 3.5u; - height: 3.5u; - block-progression:lr; - direction: ltr; -} - text { display: block; @@ -103,7 +90,7 @@ height: auto; /* From layout data: Fills whole row_container height (3.5u) */ } -text.text_mailbox +text.mailbox_text { padding-left: 0.5u; width: auto; @@ -130,7 +117,28 @@ padding-left: 0.2u; } -image +image.mailbox_icon +{ + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: auto; + _s60-aspect-ratio:preserve +} + +image.indicator_icon { - _s60-aspect-ratio:preserve; + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: 3.5u; + _s60-aspect-ratio:preserve } + +image.horizontal_line +{ + height: auto; + width: auto; + + path: "SKIN(270501603 4967)"; +} \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 emailuis/widget/xuikon/94/emailwidget.css --- a/emailuis/widget/xuikon/94/emailwidget.css Mon Mar 15 12:39:10 2010 +0200 +++ b/emailuis/widget/xuikon/94/emailwidget.css Wed Mar 31 21:08:33 2010 +0300 @@ -37,15 +37,24 @@ box.row_container { display: block; - padding-top: 0.25u; /* From layout data */ - padding-bottom: 0u; /* From layout data: Padding between rows is included in top padding */ - width: auto; /* From layout data: Fit to screen */ - height: 3.5u; /* From layout data: Height inside padding */ + padding-top: 0.1u; + padding-bottom: 0.2u; + width: auto; + height: 3.5u; block-progression:lr; direction: rtl; nav-index: auto; } +box.line_container +{ + display: block; + padding-top: 2px; + padding-bottom: 0u; + width: auto; + height: 2px; +} + box.setup_row_2_container { display: block; @@ -67,28 +76,6 @@ direction: ltr; } -box.image_container -{ - display: block; - padding-left: 0.5u; /* From layout data */ - padding-right: 0.5u; /* From layout data */ - width: 3.5u; /* From layout data */ - height: auto; /* From layout data: Fills whole row_container height (3.5u) */ - block-progression:lr; - direction: ltr; -} - -box.indicator_image_container -{ - display: block; - padding-left: 0.5u; - padding-right: 0.5u; - width: 3.5u; - height: 3.5u; - block-progression:lr; - direction: ltr; -} - text { display: block; @@ -103,7 +90,7 @@ height: auto; /* From layout data: Fills whole row_container height (3.5u) */ } -text.text_mailbox +text.mailbox_text { padding-left: 0.5u; width: auto; @@ -130,7 +117,28 @@ padding-left: 0.2u; } -image +image.mailbox_icon +{ + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: auto; + _s60-aspect-ratio:preserve +} + +image.indicator_icon { - _s60-aspect-ratio:preserve; + padding-left: 0.5u; + padding-right: 0.5u; + width: 3.5u; + height: 3.5u; + _s60-aspect-ratio:preserve } + +image.horizontal_line +{ + height: auto; + width: auto; + + path: "SKIN(270501603 4967)"; +} \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 help/data/xhtml.zip Binary file help/data/xhtml.zip has changed diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp --- a/ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -71,9 +71,6 @@ LIBRARY IpsSosSettings.lib LIBRARY cmaillogger.lib LIBRARY cmmanager.lib - -#ifdef TRACE_INTO_FILE LIBRARY flogger.lib -#endif // TRACE_INTO_FILE DEFFILE IPSSOSAOPLUGIN.DEF diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssosplugin/EABI/IPSSOSPLUGINU.DEF --- a/ipsservices/ipssosplugin/EABI/IPSSOSPLUGINU.DEF Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssosplugin/EABI/IPSSOSPLUGINU.DEF Wed Mar 31 21:08:33 2010 +0300 @@ -20,56 +20,56 @@ _ZN22CIpsPlgSingleOpWatcherD2Ev @ 19 NONAME _ZN34CIpsPlgConnectAndRefreshFolderList4NewLER11CMsvSessioniR14TRequestStatuslR12TFSMailMsgIdR18CMsvEntrySelectionR22MFSMailRequestObserverR21CIpsPlgTimerOperation @ 20 NONAME _ZNK22CIpsPlgSingleOpWatcher9OperationEv @ 21 NONAME - _ZTI13TIpsPlgMsgKey @ 22 NONAME ; ## - _ZTI14CIpsPlgMruList @ 23 NONAME ; ## - _ZTI14TIpsPlgMsgSwap @ 24 NONAME ; ## - _ZTI15CIPSAccountInfo @ 25 NONAME ; ## - _ZTI17CIpsPlgEventTimer @ 26 NONAME ; ## - _ZTI17CIpsPlgPop3Plugin @ 27 NONAME ; ## - _ZTI18CIpsPlgDeleteLocal @ 28 NONAME ; ## - _ZTI18CIpsPlgImap4Plugin @ 29 NONAME ; ## - _ZTI19CIpsFetchProgReport @ 30 NONAME ; ## - _ZTI19CIpsPlgDeleteRemote @ 31 NONAME ; ## - _ZTI19CIpsPlgDisconnectOp @ 32 NONAME ; ## - _ZTI19CIpsPlgEventHandler @ 33 NONAME ; ## - _ZTI20CIpsPlgBaseOperation @ 34 NONAME ; ## - _ZTI20CIpsPlgPop3ConnectOp @ 35 NONAME ; ## - _ZTI20CIpsPlgSosBasePlugin @ 36 NONAME ; ## - _ZTI21CIpsPlgImap4ConnectOp @ 37 NONAME ; ## - _ZTI21CIpsPlgTimerOperation @ 38 NONAME ; ## - _ZTI22CIpsPlgImap4PopulateOp @ 39 NONAME ; ## - _ZTI22CIpsPlgOnlineOperation @ 40 NONAME ; ## - _ZTI22CIpsPlgPropertyWatcher @ 41 NONAME ; ## - _ZTI22CIpsPlgSingleOpWatcher @ 42 NONAME ; ## - _ZTI23CIpsPlgSettingsObserver @ 43 NONAME ; ## - _ZTI24CIpsPlgImap4MoveRemoteOp @ 44 NONAME ; ## - _ZTI25CIpsPlgPop3FetchOperation @ 45 NONAME ; ## - _ZTI29CIpsPlgImap4FetchAttachmentOp @ 46 NONAME ; ## - _ZTI34CIpsPlgConnectAndRefreshFolderList @ 47 NONAME ; ## - _ZTV13TIpsPlgMsgKey @ 48 NONAME ; ## - _ZTV14CIpsPlgMruList @ 49 NONAME ; ## - _ZTV14TIpsPlgMsgSwap @ 50 NONAME ; ## - _ZTV15CIPSAccountInfo @ 51 NONAME ; ## - _ZTV17CIpsPlgEventTimer @ 52 NONAME ; ## - _ZTV17CIpsPlgPop3Plugin @ 53 NONAME ; ## - _ZTV18CIpsPlgDeleteLocal @ 54 NONAME ; ## - _ZTV18CIpsPlgImap4Plugin @ 55 NONAME ; ## - _ZTV19CIpsFetchProgReport @ 56 NONAME ; ## - _ZTV19CIpsPlgDeleteRemote @ 57 NONAME ; ## - _ZTV19CIpsPlgDisconnectOp @ 58 NONAME ; ## - _ZTV19CIpsPlgEventHandler @ 59 NONAME ; ## - _ZTV20CIpsPlgBaseOperation @ 60 NONAME ; ## - _ZTV20CIpsPlgPop3ConnectOp @ 61 NONAME ; ## - _ZTV20CIpsPlgSosBasePlugin @ 62 NONAME ; ## - _ZTV21CIpsPlgImap4ConnectOp @ 63 NONAME ; ## - _ZTV21CIpsPlgTimerOperation @ 64 NONAME ; ## - _ZTV22CIpsPlgImap4PopulateOp @ 65 NONAME ; ## - _ZTV22CIpsPlgOnlineOperation @ 66 NONAME ; ## - _ZTV22CIpsPlgPropertyWatcher @ 67 NONAME ; ## - _ZTV22CIpsPlgSingleOpWatcher @ 68 NONAME ; ## - _ZTV23CIpsPlgSettingsObserver @ 69 NONAME ; ## - _ZTV24CIpsPlgImap4MoveRemoteOp @ 70 NONAME ; ## - _ZTV25CIpsPlgPop3FetchOperation @ 71 NONAME ; ## - _ZTV29CIpsPlgImap4FetchAttachmentOp @ 72 NONAME ; ## - _ZTV34CIpsPlgConnectAndRefreshFolderList @ 73 NONAME ; ## + _ZTI13TIpsPlgMsgKey @ 22 NONAME + _ZTI14CIpsPlgMruList @ 23 NONAME + _ZTI14TIpsPlgMsgSwap @ 24 NONAME + _ZTI15CIPSAccountInfo @ 25 NONAME + _ZTI17CIpsPlgEventTimer @ 26 NONAME + _ZTI17CIpsPlgPop3Plugin @ 27 NONAME + _ZTI18CIpsPlgDeleteLocal @ 28 NONAME + _ZTI18CIpsPlgImap4Plugin @ 29 NONAME + _ZTI19CIpsFetchProgReport @ 30 NONAME + _ZTI19CIpsPlgDeleteRemote @ 31 NONAME + _ZTI19CIpsPlgDisconnectOp @ 32 NONAME + _ZTI19CIpsPlgEventHandler @ 33 NONAME + _ZTI20CIpsPlgBaseOperation @ 34 NONAME + _ZTI20CIpsPlgPop3ConnectOp @ 35 NONAME + _ZTI20CIpsPlgSosBasePlugin @ 36 NONAME + _ZTI21CIpsPlgImap4ConnectOp @ 37 NONAME + _ZTI21CIpsPlgTimerOperation @ 38 NONAME + _ZTI22CIpsPlgImap4PopulateOp @ 39 NONAME + _ZTI22CIpsPlgOnlineOperation @ 40 NONAME + _ZTI22CIpsPlgPropertyWatcher @ 41 NONAME + _ZTI22CIpsPlgSingleOpWatcher @ 42 NONAME + _ZTI23CIpsPlgSettingsObserver @ 43 NONAME + _ZTI24CIpsPlgImap4MoveRemoteOp @ 44 NONAME + _ZTI25CIpsPlgPop3FetchOperation @ 45 NONAME + _ZTI29CIpsPlgImap4FetchAttachmentOp @ 46 NONAME + _ZTI34CIpsPlgConnectAndRefreshFolderList @ 47 NONAME + _ZTV13TIpsPlgMsgKey @ 48 NONAME + _ZTV14CIpsPlgMruList @ 49 NONAME + _ZTV14TIpsPlgMsgSwap @ 50 NONAME + _ZTV15CIPSAccountInfo @ 51 NONAME + _ZTV17CIpsPlgEventTimer @ 52 NONAME + _ZTV17CIpsPlgPop3Plugin @ 53 NONAME + _ZTV18CIpsPlgDeleteLocal @ 54 NONAME + _ZTV18CIpsPlgImap4Plugin @ 55 NONAME + _ZTV19CIpsFetchProgReport @ 56 NONAME + _ZTV19CIpsPlgDeleteRemote @ 57 NONAME + _ZTV19CIpsPlgDisconnectOp @ 58 NONAME + _ZTV19CIpsPlgEventHandler @ 59 NONAME + _ZTV20CIpsPlgBaseOperation @ 60 NONAME + _ZTV20CIpsPlgPop3ConnectOp @ 61 NONAME + _ZTV20CIpsPlgSosBasePlugin @ 62 NONAME + _ZTV21CIpsPlgImap4ConnectOp @ 63 NONAME + _ZTV21CIpsPlgTimerOperation @ 64 NONAME + _ZTV22CIpsPlgImap4PopulateOp @ 65 NONAME + _ZTV22CIpsPlgOnlineOperation @ 66 NONAME + _ZTV22CIpsPlgPropertyWatcher @ 67 NONAME + _ZTV22CIpsPlgSingleOpWatcher @ 68 NONAME + _ZTV23CIpsPlgSettingsObserver @ 69 NONAME + _ZTV24CIpsPlgImap4MoveRemoteOp @ 70 NONAME + _ZTV25CIpsPlgPop3FetchOperation @ 71 NONAME + _ZTV29CIpsPlgImap4FetchAttachmentOp @ 72 NONAME + _ZTV34CIpsPlgConnectAndRefreshFolderList @ 73 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssosplugin/group/IPSSosPlugin.mmp --- a/ipsservices/ipssosplugin/group/IPSSosPlugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssosplugin/group/IPSSosPlugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -103,10 +103,7 @@ LIBRARY avkon.lib LIBRARY cmaillogger.lib LIBRARY featmgr.lib +LIBRARY flogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE - DEFFILE IPSSOSPLUGIN.DEF diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h --- a/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h Wed Mar 31 21:08:33 2010 +0300 @@ -216,6 +216,7 @@ EStateIdle, EStateConnecting, EStateFetching, + EStateWaiting, EStateDisconnecting }; TFetchState iState; @@ -232,7 +233,11 @@ TMsvId iService; TBool iPopulated; CIpsFetchProgReport* iProgReport; + // Temporary fix for handling KErrServerBusy errors from the + // messaging service. Remove these once the appropriate observer + // mechanism has been implemented in the messaging service. TInt iRetryCount; + RTimer iRetryTimer; }; #endif //__IPSPLGIMAP4FETCHATTACHMENTOP_H__ diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -23,6 +23,8 @@ // Constants and defines const TInt KFetchOpPriority = CActive::EPriorityStandard; const TInt KIpsAttaFetchProgressReportInterval = 1000000; // 1 sec +const TInt KIpsAttaFetchRetryInterval = 1000000; // 1 sec +const TInt KIpsAttaFetchRetryCount = 30; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- @@ -157,6 +159,7 @@ { FUNC_LOG; iService = aService; + iRetryTimer.CreateLocal(); } // ---------------------------------------------------------------------------- @@ -164,6 +167,7 @@ CIpsPlgImap4FetchAttachmentOp::~CIpsPlgImap4FetchAttachmentOp() { FUNC_LOG; + iRetryTimer.Close(); delete iSelection; delete iProgReport; } @@ -238,6 +242,11 @@ DoFetchAttachmentL(); break; } + case EStateWaiting: + { + DoFetchAttachmentL(); + break; + } case EStateFetching: { delete iProgReport; @@ -245,11 +254,16 @@ TInt err = iStatus.Int(); - // If the server was busy, try again a few times. - if ( err == KErrServerBusy && iRetryCount < 3 ) + // If the server was busy, try again after a short delay, up to + // some retry limit. + if ( err == KErrServerBusy && iRetryCount < KIpsAttaFetchRetryCount ) { iRetryCount++; - DoFetchAttachmentL(); + INFO_1( "CIpsPlgImap4FetchAttachmentOp::DoRunL: iRetryCount = %d", iRetryCount ); + iState = EStateWaiting; + iStatus = KRequestPending; + iRetryTimer.After( iStatus, KIpsAttaFetchRetryInterval ); + SetActive(); } else { diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/data/ipssetuimailsettings.ra --- a/ipsservices/ipssossettings/data/ipssetuimailsettings.ra Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/data/ipssetuimailsettings.ra Wed Mar 31 21:08:33 2010 +0300 @@ -460,7 +460,7 @@ itemid = EIpsSetUiWhatRetrievePop3; itemlabel = qtn_fse_settings_mail_downl_ctrl_retrieve_limit; itemarray = r_ips_set_what_to_sync_array_email_retrieve_pop3; - itemflags = KIpsSetUiFlagPop3Only; + itemflags = KIpsSetUiFlagPop3Only | KIpsSetUiFlagLangSpecificNumConv; }, // Emails to retrieve (IMAP4) IPS_SET_ITEM @@ -518,6 +518,7 @@ itemid = EIpsSetUiWhenHours; itemlabel = qtn_fse_settings_mail_conn_hours; itemarray = r_ips_set_when_to_sync_array_sync_hours; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // Update Interval IPS_SET_ITEM @@ -526,6 +527,7 @@ itemid = EIpsSetUiWhenSchedule; itemlabel = qtn_fse_settings_mail_interval; itemarray = r_ips_set_when_to_sync_array_sync_schedule; + itemflags = KIpsSetUiFlagLangSpecificNumConv; } }; } @@ -766,7 +768,8 @@ itemtype = EIpsSetUiItemValue; itemid = EIpsSetUiWhatRetrievePop3EditCustom; itemlabel = qtn_fse_settings_mail_retrieve_amount; - itemflags = KIpsSetUiFlagPermanentlyHidden; + itemflags = KIpsSetUiFlagPermanentlyHidden | + KIpsSetUiFlagForceMustFill; } }; } @@ -789,6 +792,7 @@ itemlabel = qtn_fse_settings_mail_retrieve_from_inbox; itemarray = r_ips_set_what_to_sync_array_email_retrieve_imap4_inbox; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // IPS_SET_ITEM @@ -798,6 +802,7 @@ itemlabel = qtn_fse_settings_mail_retrieve_from_folders; itemarray = r_ips_set_what_to_sync_array_email_retrieve_imap4_folder; + itemflags = KIpsSetUiFlagLangSpecificNumConv; } }; } @@ -833,7 +838,8 @@ itemtype = EIpsSetUiItemValue; itemid = EIpsSetUiWhatRetrieveImap4InboxEditCustom; itemlabel = qtn_fse_settings_mail_retrieve_amount; - itemflags = KIpsSetUiFlagPermanentlyHidden; + itemflags = KIpsSetUiFlagPermanentlyHidden | + KIpsSetUiFlagForceMustFill; } }; } @@ -869,7 +875,8 @@ itemtype = EIpsSetUiItemValue; itemid = EIpsSetUiWhatRetrieveImap4FolderEditCustom; itemlabel = qtn_fse_settings_mail_retrieve_amount; - itemflags = KIpsSetUiFlagPermanentlyHidden; + itemflags = KIpsSetUiFlagPermanentlyHidden | + KIpsSetUiFlagForceMustFill; } }; } @@ -934,6 +941,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn5Min; itemlabel = qtn_fse_settings_mail_interval_5min; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "10 minutes" -option IPS_SET_ITEM @@ -941,6 +949,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn10Min; itemlabel = qtn_fse_settings_mail_interval_10min; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "15 minutes" -option IPS_SET_ITEM @@ -948,6 +957,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn15Min; itemlabel = qtn_fse_settings_mail_interval_15min; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "30 minutes" -option IPS_SET_ITEM @@ -955,6 +965,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn30Min; itemlabel = qtn_fse_settings_mail_interval_30min; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "1 hour" -option IPS_SET_ITEM @@ -962,6 +973,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn1Hour; itemlabel = qtn_fse_settings_mail_interval_1hour; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "4 hours" -option IPS_SET_ITEM @@ -969,6 +981,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn4Hours; itemlabel = qtn_fse_settings_mail_interval_4hours; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "12 hours" -option IPS_SET_ITEM @@ -976,6 +989,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn12Hours; itemlabel = qtn_fse_settings_mail_interval_12hours; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "1 day" -option IPS_SET_ITEM @@ -983,6 +997,7 @@ itemtype = EIpsSetUiItemRadioButton; itemid = EIpsSetUiWhenScheduleBtn1Day; itemlabel = qtn_fse_settings_mail_interval_1day; + itemflags = KIpsSetUiFlagLangSpecificNumConv; }, // "Notification" -option IPS_SET_ITEM diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/group/ipssossettings.mmp --- a/ipsservices/ipssossettings/group/ipssossettings.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/group/ipssossettings.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -131,10 +131,7 @@ LIBRARY ipssosplugin.lib LIBRARY CdlEngine.lib LIBRARY cmaillogger.lib - -#ifdef TRACE_INTO_FILE LIBRARY flogger.lib -#endif // TRACE_INTO_FILE START wins BASEADDRESS 0x4A980000 diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/inc/ipssetdata.h --- a/ipsservices/ipssossettings/inc/ipssetdata.h Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/inc/ipssetdata.h Wed Mar 31 21:08:33 2010 +0300 @@ -394,7 +394,17 @@ void SetIapL( TImIAPChoice aIncomingIap, TImIAPChoice aOutgoingIap ); + /** + * + * @param aIncomingIap Incoming access point to be stored. + * @param aOutgoingIap Outgoing access point to be stored. + */ + void SetIapL( + const CImIAPPreferences& aIncomingIap, + const CImIAPPreferences& aOutgoingIap ); + + /** * @param aIncomingSecurity Incoming security to be stored. * @param aOutgoingSecurity Outgoing security to be stored. diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/inc/ipssetuidialog.h --- a/ipsservices/ipssossettings/inc/ipssetuidialog.h Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/inc/ipssetuidialog.h Wed Mar 31 21:08:33 2010 +0300 @@ -251,6 +251,14 @@ TImIAPChoice GetIapChoiceL( const TUid& aId ) const; /** + * Gets IapPrefs from the item. + * + * @return Access point preferences item. + */ + CImIAPPreferences& GetIapPrefsL(const TUid& aId); + + + /** * Initialize signature item * * @param aBaseItem Signature item for init diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/inc/ipssetuiitemaccesspoint.h --- a/ipsservices/ipssossettings/inc/ipssetuiitemaccesspoint.h Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/inc/ipssetuiitemaccesspoint.h Wed Mar 31 21:08:33 2010 +0300 @@ -74,6 +74,11 @@ void InitL( const TImIAPChoice& aIapChoice ); /** + * @param aIapPrefs full Iap data used for initialization. + */ + void InitL( const CImIAPPreferences* aIapPrefs ); + + /** * Updates the setting item text */ void UpdateL(); @@ -84,6 +89,21 @@ TUint32 GetIapIdL(); /** + * Get the access point choice (ID & preference) + */ + TImIAPChoice GetIapChoice(); + + /** + * Creates/updates and returns extended Iap preferences + */ + CImIAPPreferences& GetExtendedIapPreferencesL(); + + /** + * Get the selection setting i.e. EDestination + */ + TCmSettingSelection GetIapSelection(); + + /** * Returns the name of the specified access point * * @return HBufC* Access point name @@ -171,6 +191,18 @@ * Owned. */ RArray iIapList; + + private: + /** + * Method or Destination + */ + TCmSettingSelection iIapSel; + + /** + * Added for exporting iap data as CImIAPPreferences object + */ + CImIAPPreferences* iFullIapPrefs; + }; #endif /* CIPSSETUIITEMACCESSPOINT_H */ diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/inc/ipssetview.h --- a/ipsservices/ipssossettings/inc/ipssetview.h Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/inc/ipssetview.h Wed Mar 31 21:08:33 2010 +0300 @@ -24,6 +24,8 @@ #include "esmailsettingsplugin.h" // +// Forward declarations +class CAknLocalScreenClearer; // class declaration class CIpsSetView : public CESMailSettingsPlugin @@ -85,6 +87,7 @@ CAsyncCallBack* iAsyncCallback; TVwsViewId iPrevViewId; HBufC8* iCustomMessage; + CAknLocalScreenClearer* iLocalScreenClearer; }; #endif //IPSSETVIEW_H_ diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/src/ipssetdata.cpp --- a/ipsservices/ipssossettings/src/ipssetdata.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetdata.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -523,7 +523,11 @@ ret.iIAP = 0; if ( aIncoming ) { - + if (iIncomingIapPref->SNAPDefined()) + { + ret.iIAP = iIncomingIapPref->SNAPPreference(); + } + if ( iIncomingIapPref->NumberOfIAPs() > 0 ) { ret = iIncomingIapPref->IAPPreference(0); @@ -916,10 +920,50 @@ CleanupStack::Pop( iIncomingIapPref ); iOutgoingIapPref = CImIAPPreferences::NewLC(); CleanupStack::Pop( iOutgoingIapPref ); - iIncomingIapPref->AddIAPL( aIncomingIap ); iOutgoingIapPref->AddIAPL( aOutgoingIap ); } +// --------------------------------------------------------------------------- +// CIpsSetData::SetIapL() +// --------------------------------------------------------------------------- +// +void CIpsSetData::SetIapL( + const CImIAPPreferences& aIncomingIap, + const CImIAPPreferences& aOutgoingIap ) + { + FUNC_LOG; + // This is not ideal choice, but current situation forces to do this, + // until Reset() funcion is exported from class CImIAPPreferences + delete iIncomingIapPref; + iIncomingIapPref = NULL; + delete iOutgoingIapPref; + iOutgoingIapPref = NULL; + + iIncomingIapPref = CImIAPPreferences::NewLC(); + CleanupStack::Pop( iIncomingIapPref ); + iOutgoingIapPref = CImIAPPreferences::NewLC(); + CleanupStack::Pop( iOutgoingIapPref ); + + if (aIncomingIap.SNAPDefined()) + { + iIncomingIapPref->SetSNAPL(aIncomingIap.SNAPPreference()); + } + else + { + iIncomingIapPref->AddIAPL( aIncomingIap.IAPPreference(0) ); + } + + if (aOutgoingIap.SNAPDefined()) + { + iOutgoingIapPref->SetSNAPL(aOutgoingIap.SNAPPreference()); + } + else + { + iOutgoingIapPref->AddIAPL( aOutgoingIap.IAPPreference(0) ); + } + + } + // --------------------------------------------------------------------------- // CIpsSetData::SetSecurity() diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/src/ipssetuidialog.cpp --- a/ipsservices/ipssossettings/src/ipssetuidialog.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetuidialog.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -666,9 +666,9 @@ iData->SetMailServerL( GetItem( TUid::Uid( EIpsSetUiIncomingMailServer ) )->Text(), GetItem( TUid::Uid( EIpsSetUiOutgoingMailServer ) )->Text() ); - iData->SetIapL( - GetIapChoiceL( TUid::Uid( EIpsSetUiIncomingIap ) ), - GetIapChoiceL( TUid::Uid( EIpsSetUiOutgoingIap ) ) ); + iData->SetIapL( + GetIapPrefsL( TUid::Uid( EIpsSetUiIncomingIap ) ), + GetIapPrefsL( TUid::Uid( EIpsSetUiOutgoingIap ) ) ); iData->SetSecurity( GetItem( TUid::Uid( EIpsSetUiIncomingSecurity ) )->Value(), GetItem( TUid::Uid( EIpsSetUiOutgoingSecurity ) )->Value() ); @@ -685,6 +685,7 @@ GetItem( TUid::Uid( EIpsSetUiWhatDownloadSize ) )->Value(), GetItem( TUid::Uid( EIpsSetUiWhatDownloadSizeEditPlus ) )->Value() ); StoreRetrievalLimit(); + iData->SetSchedule( GetItem( TUid::Uid( EIpsSetUiWhenSchedule ) )->Value(), EFalse ); iData->SetDays( @@ -745,6 +746,22 @@ } // --------------------------------------------------------------------------- +// CIpsSetUiDialogCtrl::GetIapPrefsL() +// --------------------------------------------------------------------------- +// +CImIAPPreferences& CIpsSetUiDialogCtrl::GetIapPrefsL(const TUid& aId) + { + FUNC_LOG; + + CIpsSetUiItemAccessPoint* ap = + static_cast( GetItem( aId ) ); + + CImIAPPreferences& prefs = ap->GetExtendedIapPreferencesL(); + + return prefs; + } + +// --------------------------------------------------------------------------- // CIpsSetUiDialogCtrl::OfferKeyEventL() // --------------------------------------------------------------------------- // @@ -1360,8 +1377,11 @@ FUNC_LOG; CIpsSetUiItemAccessPoint* iapItem = static_cast( &aBaseItem ); - iapItem->InitL( iData->Iap( - aBaseItem.iItemId.iUid == EIpsSetUiIncomingIap ) ); + //check which iap we are initializing + if ( aBaseItem.iItemId.iUid == EIpsSetUiIncomingIap ) + iapItem->InitL( iData->IncomingIapPref() ); + else + iapItem->InitL( iData->OutgoingIapPref() ); } // --------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/src/ipssetuiitemaccesspoint.cpp --- a/ipsservices/ipssossettings/src/ipssetuiitemaccesspoint.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetuiitemaccesspoint.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -26,6 +26,7 @@ #include "ipssetuiitemaccesspoint.h" +const TInt KDefaultIapIndex = 0; // ============================ MEMBER FUNCTIONS =============================== @@ -37,7 +38,8 @@ : iIapType( ECuuUserDefined ), iIapPref( ECommDbDialogPrefUnknown ), - iIapId( 0 ) + iIapId( 0 ), + iFullIapPrefs(NULL) { FUNC_LOG; } @@ -51,6 +53,9 @@ FUNC_LOG; iIapList.Close(); iCommMethodManager.Close(); + + if (iFullIapPrefs) + delete iFullIapPrefs; } // ---------------------------------------------------------------------------- @@ -62,6 +67,9 @@ FUNC_LOG; CIpsSetUiItemLink::ConstructL(); iCommMethodManager.OpenL(); + + iIapSel.iResult = CMManager::EAlwaysAsk; + iIapSel.iId = 0; } // ---------------------------------------------------------------------------- @@ -111,8 +119,10 @@ iIapType = aIapItem.iIapType; //iIapRadioButton = aIapItem.iIapRadioButton; iIapPref = aIapItem.iIapPref; - iIapId = aIapItem.iIapId; - + iIapId = aIapItem.iIapId; + iIapSel.iId = aIapItem.iIapSel.iId; + iIapSel.iResult = aIapItem.iIapSel.iResult; + return *this; } @@ -140,6 +150,11 @@ { result = LaunchIapPageL( iapId ); } + else + { + iIapSel.iId = 0; + iIapSel.iResult = CMManager::EAlwaysAsk; + } } // Everything is fine, finally update the setting item @@ -180,8 +195,9 @@ // be fetched from the list. if( iIapType == ECuuUserDefined ) { - iItemSettingText->Copy( AccessPointNameLC()->Des() ); - CleanupStack::PopAndDestroy(); //AccessPointNameLC() + HBufC* accPointName = AccessPointNameLC(); + iItemSettingText->Copy( accPointName->Des()); + CleanupStack::PopAndDestroy(accPointName); //AccessPointNameLC() } else { @@ -201,10 +217,23 @@ { FUNC_LOG; HBufC* bearerName( NULL ); - RCmConnectionMethod method = iCommMethodManager.ConnectionMethodL( iIapId ); - CleanupClosePushL( method ); - bearerName = method.GetStringAttributeL( CMManager::ECmName ); - CleanupStack::PopAndDestroy(); //method + //check if method or destination is selected + if (iIapSel.iResult == CMManager::EDestination) + { + RCmDestination dest = iCommMethodManager.DestinationL(iIapSel.iId); + CleanupClosePushL(dest); + bearerName = dest.NameLC(); + CleanupStack::Pop(bearerName); + CleanupStack::PopAndDestroy(&dest); //dest + } + else + { + RCmConnectionMethod method = iCommMethodManager.ConnectionMethodL( iIapId ); + CleanupClosePushL( method ); + bearerName = method.GetStringAttributeL( CMManager::ECmName ); + CleanupStack::PopAndDestroy(&method); //method + } + CleanupStack::PushL( bearerName ); return bearerName; } @@ -242,13 +271,24 @@ TCmSettingSelection selection; TBearerFilterArray filterArray; //Set focus to the currently selected access point - selection.iId = iIapId; - selection.iResult = CMManager::EConnectionMethod; + selection.iId = iIapSel.iId; + selection.iResult =iIapSel.iResult; CCmApplicationSettingsUi* settingsUi = CCmApplicationSettingsUi::NewLC(); - TUint apFilter = CMManager::EShowConnectionMethods; + TUint apFilter = CMManager::EShowDestinations|CMManager::EShowConnectionMethods; + result = settingsUi->RunApplicationSettingsL( selection, apFilter, filterArray ); - aIapId = result ? selection.iId : ( TUint32 )KErrNotFound; + CleanupStack::PopAndDestroy( settingsUi ); + + // store selection + if (result) + { + aIapId = selection.iId; + iIapSel = selection; + } + else + aIapId = ( TUint32 )KErrNotFound; + // Return the quit method return result ? KErrNone : KErrCancel; } @@ -266,10 +306,9 @@ // Open the always ask -page TBool ok = dialog->AlwaysAskPageL( aAlwaysAsk ); - + CleanupStack::PopAndDestroy( dialog ); dialog = NULL; - // Ok or cancel pressed return ok ? KErrNone : KErrCancel; } @@ -295,6 +334,37 @@ } UpdateL(); } +// --------------------------------------------------------------------------- +// CIpsSetUiItemAccessPoint::InitL() +// --------------------------------------------------------------------------- +// +void CIpsSetUiItemAccessPoint::InitL( const CImIAPPreferences* aIapPrefs ) + { + FUNC_LOG; + if (aIapPrefs->SNAPDefined()) + { + iIapSel.iResult = CMManager::EDestination; + iIapSel.iId = aIapPrefs->SNAPPreference(); + iIapPref = ECommDbDialogPrefDoNotPrompt; + } + //Iap is used + else + { + iIapPref = aIapPrefs->IAPPreference(KDefaultIapIndex).iDialogPref; + if( iIapPref == ECommDbDialogPrefPrompt ) + { + iIapId = 0; + iIapType = ECuuAlwaysAsk; + } + else + { + iIapId = aIapPrefs->IAPPreference(KDefaultIapIndex).iIAP; + } + iIapSel.iResult = CMManager::EConnectionMethod; + iIapSel.iId = iIapId; + } + UpdateL(); + } // ---------------------------------------------------------------------------- // CIpsSetUiItemAccessPoint::InitializeSelection() @@ -317,6 +387,55 @@ FUNC_LOG; return iIapId; } +// ---------------------------------------------------------------------------- +// CIpsSetUiItemAccessPoint::GetIapSelection() +// ---------------------------------------------------------------------------- +// +TCmSettingSelection CIpsSetUiItemAccessPoint::GetIapSelection() + { + FUNC_LOG; + return iIapSel; + } +// ---------------------------------------------------------------------------- +// CIpsSetUiItemAccessPoint::GetIapChoice() +// ---------------------------------------------------------------------------- +// +TImIAPChoice CIpsSetUiItemAccessPoint::GetIapChoice() + { + TImIAPChoice choice; + + choice.iDialogPref = iIapPref; + choice.iIAP = iIapId; + + return choice; + } +// ---------------------------------------------------------------------------- +// CIpsSetUiItemAccessPoint::GetExtendedIapPreferences() +// ---------------------------------------------------------------------------- +// +CImIAPPreferences& CIpsSetUiItemAccessPoint::GetExtendedIapPreferencesL() + { + if (iFullIapPrefs) + { + delete iFullIapPrefs; + iFullIapPrefs = NULL; + } + + + iFullIapPrefs = CImIAPPreferences::NewLC(); + CleanupStack::Pop(iFullIapPrefs); + + if (iIapSel.iResult == CMManager::EDestination) + { + iFullIapPrefs->SetSNAPL(iIapSel.iId); + } + else + { + iFullIapPrefs->AddIAPL(GetIapChoice()); + } + + return *iFullIapPrefs; + } // End of File diff -r 0396474f30f5 -r 4ce476e64c59 ipsservices/ipssossettings/src/ipssetview.cpp --- a/ipsservices/ipssossettings/src/ipssetview.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetview.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -20,6 +20,7 @@ #include #include #include +#include // #include "FreestyleEmailUiConstants.h" // @@ -65,6 +66,11 @@ FUNC_LOG; delete iAsyncCallback; delete iCustomMessage; + if (iLocalScreenClearer != NULL) + { + delete iLocalScreenClearer; + iLocalScreenClearer = NULL; + } } // Constructor @@ -90,11 +96,17 @@ iCustomMessage = NULL; iCustomMessage = aCustomMessage.AllocL(); iAsyncCallback->CallBack(); + iLocalScreenClearer = CAknLocalScreenClearer::NewL( EFalse ); } void CIpsSetView::DoDeactivate() { FUNC_LOG; + if (iLocalScreenClearer != NULL) + { + delete iLocalScreenClearer; + iLocalScreenClearer = NULL; + } } TPtrC CIpsSetView::MailSettingsSubviewCaption( @@ -184,6 +196,9 @@ } else { + //refresh background + self->iLocalScreenClearer->DrawNow(); + //check if composer is active view; needed to handle special case when email is plugin settings and composer is activated externaly TVwsViewId aViewId; self->AppUi()->GetActiveViewId(aViewId); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/conf/mrui.confml Binary file meetingrequest/conf/mrui.confml has changed diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/conf/mrui_2001E610.crml Binary file meetingrequest/conf/mrui_2001E610.crml has changed diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/group/bld.inf --- a/meetingrequest/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -20,10 +20,12 @@ #include // +#include "../mrcalremoteattachment/group/bld.inf" #include "../mrcommon/group/bld.inf" #include "../mrdb/group/bld.inf" #include "../mrpolicy/group/bld.inf" #include "../mrservices/group/bld.inf" +#include "../mrguicommon/group/bld.inf" #include "../mrgui/group/bld.inf" #include "../mrentry/group/bld.inf" #include "../mrtasks/group/bld.inf" @@ -36,6 +38,10 @@ #include "../mragnversit2/group/bld.inf" #include "../mrcasplugin/group/bld.inf" #include "../mrurlparserplugin/group/bld.inf" +#include "../mrmbutilsextension/group/bld.inf" +#include "../mrbcplugin/group/bld.inf" +#include "../mrprocessor/group/bld.inf" +#include "../mrcmailremoteattachmentplugin/group/bld.inf" // PRJ_PLATFORMS @@ -46,8 +52,8 @@ // Mifconv extension taken into use. // Keep the PRJ_EXTENSIONS defintions below update with the mk-files. // Also keep updating the mk-files to enable "going back option". -//gnumakefile ../mrgui/group/icons.mk -//gnumakefile ../mrcasplugin/group/esmrcaspluginicons.mk +//gnumakefile ../mrgui/data/icons.mk +//gnumakefile ../mrcasplugin/data/esmrcaspluginicons.mk // // Exports moved to under subsystems (due to code policy) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mragnversit2/data/2001846E.rss --- a/meetingrequest/mragnversit2/data/2001846E.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mragnversit2/data/2001846E.rss Wed Mar 31 21:08:33 2010 +0300 @@ -17,7 +17,6 @@ */ #include //REGISTRY_INFO -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber #include "mruiuids.h" RESOURCE REGISTRY_INFO theInfo @@ -33,7 +32,7 @@ IMPLEMENTATION_INFO { implementation_uid = KESMRIcalConversionImplementationUid; - version_no = KEmailEcomVersionNumber; + version_no = 1; display_name = "mrui iCalendar"; default_data = "text/calendar"; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mragnversit2/group/esmragnversit2.mmp --- a/meetingrequest/mragnversit2/group/esmragnversit2.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mragnversit2/group/esmragnversit2.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,12 +16,10 @@ * */ -#include +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" #include - -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" +#include TARGET esmragnversit2.dll TARGETTYPE PLUGIN @@ -30,9 +28,6 @@ VENDORID VID_DEFAULT -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmragnversit2.cpp SOURCE cesmragnversit2importer.cpp @@ -49,16 +44,22 @@ SOURCE cesmragnparserruledaily.cpp //user include +// USERINCLUDE ../inc USERINCLUDE ../../inc USERINCLUDE ../../../inc +// //system include +// APP_LAYER_SYSTEMINCLUDE +// SOURCEPATH ../data +// START RESOURCE 2001846E.rss +// TARGET esmragnversit2.rsc END @@ -69,18 +70,17 @@ TARGETPATH RESOURCE_FILES_DIR END -LIBRARY bafl.LIB +LIBRARY bafl.lib LIBRARY euser.lib -LIBRARY ECom.lib +LIBRARY ecom.lib LIBRARY esmrversit2.lib -LIBRARY CalInterimAPI.lib +LIBRARY calinterimapi.lib LIBRARY tzclient.lib LIBRARY efsrv.lib LIBRARY esmrcommon.lib -LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/data/bcmrevent.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/data/bcmrevent.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for ECOM registry. +* +*/ + + +// INCLUDES +#include +#include "esmrinternaluid.h" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// theInfo +// ECOM registry information for ESMRVIEWER ECOM implementation +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRBCMREventPluginImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMRBCEventPluginInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRBCMREventPluginImplementationUID; + version_no = 1; + display_name = ""; + default_data = ""; + opaque_data = KBCCalMRPluginResource; + rom_only = 0; + } + }; + } + }; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/data/bcmreventplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/data/bcmreventplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for ECOM registry. +* +*/ + +NAME MRBC + +#include +#include +#include "mrbcplugin.rh" +#include "esmrdef.h" + +RESOURCE RSS_SIGNATURE { } + +RESOURCE MR_BCPLUGIN_INFO r_mrbcplugin_info + { + version = 1; + event_type = KMRTypeMeetingRequest + | KMRTypeMeeting + | KMRTypeMemo + | KMRTypeAnniversary + | KMRTypeToDo; + command_table = + { + MR_BCPLUGIN_COMMAND + { + command_id = ECalenNewMeetingRequest; + check_entry_type = 0; + }, + MR_BCPLUGIN_COMMAND + { + command_id = ECalenNewMeeting; + check_entry_type = 0; + }, + MR_BCPLUGIN_COMMAND + { + command_id = ECalenNewDayNote; + check_entry_type = 0; + }, + MR_BCPLUGIN_COMMAND + { + command_id = ECalenNewAnniv; + check_entry_type = 0; + }, + MR_BCPLUGIN_COMMAND + { + command_id = ECalenNewTodo; + check_entry_type = 0; + }, + MR_BCPLUGIN_COMMAND + { + command_id = ECalenEventView; + check_entry_type = 1; + }, + MR_BCPLUGIN_COMMAND + { + command_id = ECalenNewMeetingTimeSpan; + check_entry_type = 0; + } + }; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/group/bcmrevent.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/group/bcmrevent.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +#include "../../../mrcommon/inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET bcmrevent.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRBCMREventPluginImplementationUID + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src + +SOURCE cmrbcmeetingrequestplugin.cpp +SOURCE cmrbcplugincmdhandler.cpp +SOURCE cmrbcplugincreatenewmrcmd.cpp +SOURCE cmrbcpluginopenmrviewercmd.cpp +SOURCE cmrbcpluginnewcaleventcommand.cpp +SOURCE dllmain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../mrcommon/inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data/ +START RESOURCE bcmrevent.rss +TARGET bcmrevent.rsc +END + +// BC calendar plugin resource definition +START RESOURCE ../data/bcmreventplugin.rss +HEADER +TARGET bcmreventplugin +TARGETPATH RESOURCE_FILES_DIR +END + +LIBRARY esmrcommon.lib +LIBRARY esmrviewer.lib + +LIBRARY ecom.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY euser.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY charconv.lib +LIBRARY eikcoctl.lib +LIBRARY calinterimapi.lib +LIBRARY caleninterimutils2.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build definition file. +* +* +*/ + + +#include + +PRJ_EXPORTS + +PRJ_MMPFILES +bcmrevent.mmp + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcmeetingrequestplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcmeetingrequestplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRBCMEETINGREQUESTPLUGIN_H +#define C_MRBCMEETINGREQUESTPLUGIN_H + +#include "cmrbceventplugin.h" +#include +#include + +class CMRBCPluginCmdHandler; + +/** + * CMRBCMeetingRequestPlugin implements CMRBCEventPlugin interface + * for meeting requests + */ +NONSHARABLE_CLASS( CMRBCMeetingRequestPlugin ) : + public CMRBCEventPlugin + { +public: + /** + * Creates new CMRBCMeetingRequestPlugin object. + * @param aCalenServices Reference to calendar services + * @return New CMRBCMeetingRequestPlugin object + */ + static CMRBCMeetingRequestPlugin* NewL( + TAny* aCalenServices ); + + /** + * C++ destructor + */ + ~CMRBCMeetingRequestPlugin(); + +public: // From base class MMRBCEventPlugin + MCalenCommandHandler* CommandHandler(); + +private: + CMRBCMeetingRequestPlugin( + MCalenServices& aCalenServices ); + void ConstructL(); + +private: + /// Ref: Reference to calendar services + MCalenServices& iCalenServices; + /// Own: MR Command handler + CMRBCPluginCmdHandler* iCommandHandler; + }; + +#endif // C_MRBCMEETINGREQUESTPLUGIN_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcplugincmdhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcplugincmdhandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class implementing the RECAL customisation interface +* +*/ + +#ifndef CMRBCPLUGINCMDHANDLER_H +#define CMRBCPLUGINCMDHANDLER_H + +#include +#include + +class MCalenServices; +class CMRBCPluginResourceReader; +class CMRBCPluginEntryLoader; +class CMRBCPluginCreateNewMRCmd; +class CMRBCPluginOpenMRViewerCmd; + +/** + * CMRBCPluginCmdHandler is responsible for handling + * BC Plugin commands. + */ +NONSHARABLE_CLASS( CMRBCPluginCmdHandler ) : + public CBase, + public MCalenCommandHandler + { +public: // Construction and destruction + + /** + * Creates and initializes new CMRBCPluginCmdHandler object. + * @param aServices Reference to calendar services + * @param aEntryLoader Reference to entry loader + * @param aPluginResourceReader Reference to plug-in resource reader + */ + static CMRBCPluginCmdHandler* NewL( + MCalenServices& aServices ); + + /** + * C++ destructor + */ + ~CMRBCPluginCmdHandler(); + +private: // From base class MCalenCommandHandler + TBool HandleCommandL( const TCalenCommand& aCommand ); + TAny* CalenCommandHandlerExtensionL( TUid aExtensionUid ); + +private: // Implementation + CMRBCPluginCmdHandler( + MCalenServices& aServices ); + void ConstructL(); + +private: // Data + /// Ref: Reference to calen services object + MCalenServices& iServices; + }; + +#endif // CMRBCPLUGINCMDHANDLER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcplugincreatenewmrcmd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcplugincreatenewmrcmd.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRBCPLUGINCREATENEWMRCMD_H +#define C_MRBCPLUGINCREATENEWMRCMD_H + +#include "mmrbcplugincommand.h" +#include +#include + +class MCalenServices; +class CESMRViewerController; +class CCalEntry; + +/** + * + */ +NONSHARABLE_CLASS( CMRBCPluginCreateNewMRCmd ) : + public CBase, + public MMRBCPluginCommand, + public MAgnEntryUiCallback + { +public: // Construction and destruction + + /** + * Creates new CMRBCPluginCreateNewMRCmd command + * @param aServices Reference to calednar services + */ + static CMRBCPluginCreateNewMRCmd* NewL( + MCalenServices& aServices ); + + /** + * C++ destructor + */ + ~CMRBCPluginCreateNewMRCmd(); + +public: // From base class + + /** + * Executes the command. + * @param aCommand Command to be executed + */ + void ExecuteCommandL( + const TCalenCommand& aCommand ); + +private: // From base class MAgnEntryUiCallback + void ProcessCommandL(TInt aCommandId); + TInt ProcessCommandWithResultL( TInt aCommandId ); + +private: // Implementation + CMRBCPluginCreateNewMRCmd( + MCalenServices& aServices ); + void ConstructL(); + void LaunchMREditorL( const TCalenCommand& aCommand ); + void CreateEntryL( const TCalenCommand& aCommand ); + void AddOrganizerL(); + void IssueCommandL( MAgnEntryUi::TAgnEntryUiOutParams aOutParams ); + +private: // Data + /// Ref: Reference to calendar services + MCalenServices& iServices; + /// Own: Editor component + CESMRViewerController* iEditor; + /// Own: Entry to be created + CCalEntry* iEntry; + }; + +#endif // C_MRBCPLUGINCREATENEWMRCMD_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcpluginnewcaleventcommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcpluginnewcaleventcommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class implementing new entry commands +* +*/ + +#ifndef CMRBCPLUGINNEWCALEVENTCOMMAND_H +#define CMRBCPLUGINNEWCALEVENTCOMMAND_H + +#include "mmrbcplugincommand.h" +#include "esmrdef.h" + +#include +#include +#include +#include + +class MCalenServices; +class CESMRViewerController; + + +/** + * CBCCalNewEventCommand is responsible for handling + * create new event commands. + */ +NONSHARABLE_CLASS( CMRPluginNewCalEntryCommand ) : + public CBase, + public MMRBCPluginCommand, + public MAgnEntryUiCallback + { +public: // Construction and destruction + + static CMRPluginNewCalEntryCommand* NewL( + MCalenServices& aServices, + CCalEntry::TType aType ); + + static CMRPluginNewCalEntryCommand* NewLC( + MCalenServices& aServices, + CCalEntry::TType aType ); + + /** + * C++ destructor + */ + ~CMRPluginNewCalEntryCommand(); + +protected: // from base class MBCCalEventCommand + void ExecuteCommandL( + const TCalenCommand& aContext ); + +private: // From base class MAgnEntryUiCallback + void ProcessCommandL(TInt aCommandId); + TInt ProcessCommandWithResultL( TInt aCommandId ); + +private: // Implementation + CMRPluginNewCalEntryCommand( + MCalenServices& aServices, + CCalEntry::TType aEntryType); + void ConstructL(); + void CreateEntryL( + const TCalenCommand& aCommand ); + void CreateAndExecuteViewL( + const TCalenCommand& aCommand ); + void IssueCommandL( + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ); + +private: // data + /// Ref: Reference to calendar services + MCalenServices& iServices; + /// Own: Calendar Entry + CCalEntry* iCalEntry; + /// Own: Entry type + CCalEntry::TType iEntryType; + /// Own: Viewer component + CESMRViewerController* iViewer; + }; + +#endif // CBCCALEVENTCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcpluginopenmrviewercmd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/inc/cmrbcpluginopenmrviewercmd.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRBCPLUGINOPENMRVIEWERCMD_H +#define C_MRBCPLUGINOPENMRVIEWERCMD_H + +#include "mmrbcplugincommand.h" +#include +#include + +class MCalenServices; +class CESMRViewerController; +class CCalEntry; + +/** + * + */ +NONSHARABLE_CLASS( CMRBCPluginOpenMRViewerCmd ) : + public CBase, + public MMRBCPluginCommand, + public MAgnEntryUiCallback + { +public: // Construction and destruction + + /** + * Creates new CMRBCPluginOpenMRViewerCmd command + * @param aServices Reference to calednar services + */ + static CMRBCPluginOpenMRViewerCmd* NewL( + MCalenServices& aServices ); + + /** + * C++ destructor + */ + ~CMRBCPluginOpenMRViewerCmd(); + +public: // From base class + + /** + * Executes the command. + * @param aCommand Command to be executed + */ + void ExecuteCommandL( + const TCalenCommand& aCommand ); + +private: // From base class MAgnEntryUiCallback + void ProcessCommandL(TInt aCommandId); + TInt ProcessCommandWithResultL( TInt aCommandId ); + +private: // Implementation + CMRBCPluginOpenMRViewerCmd( + MCalenServices& aServices ); + void ConstructL(); + void LaunchMRViewerL( + const TCalenCommand& aCommand ); + void GetEntryL( + const TCalenCommand& aCommand ); + + void IssueNotifyL( + const TCalenCommand& aCommand, + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ); + + void IssueCommandL( + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ); + +private: // Data + /// Ref: Reference to calendar services + MCalenServices& iServices; + /// Own: Editor component + CESMRViewerController* iEditor; + /// Own: Entry to be created + CCalEntry* iEntry; + }; + +#endif // C_MRBCPLUGINOPENMRVIEWERCMD_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/src/cmrbcmeetingrequestplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/src/cmrbcmeetingrequestplugin.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#include "cmrbcmeetingrequestplugin.h" +#include "cmrbcplugincmdhandler.h" +#include "emailtrace.h" + +namespace { // codescanner::namespace + +} // namespace + +// ----------------------------------------------------------------------------- +// CMRBCMeetingRequestPlugin::CMRBCMeetingRequestPlugin +// ----------------------------------------------------------------------------- +// +CMRBCMeetingRequestPlugin::CMRBCMeetingRequestPlugin( + MCalenServices& aCalenServices ) +: iCalenServices( aCalenServices ) + { + + } + +// ----------------------------------------------------------------------------- +// CMRBCMeetingRequestPlugin::~CMRBCMeetingRequestPlugin +// ----------------------------------------------------------------------------- +// +CMRBCMeetingRequestPlugin::~CMRBCMeetingRequestPlugin() + { + FUNC_LOG; + delete iCommandHandler; + } + +// ----------------------------------------------------------------------------- +// CMRBCMeetingRequestPlugin::ConstructL +// ----------------------------------------------------------------------------- +// +void CMRBCMeetingRequestPlugin::ConstructL() + { + iCommandHandler = CMRBCPluginCmdHandler::NewL( iCalenServices ); + } + +// ----------------------------------------------------------------------------- +// CMRBCMeetingRequestPlugin::NewL +// ----------------------------------------------------------------------------- +// +CMRBCMeetingRequestPlugin* CMRBCMeetingRequestPlugin::NewL( + TAny* aCalenServices ) + { + FUNC_LOG; + + MCalenServices* calenServices = + static_cast( aCalenServices ); + + CMRBCMeetingRequestPlugin* self = + new (ELeave) CMRBCMeetingRequestPlugin( *calenServices ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCMeetingRequestPlugin::CommandHandler +// ----------------------------------------------------------------------------- +// +MCalenCommandHandler* CMRBCMeetingRequestPlugin::CommandHandler() + { + FUNC_LOG; + + return iCommandHandler; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/src/cmrbcplugincmdhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/src/cmrbcplugincmdhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class implementing the RECAL customisation interface +* +*/ + +#include "cmrbcplugincmdhandler.h" +#include "cmrbcplugincreatenewmrcmd.h" +#include "cmrbcpluginopenmrviewercmd.h" +#include "cmrbcpluginresourcereader.h" +#include "cmrbcpluginentryloader.h" +#include "tmrbcplugincommand.h" +#include "cmrbcpluginnewcaleventcommand.h" + +#include +#include +#include +#include +#include "emailtrace.h" + +namespace { // codescanner::namespace + +#ifdef _DEBUG + +_LIT( KMRBCPluginCmdHandler, "MRBCPluginCmdHandler" ); + +enum TMRBCPluginCmdHandlerPanic + { + EInvalidCommand // Invalid command + }; + +void Panic( TMRBCPluginCmdHandlerPanic aPanic ) + { + User::Panic( KMRBCPluginCmdHandler, aPanic ); + } + +#endif // _DEBUG + +CCalEntry::TType CommandToType( + TInt aCommand ) + { + CCalEntry::TType calEntryType( CCalEntry::EAppt ); + + switch( aCommand ) + { + case ECalenNewMeeting: + { + calEntryType = CCalEntry::EAppt; + } + break; + + case ECalenNewTodo: + { + calEntryType = CCalEntry::ETodo; + } + break; + + case ECalenNewAnniv: + { + calEntryType = CCalEntry::EAnniv; + } + break; + + case ECalenNewDayNote: + { + calEntryType = CCalEntry::EEvent; + } + break; + } + + return calEntryType; + } + +} // namespace + +// ----------------------------------------------------------------------------- +// CMRBCPluginCmdHandler::CMRBCPluginCmdHandler +// ----------------------------------------------------------------------------- +// +CMRBCPluginCmdHandler::CMRBCPluginCmdHandler( + MCalenServices& aServices ) +: iServices( aServices ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCmdHandler::~CMRBCPluginCmdHandler +// ----------------------------------------------------------------------------- +// +CMRBCPluginCmdHandler::~CMRBCPluginCmdHandler() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCmdHandler::NewL +// ----------------------------------------------------------------------------- +// +CMRBCPluginCmdHandler* CMRBCPluginCmdHandler::NewL( + MCalenServices& aServices ) + { + FUNC_LOG; + + CMRBCPluginCmdHandler* self = + new (ELeave) CMRBCPluginCmdHandler( + aServices ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCmdHandler::ConstructL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginCmdHandler::ConstructL() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCmdHandler::HandleCommandL +// ----------------------------------------------------------------------------- +// +TBool CMRBCPluginCmdHandler::HandleCommandL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + MMRBCPluginCommand* command = NULL; + TInt commandCode( aCommand.Command() ); + + if ( ECalenNewMeetingTimeSpan == commandCode ) + { + // command is triggered from day view bt using visual + // selection. We need to check whether MR is enabled or not. + + commandCode = ECalenNewMeeting; + if ( iServices.InterimUtilsL().MRViewersEnabledL() ) + { + commandCode = ECalenNewMeetingRequest; + } + } + + switch ( commandCode ) + { + case ECalenNewMeetingRequest: + { + command = CMRBCPluginCreateNewMRCmd::NewL( iServices ); + break; + } + + case ECalenEventView: + { + command = CMRBCPluginOpenMRViewerCmd::NewL( iServices ); + break; + } + + case ECalenNewMeeting: + case ECalenNewTodo: + case ECalenNewAnniv: + case ECalenNewDayNote: + { + command = CMRPluginNewCalEntryCommand::NewL( + iServices, + CommandToType( aCommand.Command() ) ); + break; + } + + default: + { + __ASSERT_DEBUG( command, Panic(EInvalidCommand) ); + ERROR( KErrArgument, "Invalid command" ); + User::Leave( KErrArgument ); + break; + } + } + + CleanupDeletePushL( command ); + command->ExecuteCommandL( aCommand ); + + CleanupStack::PopAndDestroy( command ); // codescanner::cleanup + + // Returning EFalse means that command is not continued + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCmdHandler::CalenCommandHandlerExtensionL +// ----------------------------------------------------------------------------- +// +TAny* CMRBCPluginCmdHandler::CalenCommandHandlerExtensionL( + TUid /* aExtensionUid */ ) + { + FUNC_LOG; + return NULL; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/src/cmrbcplugincreatenewmrcmd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/src/cmrbcplugincreatenewmrcmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,558 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM implementation +* +*/ + +#include "cmrbcplugincreatenewmrcmd.h" +#include "cesmrviewerctrl.h" +#include "esmrcommands.h" +#include "tmroutputparams.h" +#include "esmrconfig.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +/** + * Literal for BC viewer / editor + */ +_LIT8( KBCViewer, "[2001F406]" ); + +/** + * Default sequence number + */ +const TInt KDefaultSeqNo( 0 ); + +/** + * Constant for default duration in minutes + */ +const TInt KDefaultDurationInMinutes( 60 ); + +#ifdef _DEBUG + +/** + * Panic literal + */ +_LIT( KMRBCPluginCreateNewMRCmd, "MRBCPluginCreateNewMRCmd" ); + +/** + * Panic codes + */ +enum TMRBCPluginCreateNewMRCmdPanic + { + EInvalidCommand // Invalid command + }; + +void Panic( TMRBCPluginCreateNewMRCmdPanic aPanic ) + { + User::Panic( KMRBCPluginCreateNewMRCmd, aPanic ); + } + +#endif // _DEBUG + +/** + * Fetches the supported mailboxes. + * @param aMBUtils utils class + * @param aMailBoxes to test + */ +void SupportedMailboxesL( + CMRMailboxUtils& aMBUtils, + RArray& aMailBoxes ) + { + FUNC_LOG; + aMBUtils.ListMailBoxesL( aMailBoxes ); + + RCPointerArray implArray; + CleanupClosePushL( implArray ); + + //Get all MRViewers Implementation + const TUid mrViewersIface = TUid::Uid(KMRViewersInterfaceUID); + REComSession::ListImplementationsL(mrViewersIface, implArray ); + TInt mrviewerCount( implArray.Count() ); + + TInt index(0); + TInt mailboxCount( aMailBoxes.Count() ); + while ( index < mailboxCount ) + { + TBool supported( EFalse ); + + for ( TInt i(0); (i < mrviewerCount) && !supported; ++ i ) + { + TBuf16 mbName; + CnvUtfConverter::ConvertToUnicodeFromUtf8( + mbName, + implArray[i]->DataType() ); + + if( aMailBoxes[index].iMtmUid.Name().CompareF(mbName) == 0) + { + supported = ETrue; + } + } + + if ( supported ) + { + index++; + } + else + { + aMailBoxes.Remove( index ); + mailboxCount = aMailBoxes.Count(); + } + } + CleanupStack::PopAndDestroy( &implArray ); + } + +/** + * Prompts user to select default mailbox. + * @param aMailBoxes Reference to mailbox list + */ +TInt PromptForDefaultMailboxL( + RArray& aMailBoxes ) + { + FUNC_LOG; + TInt selected( KErrCancel ); + + TInt mbCount = aMailBoxes.Count(); + if( mbCount > 0) + { + CAknSinglePopupMenuStyleListBox* list = + new (ELeave) CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL(list); + + CAknPopupList* popupList = CAknPopupList::NewL( + list, + R_AVKON_SOFTKEYS_OK_CANCEL); + CleanupStack::PushL(popupList); + + list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect); + list->CreateScrollBarFrameL(ETrue); + list->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); + + CEikonEnv* eikEnv = CEikonEnv::Static();// codescanner::eikonenvstatic + + CDesCArrayFlat* items = new (ELeave)CDesCArrayFlat(mbCount); + CleanupStack::PushL(items); + for(TInt i=0; iAppendL( aMailBoxes[i].iName ); + } + CleanupStack::Pop(items); + CTextListBoxModel* model = list->Model(); + + //Pass ownersip of items to model + model->SetItemTextArray(items); + + HBufC* title = KNullDesC().AllocLC(); + popupList->SetTitleL(*title); + CleanupStack::PopAndDestroy(title); + + TBool accepted = popupList->ExecuteLD(); + CleanupStack::Pop( popupList ); + + if(accepted) + { + selected = list->CurrentItemIndex(); + } + else + { + selected = KErrCancel; + } + + CleanupStack::PopAndDestroy( list ); + } + else + { + //No mailboxes defined. Could prompt user to define one here. + selected = KErrCancel; + } + + return selected; + } + +/** + * Test if this is valid command to be executed by this object. + * @param aCommand Reference to command object + * @return ETrue if this is valid command, EFalse otherwise + */ +TBool IsValidCommand( + const TCalenCommand& aCommand ) + { + TBool retValue( EFalse ); + + TInt aCommandId( aCommand.Command() ); + + if ( ECalenNewMeetingRequest == aCommandId || + ECalenNewMeetingTimeSpan == aCommandId ) + { + retValue = ETrue; + } + + return retValue; + } + +} + +// ----------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::CMRBCPluginCreateNewMRCmd +// ----------------------------------------------------------------------------- +// +CMRBCPluginCreateNewMRCmd::CMRBCPluginCreateNewMRCmd( + MCalenServices& aServices ) +: iServices( aServices ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::~CMRBCPluginCreateNewMRCmd +// ----------------------------------------------------------------------------- +// +CMRBCPluginCreateNewMRCmd::~CMRBCPluginCreateNewMRCmd() + { + FUNC_LOG; + delete iEntry; + delete iEditor; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::ConstructL +// ----------------------------------------------------------------------------- +// +CMRBCPluginCreateNewMRCmd* CMRBCPluginCreateNewMRCmd::NewL( + MCalenServices& aServices ) + { + FUNC_LOG; + + CMRBCPluginCreateNewMRCmd* self = + new (ELeave) CMRBCPluginCreateNewMRCmd( aServices ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::ConstructL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::ConstructL() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::ExecuteCommandL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::ExecuteCommandL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + TBool validCommand( IsValidCommand(aCommand) ); + + __ASSERT_DEBUG( + validCommand, + Panic( EInvalidCommand ) ); + + if ( !validCommand ) + { + ERROR( KErrArgument, "Invalid command" ); + User::Leave( KErrArgument ); + } + + + CreateEntryL( aCommand ); + LaunchMREditorL( aCommand ); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::ProcessCommandL +// --------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::ProcessCommandL( + TInt /*aCommandId*/ ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::ProcessCommandWithResultL +// --------------------------------------------------------------------------- +// +TInt CMRBCPluginCreateNewMRCmd::ProcessCommandWithResultL( // codescanner::intleaves + TInt /*aCommandId*/ ) + { + FUNC_LOG; + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::LaunchMREditorL +// --------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::LaunchMREditorL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + const TUid KCalendarUid = { 0x10005901 }; + + // Constructing input parameters + INFO( "Constructing input parameters" ); + MAgnEntryUi::TAgnEntryUiInParams inParams( + KCalendarUid, + iServices.SessionL(), + MAgnEntryUi::ECreateNewEntry ); + + // Set time for input parameters + INFO( "Set time for input parameters" ); + TCalTime startTime = iEntry->StartTimeL(); + TCalTime::TTimeMode timemode = startTime.TimeMode(); + if (timemode == TCalTime::EFloating ) + { + inParams.iInstanceDate.SetTimeLocalFloatingL ( + startTime.TimeLocalL() ); + } + else + { + inParams.iInstanceDate.SetTimeUtcL ( + startTime.TimeUtcL() ); + } + inParams.iMsgSession = NULL; + + // Output parameters + MAgnEntryUi::TAgnEntryUiOutParams outParams; + TMROutputParams outputParams; + outParams.iSpare = reinterpret_cast< TInt >( &outputParams ); + + // Launch Entry UI + INFO( "Launch Entry UI" ); + RPointerArray entries; + CleanupClosePushL(entries); + entries.AppendL(iEntry); + + AddOrganizerL(); + + CCalenInterimUtils2& utils = iServices.InterimUtilsL(); + if ( utils.MRViewersEnabledL( ETrue ) ) + { + iEditor = CESMRViewerController::NewL( + KBCViewer(), + entries, + inParams, + outParams, + *this ); + } + else + { + // MR is not supported --> Leave + User::Leave (KErrNotSupported ); + } + + iEditor->ExecuteL(); + + TCalenNotification notification( ECalenNotifyEntryClosed ); + + if ( MAgnEntryUi::ENoAction != outParams.iAction ) + { + // Update context and issue notification before confirmation dialog + // to avoid delay of updating title pane + MCalenContext& context = iServices.Context(); + aCommand.GetContextL( context ); + + // Update context and issue notification before confirmation dialog + // to avoid delay of updating title pane + TCalenInstanceId id = TCalenInstanceId::CreateL( + *iEntry, + outParams.iNewInstanceDate ); + + context.SetInstanceIdL( id, context.ViewId() ); + notification = ECalenNotifyEntrySaved; + } + else + { + TMROutputParams* params = + ( TMROutputParams* )( outParams.iSpare ); + + // If viewer options menu exit is desired + if( params->iCommand == EMRDialogOptionsMenuExit ) + { + notification = ECalenNotifyRealExit; + } + } + + iServices.IssueNotificationL( notification ); + IssueCommandL( outParams ); + CleanupStack::PopAndDestroy( &entries ); + iEntry = NULL; + } + +// --------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::CreateEntryL +// --------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::CreateEntryL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + CCalenInterimUtils2& utils = iServices.InterimUtilsL(); + + // Create unique ID. + HBufC8* guid = utils.GlobalUidL(); + CleanupStack::PushL(guid); + iEntry = CCalEntry::NewL( + CCalEntry::EAppt, + guid, CCalEntry::EMethodRequest, + KDefaultSeqNo ); + CleanupStack::Pop( guid ); + + MCalenContext& context = iServices.Context(); + aCommand.GetContextL( context ); + + TCalTime startTime, stopTime; + +#ifdef RD_USE_PS2_APIS + // Business Calendar day view with visual selection + TTime start( 0 ); + TTime end( 0 ); + + context.GetStartAndEndTimeForNewInstance( start, end ); + + const TTime zeroTime(0); + if ( start != zeroTime && end != zeroTime && + ECalenNewMeetingTimeSpan == aCommand.Command() ) + { + startTime.SetTimeLocalL( start ); + stopTime.SetTimeLocalL( end ); + + context.SetStartAndEndTimeForNewInstance( zeroTime, zeroTime ); //clean the start/end time in Context + + } + else +#endif // RD_USE_PS2_APIS + { + startTime = context.FocusDateAndTimeL(); + + TTimeIntervalMinutes interval = KDefaultDurationInMinutes; + + stopTime.SetTimeLocalL( + startTime.TimeLocalL() + + interval ); + } + + iEntry->SetStartAndEndTimeL( startTime, stopTime ); + + iEntry->SetPriorityL( EFSCalenMRPriorityNormal ); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::AddOrganizerL +// --------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::AddOrganizerL() + { + FUNC_LOG; + CMRMailboxUtils* mbUtils = CMRMailboxUtils::NewL( NULL ); + CleanupStack::PushL( mbUtils ); + + CMRMailboxUtils::TMailboxInfo defaultMailBox; + TInt err = mbUtils->GetDefaultMRMailBoxL( defaultMailBox ); + + if ( KErrNone != err ) + { + RArray mailBoxes; + CleanupClosePushL( mailBoxes ); + + SupportedMailboxesL( *mbUtils, mailBoxes ); + + TInt selectedMailbox( PromptForDefaultMailboxL(mailBoxes) ); + + if ( KErrCancel != selectedMailbox ) + { + mbUtils->SetDefaultMRMailBoxL( + mailBoxes[selectedMailbox].iEntryId ); // codescanner::accessArrayElementWithoutCheck2 + mbUtils->GetDefaultMRMailBoxL(defaultMailBox); + } + CleanupStack::PopAndDestroy( &mailBoxes ); + + // This will leave if user cancelled the mailbox selection + User::LeaveIfError( selectedMailbox ); + } + + //Set the organizer from the selected mailbox + CCalUser* organizer = CCalUser::NewL( defaultMailBox.iEmailAddress ); + CleanupStack::PushL(organizer ); + iEntry->SetOrganizerL(organizer ); + CleanupStack::Pop( organizer ); // Ownership trasferred + + CleanupStack::PopAndDestroy( mbUtils ); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginCreateNewMRCmd::IssueCommandL +// Issue command for calendar to handle +// --------------------------------------------------------------------------- +// +void CMRBCPluginCreateNewMRCmd::IssueCommandL( + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ) + { + FUNC_LOG; + TInt command( KErrNotFound ); + + TMROutputParams* params = ( TMROutputParams* )( aOutParams.iSpare ); + + switch ( params->iCommand ) + { + case EMRDialogOptionsMenuExit: + { + // Calendar app is not supposed to issue EAknCmdExit command. + // It is always soft exit and faster app FW takes the call, and + // decides the correct action. + // + // This is why we use command EAknSoftkeyExit, to exit + // application from editor options menu. + + command = EAknSoftkeyExit; + } + break; + + default: + break; + } + + // Issue command for RECAL + if( command != KErrNotFound ) + { + iServices.IssueCommandL( command ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/src/cmrbcpluginnewcaleventcommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/src/cmrbcpluginnewcaleventcommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,367 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for new event commands +* +*/ + + +#include "cmrbcpluginnewcaleventcommand.h" +#include "tesmrscenariodata.h" +#include "cesmrviewerctrl.h" +#include "esmrcommands.h" +#include "tmroutputparams.h" +#include "esmrconfig.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" + +/// Unnamed namespace for local definitions +namespace { + +/** + * Constant for default duration in minutes + */ +const TInt KDefaultDurationInMinutes( 60 ); + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::CMRPluginNewCalEntryCommand +// --------------------------------------------------------------------------- +// +CMRPluginNewCalEntryCommand::CMRPluginNewCalEntryCommand( + MCalenServices& aServices, + CCalEntry::TType aEntryType ) + : iServices( aServices ), + iEntryType( aEntryType ) + { + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::~CMRPluginNewCalEntryCommand +// --------------------------------------------------------------------------- +// +CMRPluginNewCalEntryCommand::~CMRPluginNewCalEntryCommand() + { + delete iCalEntry; + delete iViewer; + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::NewL +// --------------------------------------------------------------------------- +// +CMRPluginNewCalEntryCommand* CMRPluginNewCalEntryCommand::NewL( + MCalenServices& aServices, + CCalEntry::TType aEntryType ) + { + FUNC_LOG; + + CMRPluginNewCalEntryCommand* self = CMRPluginNewCalEntryCommand::NewLC( + aServices, + aEntryType ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::NewLC +// --------------------------------------------------------------------------- +// +CMRPluginNewCalEntryCommand* CMRPluginNewCalEntryCommand::NewLC( + MCalenServices& aServices, + CCalEntry::TType aEntryType ) + { + FUNC_LOG; + + CMRPluginNewCalEntryCommand* self = + new(ELeave) CMRPluginNewCalEntryCommand( + aServices, + aEntryType ); + CleanupStack::PushL(self); + self->ConstructL(); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::ConstructL +// --------------------------------------------------------------------------- +// +void CMRPluginNewCalEntryCommand::ConstructL() + { + FUNC_LOG; + // No implementation yet + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::ExecuteCommandL +// --------------------------------------------------------------------------- +// +void CMRPluginNewCalEntryCommand::ExecuteCommandL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + CreateEntryL( aCommand ); + CreateAndExecuteViewL( aCommand ); + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::ProcessCommandL +// --------------------------------------------------------------------------- +// +void CMRPluginNewCalEntryCommand::ProcessCommandL( + TInt aCommandId ) + { + FUNC_LOG; + User::LeaveIfError( ProcessCommandWithResultL(aCommandId) ); + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::ProcessCommandWithResultL +// --------------------------------------------------------------------------- +// +TInt CMRPluginNewCalEntryCommand::ProcessCommandWithResultL( + TInt /*aCommandId*/ ) + { + FUNC_LOG; + ASSERT( EFalse ); + + return KErrNotSupported; + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::CreateAndExecuteViewL +// --------------------------------------------------------------------------- +// +void CMRPluginNewCalEntryCommand::CreateAndExecuteViewL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + const TUid KCalendarUid = { 0x10005901 }; + + // Constructing input parameters + INFO( "Constructing input parameters" ); + MAgnEntryUi::TAgnEntryUiInParams inParams( + KCalendarUid, + iServices.SessionL(), + MAgnEntryUi::ECreateNewEntry ); + + // Set time for input parameters + INFO( "Set time for input parameters" ); + TCalTime startTime = iCalEntry->StartTimeL(); + TCalTime::TTimeMode timemode = startTime.TimeMode(); + if (timemode == TCalTime::EFloating ) + { + inParams.iInstanceDate.SetTimeLocalFloatingL ( + startTime.TimeLocalL() ); + } + else + { + inParams.iInstanceDate.SetTimeUtcL ( + startTime.TimeUtcL() ); + } + inParams.iMsgSession = NULL; + + // Output parameters + MAgnEntryUi::TAgnEntryUiOutParams outParams; + TMROutputParams outputParams; + outParams.iSpare = reinterpret_cast< TInt >( &outputParams ); + + // Launch Entry UI + INFO( "Launch Entry UI" ); + RCPointerArray entries; + CleanupClosePushL(entries); + entries.AppendL(iCalEntry); + + CCalenInterimUtils2& utils = iServices.InterimUtilsL(); + + iViewer = CESMRViewerController::NewL( + KNullDesC8(), + entries, + inParams, + outParams, + *this ); + + iViewer->ExecuteL(); + + TCalenNotification notification( ECalenNotifyEntryClosed ); + + if ( MAgnEntryUi::ENoAction != outParams.iAction ) + { + // Update context and issue notification before confirmation dialog + // to avoid delay of updating title pane + MCalenContext& context = iServices.Context(); + aCommand.GetContextL( context ); + + // Update context and issue notification before confirmation dialog + // to avoid delay of updating title pane + TCalenInstanceId id = TCalenInstanceId::CreateL( + *iCalEntry, + outParams.iNewInstanceDate ); + + context.SetInstanceIdL( id, context.ViewId() ); + notification = ECalenNotifyEntrySaved; + } + else + { + TMROutputParams* params = + ( TMROutputParams* )( outParams.iSpare ); + + // If viewer options menu exit is desired + if( params->iCommand == EMRDialogOptionsMenuExit ) + { + notification = ECalenNotifyRealExit; + } + } + + iServices.IssueNotificationL( notification ); + IssueCommandL( outParams ); + CleanupStack::PopAndDestroy( &entries ); + iCalEntry = NULL; + + delete iViewer; + iViewer = NULL; + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::CreateEntryL +// --------------------------------------------------------------------------- +// +void CMRPluginNewCalEntryCommand::CreateEntryL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + if ( iCalEntry ) + { + delete iCalEntry; + iCalEntry = NULL; + } + CCalenInterimUtils2& utils = iServices.InterimUtilsL(); + // Create unique ID. + HBufC8* guid = utils.GlobalUidL(); + CleanupStack::PushL(guid); + iCalEntry = CCalEntry::NewL( + iEntryType, + guid, + CCalEntry::EMethodNone, + 0 ); + + // Ownership transferred + CleanupStack::Pop( guid ); + + MCalenContext& context = iServices.Context(); + aCommand.GetContextL( context ); + + TCalTime startTime, stopTime; + +#ifdef RD_USE_PS2_APIS + // Business Calendar day view with visual selection + TTime start( 0 ); + TTime end( 0 ); + + context.GetStartAndEndTimeForNewInstance( start, end ); + +const TTime zeroTime(0); + if ( start != zeroTime && end != zeroTime && + ECalenNewMeetingTimeSpan == aCommand.Command() ) + { + startTime.SetTimeLocalL( start ); + stopTime.SetTimeLocalL( end ); + + //clean the start/end time in Context + context.SetStartAndEndTimeForNewInstance( zeroTime, zeroTime ); + } + else +#endif // RD_USE_PS2_APIS + { + startTime = context.FocusDateAndTimeL(); + + TTimeIntervalMinutes interval = KDefaultDurationInMinutes; + + stopTime.SetTimeLocalL( + startTime.TimeLocalL() + + interval ); + } + + iCalEntry->SetStartAndEndTimeL( startTime, stopTime ); + + // Set default priority for the entry also + if ( CCalEntry::ETodo == iCalEntry->EntryTypeL() ) + { + iCalEntry->SetPriorityL( EFSCalenTodoPriorityNormal ); + } + else + { + iCalEntry->SetPriorityL( EFSCalenMRPriorityNormal ); + } + } + +// --------------------------------------------------------------------------- +// CMRPluginNewCalEntryCommand::IssueCommandL +// Issue command for calendar to handle +// --------------------------------------------------------------------------- +// +void CMRPluginNewCalEntryCommand::IssueCommandL( + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ) + { + FUNC_LOG; + TInt command( KErrNotFound ); + + TMROutputParams* params = ( TMROutputParams* )( aOutParams.iSpare ); + + switch ( params->iCommand ) + { + case EMRDialogOptionsMenuExit: + { + // Calendar app is not supposed to issue EAknCmdExit command. + // It is always soft exit and faster app FW takes the call, and + // decides the correct action. + // + // This is why we use command EAknSoftkeyExit, to exit + // application from editor options menu. + + command = EAknSoftkeyExit; + } + break; + + default: + break; + } + + // Issue command for RECAL + if( command != KErrNotFound ) + { + iServices.IssueCommandL( command ); + } + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/src/cmrbcpluginopenmrviewercmd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/src/cmrbcpluginopenmrviewercmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,480 @@ +/* + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: MBUtils ECOM implementation + * + */ + +#include "cmrbcpluginopenmrviewercmd.h" +#include "cesmrviewerctrl.h" +#include "esmrcommands.h" +#include "tmroutputparams.h" +#include "esmrhelper.h" +#include "esmrconfig.hrh" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" + + +namespace { + +/** + * Literal for BC viewer / editor + */ +_LIT8( KBCViewer, "[2001F406]" ); + + +#ifdef _DEBUG + +/** + * Panic literal + */ +_LIT( KMRBCPluginOpenMRViewerCmd, "MRBCPluginOpenMRViewerCmd" ); + +/** + * Panic codes + */ +enum TMRBCPluginOpenMRViewerCmdPanic + { + EInvalidCommand // Invalid command + }; + +void Panic( TMRBCPluginOpenMRViewerCmdPanic aPanic ) + { + User::Panic( KMRBCPluginOpenMRViewerCmd, aPanic ); + } + +#endif // _DEBUG + +template +class CleanupResetAndDestroy + { + public: + inline static void PushL( T& aRef ) + { + CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) ); + } + + private: + inline static void ResetAndDestroy( TAny* aPtr ) + { + static_cast< T*>( aPtr )->ResetAndDestroy(); + } + }; + +template +inline void CleanupResetAndDestroyPushL( T& aRef ) + { + CleanupResetAndDestroy::PushL( aRef ); + } +} + +//TODO:- displace after nokia provide RIGHT CalenActionUiUtils::FindPossibleInstance +CCalInstance* FindPossibleInstanceL( + const TCalenInstanceId& aId, CCalInstanceView& aInstanceView ) + { + FUNC_LOG; + + RPointerArray instances; + CleanupResetAndDestroyPushL( instances ); + + TCalTime moment; + moment.SetTimeLocalL( aId.iInstanceTime ); + CalCommon::TCalTimeRange range( moment, moment ); + aInstanceView.FindInstanceL( instances, CalCommon::EIncludeAll, range ); + + CCalInstance* result = NULL; + + // For instances finishing the next day (now possible with unified DateTime editor), + // we have to do our best to match the instance time exactly - otherwise we could + // match the LocalUid to the incorrect instance in a series. + for ( TInt i=0; i < instances.Count() && !result; ++i ) + { + if( instances[i]->Entry().LocalUidL() == aId.iEntryLocalUid ) + { + // Check the instance time matches. + if( instances[i]->StartTimeL().TimeLocalL() == aId.iInstanceTime ) + { + result = instances[i]; + instances.Remove(i); + } + } + } + + if( !result ) + { + // Couldn't match the instance time exactly - just use the instance + // with the same LocalUid as the one we're looking for. + for ( TInt i=0; i < instances.Count() && !result; ++i ) + { + if( instances[i]->Entry().LocalUidL() == aId.iEntryLocalUid ) + { + result = instances[i]; + instances.Remove(i); + } + } + } + + CleanupStack::PopAndDestroy( &instances ); + return result; + } + + + +// ----------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::CMRBCPluginOpenMRViewerCmd +// ----------------------------------------------------------------------------- +// +CMRBCPluginOpenMRViewerCmd::CMRBCPluginOpenMRViewerCmd( + MCalenServices& aServices ) +: iServices( aServices ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::~CMRBCPluginOpenMRViewerCmd +// ----------------------------------------------------------------------------- +// +CMRBCPluginOpenMRViewerCmd::~CMRBCPluginOpenMRViewerCmd() + { + FUNC_LOG; + delete iEntry; + delete iEditor; + } + + // ----------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::NewL +// ----------------------------------------------------------------------------- +// +CMRBCPluginOpenMRViewerCmd* CMRBCPluginOpenMRViewerCmd::NewL( + MCalenServices& aServices) + { + FUNC_LOG; + + CMRBCPluginOpenMRViewerCmd* self = new (ELeave) CMRBCPluginOpenMRViewerCmd( + aServices); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::ConstructL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::ConstructL() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::ExecuteCommandL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::ExecuteCommandL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + __ASSERT_DEBUG( + aCommand.Command() == ECalenEventView, + Panic( EInvalidCommand ) ); + + if (aCommand.Command() != ECalenEventView) + { + ERROR( KErrArgument, "Invalid command" ); + User::Leave(KErrArgument); + } + + GetEntryL(aCommand); + LaunchMRViewerL( aCommand ); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::ProcessCommandL +// --------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::ProcessCommandL( TInt /* aCommandId */ ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::ProcessCommandWithResultL +// --------------------------------------------------------------------------- +// +TInt CMRBCPluginOpenMRViewerCmd::ProcessCommandWithResultL(TInt /*aCommandId*/) + { + FUNC_LOG; + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::LaunchMRViewerL +// --------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::LaunchMRViewerL( + const TCalenCommand& aCommand ) + { + FUNC_LOG; + + const TUid KCalendarUid = + { + 0x10005901 + }; + // Constructing input parameters + INFO( "Constructing input parameters" ); + MAgnEntryUi::TAgnEntryUiInParams inParams( + KCalendarUid, + iServices.SessionL(), + MAgnEntryUi::EViewEntry); + + // Set time for input parameters + INFO( "Set time for input parameters" ); + TCalTime startTime = iEntry->StartTimeL(); + TCalTime::TTimeMode timemode = startTime.TimeMode(); + if (timemode == TCalTime::EFloating) + { + inParams.iInstanceDate.SetTimeLocalFloatingL(startTime.TimeLocalL()); + } + else + { + RArray colIds; + CleanupClosePushL( colIds ); + TInt colId = iServices.Context().InstanceId().iColId; + colIds.AppendL( colId ); + CCalInstance* instance = FindPossibleInstanceL( + iServices.Context().InstanceId(), *(iServices.InstanceViewL(colIds))); + CleanupStack::PushL( instance ); + inParams.iInstanceDate.SetTimeUtcL(instance->Time().TimeUtcL()); + CleanupStack::PopAndDestroy( instance ); + CleanupStack::PopAndDestroy( &colIds ); + } + + inParams.iMsgSession = NULL; + + // Output parameters + MAgnEntryUi::TAgnEntryUiOutParams outParams; + TMROutputParams outputParams; + outParams.iSpare = reinterpret_cast< TInt >( &outputParams ); + + // Launch Entry UI + INFO( "Launch Entry UI" ); + RPointerArray entries; + CleanupClosePushL( entries ); + entries.AppendL( iEntry ); // Ownership not transferred. + + iEditor = CESMRViewerController::NewL( + KBCViewer(), + entries, + inParams, + outParams, + *this ); + + TRAPD( err, iEditor->ExecuteL() ); + if( KErrArgument == err ) + { + delete iEditor; + iEditor = NULL; + + // ES MR VIEWER controller was unable to show the + // passed meeting request. Let's launch normal meeting viewer + // for showing the entry + CCalEntry* meetingEntry = ESMRHelper::CopyEntryLC( + *entries[0], + entries[0]->MethodL(), + ESMRHelper::ECopyFull, + EESMREventTypeAppt ); + +#ifdef RD_USE_PS2_APIS + meetingEntry->ClearMRSpecificDataL(); +#endif // RD_USE_PS2_APIS + + // Delete old entry and reset entry array + delete iEntry; + iEntry = NULL; + entries.Reset(); + + // Append entry to array. + entries.AppendL( meetingEntry ); + + // Take ownership of meeting entry + iEntry = meetingEntry; + CleanupStack::Pop( meetingEntry ); + + iEditor = CESMRViewerController::NewL( + KBCViewer(), + entries, + inParams, + outParams, + *this ); + + iEditor->ExecuteL(); + } + + // Issue notification if required. + IssueNotifyL( aCommand, outParams ); + + // Issue command if required. + IssueCommandL( outParams ); + + // Close and reset entry array + CleanupStack::PopAndDestroy( &entries ); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::GetEntryL +// --------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::GetEntryL(const TCalenCommand& /*aCommand*/ ) + { + FUNC_LOG; + + if (iEntry) + { + delete iEntry; + iEntry = NULL; + } + + MCalenContext& context = iServices.Context(); + TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid; + TInt colId = context.InstanceId().iColId; + + iEntry = iServices.EntryViewL(colId)->FetchL(instanceId); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::IssueNotifyL +// Handle notify message +// --------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::IssueNotifyL( + const TCalenCommand& aCommand, + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ) + { + FUNC_LOG; + + TCalenNotification notification = ECalenNotifyEntryClosed; + switch ( aOutParams.iAction ) + { + case MAgnEntryUi::EMeetingDeleted: + case MAgnEntryUi::EInstanceDeleted: + { + notification = ECalenNotifyEntryDeleted; + } + break; + + case MAgnEntryUi::EMeetingSaved: + { + notification = ECalenNotifyEntrySaved; + } + break; + + case MAgnEntryUi::EInstanceRescheduled: + { + notification = ECalenNotifyEntrySaved; + } + break; + + case MAgnEntryUi::ENoAction: + { + TMROutputParams* params = + ( TMROutputParams* )( aOutParams.iSpare ); + + // If viewer options menu exit is desired + if( params->iCommand == EMRDialogOptionsMenuExit ) + { + notification = ECalenNotifyRealExit; + } + } + break; + + default: + break; + } + + if ( MAgnEntryUi::ENoAction != aOutParams.iAction ) + { + // Update context and issue notification before confirmation dialog + // to avoid delay of updating title pane + MCalenContext& context = iServices.Context(); + aCommand.GetContextL( context ); + + // Update context and issue notification before confirmation dialog + // to avoid delay of updating title pane + TCalenInstanceId id = TCalenInstanceId::CreateL( + *iEntry, + aOutParams.iNewInstanceDate ); + + context.SetInstanceIdL( id, context.ViewId() ); + } + + // Notify RECAL + iServices.IssueNotificationL( notification ); + } + +// --------------------------------------------------------------------------- +// CMRBCPluginOpenMRViewerCmd::IssueCommandL +// Issue command for calendar to handle +// --------------------------------------------------------------------------- +// +void CMRBCPluginOpenMRViewerCmd::IssueCommandL( + MAgnEntryUi::TAgnEntryUiOutParams aOutParams ) + { + FUNC_LOG; + TInt command( KErrNotFound ); + + TMROutputParams* params = ( TMROutputParams* )( aOutParams.iSpare ); + + switch ( params->iCommand ) + { + case EMRDialogOptionsMenuExit: + { + // Calendar app is not supposed to issue EAknCmdExit command. + // It is always soft exit and faster app FW takes the call, and + // decides the correct action. + // + // This is why we use command EAknSoftkeyExit, to exit + // application from viewer options menu. + + command = EAknSoftkeyExit; + } + break; + + default: + break; + } + + // Issue command for RECAL + if( command != KErrNotFound ) + { + iServices.IssueCommandL( command ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/bcmrevent/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/bcmrevent/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +// Internal includes +#include "cmrbcmeetingrequestplugin.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KMRBCMREventPluginImplementationUID, + CMRBCMeetingRequestPlugin::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/data/mrbcplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/data/mrbcplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECom registration resource for ESMR URL Parser Plugin +* +*/ + + + +#include +#include "esmrinternaluid.h" + + +// --------------------------------------------------------------------------- +// r_registry +// ECOM plugin registry info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO r_registry + { + // Resource format version 2 for ROM-only plugins + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRBCPluginDllUid; + interfaces = + { + INTERFACE_INFO + { + interface_uid = 0x1028336F; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRBCPluginImplementationUid; + version_no = 1; + display_name = + "MR BC Plugin";// codescanner::codereview + default_data = "language(*)"; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build definition file. +* +* +*/ + + +#include + +PRJ_EXPORTS + +PRJ_MMPFILES +mrbcplugin.mmp + + +#include "../bcmrevent/group/bld.inf" + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/group/mrbcplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/group/mrbcplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrbcplugin.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRBCPluginDllUid + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmrbcpluginentryloader.cpp +SOURCE cmrbcpluginresourcereader.cpp +SOURCE cmrbcplugin.cpp +SOURCE tmrbcplugincommand.cpp +SOURCE dllmain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data/ +START RESOURCE mrbcplugin.rss +TARGET mrbcplugin.rsc +END + +LIBRARY esmrcommon.lib + +LIBRARY ecom.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY euser.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY charconv.lib +LIBRARY eikcoctl.lib +LIBRARY calinterimapi.lib +LIBRARY caleninterimutils2.lib +LIBRARY FeatDiscovery.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/cmrbceventplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/cmrbceventplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRBCEVENTPLUGIN_H +#define C_MRBCEVENTPLUGIN_H + +#include "mmrbceventplugin.h" +#include + +class MCalenServices; + +class CMRBCEventPlugin : + public CBase, + public MMRBCEventPlugin + { +public: + static CMRBCEventPlugin* NewL( + TUid aPluginUid, + MCalenServices& aCalenServices ); + + ~CMRBCEventPlugin(); + +private: + /** iDtor_ID_Key Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + }; + +#include "cmrbceventplugin.inl" + +#endif // C_MRBCEVENTPLUGIN_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/cmrbceventplugin.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/cmrbceventplugin.inl Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: esmricalviewer inline methods +* +*/ + +#include + +// ----------------------------------------------------------------------------- +// CMRBCEventPlugin::NewL +// ----------------------------------------------------------------------------- +// +inline CMRBCEventPlugin* CMRBCEventPlugin::NewL( + TUid aUid, + MCalenServices& aCalenServices ) + { + TAny* param = static_cast( &aCalenServices ); + + TAny* ptr = REComSession::CreateImplementationL( + aUid, + _FOFF(CMRBCEventPlugin, iDtor_ID_Key ), + param ); + + return reinterpret_cast(ptr); + } + +// ----------------------------------------------------------------------------- +// CMRBCEventPlugin::~CMRBCEventPlugin +// ----------------------------------------------------------------------------- +// +inline CMRBCEventPlugin::~CMRBCEventPlugin() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/cmrbcplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/cmrbcplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class implementing the RECAL customisation interface +* +*/ + +#ifndef CMRBCPLUGIN_H +#define CMRBCPLUGIN_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MCalenServices; +class CMRBCPluginEntryLoader; +class CMRBCPluginResourceReader; +class MCalenPreview; +class CMRBCEventPlugin; + +// CLASS DECLARATIONS +/** + * This class is used for creating implement of view through ECom framework. + */ +NONSHARABLE_CLASS( CMRBCPlugin ) : public CCalenCustomisation + { +public: // C'tor and d'tor + /** + * Static constructor. + * @param aServices + * @return A new instance of CMRBCPlugin + */ + static CMRBCPlugin* NewL( MCalenServices* aServices ); + + /** + * Destructor + */ + ~CMRBCPlugin(); + +public: // Interface + +protected: // From base class CCalenCustomisation + + void GetCustomViewsL( RPointerArray& aCustomViewArray ); + + void GetCustomSettingsL( RPointerArray& aCustomSettingArray ); + + CCoeControl* InfobarL( const TRect& aRect ); + + const TDesC& InfobarL(); + + MCalenPreview* CustomPreviewPaneL( TRect& aRect ); // From wk 39 onwards + + CCoeControl* PreviewPaneL( TRect& aRect ); + + MCalenCommandHandler* CommandHandlerL(TInt aCommand ); + + void RemoveViewsFromCycle( RArray& aViews ); + + TBool CustomiseMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + + TBool CanBeEnabledDisabled(); + + TAny* CalenCustomisationExtensionL( TUid aExtensionUid ); + +private: // Implementation + /** + * C++ constructor + */ + CMRBCPlugin( MCalenServices* aServices ); + + /** + * constructor + */ + void ConstructL(); + + MCalenCommandHandler* ResolveCommandHandlerL( TInt aCommand ); + + CMRBCEventPlugin* PluginByUidL( TUid aUid ); + +private: // Data + /// Ref: Services interface for Calendar services + MCalenServices* iServices; + /// Own: Plugin resource reader + RPointerArray iPluginResources; + /// Own: Entry loader + CMRBCPluginEntryLoader* iEntryLoader; + }; + +#endif // CMRBCPLUGIN_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/cmrbcpluginentryloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/cmrbcpluginentryloader.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRBCPLUGINENTRYLOADER_H +#define C_MRBCPLUGINENTRYLOADER_H + +#include + +class CCalEntry; +class MCalenServices; + +/** + * CMRBcPluginEntryLoader is responsible for loafding the correct + * entry from the calendar database for handling. + */ +NONSHARABLE_CLASS( CMRBCPluginEntryLoader ) : public CBase + { +public: // Construction and destruction + + /** + * Creates and initalizes new CMRBcPluginEntryLoader object. + * @param aServices Reference to calendar services + * @return pointer to new CMRBcPluginEntryLoader object + */ + static CMRBCPluginEntryLoader* NewL( MCalenServices& aServices ); + + /** + * C++ destructor + */ + ~CMRBCPluginEntryLoader(); + +public: // Interface + + /** + * Updates the entry from the database. + */ + void UpdateEntryFromDatabaseL(); + + /** + * Fetches the reference to entry + * @return Reference to entry + */ + CCalEntry& Entry(); + +private: // Implementation + CMRBCPluginEntryLoader( MCalenServices& aServices ); + void ConstructL(); + +private: + /// Ref: Reference to calendar services + MCalenServices& iServices; + /// Own: Calendar entry + CCalEntry* iEntry; + }; + +#endif + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/cmrbcpluginresourcereader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/cmrbcpluginresourcereader.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRBCPLUGINRESOURCEREADER_H +#define C_MRBCPLUGINRESOURCEREADER_H + +#include +#include +#include +#include "tmrbcplugincommand.h" +#include "esmrdef.h" + +class CMRBCEventPlugin; +class MCalenServices; + +/** + * CMRBCPluginResourceReader reads BC Plug-In resource file + * information. + * @see mrbcplugin.rh + */ +NONSHARABLE_CLASS( CMRBCPluginResourceReader ) : public CBase + { +public: // Constrction and destruction + + /** + * Creates and initializes new CMRBCPluginResourceReader object. + * @param aCalenServices Reference to calendar services + */ + static CMRBCPluginResourceReader* NewL( + MCalenServices& aCalenServices ); + + /** + * C++ destructor + */ + ~CMRBCPluginResourceReader(); + +public: // Interface + /** + * Reads resource information from file. + * @param aResourceFile + */ + void ReadFromResourceFileL( + TUid aUid, + const TDesC& aResourceFile ); + + /** + * Version information + * @return Version information + */ + TVersion Version() const; + + /** + * Tests if BC plugin resource supports specified type + * @param aEventType Specifies event type + * @return ETrue if event type is supported, EFalse otherwise + */ + TBool SupportsType( TBCPluginEventType aEventType ) const; + + /** + * Tests if specified command is supported + * @param aCommand Specifies the command + * @return ETrue if command is supported, EFalse otherwise + */ + TBool SupportsCommand( TInt aCommand ) const; + + /** + * Fetches command from resource. + * @param aCommand Command to be executed + * @param aPluginCommand On return contains the fecthed plug-in command + * @return KErrNone if command is found, KErrNotFound otherwise + */ + TInt Command( + TInt aCommand, + TMRBCPluginCommand& aPluginCommand) const; + /** + * Fetches plugin implemenation UID + * @return plugin implemenation UID + */ + TUid PluginImplUid() const; + + /** + * Fetches the plugin implemenation. + * @return Plugin implementation + */ + CMRBCEventPlugin& PluginL(); + +private: // Implementation + CMRBCPluginResourceReader( + MCalenServices& aCalenServices ); + void ConstructL(); + +private: // Data + /// Ref: Calender services + MCalenServices& iCalenServices; + /// Own: Resource reader + RResourceFile iBCPluginResourceFile; + /// Own: Plugin implementation UID + TUid iPluginImplementationUid; + /// Own: Resource file offset + TInt iOffset; + /// Own: Version information + TVersion iVersion; + /// Own: Supported event types + TBitFlags32 iSupportedEventTypes; + /// Own: Command IDs + RArray iPluginCommands; + /// Own: Plugin implementation + CMRBCEventPlugin* iPlugin; + }; + +#endif // C_MRBCPLUGINRESOURCEREADER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/mmrbceventplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/mmrbceventplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef M_MRBCEVENTPLUGIN_H +#define M_MRBCEVENTPLUGIN_H + +#include + +class MCalenCommandHandler; + +/** + * MMRBCEventPlugin defines interface for BC event plug-in + */ +class MMRBCEventPlugin + { +public: // Interface + + /** + * Fetches event plugin command handler + */ + virtual MCalenCommandHandler* CommandHandler() = 0; + + /** + * Returns extension interface. + * @param aExtensionUid Extension identifier + */ + virtual TAny* Extension( TUid /* aExtensionUid */ ) { return NULL; } + }; + +#endif // M_MRBCPLUGINCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/mmrbcplugincommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/mmrbcplugincommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef M_MRBCPLUGINCOMMAND_H +#define M_MRBCPLUGINCOMMAND_H + +#include +#include + +/** + * MMRBCPluginCommand defines interface for BC plug-in commands + */ +class MMRBCPluginCommand + { +public: // Destruction + virtual ~MMRBCPluginCommand() { } + +public: // Interface + /** + * Executes the command. + * @param aCommand Command to be executed + */ + virtual void ExecuteCommandL( + const TCalenCommand& aCommand ) = 0; + }; + +#endif // M_MRBCPLUGINCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/inc/tmrbcplugincommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/inc/tmrbcplugincommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef TMRBCPLUGINCOMMAND_H +#define TMRBCPLUGINCOMMAND_H + +#include + +/** + * Defines BC Plusgin command type + */ +class TMRBCPluginCommand + { +public: // Construction + /** + * Default constructor. + */ + TMRBCPluginCommand(); + + /** + * C++ constructor. + * @param aCommand Command type + * @param aCheckEntryType Defines whether entry type needs to be checked + */ + TMRBCPluginCommand( + TInt aCommand, + TInt aCheckEntryType ); + +public: // Interface + + /** + * Returns command + * @return Command info + */ + TInt Command() const; + + /** + * Checks whether entry type needs to be checked + * @return ETrue if entry type needs to be checked + */ + TBool CheckEntryType() const; + + +public:// Data + TInt iCommand; + TInt iCheckEntryType; + }; + +#endif // TMRBCPLUGINCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/src/cmrbcplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/src/cmrbcplugin.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,544 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implements RECAL customisation api +* +*/ + +// INCLUDES +#include "cmrbcplugin.h" +#include "cmrbcpluginentryloader.h" +#include "cmrbcpluginresourcereader.h" +#include "cmrbceventplugin.h" +#include "esmrhelper.h" +#include "esmrdef.h" +#include "esmrinternaluid.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +#ifdef _DEBUG + +// Panic literal +_LIT( KMRBCPlugin, "MRBCPlugin" ); + +enum TMRBCPluginPanic + { + ENoBCPluginsFound // No MRUi MR Viewer Impl found + }; + +void Panic( TMRBCPluginPanic aPanic ) + { + User::Panic( KMRBCPlugin, aPanic ); + } + +#endif // _DEBUG + +TBCPluginEventType EventTypeL( + MCalenServices& aServices, + CCalEntry& aEntry ) + { + TBCPluginEventType eventType( EMRTypeNone ); + + CCalenInterimUtils2& utils = aServices.InterimUtilsL(); + if ( utils.IsMeetingRequestL(aEntry) ) + { + eventType = EMRTypeMeetingRequest; + } + else + { + switch( aEntry.EntryTypeL() ) + { + case CCalEntry::EAppt: + eventType = EMRTypeMeeting; + break; + + case CCalEntry::ETodo: + eventType = EMRTypeToDo; + break; + + case CCalEntry::EEvent: + eventType = EMRTypeMemo; + break; + + case CCalEntry::EAnniv: + eventType = EMRTypeAnniversary; + break; + } + } + + return eventType; + } + +/** + * Checks if features for handling commands are enabled + * @param aCommand command to check + * @return ETrue if feature is enabled for handling the given command + */ +TBool IsCommandHandlerEnabledL( TInt aCommand ) + { + FUNC_LOG; + + TBool enabled( ETrue ); + + switch ( aCommand ) + { + case ECalenNewMeetingRequest: + { + if ( !CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfCalMeetingRequestUi ) ) ) + { + // KFeatureIdFfCalMeetingRequestUi is not supported. + // Disable ECalenNewMeetingRequest command handling. + enabled = EFalse; + } + break; + } + + case ECalenEventView: + { + break; + } + + case ECalenNewMeeting: + case ECalenNewTodo: + case ECalenNewAnniv: + case ECalenNewDayNote: + { + if ( !CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfEnhancedCalendarEventUi ) ) ) + { + // KFeatureIdFfEnhancedCalendarEventUi is not supported. + // Disable enhanced event editors. + enabled = EFalse; + } + break; + } + + case ECalenNewMeetingTimeSpan: + { + if ( !CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfCalMeetingRequestUi ) ) + && !CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfEnhancedCalendarEventUi ) ) ) + { + enabled = EFalse; + } + break; + } + + default: + { + enabled = EFalse; + break; + } + } + + return enabled; + } + +/** + * Checks is feature for handling a command is enabled + * @param aCommand the command to handle + * @param aType the event type + * @return ETrue if command handling is enabled + */ +TBool IsCommandSupportedForEntryTypeL( + TInt aCommand, + TBCPluginEventType aType ) + { + FUNC_LOG; + + TBool supported = ETrue; + + if ( aCommand == ECalenEventView ) + { + // Check that corresponding viewer feature is enabled + switch ( aType ) + { + case EMRTypeMeetingRequest: + { + if ( !CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfCalMeetingRequestUi ) ) ) + { + // Meeting request viewer is not supported + supported = EFalse; + } + break; + } + + case EMRTypeMeeting: + case EMRTypeMemo: + case EMRTypeAnniversary: + case EMRTypeToDo: + { + if ( !CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfEnhancedCalendarEventUi ) ) ) + { + // Enhanced event viewers are not supported + supported = EFalse; + } + break; + } + default: + { + supported = EFalse; + break; + } + + } + } + + return supported; + } + +} // namespace + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::CMRBCPlugin +// C++ constructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPlugin::CMRBCPlugin( MCalenServices* aServices ) +: iServices( aServices ) + { + FUNC_LOG; + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::~CMRBCPlugin +// Destructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPlugin::~CMRBCPlugin() + { + FUNC_LOG; + + if ( iServices ) + { + iServices->Release(); + } + + iPluginResources.ResetAndDestroy(); + delete iEntryLoader; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::NewL +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPlugin* CMRBCPlugin::NewL( + MCalenServices* aServices ) + { + FUNC_LOG; + + CMRBCPlugin* self = new ( ELeave ) CMRBCPlugin( aServices ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::ConstructL +// 2nd phase constructor for this class. +// ----------------------------------------------------------------------------- +// +void CMRBCPlugin::ConstructL() + { + FUNC_LOG; + + RCPointerArray bcPlugins; + CleanupClosePushL( bcPlugins ); + + REComSession::ListImplementationsL( + TUid::Uid(KMRBCEventPluginInterfaceUID), + bcPlugins ); + + TInt pluginCount( bcPlugins.Count() ); + __ASSERT_DEBUG( pluginCount , Panic( ENoBCPluginsFound) ); + + if ( !pluginCount ) + { + ERROR( KErrNotFound, "No BC Plugins found" ); + User::Leave( KErrNotFound ); + } + + for ( TInt i(0); i < pluginCount; ++i ) + { + HBufC* resourceFileName = + HBufC::NewLC( bcPlugins[i]->OpaqueData().Length() ); + resourceFileName->Des().Copy( bcPlugins[i]->OpaqueData() ); + + CMRBCPluginResourceReader* pluginResource = + CMRBCPluginResourceReader::NewL( *iServices ); + CleanupStack::PushL( pluginResource ); + + TFileName resource; + TInt err = ESMRHelper::LocateResourceFile( + *resourceFileName, + KDC_RESOURCE_FILES_DIR, + resource, + NULL ); + + User::LeaveIfError( err ); + + pluginResource->ReadFromResourceFileL( + bcPlugins[i]->ImplementationUid(), + resource ); + + User::LeaveIfError( + iPluginResources.Append( pluginResource ) ); + + CleanupStack::Pop( pluginResource ); + CleanupStack::PopAndDestroy( resourceFileName ); + } + + // bcPlugins + CleanupStack::PopAndDestroy(); // codescanner::cleanup + + iEntryLoader = CMRBCPluginEntryLoader::NewL( *iServices ); + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::GetCustomViewsL +// ----------------------------------------------------------------------------- +// +void CMRBCPlugin::GetCustomViewsL( + RPointerArray& /*aCustomViewArray*/ ) + { + FUNC_LOG; + + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::GetCustomSettingsL +// No implementation needed +// ----------------------------------------------------------------------------- +// +void CMRBCPlugin::GetCustomSettingsL( RPointerArray& /*aCustomSettingArray*/ ) + { + FUNC_LOG; + + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::InfobarL +// No implementation needed +// ----------------------------------------------------------------------------- +// +CCoeControl* CMRBCPlugin::InfobarL( const TRect& /*aRect*/ ) + { + FUNC_LOG; + + // Do nothing + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::InfobarL +// No implementation needed +// ----------------------------------------------------------------------------- +// +const TDesC& CMRBCPlugin::InfobarL() + { + FUNC_LOG; + + return KNullDesC; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::CustomPreviewPaneL +// No implementation needed +// ----------------------------------------------------------------------------- +// +MCalenPreview* CMRBCPlugin::CustomPreviewPaneL( TRect& /*aRect*/ ) + { + FUNC_LOG; + + // Do nothing + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::PreviewPaneL +// No implementation needed +// ----------------------------------------------------------------------------- +// +CCoeControl* CMRBCPlugin::PreviewPaneL( TRect& /*aRect*/ ) + { + FUNC_LOG; + + // Do nothing + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::CommandHandlerL +// Decides what command handler is returned +// ----------------------------------------------------------------------------- +// +MCalenCommandHandler* CMRBCPlugin::CommandHandlerL( + TInt aCommand ) + { + FUNC_LOG; + + MCalenCommandHandler* cmdHandler = NULL; + + if ( IsCommandHandlerEnabledL( aCommand ) ) + { + cmdHandler = ResolveCommandHandlerL( aCommand ); + } + + return cmdHandler; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::RemoveViewsFromCycle +// ----------------------------------------------------------------------------- +// +void CMRBCPlugin::RemoveViewsFromCycle( RArray& /*aViews*/ ) + { + FUNC_LOG; + + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::CustomiseMenuPaneL +// No implementation needed +// ----------------------------------------------------------------------------- +// +TBool CMRBCPlugin::CustomiseMenuPaneL( TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/ ) + { + FUNC_LOG; + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::CanBeEnabledDisabled +// No implementation needed +// ----------------------------------------------------------------------------- +// +TBool CMRBCPlugin::CanBeEnabledDisabled() + { + FUNC_LOG; + + return EFalse; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::CalenCustomisationExtensionL +// No implementation needed +// ----------------------------------------------------------------------------- +// +TAny* CMRBCPlugin::CalenCustomisationExtensionL( TUid /*aExtensionUid*/ ) + { + FUNC_LOG; + + return NULL; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::ResolveCommandHandlerL +// ----------------------------------------------------------------------------- +// +MCalenCommandHandler* CMRBCPlugin::ResolveCommandHandlerL( TInt aCommand ) + { + MCalenCommandHandler* cmdHandler = NULL; + + //Open meetingview instead of mr while can't resolve phone owner. + //This situation command ECalenOpenMeetingView will be received. + if( EMRLaunchMeetingViewer == aCommand ) + { + CMRBCEventPlugin* eventPlugin = PluginByUidL( + TUid::Uid( KMRBCMREventPluginImplementationUID ) ); + + if ( eventPlugin ) + { + cmdHandler = eventPlugin->CommandHandler(); + } + } + else + { + TInt pluginCount( iPluginResources.Count() ); + for ( TInt i(0); i < pluginCount && !cmdHandler; ++i ) + { + TMRBCPluginCommand pluginCommand; + + TInt err = iPluginResources[i]->Command( aCommand, pluginCommand ); + if ( KErrNone == err ) + { + // Command was found from the plugin + if ( pluginCommand.CheckEntryType() ) + { + iEntryLoader->UpdateEntryFromDatabaseL(); + + TBCPluginEventType eventType( + EventTypeL( *iServices, iEntryLoader->Entry() ) ); + + if ( iPluginResources[i]->SupportsType( eventType) + && IsCommandSupportedForEntryTypeL( aCommand, eventType ) ) + { + cmdHandler = iPluginResources[i]->PluginL().CommandHandler(); + } + } + else + { + cmdHandler = iPluginResources[i]->PluginL().CommandHandler(); + } + } + } + } + return cmdHandler; + } + +// ----------------------------------------------------------------------------- +// CMRBCPlugin::PluginByUid +// ----------------------------------------------------------------------------- +// +CMRBCEventPlugin* CMRBCPlugin::PluginByUidL( TUid aUid ) + { + CMRBCEventPlugin* plugin = NULL; + + for ( TInt i = 0; i < iPluginResources.Count() && !plugin; ++i ) + { + if ( iPluginResources[ i ]->PluginImplUid() == aUid ) + { + plugin = &( iPluginResources[ i ]->PluginL() ); + } + } + + return plugin; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/src/cmrbcpluginentryloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/src/cmrbcpluginentryloader.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM implementation +* +*/ + +#include "cmrbcpluginentryloader.h" + +#include +#include +#include +#include + +#include "emailtrace.h" + +namespace { //codescanner::namespace + +#ifdef _DEBUG + +_LIT( KMRBCPluginEntryLoader, "MRBCPluginEntryLoader" ); + +enum TMRBCPluginEntryLoaderPanic + { + EEntryNotFetched + }; + +void Panic( TMRBCPluginEntryLoaderPanic aPanic ) + { + User::Panic( KMRBCPluginEntryLoader, aPanic ); + } + +#endif // _DEBUG + +} // namespace + +// ----------------------------------------------------------------------------- +// CMRBCPluginEntryLoader::CMRBCPluginEntryLoader +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPluginEntryLoader::CMRBCPluginEntryLoader( MCalenServices& aServices ) +: iServices( aServices ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginEntryLoader::~CMRBCPluginEntryLoader +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPluginEntryLoader::~CMRBCPluginEntryLoader() + { + FUNC_LOG; + delete iEntry; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginEntryLoader::ConstructL +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +void CMRBCPluginEntryLoader::ConstructL() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginEntryLoader::NewL +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPluginEntryLoader* CMRBCPluginEntryLoader::NewL( + MCalenServices& aServices ) + { + FUNC_LOG; + + CMRBCPluginEntryLoader* self = new (ELeave) CMRBCPluginEntryLoader( aServices ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginEntryLoader::UpdateEntryFromDatabaseL +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +void CMRBCPluginEntryLoader::UpdateEntryFromDatabaseL() + { + FUNC_LOG; + + if ( iEntry ) + { + delete iEntry; + iEntry = NULL; + } + + MCalenContext& context = iServices.Context(); + TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid; + + iEntry = iServices.EntryViewL( + context.InstanceId().iColId )->FetchL( instanceId ); + } + +CCalEntry& CMRBCPluginEntryLoader::Entry() + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic(EEntryNotFetched) ); + + return *iEntry; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/src/cmrbcpluginresourcereader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/src/cmrbcpluginresourcereader.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ + +#include "cmrbcpluginresourcereader.h" +#include "cmrbceventplugin.h" + +#include +#include + +#include "emailtrace.h" + +namespace { //codescanner::namespace + +// BC Plugin resource file offset +const TInt KMRBCPluginResourceFileOffset( 2 ); + +} // namespace + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::CMRBCPluginResourceReader +// Static constructor for this class +// ----------------------------------------------------------------------------- +// +CMRBCPluginResourceReader::CMRBCPluginResourceReader( + MCalenServices& aCalenServices ) +: iCalenServices( aCalenServices ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::~CMRBCPluginResourceReader +// ----------------------------------------------------------------------------- +// +CMRBCPluginResourceReader::~CMRBCPluginResourceReader() + { + FUNC_LOG; + + iPluginCommands.Close(); + iBCPluginResourceFile.Close(); + delete iPlugin; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::NewL +// ----------------------------------------------------------------------------- +// +CMRBCPluginResourceReader* CMRBCPluginResourceReader::NewL( + MCalenServices& aCalenServices ) + { + FUNC_LOG; + + CMRBCPluginResourceReader* self = + new (ELeave) CMRBCPluginResourceReader( aCalenServices ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::ConstructL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginResourceReader::ConstructL() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::ReadFromResourceFileL +// ----------------------------------------------------------------------------- +// +void CMRBCPluginResourceReader::ReadFromResourceFileL( + TUid aUid, + const TDesC& aResourceFile ) + { + FUNC_LOG; + + CCoeEnv* coeEnv( CCoeEnv::Static() ); + + iBCPluginResourceFile.Close(); + iBCPluginResourceFile.OpenL( coeEnv->FsSession(), aResourceFile ); + iBCPluginResourceFile.ConfirmSignatureL(); + + iOffset = iBCPluginResourceFile.Offset() + KMRBCPluginResourceFileOffset; + + iPluginCommands.Reset(); + iSupportedEventTypes.ClearAll(); + + HBufC8* resourceIdBuffer = + iBCPluginResourceFile.AllocReadLC( iOffset ); + + // Construct resource reader + TResourceReader reader; + reader.SetBuffer(resourceIdBuffer); + + iPluginImplementationUid = aUid; + iVersion.iMajor = reader.ReadInt32(); + iSupportedEventTypes = reader.ReadUint32(); + + TInt commandCount( reader.ReadInt16() ); + iPluginCommands.ReserveL( commandCount ); + + for (TInt i(0); i < commandCount; ++i ) + { + TMRBCPluginCommand pluginCommand; + + pluginCommand.iCommand = reader.ReadInt32(); + pluginCommand.iCheckEntryType = reader.ReadInt32(); + iPluginCommands.Append( pluginCommand ); + } + + iBCPluginResourceFile.Close(); + CleanupStack::PopAndDestroy( resourceIdBuffer ); + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::Version +// ----------------------------------------------------------------------------- +// +TVersion CMRBCPluginResourceReader::Version() const + { + FUNC_LOG; + + return iVersion; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::ReadFromResourceFileL +// ----------------------------------------------------------------------------- +// +TBool CMRBCPluginResourceReader::SupportsType( + TBCPluginEventType aEventType ) const + { + FUNC_LOG; + + return iSupportedEventTypes.IsSet( aEventType ); + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::ReadFromResourceFileL +// ----------------------------------------------------------------------------- +// +TBool CMRBCPluginResourceReader::SupportsCommand( + TInt aCommand ) const + { + FUNC_LOG; + + TInt pos( KErrNotFound ); + TInt commandCount( iPluginCommands.Count() ); + for ( TInt i(0); i < commandCount && KErrNotFound == pos; ++i ) + { + if ( iPluginCommands[i].Command() == aCommand ) + { + pos = i; + } + } + + return KErrNotFound != pos; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::CommandL +// ----------------------------------------------------------------------------- +// +TInt CMRBCPluginResourceReader::Command( + TInt aCommand, + TMRBCPluginCommand& aPluginCommand ) const + { + FUNC_LOG; + + TInt retValue( KErrNotFound ); + TInt commandCount( iPluginCommands.Count() ); + for ( TInt i(0); i < commandCount && KErrNotFound == retValue; ++i ) + { + if ( iPluginCommands[i].Command() == aCommand ) + { + retValue = KErrNone; + aPluginCommand = iPluginCommands[i]; + } + } + + return retValue; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::PluginImplUid +// ----------------------------------------------------------------------------- +// +TUid CMRBCPluginResourceReader::PluginImplUid() const + { + FUNC_LOG; + + return iPluginImplementationUid; + } + +// ----------------------------------------------------------------------------- +// CMRBCPluginResourceReader::PluginImplUid +// ----------------------------------------------------------------------------- +// +CMRBCEventPlugin& CMRBCPluginResourceReader::PluginL() + { + FUNC_LOG; + + if ( !iPlugin ) + { + iPlugin = CMRBCEventPlugin::NewL( + iPluginImplementationUid, + iCalenServices ); + } + + return *iPlugin; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Standard Symbian OS DLL entry point function. +* +*/ + + +// Internal includes +#include "cmrbcplugin.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KMRBCPluginImplementationUid, + CMRBCPlugin::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrbcplugin/src/tmrbcplugincommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrbcplugin/src/tmrbcplugincommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#include "tmrbcplugincommand.h" + +// ----------------------------------------------------------------------------- +// TMRBCPluginCommand::TMRBCPluginCommand +// ----------------------------------------------------------------------------- +// +TMRBCPluginCommand::TMRBCPluginCommand() + { + + } + +// ----------------------------------------------------------------------------- +// TMRBCPluginCommand::TMRBCPluginCommand +// ----------------------------------------------------------------------------- +// +TMRBCPluginCommand::TMRBCPluginCommand( + TInt aCommand, + TInt aCheckEntryType ) +: iCommand( aCommand ), + iCheckEntryType( aCheckEntryType ) + { + + } + +// ----------------------------------------------------------------------------- +// TMRBCPluginCommand::Command +// ----------------------------------------------------------------------------- +// +TInt TMRBCPluginCommand::Command() const + { + return iCommand; + } + +// ----------------------------------------------------------------------------- +// TMRBCPluginCommand::CheckEntryType +// ----------------------------------------------------------------------------- +// +TBool TMRBCPluginCommand::CheckEntryType() const + { + return iCheckEntryType; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +PRJ_EXPORTS +../inc/calremoteattachmentapidefs.h |../../../inc/calremoteattachmentapidefs.h +../inc/ccalremoteattachmentapi.h |../../../inc/ccalremoteattachmentapi.h +../inc/ccalremoteattachmentapi.inl |../../../inc/ccalremoteattachmentapi.inl +../inc/mcalremoteattachment.h |../../../inc/mcalremoteattachment.h +../inc/mcalremoteattachmentinfo.h |../../../inc/mcalremoteattachmentinfo.h +../inc/mcalremoteattachmentoperation.h |../../../inc/mcalremoteattachmentoperation.h +../inc/mcalremoteattachmentoperationobserver.h |../../../inc/mcalremoteattachmentoperationobserver.h + +PRJ_MMPFILES + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/calremoteattachmentapidefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/calremoteattachmentapidefs.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CALREMOTEATTACHMENTAPIDEFS_H +#define CALREMOTEATTACHMENTAPIDEFS_H + +// Attachment download API Interface UID +#define KCalRemoteAttachmentAPIInterface 0x20026FBA + +// CMail implementation UID +#define KCalRemoteAttachmentAPICMailImpl 0x20026FBB + +#endif // CALREMOTEATTACHMENTAPIDEFS_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/ccalremoteattachmentapi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/ccalremoteattachmentapi.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CCALREMOTEATTACHMENTAPI_H +#define CCALREMOTEATTACHMENTAPI_H + +#include +#include + +class MCalRemoteAttachment; +class MCalRemoteAttachmentInfo; +class MCalRemoteAttachmentOperation; +class MCalRemoteAttachmentOperationObserver; + +/** + * CCalRemoteAttachmentApi defines calendar attachment download operations. + */ +class CCalRemoteAttachmentApi : public CBase + { +public: // Construction and destruction + + /** + * Creates and initializes new CCalRemoteAttachmentApi object. Ownership + * is transferred to caller. + * @param aUri + */ + static CCalRemoteAttachmentApi* NewL( const TDesC8& aUri ); + + /** + * Destructor + */ + virtual ~CCalRemoteAttachmentApi(); + +public: // Interface + + /** + * Fetches attachment information. + * @param aAttachmentInfo Reference to attachment info array + * @param aAttachmentUrlArray List of attachment URIs which information is wanted + */ + virtual void AttachmentInfo( + MCalRemoteAttachmentInfo& aAttachmentInfo, + MDesCArray& aAttachmentUrlArray ) const = 0; + + /** + * Downloads attachment. Ownership of created operation is transferred + * to caller. Created operations are stored to array. + * + * @param aAttachments Attachments to be downloaded index + * @param aOperations Operation array. + * @param aObserver Reference to attachment observer + */ + virtual void DownloadAttachmentsL( + const RPointerArray& aAttachments, + RPointerArray& aOperations, + MCalRemoteAttachmentOperationObserver& aObserver ) = 0; + +private: + /** iDtor_ID_Key Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + }; + +#include + +#endif // CCALREMOTEATTACHMENTAPI_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/ccalremoteattachmentapi.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/ccalremoteattachmentapi.inl Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +// simple wrapper class with array deletion on close +class RImplInfoPtrArrayCalRemoteAttachment : public RImplInfoPtrArray + { + public: + void Close() + { + ResetAndDestroy(); + RImplInfoPtrArray::Close(); + } + }; + +// ----------------------------------------------------------------------------- +// CCalRemoteAttachmentApi::NewL +// ----------------------------------------------------------------------------- +// +inline CCalRemoteAttachmentApi* CCalRemoteAttachmentApi::NewL( + const TDesC8& aUri ) + { + TAny* ptr( NULL ); + + RImplInfoPtrArrayCalRemoteAttachment implArray; + CleanupClosePushL( implArray ); + REComSession::ListImplementationsL( + TUid::Uid( KCalRemoteAttachmentAPIInterface ), + implArray ); + + TInt implCount( implArray.Count() ); + if ( !implCount ) + { + User::Leave( KErrNotFound ); + } + + for ( TInt i(0); i < implCount && !ptr; ++i ) + { + TPtrC8 datatype( implArray[i]->DataType() ); + if ( KErrNotFound != aUri.Find( datatype) ) + { + TInt32 keyOffset = _FOFF( CCalRemoteAttachmentApi, iDtor_ID_Key ); + TUid implUid = implArray[i]->ImplementationUid(); + ptr = REComSession::CreateImplementationL( implUid, + keyOffset, + NULL ); + } + } + + User::LeaveIfNull( ptr ); + CleanupStack::PopAndDestroy( &implArray ); + return reinterpret_cast(ptr); + } + +// ----------------------------------------------------------------------------- +// CCalRemoteAttachmentApi::~CCalRemoteAttachmentApi +// ----------------------------------------------------------------------------- +// +inline CCalRemoteAttachmentApi::~CCalRemoteAttachmentApi() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachment.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project esmrgui +* +*/ + + +#ifndef MCALREMOTEATTACHMENT_H +#define MCALREMOTEATTACHMENT_H + +#include + +/** + * MCalRemoteAttachment encapsulates calendar entry attachment. + */ +class MCalRemoteAttachment + { +public: + /** + * Attachment state information + */ + enum TCalRemoteAttachmentState + { + /** Unknown attachment state */ + EAttachmentStateUnknown, + /** Attachment is now downlaoded to device */ + EAttachmentStateNotDownloaded, + /** Attachment is downloaded to device */ + EAttachmentStateDownloaded + }; + +public: // Construction and destruction + + /** + * C++ Destructor. + */ + virtual ~MCalRemoteAttachment() {} ; + +public: // Interface + /** + * Sets name of attachment + * @param aAttachmentLabel Attachment label + */ + virtual void SetAttachmentLabelL( + const TDesC& aAttachmentLabel ) = 0; + + /** + * Gets label of attachment + * @return Label name of attachment + */ + virtual const TDesC& AttachmentLabel() const = 0; + + /** + * Sets attachment identifier + * + * @param aAttachmentIdentifier Attachment identifier + */ + virtual void SetAttachmentIdentifierL( + const TDesC& aAttachmentIdentifier ) = 0; + + /** + * Fetches attachment identifier + * + * @return Attachment identifier + */ + virtual const TDesC& AttachmentIdentifier() const = 0; + + /** + * Sets size of attachment + * + * @param aAttachmentSizeInBytes size of attachment in bytes + */ + virtual void SetAttachmentSize( + TInt aAttachmentSizeInBytes ) = 0; + + /** + * return size of attachment in bytes + * + * @return size of attachment + */ + virtual TInt AttachmentSizeInBytes() const = 0; + + /** + * Sets download state of attachment + * + * @param aAttachmentState download state of attachment + */ + virtual void SetAttachmentState( + MCalRemoteAttachment::TCalRemoteAttachmentState aAttachmentState ) = 0; + + /** + * Gets download state of attachment + * + * @return download state of attachment + */ + virtual MCalRemoteAttachment::TCalRemoteAttachmentState + AttachmenState() const = 0; + + /** + * Returns an extension point for this interface or NULL. + * + * @param aExtensionUid Uid of extension + * @return Extension point or NULL + */ + virtual TAny* CalRemoteAttachmentExtension( + TUid /*aExtensionUid*/ ) { return NULL; } + }; + +#endif // MCALREMOTEATTACHMENT_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachmentinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachmentinfo.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project esmrgui +* +*/ + +#ifndef MCALREMOTEATTACHMENTINFO_H +#define MCALREMOTEATTACHMENTINFO_H + +#include +#include + +/** + * MCalRemoteAttachmentInfo encapsulates calendar entry attachment information. + */ +class MCalRemoteAttachmentInfo + { +public: // Construction and destruction + + /** + * C++ Destructor + */ + virtual ~MCalRemoteAttachmentInfo() {}; + +public: + /** + * Creates new CESMRAttachment object and + * adds it to the array owned by this class + * + * @param aAttachmentIdentifier Attachment identifier + * @param aAttachmentLabel Attachment label + * @param aAttachmentSizeInBytes of attachment + * @param aState state of attachment download + */ + virtual void AddAttachmentInfoL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel, + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ) = 0; + + /** + * Adds MCalRemoteAttachment to the array owned by this class. Ownership is + * transferred from the caller. + * + * @param aAttachment object to be added to the array + */ + virtual void AddAttachmentInfoL( + MCalRemoteAttachment* aAttachment ) = 0; + + /** + * Counts number of MCalRemoteAttachment objects in array + * @return number of objects in array + */ + virtual TInt AttachmentCount() const = 0; + + /** + * Returns MCalRemoteAttachment from array index + * + *@param aIndex index of MCalRemoteAttachment to be returned + *@return object in the index + */ + virtual const MCalRemoteAttachment& AttachmentL( + TInt aIndex ) const = 0; + + /** + * Removes MCalRemoteAttachment from array index + * + *@param aIndex index of MCalRemoteAttachment to be removed from array + */ + virtual void RemoveAttachmentAtL( + TInt aIndex ) = 0; + + /** + * Removes MCalRemoteAttachment from array index + * + *@param aIndex index of MCalRemoteAttachment to be removed from array + */ + virtual void RemoveAttachmentL( + MCalRemoteAttachment& aAttachment ) = 0; + + /** + * Fetches attachment array. + * @return attachment array. + */ + virtual const RPointerArray& Attachments() const = 0; + + /** + * Returns an extension point for this interface or NULL. + * + * @param aExtensionUid Uid of extension + * @return Extension point or NULL + */ + virtual TAny* CalRemoteAttachmentInfoExtension( + TUid /*aExtensionUid*/ ) { return NULL; } + }; + +#endif // MCALREMOTEATTACHMENTINFO_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachmentoperation.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachmentoperation.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef MCALREMOTEATTACHMENTOPERATION_H +#define MCALREMOTEATTACHMENTOPERATION_H + +#include + +class MCalRemoteAttachment; + +/** + * MCalRemoteAttachmentOperation defines interface for calendar attachment operations + */ +class MCalRemoteAttachmentOperation + { +public: // Destruction + /** + * Virtual C++ destructor + */ + virtual ~MCalRemoteAttachmentOperation() {} + +public: // Interface + + /** + * fetches progress of the operation. + * @return Operation progress + */ + virtual TInt Progress() const = 0; + + /** + * Fetches the information about the attachment related to this command. + * @return Attachment information + */ + virtual const MCalRemoteAttachment& AttachmentInformation() const = 0; + + /** + * Returns an extension point for this interface or NULL. + * + * @param aExtensionUid Uid of extension + * @return Extension point or NULL + */ + virtual TAny* CalRemoteAttachmentOperationExtension( + TUid /*aExtensionUid*/ ) { return NULL; } + }; + +#endif // MCALREMOTEATTACHMENTOPERATION_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachmentoperationobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/api/inc/mcalremoteattachmentoperationobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef MCALREMOTEATTACHMENTOPERATIONOBSERVER_H +#define MCALREMOTEATTACHMENTOPERATIONOBSERVER_H + +#include + +class MCalRemoteAttachmentOperation; +class RFile; + +/** + * MCalRemoteAttachmentOperationObserver is used for indicating + * attachment download operation progress and completion. + */ +class MCalRemoteAttachmentOperationObserver + { +public: // Destruction + + /** + * Virtual desttructor + */ + virtual ~MCalRemoteAttachmentOperationObserver() {} + +public: // Interface + + /** + * Indicates about operation progress. + * @param aOperation Pointer to operation that was completed. + * @param aPercentageCompleted how many percent is done. + */ + virtual void Progress( + MCalRemoteAttachmentOperation* aOperation, + TInt aPercentageCompleted ) = 0; + + /** + * Called when operation is completed. Command is allowed to close file handle + * after calling this method. Observer needs to duplicate file handle if + * needed afterwards. + * + * @param aOperation Pointer to operation that was completed. + */ + virtual void OperationCompleted( + MCalRemoteAttachmentOperation* aOperation, + RFile& aAttachment ) = 0; + + /** + * Called when operation error occured. + * @param aOperation Pointer to operation. + * @param aErrorCode Defines operation error code. + */ + virtual void OperationError( + MCalRemoteAttachmentOperation* aOperation, + TInt aErrorCode ) = 0; + }; + +#endif // MCALREMOTEATTACHMENTOPERATIONOBSERVER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +#include "../api/group/bld.inf" +#include "../remoteattachment/group/bld.inf" + +PRJ_EXPORTS + +PRJ_MMPFILES + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/bwins/remoteattachmentu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/bwins/remoteattachmentu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,6 @@ +EXPORTS + ??1CCalRemoteAttachmentInfo@@UAE@XZ @ 1 NONAME ; CCalRemoteAttachmentInfo::~CCalRemoteAttachmentInfo(void) + ?NewL@CCalRemoteAttachmentInfo@@SAPAV1@XZ @ 2 NONAME ; class CCalRemoteAttachmentInfo * CCalRemoteAttachmentInfo::NewL(void) + ?NewL@CCalRemoteAttachment@@SAPAV1@ABVTDesC16@@0HW4TCalRemoteAttachmentState@MCalRemoteAttachment@@@Z @ 3 NONAME ; class CCalRemoteAttachment * CCalRemoteAttachment::NewL(class TDesC16 const &, class TDesC16 const &, int, enum MCalRemoteAttachment::TCalRemoteAttachmentState) + ??1CCalRemoteAttachment@@UAE@XZ @ 4 NONAME ; CCalRemoteAttachment::~CCalRemoteAttachment(void) + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/eabi/remoteattachmentu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/eabi/remoteattachmentu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,14 @@ +EXPORTS + _ZN20CCalRemoteAttachment4NewLERK7TDesC16S2_iN20MCalRemoteAttachment25TCalRemoteAttachmentStateE @ 1 NONAME + _ZN20CCalRemoteAttachmentD0Ev @ 2 NONAME + _ZN20CCalRemoteAttachmentD1Ev @ 3 NONAME + _ZN20CCalRemoteAttachmentD2Ev @ 4 NONAME + _ZN24CCalRemoteAttachmentInfo4NewLEv @ 5 NONAME + _ZN24CCalRemoteAttachmentInfoD0Ev @ 6 NONAME + _ZN24CCalRemoteAttachmentInfoD1Ev @ 7 NONAME + _ZN24CCalRemoteAttachmentInfoD2Ev @ 8 NONAME + _ZThn4_N20CCalRemoteAttachmentD0Ev @ 9 NONAME + _ZThn4_N20CCalRemoteAttachmentD1Ev @ 10 NONAME + _ZThn4_N24CCalRemoteAttachmentInfoD0Ev @ 11 NONAME + _ZThn4_N24CCalRemoteAttachmentInfoD1Ev @ 12 NONAME + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +PRJ_EXPORTS + +../inc/ccalremoteattachment.h |../../../inc/ccalremoteattachment.h +../inc/ccalremoteattachmentinfo.h |../../../inc/ccalremoteattachmentinfo.h + +PRJ_MMPFILES +remoteattachment.mmp + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/group/remoteattachment.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/group/remoteattachment.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +#define KEPOCStaticDllUID2 0x1000008d +#define KESMRDllUid3 0x2001E27F + +// Target information +TARGET remoteattachment.dll +TARGETTYPE dll +UID KEPOCStaticDllUID2 KESMRDllUid3 + +CAPABILITY CAP_GENERAL_DLL + +APP_LAYER_SYSTEMINCLUDE + +// Include paths +USERINCLUDE ../inc +USERINCLUDE ../../../inc + +SOURCEPATH ../src +SOURCE ccalremoteattachment.cpp +SOURCE ccalremoteattachmentinfo.cpp + +// Dependencies to esmrui libraries +LIBRARY euser.lib +LIBRARY efsrv.lib + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/inc/ccalremoteattachment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/inc/ccalremoteattachment.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CCALREMOTEATTACHMENT_H +#define CCALREMOTEATTACHMENT_H + +#include +#include "mcalremoteattachment.h" + +/** + * CCalRemoteAttachment encapsulates one attachment information + */ +NONSHARABLE_CLASS( CCalRemoteAttachment ) : + public CBase, + public MCalRemoteAttachment + { +public: // Construction and destruction + + /** + * Creates and initializes new CCalRemoteAttachment object. + * Ownership is transferred to caller. + * + * @param aAttachmentIdentifier Attachment identifier + * @param aAttachmentLabel Attachment label + * @param aAttachmentSizeInBytes of attachment + * @param aState state of attachment download + */ + IMPORT_C static CCalRemoteAttachment* NewL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel, + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ); + + /** + * C++ destructor + */ + IMPORT_C ~CCalRemoteAttachment(); + +public: // From MCalRemoteAttachment + void SetAttachmentLabelL( + const TDesC& aAttachmentLabel ); + const TDesC& AttachmentLabel() const; + void SetAttachmentIdentifierL( + const TDesC& aAttachmentIdentifier ); + const TDesC& AttachmentIdentifier() const; + void SetAttachmentSize( + TInt aAttachmentSizeInBytes ); + TInt AttachmentSizeInBytes() const; + void SetAttachmentState( + MCalRemoteAttachment::TCalRemoteAttachmentState aAttachmentState ); + MCalRemoteAttachment::TCalRemoteAttachmentState AttachmenState() const; + +private: // Implementation + CCalRemoteAttachment( + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ); + void ConstructL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel ); + +private: // Data + /// Own: Attachment identifier + HBufC* iIdentifier; + /// Own: Attachment label + HBufC* iLabel; + /// Own: Attachment size in bytes + TInt iSizeInBytes; + /// Own: Attachment download state + MCalRemoteAttachment::TCalRemoteAttachmentState iState; + }; + +#endif // CCALREMOTEATTACHMENT_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/inc/ccalremoteattachmentinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/inc/ccalremoteattachmentinfo.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CCALREMOTEATTACHMENTINFO_H +#define CCALREMOTEATTACHMENTINFO_H + +#include +#include + +class CCalRemoteAttachment; + +/** + * CCalRemoteAttachmentInfo contains information + * about attachments. + */ +NONSHARABLE_CLASS( CCalRemoteAttachmentInfo ) : + public CBase, + public MCalRemoteAttachmentInfo + { +public: // Construction and destruction + /** + * Creates CCalRemoteAttachmentInfo object. + * Ownership is transferred to caller. + * + * @return Pointer to CCalRemoteAttachmentInfo + */ + IMPORT_C static CCalRemoteAttachmentInfo* NewL(); + + /** + * C++ destructor + */ + IMPORT_C ~CCalRemoteAttachmentInfo(); + +public: // + void AddAttachmentInfoL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel, + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ); + void AddAttachmentInfoL( + MCalRemoteAttachment* aAttachment ); + TInt AttachmentCount() const; + const MCalRemoteAttachment& AttachmentL( + TInt aIndex ) const; + void RemoveAttachmentAtL( + TInt aIndex ); + void RemoveAttachmentL( + MCalRemoteAttachment& aAttachment ); + const RPointerArray& Attachments() const; + +private: + CCalRemoteAttachmentInfo(); + void ConstructL(); + +private: + /// Own: Attachment array + RPointerArray iAttachments; + }; + +#endif // CCALREMOTEATTACHMENTINFO_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/src/ccalremoteattachment.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/src/ccalremoteattachment.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "ccalremoteattachment.h" + + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::CCalRemoteAttachment +// --------------------------------------------------------------------------- +// +CCalRemoteAttachment::CCalRemoteAttachment( + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ) : + iSizeInBytes( aAttachmentSizeInBytes ), + iState( aState ) + { + + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::~CCalRemoteAttachment +// --------------------------------------------------------------------------- +// +EXPORT_C CCalRemoteAttachment::~CCalRemoteAttachment() + { + delete iLabel; + delete iIdentifier; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CCalRemoteAttachment* CCalRemoteAttachment::NewL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel, + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ) + { + CCalRemoteAttachment* self = + new (ELeave) CCalRemoteAttachment( + aAttachmentSizeInBytes, aState ); + CleanupStack::PushL( self ); + self->ConstructL( aAttachmentIdentifier, aAttachmentLabel ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::ConstructL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachment::ConstructL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel ) + { + iIdentifier = aAttachmentIdentifier.AllocL(); + iLabel = aAttachmentLabel.AllocL(); + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::SetAttachmentLabelL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachment::SetAttachmentLabelL( + const TDesC& aAttachmentLabel ) + { + HBufC* newLabel = aAttachmentLabel.AllocL(); + delete iLabel; + iLabel = newLabel; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::AttachmentLabel +// --------------------------------------------------------------------------- +// +const TDesC& CCalRemoteAttachment::AttachmentLabel() const + { + return *iLabel; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::SetAttachmentIdentifierL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachment::SetAttachmentIdentifierL( + const TDesC& aAttachmentIdentifier ) + { + HBufC* newLabel = aAttachmentIdentifier.AllocL(); + delete iIdentifier; + iIdentifier = newLabel; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::AttachmentIdentifier +// --------------------------------------------------------------------------- +// +const TDesC& CCalRemoteAttachment::AttachmentIdentifier() const + { + return *iIdentifier; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::SetAttachmentSize +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachment::SetAttachmentSize( + TInt aAttachmentSizeInBytes ) + { + iSizeInBytes = aAttachmentSizeInBytes; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::AttachmentSizeInBytes +// --------------------------------------------------------------------------- +// +TInt CCalRemoteAttachment::AttachmentSizeInBytes() const + { + return iSizeInBytes; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::SetAttachmentState +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachment::SetAttachmentState( + MCalRemoteAttachment::TCalRemoteAttachmentState aAttachmentState ) + { + iState = aAttachmentState; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachment::AttachmenState +// --------------------------------------------------------------------------- +// +MCalRemoteAttachment::TCalRemoteAttachmentState CCalRemoteAttachment::AttachmenState() const + { + return iState; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcalremoteattachment/remoteattachment/src/ccalremoteattachmentinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcalremoteattachment/remoteattachment/src/ccalremoteattachmentinfo.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "ccalremoteattachmentinfo.h" +#include "ccalremoteattachment.h" + +// ======== MEMBER FUNCTIONS ======== +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::CCalRemoteAttachmentInfo +// --------------------------------------------------------------------------- +// +CCalRemoteAttachmentInfo::CCalRemoteAttachmentInfo() + { + + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::~CCalRemoteAttachmentInfo +// --------------------------------------------------------------------------- +// +EXPORT_C CCalRemoteAttachmentInfo::~CCalRemoteAttachmentInfo() + { + iAttachments.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CCalRemoteAttachmentInfo* CCalRemoteAttachmentInfo::NewL() + { + CCalRemoteAttachmentInfo* self = new (ELeave) CCalRemoteAttachmentInfo; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::ConstructL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachmentInfo::ConstructL() + { + + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::AddAttachmentInfoL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachmentInfo::AddAttachmentInfoL( + const TDesC& aAttachmentIdentifier, + const TDesC& aAttachmentLabel, + TInt aAttachmentSizeInBytes, + MCalRemoteAttachment::TCalRemoteAttachmentState aState ) + { + CCalRemoteAttachment* attachment = + CCalRemoteAttachment::NewL( + aAttachmentIdentifier, + aAttachmentLabel, + aAttachmentSizeInBytes, + aState ); + + CleanupStack::PushL( attachment ); + + // Ownership is transferred + iAttachments.AppendL( attachment ); + + CleanupStack::Pop( attachment ); + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::AddAttachmentInfoL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachmentInfo::AddAttachmentInfoL( + MCalRemoteAttachment* aAttachment ) + { + // Ownership is transferred + iAttachments.AppendL( aAttachment ); + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::AttachmentCount +// --------------------------------------------------------------------------- +// +TInt CCalRemoteAttachmentInfo::AttachmentCount() const + { + return iAttachments.Count(); + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::AttachmentL +// --------------------------------------------------------------------------- +// +const MCalRemoteAttachment& CCalRemoteAttachmentInfo::AttachmentL( + TInt aIndex ) const + { + return *iAttachments[ aIndex ]; + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::RemoveAttachmentAtL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachmentInfo::RemoveAttachmentAtL( + TInt aIndex ) + { + if ( aIndex < iAttachments.Count() && aIndex >= 0 ) + { + MCalRemoteAttachment* attachment = iAttachments[ aIndex ]; + iAttachments.Remove( aIndex ); + delete attachment; + } + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::RemoveAttachmentL +// --------------------------------------------------------------------------- +// +void CCalRemoteAttachmentInfo::RemoveAttachmentL( + MCalRemoteAttachment& aAttachment ) + { + TInt pos( iAttachments.Find( &aAttachment ) ); + if ( KErrNotFound == pos ) + { + User::Leave( KErrNotFound ); + } + + RemoveAttachmentAtL( pos ); + } + +// --------------------------------------------------------------------------- +// CCalRemoteAttachmentInfo::Attachments +// --------------------------------------------------------------------------- +// +const RPointerArray& + CCalRemoteAttachmentInfo::Attachments() const + { + return iAttachments; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/data/2001F3FF.rss --- a/meetingrequest/mrcasplugin/data/2001F3FF.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/data/2001F3FF.rss Wed Mar 31 21:08:33 2010 +0300 @@ -18,7 +18,6 @@ // INCLUDE FILES #include -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber #include "fsccontactactionserviceuids.hrh" RESOURCE REGISTRY_INFO theInfo @@ -38,7 +37,7 @@ IMPLEMENTATION_INFO { implementation_uid = KFscMruiPluginImplImpUid; - version_no = KEmailEcomVersionNumber; + version_no = 1; } }; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/group/bld.inf --- a/meetingrequest/mrcasplugin/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -34,3 +34,5 @@ OPTION HEADERFILE esmrcasplugin.mbg OPTION SOURCES -c16,8 qgn_prop_cmail_action_meeting.svg END + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/group/esmrcasplugin.mmp --- a/meetingrequest/mrcasplugin/group/esmrcasplugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/group/esmrcasplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,10 +16,9 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber #include "../../inc/esmrinternaluid.h" -#include "../../../inc/fsccontactactionserviceuids.hrh" // #include "../../../inc/emailtraceconfig.hrh" +#include "../../../inc/fsccontactactionserviceuids.hrh" #include #include @@ -32,9 +31,6 @@ VENDORID VID_DEFAULT DEFFILE ESMRCASPlugin.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrcaspluginimpl.cpp SOURCE cesmrcascontactaction.cpp @@ -42,12 +38,13 @@ SOURCE cesmrcasplugincontactretriever.cpp USERINCLUDE ../group -USERINCLUDE ../inc +USERINCLUDE ../inc USERINCLUDE ../../inc USERINCLUDE ../../../inc APP_LAYER_SYSTEMINCLUDE + LIBRARY avkon.lib LIBRARY aknicon.lib LIBRARY efsrv.lib @@ -63,11 +60,6 @@ LIBRARY esmrcommon.lib LIBRARY eikcoctl.lib LIBRARY eikcore.lib -LIBRARY cmaillogger.lib - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE SOURCEPATH ../data START RESOURCE 2001F3FF.rss @@ -81,8 +73,9 @@ END -#if defined(ESMR_ENABLE_LOGGING) && defined( ESMR_LOG_FILE ) -LIBRARY flogger.lib // Debugging utilities -#endif // ESMR_ENABLE_LOGGING && ESMR_LOG_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // end of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/inc/cesmrcaspluginimpl.h --- a/meetingrequest/mrcasplugin/inc/cesmrcaspluginimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/inc/cesmrcaspluginimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -24,7 +24,7 @@ #include "cfsccontactactionplugin.h" #include "mfscreasoncallback.h" #include "cesmrcascontactaction.h" -#include +#include #include #include "mfsccontactsetobserver.h" // diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/inc/cesmrcaspluginuilauncher.h --- a/meetingrequest/mrcasplugin/inc/cesmrcaspluginuilauncher.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/inc/cesmrcaspluginuilauncher.h Wed Mar 31 21:08:33 2010 +0300 @@ -20,7 +20,7 @@ #define CESMRCASPLUGINUILAUNCHER_H #include -#include +#include #include class CCalSession; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/src/cesmrcascontactaction.cpp --- a/meetingrequest/mrcasplugin/src/cesmrcascontactaction.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/src/cesmrcascontactaction.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -18,7 +18,7 @@ #include "emailtrace.h" #include "cesmrcascontactaction.h" -#include +#include #include // ======== MEMBER FUNCTIONS ======== diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/src/cesmrcasplugincontactretriever.cpp --- a/meetingrequest/mrcasplugin/src/cesmrcasplugincontactretriever.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/src/cesmrcasplugincontactretriever.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description : Implementation of the class CESMRCasPluginImpl. - * Version : %version: tr1sido#7 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: e002sa33#6 % << Don't touch! Updated by Synergy at check-out. * */ @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include @@ -39,10 +39,10 @@ #include "mfsccontactsetobserver.h" #include "tfsccontactactionpluginparams.h" //
-#include -#include -#include -#include +#include +#include +#include +#include // Unnamed namespace for local definitions namespace { // codescanner::namespace diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/src/cesmrcaspluginimpl.cpp --- a/meetingrequest/mrcasplugin/src/cesmrcaspluginimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/src/cesmrcaspluginimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description : Implementation of the class CESMRCasPluginImpl. - * Version : %version: 10 % << Don't touch! Updated by Synergy at check-out. + * Version : %version: e002sa33#9 % << Don't touch! Updated by Synergy at check-out. * */ @@ -27,17 +27,17 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include // #include "mfscactionutils.h" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcasplugin/src/cesmrcaspluginuilauncher.cpp --- a/meetingrequest/mrcasplugin/src/cesmrcaspluginuilauncher.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcasplugin/src/cesmrcaspluginuilauncher.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -25,22 +25,22 @@ #include // #include "tfsccontactactionpluginparams.h" -#include -#include +#include +#include #include #include #include -#include +#include #include #include "mfscactionutils.h" // -#include +#include #include #include #include #include "esmrcommands.h" #include -#include +#include #include @@ -319,7 +319,7 @@ if (iOutParams.iAction == MAgnEntryUi::EMeetingSaved) { TInt res = R_FS_MR_NOTE_SAVED; - HBufC* prompt = StringLoader::LoadLC( res, CEikonEnv::Static() ); + HBufC* prompt = StringLoader::LoadLC( res, CEikonEnv::Static() );// codescanner::eikonenvstatic CAknConfirmationNote* dialog = new( ELeave )CAknConfirmationNote(); dialog->ExecuteLD( *prompt ); CleanupStack::PopAndDestroy( prompt ); @@ -380,36 +380,33 @@ { FUNC_LOG; CMRMailboxUtils::TMailboxInfo defaultMailBox; - - RArray mailBoxes; - CleanupClosePushL( mailBoxes ); - SupportedMailboxesL( iMBUtils, mailBoxes ); - - if ( KErrNone == iMBUtils.GetDefaultMRMailBoxL(defaultMailBox) ) - { - for ( TInt i(0); i < mailBoxes.Count(); i++ ) - { - if ( (defaultMailBox.iEntryId != mailBoxes[i].iEntryId) && - ( i == mailBoxes.Count() - 1 ) ) - { - TInt selectedMailbox( PromptForDefaultMailboxL(mailBoxes) ); - - if ( KErrCancel != selectedMailbox ) - { - iMBUtils.SetDefaultMRMailBoxL( mailBoxes[selectedMailbox].iEntryId ); - iMBUtils.GetDefaultMRMailBoxL(defaultMailBox); - } - - // This will leave if user cancelled the mailbox selection - User::LeaveIfError( selectedMailbox ); - } - } - } - - CleanupStack::PopAndDestroy( &mailBoxes ); - + if ( KErrNotFound == iMBUtils.GetDefaultMRMailBoxL(defaultMailBox) ) + { + RArray mailBoxes; + CleanupClosePushL( mailBoxes ); + + SupportedMailboxesL( iMBUtils, mailBoxes ); + + TInt selectedMailbox( PromptForDefaultMailboxL(mailBoxes) ); + + if ( KErrCancel != selectedMailbox ) + { + iMBUtils.SetDefaultMRMailBoxL( mailBoxes[selectedMailbox].iEntryId ); + iMBUtils.GetDefaultMRMailBoxL(defaultMailBox); + } + CleanupStack::PopAndDestroy( &mailBoxes ); + + // This will leave if user cancelled the mailbox selection + User::LeaveIfError( selectedMailbox ); + } + delete iMtmUid; iMtmUid = NULL; iMtmUid = defaultMailBox.iMtmUid.Name().AllocL(); + + // iMtmUid needs to be upper case due to resource file definition, + // so let's make sure + TPtr mtm( iMtmUid->Des() ); + mtm.UpperCase(); //Set the organizer from the selected mailbox CCalUser* organizer = CCalUser::NewL( defaultMailBox.iEmailAddress ); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/data/mrcmailremoteattachmentplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/data/mrcmailremoteattachmentplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECom registration resource for example remote att plugin +* +*/ + +#include +#include "calremoteattachmentapidefs.h" + +// --------------------------------------------------------------------------- +// r_registry +// ECOM plugin registry info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO r_registry + { + // Resource format version 2 for ROM-only plugins + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KCalRemoteAttachmentAPICMailImpl; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KCalRemoteAttachmentAPIInterface; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KCalRemoteAttachmentAPICMailImpl; + version_no = 1; + display_name = "CMAIL Remote att plugin"; // codescanner::codereview + default_data = "cmail"; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +#include +#include + +PRJ_EXPORTS + +PRJ_MMPFILES +mrcmailremoteattachmentplugin + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/group/mrcmailremoteattachmentplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/group/mrcmailremoteattachmentplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file exampleremoteattplugin +* +*/ + +#include "../../inc/calremoteattachmentapidefs.h" +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" + +#include +#include + +TARGET mrcmailremoteattachmentplugin.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KCalRemoteAttachmentAPICMailImpl + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmrcmailremoteattachmentplugin.cpp +SOURCE cmrcmailremoteattachmentpluginattinfofetcher.cpp +SOURCE tmrcmailremoteattachmentpluginurlparser.cpp +SOURCE cmrcmailremoteattachmentplugindownloader.cpp +SOURCE dllmain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom //TODO: Remove when Cmail headers are fixed + + + +SOURCEPATH ../data/ +START RESOURCE mrcmailremoteattachmentplugin.rss +TARGET mrcmailremoteattachmentplugin.rsc +END + +LIBRARY ecom.lib +LIBRARY bafl.lib +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY cone.lib +LIBRARY remoteattachment.lib +LIBRARY fsmailframework.lib +LIBRARY fsfwcommonlib.lib +LIBRARY inetprotutil.lib +LIBRARY esmrcommon.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/inc/cmrcmailremoteattachmentplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/inc/cmrcmailremoteattachmentplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CMRCMAILREMOTEATTPLUGIN_H +#define CMRCMAILREMOTEATTPLUGIN_H + +#include +#include "ccalremoteattachmentapi.h" + +class CFSMailClient; +class CMRCmailRemoteAttachmentPluginAttinfoFetcher; + +/** + * CMRCmailRemoteAttachmentPlugin is responsible for handling + * MR attachment downloading from MR email messages. + */ +NONSHARABLE_CLASS( CMRCmailRemoteAttachmentPlugin ) : + public CCalRemoteAttachmentApi + { +public: // Construction and destruction + /** + * Creates and initializes new CMRCmailRemoteAttachmentPlugin object. + * @return Pointer to CMRCmailRemoteAttachmentPlugin + */ + static CMRCmailRemoteAttachmentPlugin* NewL(); + + /** + * C++ destructor + */ + ~CMRCmailRemoteAttachmentPlugin(); + +protected: // From CCalRemoteAttachmentApi + void AttachmentInfo( + MCalRemoteAttachmentInfo& aAttachmentInfo, + MDesCArray& aAttachmentUrlArray ) const; + + void DownloadAttachmentsL( + const RPointerArray& aAttachments, + RPointerArray& aOperations, + MCalRemoteAttachmentOperationObserver& aObserver ); + +private: // Implementation + CMRCmailRemoteAttachmentPlugin(); + void ConstructL(); + +private: + /// Own: Pointer to CMAIL client object. + CFSMailClient* iMailClient; + /// Own: Attachment information fetcher + CMRCmailRemoteAttachmentPluginAttinfoFetcher* iAttinfoFetcher; + }; + +#endif // CMRCMAILREMOTEATTPLUGIN_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/inc/cmrcmailremoteattachmentpluginattinfofetcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/inc/cmrcmailremoteattachmentpluginattinfofetcher.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CMRCMAILREMOTEATTACHMENTPLUGINATTINFOFETCHER_H +#define CMRCMAILREMOTEATTACHMENTPLUGINATTINFOFETCHER_H + +#include +#include + +// FORWARD DECLARATIONS +class MCalRemoteAttachmentInfo; +class CFSMailClient; +class CFSMailBox; +class CFSMailMessage; +class TMRCMailRemoteAttachmentPluginURLParser; + +/** + * CMRCmailRemoteAttachmentPluginAttinfoFetcher is responsible for + * fetching attachment information from the email message. + */ +NONSHARABLE_CLASS( CMRCmailRemoteAttachmentPluginAttinfoFetcher ) : + public CBase + { +public: // Construction and destruction + + /** + * Creates and initializes new CMRCmailRemoteAttachmentPluginAttinfoFetcher + * object. Ownership is transferred to caller. + * + * @param aMailClient Reference to CMAIL mail client object. + * @return Pointer to CMRCmailRemoteAttachmentPluginAttinfoFetcher object. + */ + static CMRCmailRemoteAttachmentPluginAttinfoFetcher* NewL( + CFSMailClient& aMailClient ); + + /** + * C++ destructor. + */ + ~CMRCmailRemoteAttachmentPluginAttinfoFetcher(); + +public: // Interface + + /** + * Fetches attachment information from the CMail email message + */ + void FetchAttachmentInformationL( + MCalRemoteAttachmentInfo& aAttachmentInfo, + MDesCArray& aAttachmentUrlArray ); + +private: // Implementation + CMRCmailRemoteAttachmentPluginAttinfoFetcher( + CFSMailClient& aMailClient ); + void ConstructL(); + void AddAttachmentInformationL( + TMRCMailRemoteAttachmentPluginURLParser& aParser, + const TDesC& aUri, + MCalRemoteAttachmentInfo& aAttachmentInfo ); + +private: // Data + /// Ref: Reference to mail client + CFSMailClient& iMailClient; + }; + +#endif // CMRCMAILREMOTEATTACHMENTPLUGINATTINFOFETCHER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/inc/cmrcmailremoteattachmentplugindownloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/inc/cmrcmailremoteattachmentplugindownloader.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef CMRCMAILREMOTEATTACHMENTDOWNLOADER_H +#define CMRCMAILREMOTEATTACHMENTDOWNLOADER_H + +#include +#include +#include + +#include "mcalremoteattachmentoperation.h" +#include "mfsmailrequestobserver.h" +#include "tmrcmailremoteattachmentpluginurlparser.h" + +class CFSMailMessage; +class CFSMailClient; +class CCalRemoteAttachment; +class MCalRemoteAttachmentOperationObserver; + +/** + * CMRCmailRemoteAttachmentDownloader is responsible for + * downloading remote attachment. + */ +NONSHARABLE_CLASS( CMRCmailRemoteAttachmentDownloader ) : + public CActive, + public MCalRemoteAttachmentOperation, + public MFSMailRequestObserver + { +public: // Construction and destruction + /** + * Creates and initializes new CMRCmailRemoteAttachmentDownloader + * object. Ownership is transferred to caller. + * + * @param aMailClient Reference to mail client + * @param aObserver Reference to command observer + * @param aUri Attachment URI + */ + static CMRCmailRemoteAttachmentDownloader* NewL( + CFSMailClient& aMailClient, + MCalRemoteAttachmentOperationObserver& aObserver, + const TDesC& aUri ); + + /** + * C++ destructor + */ + ~CMRCmailRemoteAttachmentDownloader(); + +public: // From CActive + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + +public: // From MCalRemoteAttachmentOperation + TInt Progress() const; + const MCalRemoteAttachment& AttachmentInformation() const; + +private: // From MFSMailRequestObserver + void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); + +private: // Implementation + CMRCmailRemoteAttachmentDownloader( + CFSMailClient& aMailClient, + MCalRemoteAttachmentOperationObserver& aObserver ); + void ConstructL( + const TDesC& aUri ); + void IssueRequest(); + void NotifyCompletionL( CFSMailMessagePart& aAttachment ); + void NotifyError( TInt aError ); + TInt ProgressL() const; + void DoCancelL(); + +private: // Data + /// Ref: Reference to mail client + CFSMailClient& iMailClient; + /// Ref: Command observer + MCalRemoteAttachmentOperationObserver& iObserver; + /// Own: Remote attachment information + CCalRemoteAttachment* iRemoteAttachment; + /// Own: Attachment URI + HBufC* iUri; + /// Own: Mail message + CFSMailMessage* iMailMessage; + /// Own: Mail operation ID + TInt iFSMailOperationId; + /// Own: Mail ID parser + TMRCMailRemoteAttachmentPluginURLParser iMailIdParser; + /// Own: Attachment file + RFile iAttachmentFile; + }; + +#endif // CMRCMAILREMOTEATTACHMENTDOWNLOADER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/inc/tmrcmailremoteattachmentpluginurlparser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/inc/tmrcmailremoteattachmentpluginurlparser.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef TMRCMAILREMOTEATTACHMENTPLUGINURLPARSER_H +#define TMRCMAILREMOTEATTACHMENTPLUGINURLPARSER_H + +#include +#include "cfsmailcommon.h" + +/** + * TMRCMailRemoteAttachmentPluginURLParser is responsible for + * parsing CMAIUL attachment URI to mail message UIDs. + */ +NONSHARABLE_CLASS( TMRCMailRemoteAttachmentPluginURLParser ) + { +public: // Construction and destruction + + /** + * Default C++ constructor + */ + TMRCMailRemoteAttachmentPluginURLParser(); + + /** + * C++ destructor + */ + ~TMRCMailRemoteAttachmentPluginURLParser(); + +public: // Interface + + /** + * Parses CMAIL attachment URI to CMAIL message IDs. + * @param aUri URI to be parsed + * @return KErrNone if URI was parsed succesfully. + * Otherwise system wide error code. + */ + TInt Parse( const TDesC& aUri ); + +private: // Implementation + void SetMailId( TFSMailMsgId& aMailId ); + TInt ParseMailId( TPtrC& aMailId ); + +public: // Data + /// Own: Mailbox UID + TFSMailMsgId iMailboxUid; + /// Owm: Folder UID + TFSMailMsgId iFolderUid; + /// Own: Message UID + TFSMailMsgId iMessageUid; + /// Own: Messagepart UID + TFSMailMsgId iMessagepartUid; + }; + +#endif // TMRCMAILREMOTEATTACHMENTPLUGINURLPARSER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/src/cmrcmailremoteattachmentplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/src/cmrcmailremoteattachmentplugin.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cmrcmailremoteattachmentplugin.h" +#include "cmrcmailremoteattachmentpluginattinfofetcher.h" +#include "cfsmailclient.h" +#include "mcalremoteattachmentinfo.h" +#include "cmrcmailremoteattachmentplugindownloader.h" +#include "mcalremoteattachment.h" + +#include "emailtrace.h" + +#include +#include + +// Unnamed namespace for local definitions +namespace { // namespace::codescanner + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPlugin::CMRCmailRemoteAttachmentPlugin +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentPlugin::CMRCmailRemoteAttachmentPlugin() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPlugin::~CMRCmailRemoteAttachmentPlugin +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentPlugin::~CMRCmailRemoteAttachmentPlugin() + { + FUNC_LOG; + + delete iAttinfoFetcher; + + if ( iMailClient ) + { + // DEcrement mail client reference count + iMailClient->Close(); + iMailClient = NULL; + } + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPlugin::NewL +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentPlugin* CMRCmailRemoteAttachmentPlugin::NewL() + { + FUNC_LOG; + + CMRCmailRemoteAttachmentPlugin* self = + new (ELeave) CMRCmailRemoteAttachmentPlugin; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPlugin::ConstructL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentPlugin::ConstructL() + { + FUNC_LOG; + + iMailClient = CFSMailClient::NewL(); + + iAttinfoFetcher = + CMRCmailRemoteAttachmentPluginAttinfoFetcher::NewL( + *iMailClient ); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPlugin::AttachmentInfo +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentPlugin::AttachmentInfo( + MCalRemoteAttachmentInfo& aAttachmentInfo, + MDesCArray& aAttachmentUrlArray ) const + { + FUNC_LOG; + + TRAP_IGNORE( iAttinfoFetcher->FetchAttachmentInformationL( + aAttachmentInfo, + aAttachmentUrlArray ) ) + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPlugin::DownloadAttachmentsL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentPlugin::DownloadAttachmentsL( + const RPointerArray& aAttachments, + RPointerArray& aOperations, + MCalRemoteAttachmentOperationObserver& aObserver ) + { + FUNC_LOG; + + TInt attachmentCount( aAttachments.Count() ); + aOperations.ReserveL( attachmentCount ); + for ( TInt i(0); i < attachmentCount; ++i ) + { + CMRCmailRemoteAttachmentDownloader* downloadCommand = + CMRCmailRemoteAttachmentDownloader::NewL( + *iMailClient, + aObserver, + aAttachments[i]->AttachmentIdentifier() ); + + // Ownership transferred + aOperations.AppendL( downloadCommand ); + } + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/src/cmrcmailremoteattachmentpluginattinfofetcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/src/cmrcmailremoteattachmentpluginattinfofetcher.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "cmrcmailremoteattachmentpluginattinfofetcher.h" +#include "tmrcmailremoteattachmentpluginurlparser.h" +#include "mcalremoteattachmentinfo.h" +#include "mcalremoteattachment.h" +#include "cfsmailclient.h" +#include "emailtrace.h" + +#include + +// Unnamed namespace for local definitions +namespace { // namespace::codescanner + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPluginAttinfoFetcher::CMRCmailRemoteAttachmentPluginAttinfoFetcher +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentPluginAttinfoFetcher::CMRCmailRemoteAttachmentPluginAttinfoFetcher( + CFSMailClient& aMailClient ) +: iMailClient( aMailClient ) + { + FUNC_LOG; + } + + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPluginAttinfoFetcher::~CMRCmailRemoteAttachmentPluginAttinfoFetcher +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentPluginAttinfoFetcher::~CMRCmailRemoteAttachmentPluginAttinfoFetcher() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPluginAttinfoFetcher::NewL +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentPluginAttinfoFetcher* + CMRCmailRemoteAttachmentPluginAttinfoFetcher::NewL( + CFSMailClient& aMailClient ) + { + FUNC_LOG; + + CMRCmailRemoteAttachmentPluginAttinfoFetcher* self = + new (ELeave) CMRCmailRemoteAttachmentPluginAttinfoFetcher( + aMailClient ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPluginAttinfoFetcher::ConstructL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentPluginAttinfoFetcher::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPluginAttinfoFetcher::FetchAttachmentInformationL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentPluginAttinfoFetcher::FetchAttachmentInformationL( + MCalRemoteAttachmentInfo& aAttachmentInfo, + MDesCArray& aAttachmentUrlArray ) + { + FUNC_LOG; + + TInt attachmentInfoCount( aAttachmentUrlArray.MdcaCount() ); + + for ( TInt i(0); i < attachmentInfoCount; ++i ) + { + TMRCMailRemoteAttachmentPluginURLParser mailIdParser; + + TPtrC uri( aAttachmentUrlArray.MdcaPoint(i) ); + + TInt err = mailIdParser.Parse( uri ); + User::LeaveIfError( err ); + + AddAttachmentInformationL( mailIdParser, uri, aAttachmentInfo ); + } + + + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentPluginAttinfoFetcher::FetchAttachmentInformationL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentPluginAttinfoFetcher::AddAttachmentInformationL( + TMRCMailRemoteAttachmentPluginURLParser& aParser, + const TDesC& aUri, + MCalRemoteAttachmentInfo& aAttachmentInfo ) + { + FUNC_LOG; + + // Fetch message + CFSMailMessage* message = iMailClient.GetMessageByUidL( + aParser.iMailboxUid, + aParser.iFolderUid, + aParser.iMessageUid, + EFSMsgDataStructure ); + + CleanupStack::PushL( message ); + + CFSMailMessagePart* attachment = + message->ChildPartL( aParser.iMessagepartUid ); + CleanupStack::PushL( attachment ); + + TPtrC attachmentName( attachment->AttachmentNameL() ); + TInt attachmentSize( attachment->ContentSize() ); + + MCalRemoteAttachment::TCalRemoteAttachmentState attachmentState( + MCalRemoteAttachment::EAttachmentStateNotDownloaded ); + + if ( EFSFull == attachment->FetchLoadState() ) + { + attachmentState = MCalRemoteAttachment::EAttachmentStateDownloaded; + } + + aAttachmentInfo.AddAttachmentInfoL( + aUri, + attachmentName, + attachmentSize, + attachmentState ); + + CleanupStack::PopAndDestroy( attachment ); + CleanupStack::PopAndDestroy( message ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/src/cmrcmailremoteattachmentplugindownloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/src/cmrcmailremoteattachmentplugindownloader.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,382 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "cmrcmailremoteattachmentplugindownloader.h" +#include "mcalremoteattachmentoperationobserver.h" +#include "ccalremoteattachment.h" +#include "esmrhelper.h" +#include "cfsmailclient.h" +#include "cfsmailmessage.h" + +#include + +#include "emailtrace.h" + +// Unnamed namespace for local definitions +namespace { // codescanner::namespace + +// Preferred byte count definition +const TInt KPreferredByteCount(0); + +// Percentage for progress calculation +const TInt KPercentage( 100 ); + +// Literal for temporary path +_LIT( KTempPath, "temp\\" ); + +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader( + CFSMailClient& aMailClient, + MCalRemoteAttachmentOperationObserver& aObserver ) +: CActive( EPriorityStandard ), + iMailClient( aMailClient ), + iObserver( aObserver ) + { + CActiveScheduler::Add( this ); + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentDownloader::~CMRCmailRemoteAttachmentDownloader() + { + FUNC_LOG; + + if( IsActive() ) + { + Cancel(); + } + else + { + DoCancel(); + } + delete iMailMessage; + delete iUri; + iAttachmentFile.Close(); + delete iRemoteAttachment; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +CMRCmailRemoteAttachmentDownloader* + CMRCmailRemoteAttachmentDownloader::NewL( + CFSMailClient& aMailClient, + MCalRemoteAttachmentOperationObserver& aObserver, + const TDesC& aUri ) + { + FUNC_LOG; + CMRCmailRemoteAttachmentDownloader* self = + new (ELeave) CMRCmailRemoteAttachmentDownloader( + aMailClient, + aObserver ); + + CleanupStack::PushL( self ); + self->ConstructL( aUri ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::ConstructL( + const TDesC& aUri ) + { + FUNC_LOG; + iUri = aUri.AllocL(); + + TInt error = iMailIdParser.Parse( *iUri ); + User::LeaveIfError( error ); + + // Fetch message structure and construct attachment information + iMailMessage = iMailClient.GetMessageByUidL( + iMailIdParser.iMailboxUid, + iMailIdParser.iFolderUid, + iMailIdParser.iMessageUid, + EFSMsgDataStructure ); + + CFSMailMessagePart* attachment = + iMailMessage->ChildPartL( iMailIdParser.iMessagepartUid ); + CleanupStack::PushL( attachment ); + + TPtrC attachmentName( attachment->AttachmentNameL() ); + TInt attachmentSize( attachment->ContentSize() ); + + MCalRemoteAttachment::TCalRemoteAttachmentState attachmentState( + MCalRemoteAttachment::EAttachmentStateNotDownloaded ); + + if ( EFSFull == attachment->FetchLoadState() ) + { + attachmentState = MCalRemoteAttachment::EAttachmentStateDownloaded; + } + + iRemoteAttachment = CCalRemoteAttachment::NewL( + aUri, + attachmentName, + attachmentSize, + attachmentState ); + + CleanupStack::PopAndDestroy( attachment ); + + // Trigger asynchronous request + IssueRequest(); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::DoCancel +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::DoCancel() + { + FUNC_LOG; + + TRAP_IGNORE( DoCancelL() ); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::RunL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::RunL() + { + FUNC_LOG; + + // We first check whether attachment is already downloaded to device or not + CFSMailMessagePart* attachment = + iMailMessage->ChildPartL( iMailIdParser.iMessagepartUid ); + CleanupStack::PushL( attachment ); + + if ( EFSFull == attachment->FetchLoadState() ) + { + // Attachment is fecthed to device --> Trigger completion + NotifyCompletionL( *attachment ); + } + else + { + // Attachment is not fetched --> Start fetching attachment + iFSMailOperationId = + attachment->FetchMessagePartL( + iMailIdParser.iMessagepartUid, + *this, + KPreferredByteCount ); + } + + CleanupStack::PopAndDestroy( attachment ); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::RunError +// --------------------------------------------------------------------------- +// +TInt CMRCmailRemoteAttachmentDownloader::RunError( TInt aError ) + { + FUNC_LOG; + + NotifyError( aError ); + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +TInt CMRCmailRemoteAttachmentDownloader::Progress() const + { + FUNC_LOG; + + TInt progress( 0 ); + TRAP_IGNORE( progress = ProgressL() ); + return progress; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +const MCalRemoteAttachment& + CMRCmailRemoteAttachmentDownloader::AttachmentInformation() const + { + FUNC_LOG; + return *iRemoteAttachment; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::RequestResponseL( + TFSProgress aEvent, + TInt aRequestId ) + { + FUNC_LOG; + + // Make sure that correct notification is received from mail framework + ASSERT( aRequestId == iFSMailOperationId ); + + if ( aRequestId == iFSMailOperationId ) + { + // Fetching message structure + switch ( aEvent.iProgressStatus ) + { + case TFSProgress::EFSStatus_RequestComplete: + { + // Fetch attachment part and notify completion + CFSMailMessagePart* attachment = + iMailMessage->ChildPartL( iMailIdParser.iMessagepartUid ); + CleanupStack::PushL( attachment ); + + NotifyCompletionL( *attachment ); + + CleanupStack::PopAndDestroy( attachment ); + } + break; + + case TFSProgress::EFSStatus_Status: + { + // Notify progress about downloading + TInt progress = ( KPercentage * aEvent.iCounter ) / aEvent.iMaxCount; + iObserver.Progress( this, progress ); + } + break; + + case TFSProgress::EFSStatus_RequestCancelled: + { + // Error occured during fetch operation + NotifyError( KErrCancel ); + } + break; + default: + break; + } + } + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::IssueRequest() + { + FUNC_LOG; + + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::CMRCmailRemoteAttachmentDownloader +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::NotifyCompletionL( + CFSMailMessagePart& aAttachment ) + { + FUNC_LOG; + + // Make sure that file server can share files between processes + RFs& fs = CCoeEnv::Static()->FsSession(); + fs.ShareProtected(); + + // Construct filename for attachment + TFileName fileName( KTempPath ); + fileName.Append( iRemoteAttachment->AttachmentLabel() ); + User::LeaveIfError( + ESMRHelper::CreateAndAppendOthersDirToFileName( fileName ) ); + + // Copy attachment from mail storage to file system + aAttachment.CopyContentFileL( fileName ); + + // Open file handle to attachment + User::LeaveIfError( iAttachmentFile.Open( + fs, + fileName, + EFileRead | EFileShareReadersOnly ) ); + + // Notify observer about completion + iRemoteAttachment->SetAttachmentState( + MCalRemoteAttachment::EAttachmentStateDownloaded ); + + iObserver.OperationCompleted( this, iAttachmentFile ); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::NotifyError +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::NotifyError( TInt aError ) + { + FUNC_LOG; + iObserver.OperationError( this, aError ); + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::ProgressL +// --------------------------------------------------------------------------- +// +TInt CMRCmailRemoteAttachmentDownloader::ProgressL() const + { + FUNC_LOG; + + TInt progress( 0 ); + + CFSMailMessagePart* attachment = + iMailMessage->ChildPartL( iMailIdParser.iMessagepartUid ); + CleanupStack::PushL( attachment ); + + TInt fetchedContent( attachment->FetchedContentSize() ); + TInt contentSize( attachment->ContentSize() ); + progress = ( KPercentage * fetchedContent ) / contentSize; + + CleanupStack::PopAndDestroy( attachment ); + + return progress; + } + +// --------------------------------------------------------------------------- +// CMRCmailRemoteAttachmentDownloader::DoCancelL +// --------------------------------------------------------------------------- +// +void CMRCmailRemoteAttachmentDownloader::DoCancelL() + { + FUNC_LOG; + + CFSMailMessagePart* attachment = + iMailMessage->ChildPartL( iMailIdParser.iMessagepartUid ); + CleanupStack::PushL( attachment ); + + if ( EFSFull != attachment->FetchLoadState() ) + { + iMailClient.CancelL( iFSMailOperationId ); + } + + CleanupStack::PopAndDestroy( attachment ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// Internal includes +#include "cmrcmailremoteattachmentplugin.h" +#include "calremoteattachmentapidefs.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KCalRemoteAttachmentAPICMailImpl, + CMRCmailRemoteAttachmentPlugin::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcmailremoteattachmentplugin/src/tmrcmailremoteattachmentpluginurlparser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcmailremoteattachmentplugin/src/tmrcmailremoteattachmentpluginurlparser.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "tmrcmailremoteattachmentpluginurlparser.h" +#include "cfsmailcommon.h" +#include "emailtrace.h" + +#include +#include + +// Unnamed namespace for local definitions +namespace { // namespace::codescanner + +// Length for path buffer +const TInt KPathBufferLen( 64 ); + +// Mail ID separator +_LIT( KMailIDSepararor, "." ); + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// TMRCMailRemoteAttachmentPluginURLParser::TMRCMailRemoteAttachmentPluginURLParser +// --------------------------------------------------------------------------- +// +TMRCMailRemoteAttachmentPluginURLParser::TMRCMailRemoteAttachmentPluginURLParser() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// TMRCMailRemoteAttachmentPluginURLParser::~TMRCMailRemoteAttachmentPluginURLParser +// --------------------------------------------------------------------------- +// +TMRCMailRemoteAttachmentPluginURLParser::~TMRCMailRemoteAttachmentPluginURLParser() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// TMRCMailRemoteAttachmentPluginURLParser::Parse +// --------------------------------------------------------------------------- +// +TInt TMRCMailRemoteAttachmentPluginURLParser::Parse( + const TDesC& aUri ) + { + FUNC_LOG; + + TInt err( KErrNone ); + + iMailboxUid.SetNullId(); + iFolderUid.SetNullId(); + iMessageUid.SetNullId(); + iMessagepartUid.SetNullId(); + + // Parse URI cmail://mailboxuid/folder/message/messagepart/ + // mailboxuid will be the host and rest is the folder structure + // + TUriParser16 uriparser; + TInt error = uriparser.Parse( aUri ); + + // First we will get mailbox UID + TPtrC mailboxuid( uriparser.Extract( EUriHost ) ); + ParseMailId( mailboxuid ); + + TDelimitedPathParser16 pathParser; + TPtrC uripath( uriparser.Extract( EUriPath ) ); + pathParser.Parse( uripath ); + + TBuf pathBuffer; + TPtrC pathBufferPtr( pathBuffer ); + err = pathParser.Peek( pathBufferPtr ); + while ( pathBufferPtr.Length() && err == KErrNone ) + { + err = ParseMailId( pathBufferPtr ); + pathParser.Inc(); + err = pathParser.Peek( pathBufferPtr ); + } + + if ( iMailboxUid.IsNullId() || + iFolderUid.IsNullId() || + iMessageUid.IsNullId() || + iMessagepartUid.IsNullId() ) + { + // Not all UIDs were found + err = KErrNotFound; + } + + return err; + } + +// --------------------------------------------------------------------------- +// TMRCMailRemoteAttachmentPluginURLParser::Parse +// --------------------------------------------------------------------------- +// +void TMRCMailRemoteAttachmentPluginURLParser::SetMailId( + TFSMailMsgId& aMailId ) + { + FUNC_LOG; + + if ( iMailboxUid.IsNullId() ) + { + iMailboxUid = aMailId; + } + else if ( iFolderUid.IsNullId() ) + { + iFolderUid = aMailId; + } + else if ( iMessageUid.IsNullId() ) + { + iMessageUid = aMailId; + } + else if ( iMessagepartUid.IsNullId() ) + { + iMessagepartUid = aMailId; + } + } + +// --------------------------------------------------------------------------- +// TMRCMailRemoteAttachmentPluginURLParser::ParseMailId +// --------------------------------------------------------------------------- +// +TInt TMRCMailRemoteAttachmentPluginURLParser::ParseMailId( + TPtrC& aMailId ) + { + FUNC_LOG; + + TInt err( KErrNone ); + TInt pos( KErrNotFound ); + + // Now we have pathpart in buffer. Each pathpart contains + // TFSMailMsgId if following format: pluginuid.pluginid + // We need to parse that further to plugin UID and plugin ID + pos = aMailId.Find( KMailIDSepararor ); + if ( pos != KErrNotFound ) + { + TPtrC mailUidStr( aMailId.Left( pos ) ); + TPtrC mailIdStr( aMailId.Mid( pos + 1 ) ); + + TUint pluginUid(0); + TLex numberParser( mailUidStr ); + err = numberParser.Val(pluginUid); + + if ( KErrNone == err ) + { + // Then parse plugin ID + TUint pluginId(0); + numberParser = mailIdStr; + err = numberParser.Val(pluginId); + + TFSMailMsgId mailId( pluginUid, pluginId ); + SetMailId( mailId ); + } + } + + return err; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/BWINS/ESMRCommonU.def --- a/meetingrequest/mrcommon/BWINS/ESMRCommonU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/BWINS/ESMRCommonU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,28 +1,39 @@ EXPORTS - ?LoadResourceL@ESMRHelper@@SAHABVTDesC16@@0@Z @ 1 NONAME ; int ESMRHelper::LoadResourceL(class TDesC16 const &, class TDesC16 const &) - ?IsModifyingEntryL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 2 NONAME ; int ESMREntryHelper::IsModifyingEntryL(class CCalEntry const &) - ?IsCancelledL@ESMREntryHelper@@SAHABVCCalEntry@@AAVCMRMailboxUtils@@@Z @ 3 NONAME ; int ESMREntryHelper::IsCancelledL(class CCalEntry const &, class CMRMailboxUtils &) - ?CopyUserLC@ESMRHelper@@SAPAVCCalUser@@AAV2@@Z @ 4 NONAME ; class CCalUser * ESMRHelper::CopyUserLC(class CCalUser &) - ?IsLatestSavedSentL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 5 NONAME ; int ESMREntryHelper::IsLatestSavedSentL(class CCalEntry const &) - ?PopulateChildFromParentL@ESMRHelper@@SAXAAVCCalEntry@@ABV2@@Z @ 6 NONAME ; void ESMRHelper::PopulateChildFromParentL(class CCalEntry &, class CCalEntry const &) - ?CopyFieldsL@ESMRHelper@@SAXABVCCalEntry@@AAV2@W4TCopyFields@1@@Z @ 7 NONAME ; void ESMRHelper::CopyFieldsL(class CCalEntry const &, class CCalEntry &, enum ESMRHelper::TCopyFields) - ?CopyAttendeeL@ESMRHelper@@SAPAVCCalAttendee@@AAV2@@Z @ 8 NONAME ; class CCalAttendee * ESMRHelper::CopyAttendeeL(class CCalAttendee &) - ?GetCorrectDllDriveL@ESMRHelper@@SAXAAV?$TBuf@$0BAA@@@@Z @ 9 NONAME ; void ESMRHelper::GetCorrectDllDriveL(class TBuf<256> &) - ?CopyUserL@ESMRHelper@@SAPAVCCalUser@@AAV2@@Z @ 10 NONAME ; class CCalUser * ESMRHelper::CopyUserL(class CCalUser &) - ?NewL@CESMRFeatureSettings@@SAPAV1@XZ @ 11 NONAME ; class CESMRFeatureSettings * CESMRFeatureSettings::NewL(void) - ?FeatureSupported@CESMRFeatureSettings@@QBEHI@Z @ 12 NONAME ; int CESMRFeatureSettings::FeatureSupported(unsigned int) const - ?EqualAttendeeL@ESMREntryHelper@@SAPAVCCalAttendee@@ABV2@ABVCCalEntry@@@Z @ 13 NONAME ; class CCalAttendee * ESMREntryHelper::EqualAttendeeL(class CCalAttendee const &, class CCalEntry const &) - ?SendingMailBoxL@ESMREntryHelper@@SAJABVTAgnEntryUiInParams@MAgnEntryUi@@AAVCMRMailboxUtils@@@Z @ 14 NONAME ; long ESMREntryHelper::SendingMailBoxL(class MAgnEntryUi::TAgnEntryUiInParams const &, class CMRMailboxUtils &) - ?LocateResourceFile@ESMRHelper@@SAHABVTDesC16@@0AAV?$TBuf@$0BAA@@@PAVRFs@@@Z @ 15 NONAME ; int ESMRHelper::LocateResourceFile(class TDesC16 const &, class TDesC16 const &, class TBuf<256> &, class RFs *) - ?CopyAttendeeLC@ESMRHelper@@SAPAVCCalAttendee@@AAV2@@Z @ 16 NONAME ; class CCalAttendee * ESMRHelper::CopyAttendeeLC(class CCalAttendee &) - ?SpansManyDaysL@ESMREntryHelper@@SAHABVTCalTime@@0@Z @ 17 NONAME ; int ESMREntryHelper::SpansManyDaysL(class TCalTime const &, class TCalTime const &) + ?LocateResourceFile@ESMRHelper@@SAHABVTDesC16@@0AAV?$TBuf@$0BAA@@@PAVRFs@@@Z @ 1 NONAME ; int ESMRHelper::LocateResourceFile(class TDesC16 const &, class TDesC16 const &, class TBuf<256> &, class RFs *) + ?FeatureSupported@CESMRFeatureSettings@@QBEHI@Z @ 2 NONAME ; int CESMRFeatureSettings::FeatureSupported(unsigned int) const + ?PhoneOwnerAddrL@ESMREntryHelper@@SAABVTDesC16@@ABVCCalEntry@@AAVCMRMailboxUtils@@@Z @ 3 NONAME ; class TDesC16 const & ESMREntryHelper::PhoneOwnerAddrL(class CCalEntry const &, class CMRMailboxUtils &) + ?OccursInPastL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 4 NONAME ; int ESMREntryHelper::OccursInPastL(class CCalEntry const &) + ?PopulateChildFromParentL@ESMRHelper@@SAXAAVCCalEntry@@ABV2@@Z @ 5 NONAME ; void ESMRHelper::PopulateChildFromParentL(class CCalEntry &, class CCalEntry const &) + ?IsModifyingEntryL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 6 NONAME ; int ESMREntryHelper::IsModifyingEntryL(class CCalEntry const &) + ?CopyUserL@ESMRHelper@@SAPAVCCalUser@@AAV2@@Z @ 7 NONAME ; class CCalUser * ESMRHelper::CopyUserL(class CCalUser &) + ?SetInstanceStartAndEndL@ESMREntryHelper@@SAXAAVCCalEntry@@ABV2@ABVTCalTime@@@Z @ 8 NONAME ; void ESMREntryHelper::SetInstanceStartAndEndL(class CCalEntry &, class CCalEntry const &, class TCalTime const &) + ?IsCancelledL@ESMREntryHelper@@SAHABVCCalEntry@@AAVCMRMailboxUtils@@@Z @ 9 NONAME ; int ESMREntryHelper::IsCancelledL(class CCalEntry const &, class CMRMailboxUtils &) + ?CopyAttendeeL@ESMRHelper@@SAPAVCCalAttendee@@AAV2@@Z @ 10 NONAME ; class CCalAttendee * ESMRHelper::CopyAttendeeL(class CCalAttendee &) + ?LoadResourceL@ESMRHelper@@SAHABVTDesC16@@0@Z @ 11 NONAME ; int ESMRHelper::LoadResourceL(class TDesC16 const &, class TDesC16 const &) + ?AddressWithoutMailtoPrefix@ESMRHelper@@SA?AVTPtrC16@@ABVTDesC16@@@Z @ 12 NONAME ; class TPtrC16 ESMRHelper::AddressWithoutMailtoPrefix(class TDesC16 const &) + ?IsLatestSavedSentL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 13 NONAME ; int ESMREntryHelper::IsLatestSavedSentL(class CCalEntry const &) + ?CopyEntryL@ESMRHelper@@SAPAVCCalEntry@@ABV2@W4TMethod@2@W4TCopyFields@1@W4TESMRCalendarEventType@@@Z @ 14 NONAME ; class CCalEntry * ESMRHelper::CopyEntryL(class CCalEntry const &, enum CCalEntry::TMethod, enum ESMRHelper::TCopyFields, enum TESMRCalendarEventType) + ?EqualAttendeeL@ESMREntryHelper@@SAPAVCCalAttendee@@ABV2@ABVCCalEntry@@@Z @ 15 NONAME ; class CCalAttendee * ESMREntryHelper::EqualAttendeeL(class CCalAttendee const &, class CCalEntry const &) + ?EventTypeL@ESMREntryHelper@@SA?AW4TESMRCalendarEventType@@ABVCCalEntry@@@Z @ 16 NONAME ; enum TESMRCalendarEventType ESMREntryHelper::EventTypeL(class CCalEntry const &) + ?CopyAttendeeLC@ESMRHelper@@SAPAVCCalAttendee@@AAV2@@Z @ 17 NONAME ; class CCalAttendee * ESMRHelper::CopyAttendeeLC(class CCalAttendee &) ?CreateAndAppendPrivateDirToFileName@ESMRHelper@@SAHAAV?$TBuf@$0BAA@@@@Z @ 18 NONAME ; int ESMRHelper::CreateAndAppendPrivateDirToFileName(class TBuf<256> &) - ?CorrespondingSmtpServiceL@ESMRHelper@@SAJJAAVCMsvSession@@@Z @ 19 NONAME ; long ESMRHelper::CorrespondingSmtpServiceL(long, class CMsvSession &) - ?IsRepeatingMeetingL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 20 NONAME ; int ESMREntryHelper::IsRepeatingMeetingL(class CCalEntry const &) - ?CopyEntryL@ESMRHelper@@SAPAVCCalEntry@@ABV2@W4TMethod@2@W4TCopyFields@1@@Z @ 21 NONAME ; class CCalEntry * ESMRHelper::CopyEntryL(class CCalEntry const &, enum CCalEntry::TMethod, enum ESMRHelper::TCopyFields) + ?SpansManyDaysL@ESMREntryHelper@@SAHABVTCalTime@@0@Z @ 19 NONAME ; int ESMREntryHelper::SpansManyDaysL(class TCalTime const &, class TCalTime const &) + ?CheckRepeatUntilValidityL@ESMREntryHelper@@SAXAAVCCalEntry@@ABVTCalTime@@@Z @ 20 NONAME ; void ESMREntryHelper::CheckRepeatUntilValidityL(class CCalEntry &, class TCalTime const &) + ?CopyFieldsL@ESMRHelper@@SAXABVCCalEntry@@AAV2@W4TCopyFields@1@@Z @ 21 NONAME ; void ESMRHelper::CopyFieldsL(class CCalEntry const &, class CCalEntry &, enum ESMRHelper::TCopyFields) ?NewLC@CESMRFeatureSettings@@SAPAV1@XZ @ 22 NONAME ; class CESMRFeatureSettings * CESMRFeatureSettings::NewLC(void) - ?CopyEntryLC@ESMRHelper@@SAPAVCCalEntry@@ABV2@W4TMethod@2@W4TCopyFields@1@@Z @ 23 NONAME ; class CCalEntry * ESMRHelper::CopyEntryLC(class CCalEntry const &, enum CCalEntry::TMethod, enum ESMRHelper::TCopyFields) - ?AddressWithoutMailtoPrefix@ESMRHelper@@SA?AVTPtrC16@@ABVTDesC16@@@Z @ 24 NONAME ; class TPtrC16 ESMRHelper::AddressWithoutMailtoPrefix(class TDesC16 const &) - ?OccursInPastL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 25 NONAME ; int ESMREntryHelper::OccursInPastL(class CCalEntry const &) - ?PhoneOwnerAddrL@ESMREntryHelper@@SAABVTDesC16@@ABVCCalEntry@@AAVCMRMailboxUtils@@@Z @ 26 NONAME ; class TDesC16 const & ESMREntryHelper::PhoneOwnerAddrL(class CCalEntry const &, class CMRMailboxUtils &) + ?CorrespondingSmtpServiceL@ESMRHelper@@SAJJAAVCMsvSession@@@Z @ 23 NONAME ; long ESMRHelper::CorrespondingSmtpServiceL(long, class CMsvSession &) + ?CopyUserLC@ESMRHelper@@SAPAVCCalUser@@AAV2@@Z @ 24 NONAME ; class CCalUser * ESMRHelper::CopyUserLC(class CCalUser &) + ?CopyEntryLC@ESMRHelper@@SAPAVCCalEntry@@ABV2@W4TMethod@2@W4TCopyFields@1@W4TESMRCalendarEventType@@@Z @ 25 NONAME ; class CCalEntry * ESMRHelper::CopyEntryLC(class CCalEntry const &, enum CCalEntry::TMethod, enum ESMRHelper::TCopyFields, enum TESMRCalendarEventType) + ?GetCorrectDllDriveL@ESMRHelper@@SAXAAV?$TBuf@$0BAA@@@@Z @ 26 NONAME ; void ESMRHelper::GetCorrectDllDriveL(class TBuf<256> &) + ?SendingMailBoxL@ESMREntryHelper@@SAJABVTAgnEntryUiInParams@MAgnEntryUi@@AAVCMRMailboxUtils@@@Z @ 27 NONAME ; long ESMREntryHelper::SendingMailBoxL(class MAgnEntryUi::TAgnEntryUiInParams const &, class CMRMailboxUtils &) + ?NewL@CESMRFeatureSettings@@SAPAV1@XZ @ 28 NONAME ; class CESMRFeatureSettings * CESMRFeatureSettings::NewL(void) + ?IsRepeatingMeetingL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 29 NONAME ; int ESMREntryHelper::IsRepeatingMeetingL(class CCalEntry const &) + ?CreateAndAppendOthersDirToFileName@ESMRHelper@@SAHAAV?$TBuf@$0BAA@@@@Z @ 30 NONAME ; int ESMRHelper::CreateAndAppendOthersDirToFileName(class TBuf<256> &) + ?IsAllDayEventL@ESMREntryHelper@@SAHABVCCalEntry@@@Z @ 31 NONAME ; int ESMREntryHelper::IsAllDayEventL(class CCalEntry const &) + ?KeyboardType@NMRGlobalFeatureSettings@@YA?AW4TKeyboardLayout@1@XZ @ 32 NONAME ; enum NMRGlobalFeatureSettings::TKeyboardLayout NMRGlobalFeatureSettings::KeyboardType(void) + ?Start@CMRActivityManager@@QAEXXZ @ 33 NONAME ; void CMRActivityManager::Start(void) + ?NewL@CMRActivityManager@@SAPAV1@AAVMMRActivityManagerObserver@@H@Z @ 34 NONAME ; class CMRActivityManager * CMRActivityManager::NewL(class MMRActivityManagerObserver &, int) + ?Reset@CMRActivityManager@@QAEXXZ @ 35 NONAME ; void CMRActivityManager::Reset(void) + ?SetTimeout@CMRActivityManager@@QAEXH@Z @ 36 NONAME ; void CMRActivityManager::SetTimeout(int) + ??1CMRActivityManager@@UAE@XZ @ 37 NONAME ; CMRActivityManager::~CMRActivityManager(void) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/EABI/ESMRCommonU.def --- a/meetingrequest/mrcommon/EABI/ESMRCommonU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/EABI/ESMRCommonU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,7 +1,7 @@ EXPORTS - _ZN10ESMRHelper10CopyEntryLERK9CCalEntryNS0_7TMethodENS_11TCopyFieldsE @ 1 NONAME + _ZN10ESMRHelper10CopyEntryLERK9CCalEntryNS0_7TMethodENS_11TCopyFieldsE22TESMRCalendarEventType @ 1 NONAME _ZN10ESMRHelper10CopyUserLCER8CCalUser @ 2 NONAME - _ZN10ESMRHelper11CopyEntryLCERK9CCalEntryNS0_7TMethodENS_11TCopyFieldsE @ 3 NONAME + _ZN10ESMRHelper11CopyEntryLCERK9CCalEntryNS0_7TMethodENS_11TCopyFieldsE22TESMRCalendarEventType @ 3 NONAME _ZN10ESMRHelper11CopyFieldsLERK9CCalEntryRS0_NS_11TCopyFieldsE @ 4 NONAME _ZN10ESMRHelper13CopyAttendeeLER12CCalAttendee @ 5 NONAME _ZN10ESMRHelper13LoadResourceLERK7TDesC16S2_ @ 6 NONAME @@ -13,16 +13,29 @@ _ZN10ESMRHelper26AddressWithoutMailtoPrefixERK7TDesC16 @ 12 NONAME _ZN10ESMRHelper35CreateAndAppendPrivateDirToFileNameER4TBufILi256EE @ 13 NONAME _ZN10ESMRHelper9CopyUserLER8CCalUser @ 14 NONAME - _ZN15ESMREntryHelper12IsCancelledLERK9CCalEntryR15CMRMailboxUtils @ 15 NONAME - _ZN15ESMREntryHelper13OccursInPastLERK9CCalEntry @ 16 NONAME - _ZN15ESMREntryHelper14EqualAttendeeLERK12CCalAttendeeRK9CCalEntry @ 17 NONAME - _ZN15ESMREntryHelper14SpansManyDaysLERK8TCalTimeS2_ @ 18 NONAME - _ZN15ESMREntryHelper15PhoneOwnerAddrLERK9CCalEntryR15CMRMailboxUtils @ 19 NONAME - _ZN15ESMREntryHelper15SendingMailBoxLERKN11MAgnEntryUi19TAgnEntryUiInParamsER15CMRMailboxUtils @ 20 NONAME - _ZN15ESMREntryHelper17IsModifyingEntryLERK9CCalEntry @ 21 NONAME - _ZN15ESMREntryHelper18IsLatestSavedSentLERK9CCalEntry @ 22 NONAME - _ZN15ESMREntryHelper19IsRepeatingMeetingLERK9CCalEntry @ 23 NONAME - _ZN20CESMRFeatureSettings4NewLEv @ 24 NONAME - _ZN20CESMRFeatureSettings5NewLCEv @ 25 NONAME - _ZNK20CESMRFeatureSettings16FeatureSupportedEj @ 26 NONAME + _ZN15ESMREntryHelper10EventTypeLERK9CCalEntry @ 15 NONAME + _ZN15ESMREntryHelper12IsCancelledLERK9CCalEntryR15CMRMailboxUtils @ 16 NONAME + _ZN15ESMREntryHelper13OccursInPastLERK9CCalEntry @ 17 NONAME + _ZN15ESMREntryHelper14EqualAttendeeLERK12CCalAttendeeRK9CCalEntry @ 18 NONAME + _ZN15ESMREntryHelper14SpansManyDaysLERK8TCalTimeS2_ @ 19 NONAME + _ZN15ESMREntryHelper15PhoneOwnerAddrLERK9CCalEntryR15CMRMailboxUtils @ 20 NONAME + _ZN15ESMREntryHelper15SendingMailBoxLERKN11MAgnEntryUi19TAgnEntryUiInParamsER15CMRMailboxUtils @ 21 NONAME + _ZN15ESMREntryHelper17IsModifyingEntryLERK9CCalEntry @ 22 NONAME + _ZN15ESMREntryHelper18IsLatestSavedSentLERK9CCalEntry @ 23 NONAME + _ZN15ESMREntryHelper19IsRepeatingMeetingLERK9CCalEntry @ 24 NONAME + _ZN15ESMREntryHelper23SetInstanceStartAndEndLER9CCalEntryRKS0_RK8TCalTime @ 25 NONAME + _ZN15ESMREntryHelper25CheckRepeatUntilValidityLER9CCalEntryRK8TCalTime @ 26 NONAME + _ZN20CESMRFeatureSettings4NewLEv @ 27 NONAME + _ZN20CESMRFeatureSettings5NewLCEv @ 28 NONAME + _ZNK20CESMRFeatureSettings16FeatureSupportedEj @ 29 NONAME + _ZN10ESMRHelper34CreateAndAppendOthersDirToFileNameER4TBufILi256EE @ 30 NONAME + _ZN15ESMREntryHelper14IsAllDayEventLERK9CCalEntry @ 31 NONAME + _ZN24NMRGlobalFeatureSettings12KeyboardTypeEv @ 32 NONAME + _ZN18CMRActivityManager10SetTimeoutEi @ 33 NONAME + _ZN18CMRActivityManager4NewLER26MMRActivityManagerObserveri @ 34 NONAME + _ZN18CMRActivityManager5ResetEv @ 35 NONAME + _ZN18CMRActivityManager5StartEv @ 36 NONAME + _ZN18CMRActivityManagerD0Ev @ 37 NONAME + _ZN18CMRActivityManagerD1Ev @ 38 NONAME + _ZN18CMRActivityManagerD2Ev @ 39 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/group/bld.inf --- a/meetingrequest/mrcommon/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -34,14 +34,14 @@ ../inc/tesmrscenariodata.h |../../inc/tesmrscenariodata.h ../inc/esmrconfig.hrh |../../inc/esmrconfig.hrh ../inc/tesmrinputparams.h |../../inc/tesmrinputparams.h +../inc/tmroutputparams.h |../../inc/tmroutputparams.h ../inc/esmrhelper.h |../../inc/esmrhelper.h ../inc/esmrentryhelper.h |../../inc/esmrentryhelper.h ../inc/cesmrfeaturesettings.h |../../inc/cesmrfeaturesettings.h +../inc/nmrglobalfeaturesettings.h |../../inc/nmrglobalfeaturesettings.h +../inc/cmractivitymanager.h |../../inc/cmractivitymanager.h PRJ_MMPFILES esmrcommon.mmp -// Removed dependencies to test code - - // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/group/esmrcommon.mmp --- a/meetingrequest/mrcommon/group/esmrcommon.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/group/esmrcommon.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,13 +29,12 @@ VENDORID VID_DEFAULT DEFFILE ESMRCommon.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE esmrentryhelper.cpp SOURCE esmrhelper.cpp -SOURCE cesmrfeaturesettings.cpp +SOURCE cesmrfeaturesettings.cpp +SOURCE nmrglobalfeaturesettings.cpp +SOURCE cmractivitymanager.cpp USERINCLUDE ../inc USERINCLUDE ../../inc @@ -52,10 +50,17 @@ LIBRARY msgs.lib LIBRARY featmgr.lib LIBRARY centralrepository.lib -LIBRARY PlatformEnv.lib -LIBRARY cmaillogger.lib +LIBRARY platformenv.lib +LIBRARY caleninterimutils2.lib +LIBRARY ecom.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY charconv.lib +LIBRARY eikcoctl.lib -LIBRARY flogger.lib +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/cesmrfeaturesettings.h --- a/meetingrequest/mrcommon/inc/cesmrfeaturesettings.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/cesmrfeaturesettings.h Wed Mar 31 21:08:33 2010 +0300 @@ -21,10 +21,6 @@ #include -//#include "?include_file" - -//class ?forward_classname; - /** * CESMRFeatureSettings is utility to access MRUI Features repository. * Usage: @@ -61,8 +57,11 @@ /** Previous locations list */ EESMRUIPreviousLocationsList = 0x8, /** Any of the previous location features */ - // Must be last member in enumeration - EESMRUILocationFeatures + EESMRUILocationFeatures = 0xf, + /** Meeting request viewer only for Cmail */ + EMRUIMeetingRequestViewerCmailOnly = 0x10, + /** Any of the prevuious features */ + EMRUIAllFeatures }; IMPORT_C static CESMRFeatureSettings* NewL(); @@ -102,14 +101,15 @@ EESMRUIContactsIntegrationIndex, EESMRUILandmarksIntegrationIndex, EESMRUIPreviousLocationsListIndex, + EMRUIMeetingRequestViewerCmailIndex, // Last item. Number of features - EESMRUINumLocationFeatures + EESMRUINumFeatures }; /** * Feature status array */ - TInt iLocationFeatures[ EESMRUINumLocationFeatures ]; + TInt iFeatures[ EESMRUINumFeatures ]; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/cmractivitymanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcommon/inc/cmractivitymanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Meeting Request timer for the focus +* +*/ +#ifndef CMRTIMER_H +#define CMRTIMER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS + +// CLASS DECLARATIONS +class MMRActivityManagerObserver + { + public : + virtual void PeriodCompleted() = 0; + }; + +NONSHARABLE_CLASS( CMRActivityManager ): public CBase + { + public: + + IMPORT_C static CMRActivityManager* NewL( + MMRActivityManagerObserver& aObserver, + TInt aTimeout = 6 ); + + IMPORT_C ~CMRActivityManager(); + + IMPORT_C void SetTimeout( TInt aTimeout ); + + IMPORT_C void Start(); + + IMPORT_C void Reset(); + + private: // New functions + + /** + * The call back function. + * \param aAny A pointer to this class. + */ + static TInt PeriodicTimerCallBack(TAny* aAny); + + /** + * Notice that this is a sample fuction. + * + */ + void NotifyObserver(); + + private: // Implementation + CMRActivityManager( + MMRActivityManagerObserver& aObserver, + TInt aTimeout ); + void ConstructL(); + + private: // Member data + + /** + * The periodic timer. + * Owned by CMyClass + */ + CPeriodic* iPeriodicTimer; + + /// Ref: Observer for listening the activity manager + MMRActivityManagerObserver& iObserver; + /// Timeout + TInt iTimeoutInSecs; + }; + +#endif // CMRTIMER_H +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/esmrcommands.h --- a/meetingrequest/mrcommon/inc/esmrcommands.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/esmrcommands.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,6 +19,7 @@ #define ESMRCOMMANDS_H #include +#include /** * Enumeration for ES MR commands. @@ -36,6 +37,7 @@ EESMRCmdSendMR, // Send Meeting request EESMRCmdSendMRUpdate, // Send MR update EESMRCmdSaveMR, // Save MR + EESMRCmdSaveCloseMR, // Save and Close MR EESMRCmdEdit, // Edit MR EESMRCmdEditLocal, // Locally edit meeting request EESMRCmdReply, // Reply to one recipient @@ -50,7 +52,7 @@ EESMRCmdPriorityOptions, // Cascade menu command for priority options EESMRCmdAddAttendees, // add attendees to meeting EESMRCmdShowAllAttendees, // show all attendees of attendee viever field - EESMRCmdForward, // Forward MR + EESMRCmdForwardOptions, // Cascade menu command for forward options EESMRCmdForceExit, // Exit without saving EESMRCmdAlarmOn, EESMRCmdAlarmOff, @@ -60,16 +62,18 @@ EESMRCmdOpenAlarmQuery, EESMRCmdOpenLocationContextMenu, EESMRCmdCheckEvent, - EESMRCmdClipboardCopy, // Copy to clipboard in viewer options menu - EESMRCmdTodoMarkAsDone, // todoviewer options menu - EESMRCmdTodoMarkAsNotDone, // todoviewer options menu + EESMRCmdClipboardCopy, // Copy to clipboard in viewer options menu + EESMRCmdTodoMarkAsDone, // todoviewer options menu + EESMRCmdTodoMarkAsNotDone, // todoviewer options menu + EESMRCmdOpenUnifiedEditorQuery, // Open query for event type + EESMRCmdOpenMultiCalenSelectQuery, // Open query for multi calen selection dialog - /** + /** * Tracking view commands */ - EESMRCmdViewTrack, // Show tracking view - EESMRCmdCall, // Call the selected participant - EESMRCmdBack, // Back to previos dialog + EESMRCmdViewTrack, // Show tracking view + EESMRCmdCall, // Call the selected participant + EESMRCmdBack, // Back to previos dialog /** * Calendar Entry UI Specific commands @@ -87,7 +91,9 @@ EESMRTentativeWithoutAttachmentCheck, // Tentative MR without attachment check EESMRDeclineWithoutAttachmentCheck, // Decline MR without attachment check EESMRRemoveFromDbWithoutAttachmentCheck, // Remove from calendar without attachment check - + EMRLaunchAttachmentContextMenu, // Launch context menu for attachment field + EMRCmdHideAttachmentIndicator, // Hide attachment indicator from UI + /** * Attendee field contact handling related */ @@ -102,13 +108,13 @@ /** Attachment field specific command */ EESMRCmdMskOpenEmailAttachment, - + /** * MR Contact Action Plugin specific command * to notify that editor is inialized and ready * to be shown on screen * */ - EESMRCmdEditorInitializationComplete, + EESMRCmdEditorInitializationComplete, /** * Location integration @@ -123,16 +129,57 @@ EESMRCmdLandmarks, EESMRCmdDisableWaypointIcon, EESMRCmdEnableWaypointIcon, - + /** - * Middle softkey restoration + * Middle softkey restoration */ EESMRCmdRestoreMiddleSoftKey, - + /** * Text size of field exceeded */ EESMRCmdSizeExceeded, + + EESMRCmdLongtapDetected, + + /** + * Attachment field + */ + EESMRViewerOpenAttachment, + EESMRViewerSaveAttachment, + EESMRViewerOpenAndSaveAttachment, + EESMRViewerSaveAllAttachments, + EESMRViewerCancelAttachmentDownload, + + EESMREditorOpenAttachment, + EESMREditorRemoveAttachment, + EESMREditorRemoveAllAttachments, + EESMREditorAddAttachment, + + /** + * Unified editor commands + */ + EMRCommandSwitchToMR, + EMRCommandSwitchToMeeting, + EMRCommandSwitchToMemo, + EMRCommandSwitchToAnniversary, + EMRCommandSwitchToTodo, + EESMRCmdCalendarChange, //switch calendar + + /** + * My Locations view commands + */ + EMRCommandMyLocations, + + /** + * Other commands + */ + EMRDialogOptionsMenuExit, + + /** + * Environment change + */ + EMRCmdDoEnvironmentChange, /** * FS Email specific command range @@ -149,16 +196,6 @@ EESMRCmdSendAs = 30000, /** - * Printing Framework - */ - EESMRCmdPrint = 100155, - EESMRCmdPrint_Reserved1, - EESMRCmdPrint_Reserved2, - EESMRCmdPrint_Reserved3, - EESMRCmdPrint_Reserved4, - - - /** * Action menu command items */ EESMRCmdActionMenu = 999500, // Action menu command @@ -166,6 +203,19 @@ EESMRCmdActionMenuLast = 999600 // Last dynamic submenu command }; +/** + * Enumeration for MR plugin commands. + * Define mrplugin command ids after RECAL Calendar's last commands + */ +enum TMRCalenPluginCommands + { + /** + *Plugin Commands + */ + EMRPluginCommandBase = ECalenLastCommand, // Last TCalenCommandId + EMRLaunchMeetingViewer // Use meeting viewer to open entry + }; + #endif // ESMRCOMMANDS_H // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/esmrconfig.hrh --- a/meetingrequest/mrcommon/inc/esmrconfig.hrh Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/esmrconfig.hrh Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,18 +18,13 @@ #ifndef ESMRCONFIG_HRH #define ESMRCONFIG_HRH -#ifndef KFeatureIdPrintingFrameworkCalendarPlugin -#define KFeatureIdPrintingFrameworkCalendarPlugin 5057 //actual ID from customswruntimeids.hrh -#endif // KFeatureIdPrintingFrameworkCalendarPlugin - -#ifndef KFeatureIdFfFsCalendarLocation -#define KFeatureIdFfFsCalendarLocation 5171 //actual ID from customswruntimeids.hrh -#endif // KFeatureIdFfFsCalendarLocation - // #define EMAIL_FW_NEW_CAPAS_RELEASED // #define ESMR_ENABLE_PROFILE +#undef RD_USE_MYLOCATIONUI +#undef RD_USE_PS2_APIS + #endif //ESMRCONFIG_HRH // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/esmrdef.h --- a/meetingrequest/mrcommon/inc/esmrdef.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/esmrdef.h Wed Mar 31 21:08:33 2010 +0300 @@ -25,13 +25,16 @@ /** * Enumeration for calendar entry types */ + enum TESMRCalendarEventType { - EESMREventTypeAppt = 0, // Appointment calendar item - EESMREventTypeETodo, // TO-DO calendar item - EESMREventTypeEEvent, // Event calendar item - EESMREventTypeEReminder, // Reminder calendar item - EESMREventTypeEAnniv // Anniversary calendar item + EESMREventTypeNone = -1, + EESMREventTypeMeetingRequest = 0, // Meeting request item + EESMREventTypeAppt, // Appointment calendar item + EESMREventTypeEEvent, // Event calendar item + EESMREventTypeEAnniv, // Anniversary calendar item + EESMREventTypeETodo, // TO-DO calendar item + EESMREventTypeEReminder // Reminder calendar item }; /** @@ -126,11 +129,6 @@ EESMRFieldResponseArea = 1, // Response ready area, this is created always // when EESMRFieldResponseArea is given by policy - EESMRFieldResponseReadyArea, - // Response area with one item, this used at runtime. - // Not working in policy. The EESMRFieldResponseArea should be used in - // policy. If the response is e.g. Cancelled then this is used - // solve the measures of the ui components. EESMRFieldResponseAreaWithOneItem, // Organizer field EESMRFieldOrganizer, @@ -178,14 +176,20 @@ EESMRFieldViewerBasic, // Additional Subject field for viewer EESMRFieldDetailedSubject, - // Attachments field - EESMRFieldAttachments, // Tracking required attendeee field EESMRFieldReqTrack, // Tracking Optional Attendee field EESMRFieldOptTrack, // Tracking status - EESMRTrackStatus + EESMRTrackStatus, + // Attachment field + EESMRFieldAttachments, + // Event type field + EESMRFieldUnifiedEditor, + // Calendar name field + EESMRFieldCalendarName, + // Viewer attachment field + EESMRFieldViewerAttachments }; /** @@ -194,7 +198,8 @@ enum TESMRFieldType { EESMRFieldTypeDefault, // Default field - EESMRFieldTypeAdditional // Additional field + EESMRFieldTypeAdditional, // Additional field + EESMRFieldTypeDisabled // Disabled field }; /** @@ -355,6 +360,40 @@ EESMRImapPop }; +/** + * BC Plugin event types for resource file + */ +#define KMRTypeMeetingRequest 0x01 +#define KMRTypeMeeting 0x02 +#define KMRTypeMemo 0x04 +#define KMRTypeAnniversary 0x08 +#define KMRTypeToDo 0x10 + +/** + * BC Plugin event types + */ +enum TBCPluginEventType + { + EMRTypeMeetingRequest = 0, + EMRTypeMeeting = 1, + EMRTypeMemo = 2, + EMRTypeAnniversary = 3, + EMRTypeToDo = 4, + EMRTypeNone = 1024 + }; + +/** + * Defines processor mode + */ +enum TMRProcessorMode + { + EMRProcessorModeNone = 0, + EMRProcessorModeView = 1, + EMRProcessorModeEdit = 2, + EMRProcessorModeForward = 3, + EMRProcessorModeTrack = 4 + }; + // ESMRICALVIEWER definitions #include "esmricalviewerdefs.hrh" // diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/esmrentryhelper.h --- a/meetingrequest/mrcommon/inc/esmrentryhelper.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/esmrentryhelper.h Wed Mar 31 21:08:33 2010 +0300 @@ -19,8 +19,9 @@ #ifndef MESMRENTRYHELPER_H #define MESMRENTRYHELPER_H +#include "esmrdef.h" #include -#include +#include class CCalEntry; class CCalAttendee; @@ -83,6 +84,14 @@ IMPORT_C static TBool IsCancelledL( const CCalEntry& aEntry, CMRMailboxUtils& aUtils ); + + /** + * Checks if entry is all-day event. + * @param aEntry + * @return ETrue if meeting is all-day event + */ + IMPORT_C static TBool IsAllDayEventL( + const CCalEntry& aEntry ); /** * Checks whether entry is out of date or not. @@ -122,6 +131,35 @@ IMPORT_C static TBool SpansManyDaysL( const TCalTime& aStartTime, const TCalTime& aEndTime ); + + /** + * Resolves the calendar entry type. + * @param aCalEntry reference to calendar entry + */ + IMPORT_C static TESMRCalendarEventType EventTypeL( + const CCalEntry& aCalEntry ); + + /** + * Sets child entry's start and end time. + * + * @param aChild Reference to child entry + * @param aParent Reference to parent entry + * @param aChildEnd Child entry's start time + */ + IMPORT_C static void SetInstanceStartAndEndL( + CCalEntry& aChild, + const CCalEntry& aParent, + const TCalTime& aChildStart ); + + /** + * Checks and adjust repeat until validity. Method adjusts entry's + * recurrence until time if needed. + * @param aEntry Reference to parent entry + * @param aInstanceTime Reference to instances time + */ + IMPORT_C static void CheckRepeatUntilValidityL( + CCalEntry& aEntry, + const TCalTime& aInstanceTime ); }; -#endif // MESMRENTRYHELPER_H \ No newline at end of file +#endif // MESMRENTRYHELPER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/esmrhelper.h --- a/meetingrequest/mrcommon/inc/esmrhelper.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/esmrhelper.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,6 +22,8 @@ #include #include +#include "esmrdef.h" + class CCalAttendee; class CCalUser; class CMsvSession; @@ -92,7 +94,8 @@ IMPORT_C static CCalEntry* CopyEntryL( const CCalEntry& aEntry, CCalEntry::TMethod aMethod, - TCopyFields aCopyType ); + TCopyFields aCopyType, + TESMRCalendarEventType aEntryType = EESMREventTypeNone ); /** * Creates a copy with given method type. @@ -105,7 +108,8 @@ IMPORT_C static CCalEntry* CopyEntryLC( const CCalEntry& aEntry, CCalEntry::TMethod aMethod, - TCopyFields aCopyType ); + TCopyFields aCopyType, + TESMRCalendarEventType aEntryType = EESMREventTypeNone ); /** * Copies entry fields according to the copy type specification. @@ -122,7 +126,7 @@ /** * Returns TPtrC to all/part of the aAddress parameter - * so that possible "mailto:" or "MAILTO:" prefix is + * so that possible "mailto:" or "MAILTO:" prefix is * stripped out. * * @param aAddress address which might contain the prefix @@ -184,19 +188,98 @@ const TDesC& aPath, TFileName &aResourceFile, RFs* aFs = NULL ); - + // getting temporary file name is not hard coded /** - * Creates and append process'es private directory to begining of file. + * Creates and appends process' private directory to beginning of file. * It also appends two back slashes, so aFileName should not contain any * backslashes in the begining. * * @param aFileName private directory is appended to this file name * @return error code */ - IMPORT_C static TInt CreateAndAppendPrivateDirToFileName(TFileName& aFileName); + IMPORT_C static TInt CreateAndAppendPrivateDirToFileName( + TFileName& aFileName); // - + + /** + * Creates and appends system private directory to beginning of file. + * It also appends two back slashes, so aFileName should not contain any + * backslashes in the begining. + * + * @param aFileName Others directory is appended to this file name + * @return error code + */ + IMPORT_C static TInt CreateAndAppendOthersDirToFileName( + TFileName& aFileName); + +private: + /** + * Enumeration for entry type switching + */ + + enum TESMRSwitchEventType + { + EMRSwitchUnknown = -1, + EMRSwitchMRToMeeting = 0, + EMRSwitchMRToMemo, + EMRSwitchMRToAnniversary, + EMRSwitchMRToTodo, + + EMRSwitchMeetingToMR, + EMRSwitchMeetingToMemo, + EMRSwitchMeetingToAnniversary, + EMRSwitchMeetingToTodo, + + EMRSwitchMemoToMR, + EMRSwitchMemoToMeeting, + EMRSwitchMemoToAnniversary, + EMRSwitchMemoToTodo, + + EMRSwitchAnniversaryToMR, + EMRSwitchAnniversaryToMeeting, + EMRSwitchAnniversaryToMemo, + EMRSwitchAnniversaryToTodo, + + EMRSwitchTodoToMR, + EMRSwitchTodoToMeeting, + EMRSwitchTodoToMemo, + EMRSwitchTodoToAnniversary + }; + +private: // implementation + + static CCalEntry* CopyEntryAndSwitchTypeL( + const CCalEntry& aSourceEntry, + TESMRCalendarEventType aTargetType ); + + static TESMRSwitchEventType ResolveSwitchType( + TESMRCalendarEventType aSourceType, + TESMRCalendarEventType aTargetType ); + + // This handles all entry type changes to Memo + static CCalEntry* SwitchToMemoL( const CCalEntry& aSourceEntry ); + // This handles all entry type changes to Anniversary + static CCalEntry* SwitchToAnniversaryL( const CCalEntry& aSourceEntry ); + // This handles all entry type changes to To-do + static CCalEntry* SwitchToTodoL( const CCalEntry& aSourceEntry ); + // This handles all entry type changes to Meeting + static CCalEntry* SwitchToMeetingL( const CCalEntry& aSourceEntry ); + // This handles all entry type changes to Meeting request + static CCalEntry* SwitchToMRL( const CCalEntry& aSourceEntry ); + + // Helper functions + static CCalEntry* CreateEntryL( + CCalEntry::TType aType, + const TDesC8& aUid, + CCalEntry::TMethod aMethod, + CalCommon::TRecurrenceRange aRange ); + static void SetMeetingTimeL( + CCalEntry& aTargetEntry, + const CCalEntry& aSourceEntry ); + static void SetDefaultAlarmForMeetingL( + CCalEntry& aTargetEntry ); + static void AddOrganizerL( CCalEntry& aTargetEntry ); }; #endif // ESMRHELPER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/esmrinternaluid.h --- a/meetingrequest/mrcommon/inc/esmrinternaluid.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/esmrinternaluid.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -31,7 +31,7 @@ #define KESMRUtilsCalPluginDataImap "[1000102a]" //For plugin resource file #define KESMRUtilsCalPluginDataSmtp "[10001028]" //For plugin resource file // S60 UID update -#define KESMRUtilsCalPluginDataFs "[2001F406]" //For plugin resource file +#define KESMRUtilsCalPluginDataFs "[2001f406]" //For plugin resource file #define KESMRUtilsCalPluginResource 2001E27F.rss // for mmp // S60 UID update @@ -103,9 +103,22 @@ #define KESMRLocationPluginImplementationUid 0x2001E60B #define KESMRLocationPluginDllUid 0x2001E60C +// MR Mailbox Utils plugin UIDs +#define KESMRMButilsExtensionImplementationUid 0x2002137D +#define KESMRMButilsExtensionDllUid 0x2002137D +#define KMRDefaultCMailMRMailbox 0x2002137C + +// MR BC Plugin UIDs +#define KMRBCPluginImplementationUid 0x2002137B +#define KMRBCPluginDllUid 0x2002137B + #define KS60CalenEditorsImplementation 0x102071F4 #define KCalEntryUIImplmentation 0x200025B4 +#define KMREntryProcessorInterfaceUID 0x20026F6D +#define KMRMeetingRequestProcessorImplementationUID 0x20026F6E +#define KMRCalEventProcessorImplementationUID 0x20026F6F + // MRUI Private CenRep UIDs #define KESMRUIPreviousLocationsCRUid 0x2001E611 @@ -114,5 +127,20 @@ #define KMaxMinutesInHour 59 #define KMaxSecondsInMinute 59 +// Definition for BC plug-in resources +#define KBCCalMRPluginResource "bcmreventplugin.rsc" + +#define KMRBCEventPluginInterfaceUID 0x20022D89 +#define KMRBCMREventPluginImplementationUID 0x20022D8A + +// Definition of MR Tasks ECom plug-in UIDs +#define KMRTaskInterfaceUID 0x20022D8C +#define KMRTaskPluginImplementationUID 0x20022D8D +#define KMRCalEventTaskPluginImplementationUID 0x20026F6C + +// Definition of MR Policy resolver ECom plug-in UIDs +#define KMRPolicyResolverInterfaceUID 0x20026F70 +#define KMREntryPolicyImplementationUID 0x20026FB8 +#define KMRCalEntryPolicyImplementationUID 0x20026FB9 #endif // ESMRINTERNALUID_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/mrbcplugin.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcommon/inc/mrbcplugin.rh Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource headers for project esmrservices +* +*/ + + +#ifndef MRBCPLUGIN_RH +#define MRBCPLUGIN_RH + +// --------------------------------------------------------------------------- +// Resource definition for plug-in info +// --------------------------------------------------------------------------- +// +STRUCT MR_BCPLUGIN_INFO + { + LONG version; // Version information + LONG event_type; // Supported event types (See esmrdef.h) + STRUCT command_table[]; // command ID table (MR_BCPLUGIN_COMMAND) + } + +// --------------------------------------------------------------------------- +// Resource definition for plug-in command id +// --------------------------------------------------------------------------- +// +STRUCT MR_BCPLUGIN_COMMAND + { + LONG command_id; // Command identifier + LONG check_entry_type; // Entry type needs to be checked + } + +#endif // MRBCPLUGIN_RH + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/mruidomaincrkeys.h --- a/meetingrequest/mrcommon/inc/mruidomaincrkeys.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/mruidomaincrkeys.h Wed Mar 31 21:08:33 2010 +0300 @@ -55,4 +55,18 @@ */ const TUint32 KESMRUIFeaturePreviousLocationsList = 0x4; +/** + * CenRep key for disabling all features except meeting request + * viewer in Cmail application. + * + * Default value: 0 (off) + */ +const TUint32 KMRUIFeatureMeetingRequestViewerCmailOnly = 0x5; + +/** + * CenRep key for storing default calendar database index for + * meeting request entries. + */ +const TUint32 KMRUIDefaultCalDbIndex = 0x6; + #endif // MRUIDOMAINCRKEYS_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/nmrglobalfeaturesettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcommon/inc/nmrglobalfeaturesettings.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Color manager for MRGUI usage. +* +*/ + +#ifndef NMRGLOBALFEATURESETTINGS_H +#define NMRGLOBALFEATURESETTINGS_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS + +// CLASS DECLARATIONS + +// NAMESPACE DECLARATIONS +namespace NMRGlobalFeatureSettings + { + enum TKeyboardLayout + { + // Values taken from + // http://developer.symbian.org/main/documentation/reference/s%5E2/ + // doc_source/reference/9.4-PP/AVKON_Settings_API/ + // AvkonInternalCRKeys.hGlobals.html + EUninitialized = -1, + ENoKeyboard = 0, + EKeyboardW12Keys = 1, + EQwerty4x12 = 2, + EQwerty4x10 = 3, + EQwerty3x11 = 4, + EHalfQwerty = 5, + ECustomQwerty = 6 + }; + + /** + * Checks the device's keyboard layout + * + * @return The keyboard layout, ENoKeyboard returned from the touch + * only devices. + */ + IMPORT_C TKeyboardLayout KeyboardType(); + } + +#endif // NMRGLOBALFEATURESETTINGS_H +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/tesmrinputparams.h --- a/meetingrequest/mrcommon/inc/tesmrinputparams.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/inc/tesmrinputparams.h Wed Mar 31 21:08:33 2010 +0300 @@ -67,12 +67,6 @@ TESMRCommand iCommand; /** - * Pointer to attachment information - * Not owned. - */ - CESMRAttachmentInfo* iAttachmentInfo; - - /** * Reserved for future use */ TInt iSpare; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/inc/tmroutputparams.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcommon/inc/tmroutputparams.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definitions for MR output parameters +* +*/ + + +#ifndef TMROUTPUTPARAMS_H +#define TMROUTPUTPARAMS_h + +// +#include "esmrdef.h" +// + +/** + * TMROutputParams defines MR UI output parameters. + * + * @lib mrcommon.lib + */ +class TMROutputParams + { +public: // Data + + /** + * Command to be executed + */ + TESMRCommand iCommand; + + /** + * Reserved for future use + */ + TInt iSpare; + }; + +#endif // TMROUTPUTPARAMS_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/src/cesmrfeaturesettings.cpp --- a/meetingrequest/mrcommon/src/cesmrfeaturesettings.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/src/cesmrfeaturesettings.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -38,8 +38,7 @@ #endif // _DEBUG -// Removed unneeded cleanup function. -// +const TInt KNumLocationFeatures = 4; } // namespace @@ -62,41 +61,33 @@ // --------------------------------------------------------------------------- // void CESMRFeatureSettings::ConstructL() - { + { FUNC_LOG; - // Removed unneeded cleanup function. - FeatureManager::InitializeLibL(); - - TBool locationIntegrationSupported = FeatureManager::FeatureSupported( - KFeatureIdFfFsCalendarLocation ); + + // Read settings from central repository. These are read-only settings, + // so these must be read only once at this object lifetime. + CRepository* settings = NULL; + TRAPD( err, settings = CRepository::NewL( KCRUidESMRUIFeatures ) ); - FeatureManager::UnInitializeLib(); - - if ( locationIntegrationSupported ) + if ( err == KErrNone ) { - // Read settings from central repository. These are read-only settings, - // so these must be read only once at this object lifetime. - CRepository* settings = NULL; - TRAPD( err, settings = CRepository::NewL( KCRUidESMRUIFeatures ) ); + settings->Get( KESMRUIFeatureMnFwIntegration, + iFeatures[ EESMRUIMnFwIntegrationIndex ] ); + + settings->Get( KESMRUIFeatureContactsIntegration, + iFeatures[ EESMRUIContactsIntegrationIndex ] ); + + settings->Get( KESMRUIFeatureLandmarksIntegration, + iFeatures[ EESMRUILandmarksIntegrationIndex ] ); + + settings->Get( KESMRUIFeaturePreviousLocationsList, + iFeatures[ EESMRUIPreviousLocationsListIndex ] ); - if ( err == KErrNone ) - { - settings->Get( KESMRUIFeatureMnFwIntegration, - iLocationFeatures[ EESMRUIMnFwIntegrationIndex ] ); - - settings->Get( KESMRUIFeatureContactsIntegration, - iLocationFeatures[ EESMRUIContactsIntegrationIndex ] ); - - settings->Get( KESMRUIFeatureLandmarksIntegration, - iLocationFeatures[ EESMRUILandmarksIntegrationIndex ] ); - - settings->Get( KESMRUIFeaturePreviousLocationsList, - iLocationFeatures[ EESMRUIPreviousLocationsListIndex ] ); - - delete settings; - } - } - // + settings->Get( KMRUIFeatureMeetingRequestViewerCmailOnly, + iFeatures[ EMRUIMeetingRequestViewerCmailIndex ] ); + + delete settings; + } } @@ -151,10 +142,11 @@ case EESMRUIContactsIntegration: case EESMRUILandmarksIntegration: case EESMRUIPreviousLocationsList: + case EMRUIMeetingRequestViewerCmailOnly: { TInt index = MapFeature( aFeatures ); if ( index > KErrNotFound - && iLocationFeatures[ index ] ) // codescanner::accessArrayElementWithoutCheck2 + && iFeatures[ index ] ) // codescanner::accessArrayElementWithoutCheck2 { featureSupported = ETrue; } @@ -164,9 +156,9 @@ // All flag case EESMRUILocationFeatures: { - for ( TInt i = 0; i < EESMRUINumLocationFeatures; ++i ) + for ( TInt i = 0; i < KNumLocationFeatures; ++i ) { - if ( iLocationFeatures[ i ] ) // codescanner::accessArrayElementWithoutCheck2 + if ( iFeatures[ i ] ) // codescanner::accessArrayElementWithoutCheck2 { featureSupported = ETrue; break; // for-loop @@ -179,18 +171,18 @@ default: { TUint mask = 0x1; - for ( TInt i = 0; i < EESMRUINumLocationFeatures; ++i ) + for ( TInt i = 0; i < EESMRUINumFeatures; ++i ) { TUint feature = aFeatures & mask; TInt index = MapFeature( feature ); if ( ( index > KErrNotFound ) - && ( feature < EESMRUILocationFeatures ) - && iLocationFeatures[ index ] ) // codescanner::accessArrayElementWithoutCheck2 + && ( feature < EMRUIAllFeatures ) + && iFeatures[ index ] ) // codescanner::accessArrayElementWithoutCheck2 { featureSupported = ETrue; break; } - else if ( feature > EESMRUILocationFeatures ) + else if ( feature > EMRUIAllFeatures ) { __ASSERT_DEBUG( EFalse, User::Panic( KPanicCategory, EUnknownFeature) ); } @@ -240,6 +232,11 @@ index = EESMRUIPreviousLocationsListIndex; break; } + case EMRUIMeetingRequestViewerCmailOnly: + { + index = EMRUIMeetingRequestViewerCmailIndex; + break; + } default: // Illegal flags { __ASSERT_DEBUG( EFalse, User::Panic( KPanicCategory, EUnknownFeature) ); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/src/cmractivitymanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcommon/src/cmractivitymanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR policy implementation +* +*/ + +#include "cmractivitymanager.h" + +// ---------------------------------------------------------------------------- +// CMRActivityManager::CMRActivityManager +// ---------------------------------------------------------------------------- +// +CMRActivityManager::CMRActivityManager( + MMRActivityManagerObserver& aObserver, + TInt aTimeoutInSecs ) +: iObserver( aObserver ), iTimeoutInSecs( aTimeoutInSecs) + { + + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::NewL +// ---------------------------------------------------------------------------- +// +EXPORT_C CMRActivityManager* CMRActivityManager::NewL( + MMRActivityManagerObserver& aObserver, + TInt aTimeoutInSecs ) + { + CMRActivityManager* self = new + ( ELeave )CMRActivityManager( aObserver, aTimeoutInSecs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::~CMRActivityManager() +// ---------------------------------------------------------------------------- +// +EXPORT_C CMRActivityManager::~CMRActivityManager() + { + if( iPeriodicTimer ) + { + // Calling Cancel without checking if the timer is active is safe + iPeriodicTimer->Cancel(); + } + delete iPeriodicTimer; + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::ConstructL() +// ---------------------------------------------------------------------------- +// +void CMRActivityManager::ConstructL() + { + // Initialize the periodic timer. + iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityIdle ); + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::SetTimeout() +// ---------------------------------------------------------------------------- +// + +EXPORT_C void CMRActivityManager::SetTimeout( TInt aTimeout ) + { + iTimeoutInSecs = aTimeout; + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::Start() +// ---------------------------------------------------------------------------- +// + +EXPORT_C void CMRActivityManager::Start() + { + if ( iPeriodicTimer ) + { + iPeriodicTimer->Cancel(); + } + else + { + TRAP_IGNORE(iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityIdle )); + } + if ( iPeriodicTimer && !iPeriodicTimer->IsActive() ) + { + TInt secs( 1000000 * iTimeoutInSecs ); + iPeriodicTimer->Start( + secs, secs, + TCallBack( PeriodicTimerCallBack, this ) ); + } + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::Reset() +// ---------------------------------------------------------------------------- +// +EXPORT_C void CMRActivityManager::Reset() + { + if( iPeriodicTimer ) + { + // Calling Cancel without checking if the timer is active is safe + iPeriodicTimer->Cancel(); + } + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::PeriodicTimerCallBack(TAny* aAny) +// The call back function. +// ---------------------------------------------------------------------------- +// +TInt CMRActivityManager::PeriodicTimerCallBack(TAny* aAny) + { + CMRActivityManager* self = static_cast( aAny ); + self->NotifyObserver(); + + // Cancel the timer when the callback should not be called again. + self->iPeriodicTimer->Cancel(); + + return KErrNone; // Return value ignored by CPeriodic + } + +// ---------------------------------------------------------------------------- +// CMRActivityManager::SomeFunction(TAny* aAny) +// Notice that this is a sample fuction. +// ---------------------------------------------------------------------------- +// +void CMRActivityManager::NotifyObserver() + { + iObserver.PeriodCompleted(); + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/src/esmrentryhelper.cpp --- a/meetingrequest/mrcommon/src/esmrentryhelper.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/src/esmrentryhelper.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -21,6 +21,7 @@ #include "emailtrace.h" #include "esmrentryhelper.h" #include "esmrhelper.h" +#include "esmrdef.h" // From System #include @@ -28,9 +29,17 @@ #include #include #include -#include +#include #include +#include +// unnamed naespace for local definitions +namespace { // codescanner::namespace + +// Definition for zero interval +const TInt KZeroInterval( 0 ); + +} // ======== MEMBER FUNCTIONS ======== @@ -154,6 +163,38 @@ } // ---------------------------------------------------------------------------- +// ESMREntryHelper::IsAllDayEventL +// ---------------------------------------------------------------------------- +// +EXPORT_C TBool ESMREntryHelper::IsAllDayEventL( const CCalEntry& aEntry ) + { + FUNC_LOG; + TBool retVal( EFalse ); + + TDateTime start = aEntry.StartTimeL().TimeLocalL().DateTime(); + TDateTime end = aEntry.EndTimeL().TimeLocalL().DateTime(); + + // All-day events: + // From one days 00:00:00 to at least next days 00:00:00. + // Start times hour, minute and second need to be the same. + // Start and end time days need to be different + if( start.Hour() == end.Hour() && + start.Minute() == end.Minute() && + start.Second() == end.Second() && + start.Day() != end.Day() ) + { + if( start.Hour() == 0 && + start.Minute() == 0 && + start.Second() == 0 ) + { + retVal = ETrue; + } + } + + return retVal; + } + +// ---------------------------------------------------------------------------- // ESMREntryHelper::OccursInPastL // ---------------------------------------------------------------------------- // @@ -251,5 +292,147 @@ return retVal; } +// ---------------------------------------------------------------------------- +// ESMREntryHelper::EventTypeL +// ---------------------------------------------------------------------------- +// +EXPORT_C TESMRCalendarEventType ESMREntryHelper::EventTypeL( + const CCalEntry& aCalEntry ) + { + FUNC_LOG; + + TESMRCalendarEventType type( EESMREventTypeNone ); + + switch ( aCalEntry.EntryTypeL() ) + { + case CCalEntry::EAppt: + if ( CCalenInterimUtils2::IsMeetingRequestL( + const_cast< CCalEntry& >( aCalEntry ) ) ) + { + type = EESMREventTypeMeetingRequest; + } + else + { + type = EESMREventTypeAppt; + } + break; + + case CCalEntry::ETodo: + type = EESMREventTypeETodo; + break; + + case CCalEntry::EEvent: + type = EESMREventTypeEEvent; + break; + + case CCalEntry::EReminder: + type = EESMREventTypeEReminder; + break; + + case CCalEntry::EAnniv: + type = EESMREventTypeEAnniv; + break; + + } + + return type; + } + +// ---------------------------------------------------------------------------- +// ESMREntryHelper::SetInstanceStartAndEndL +// ---------------------------------------------------------------------------- +// +EXPORT_C void ESMREntryHelper::SetInstanceStartAndEndL( + CCalEntry& aChild, + const CCalEntry& aParent, + const TCalTime& aChildStart ) + { + TTime parentStart( aParent.StartTimeL().TimeUtcL() ); + TTime parentEnd( aParent.EndTimeL().TimeUtcL() ); + const TTime KNullTime( Time::NullTTime() ); + + if ( KNullTime == parentStart || + KNullTime == parentEnd || + KNullTime == aChildStart.TimeUtcL() ) + { + // Invalid time --> Leaving + User::Leave( KErrArgument ); + } + + TTimeIntervalMicroSeconds duration( KZeroInterval ); + duration = parentEnd.MicroSecondsFrom( parentStart ); + TCalTime childStart; + TCalTime childEnd; + + // Meeting time mode is Fixed Utc + if( aChild.EntryTypeL() == CCalEntry::EAppt ) + { + const TTime startTime = aChildStart.TimeUtcL(); + childStart.SetTimeUtcL( startTime ); + childEnd.SetTimeUtcL( startTime + duration ); + } + + // Anniversary time mode is local floating + if( aChild.EntryTypeL() == CCalEntry::EAnniv ) + { + const TTime startTime = aChildStart.TimeLocalL(); + childStart.SetTimeLocalFloatingL( startTime ); + childEnd.SetTimeLocalFloatingL( startTime + duration ); + } + + aChild.SetStartAndEndTimeL( childStart, childEnd ); + } + +// ---------------------------------------------------------------------------- +// ESMREntryHelper::CheckRepeatUntilValidityL +// ---------------------------------------------------------------------------- +// +EXPORT_C void ESMREntryHelper::CheckRepeatUntilValidityL( + CCalEntry& aEntry, + const TCalTime& aInstanceTime ) + { + if ( ESMREntryHelper::IsRepeatingMeetingL(aEntry) && + !ESMREntryHelper::IsModifyingEntryL(aEntry) ) + { + TCalRRule originalRRule; + if ( aEntry.GetRRuleL( originalRRule ) ) + { + TCalTime endTime = aEntry.EndTimeL(); + TCalTime startTime = aEntry.StartTimeL(); + + TTimeIntervalMicroSeconds duration = + endTime.TimeLocalL().MicroSecondsFrom( + startTime.TimeLocalL() ); + + TTime instanceEndTime( aInstanceTime.TimeLocalL() ); + instanceEndTime += duration; + TCalTime repeatUntilTime = originalRRule.Until(); + + TDateTime repeat = repeatUntilTime.TimeLocalL().DateTime(); + TDateTime instanceEndDatetime = instanceEndTime.DateTime(); + + if ( repeatUntilTime.TimeLocalL() < instanceEndTime ) + { + // reset the recurrence so, that the repeat until + // time is included in repeat range. This is done, + // because when setting the instance start and end + // time, the CCalEntry implementation clears the + // recurrence information if the end time is + // after repeat until end time. + // CCalEntry forces the repeat until time to be + // same than last entry's start time when storing the + // entry to db. Reason uknown. + TCalRRule rRule = originalRRule; + + TCalTime newUntil; + newUntil.SetTimeLocalL( instanceEndTime ); + rRule.SetUntil( newUntil ); + + aEntry.SetRRuleL( rRule ); + } + } + } + } + // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/src/esmrhelper.cpp --- a/meetingrequest/mrcommon/src/esmrhelper.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrcommon/src/esmrhelper.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,9 +17,9 @@ // INCLUDE FILES -#include "emailtrace.h" #include "esmrhelper.h" #include "esmrentryhelper.h" +#include "esmrconfig.hrh" #include #include #include @@ -29,12 +29,25 @@ #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include // hardcoded paths removal #include // +#include "emailtrace.h" + // CONSTANTS /// Unnamed namespace for local definitions @@ -51,13 +64,39 @@ _LIT (KResourceFormat, "rsc" ); +// Definition for max hours, minutes, seconds in day for Memo +const TInt KMaxHoursForMemo( 23 ); +const TInt KMaxMinutesForMemo( 59 ); +const TInt KMaxSecondsForMemo( 59 ); + +// Definition for max hours, minutes, seconds in day for To-Do +const TInt KMaxHoursForTodo( 23 ); +const TInt KMaxMinutesForTodo( 59 ); +const TInt KMaxSecondsForTodo( 00 ); + +const TInt KDefaultAnniversaryAlarmHours( 12 ); + +const TInt KDefaultTodoAlarmHours( 12 ); + +// Definition for default alarm time for meeting +const TInt KDefaultMeetingAlarmMinutes( 15 ); + +// Constant for default meeeting start hour +const TInt KDefaultMeetingStartHour( 8 ); + +// Constant for default meeeting end hour +const TInt KDefaultMeetingEndHour( 9 ); + + #ifdef _DEBUG enum TPanicCode { EPanicNullMsvId = 1, EIllegalMsvEntryType, - EPanicNoOrganizer + EPanicNoOrganizer, + EInvalidEntryType, + EInvalidSwitchType }; // Panic message definition @@ -70,6 +109,199 @@ #endif // _DEBUG +CCalEntry::TType MapType( TESMRCalendarEventType aEntryType ) + { + CCalEntry::TType type( CCalEntry::EAppt ); + + switch ( aEntryType ) + { + case EESMREventTypeAppt: + case EESMREventTypeMeetingRequest: + { + type = CCalEntry::EAppt; + break; + } + case EESMREventTypeETodo: + { + type = CCalEntry::ETodo; + break; + } + case EESMREventTypeEEvent: + { + type = CCalEntry::EEvent; + break; + } + case EESMREventTypeEReminder: + { + type = CCalEntry::EReminder; + break; + } + case EESMREventTypeEAnniv: + { + type = CCalEntry::EAnniv; + break; + } + default: + { + __ASSERT_DEBUG( EFalse, Panic( EInvalidEntryType ) ); + } + } + + return type; + } + +/** + * Fetches the supported mailboxes. + * @param aMBUtils utils class + * @param aMailBoxes to test + */ +void SupportedMailboxesL( + CMRMailboxUtils& aMBUtils, + RArray& aMailBoxes ) + { + FUNC_LOG; + aMBUtils.ListMailBoxesL( aMailBoxes ); + + RCPointerArray implArray; + CleanupClosePushL( implArray ); + + //Get all MRViewers Implementation + const TUid mrViewersIface = TUid::Uid(KMRViewersInterfaceUID); + REComSession::ListImplementationsL(mrViewersIface, implArray ); + TInt mrviewerCount( implArray.Count() ); + + TInt index(0); + TInt mailboxCount( aMailBoxes.Count() ); + while ( index < mailboxCount ) + { + TBool supported( EFalse ); + + for ( TInt i(0); (i < mrviewerCount) && !supported; ++ i ) + { + TBuf16 mbName; + CnvUtfConverter::ConvertToUnicodeFromUtf8( + mbName, + implArray[i]->DataType() ); + + if( aMailBoxes[index].iMtmUid.Name().CompareF(mbName) == 0) + { + supported = ETrue; + } + } + + if ( supported ) + { + index++; + } + else + { + aMailBoxes.Remove( index ); + mailboxCount = aMailBoxes.Count(); + } + } + CleanupStack::PopAndDestroy( &implArray ); + } + +/** + * Prompts user to select default mailbox. + * @param aMailBoxes Reference to mailbox list + */ +TInt PromptForDefaultMailboxL( + RArray& aMailBoxes ) + { + FUNC_LOG; + TInt selected( KErrCancel ); + + TInt mbCount = aMailBoxes.Count(); + if( mbCount > 0) + { + CAknSinglePopupMenuStyleListBox* list = + new (ELeave) CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL(list); + + CAknPopupList* popupList = CAknPopupList::NewL( + list, + R_AVKON_SOFTKEYS_OK_CANCEL); + CleanupStack::PushL(popupList); + + list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect); + list->CreateScrollBarFrameL(ETrue); + list->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); + + CEikonEnv* eikEnv = CEikonEnv::Static();// codescanner::eikonenvstatic + + CDesCArrayFlat* items = new (ELeave)CDesCArrayFlat(mbCount); + CleanupStack::PushL(items); + for(TInt i=0; iAppendL( aMailBoxes[i].iName ); + } + CleanupStack::Pop(items); + CTextListBoxModel* model = list->Model(); + + //Pass ownersip of items to model + model->SetItemTextArray(items); + + HBufC* title = KNullDesC().AllocLC(); + popupList->SetTitleL(*title); + CleanupStack::PopAndDestroy(title); + + TBool accepted = popupList->ExecuteLD(); + CleanupStack::Pop( popupList ); + + if(accepted) + { + selected = list->CurrentItemIndex(); + } + else + { + selected = KErrCancel; + } + + CleanupStack::PopAndDestroy( list ); + } + else + { + //No mailboxes defined. Could prompt user to define one here. + selected = KErrCancel; + } + + return selected; + } + +/** + * Converts to-do specific priority to normal priority + * @param Calendar entry, which priority is converted + */ +void ConvertTodoPriorityToNormalL( CCalEntry& entry ) + { + FUNC_LOG; + TInt priority( 0 ); + if( entry.PriorityL() == EFSCalenTodoPriorityHigh ) + { + priority = EFSCalenMRPriorityHigh; + } + + else if( entry.PriorityL() == EFSCalenTodoPriorityNormal ) + { + priority = EFSCalenMRPriorityNormal; + } + + else if( entry.PriorityL() == EFSCalenTodoPriorityLow ) + { + priority = EFSCalenMRPriorityLow; + } + + else + { + // Priority unknown, let's set it to normal then + priority = EFSCalenMRPriorityNormal; + } + + entry.SetPriorityL( priority ); + } + } // namespace // ======== MEMBER FUNCTIONS ======== @@ -136,10 +368,11 @@ EXPORT_C CCalEntry* ESMRHelper::CopyEntryL( const CCalEntry& aEntry, CCalEntry::TMethod aMethod, - TCopyFields aCopyType ) + TCopyFields aCopyType, + TESMRCalendarEventType aEntryType ) { FUNC_LOG; - CCalEntry* copy = CopyEntryLC( aEntry, aMethod, aCopyType ); + CCalEntry* copy = CopyEntryLC( aEntry, aMethod, aCopyType, aEntryType ); CleanupStack::Pop( copy ); return copy; } @@ -151,32 +384,54 @@ EXPORT_C CCalEntry* ESMRHelper::CopyEntryLC( const CCalEntry& aEntry, CCalEntry::TMethod aMethod, - TCopyFields aCopyType ) + TCopyFields aCopyType, + TESMRCalendarEventType aEntryType ) { FUNC_LOG; CCalEntry* copy = NULL; - HBufC8* uid = aEntry.UidL().AllocLC(); - if ( ESMREntryHelper::IsModifyingEntryL( aEntry ) ) + + TESMRCalendarEventType type = ESMREntryHelper::EventTypeL( aEntry ); + + if( aEntryType == EESMREventTypeNone || + type == aEntryType ) { - copy = CCalEntry::NewL( aEntry.EntryTypeL(), - uid, - aMethod, - aEntry.SequenceNumberL(), - aEntry.RecurrenceIdL(), - aEntry.RecurrenceRangeL() ); + HBufC8* uid = aEntry.UidL().AllocLC(); + + CCalEntry::TType entryType = aEntry.EntryTypeL(); + + if ( aEntryType != EESMREventTypeNone ) + { + entryType = MapType( aEntryType ); + } + + if ( ESMREntryHelper::IsModifyingEntryL( aEntry ) ) + { + copy = CCalEntry::NewL( entryType, + uid, + aMethod, + aEntry.SequenceNumberL(), + aEntry.RecurrenceIdL(), + aEntry.RecurrenceRangeL() ); + } + else + { + copy = CCalEntry::NewL( entryType, + uid, + aMethod, + aEntry.SequenceNumberL() ); + } + CleanupStack::Pop( uid ); // ownership transferred to the copy entry + CleanupStack::PushL( copy ); + + CopyFieldsL( aEntry, *copy, aCopyType ); + copy->SetLastModifiedDateL(); + } else { - copy = CCalEntry::NewL( aEntry.EntryTypeL(), - uid, - aMethod, - aEntry.SequenceNumberL() ); + copy = CopyEntryAndSwitchTypeL( aEntry, aEntryType ); + CleanupStack::PushL( copy ); } - CleanupStack::Pop( uid ); // ownership transferred to the copy entry - CleanupStack::PushL( copy ); - - CopyFieldsL( aEntry, *copy, aCopyType ); - copy->SetLastModifiedDateL(); return copy; } @@ -234,18 +489,18 @@ { FUNC_LOG; TPtrC addrWithoutPrefix( aAddress ); - TInt pos = KErrNotFound; - - do + TInt pos = KErrNotFound; + + do { - pos = addrWithoutPrefix.MatchF( KMailtoMatchPattern ); - if ( pos != KErrNotFound ) + pos = addrWithoutPrefix.MatchF( KMailtoMatchPattern ); + if ( pos != KErrNotFound ) { - addrWithoutPrefix.Set( addrWithoutPrefix.Mid( KMailtoLength ) ); - } + addrWithoutPrefix.Set( addrWithoutPrefix.Mid( KMailtoLength ) ); + } } - while ( pos != KErrNotFound ); - + while ( pos != KErrNotFound ); + return addrWithoutPrefix; } @@ -450,41 +705,41 @@ aResourceFile.Copy( resourceFile.File() ); } else - { - const TChar KFileFormatDelim( '.' ); - TFileName locResourceFile; + { + const TChar KFileFormatDelim( '.' ); + TFileName locResourceFile; - TInt pos = aResource.LocateReverse( KFileFormatDelim ); - if ( pos != KErrNotFound ) - { - locResourceFile.Copy( aResource.Mid(0, pos + 1) ); + TInt pos = aResource.LocateReverse( KFileFormatDelim ); + if ( pos != KErrNotFound ) + { + locResourceFile.Copy( aResource.Mid(0, pos + 1) ); - TInt language( User::Language() ); - if (language < KMinTwoDigitLanguageCode ) - { - locResourceFile.AppendFormat( KResourceFileLocFormat1, language ); - } - else - { - locResourceFile.AppendFormat( KResourceFileLocFormat2, language ); - } + TInt language( User::Language() ); + if (language < KMinTwoDigitLanguageCode ) + { + locResourceFile.AppendFormat( KResourceFileLocFormat1, language ); + } + else + { + locResourceFile.AppendFormat( KResourceFileLocFormat2, language ); + } - TFindFile resourceFile( *fsSession ); - err = resourceFile.FindByDir( - locResourceFile, - aPath ); + TFindFile resourceFile( *fsSession ); + err = resourceFile.FindByDir( + locResourceFile, + aPath ); - if ( KErrNone == err ) - { - TFileName tempName; - tempName.Copy( resourceFile.File() ); - TInt dotpos= tempName.LocateReverse(KFileFormatDelim); - aResourceFile.Copy(tempName.Mid(0,dotpos+1) ); - aResourceFile.Append(KResourceFormat); - } - } - } + if ( KErrNone == err ) + { + TFileName tempName; + tempName.Copy( resourceFile.File() ); + TInt dotpos= tempName.LocateReverse(KFileFormatDelim); + aResourceFile.Copy(tempName.Mid(0,dotpos+1) ); + aResourceFile.Append(KResourceFormat); + } + } + } if ( KErrNone != err ) @@ -498,29 +753,961 @@ // ESMRHelper::CreateAndAppendPrivateDirToFileName // ---------------------------------------------------------------------------- // -EXPORT_C TInt ESMRHelper::CreateAndAppendPrivateDirToFileName(TFileName& aFileName) +EXPORT_C TInt ESMRHelper::CreateAndAppendPrivateDirToFileName( + TFileName& aFileName) { - TFileName KPath; + FUNC_LOG; + + TFileName path; RFs fsSession; TInt result = fsSession.Connect(); - if(result==KErrNone) + if ( KErrNone == result ) { - fsSession.PrivatePath(KPath); + TBool createPrivatePath( ETrue ); + + fsSession.PrivatePath(path); + TFindFile findFile(fsSession); - - result = findFile.FindByDir(KPath, KNullDesC); - if (result != KErrNone) //create path if doesn't exists + result = findFile.FindByDir(path, KNullDesC); + if (KErrNone == result ) { - fsSession.CreatePrivatePath(TDriveUnit(PathInfo::PhoneMemoryRootPath())); - result = findFile.FindByDir(KPath, KNullDesC); + // Check that we are able to drive into private path location + createPrivatePath = EFalse; + + path = findFile.File(); + TInt drive = TDriveUnit( path ); + TInt KRomDrive = TDriveUnit( PathInfo::RomRootPath() ); + + if ( drive == KRomDrive ) + { + // Private path locates in ROM + createPrivatePath = ETrue; + } } - KPath = findFile.File(); - aFileName.Insert(0,KPath); + + TPtrC phoneMemoryPath( PathInfo::PhoneMemoryRootPath() ); + + if ( createPrivatePath ) + { + //create path if doesn't exists + TInt drive = TDriveUnit(phoneMemoryPath); + fsSession.CreatePrivatePath( drive ); + } + + result = findFile.FindByDir(path, KNullDesC); + path = findFile.File(); + path[0] = phoneMemoryPath[0]; + aFileName.Insert(0,path); + fsSession.MkDirAll(aFileName); - fsSession.Close(); + result = KErrNone; } + + // fsSession + fsSession.Close(); return result; } //
+// ---------------------------------------------------------------------------- +// ESMRHelper::CreateAndAppendOthersDirToFileName +// ---------------------------------------------------------------------------- +// +EXPORT_C TInt ESMRHelper::CreateAndAppendOthersDirToFileName( + TFileName& aFileName) + { + FUNC_LOG; + + TFileName path; + RFs fsSession; + TInt result = fsSession.Connect(); + if ( KErrNone == result ) + { + aFileName.Insert(0, PathInfo::OthersPath() ); + aFileName.Insert(0, PathInfo::PhoneMemoryRootPath() ); + + fsSession.MkDirAll(aFileName); + + result = KErrNone; + } + + // fsSession + fsSession.Close(); + return result; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::CopyEntryAndSwitchTypeL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::CopyEntryAndSwitchTypeL( + const CCalEntry& aSourceEntry, + TESMRCalendarEventType aTargetType ) + { + FUNC_LOG; + CCalEntry* entry = NULL; + + TESMRSwitchEventType switchType; + + switchType = ResolveSwitchType( + ESMREntryHelper::EventTypeL( aSourceEntry ), aTargetType ); + + switch ( switchType ) + { + case EMRSwitchMRToMeeting: + { + entry = SwitchToMeetingL( aSourceEntry ); + break; + } + case EMRSwitchMRToMemo: + { + entry = SwitchToMemoL( aSourceEntry ); + break; + } + case EMRSwitchMRToAnniversary: + { + entry = SwitchToAnniversaryL( aSourceEntry ); + break; + } + case EMRSwitchMRToTodo: + { + entry = SwitchToTodoL( aSourceEntry ); + break; + } + case EMRSwitchMeetingToMR: + { + entry = SwitchToMRL( aSourceEntry ); + break; + } + case EMRSwitchMeetingToMemo: + { + entry = SwitchToMemoL( aSourceEntry ); + break; + } + case EMRSwitchMeetingToAnniversary: + { + entry = SwitchToAnniversaryL( aSourceEntry ); + break; + } + case EMRSwitchMeetingToTodo: + { + entry = SwitchToTodoL( aSourceEntry ); + break; + } + case EMRSwitchMemoToMR: + { + entry = SwitchToMRL( aSourceEntry ); + break; + } + case EMRSwitchMemoToMeeting: + { + entry = SwitchToMeetingL( aSourceEntry ); + break; + } + case EMRSwitchMemoToAnniversary: + { + entry = SwitchToAnniversaryL( aSourceEntry ); + break; + } + case EMRSwitchMemoToTodo: + { + entry = SwitchToTodoL( aSourceEntry ); + break; + } + case EMRSwitchAnniversaryToMR: + { + entry = SwitchToMRL( aSourceEntry ); + break; + } + case EMRSwitchAnniversaryToMeeting: + { + entry = SwitchToMeetingL( aSourceEntry ); + break; + } + case EMRSwitchAnniversaryToMemo: + { + entry = SwitchToMemoL( aSourceEntry ); + break; + } + case EMRSwitchAnniversaryToTodo: + { + entry = SwitchToTodoL( aSourceEntry ); + break; + } + case EMRSwitchTodoToMR: + { + entry = SwitchToMRL( aSourceEntry ); + break; + } + case EMRSwitchTodoToMeeting: + { + entry = SwitchToMeetingL( aSourceEntry ); + break; + } + case EMRSwitchTodoToMemo: + { + entry = SwitchToMemoL( aSourceEntry ); + break; + } + case EMRSwitchTodoToAnniversary: + { + entry = SwitchToAnniversaryL( aSourceEntry ); + break; + } + + default: + { + __ASSERT_DEBUG( EFalse, Panic( EInvalidEntryType ) ); + } + } + + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::ResolveSwitchType +// ---------------------------------------------------------------------------- +// +ESMRHelper::TESMRSwitchEventType ESMRHelper::ResolveSwitchType( + TESMRCalendarEventType aSourceType, + TESMRCalendarEventType aTargetType ) + { + FUNC_LOG; + + TESMRSwitchEventType type( EMRSwitchUnknown ); + + if( aSourceType == EESMREventTypeMeetingRequest ) // Meeting request + { + if( aTargetType == EESMREventTypeAppt ) + { + type = EMRSwitchMRToMeeting; + } + + if( aTargetType == EESMREventTypeEEvent ) + { + type = EMRSwitchMRToMemo; + } + + if( aTargetType == EESMREventTypeEAnniv ) + { + type = EMRSwitchMRToAnniversary; + } + + if( aTargetType == EESMREventTypeETodo ) + { + type = EMRSwitchMRToTodo; + } + } + + if( aSourceType == EESMREventTypeAppt ) // Meeting + { + if( aTargetType == EESMREventTypeMeetingRequest ) + { + type = EMRSwitchMeetingToMR; + } + + if( aTargetType == EESMREventTypeEEvent ) + { + type = EMRSwitchMeetingToMemo; + } + + if( aTargetType == EESMREventTypeEAnniv ) + { + type = EMRSwitchMeetingToAnniversary; + } + + if( aTargetType == EESMREventTypeETodo ) + { + type = EMRSwitchMeetingToTodo; + } + } + + if( aSourceType == EESMREventTypeEEvent ) // Memo + { + if( aTargetType == EESMREventTypeMeetingRequest ) + { + type = EMRSwitchMemoToMR; + } + + if( aTargetType == EESMREventTypeAppt ) + { + type = EMRSwitchMemoToMeeting; + } + + if( aTargetType == EESMREventTypeEAnniv ) + { + type = EMRSwitchMemoToAnniversary; + } + + if( aTargetType == EESMREventTypeETodo ) + { + type = EMRSwitchMemoToTodo; + } + } + + if( aSourceType == EESMREventTypeEAnniv ) // Anniversary + { + if( aTargetType == EESMREventTypeMeetingRequest ) + { + type = EMRSwitchAnniversaryToMR; + } + + if( aTargetType == EESMREventTypeAppt ) + { + type = EMRSwitchAnniversaryToMeeting; + } + + if( aTargetType == EESMREventTypeEEvent ) + { + type = EMRSwitchAnniversaryToMemo; + } + + if( aTargetType == EESMREventTypeETodo ) + { + type = EMRSwitchAnniversaryToTodo; + } + } + + if( aSourceType == EESMREventTypeETodo ) // To-do + { + if( aTargetType == EESMREventTypeMeetingRequest ) + { + type = EMRSwitchTodoToMR; + } + + if( aTargetType == EESMREventTypeAppt ) + { + type = EMRSwitchTodoToMeeting; + } + + if( aTargetType == EESMREventTypeEEvent ) + { + type = EMRSwitchTodoToMemo; + } + + if( aTargetType == EESMREventTypeEAnniv ) + { + type = EMRSwitchTodoToAnniversary; + } + } + + __ASSERT_DEBUG( type != EMRSwitchUnknown, Panic( EInvalidSwitchType ) ); + + return type; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SwitchToMemoL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::SwitchToMemoL( + const CCalEntry& aSourceEntry ) + { + FUNC_LOG; + CCalEntry* entry = CreateEntryL( + CCalEntry::EEvent, + aSourceEntry.UidL(), + CCalEntry::EMethodNone, + CalCommon::EThisOnly ); + + CleanupStack::PushL( entry ); + + // Copy all data from existing entry to new entry + entry->CopyFromL( aSourceEntry ); + // We must re-set the method to the original value + entry->SetMethodL( CCalEntry::EMethodNone ); + +#ifdef RD_USE_PS2_APIS + // If source entry is a meeting request... + if( CCalenInterimUtils2::IsMeetingRequestL( *entry ) ) + { + // ... we need to clear all MR specific data + entry->ClearMRSpecificDataL(); + } +#endif // RD_USE_PS2_APIS + + // Memo is never a repeating event + entry->ClearRepeatingPropertiesL(); + + // Memo has start and stop date without time value. + // Let's change the entry's start and stop times to memo specific + // Setting start date and stop date + TDateTime start = entry->StartTimeL().TimeLocalL().DateTime(); + start.SetHour( 0 ); + start.SetMinute( 0 ); + start.SetSecond( 0 ); + + TTime tempEnd = entry->EndTimeL().TimeLocalL(); + + if( ESMREntryHelper::IsAllDayEventL( aSourceEntry ) ) + { + // If source is all day event, we need to reduce one from the day, + // otherwise the new memo would be spanned over one day too long + tempEnd -= TTimeIntervalDays( 1 ); + } + + TDateTime end = tempEnd.DateTime(); + end.SetHour( KMaxHoursForMemo ); + end.SetMinute( KMaxMinutesForMemo ); + end.SetSecond( KMaxSecondsForMemo ); + + TCalTime startDate; + startDate.SetTimeLocalFloatingL( start ); + TCalTime stopDate; + stopDate.SetTimeLocalFloatingL( end ); + entry->SetStartAndEndTimeL( startDate, stopDate ); + + // Memo does not have any alarm value + entry->SetAlarmL( NULL ); + + // If source entry is to-do, we need to convert the + // priority from to-do priority to normal priority + if( aSourceEntry.EntryTypeL() == CCalEntry::ETodo ) + { + ConvertTodoPriorityToNormalL( *entry ); + } + + CleanupStack::Pop( entry ); // ownership transferred to caller + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SwitchToAnniversaryL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::SwitchToAnniversaryL( + const CCalEntry& aSourceEntry ) + { + FUNC_LOG; + // Create an entry + CCalEntry* entry = CreateEntryL( + CCalEntry::EAnniv, + aSourceEntry.UidL(), + CCalEntry::EMethodNone, + CalCommon::EThisOnly ); + + CleanupStack::PushL( entry ); + + // Copy all data from existing entry to new entry + entry->CopyFromL( aSourceEntry ); + // We must re-set the method to the original value + entry->SetMethodL( CCalEntry::EMethodNone ); + +#ifdef RD_USE_PS2_APIS + // If source entry is a meeting request... + if( CCalenInterimUtils2::IsMeetingRequestL( *entry ) ) + { + // ... we need to clear all MR specific data + entry->ClearMRSpecificDataL(); + } +#endif // RD_USE_PS2_APIS + + // Anniversary repeats once a year, so + // we clear existing repeating rules... + entry->ClearRepeatingPropertiesL(); + + // ... and create a new rule, to repeat once a year + TCalRRule rrule( TCalRRule::EYearly ); + rrule.SetDtStart( entry->StartTimeL() ); + rrule.SetInterval( 1 ); + rrule.SetCount( 0 ); + entry->SetRRuleL( rrule ); + + // Anniversary default alarm is previous day at noon. + // Let's set that also. + TTime eventTime = entry->StartTimeL().TimeLocalL(); + TTime alarmTime = eventTime - TTimeIntervalDays( 1 ); + TDateTime alarmDateTime = alarmTime.DateTime(); + alarmDateTime.SetHour( KDefaultAnniversaryAlarmHours ); + alarmDateTime.SetMinute( 0 ); + alarmDateTime.SetSecond( 0 ); + alarmDateTime.SetMicroSecond( 0 ); + alarmTime = alarmDateTime; + + // Calculating alarm offset + TTimeIntervalMinutes alarmOffset( 0 ); + eventTime.MinutesFrom( alarmTime, alarmOffset ); + + // Creating alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + alarm->SetTimeOffset( alarmOffset ); + + // Setting alarm + entry->SetAlarmL( alarm ); + CleanupStack::PopAndDestroy( alarm ); + alarm = NULL; + + // If source entry is to-do, we need to convert the + // priority from to-do priority to normal priority + if( aSourceEntry.EntryTypeL() == CCalEntry::ETodo ) + { + ConvertTodoPriorityToNormalL( *entry ); + } + + CleanupStack::Pop( entry ); // ownership transferred to caller + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SwitchToTodoL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::SwitchToTodoL( + const CCalEntry& aSourceEntry ) + { + FUNC_LOG; + CCalEntry* entry = CreateEntryL( + CCalEntry::ETodo, + aSourceEntry.UidL(), + CCalEntry::EMethodNone, + CalCommon::EThisOnly ); + + CleanupStack::PushL( entry ); + + // Copy all data from existing entry to new entry + entry->CopyFromL( aSourceEntry ); + // We must re-set the method to the original value + entry->SetMethodL( CCalEntry::EMethodNone ); + +#ifdef RD_USE_PS2_APIS + // If source entry is a meeting request... + if( CCalenInterimUtils2::IsMeetingRequestL( *entry ) ) + { + // ... we need to clear all MR specific data + entry->ClearMRSpecificDataL(); + } +#endif // RD_USE_PS2_APIS + + // To-do is never a repeating event + entry->ClearRepeatingPropertiesL(); + + // To-do has a due date only. Let's change the entry's start and stop + // times to To-do specific ones + TTime tempEnd = entry->EndTimeL().TimeLocalL(); + + if( ESMREntryHelper::IsAllDayEventL( aSourceEntry ) ) + { + // If source is all day event, we need to reduce one from the day, + // otherwise the new todos due date would be one day late + tempEnd -= TTimeIntervalDays( 1 ); + } + + TDateTime tempDue = tempEnd.DateTime(); + + tempDue.SetHour( KMaxHoursForTodo ); + tempDue.SetMinute( KMaxMinutesForTodo ); + tempDue.SetSecond( KMaxSecondsForTodo ); + + TCalTime dueDate; + dueDate.SetTimeLocalFloatingL( tempDue ); + + entry->SetStartAndEndTimeL( dueDate, dueDate ); + + // Setting to-do specific alarm + if( entry->AlarmL() ) + { + // Setting default To-do alarm for entry + TTime eventTime = entry->EndTimeL().TimeLocalL(); + + // Calculate alarm time (due date at 12:00am) + TTime alarmTime = eventTime; + TDateTime alarmDateTime = alarmTime.DateTime(); + alarmDateTime.SetHour( KDefaultTodoAlarmHours ); + alarmDateTime.SetMinute( 0 ); + alarmDateTime.SetSecond( 0 ); + alarmDateTime.SetMicroSecond( 0 ); + alarmTime = alarmDateTime; + + TTime currentTime; + currentTime.HomeTime(); + + // If alarm is in the future + if ( alarmTime > currentTime ) + { + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + TTimeIntervalMinutes alarmOffset( 0 ); + eventTime.MinutesFrom( alarmTime, alarmOffset ); + alarm->SetTimeOffset( alarmOffset ); + entry->SetAlarmL( alarm ); + CleanupStack::PopAndDestroy( alarm ); + } + // Alarm is in the past, let's set it to NULL + else + { + entry->SetAlarmL( NULL ); + } + } + + // Setting to-do specific priority + TInt priority( 0 ); + if( entry->PriorityL() == EFSCalenMRPriorityHigh ) + { + priority = EFSCalenTodoPriorityHigh; + } + + else if( entry->PriorityL() == EFSCalenMRPriorityNormal ) + { + priority = EFSCalenTodoPriorityNormal; + } + + else if( entry->PriorityL() == EFSCalenMRPriorityLow ) + { + priority = EFSCalenTodoPriorityLow; + } + + else + { + // Priority unknown, let's set it to normal then + priority = EFSCalenTodoPriorityNormal; + } + + entry->SetPriorityL( priority ); + + CleanupStack::Pop( entry ); // ownership transferred to caller + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SwitchToMeetingL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::SwitchToMeetingL( + const CCalEntry& aSourceEntry ) + { + FUNC_LOG; + + CCalEntry* entry = CreateEntryL( + CCalEntry::EAppt, + aSourceEntry.UidL(), + CCalEntry::EMethodNone, + CalCommon::EThisOnly ); + + CleanupStack::PushL( entry ); + + // Copy all data from existing entry to new entry + entry->CopyFromL( aSourceEntry ); + + // If source was to-do, priority needs converting + if( aSourceEntry.EntryTypeL() == CCalEntry::ETodo ) + { + ConvertTodoPriorityToNormalL( *entry ); + } + + // We must re-set the method to the original value + entry->SetMethodL( CCalEntry::EMethodNone ); + +#ifdef RD_USE_PS2_APIS + // If source entry is a meeting request... + if( CCalenInterimUtils2::IsMeetingRequestL( *entry ) ) + { + // ... we need to clear all MR specific data, + // but otherwise the enrty is now converted + // correctly from MR to meeting + entry->ClearMRSpecificDataL(); + } + else +#endif // RD_USE_PS2_APIS + { + // Repeating rules from memo, to-do and anniversary + // are not compatible with a meeting + entry->ClearRepeatingPropertiesL(); + + // Setting meeting time, since memo, to-do and anniversary + // start / end times are not compatible with meeting's corresponding + // values + SetMeetingTimeL( *entry, aSourceEntry ); + + // If source is not an appointment, we'll set default + // alarm for meeting, since memo, to-do and anniversary + // alarms are not compatible with meeting alarm + if( entry->AlarmL() && + aSourceEntry.EntryTypeL() != CCalEntry::EAppt ) + { + SetDefaultAlarmForMeetingL( *entry ); + } + + // If source entry is to-do, we need to convert the + // priority from to-do priority to normal priority + if( aSourceEntry.EntryTypeL() == CCalEntry::ETodo ) + { + ConvertTodoPriorityToNormalL( *entry ); + } + } + + CleanupStack::Pop( entry ); // ownership transferred to caller + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SwitchToMRL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::SwitchToMRL( + const CCalEntry& aSourceEntry ) + { + FUNC_LOG; + CCalEntry* entry = CreateEntryL( + CCalEntry::EAppt, + aSourceEntry.UidL(), + CCalEntry::EMethodRequest, + CalCommon::EThisOnly ); + + CleanupStack::PushL( entry ); + + // Copy all data from existing entry to new entry + entry->CopyFromL( aSourceEntry ); + + // If source was to-do, priority needs converting + if( aSourceEntry.EntryTypeL() == CCalEntry::ETodo ) + { + ConvertTodoPriorityToNormalL( *entry ); + } + + // We must re-set the method to the original value + entry->SetMethodL( CCalEntry::EMethodRequest ); + + // If source is a meeting... + if( aSourceEntry.EntryTypeL() != CCalEntry::EAppt ) + { + // Repeating rules from memo, to-do and anniversary + // are not compatible with MR + entry->ClearRepeatingPropertiesL(); + + // Setting meeting time, since memo, to-do and anniversary + // start / end times are not compatible with MR's corresponding + // values + SetMeetingTimeL( *entry, aSourceEntry ); + + // If source is not an appointment, we'll set default + // alarm for MR, since memo, to-do and anniversary + // alarms are not compatible with MR alarm + if( entry->AlarmL() && + aSourceEntry.EntryTypeL() != CCalEntry::EAppt ) + { + SetDefaultAlarmForMeetingL( *entry ); + } + + // If source entry is to-do, we need to convert the + // priority from to-do priority to normal priority + if( aSourceEntry.EntryTypeL() == CCalEntry::ETodo ) + { + ConvertTodoPriorityToNormalL( *entry ); + } + } + + // Add organizer + AddOrganizerL( *entry ); + + // Set organizer as phone owner + entry->SetPhoneOwnerL( entry->OrganizerL() ); + + CleanupStack::Pop( entry ); // ownership transferred to caller + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::CreateEntryL +// ---------------------------------------------------------------------------- +// +CCalEntry* ESMRHelper::CreateEntryL( + CCalEntry::TType aType, + const TDesC8& aUid, + CCalEntry::TMethod aMethod, + CalCommon::TRecurrenceRange aRange ) + { + FUNC_LOG; + + HBufC8* guid = aUid.AllocLC(); + CCalEntry* entry = CCalEntry::NewL( aType, guid, aMethod, aRange ); + CleanupStack::Pop( guid ); + + return entry; + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SetMeetingTimeL +// ---------------------------------------------------------------------------- +// +void ESMRHelper::SetMeetingTimeL( + CCalEntry& aTargetEntry, + const CCalEntry& aSourceEntry ) + { + FUNC_LOG; + TCalTime start; + TCalTime end; + + TDateTime tempStart; + TDateTime tempEnd; + + CCalEntry::TType type = aSourceEntry.EntryTypeL(); + + switch ( type ) + { + case CCalEntry::EAppt: + { + start.SetTimeLocalL( aSourceEntry.StartTimeL().TimeLocalL() ); + end.SetTimeLocalL( aSourceEntry.EndTimeL().TimeLocalL() ); + break; + } + case CCalEntry::ETodo: + { + // Todo has only due date => Adding date from that, + // Hour, minute and second as default values + tempStart = aSourceEntry.StartTimeL().TimeLocalL().DateTime(); + tempStart.SetHour( KDefaultMeetingStartHour ); + tempStart.SetMinute( 0 ); + tempStart.SetSecond( 0 ); + + tempEnd = aSourceEntry.StartTimeL().TimeLocalL().DateTime(); + tempEnd.SetHour( KDefaultMeetingEndHour ); + tempEnd.SetMinute( 0 ); + tempEnd.SetSecond( 0 ); + + start.SetTimeLocalL( tempStart ); + end.SetTimeLocalL( tempEnd ); + break; + } + case CCalEntry::EEvent: //Memo + { + // Memo is one day event with start time as 00:00 and end as 23:59 + // Let's add start date from that, and set hour, minute and second + // as default values + tempStart = aSourceEntry.StartTimeL().TimeLocalL().DateTime(); + tempStart.SetHour( KDefaultMeetingStartHour ); + tempStart.SetMinute( 0 ); + tempStart.SetSecond( 0 ); + + tempEnd = aSourceEntry.StartTimeL().TimeLocalL().DateTime(); + tempEnd.SetHour( KDefaultMeetingEndHour ); + tempEnd.SetMinute( 0 ); + tempEnd.SetSecond( 0 ); + + start.SetTimeLocalL( tempStart ); + end.SetTimeLocalL( tempEnd ); + + break; + } + case CCalEntry::EAnniv: + { + // Anniversary has start date, which is taken as date of the meeting. + // Hour, minute and second are set as teh default values. + tempStart = aSourceEntry.StartTimeL().TimeLocalL().DateTime(); + tempStart.SetHour( KDefaultMeetingStartHour ); + tempStart.SetMinute( 0 ); + tempStart.SetSecond( 0 ); + + tempEnd = aSourceEntry.StartTimeL().TimeLocalL().DateTime(); + tempEnd.SetHour( KDefaultMeetingEndHour ); + tempEnd.SetMinute( 0 ); + tempEnd.SetSecond( 0 ); + + start.SetTimeLocalL( tempStart ); + end.SetTimeLocalL( tempEnd ); + break; + } + + default: + { + __ASSERT_DEBUG( EFalse, Panic( EInvalidEntryType ) ); + } + } + + aTargetEntry.SetStartAndEndTimeL( start, end ); + } + +// ---------------------------------------------------------------------------- +// ESMRHelper::SetDefaultAlarmForMetingL +// ---------------------------------------------------------------------------- +// +void ESMRHelper::SetDefaultAlarmForMeetingL( + CCalEntry& aTargetEntry ) + { + FUNC_LOG; + + // Get default alarm time from central repository + TInt defaultAlarmTime; + CRepository* repository = CRepository::NewLC( KCRUidCalendar ); + TInt err = repository->Get( KCalendarDefaultAlarmTime, defaultAlarmTime ); + CleanupStack::PopAndDestroy( repository ); + + if ( err != KErrNone ) + { + defaultAlarmTime = KDefaultMeetingAlarmMinutes; + } + + // Getting current time + TTime currentTime; + currentTime.HomeTime(); + + // Getting meeting start time + TTime start = aTargetEntry.StartTimeL().TimeLocalL(); + + // Create default alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + + TTimeIntervalMinutes alarmOffset( defaultAlarmTime ); + + // If alarm time is in past + if ( ( start - alarmOffset ) < currentTime ) + { + // Setting alarm off + aTargetEntry.SetAlarmL( NULL ); + } + else + { + // Set default alarm time + alarm->SetTimeOffset( alarmOffset ); + aTargetEntry.SetAlarmL( alarm ); + } + CleanupStack::PopAndDestroy( alarm ); + + } + +// --------------------------------------------------------------------------- +// ESMRHelper::AddOrganizerL +// --------------------------------------------------------------------------- +// +void ESMRHelper::AddOrganizerL( CCalEntry& aTargetEntry ) + { + FUNC_LOG; + CMRMailboxUtils* mbUtils = CMRMailboxUtils::NewL( NULL ); + CleanupStack::PushL( mbUtils ); + + CMRMailboxUtils::TMailboxInfo defaultMailBox; + TInt err = mbUtils->GetDefaultMRMailBoxL( defaultMailBox ); + + if ( KErrNone != err ) + { + RArray mailBoxes; + CleanupClosePushL( mailBoxes ); + + SupportedMailboxesL( *mbUtils, mailBoxes ); + + TInt selectedMailbox( PromptForDefaultMailboxL(mailBoxes) ); + + if ( KErrCancel != selectedMailbox ) + { + mbUtils->SetDefaultMRMailBoxL( + mailBoxes[selectedMailbox].iEntryId ); // codescanner::accessArrayElementWithoutCheck2 + mbUtils->GetDefaultMRMailBoxL(defaultMailBox); + } + CleanupStack::PopAndDestroy( &mailBoxes ); + + // This will leave if user cancelled the mailbox selection + User::LeaveIfError( selectedMailbox ); + } + + //Set the organizer from the selected mailbox + CCalUser* organizer = CCalUser::NewL( defaultMailBox.iEmailAddress ); + CleanupStack::PushL( organizer ); + aTargetEntry.SetOrganizerL( organizer ); + CleanupStack::Pop( organizer ); // Ownership trasferred + + CleanupStack::PopAndDestroy( mbUtils ); + } + // EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrcommon/src/nmrglobalfeaturesettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrcommon/src/nmrglobalfeaturesettings.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Color manager for MRGUI usage. +* +*/ + +#include "nmrglobalfeaturesettings.h" + +#include +#include + +using namespace NMRGlobalFeatureSettings; + +// --------------------------------------------------------------------------- +// NMRGlobalFeatureSettings::KeyboardType +// --------------------------------------------------------------------------- +// +EXPORT_C TKeyboardLayout NMRGlobalFeatureSettings::KeyboardType() + { + CRepository* settings = NULL; + TRAPD( err, settings = CRepository::NewL( KCRUidAvkon ) ); + TInt keyboardLayout( EUninitialized ); + + if ( err == KErrNone ) + { + settings->Get( KAknKeyBoardLayout, keyboardLayout ); + delete settings; + } + + return static_cast + ( keyboardLayout ); + } +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrdb/group/esmrdb.mmp --- a/meetingrequest/mrdb/group/esmrdb.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrdb/group/esmrdb.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,9 +29,6 @@ VENDORID VID_DEFAULT DEFFILE ESMRDb.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrcaldbbase.cpp SOURCE cesmrcaldbmgr.cpp @@ -52,11 +48,13 @@ LIBRARY euser.lib LIBRARY calinterimapi.lib LIBRARY caleninterimutils2.lib -LIBRARY cmaillogger.lib - +LIBRARY sysutil.lib +LIBRARY commonui.lib +LIBRARY cone.lib +LIBRARY centralrepository.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrdb/inc/cesmrcaldbmgr.h --- a/meetingrequest/mrdb/inc/cesmrcaldbmgr.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrdb/inc/cesmrcaldbmgr.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,17 +20,24 @@ #define CESMRCALDBMGR_H #include +#include // #include "mesmrutilstombsext.h" // #include #include "cesmrcaldbbase.h" + class MMRUtilsObserver; class CCalSession; class CCalEntry; class CESMREntryCmdIteratorAO; class CESMRGraveyardCleaner; +class MESMRCalEntry; +class CCalEntryView; +class CCalInstanceView; +class CCalCalendarInfo; + /** * MESMRServicesCalDbMgr defines interface for calendar DB @@ -62,6 +69,14 @@ * @return instance view pointer, ownership not transferred */ virtual CCalInstanceView* NormalDbInstanceView() = 0; + + /** + * Accessor for Agenda Model CCalInstanceView owned by this utility. + * Returns a valid array of pointer if status is EAvailable or + * EAvailableWithoutTombs, otherwise NULL. + * @return instance view pointer, ownership not transferred + */ + virtual RPointerArray NormalDbAllCalenInstanceView() = 0; /** * Fetches entries from the Agenda Model based on time range. @@ -116,7 +131,7 @@ * @return KErrNone or a system wide error code */ virtual TInt DeleteEntryL( - const TDesC8& aUid ) = 0; + const TDesC8& aUid, TInt aCalenIndex ) = 0; /** * Deletes the given entry from the Agenda Model. @@ -124,7 +139,7 @@ * @return KErrNone or a system wide error code */ virtual TInt DeleteEntryL( - const TCalLocalUid& aLocalUid ) = 0; + const TCalLocalUid& aLocalUid, TInt aCalenIndex ) = 0; /** * Check entry: GUID, sequence number, existence in Agenda Model and @@ -182,6 +197,107 @@ * @return Reference to calendar server session. */ virtual CCalSession& CalSession() = 0; + + /** + * Finds matching calendar instance from calendar db. Ownership is + * transferred to caller. + * If instance cannot be found, NULL is returned. + * + * @param aCalDb Reference to cal db manager. + * @param aEntry Reference to calendar entry + * @return Pointer to calendar entry instance. + */ + virtual CCalInstance* FindInstanceL( + const CCalEntry& aEntry ) = 0; + + /** + * Get calendar's color by entry + * @param aEntry Reference to calendar entry + * @return calendar's color rgb value + */ + virtual TRgb GetCalendarColorByEntryL( MESMRCalEntry& aEntry ) = 0; + + /** + * Get multi-calendar name list + * @param aCalendarNameList Reference to name string array + */ + virtual void GetMultiCalendarNameListL( RArray& aCalendarNameList ) = 0; + + /** + * Get calendar's name by entry + * @param aEntry Reference to calendar entry + * @return calendar's name + */ + virtual TPtrC GetCalendarNameByEntryL( MESMRCalEntry& aEntry ) = 0; + + /** + * Get calendar's color by calendar name + * @param aCalendarName Reference to calendar name + * @return calendar's color rgb value + */ + virtual TRgb GetCalendarColorByNameL( TDesC& aCalendarName ) = 0; + + /* + * Set current calendar by pass calendar index to it + * @param aIndex current calendar index + */ + virtual void SetCurCalendarByIndex( TInt aIndex ) = 0; + + /* + * Set current calendar by pass calendar name to it + * @param aCalendarName current calendar name + */ + virtual void SetCurCalendarByNameL( TDesC& aCalendarName ) = 0; + + /* + * Set current calendar by pass entry + * @param aColId current calendar collectionID + */ + virtual void SetCurCalendarByColIdL( TInt aColId ) = 0; + + /* + * Set current calendar by pass entry + * @param aEntry entry which belongs current calendar + */ + virtual void SetCurCalendarByEntryL( MESMRCalEntry& aEntry ) = 0; + + /* + * Get color of current calendar + * @return current calendar's color(rgb value) + */ + virtual TRgb GetCurCalendarColor() = 0; + + /* + * Get colId of current calendar + * @return current calendar's colId + */ + virtual TInt GetCurCalendarColIdL() = 0; + + /* + * Get index of current calendar + * @return current calendar's index + */ + virtual TInt GetCurCalendarIndex() = 0; + + /* + * Get entryview by CCalEntry + * @param aCalEntry use to get calendar which aCalEntry belongs + * @return CCalEntryView aCalEntry belongs + */ + virtual CCalEntryView* EntryViewL(const CCalEntry& aCalEntry ) = 0; + + /* + * Get instanceview by CCalEntry + * @param aCalEntry use to get calendar which aCalEntry belongs + * @return a CCalInstanceView that aCalEntry belongs + */ + virtual CCalInstanceView* InstanceViewL(const CCalEntry& aCalEntry ) = 0; + + /* + * Get current entryview + * @return current entryView + */ + virtual CCalEntryView* EntryView() = 0; }; /** @@ -230,6 +346,7 @@ CCalEntryView* NormalDbEntryView(); CCalInstanceView* NormalDbInstanceView(); + RPointerArray NormalDbAllCalenInstanceView(); void FetchEntriesL( RPointerArray& aCalEntryArray, const CalCommon::TCalTimeRange& aTimeRange ); @@ -242,9 +359,9 @@ TInt UpdateEntryL( const CCalEntry& aCalEntry ); TInt DeleteEntryL( - const TDesC8& aUid ); + const TDesC8& aUid, TInt aCalenIndex ); TInt DeleteEntryL( - const TCalLocalUid& aLocalUid ); + const TCalLocalUid& aLocalUid, TInt aCalenIndex ); MESMRUtilsTombsExt::TESMRUtilsDbResult StoreEntryCondL( CCalEntry& aCalEntry, TBool aResurrect, @@ -260,6 +377,31 @@ void DeleteEntryCondL( const CalCommon::TCalTimeRange& aCalTimeRange ); CCalSession& CalSession(); + CCalInstance* FindInstanceL( + const CCalEntry& aEntry ); + + TRgb GetCalendarColorByEntryL( + MESMRCalEntry& aEntry); + void GetMultiCalendarNameListL( + RArray& aCalendarNameList); + TPtrC GetCalendarNameByEntryL( + MESMRCalEntry& aEntry); + TRgb GetCalendarColorByNameL( + TDesC& aCalendarName); + void SetCurCalendarByNameL( + TDesC& aCalendarName ); + void SetCurCalendarByIndex( + TInt aIndex ); + void SetCurCalendarByColIdL( + TInt aColId ); + void SetCurCalendarByEntryL( + MESMRCalEntry& aEntry ); + TRgb GetCurCalendarColor(); + TInt GetCurCalendarColIdL(); + TInt GetCurCalendarIndex(); + CCalEntryView* EntryViewL(const CCalEntry& aCalEntry ); + CCalInstanceView* InstanceViewL(const CCalEntry& aCalEntry ); + CCalEntryView* EntryView(); protected: // New functions /** @@ -355,6 +497,13 @@ */ void ConstructL(); +private: + TBool CheckSpaceBelowCriticalLevelL(); + /** + * Load multi calendar info to dbmgr + */ + void LoadMultiCalenInfoL(); + protected: // data /** @@ -369,10 +518,35 @@ CCalSession& iCalSession; /** + * Calendar session array, support multi calendar + * Own. + */ + RPointerArray iCalSessionArray; + + /** + * CCalEntryView array, support multi calendar + * Own. + */ + RPointerArray iCalEntryViewArray; + + /** + * CCalInstanceView array, support multi calendar + * Own. + */ + RPointerArray iCalInstanceViewArray; + + /** + * CCalCalendarInfo array, support multi calendar + * Own. + */ + RPointerArray iCalendarInfoArray; + + /** * Reference to cal db observer * */ MMRUtilsObserver& iObserver; + /** * Normal agenda database * Own. @@ -384,6 +558,9 @@ * Own. */ CESMREntryCmdIteratorAO* iCmdIterator; + +private: + TInt iCurCalenIndex; }; #endif // CESMRCALDBMGR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrdb/inc/cesmrentrycmditeratorao.h --- a/meetingrequest/mrdb/inc/cesmrentrycmditeratorao.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrdb/inc/cesmrentrycmditeratorao.h Wed Mar 31 21:08:33 2010 +0300 @@ -20,7 +20,7 @@ // INCLUDE FILES #include -#include +#include // FORWARD DECLARATIONS class MESMRCalDbMgr; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrdb/src/cesmrcaldbmgr.cpp --- a/meetingrequest/mrdb/src/cesmrcaldbmgr.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrdb/src/cesmrcaldbmgr.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,9 +23,9 @@ #include "cesmrentrycmditeratorao.h" #include "esmrhelper.h" #include "esmrentryhelper.h" -// +#include "mesmrcalentry.h" #include "mesmrutilstombsext.h" -// +#include "mruidomaincrkeys.h" // From System #include @@ -36,16 +36,48 @@ #include #include #include -#include +#include +#include +#include +#include +#include +#include // CONSTANTS // Unnamed namespace for local definitions namespace { -const TInt KDbInitReady = 100; +const TInt KDbInitReady( 100 ); + +/** + * Reads last used database index from central repository + * + * @param aIndex on return contains the last used database index + */ +void ReadDatabaseIndexL( TInt& aIndex ) + { + FUNC_LOG; -#ifdef _DEBUG + CRepository* repository = CRepository::NewLC( KCRUidESMRUIFeatures ); + User::LeaveIfError( repository->Get( KMRUIDefaultCalDbIndex, aIndex ) ); + CleanupStack::PopAndDestroy( repository ); + } + +/** + * Writes used database index into central repository + * + * @param database index + */ +void WriteDatabaseIndexL( TInt aIndex ) + { + FUNC_LOG; + + CRepository* repository = CRepository::NewLC( KCRUidESMRUIFeatures ); + User::LeaveIfError( repository->Set( KMRUIDefaultCalDbIndex, aIndex ) ); + CleanupStack::PopAndDestroy( repository ); + } + // Panic code definitions enum TPanicCode @@ -55,7 +87,9 @@ EPanicAsyncOpAlreadyExists, EPanicIllegalEntryStatus, EPanicIllegalResurrect, - EPanicUnexpectedUidValue + EPanicUnexpectedUidValue, + EPanicLoadMultiDbInfoFail, + EPanicInvalidDbIndex }; // Panic string definition @@ -70,8 +104,6 @@ User::Panic( KPanicMsg, aReason ); } -#endif // _DEBUG - } // namespace @@ -94,7 +126,6 @@ self->ConstructL(); CleanupStack::Pop(); - return self; } @@ -123,6 +154,12 @@ CESMRCalDbMgr::~CESMRCalDbMgr() { FUNC_LOG; + + iCalInstanceViewArray.ResetAndDestroy(); + iCalEntryViewArray.ResetAndDestroy(); + iCalendarInfoArray.ResetAndDestroy(); + iCalSessionArray.ResetAndDestroy(); + delete iCmdIterator; delete iNormalDb; } @@ -138,6 +175,9 @@ iNormalDb = CESMRCalDbNormal::NewL( iCalSession, *this, *this ); iCmdIterator = CESMREntryCmdIteratorAO::NewL( *this ); + TRAPD( err, LoadMultiCalenInfoL() ); + __ASSERT_ALWAYS( err == KErrNone, Panic( EPanicLoadMultiDbInfoFail ) ); + User::LeaveIfError( err ); } // ---------------------------------------------------------------------------- @@ -168,7 +208,6 @@ iObserver.HandleCalEngStatus( MMRUtilsObserver::ENotAvailable ); } - // In other cases either db is not yet finished } @@ -203,7 +242,6 @@ iObserver.HandleOperation( iCurrentAsyncOp, KDbInitReady, aError ); iCurrentAsyncOp = CMRUtils::ENoOperation; - } // ---------------------------------------------------------------------------- @@ -227,6 +265,16 @@ } // ---------------------------------------------------------------------------- +// CESMRCalDbMgr::NormalDbAllCalenInstanceView +// ---------------------------------------------------------------------------- +// +RPointerArray CESMRCalDbMgr::NormalDbAllCalenInstanceView() + { + FUNC_LOG; + return iCalInstanceViewArray; + } + +// ---------------------------------------------------------------------------- // CESMRCalDbMgr::FetchEntriesL // ---------------------------------------------------------------------------- // @@ -277,7 +325,6 @@ CleanupStack::PopAndDestroy(); // tmpFetchArray - return retVal; } @@ -293,15 +340,21 @@ TInt retVal( KErrNone ); - if(aToNormalDb) + if ( CheckSpaceBelowCriticalLevelL() ) { - CCalenInterimUtils2::StoreL( *( iNormalDb->EntryView() ), - aCalEntry, - ETrue ); - + retVal = KErrNoMemory; } - + else + { + if( aToNormalDb ) + { + CCalenInterimUtils2::StoreL( *(iCalEntryViewArray[iCurCalenIndex]), + aCalEntry, + ETrue ); + WriteDatabaseIndexL( iCurCalenIndex ); + } + } return retVal; } @@ -319,10 +372,9 @@ calEntryTmpArray.AppendL( &aCalEntry ); TInt numSuccessfulEntry( 0 ); // entry view surely exists when status is 'available': - iNormalDb->EntryView()->UpdateL( calEntryTmpArray, numSuccessfulEntry ); + EntryViewL( aCalEntry )->UpdateL( calEntryTmpArray, numSuccessfulEntry ); TInt retVal( numSuccessfulEntry == 1 ? KErrNone : KErrGeneral ); - CleanupStack::PopAndDestroy(); // calEntryTmpArray, only close array - + CleanupStack::Pop(); // calEntryTmpArray, only close array return retVal; } @@ -331,7 +383,7 @@ // CESMRCalDbMgr::DeleteEntryL // ---------------------------------------------------------------------------- // -TInt CESMRCalDbMgr::DeleteEntryL( const TDesC8& aUid ) +TInt CESMRCalDbMgr::DeleteEntryL( const TDesC8& aUid, TInt aCalenIndex ) { FUNC_LOG; @@ -339,10 +391,9 @@ CleanupStack::PushL( uidArray ); uidArray->AppendL( aUid ); // entry view surely exists when status is 'available': - iNormalDb->EntryView()->DeleteL( *uidArray ); + iCalEntryViewArray[aCalenIndex]->DeleteL( *uidArray ); CleanupStack::PopAndDestroy( uidArray ); - return KErrNone; } @@ -350,7 +401,7 @@ // CESMRCalDbMgr::DeleteEntryL // ---------------------------------------------------------------------------- // -TInt CESMRCalDbMgr::DeleteEntryL( const TCalLocalUid& aLocalUid ) +TInt CESMRCalDbMgr::DeleteEntryL( const TCalLocalUid& aLocalUid, TInt aCalenIndex ) { FUNC_LOG; @@ -358,7 +409,7 @@ CleanupClosePushL( localUidArray ); localUidArray.AppendL( aLocalUid ); TInt numSuccessfulEntry( 0 ); - iNormalDb->EntryView()->DeleteL( localUidArray, numSuccessfulEntry ); + iCalEntryViewArray[aCalenIndex]->DeleteL( localUidArray, numSuccessfulEntry ); TInt retVal( numSuccessfulEntry == 1 ? KErrNone : KErrGeneral ); CleanupStack::PopAndDestroy(); // localUidArray @@ -378,58 +429,64 @@ TBool aCheckOnly ) { FUNC_LOG; - - RCPointerArray tmpFetchArray; - CleanupClosePushL( tmpFetchArray ); - MESMRUtilsTombsExt::TESMRUtilsDbResult entryStatus( MESMRUtilsTombsExt::EUndefined ); - TInt index( -1 ); - // 1. Normal db part, if entry is found in there then tombstones aren't - // checked at all: + if ( CheckSpaceBelowCriticalLevelL() ) + { + entryStatus = MESMRUtilsTombsExt::EErrorCancelled; + } + else + { + RCPointerArray tmpFetchArray; + CleanupClosePushL( tmpFetchArray ); + + TInt index( -1 ); + + // 1. Normal db part, if entry is found in there then tombstones aren't + // checked at all: - if ( EntryExistsInDbL( aCalEntry, *iNormalDb, tmpFetchArray, index ) ) - { // Entry exists in normal db - entryStatus = EvaluateExistingEntryL( aCalEntry, - *( tmpFetchArray[index] ) ); - if ( entryStatus == MESMRUtilsTombsExt::ECheckedValidUpdate && - !aCheckOnly ) - { - StoreEntryL( aCalEntry ); - entryStatus = MESMRUtilsTombsExt::EStoredUpdate; - } - else if ( entryStatus == MESMRUtilsTombsExt::EErrorCancelled && - aResurrect ) - { - __ASSERT_DEBUG( !aCheckOnly, Panic( EPanicIllegalResurrect ) ); - StoreEntryL( aCalEntry ); - entryStatus = MESMRUtilsTombsExt::EResurrectedCancelled; - } - // entry can't be new if it exists in the db already: - __ASSERT_DEBUG( entryStatus != MESMRUtilsTombsExt::ECheckedValidNew, - Panic( EPanicIllegalEntryStatus) ); - } - - // 2. New entry in this phone: - - else - { // Completely new entry (or tombstone has disappeared) - entryStatus = EvaluateNewEntryL( aCalEntry ); - if ( entryStatus == MESMRUtilsTombsExt::ECheckedValidNew && !aCheckOnly ) - { - StoreEntryL( aCalEntry ); - entryStatus = MESMRUtilsTombsExt::EStoredNew; + if ( EntryExistsInDbL( aCalEntry, *iNormalDb, tmpFetchArray, index ) ) + { // Entry exists in normal db + entryStatus = EvaluateExistingEntryL( aCalEntry, + *( tmpFetchArray[index] ) ); + if ( entryStatus == MESMRUtilsTombsExt::ECheckedValidUpdate && + !aCheckOnly ) + { + StoreEntryL( aCalEntry ); + entryStatus = MESMRUtilsTombsExt::EStoredUpdate; + } + else if ( entryStatus == MESMRUtilsTombsExt::EErrorCancelled && + aResurrect ) + { + __ASSERT_DEBUG( !aCheckOnly, Panic( EPanicIllegalResurrect ) ); + StoreEntryL( aCalEntry ); + entryStatus = MESMRUtilsTombsExt::EResurrectedCancelled; + } + // entry can't be new if it exists in the db already: + __ASSERT_DEBUG( entryStatus != MESMRUtilsTombsExt::ECheckedValidNew, + Panic( EPanicIllegalEntryStatus) ); } - // entry can't be update if doesn't exist in the db already: - __ASSERT_DEBUG( entryStatus != MESMRUtilsTombsExt::ECheckedValidUpdate, - Panic( EPanicIllegalEntryStatus) ); + // 2. New entry in this phone: + + else + { // Completely new entry (or tombstone has disappeared) + entryStatus = EvaluateNewEntryL( aCalEntry ); + if ( entryStatus == MESMRUtilsTombsExt::ECheckedValidNew && !aCheckOnly ) + { + StoreEntryL( aCalEntry ); + entryStatus = MESMRUtilsTombsExt::EStoredNew; + } + + // entry can't be update if doesn't exist in the db already: + __ASSERT_DEBUG( entryStatus != MESMRUtilsTombsExt::ECheckedValidUpdate, + Panic( EPanicIllegalEntryStatus) ); + } + + CleanupStack::PopAndDestroy(); // tmpFetchArray } - CleanupStack::PopAndDestroy(); // tmpFetchArray - - return entryStatus; } @@ -445,12 +502,18 @@ CleanupClosePushL( tmpFetchArray ); // 1. Delete all found entries from normal db: - - iNormalDb->EntryView()->FetchL( aUid, tmpFetchArray ); - DeleteEntryL( aUid ); + TInt count = iCalEntryViewArray.Count(); + for( TInt i(0); i < count; i++ ) + { + iCalEntryViewArray[i]->FetchL( aUid, tmpFetchArray ); + if( tmpFetchArray.Count() > 0 ) + { + DeleteEntryL( aUid, i ); + tmpFetchArray.ResetAndDestroy(); + } + } CleanupStack::PopAndDestroy(); // tmpFetchArray - } // ---------------------------------------------------------------------------- @@ -461,14 +524,17 @@ { FUNC_LOG; - CCalEntry* entry = iNormalDb->EntryView()->FetchL( aLocalUid ); - if ( entry ) + TInt count = iCalEntryViewArray.Count(); + for( TInt i(0); i < count; i++ ) { - CleanupStack::PushL( entry ); - DeleteEntryCondL( *entry ); - CleanupStack::PopAndDestroy( entry ); + CCalEntry* entry = iCalEntryViewArray[i]->FetchL( aLocalUid ); + if ( entry ) + { + CleanupStack::PushL( entry ); + DeleteEntryCondL( *entry ); + CleanupStack::PopAndDestroy( entry ); + } } - } // ---------------------------------------------------------------------------- @@ -483,14 +549,29 @@ { // Modifying entry // 1. Delete entry from normal db: - iNormalDb->EntryView()->DeleteL( aCalEntry ); + + CCalInstance* instance = FindInstanceL( (CCalEntry&)aCalEntry ); + CleanupStack::PushL( instance ); + TInt colId = instance->InstanceIdL().iCollectionId; + + TInt index = 0; + TInt count = iCalSessionArray.Count(); + for( TInt i = 0; i < count; i++ ) + { + if( colId == iCalSessionArray[i]->CollectionIdL() ) + { + index = i; + break; + } + } + iCalEntryViewArray[index]->DeleteL( aCalEntry ); + CleanupStack::PopAndDestroy( instance ); } else { // Originating entry, this is the same case as deleting with GUID: DeleteEntryCondL( aCalEntry.UidL() ); } - } // ---------------------------------------------------------------------------- @@ -527,13 +608,384 @@ } // ---------------------------------------------------------------------------- +// CESMRCalDbMgr::FindInstanceL +// ---------------------------------------------------------------------------- +// +CCalInstance* CESMRCalDbMgr::FindInstanceL( + const CCalEntry& aEntry ) + { + FUNC_LOG; + + CCalInstance* instance = NULL; + RCPointerArray calInstances; + CleanupClosePushL( calInstances ); + + CalCommon::TCalViewFilter instanceFilter = + CalCommon::EIncludeAppts | + CalCommon::EIncludeEvents | + CalCommon::EIncludeReminder | + CalCommon::EIncludeAnnivs | + CalCommon::EIncludeCompletedTodos | + CalCommon::EIncludeIncompletedTodos; + + // Removing one seconds from start time and adding one second to stop + // time. Otherwise wanted entry is not included into results. + TCalTime startTime; + startTime.SetTimeLocalL( + aEntry.StartTimeL().TimeLocalL() - TTimeIntervalSeconds( 1 ) ); + TCalTime endTime; + endTime.SetTimeLocalL( + aEntry.EndTimeL().TimeLocalL() + TTimeIntervalSeconds( 1 ) ); + + TDateTime start = startTime.TimeLocalL().DateTime(); + TDateTime end = endTime.TimeLocalL().DateTime(); + + CalCommon::TCalTimeRange timeRange( + startTime, + endTime ); + + + TInt count = iCalInstanceViewArray.Count(); + for( TInt i = 0; i < count && !instance; i++ ) + { + iCalInstanceViewArray[i]->FindInstanceL( + calInstances, + instanceFilter, + timeRange); + if( calInstances.Count() > 0 ) + { + TInt instanceCount( calInstances.Count() ); + for (TInt i = 0; (i < instanceCount && !instance); ++i) + { + CCalEntry& entry = calInstances[i]->Entry(); + + // Finding the entry we are intrested for + if ( !entry.UidL().Compare( aEntry.UidL() ) ) + { + instance = calInstances[i]; + calInstances.Remove( i ); + } + } + } + } + + CleanupStack::PopAndDestroy(); // arrayCleanup + return instance; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetCalendarColorByEntryL +// ---------------------------------------------------------------------------- +// +TRgb CESMRCalDbMgr::GetCalendarColorByEntryL(MESMRCalEntry& aEntry) + { + FUNC_LOG; + TInt count = iCalSessionArray.Count(); + TRgb color(0); + if( count < 1 ) + return color; + + if( !aEntry.IsStoredL() ) + { + color = iCalendarInfoArray[0]->Color(); + } + else + { + CCalInstance* instance = aEntry.InstanceL(); + CleanupStack::PushL( instance ); + TInt collectionId = instance->InstanceIdL().iCollectionId; + + for( TInt i = 0; i < count; i++ ) + { + if( collectionId == iCalSessionArray[i]->CollectionIdL() ) + { + color = iCalendarInfoArray[i]->Color(); + break; + } + } + + CleanupStack::PopAndDestroy( instance ); + } + + return color; + } +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetMultiCalendarNameListL +// ---------------------------------------------------------------------------- +// +void CESMRCalDbMgr::GetMultiCalendarNameListL(RArray& aCalendarNameList) + { + FUNC_LOG; + TInt count = iCalendarInfoArray.Count(); + aCalendarNameList.ReserveL( count ); + + for( TInt i = 0; i < count; i++ ) + { + const TDesC& calenName = iCalendarInfoArray[i]->NameL(); + aCalendarNameList.AppendL( TPtrC( calenName ) ); + } + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetCalendarNameByEntryL +// ---------------------------------------------------------------------------- +// +TPtrC CESMRCalDbMgr::GetCalendarNameByEntryL(MESMRCalEntry& aEntry) + { + FUNC_LOG; + + TInt count = iCalSessionArray.Count(); + + TRgb color(0); + TPtrC calenName; + + if( !aEntry.IsStoredL() ) + { + //while create new entry, use current calendar db + if( count > 0 ) + { + calenName.Set(iCalendarInfoArray[iCurCalenIndex]->NameL()); + } + } + else + { + CCalInstance* instance = NULL; + TRAPD( err, instance = aEntry.InstanceL() ); + CleanupStack::PushL( instance ); + if( err == KErrNotFound || instance == NULL ) + calenName.Set(iCalendarInfoArray[iCurCalenIndex]->NameL()); + else + { + TInt collectionId = instance->InstanceIdL().iCollectionId; + TBuf<16> val; + + for( TInt i = 0; i < count; i++ ) + { + if( collectionId == iCalSessionArray[i]->CollectionIdL() ) + { + calenName.Set(iCalendarInfoArray[i]->NameL()); + break; + } + } + } + CleanupStack::PopAndDestroy( instance ); + } + + return calenName; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetCalendarColorByNameL +// ---------------------------------------------------------------------------- +// +TRgb CESMRCalDbMgr::GetCalendarColorByNameL(TDesC& aCalendarName) + { + FUNC_LOG; + TInt count = iCalendarInfoArray.Count(); + TRgb color(0); + + for ( TInt i = 0; i < count; i++) + { + if( aCalendarName.Compare( iCalendarInfoArray[i]->NameL() ) == 0 ) + { + color = iCalendarInfoArray[i]->Color(); + } + } + + return color; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::SetCurCalendarByNameL +// ---------------------------------------------------------------------------- +// +void CESMRCalDbMgr::SetCurCalendarByNameL( TDesC& aCalendarName ) + { + FUNC_LOG; + TInt count = iCalendarInfoArray.Count(); + + for( TInt i(0); i < count; i++ ) + { + if( aCalendarName.Compare( iCalendarInfoArray[i]->NameL() ) == 0 ) + { + SetCurCalendarByIndex( i ); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::SetCurCalendarByColIdL +// ---------------------------------------------------------------------------- +// +void CESMRCalDbMgr::SetCurCalendarByColIdL( TInt aColId ) + { + FUNC_LOG; + TInt count = iCalSessionArray.Count(); + + for( TInt i = 0; i < count; i++ ) + { + if( aColId == iCalSessionArray[i]->CollectionIdL() ) + { + SetCurCalendarByIndex( i ); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::SetCurCalendarByEntry +// ---------------------------------------------------------------------------- +// +void CESMRCalDbMgr::SetCurCalendarByEntryL( MESMRCalEntry& aEntry ) + { + TPtrC calenName = GetCalendarNameByEntryL( aEntry ); + SetCurCalendarByNameL( calenName ); + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::SetCurCalendarByIndex +// ---------------------------------------------------------------------------- +// +void CESMRCalDbMgr::SetCurCalendarByIndex( TInt aIndex ) + { + FUNC_LOG; + iCurCalenIndex = aIndex; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetCurCalendarColor +// ---------------------------------------------------------------------------- +// +TRgb CESMRCalDbMgr::GetCurCalendarColor() + { + FUNC_LOG; + __ASSERT_ALWAYS( + iCurCalenIndex < iCalendarInfoArray.Count(), + Panic( EPanicInvalidDbIndex ) ); + return iCalendarInfoArray[iCurCalenIndex]->Color(); + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetCurCalendarColIdL +// ---------------------------------------------------------------------------- +// +TInt CESMRCalDbMgr::GetCurCalendarColIdL() + { + FUNC_LOG; + __ASSERT_ALWAYS( + iCurCalenIndex < iCalSessionArray.Count(), + Panic( EPanicInvalidDbIndex ) ); + + return iCalSessionArray[iCurCalenIndex]->CollectionIdL(); + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::GetCurCalendarIndex +// ---------------------------------------------------------------------------- +// +TInt CESMRCalDbMgr::GetCurCalendarIndex() + { + return iCurCalenIndex; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::EntryViewL +// ---------------------------------------------------------------------------- +// +CCalEntryView* CESMRCalDbMgr::EntryViewL(const CCalEntry& aCalEntry ) + { + FUNC_LOG; + CCalInstance* instance = FindInstanceL( aCalEntry ); + if( !instance ) + { + return NULL; + } + + CleanupStack::PushL( instance ); + CCalEntryView* entryView = NULL; + + TInt colId = instance->InstanceIdL().iCollectionId; + TInt count = iCalSessionArray.Count(); + + for( TInt i = 0; i < count; i++ ) + { + if( colId == iCalSessionArray[i]->CollectionIdL() ) + { + entryView = iCalEntryViewArray[i]; + break; + } + } + + if ( !entryView ) + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( instance ); + return entryView; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::InstanceViewL +// ---------------------------------------------------------------------------- +// +CCalInstanceView* CESMRCalDbMgr::InstanceViewL(const CCalEntry& aCalEntry ) + { + FUNC_LOG; + CCalInstance* instance = FindInstanceL( aCalEntry ); + if( !instance ) + { + return NULL; + } + + CleanupStack::PushL( instance ); + CCalInstanceView* instanceView = NULL; + + TInt colId = instance->InstanceIdL().iCollectionId; + TInt count = iCalSessionArray.Count(); + + for( TInt i = 0; i < count; i++ ) + { + if( colId == iCalSessionArray[i]->CollectionIdL() ) + { + instanceView = iCalInstanceViewArray[i]; + break; + } + } + + if ( !instanceView ) + { + User::Leave( KErrNotFound ); + } + + CleanupStack::PopAndDestroy( instance ); + return instanceView; + } + +// ---------------------------------------------------------------------------- +// CESMRCalDbMgr::EntryView +// ---------------------------------------------------------------------------- +// +CCalEntryView* CESMRCalDbMgr::EntryView() + { + FUNC_LOG; + __ASSERT_ALWAYS( + iCurCalenIndex < iCalEntryViewArray.Count(), + Panic( EPanicInvalidDbIndex ) ); + return iCalEntryViewArray[iCurCalenIndex]; + } + + + +// ---------------------------------------------------------------------------- // CESMRCalDbMgr::EntryExistsInDbL // ---------------------------------------------------------------------------- // TBool CESMRCalDbMgr::EntryExistsInDbL( const TDesC8& aUid, const TCalTime& aRecurrenceId, - const CESMRCalDbBase& aDb, + const CESMRCalDbBase& /*aDb*/, RPointerArray& aCalEntryArray, TInt& aIndex ) const { @@ -542,7 +994,16 @@ TBool retVal( EFalse ); aIndex = KErrNotFound; - aDb.EntryView()->FetchL( aUid, aCalEntryArray ); + TInt sessionCount = iCalSessionArray.Count(); + for( TInt i = 0; i < sessionCount; i++ ) + { + iCalEntryViewArray[i]->FetchL( aUid, aCalEntryArray ); + if( aCalEntryArray.Count() > 0) + { + break; + } + } + TInt count( aCalEntryArray.Count() ); for ( TInt i( 0 ); i < count; ++i ) { @@ -555,7 +1016,6 @@ } } - return retVal; } @@ -587,9 +1047,11 @@ { FUNC_LOG; - __ASSERT_DEBUG( aEntry.UidL() == aEntry.UidL(), + __ASSERT_DEBUG( aEntry.UidL() == aDbEntry.UidL(), Panic( EPanicUnexpectedUidValue ) ); - MESMRUtilsTombsExt::TESMRUtilsDbResult retVal( MESMRUtilsTombsExt::EUndefined ); + + MESMRUtilsTombsExt::TESMRUtilsDbResult retVal( + MESMRUtilsTombsExt::EUndefined ); TInt seq( aEntry.SequenceNumberL() ); TInt dbSeq( aDbEntry.SequenceNumberL() ); @@ -617,7 +1079,6 @@ retVal = MESMRUtilsTombsExt::EErrorObsolete; } - return retVal; } @@ -643,7 +1104,6 @@ retVal = MESMRUtilsTombsExt::ECheckedValidNew; } - return retVal; } @@ -666,6 +1126,21 @@ CalCommon::EIncludeAppts, range ); TInt count( instances.Count() ); + + // The entry can also be in other calendar than the default one, + // so the instance view array should be checked in this case. + if( count == 0 ) + { + TInt instanceViewCount = iCalInstanceViewArray.Count(); + for( TInt i(0); i < instanceViewCount; i++ ) + { + iCalInstanceViewArray[i]->FindInstanceL( instances, + CalCommon::EIncludeAppts, + range ); + } + count = instances.Count(); + } + for ( TInt i( 0 ); i < count; ++i ) { // When creating a new modifying entry, recurrence id must match @@ -680,7 +1155,6 @@ } CleanupStack::PopAndDestroy(); // instances, delete array items - return retVal; } @@ -702,9 +1176,97 @@ retVal = ETrue; } - return retVal; } +// --------------------------------------------------------------------------- +// CESMRCalDbMgr::CheckSpaceBelowCriticalLevelL +// --------------------------------------------------------------------------- +// +TBool CESMRCalDbMgr::CheckSpaceBelowCriticalLevelL() + { + FUNC_LOG; + + TBool retcode(EFalse); + + CCoeEnv* coeEnv = CCoeEnv::Static(); + + if ( SysUtil::FFSSpaceBelowCriticalLevelL( &( coeEnv->FsSession() ) ) ) + { + CErrorUI* errorUi = CErrorUI::NewLC(); + errorUi->ShowGlobalErrorNoteL( KErrDiskFull ); + CleanupStack::PopAndDestroy(); // errorUi + retcode = ETrue; + } + + return retcode; + } + +// --------------------------------------------------------------------------- +// CESMRCalDbMgr::LoadMultiCalenInfo +// --------------------------------------------------------------------------- +// +void CESMRCalDbMgr::LoadMultiCalenInfoL() + { + FUNC_LOG; + + CDesCArray* fileArray = iCalSession.ListCalFilesL(); + CleanupStack::PushL( fileArray ); + + TInt count = fileArray->Count(); + + iCalSessionArray.ReserveL( count ); + iCalEntryViewArray.ReserveL( count ); + iCalInstanceViewArray.ReserveL( count ); + iCalendarInfoArray.ReserveL( count ); + + for( TInt i = 0; i < count; i++ ) + { + CCalSession* file = CCalSession::NewL(); + CleanupStack::PushL( file ); + + const TDesC& fileName = (*fileArray)[i]; + file->OpenL( fileName ); + CCalCalendarInfo* calendarInfo = file->CalendarInfoL(); + + if( calendarInfo->IsValid() + && calendarInfo->Enabled() ) + { + // Push info into CleanupStack because NewL may leave + CleanupStack::PushL( calendarInfo ); + + CCalEntryView* entryView = CCalEntryView::NewL( *file ); + // Push entryView into CleanupStack because NewL may leave + CleanupStack::PushL( entryView ); + + CCalInstanceView* instanceView = CCalInstanceView::NewL( *file ); + + // Space has been reserved so AppendL won't leave + iCalInstanceViewArray.AppendL( instanceView ); + + iCalEntryViewArray.AppendL( entryView ); + CleanupStack::Pop( entryView ); + + iCalendarInfoArray.AppendL( calendarInfo ); + CleanupStack::Pop( calendarInfo ); + + iCalSessionArray.AppendL( file ); + CleanupStack::Pop( file ); + } + else + { + delete calendarInfo; + CleanupStack::PopAndDestroy( file ); + } + } + + CleanupStack::PopAndDestroy( fileArray ); + + // Restore default database index from repository + ReadDatabaseIndexL( iCurCalenIndex ); + } + + // End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrdb/src/cesmrentrycmditeratorao.cpp --- a/meetingrequest/mrdb/src/cesmrentrycmditeratorao.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrdb/src/cesmrentrycmditeratorao.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -122,6 +122,8 @@ TInt count( aCalEntryArray.Count() ); + iCalEntryArray.ReserveL( count ); + for ( TInt i( 0 ); i < count; ++i ) { iCalEntryArray.AppendL( aCalEntryArray[i] ); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/bwins/ESMREntryu.def --- a/meetingrequest/mrentry/bwins/ESMREntryu.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/bwins/ESMREntryu.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,15 +1,10 @@ EXPORTS - ??1CESMREntryProcessor@@UAE@XZ @ 1 NONAME ; CESMREntryProcessor::~CESMREntryProcessor(void) - ?ESMREntryL@CESMREntryProcessor@@QAEAAVMESMRMeetingRequestEntry@@XZ @ 2 NONAME ; class MESMRMeetingRequestEntry & CESMREntryProcessor::ESMREntryL(void) - ?ExtensionUid@CESMREntryProcessor@@SA?AVTUid@@XZ @ 3 NONAME ; class TUid CESMREntryProcessor::ExtensionUid(void) - ?NewL@CESMREntryProcessor@@SAPAV1@AAVCMRMailboxUtils@@AAVMESMRCalDbMgr@@@Z @ 4 NONAME ; class CESMREntryProcessor * CESMREntryProcessor::NewL(class CMRMailboxUtils &, class MESMRCalDbMgr &) - ?ProcessL@CESMREntryProcessor@@QAEXAAVCCalInstance@@@Z @ 5 NONAME ; void CESMREntryProcessor::ProcessL(class CCalInstance &) - ?ProcessL@CESMREntryProcessor@@QAEXPAV?$RPointerArray@VCCalEntry@@@@@Z @ 6 NONAME ; void CESMREntryProcessor::ProcessL(class RPointerArray *) - ?ProcessL@CESMREntryProcessor@@QAEXPBVTAgnEntryUiInParams@MAgnEntryUi@@PAV?$RPointerArray@VCCalEntry@@@@@Z @ 7 NONAME ; void CESMREntryProcessor::ProcessL(class MAgnEntryUi::TAgnEntryUiInParams const *, class RPointerArray *) - ?ProcessOutputParametersL@CESMREntryProcessor@@QAEXAAVTAgnEntryUiOutParams@MAgnEntryUi@@W4TESMRCommand@@@Z @ 8 NONAME ; void CESMREntryProcessor::ProcessOutputParametersL(class MAgnEntryUi::TAgnEntryUiOutParams &, enum TESMRCommand) - ?ResetL@CESMREntryProcessor@@QAEXXZ @ 9 NONAME ; void CESMREntryProcessor::ResetL(void) - ?SwitchToEditL@CESMREntryProcessor@@QAEXXZ @ 10 NONAME ; void CESMREntryProcessor::SwitchToEditL(void) - ?SwitchToForwardL@CESMREntryProcessor@@QAEXXZ @ 11 NONAME ; void CESMREntryProcessor::SwitchToForwardL(void) - ?SwitchToViewL@CESMREntryProcessor@@QAEXXZ @ 12 NONAME ; void CESMREntryProcessor::SwitchToViewL(void) - ?SwitchToTrackL@CESMREntryProcessor@@QAEXXZ @ 13 NONAME ; void CESMREntryProcessor::SwitchToTrackL(void) + ?SetPhoneOwnerL@CESMRFsMailboxUtils@@QAEHAAVCCalEntry@@AAVCFSMailClient@@AAVCFSMailMessage@@@Z @ 1 NONAME ; int CESMRFsMailboxUtils::SetPhoneOwnerL(class CCalEntry &, class CFSMailClient &, class CFSMailMessage &) + ?FSEmailPluginForEntryL@CESMRFsMailboxUtils@@QAE?AW4TESMRMailPlugin@@ABVCCalEntry@@@Z @ 2 NONAME ; enum TESMRMailPlugin CESMRFsMailboxUtils::FSEmailPluginForEntryL(class CCalEntry const &) + ?SetPhoneOwnerL@CESMRFsMailboxUtils@@QAEHAAVCCalEntry@@J@Z @ 3 NONAME ; int CESMRFsMailboxUtils::SetPhoneOwnerL(class CCalEntry &, long) + ??1CESMRMeetingRequestEntry@@UAE@XZ @ 4 NONAME ; CESMRMeetingRequestEntry::~CESMRMeetingRequestEntry(void) + ?NewL@CESMRFsMailboxUtils@@SAPAV1@AAVCMRMailboxUtils@@@Z @ 5 NONAME ; class CESMRFsMailboxUtils * CESMRFsMailboxUtils::NewL(class CMRMailboxUtils &) + ??1CESMRFsMailboxUtils@@UAE@XZ @ 6 NONAME ; CESMRFsMailboxUtils::~CESMRFsMailboxUtils(void) + ?NewL@CESMRMeetingRequestEntry@@SAPAV1@ABVCCalEntry@@AAVCMRMailboxUtils@@AAVMESMRCalDbMgr@@HPAVTESMRInputParams@@@Z @ 7 NONAME ; class CESMRMeetingRequestEntry * CESMRMeetingRequestEntry::NewL(class CCalEntry const &, class CMRMailboxUtils &, class MESMRCalDbMgr &, int, class TESMRInputParams *) + ?DefaultMailboxSupportCapabilityL@CESMRFsMailboxUtils@@QAEHW4TMRMailboxCapability@1@@Z @ 8 NONAME ; int CESMRFsMailboxUtils::DefaultMailboxSupportCapabilityL(enum CESMRFsMailboxUtils::TMRMailboxCapability) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/eabi/ESMREntryu.def --- a/meetingrequest/mrentry/eabi/ESMREntryu.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/eabi/ESMREntryu.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,17 +1,16 @@ EXPORTS - _ZN19CESMREntryProcessor10ESMREntryLEv @ 1 NONAME - _ZN19CESMREntryProcessor12ExtensionUidEv @ 2 NONAME - _ZN19CESMREntryProcessor13SwitchToEditLEv @ 3 NONAME - _ZN19CESMREntryProcessor13SwitchToViewLEv @ 4 NONAME - _ZN19CESMREntryProcessor16SwitchToForwardLEv @ 5 NONAME - _ZN19CESMREntryProcessor24ProcessOutputParametersLERN11MAgnEntryUi20TAgnEntryUiOutParamsE12TESMRCommand @ 6 NONAME - _ZN19CESMREntryProcessor4NewLER15CMRMailboxUtilsR13MESMRCalDbMgr @ 7 NONAME - _ZN19CESMREntryProcessor6ResetLEv @ 8 NONAME - _ZN19CESMREntryProcessor8ProcessLEP13RPointerArrayI9CCalEntryE @ 9 NONAME - _ZN19CESMREntryProcessor8ProcessLEPKN11MAgnEntryUi19TAgnEntryUiInParamsEP13RPointerArrayI9CCalEntryE @ 10 NONAME - _ZN19CESMREntryProcessor8ProcessLER12CCalInstance @ 11 NONAME - _ZN19CESMREntryProcessorD0Ev @ 12 NONAME - _ZN19CESMREntryProcessorD1Ev @ 13 NONAME - _ZN19CESMREntryProcessorD2Ev @ 14 NONAME - _ZN19CESMREntryProcessor14SwitchToTrackLEv @ 15 NONAME + _ZN19CESMRFsMailboxUtils14SetPhoneOwnerLER9CCalEntryR13CFSMailClientR14CFSMailMessage @ 1 NONAME + _ZN19CESMRFsMailboxUtils14SetPhoneOwnerLER9CCalEntryl @ 2 NONAME + _ZN19CESMRFsMailboxUtils22FSEmailPluginForEntryLERK9CCalEntry @ 3 NONAME + _ZN19CESMRFsMailboxUtils4NewLER15CMRMailboxUtils @ 4 NONAME + _ZN19CESMRFsMailboxUtilsD0Ev @ 5 NONAME + _ZN19CESMRFsMailboxUtilsD1Ev @ 6 NONAME + _ZN19CESMRFsMailboxUtilsD2Ev @ 7 NONAME + _ZN24CESMRMeetingRequestEntry4NewLERK9CCalEntryR15CMRMailboxUtilsR13MESMRCalDbMgriP16TESMRInputParams @ 8 NONAME + _ZN24CESMRMeetingRequestEntryD0Ev @ 9 NONAME + _ZN24CESMRMeetingRequestEntryD1Ev @ 10 NONAME + _ZN24CESMRMeetingRequestEntryD2Ev @ 11 NONAME + _ZThn4_N24CESMRMeetingRequestEntryD0Ev @ 12 NONAME + _ZThn4_N24CESMRMeetingRequestEntryD1Ev @ 13 NONAME + _ZN19CESMRFsMailboxUtils32DefaultMailboxSupportCapabilityLENS_20TMRMailboxCapabilityE @ 14 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/group/bld.inf --- a/meetingrequest/mrentry/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -21,9 +21,10 @@ PRJ_EXPORTS ../inc/mesmrcalentry.h |../../inc/mesmrcalentry.h +../inc/cesmrfsmailboxutils.h |../../inc/cesmrfsmailboxutils.h +../inc/cesmrmeetingrequestentry.h |../../inc/cesmrmeetingrequestentry.h ../inc/mesmrmeetingrequestentry.h |../../inc/mesmrmeetingrequestentry.h -../inc/cesmrentryprocessor.h |../../inc/cesmrentryprocessor.h -../inc/cesmrentryprocessor.inl |../../inc/cesmrentryprocessor.inl + PRJ_MMPFILES esmrentry.mmp diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/group/esmrentry.mmp --- a/meetingrequest/mrentry/group/esmrentry.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/group/esmrentry.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,21 +29,16 @@ VENDORID VID_DEFAULT DEFFILE ESMREntry.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src -SOURCE cesmrentryprocessor.cpp SOURCE cesmrmeetingrequestentry.cpp -SOURCE cesmrconflictchecker.cpp SOURCE cesmrfsmailboxutils.cpp USERINCLUDE . USERINCLUDE ../inc USERINCLUDE ../../inc +USERINCLUDE ../../../inc APP_LAYER_SYSTEMINCLUDE -USERINCLUDE ../../../inc // ESMR libraries LIBRARY esmrcommon.lib @@ -64,10 +58,11 @@ LIBRARY fsmailframework.lib LIBRARY fsfwcommonlib.lib LIBRARY centralrepository.lib -LIBRARY cmaillogger.lib +LIBRARY apgrfx.lib +LIBRARY apmime.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/cesmrconflictchecker.h --- a/meetingrequest/mrentry/inc/cesmrconflictchecker.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR calendar entry conflict checker -* -*/ - - -#ifndef CESMRCONFLICTCHECKER_H -#define CESMRCONFLICTCHECKER_H - -#include - -class CCalEntry; -class MESMRCalDbMgr; - -/** - * CESMRConflictChecker is responsible for finding - * conflicting entries from symbian calendar database. - * - * @lib esmrentry.lib - */ -NONSHARABLE_CLASS(CESMRConflictChecker) : - public CBase - { -public: // Construction and destruction - /** - * Two-phased constructor. Creates and initializes - * CESMRConflictChecker object. - * @param aDbMgr Reference to cal db manager. - * @return Pointer to esmr policy checker object. - */ - static CESMRConflictChecker* NewL( - MESMRCalDbMgr& aDbMgr ); - - /** - * C++ destructor. - */ - ~CESMRConflictChecker(); - -public: // Interface - /** - * Finds conflicting entries. Conflicting entries are - * stored to table given as parameter. Ownership of the - * conflicting entries are transferred to caller. - * - * @param aEntry Reference to calendar entry - * @param aConflicts Reference to calendar entry table - */ - void FindConflictsL( - const CCalEntry& aEntry, - RPointerArray& aConflicts ); - - /** - * Finds instances for this entry occuring between specified - * time range. - * @param aStart Start time - * @param aEnd End time - * @param aEntry Reference to entry - * @param aInstances On return contains the instances - * - */ - void FindInstancesForEntryL( - TTime aStart, - TTime aEnd, - const CCalEntry& aEntry, - RPointerArray& aInstances ); - -private: // Implementation - CESMRConflictChecker( - MESMRCalDbMgr& aDbMgr ); - -private: // Data - /// Ref: Reference to cal db manager - MESMRCalDbMgr& iDbMgr; - }; - -#endif // CESMRCONFLICTCHECKER_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/cesmrentryprocessor.h --- a/meetingrequest/mrentry/inc/cesmrentryprocessor.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR mr entry processor -* -*/ - -#ifndef CESMRENTRYPROCESSOR_H -#define CESMRENTRYPROCESSOR_H - -#include -#include -// -#include "esmrcommands.h" -#include "tesmrscenariodata.h" -// - -class MESMRCalDbMgr; -class CMRMailboxUtils; -class CCalInstance; -class MESMRMeetingRequestEntry; -class CESMRMeetingRequestEntry; -class CESMRFsMailboxUtils; - -/** -* CESMREntryProcessor's main responsibility is to -* perform entry processing and evaluation in initialization phase. -* -* @lib esmrentry.lib -*/ -NONSHARABLE_CLASS(CESMREntryProcessor) : - public CBase - { -public: // Construction and destruction - /** - * Creates new CESMREntryProcessor object. Ownership - * is transferred to caller. - * @param aMRMailboxUtils Refernce to MR Mailbox Utilities API. - * @param aDbMgr Reference to calendar DB manager. - * @return Pointer to created CESMREntryProcessor object, - */ - IMPORT_C static CESMREntryProcessor* NewL( - CMRMailboxUtils& aMRMailboxUtils, - MESMRCalDbMgr& aDbMgr ); - - /** - * C++ destructor - */ - IMPORT_C ~CESMREntryProcessor(); - -public: // Interface - /** - * Fetches scenario data. - * - * @return scenario data. - */ - inline const TESMRScenarioData& ScenarioData() const; - - /** - * Tests, whether processor contains entry, which it has processed - * or not. - * - * @return ETrue, if contains processed entry. - */ - inline TBool ContainsProcessedEntry() const; - - /** - * Fetches the extension UID for ES MR entry processor. - * - * @return MRUI processor extension UID. - */ - IMPORT_C static TUid ExtensionUid(); - - /** - * Process entries and constructs scenario data. - * - * @param aParam AGN Entry UI input parameters. - * @param aEntries Calendar entries to be processed. - * Ownership is not transferred. - */ - IMPORT_C void ProcessL( - const MAgnEntryUi::TAgnEntryUiInParams* aParams, - RPointerArray* aEntries ); - - /** - * Process entries. Scenario data is not constructed. - * - * @param aEntries Calendar entries to be processed. - * Ownership is not transferred. - */ - IMPORT_C void ProcessL( - RPointerArray* aEntries ); - - /** - * Processes calendar instance. All operations affects only the - * processed instance. - * - * @param aInstance Reference to calendar instance. - */ - IMPORT_C void ProcessL( - CCalInstance& aInstance ); - - /** - * Switches processor for forwarding mode. - * @error KErrNotReady no entries has been processed yet. - */ - IMPORT_C void SwitchToForwardL(); - - /** - * Switches processor to edit mode. - * @error KErrNotReady no entries has been processed yet. - */ - IMPORT_C void SwitchToEditL(); - - /** - * Switches processor to view mode. - * @error KErrNotReady no entries has been processed yet. - */ - IMPORT_C void SwitchToViewL(); - - /** - * Switches processor to Tracking mode. - * @error KErrNotReady no entries has been processed yet. - */ - IMPORT_C void SwitchToTrackL(); - - /** - * Fetches ES MR Entry. Methods panics, if entries has not - * been processed before calling this method. - * - * @return Reference to CESMRMeetingRequestEntry object. - */ - IMPORT_C MESMRMeetingRequestEntry& ESMREntryL(); - - /** - * Resets the entry processor. After calling this method the - * processor is in the same state than after creation. - */ - IMPORT_C void ResetL(); - - /** - * Process output parameters. Processing is done according to command - * passed as parameter. - * - * @param aOutputParams Reference to output parameters. - * @param aCommand Command for which output parameters are processed. - */ - IMPORT_C void ProcessOutputParametersL( - MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, - TESMRCommand aCommand ); - -private: // Implementaton - - CESMREntryProcessor( - CMRMailboxUtils& aMRMailboxUtils, - MESMRCalDbMgr& aDbMgr ); - void ConstructL(); - void SetPhoneOwnerL(); - void CheckViewModeL(); - TBool IsDataOk() const; - void CreateESMREntryL(); - void CheckOrganizerL(); - void SetPhoneOwnerToOwnEntryL(); - -private: // Data - /** - * Scenario data - * Own. - */ - TESMRScenarioData iScenData; - - /** - * ES MR Entry - * Own. - */ - CESMRMeetingRequestEntry* iESMREntry; - - /** - * Reference to MR Mailbox Utilities API - * Not own. - */ - CMRMailboxUtils& iMRMailboxUtils; - - /** - * Reference to calendar DB manager - * Not own. - */ - MESMRCalDbMgr& iDbMgr; - - /** - * Entries to be processed - * Not own. - */ - RPointerArray* iMREntries; - - /** - * Input parameters from calling application - * Not own. - */ - const MAgnEntryUi::TAgnEntryUiInParams* iParams; - - /** - * Own: Mailbox utils class. - */ - CESMRFsMailboxUtils* iMbUtils; - }; - -#include "cesmrentryprocessor.inl" - -#endif // CESMRENTRYPROCESSOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/cesmrentryprocessor.inl --- a/meetingrequest/mrentry/inc/cesmrentryprocessor.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR mr entry processor inline methods -* -*/ - - -// ----------------------------------------------------------------------------- -// CESMREntryProcessor::ScenarioData -// ----------------------------------------------------------------------------- -// -inline const TESMRScenarioData& CESMREntryProcessor::ScenarioData() const - { - return iScenData; - } - -// ----------------------------------------------------------------------------- -// CESMREntryProcessor::ContainsProcessedEntry -// ----------------------------------------------------------------------------- -// -inline TBool CESMREntryProcessor::ContainsProcessedEntry() const - { - return (TBool) iESMREntry; - } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/cesmrfsmailboxutils.h --- a/meetingrequest/mrentry/inc/cesmrfsmailboxutils.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/inc/cesmrfsmailboxutils.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,8 +20,8 @@ #include #include +#include "esmrdef.h" #include "cfsmailcommon.h" -#include "esmrdef.h" class CFSMailClient; class CFSMailMessage; @@ -34,7 +34,16 @@ */ NONSHARABLE_CLASS( CESMRFsMailboxUtils ): public CBase { - +public: + + /** + * Enumeration for mailbox capabilities + */ + enum TMRMailboxCapability + { + EMRCapabilityAttachment + }; + public: // Constructors and destructors /** @@ -43,13 +52,13 @@ * @param aMailboxUtils Reference to S60 mailbox utils * @return instantiated object, ownership transferred */ - static CESMRFsMailboxUtils* NewL( + IMPORT_C static CESMRFsMailboxUtils* NewL( CMRMailboxUtils& aMailboxUtils ); /** * C++ Destructor. */ - ~CESMRFsMailboxUtils(); + IMPORT_C ~CESMRFsMailboxUtils(); public: // New functions @@ -66,43 +75,43 @@ * @param aPrimaryBox primary mailbox for matching, if applicable * @return KErrNone or a system wide error code */ - TInt SetPhoneOwnerL( + IMPORT_C TInt SetPhoneOwnerL( CCalEntry& aCalEntry, TMsvId aPrimaryBox = KMsvNullIndexEntryId ); /** * If phone owner field hasn't been set so far, this method compares * mailboxowner's email address to organizer field and if no match - * was found compares each attendee to the mailboxowner's email address. - * If match was found, phone owner field is set, otherwise KErrNotFound + * was found compares each attendee to the mailboxowner's email address. + * If match was found, phone owner field is set, otherwise KErrNotFound * is returned. * * @param aCalEntry entry to modify * @param aPrimaryBox primary mailbox for matching, if applicable * @return KErrNone or a system wide error code */ - TInt SetPhoneOwnerL( + IMPORT_C TInt SetPhoneOwnerL( CCalEntry& aCalEntry, CFSMailClient& aMailClient, - CFSMailMessage& aMailMessage ); - + CFSMailMessage& aMailMessage ); + /** * Resolves the plugin to be used to current calendar entry. * Method retrieves phone owner from calendar entry and loops all - * FS Email mailboxes. + * FS Email mailboxes. * @param aEntry Reference to calendar entry. * @return Plugin ID for FS Email mailbox */ - TESMRMailPlugin FSEmailPluginForEntryL( const CCalEntry& aEntry ); + IMPORT_C TESMRMailPlugin FSEmailPluginForEntryL( + const CCalEntry& aEntry ); /** - * Resolves the mail box for current calendar entry. - * Method retrieves phone owner from calendar entry and loops all - * FS Email mailboxes. - * @param aEntry Reference to calendar entry. - * @return ID of the FS Email mailbox + * Tests if default mailbox supports certain capability. + * @param aCapability Capability to be tested + * @return ETrue if success, EFalse otherwise */ - TFSMailMsgId FSEmailMailBoxForEntryL( const CCalEntry& aEntry ); + IMPORT_C TBool DefaultMailboxSupportCapabilityL( + TMRMailboxCapability aCapability ); private: // Implementation CESMRFsMailboxUtils( @@ -116,9 +125,10 @@ const CCalUser& aUser, const RPointerArray& aMailBoxes, TInt& aMatchIndex ); - + CFSMailClient& MailClientL(); - + CFSMailBox* DefaultMailboxL(); + private: // Data /// Ref: Reference to S60 mailbox utilities CMRMailboxUtils& iMRMailboxUtils; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/cesmrmeetingrequestentry.h --- a/meetingrequest/mrentry/inc/cesmrmeetingrequestentry.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/inc/cesmrmeetingrequestentry.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -48,7 +48,7 @@ * @param aConflictsExists ETrue, if conflicts exists * @param aESMRInputParams ESMR input parameters structure */ - static CESMRMeetingRequestEntry* NewL( + IMPORT_C static CESMRMeetingRequestEntry* NewL( const CCalEntry& aEntry, CMRMailboxUtils& aMRMailboxUtils, MESMRCalDbMgr& aCalDb, @@ -58,7 +58,7 @@ /** * C++ destructor */ - ~CESMRMeetingRequestEntry(); + IMPORT_C ~CESMRMeetingRequestEntry(); public: // From MESMRMeetingRequestEntry TESMRCalEntryType Type() const; @@ -76,8 +76,8 @@ TESMRRecurrenceValue& aRecurrence, TTime& aUntil) const; TESMRRecurrenceModifyingRule RecurrenceModRule() const; - void SetModifyingRuleL( - TESMRRecurrenceModifyingRule aRule ); + void SetModifyingRuleL(TESMRRecurrenceModifyingRule aRule, + const TBool aTypeChanging = EFalse ); void SetAllDayEventL( TTime aStartDate, TTime aEndDate ); @@ -85,10 +85,14 @@ TBool IsStoredL() const; TBool IsSentL() const; TBool IsEntryEditedL() const; + TBool IsEntryTypeChangedL() const; void GetAlarmL( MESMRCalEntry::TESMRAlarmType& aAlarmType, TTime &aAlarmTime ); const CCalEntry& OriginalEntry(); + void UpdateEntryAfterStoringL(); + void SetDefaultValuesToEntryL(); + CCalEntry* CloneEntryLC( TESMRCalEntryType aType ) const; TESMRRole RoleL() const; TBool Conflicts() const; void MarkMeetingCancelledL(); @@ -119,7 +123,6 @@ TInt AttendeeCountL( TUint aFilterFlags ) const; CCalEntry* RemoveInstanceFromSeriesL(); - void SetDefaultValuesToEntryL(); TBool IsOpenedFromMail() const; void GetAddedAttendeesL( RArray& aAttendeeArray, @@ -127,14 +130,26 @@ void GetRemovedAttendeesL( RArray& aAttendeeArray, TUint aFilterFlags ) const; - void UpdateEntryAfterStoringL(); void UpdateChildEntriesSeqNumbersL(); TESMRMailPlugin CurrentPluginL(); - TFSMailMsgId CurrentMailBoxIdL(); void UpdateTimeStampL(); - TBool AnyInstanceOnDayL( + TBool AnyInstancesBetweenTimePeriodL( + TTime& aStart, + TTime& aEnd ); + void GetFirstInstanceStartAndEndTimeL( TTime& aStart, - TTime& aEnd ); + TTime& aEnd ); + const TDesC& CalendarOwnerAddressL() const; + CMRMailboxUtils& MailboxUtils() const; + void UpdateComparativeEntry( + CCalEntry* aNewComparativeEntry ); + MESMRCalDbMgr& GetDBMgr(); + TBool SupportsCapabilityL( + MESMRCalEntry::TMREntryCapability aCapability ) const; + TBool ContainsRemoteAttachmentsL(); + TBool SendCanellationAvailable(); + void SetSendCanellationAvailable (TBool aSendCanellation); + void SetTypeChanged( TBool aTypeChanged ); private: // Implementaton CESMRMeetingRequestEntry( @@ -145,14 +160,13 @@ void ConstructL( const CCalEntry& aEntry ); HBufC* ReplaceCharactersFromBufferLC( - const TDesC& aTarget, - const TDesC& aFindString, + const TDesC& aTarget, + const TDesC& aFindString, const TDesC& aReplacement ); private: // Data /// Own: Calendar entry CCalEntry* iEntry; - CCalEntry* iBackupEntry; /// Own: Forward calendar entry CCalEntry* iForwardEntry; /// Ref: Reference to mailbox utilities @@ -167,10 +181,16 @@ TESMRInputParams* iESMRInputParams; /// Own: Orginal entry CCalEntry* iOrginalEntry; - /// Ref: Entry received as parameter + /// Own: Entry received as parameter CCalEntry* iParameterEntry; /// Own: Current FS Email plug-in TESMRMailPlugin iCurrentFSEmailPlugin; + /// Flag for removing attachments + TBool iRemoveAttachments; + /// Flag for send canellation + TBool iSendCanellation; + // Own: Indicates if the entry is type changed or not + TBool iTypeChanged; }; #endif // CESMRMEETINGREQUESTENTRY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/cesmrmeetingrequestentry.inl --- a/meetingrequest/mrentry/inc/cesmrmeetingrequestentry.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR mr entry inline methods -* -*/ - - -// ----------------------------------------------------------------------------- -// CESMRCalEntry::Entry -// ----------------------------------------------------------------------------- -// -inline const CCalEntry& CESMRCalEntry::Entry() const - { - return *iEntry; - } - -// ----------------------------------------------------------------------------- -// CESMRCalEntry::Entry -// ----------------------------------------------------------------------------- -// -inline CCalEntry& CESMRCalEntry::Entry() - { - return *iEntry; - } - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/mesmrcalentry.h --- a/meetingrequest/mrentry/inc/mesmrcalentry.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/inc/mesmrcalentry.h Wed Mar 31 21:08:33 2010 +0300 @@ -25,7 +25,7 @@ class CCalEntry; class CCalInstance; - +class MESMRCalDbMgr; /** * MESMRMeetingRequestEntry provides utility functions for handling MR Entry. * @@ -39,13 +39,13 @@ */ enum TESMRCalEntryType { - EESMRCalEntryNotSupported = -1, // Entry type not supported - EESMRCalEntryMeetingRequest, // Meeting request entry - EESMRCalEntryMeeting, // Meeting entry - EESMRCalEntryTodo, // TO-DO entry - EESMRCalEntryMemo, // Memo entry - EESMRCalEntryReminder, // Reminder entry - EESMRCalEntryAnniversary // Anniversary entry + EESMRCalEntryNotSupported = EESMREventTypeNone, + EESMRCalEntryMeetingRequest = EESMREventTypeMeetingRequest, + EESMRCalEntryMeeting = EESMREventTypeAppt, + EESMRCalEntryTodo = EESMREventTypeETodo, + EESMRCalEntryMemo = EESMREventTypeEEvent, + EESMRCalEntryReminder = EESMREventTypeEReminder, + EESMRCalEntryAnniversary = EESMREventTypeEAnniv }; /** @@ -78,6 +78,15 @@ EESMRAlarmRelative }; + /** + * Enumeration for entry + */ + enum TMREntryCapability + { + // Entry supports attachments + EMRCapabilityAttachments + }; + public: // Destruction /** * Virtual destructor. @@ -165,10 +174,10 @@ /** * Sets modifying rule role to meeting request. * @param aRule Recurrence modification rule. + * @param aRule ETrue event type is changing. */ - virtual void SetModifyingRuleL( - TESMRRecurrenceModifyingRule aRule ) = 0; - + virtual void SetModifyingRuleL(TESMRRecurrenceModifyingRule aRule, + const TBool aTypeChanging = EFalse ) = 0; /** * Sets the entry priority. * @param aPriority entry priority. @@ -204,16 +213,45 @@ virtual TBool IsStoredL() const = 0; /** - * Tests if this entry has been sent to attendees. - * @return ETrue, if entry is sent to attendees - */ - virtual TBool IsSentL() const = 0; - - /** * Tests, whether entry is edited. * @return ETrue, if entry is edited. */ virtual TBool IsEntryEditedL() const = 0; + + /** + * Tests, if entry type has changed from the original + * @return ETrue, if entry type has changed + */ + virtual TBool IsEntryTypeChangedL() const = 0; + + /** + * Sets the entry type changed + * @param aTypeChanged, ETrue if type changed, otherwise EFalse + */ + virtual void SetTypeChanged( TBool aTypeChanged ) = 0; + + /** + * Checks if any instance (having same UID) + * occurs between specified time. Time information + * is considered to be device's local time. + * + * @param aStart Start time + * @param aEnd End time + */ + virtual TBool AnyInstancesBetweenTimePeriodL( + TTime& aStart, + TTime& aEnd ) = 0; + + /** + * Fetches first instances start and end time. For non-recurrent + * entries this returns the entry's start and end time. + * + * @param aStart On returns contains the first instance's start time. + * @param aEnd On returns contains the first instance's end time. + */ + virtual void GetFirstInstanceStartAndEndTimeL( + TTime& aStart, + TTime& aEnd ) = 0; /** * Fetches alarm information from entry. @@ -229,9 +267,74 @@ * @return CCalEntry original entry */ virtual const CCalEntry& OriginalEntry() = 0; + + /** + * Updates the entry after storing + */ + virtual void UpdateEntryAfterStoringL() = 0; + + /** + * Updates the comparative entry (needed in entry type changing) + */ + virtual void UpdateComparativeEntry( CCalEntry* aNewComparativeEntry ) = 0; + + /** + * Sets default values to entry. + */ + virtual void SetDefaultValuesToEntryL() = 0; + + /** + * Updates entry's timestamp (DTSTAMP) information. + */ + virtual void UpdateTimeStampL() = 0; + + /** + * Clones entry and leaves the clone into CleanupStack. + * + * @param aType the entry type of the clone. If EESMRCalEntryNotSupported + * the original type is preserved. + */ + virtual CCalEntry* CloneEntryLC( + TESMRCalEntryType aType = EESMRCalEntryNotSupported ) const = 0; + + /** + * Fetches validated entry. Ownership is transferred to caller. + * @return Pointer to validated entry. + */ + virtual CCalEntry* ValidateEntryL() = 0; + + /** + * For recurrent event method removes this from the series. + * Entry needs to be recurrent event and modification rule + * needs to be MESMRCalEntry::EESMRThisOnly. + * Ownership of the returned calendar entry is transferred to caller. + * + * @return Parent entry + */ + virtual CCalEntry* RemoveInstanceFromSeriesL() = 0; + + /** + * Get calendar dbmgr + * + * @return calendar dbmgr + */ + virtual MESMRCalDbMgr& GetDBMgr() = 0; + + /** + * Tests whether entry supports capability or not. + * @param aCapability Capability to be checked + * @return ETrue if capability is supported. + */ + virtual TBool SupportsCapabilityL( + TMREntryCapability aCapability ) const = 0; + + /** + * Tests whether entry contains remote attachments or not. + * @return ETrue if entry contains remote attachments + */ + virtual TBool ContainsRemoteAttachmentsL() = 0; }; - #endif // MESMRCALENTRY_H // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h --- a/meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,13 +19,15 @@ #ifndef MESMRMEETINGREQUESTENTRY_H #define MESMRMEETINGREQUESTENTRY_H -#include "cfsmailcommon.h" +// #include "mesmrcalentry.h" #include "esmrdef.h" +// class CCalAttendee; class MMRInfoObject; class TESMRInputParams; +class CMRMailboxUtils; /** * MESMRCalEntry provides utility functions for handling MR Entry. @@ -57,6 +59,11 @@ public: /** + * Tests whether entry is sent or not + */ + virtual TBool IsSentL() const = 0; + + /** * Fetches the phone owner's role in this calendar entry. * @return User role. * @see TESMRRole. @@ -163,12 +170,6 @@ TUint aFilterFlags ) const = 0; /** - * Fetches validated entry. Ownership is transferred to caller. - * @return Pointer to validated entry. - */ - virtual CCalEntry* ValidateEntryL() = 0; - - /** * Fetches the conflicting entries. Conflicting entries are added * to aEntryArray. * @param aEntryArray Array containing conflicting entries @@ -217,21 +218,6 @@ TUint aFilterFlags ) const = 0; /** - * For recurrent event method removes this from the series. - * Entry needs to be recurrent event and modification rule - * needs to be MESMRCalEntry::EESMRThisOnly. - * Ownership of the returned calendar entry is transferred to caller. - * - * @return Parent entry - */ - virtual CCalEntry* RemoveInstanceFromSeriesL() = 0; - - /** - * Sets default values to entry. - */ - virtual void SetDefaultValuesToEntryL() = 0; - - /** * Tests, if entry is opened from mail. * @return ETrue if entry is opened from mail. */ @@ -268,16 +254,11 @@ TUint aFilterFlags ) const = 0; /** - * Updates the entry after storing - */ - virtual void UpdateEntryAfterStoringL() = 0; - - /** * Updates child entries sequence numbers and stores them to * calendar DB. */ virtual void UpdateChildEntriesSeqNumbersL() = 0; - + /** * Resolves current plugin in use. * @return current plug-in in use. @@ -285,27 +266,47 @@ virtual TESMRMailPlugin CurrentPluginL() = 0; /** - * Resolves current message box Id. - * @return current message box Id. - */ - virtual TFSMailMsgId CurrentMailBoxIdL() = 0; - - /** - * Updates entry's timestamp (DTSTAMP) information. - */ - virtual void UpdateTimeStampL() = 0; - - /** * Checks if any instance (having same UID) * occurs between specified time. Time information * is considered to be device's local time. - * + * * @param aStart Start time * @param aEnd End time */ - virtual TBool AnyInstanceOnDayL( + virtual TBool AnyInstancesBetweenTimePeriodL( + TTime& aStart, + TTime& aEnd ) = 0; + + /** + * Fetches first instances start and end time. For non-recurrent + * entries this returns the entry's start and end time. + * + * @param aStart On returns contains the first instance's start time. + * @param aEnd On returns contains the first instance's end time. + */ + virtual void GetFirstInstanceStartAndEndTimeL( TTime& aStart, TTime& aEnd ) = 0; + + /** + * Fetches the calendar owner address. + * @return Calendar owner address + */ + virtual const TDesC& CalendarOwnerAddressL() const = 0; + + /** + * Gets the mailbox utils. + */ + virtual CMRMailboxUtils& MailboxUtils() const = 0; + + /** + * check whether can send canellation + */ + virtual TBool SendCanellationAvailable() = 0; + /** + * set the cannellation flag + */ + virtual void SetSendCanellationAvailable (TBool aSendCanellation) = 0; }; #endif // MESMREMEETINGREQUESTSENDER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/src/cesmrconflictchecker.cpp --- a/meetingrequest/mrentry/src/cesmrconflictchecker.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,430 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description : ESMR conflict checker implementation -* Version : %version: tr1sido#7 % -* -*/ - -#include "emailtrace.h" -#include "cesmrconflictchecker.h" -#include "cesmrcaldbmgr.h" -#include "esmrhelper.h" -#include "esmrentryhelper.h" -#include "esmrinternaluid.h" - -#include -#include -#include -#include -#include - -/// Unnamed namespace for local definitions -namespace { // codescanner::namespace - -// Definition for zero -const TInt KZero(0); - -/** Defines instace filter type */ -enum TInstanceFilter - { - EIncludeSameUID, - ERemoveSameUID - }; - -#ifdef _DEBUG - -// Literal for panic texts -_LIT( KESMRConflictCheckerTxt, "ESMRConflictChecker" ); - -/** Enumeration for panic codes */ -enum TESMRConflictCheckerPanic - { - // Input entry is not appointment - EESMRConflictCheckerInvalidEntryType - }; - -/** - * Thows system wide panic. - * @param aPanic Panic code. - */ -void Panic( TESMRConflictCheckerPanic aPanic ) - { - - User::Panic( KESMRConflictCheckerTxt, aPanic ); - } - -#else - -/** - * Thows system wide leave. - * @param aError Leave code. - */ -void Leave( TInt aError ) - { - - User::Leave( aError ); - } - -#endif - -/** - * Resolves time range for possible conflicting entries. Instance view - * is used for resolving the time range. - * - * @param aStart Start time - * @param aEnd End time - * @param aInstanceView Pointer to calendar db instance view - * @return Time range for possible conflicting entries - */ -CalCommon::TCalTimeRange ResolveFetchTimeRangeL( - TTime aStart, - TTime aEnd, - CCalInstanceView* aInstanceView ) - { - FUNC_LOG; - const CalCommon::TCalViewFilter instanceFilter = - CalCommon::EIncludeAppts; - - TDateTime start = aStart.DateTime(); - TDateTime end = aEnd.DateTime(); - - start.SetHour( KZero ); - start.SetMinute( KZero ); - start.SetSecond( KZero ); - start.SetMicroSecond( KZero ); - - end.SetHour( KZero ); - end.SetMinute( KZero ); - end.SetSecond( KZero ); - end.SetMicroSecond( KZero ); - TTime endTime = end; - - if ( TTime(start) == endTime || - endTime < aEnd ) - { - - endTime += TTimeIntervalDays(1); - end = endTime.DateTime(); - } - - TCalTime rangeStart; - rangeStart.SetTimeLocalL( start ); - - TCalTime instanceTime = aInstanceView->PreviousInstanceL( - instanceFilter, - rangeStart ); - - if ( Time::NullTTime() != instanceTime.TimeUtcL() ) - { - rangeStart = instanceTime; - } - - TCalTime rangeEnd; - rangeEnd.SetTimeLocalL( end ); - - instanceTime = aInstanceView->NextInstanceL( - instanceFilter, - rangeEnd ); - - if ( instanceTime.TimeLocalL() != Time::NullTTime() ) - { - rangeEnd = instanceTime; - } - - return CalCommon::TCalTimeRange( rangeStart, rangeEnd ); - } - -/** - * Removes and deletes the entries, which do not confilct with - * entry. Entry is considered to be conflicting entry if starts or - * ends between aEntry's start and end time. - * - * @param aEntries Reference to entries, which may conflict - * @param aEntry Reference to entry, which confilcts are resolved. - */ -void RemoveAndDeleteNonConflictingInstancesL( - RPointerArray& instanceArray, - // const CCalEntry& aEntry, - TCalTime aStartTime, - TCalTime aEndTime, - const TDesC8& aUid, - TInstanceFilter aFilterType ) - { - FUNC_LOG; - TInt index(0); - - TTime startTimeUtc = aStartTime.TimeUtcL(); - TTime endTimeUtc = aEndTime.TimeUtcL(); - - while( index < instanceArray.Count() ) - { - TBool conflictingInstance( ETrue ); - CCalInstance* instance = instanceArray[index]; - - TTime entryStartTimeUtc = instance->StartTimeL().TimeUtcL(); - TTime entryEndTimeUtc = instance->EndTimeL().TimeUtcL(); - - TPtrC8 uid( instance->Entry().UidL() ); - if ( ERemoveSameUID == aFilterType && - 0 == aUid.CompareF(uid) ) - { - conflictingInstance = EFalse; - } - else if ( entryStartTimeUtc >= startTimeUtc && - entryStartTimeUtc < endTimeUtc ) - { - // Entry starts during another entry - index++; - } - else if ( entryEndTimeUtc > startTimeUtc && - entryEndTimeUtc <= endTimeUtc ) - { - // Entry ends during another entry - index++; - } - else if ( entryStartTimeUtc > startTimeUtc && - entryEndTimeUtc < endTimeUtc ) - { - // Antry starts and ends during another entry - index++; - } - else if ( entryStartTimeUtc < startTimeUtc && - entryEndTimeUtc > endTimeUtc ) - { - // Antry starts and ends during another entry - index++; - } - else - { - conflictingInstance = EFalse; - } - - // Remove non-conflicting instance from instance array - if ( !conflictingInstance ) - { - instanceArray.Remove(index); - delete instance; - instance = NULL; - } - } - } - -/** - * Creates calendar entries from the conflicting instances - * and stores the created entries into entry array. - * Ownership of the created entries is transferred to caller. - * @param aInstanceArray Reference to instance array - * @param aConflictingEntries Reference to entry array. - */ -void CreateEntriesFromInstancesL( - RPointerArray& instanceArray, - RPointerArray& aConflictingEntries ) - { - FUNC_LOG; - TInt instanceCount( instanceArray.Count() ); - for ( TInt i(0); i < instanceCount; ++i ) - { - CCalEntry& parent( instanceArray[i]->Entry() ); - CCalEntry* entry = ESMRHelper::CopyEntryLC( parent, - parent.MethodL(), - ESMRHelper::ECopyFull ); - - entry->SetStartAndEndTimeL( instanceArray[i]->StartTimeL(), - instanceArray[i]->EndTimeL() ); - - User::LeaveIfError( aConflictingEntries.Append( entry ) ); - CleanupStack::Pop( entry ); - } - } - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRConflictChecker::CESMRConflictChecker -// --------------------------------------------------------------------------- -// -inline CESMRConflictChecker::CESMRConflictChecker( - MESMRCalDbMgr& aDbMgr ) : - iDbMgr( aDbMgr ) - { - FUNC_LOG; - // Not implementation yet - } - -// --------------------------------------------------------------------------- -// CESMRConflictChecker::~CESMRConflictChecker -// --------------------------------------------------------------------------- -// -CESMRConflictChecker::~CESMRConflictChecker() - { - FUNC_LOG; - // Not implementation yet - } - -// --------------------------------------------------------------------------- -// CESMRConflictChecker::NewL -// --------------------------------------------------------------------------- -// -CESMRConflictChecker* CESMRConflictChecker::NewL( - MESMRCalDbMgr& aDbMgr ) - { - FUNC_LOG; - CESMRConflictChecker* self = - new (ELeave) CESMRConflictChecker(aDbMgr); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRConflictChecker::FindConflictsL -// --------------------------------------------------------------------------- -// -void CESMRConflictChecker::FindConflictsL( - const CCalEntry& aEntry, - RPointerArray& aConflicts ) - { - FUNC_LOG; - - // Checking input parameters -#ifdef _DEBUG - - __ASSERT_DEBUG( - CCalEntry::EAppt == aEntry.EntryTypeL(), - Panic(EESMRConflictCheckerInvalidEntryType) ); - -#else - - if ( CCalEntry::EAppt != aEntry.EntryTypeL() ) - { - Leave( KErrArgument ); - } - -#endif - - CCalInstanceView* instanceView = iDbMgr.NormalDbInstanceView(); - - CalCommon::TCalTimeRange timeRange = - ResolveFetchTimeRangeL( - aEntry.StartTimeL().TimeUtcL(), - aEntry.EndTimeL().TimeUtcL(), - instanceView ); - - RCPointerArray instanceArray; - CleanupClosePushL( instanceArray ); - - instanceView->FindInstanceL( instanceArray, - CalCommon::EIncludeAppts, - timeRange ); - - RemoveAndDeleteNonConflictingInstancesL( - instanceArray, - aEntry.StartTimeL(), - aEntry.EndTimeL(), - aEntry.UidL(), - ERemoveSameUID ); - - CreateEntriesFromInstancesL( instanceArray, aConflicts ); - - CleanupStack::PopAndDestroy(); // instanceArray - - } - -// --------------------------------------------------------------------------- -// CESMRConflictChecker::FindInstancesForEntry -// --------------------------------------------------------------------------- -// -void CESMRConflictChecker::FindInstancesForEntryL( - TTime aStart, - TTime aEnd, - const CCalEntry& aEntry, - RPointerArray& aInstances ) - { - FUNC_LOG; - TDateTime startDt = aStart.DateTime(); - startDt.SetHour( KZero ); - startDt.SetMinute( KZero ); - startDt.SetSecond( KZero ); - - TDateTime endDt = aEnd.DateTime(); - endDt.SetHour( KMaxHoursInDay ); - endDt.SetMinute( KMaxMinutesInHour ); - endDt.SetSecond( KMaxSecondsInMinute ); - - aStart = startDt; - aEnd = endDt; - - CCalInstanceView* instanceView = iDbMgr.NormalDbInstanceView(); - - CalCommon::TCalTimeRange timeRange = - ResolveFetchTimeRangeL( - aStart, - aEnd, - instanceView ); - - RCPointerArray instanceArray; - CleanupClosePushL( instanceArray ); - - instanceView->FindInstanceL( instanceArray, - CalCommon::EIncludeAppts, - timeRange ); - - TInt i(0); - while( i < instanceArray.Count() ) - { - CCalInstance* instance = instanceArray[i]; - CCalEntry& instanceEntry( instance->Entry() ); - - TBool sameUid( - 0 == instanceEntry.UidL().CompareF( aEntry.UidL() ) ); - - TBool thisInstance( - instance->StartTimeL().TimeLocalL() == - aEntry.StartTimeL().TimeLocalL() && - instance->EndTimeL().TimeLocalL() == - aEntry.EndTimeL().TimeLocalL() ); - - if ( !sameUid || thisInstance ) - { - // This is either same entry as aEntry or then - // this entry does not belong to this series - delete instance; - instanceArray.Remove( i ); - } - else - { - ++i; - } - } - - TCalTime start; - start.SetTimeUtcL( aStart ); - - TCalTime end; - end.SetTimeUtcL( aEnd ); - - RemoveAndDeleteNonConflictingInstancesL( - instanceArray, - start, - end, - aEntry.UidL(), - EIncludeSameUID ); - - CreateEntriesFromInstancesL( instanceArray, aInstances ); - - CleanupStack::PopAndDestroy(); // instanceArray - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/src/cesmrentryprocessor.cpp --- a/meetingrequest/mrentry/src/cesmrentryprocessor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,955 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description : ESMR entry processor implementation -* Version : %version: e003sa40#13 % -* -*/ - - -// INCLUDE FILES -#include "emailtrace.h" -#include "cesmrentryprocessor.h" -#include "cesmrcaldbmgr.h" -#include "cesmrmeetingrequestentry.h" -#include "cesmrconflictchecker.h" -#include "esmrhelper.h" -#include "esmrinternaluid.h" -#include "cesmrfsmailboxutils.h" - -// -#include "esmrdef.h" -// -#include -#include -#include -#include -#include -#include -#include -#include -#include -// -#include "FreestyleEmailUiConstants.h" -#include "cesmrrecurrenceinfohandler.h" -// -#include "esmrentryhelper.h" -#include "tesmrinputparams.h" - -/// Unnamed namespace for local definitions -namespace { - -// Definition for first item index -const TInt KFirstEntryIndex = 0; - -// Definition for zero interval -const TInt KZeroInterval = 0; - -#ifdef _DEBUG - -// Definition for module panic text -_LIT( KESMRProcessorPanicTxt, "ESMREntryProcessor" ); - -/** - * ESMREntryProcessor panic codes - */ -enum TESMREntryProcessorPanic - { - // Input entry array is empty - EESMRProcessorEmptyEntryArray = 1, - // Too many input entries - EESMRProcessorTooManyEntries = 2, - // entries are not processed - EESMRProcessorEntriesNotProcessed, - // View mode for policy resolving - // cannot be check. - EESMRProcessorCannotCheckViewMode, - }; - -/** - * Raises panic. - * @param aPanic Panic code - */ -void Panic(TESMREntryProcessorPanic aPanic) - { - - User::Panic( KESMRProcessorPanicTxt(), - aPanic); - } - -/** - * Logs scenatio data - * @param aData Reference to scenario data. - */ -void LogScenatioData( - const TESMRScenarioData& /*aScenarioData*/ ) - { - - - - - } - -#endif // _DEBUG - -/** - * Cleanup operation for RPointerArray. - * - * @param aArray Pointer to RPointerArray. - */ -void CalEntryPointerArrayCleanup( TAny* aArray ) - { - RPointerArray* entryArray = - static_cast*>( aArray ); - - entryArray->ResetAndDestroy(); - entryArray->Close(); - } - -/** - * Sets child entry's start and end time. - * - * @param aChild Reference to child entry - * @param aParent Reference to parent entry - * @param aChildEnd Child entry's start time - */ -void SetInstanceStartAndEndL( - CCalEntry& aChild, - const CCalEntry& aParent, - const TCalTime& aChildStart ) - { - TTime parentStart( aParent.StartTimeL().TimeUtcL() ); - TTime parentEnd( aParent.EndTimeL().TimeUtcL() ); - TTime childStart( aChildStart.TimeUtcL() ); - const TTime KNullTime( Time::NullTTime() ); - - if ( KNullTime == parentStart || - KNullTime == parentEnd || - KNullTime == childStart ) - { - // Invalid time --> Leaving - User::Leave( KErrArgument ); - } - - TTimeIntervalMicroSeconds duration( KZeroInterval ); - duration = parentEnd.MicroSecondsFrom( parentStart ); - TCalTime childEnd; - childEnd.SetTimeUtcL( childStart + duration ); - - aChild.SetStartAndEndTimeL( aChildStart, childEnd ); - } - -void CheckRepeatUntilValidityL( - CCalEntry& aEntry, - const TCalTime& aInstanceTime ) - { - - if ( ESMREntryHelper::IsRepeatingMeetingL(aEntry) && - !ESMREntryHelper::IsModifyingEntryL(aEntry) ) - { - TCalRRule originalRRule; - if ( aEntry.GetRRuleL( originalRRule ) ) - { - TCalTime endTime = aEntry.EndTimeL(); - TCalTime startTime = aEntry.StartTimeL(); - - TTimeIntervalMicroSeconds duration = - endTime.TimeLocalL().MicroSecondsFrom( - startTime.TimeLocalL() ); - - TTime instanceEndTime( aInstanceTime.TimeLocalL() ); - instanceEndTime += duration; - TCalTime repeatUntilTime = originalRRule.Until(); - - TDateTime repeat = repeatUntilTime.TimeLocalL().DateTime(); - TDateTime instanceEndDatetime = instanceEndTime.DateTime(); - - if ( repeatUntilTime.TimeLocalL() < instanceEndTime ) - { - // reset the recurrence so, that the repeat until - // time is included in repeat range. This is done, - // because when setting the instance start and end - // time, the CCalEntry implementation clears the - // recurrence information if the end time is - // after repeat until end time. - // CCalEntry forces the repeat until time to be - // same than last entry's start time when storing the - // entry to db. Reason uknown. - TCalRRule rRule; - rRule.SetDtStart( originalRRule.DtStart() ); - rRule.SetType( originalRRule.Type() ); - - TCalTime newUntil; - newUntil.SetTimeLocalL( instanceEndTime ); - rRule.SetUntil( newUntil ); - rRule.SetInterval( originalRRule.Interval() ); - aEntry.SetRRuleL( rRule ); - } - } - } - } - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::CESMREntryProcessor -// --------------------------------------------------------------------------- -// -inline CESMREntryProcessor::CESMREntryProcessor( - CMRMailboxUtils& aMRMailboxUtils, - MESMRCalDbMgr& aDbMgr ) -: iMRMailboxUtils( aMRMailboxUtils ), - iDbMgr( aDbMgr ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::~CESMREntryProcessor -// --------------------------------------------------------------------------- -// -EXPORT_C CESMREntryProcessor::~CESMREntryProcessor() - { - FUNC_LOG; - delete iESMREntry; - delete iMbUtils; - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ConstructL -// --------------------------------------------------------------------------- -// -void CESMREntryProcessor::ConstructL() - { - FUNC_LOG; - iMbUtils = - CESMRFsMailboxUtils::NewL( iMRMailboxUtils ); - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMREntryProcessor* CESMREntryProcessor::NewL( - CMRMailboxUtils& aMRMailboxUtils, - MESMRCalDbMgr& aDbMgr ) - { - FUNC_LOG; - - CESMREntryProcessor* self = - new (ELeave) CESMREntryProcessor( - aMRMailboxUtils, aDbMgr ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - - return self; - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ExtensionUid -// --------------------------------------------------------------------------- -// -EXPORT_C TUid CESMREntryProcessor::ExtensionUid() - { - FUNC_LOG; - return TUid::Uid( KESMRMREntryProcessorUid ); - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ProcessL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::ProcessL( - const MAgnEntryUi::TAgnEntryUiInParams* aParams, - RPointerArray* aEntries ) - { - FUNC_LOG; - - iParams = aParams; - ProcessL( aEntries ); - CheckViewModeL(); - - if ( !IsDataOk() ) - { - // Data is not ok --> Leave - User::Leave( KErrArgument ); - } - - // Check mail parameters - if ( iParams ) - { - CCalEntry* entry = &iESMREntry->Entry(); - if(entry) - { - TBool recurrent(EFalse); - recurrent = iESMREntry->IsRecurrentEventL(); - - if(recurrent) - { - if ( !ESMREntryHelper::IsModifyingEntryL(*entry) ) - { - iESMREntry->SetModifyingRuleL( MESMRMeetingRequestEntry::EESMRAllInSeries ); - - SetPhoneOwnerToOwnEntryL(); - } - } - } - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ProcessL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::ProcessL( - RPointerArray* aEntries ) - { - FUNC_LOG; - - __ASSERT_DEBUG( aEntries->Count() > 0, - Panic( EESMRProcessorEmptyEntryArray ) ); - - iMREntries = aEntries; - - // Set initial values to scenario data - iScenData.iRole = EESMRRoleUndef; - iScenData.iViewMode = EESMRViewUndef; - iScenData.iCallingApp = EESMRAppUndef; - - SetPhoneOwnerL(); - CreateESMREntryL(); - CheckOrganizerL(); - - iESMREntry->SetModifyingRuleL( - MESMRMeetingRequestEntry::EESMRThisOnly ); - - if ( iParams && MAgnEntryUi::ECreateNewEntry == iParams->iEditorMode ) - { - iESMREntry->SetDefaultValuesToEntryL(); - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ProcessL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::ProcessL( - CCalInstance& aInstance ) - { - FUNC_LOG; - - RPointerArray entries; - CleanupStack::PushL( - TCleanupItem( - CalEntryPointerArrayCleanup, - &entries ) ); - - // Fetches parent entry. We need to construct entry with - // correct time. - CCalEntry &entry = aInstance.Entry(); - CCalEntry* instanceEntry = ESMRHelper::CopyEntryL( - entry, - entry.MethodL(), - ESMRHelper::ECopyFull ); - - entries.Append(instanceEntry); - - // Setting start and end time for child entry - CheckRepeatUntilValidityL( - *instanceEntry, - aInstance.StartTimeL() ); - - SetInstanceStartAndEndL( - *instanceEntry, - entry, - aInstance.StartTimeL() ); - - // Filling child with correct data - // This can be replaced withCCalenInterimUtils2::PopulateChildFromParentL - // after its memory leak has been fixed. - ESMRHelper::PopulateChildFromParentL( - *instanceEntry, - entry ); - - ProcessL( &entries ); - - if ( !iESMREntry ) - { - User::Leave( KErrArgument ); - } - - // Mark only this entry to be affected. - iESMREntry->SetModifyingRuleL( - MESMRMeetingRequestEntry::EESMRThisOnly ); - - CleanupStack::PopAndDestroy( &entries ); - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SwitchToForwardL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::SwitchToForwardL() - { - FUNC_LOG; - - if ( !iESMREntry ) - { - // No entries has been processed yet. - User::Leave( KErrNotReady ); - } - - iESMREntry->SwitchToForwardL(); - - // Rest of the scenario data remains as it is - iScenData.iViewMode = EESMRForwardMR; - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SwitchToViewL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::SwitchToEditL() - { - FUNC_LOG; - - if ( !iESMREntry ) - { - // No entries has been processed yet. - User::Leave( KErrNotReady ); - } - - iESMREntry->SwitchToOrginalL(); - - // Rest of the scenario data remains as it is - iScenData.iViewMode = EESMREditMR; - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SwitchToViewL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::SwitchToViewL() - { - FUNC_LOG; - - if ( !iESMREntry ) - { - // No entries has been processed yet. - User::Leave( KErrNotReady ); - } - - iESMREntry->SwitchToOrginalL(); - - // Rest of the scenario data remains as it is - iScenData.iViewMode = EESMRViewMR; - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SwitchToTrackL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::SwitchToTrackL() - { - FUNC_LOG; - - if ( !iESMREntry ) - { - // No entries has been processed yet. - User::Leave( KErrNotReady ); - } - - iESMREntry->SwitchToOrginalL(); - - // Rest of the scenario data remains as it is - iScenData.iViewMode = EESMRTrackingViewMR; - iScenData.iRole = EESMRRoleOrganizer; - iScenData.iEntryType = EESMREventTypeAppt; - - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ESMREntryL -// --------------------------------------------------------------------------- -// -EXPORT_C MESMRMeetingRequestEntry& CESMREntryProcessor::ESMREntryL() - { - FUNC_LOG; - CreateESMREntryL(); - return *iESMREntry; - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ResetL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::ResetL() - { - FUNC_LOG; - - iScenData.iRole = EESMRRoleUndef; - iScenData.iViewMode = EESMRViewUndef; - iScenData.iCallingApp = EESMRAppUndef; - - delete iESMREntry; - iESMREntry = NULL; - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::ProcessOutputParametersL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMREntryProcessor::ProcessOutputParametersL( - MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, - TESMRCommand aCommand ) - { - FUNC_LOG; - - __ASSERT_DEBUG( iESMREntry, Panic(EESMRProcessorEntriesNotProcessed) ); - - if ( !iParams || - EESMRForwardMR == iScenData.iViewMode || - EESMRViewUndef == iScenData.iViewMode ) - { - // No input parameters supplied --> Output parameters cannot be set - return; - } - - TBool handlingInstanceOnly( - iESMREntry->IsRecurrentEventL() && - MESMRCalEntry::EESMRThisOnly == iESMREntry->RecurrenceModRule() ); - - switch ( aCommand ) - { - case EESMRCmdSendMR: - case EESMRCmdSendMRUpdate: - case EESMRCmdSaveMR: - case EESMRCmdAcceptMR: - case EESMRCmdTentativeMR: - { - aOutParams.iAction = MAgnEntryUi::EMeetingSaved; - if ( handlingInstanceOnly ) - { - aOutParams.iAction = MAgnEntryUi::EInstanceRescheduled; - } - } - break; - - case EESMRCmdDeclineMR: - case EESMRCmdDeleteMR: - { - aOutParams.iAction = MAgnEntryUi::EMeetingDeleted; - if ( handlingInstanceOnly ) - { - aOutParams.iAction = MAgnEntryUi::EInstanceDeleted; - } - } - break; - - default: - { - aOutParams.iAction = MAgnEntryUi::ENoAction; - } - break; - } - - if ( handlingInstanceOnly ) - { - aOutParams.iNewInstanceDate = - iESMREntry->Entry().StartTimeL(); - } - else if ( MAgnEntryUi::ENoAction != aOutParams.iAction ) - { - // Copy entry details to input entry - CCalEntry& baseEntry = *((*iMREntries)[KFirstEntryIndex]); - baseEntry.CopyFromL( iESMREntry->Entry() ); - - TCalTime instanceTime = iESMREntry->Entry().StartTimeL(); - - if ( MESMRCalEntry::EESMRAllInSeries == iESMREntry->RecurrenceModRule() ) - { - // For recurrent event there might be exceptions - // and therefore the first possible start time - // is set to putput params - TCalTime end; - CESMRRecurrenceInfoHandler* recurrenceHandler = - CESMRRecurrenceInfoHandler::NewLC( iESMREntry->Entry() ); - - recurrenceHandler->GetFirstInstanceTimeL( - instanceTime, - end ); - - CleanupStack::PopAndDestroy( recurrenceHandler ); - recurrenceHandler = NULL; - aOutParams.iNewInstanceDate = instanceTime; - } - else - { - aOutParams.iNewInstanceDate.SetTimeLocalL( - iESMREntry->Entry().StartTimeL().TimeLocalL() ); - } - } - else - { - aOutParams.iNewInstanceDate.SetTimeLocalL( Time::NullTTime() ); - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SetPhoneOwnerL -// --------------------------------------------------------------------------- -// -void CESMREntryProcessor::SetPhoneOwnerL() - { - FUNC_LOG; - - TInt count( iMREntries->Count() ); - for ( TInt i( 0 ); i < count; ++i ) - { - // Set phone owner for all entries - CCalEntry& entry = *( (*iMREntries)[i] ); - - TESMRInputParams* inputParams = NULL; - if ( iParams ) - { - inputParams = (TESMRInputParams*)(iParams->iSpare); - } - - TInt err(KErrNone); - if ( inputParams && - inputParams->iMailClient && - inputParams->iMailMessage ) - { - err = iMbUtils->SetPhoneOwnerL( - entry, - *(inputParams->iMailClient), - *(inputParams->iMailMessage) ); - } - else if ( iParams ) - { - err = iMbUtils->SetPhoneOwnerL( - entry, - iParams->iMailBoxId ); - } - else - { - err = iMbUtils->SetPhoneOwnerL( entry ); - } - - if ( KErrNone != err ) - { - User::Leave( KErrArgument ); - } - } - - // set iOwnerRole, use entry at index zero: - CCalEntry& baseEntry = *( (*iMREntries)[KFirstEntryIndex] ); - if ( iMRMailboxUtils.IsOrganizerL( baseEntry ) ) - { - iScenData.iRole = EESMRRoleOrganizer; - } - else - { - // We are not organizer. Let's see if we are in attendee list - // or not. - CCalAttendee* thisAttendee = - iMRMailboxUtils.ThisAttendeeL( baseEntry ); - if ( thisAttendee ) - { - switch ( thisAttendee->RoleL() ) - { - case CCalAttendee::EOptParticipant: - { - iScenData.iRole = EESMRRoleOptionalAttendee; - break; - } - case CCalAttendee::ENonParticipant: - { - iScenData.iRole = EESMRRoleNonParticipant; - break; - } - case CCalAttendee::EReqParticipant: // fall through - case CCalAttendee::EChair: // fall through - default: - { // Note: chair MUST NOT be interpreted as organizer - // Req.participant is not correct either but has less - // side effects. - iScenData.iRole = EESMRRoleRequiredAttendee; - break; - } - } - } - else - { - // Phone owner cannot be set --> Leave - User::Leave( KErrCorrupt ); - } - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::CheckViewModeL -// --------------------------------------------------------------------------- -// -void CESMREntryProcessor::CheckViewModeL() - { - FUNC_LOG; - - // View mode cannot be checked - __ASSERT_DEBUG( - iESMREntry, - Panic(EESMRProcessorCannotCheckViewMode) ); - - TInt32 callingAppUid = iParams->iCallingApp.iUid; - switch ( callingAppUid ) - { - case KUidCalendarApplication: - { - iScenData.iCallingApp = EESMRAppCalendar; - iScenData.iViewMode = EESMRViewMR; - if ( MAgnEntryUi::EViewEntry == iParams->iEditorMode ) - { - if ( iESMREntry->IsAllDayEventL() ) - { - iScenData.iViewMode = EESMRViewAllDayMR; - } - } - else - { - iScenData.iViewMode = EESMREditMR; - } - break; - } - case KUidMceMailApplication: - case KUidEsMailApplication: - case KUidBVAApplication: - { - iScenData.iCallingApp = EESMRAppESEmail; - iScenData.iViewMode = EESMRViewMR; - - if ( iESMREntry->IsAllDayEventL() ) - { - iScenData.iViewMode = EESMRViewAllDayMR; - } - break; - } - default: - { - //error situation, should never come here - // Setting data to undef --> will leave later on. - iScenData.iViewMode = EESMRViewUndef; - break; - } - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SetPhoneOwnerL -// --------------------------------------------------------------------------- -// -TBool CESMREntryProcessor::IsDataOk() const - { - FUNC_LOG; - -#ifdef _DEBUG - LogScenatioData( iScenData ); -#endif - - TBool retVal(ETrue); - - // Check that all values has been set and there is no - // undefined values. Policies cannot be resolved, if - // scenario data is undefined. - if ( EESMRRoleUndef == iScenData.iRole || - EESMRViewUndef == iScenData.iViewMode || - EESMRAppUndef == iScenData.iCallingApp ) - { - retVal = EFalse; - } - - - - return retVal; - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::CreateESMREntryL -// --------------------------------------------------------------------------- -// -void CESMREntryProcessor::CreateESMREntryL() - { - FUNC_LOG; - - __ASSERT_DEBUG( iMREntries, Panic(EESMRProcessorEntriesNotProcessed) ); - - if ( !iESMREntry ) - { - // ES MR Entry is created - CCalEntry& base = *((*iMREntries)[KFirstEntryIndex]); - HBufC* description = NULL; - TRAPD( err, description = base.DescriptionL().AllocL() ); - CleanupStack::PushL( description ); - if ( KErrNone != err ) - { - User::Leave( KErrCorrupt ); - } - CleanupStack::PopAndDestroy( description ); - description = NULL; - - CCalEntry* entry = - ESMRHelper::CopyEntryLC( - base, - base.MethodL(), - ESMRHelper::ECopyFull ); - - CESMRConflictChecker* conflictChecker = - CESMRConflictChecker::NewL(iDbMgr); - CleanupStack::PushL( conflictChecker ); - - RPointerArray conflicts; - CleanupStack::PushL( - TCleanupItem( - CalEntryPointerArrayCleanup, - &conflicts ) ); - - conflictChecker->FindConflictsL( *entry, conflicts ); - TBool conflictsExists( conflicts.Count() ); - - if ( iParams && - KUidCalendarApplication == iParams->iCallingApp.iUid ) - { - // Setting start and end time for child entry - CheckRepeatUntilValidityL( - *entry, - iParams->iInstanceDate ); - - SetInstanceStartAndEndL( - *entry, - base, - iParams->iInstanceDate ); - } - - TESMRInputParams* inputParams = NULL; - if ( iParams ) - { - inputParams = (TESMRInputParams*)(iParams->iSpare); - } - - iESMREntry = - CESMRMeetingRequestEntry::NewL( - *entry, - iMRMailboxUtils, - iDbMgr, - conflictsExists, - inputParams ); - - CleanupStack::PopAndDestroy(); // conflicts - CleanupStack::PopAndDestroy( conflictChecker ); - CleanupStack::PopAndDestroy( entry ); - - SetPhoneOwnerToOwnEntryL(); - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::CheckOrganizerL -// --------------------------------------------------------------------------- -// -void CESMREntryProcessor::CheckOrganizerL() - { - FUNC_LOG; - - __ASSERT_DEBUG( iMREntries, Panic(EESMRProcessorEntriesNotProcessed) ); - - if ( EESMRRoleOrganizer == iScenData.iRole ) - { - CCalEntry& entry = *((*iMREntries)[KFirstEntryIndex]); - - CCalUser *phoneOwner = entry.PhoneOwnerL(); - - if ( !phoneOwner ) - { - User::Leave( KErrCorrupt ); - } - - CCalUser* organizer = ESMRHelper::CopyUserLC( *phoneOwner ); - - // Ownership is transferred - entry.SetOrganizerL( organizer ); - CleanupStack::Pop( organizer ); - } - - } - -// --------------------------------------------------------------------------- -// CESMREntryProcessor::SetPhoneOwnerToOwnEntryL -// --------------------------------------------------------------------------- -// -void CESMREntryProcessor::SetPhoneOwnerToOwnEntryL() - { - FUNC_LOG; - - // Phone owner cannot be checked - __ASSERT_DEBUG( - iESMREntry, - Panic(EESMRProcessorEntriesNotProcessed) ); - - TESMRInputParams* inputParams = NULL; - if ( iParams ) - { - inputParams = (TESMRInputParams*)(iParams->iSpare); - } - - TInt err(KErrNone); - if ( inputParams && - inputParams->iMailClient && - inputParams->iMailMessage ) - { - err = iMbUtils->SetPhoneOwnerL( - iESMREntry->Entry(), - *(inputParams->iMailClient), - *(inputParams->iMailMessage) ); - } - else if ( iParams ) - { - err = iMbUtils->SetPhoneOwnerL( - iESMREntry->Entry(), - iParams->iMailBoxId ); - } - else - { - err = iMbUtils->SetPhoneOwnerL( iESMREntry->Entry() ); - } - - User::LeaveIfError( err ); - - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp --- a/meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,9 +22,12 @@ #include "esmrinternaluid.h" #include -#include "cfsmailclient.h" -#include "cfsmailbox.h" +// +#include "CFSMailClient.h" +#include "CFSMailBox.h" +// #include +#include // Unnamed namespace for local definitions namespace { @@ -32,20 +35,6 @@ // Definition for email address comparison const TInt KEqualEmailAddress( 0 ); -// --------------------------------------------------------------------------- -// Cleanup operation for RPointerArray. -// @param aArray Pointer to RPointerArray. -// --------------------------------------------------------------------------- -// -void MailboxPointerArrayCleanup( TAny* aArray ) - { - RPointerArray* entryArray = - static_cast*>( aArray ); - - entryArray->ResetAndDestroy(); - entryArray->Close(); - } - /** * Listes all FS mailboxes. On return aMailboxes contains FS mailboxes * @param aMailClient FS mail client @@ -79,7 +68,7 @@ // CESMRFsMailboxUtils::~CESMRFsMailboxUtils // --------------------------------------------------------------------------- // -CESMRFsMailboxUtils::~CESMRFsMailboxUtils() +EXPORT_C CESMRFsMailboxUtils::~CESMRFsMailboxUtils() { FUNC_LOG; if ( iMailClient ) @@ -92,7 +81,7 @@ // CESMRFsMailboxUtils::NewL // --------------------------------------------------------------------------- // -CESMRFsMailboxUtils* CESMRFsMailboxUtils::NewL( +EXPORT_C CESMRFsMailboxUtils* CESMRFsMailboxUtils::NewL( CMRMailboxUtils& aMailboxUtils ) { FUNC_LOG; @@ -118,7 +107,7 @@ // CESMRFsMailboxUtils::SetPhoneOwnerL // --------------------------------------------------------------------------- // -TInt CESMRFsMailboxUtils::SetPhoneOwnerL( +EXPORT_C TInt CESMRFsMailboxUtils::SetPhoneOwnerL( CCalEntry& aCalEntry, TMsvId aPrimaryBox ) { @@ -130,11 +119,8 @@ { // Check if phone owner can be set using FS mailboxes // Loop throug all mailboxes in this plug-in - RPointerArray mailboxes; - CleanupStack::PushL( - TCleanupItem( - MailboxPointerArrayCleanup, - &mailboxes ) ); + RCPointerArray mailboxes; + CleanupClosePushL( mailboxes ); ListMailBoxesL( MailClientL(), @@ -148,6 +134,7 @@ aCalEntry.SetPhoneOwnerL( phoneOwner ); err = KErrNone; } + CleanupStack::PopAndDestroy( &mailboxes ); } return err; @@ -157,14 +144,14 @@ // CESMRFsMailboxUtils::SetPhoneOwnerL // ---------------------------------------------------------------------------- // -TInt CESMRFsMailboxUtils::SetPhoneOwnerL( +EXPORT_C TInt CESMRFsMailboxUtils::SetPhoneOwnerL( CCalEntry& aCalEntry, CFSMailClient& aMailClient, CFSMailMessage& aMailMessage ) { FUNC_LOG; TInt err( KErrNotFound ); - + TFSMailMsgId mailboxId( aMailMessage.GetMailBoxId() ); CFSMailBox* mailbox = aMailClient.GetMailBoxByUidL( mailboxId ); @@ -172,16 +159,16 @@ { return KErrNotFound; } - + CleanupStack::PushL( mailbox ); TPtrC mailboxOwnerAddName( mailbox->OwnMailAddress().GetEmailAddress() ); - + CCalUser* po = NULL; CCalUser* organizer = aCalEntry.OrganizerL(); - if ( organizer && + if ( organizer && KEqualEmailAddress == organizer->Address().CompareF(mailboxOwnerAddName) ) { po = organizer; @@ -200,16 +187,16 @@ po = attendee; } } - } - + } + if ( po ) { aCalEntry.SetPhoneOwnerL( po ); err = KErrNone; } - + CleanupStack::PopAndDestroy( mailbox ); - + return err; } @@ -217,39 +204,36 @@ // CESMRFsMailboxUtils::FSEmailPluginForEntryL // ---------------------------------------------------------------------------- // -TESMRMailPlugin CESMRFsMailboxUtils::FSEmailPluginForEntryL( +EXPORT_C TESMRMailPlugin CESMRFsMailboxUtils::FSEmailPluginForEntryL( const CCalEntry& aEntry ) { FUNC_LOG; - RPointerArray mailboxes; - CleanupStack::PushL( - TCleanupItem( - MailboxPointerArrayCleanup, - &mailboxes ) ); + RCPointerArray mailboxes; + CleanupClosePushL( mailboxes ); ListMailBoxesL( MailClientL(), - mailboxes ); - + mailboxes ); + CCalUser* phoneOwner = aEntry.PhoneOwnerL(); TPtrC poMailAddress( phoneOwner->Address() ); - + CFSMailBox* fsEmailMailbox = NULL; TInt mailboxCount( mailboxes.Count() ); for (TInt j(0); j < mailboxCount && !fsEmailMailbox; ++j ) - { + { TPtrC mailboxOwnerAddName( mailboxes[j]->OwnMailAddress().GetEmailAddress() ); - + if ( KEqualEmailAddress == mailboxOwnerAddName.CompareF(poMailAddress) ) { // Correct mailbox is found fsEmailMailbox = mailboxes[j]; } - } - + } + TESMRMailPlugin plugin( EESMRUnknownPlugin ); - + if ( fsEmailMailbox ) { // Mailbox was found --> We need to resolve mailboxes plug-in @@ -268,54 +252,41 @@ TUid::Uid( KFSEmailImap4 ) == pluginId ) { plugin = EESMRImapPop; - } + } } - - CleanupStack::PopAndDestroy( &mailboxes ); + + CleanupStack::PopAndDestroy( &mailboxes ); return plugin; } // ---------------------------------------------------------------------------- -// CESMRFsMailboxUtils::FSEmailMailBoxForEntryL +// CESMRFsMailboxUtils::DefaultMailboxSupportCapabilityL // ---------------------------------------------------------------------------- // -TFSMailMsgId CESMRFsMailboxUtils::FSEmailMailBoxForEntryL( - const CCalEntry& aEntry ) +EXPORT_C TBool CESMRFsMailboxUtils::DefaultMailboxSupportCapabilityL( + CESMRFsMailboxUtils::TMRMailboxCapability aCapability ) { FUNC_LOG; - RPointerArray mailboxes; - CleanupStack::PushL( - TCleanupItem( MailboxPointerArrayCleanup, &mailboxes ) ); - - ListMailBoxesL( MailClientL(), mailboxes ); - CCalUser* phoneOwner = aEntry.PhoneOwnerL(); - TPtrC poMailAddress( phoneOwner->Address() ); + TBool retValue( EFalse ); + + CFSMailBox* defaultMailbox = DefaultMailboxL(); + CleanupStack::PushL( defaultMailbox ); + ASSERT( defaultMailbox ); - CFSMailBox* fsEmailMailbox = NULL; - TInt mailboxCount( mailboxes.Count() ); - for (TInt j(0); j < mailboxCount && !fsEmailMailbox; ++j ) - { - TPtrC mailboxOwnerAddName( - mailboxes[j]->OwnMailAddress().GetEmailAddress() ); - - if ( KEqualEmailAddress == - mailboxOwnerAddName.CompareF( poMailAddress ) ) + switch ( aCapability ) + { + case CESMRFsMailboxUtils::EMRCapabilityAttachment: { - // Correct mailbox is found - fsEmailMailbox = mailboxes[j]; + retValue = defaultMailbox->HasCapability( + EFSMboxCapaSupportsAttahmentsInMR ); } + break; } - TFSMailMsgId retVal; // default ctor constructs a null id. + CleanupStack::PopAndDestroy( defaultMailbox ); - if ( fsEmailMailbox ) - { - retVal = fsEmailMailbox->GetId(); - } - - CleanupStack::PopAndDestroy( &mailboxes ); - return retVal; + return retValue; } // ---------------------------------------------------------------------------- @@ -398,5 +369,46 @@ return *iMailClient; } +// ---------------------------------------------------------------------------- +// CESMRFsMailboxUtils::DefaultMailboxL +// ---------------------------------------------------------------------------- +// +CFSMailBox* CESMRFsMailboxUtils::DefaultMailboxL() + { + FUNC_LOG; + + CFSMailBox* defaultMailbox( NULL ); + + CMRMailboxUtils::TMailboxInfo mailboxInfo; + TInt err = iMRMailboxUtils.GetDefaultMRMailBoxL( mailboxInfo ); + + if ( KErrNone == err ) + { + RCPointerArray mailboxes; + CleanupClosePushL( mailboxes ); + + ListMailBoxesL( MailClientL(), mailboxes ); + + TInt mailboxCount( mailboxes.Count() ); + for (TInt j(0); j < mailboxCount && !defaultMailbox; ++j ) + { + TPtrC mailboxOwnerAddName( + mailboxes[j]->OwnMailAddress().GetEmailAddress() ); + + if ( KEqualEmailAddress == + mailboxOwnerAddName.CompareF( mailboxInfo.iEmailAddress) ) + { + // Default mailbox is found + defaultMailbox = mailboxes[j]; + mailboxes.Remove( j ); + } + } + + CleanupStack::PopAndDestroy( &mailboxes ); + } + + return defaultMailbox; + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/src/cesmrmeetingrequestentry.cpp --- a/meetingrequest/mrentry/src/cesmrmeetingrequestentry.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrentry/src/cesmrmeetingrequestentry.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,14 +17,6 @@ // INCLUDE FILES -// -#include "emailtrace.h" -#include "cesmralarminfohandler.h" -#include "cesmrrecurrenceinfohandler.h" -// -#include -#include - #include "cesmrmeetingrequestentry.h" #include "cesmrfsmailboxutils.h" #include "cesmrcaldbmgr.h" @@ -32,25 +24,37 @@ #include "esmrentryhelper.h" #include "cesmrconflictchecker.h" #include "cesmrcaluserutil.h" +#include "cesmralarminfohandler.h" +#include "cesmrrecurrenceinfohandler.h" +#include "mmrinfoobject.h" +#include "mmrattendee.h" + +#include "CFSMailMessage.h" + #include "esmrconfig.hrh" +#include "cesmrfeaturesettings.h" + +#include "emailtrace.h" #include #include #include #include #include -#include +#include +#include #include #include -// -#include "mmrinfoobject.h" -#include "mmrattendee.h" -// -#include +#include +#include +#include #include #include #include #include +#include +#include +#include /// Unnamed namespace for local definitions namespace { @@ -58,18 +62,6 @@ // Alarm resource file location _LIT( KAlarmInfoResource, "esmralarminfo.rsc" ); -// Definition for first index -const TInt KFirstIndex = 0; - -// Definition for 0 -const TInt KZero = 0; - -// Definition for 1 -const TInt KOne = 1; - -// Definition for number of hours within day -const TInt KHoursInDay = 24; - // Definition for default alarm time for meeting const TInt KDefaultMeetingAlarmMinutes( 15 ); @@ -77,63 +69,41 @@ _LIT( KLineFeed, "\x2029"); /** - * Finds matching calendar instance from calendar db. Ownership is - * transferred, If instance cannot be found, NULL is returned. - * - * @param aCalDb Reference to cal db manager. - * @param aEntry Reference to calendar entry - * @return Pointer to calendar entry instance. + * Sets phone owner to entry. + * @param aMbUtils Reference to mailbox utils. + * @param aEntry Reference to calendar entry. */ -CCalInstance* FindInstanceL( - MESMRCalDbMgr& aCalDb, +void SetPhoneOwnerL( + CMRMailboxUtils& aMbUtils, CCalEntry& aEntry ) { - CCalInstance* instance = NULL; - RCPointerArray calInstances; - CleanupClosePushL( calInstances ); - - CCalInstanceView* instanceView = - aCalDb.NormalDbInstanceView(); - - CalCommon::TCalViewFilter instanceFilter = - CalCommon::EIncludeAppts | - CalCommon::EIncludeEvents; - - // Removing one seconds from start time and adding one second to stop - // time. Otherwise wanted entry is not included into results. - TCalTime startTime; - startTime.SetTimeLocalL( - aEntry.StartTimeL().TimeLocalL() - TTimeIntervalSeconds(KOne) ); - TCalTime endTime; - endTime.SetTimeLocalL( - aEntry.EndTimeL().TimeLocalL() + TTimeIntervalSeconds(KOne) ); - - TDateTime start = startTime.TimeLocalL().DateTime(); - TDateTime end = endTime.TimeLocalL().DateTime(); - - CalCommon::TCalTimeRange timeRange( - startTime, - endTime ); - - instanceView->FindInstanceL( - calInstances, - instanceFilter, - timeRange); - - TInt instanceCount( calInstances.Count() ); - for (TInt i = 0; (i < instanceCount && !instance); ++i) - { - CCalEntry& entry = calInstances[i]->Entry(); - - // Finding the entry we are intrested for - if ( !entry.UidL().Compare( aEntry.UidL() ) ) - { - instance = calInstances[i]; - calInstances.Remove( i ); - } - } - CleanupStack::PopAndDestroy(); // arrayCleanup - return instance; + CESMRFsMailboxUtils* fsMbUtils = + CESMRFsMailboxUtils::NewL( aMbUtils ); + CleanupStack::PushL( fsMbUtils ); + + fsMbUtils->SetPhoneOwnerL( aEntry ); + CleanupStack::PopAndDestroy( fsMbUtils ); + fsMbUtils = NULL; + } + +/** + * Makes copy of the entry and sets phone owner accordingly + * @param aMbUtils Reference to mailbox utils. + * @param aEntry Reference to calendar entry. + */ +CCalEntry* CopyEntryL( + CMRMailboxUtils& aMbUtils, + const CCalEntry& aEntry ) + { + CCalEntry* entry = ESMRHelper::CopyEntryL( + aEntry, + aEntry.MethodL(), + ESMRHelper::ECopyFull, + EESMREventTypeMeetingRequest ); + + SetPhoneOwnerL( aMbUtils, *entry ); + + return entry; } #ifdef _DEBUG @@ -183,7 +153,8 @@ : iMRMailboxUtils( aMRMailboxUtils ), iConflictsExists( aConflictsExists), iCalDb( aCalDb ), - iESMRInputParams( aESMRInputParams ) + iESMRInputParams( aESMRInputParams ), + iSendCanellation( ETrue ) { FUNC_LOG; // Not yet implementation @@ -193,21 +164,20 @@ // CESMRMeetingRequestEntry::~CESMRMeetingRequestEntry // --------------------------------------------------------------------------- // -CESMRMeetingRequestEntry::~CESMRMeetingRequestEntry() +EXPORT_C CESMRMeetingRequestEntry::~CESMRMeetingRequestEntry() { FUNC_LOG; delete iEntry; delete iForwardEntry; delete iOrginalEntry; delete iParameterEntry; - delete iBackupEntry; } // --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::NewL // --------------------------------------------------------------------------- // -CESMRMeetingRequestEntry* CESMRMeetingRequestEntry::NewL( +EXPORT_C CESMRMeetingRequestEntry* CESMRMeetingRequestEntry::NewL( const CCalEntry& aEntry, CMRMailboxUtils& aMRMailboxUtils, MESMRCalDbMgr& aCalDb, @@ -238,31 +208,12 @@ const CCalEntry& aEntry ) { FUNC_LOG; - - iParameterEntry = ESMRHelper::CopyEntryL( - aEntry, - aEntry.MethodL(), - ESMRHelper::ECopyFull ); - iBackupEntry=ESMRHelper::CopyEntryL( - aEntry, - aEntry.MethodL(), - ESMRHelper::ECopyFull ); - iEntry = ESMRHelper::CopyEntryL( - aEntry, - aEntry.MethodL(), - ESMRHelper::ECopyFull ); - - if ( !IsStoredL() && !IsOpenedFromMail() ) - { - // by default when creating a meeting the priority value is normal - SetPriorityL( EFSCalenMRPriorityNormal ); - } - - iOrginalEntry = ESMRHelper::CopyEntryL( - aEntry, - aEntry.MethodL(), - ESMRHelper::ECopyFull ); - + + iParameterEntry = CopyEntryL( iMRMailboxUtils, aEntry ); + iEntry = CopyEntryL( iMRMailboxUtils, aEntry ); + + iOrginalEntry = CopyEntryL( iMRMailboxUtils, aEntry ); + if ( EESMRRoleOrganizer == RoleL() && IsStoredL() ) { // Increase sequence number @@ -281,39 +232,52 @@ } HBufC* newDescription = ReplaceCharactersFromBufferLC( - iEntry->DescriptionL(), + iEntry->DescriptionL(), KReplaceLineFeedChar(), KLineFeed() ); iEntry->SetDescriptionL( *newDescription ); + iOrginalEntry->SetDescriptionL( *newDescription ); + CleanupStack::PopAndDestroy( newDescription ); - + + __ASSERT_DEBUG( iEntry->PhoneOwnerL(), Panic( EESMRPhoneOwnerNotSet) ); + + CESMRFeatureSettings* settings = CESMRFeatureSettings::NewL(); + if ( settings->FeatureSupported( + CESMRFeatureSettings::EMRUIMeetingRequestViewerCmailOnly ) ) + { + // Meeting request viewer available only from email. + // Remove attachments from entry. + iRemoveAttachments = ETrue; + } + delete settings; } // --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::ReplaceCharactersFromBufferL // --------------------------------------------------------------------------- // -HBufC* CESMRMeetingRequestEntry::ReplaceCharactersFromBufferLC( const TDesC& aTarget, - const TDesC& aFindString, +HBufC* CESMRMeetingRequestEntry::ReplaceCharactersFromBufferLC( const TDesC& aTarget, + const TDesC& aFindString, const TDesC& aReplacement ) { FUNC_LOG; HBufC* newBuffer = aTarget.AllocLC(); TPtr16 ptr = newBuffer->Des(); - + // find next occurance: TInt offset = ptr.Find(aFindString); while ( offset != KErrNotFound ) { // replace the data: ptr.Replace( offset, aFindString.Length(), aReplacement); - + // find next occurance: offset = ptr.Find(aFindString); } - + return newBuffer; - } + } // --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::Type @@ -390,24 +354,21 @@ CCalInstance* instance = NULL; - instance = FindInstanceL( iCalDb, *iEntry ); + instance = iCalDb.FindInstanceL( *iEntry ); if ( !instance ) { // Instance not found by using the edited entry // Trying with orginal. - instance = FindInstanceL( iCalDb, *iOrginalEntry ); + instance = iCalDb.FindInstanceL( *iOrginalEntry ); } if ( !instance ) { // Instance not found by using edited or orginal entry. // --> Leave - - User::Leave( KErrNotFound ); } - return instance; } @@ -422,7 +383,7 @@ __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); TBool canSetRecurrence( ETrue ); - + if ( iEntry->EntryTypeL() == CCalEntry::EAppt && ESMREntryHelper::IsRepeatingMeetingL(*iEntry) && (!ESMREntryHelper::IsModifyingEntryL(*iEntry) && @@ -454,7 +415,7 @@ // Ownership is transferred CCalInstance* instance = NULL; TRAPD(err, instance = InstanceL() ); - if ( KErrNotFound != err&&err!=KErrNone ) + if ( KErrNotFound != err ) { User::LeaveIfError( err ); } @@ -540,11 +501,10 @@ __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); CESMRRecurrenceInfoHandler* recurrenceHandler = - CESMRRecurrenceInfoHandler::NewLC( *iEntry ); + CESMRRecurrenceInfoHandler::NewLC( *iEntry, &iCalDb ); recurrenceHandler->GetRecurrenceL( aRecurrence, aUntil ); CleanupStack::PopAndDestroy( recurrenceHandler ); - } // --------------------------------------------------------------------------- @@ -562,7 +522,7 @@ // --------------------------------------------------------------------------- // void CESMRMeetingRequestEntry::SetModifyingRuleL( - TESMRRecurrenceModifyingRule aRule ) + TESMRRecurrenceModifyingRule aRule, const TBool aTypeChanging ) { FUNC_LOG; @@ -578,18 +538,16 @@ recHandler->GetRecurrenceL( orginalRecurrence, orginalUntil); - CleanupStack::PopAndDestroy( recHandler ); recHandler = NULL; + TBool modifyingEntry( ESMREntryHelper::IsModifyingEntryL( *iEntry ) ); if ( MESMRCalEntry::EESMRAllInSeries == aRule && - IsStoredL() && !IsForwardedL() && !IsOpenedFromMail() ) + IsStoredL() && !IsForwardedL() && !IsOpenedFromMail() && !aTypeChanging ) { // When we want to modify series of recurrence entries --> // Parent entry is modified - - TBool modifyingEntry( ESMREntryHelper::IsModifyingEntryL( *iEntry ) ); if ( ERecurrenceNot == orginalRecurrence && !modifyingEntry ) { // Orginal entry was not recurrent event @@ -611,27 +569,24 @@ CleanupStack::PushL( instance ); CCalEntry::TMethod entryMethod( iEntry->MethodL() ); - CCalEntry* iBackupEntry=ESMRHelper::CopyEntryL( - *iEntry, - entryMethod, - ESMRHelper::ECopyFull); - delete iEntry; + + delete iEntry; iEntry = NULL; - - delete iForwardEntry; + + delete iForwardEntry; iForwardEntry = NULL; - - delete iOrginalEntry; + + delete iOrginalEntry; iOrginalEntry = NULL; RCPointerArray entries; CleanupClosePushL( entries ); - iCalDb.NormalDbEntryView()->FetchL( + iCalDb.EntryViewL( instance->Entry() )->FetchL( instance->Entry().UidL(), entries ); TInt parentIndex( KErrNotFound ); - TInt entryCount( entries.Count() ); + TInt entryCount( entries.Count() ); for ( TInt i(0); i < entryCount && KErrNotFound == parentIndex; ++i ) { TBool modifyingEntry( ESMREntryHelper::IsModifyingEntryL( *entries[i]) ); @@ -642,24 +597,13 @@ } __ASSERT_DEBUG( KErrNotFound != parentIndex, Panic(EESMRParentNotFound) ); - + CCalEntry& parent = *entries[parentIndex]; TPtrC description( parent.DescriptionL() ); - - iEntry = ESMRHelper::CopyEntryL( - parent, - parent.MethodL(), - ESMRHelper::ECopyFull ); - - CESMRFsMailboxUtils* fsMbUtils = - CESMRFsMailboxUtils::NewL( iMRMailboxUtils ); - CleanupStack::PushL( fsMbUtils ); - - fsMbUtils->SetPhoneOwnerL( *iBackupEntry ); - CleanupStack::PopAndDestroy( fsMbUtils ); - fsMbUtils = NULL; - + + iEntry = CopyEntryL( iMRMailboxUtils, parent ); + // Adjust parent entry's start and end time to entry TCalTime start; TCalTime end; @@ -673,10 +617,7 @@ iEntry->SetStartAndEndTimeL( start, end ); - iOrginalEntry = ESMRHelper::CopyEntryL( - *iEntry, - iEntry->MethodL(), - ESMRHelper::ECopyFull ); + iOrginalEntry = CopyEntryL( iMRMailboxUtils, *iEntry ); if ( iEntry->MethodL() != entryMethod ) { @@ -686,8 +627,7 @@ iEntry->SetDescriptionL( description ); iOrginalEntry->SetDescriptionL( description ); - iEntry=ESMRHelper::CopyEntryL(*iBackupEntry,iBackupEntry->MethodL(),ESMRHelper::ECopyFull); - + CleanupStack::PopAndDestroy(); // entries CleanupStack::PopAndDestroy( instance ); @@ -700,7 +640,15 @@ } } } - + else if ( ERecurrenceNot != orginalRecurrence && + aTypeChanging && !modifyingEntry ) + { + // if entry( in the memory) is a recurrent event + // ,and if entry type is changing, and not in modifying status then EESMRAllInSeries + iRecurrenceModRule = EESMRAllInSeries ; + return; + } + iRecurrenceModRule = aRule; } @@ -728,10 +676,10 @@ start.Set( aStartDate.DateTime().Year(), aStartDate.DateTime().Month(), aStartDate.DateTime().Day(), - KZero, - KZero, - KZero, - KZero); + 0, + 0, + 0, + 0); // set the end date to next day from given end date since // all day event should last 24 hours. @@ -739,10 +687,10 @@ end.Set( endDate.DateTime().Year(), endDate.DateTime().Month(), endDate.DateTime().Day(), - KZero, - KZero, - KZero, - KZero ); + 0, + 0, + 0, + 0 ); startTime.SetTimeLocalL( start ); stopTime.SetTimeLocalL( end ); @@ -762,34 +710,11 @@ __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); - TBool allDayEvent(EFalse); - - TCalTime startTime = iEntry->StartTimeL(); - TCalTime stopTime = iEntry->EndTimeL(); - - TTimeIntervalHours hoursBetweenStartAndEnd; - stopTime.TimeLocalL().HoursFrom( - startTime.TimeLocalL(), - hoursBetweenStartAndEnd ); - - TCalTime::TTimeMode mode = startTime.TimeMode(); - - TInt hoursBetweenStartAndEndAsInt( hoursBetweenStartAndEnd.Int() ); - TInt alldayDivident( hoursBetweenStartAndEndAsInt % KHoursInDay ); - - if ( hoursBetweenStartAndEndAsInt&& KZero == alldayDivident ) - { - TDateTime startTimeLocal = startTime.TimeLocalL().DateTime(); - TDateTime stopTimeLocal = stopTime.TimeLocalL().DateTime(); - - if ( startTimeLocal.Hour() == stopTimeLocal.Hour() && - startTimeLocal.Minute() == stopTimeLocal.Minute() && - startTimeLocal.Second() == stopTimeLocal.Second() ) - { - allDayEvent = ETrue; - } - } - + CESMRCalUserUtil* entryUtil = CESMRCalUserUtil::NewLC( *iEntry ); + + TBool allDayEvent( entryUtil->IsAlldayEventL() ); + + CleanupStack::PopAndDestroy( entryUtil ); return allDayEvent; } @@ -806,16 +731,16 @@ TBool ret(EFalse); CCalEntry* dbEntry = NULL; - + TRAPD( err, dbEntry = iCalDb.FetchEntryL( iEntry->UidL(), iEntry->RecurrenceIdL() ) ); - + if ( KErrNotFound == err ) { - // Error has occured while retrieving an entry + // Error has occured while retrieving an entry ret = EFalse; - } + } else if ( dbEntry) { // Entry was found from the calendar db --> it is stored for sure. @@ -844,7 +769,7 @@ { CCalEntry::TStatus status( iOrginalEntry->StatusL() ); if ( CCalEntry::ENullStatus != status ) - { // When we send a request for the first time we set + { // When we send a request for the first time we set // it's status to some other value than ENullStatus retVal = ETrue; } @@ -852,10 +777,12 @@ else { // In attendee mode, we have sent the entry, if it is stored to - // calendar db and status is not declined. Declined entries are - // not stored to calendar db. + // calendar db and status is known and not declined. + // Declined entries are not stored to calendar db. TESMRAttendeeStatus currentStatus( AttendeeStatusL() ); - if ( IsStoredL() && EESMRAttendeeStatusDecline != currentStatus) + if ( IsStoredL() + && EESMRAttendeeStatusUnknown != currentStatus + && EESMRAttendeeStatusDecline != currentStatus ) { retVal = ETrue; } @@ -924,6 +851,13 @@ edited = ETrue; } + if( IsStoredL() ) + { + if ( iCalDb.EntryViewL( *iEntry ) != iCalDb.EntryView() ) + { + edited = ETrue; + } + } } @@ -932,6 +866,17 @@ } // --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::IsEntryTypeChangedL +// --------------------------------------------------------------------------- +// +TBool CESMRMeetingRequestEntry::IsEntryTypeChangedL() const + { + FUNC_LOG; + + return iTypeChanged; + } + +// --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::GetAlarmL // --------------------------------------------------------------------------- // @@ -967,7 +912,7 @@ { aAlarmType = MESMRCalEntry::EESMRAlarmAbsolute; - // only meeting request that is not allday event can have + // only meeting request that is not allday event can have // relative alarm: if ( !IsAllDayEventL() ) { @@ -978,7 +923,7 @@ if ( KErrNone == err ) { aAlarmType = MESMRCalEntry::EESMRAlarmRelative; - if( alarmInfo.iRelativeAlarmInSeconds < KZero ) + if( alarmInfo.iRelativeAlarmInSeconds < 0 ) { aAlarmType = MESMRCalEntry::EESMRAlarmNotFound; } @@ -1003,6 +948,192 @@ // --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::UpdateEntryAfterStoringL +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestEntry::UpdateEntryAfterStoringL() + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); + + CCalEntry* storedEntry = NULL; + + + if ( IsRecurrentEventL() && + EESMRThisOnly == iRecurrenceModRule && + !IsForwardedL() && IsStoredL() && + !ESMREntryHelper::IsModifyingEntryL(*iEntry) ) + { + // We have stored one instance of series. + storedEntry = iCalDb.FetchEntryL( + iEntry->UidL(), + iOrginalEntry->StartTimeL() ); + } + else + { + // We are dealing with single instance or with the series + storedEntry = iCalDb.FetchEntryL( + iEntry->UidL(), + iEntry->RecurrenceIdL() ); + } + + + __ASSERT_DEBUG( storedEntry, Panic( EESMREntryNotExist ) ); + CleanupStack::PushL( storedEntry ); + + // Description needs to be fecthed explicitly into memory + TPtrC description( storedEntry->DescriptionL() ); + + + delete iEntry; + iEntry = NULL; + iEntry = CopyEntryL( iMRMailboxUtils, *storedEntry ); + + if ( MESMRCalEntry::EESMRAllInSeries == iRecurrenceModRule && + IsRecurrentEventL() ) + { + // Adjust parent entry's start and end time to entry + TCalTime start; + TCalTime end; + + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( *iEntry ); + + recurrenceHandler->GetFirstInstanceTimeL( start, end ); + CleanupStack::PopAndDestroy( recurrenceHandler ); + recurrenceHandler = NULL; + + iEntry->SetStartAndEndTimeL( start, end ); + iEntry->SetDescriptionL( description ); + } + + CCalEntry* temp = CopyEntryL( iMRMailboxUtils, *iEntry ); + + delete iOrginalEntry; + iOrginalEntry = temp; + + CleanupStack::PopAndDestroy( storedEntry ); + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::UpdateComparativeEntry +// ---------------------------------------------------------------------------- +// +void CESMRMeetingRequestEntry::UpdateComparativeEntry( + CCalEntry* aNewComparativeEntry ) + { + FUNC_LOG; + + if( iOrginalEntry ) // Update comparative entry + { + delete iOrginalEntry; + iOrginalEntry = NULL; + + iOrginalEntry = aNewComparativeEntry; + } + + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::SetDefaultValuesToEntryL +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestEntry::SetDefaultValuesToEntryL() + { + FUNC_LOG; + + if ( !IsStoredL() ) + { + SetPriorityL( EFSCalenMRPriorityNormal ); + + // Get default alarm time from central repository + TInt defaultAlarmTime=0; + CRepository* repository = CRepository::NewLC( KCRUidCalendar ); + + TInt err = KErrNotFound; + + if ( repository ) + { + err = repository->Get( + KCalendarDefaultAlarmTime, + defaultAlarmTime ); + CleanupStack::PopAndDestroy( repository ); + } + + if ( err != KErrNone ) + { + // By default 15 minutes if not found from central repository + defaultAlarmTime = KDefaultMeetingAlarmMinutes; + } + + // Getting current time + TTime currentTime; + currentTime.HomeTime(); + + // Getting meeting start time + TTime start = iEntry->StartTimeL().TimeLocalL(); + + // Create default alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + + TTimeIntervalMinutes alarmOffset( defaultAlarmTime ); + + // If alarm time is in past + if ( ( start - alarmOffset ) < currentTime ) + { + // Setting alarm off + iEntry->SetAlarmL( NULL ); + } + else + { + // Set default alarm time + alarm->SetTimeOffset( alarmOffset ); + iEntry->SetAlarmL( alarm ); + } + CleanupStack::PopAndDestroy( alarm ); + } + + // Set the default end time if not set by client + if ( iEntry->StartTimeL().TimeUtcL() == iEntry->EndTimeL().TimeUtcL() ) + { + // This value might also be read from cenrep + TTimeIntervalHours KDefaultMeetingDuration(1); + + TCalTime newEndTime; + newEndTime.SetTimeUtcL( + iEntry->StartTimeL().TimeUtcL() + KDefaultMeetingDuration ); + iEntry->SetStartAndEndTimeL(iEntry->StartTimeL(), newEndTime); + } + + iEntry->SetReplicationStatusL( CCalEntry::EOpen ); + + //Original entry must be stored after the default values are set. + //Otherwise it looks like settings are changed even though they haven't + CCalEntry* temp = CopyEntryL( iMRMailboxUtils, *iEntry ); + + delete iOrginalEntry; + iOrginalEntry = temp; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::CloneEntryLC +// --------------------------------------------------------------------------- +// +CCalEntry* CESMRMeetingRequestEntry::CloneEntryLC( + TESMRCalEntryType aType ) const + { + CCalEntry* entry = + ESMRHelper::CopyEntryLC( *iEntry, + iEntry->MethodL(), + ESMRHelper::ECopyFull, + TESMRCalendarEventType( aType ) ); + + return entry; + } + +// --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::RoleL // --------------------------------------------------------------------------- // @@ -1108,7 +1239,7 @@ attendee->SetStatusL(status); iEntry->SetStatusL(entryStatus); - + iEntry->SetMethodL( CCalEntry::EMethodReply ); } @@ -1127,11 +1258,11 @@ TBool outOfDate( EFalse ); CCalEntry::TMethod method( iEntry->MethodL() ); - if ( IsOpenedFromMail() && + if ( IsOpenedFromMail() && CCalEntry::EMethodCancel != method ) { CCalEntry* dbEntry = NULL; - + TRAP_IGNORE( dbEntry = iCalDb.FetchEntryL( iEntry->UidL(), iEntry->RecurrenceIdL() ) ); @@ -1205,6 +1336,10 @@ CCalAttendee::TCalStatus attendeeStatus( attendee->StatusL() ); switch ( attendeeStatus ) { + case CCalAttendee::ENeedsAction: + status = EESMRAttendeeStatusUnknown; + break; + case CCalAttendee::EAccepted: status = EESMRAttendeeStatusAccept; break; @@ -1254,13 +1389,10 @@ FUNC_LOG; __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); - - CCalEntry* temp = ESMRHelper::CopyEntryL( - *iEntry, - iEntry->MethodL(), - ESMRHelper::ECopyFull ); - - delete iForwardEntry; + + CCalEntry* temp = CopyEntryL( iMRMailboxUtils, *iEntry ); + + delete iForwardEntry; iForwardEntry = temp; RPointerArray& attendeeList = @@ -1269,7 +1401,7 @@ while ( attendeeList.Count() ) { //remove attendees from entry that is to be forwarded - iForwardEntry->DeleteAttendeeL( KFirstIndex ); + iForwardEntry->DeleteAttendeeL( 0 ); } } @@ -1308,11 +1440,11 @@ iForwardEntry->SetStatusL( CCalEntry::EConfirmed ); } else if ( RoleL() == EESMRRoleOrganizer || - iEntry->StatusL() == CCalEntry::ENullStatus ) + iEntry->StatusL() == CCalEntry::ENullStatus ) { iEntry->SetStatusL( CCalEntry::EConfirmed ); } - + } // --------------------------------------------------------------------------- @@ -1364,8 +1496,6 @@ MESMRMeetingRequestEntry::TESMREntryInfo info = EESMREntryInfoNormal; - TBool isSent( IsSentL() ); - if ( IsEntryOutOfDateL() ) { info = EESMREntryInfoOutOfDate; @@ -1374,7 +1504,7 @@ { info = EESMREntryInfoCancelled; } - else if ( isSent ) + else if ( IsSentL() ) { info = EESMREntryInfoAccepted; if ( EESMRAttendeeStatusTentative == attendeeStatus ) @@ -1386,10 +1516,6 @@ { info = EESMREntryInfoOccursInPast; } - else if ( iConflictsExists ) - { - info = EESMREntryInfoConflicts; - } return info; @@ -1466,10 +1592,7 @@ if ( iForwardEntry ) { - entry = ESMRHelper::CopyEntryL( - *iForwardEntry, - iForwardEntry->MethodL(), - ESMRHelper::ECopyFull ); + entry = CopyEntryL( iMRMailboxUtils, *iForwardEntry ); } if ( !entry && IsRecurrentEventL() && @@ -1506,15 +1629,15 @@ parent.EntryTypeL(), guid, parent.MethodL(), - KZero, + 0, iOrginalEntry->StartTimeL(), CalCommon::EThisOnly ); - CleanupStack::Pop( guid ); + CleanupStack::Pop( guid ); guid = NULL; // ownership transferred } - CleanupStack::PopAndDestroy( instance ); + CleanupStack::PopAndDestroy( instance ); instance = NULL; // instance CleanupStack::PushL( entry ); @@ -1522,11 +1645,12 @@ CCalEntry::TMethod method( iEntry->MethodL() ); entry->CopyFromL( *iEntry, CCalEntry::EDontCopyId ); - entry->SetSequenceNumberL( KZero ); + entry->SetSequenceNumberL( 0 ); entry->SetMethodL( method ); entry->SetSummaryL( iEntry->SummaryL() ); entry->SetLocalUidL( TCalLocalUid( 0 ) ); entry->ClearRepeatingPropertiesL(); + iMRMailboxUtils.SetPhoneOwnerL( *entry ); CleanupStack::Pop( entry ); } @@ -1534,14 +1658,20 @@ if ( !entry ) { - - entry = ESMRHelper::CopyEntryL( - *iEntry, - iEntry->MethodL(), - ESMRHelper::ECopyFull ); - + entry = CopyEntryL( iMRMailboxUtils, *iEntry ); } + if ( iRemoveAttachments ) + { + // Remove attachments from the entry + TInt count( entry->AttachmentCountL() ); + + for ( TInt i = 0; i < count; ++i ) + { + CCalAttachment* attachment = entry->AttachmentL( i ); + entry->DeleteAttachmentL( *attachment ); + } + } return entry; } @@ -1635,7 +1765,7 @@ TPtrC calEntryAddress( thisAttendee->Address() ); TPtrC infoAddress( attendee->Address() ); - if ( KZero == infoAddress.Compare(calEntryAddress ) ) + if ( 0 == infoAddress.Compare(calEntryAddress ) ) { found = ETrue; @@ -1687,8 +1817,7 @@ aStartupParams.iCalEntry = iESMRInputParams->iCalEntry; aStartupParams.iMRInfoObject = iESMRInputParams->iMRInfoObject; aStartupParams.iMailMessage = iESMRInputParams->iMailMessage; - aStartupParams.iMailClient = iESMRInputParams->iMailClient; - aStartupParams.iAttachmentInfo = iESMRInputParams->iAttachmentInfo; + aStartupParams.iMailClient = iESMRInputParams->iMailClient; aStartupParams.iSpare = iESMRInputParams->iSpare; } return retValue; @@ -1779,94 +1908,6 @@ } // --------------------------------------------------------------------------- -// CESMRMeetingRequestEntry::SetDefaultValuesToEntryL -// --------------------------------------------------------------------------- -// -void CESMRMeetingRequestEntry::SetDefaultValuesToEntryL() - { - FUNC_LOG; - - if ( !IsStoredL() ) - { - SetPriorityL( EFSCalenMRPriorityNormal ); - - // Get default alarm time from central repository - TInt defaultAlarmTime=0; - CRepository* repository = CRepository::NewLC( KCRUidCalendar ); - - TInt err = KErrNotFound; - - if ( repository ) - { - err = repository->Get( - KCalendarDefaultAlarmTime, - defaultAlarmTime ); - CleanupStack::PopAndDestroy( repository ); - } - - if ( err != KErrNone ) - { - // By default 15 minutes if not found from central repository - defaultAlarmTime = KDefaultMeetingAlarmMinutes; - } - - // Getting current time - TTime currentTime; - currentTime.HomeTime(); - - // Getting meeting start time - TTime start = iEntry->StartTimeL().TimeLocalL(); - - // Create default alarm - CCalAlarm* alarm = CCalAlarm::NewL(); - CleanupStack::PushL( alarm ); - - TTimeIntervalMinutes alarmOffset( defaultAlarmTime ); - - // If alarm time is in past - if ( ( start - alarmOffset ) < currentTime ) - { - // Setting alarm off - iEntry->SetAlarmL( NULL ); - } - else - { - // Set default alarm time - alarm->SetTimeOffset( alarmOffset ); - iEntry->SetAlarmL( alarm ); - } - CleanupStack::PopAndDestroy( alarm ); - } - - // Set the default end time if not set by client - if ( iEntry->StartTimeL().TimeUtcL() == iEntry->EndTimeL().TimeUtcL() ) - { - // This value might also be read from cenrep - TTimeIntervalHours KDefaultMeetingDuration(1); - - TCalTime newEndTime; - newEndTime.SetTimeUtcL( - iEntry->StartTimeL().TimeUtcL() + KDefaultMeetingDuration ); - iEntry->SetStartAndEndTimeL(iEntry->StartTimeL(), newEndTime); - } - - iEntry->SetReplicationStatusL( CCalEntry::EOpen ); - - //Original entry must be stored after the default values are set. - //Otherwise it looks like settings are changed even though they haven't - - CCalEntry* temp = ESMRHelper::CopyEntryL( - *iEntry, - iEntry->MethodL(), - ESMRHelper::ECopyFull ); - - delete iOrginalEntry; - iOrginalEntry = temp; - - } - - -// --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::IsOpenedFromMail // --------------------------------------------------------------------------- // @@ -2000,78 +2041,58 @@ } // --------------------------------------------------------------------------- -// CESMRMeetingRequestEntry::UpdateEntryAfterStoringL -// --------------------------------------------------------------------------- -// -void CESMRMeetingRequestEntry::UpdateEntryAfterStoringL() - { - FUNC_LOG; - - __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); - - CCalEntry* temp = ESMRHelper::CopyEntryL( - *iEntry, - iEntry->MethodL(), - ESMRHelper::ECopyFull ); - - delete iOrginalEntry; - iOrginalEntry = temp; - - } - -// --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::UpdateChildEntriesSeqNumbersL // --------------------------------------------------------------------------- // void CESMRMeetingRequestEntry::UpdateChildEntriesSeqNumbersL() - { + { FUNC_LOG; - if ( MESMRCalEntry::EESMRAllInSeries == iRecurrenceModRule && - IsStoredL() ) - { - RCPointerArray childEntries; - CleanupClosePushL( childEntries ); - - // Fetch all entries (this and child entries - iCalDb.NormalDbEntryView()->FetchL( - iEntry->UidL(), - childEntries ); - - // Next: Remove parent entry from the array - TBool removed( EFalse ); - TInt entryCount( childEntries.Count() ); - for ( TInt i(0); (i < entryCount) && !removed; ++i ) - { - CCalEntry* entry = childEntries[i]; - - if ( !ESMREntryHelper::IsModifyingEntryL( *entry) ) - { - removed = ETrue; - childEntries.Remove( i ); - delete entry; - } - entry = NULL; - } - - TInt childCount( childEntries.Count() ); - if ( childCount ) - { - for (TInt i(0); i < childCount; ++i ) - { - CCalEntry* child = childEntries[i]; - TInt childSeqNo( child->SequenceNumberL() ); - child->SetSequenceNumberL( childSeqNo + 1); - } - - TInt updatedChilds; - iCalDb.NormalDbEntryView()->StoreL(childEntries, updatedChilds); - } - - CleanupStack::PopAndDestroy(); // childEntries - } - - } + if ( MESMRCalEntry::EESMRAllInSeries == iRecurrenceModRule && + IsStoredL() ) + { + RCPointerArray childEntries; + CleanupClosePushL( childEntries ); + + // Fetch all entries (this and child entries + iCalDb.EntryView()->FetchL( + iEntry->UidL(), + childEntries ); + + // Next: Remove parent entry from the array + TBool removed( EFalse ); + TInt entryCount( childEntries.Count() ); + for ( TInt i(0); (i < entryCount) && !removed; ++i ) + { + CCalEntry* entry = childEntries[i]; + + if ( !ESMREntryHelper::IsModifyingEntryL( *entry) ) + { + removed = ETrue; + childEntries.Remove( i ); + delete entry; + } + entry = NULL; + } + + TInt childCount( childEntries.Count() ); + if ( childCount ) + { + for (TInt i(0); i < childCount; ++i ) + { + CCalEntry* child = childEntries[i]; + TInt childSeqNo( child->SequenceNumberL() ); + child->SetSequenceNumberL( childSeqNo + 1); + } + + TInt updatedChilds; + iCalDb.EntryView()->StoreL(childEntries, updatedChilds); + } + + CleanupStack::PopAndDestroy(); // childEntries + } + + } // --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::CurrentPluginL @@ -2083,35 +2104,19 @@ if ( EESMRUnknownPlugin == iCurrentFSEmailPlugin) { - CESMRFsMailboxUtils* fsMbUtils = + CESMRFsMailboxUtils* fsMbUtils = CESMRFsMailboxUtils::NewL( iMRMailboxUtils ); CleanupStack::PushL( fsMbUtils ); - + iCurrentFSEmailPlugin = fsMbUtils->FSEmailPluginForEntryL( *iEntry ); CleanupStack::PopAndDestroy( fsMbUtils ); - fsMbUtils = NULL; + fsMbUtils = NULL; } - return iCurrentFSEmailPlugin; } // --------------------------------------------------------------------------- -// CESMRMeetingRequestEntry::CurrentMailBoxIdL -// --------------------------------------------------------------------------- -// -TFSMailMsgId CESMRMeetingRequestEntry::CurrentMailBoxIdL() - { - FUNC_LOG; - CESMRFsMailboxUtils* fsMbUtils = - CESMRFsMailboxUtils::NewL( iMRMailboxUtils ); - CleanupStack::PushL( fsMbUtils ); - TFSMailMsgId retVal = fsMbUtils->FSEmailMailBoxForEntryL( *iEntry ); - CleanupStack::PopAndDestroy( fsMbUtils ); - return retVal; - } - -// --------------------------------------------------------------------------- // CESMRMeetingRequestEntry::UpdateTimeStampL // --------------------------------------------------------------------------- // @@ -2119,49 +2124,204 @@ { FUNC_LOG; __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); - + TTime currentUTCTime; currentUTCTime.UniversalTime(); TCalTime currentTime; currentTime.SetTimeUtcL( currentUTCTime ); - iEntry->SetDTStampL( currentTime ); + iEntry->SetDTStampL( currentTime ); } // --------------------------------------------------------------------------- -// CESMRMeetingRequestEntry::UpdateTimeStampL +// CESMRMeetingRequestEntry::AnyInstancesBetweenTimePeriodL // --------------------------------------------------------------------------- // -TBool CESMRMeetingRequestEntry::AnyInstanceOnDayL( +TBool CESMRMeetingRequestEntry::AnyInstancesBetweenTimePeriodL( + TTime& aStart, + TTime& aEnd ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); + __ASSERT_DEBUG( iOrginalEntry, Panic(EESMREntryNotExist ) ); + + TBool retValue( EFalse ); + + RCPointerArray entries; + CleanupClosePushL( entries ); + + CESMRConflictChecker* conflictCheckker = + CESMRConflictChecker::NewL( iCalDb ); + CleanupStack::PushL( conflictCheckker ); + + CCalInstance* instance = InstanceL(); + CleanupStack::PushL( instance ); + + TCalCollectionId colId = instance->InstanceIdL().iCollectionId; + CleanupStack::PopAndDestroy( instance ); + + conflictCheckker->FindInstancesForEntryL( aStart, + aEnd, + *iEntry, + colId, + entries ); + + if ( entries.Count() ) + { + retValue = ETrue; + } + + CleanupStack::PopAndDestroy( conflictCheckker ); + CleanupStack::PopAndDestroy(); // entries + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::GetFirstInstanceStartAndEndTimeL +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestEntry::GetFirstInstanceStartAndEndTimeL( TTime& aStart, TTime& aEnd ) { FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic(EESMREntryNotExist ) ); + + // This fetches the parent entry + TCalTime recurrenceId; + recurrenceId.SetTimeLocalL( Time::NullTTime() ); + CCalEntry* parent = iCalDb.FetchEntryL( + iEntry->UidL(), + recurrenceId ); + + CleanupStack::PushL( parent ); + + aStart = parent->StartTimeL().TimeLocalL(); + aEnd = parent->EndTimeL().TimeLocalL(); + + CleanupStack::PopAndDestroy( parent ); + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::CalendarOwnerAddressL +// --------------------------------------------------------------------------- +// +const TDesC& CESMRMeetingRequestEntry::CalendarOwnerAddressL() const + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic( EESMREntryNotExist ) ); + + CCalUser* po = iEntry->PhoneOwnerL(); + + __ASSERT_DEBUG( po, Panic( EESMRPhoneOwnerNotSet ) ); + + return po->Address(); + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::MailboxUtils +// --------------------------------------------------------------------------- +// +CMRMailboxUtils& CESMRMeetingRequestEntry::MailboxUtils() const + { + return iMRMailboxUtils; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::GetDBMgr +// --------------------------------------------------------------------------- +// +MESMRCalDbMgr& CESMRMeetingRequestEntry::GetDBMgr() + { + return iCalDb; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::SupportsCapabilityL +// --------------------------------------------------------------------------- +// +TBool CESMRMeetingRequestEntry::SupportsCapabilityL( + MESMRCalEntry::TMREntryCapability aCapability ) const + { TBool retValue( EFalse ); - RCPointerArray entries; - CleanupClosePushL( entries ); - - CESMRConflictChecker* conflictCheckker = - CESMRConflictChecker::NewL( iCalDb ); - CleanupStack::PushL( conflictCheckker ); - - conflictCheckker->FindInstancesForEntryL( aStart, - aEnd, - *iEntry, - entries ); - - if ( entries.Count() ) + switch( aCapability ) { - retValue = ETrue; - } - - CleanupStack::PopAndDestroy( conflictCheckker ); - CleanupStack::PopAndDestroy(); // entries + case MESMRCalEntry::EMRCapabilityAttachments: + { + CESMRFsMailboxUtils* fsMbUtils = + CESMRFsMailboxUtils::NewL( iMRMailboxUtils ); + CleanupStack::PushL( fsMbUtils ); + + retValue = fsMbUtils->DefaultMailboxSupportCapabilityL( + CESMRFsMailboxUtils::EMRCapabilityAttachment ); + CleanupStack::PopAndDestroy( fsMbUtils ); + } + break; + } return retValue; } +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::ContainsRemoteAttachmentsL +// --------------------------------------------------------------------------- +// +TBool CESMRMeetingRequestEntry::ContainsRemoteAttachmentsL() + { + FUNC_LOG; + + TBool retValue( EFalse ); + + TInt attachmentCount( iEntry->AttachmentCountL() ); + + for ( TInt i(0); i < attachmentCount && !retValue; ++i ) + { + CCalAttachment* attachment = iEntry->AttachmentL(i); + CCalAttachment::TType type( attachment->Type() ); + + if ( CCalAttachment::EFile != type ) + { + retValue = ETrue; + } + } + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::SendCanellationAvailable +// --------------------------------------------------------------------------- +// +TBool CESMRMeetingRequestEntry::SendCanellationAvailable () + { + return iSendCanellation; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::SetSendCanellationAvailable +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestEntry::SetSendCanellationAvailable ( + TBool aSendCanellation ) + { + iSendCanellation = aSendCanellation; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::SetTypeChanged +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestEntry::SetTypeChanged( TBool aTypeChanged ) + { + FUNC_LOG; + + iTypeChanged = aTypeChanged; + } + // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/tsrc/ut_mrentry/inc/ut_cesmrconflictchecker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrentry/tsrc/ut_mrentry/inc/ut_cesmrconflictchecker.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for Conflict Checker unit and module tests +* +*/ + + +#ifndef UT_CESMRConflictChecker_H +#define UT_CESMRConflictChecker_H + +// INCLUDES +#include +#include + +#include "cmrutils.h" + +// FORWARD DECLARATIONS + +// CLASS DEFINITION +class CCalSession; +class CESMRCalDbMgr; +class CESMRConflictChecker; + +/** + * Generated EUnit test suite class. + */ +NONSHARABLE_CLASS( UT_CESMRConflictChecker ) : public CEUnitTestSuiteClass, + public MMRUtilsObserver + { + public: // Constructors and destructor + + static UT_CESMRConflictChecker* NewL(); + static UT_CESMRConflictChecker* NewLC(); + ~UT_CESMRConflictChecker(); + + private: // Constructors + UT_CESMRConflictChecker(); + void ConstructL(); + + private: // From MMRUtilsObserver + + void HandleCalEngStatus( TMRUtilsCalEngStatus aStatus ); + + private: // New methods + + void SetupL(); + void Teardown(); + + private: // Test methods + + void T_Global_NewL(); + void T_Global_FindConflictsL(); + void T_Global_FindInstancesForEntryL(); + + private: // Data + + // Own. Calendar session. + CCalSession* iCalSession; + // Own. Calendar database manager instance. + CESMRCalDbMgr* iCalDbManager; + // Own. Conflict checker instance. + CESMRConflictChecker* iConflictChecker; + // Own. Wait object for asynchronous operations. + CActiveSchedulerWait* iWait; + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CESMRConflictChecker_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/tsrc/ut_mrentry/inc/ut_cesmrmeetingrequestentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrentry/tsrc/ut_mrentry/inc/ut_cesmrmeetingrequestentry.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for MR Entry unit and module tests +* +*/ + + +#ifndef UT_CESMRMeetingRequestEntry_H +#define UT_CESMRMeetingRequestEntry_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CCalEntry; +class CMRMailboxUtils; +class CESMRCalDbMgr; +class CCalSession; +class CActiveSchedulerWait; +class CESMRMeetingRequestEntry; + +// CLASS DEFINITION +/** + * Generated EUnit test suite class. + */ +NONSHARABLE_CLASS( UT_CESMRMeetingRequestEntry ) : public CEUnitTestSuiteClass, MMRUtilsObserver + { + public: // Constructors and destructor + + static UT_CESMRMeetingRequestEntry* NewL(); + static UT_CESMRMeetingRequestEntry* NewLC(); + ~UT_CESMRMeetingRequestEntry(); + + public: + void ExecuteL(); + + protected: // From MMRUtilsObserver + void HandleCalEngStatus( TMRUtilsCalEngStatus aStatus ); + void HandleOperation( + TInt aType, + TInt aPercentageCompleted, + TInt aStatus ); + + private: // Constructors + UT_CESMRMeetingRequestEntry(); + void ConstructL(); + + + private: // New methods + + void SetupL(); + void Teardown(); + + /** + * Utility functions + */ + void CreateCalEntryL(); + void CreateMREntryL(); + CCalEntry* CCalEntryL(); //ownership transfered to caller + + /** + * Test functions + */ + void T_Global_CESMRMeetingRequestEntry_NewL(); + void T_ValidateEntryL_1(); + void T_ValidateEntryL_2(); + void T_EntryAttendeeInfoL(); + void T_GetRecurrenceL(); + + private: //members + + CESMRMeetingRequestEntry* iMrEntry; + CCalEntry* iEntry; + CMRMailboxUtils* iMRMailboxUtils; + CESMRCalDbMgr* iCalDbMgr; + TBool iConflictsExists; + CCalSession* iCalSession; + + /// Own: MR UTILS syncher + CActiveSchedulerWait* iCtrlSyncher; + /// Own: Operation error value + TInt iExecutionError; + + private: // Data + + EUNIT_DECLARE_TEST_TABLE; + + }; + +#endif // UT_CESMRMeetingRequestEntry_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/tsrc/ut_mrentry/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrentry/tsrc/ut_mrentry/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Conflict Checker unit and module test entrypoint +* +*/ + + +// SYSTEM INCLUDES +#include + +// USER INCLUDES +#include "ut_cesmrconflictchecker.h" +#include "ut_cesmrmeetingrequestentry.h" + +// --------------------------------------------------------------------------- +// CreateTestSuiteL +// --------------------------------------------------------------------------- +// +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + CEUnitTestSuite* rootSuite = CEUnitTestSuite::NewLC(_L("MREntry Unit Tests")); + + CEUnitTestSuiteClass* testSuite; + testSuite = UT_CESMRConflictChecker::NewLC(); + rootSuite->AddL( testSuite ); + CleanupStack::Pop( testSuite ); + + CEUnitTestSuiteClass* testSuite2; + testSuite2 = UT_CESMRMeetingRequestEntry::NewLC(); + rootSuite->AddL( testSuite2 ); + CleanupStack::Pop( testSuite2 ); + + CleanupStack::Pop( rootSuite ); + return rootSuite; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/tsrc/ut_mrentry/src/ut_cesmrconflictchecker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrentry/tsrc/ut_mrentry/src/ut_cesmrconflictchecker.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,329 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Conflict checker unit and module tests +* Version : %version: e002sa33#4 % +* +* Copyright ? 2008-2008 Nokia. All rights reserved. +*/ + + +#include "UT_CESMRConflictChecker.h" + +// SYSTEM INCLUDES +#include +#include + +#include +#include +#include +#include + +// USER INCLUDES +#include "cesmrconflictchecker.h" +#include "cesmrcaldbmgr.h" + +// CONSTANTS + +// LOCAL DEFINITIONS + +namespace { + +_LIT(KTimeFormat,"%F%Y/%M/%D,%H:%T:%S"); + +// Conflicting entry's start time (yyyymmdd::hhmmss). +_LIT( KConflictingCalendarEntryStartTime, "20091100:140000" ); +//-TODO:luo _LIT( KConflictingCalendarEntryStartTime, "20090000:150000" ); +// Conflicting entry's end time (yyyymmdd::hhmmss). +_LIT( KConflictingCalendarEntryEndTime, "20091100:150000"); +//-TODO:luo _LIT( KConflictingCalendarEntryEndTime, "20090000:170000"); +// Calendar entry's location for conflicting entries. +_LIT( KCalendarEntryTrueValue, "1" ); + +// Recurrent event start and end time. +_LIT( KRecurrentCalendarEntryStartTime, "20091100:140000" ); +_LIT( KRecurrentCalendarEntryEndTime, "20091100:150000" ); + +// Time range for fetching recurrent event instances. +_LIT( KRecurrentEntryTimeRangeStartTime, "20091100:000000" ); +_LIT( KRecurrentEntryTimeRangeEndTime, "20091106:000000" ); + +// Calendar database filename. +_LIT( KCalendarDatabaseFilePath, "c:calendar3");//"c:Calendar_test_conflictchecker" ); +// Calendar entry UID. +_LIT8( KCalendarEntryUid, "UT_ConflictChecker" ); +} + +// - Construction ------------------------------------------------------------ + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::NewL +// --------------------------------------------------------------------------- +// +UT_CESMRConflictChecker* UT_CESMRConflictChecker::NewL() + { + UT_CESMRConflictChecker* self = UT_CESMRConflictChecker::NewLC(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::NewLC +// --------------------------------------------------------------------------- +// +UT_CESMRConflictChecker* UT_CESMRConflictChecker::NewLC() + { + UT_CESMRConflictChecker* self = new( ELeave ) UT_CESMRConflictChecker(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::~UT_CESMRConflictChecker +// --------------------------------------------------------------------------- +// +UT_CESMRConflictChecker::~UT_CESMRConflictChecker() + { + delete iWait; + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::UT_CESMRConflictChecker +// --------------------------------------------------------------------------- +// +UT_CESMRConflictChecker::UT_CESMRConflictChecker() + { + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::ConstructL +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + iWait = new ( ELeave) CActiveSchedulerWait(); + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::HandleCalEngStatus +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::HandleCalEngStatus( TMRUtilsCalEngStatus aStatus ) + { + iWait->AsyncStop(); + } + +// - Test methods ----------------------------------------------------------- + + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::SetupL +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::SetupL() + { + __UHEAP_MARK; + iCalSession = CCalSession::NewL(); + iCalSession->OpenL( KCalendarDatabaseFilePath ); + iCalDbManager = CESMRCalDbMgr::NewL( *iCalSession, *this ); + iWait->Start(); + iConflictChecker = CESMRConflictChecker::NewL( *iCalDbManager ); + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::Teardown +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::Teardown() + { + delete iConflictChecker; + delete iCalDbManager; + delete iCalSession; + __UHEAP_MARKEND; + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::T_Global_NewL +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::T_Global_NewL() + { + delete iConflictChecker; + iConflictChecker = NULL; + + __UHEAP_MARK; + iConflictChecker = CESMRConflictChecker::NewL( *iCalDbManager ); + delete iConflictChecker; + __UHEAP_MARKEND; + + iConflictChecker = NULL; + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::T_Global_FindConflictsL +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::T_Global_FindConflictsL() + { + // Create reference calendar entry. + HBufC8* entryUidBufC = KCalendarEntryUid().AllocLC(); + CCalEntry* calEntry = CCalEntry::NewL( CCalEntry::EAppt, entryUidBufC, CCalEntry::EMethodRequest, 0 ); + CleanupStack::Pop( entryUidBufC ); + entryUidBufC = NULL; + + TTime startTime, endTime; + TCalTime startCalTime, endCalTime; + + startTime.Set( KConflictingCalendarEntryStartTime ); + endTime.Set( KConflictingCalendarEntryEndTime ); + + TBuf<32> sTime; + TBuf<32> eTime; + startTime.FormatL( sTime, KTimeFormat ); + endTime.FormatL( eTime, KTimeFormat ); + + startCalTime.SetTimeLocalL( startTime ); + endCalTime.SetTimeLocalL( endTime ); + + calEntry->SetStartAndEndTimeL( startCalTime, endCalTime ); + + // Fetch conflicting entries. + RPointerArray conflictList; + CleanupClosePushL( conflictList ); + + iConflictChecker->FindConflictsL( *calEntry, conflictList ); + delete calEntry; + calEntry = NULL; + + // Check that correct number of entries is returned. + EUNIT_ASSERT_DESC( conflictList.Count() == 4, + "Incorrect number of calendar entries." ); + + // Verify list of conflicting entries. + TBool testFailed = EFalse; + while ( conflictList.Count() ) + { + // If entry's location is something else than '1'. + if ( conflictList[ 0 ]->LocationL().Compare( KCalendarEntryTrueValue ) ) + { + testFailed = ETrue; + } + + // Remove entry from array. + delete conflictList[ 0 ]; + conflictList.Remove( 0 ); + } + + // Check that correct entries were returned. + EUNIT_ASSERT_DESC( !testFailed, + "Incorrect calendar entry/ies returned."); + + CleanupStack::PopAndDestroy(); // conflictList + } + +// --------------------------------------------------------------------------- +// UT_CESMRConflictChecker::T_Global_FindInstancesForEntryL +// --------------------------------------------------------------------------- +// +void UT_CESMRConflictChecker::T_Global_FindInstancesForEntryL() + { + // First retrieve one instace of recurrent event. + RPointerArray instanceList; + MESMRCalDbMgr& dbMgr = *iCalDbManager; + CCalInstanceView* instanceView = dbMgr.NormalDbInstanceView(); + CalCommon::TCalViewFilter calViewFilter( CalCommon::EIncludeAppts ); + + TTime startTime, endTime; + TCalTime startCalTime, endCalTime; + + startTime.Set( KRecurrentCalendarEntryStartTime ); + endTime.Set( KRecurrentCalendarEntryEndTime ); + + TBuf<32> sTime; + TBuf<32> eTime; + startTime.FormatL( sTime, KTimeFormat ); + endTime.FormatL( eTime, KTimeFormat ); + + startCalTime.SetTimeLocalL( startTime ); + endCalTime.SetTimeLocalL( endTime ); + + instanceView->FindInstanceL( + instanceList, + calViewFilter, + CalCommon::TCalTimeRange( startCalTime, endCalTime ) ); + + EUNIT_ASSERT_DESC( instanceList.Count() == 2, + "Incorrect number of instances returned."); + + CCalEntry& calEntry = instanceList[0]->Entry(); + + // Set time range. + startTime.Set( KRecurrentEntryTimeRangeStartTime ); + endTime.Set( KRecurrentEntryTimeRangeEndTime ); + + startCalTime.SetTimeLocalL( startTime ); + endCalTime.SetTimeLocalL( endTime ); + + // Fetch recurrent event instances. + RPointerArray entryList; + iConflictChecker->FindInstancesForEntryL( startTime, endTime, calEntry, entryList ); + + EUNIT_ASSERT_DESC( entryList.Count() == 6, + "Incorrect number of calendar entry instances returned."); + + // Clear entry/instance lists. + while ( instanceList.Count() ) + { + delete instanceList[ 0 ]; + instanceList.Remove( 0 ); + } + while ( entryList.Count() ) + { + delete entryList[ 0 ]; + entryList.Remove( 0 ); + } + instanceList.Close(); + entryList.Close(); + } + +// - EUnit test table -------------------------------------------------------- + +EUNIT_BEGIN_TEST_TABLE( + UT_CESMRConflictChecker, + "CESMRConflictChecker unit and module tests.", + "UNIT" ) + +EUNIT_TEST( + "NewL", + "CESMRConflictChecker", + "NewL", + "FUNCTIONALITY", + SetupL, T_Global_NewL, Teardown ) + +EUNIT_TEST( + "FindConflictsL", + "CESMRConflictChecker", + "FindConflictsL", + "FUNCTIONALITY", + SetupL, T_Global_FindConflictsL, Teardown ) + +EUNIT_TEST( + "FindInstancesForEntryL", + "CESMRConflictChecker", + "FindInstancesForEntryL", + "FUNCTIONALITY", + SetupL, T_Global_FindInstancesForEntryL, Teardown ) + +EUNIT_END_TEST_TABLE diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrentry/tsrc/ut_mrentry/src/ut_cesmrmeetingrequestentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrentry/tsrc/ut_mrentry/src/ut_cesmrmeetingrequestentry.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,624 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Entry unit and module tests +* Version : %version: e002sa33#3 % +* +* Copyright ? 2008-2008 Nokia. All rights reserved. +*/ + + +#include "ut_cesmrmeetingrequestentry.h" + + +// SYSTEM INCLUDES +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// USER INCLUDES +#include "cesmrmeetingrequestentry.h" +#include "cesmrcaldbmgr.h" +#include "esmrentryhelper.h" + + + +// CONSTANTS + +// LOCAL DEFINITIONS + +namespace { + +// Default Calendar database path "Calendar_test");// +_LIT( KCalendarDatabaseFilePath, "c:Calendar_test" ); + + +_LIT( KUser1, "foo1@bar.com" ); +_LIT( KUser2, "foo2@bar.com" ); +_LIT( KUser3, "foo3@bar.com" ); +_LIT( KUser4, "foo4@bar.com" ); +_LIT( KUser5, "foo5@bar.com" ); +_LIT( KUser6, "foo6@bar.com" ); +_LIT( KOrg, "foo7@bar.com"); +_LIT( KAtOrg, "cayenne2@digia.com"); + + +CCalEntry* CreateEntryL( CCalEntry::TType aType, + TCalTime aStartCalTime, + TCalTime aEndCalTime ) + { + CCalenInterimUtils2* utils = CCalenInterimUtils2::NewL(); + CleanupStack::PushL( utils ); + // Create unique ID. + HBufC8* guid = utils->GlobalUidL(); + CleanupStack::PushL(guid); + CCalEntry* entry = CCalEntry::NewL( aType, guid, CCalEntry::EMethodNone, 0 ); + CleanupStack::Pop( guid ); + CleanupStack::PushL( entry ); + + //TEST DATA + TDateTime start = aStartCalTime.TimeLocalL().DateTime(); + TDateTime end = aEndCalTime.TimeLocalL().DateTime(); + + entry->SetStartAndEndTimeL( aStartCalTime, aEndCalTime ); + CleanupStack::Pop( entry ); + CleanupStack::PopAndDestroy( utils ); + + return entry; + } + +CCalAttendee* CreateAttendeeLC( const TDesC& aAddress, CCalAttendee::TCalRole aRole ) + { + CCalAttendee* attendee = CCalAttendee::NewL(aAddress); + CleanupStack::PushL(attendee); + attendee->SetRoleL(aRole); + + return attendee; + } + +CCalAttendee* SetAttendeeLC( CCalEntry& aEntry, const TDesC& aAddress, CCalAttendee::TCalRole aRole ) + { + CCalAttendee* attendee = CreateAttendeeLC( aAddress, aRole ); + aEntry.AddAttendeeL( attendee ); + + return attendee; + } + + +} //namespace + +// - Construction ------------------------------------------------------------ + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntryImpl::NewL +// --------------------------------------------------------------------------- +// +UT_CESMRMeetingRequestEntry* UT_CESMRMeetingRequestEntry::NewL() + { + UT_CESMRMeetingRequestEntry* self = UT_CESMRMeetingRequestEntry::NewLC(); + CleanupStack::Pop(); + return self; + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::NewLC +// --------------------------------------------------------------------------- +// +UT_CESMRMeetingRequestEntry* UT_CESMRMeetingRequestEntry::NewLC() + { + UT_CESMRMeetingRequestEntry* self = new( ELeave ) UT_CESMRMeetingRequestEntry(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::~UT_CESMRMeetingRequestEntry +// --------------------------------------------------------------------------- +// +UT_CESMRMeetingRequestEntry::~UT_CESMRMeetingRequestEntry() + { + delete iMRMailboxUtils; iMRMailboxUtils = NULL; + delete iEntry; iEntry = NULL; + delete iCtrlSyncher; iCtrlSyncher = NULL; + delete iCalDbMgr; iCalDbMgr = NULL; + delete iCalSession; iCalSession = NULL; + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::UT_CESMRMeetingRequestEntry +// --------------------------------------------------------------------------- +// +UT_CESMRMeetingRequestEntry::UT_CESMRMeetingRequestEntry() + { + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::ConstructL +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + + } + + +// - Utility functions ----------------------------------------------------------- + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::SetupL +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::SetupL() + { + // Creating mailbox utils + iMRMailboxUtils = CMRMailboxUtils::NewL( NULL ); + + // Creating calSession to calendar database + iCalSession = CCalSession::NewL(); + + TRAP_IGNORE( iCalSession->DeleteCalFileL( KCalendarDatabaseFilePath )); + + TRAPD( err, iCalSession->OpenL( KCalendarDatabaseFilePath )); + if ( err == KErrNotFound ) + { + iCalSession->CreateCalFileL( KCalendarDatabaseFilePath ); + iCalSession->OpenL( KCalendarDatabaseFilePath ); + } + else + { + User::LeaveIfError( err ); + } + + iCalDbMgr = CESMRCalDbMgr::NewL( *iCalSession, *this ); + + iConflictsExists = EFalse; + + ExecuteL(); + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::Teardown +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::Teardown() + { + delete iMrEntry; iMrEntry = NULL; + delete iMRMailboxUtils; iMRMailboxUtils = NULL; + delete iEntry; iEntry = NULL; + delete iCtrlSyncher; iCtrlSyncher = NULL; + delete iCalDbMgr; iCalDbMgr = NULL; + delete iCalSession; iCalSession = NULL; + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::CreateCalEntryL +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::CreateCalEntryL() + { + TTime time; + time.HomeTime(); + TCalTime initialCalTime; initialCalTime.SetTimeLocalL( time ); + TTimeIntervalHours hour( 1 ); + TCalTime initialCalEndTime; time += hour; initialCalEndTime.SetTimeLocalL( time ); + + iEntry = CreateEntryL( CCalEntry::EAppt, initialCalTime, initialCalEndTime ); + + // Location + _LIT( KLocation, "Meeting Room data 123" ); + iEntry->SetLocationL( KLocation() ); + // Method for 'remove from cal' option test + // iEntry->SetMethodL( CCalEntry::EMethodCancel ); + + // Description + _LIT( KDesc, "Description field data" ); + iEntry->SetDescriptionL( KDesc() ); + + // Subject + _LIT( KSummary, "Summary field data" ); + iEntry->SetSummaryL( KSummary() ); + + // Setting alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + TTimeIntervalMinutes offset(60); + alarm->SetTimeOffset( offset ); + iEntry->SetAlarmL( alarm ); + delete alarm; alarm = NULL; + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::CalEntryL +// --------------------------------------------------------------------------- +// +CCalEntry* UT_CESMRMeetingRequestEntry::CCalEntryL() + { + TTime time; + time.HomeTime(); + TCalTime initialCalTime; initialCalTime.SetTimeLocalL( time ); + TTimeIntervalHours hour( 1 ); + TCalTime initialCalEndTime; time += hour; initialCalEndTime.SetTimeLocalL( time ); + + CCalEntry* entry = CreateEntryL( CCalEntry::EAppt, initialCalTime, initialCalEndTime ); + + // Location + _LIT( KLocation, "Meeting Room data 123" ); + entry->SetLocationL( KLocation() ); + + // Description + _LIT( KDesc, "Description field data" ); + entry->SetDescriptionL( KDesc() ); + + // Subject + _LIT( KSummary, "Summary field data" ); + entry->SetSummaryL( KSummary() ); + + // Setting alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + TTimeIntervalMinutes offset(60); + alarm->SetTimeOffset( offset ); + entry->SetAlarmL( alarm ); + delete alarm; alarm = NULL; + + return entry; + } + + +// ----------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::HandleCalEngStatus +// ----------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::HandleCalEngStatus( TMRUtilsCalEngStatus /*aStatus*/ ) + { + if ( iCtrlSyncher->CanStopNow() ) + { + iCtrlSyncher->AsyncStop(); + } + } + +// ----------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::HandleOperation +// ----------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::HandleOperation( + TInt /*aType*/, + TInt /*aPercentageCompleted*/, + TInt /*aStatus*/ ) + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::ExecuteL +// ----------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::ExecuteL() + { + iExecutionError = KErrNone; + + iCtrlSyncher = new (ELeave) CActiveSchedulerWait; + + iCtrlSyncher->Start(); + } + +// ----------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::CreateMREntryL +// ----------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::CreateMREntryL() + { + iMrEntry = CESMRMeetingRequestEntry::NewL( + *iEntry, + *iMRMailboxUtils, + *iCalDbMgr, + iConflictsExists, + NULL ); + } + +// - Test methods ----------------------------------------------------------- + + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::T_Global_CESMRMeetingRequestEntry_NewL +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::T_Global_CESMRMeetingRequestEntry_NewL() + { + CreateCalEntryL(); // Creating iEntry + + iMrEntry = CESMRMeetingRequestEntry::NewL( + *iEntry, + *iMRMailboxUtils, + *iCalDbMgr, + iConflictsExists, + NULL ); + + EUNIT_ASSERT_DESC( iMrEntry, "CESMRMeetingRequestEntry::NewL failed" ); + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::T_ValidateEntryL_1 +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::T_ValidateEntryL_1() + { + // entry1 = Normal once occuring entry + CCalEntry* entry1 = CCalEntryL(); + + // Saving entry to caldb + MESMRCalDbMgr& mgr = *iCalDbMgr; + mgr.StoreEntryL( *entry1, ETrue ); + + iEntry = entry1; //ownership transfered to iEntry + + CreateMREntryL(); + CCalEntry* validatedEntry1 = iMrEntry->ValidateEntryL(); + + TCalLocalUid entry1uid = entry1->LocalUidL(); + TCalLocalUid validateuid = validatedEntry1->LocalUidL(); + +/* + EUNIT_ASSERT_DESC( validateuid == entry1uid, + "Entry1 local uid should be the same as validated entrys!" ); +*/ + + EUNIT_ASSERT_DESC( validatedEntry1->UidL() == entry1->UidL(), + "Entry1 local uid should be the same as validated entrys!" ); + + EUNIT_ASSERT_DESC( validatedEntry1->RecurrenceIdL().TimeLocalL() == + entry1->RecurrenceIdL().TimeLocalL(), + "Entry1 recurrence id should be the same as validated entrys!" ); + + + delete validatedEntry1; validatedEntry1 = NULL; + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::T_ValidateEntryL_2 +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::T_ValidateEntryL_2() + { + // entry2 = recurring entry + CCalEntry* entry2 = CCalEntryL(); + + // Adjusting entry2 start and end time + TCalTime newStartTime; + TCalTime newEndTime; + TTime newStart = entry2->StartTimeL().TimeLocalL() + TTimeIntervalDays(10); + TTime newEnd = entry2->EndTimeL().TimeLocalL() + TTimeIntervalDays(10); + newStartTime.SetTimeLocalL( newStart ); + newEndTime.SetTimeLocalL( newEnd ); + entry2->SetStartAndEndTimeL( newStartTime , newEndTime ); + + // Adding recurrence to entry2 + TCalTime meetingStartTime = entry2->StartTimeL(); + TCalRRule rRule; + rRule.SetType( TCalRRule::EDaily ); + rRule.SetCount( 5 ); + rRule.SetDtStart( meetingStartTime ); + entry2->SetRRuleL( rRule ); + + // Saving entries to caldb + MESMRCalDbMgr& mgr = *iCalDbMgr; + mgr.StoreEntryL( *entry2, ETrue ); + + // If all went well, entry2 has been saved to db correctly, so let's use that + iEntry = entry2; // ownership transfered + + // Creating iMrEntry based on this modifying entry + CreateMREntryL(); + + iMrEntry->SetModifyingRuleL( MESMRCalEntry::EESMRThisOnly ); + + CCalEntry* validatedEntry2 = iMrEntry->ValidateEntryL(); + + // Verification + if( validatedEntry2->EntryTypeL() != iEntry->EntryTypeL() ) + { + EUNIT_FAIL_TEST( "Validated entrys type has changed!" ); + } + else if( validatedEntry2->UidL().Compare( iEntry->UidL() )) + { + EUNIT_FAIL_TEST( "Validated entrys uid is no longer the original one!" ); + } + else if ( validatedEntry2->LocalUidL() != 0 ) + { + EUNIT_FAIL_TEST( "Validated entrys local uid is not zero!" ); + } + else if ( validatedEntry2->SequenceNumberL() != 0 ) + { + EUNIT_FAIL_TEST( "Validated entrys sequence number is not zero!" ); + } + else if( validatedEntry2->SummaryL().Compare( iEntry->SummaryL() )) + { + EUNIT_FAIL_TEST( "Validated entrys summary is no longer the original one!" ); + } + else if ( validatedEntry2->RecurrenceRangeL() != CalCommon::EThisOnly ) + { + EUNIT_FAIL_TEST( "Validated entrys recurrence range is not EThisOnly!" ); + } + else if ( validatedEntry2->StartTimeL().TimeLocalL() != iEntry->StartTimeL().TimeLocalL() ) + { + EUNIT_FAIL_TEST( "Validated entrys start time has changed from original!" ); + } + else + { + EUNIT_ASSERT_DESC( validatedEntry2, "Enrty validated correctly" ) + } + + delete validatedEntry2; validatedEntry2 = NULL; + } + + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::T_EntryAttendeeInfoL +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::T_EntryAttendeeInfoL() + { + CreateCalEntryL(); // Creating iEntry + + CCalAttendee* organizer = CreateAttendeeLC( KAtOrg(), CCalAttendee::EChair ); + iEntry->SetOrganizerL( organizer ); + iEntry->SetPhoneOwnerL( organizer ); + CleanupStack::Pop( organizer ); + + SetAttendeeLC( *iEntry, KUser1(), CCalAttendee::EReqParticipant ); + CleanupStack::Pop(); + + SetAttendeeLC( *iEntry, KUser2(), CCalAttendee::EReqParticipant ); + CleanupStack::Pop(); + + SetAttendeeLC( *iEntry, KUser3(), CCalAttendee::EReqParticipant ); + CleanupStack::Pop(); + + SetAttendeeLC( *iEntry, KUser4(), CCalAttendee::EOptParticipant ); + CleanupStack::Pop(); + + SetAttendeeLC( *iEntry, KUser5(), CCalAttendee::EOptParticipant ); + CleanupStack::Pop(); + + SetAttendeeLC( *iEntry, KUser6(), CCalAttendee::EOptParticipant ); + CleanupStack::Pop(); + + CCalUser* phoneOwner = iEntry->PhoneOwnerL(); + CCalUser* org = iEntry->OrganizerL(); + + CreateMREntryL(); // Creating iMrEntry + // Test data + TESMRRole role = iMrEntry->RoleL(); + + // When entry is organizer, attendee info should leave with KErrNotSupported + //EUNIT_ASSERT_SPECIFIC_LEAVE( iMrEntry->EntryAttendeeInfoL(), KErrNotSupported ); + delete iMrEntry; iMrEntry = NULL; + + // PhoneOwner is set different than organizer, so that AttendeeInfo gives valid value + CCalAttendee* attendee = SetAttendeeLC( *iEntry, KUser1(), CCalAttendee::EReqParticipant ); + iEntry->SetPhoneOwnerL( attendee ); + CleanupStack::Pop( attendee ); + + // Setting entry to occure in the past so that return value is EESMREntryInfoOccursInPast + TCalTime newStartTime; + TCalTime newEndTime; + TTime newStart = iEntry->StartTimeL().TimeLocalL() - TTimeIntervalDays(10); + TTime newEnd = iEntry->EndTimeL().TimeLocalL() - TTimeIntervalDays(10); + newStartTime.SetTimeLocalL( newStart ); + newEndTime.SetTimeLocalL( newEnd ); + iEntry->SetStartAndEndTimeL( newStartTime , newEndTime ); + + CreateMREntryL(); // Creating iMrEntry + // Test data + role = iMrEntry->RoleL(); + + MESMRMeetingRequestEntry::TESMREntryInfo attendeeInfo = iMrEntry->EntryAttendeeInfoL(); + + EUNIT_ASSERT_DESC( attendeeInfo == MESMRMeetingRequestEntry::EESMREntryInfoOccursInPast, + "Entrys attendee info should be EESMREntryInfoOccursInPast" ); + + } + +// --------------------------------------------------------------------------- +// UT_CESMRMeetingRequestEntry::T_GetRecurrenceL +// --------------------------------------------------------------------------- +// +void UT_CESMRMeetingRequestEntry::T_GetRecurrenceL() + { + CreateCalEntryL(); // Creating iEntry + + // Setting recurrence + TCalTime meetingStartTime = iEntry->StartTimeL(); + TCalRRule rRule; + rRule.SetType( TCalRRule::EDaily ); + rRule.SetCount( 5 ); + //rRule.SetInterval( 1 ); + rRule.SetDtStart( meetingStartTime ); + iEntry->SetRRuleL( rRule ); + // Entry is repeating 5 times every day from today onwards + + CreateMREntryL(); // Creating iMrEntry + + TESMRRecurrenceValue recurrence; + TTime until; + iMrEntry->GetRecurrenceL( recurrence, until ); + + TTime recurrenceUntil = meetingStartTime.TimeUtcL() + TTimeIntervalDays(4); + + // Test data + TDateTime start = meetingStartTime.TimeLocalL().DateTime(); + TDateTime givenUntil = recurrenceUntil.DateTime(); + TDateTime fetchedUntil = until.DateTime(); + + EUNIT_ASSERT_DESC( recurrence == ERecurrenceDaily, "Entry should be recurring daily" ); + EUNIT_ASSERT_DESC( until == recurrenceUntil, "Entrys until time is not 5 days from now" ); + } + + +// - EUnit test table -------------------------------------------------------- + +EUNIT_BEGIN_TEST_TABLE( + UT_CESMRMeetingRequestEntry, + "MRMeetingRequestEntry unit and module tests.", + "UNIT" ) + +EUNIT_TEST( + "Class creation (NewL)", + "CESMRMeetingRequestEntry", + "NewL", + "FUNCTIONALITY", + SetupL, T_Global_CESMRMeetingRequestEntry_NewL, Teardown ) + +EUNIT_TEST( + "Validate Entry - 1", + "CESMRMeetingRequestEntry", + "ValidateEntryL", + "FUNCTIONALITY", + SetupL, T_ValidateEntryL_1, Teardown ) + +EUNIT_TEST( + "Validate Entry - 2", + "CESMRMeetingRequestEntry", + "ValidateEntryL", + "FUNCTIONALITY", + SetupL, T_ValidateEntryL_2, Teardown ) + +EUNIT_TEST( + "Entry Attendee Info", + "CESMRMeetingRequestEntry", + "EntryAttendeeInfoL", + "FUNCTIONALITY", + SetupL, T_EntryAttendeeInfoL, Teardown ) + +EUNIT_TEST( + "Get recurrence", + "CESMRMeetingRequestEntry", + "GetRecurrenceL", + "FUNCTIONALITY", + SetupL, T_GetRecurrenceL, Teardown ) + +EUNIT_END_TEST_TABLE diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/bwins/ESMRGUIU.def --- a/meetingrequest/mrgui/bwins/ESMRGUIU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/bwins/ESMRGUIU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,71 +1,9 @@ EXPORTS - ?Text@CESMRAlarm@@QAEPAVHBufC16@@XZ @ 1 NONAME ; class HBufC16 * CESMRAlarm::Text(void) - ?GetFieldRowLayoutRect@NMRLayoutManager@@YA?AVTAknLayoutRect@@ABVTRect@@H@Z @ 2 NONAME ; class TAknLayoutRect NMRLayoutManager::GetFieldRowLayoutRect(class TRect const &, int) - ?GetLayoutText@NMRLayoutManager@@YA?AVTAknLayoutText@@ABVTRect@@W4TMRTextLayout@1@@Z @ 3 NONAME ; class TAknLayoutText NMRLayoutManager::GetLayoutText(class TRect const &, enum NMRLayoutManager::TMRTextLayout) - ?ConflictPopupPosition@CESMRLayoutManager@@SA?AVTPoint@@XZ @ 4 NONAME ; class TPoint CESMRLayoutManager::ConflictPopupPosition(void) - ??1CESMRUiFactory@@UAE@XZ @ 5 NONAME ; CESMRUiFactory::~CESMRUiFactory(void) - ?ExecuteDlgLD@CESMRResponseDialog@@QAEHXZ @ 6 NONAME ; int CESMRResponseDialog::ExecuteDlgLD(void) - ?GetContactManager@CESMRContactManagerHandler@@QAEAAVCVPbkContactManager@@XZ @ 7 NONAME ; class CVPbkContactManager & CESMRContactManagerHandler::GetContactManager(void) - ?SetCommandObserver@CESMRContactMenuHandler@@QAEXPAVMEikCommandObserver@@@Z @ 8 NONAME ; void CESMRContactMenuHandler::SetCommandObserver(class MEikCommandObserver *) - ?SetBitmapFallback@CESMRLayoutManager@@SAXABVTAknsItemID@@AAH1@Z @ 9 NONAME ; void CESMRLayoutManager::SetBitmapFallback(class TAknsItemID const &, int &, int &) - ?AddObserverL@CESMRContactManagerHandler@@QAEXPAVMESMRContactManagerObserver@@@Z @ 10 NONAME ; void CESMRContactManagerHandler::AddObserverL(class MESMRContactManagerObserver *) - ?NewL@CESMRUiFactory@@SAPAV1@XZ @ 11 NONAME ; class CESMRUiFactory * CESMRUiFactory::NewL(void) - ?NewL@CESMRViewerDialog@@SAPAV1@PAVCESMRPolicy@@AAVMESMRCalEntry@@AAVMAgnEntryUiCallback@@@Z @ 12 NONAME ; class CESMRViewerDialog * CESMRViewerDialog::NewL(class CESMRPolicy *, class MESMRCalEntry &, class MAgnEntryUiCallback &) - ?IsReady@CESMRContactManagerHandler@@QAEHXZ @ 13 NONAME ; int CESMRContactManagerHandler::IsReady(void) - ?SendAsVCalendarL@CESMRSendUI@@QAEXHAAVCCalEntry@@@Z @ 14 NONAME ; void CESMRSendUI::SendAsVCalendarL(int, class CCalEntry &) - ??0CESMRRecurrence@@QAE@XZ @ 15 NONAME ; CESMRRecurrence::CESMRRecurrence(void) - ?LoadTextL@CESMRAlarm@@QAEXPAVCCoeEnv@@@Z @ 16 NONAME ; void CESMRAlarm::LoadTextL(class CCoeEnv *) - ?IsMirrored@CESMRLayoutManager@@SAHXZ @ 17 NONAME ; int CESMRLayoutManager::IsMirrored(void) - ??1RESMRStatic@@QAE@XZ @ 18 NONAME ; RESMRStatic::~RESMRStatic(void) - ??1CMRImage@@UAE@XZ @ 19 NONAME ; CMRImage::~CMRImage(void) - ?ExecuteL@CESMRGlobalNote@@SAXW4TESMGlobalNoteType@1@@Z @ 20 NONAME ; void CESMRGlobalNote::ExecuteL(enum CESMRGlobalNote::TESMGlobalNoteType) - ?NewL@CMRImage@@SAPAV1@ABVTAknsItemID@@W4TScaleMode@@@Z @ 21 NONAME ; class CMRImage * CMRImage::NewL(class TAknsItemID const &, enum TScaleMode) - ?ExecuteL@CESMRConfirmationQuery@@SAHW4TESMRConfirmationQueryType@1@@Z @ 22 NONAME ; int CESMRConfirmationQuery::ExecuteL(enum CESMRConfirmationQuery::TESMRConfirmationQueryType) - ?RecurrenceText@CESMRRecurrence@@QAEAAVHBufC16@@XZ @ 23 NONAME ; class HBufC16 & CESMRRecurrence::RecurrenceText(void) - ?NewL@CESMRGlobalNote@@SAPAV1@W4TESMGlobalNoteType@1@@Z @ 24 NONAME ; class CESMRGlobalNote * CESMRGlobalNote::NewL(enum CESMRGlobalNote::TESMGlobalNoteType) - ?Id@CESMRAlarm@@QAEHXZ @ 25 NONAME ; int CESMRAlarm::Id(void) - ?ExecuteLD@CESMRListQuery@@QAEHXZ @ 26 NONAME ; int CESMRListQuery::ExecuteLD(void) - ?GetFieldLayoutRect@NMRLayoutManager@@YA?AVTAknLayoutRect@@ABVTRect@@H@Z @ 27 NONAME ; class TAknLayoutRect NMRLayoutManager::GetFieldLayoutRect(class TRect const &, int) - ?SetValueL@CESMRContactMenuHandler@@QAEXABVTDesC16@@W4TValueType@1@@Z @ 28 NONAME ; void CESMRContactMenuHandler::SetValueL(class TDesC16 const &, enum CESMRContactMenuHandler::TValueType) - ?GetBitmapStruct@NMRBitmapManager@@YA?AVTMRBitmapStruct@1@W4TMRBitmapId@1@@Z @ 29 NONAME ; class NMRBitmapManager::TMRBitmapStruct NMRBitmapManager::GetBitmapStruct(enum NMRBitmapManager::TMRBitmapId) - ?ExecuteL@CESMRListQuery@@SAHW4TESMRListQueryType@1@@Z @ 30 NONAME ; int CESMRListQuery::ExecuteL(enum CESMRListQuery::TESMRListQueryType) - ?Close@RESMRStatic@@QAEXXZ @ 31 NONAME ; void RESMRStatic::Close(void) - ?ShowActionMenuL@CESMRContactMenuHandler@@QAEXXZ @ 32 NONAME ; void CESMRContactMenuHandler::ShowActionMenuL(void) - ?ContactMenuHandlerL@RESMRStatic@@QAEAAVCESMRContactMenuHandler@@XZ @ 33 NONAME ; class CESMRContactMenuHandler & RESMRStatic::ContactMenuHandlerL(void) - ?SetAttachmentInfoL@CESMRContactMenuHandler@@QAEXPAVCESMRAttachmentInfo@@@Z @ 34 NONAME ; void CESMRContactMenuHandler::SetAttachmentInfoL(class CESMRAttachmentInfo *) - ??1CESMRRecurrence@@UAE@XZ @ 35 NONAME ; CESMRRecurrence::~CESMRRecurrence(void) - ??0RESMRStatic@@QAE@XZ @ 36 NONAME ; RESMRStatic::RESMRStatic(void) - ?DisplaySendCascadeMenuL@CESMRSendUI@@QAEXAAVCEikMenuPane@@@Z @ 37 NONAME ; void CESMRSendUI::DisplaySendCascadeMenuL(class CEikMenuPane &) - ?NewL@CESMRSendUI@@SAPAV1@H@Z @ 38 NONAME ; class CESMRSendUI * CESMRSendUI::NewL(int) - ??1CMRLabel@@UAE@XZ @ 39 NONAME ; CMRLabel::~CMRLabel(void) - ?CurrentFieldIndex@RESMRStatic@@QAEHXZ @ 40 NONAME ; int RESMRStatic::CurrentFieldIndex(void) - ?GetSkinBasedBitmap@NMRBitmapManager@@YAHW4TMRBitmapId@1@AAPAVCFbsBitmap@@1VTSize@@@Z @ 41 NONAME ; int NMRBitmapManager::GetSkinBasedBitmap(enum NMRBitmapManager::TMRBitmapId, class CFbsBitmap * &, class CFbsBitmap * &, class TSize) - ?RemoveObserver@CESMRContactManagerHandler@@QAEXPAVMESMRContactManagerObserver@@@Z @ 42 NONAME ; void CESMRContactManagerHandler::RemoveObserver(class MESMRContactManagerObserver *) - ?ConstructFromResourceL@CESMRAlarm@@QAEXAAVTResourceReader@@@Z @ 43 NONAME ; void CESMRAlarm::ConstructFromResourceL(class TResourceReader &) - ?RecurrenceValue@CESMRRecurrence@@QAE?AW4TESMRRecurrenceValue@@XZ @ 44 NONAME ; enum TESMRRecurrenceValue CESMRRecurrence::RecurrenceValue(void) - ?RelativeTimeInMinutes@CESMRAlarm@@QAE?AVTTimeIntervalMinutes@@XZ @ 45 NONAME ; class TTimeIntervalMinutes CESMRAlarm::RelativeTimeInMinutes(void) - ?CanSendL@CESMRSendUI@@QAEHH@Z @ 46 NONAME ; int CESMRSendUI::CanSendL(int) - ?DisplaySendMenuItemL@CESMRSendUI@@QAEXAAVCEikMenuPane@@H@Z @ 47 NONAME ; void CESMRSendUI::DisplaySendMenuItemL(class CEikMenuPane &, int) - ?NewL@CESMREditorDialog@@SAPAV1@PAVCESMRPolicy@@AAVMESMRCalEntry@@AAVMAgnEntryUiCallback@@@Z @ 48 NONAME ; class CESMREditorDialog * CESMREditorDialog::NewL(class CESMRPolicy *, class MESMRCalEntry &, class MAgnEntryUiCallback &) - ?NewL@CMRImage@@SAPAV1@W4TMRBitmapId@NMRBitmapManager@@W4TScaleMode@@@Z @ 49 NONAME ; class CMRImage * CMRImage::NewL(enum NMRBitmapManager::TMRBitmapId, enum TScaleMode) - ?ContactManagerHandlerL@RESMRStatic@@QAEAAVCESMRContactManagerHandler@@XZ @ 50 NONAME ; class CESMRContactManagerHandler & RESMRStatic::ContactManagerHandlerL(void) - ?ExecuteEditBeforeSendL@CESMRListQuery@@SAHW4TESMRAttendeeStatus@@@Z @ 51 NONAME ; int CESMRListQuery::ExecuteEditBeforeSendL(enum TESMRAttendeeStatus) - ?GetLayoutRect@NMRLayoutManager@@YA?AVTAknLayoutRect@@ABVTRect@@W4TMRLayout@1@@Z @ 52 NONAME ; class TAknLayoutRect NMRLayoutManager::GetLayoutRect(class TRect const &, enum NMRLayoutManager::TMRLayout) - ?Reset@CESMRContactMenuHandler@@QAEXXZ @ 53 NONAME ; void CESMRContactMenuHandler::Reset(void) - ?ExecuteL@CESMRGUIListQuery@@SAHW4TESMRListQueryType@1@@Z @ 54 NONAME ; int CESMRGUIListQuery::ExecuteL(enum CESMRGUIListQuery::TESMRListQueryType) - ?ConnectL@RESMRStatic@@QAEXXZ @ 55 NONAME ; void RESMRStatic::ConnectL(void) - ?ExecuteEditBeforeSendWithSendOptOnlyL@CESMRListQuery@@SAHW4TESMRAttendeeStatus@@@Z @ 56 NONAME ; int CESMRListQuery::ExecuteEditBeforeSendWithSendOptOnlyL(enum TESMRAttendeeStatus) - ?NewL@CESMRListQuery@@SAPAV1@W4TESMRListQueryType@1@@Z @ 57 NONAME ; class CESMRListQuery * CESMRListQuery::NewL(enum CESMRListQuery::TESMRListQueryType) - ?GetTextComponentLayout@NMRLayoutManager@@YA?AVTAknTextComponentLayout@@W4TMRTextLayout@1@@Z @ 58 NONAME ; class TAknTextComponentLayout NMRLayoutManager::GetTextComponentLayout(enum NMRLayoutManager::TMRTextLayout) - ?CreateUIL@CESMRUiFactory@@UAEPAVMESMRUiBase@@PAVCESMRPolicy@@AAVMESMRCalEntry@@AAVMAgnEntryUiCallback@@@Z @ 59 NONAME ; class MESMRUiBase * CESMRUiFactory::CreateUIL(class CESMRPolicy *, class MESMRCalEntry &, class MAgnEntryUiCallback &) - ?ConstructFromResourceL@CESMRRecurrence@@QAEXPAVCCoeEnv@@AAVTResourceReader@@@Z @ 60 NONAME ; void CESMRRecurrence::ConstructFromResourceL(class CCoeEnv *, class TResourceReader &) - ?GetWindowComponentLayout@NMRLayoutManager@@YA?AVTAknWindowComponentLayout@@W4TMRLayout@1@@Z @ 61 NONAME ; class TAknWindowComponentLayout NMRLayoutManager::GetWindowComponentLayout(enum NMRLayoutManager::TMRLayout) - ?Relative@CESMRAlarm@@QAEHXZ @ 62 NONAME ; int CESMRAlarm::Relative(void) - ??0CESMRAlarm@@QAE@XZ @ 63 NONAME ; CESMRAlarm::CESMRAlarm(void) - ?SetCurrentFieldIndex@RESMRStatic@@QAEXH@Z @ 64 NONAME ; void RESMRStatic::SetCurrentFieldIndex(int) - ??1CESMRSendUI@@UAE@XZ @ 65 NONAME ; CESMRSendUI::~CESMRSendUI(void) - ?NewL@CMRLabel@@SAPAV1@XZ @ 66 NONAME ; class CMRLabel * CMRLabel::NewL(void) - ?NewL@CESMRResponseDialog@@SAPAV1@AAPAVHBufC16@@@Z @ 67 NONAME ; class CESMRResponseDialog * CESMRResponseDialog::NewL(class HBufC16 * &) - ??1CESMRAlarm@@UAE@XZ @ 68 NONAME ; CESMRAlarm::~CESMRAlarm(void) - ?MailBoxL@RESMRStatic@@QAEAAVCFSMailBox@@ABVTDesC16@@@Z @ 69 NONAME ; class CFSMailBox & RESMRStatic::MailBoxL(class TDesC16 const &) + ?NewL@CESMREditorDialog@@SAPAV1@AAVMMRInfoProvider@@AAVMAgnEntryUiCallback@@@Z @ 1 NONAME ; class CESMREditorDialog * CESMREditorDialog::NewL(class MMRInfoProvider &, class MAgnEntryUiCallback &) + ?ExecuteDlgLD@CESMRResponseDialog@@QAEHXZ @ 2 NONAME ; int CESMRResponseDialog::ExecuteDlgLD(void) + ?NewL@CESMRUiFactory@@SAPAV1@XZ @ 3 NONAME ; class CESMRUiFactory * CESMRUiFactory::NewL(void) + ?NewL@CESMRViewerDialog@@SAPAV1@AAVMMRInfoProvider@@AAVMAgnEntryUiCallback@@@Z @ 4 NONAME ; class CESMRViewerDialog * CESMRViewerDialog::NewL(class MMRInfoProvider &, class MAgnEntryUiCallback &) + ?NewL@CESMRResponseDialog@@SAPAV1@AAPAVHBufC16@@@Z @ 5 NONAME ; class CESMRResponseDialog * CESMRResponseDialog::NewL(class HBufC16 * &) + ?CreateUIL@CESMRUiFactory@@UAEPAVMESMRUiBase@@AAVMMRInfoProvider@@AAVMAgnEntryUiCallback@@@Z @ 6 NONAME ; class MESMRUiBase * CESMRUiFactory::CreateUIL(class MMRInfoProvider &, class MAgnEntryUiCallback &) + ??1CESMRUiFactory@@UAE@XZ @ 7 NONAME ; CESMRUiFactory::~CESMRUiFactory(void) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/data/esmrgui.rss --- a/meetingrequest/mrgui/data/esmrgui.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/data/esmrgui.rss Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,26 +22,61 @@ #include #include #include -#include -#include -#include // for service commands +#include +#include +#include // for service commands #include -#include -#include -// +#include + #include "esmrdef.h" -// #include "esmrgui.hrh" #include "esmrgui.rh" -// -#include -// -#define MRGUI_ICON_FILE APP_BITMAP_DIR"\\esmrgui.mif" -#define EMAILUI_ICON_FILE APP_BITMAP_DIR"\\FreestyleEmailUi.mif" RESOURCE RSS_SIGNATURE { } +// Included resource files +#include "mrguilocationresources.rss" // r_location_options + + +// --------------------------------------------------------------------------- +// r_global_toolbar +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_TOOLBAR r_global_toolbar + { + flags = KAknToolbarFixed; + // define empty button set in order for the toolbar to be displayed properly, + // buttons will be updated at runtime + items = + { + TBAR_CTRL + { + type = EAknCtButton; + id = 0; + control = AVKON_BUTTON + { + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = 1; + control = AVKON_BUTTON + { + }; + }, + TBAR_CTRL + { + type = EAknCtButton; + id = 2; + control = AVKON_BUTTON + { + }; + } + }; + } + // --------------------------------------------------------------------------- // r_priority_options // @@ -70,38 +105,6 @@ } // --------------------------------------------------------------------------- -// r_location_options -// -// --------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_location_options - { - items = - { - MENU_ITEM - { - command = EESMRCmdAssignFromMap; - txt = qtn_meet_req_options_assign_from_map; - }, - MENU_ITEM - { - command = EESMRCmdSearchFromContacts; - txt = qtn_meet_req_options_search_from_contacts; - }, - MENU_ITEM - { - command = EESMRCmdPreviousLocations; - txt = qtn_meet_req_options_recent_locations; - }, - MENU_ITEM - { - command = EESMRCmdLandmarks; - txt = qtn_meet_req_options_landmarks; - } - }; - } - -// --------------------------------------------------------------------------- // r_mr_editor_organizer_menu // // --------------------------------------------------------------------------- @@ -142,6 +145,11 @@ }, MENU_ITEM { + command = EESMRCmdSaveCloseMR; + txt = qtn_meet_req_opt_save_close; + }, + MENU_ITEM + { command = EESMRCmdCalEntryUISave; txt = qtn_form_litxt_save; }, @@ -170,11 +178,11 @@ command = EESMRCmdAddAttendees; txt = qtn_meet_req_opt_add_participants; }, - MENU_ITEM + MENU_ITEM { - command = EESMRCmdAddLocation; - txt = qtn_meet_req_options_add_location; - cascade=r_location_options; + command = EESMRCmdAddLocation; + txt = qtn_meet_req_options_add_location; + cascade=r_location_options; }, MENU_ITEM { @@ -194,13 +202,6 @@ }, MENU_ITEM { - command = EESMRCmdPrint; // Same ID as in interest. - txt = ""; // AIW plugin will set the text. - // No submenu if only one item in it - cascade = AIW_INTELLIGENT_CASCADE_ID; - }, - MENU_ITEM - { command = EAknCmdHelp; txt = qtn_options_help; }, @@ -213,6 +214,28 @@ } // --------------------------------------------------------------------------- +// r_forward_options +// +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_forward_options + { + items = + { + MENU_ITEM + { + command=EESMRCmdForwardAsMeeting; + txt= qtn_meet_req_opt_meeting; + }, + MENU_ITEM + { + command=EESMRCmdForwardAsMail; + txt= qtn_meet_req_opt_email; + } + }; + } + +// --------------------------------------------------------------------------- // r_mr_viewer_menu // // --------------------------------------------------------------------------- @@ -283,8 +306,9 @@ }, MENU_ITEM { - command = EESMRCmdForward; + command = EESMRCmdForwardOptions; txt = qtn_meet_req_opt_forward; + cascade=r_forward_options; }, MENU_ITEM { @@ -304,12 +328,6 @@ }, MENU_ITEM { - command = EESMRCmdMailEmailMoreMenu; - txt = qtn_meet_req_options_more; - cascade = r_mrviewer_email_menu; - }, - MENU_ITEM - { command = EESMRCmdViewTrack; txt = qtn_meet_req_opt_tracking; }, @@ -341,13 +359,6 @@ }, MENU_ITEM { - command = EESMRCmdPrint; // Same ID as in interest. - txt = ""; // AIW plugin will set the text. - // No submenu if only one item in it - cascade = AIW_INTELLIGENT_CASCADE_ID; - }, - MENU_ITEM - { command = EESMRCmdMailPreviousMessage; txt = qtn_meet_req_options_prev_msg; }, @@ -483,13 +494,6 @@ }, MENU_ITEM { - command = EESMRCmdPrint; // Same ID as in interest. - txt = ""; // AIW plugin will set the text. - // No submenu if only one item in it - cascade = AIW_INTELLIGENT_CASCADE_ID; - }, - MENU_ITEM - { command = EAknCmdHelp; txt = qtn_options_help; }, @@ -500,6 +504,7 @@ } }; } + // --------------------------------------------------------------------------- // r_response_dialog_softkeys_options_send // @@ -766,8 +771,7 @@ buttons = { CBA_BUTTON {id=EAknSoftkeyOptions; txt = text_softkey_option;}, - //CBA_BUTTON {id=EAknSoftkeyClose; txt = text_softkey_close; }, - CBA_BUTTON {id=EAknSoftkeyClose; txt = text_softkey_back; }, + CBA_BUTTON {id=EAknSoftkeyClose; txt = text_softkey_close; }, AVKON_CBA_BUTTON{id=EESMRCmdEdit; longpressid=0; txt= qtn_msk_edit; } }; } @@ -789,7 +793,7 @@ CBA_BUTTON { id=EAknSoftkeyDone; - txt = text_softkey_cancel; + txt = text_softkey_done; }, AVKON_CBA_BUTTON { @@ -873,26 +877,24 @@ txt = qtn_msk_add; } -// --------------------------------------------------------------------------- -// r_ps_aiw_interest +// -------------------------------------------------------------------------- +// r_mr_send_softkey +// -------------------------------------------------------------------------- // -// --------------------------------------------------------------------------- -// -RESOURCE AIW_INTEREST r_ps_aiw_interest +RESOURCE CBA_BUTTON r_mr_send_softkey { - items = - { - // This application is interested in calling from menu. - AIW_CRITERIA_ITEM - { - id = EESMRCmdPrint; - serviceCmd = KAiwCmdPrint; - serviceClass = KAiwClassMenu; - contentType = ".cal"; - defaultProvider = 0x102085EB; // Printing Framework AIW - maxProviders = 1; - } - }; + id=EAknSoftkeySend; + txt = qtn_meet_req_softkey_send; + } + +// -------------------------------------------------------------------------- +// r_mr_done_softkey +// -------------------------------------------------------------------------- +// +RESOURCE CBA_BUTTON r_mr_done_softkey + { + id=EAknSoftkeyDone; + txt = text_softkey_done; } // --------------------------------------------------------------------------- @@ -1250,6 +1252,38 @@ }; } +RESOURCE ESMR_UNIFIED_TABLE r_esmreditor_unified + { + unified = + { + ESMR_UNIFIED + { + id = EESMREventTypeMeetingRequest; + txt = r_qtn_meet_req_title_meeting; + }, + ESMR_UNIFIED + { + id = EESMREventTypeAppt; + txt = r_qtn_calendar_title_meeting; + }, + ESMR_UNIFIED + { + id = EESMREventTypeEEvent; + txt = r_qtn_calendar_title_memo; + }, + ESMR_UNIFIED + { + id = EESMREventTypeEAnniv; + txt = r_qtn_calendar_title_anniversary; + }, + ESMR_UNIFIED + { + id = EESMREventTypeETodo; + txt = r_qtn_calendar_title_todo; + } + }; + } + RESOURCE ESMR_PRIORITY_TABLE r_esmreditor_priority { priority = @@ -1299,10 +1333,6 @@ { buf = qtn_form_quest_save_changes; } -RESOURCE TBUF r_qtn_fs_action_recipient - { - buf = qtn_fs_action_recipient; - } RESOURCE TBUF r_qtn_meet_req_info_note_ends_before { buf = qtn_meet_req_info_note_ends_before; @@ -1319,10 +1349,6 @@ { buf = qtn_meet_req_plain_text_declined; } -RESOURCE TBUF r_qtn_meet_req_plain_text_description - { - buf = qtn_meet_req_plain_text_description; - } RESOURCE TBUF r_qtn_meet_req_plain_text_forwarded { buf = qtn_meet_req_plain_text_forwarded; @@ -1339,22 +1365,6 @@ { buf = qtn_meet_req_recurring_daily; } -RESOURCE TBUF r_qtn_meet_req_add_optional - { - buf = qtn_meet_req_add_optional; - } -RESOURCE TBUF r_qtn_meet_req_add_optional_act - { - buf = qtn_meet_req_add_optional_act; - } -RESOURCE TBUF r_qtn_meet_req_add_required - { - buf = qtn_meet_req_add_required; - } -RESOURCE TBUF r_qtn_meet_req_add_required_act - { - buf = qtn_meet_req_add_required_act; - } RESOURCE TBUF r_qtn_meet_req_alarm_days { buf = qtn_meet_req_alarm_days; @@ -1423,26 +1433,10 @@ { buf = qtn_meet_req_edit_before_send; } -RESOURCE TBUF r_qtn_meet_req_label_accept - { - buf = qtn_meet_req_label_accept; - } -RESOURCE TBUF r_qtn_meet_req_label_cancelled - { - buf = qtn_meet_req_label_cancelled; - } -RESOURCE TBUF r_qtn_meet_req_label_decline - { - buf = qtn_meet_req_label_decline; - } RESOURCE TBUF r_qtn_meet_req_label_from { buf = qtn_meet_req_label_from; } -RESOURCE TBUF r_qtn_meet_req_label_fw - { - buf = qtn_meet_req_label_fw; - } RESOURCE TBUF r_qtn_meet_req_label_opt { buf = qtn_meet_req_label_opt; @@ -1451,102 +1445,22 @@ { buf = qtn_meet_req_label_required; } -RESOURCE TBUF r_qtn_meet_req_label_tentative - { - buf = qtn_meet_req_label_tentative; - } -RESOURCE TBUF r_qtn_meet_req_label_updated - { - buf = qtn_meet_req_label_updated; - } RESOURCE TBUF r_qtn_meet_req_location_field { buf = qtn_meet_req_location_field; } -RESOURCE TBUF r_qtn_meet_req_opt_accept - { - buf = qtn_meet_req_opt_accept; - } -RESOURCE TBUF r_qtn_meet_req_opt_cancel - { - buf = qtn_meet_req_opt_cancel; - } -RESOURCE TBUF r_qtn_meet_req_opt_decline - { - buf = qtn_meet_req_opt_decline; - } -RESOURCE TBUF r_qtn_meet_req_opt_edit +RESOURCE TBUF r_qtn_meet_req_opt_email { - buf = qtn_meet_req_opt_edit; - } -RESOURCE TBUF r_qtn_meet_req_opt_forward - { - buf = qtn_meet_req_opt_forward; + buf = qtn_meet_req_opt_email; } -RESOURCE TBUF r_qtn_meet_req_opt_language +RESOURCE TBUF r_qtn_meet_req_opt_meeting { - buf = qtn_meet_req_opt_language; - } -RESOURCE TBUF r_qtn_meet_req_opt_message - { - buf = qtn_meet_req_opt_message; + buf = qtn_meet_req_opt_meeting; } RESOURCE TBUF r_qtn_meet_req_opt_priority { buf = qtn_meet_req_opt_priority; } -RESOURCE TBUF r_qtn_meet_req_opt_priority_high - { - buf = qtn_meet_req_opt_priority_high; - } -RESOURCE TBUF r_qtn_meet_req_opt_priority_low - { - buf = qtn_meet_req_opt_priority_low; - } -RESOURCE TBUF r_qtn_meet_req_opt_priority_normal - { - buf = qtn_meet_req_opt_priority_normal; - } -RESOURCE TBUF r_qtn_meet_req_opt_reply - { - buf = qtn_meet_req_opt_reply; - } -RESOURCE TBUF r_qtn_meet_req_opt_reply_all - { - buf = qtn_meet_req_opt_reply_all; - } -RESOURCE TBUF r_qtn_meet_req_opt_send - { - buf = qtn_meet_req_opt_send; - } -RESOURCE TBUF r_qtn_meet_req_opt_send_update - { - buf = qtn_meet_req_opt_send_update; - } -RESOURCE TBUF r_qtn_meet_req_opt_tentative - { - buf = qtn_meet_req_opt_tentative; - } -RESOURCE TBUF r_qtn_meet_req_opt_view_cal - { - buf = qtn_meet_req_opt_view_cal; - } -RESOURCE TBUF r_qtn_meet_req_plain_text_end_time - { - buf = qtn_meet_req_plain_text_end_time; - } -RESOURCE TBUF r_qtn_meet_req_plain_text_location - { - buf = qtn_meet_req_plain_text_location; - } -RESOURCE TBUF r_qtn_meet_req_plain_text_start_time - { - buf = qtn_meet_req_plain_text_start_time; - } -RESOURCE TBUF r_qtn_meet_req_plain_text_subject - { - buf = qtn_meet_req_plain_text_subject; - } RESOURCE TBUF r_qtn_meet_req_recurrence_event { buf = qtn_meet_req_recurrence_event; @@ -1575,6 +1489,18 @@ { buf = qtn_meet_req_recurrent_this_occurrence_delete; } +RESOURCE TBUF r_qtn_meet_req_recurrent_heading_forward + { + buf = qtn_meet_req_recurrent_heading_forward; + } +RESOURCE TBUF r_qtn_meet_req_recurrent_fw_this_occurrence + { + buf = qtn_meet_req_recurrent_fw_this_occurrence; + } +RESOURCE TBUF r_qtn_meet_req_fw_recurrent_series + { + buf = qtn_meet_req_fw_recurrent_series; + } RESOURCE TBUF r_qtn_meet_req_recurring_monthly { buf = qtn_meet_req_recurring_monthly; @@ -1631,9 +1557,9 @@ { buf = qtn_meet_req_response_decline; } -RESOURCE TBUF r_qtn_meet_req_response_remove_calendar_event +RESOURCE TBUF r_qtn_meet_req_options_remove_from_cal { - buf = qtn_meet_req_response_remove_calendar_event; + buf = qtn_meet_req_options_remove_from_cal; } RESOURCE TBUF r_qtn_meet_req_response_occurs_past { @@ -1691,10 +1617,6 @@ { buf = qtn_meet_req_set_recurrence_header; } -RESOURCE TBUF r_qtn_meet_req_softkey_send - { - buf = qtn_meet_req_softkey_send; - } RESOURCE TBUF r_qtn_meet_req_subject_field { buf = qtn_meet_req_subject_field; @@ -1703,10 +1625,6 @@ { buf = qtn_meet_req_title; } -RESOURCE TBUF r_qtn_rcl_opt_add_recipient - { - buf = qtn_rcl_opt_add_recipient; - } RESOURCE TBUF r_qtn_meet_req_later_date { buf = qtn_meet_req_later_date; @@ -1723,58 +1641,10 @@ { buf = qtn_calendar_task_sync_public; } -RESOURCE TBUF r_qtn_calendar_all_day_event - { - buf = qtn_calendar_all_day_event; - } RESOURCE TBUF r_qtn_calendar_anniversary_type_occasion { buf = qtn_calendar_anniversary_type_occasion; } -RESOURCE TBUF r_qtn_calendar_info_note_ends_before - { - buf = qtn_calendar_info_note_ends_before; - } -RESOURCE TBUF r_qtn_calendar_meeting_recurring_daily - { - buf = qtn_calendar_meeting_recurring_daily; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_days - { - buf = qtn_calendar_meeting_alarm_days; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_hour - { - buf = qtn_calendar_meeting_alarm_hour; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_hours - { - buf = qtn_calendar_meeting_alarm_hours; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_minutes - { - buf = qtn_calendar_meeting_alarm_minutes; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_off - { - buf = qtn_calendar_meeting_alarm_off; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_one_day - { - buf = qtn_calendar_meeting_alarm_one_day; - } -RESOURCE TBUF r_qtn_calendar_meeting_alarm_one_week - { - buf = qtn_calendar_meeting_alarm_one_week; - } -RESOURCE TBUF r_qtn_calendar_meeting_details_field - { - buf = qtn_calendar_meeting_details_field; - } -RESOURCE TBUF r_qtn_calendar_meeting_location_field - { - buf = qtn_calendar_meeting_location_field; - } RESOURCE TBUF r_qtn_calendar_meeting_opt_priority_high { buf = qtn_calendar_meeting_opt_priority_high; @@ -1787,54 +1657,6 @@ { buf = qtn_calendar_meeting_opt_priority_normal; } -RESOURCE TBUF r_qtn_calendar_meeting_recurring_monthly - { - buf = qtn_calendar_meeting_recurring_monthly; - } -RESOURCE TBUF r_qtn_calendar_meeting_recurring_not - { - buf = qtn_calendar_meeting_recurring_not; - } -RESOURCE TBUF r_qtn_calendar_meeting_recurring_sec_week - { - buf = qtn_calendar_meeting_recurring_sec_week; - } -RESOURCE TBUF r_qtn_calendar_meeting_recurring_weekly - { - buf = qtn_calendar_meeting_recurring_weekly; - } -RESOURCE TBUF r_qtn_calendar_meeting_recurring_yearly - { - buf = qtn_calendar_meeting_recurring_yearly; - } -RESOURCE TBUF r_qtn_calendar_meeting_subject_field - { - buf = qtn_calendar_meeting_subject_field; - } -RESOURCE TBUF r_qtn_calendar_meeting_title - { - buf = qtn_calendar_meeting_title; - } -RESOURCE TBUF r_qtn_calendar_memo_type_subj - { - buf = qtn_calendar_memo_type_subj; - } -RESOURCE TBUF r_qtn_calendar_opt_delete - { - buf = qtn_calendar_opt_delete; - } -RESOURCE TBUF r_qtn_calendar_opt_delete_entry - { - buf = qtn_calendar_opt_delete_entry; - } -RESOURCE TBUF r_qtn_calendar_task_alarm_off - { - buf = qtn_calendar_task_alarm_off; - } -RESOURCE TBUF r_qtn_calendar_task_alarm_on - { - buf = qtn_calendar_task_alarm_on; - } RESOURCE TBUF r_qtn_calendar_task_priority_high { buf = qtn_calendar_task_priority_high; @@ -1875,38 +1697,10 @@ { buf = qtn_calendar_title_todo; } -RESOURCE TBUF r_qtn_calendar_todo_type_description - { - buf = qtn_calendar_todo_type_description; - } -RESOURCE TBUF r_qtn_calendar_todo_type_subj - { - buf = qtn_calendar_todo_type_subj; - } -RESOURCE TBUF r_qtn_fldr_delete - { - buf = qtn_fldr_delete; - } -RESOURCE TBUF r_qtn_form_litxt_save - { - buf = qtn_form_litxt_save; - } -RESOURCE TBUF r_qtn_meet_reg_opt_language - { - buf = qtn_meet_reg_opt_language; - } -RESOURCE TBUF r_qtn_options_delete - { - buf = qtn_options_delete; - } RESOURCE TBUF r_qtn_meet_req_show_all { buf = qtn_meet_req_show_all; } -RESOURCE TBUF r_qtn_meet_req_opt_actions - { - buf = qtn_meet_req_opt_actions; - } RESOURCE TBUF r_qtn_meet_req_viewer_options_open_in_web { buf = qtn_meet_req_viewer_options_open_in_web; @@ -1927,10 +1721,6 @@ { buf = qtn_calendar_bookmark_saved; } -RESOURCE TBUF r_qtn_meet_req_actions_remote_lookup - { - buf = qtn_meet_req_actions_remote_lookup; - } RESOURCE TBUF r_qtn_calendar_alarm_passed { buf = qtn_calendar_alarm_passed; @@ -1947,6 +1737,10 @@ { buf = qtn_calendar_task_sync_title; } +RESOURCE TBUF r_qtn_calendar_task_unified_title + { + buf = qtn_calendar_task_unified_title; + } RESOURCE TBUF r_qtn_meet_req_title_meeting { buf = qtn_meet_req_title_meeting; @@ -1975,319 +1769,37 @@ { buf = qtn_meet_req_info_start_end_date; } -RESOURCE TBUF r_qtn_calendar_later_date - { - buf = qtn_calendar_later_date; - } -RESOURCE TBUF r_qtn_calendar_opt_mark_done - { - buf = qtn_calendar_opt_mark_done; - } -RESOURCE TBUF r_qtn_calendar_opt_mark_not_done - { - buf = qtn_calendar_opt_mark_not_done; - } -RESOURCE TBUF r_text_calendar_note_saved_msk - { - buf = text_calendar_note_saved; - } RESOURCE TBUF r_qtn_meet_req_note_attachments { buf = qtn_meet_req_note_attachments; } -RESOURCE TBUF r_qtn_fse_viewer_header_attachment - { - buf = qtn_fse_viewer_header_attachment; - } -RESOURCE TBUF r_qtn_fse_viewer_header_attachment_less_than_kb - { - buf = qtn_fse_viewer_header_attachment_less_than_kb; - } -RESOURCE TBUF r_qtn_fse_viewer_header_attachments_total - { - buf = qtn_fse_viewer_header_attachments_total; - } -RESOURCE TBUF r_qtn_fse_viewer_header_attachments_less_than_kb - { - buf = qtn_fse_viewer_header_attachments_less_than_kb; - } RESOURCE TBUF r_qtn_options_open { buf = qtn_options_open; } -// -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_open - { - buf = qtn_meet_req_viewer_options_attach_open; - } -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_view_list - { - buf = qtn_meet_req_viewer_options_attach_view_list; - } -// -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_download - { - buf = qtn_meet_req_viewer_options_attach_download; - } -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_cancel_download - { - buf = qtn_meet_req_viewer_options_attach_cancel_download; - } -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_save - { - buf = qtn_meet_req_viewer_options_attach_save; - } -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_download_all - { - buf = qtn_meet_req_viewer_options_attach_download_all; - } -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_cancel_all_downloads - { - buf = qtn_meet_req_viewer_options_attach_cancel_all_downloads; - } -RESOURCE TBUF r_qtn_meet_req_viewer_options_attach_save_all - { - buf = qtn_meet_req_viewer_options_attach_save_all; - } -RESOURCE TBUF r_qtn_meet_req_viewer_cancel_download_query - { - buf = qtn_meet_req_viewer_cancel_download_query; - } -RESOURCE TBUF r_qtn_meet_req_viewer_cancel_downloads_query - { - buf = qtn_meet_req_viewer_cancel_downloads_query; - } -RESOURCE TBUF r_qtn_meet_req_options_remove_from_cal - { - buf = qtn_meet_req_options_remove_from_cal; - } - - -// -//FOR MR EDITOR ATTENDEE FIELD, FROM FSEMAILUI -// -RESOURCE TBUF r_meet_req_editor_add_to_contacts - { - buf=qtn_meet_req_editor_options_add_to_contacts; - } -RESOURCE TBUF r_meet_req_editor_create_new_contact - { - buf=qtn_meet_req_editor_options_add_to_contacts_create_new; - } -RESOURCE TBUF r_meet_req_editor_update_existing - { - buf=qtn_meet_req_editor_options_add_to_contacts_update_existing; - } -RESOURCE TBUF r_meet_req_editor_fetch_from_remote_query - { - buf=qtn_meet_req_editor_no_phone_number_found_search_server; - } -RESOURCE TBUF r_meet_req_editor_no_phone_number - { - buf=qtn_meet_req_editor_error_general_no_phone_number; - } RESOURCE TBUF r_meet_req_editor_address_list_remote_lookup_search { buf=qtn_meet_req_editor_address_list_remote_lookup_search; } -RESOURCE TBUF r_qtn_meet_req_options_download_mgr - { - buf = qtn_meet_req_options_download_mgr; - } -RESOURCE TBUF r_qtn_meet_req_options_copy_to_clipboard - { - buf = qtn_meet_req_options_copy_to_clipboard; - } -// Action menu items for attachments -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_open - { - buf = qtn_meet_req_viewer_options_attach_open; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_download - { - buf = qtn_meet_req_viewer_options_attach_download; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_save - { - buf = qtn_meet_req_viewer_options_attach_save; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_cancel_download - { - buf = qtn_meet_req_viewer_options_attach_cancel_download; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_view_list - { - buf = qtn_meet_req_viewer_options_attach_view_list; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_download_all - { - buf = qtn_meet_req_viewer_options_attach_download_all; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_save_all - { - buf = qtn_meet_req_viewer_options_attach_save_all; - } -RESOURCE TBUF r_qtn_meet_req_viewer_action_attach_cancel_all_downloads - { - buf = qtn_meet_req_viewer_options_attach_cancel_all_downloads; - } -// MSKs for attachments -RESOURCE TBUF r_qtn_msk_download - { - buf = qtn_msk_download; - } -RESOURCE TBUF r_qtn_msk_viewlist +RESOURCE TBUF r_meet_req_instance_starts_earlier_than_series { - buf = qtn_msk_viewlist; - } -// - -// -// LOCATION INTEGRATION STRINGS: -// -RESOURCE TBUF r_meet_req_replace_previous_location - { - buf = qtn_meet_req_replace_previous_location; - } -RESOURCE TBUF r_meet_req_new_location_format - { - buf = qtn_meet_req_new_location_format; - } -RESOURCE TBUF r_meet_req_address_street_city - { - buf = qtn_meet_req_address_street_city; - } -RESOURCE TBUF r_qtn_meet_req_loc_address_selection_title - { - buf = qtn_meet_req_loc_address_selection_title; + buf = qtn_meet_req_instance_starts_earlier_than_series; } -RESOURCE TBUF r_qtn_meet_req_recent_locations_selection_title - { - buf = qtn_meet_req_recent_locations_selection_title; - } -RESOURCE TBUF r_qtn_meet_req_assign_updated_location - { - buf = qtn_meet_req_assign_updated_location; - } - -// Editor Options menu item texts if r_location_options not available -RESOURCE TBUF r_meet_req_options_assign_from_map +RESOURCE TBUF r_meet_req_instance_already_exists_on_this_day { - buf = qtn_meet_req_options_assign_from_map; - } -RESOURCE TBUF r_meet_req_options_search_from_contacts - { - buf = qtn_meet_req_options_search_from_contacts; - } -RESOURCE TBUF r_meet_req_options_previous_locations - { - buf = qtn_meet_req_options_recent_locations; - } -RESOURCE TBUF r_meet_req_options_landmarks - { - buf = qtn_meet_req_options_landmarks; + buf = qtn_meet_req_instance_already_exists_on_this_day; } - -RESOURCE TBUF r_meet_req_address_from_contacts_format - { - buf = qtn_meet_req_address_from_contacts_format; - } -RESOURCE TBUF r_meet_req_address_from_contacts_three_items - { - buf = qtn_meet_req_address_from_contacts_three_items; - } -RESOURCE TBUF r_meet_req_address_from_contacts_two_items - { - buf = qtn_meet_req_address_from_contacts_two_items; - } -RESOURCE TBUF r_meet_req_home_address +RESOURCE TBUF r_meet_req_instance_overlaps_existing_instance { - buf = qtn_meet_req_home_address; - } -RESOURCE TBUF r_meet_req_work_address - { - buf = qtn_meet_req_work_address; + buf = qtn_meet_req_instance_overlaps_existing_instance; } -RESOURCE TBUF r_meet_req_general_address - { - buf = qtn_meet_req_general_address; - } -RESOURCE TBUF r_meet_req_no_address_found - { - buf = qtn_meet_req_address_not_found; - } - -// Editor context menu pane -RESOURCE MENU_PANE r_mr_editor_location_menu +RESOURCE TBUF r_meet_req_instance_out_of_sequence { - items = - { - MENU_ITEM - { - txt = qtn_meet_req_options_assign_from_map; - command = EESMRCmdAssignFromMap; - }, - MENU_ITEM - { - command = EESMRCmdSearchFromContacts; - txt = qtn_meet_req_options_search_from_contacts; - }, - MENU_ITEM - { - command = EESMRCmdPreviousLocations; - txt = qtn_meet_req_options_recent_locations; - }, - MENU_ITEM - { - command = EESMRCmdLandmarks; - txt = qtn_meet_req_options_landmarks; - } - }; + buf = qtn_meet_req_instance_out_of_sequence; } - -// Editor context menu bar -RESOURCE MENU_BAR r_mr_editor_context_menu +RESOURCE TBUF r_qtn_calendar_opt_delete_entry { - titles = - { - MENU_TITLE - { - menu_pane = r_mr_editor_location_menu; - } - }; - } - -// Viewer context menu pane -RESOURCE MENU_PANE r_mr_viewer_location_menu - { - items = - { - MENU_ITEM - { - command = EESMRCmdEdit; - txt = qtn_meet_req_opt_edit; - }, - MENU_ITEM - { - command = EESMRCmdEditLocal; - txt = qtn_meet_req_opt_edit; - }, - MENU_ITEM - { - command = EESMRCmdCalEntryUIEdit; - txt = qtn_meet_req_opt_edit; - }, - MENU_ITEM - { - command = EESMRCmdShowOnMap; - txt = qtn_meet_req_options_show_on_map; - }, - MENU_ITEM - { - command = EESMRCmdSearchFromMap; - txt = qtn_meet_req_options_search_from_map; - } - }; + buf = qtn_calendar_opt_delete_entry; } // Viewer context menu bar @@ -2297,15 +1809,50 @@ { MENU_TITLE { + menu_pane = r_action_menu; + }, + MENU_TITLE + { menu_pane = r_mr_viewer_location_menu; } }; } -// Description field link -RESOURCE TBUF r_meet_req_link_show_on_map +// Tracking View context menu bar +RESOURCE MENU_BAR r_mr_tracking_view_context_menu + { + titles = + { + MENU_TITLE + { + menu_pane = r_action_menu; + } + }; + } + +// Editor attendee field context menu bar +RESOURCE MENU_BAR r_mr_editor_attendee_context_menu { - buf = qtn_meet_req_link_show_on_map; + titles = + { + MENU_TITLE + { + menu_pane = r_mr_editor_attendee_menu; + } + }; + } + +// Viewer context menu pane +RESOURCE MENU_PANE r_mr_editor_attendee_menu + { + items = + { + MENU_ITEM + { + command = EESMRCmdAttendeeInsertContact; + txt = qtn_meet_req_add_attendees_from_contacts; + } + }; } // Reschedule instance information note @@ -2320,68 +1867,13 @@ buf = qtn_meet_req_long_description; } -// send button for meeting request response editor -RESOURCE AVKON_BUTTON r_send_button +// Display multi calendar query list title +RESOURCE TBUF r_qtn_calendar_task_calendar_title { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_meet_req_opt_send; - bmpfile = EMAILUI_ICON_FILE; - bmpid=EMbmFreestyleemailuiQgn_indi_tb_msg_send; - bmpmask=EMbmFreestyleemailuiQgn_indi_tb_msg_send_mask; - } - }; - } - -// accept button for meeting request -RESOURCE AVKON_BUTTON r_accept_button - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_meet_req_response_accept; - bmpfile = MRGUI_ICON_FILE; - bmpid=EMbmEsmrguiQgn_indi_tb_email_accept; - bmpmask=EMbmEsmrguiQgn_indi_tb_email_accept_mask; - } - }; + buf = qtn_calendar_task_calendar_title; } -// tentative button for meeting request -RESOURCE AVKON_BUTTON r_tentative_button - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_meet_req_response_tentative; - bmpfile = MRGUI_ICON_FILE; - bmpid=EMbmEsmrguiQgn_indi_tb_email_tentative; - bmpmask=EMbmEsmrguiQgn_indi_tb_email_tentative_mask; - } - }; - } - -// decline button for meeting request -RESOURCE AVKON_BUTTON r_decline_button - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_meet_req_response_decline; - bmpfile = MRGUI_ICON_FILE; - bmpid=EMbmEsmrguiQgn_indi_tb_email_decline; - bmpmask=EMbmEsmrguiQgn_indi_tb_email_decline_mask; - } - }; - } - +// Included resource files +#include "mrguitoolbarresources.rss" +#include "mrguiattachmentresources.rss" // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/data/iconlist.txt --- a/meetingrequest/mrgui/data/iconlist.txt Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/data/iconlist.txt Wed Mar 31 21:08:33 2010 +0300 @@ -29,7 +29,7 @@ -c32,8 qsn_fr_list_side_l.svg -c32,8 qsn_fr_list_side_r.svg -c32,8 qsn_fr_list_side_t.svg --c32,8 qgn_indi_cmail_arrow_right.svg +-c32,8 qgn_indi_cmail_action_arrow_right.svg -c32,8 qgn_menu_browserng.svg -c32,8 qgn_menu_intranet.svg -c32,8 qsn_fr_cmail_list_center.svg @@ -52,6 +52,25 @@ -c32,8 qgn_prop_cmail_action_attachment_save.svg -c32,8 qgn_prop_cmail_action_attachment_save_all.svg -c32,8 qgn_prop_cmail_action_attachment_list_options_view_all.svg +-c32,8 qgn_prop_search_contacts.svg +-c32,8 qgn_prop_nrtyp_date.svg +-c32,8 qgn_indi_cmail_arrow_previous.svg +-c32,8 qgn_indi_cmail_arrow_next.svg +-c32,8 qgn_indi_cdr_meeting.svg +-c32,8 qgn_indi_cdr_invitation.svg +-c32,8 qgn_indi_cdr_reminder.svg +-c32,8 qgn_indi_cdr_birthday.svg +-c32,8 qgn_indi_cdr_todo.svg +-c32,8 qgn_indi_mce_tb_image.svg +-c32,8 qgn_indi_mce_tb_video.svg +-c32,8 qgn_indi_mce_tb_audio.svg +-c32,8 qgn_indi_tb_template.svg +-c32,8 qgn_indi_tb_note.svg +-c32,8 qgn_indi_mce_tb_pres.svg +-c32,8 qgn_indi_mce_tb_other.svg +-c32,8 qgn_indi_tb_email_accept.svg -c32,8 qgn_indi_tb_email_tentative.svg -c32,8 qgn_indi_tb_email_decline.svg --c32,8 qgn_indi_tb_email_accept.svg +-c32,8 qgn_indi_sett_protected_add.svg +-c32,8 qgn_indi_cal_locat_event_add.svg + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/data/icons.mk --- a/meetingrequest/mrgui/data/icons.mk Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/data/icons.mk Wed Mar 31 21:08:33 2010 +0300 @@ -9,9 +9,10 @@ # Initial Contributors: # Nokia Corporation - initial contribution. # +# # Contributors: # -# Description: Make file for mrgui icons. +# Description: Make file for mrgui icons. This file is only for ABLD building! # ifeq (WINS,$(findstring WINS,$(PLATFORM))) @@ -25,7 +26,7 @@ ICONTARGETFILENAME=$(TARGETDIR)\esmrgui.mif HEADERFILENAME=$(HEADERDIR)\esmrgui.mbg # icons changed -SOURCEDIR=$(EPOCROOT)epoc32\s60\bitmaps +SOURCEDIR=$(EPOCROOT)epoc32\s60\icons # do_nothing : @@ -45,38 +46,69 @@ RESOURCE : mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_priority_high.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_priority_normal.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_priority_low.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_alarm_day.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_alarm.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_subject.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_recurrence.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_alarm.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_checkbox_on.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_checkbox_off.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_clock.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_date_end.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_date_start.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_location.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_synchronisation.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_occasion.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_tentative.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_accept.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_none.svg\ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_reject.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_attachment.svg \ - /c32,8 $(SOURCEDIR)\qgn_graf_cmail_email_ctrlbar.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_center.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_corner_bl.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_corner_br.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_corner_tl.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_corner_tr.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_side_bottom.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_side_l.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_side_r.svg \ - /c32,8 $(SOURCEDIR)\qsn_fr_cmail_list_side_top.svg \ - /c32,8 $(SOURCEDIR)\qgn_indi_cmail_home_arrow_right.svg + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_priority_high.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_priority_normal.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_priority_low.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_alarm_day.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_alarm.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_subject.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_recurrence.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_alarm.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_checkbox_on.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_checkbox_off.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_clock.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_date_end.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_date_start.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_meet_req_location.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_synchronisation.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_occasion.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_tentative.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_accept.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_none.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_calendar_tracking_reject.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_attachment.svg \ + /c32,8 $(SOURCEDIR)\qgn_graf_cmail_email_ctrlbar.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_center.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_corner_bl.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_corner_br.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_corner_tl.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_corner_tr.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_side_b.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_side_l.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_side_r.svg \ + /c32,8 $(SOURCEDIR)\qsn_fr_list_side_t.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_action_arrow_right.svg \ + /c32,8 $(SOURCEDIR)\qgn_menu_browserng.svg \ + /c32,8 $(SOURCEDIR)\qgn_menu_intranet.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_wml_bookmark.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_cancel_download.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_open.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_download.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_download_all.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_save.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_save_all.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_cmail_action_attachment_list_options_view_all.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_search_contacts.svg \ + /c32,8 $(SOURCEDIR)\qgn_prop_nrtyp_date.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cdr_meeting.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cdr_invitation.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cdr_reminder.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cdr_birthday.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cdr_todo.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_arrow_previous.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cmail_arrow_next.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_mce_tb_image.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_mce_tb_video.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_mce_tb_audio.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_tb_template.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_tb_note.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_mce_tb_pres.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_mce_tb_other.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_tb_email_accept.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_tb_email_tentative.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_tb_email_decline.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_sett_protected_add.svg \ + /c32,8 $(SOURCEDIR)\qgn_indi_cal_locat_event_add.svg \ #
diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/data/mrguiattachmentresources.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/data/mrguiattachmentresources.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,250 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for mrgui attachment ui resources +* +*/ + +#include +#include + +RESOURCE AVKON_LIST_QUERY r_attachment_type_query_dialog + { + flags = EGeneralQueryFlags; + softkeys = R_AVKON_SOFTKEYS_OK_CANCEL; + items = + { + AVKON_LIST_QUERY_DLG_LINE + { + control = AVKON_LIST_QUERY_CONTROL + { + listtype = EAknCtSinglePopupMenuListBox; + listbox = + AVKON_LIST_QUERY_LIST + { + }; + // TODO: loc string + heading = "Select Option"; + }; + } + }; + } + +RESOURCE DIALOG r_attachment_progress_note + { + flags = EAknProgressNoteFlags; + buttons = R_AVKON_SOFTKEYS_CANCEL; + items = + { + DLG_LINE + { + type = EAknCtNote; + id = EMrAttachmentProgressNoteId; + control = AVKON_NOTE + { + layout = EProgressLayout; + singular_label ="Progressing"; + }; + } + }; + } + +// --------------------------------------------------------- +// r_mr_attachment_memory_selection_dialog +// --------------------------------------------------------- +// +RESOURCE MEMORYSELECTIONDIALOG r_mr_attachment_memory_selection_dialog + { + locations = + { + LOCATION { root_path = text_phone_memory_root_path; }, + LOCATION { root_path = text_memory_card_root_path; } + }; + } + +// --------------------------------------------------------- +// r_mr_editor_attachment_menu +// Editor attachment field context menu pane +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_mr_editor_attachment_menu + { + items = + { + MENU_ITEM + { + command = EESMREditorAddAttachment; + txt = qtn_meet_req_add_attachment; + }, + MENU_ITEM + { + command = EESMREditorOpenAttachment; + txt = qtn_meet_req_open_attachment; + }, + MENU_ITEM + { + command = EESMREditorRemoveAttachment; + txt = qtn_meet_req_remove_attachment; + }, + MENU_ITEM + { + command = EESMREditorRemoveAllAttachments; + txt = qtn_meet_req_remove_all_attachments; + } + }; + } + +// --------------------------------------------------------- +// r_mr_editor_attachment_context_menu +// Editor attachment field context menu bar +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_mr_editor_attachment_context_menu + { + titles = + { + MENU_TITLE + { + menu_pane = r_mr_editor_attachment_menu; + } + }; + } + +// --------------------------------------------------------- +// r_mr_viewer_attachment_menu +// Viewer attachment field context menu pane +// --------------------------------------------------------- +// +RESOURCE MENU_PANE r_mr_viewer_attachment_menu + { + items = + { + MENU_ITEM + { + command = EESMRViewerOpenAttachment; + txt = qtn_meet_req_open_attachment; + }, + MENU_ITEM + { + command = EESMRViewerSaveAttachment; + txt = qtn_meet_req_save_attachment; + }, + MENU_ITEM + { + command = EESMRViewerSaveAllAttachments; + txt = qtn_meet_req_save_all_attachments; + }, + MENU_ITEM + { + command = EESMRViewerCancelAttachmentDownload; + txt = qtn_meet_req_cancel_attachment_download; + } + }; + } + +// --------------------------------------------------------- +// r_mr_viewer_attachment_context_menu +// Viewer attachment field context menu bar +// --------------------------------------------------------- +// +RESOURCE MENU_BAR r_mr_viewer_attachment_context_menu + { + titles = + { + MENU_TITLE + { + menu_pane = r_mr_viewer_attachment_menu; + } + }; + } + +/// Text buffers +RESOURCE TBUF r_qtn_meet_req_editor_header_attachments + { + buf = qtn_meet_req_editor_header_attachments; + } +RESOURCE TBUF r_meet_req_note_attachment_progress_megabyte + { + buf = qtn_meet_req_note_attachment_progress_megabyte; + } +RESOURCE TBUF r_meet_req_note_attachment_progress_kilobyte + { + buf = qtn_meet_req_note_attachment_progress_kilobyte; + } +RESOURCE TBUF r_meet_req_attachment_file_kilobyte + { + buf = qtn_meet_req_note_attachment_progress_kilobyte; // TODO: qtn_meet_req_attachment_file_kilobyte; + } +RESOURCE TBUF r_meet_req_attachment_file_megabyte + { + buf = qtn_meet_req_note_attachment_progress_megabyte; //TODO: qtn_meet_req_attachment_file_megabyte; + } +RESOURCE TBUF r_qtn_meet_req_info_already_attached + { + buf = qtn_meet_req_info_already_attached; + } +RESOURCE TBUF r_qtn_meet_req_query_heading_select_attachment_type + { + buf = qtn_meet_req_query_heading_select_attachment_type; + } +RESOURCE TBUF r_qtn_meet_req_attachment_type_image + { + buf = qtn_meet_req_attachment_type_image; + } +RESOURCE TBUF r_qtn_meet_req_attachment_type_video + { + buf = qtn_meet_req_attachment_type_video; + } +RESOURCE TBUF r_qtn_meet_req_attachment_type_soundclip + { + buf = qtn_meet_req_attachment_type_soundclip; + } +RESOURCE TBUF r_qtn_meet_req_attachment_type_note + { + buf = qtn_meet_req_attachment_type_note; + } +RESOURCE TBUF r_qtn_meet_req_attachment_type_other + { + buf = qtn_meet_req_attachment_type_other; + } + +/* + * Attachment downloading string + */ +RESOURCE TBUF r_qtn_meet_req_attachments_download_prefix + { + buf = "#%0N% %1U"; //TODO: qtn_meet_req_attachments_download_prefix; + } +RESOURCE TBUF r_meet_req_info_cannot_open_attachment + { + buf = qtn_meet_req_info_cannot_open_attachment; + } +RESOURCE TBUF r_qtn_meet_req_note_attachments_not_supported + { + buf = qtn_meet_req_note_attachments_not_supported; + } + +RESOURCE TBUF r_meet_req_attachment_file_less_than_kilobyte + { + buf = qtn_meet_req_attachment_file_less_than_kilobyte; + } + +RESOURCE TBUF r_meet_req_info_note_one_attachment_saved + { + buf = qtn_meet_req_info_note_one_attachment_saved; + } +RESOURCE TBUF r_meet_req_info_note_multiple_attachments_saved + { + buf = qtn_meet_req_info_note_multiple_attachments_saved; + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/data/mrguilocationresources.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/data/mrguilocationresources.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for location features +* +*/ + +// --------------------------------------------------------------------------- +// r_location_options +// Editor dialog cascade menu pane +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_location_options + { + items = + { + MENU_ITEM + { + command = EESMRCmdAssignFromMap; + txt = qtn_meet_req_options_assign_from_map; + }, + MENU_ITEM + { + command = EMRCommandMyLocations; + txt = qtn_meet_req_options_my_locations; + } + }; + } + +// --------------------------------------------------------------------------- +// r_mr_editor_location_menu +// Editor location field context menu pane +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_mr_editor_location_menu + { + items = + { + MENU_ITEM + { + command = EESMRCmdAssignFromMap; + txt = qtn_meet_req_options_assign_from_map; + }, + MENU_ITEM + { + command = EMRCommandMyLocations; + txt = qtn_meet_req_options_my_locations; + } + }; + } + +// --------------------------------------------------------------------------- +// r_mr_editor_location_context_menu +// Editor location field context menu bar +// --------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_mr_editor_location_context_menu + { + titles = + { + MENU_TITLE + { + menu_pane = r_mr_editor_location_menu; + } + }; + } +// --------------------------------------------------------------------------- +// r_mr_viewer_location_menu +// Viewer context menu pane +// --------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_mr_viewer_location_menu + { + items = + { + MENU_ITEM + { + command = EESMRCmdShowOnMap; + txt = qtn_meet_req_options_show_on_map; + }, + MENU_ITEM + { + command = EESMRCmdSearchFromMap; + txt = qtn_meet_req_options_search_from_map; + } + }; + } + +// +// LOCATION INTEGRATION STRINGS: +// +RESOURCE TBUF r_meet_req_replace_previous_location + { + buf = qtn_meet_req_replace_previous_location; + } +RESOURCE TBUF r_meet_req_new_location_format + { + buf = qtn_meet_req_new_location_format; + } +RESOURCE TBUF r_meet_req_address_street_city + { + buf = qtn_meet_req_address_street_city; + } +RESOURCE TBUF r_qtn_meet_req_loc_address_selection_title + { + buf = qtn_meet_req_loc_address_selection_title; + } +RESOURCE TBUF r_qtn_meet_req_recent_locations_selection_title + { + buf = qtn_meet_req_recent_locations_selection_title; + } +RESOURCE TBUF r_qtn_meet_req_assign_updated_location + { + buf = qtn_meet_req_assign_updated_location; + } +RESOURCE TBUF r_meet_req_address_from_contacts_format + { + buf = qtn_meet_req_address_from_contacts_format; + } +RESOURCE TBUF r_meet_req_address_from_contacts_three_items + { + buf = qtn_meet_req_address_from_contacts_three_items; + } +RESOURCE TBUF r_meet_req_address_from_contacts_two_items + { + buf = qtn_meet_req_address_from_contacts_two_items; + } +RESOURCE TBUF r_meet_req_home_address + { + buf = qtn_meet_req_home_address; + } +RESOURCE TBUF r_meet_req_work_address + { + buf = qtn_meet_req_work_address; + } +RESOURCE TBUF r_meet_req_general_address + { + buf = qtn_meet_req_general_address; + } +RESOURCE TBUF r_meet_req_no_address_found + { + buf = qtn_meet_req_address_not_found; + } +RESOURCE TBUF r_meet_req_link_show_on_map + { + buf = qtn_meet_req_link_show_on_map; + } +RESOURCE TBUF r_meet_req_options_show_on_map + { + buf = qtn_meet_req_options_show_on_map; + } +RESOURCE TBUF r_meet_req_options_search_from_map + { + buf = qtn_meet_req_options_search_from_map; + } +RESOURCE TBUF r_meet_req_options_edit + { + buf = qtn_meet_req_opt_edit; + } +RESOURCE TBUF r_meet_req_options_assign_from_map + { + buf = qtn_meet_req_options_assign_from_map; + } +RESOURCE TBUF r_meet_req_options_my_locations + { + buf = qtn_meet_req_options_my_locations; + } +RESOURCE TBUF r_meet_req_options_add_location + { + buf = qtn_meet_req_options_add_location; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/data/mrguitoolbarresources.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/data/mrguitoolbarresources.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for mrgui toolbar resources +* +*/ + +#include +#include +#include +#include + +#define MRUI_ICON_FILE BITMAP_DIR"\\esmrgui.mif" + + +RESOURCE AVKON_BUTTON r_toolbar_button_accept + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + helptxt = qtn_meet_req_toolbar_hlp_accept; + bmpfile = MRUI_ICON_FILE; + bmpid = EMbmEsmrguiQgn_indi_tb_email_accept; + bmpmask = EMbmEsmrguiQgn_indi_tb_email_accept_mask; + } + }; + } + +RESOURCE AVKON_BUTTON r_toolbar_button_tentative + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + helptxt = qtn_meet_req_toolbar_hlp_tentative; + bmpfile = MRUI_ICON_FILE; + bmpid = EMbmEsmrguiQgn_indi_tb_email_tentative; + bmpmask = EMbmEsmrguiQgn_indi_tb_email_tentative_mask; + } + }; + } + +RESOURCE AVKON_BUTTON r_toolbar_button_decline + { + flags = 0; + states = + { + AVKON_BUTTON_STATE + { + helptxt = qtn_meet_req_toolbar_hlp_decline; + bmpfile = MRUI_ICON_FILE; + bmpid = EMbmEsmrguiQgn_indi_tb_email_decline; + bmpmask = EMbmEsmrguiQgn_indi_tb_email_decline_mask; + } + }; + } + +/* + * MR toolbar help texts + */ +RESOURCE TBUF r_qtn_meet_req_toolbar_hlp_accept + { + buf = qtn_meet_req_toolbar_hlp_accept; + } + +RESOURCE TBUF r_qtn_meet_req_toolbar_hlp_tentative + { + buf = qtn_meet_req_toolbar_hlp_tentative; + } + +RESOURCE TBUF r_qtn_meet_req_toolbar_hlp_decline + { + buf = qtn_meet_req_toolbar_hlp_decline; + } + + +RESOURCE TBUF r_qtn_meet_req_info_field_locked + { + buf = qtn_meet_req_info_field_locked; + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/eabi/ESMRGUIU.def --- a/meetingrequest/mrgui/eabi/ESMRGUIU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/eabi/ESMRGUIU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,91 +1,14 @@ EXPORTS - _ZN10CESMRAlarm21RelativeTimeInMinutesEv @ 1 NONAME - _ZN10CESMRAlarm22ConstructFromResourceLER15TResourceReader @ 2 NONAME - _ZN10CESMRAlarm2IdEv @ 3 NONAME - _ZN10CESMRAlarm4TextEv @ 4 NONAME - _ZN10CESMRAlarm8RelativeEv @ 5 NONAME - _ZN10CESMRAlarm9LoadTextLEP7CCoeEnv @ 6 NONAME - _ZN10CESMRAlarmC1Ev @ 7 NONAME - _ZN10CESMRAlarmC2Ev @ 8 NONAME - _ZN10CESMRAlarmD0Ev @ 9 NONAME - _ZN10CESMRAlarmD1Ev @ 10 NONAME - _ZN10CESMRAlarmD2Ev @ 11 NONAME - _ZN11CESMRSendUI16SendAsVCalendarLEiR9CCalEntry @ 12 NONAME - _ZN11CESMRSendUI20DisplaySendMenuItemLER12CEikMenuPanei @ 13 NONAME - _ZN11CESMRSendUI23DisplaySendCascadeMenuLER12CEikMenuPane @ 14 NONAME - _ZN11CESMRSendUI4NewLEi @ 15 NONAME - _ZN11CESMRSendUI8CanSendLEi @ 16 NONAME - _ZN11CESMRSendUID0Ev @ 17 NONAME - _ZN11CESMRSendUID1Ev @ 18 NONAME - _ZN11CESMRSendUID2Ev @ 19 NONAME - _ZN11RESMRStatic17CurrentFieldIndexEv @ 20 NONAME - _ZN11RESMRStatic19ContactMenuHandlerLEv @ 21 NONAME - _ZN11RESMRStatic20SetCurrentFieldIndexEi @ 22 NONAME - _ZN11RESMRStatic22ContactManagerHandlerLEv @ 23 NONAME - _ZN11RESMRStatic5CloseEv @ 24 NONAME - _ZN11RESMRStatic8ConnectLEv @ 25 NONAME - _ZN11RESMRStaticC1Ev @ 26 NONAME - _ZN11RESMRStaticC2Ev @ 27 NONAME - _ZN11RESMRStaticD1Ev @ 28 NONAME - _ZN11RESMRStaticD2Ev @ 29 NONAME - _ZN14CESMRListQuery22ExecuteEditBeforeSendLE19TESMRAttendeeStatus @ 30 NONAME - _ZN14CESMRListQuery37ExecuteEditBeforeSendWithSendOptOnlyLE19TESMRAttendeeStatus @ 31 NONAME - _ZN14CESMRListQuery4NewLENS_18TESMRListQueryTypeE @ 32 NONAME - _ZN14CESMRListQuery8ExecuteLENS_18TESMRListQueryTypeE @ 33 NONAME - _ZN14CESMRListQuery9ExecuteLDEv @ 34 NONAME - _ZN14CESMRUiFactory4NewLEv @ 35 NONAME - _ZN14CESMRUiFactoryD0Ev @ 36 NONAME - _ZN14CESMRUiFactoryD1Ev @ 37 NONAME - _ZN14CESMRUiFactoryD2Ev @ 38 NONAME - _ZN15CESMRGlobalNote4NewLENS_18TESMGlobalNoteTypeE @ 39 NONAME - _ZN15CESMRGlobalNote8ExecuteLENS_18TESMGlobalNoteTypeE @ 40 NONAME - _ZN15CESMRRecurrence14RecurrenceTextEv @ 41 NONAME - _ZN15CESMRRecurrence15RecurrenceValueEv @ 42 NONAME - _ZN15CESMRRecurrence22ConstructFromResourceLEP7CCoeEnvR15TResourceReader @ 43 NONAME - _ZN15CESMRRecurrenceC1Ev @ 44 NONAME - _ZN15CESMRRecurrenceC2Ev @ 45 NONAME - _ZN15CESMRRecurrenceD0Ev @ 46 NONAME - _ZN15CESMRRecurrenceD1Ev @ 47 NONAME - _ZN15CESMRRecurrenceD2Ev @ 48 NONAME - _ZN16NMRBitmapManager15GetBitmapStructENS_11TMRBitmapIdE @ 49 NONAME - _ZN16NMRBitmapManager18GetSkinBasedBitmapENS_11TMRBitmapIdERP10CFbsBitmapS3_5TSize @ 50 NONAME - _ZN16NMRLayoutManager13GetLayoutRectERK5TRectNS_9TMRLayoutE @ 51 NONAME - _ZN16NMRLayoutManager13GetLayoutTextERK5TRectNS_13TMRTextLayoutE @ 52 NONAME - _ZN16NMRLayoutManager18GetFieldLayoutRectERK5TRecti @ 53 NONAME - _ZN16NMRLayoutManager21GetFieldRowLayoutRectERK5TRecti @ 54 NONAME - _ZN16NMRLayoutManager22GetTextComponentLayoutENS_13TMRTextLayoutE @ 55 NONAME - _ZN16NMRLayoutManager24GetWindowComponentLayoutENS_9TMRLayoutE @ 56 NONAME - _ZN17CESMREditorDialog4NewLEP11CESMRPolicyR13MESMRCalEntryR19MAgnEntryUiCallback @ 57 NONAME - _ZN17CESMRGUIListQuery8ExecuteLENS_18TESMRListQueryTypeE @ 58 NONAME - _ZN17CESMRViewerDialog4NewLEP11CESMRPolicyR13MESMRCalEntryR19MAgnEntryUiCallback @ 59 NONAME - _ZN18CESMRLayoutManager10IsMirroredEv @ 60 NONAME - _ZN18CESMRLayoutManager17SetBitmapFallbackERK11TAknsItemIDRiS3_ @ 61 NONAME - _ZN18CESMRLayoutManager21ConflictPopupPositionEv @ 62 NONAME - _ZN19CESMRResponseDialog12ExecuteDlgLDEv @ 63 NONAME - _ZN19CESMRResponseDialog4NewLERP7HBufC16 @ 64 NONAME - _ZN22CESMRConfirmationQuery8ExecuteLENS_26TESMRConfirmationQueryTypeE @ 65 NONAME - _ZN23CESMRContactMenuHandler15ShowActionMenuLEv @ 66 NONAME - _ZN23CESMRContactMenuHandler18SetAttachmentInfoLEP19CESMRAttachmentInfo @ 67 NONAME - _ZN23CESMRContactMenuHandler18SetCommandObserverEP19MEikCommandObserver @ 68 NONAME - _ZN23CESMRContactMenuHandler5ResetEv @ 69 NONAME - _ZN23CESMRContactMenuHandler9SetValueLERK7TDesC16NS_10TValueTypeE @ 70 NONAME - _ZN26CESMRContactManagerHandler12AddObserverLEP27MESMRContactManagerObserver @ 71 NONAME - _ZN26CESMRContactManagerHandler14RemoveObserverEP27MESMRContactManagerObserver @ 72 NONAME - _ZN26CESMRContactManagerHandler17GetContactManagerEv @ 73 NONAME - _ZN26CESMRContactManagerHandler7IsReadyEv @ 74 NONAME - _ZN8CMRImage4NewLEN16NMRBitmapManager11TMRBitmapIdE10TScaleMode @ 75 NONAME - _ZN8CMRImage4NewLERK11TAknsItemID10TScaleMode @ 76 NONAME - _ZN8CMRImageD0Ev @ 77 NONAME - _ZN8CMRImageD1Ev @ 78 NONAME - _ZN8CMRImageD2Ev @ 79 NONAME - _ZN8CMRLabel4NewLEv @ 80 NONAME - _ZN8CMRLabelD0Ev @ 81 NONAME - _ZN8CMRLabelD1Ev @ 82 NONAME - _ZN8CMRLabelD2Ev @ 83 NONAME - _ZTI23CESMRTrackingViewDialog @ 84 NONAME ; ## - _ZTI8CMRLabel @ 85 NONAME ; ## - _ZTV23CESMRTrackingViewDialog @ 86 NONAME ; ## - _ZTV8CMRLabel @ 87 NONAME ; ## - _ZThn4_N14CESMRUiFactoryD0Ev @ 88 NONAME ; ## - _ZThn4_N14CESMRUiFactoryD1Ev @ 89 NONAME ; ## - _ZN11RESMRStatic8MailBoxLERK7TDesC16 @ 90 NONAME + _ZN14CESMRUiFactory4NewLEv @ 1 NONAME + _ZN14CESMRUiFactoryD0Ev @ 2 NONAME + _ZN14CESMRUiFactoryD1Ev @ 3 NONAME + _ZN14CESMRUiFactoryD2Ev @ 4 NONAME + _ZN17CESMREditorDialog4NewLER15MMRInfoProviderR19MAgnEntryUiCallback @ 5 NONAME + _ZN17CESMRViewerDialog4NewLER15MMRInfoProviderR19MAgnEntryUiCallback @ 6 NONAME + _ZN19CESMRResponseDialog12ExecuteDlgLDEv @ 7 NONAME + _ZN19CESMRResponseDialog4NewLERP7HBufC16 @ 8 NONAME + _ZTI23CESMRTrackingViewDialog @ 9 NONAME + _ZTV23CESMRTrackingViewDialog @ 10 NONAME + _ZThn4_N14CESMRUiFactoryD0Ev @ 11 NONAME + _ZThn4_N14CESMRUiFactoryD1Ev @ 12 NONAME + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/group/bld.inf --- a/meetingrequest/mrgui/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,13 +17,8 @@ #include -// #include -// -#include "../mrfieldbuildercommon/group/bld.inf" -#include "../mrfieldbuilderplugin/group/bld.inf" -#include "../mrfieldbuilderpluginextension/group/bld.inf" #include "../mrlocationplugin/group/bld.inf" #include "../mrfieldevent/group/bld.inf" @@ -32,24 +27,16 @@ ../inc/cesmruifactory.h |../../inc/cesmruifactory.h ../inc/mesmruibase.h |../../inc/mesmruibase.h ../inc/tesmrentryfield.h |../../inc/tesmrentryfield.h -../inc/cesmrconfirmationquery.h |../../inc/cesmrconfirmationquery.h -../inc/cesmrlistquery.h |../../inc/cesmrlistquery.h ../inc/cesmrresponsedialog.h |../../inc/cesmrresponsedialog.h -../inc/cesmrguilistquery.h |../../inc/cesmrguilistquery.h +../inc/esmrfieldbuilderdef.h |../../inc/esmrfieldbuilderdef.h +../inc/esmrgui.hrh |../../inc/esmrgui.hrh ../loc/mrui.loc APP_LAYER_LOC_EXPORT_PATH(mrui.loc) -//../inc/mesmrfieldeventobserver.h |../../inc/mesmrfieldeventobserver.h - //Export stub sis file -// -//../data/mrui_stub.sis /epoc32/data/z/system/install/mrui_stub.sis ../data/meetingrequeststub.sis /epoc32/data/z/system/install/meetingrequeststub.sis -// PRJ_MMPFILES -// -//gnumakefile icons.mk -// +// gnumakefile ../data/icons.mk esmrgui.mmp PRJ_EXTENSIONS @@ -61,3 +48,6 @@ OPTION SOURCEFILE ../data/iconlist.txt END +#include "../mrfieldbuildercommon/group/bld.inf" +#include "../mrfieldbuilderplugin/group/bld.inf" +#include "../mrfieldbuilderpluginextension/group/bld.inf" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/group/esmrgui.mmp --- a/meetingrequest/mrgui/group/esmrgui.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/group/esmrgui.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,8 +17,9 @@ #include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" +#include "../../inc/esmrconfig.hrh" #include #include @@ -30,29 +31,13 @@ CAPABILITY CAP_GENERAL_DLL -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src //the following contain dll exports SOURCE cesmruifactory.cpp -SOURCE cesmrglobalnote.cpp -SOURCE cesmrconfirmationquery.cpp -SOURCE cesmrlistquery.cpp -SOURCE cesmrsendui.cpp -SOURCE esmrvcalexport.cpp -SOURCE cesmrguilistquery.cpp -SOURCE cmrimage.cpp -SOURCE cmrlabel.cpp //internal classes -SOURCE cesmrcontactlinkiterator.cpp -SOURCE cesmrcontactmenuurlhandler.cpp -SOURCE cesmrcontactmenuattachmenthandler.cpp -SOURCE cesmrcontactmanagerhandler.cpp SOURCE cesmrview.cpp -SOURCE cesmrlistcomponent.cpp SOURCE cesmrtitlepane.cpp SOURCE cesmrfieldstorage.cpp @@ -83,15 +68,19 @@ SOURCE cesmrfieldeventqueue.cpp SOURCE cmrlistpane.cpp +SOURCE tnavipaneclearer.cpp +SOURCE cmrlistpanephysics.cpp +SOURCE cmrtoolbar.cpp +SOURCE cmrasynchcmd.cpp +SOURCE cesmrtrackingview.cpp +SOURCE cmrfieldcontainer.cpp +SOURCE cmrnaviarrow.cpp +SOURCE cmrfocusstrategybase.cpp +SOURCE cmrfocusstrategyeditor.cpp +SOURCE cmrfocusstrategyviewer.cpp -//the following also contain dll exports (only used by fieldbuilder) -SOURCE cesmrrecurrence.cpp -SOURCE cesmrlayoutmgr.cpp -SOURCE cesmralarm.cpp -SOURCE resmrstatic.cpp -SOURCE cesmrcontactmenuhandler.cpp -SOURCE nmrlayoutmanager.cpp -SOURCE nmrbitmapmanager.cpp +SOURCE cmrsystemnotifier.cpp +SOURCE cmrattachmentindicator.cpp // Resources SOURCEPATH ../data @@ -109,16 +98,19 @@ USERINCLUDE ../../../inc // Dependencies to esmrui libraries +LIBRARY esmrcommon.lib LIBRARY esmrpolicy.lib -LIBRARY esmrcommon.lib //esmrhelper::locateresourcefile() +LIBRARY esmrservices.lib LIBRARY esmrfieldevent.lib -LIBRARY esmrservices.lib +LIBRARY mrguicommon.lib +LIBRARY esmrfieldbuildercommon.lib // Dependencies to Symbian/S60 OS components LIBRARY apparc.lib LIBRARY ecom.lib LIBRARY euser.lib LIBRARY apgrfx.lib +LIBRARY apmime.lib LIBRARY cone.lib LIBRARY eikcoctl.lib LIBRARY egul.lib @@ -128,7 +120,6 @@ LIBRARY bafl.lib LIBRARY eikcore.lib LIBRARY efsrv.lib -LIBRARY featmgr.lib LIBRARY pbkeng.lib LIBRARY vpbkeng.lib LIBRARY sendui.lib @@ -148,30 +139,34 @@ LIBRARY avkon.lib LIBRARY calenimp.lib LIBRARY caleninterimutils2.lib -LIBRARY lmkcommonui.lib +LIBRARY lmkcommonui.lib LIBRARY eposlandmarks.lib -LIBRARY platformenv.lib +LIBRARY aknphysics.lib +LIBRARY touchfeedback.lib +LIBRARY commonui.lib +LIBRARY npdlib.lib +LIBRARY lbs.lib +LIBRARY FeatDiscovery.lib LIBRARY gdi.lib -LIBRARY msgs.lib + +#ifdef RD_USE_MYLOCATIONUI +LIBRARY mylocationui.lib +#endif // RD_USE_MYLOCATIONUI -// fsemail framework -LIBRARY fsfwcommonlib.lib -LIBRARY fsmailframework.lib +LIBRARY platformenv.lib +LIBRARY bitgdi.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +LIBRARY cmaillogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE //needed by XML based LAF components -LIBRARY cdlengine.lib -LIBRARY aknlayout2.lib -LIBRARY aknlayout2scalable.lib +LIBRARY cdlengine.lib +LIBRARY aknlayout2.lib +LIBRARY aknlayout2scalable.lib // AIW -LIBRARY ServiceHandler.lib //__PRINTING_FRAMEWORK_CALENDAR_PLUGIN - -LIBRARY touchfeedback.lib -LIBRARY aknphysics.lib -LIBRARY cmaillogger.lib - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +LIBRARY servicehandler.lib //__PRINTING_FRAMEWORK_CALENDAR_PLUGIN // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmraddressinfohandler.h --- a/meetingrequest/mrgui/inc/cesmraddressinfohandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmraddressinfohandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,8 +22,8 @@ // Includes #include -#include -#include +#include +#include #include "resmrstatic.h" #include "cesmrcontactmanagerhandler.h" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmraddressselectionquery.h --- a/meetingrequest/mrgui/inc/cesmraddressselectionquery.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmraddressselectionquery.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmralarm.h --- a/meetingrequest/mrgui/inc/cesmralarm.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR alarm implementation - * -*/ - - -#ifndef CESMRALARM_H -#define CESMRALARM_H - -#include - -NONSHARABLE_CLASS( CESMRAlarm ): public CBase - { -public: - /** - * Constructor - */ - IMPORT_C CESMRAlarm(); - - /** - * Destructor - */ - IMPORT_C ~CESMRAlarm(); - -public: - /** - * Loads alarm valus from resources - */ - IMPORT_C void ConstructFromResourceL( TResourceReader& aReader ); - - /** - * Loads iText from resources - */ - IMPORT_C void LoadTextL( CCoeEnv* aCoeEnv ); - - /** - * Returns relative alarm time in minutes - * - * @return relative alarm time - */ - IMPORT_C TTimeIntervalMinutes RelativeTimeInMinutes(); - - /** - * Returns alarm text - * - * @return alarm text - */ - IMPORT_C HBufC* Text(); - - /** - * Returns alarm id - * - * @return alarm id - */ - IMPORT_C TInt Id(); - - /** - * Returns relative alarm time - * - * @returns relative alarm time - */ - IMPORT_C TInt Relative(); - -private: - /** - * Alarm id - */ - TInt iId; - - /** - * Alarm value - */ - TInt iValue; - - /** - * Relative alarm value - */ - TInt iRelative; - - /** - * Alarm text id - */ - TInt iTxtLink; - - /** - * Own: Alarm text - */ - HBufC* iText; - }; - -#endif // CESMRALARM_H - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrannivtimevalidator.h --- a/meetingrequest/mrgui/inc/cesmrannivtimevalidator.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrannivtimevalidator.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -29,6 +29,7 @@ class MESMRCalEntry; class CEikTimeEditor; class CEikDateEditor; +class MMRAbsoluteAlarmController; /** * Wrapper class handles sanity checks for date/time fields on Anniversary @@ -75,8 +76,10 @@ CEikTimeEditor& aAlarmTime ); void SetAlarmDateFieldL( CEikDateEditor& aAlarmDate ); - void SetRecurrenceUntilDateFieldL( - CEikDateEditor& aRecurrenceUntil ); + void SetRecurrenceUntilDateFieldL( + CEikDateEditor& aRecurrenceUntil ); + void SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& aAbsoluteAlarmController ); void StartTimeChangedL(); void EndTimeChangedL(); void StartDateChandedL(); @@ -105,6 +108,7 @@ TDateTime StartTimeL(); TDateTime AlarmTimeL(); void ForceValuesL(); + TBool IsModifiedL( MESMRCalEntry& aEntry ); private: /// Ref: Start date editor. @@ -121,6 +125,14 @@ TBool iAlarmOnOff; /// Ref: Entry being handled MESMRCalEntry* iEntry; + /// Own: Saves initial alarm time, for later comparisons + TTime iInitialAlarmTime; + /// Own: Saves initial alarm date, for later comparisons + TTime iInitialAlarmDate; + /// Own: Saves initial alarm on off, for later comparisons + TBool iInitialAlarmOnOff; + /// Own: Saves initial due date, for later comparisons + TTime iInitialStartDate; }; #endif // CESMRANNIVTIMEVALIDATOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrconfirmationquery.h --- a/meetingrequest/mrgui/inc/cesmrconfirmationquery.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class is responsible of showing confirmation queries -* -*/ - - -#ifndef CESMRCONFIRMATIONQUERY_H -#define CESMRCONFIRMATIONQUERY_H - -// -#include "esmrdef.h" -// -#include - -class CEikonEnv; -/** - * CESMRConfirmationQuery encapsulates Yes/No confirmation query - * query for ES MR Utils usage. - * - * @lib esmrgui.lib - */ -NONSHARABLE_CLASS( CESMRConfirmationQuery ) : public CBase - { -public: - /** - * Enumeration definition for different kind of - * confirmation queries - */ - enum TESMRConfirmationQueryType - { - EESMRDeleteMR = 0, - EESMRSendCancellationInfoToParticipants, - EESMRRemoveAppointment, - EESMRSaveChanges, - EESMRDeleteEntry, - EESMRSendDecline, - EESMRSaveAnnivChangedStartDay, - EESMRAttachments, - EESMRCancelDownloadingAttachment, - EESMRCancelDownloadingAllAttachments, - EESMRSaveMeetingChangedStartDay, - EESMRAssignUpdatedLocation - }; -public: - /** - * C++ Destructor. - */ - ~CESMRConfirmationQuery(); - - /** - * Static version of ExecuteLD. - * @param aType The type of confirmation query. - * @return TBool ETrue if Yes, EFalse for no. - */ - IMPORT_C static TBool ExecuteL( TESMRConfirmationQueryType aType ); - - /** - * Static version of ExecuteLD, for location text overwrite queries. - * only used internally by esmrgui and doesn't need to be exported - * @param aLocation location text to be used and truncated to the query - * @return TBool ETrue if Yes, EFalse for no. - */ - static TBool ExecuteL( const TDesC& aLocation ); - -private: // Implementation - CESMRConfirmationQuery( TESMRConfirmationQueryType aType ); - void ConstructL(); - TBool ExecuteLD(); - HBufC* TruncateTextToLAFNoteL( const TDesC& aLocation ); - -private: // Data - /** - * Attendee status - */ - TESMRConfirmationQueryType iType; - - /** - * Resource offset - */ - TInt iResourceOffset; - - // Ref: - CEikonEnv* iEnv; - }; - -#endif // CESMRCONFIRMATIONQUERY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrcontactlinkiterator.h --- a/meetingrequest/mrgui/inc/cesmrcontactlinkiterator.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of class CESMRContactLinkIterator. -* -*/ - - -#ifndef CESMRCONTACTLINKITERATOR_H -#define CESMRCONTACTLINKITERATOR_H - -#include -// -#include "mfsccontactlinkiterator.h" -// - -class MVPbkContactLinkArray; - -/** - * Vitual phonebooks's MVPbkContactLink implementation. - */ -NONSHARABLE_CLASS( CESMRContactLinkIterator ) : public CBase, - public MFscContactLinkIterator - { -public: - - /** - * Two-phase constructor. - * - * @return new instance of th class - */ - static CESMRContactLinkIterator* NewL( ); - - /** - * Destructor. - */ - ~CESMRContactLinkIterator( ); - - /** - * Sets link array for iterating. Ownership is transferred. - * - * @param aContactLinkArray contact link array - */ - void SetContactLinkArray( MVPbkContactLinkArray* aContactLinkArray ); - -public: // from MFscContactLinkIteratator - TInt ContactCount( ) const; - TBool HasNextContact( ) const; - MVPbkContactLink* NextContactL( ); - void SetToFirstContact( ); - TInt GroupCount( ) const; - TBool HasNextGroup( ) const; - MVPbkContactLink* NextGroupL( ); - void SetToFirstGroup( ); - -private: - /** - * Private constructor. - */ - CESMRContactLinkIterator( ); - -private: //Data - /// Own: Current link index. - TInt iContactLinkArrayIndex; - /// Own: Contact link array. - MVPbkContactLinkArray* iContactLinkArray; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrcontactmanagerhandler.h --- a/meetingrequest/mrgui/inc/cesmrcontactmanagerhandler.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of class CESMRContactManagerHandler. -* -*/ - - -#ifndef CESMRCONTACTMANAGERHANDLER_H -#define CESMRCONTACTMANAGERHANDLER_H - -#include - -#include -#include - -class CVPbkContactManager; - -NONSHARABLE_CLASS( MESMRContactManagerObserver ) - { -public: - virtual void ContactManagerReady ( ) = 0; - }; - -NONSHARABLE_CLASS( CESMRContactManagerHandler ) : - public CBase, - public MVPbkContactStoreListObserver - { -public: - static CESMRContactManagerHandler* NewL ( ); - ~CESMRContactManagerHandler ( ); - - /** - * Is ready - * @return ETrue if is else EFalse - */ - IMPORT_C TBool IsReady ( ); - - /** - * Add observer - * @param aObserver - */ - IMPORT_C void AddObserverL (MESMRContactManagerObserver* aObserver ); - - /** - * Remove observer - * @param aObserver - */ - IMPORT_C void RemoveObserver (MESMRContactManagerObserver* aObserver ); - - /** - * Get contact manager - */ - IMPORT_C CVPbkContactManager& GetContactManager ( ); - -private: - CESMRContactManagerHandler ( ); - void ConstructL ( ); - - // from MVPbkContactStoreListObserver - void OpenComplete ( ); - // from MVPbkContactStoreObserver - void StoreReady (MVPbkContactStore& aContactStore ); - void StoreUnavailable (MVPbkContactStore& aContactStore, TInt aReason ); - void HandleStoreEventL (MVPbkContactStore& aContactStore, - TVPbkContactStoreEvent aStoreEvent ); - -private: //Data - /// Own: - TBool iContactManagerReady; - /// Own: - CVPbkContactManager* iContactManager; - /// Own: - RPointerArray iObservers; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrcontactmenuattachmenthandler.h --- a/meetingrequest/mrgui/inc/cesmrcontactmenuattachmenthandler.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Creates and display attachment action menu. -* -*/ - - -#ifndef CESMRCONTACTMENUATTACHMENTHANDLER_H -#define CESMRCONTACTMENUATTACHMENTHANDLER_H - -#include -#include - -// Forward declarations -class CEikMenuPane; -class CFscContactActionMenu; -class CGulIcon; -// -class CESMRAttachmentInfo; -// - -NONSHARABLE_CLASS( CESMRContactMenuAttachmentHandler ) : public CBase - { -public: // enumarations - /** - * Predefined action menu items that are availabe - */ - enum TESMRAttachmentActionMenuItem - { - EActionOpen = 0 - }; - -public: // Constructors and destructors - - /** - * Two-phase constructor. - * - * @param aContactActionMenu contact action menu - * @return new instance of the class - */ - static CESMRContactMenuAttachmentHandler* NewL( - CFscContactActionMenu& aContactActionMenu ); - - /** - * Destructor - */ - ~CESMRContactMenuAttachmentHandler(); - -public: // New methods - /** - * Resets/disables attachment contact menu handler. - */ - void Reset(); - - /** - * Sets attachment info for action menu to show/hide options. - * Ownership does not change. - * - * @param aAttachmentInfo attachment info object - */ - void SetAttachmentInfo( CESMRAttachmentInfo* aAttachmentInfo ); - - /** - * Enables contact action menu and options menu for given attachment(s). - */ - void InitActionMenuL( ); - - /** - * Returns true if options menu / actions is available. - */ - TBool OptionsMenuAvailable( ); - - /** - * Initializes options menu / actions submenu. - * - * @param aActionMenuPane actions submenu - */ - void InitOptionsMenuL( CEikMenuPane* aActionMenuPane ); - - /** - * Executes contact action menu. - */ - void ShowActionMenuL( ); - - /** - * Sets command observer for field. Field can use command - * observer for triggering commands. - * @param @aCommandObserver Reference to command observer - */ - void SetCommandObserver( MEikCommandObserver* aCommandObserver ); - -private: - - /** - * C++ default Constructor - * @param aContactActionMenu contact action menu - */ - CESMRContactMenuAttachmentHandler( - CFscContactActionMenu& aContactActionMenu ); - - /** - * Symbian 2nd phase constructor - */ - void ConstructL(); - - /** - * Creates a single actionmenu item with selectable command - * @param aResourceId - * @param aCommandUid - */ - void CreateMenuItemL( TInt aResourceId, TUid aCommandUid ); - - /** - * create icons to actionmenu - */ - CGulIcon* CreateIconL( TUid aCommandUid ); - -private: // data - - /// Ref: Contact action menu - CFscContactActionMenu& iContactActionMenu; - - /// Not owned - CESMRAttachmentInfo* iAttachmentInfo; - - /// Own: - TBool iOptionsMenuAvailable; - - /// Own: array of actionmenu icons - RPointerArray iIconArray; - - /// Ref: Pointer to command observer - MEikCommandObserver* iCommandObserver; - }; - -#endif // CESMRCONTACTMENUATTACHMENTHANDLER_H - -// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrcontactmenuhandler.h --- a/meetingrequest/mrgui/inc/cesmrcontactmenuhandler.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of class CESMRContactMenuHandler. -* -*/ - - -#ifndef CESMRCONTACTMENUHANDLER_H -#define CESMRCONTACTMENUHANDLER_H - -#include - -#include "cesmrcontactmanagerhandler.h" -#include -#include -// -#include "mfsccontactactionserviceobserver.h" -#include "fsccontactactionservicedefines.h" -// -#include - -class MVPbkContactOperationBase; -class MVPbkContactStore; -class MVPbkContactLinkArray; -class CFscContactActionService; -class CFscContactActionMenu; -class CEikMenuPane; -class CESMRContactMenuUrlHandler; -class CESMRContactMenuAttachmentHandler; -// -class CESMRAttachmentInfo; -// - -NONSHARABLE_CLASS( CESMRContactMenuHandler ) : - public CBase, - public MVPbkContactFindObserver, - public MVPbkSingleContactOperationObserver, - public MFscContactActionServiceObserver, - public MESMRContactManagerObserver - { -public: - /* - * Enumeration for value types. - */ - enum TValueType { - EValueTypeURL, - EValueTypeEmail, - EValueTypePhoneNumber, - EValueTypeAttachment - }; - -public: - /** - * Two-phase constructor - * - * @param aContactManagerHandler Handler to contact manager - * @return new instance of the class - */ - static CESMRContactMenuHandler* NewL( - CESMRContactManagerHandler& aContactManagerHandler ); - - /** - * Destructor. - */ - ~CESMRContactMenuHandler( ); - - /** - * Options menu available - * @return ETrue if options menu / actions is available. - */ - TBool OptionsMenuAvailable( ); - - /** - * Initialises actions menu pane. - * - * @param aActionMenuPane actions menu pane - */ - void InitOptionsMenuL( CEikMenuPane* aActionMenuPane ); - - /** - * Executes options menu / actions command. - * - * @param aCommand command id - */ - void ExecuteOptionsMenuL( TInt aCommand ); - - /** - * Resets/disables contact menu handler. - */ - IMPORT_C void Reset( ); - - /** - * Sets new value for contact action menu. It might be of - * type URL, Email or phone number. - * - * @param aValue descriptor which contains value - * @param aValueType type of given value - */ - IMPORT_C void SetValueL( const TDesC& aValue, TValueType aValueType ); - - /** - * Shows/executes contact action menu. - */ - IMPORT_C void ShowActionMenuL( ); - - /** - * Sets command observer for field. Field can use command - * observer for triggering commands. - * @param aCommandObserver Reference to command observer - */ - IMPORT_C void SetCommandObserver( - MEikCommandObserver* aCommandObserver ); - - IMPORT_C void SetAttachmentInfoL( CESMRAttachmentInfo* aAttachmentInfo ); - -private: - /** - * Private constructor. - */ - CESMRContactMenuHandler( - CESMRContactManagerHandler& aContactManagerHandler ); - - /** - * Second phase constructor. - */ - void ConstructL( ); - - void VerifyContactDetailsL(); - -private: // from MESMRContactManagerHandler - void ContactManagerReady( ); - -private: // from MVPbkSingleContactOperationObserver - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ); - void VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, - TInt aError ); - -private: // from MVPbkContactFindObserver - void FindCompleteL( MVPbkContactLinkArray* aResults ); - void FindFailed( TInt aError ); - - // from MFscContactActionServiceObserver - void QueryActionsComplete( ); - void QueryActionsFailed( TInt aError ); - void ExecuteComplete( ); - void ExecuteFailed( TInt aError ); - -private: - /** - * Searches selected richtext link from contact stores. - */ - void SearchContactL( ); - - /** - * Creates new temporary contact for richtext link. - */ - void CreateContactL( ); - - /** - * Searches for local contact store for temporary - * contact creation. Leaves if none is found. - * - * @return local contact store - */ - MVPbkContactStore& LocalContactStoreL( ); - -private: // Data - /// Ref: Contact manager handler - CESMRContactManagerHandler& iContactManagerHandler; - /// Own: Url contact menu handler. - CESMRContactMenuUrlHandler* iContactMenuUrlHandler; - // - /// Own: Attachment contact menu handler. - CESMRContactMenuAttachmentHandler* iContactMenuAttachmentHandler; - // - /// Own: Contact search results. - MVPbkContactLinkArray* iFindResultsArray; - /// Own: Index for verifying search results. - TInt iFindResultsArrayIndex; - /// Own: Contact action service. - CFscContactActionService* iContactActionService; - /// Own: Contact action menu. - CFscContactActionMenu* iContactActionMenu; - /// Own: Contact operation base. - MVPbkContactOperationBase* iContactOperationBase; - /// Own: Current value for actions menu. - HBufC* iValue; - /// Own: Current value type. - TValueType iValueType; - /// Own: Contact list for temporary contact. - RFscStoreContactList iStoreContactList; - /// Own: Contact action list for selected richtext link. - CFscContactActionList iContactActionList; - /// Own: ETrue if contact manager is initialized. - TBool iContactManagerReady; - /// Own: ETrue if action menu is initialized. - TBool iActionMenuReady; - /// Own: ETrue if options menu is initialized. - TBool iOptionsMenuReady; - /// Ref: Pointer to command observer - MEikCommandObserver* iCommandObserver; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrcontactmenuurlhandler.h --- a/meetingrequest/mrgui/inc/cesmrcontactmenuurlhandler.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of class CESMRContactMenuUrlHandler. - * -*/ - - -#ifndef CESMRCONTACTMENUURLHANDLER_H -#define CESMRCONTACTMENUURLHANDLER_H - -#include - -class CEikMenuPane; -class CFscContactActionMenu; -class CGulIcon; -class CAiwServiceHandler; -class CEikonEnv; - -NONSHARABLE_CLASS( CESMRContactMenuUrlHandler ) : public CBase - { -public: - /** - * Two-phase constructor. - * - * @param aContactActionMenu contact action menu - * @return new instance of the class - */ - static CESMRContactMenuUrlHandler* NewL( - CFscContactActionMenu& aContactActionMenu ); - - /** - * Destructor. - */ - ~CESMRContactMenuUrlHandler( ); - - /** - * Resets/disables url contact menu handler. - */ - void Reset( ); - - /** - * Enables contact action menu and options menu for given link. - * - * @param aUrl selected url - */ - void SetUrlL( const TDesC& aUrl ); - - /** - * Returns true if options menu / actions is available. - * @return TBool - */ - TBool OptionsMenuAvailable( ); - - /** - * Initializes options menu / actions submenu. - * - * @param aActionMenuPane actions submenu - */ - void InitOptionsMenuL( CEikMenuPane* aActionMenuPane ); - - /** - * Executes actions submenu selection. - * - * @param aCommand selected command id - */ - void ExecuteOptionsMenuL( TInt aCommand ); - - /** - * Executes contact action menu. - */ - void ShowActionMenuL( ); - -private: - /** - * Private constructor. - * - * @param aContactActionMenu contact action menu - */ - CESMRContactMenuUrlHandler( CFscContactActionMenu& aContactActionMenu ); - - /** - * Opens selected richtext link in browser. - */ - void OpenUrlInBrowserL( ); - - /** - * Opens selected richtext link in intranet browser. - */ - void OpenUrlInIntranetL( ); - - /** - * Bookmarks selected richtext link. - */ - void BookmarkUrlL( ); - - /** - * Creates a single actionmenu item with selectable command - * @param aResourceId - * @param aCommandUid - */ - void CreateMenuItemL( TInt aResourceId, TUid aCommandUid ); - - /** - * create icons to actionmenu - */ - CGulIcon* CreateIconL(TUid aCommandUid); - - /** - * Is service vailable - * @param aResourceId resource id - * @return TBool - */ - TBool IsServiceAvailableL(TInt aResourceId); - - /** - * Service handler - * @return Reference to CAiwServiceHandler - */ - CAiwServiceHandler& ServiceHandlerL(); -private: //data - - ///Ref: Contact action menu - CFscContactActionMenu& iContactActionMenu; - - /// Own: Current Url. - HBufC* iUrl; - - /// Own: array of actionmenu icons - RPointerArray iIconArray; - - /// Own: instance of aiw servicehandler - CAiwServiceHandler* iServiceHandler; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrdynamicitemselectionlist.h --- a/meetingrequest/mrgui/inc/cesmrdynamicitemselectionlist.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrdynamicitemselectionlist.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmreditordialog.h --- a/meetingrequest/mrgui/inc/cesmreditordialog.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmreditordialog.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,23 +18,30 @@ #ifndef CESMREDITORDIALOG_H #define CESMREDITORDIALOG_H -#include +#include +#include +#include #include "mesmruibase.h" #include "mesmrresponseobserver.h" #include "mesmrfieldeventobserver.h" +#include "cesmrfieldbuilderinterface.h" class CESMRPolicy; class MESMRCalEntry; class CESMRView; class MAgnEntryUiCallback; class CESMRSendUI; -class CAiwServiceHandler; class CESMRField; class CESMRTitlePaneHandler; class CCalenInterimUtils2; class CESMRLocationPluginHandler; class CESMRAddressInfoHandler; class CESMRFeatureSettings; +class CMRToolbar; +class MMRInfoProvider; +class TDataType; +class MMRFocusStrategy; +class MESMRMeetingRequestEntry; /** * CESMREditorDialog implements the editor dialog for meeting requests. @@ -46,7 +53,8 @@ public CAknDialog, public MESMRUiBase, public MESMRResponseObserver, - public MESMRFieldEventObserver + public MESMRFieldEventObserver, + public MAknToolbarObserver { public: /** @@ -58,8 +66,7 @@ * @return Pointer to created and initialized esmr editor dialog. */ IMPORT_C static CESMREditorDialog* NewL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ); /* @@ -79,7 +86,11 @@ public: // From MESMRUIBase TInt ExecuteViewLD(); - + +public: // From MAknToolbarObserver + void DynInitToolbarL ( TInt aResourceId, CAknToolbar* aToolbar ); + void OfferToolbarEventL ( TInt aCommand ); + public: // From MESMRResponseObserver TBool Response( TInt aCommand ); void ExitDialog(); @@ -99,7 +110,7 @@ * @param aCallback Callback interface for AgnEntryUI */ CESMREditorDialog( - MESMRCalEntry& aEntry, + MMRInfoProvider& aPolicyProvider, MAgnEntryUiCallback& aCallback ); /** @@ -107,7 +118,7 @@ * * @param aPolicy contains all the fields for list component. */ - void ConstructL( CESMRPolicy* aPolicy ); + void ConstructL(); /** * Handles dialog exit, saves entry etc. @@ -135,12 +146,6 @@ void TryInsertSendMenuL(CEikMenuPane* aMenuPane); /** - * Handles print command. - * @param aCommand - */ - void HandlePrintCommandL(TInt aCommand); - - /** * Executes user related queries whether the entry should be * save or not. * @return TBool @@ -148,10 +153,12 @@ TBool IsAllowedToSaveL(); /** - * Checks if cfsmailbox actually supports attendee status + * Checks if cfsmailbox supports given capability. + * @param aCapa, the capability * @return TBool */ - TBool CESMREditorDialog::SupportsAttendeeStatusL( ); + TBool SupportsMailBoxCapabilityL( + MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa ); /** * Handle options menu command "open" @@ -166,33 +173,39 @@ */ void HandleLocationOptionsL( TInt aResourceId, CEikMenuPane* aMenuPane ); - /** - * Loads options menu text for given command. - * - * @param aCommandId option menu item command id - * @return text - */ - HBufC* LoadOptionsMenuTextLC( TInt aCommandId ); + CESMRLocationPluginHandler& LocationPluginHandlerL(); + CESMRAddressInfoHandler& AddressInfoHandlerL(); + void HandleFieldCommandEventL( const MESMRFieldEvent& aEvent ); + void HandleFieldChangeEventL( const MESMRFieldEvent& aEvent ); + TBool SetContextMenuL(); + void SwitchEntryTypeL( TInt aCommand, TBool aAdjustView ); + inline const CESMRPolicy& Policy() const; + void SetTitleL(); + void VerifyMeetingRequestL(); + TBool TryOpenAttachmentL(); + TInt TryRemoveAttachmentL(); + TInt TryRemoveAllAttachmentsL(); + TInt TryAddAttachmentL(); + void ShowContextMenuL(); - CESMRLocationPluginHandler& LocationPluginHandlerL(); - - CESMRAddressInfoHandler& AddressInfoHandlerL(); + /** + * Check mr is past + * + * @param aEvent + * @return TBool + */ + TBool OccursInPastL( const MESMRFieldEvent& aEvent ); + TBool OccursInPast( const TTime& aStartUtc ); + void ChangeRightSoftkeyL( TBool aOccursInPast, TBool aIsOrganizer ); - void HandleFieldCommandEventL( const MESMRFieldEvent& aEvent ); - - void HandleFieldChangeEventL( const MESMRFieldEvent& aEvent ); + TInt TryToSaveEntryL(); private: /** - * Own: Feature manager initialization flag + * Ref: Info provider for accessing entry and policy */ - TBool iFeatureManagerInitialized; - - /** - * Ref: Policy for building fields and menus - */ - CESMRPolicy* iPolicy; + MMRInfoProvider& iInfoProvider; /** * Ref: The only control in this dialog. Fwk deletes. @@ -200,11 +213,6 @@ CESMRView* iView; /** - * Ref: Reference to MESRCalEntry (CCalEntry wrapper) - */ - MESMRCalEntry& iEntry; - - /** * Ref: Agn Entry UI callback interface */ MAgnEntryUiCallback& iCallback; @@ -215,11 +223,6 @@ CESMRSendUI* iESMRSendUI; /** - * Own: AIW Service handler - */ - CAiwServiceHandler* iServiceHandler; - - /** * Own: Boolean indicating if required attendees field contains items. */ TBool iRequiredAttendeesEnabled; @@ -257,14 +260,20 @@ CESMRFeatureSettings* iFeatures; /** - * Indicates if meeting request occurs in past. - */ - TBool iOccursInPast; - - /** * Indicates if location has been modified. */ TBool iLocationModified; + // TODO: Take this into use when implementing the toolbar + /// Own: Toolbar handler + CMRToolbar* iToolbar; + + /// Own: Context menu resource id + TInt iContextMenuResourceId; + /// Own: Focus strategy of the editor + MMRFocusStrategy* iFocusStrategy; + + // record time after time field updated + TTime iStartTimeUtc; }; #endif // CESMREDITORDIALOG_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmreditorfieldstorage.h --- a/meetingrequest/mrgui/inc/cesmreditorfieldstorage.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmreditorfieldstorage.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -40,7 +40,7 @@ * @param aCommandObserver Reference to command observer */ static CESMREditorFieldStorage* NewL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldEventObserver& aEventObserver ); /** @@ -59,11 +59,22 @@ * @return KErrNone if validation succeeds, error code otherwise */ TInt Validate( TESMREntryFieldId& aUpdatedFocus, TBool aForceValidate ); - + + /** + * Adjusts this storage for new policy. Creates fields according to new + * policy. + * + * @param aNewPolicy the new policy + * @param aEntry the entry to edit + */ + void ChangePolicyL( + const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ); + private: // Implementation CESMREditorFieldStorage( MESMRFieldEventObserver& aEventObserver ); - void ConstructL( CESMRPolicy* aPolicy ); + void ConstructL( const CESMRPolicy& aPolicy ); private: /** diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrfieldbuilderinterface.h --- a/meetingrequest/mrgui/inc/cesmrfieldbuilderinterface.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrfieldbuilderinterface.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,8 +16,8 @@ */ -#ifndef CESMRFIELDBUILDERINTERFACE -#define CESMRFIELDBUILDERINTERFACE +#ifndef CESMRFIELDBUILDERINTERFACE_H +#define CESMRFIELDBUILDERINTERFACE_H #include @@ -68,24 +68,31 @@ /** * Put additional flags/checks here if needed */ - enum EMRCFSMailBoxCapability + enum TMRCFSMailBoxCapability { EMRCFSAttendeeStatus = 0, - EMRCFSResponseDontSend + EMRCFSResponseDontSend, + EMRCFSRemoveFromCalendar, + EMRCFSSupportsAttachmentsInMR }; /** - * check if a cfsmailboxflag is set + * Check if a cfsmailboxflag is set */ - virtual TBool CFSMailBoxCapabilityL( EMRCFSMailBoxCapability aCapa ) = 0; + virtual TBool CFSMailBoxCapabilityL( TMRCFSMailBoxCapability aCapa ) = 0; /** + * Check if a cfsmailboxflag is set + */ + virtual TBool CFSMailBoxCapabilityL( + const TDesC& aEmailAddress, + TMRCFSMailBoxCapability aCapa ) = 0; + + /** * Checks, whenter meeting request can be originated or not. - * @param aForceResetDefaultMRMailbox Whether or not the default MR - * * mailbox is to be forced to reset. * @return ETrue, if MR can be originated, EFalse otherwise. */ - virtual TBool MRCanBeOriginateedL( TBool aForceResetDefaultMRMailbox ) = 0; + virtual TBool MRCanBeOriginateedL() = 0; }; /** @@ -98,7 +105,8 @@ /** * Create specific implementation */ - inline static CESMRFieldBuilderInterface* CreatePluginL( TUid aImplementationUid ); + inline static CESMRFieldBuilderInterface* CreatePluginL( + TUid aImplementationUid ); /** * Destructor @@ -124,10 +132,13 @@ // CESMRFieldBuilderInterface::CreatePluginL // ----------------------------------------------------------------------------- // -inline CESMRFieldBuilderInterface* CESMRFieldBuilderInterface::CreatePluginL( TUid aImplementationUid ) +inline CESMRFieldBuilderInterface* CESMRFieldBuilderInterface::CreatePluginL( + TUid aImplementationUid ) { - TAny* implementation = REComSession::CreateImplementationL( aImplementationUid, - _FOFF(CESMRFieldBuilderInterface, iDestructorIdKey) ); + TAny* implementation = + REComSession::CreateImplementationL( aImplementationUid, + _FOFF( CESMRFieldBuilderInterface, + iDestructorIdKey ) ); return reinterpret_cast(implementation); } @@ -141,4 +152,4 @@ } -#endif // CESMRFIELDBUILDERINTERFACE +#endif // CESMRFIELDBUILDERINTERFACE_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrfieldeventqueue.h --- a/meetingrequest/mrgui/inc/cesmrfieldeventqueue.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrfieldeventqueue.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrfieldstorage.h --- a/meetingrequest/mrgui/inc/cesmrfieldstorage.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrfieldstorage.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -29,6 +29,8 @@ class MESMRCalEntry; class MESMRFieldEventObserver; class CESMRFieldEventQueue; +class CESMRPolicy; +class CMRSystemNotifier; /** * CESMRFieldStorage is a base class for different storage classes. @@ -88,9 +90,11 @@ TInt Count() const; CESMRField* Field( TInt aInd ) const; CESMRField* FieldById( TESMREntryFieldId aId ) const; - virtual void InternalizeL( MESMRCalEntry& aEntry ); - virtual void ExternalizeL( MESMRCalEntry& aEntry ); - virtual TInt Validate( TESMREntryFieldId& aId, TBool aForceValidate ); + void InternalizeL( MESMRCalEntry& aEntry ); + void ExternalizeL( MESMRCalEntry& aEntry ); + TInt Validate( TESMREntryFieldId& aId, TBool aForceValidate ); + void ChangePolicyL( const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ); protected: // C++ constructor @@ -101,6 +105,14 @@ CESMRFieldEventQueue& EventQueueL(); + void RemoveField( TInt aInd ); + + void InsertFieldL( CESMRField* aField, TInt aIndex ); + + void ReserveL( TInt aCount ); + + void Reset(); + private: /** * loads fieldbuilder ecom plugin @@ -121,6 +133,8 @@ MESMRFieldEventObserver& iEventObserver; /// Own: Event Queue CESMRFieldEventQueue* iEventQueue; + /// Own: System notifier + CMRSystemNotifier* iSystemNotifier; }; #endif // CESMRFIELDSTORAGE_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrglobalnote.h --- a/meetingrequest/mrgui/inc/cesmrglobalnote.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Edit before send list pop-up query -* -*/ - - -#ifndef CESMRGLOBALNOTE_H -#define CESMRGLOBALNOTE_H - -// INCLUDES -#include -#include -// -#include "esmrdef.h" -// - -// CLASS DECLARATION -class CEikonEnv; -/** - * CESMRGlobalNote encapsulates Yes/No confirmation query - * query for ES MR Utils usage. - */ -NONSHARABLE_CLASS( CESMRGlobalNote ) : public CBase - { - public: - enum TESMGlobalNoteType - { - EESMRCorruptedMR = 0, - EESMREndsBeforeStarts, - EESMRCalenLaterDate, - EESMREntryEndEarlierThanItStart, - EESMRAlarmAlreadyPassed, - EESMRDiffMoreThanMonth, - EESMRRepeatEndEarlierThanItStart, - EESMREntrySaved, - EESMRTodoEntrySaved, - EESMRRepeatDifferentStartAndEndDate, - EESMRRepeatReSchedule, - EESMRCannotDisplayMuchMore - }; - public: - /** - * Two-phased constructor. - */ - IMPORT_C static CESMRGlobalNote* NewL( - TESMGlobalNoteType aType); - - /** - * Destructor. - */ - ~CESMRGlobalNote(); - - private: // Constructors - - CESMRGlobalNote( TESMGlobalNoteType aType ); - void ConstructL(); - TAknGlobalNoteType NoteType(); - HBufC* NoteTextLC(); - - public: // Implementation - - /** - * Executes the dialog and destroys itself. - */ - void ExecuteLD(); - - /** - * Static version of ExecuteLD. - * @param aType The type of confirmation query. - */ - IMPORT_C static void ExecuteL( - TESMGlobalNoteType aType ); - - private: // Data - /// Own: Attendee status - TESMGlobalNoteType iType; - /// Own: Resource offset; - TInt iResourceOffset; - /// Ref: - CEikonEnv* iEnv; - - }; - -#endif // CESMRGLOBALNOTE_H - -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrguilistquery.h --- a/meetingrequest/mrgui/inc/cesmrguilistquery.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: esmrgui list queries -* -*/ - - -#ifndef CESMRGUILISTQUERY_H -#define CESMRGUILISTQUERY_H - -// -#include "esmrdef.h" -// -#include - -class CEikonEnv; -/** - * CESMRGuilistQuery encapsulates list queries - * - * @lib esmrgui.lib - */ -NONSHARABLE_CLASS( CESMRGUIListQuery ) : public CBase - { -public: - /** - * Enumeration definition for different kind of - * confirmation queries - */ - enum TESMRListQueryType - { - EESMRSendUpdateToAllQuery - }; -public: - /** - * C++ Destructor. - */ - ~CESMRGUIListQuery(); - - /** - * Static version of ExecuteLD. - * @param aType The type of confirmation query. - * @return TInt selected item or KErrCancel if no selection was made. - */ - IMPORT_C static TInt ExecuteL( TESMRListQueryType aType ); - -private: // Implementation - CESMRGUIListQuery( TESMRListQueryType aType ); - void ConstructL(); - TInt ExecuteLD(); - -private: // Data - /// Own: Attendee status - TESMRListQueryType iType; - - /// Own: Resource offset - TInt iResourceOffset; - - /// Ref: - CEikonEnv* iEnv; - }; - -#endif // CESMRGUILISTQUERY_H - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlayoutmgr.h --- a/meetingrequest/mrgui/inc/cesmrlayoutmgr.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,430 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR checkbox component for es mr gui (editor) -* -*/ - - -#ifndef CESMRLAYOUTMGR_H -#define CESMRLAYOUTMGR_H - -#include -#include -// -#include "esmrdef.h" -// -#include -#include - -class CFont; -class CCoeEnv; -class TMargins; -class TLogicalFont; -class CAknLayoutFont; -class CRepository; -class TAknsItemID; -class MESMRFontSizeObserver; - -/** - * MRUI mif file that includes all icon fallbacks for sis installations - */ -_LIT( KESMRMifFile, "esmrgui.mif"); - -/** - * Namespace for layout constants - */ -namespace ESMRLayout // codescanner::namespace - { - /** - * common icon value all around the application - */ - #define KIconSize ::TSize(20,20) // codescanner::baddefines - - /** - * Icon border margin - */ - const TInt KIconBorderMargin = 3; - - /** - * Field end margin - */ - const TInt KFieldEndMargin = 6; - - /** - * Mirrored icon margin - */ - const TInt KMirroredIconMargin = 9; - } - -/** - * CESMRLayoutManager - * - * @lib esmrgui.lib - */ -NONSHARABLE_CLASS( CESMRLayoutManager ) : - public CBase, - public MCenRepNotifyHandlerCallback - { -public: - // Enumeration for margin ids - enum TMarginsId - { - EFieldMargins = 0x000000 - }; - - // Struct for field sizes - struct SFieldSize - { - TESMREntryFieldId iId; - TInt iFontSmallHeight; - TInt iFontNormalHeight; - TInt iFontLargeHeight; - TInt iWidthLandscape; - TInt iWidthPortrait; - }; - -public: // Construction and destruction - - /** - * Creates and initialzes new CESMRLayoutManager object. - * @return Pointer to CESMRLayoutManager object. - */ - static CESMRLayoutManager* NewL(); - - /** - * C++ destructor - */ - virtual ~CESMRLayoutManager(); - -public: // Interface - - /** - * Fetches field size information. - * @param aId Field id. - * @return Field size information. - */ - virtual TSize FieldSize( TESMREntryFieldId aId ); - - /** - * Returns margin values used in the fields - * - * @param TMarginsId - Not currently in use - * @return TMargins margin values (pixels) - */ - virtual TMargins Margins( TMarginsId aId ); - - /** - * Fetches font for field. - * - * @param aEnv Pointer to coe environment - * @param aId Field id. - * @return Pointer to font object. Ownership is not transferred. - * Can return NULL pointer. - */ - virtual const CFont* Font( - CCoeEnv* aEnv, - TESMREntryFieldId aId); - - /** - * Fetces icon margin from the top of the field. - * This depends on the font size - * - * @return Margin value (pixels) - */ - virtual TInt IconTopMargin(); - - /** - * Fetces text margin from the top of the field. - * This depends on the font size - * - * @return Margin value (pixels) - */ - virtual TInt TextTopMargin(); - - /** - * Fetces text margin from the side of the field. - * This depends on the font size. - * - * @return Margin value (pixels) - */ - virtual TInt TextSideMargin(); - - /** - * Returns the size of the control where response - * area answer text is written. - * - * @return TSize Size of the control - */ - virtual TSize ResponseAreaAnswerTextSize(); - - /** - * Returns the size of the control where response - * area topic text is written. - * - * @return TSize Size of the control - */ - virtual TSize ResponseAreaTopicTextSize(); - - /** - * Returns the position of the control where response - * area answer text is written. - * - * @return TPoint position of the control - */ - virtual TPoint ResponseAreaAnswerTextPosition(); - - /** - * Returns the position of the icon in the response area item - * - * @return TPoint position of the control - */ - virtual TPoint ResponseAreaAnswerIconPosition(); - - /** - * Returns the height of the response area item - * - * @return TInt height of the control - */ - virtual TInt ResponseAreaAnswerItemheight(); - - /** - * Returns the height of standard list field - * - * @return TInt height of the control - */ - virtual TInt RegularFieldHeight(); - - /** - * Returns the position of the text control used in organizer field - * - * @return TInt height of the control - */ - virtual TPoint OrganizerTextPosition(); - - /** - * Returns the width of the text control used in organizer field - * - * @return TInt width of the control - */ - virtual TInt OrganizerTextWidth(); - - /** - * Returns the height of the title pane - * - * @return TInt height of the control - */ - virtual TInt TitlePaneHeight(); - - /** - * Returns the skin/theme based color used as a background - * color in the list. - * - * @return TRgb background color - */ - virtual TRgb ListAreaBgColor(); - - /** - * Returns the skin/theme based color used as a text - * color. - * - * @return TRgb text color - */ - virtual TRgb GeneralListAreaTextColor(); - - /** - * Returns the skin/theme based color used as a text - * color. - * - * @return TRgb text color - */ - virtual TRgb ViewerListAreaTextColor(); - - /** - * Returns the skin/theme based color used as a text - * color when text is "highlighted". - * - * @return TRgb text color - */ - virtual TRgb ViewerListAreaHighlightedTextColor(); - - /** - * Returns the skin/theme based text color used as a text - * color in theme documentation specified places. - * - * @return TRgb text color - */ - virtual TRgb NormalTextColor(); - - /** - * Returns the skin/theme based text color used as a text - * color in theme documentation specified places. - * - * @return TRgb text color - */ - virtual TRgb HighlightedTextColor(); - - /** - * Returns the skin/theme based text color used as a text - * color in title pane. - * - * @return TRgb text color - */ - virtual TRgb TitleAreaTextColor(); - - /** - * Returns the skin/theme based text background color to be used - * as a color in theme documentation specified places. - * - * @return TRgb text color - */ - virtual TRgb NormalTextBgColor(); - - /** - * Returns the skin/theme based field border color to be used - * as a color in theme documentation specified places. - * - * @return TRgb text color - */ - virtual TRgb FieldBorderColor(); - - /** - * Returns the text color ID for normal text. - * - * @return TInt text color ID - */ - virtual TInt NormalTextColorID(); - - /** - * Returns the text color ID for viewer area text. - * - * @return TInt text color ID - */ - virtual TInt ViewerListAreaTextColorID(); - - /** - * Creates bitmap and bitmap mask. Bitmap is skin/theme based - * and it's retrived by the given ID.Bitmap is also resized to - * the given size. - * Ownership of these created bitmaps is transferred to the caller. - * - * @param aIconID - id of the wanted bitmap - * @param aBitmap - reference to the pointer where new bitmap is stored - * @param aMask - reference to the pointer where new bitmap mask is stored - * @param aSize - Desired size for the bitmap - * @return TInt - KErrNone if bitmap was constructed succesfully - * KErrNotFound if any problems occured - */ - virtual TInt GetSkinBasedBitmap( TAknsItemID aIconID, - CFbsBitmap*& aBitmap, - CFbsBitmap*& aMask, - TSize aSize ); - /** - * Checks if Font settings were changed since last font update query - * Note: This function does not make a query/poll from the cenrep - * @see CESMRLayoutManager::Font - * - * @return TBool - True, if font was changed - */ - virtual TBool IsFontChanged(); - - /** - * Checks current font zoom/size of this layoutmanager - * - * @return TAknUiZoom - font zoom state - */ - virtual TInt CurrentFontZoom(); - - /** - * Sets the Font size settings observer. - * @param MESMRFontSizeObserver Observer instance to be informed. - */ - void SetObserver( MESMRFontSizeObserver* aObserver ); - - /** - * Returns the position of the conflict popup control - * - * @return TPoint control position - */ - IMPORT_C static TPoint ConflictPopupPosition(); - - /** - * Returns information about mirrored layout. - * - * @return TBool - ETrue if mirrored layout is set, otherwise EFalse. - */ - IMPORT_C static TBool IsMirrored(); - - /** - * Sets fallback icon from esmrgui.mif file if no matching icon from skin - * also used by several other fields as a utility - * - * @param aIconID - ID for the icon that this field should show - * @param aFileIndex - id of the icon (from esmrgui.mif) - * @param aFileMaskIndex - id of the icon mask (from esmrgui.mif) - */ - IMPORT_C static void SetBitmapFallback( const TAknsItemID& aIconID, - TInt& aFileIndex, - TInt& aFileMaskIndex); - -private: - // Default c++ constructor - CESMRLayoutManager(); - // Second phase constructor - void ConstructL(); - // From MCenRepNotifyHandlerCallback - // Notifies the observer that font size has changed - virtual void HandleNotifyInt( TUint32 aId, TInt aNewValue ); - - /** - * Method is used to add sizes of the fields for different font sizes and - * orientations. This is called only once at the construct phase. - * - * @param aId - ID of the field - * @param aFontSmallHeight - height of the field when small fonts are set. - * @param aFontNormalHeight - height of the field when normal fonts are set. - * @param aFontLargeHeight - height of the field when large fonts are set. - * @param aWidthLandscape - width of the field when orientation is landscape. - * @param aWidthPortrait - width of the field when orientation is portrait. - * - */ - void AddSize( - TESMREntryFieldId aId, - TInt aFontSmallHeight, - TInt aFontNormalHeight, - TInt aFontLargeHeight, - TInt aWidthLandscape, - TInt aWidthPortrait ); - -private: // Data - /// Own: Field size array - RArray iSize; - /// Own: Pointer to text field fonts - CAknLayoutFont* iFont; - /// Own: Pointer to mfne field fonts - CAknLayoutFont* iMfneFont; - /// Own: Pointer to cenrep object fetching font settings information - CRepository* iFontSettings; - /// Own: Font settings value - TInt iFontSettingsValue; - /// Own: Font settings change status - TBool iFontSettingsChanged; - /// Own: Active object which listens Font Size Key from a CenRep - CCenRepNotifyHandler* iNotifyHandler; - /// Ref: Observer for Font Size - MESMRFontSizeObserver* iFontSizeObserver; - }; - -#endif //CESMRLAYOUTMGR_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlistcomponent.h --- a/meetingrequest/mrgui/inc/cesmrlistcomponent.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR Custom list component -* -*/ - -#ifndef CESMRLISTCOMPONENT_H -#define CESMRLISTCOMPONENT_H - -#include -#include -#include -#include // MAknPhysicsObserver - -#include "mesmrlistobserver.h" - -class CESMRField; -class CESMRLayoutManager; -class MESMRFieldStorage; -class MESMRCalEntry; -class CMRListPane; -class CAknPhysics; - -/** - * CESMRListComponent is custom list for Meeting Request edtior and viewer. - * List contains a List pane of CESMRField items that are stored in CESMRFieldStorage - * class. - * - * @see CESMRField - * @lib esmrgui.lib - */ -NONSHARABLE_CLASS( CESMRListComponent ): - public CCoeControl, - public MESMRListObserver, - public MEikScrollBarObserver, - public MAknPhysicsObserver - { -public: - /** - * Two-phased constructor. - * - * @param aParent Parent control for this list component - * @param aStorage Storage contains all the list items. - * @return Pointer to created and initialized esmr list component object. - */ - static CESMRListComponent* NewL( - const CCoeControl* aParent, - MESMRFieldStorage* aStorage, - CESMRLayoutManager* aLayout ); - - /** - * Destructor. - */ - ~CESMRListComponent(); - - /** - * InternalizeL is used to obtain the data from current CCalEntry. - * CCalEntry is wrapped inside MESMRCalEntry object. This call is - * propagated to all list items in the list. - * - * @param aEntry Current entry - * @see MESMRCalEntry - */ - void InternalizeL( MESMRCalEntry& aEntry ); - - /** - * ExternalizeL is used to store the list item data into current - * CCalEntry. CCalEntry is wrapped inside the MESMRCalEntry object. - * - * @param aEntry Current entry. - * @param aForceValidation ETrue if force validation should be used - * @see MESMRCalEntry - */ - void ExternalizeL( MESMRCalEntry& aEntry, TBool aForceValidation = EFalse ); - - /** - * Return MESMRListObserver interface. Interface allows the caller - * to add, remove field and update field size. - */ - MESMRListObserver& ListObserver(); - - /** - * Return focused list item. - * @return Focused list item or NULL if no focused item - */ - CESMRField* FocusedItem() const; - - /** - * Initializes all fields. Needed when theme changes - */ - void InitializeL(); - - /** - * Changes every fields font - */ - void HandleFontChange(); - - void DisableSizeChange(TBool aDisable ); - -public: // From MEikScrollBarObserver - void HandleScrollEventL( CEikScrollBar* aScrollBar, - TEikScrollEvent aEventType ); - -public: // from MAknPhysicsObserver - - /** - * @see MAknPhysicsObserver::ViewPositionChanged - */ - virtual void ViewPositionChanged( const TPoint& aNewPosition, TBool aDrawNow, TUint aFlags ); - - /** - * @see MAknPhysicsObserver::PhysicEmulationEnded - */ - virtual void PhysicEmulationEnded(); - - /** - * @see MAknPhysicsObserver::ViewPosition - */ - virtual TPoint ViewPosition() const; - - -protected: // From MESMRListObserver - void ControlSizeChanged( CESMRField* aCtrl ); - void InsertControl( TESMREntryFieldId aField ); - void RemoveControl( TESMREntryFieldId aField ); - TBool IsControlVisible( TESMREntryFieldId aField ); - void SetControlFocusedL( TESMREntryFieldId aField ); - // SCROLLING_MOD: These two methods are for CESMRRichTextViewer to - //be able to control view area - void MoveListAreaDownL( TInt aAmount ); - void MoveListAreaUpL( TInt aAmount ); - TInt ListHeight(); - TBool IsFieldBottomVisible(); - -public: // From CCoeControl - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aInd ) const; - void SizeChanged(); - TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, - TEventCode aType ); - virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); - void MakeVisible(TBool aVisible); - - -private: - /** - * Default c++ constuctor - */ - CESMRListComponent( MESMRFieldStorage* aFactory, - CESMRLayoutManager* aLayout ); - /** - * Second phase constructor - */ - void ConstructL( const CCoeControl* aParent ); - -private: // Helper methods - - /** - * Scrolls the specific field to be fully visible - * - * @param aInd Index of the field that needs to be fully visible - * @param aSizeChanged ETrue if the field size has been changed - */ - void ScrollItemVisible( TInt aInd/*, TBool aSizeChanged*/ ); - - /** - * Scrolls items in the list up. - * - * @param aPx Amount of pixels that items are moved up - */ - void ScrollItemsUp( TInt aPx ); - - /** - * Scrolls items in the list down. - * - * @param aPx Amount of pixels that items are moved down - */ - void ScrollItemsDown( TInt aPx ); - - /** - * Updates scroll bar - */ - void UpdateScrollBar(); - - /** - * Sets physics engine parameters - */ - void UpdatePhysicsL(); - -private: - /// Own: scrollbar - CAknDoubleSpanScrollBar* iScroll; - /// Ref: scrollbar model - TAknDoubleSpanScrollBarModel iScrollModel; - /// Own: Storage for list items. - MESMRFieldStorage* iFactory; - /// Own: List item container - CMRListPane* iContainer; - /// Ref: Pointer to Layout data for list component - CESMRLayoutManager* iLayout; - // Own: Boolean for disabling SizeChanged handling - TBool iDisableSizeChanged; - // previous scroll bar thumb position - TInt iPrevThumbPos; - - CAknPhysics* iPhysics; - TBool iIsDragging; - TBool iIsScrolling; - TPoint iPreviousPosition; - TPoint iOriginalPosition; - TTime iStartTime; - TInt iCurrentScrollSpan; - }; -#endif //CESMRLISTCOMPONENT_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlistquery.h --- a/meetingrequest/mrgui/inc/cesmrlistquery.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition for mrui list queries -* -*/ - - -#ifndef CESMRLISTQUERY_H -#define CESMRLISTQUERY_H - -// INCLUDES -#include -// -#include "esmrdef.h" -// - -// FORWARD DECLARATIONS: -class CDesC16ArrayFlat; -class CAknPopupList; -class CESMRAlarm; -class CESMRRecurrence; - -// CLASS DECLARATION -class CEikonEnv; -/** - * CESMRListQuery encapsulates edit before send pop-up list - * query for ES MR Utils usage. - * - * Usage: - * - * TESMRResponseType resp = (TESMRResponseType) - * CESMRListQuery::ExecuteEditBeforeSendL(EESMRAttendeeStatusTentative); - * - * @lib esmrgui.lib - */ -NONSHARABLE_CLASS( CESMRListQuery ) : public CBase - { - public: - enum TESMRListQueryType - { - EESMREditBeforeSendQuery = 0, - EESMRSendUpdateToAllQuery, - EESMRRecurrenceQuery, - EESMRRelativeAlarmTimeQuery, - EESMROpenThisOccurenceOrSeriesQuery, - EESMRPriorityPopup, - EESMRTodoPriorityPopup, - EESMRSynchronizationPopup, - EESMRDeleteThisOccurenceOrSeriesQuery, - EESMREditBeforeSendQueryWithSendOptionsOnly - }; - - public: - /** - * Two-phased constructor. - */ - IMPORT_C static CESMRListQuery* NewL(TESMRListQueryType aType); - - /** - * Destructor. - */ - ~CESMRListQuery(); - - private: // Constructors - - CESMRListQuery( TESMRListQueryType aType ); - void ConstructL(); - - public: // Implementation - - /** - * Sets the attendee response status to Edit before send query's - * title. - * @param aStatus Response status - */ - void SetAttendeeStatus(TESMRAttendeeStatus aStatus); - - - /** - * Executes the dialog and destroys itself. - * @return TESMRResponseType, or KErrCancel if dialog has - * been cancelled. - */ - IMPORT_C TInt ExecuteLD(); - - /** - * Static version of ExecuteLD for edit before send dialog - * @param aStatus attendee status. - * @return TESMRResponseType, or KErrCancel if dialog has - * been cancelled. - */ - IMPORT_C static TInt ExecuteEditBeforeSendL( - TESMRAttendeeStatus aStatus); - - /** - * Static version of ExecuteLD for edit before send dialog - * @param aStatus attendee status. - * @return TESMRResponseType, or KErrCancel if dialog has - * been cancelled. - */ - IMPORT_C static TInt ExecuteEditBeforeSendWithSendOptOnlyL( - TESMRAttendeeStatus aStatus ); - - /** - * Static version of ExecuteLD for other list querys - * @param aStatus attendee status. - * @return - * TESMRSendUpdateQueryResponeStatus if the type is EESMRSendUpdateAll - * TESMRGUIAlarmValue if the type is EESMRRelativeAlarmTime - * TESMRGUIRecurrenceValue if the type is EESMRRecurrence - * TESMRThisOccurenceOrSeriesQuery if the type is - * EESMRThisOccurenceOrSeriesQuery - * or KErrCancel if dialog has - * been cancelled. - */ - IMPORT_C static TInt ExecuteL( - TESMRListQueryType aType); - - private: // Implementation: - - void SetListQueryTextsL( - CDesC16ArrayFlat* aItemArray, - CAknPopupList* aPopupList); - TInt MapSelectedIndexToReturnValue(TInt aIndex); - void LoadTextsFromResourceL(); - - private: // Data - /// Own: Attendee status - TESMRAttendeeStatus iStatus; - /// Own: Resource offset; - TInt iResourceOffset; - /// Own: List query type - TESMRListQueryType iType; - /// Own: Array for Alarm items - RPointerArray< CESMRAlarm > iAlarmArray; - /// Own: Array for Recurrence items - RPointerArray< CESMRRecurrence > iRecurrenceArray; - /// Ref: - CEikonEnv* iEnv; - }; - -#endif // CESMRLISTQUERY_H - -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlocationhistoryitem.h --- a/meetingrequest/mrgui/inc/cesmrlocationhistoryitem.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrlocationhistoryitem.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlocationhistoryitemfactory.h --- a/meetingrequest/mrgui/inc/cesmrlocationhistoryitemfactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrlocationhistoryitemfactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlocationhistorymanager.h --- a/meetingrequest/mrgui/inc/cesmrlocationhistorymanager.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrlocationhistorymanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlocationplugin.h --- a/meetingrequest/mrgui/inc/cesmrlocationplugin.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrlocationplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrlocationpluginhandler.h --- a/meetingrequest/mrgui/inc/cesmrlocationpluginhandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrlocationpluginhandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -86,11 +86,13 @@ * @param aLocation location text to update into entry * @param aIgnoreQuery if ETrue, "Replace previous location" query is * not displayed. + * @param aLocationReplaced on return, ETrue if previous location was replaced * @return ETrue if aEntry location field was modified. */ static TBool UpdateEntryLocationL( MESMRCalEntry& aEntry, const TDesC& aLocation, - TBool aIgnoreQuery ); + TBool aIgnoreQuery, + TBool& aLocationReplaced ); protected: // From MESMRLocationPluginObserver void SelectFromMapCompleted( TInt aError, @@ -125,6 +127,11 @@ */ TBool iEntryUpdated; + /** + * Location replace flag + */ + TBool iLocationReplaced; + /** * Location plugin. * Own. diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrmeetingtimevalidator.h --- a/meetingrequest/mrgui/inc/cesmrmeetingtimevalidator.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrmeetingtimevalidator.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -30,6 +30,7 @@ class CEikTimeEditor; class CEikDateEditor; class MESMRCalEntry; +class MMRAbsoluteAlarmController; /** * Validator for meetings. @@ -73,8 +74,10 @@ CEikTimeEditor& aAlarmTime ); void SetAlarmDateFieldL( CEikDateEditor& aAlarmDate ); - void SetRecurrenceUntilDateFieldL( - CEikDateEditor& aRecurrenceUntil ); + void SetRecurrenceUntilDateFieldL( + CEikDateEditor& aRecurrenceUntil ); + void SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& aAbsoluteAlarmController ); void StartTimeChangedL(); void EndTimeChangedL(); void StartDateChandedL(); @@ -95,7 +98,7 @@ TBool IsRelativeAlarmValid( TTimeIntervalMinutes aAlarmTimeOffset ); void SetFieldEventQueue( MESMRFieldEventQueue* aEventQueue ); - + MESMRFieldValidator::TESMRFieldValidatorError ValidateEditedInstanceTimeL(); private: // Implementation CESMRMeetingTimeValidator(); TInt PreValidateEditorContent(); @@ -137,6 +140,8 @@ CEikDateEditor* iAlarmDate; /// Ref: Reference to recurrence until date field CEikDateEditor* iRecurrenceUntilDate; + // Ref: Reference to absolute alarm on of interface + MMRAbsoluteAlarmController* iAbsoluteAlarmController; /// Own: Current recurrence value TESMRRecurrenceValue iRecurrenceValue; /// Ref: Entry being handled diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrmemotimevalidator.h --- a/meetingrequest/mrgui/inc/cesmrmemotimevalidator.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrmemotimevalidator.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -30,6 +30,7 @@ class MESMRCalEntry; class CEikTimeEditor; class CEikDateEditor; +class MMRAbsoluteAlarmController; /** * Wrapper class handles sanity checks for date/time fields on Memo/Day note @@ -81,6 +82,8 @@ CEikDateEditor& aAlarmDate ); void SetRecurrenceUntilDateFieldL( CEikDateEditor& aRecurrenceUntil ); + void SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& aAbsoluteAlarmController ); void StartTimeChangedL(); void EndTimeChangedL(); void StartDateChandedL(); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrmixedfieldstorage.h --- a/meetingrequest/mrgui/inc/cesmrmixedfieldstorage.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrmixedfieldstorage.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,7 +12,7 @@ * Contributors: * * Description : Fieldstorage with both viewer and editor fields -* Version : %version: tr1sido#3 % +* Version : %version: e002sa33#5 % * */ @@ -44,7 +44,7 @@ */ static CESMRMixedFieldStorage* NewL( MESMRFieldEventObserver& aEventObserver, - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, MESMRCalEntry& aEntry ); @@ -53,10 +53,13 @@ */ ~CESMRMixedFieldStorage(); -public: // from CESMRFieldStorage +protected: // from CESMRFieldStorage void ExternalizeL( MESMRCalEntry& aEntry ); void InternalizeL( MESMRCalEntry& aEntry ); TInt Validate( TESMREntryFieldId& aUpdatedFocus, TBool aForceValidate ); + void ChangePolicyL( + const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ); private: // Implemantation /** @@ -66,15 +69,16 @@ */ CESMRMixedFieldStorage( MESMRFieldEventObserver& aEventObserver, - MESMRResponseObserver* aResponseObserver, - MESMRCalEntry& aEntry ); + MESMRResponseObserver* aResponseObserver ); /** * Second phase constructor. * * @param aPolicy policy states visible fields + * @param aEntry current entry for policy */ - void ConstructL( CESMRPolicy* aPolicy ); + void ConstructL( const CESMRPolicy& aPolicy, + MESMRCalEntry& aEntry ); /** * Second phase constructor. @@ -83,7 +87,7 @@ * @param aValidator validator object */ void ConstructForwardEventL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldValidator* aValidator ); /** @@ -93,7 +97,7 @@ * @param aValidator validator object */ void ConstructRecurrentEventL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldValidator* aValidator ); /** @@ -103,9 +107,23 @@ * @param aValidator validator object */ void ConstructEditSeriesEventL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldValidator* aValidator ); + /** + * Resets this storage + */ + void Reset(); + + /** + * Non-virtual function to change policy. + * @param aNewPolicy policy states visible fields + * @param aEntry the entry to handle + */ + void DoChangePolicyL( + const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ); + private: /** Enumeration for mixed event types */ @@ -127,7 +145,7 @@ /// Ref: Response observer MESMRResponseObserver* iResponseObserver; /// Ref: Reference to used calendar entry - MESMRCalEntry& iEntry; + MESMRCalEntry* iEntry; /// Own: Created event type TMixedFieldStorageEventType iEventType; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrrecurrence.h --- a/meetingrequest/mrgui/inc/cesmrrecurrence.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition for mrui list queries -* -*/ - -#ifndef CESMRRECURRENCE_H -#define CESMRRECURRENCE_H - -#include -#include // resource reader -// -#include "esmrdef.h" -// - -/** - * Helper class for recurrence texts - */ -NONSHARABLE_CLASS( CESMRRecurrence ) : public CBase - { -public: - /** - * Constructor. - */ - IMPORT_C CESMRRecurrence(); - - /** - * Destructor. - */ - IMPORT_C ~CESMRRecurrence(); - - /** - * Constructs the recurrence text from resource. - * - * @param aEnv - Control environment to be used - * @param aReader - resource reader for reading the correct text - */ - IMPORT_C void ConstructFromResourceL( - CCoeEnv* aEnv, TResourceReader& aReader ); - - /** - * Get the type of recurrence - * - * @return type of recurrence - */ - IMPORT_C TESMRRecurrenceValue RecurrenceValue(); - - /** - * Get the descriptor text for the type of recurrence - * - * @return descriptor text for the type of recurrence - */ - IMPORT_C HBufC& RecurrenceText(); - -private: - //Own: ID of the wanted recurrence text - TESMRRecurrenceValue iId; - //Own: Descriptor for the actual text - HBufC* iTxt; - }; -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrresponsedialog.h --- a/meetingrequest/mrgui/inc/cesmrresponsedialog.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrresponsedialog.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,8 +20,7 @@ #define CESMRRESPONSEDIALOG_H // INCLUDES -#include -#include +#include // FORWARD DECLARATIONS class CAknsBasicBackgroundControlContext; @@ -33,8 +32,7 @@ * * @lib esmrgui.lib */ -NONSHARABLE_CLASS( CESMRResponseDialog ) : public CAknDialog, - public MAknToolbarObserver +NONSHARABLE_CLASS( CESMRResponseDialog ) : public CAknDialog { public: /** @@ -52,11 +50,6 @@ SEikControlInfo CreateCustomControlL( TInt aType ); TBool OkToExitL (TInt aButtonId); void ProcessCommandL( TInt aCommand ); - void DynInitMenuPaneL( /*TInt aResourceId,*/ - CEikMenuPane* aMenuPane ); - -public: // From MAknToolbarObserver - virtual void OfferToolbarEventL( TInt aCommand ); public:// From CCoeControl TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); @@ -65,8 +58,6 @@ private://Implementation CESMRResponseDialog( HBufC*& aText ); void ConstructL(); - void MakeResponseToolbarL(); - void RestoreMrGuiToolbarL(); private: // data /** @@ -78,11 +69,8 @@ * Ref: Pointer to buffer where the text is written */ HBufC*& iText; - - /** - * Pointer to previous toolbar observer. Not owned - */ - MAknToolbarObserver* iOldObserver; + /// To record if the toolbar in previous view is visible. + TBool iPreviousVisibility; }; #endif // CESMRRESPONSEDIALOG_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrrichtextlink.h --- a/meetingrequest/mrgui/inc/cesmrrichtextlink.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for single text link -* -*/ - -#ifndef CESMRRICHTEXTLINK_H -#define CESMRRICHTEXTLINK_H - -#include - -/** - * Class for single text link object - */ -NONSHARABLE_CLASS( CESMRRichTextLink ): public CBase - { -public: - // Enumerations for the higlighted item type - enum TType - { - ETypeEmail, - ETypePhoneNumber, - ETypeURL, - ETypeAttachment, - ETypeShowAll, - ETypeLocationUrl - }; - - // Enumerations for the action trigger key - enum TTriggerKey - { - ETriggerKeyRight, - ETriggerKeyOk - }; - - /** - * Creates new rich text link instance. - * - * @param aStartPos - Start position of the link - * @param aLength - Length of the link - * @param aValue - Actual value of the link (e.g. email address) - * @param aType - Type of the link - * @param aTriggerKey - Key that triggers the action - * @return New rich text link object - */ - IMPORT_C static CESMRRichTextLink* NewL( - TInt aStartPos, - TInt aLength, - const TDesC& aValue, - TType aType, - TTriggerKey aTriggerKey ); - - // Destructor - IMPORT_C ~CESMRRichTextLink( ); - - /** - * Getter for start position - * - * @return Start postion of the link - */ - IMPORT_C TInt StartPos( ) const; - - /** - * Getter for link length - * - * @return Length of the link - */ - IMPORT_C TInt Length( ) const; - - /** - * Getter for link actual value - * - * @return Value of the link - */ - IMPORT_C TDesC& Value( ) const; - - /** - * Getter for link type - * - * @return Type of the link - */ - IMPORT_C TType Type( ) const; - - /** - * Getter for trigger key - * - * @return Key that triggers the event - */ - IMPORT_C TTriggerKey TriggerKey( ) const; - - /** - * Setter for start position - * - * @param aPos New start position of the link - */ - IMPORT_C void SetStartPos( TInt aPos ); - -private: // Implementation - CESMRRichTextLink( - TInt aStartPos, - TInt aLength, - TType aType, - TTriggerKey aTriggerKey ); - void ConstructL(const TDesC& aValue ); - -private: - /// Own: - TInt iStartPos; - /// Own: - TInt iLength; - /// Own: - HBufC* iValue; - /// Own: - TType iType; - /// Own: - TTriggerKey iTriggerKey; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrsendui.h --- a/meetingrequest/mrgui/inc/cesmrsendui.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR send ui wrapper -* -*/ - - -#ifndef CESMRSENDUI_H -#define CESMRSENDUI_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CCalSession; -class CCalEntry; -class CEikMenuPane; -class CSendUi; -class TParse; -class RFile; -class CCalenGlobalData; - -/** -* SendUI wrapper class. Used to send entry information forward. CCalEntry -* is converted to VCalendar format before sending. -*/ -NONSHARABLE_CLASS( CESMRSendUI ) : public CBase - { -public: // Factory method and destructor - IMPORT_C static CESMRSendUI* NewL(TInt aMenuCommandId); - IMPORT_C virtual ~CESMRSendUI(); - -public: // API - /** - * Can entry be sent or not. - * - * @param aCommandId - NOT IN USE - * @return boolean ETrue/Efalse - */ - IMPORT_C TBool CanSendL(TInt aCommandId); - - /** - * Adds the send ui menu items into menu pane. - * - * @param aMenuPane - menu pane where items are added - * @param aIndex - index of the menu item - */ - IMPORT_C void DisplaySendMenuItemL(CEikMenuPane& aMenuPane, TInt aIndex); - - /** - * Displays the send ui sub menu - * - * @param aMenuPane - NOT IN USE - */ - IMPORT_C void DisplaySendCascadeMenuL(CEikMenuPane& aMenuPane); - - /** - * Sends the converted entry via selected protocol - * - * @param aCommand - information about how entry needs to be sent - * @param aEntry - entry to be sent. - */ - IMPORT_C void SendAsVCalendarL(TInt aCommand, CCalEntry& aEntry); - -private: // utility functions - void DoSendAsAttachmentFileL(TInt aCommand, TParse& aFilename); - - void DoSendAsAttachmentHandleL(const RFile& aHandle); - -private: // constrution - CESMRSendUI(); - void ConstructL(TInt aMenuCommandId); -private: // data - /// Own: - CSendUi* iSendUi; - /// Own: - TInt iSendAsCmdId; - /// Own: - TUid iSelectedMtmUid; - /// Own: - CArrayFixFlat* iSendMtmsToDim; - // Own: calendar session - CCalSession* iSession; - }; - -#endif // CESMRSENDUI_H - - -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrtitlepane.h --- a/meetingrequest/mrgui/inc/cesmrtitlepane.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrtitlepane.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,7 +19,7 @@ #define CESMRTITLEPANE_H #include -#include +#include "nmrbitmapmanager.h" // #include "mesmrcalentry.h" #include "esmrdef.h" @@ -51,18 +51,6 @@ void SizeChanged(); public: - /** - * Handle set the priority - * @param aPriority - */ - void HandleSetPriorityCmdL( TInt aPriority ); - /** - * Sets the priority indicator for this pane - * - * @param aPriority - priority to be set - * @param aEntryType - entry type - */ - void SetPriorityL(TUint aPriority ); /** * Sets the text for this pane @@ -77,31 +65,14 @@ */ void InternalizeL( MESMRCalEntry& aEntry ); - /** - * Called by the view component. Title pane stores the priority of entry - * @param aEntry Current calendar entry - */ - void ExternalizeL( MESMRCalEntry& aEntry ); - - /** - * Set default icon for the view if needed - */ - void SetDefaultIcon(TBool aDefault); private: CESMRTitlePane(); void ConstructL(); - void CreateIconL( TAknsItemID aIconID ); private: - /// Own: Current priority - TUint iPriority; /// Own: entry type: MESMRCalEntry::TESMRCalEntryType iEntryType; - /// Own: do we have a default icon - TBool iDefaultIcon; - /// Own: Field icon - CMRImage* iIcon; /// Own: Field text label CMRLabel* iTitle; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrtitlepanehandler.h --- a/meetingrequest/mrgui/inc/cesmrtitlepanehandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrtitlepanehandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,111 +11,57 @@ * * Contributors: * -* Description: ESMR titlepane handler header - - * +* Description: MR titlepane handler header +* */ - - - #ifndef CESMRTITLEPANEHANDLER_H - #define CESMRTITLEPANEHANDLER_H - - // INCLUDES - #include - - // FORWARD DECLARATIONS - class CAknTitlePane; - class CEikonEnv; - - // CLASS DECLARATIONS - NONSHARABLE_CLASS( CESMRTitlePaneHandler ) : public CBase - - { - - public: - - static CESMRTitlePaneHandler* NewL( CEikonEnv& aEnv ); - - ~CESMRTitlePaneHandler(); - - - - public: - - /** + { + public: + static CESMRTitlePaneHandler* NewL( CEikonEnv& aEnv ); + ~CESMRTitlePaneHandler(); - * Restores the original titlepane text that was saved - - * before setting new one into titlepane. If called before - - * SetNewTitle() does nothing. - - */ - - void Rollback(); - - - - /** - - * Sets new title. If aNewTitle is NULL the titlepane - - * default is used. + public: + /** + * Restores the original titlepane text that was saved + * before setting new one into titlepane. If called before + * SetNewTitle() does nothing. + */ + void Rollback(); - * @param aNewTitle New titlepane text as reference - - */ - - void SetNewTitle( const TDesC* aNewTitle ); - - - - private: - - CESMRTitlePaneHandler( CEikonEnv& aEnv ); - - void ConstructL(); - - - - void SetTitlePaneTextL( const TDesC* aNewTitle ); + /** + * Sets new title. If aNewTitle is NULL the titlepane + * default is used. + * @param aNewTitle New titlepane text as reference + */ + void SetNewTitle( const TDesC* aNewTitle ); - - - private: - - // Own: Original title pane text before change - - HBufC* iSaveTitlePaneText; - - // Ref: + private: + CESMRTitlePaneHandler( CEikonEnv& aEnv ); + void ConstructL(); + void SetTitlePaneTextL( const TDesC* aNewTitle ); - CEikonEnv& iEikEnv; - - // Ref: - - CAknTitlePane* iTitlePane; - - }; - - + private: + // Own: Original title pane text before change + HBufC* iSaveTitlePaneText; + // Ref: + CEikonEnv& iEikEnv; + // Ref: + CAknTitlePane* iTitlePane; + }; #endif // CESMRTITLEPANEHANDLER_H - - // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrtodotimevalidator.h --- a/meetingrequest/mrgui/inc/cesmrtodotimevalidator.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrtodotimevalidator.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -32,6 +32,7 @@ class CEikTimeEditor; class CEikDateEditor; class MESMRMeetingRequestEntry; +class MMRAbsoluteAlarmController; /** * Wrapper class handles sanity checks for date/time fields. @@ -81,6 +82,8 @@ CEikDateEditor& aAlarmDate ); void SetRecurrenceUntilDateFieldL( CEikDateEditor& aRecurrenceUntil ); + void SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& aAbsoluteAlarmController ); void StartTimeChangedL(); void EndTimeChangedL(); void StartDateChandedL(); @@ -110,6 +113,7 @@ TDateTime DueDateTimeL(); TDateTime AlarmDateTimeL(); void ForceValuesL(); + TBool IsModifiedL( MESMRCalEntry& aEntry ); private: /// Ref: Start date editor. @@ -126,6 +130,14 @@ TBool iAlarmOnOff; /// Ref: Entry being handled MESMRCalEntry* iEntry; + /// Own: Saves initial alarm time, for later comparisons + TTime iInitialAlarmTime; + /// Own: Saves initial alarm date, for later comparisons + TTime iInitialAlarmDate; + /// Own: Saves initial alarm on off, for later comparisons + TBool iInitialAlarmOnOff; + /// Own: Saves initial due date, for later comparisons + TTime iInitialDueDate; }; #endif // CESMRTODOTIMEVALIDATOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrtrackingview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cesmrtrackingview.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR Tracking view container for the title label and list component +* +*/ + +#ifndef CESMRTRACKINGVIEW_H_ +#define CESMRTRACKINGVIEW_H_ + +#include +#include +#include + +#include "mesmrtitlepaneobserver.h" +#include "mesmrfontsizeobserver.h" +#include "tnavipaneclearer.h" + +#include "resmrstatic.h" +#include "cesmrcontactmenuhandler.h" +#include "nmrbitmapmanager.h" + +class CESMRTitlePane; +class MESMRCalEntry; +class MESMRFieldStorage; +class MAgnEntryUiCallback; +class CAknsBasicBackgroundControlContext; +class CESMRTrackingViewDialog; + +/** + * Container for the meeting request title and list control. + * This class is deleted by framework + */ +NONSHARABLE_CLASS( CESMRTrackingView ): + public CCoeControl, + public MCoeControlBackground, + public MESMRFontSizeObserver, + public MEikListBoxObserver + { +public: + /** + * Two-phased constructor. + * + * @param aEntry - interface to entry information. + * @param aRect - rect for this view + * @param aReqAttendee - the count of required attendees + * @param aOptAttendee - the count of optional attendees + * @return Pointer to created and initialized esmr view object. + */ + static CESMRTrackingView* NewL( + MESMRCalEntry& aEntry, + const TRect& aRect, + const TInt &aReqAttendee, + const TInt &aOptAttendee); + + /** + * Destructor. + */ + ~CESMRTrackingView(); + +public: + + /** + * Externalize the list component items. Data in list items + * is stored to iEntry member variable. + * + * @param TBool ETrue if force validation should be used + */ + void ExternalizeL( TBool aForceValidation = EFalse ); + + /** + * Internalize the list component items. Data from iEntry is updated + * to all fields. + */ + void InternalizeL(); + + /** + * Process commands. Dialog forwards the commands that must + * be handled by CESMRTrackingView. + * + * @param aCommand + */ + void ProcessEditorCommandL( TInt aCommand ); + + /** + * Title can be changed by calling this method + * + * @param aTitle New title for the view + * @param aDefault + */ + void SetTitleL( const TDesC& aTitle ); + + /** + * Launches editor help + */ + void LaunchEditorHelpL(); + + /** + * Launches viewer help + */ + void LaunchViewerHelpL(); + + void SetParentDialog(CCoeControl* aParentDialog); + +private: // implementation + void ConstructL( const TRect& aRect ); + CESMRTrackingView( MESMRCalEntry& aEntry, + const TInt &aReqAttendee, + const TInt &aOptAttendee); + +private: + // Define the type of icons for status type + enum TStatusIconType + { + /** For accept */ + EAcceptIcon, + /** For reject */ + ERejectIcon, + /** For tentative */ + ETentativeIcon, + /** For none status */ + ENoneIcon, + /** For account total type number */ + ETotalIconNumber + }; + void LaunchHelpL( const TDesC& aContext ); + void CreateTrackingListL(); + void InitTrackingListL(); + void InitStatusIconArrayL(); + CGulIcon* InitStatusIconL(NMRBitmapManager::TMRBitmapId aStatus); + +public: // From CCoeControl + void SetContainerWindowL(const CCoeControl& aContainer); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + TSize MinimumSize(); + TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); + void HandleResourceChange( TInt aType ); + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + +private: // From CCoeControl + void Draw( const TRect& aRect ) const; + +protected: // FromMESMRFontSizeObserver + void FontSizeSettingsChanged(); + +public: // From MCoeControlBackground + void Draw(CWindowGc& aGc, + const CCoeControl& aControl, + const TRect& aRect) const; + void GetTextDrawer( + CCoeTextDrawerBase*& aText, + const CCoeControl* aControl) const; + +public: // From MEikListBoxObserver + virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); + +private: + /// Own: Priority icon + CESMRTitlePane* iTitle; + /// Own: attendee list + /// Own: The list for attendee names and tracking status + CAknSingleGraphicStyleListBox* iList; + /// Ref: List item storage +// MESMRFieldStorage* iStorage; + /// Ref: Current MR entry + MESMRCalEntry& iEntry; + /// Own: To enable skin as background for the iTitle + CAknsBasicBackgroundControlContext* iBgContext; + /// Own: This clears the navipane for us. + TNavipaneClearer iClearer; + /// Required attendee count + TInt iReqAttendeeCount; + /// Optional attendee count + TInt iOptAttendeeCount; + /// Own: list text array + MDesCArray* iItemArray; + /** + * Static TLS stored variables. + */ + RESMRStatic iESMRStatic; + /** + * Ref: Reference to menu handler + */ + CESMRContactMenuHandler* iMenuHandler; + /// Ref: Tracking View Dialog + CESMRTrackingViewDialog* iParentDialog; + /// Own: attendees' contact info + TDesC* iAddress; + /// Own: Focused list item index + TInt iFocusedItemIndex; + /// Own: Index of "Optional" item + TInt iIndexOfOptLabel; + }; + +#endif /* CESMRTRACKINGVIEW_H_ */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrtrackingviewdialog.h --- a/meetingrequest/mrgui/inc/cesmrtrackingviewdialog.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrtrackingviewdialog.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,31 +12,30 @@ * Contributors: * * Description : ESMR tracking viewe dialog -* Version : %version: tr1sido#4 % +* Version : %version: e002sa33#7 % * */ #ifndef CESMRTRACKINGVIEWDIALOG_H #define CESMRTRACKINGVIEWDIALOG_H // SYSTEM INCLUDE -#include +#include #include +//#include #include "mesmruibase.h" #include "mesmrresponseobserver.h" #include "resmrstatic.h" -#include "mesmrfieldeventobserver.h" + // FORWARD DECLARATIONS class CESMRPolicy; class MAgnEntryUiCallback; class MESMRCalEntry; -class CESMRView; -class CAiwServiceHandler; +class CESMRTrackingView; class CESMRTrackingViewDialog : public CAknDialog, - public MESMRUiBase, - public MESMRFieldEventObserver + public MESMRUiBase { public: @@ -44,10 +43,10 @@ * Two-phased constructor. * */ - static CESMRTrackingViewDialog* NewL - (CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, - MAgnEntryUiCallback& aCallback + static CESMRTrackingViewDialog* NewL( + const CESMRPolicy& aPolicy, + MESMRCalEntry& aEntry, + MAgnEntryUiCallback& aCallback ); /* @@ -68,29 +67,25 @@ public: // From MESUIBase TInt ExecuteViewLD(); -protected: // From MESMRFieldEventObserver +public: // Used by tracking vieww - void HandleFieldEventL( const MESMRFieldEvent& aEvent ); + void HandleListEventL(); private: // Implementation void DoProcessCommandL( TInt aCommand ); - CESMRTrackingViewDialog(MESMRCalEntry& aEntry, MAgnEntryUiCallback& aCallback); - void ConstructL( CESMRPolicy* aPolicy ); + CESMRTrackingViewDialog( const CESMRPolicy& aPolicy, + MESMRCalEntry& aEntry, + MAgnEntryUiCallback& aCallback); + void ConstructL(); TInt CountAttendeesL(CCalAttendee::TCalRole aRole); void SortAttendeesL(); - void HandlePrintCommandL(TInt aCommand); private: /** - * Own:Feature manager initialization flag - */ - TBool iFeatureManagerInitialized; - - /** * Ref: Policy for building fields and menus */ - CESMRPolicy* iPolicy; + const CESMRPolicy& iPolicy; /// Ref: Reference to MESRCalEntry (CCalEntry wrapper) MESMRCalEntry& iEntry; @@ -101,10 +96,7 @@ /** * Ref: The only control in this dialog. Fwk deletes. */ - CESMRView* iView; - - /// Own: AIW Service handler - CAiwServiceHandler* iServiceHandler; + CESMRTrackingView* iView; /// Own: Static TLS data handler RESMRStatic iESMRStatic; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmruibase.h --- a/meetingrequest/mrgui/inc/cesmruibase.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmruibase.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,7 +18,7 @@ #ifndef CESMRUIBASE_H #define CESMRUIBASE_H -#include +#include #include "mesmruibase.h" /** diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmruifactory.h --- a/meetingrequest/mrgui/inc/cesmruifactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmruifactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,6 +25,7 @@ // FORWARD DECLARATIONS: class CEikonEnv; +class MMRInfoProvider; /** * UI Factory implementation. @@ -52,8 +53,7 @@ public: // From MESMRUiFactory IMPORT_C MESMRUiBase* CreateUIL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ); private: // Implementation diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrvalidatorfactory.h --- a/meetingrequest/mrgui/inc/cesmrvalidatorfactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrvalidatorfactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrview.h --- a/meetingrequest/mrgui/inc/cesmrview.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrview.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,18 +19,28 @@ #define CESMRVIEW_H #include -#include +#include +#include -#include "cesmrlistcomponent.h" +#include "cmrlistpane.h" #include "mesmrtitlepaneobserver.h" -#include "mesmrfontsizeobserver.h" +#include "mmrscrollbarobserver.h" +#include "tnavipaneclearer.h" +#include "esmrgui.hrh" class CESMRTitlePane; -class MESMRCalEntry; class MESMRFieldStorage; class MAgnEntryUiCallback; -class CESMRLayoutManager; class CAknsBasicBackgroundControlContext; +class CESMRPolicy; +class CEikMenuPane; +class MMRFocusStrategy; +class MTouchFeedback; +class CMRNaviArrow; +class MESMRNaviArrowEventObserver; +class CMRToolbar; +class MESMRFieldEvent; +class CMRAttachmentIndicator; /** * Container for the meeting request title and list control. @@ -39,163 +49,262 @@ NONSHARABLE_CLASS( CESMRView ): public CCoeControl, public MCoeControlBackground, - public MESMRFontSizeObserver, - public MESMRTitlePaneObserver + public MESMRTitlePaneObserver, + public MEikScrollBarObserver, + public MMRScrollBarObserver { -public: - /** - * Two-phased constructor. - * - * @param aStorage - interface to storage that has all the fileds - * @param aEntry - interface to entry information. - * @param aRect - rect for this view - * @return Pointer to created and initialized esmr view object. - */ - static CESMRView* NewL( - MESMRFieldStorage* aStorage, - MESMRCalEntry& aEntry, - const TRect& aRect ); + public: + /** + * Two-phased constructor. + * + * @param aStorage - interface to storage that has all the fileds + * @param aEntry - interface to entry information. + * @param aRect - rect for this view + * @param aFocusStrategy - interface to focus strategy + * @param aToolbar - Reference to MR toolbar + * @param aObserver - navi arrow observer + * @return Pointer to created and initialized esmr view object. + */ + static CESMRView* NewL( + MESMRFieldStorage* aStorage, + MESMRCalEntry& aEntry, + const TRect& aRect, + MMRFocusStrategy& aFocusStrategy, + CMRToolbar& aToolbar, + MESMRNaviArrowEventObserver* aObserver = NULL ); + + /** + * Destructor. + */ + ~CESMRView(); - /** - * Destructor. - */ - ~CESMRView(); + public: -public: + /** + * Externalize the list component items. Data in list items + * is stored to iEntry member variable. + * + * @param TBool ETrue if force validation should be used + */ + void ExternalizeL( TBool aForceValidation = EFalse ); + + /** + * Internalize the list component items. Data from iEntry is updated + * to all fields. + */ + void InternalizeL(); - /** - * Externalize the list component items. Data in list items - * is stored to iEntry member variable. - * - * @param TBool ETrue if force validation should be used - */ - void ExternalizeL( TBool aForceValidation = EFalse ); + /** + * Process commands. Dialog forwards the commands that must + * be handled by CESMRView. + * + * @param aCommand + */ + void ProcessEditorCommandL( TInt aCommand ); - /** - * Internalize the list component items. Data from iEntry is updated - * to all fields. - */ - void InternalizeL(); + /** + * Query if a component with given id is currently visible + * + * @param aField Field Id which visibility we are interested in. + * @return True if component is currently visible + */ + TBool IsControlVisible( TESMREntryFieldId aField ) const; - /** - * Checks if the command can be processed - * be handled by CESMRView. - * - * @param aCommand - * @return ETrue if command can be processed - */ - TBool CanProcessEditorCommandL( TInt aCommand ); + /** + * Title can be changed by calling this method + * + * @param aTitle New title for the view + * @param aDefault + */ + void SetTitleL( const TDesC& aTitle, TBool aDefault = EFalse ); - /** - * Process commands. Dialog forwards the commands that must - * be handled by CESMRView. - * - * @param aCommand - */ - void ProcessEditorCommandL( TInt aCommand ); + /** + * Focused field in the list can be changed by calling this method + * + * @param aField Field id of the field that needs to be focused + */ + void SetControlFocusedL( TESMREntryFieldId aField ); + + /** + * Launches editor help + */ + void LaunchEditorHelpL(); + + /** + * Launches viewer help + */ + void LaunchViewerHelpL(); - /** - * Query if a component with given id is currently visible - * - * @param aField Field Id which visibility we are interested in. - * @return True if component is currently visible - */ - TBool IsComponentVisible( TESMREntryFieldId aField ) const; + /** + * Query if a component with given id is currently focused + * + * @param aField Field Id which focus we are interested in. + * @return True if component is currently focused + */ + TBool IsComponentFocused( TESMREntryFieldId aField ) const; - /** - * Title can be changed by calling this method - * - * @param aTitle New title for the view - * @param aDefault - */ - void SetTitleL( const TDesC& aTitle, TBool aDefault = EFalse ); + /** + * Returns the the currently focused field id. + */ + TESMREntryFieldId FocusedField() const; + + /** + * Returns the the currently clicked (if exists) or focused field id. + */ + TESMREntryFieldId ClickedOrFocusedField() const; + + /** + * Set the navi arrows' visibility. + * @param aLeftArrowVisible Indicate if the left arrow visible + * @param aRightArrowVisible Indicate if the right arrow visible + */ + void SetNaviArrowStatus(TBool aLeftArrowVisible, TBool aRightArrowVisible); - /** - * Focused field in the list can be changed by calling this method - * - * @param aField Field id of the field that needs to be focused - */ - void SetControlFocusedL( TESMREntryFieldId aField ); + /** + * Adjusts view for a new entry and a new policy + */ + void AdjustViewL( + MESMRCalEntry* aNewEntry, + const CESMRPolicy& aNewPolicy ); + + /** + * Scroll the list to put the responeArea at the top and + * set the focus on it + */ + void InitialScrollL(); - /** - * Launches editor help - */ - void LaunchEditorHelpL(); - - /** - * Launches viewer help - */ - void LaunchViewerHelpL(); + /** + * Provides possibility to initialize current menu pane. + * @param aMenuStyle style of the provided menu pane + * @param aResourceId Context menu resource ID + * @param aMenuPane Pointer to menu pane + */ + void DynInitMenuPaneL( + TMRMenuStyle aMenuStyle, + TInt aResourceId, + CEikMenuPane* aMenuPane ); + + /* + * Relayouts view by calling size changed. + */ + void ReLayout(); - /** - * Query if a component with given id is currently focused - * - * @param aField Field Id which focus we are interested in. - * @return True if component is currently focused - */ - TBool IsComponentFocused( TESMREntryFieldId aField ) const; + /** + * Processes event. + * @param aEvent Reference to event to be processed + */ + void ProcessEventL( const MESMRFieldEvent& aEvent ); + + + public: // From CCoeControl + TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); - /** - * Returns the the currently focused field id. - */ - TESMREntryFieldId FocusedField() const; - -public: // From CAknDialog - void DynInitMenuPaneL( /*TInt aResourceId,*/ - CEikMenuPane* aMenuPane ); + public: + /* + * Set MRUI MR view mode for judge editor mode or viewer mode is using. + * @param aMode MRUI MR view mode + */ + void SetViewMode(TESMRViewMode aMode); + TESMRViewMode GetViewMode(); + + private: // MESMRTitlePaneObserver + void UpdateTitlePaneTextL( const TDesC& aText ); + + private: // From MMRScrollBarObserver + void ScrollBarPositionChanged( TInt aThumbPosition ); -public: // MESMRTitlePaneObserver - void UpdateTitlePaneTextL( const TDesC& aText ); - void UpdateTitlePanePriorityIconL( TUint aPriority ); + private: // From MEikScrollBarObserver + void HandleScrollEventL( CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ); + + private: // From MESMRToolbarVisibilityObserver + void MRToolbarVisibilityChanged( + TBool aVisible, + TRect aToolbarRect ); + -private: // implementation - void ConstructL( const TRect& aRect ); - CESMRView( MESMRFieldStorage* aStorage, MESMRCalEntry& aEntry ); - -private: - void LaunchHelpL( const TDesC& aContext ); + private: // From MCoeControlBackground + void Draw(CWindowGc& aGc, + const CCoeControl& aControl, + const TRect& aRect) const; + void GetTextDrawer( + CCoeTextDrawerBase*& aText, + const CCoeControl* aControl) const; -public: // From CCoeControl - void SetContainerWindowL(const CCoeControl& aContainer); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aInd ) const; - void SizeChanged(); - TSize MinimumSize(); - TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType); - void HandleResourceChange( TInt aType ); - TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + private: // From CCoeControl + void SetContainerWindowL(const CCoeControl& aContainer); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + TSize MinimumSize(); + void HandleResourceChange( TInt aType ); + TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); + void HandlePointerEventL( + const TPointerEvent &aPointerEvent ); - // - void FocusChanged(TDrawNow aDrawNow); - // - -private: // From CCoeControl - void Draw( const TRect& aRect ) const; - -protected: // FromMESMRFontSizeObserver - void FontSizeSettingsChanged(); + private: // From CCoeControl + void Draw( const TRect& aRect ) const; -public: // From MCoeControlBackground - void Draw(CWindowGc& aGc, - const CCoeControl& aControl, - const TRect& aRect) const; - void GetTextDrawer( - CCoeTextDrawerBase*& aText, - const CCoeControl* aControl) const; - -private: - /// Own: Priority icon - CESMRTitlePane* iTitle; - /// Own: Meeting Requst list component - CESMRListComponent* iList; - /// Ref: List item storage - MESMRFieldStorage* iStorage; - /// Ref: Current MR entry - MESMRCalEntry& iEntry; - /// Own: Pointer to layout manager - CESMRLayoutManager* iLayout; - /// Own: To enable skin as background for the iTitle - CAknsBasicBackgroundControlContext* iBgContext; + private: // implementation + void ConstructL( const TRect& aRect ); + CESMRView(MESMRFieldStorage* aStorage, + MESMRCalEntry& aEntry, + MMRFocusStrategy& aFocusStrategy, + MESMRNaviArrowEventObserver* aObserver, + CMRToolbar& aToolbar ); + void LaunchHelpL( const TDesC& aContext ); + void SetTitlePaneObserver(); + TRect CalculateAttachmentIndicatorLayout(); + + private: // data + + /** + * Defines the component is clicked + */ + enum TComponentPointed + { + // No component is clicked + EComponentNone, + // Scroll bar is clicked + EComponentScrollBar, + // List component is clicked + EComponentListPane + }; + + /// Own: UI list pane in event editor and viewer + CMRListPane* iListPane; + /// Ref: List item storage + MESMRFieldStorage* iStorage; + /// Own: scrollbar + CAknDoubleSpanScrollBar* iScrollBar; + /// Ref: scrollbar model + TAknDoubleSpanScrollBarModel iScrollBarModel; + /// Own: current scroll bar thumb position + TInt iScrollBarThumbPosition; + /// Ref: Current MR entry + MESMRCalEntry* iEntry; + /// Own: To enable skin as background for the iTitle + CAknsBasicBackgroundControlContext* iBgContext; + /// Own: This clears the navipane for us. + TNavipaneClearer iClearer; + /// Ref: Focus strategy reference + MMRFocusStrategy& iFocusStrategy; + /// Own: Left navigation arrow component control. + CMRNaviArrow* iNaviArrowLeft; + /// Own: Right navigation arrow component control. + CMRNaviArrow* iNaviArrowRight; + /// Ref: Navigation arrow event observer. + MESMRNaviArrowEventObserver* iObserver; + /// Own: judge which view mode is using + TESMRViewMode iViewMode; + /// Ref: Reference to viewer dialog owned mr toolbar + CMRToolbar& iToolbar; + /// Own: Record the rect of stripe. + TRect iStripeRect; + /// Own: Attachment download indicator + CMRAttachmentIndicator* iAttachmentIndicator; + /// Own: Control array + RArray iControls; }; #endif //CESMRVIEW_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrviewerdialog.h --- a/meetingrequest/mrgui/inc/cesmrviewerdialog.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrviewerdialog.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,15 +17,15 @@ #ifndef CESMRVIEWERDIALOG_H #define CESMRVIEWERDIALOG_H -#include +#include #include -#include -#include - +#include #include "mesmruibase.h" #include "mesmrresponseobserver.h" #include "resmrstatic.h" #include "mesmrfieldeventobserver.h" +#include "mesmrnaviarroweventobserver.h" +#include "cesmrfieldbuilderinterface.h" class MESMRFieldStorage; class MESMRCalEntry; @@ -33,14 +33,15 @@ class MAgnEntryUiCallback; class CESMRPolicy; class CESMRSendUI; -class CAiwServiceHandler; class CCEUIPolicyResolver; class CESMRPolicyManager; class CESMRLocationPluginHandler; class CESMRFeatureSettings; -class CAknNavigationDecorator; -class MESMRMeetingRequestEntry; -class TFSMailMsgId; +class CMRToolbar; +class TDataType; +class MMRInfoProvider; +class MMRFocusStrategy; +class CESMRTitlePaneHandler; /** * CESMRViewerDialog implements the viewer dialog for meeting requests. @@ -54,23 +55,20 @@ public MESMRResponseObserver, public MESMRFieldEventObserver, public MAknToolbarObserver, - public MAknNaviDecoratorObserver, - public MMsvSessionObserver + public MESMRNaviArrowEventObserver { public: /** * Two-phased constructor. * - * @param aStorage Field storage contains all the fields for list component. - * @param aEntry ESMR calendar entry (wraps the CCalEntry object) + * @param aInfoProvider Reference to MR / entry info provider. * @param aCallback Callback interface for AgnEntryUI * @return Pointer to created and initialized esmr editor dialog. */ IMPORT_C static CESMRViewerDialog* NewL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, - MAgnEntryUiCallback& aCallback ); + MMRInfoProvider& aInfoProvider, + MAgnEntryUiCallback& aCallback ); /* * Destructor. */ @@ -86,7 +84,7 @@ CEikMenuPane* aMenuPane ); void ActivateL(); void PreLayoutDynInitL(); - + public: // From MESUIBase TInt ExecuteViewLD(); @@ -96,48 +94,26 @@ void ChangeReadyResponseL(); public: // From MAknToolbarObserver - virtual void OfferToolbarEventL( TInt aCommand ); - -public: // from MAknNaviDecoratorObserver - void HandleNaviDecoratorEventL( TInt aEventID ); + void DynInitToolbarL ( TInt aResourceId, CAknToolbar* aToolbar ); + void OfferToolbarEventL ( TInt aCommand ); -public: // from MMsvSessionObserver - void HandleSessionEventL( - TMsvSessionEvent aEvent, TAny* aArg1, - TAny* aArg2, TAny* aArg3 ); - -public: - /** - * Static method that is given as callback to CIdle object - * handling the navigation decorator right arrow event. - * - * @param aObjPtr TAny-casted pointer to an instance of this class. - * @return Always KErrNone. - */ - static TInt RunCmdMailNextMessageIdle( TAny* aObjPtr ); - - /** - * Static method that is given as callback to CIdle object - * handling the navigation decorator left arrow event. - * - * @param aObjPtr TAny-casted pointer to an instance of this class. - * @return Always KErrNone. - */ - static TInt RunCmdMailPreviousMessageIdle( TAny* aObjPtr ); - protected: // MESMRFieldEventObserver void HandleFieldEventL( const MESMRFieldEvent& aEvent ); + +public: // From MESMRNaviArrowEventObserver + void HandleNaviArrowEventL( const TInt aCommand ); private: // Implementation void DoProcessCommandL( TInt aCommand ); - CESMRViewerDialog( MESMRCalEntry& aEntry, MAgnEntryUiCallback& aCallback ); - void ConstructL( CESMRPolicy* aPolicy ); + CESMRViewerDialog( + MMRInfoProvider& aInfoProvider, + MAgnEntryUiCallback& aCallback ); + void ConstructL(); void OpenInDayModeL(); void CommandTailL(HBufC16*& aTailBuffer); - TBool HandleCommandForRecurrentEventL( TInt aCommand ); + TBool HandleCommandForEventL( TInt aCommand ); void SendCalendarEntryL(TInt aCommandId); void TryInsertSendMenuL(CEikMenuPane* aMenuPane); - void HandlePrintCommandL(TInt aCommand); void HandleEmailSubmenuL( TInt aResourceId, CEikMenuPane* aMenuPane ); @@ -147,54 +123,51 @@ void HandleDynamicMenuItemsL( TInt aResourceId, CEikMenuPane* aMenuPane ); - TBool SupportsAttendeeStatusL(); + TBool SupportsMailBoxCapabilityL( + MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa ); TBool HandleMRExitL( TInt aCommand ); - TBool SupportsForwardingAsMeetingL( - MESMRMeetingRequestEntry* aEntry, - TBool aForceResetDefaultMRMailbox ); + void HandleForwardMenuL( + TInt aResourceId, + CEikMenuPane* aMenuPane ); CESMRLocationPluginHandler& LocationPluginHandlerL(); void SetDefaultMiddleSoftKeyL(); - TPtrC DigMailboxAndRemovePrefixL(); - void MakeMrGuiToolbarButtonsL(); - void ClearToolbarL(); - TInt AccountIdL( const TFSMailMsgId& aMailboxId ); + TInt TryToSaveAttachmentL(); + void SetContextMenu(); + void ShowContextMenuL(); + TBool UserWantToHandleAttachmentsL(); + void InitLocationMenuL( + CEikMenuPane* aMenuPane ); + void ConstructToolbarL(); + void ProcessCommandEventL( const MESMRFieldEvent& aEvent ); + void ProcessFieldEventL( const MESMRFieldEvent& aEvent ); private: // Data - /// Own: Feature manager initialization flag - TBool iFeatureManagerInitialized; - /// Ref: The only control in this dialog. Fwk deletes. + /// Ref: The only control in this dialog. Fwk deletes. CESMRView* iView; - /// Ref: Reference to MESRCalEntry (CCalEntry wrapper) - MESMRCalEntry& iEntry; /// Ref: Agn Entry UI callback interface MAgnEntryUiCallback& iCallback; - /// Ref: Pointer to policy - CESMRPolicy* iPolicy; /// Own: Calendar Global data CESMRSendUI* iESMRSendUI; - /// Own: AIW Service handler - CAiwServiceHandler* iServiceHandler; /// Own: Flag for marking exit TBool iExitTriggered; /// Own: Static TLS data handler RESMRStatic iESMRStatic; - // Own: Location plugin handler. + // Own: Location plugin handler. CESMRLocationPluginHandler* iLocationPluginHandler; // Own: Feature settings. CESMRFeatureSettings* iFeatures; - // Not own: Pointer to previous toolbar observer. - MAknToolbarObserver* iOldObserver; - // flag to indicate toolbar can be cleared - TBool iClearToolbar; - // Own: CIdle object through which navi button events are handled. - // CIdle with callback is used because the navi buttons events - // cause deletion of this dialog, but the actual button event - // handling needs to be completed before closing the dialog. - CIdle* iIdleNaviEventRunner; - // Not own: Pointer to navigation decorator - CAknNavigationDecorator* iESMRNaviDecorator; + /// Own: Toolbar + CMRToolbar* iToolbar; + /// Ref: Reference to mrinfo provider + MMRInfoProvider& iInfoProvider; + /// Own: Context menu resource ID. + TInt iContextMenuResourceId; + /// Own: Focus strategy of the viewer + MMRFocusStrategy* iFocusStrategy; + /// Own: Titlepane handler + CESMRTitlePaneHandler* iTitlePane; }; #endif // CESMRVIEWERDIALOG_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cesmrviewerfieldstorage.h --- a/meetingrequest/mrgui/inc/cesmrviewerfieldstorage.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmrviewerfieldstorage.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR field storage for viewer fields in CESMRListComponent +* Description: ESMR field storage for viewer fields owned by fieldcontainer * */ @@ -43,7 +43,7 @@ * @return New viewer field storage object */ static CESMRViewerFieldStorage* NewL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady, MESMRFieldEventObserver& aEventObserver, @@ -62,17 +62,17 @@ CESMRViewerFieldStorage( MESMRFieldEventObserver& aEventObserver ); - void ConstructL( CESMRPolicy* aPolicy, + void ConstructL( const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady, const TInt &aReqAttendee , const TInt &aOptAttendee ); - void CreatePolicyFieldsL(CESMRPolicy* aPolicy, + void CreatePolicyFieldsL( const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady); - void CreateTrackingFieldsL(CESMRPolicy* aPolicy, + void CreateTrackingFieldsL( const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady, const TInt &aReqAttendeee, const TInt &aOptAttendee); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrasynchcmd.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrasynchcmd.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Async command handler +* +*/ +#ifndef CMRASYNCHCMD_H +#define CMRASYNCHCMD_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MAknToolbarObserver; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRAsynchCmd ) + : public CAsyncOneShot + { + public: + static CMRAsynchCmd* NewL(); + ~CMRAsynchCmd(); + + public: // Interface + /** + * Asynchronously calls the aObserver with aCmd as a parameter + * @param aCmd Command the will be sent as param to aObserver + * @param aObserver Pointer to observer that will be notified + */ + void NotifyObserver( TInt aCmd, MAknToolbarObserver* aObserver ); + + protected: // From base classes + void RunL(); + + private: // Implementation + CMRAsynchCmd(); + + private: // Data + /// Own: command that is sent as param to observer + TInt iCommand; + /// Ref: Observer that will be notified + MAknToolbarObserver* iObserver; + }; + +#endif // CMRASYNCHCMD_H + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrattachmentindicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrattachmentindicator.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment indicator class definition +* +*/ + +#ifndef CMRATTACHMENTINDICATOR_H +#define CMRATTACHMENTINDICATOR_H + +#include + +/** + * Attachment indicator + */ +NONSHARABLE_CLASS( CMRAttachmentIndicator ) : + public CCoeControl + { +public: // Construction and destruction + + /** + * Two-phased constructor. + * Creates a new instance of class + * + * @param aRect rect for this control + * @param aParent parent control + * + * @return CMRAttachmentIndicator instance + */ + static CMRAttachmentIndicator* NewL( + const TRect& aRect, + const CCoeControl* aParent ); + + /** + * C++ Destructor. + */ + ~CMRAttachmentIndicator(); + +public: // new methods + + /** + * Shows the indicator in UI. The ownships of aBitmap, aMaskBitmap and aText + * are transferred in. The status indicator is displayed for aDuration + * millisecond if aDuration is not negative; otherwise, it is diplayed forever + * until it is manually hidden. + * + * @param aBitmap Indicator image bitmap + * @param aMaskBitmap Indicator image bitmap mask + * @param aText Indicator text + * @param aDuration Duration for the indicator to be shown + */ + void ShowIndicatorL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMaskBitmap, + const TDesC& aText, + TInt aDuration ); + + /** + * Hides the indicator from UI + * + * @param aDelayBeforeHidingInMs Delay before the indicator is hidden + * in milliseconds + */ + void HideIndicator( + TInt aDelayBeforeHidingInMs ); + + /** + * Setter for indicator text. The ownship of aText is transferred in. + * + * @param aText text for indicator + */ + void SetTextL( + const TDesC& aText ); + + /** + * Setter for indicator image. + * + * @param aBitmap image bitmap for indicator + * @param aMaskBitmap image bitmap mask for indicator + */ + void SetImage( + CFbsBitmap* aBitmap, + CFbsBitmap* aMaskBitmap ); + + /** + * Getter for indicator image bitmap + * + * @return the indicator image bitmap + */ + const CFbsBitmap* Image() const; + + /** + * Getter for indicator image bitmap mask + * + * @return the indicator image bitmap mask + */ + const CFbsBitmap* ImageMask() const; + + /** + * Getter for indicator text + * + * @return the indicator text + */ + const TDesC& Text() const; + +public: // From CCoeControl + CCoeControl* ComponentControl( + TInt aIndex ) const; + TInt CountComponentControls() const; + void Draw( + const TRect& aRect ) const; + void SizeChanged(); + +private: + + CMRAttachmentIndicator(); + void ConstructL( + const TRect& aRect, + const CCoeControl* aParent ); + void CalculateLayout( + const TRect& aRect ) const; + + void SetTextFont() const; + void CalculateVisualText() const; + + void DrawBoundary( const TRect& aRect ) const; + void DrawImage( const TRect& aRect ) const; + void DrawText( const TRect& aRect ) const; + void ScaleImage() const; + + void ClearImage(); + void ClearText(); + +private: + /// own: Indicator image bitmap + CFbsBitmap* iBitmap; + /// own: Indicator image bitmap mask + CFbsBitmap* iMaskBitmap; + /// own: Indicator text + HBufC* iText; + // Rect for indicator image + mutable TRect iImageRect; + // Rect for indicator text + mutable TRect iTextRect; + /// own: Indicator visual text (final text shown in UI) + mutable HBufC* iVisualText; + /// not owned: Indicator text font + mutable CFont* iTextFont; + }; + +#endif // CMRATTACHMENTINDICATOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrfieldcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrfieldcontainer.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface for field container +* +*/ + +#ifndef CMRFIELDCONTAINER_H +#define CMRFIELDCONTAINER_H + +// INCLUDES +#include +#include "mesmrlistobserver.h" + +// FORWARD DECLARATIONS +class MESMRFieldStorage; +class MMRFieldContainerObserver; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRFieldContainer ) : + public CCoeControl, + public MESMRListObserver + { + public: // Creation and destruction + /** + * Static constructor. + * + * @return New instance of this class + */ + static CMRFieldContainer* NewL( + MESMRFieldStorage& aFactory, + const CCoeControl& aParent ); + /** + * Destructor + */ + ~CMRFieldContainer(); + + public: // Interface + + /** + * Return focused field. + * @return Focused list item or NULL if no focused item + */ + CESMRField* FocusedField() const; + + /** + * Moves focus up one step. + * + * @param aHiddenFocus, in case of hidden focus use case, ETrue. + * @return TKeyResponse, if key response was used or not + */ + TKeyResponse MoveFocusUpL( TBool aHiddenFocus ); + + /** + * Moves focus down one step. + * + * @param aHiddenFocus, in case of hidden focus use case, ETrue. + * @return TKeyResponse, if key response was used or not + */ + TKeyResponse MoveFocusDownL( TBool aHiddenFocus ); + + /** + * Moves focus visible if it is partly or completely out of + * viewable area. + */ + void SetFieldContainerObserver( MMRFieldContainerObserver* aObserver ); + + public: // From MESMRListObserver + void ControlSizeChanged( CESMRField* aField ); + void ShowControl( TESMREntryFieldId aFieldId ); + void HideControl( TESMREntryFieldId aFieldId ); + TBool IsControlVisible( TESMREntryFieldId aFieldId ); + void SetControlFocusedL( TESMREntryFieldId aFieldId ); + TInt ListHeight(); + TBool IsFocusedControlsBottomVisible(); + void ScrollControlVisible( TInt aInd ); + void RePositionFields( TInt aAmount ); + TRect ViewableAreaRect(); + + public: // From CCoeControl + TSize MinimumSize(); + + private: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SizeChanged(); + + private: // Implementation + CMRFieldContainer( MESMRFieldStorage& aFactory ); + void ConstructL( const CCoeControl& aParent ); + void MoveFields( TInt aIndex, TPoint& aTl ); + void LayoutField( CESMRField& aField, const TPoint& aTl ); + TInt LastVisibleField( TESMREntryFieldId aFieldId ); + void DoSetFocusL( TInt aNewFocusIndex ); + TKeyResponse MoveFocusVisibleL(); + + private: // Data + // Own: Informs listapane about needed position changes + MMRFieldContainerObserver* iObserver; + /// Ref: Storage for list items. + MESMRFieldStorage& iFactory; + /// Own: Current focus index + TInt iFocusedFieldIndex; + + }; + +#endif // CMRFIELDCONTAINER_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrfocusstrategybase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrfocusstrategybase.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for the focus strategies +* +*/ + +#ifndef CMRFOCUSSTRATEGYBASE_H +#define CMRFOCUSSTRATEGYBASE_H + +// INCLUDES +#include +#include "mmrfocusstrategy.h" + +// FORWARD DECLARATIONS +class CESMRField; +class MESMRFieldStorage; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRFocusStrategyBase ): public CBase, public MMRFocusStrategy + { + protected: + void InitializeFocus(); + void EventOccured( TFocusEventType aEventType ); + TBool IsFocusVisible() const { return iVisibleFocusOn; } + + protected: // Implementation + CMRFocusStrategyBase( MESMRFieldStorage& aFactory ); + ~CMRFocusStrategyBase(); + + void HideFocus(); + void ShowFocus(); + + protected: // Data + /// Flag indicating the focus state + TBool iVisibleFocusOn; + /// Field storage reference + MESMRFieldStorage& iFactory; + }; +#endif // CMRFOCUSSTRATEGYBASE_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrfocusstrategyeditor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrfocusstrategyeditor.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for the editora focus strategy +* +*/ + +#ifndef CMRFOCUSSTRATEGYEDITOR_H +#define CMRFOCUSSTRATEGYEDITOR_H + +// INCLUDES +#include +#include "cmrfocusstrategybase.h" + +// FORWARD DECLARATIONS + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRFocusStrategyEditor ): public CMRFocusStrategyBase + { + public: // C'tor & d'tor + /** + * Static constructor + * @param aFactory Field storage factory + */ + static CMRFocusStrategyEditor* NewL( MESMRFieldStorage& aFactory ); + + /** + * Destructor + */ + ~CMRFocusStrategyEditor(); + + protected: // From CMRFocusStrategyBase + void EventOccured( TFocusEventType aEventType ); + void InitializeFocus(); + + private: // Implementation + CMRFocusStrategyEditor( MESMRFieldStorage& aFactory ); + }; +#endif // CMRFOCUSSTRATEGYEDITOR_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrfocusstrategyviewer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrfocusstrategyviewer.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for the editora focus strategy +* +*/ + +#ifndef CMRFOCUSSTRATEGYVIEWER_H +#define CMRFOCUSSTRATEGYVIEWER_H + +// INCLUDES +#include +#include "cmrfocusstrategybase.h" // CMRFocusStrategyBase + +// FORWARD DECLARATIONS + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRFocusStrategyViewer ): + public CMRFocusStrategyBase + { + public: // C'tor & d'tor + /** + * Static constructor + * @param aFactory Field storage factory + */ + static CMRFocusStrategyViewer* NewL( MESMRFieldStorage& aFactory ); + + /** + * Destructor + */ + ~CMRFocusStrategyViewer(); + + protected: // From CMRFocusStrategyBase + void EventOccured( TFocusEventType aEventType ); + void InitializeFocus(); + + private: // Implementation + CMRFocusStrategyViewer( MESMRFieldStorage& aFactory ); + void ConstructL(); + void DoHideFocus(); + }; +#endif // CMRFOCUSSTRATEGYVIEWER_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrimage.h --- a/meetingrequest/mrgui/inc/cmrimage.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Declaration of CMRImage class. -* -*/ - -#ifndef CMRIMAGE_H -#define CMRIMAGE_H - -#include -#include -#include - -#include "esmrfieldbuilderdef.h" -#include "nmrbitmapmanager.h" - -/** - * CMRImage is icon component for fields - */ -NONSHARABLE_CLASS( CMRImage ) : public CEikImage - { -public: - /** - * Two-phased constructor. - * - * @param - * @return Pointer to created and initialized mr image object. - */ - IMPORT_C static CMRImage* NewL( - const TAknsItemID& aIconId, - TScaleMode aScaleMode = EAspectRatioPreserved ); - IMPORT_C static CMRImage* NewL( - NMRBitmapManager::TMRBitmapId aBitmapId, - TScaleMode aScaleMode = EAspectRatioPreserved ); - - /** - * C++ Destructor - */ - IMPORT_C virtual ~CMRImage(); - - void SizeChanged(); - -private: - /** - * C++ default constructor - */ - CMRImage( TScaleMode aScaleMode ); - void ConstructL( const TAknsItemID& aIconId ); - void ConstructL( NMRBitmapManager::TMRBitmapId aBitmapId ); - void SetBitmapFallback( - const TAknsItemID& aIconId, - TInt& aFileIndex, - TInt& aFileMaskIndex ); - void CreateIconL( const TAknsItemID& aIconId); - void CreateIconL( NMRBitmapManager::TMRBitmapId aBitmapId ); - -private: - TScaleMode iScaleMode; - }; - -#endif //CMRIMAGE_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrlabel.h --- a/meetingrequest/mrgui/inc/cmrlabel.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface definition for Location URL Parser plug-in -* -*/ - -#ifndef CMRLABEL_H -#define CMRLABEL_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATIONS - -class CMRLabel : public CEikLabel - { - public: - /** - * Static construtor - * @return New instance of this class - */ - IMPORT_C static CMRLabel* NewL(); - /** - * Destructor - */ - IMPORT_C ~CMRLabel(); - - public: // From base class - void FocusChanged(TDrawNow aDrawNow); - - private: // Implementation - CMRLabel(); - void ConstructL(); - - private: // Data - }; - -#endif // CMRLABEL_H - -// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrlistpane.h --- a/meetingrequest/mrgui/inc/cmrlistpane.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cmrlistpane.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,115 +20,190 @@ // INCLUDES #include -#include "mesmrlistobserver.h" +#include +#include "mmrphysicsobserver.h" +#include "mmrfieldcontainerobserver.h" // FORWARD DECLARATIONS class MESMRFieldStorage; class TAknDoubleSpanScrollBarModel; -class MFsTextViewerObserver; +class CMRFieldContainer; +class CMRListPanePhysics; +class CAknDoubleSpanScrollBar; +class MMRScrollBarObserver; +class CESMRField; +class MESMRCalEntry; // CLASS DECLARATIONS -NONSHARABLE_CLASS( CMRListPane ) : public CCoeControl, - public MESMRListObserver +NONSHARABLE_CLASS( CMRListPane ) : + public CCoeControl, + public MAknLongTapDetectorCallBack, + public MMRPhysicsObserver, + public MMRFieldContainerObserver { -public: - /** - * Static constructor. - * - * @return New instance of this class - */ - static CMRListPane* NewL( const CCoeControl& aParent, - MESMRFieldStorage& aFactory, - TAknDoubleSpanScrollBarModel& aScrollModel ); - /** - * Destructor - */ - ~CMRListPane(); - -public: // Interface - - /** - * Return focused list item. - * @return Focused list item or NULL if no focused item - */ - CESMRField* FocusedItem() const; - - /** - * Scrolls the specific field to be fully visible - * - * @param aInd Index of the field that needs to be fully visible - */ - void ScrollItemVisible( TInt aInd ); - - /** - * Scrolls the view specified amount of pixels - * - * @param aAmount Amount of pixels to move the view - */ - void ScrollView( TInt aAmount ); + public: // Creation and destruction + /** + * Static constructor. + * + * @return New instance of this class + */ + static CMRListPane* NewL( const CCoeControl& aParent, + MESMRFieldStorage& aFactory, + TAknDoubleSpanScrollBarModel& aScrollModel, + CAknDoubleSpanScrollBar& aScroll, + MMRScrollBarObserver& aScrollBarObserver ); + /** + * Destructor + */ + ~CMRListPane(); + + public: // Interface + + /** + * Initializes all fields. Needed when theme changes + */ + void InitializeL(); + + /** + * InternalizeL is used to obtain the data from current CCalEntry. + * CCalEntry is wrapped inside MESMRCalEntry object. This call is + * propagated to all list items in the list. + * + * @param aEntry Current entry + * @see MESMRCalEntry + */ + void InternalizeL( MESMRCalEntry& aEntry ); + + /** + * ExternalizeL is used to store the list item data into current + * CCalEntry. CCalEntry is wrapped inside the MESMRCalEntry object. + * + * @param aEntry Current entry. + * @param aForceValidation ETrue if force validation should be used + * @see MESMRCalEntry + */ + void ExternalizeL( MESMRCalEntry& aEntry, TBool aForceValidation = EFalse ); + + /** + * Disables or enables relayouting. + * + * @param aDisable. If ETrue, disables relayouting. + */ + void DisableSizeChange(TBool aDisable ); - /** - * Updates focus position. - */ - void UpdateFocusPosition(); - - /** - * @return center point of the visible part of the pane - */ - TPoint GetViewCenterPosition() const; - -public: // From CCoeControl - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aIndex) const; - void SizeChanged(); - TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, - TEventCode aType ); - virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); - -public: // From MESMRListObserver - void ControlSizeChanged( CESMRField* aCtrl ); - void InsertControl( TESMREntryFieldId aField ); - void RemoveControl( TESMREntryFieldId aField ); - TBool IsControlVisible( TESMREntryFieldId aField ); - void SetControlFocusedL( TESMREntryFieldId aField ); - // SCROLLING_MOD: These two methods are for CESMRRichTextViewer to - //be able to control view area - void MoveListAreaDownL( TInt aAmount ); - void MoveListAreaUpL( TInt aAmount ); - TInt ListHeight(); - TBool IsFieldBottomVisible(); + /** + * Scroll the list to put the responeArea at the top and + * set the focus on it + */ + void InitialScrollL(); // TODO: Fix me. + + /** + * Return focused field. + * @return Focused list item or NULL if no focused item + */ + CESMRField* FocusedField() const; + + /** + * Sets the field focused based on the given field id. + * @param aFieldId Id of the field to be focused + */ + void SetControlFocusedL( TESMREntryFieldId aFieldId ); + + /** + * Return clicked list item. + * @return Clicked list item or NULL if no valid clicked item + */ + CESMRField* ClickedField() const; + + /** + * Sets field to be visible in the list. + * + * @param aField - id of the field. + */ + void ShowControl( TESMREntryFieldId aFieldId ); + + /** + * Is field visible or not. + * + * @return Boolean ETrue/EFalse + */ + TBool IsControlVisible( TESMREntryFieldId aFieldId ); + + /** + * Get response field type of current event. + * @Return TESMREntryFieldId + */ + TESMREntryFieldId GetResponseFieldsFieldId(); + + /** + * Activates new fields which has been added into the storage + * after list pane construction. + */ + void ReActivateL(); + + public: // MMRFieldContainerObserver + void ScrollFieldsUp( TInt aPx ); + void ScrollFieldsDown( TInt aPx ); + void UpdateScrollBarAndPhysics(); + + public: // From CCoeControl + TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, + TEventCode aType ); + void SizeChanged(); + + private: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex) const; + void HandlePointerEventL( const TPointerEvent &aPointerEvent ); + void ActivateL(); + + private: // From MMRPhysicsObserver + void PhysicsEmulationEnded(); + + private: // From MAknLongTapDetectorCallBack + void HandleLongTapEventL( + const TPoint& aPenEventLocation, + const TPoint& aPenEventScreenLocation ); -private: // Implementation - CMRListPane( MESMRFieldStorage& aFactory, - TAknDoubleSpanScrollBarModel& aScrollModel ); - void ConstructL( const CCoeControl& aParent ); - TKeyResponse MoveFocusUpL(); - TKeyResponse MoveFocusDownL(); - void LayoutField( CESMRField& aField, - const TPoint& aTl ); - void MoveFields( TInt aIndex, - TPoint& aTl ); - void DoSetFocusL( TInt aFocus ); - void ScrollItemsUp( TInt aPx ); - void ScrollItemsDown( TInt aPx ); - void UpdateScrollBar(); - /** - * Moves focus to pointed field - * @param aNextFieldIndex a new index - * @return ETrue if move succeeded - */ - TBool MoveFocusL( TInt aNextFieldIndex ); - - -private: // Data - /// Ref: Storage for list items. - MESMRFieldStorage& iFactory; - /// Ref: scrollbar model - TAknDoubleSpanScrollBarModel& iScrollModel; - /// Own: Current focus index - TInt iFocus; - /// Own: List top visible field index - TInt iTopVisibleIndex; + private: // Implementation + CMRListPane( MESMRFieldStorage& aFactory, + TAknDoubleSpanScrollBarModel& aScrollModel, + CAknDoubleSpanScrollBar& aScroll, + MMRScrollBarObserver& aScrollBarObserver ); + void ConstructL( const CCoeControl& aParent ); + void DoUpdateScrollBar( TInt aFocusPosition = KErrNotFound ); + TInt UpdatedFocusPosition(); + void SetFocusAfterPointerEventL( + const TPointerEvent &aPointerEvent ); + void UpdateClickedField( const TPointerEvent &aPointerEvent ); + TBool HiddenFocus(); + void ForwardReceivedPointerEventsToChildrenL(); + + private: // Data + /// Ref: Storage for list items. + MESMRFieldStorage& iFactory; + /// Ref: scrollbar model + TAknDoubleSpanScrollBarModel& iScrollModel; + /// Ref: List components scroll bar + CAknDoubleSpanScrollBar& iScroll; + /// Own: Long tap detector + CAknLongTapDetector* iLongtapDetector; + /// Own: Field container + CMRFieldContainer* iFieldContainer; + /// Own: Physics for kinetic scrolling + CMRListPanePhysics* iPhysics; + /// Ref: Observer for updating scroll bar revents + MMRScrollBarObserver& iScrollBarObserver; + /// Not owned: A field which got a pointer down event, + /// nulled when focus is changed via keyboard + CESMRField* iClickedField; + /// Own: Boolean for disabling SizeChanged handling + TBool iDisableSizeChanged; + /// Own: Boolean to check, if physics action is ongoing or not + TBool iPhysicsActionOngoing; + /// Own: Record if the long tapping event have been comsumed, if yes, + /// then do not handle signal pointer event anymore. + TBool iLongTapEventConsumed; }; #endif // CMRLISTPANE_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrlistpanephysics.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrlistpanephysics.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR Custom list component physics impl +* +*/ + +#ifndef CMRLISTPANEPHYSICS_H +#define CMRLISTPANEPHYSICS_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CAknPhysics; +class CMRFieldContainer; +class CCoeControl; +class MMRPhysicsObserver; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRListPanePhysics ): + public CBase, + public MAknPhysicsObserver + { + public: // C'tor and d'tor + static CMRListPanePhysics* NewL( + CCoeControl& aParent, + CMRFieldContainer& aViewControl, + MMRPhysicsObserver& aPhysicsObserver ); + + ~CMRListPanePhysics(); + + public: // Interface + /** + * Handles the pointer event + * + * @param aPointerEvent Pointer event to handle. + * @param aEventsBlocked ETrue if events are blocked. + * Set by this function. + * @return ETrue if the physics has been started, EFalse otherwise. + */ + TBool HandlePointerEventL( + const TPointerEvent& aPointerEvent, TBool& aEventsBlocked ); + + /** + * Initializes physics. + */ + void InitPhysics(); + + /** + * Sets world height. + * + * @param aWorldHeight New world height. + */ + void SetWorldHeight( TInt aWorldHeight ); + + /** + * Sets the vertical scroll index, which is directly the position + * of the list pane on the Y-axis + * + * @param aVerScrollIndex New vertical scroll index. + */ + void UpdateVerticalScrollIndex( TInt aVerScrollIndex ); + + /** + * Returns the current vertical scroll index. + * + * @return Current vertical scroll index + */ + TInt VerticalScrollIndex(); + + + public: // from base class MAknPhysicsObserver + void ViewPositionChanged( const TPoint& aNewPosition, + TBool aDrawNow, + TUint aFlags ); + void PhysicEmulationEnded(); + TPoint ViewPosition() const; + + private: // Implementation + CMRListPanePhysics( CCoeControl& aParent, + CMRFieldContainer& aViewControl, + MMRPhysicsObserver& aPhysicsObserver ); + void ConstructL(); + + private: + /// Own: Physics engine handle + CAknPhysics* iPhysics; + /// Ref: Parent control + CCoeControl& iParent; + /// Ref: Reference to field container that should be kinetic + CMRFieldContainer& iViewControl; + /// Feature enabled + TBool iFeatureEnabled; + /// Ref: Physics observer + MMRPhysicsObserver& iPhysicsObserver; + /// Own: Records previous pointer event + TPointerEvent iPreviousPointerEvent; + + /** + * Physics world size. + */ + TSize iWorldSize; + + /** + * Physics view size. + */ + TSize iViewSize; + + /** + * Vertical scroll index. + */ + TInt iVerScrollIndex; + + /** + * Pointer event start time. + */ + TTime iStartTime; + + /** + * Pointer event start position. + */ + TPoint iStartPoint; + + /** + * Pointer event drag position. + */ + TPoint iDragPoint; + }; + +#endif // CMRLISTPANEPHYSICS_H +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrnaviarrow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrnaviarrow.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Navigation arrows used to replace the navipane. +* +*/ + +#ifndef CMRNAVIARROW_H_ +#define CMRNAVIARROW_H_ + +#include + +class CGulIcon; +class CAknButton; +class MESMRNaviArrowEventObserver; + + +NONSHARABLE_CLASS( CMRNaviArrow ) : + public CCoeControl + { +public: + enum TArrowType { + EMRArrowLeft, + EMRArrowRight + }; +public: + /** + * Two-phased constructor. + */ + static CMRNaviArrow* NewL( const CCoeControl* aParent, TArrowType aType, + MESMRNaviArrowEventObserver* aObserver, + TSize aIconSize ); + + /** + * Destructor. + */ + virtual ~CMRNaviArrow(); + +private: + /** + * Default c++ constuctor + */ + CMRNaviArrow( MESMRNaviArrowEventObserver* aObserver, TArrowType aType, TSize aIconSize ); + /** + * Second phase constructor + */ + void ConstructL( const CCoeControl* aParent ); + +public: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + void HandlePointerEventL( + const TPointerEvent &aPointerEvent ); + void Draw(const TRect& aRect) const; + +public: + /** + * Set the navi arrow's visibility. + * @param aVisible Indicate if the arrow visible + */ + void SetNaviArrowStatus( TBool aVisible ); + +private: + /** + * Init the navi arrow buttons. + */ + void InitNaviArrowsL(); + /** + * Create a semi-transparent Icon. + * @param aBitMap The bitmap source + * @param aBitMapMask The bitmap mask source + */ + CGulIcon* CreateSemiTransparentIconL( CFbsBitmap* aBitMap, + CFbsBitmap* aBitMapMask); + +private: + /// Own: Left arrow button + CAknButton* iArrow; + /// Ref: Navi arrow event observer + MESMRNaviArrowEventObserver* iObserver; + /// Own: Left arrow visibility status + TBool iArrowVisibility; + /// Own: Store the type of such arrow + TArrowType iArrowType; + /// Own: Store the size of such arrow + TSize iIconSize; + }; + +#endif /* CMRNAVIARROW_H_ */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrresponsedialogview.h --- a/meetingrequest/mrgui/inc/cmrresponsedialogview.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/cmrresponsedialogview.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,7 +21,6 @@ // INCLUDES #include -#include // FORWARD DECLARATIONS class CAknsBasicBackgroundControlContext; @@ -61,8 +60,6 @@ void HandleResourceChange( TInt aType ); TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); void SizeChanged(); - TSize MinimumSize(); - void SetFontColorL(); private: @@ -73,8 +70,6 @@ CEikRichTextEditor* iEditor; /// Own: bg context CAknsBasicBackgroundControlContext* iBgContext; - - CEikScrollBarFrame* iScrollBarFrame; }; #endif // CESMRRESPONSEDIALOGVIEW_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrsystemnotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrsystemnotifier.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Response dialog's custom control implementation +* +*/ + + +#ifndef CMRSYSTEMNOTIFIER_H +#define CMRSYSTEMNOTIFIER_H + +#include + +class CEnvironmentChangeNotifier; +class CESMRFieldEventQueue; + +/** + * CMRSystemNotifier listen system events and sends MRUI events. + */ +NONSHARABLE_CLASS( CMRSystemNotifier ) : public CBase + { +public: // Contstruction and destruction + /** + * Creates and initialzes new CMRSystemNotifier object. + * Ownership is transferred to caller. + * @param aEventQueue Reference to event queue + */ + static CMRSystemNotifier* NewL( + CESMRFieldEventQueue& aEventQueue ); + + /** + * C++ destructor + */ + ~CMRSystemNotifier(); + + /** + * Starts system notifier + */ + void StartL(); + + /** + * Stops system notifier + */ + void Stop(); + +private: // Implementation + CMRSystemNotifier( CESMRFieldEventQueue& aEventQueue ); + void ConstructL(); + static TInt EnvChangeCallbackL( TAny* aThisPtr ); + void DoEnvChangeL(); + +private: // Data + /// Own: System notifier + CEnvironmentChangeNotifier* iSystemNotifier; + /// Ref: Reference to event queue + CESMRFieldEventQueue& iEventQueue; + }; + +#endif // CMRSYSTEMNOTIFIER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/cmrtoolbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/cmrtoolbar.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Toolbar +* +*/ +#ifndef CMRTOOLBAR_H +#define CMRTOOLBAR_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CMRAsynchCmd; + +// CLASS DECLARATIONS + +NONSHARABLE_CLASS( CMRToolbar ) : public CBase, public MAknToolbarObserver + { + public: + /// Context of the toolbar + enum TToolbarContext + { + EMRViewerOrganizer = 1, + EMRViewerAttendee, + EMRViewerFromMailApp, + ECustom = 100 // User has customized the toolbar with own buttons + }; + + public: + /** + * C'tor + */ + static CMRToolbar* NewL(); + /** + * D'tor + */ + ~CMRToolbar(); + + public: // Interface + /** + * Initialize toolbar with native toolbar and the context + * @param aContext Toolbar's context, defined the button set + * @param aNativeToolbar Avkon toolbar, if NULL the + * Appui::CurrentFixedToolbar() is used to get the toolbar + */ + void InitializeToolbarL( + TToolbarContext aCntx, + CAknToolbar* aNativeToolbar = NULL ); + /** + * Sets the toolbar's, aNativeToolbar or CurrentFixedToolbar, + * visiblity as aShowToolbar. Toolbar's visibility is restored in + * class' d'tor + * @param aShowToolbar If ETrue sets toolbar visible, + * otherwise hides toolbar + */ + void ShowToolbar( TBool aShowToolbar ); + /** + * Set on toolbar event observer + * @param aObserver Pointer to observer, ownership is not transferred + */ + void SetObserver( MAknToolbarObserver* aObserver ); + + /* + * Returns the rect of the current toolbar. If not in use, returns + * zero rect. + * @return Rect of the toolbar in use. + */ + TRect Rect(); + + private: // From MAknToolbarObserver + void DynInitToolbarL ( TInt aResourceId, CAknToolbar *aToolbar ); + void OfferToolbarEventL ( TInt aCommand ); + + private: // Implementation + CMRToolbar(); + void ConstructL(); + void ConstructToolbarL( TToolbarContext aCntx ); + void ConstructButtonL( TInt aResId, TInt aIndex ); + void RemovePreviousItems(); + + private: // Data + /// Ref: Current application toolbar + CAknToolbar* iToolbar; + /// Ref: Observer for toolbar events + MAknToolbarObserver* iObserver; + /// Own: Context of the toolbar + TToolbarContext iCntx; + /// Own: Item id array, needed for cleaning up the toolbar in d'tor + RArray iItemIdArray; + /// Own: Asynchronous command notifier + CMRAsynchCmd* iAsyncCmd; + /// Own: Flag for the visibility change + TBool iVisibilityChanged; + /// Own: copy of previous application toolbar + CAknToolbar* iPreviousToolbar; + /// To record if the toolbar in previous view is visible. + TBool iPreviousVisibility; + /// Ref: Observer for toolbar visibility + }; + +#endif // CMRTOOLBAR_H + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/esmrfieldbuilderdef.h --- a/meetingrequest/mrgui/inc/esmrfieldbuilderdef.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/esmrfieldbuilderdef.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -28,7 +28,7 @@ const TUint KSemiColon = 59;//ascii letter const TUint KComma = 44;//ascii letter -const TInt KTextLimit( 5000 ); +const TInt KTextLimit( 2000 ); const TInt KMaxAddressFieldLines = 3; //needed to offset the difference that HandleEdwinSizeEventL forces on this control diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/esmrgui.hrh --- a/meetingrequest/mrgui/inc/esmrgui.hrh Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/esmrgui.hrh Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -37,4 +37,13 @@ #define EEsMrResponseDialogType 0x602 #define EEsMrTrackingType 0x603 +#define EMrAttachmentProgressNoteId 0x604 + +enum TMRMenuStyle + { + EMROptionsMenu, + EMRContextMenu, + EMRStylusPopupMenu + }; + #endif // ESMRGUI_HRH diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/esmrgui.pan --- a/meetingrequest/mrgui/inc/esmrgui.pan Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/esmrgui.pan Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/esmrgui.rh --- a/meetingrequest/mrgui/inc/esmrgui.rh Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/esmrgui.rh Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -55,6 +55,17 @@ } // --------------------------------------------------------------------------- +// ESMR_UNIFIED +// +// --------------------------------------------------------------------------- +// +STRUCT ESMR_UNIFIED + { + WORD id; + LLINK txt; // TBUF + } + +// --------------------------------------------------------------------------- // ESMR_PRIORITY // // --------------------------------------------------------------------------- @@ -96,6 +107,16 @@ } // --------------------------------------------------------------------------- +// ESMR_UNIFIED_TABLE +// +// --------------------------------------------------------------------------- +// +STRUCT ESMR_UNIFIED_TABLE + { + STRUCT unified[]; // event type in unified editor (UNIFIED) + } + +// --------------------------------------------------------------------------- // ESMR_PRIORITY_TABLE // // --------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/esmrvcalexport.h --- a/meetingrequest/mrgui/inc/esmrvcalexport.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VCal exporter for send ui wrapper -* -*/ - - -#ifndef TESMRVCALEXPORT_H -#define TESMRVCALEXPORT_H - -// INCLUDES -#include -#include // for TParse - -// FORWARD DECLARATIONS -class CCalSession; -class CCalEntry; - - -// CLASS DECLARATION - -/** - * Exports Agenda entry to VCalendar data - * - */ -NONSHARABLE_CLASS( TESMRVCalExport ) - { -public: // Constructors and destructor - /** - * C++ default constructor. - */ - TESMRVCalExport(CCalSession& aCalSession, RFs& aFileServerSession); - -public: // New functions - /** - * Exports CCalEntry into VCalendar format - * - * @param aEntry - entry to be exported - * @return Descriptor that points to the exported data - */ - HBufC8* ExportVCalLC(CCalEntry& aEntry); - -protected: // New functions - void ConvertVCalL(CBufFlat* aBuf, CCalEntry& aEntry); - void ConvertICalL(CBufFlat* aBuf, CCalEntry& aEntry); - -private: // Data - - // Ref: calendar session - CCalSession& iSession; - - // Ref: file server session - RFs& iFs; - }; - -#endif - - -// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfieldevent.h --- a/meetingrequest/mrgui/inc/mesmrfieldevent.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfieldevent.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfieldeventnotifier.h --- a/meetingrequest/mrgui/inc/mesmrfieldeventnotifier.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfieldeventnotifier.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfieldeventobserver.h --- a/meetingrequest/mrgui/inc/mesmrfieldeventobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfieldeventobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfieldeventqueue.h --- a/meetingrequest/mrgui/inc/mesmrfieldeventqueue.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfieldeventqueue.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfieldstorage.h --- a/meetingrequest/mrgui/inc/mesmrfieldstorage.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfieldstorage.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,9 +20,11 @@ #define MESMRFIELDSTORAGE_H #include +#include "esmrdef.h" // TESMREntryFieldId class MESMRCalEntry; class CESMRField; +class CESMRPolicy; /** * Pure virtual class to be inherited by field storage classes. @@ -81,6 +83,15 @@ virtual TInt Validate( TESMREntryFieldId& aId, TBool aForceValidate = EFalse ) = 0; + + /** + * Updates storage on policy change. + * + * @param aNewPolicy the new policy to adjust the storage. + * @param aEntry the entry to handle. + */ + virtual void ChangePolicyL( const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ) = 0; }; #endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfieldvalidator.h --- a/meetingrequest/mrgui/inc/mesmrfieldvalidator.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfieldvalidator.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -27,6 +27,7 @@ class CEikTimeEditor; class CEikDateEditor; class MESMRFieldEventQueue; +class MMRAbsoluteAlarmController; /** * MESMRFieldValidator defines interface for field validation. @@ -61,7 +62,11 @@ /** Relative alarm occurs in past */ EErrorRelativeAlarmInPast, /** Reschedule instance to same day with another instance */ - EErrorRescheduleInstance + EErrorRescheduleInstance, + /** The errors be used to validate the time of one edited intance of seires*/ + EErrorInstanceOverlapsExistingOne, + EErrorInstanceAlreadyExistsOnThisDay, + EErrorInstanceOutOfSequence }; public: @@ -139,6 +144,14 @@ CEikDateEditor& aAlarmDate ) = 0; /** + * Sets absolute alarm on off field. + * @param aAbsoluteAlarmOnOff Reference to interface to handle absolute + * alarm on-off setting. + */ + virtual void SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& aAbsoluteAlarmController ) = 0; + + /** * Sets alarm date field. * @param aAlarmDate Reference to alarm date field. */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrfontsizeobserver.h --- a/meetingrequest/mrgui/inc/mesmrfontsizeobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrfontsizeobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrlistobserver.h --- a/meetingrequest/mrgui/inc/mesmrlistobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrlistobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,9 +25,9 @@ class CESMRField; /** - * Observer interface for the custom list component. + * Observer interface for the custom list pane. * - * @see cesmrlistcomponent.h + * @see cesmrlistpane.h * @lib esmrgui.lib */ class MESMRListObserver @@ -46,14 +46,14 @@ * * @param aField - id of the field. */ - virtual void InsertControl( TESMREntryFieldId aField ) = 0; + virtual void ShowControl( TESMREntryFieldId aField ) = 0; /** * Disables field in the list. This method does not delete field. * * @param aField - id of the field. */ - virtual void RemoveControl( TESMREntryFieldId aField ) = 0; + virtual void HideControl( TESMREntryFieldId aField ) = 0; /** * Is field visible or not. @@ -73,16 +73,37 @@ * Scrolls the specific field to be fully visible * * @param aInd Index of the field that needs to be fully visible - * @param aSizeChanged ETrue if the field size has been changed */ - virtual void ScrollItemVisible( TInt aInd ) = 0; + virtual void ScrollControlVisible( TInt aInd ) = 0; -// SCROLLING_MOD: Two methods for CESMRRichTextViewer usage - virtual void MoveListAreaDownL( TInt aAmount) = 0; - virtual void MoveListAreaUpL(TInt aAmount) = 0; - + /** + * Returns the height of the whole field container area containing all visible fields + * + * @return World height. + */ virtual TInt ListHeight() = 0; - virtual TBool IsFieldBottomVisible() = 0; + + /** + * Returns ETrue if focused fields bottom is visible, otherwise EFalse + * + * @return Boolean ETrue/EFalse + */ + virtual TBool IsFocusedControlsBottomVisible() = 0; + + /** + * Moves fields the amount of pixels given. + * + * @param aAmount, amount of the movement in pixels. Positive down, negative up. + */ + virtual void RePositionFields( TInt aAmount ) = 0; + + /** + * Return viewable areas rect, which in other words is + * listpanes rect. + * + * @return TRect, rect of the viewable area. + */ + virtual TRect ViewableAreaRect() = 0; }; #endif // MESMRLISTOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrlocationhistoryitem.h --- a/meetingrequest/mrgui/inc/mesmrlocationhistoryitem.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrlocationhistoryitem.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrlocationhistoryitemfactory.h --- a/meetingrequest/mrgui/inc/mesmrlocationhistoryitemfactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrlocationhistoryitemfactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrlocationplugin.h --- a/meetingrequest/mrgui/inc/mesmrlocationplugin.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrlocationplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,17 +22,19 @@ #include +class CCalGeoValue; + /** * MESMRLocationPlugin defines the interface for accessing location service provider * from ESMR GUI. */ class MESMRLocationPlugin - { + { public: - /** + /** * Shows map on the screen and asks user to select a position. * The function returns immediately and the selection is provided * to the caller via MESMRLocationPluginObserver interface. @@ -40,28 +42,48 @@ * @param aSearchQuery Text to show as default address * @param aLocationUrl URL containing coordinates for maps focus */ - virtual void SelectFromMapL( const TDesC& aSearchQuery, const TDesC& aLocationUrl ) = 0; - + virtual void SelectFromMapL( + const TDesC& aSearchQuery, + const TDesC& aLocationUrl ) = 0; + + /** + * Shows map on the screen and asks user to select a position. + * The function returns immediately and the selection is provided + * to the caller via MESMRLocationPluginObserver interface. + * + * @param aSearchQuery Text to show as default address + * @param aGeoValue coordinates for maps focus + */ + virtual void SelectFromMapL( + const TDesC& aSearchQuery, + const CCalGeoValue* aGeoValue ) = 0; + /** * Shows map on the screen. User may edit the search string and search * the position from the map, but the selection is not provided to the * caller - * + * * @param aSearchQuery Text to show as default address */ virtual void SearchFromMapL( const TDesC& aSearchQuery ) = 0; - + /** * Shows map on the screen focused on the given location. * - * @param aLocation containing name for landmark * @param aLocationUrl URL containing coordinates for maps focus */ - virtual void ShowOnMapL( const TDesC& aLocation, const TDesC& aLocationUrl ) = 0; + virtual void ShowOnMapL( const TDesC& aLocationUrl ) = 0; + + /** + * Shows map on the screen focused on the given location. + * + * @param aGeoValue the coordinates for maps focus + */ + virtual void ShowOnMapL( const CCalGeoValue& aGeoValue ) = 0; protected: - virtual ~MESMRLocationPlugin() {} + virtual ~MESMRLocationPlugin() {} }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrlocationpluginobserver.h --- a/meetingrequest/mrgui/inc/mesmrlocationpluginobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrlocationpluginobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrnaviarroweventobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mesmrnaviarroweventobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file defines class MESMRFieldEventObserver. +* +*/ + +#ifndef MESMRNAVIARROWEVENTOBSERVER_H_ +#define MESMRNAVIARROWEVENTOBSERVER_H_ + +/** + * MESMRNaviArrowEventObserver defines an interface for observing events + * from NaviArrow. + * + */ +class MESMRNaviArrowEventObserver + { +public: + + /** + * Event notification function. + * + * @param aCommand The navi command + */ + virtual void HandleNaviArrowEventL( const TInt aCommand ) = 0; + +protected: + + virtual ~MESMRNaviArrowEventObserver() {} + }; + +#endif /* MESMRNAVIARROWEVENTOBSERVER_H_ */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrresponseobserver.h --- a/meetingrequest/mrgui/inc/mesmrresponseobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrresponseobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -46,4 +46,4 @@ virtual void ChangeReadyResponseL() = 0; }; -#endif // __MESMRRESPONSEOBSERVER_H__ \ No newline at end of file +#endif // __MESMRRESPONSEOBSERVER_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmrtitlepaneobserver.h --- a/meetingrequest/mrgui/inc/mesmrtitlepaneobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmrtitlepaneobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -28,13 +28,6 @@ * @param aText new text */ virtual void UpdateTitlePaneTextL( const TDesC& aText ) = 0; - - /** - * Updates the priority icon in title pane - * - * @param aPriority - */ - virtual void UpdateTitlePanePriorityIconL( TUint aPriority ) = 0; }; #endif // MESMRTITLEPANEOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmruibase.h --- a/meetingrequest/mrgui/inc/mesmruibase.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmruibase.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mesmruifactory.h --- a/meetingrequest/mrgui/inc/mesmruifactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/mesmruifactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,7 +18,7 @@ #ifndef MESMRUIFACTORY_H #define MESMRUIFACTORY_H -class CESMRPolicy; +class MMRInfoProvider; class MESMRCalEntry; class MESMRUiBase; class MAgnEntryUiCallback; @@ -42,13 +42,11 @@ public: /** * Creates UI view - * @param aPolicy Reference to MRUI policy - * @param aEntry Reference to MRUI calendar entry + * @param aInfoProvider Reference to MR Info provider * @param aCallback Reference to callback object */ virtual MESMRUiBase* CreateUIL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ) = 0; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mmrabsolutealarmcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mmrabsolutealarmcontroller.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface class for controlling absolute alarm +* +*/ + +#ifndef MMRABSOLUTEALARMCONTROLLER_H +#define MMRABSOLUTEALARMCONTROLLER_H + +// INCLUDES +#include + +// CLASS DECLARATIONS +class MMRAbsoluteAlarmController + { + public: // Interface + + /** + * Validator sets absolute alarm 'On' in CMRAlarmOnOffField + * by calling this function. + */ + virtual void SetAbsoluteAlarmOn() = 0; + + /** + * Validator sets absolute alarm 'Off' in CMRAlarmOnOffField + * by calling this function. + */ + virtual void SetAbsoluteAlarmOff() = 0; + + }; +#endif // MMRABSOLUTEALARMCONTROLLER_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mmrfieldcontainerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mmrfieldcontainerobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR observer for the custom list pane +* +*/ + +#ifndef MMRFIELDCONTAINEROBSERVER_H +#define MMRFIELDCONTAINEROBSERVER_H + +// +#include "esmrdef.h" +// + +class CESMRField; + +/** + * Observer interface for scrolling fields up and down. + * + * @see cmrlistpane.h + * @lib esmrgui.lib + */ + class MMRFieldContainerObserver + { +public: + /** + * Scrolls list items up + * @param aPx Amount of scroll in pixels + */ + virtual void ScrollFieldsUp( TInt aPx ) = 0; + + /** + * Scrolls list items down + * @param aPx Amount of scroll in pixels + */ + virtual void ScrollFieldsDown( TInt aPx ) = 0; + + /** + * Tells to the list pane that scroll bar + * and physics require updating. + * + * @param aPx Amount of scroll in pixels + */ + virtual void UpdateScrollBarAndPhysics() = 0; + + }; + +#endif // MMRFIELDCONTAINERPOSITIONOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mmrfocushandlingtimerobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mmrfocushandlingtimerobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file defines class MMRFocusHandlingTimerObserver. +* +*/ + +#ifndef MMRFOCUSHANDLINGTIMEROBSERVER_H +#define MMRFOCUSHANDLINGTIMEROBSERVER_H + + +/** + * Observer interface to observer timer callbacks + */ +class MMRFocusHandlingTimerObserver + { + public: + /** + * Callback function which is called after timer + * completion. + * + * @param aError Completion code of timer + */ + virtual void TimerCallBackL( TInt aError ) = 0; + + }; + + +#endif // MMRFOCUSHANDLINGTIMEROBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mmrfocusstrategy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mmrfocusstrategy.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface class for the focus strategy +* +*/ + +#ifndef MMRFOCUSSTRATEGY_H +#define MMRFOCUSSTRATEGY_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CESMRField; +class MESMRFieldStorage; + +// CLASS DECLARATIONS + +class MMRFocusStrategy + { + public: // Types + /** + * Event types where the strategy will react on. + */ + enum TFocusEventType + { + EFocusPointerEvent, + EFocusKeyEvent + }; + + public: // Destructor + virtual ~MMRFocusStrategy() { } + + public: // Interface + + /** + * Called to initialize the focus + */ + virtual void InitializeFocus() = 0; + + /** + * Called when the event occurs + * + * @param aEventType Type of the event e.g. key, pointer + */ + virtual void EventOccured( TFocusEventType aEventType ) = 0; + + /** + * Returns either the focus is on or off + * + * @return ETrue if the focus is visible + */ + virtual TBool IsFocusVisible() const = 0; + }; +#endif // MMRFOCUSSTRATEGY_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mmrphysicsobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mmrphysicsobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR observer for physics handling +* +*/ + +#ifndef MMRPHYSICSOBSERVER_H +#define MMRPHYSICSOBSERVER_H + +// +#include "esmrdef.h" +// + +/** + * Observer interface for physics event's end handling + * + * @see cesmrlistpane.h + * @lib esmrgui.lib + */ + class MMRPhysicsObserver + { +public: + /** + * Method to be called when physics wants to notify that physics operation + * has ended. By calling this, list pane updates for example + * scroll bar and focus. + */ + virtual void PhysicsEmulationEnded() = 0; + }; + +#endif // MMRPHYSICSOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/mmrscrollbarobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/mmrscrollbarobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR observer for scroll bar position updating +* +*/ + +#ifndef MMRSCROLLBAROBSERVER_H +#define MMRSCROLLBAROBSERVER_H + +// +#include "esmrdef.h" +// + +/** + * Observer interface for the scroll bar position handling + * + * @see cesmrview.h + * @lib esmrgui.lib + */ + class MMRScrollBarObserver + { +public: + /** + * Method to be called when list pane wants to notify list component + * that scroll bar thumb position needs to be updated. + */ + virtual void ScrollBarPositionChanged( TInt aThumbPosition ) = 0; + }; + +#endif // MMRPHYSICSOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/nmrbitmapmanager.h --- a/meetingrequest/mrgui/inc/nmrbitmapmanager.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bitmap manager for MRGUI usage. -* -*/ - -#ifndef NMRBITMAPMANAGER_H -#define NMRBITMAPMANAGER_H - -#include -#include - -// FORWARD DECLARATIONS -class CFbsBitmap; - -namespace NMRBitmapManager - { - enum TMRBitmapId - { - EMRBitmapNotSet = 0, - EMRBitmapRightClickArrow = 1, - EMRBitmapTrackingAccept, - EMRBitmapTrackingReject, - EMRBitmapTrackingTentative, - EMRBitmapTrackingNone, - EMRBitmapPriorityHigh, - EMRBitmapPriorityLow, - EMRBitmapPriorityNormal, - EMRBitmapSynchronization, - EMRBitmapSubject, - EMRBitmapOccasion, - EMRBitmapRecurrence, - EMRBitmapBrowser, - EMRBitmapIntranet, - EMRBitmapBookmark, - EMRBitmapAlarm, - EMRBitmapAlarmDate, - EMRBitmapAlarmTime, - EMRBitmapAlarmClock, - EMRBitmapCheckBoxOn, - EMRBitmapCheckBoxOff, - EMRBitmapClock, - EMRBitmapLocation, - EMRBitmapDateStart, - EMRBitmapDateEnd, - EMRBitmapAttachment, - EMRBitmapCtrlBar, - - // Attachment handling icons - EMRBitmapMailAttachment, - EMRBitmapOpenAttachmentView, - EMRBitmapOpenAttachment, - EMRBitmapDownloadAttachment, - EMRBitmapDownloadAllAttachments, - EMRBitmapSaveAttachment, - EMRBitmapSaveAllAttachments, - - EMRBitmapListCenter, - EMRBitmapListTop, - EMRBitmapListBottom, - EMRBitmapListLeft, - EMRBitmapListRight, - EMRBitmapListTopLeft, - EMRBitmapListTopRight, - EMRBitmapListBottomLeft, - EMRBitmapListBottomRight, - - EMRBitmapInputCenter, - EMRBitmapInputTop, - EMRBitmapInputBottom, - EMRBitmapInputLeft, - EMRBitmapInputRight, - EMRBitmapInputTopLeft, - EMRBitmapInputTopRight, - EMRBitmapInputBottomLeft, - EMRBitmapInputBottomRight, - - EMRBitmapSetOptCenter, - EMRBitmapSetOptTop, - EMRBitmapSetOptBottom, - EMRBitmapSetOptLeft, - EMRBitmapSetOptRight, - EMRBitmapSetOptTopLeft, - EMRBitmapSetOptTopRight, - EMRBitmapSetOptBottomLeft, - EMRBitmapSetOptBottomRight - }; - - class TMRBitmapStruct - { - public: - TMRBitmapStruct() : - iFallbackIndex( 0 ), iFallbackMaskIndex( 0 ) - { iItemId.iMajor = 0; iItemId.iMinor = 0; } - - public: // Data - TAknsItemID iItemId; - TInt iFallbackIndex; - TInt iFallbackMaskIndex; - }; - - /** - * Converts logical TMRBitmapId to internal TMRBitmapStruct - * which contains skin id for bitmap and fallback ids. - * - * @param aBitmapId Logical bitmap id. - * @return TAknsItemID Skin graphics id. - */ - IMPORT_C TMRBitmapStruct GetBitmapStruct( TMRBitmapId aBitmapId ); - - /** - * Creates bitmap and bitmap mask. Bitmap is skin/theme based - * and it's retrived by the given ID.Bitmap is also resized to - * the given size. - * Ownership of these created bitmaps is transferred to the caller. - * - * @param aIconID - id of the wanted bitmap - * @param aBitmap - reference to the pointer where new bitmap is stored - * @param aMask - reference to the pointer where new bitmap mask is stored - * @param aSize - Desired size for the bitmap - * @return TInt - KErrNone if bitmap was constructed succesfully - * KErrNotFound if any problems occured - */ - IMPORT_C TInt GetSkinBasedBitmap( TMRBitmapId aBitmapId, - CFbsBitmap*& aBitmap, - CFbsBitmap*& aMask, - TSize aSize ); - - } - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/nmrlayoutmanager.h --- a/meetingrequest/mrgui/inc/nmrlayoutmanager.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Layout manager for MRGUI usage. -* -*/ - -#ifndef NMRLAYOUTMANAGER_H -#define NMRLAYOUTMANAGER_H - -#include -#include -#include - - -namespace NMRLayoutManager - { - - /** - * Enumeration for getting window component sizes. - */ - enum TMRLayout { - // Table 1.1 - EMRLayoutDialog, - // Table 1.48 (Mrui) - EMRLayoutCtrlBar, - EMRLayoutContentArea, - EMRLayoutDialogBg, - // Table 1.49 - EMRLayoutDialogBgGraphics, - // Table 1.50 - EMRLayoutListArea, - EMRLayoutScrollBar, - - // Table 1.53 - // Option 0 - // Option 1 - EMRLayoutTextEditorIcon, - EMRLayoutTextEditorBg, - // Option 2 - EMRLayoutTimeEditorIcon, - EMRLayoutTimeEditorStartBg, - EMRLayoutTimeEditorEndBg, - // Option 3 - EMRLayoutDateEditorIcon, - EMRLayoutDateEditorBg, - // Option 4 - // Option 5 - EMRLayoutCheckboxIcon, - - // Table 1.67 - // Option 0 - // Option 1 - // Option 2 - EMRLayoutCtrlBarGraphics - }; - - /** - * Enumeration for getting text component sizes, fonts, etc. - */ - enum TMRTextLayout { - // Table 1.53 - // Option 0 - EMRTextLayoutText, - // Option 1 - EMRTextLayoutTextEditor, - // Option 2 - EMRTextLayoutTimeEditorStart, - EMRTextLayoutTimeEditorSeparator, - EMRTextLayoutTimeEditorEnd, - // Option 3 - EMRTextLayoutDateEditor, - // Option 4 - EMRTextLayoutMultiRowTextEditor, - // Option 5 - EMRTextLayoutCheckboxEditor, - - // Table 1.67 - // Option 0 - // Option 1 - // Option 2 - EMRLayoutCtrlBarTitle - }; - - - /** - * Returns TAknWindowComponentLayout for logical TMRLayout from xml laf. - * - * @param aLayout logical mr component id - * @return layout struct from laf - */ - IMPORT_C TAknWindowComponentLayout GetWindowComponentLayout( TMRLayout aLayout ); - - /** - * Returns TAknTextComponentLayout for logical TMRTextLayout from xml laf. - * - * @param aLayout logical mr component id - * @return layout struct from laf - */ - IMPORT_C TAknTextComponentLayout GetTextComponentLayout( TMRTextLayout aLayout ); - - /** - * Returns window component's rect from layout data. - * - * @param aParentRect parent component's rect. - * @param aLayout component enumeration. - * @return layout rect of the component. - */ - IMPORT_C TAknLayoutRect GetLayoutRect( const TRect& aParentRect, TMRLayout aLayout ); - - /** - * Returns field's size from layout data. - * - * @param aParentRect parent component's rect. - * @param aRows field row count. - * @return layout rect of the field. - */ - IMPORT_C TAknLayoutRect GetFieldLayoutRect( const TRect& aParentRect, TInt aRows ); - - /** - * Returns rect for one field's row. - * - * @param aParentRect field's rect. - * @param aRow row which's rect to return. - * @return layout rect of field's row. - */ - IMPORT_C TAknLayoutRect GetFieldRowLayoutRect( const TRect& aParentRect, TInt aRow ); - - /** - * Returns text component's rect from layout data. - * - * @param aParentRect parent component's rect. - * @param aLayout text component enumeration. - * @return text layout rect of text component. - */ - IMPORT_C TAknLayoutText GetLayoutText( const TRect& aParentRect, TMRTextLayout aLayout ); - - } - -#endif // NMRLAYOUTMANAGER_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/resmrstatic.h --- a/meetingrequest/mrgui/inc/resmrstatic.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Static Tls data storage -* -*/ - - -#ifndef RESMRSTATIC_H -#define RESMRSTATIC_H - -#include - -class TESMRStaticData; -class CESMRContactMenuHandler; -class CESMRContactManagerHandler; -class CFSMailClient; -class CFSMailBox; - -/* - * Proxy class to access TLS stored data - */ -class RESMRStatic - { -public: - /** - * C++ constructor - */ - IMPORT_C RESMRStatic(); - - /** - * C++ destructor - */ - IMPORT_C ~RESMRStatic(); - -public: // interface - /* - * Retrieves stored data pointer from Tls, or creates new one - * if called first time. Must be called before using this class. - */ - IMPORT_C void ConnectL(); - - /* - * Closes this instance of static data handler. - */ - IMPORT_C void Close(); - - /* - * Returns global instance of CESMRContactManagerHandler - */ - IMPORT_C CESMRContactManagerHandler& ContactManagerHandlerL(); - - /* - * Returns global instance of CESMRContactMenuHandler - */ - IMPORT_C CESMRContactMenuHandler& ContactMenuHandlerL(); - - /* - * Returns the current index for tracking field - */ - IMPORT_C TInt CurrentFieldIndex(); - - /* - * Sets the current index for tracking field - */ - IMPORT_C void SetCurrentFieldIndex(TInt aFieldIndex); - - IMPORT_C CFSMailBox& MailBoxL( const TDesC& aAddress ); - -private: // Internal definitions - /** - * Enumeration for cached data types - */ - enum TUsedType - { - EContactManagerHandler = 0x01, - EContactMenuHandler = 0x04, - EMailBoxHandler = 0x08 - }; - - CFSMailClient& FSMailClientL( ); - -private: // Data - /* - * Own: Pointer to Tls stored data pointer - */ - TESMRStaticData* iStaticData; - - /* - * Own: Used pointer types - */ - TInt iUsedTypes; - }; - -#endif //RESMRSTATIC_H - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/tesmrattachmentinfo.h --- a/meetingrequest/mrgui/inc/tesmrattachmentinfo.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/tesmrattachmentinfo.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/tesmrentryfield.h --- a/meetingrequest/mrgui/inc/tesmrentryfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/inc/tesmrentryfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/inc/tnavipaneclearer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/inc/tnavipaneclearer.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Sets the default navipane in construct phase and +* pops it back in destruct. +* +*/ +#ifndef TNAVIPANECLEARER_H +#define TNAVIPANECLEARER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CAknNavigationControlContainer; + +// CLASS DECLARATIONS + +class TNavipaneClearer + { + public: + TNavipaneClearer(); + ~TNavipaneClearer(); + + private: + /// Ref: Navi container reference + CAknNavigationControlContainer* iNaviContainer; + /// Own: Error indicator, indicates whether the + /// navicontainer is initialized fully or not. + TBool iFullyInitialized; + }; + +#endif // TNAVIPANECLEARER_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/loc/mrui.loc --- a/meetingrequest/mrgui/loc/mrui.loc Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/loc/mrui.loc Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,1775 +16,1255 @@ */ -// d:Status pane text -// l:title_pane_t2/opt9 -// r:TB9.1 +// d: Status pane text +// l: title_pane_t2/opt9 +// r: TB9.1 // #define qtn_meet_req_title_meeting "Meeting request" -// d:Control bar text -// l:fscal_editor_control_bar_text -// r:TB9.1 +// d: Control bar text +// l: fscal_editor_control_bar_text +// r: TB9.1 // #define qtn_meet_req_title "New meeting" -// d:Label for required attendees field -// l:fscal_mr_field_label_text -// r:TB9.1 +// d: Label for required attendees field +// l: fscal_mr_field_label_text +// r: TB9.1 // #define qtn_meet_req_label_required "Required" -// d:Label for optional attendees field -// l:fscal_mr_field_label_text -// r:TB9.1 +// d: Label for optional attendees field +// l: fscal_mr_field_label_text +// r: TB9.1 // #define qtn_meet_req_label_opt "Optional" -// d:Default text for attendees fields -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Default text for attendees field +// l: fscal_editor_field_text_1 +// r: TB9.1 // -#define qtn_meet_req_contact_field "(Add contact)" - -// d:Options menu item -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_rcl_opt_add_recipient "Add as recipient" +#define qtn_meet_req_contact_field "(Type contact)" -// d:Action menu item -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_fs_action_recipient "Add as recipient" - -// d:Options menu item -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_add_required "Add as 'required'" - -// d:Options menu item -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Default text for subject field +// l: fscal_editor_field_text_1 +// r: TB9.1 // -#define qtn_meet_req_add_optional "Add as 'optional'" - -// d:Action menu item -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_add_required_act "Add as 'required'" - -// d:Action menu item -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_add_optional_act "Add as 'optional'" +#define qtn_meet_req_subject_field "(Type subject)" -// d:Default text for subject field -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Text for all day event checkbox +// l: fscal_editor_all_day_text +// r: TB9.1 // -#define qtn_meet_req_subject_field "(Enter subject)" +#define qtn_meet_req_all_day_event "All day event" -// d:Text for all day event checkbox -// l:fscal_editor_all_day_text -// r:TB9.1 -// -#define qtn_meet_req_all_day_event "All-day event" - -// d:Alarm field text if the alarm is set on -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Alarm field text if the alarm is set on +// l: fscal_editor_field_text_1 +// r: TB9.1 // #define qtn_meet_req_alarm_on "On" -// d:Alarm field text if the alarm is set off -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Alarm field text if the alarm is set off +// l: fscal_editor_field_text_1 +// r: TB9.1 // #define qtn_meet_req_alarm_off "Off" -// d:All day event information note -// l:popup_note_window -// r:TB9.1 +// d: All day event information note +// l: popup_note_window +// r: TB9.1 // -#define qtn_meet_req_later_date "Alarm set for later than entry starts" +#define qtn_meet_req_later_date "Alarm is set later than the entry starts" -// d:Information note text if user has defined the entry end time before start time -// l:popup_note_window -// r:TB9.1 -// +// d: Information note text if user has defined the entry end time before start time +// l: popup_note_window +// r: TB9.1 +// #define qtn_meet_req_info_note_ends_before "Entry ends earlier than it starts" -// d:Default text for location field -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Default text for location field +// l: fscal_editor_field_text_1 +// r: TB9.1 // -#define qtn_meet_req_location_field "(Enter location)" +#define qtn_meet_req_location_field "(Type location)" -// d:Heading text for set alarm pop up list -// l:heading_pane_t1 -// r:TB9.1 +// d: Heading text for set alarm pop up list +// l: heading_pane_t1 +// r: TB9.1 // -#define qtn_meet_req_set_alarm_header "Set alarm:" +#define qtn_meet_req_set_alarm_header "Set alarm" -// d:Alarm list item text for 1 minute before -// d:Value for N: 1 -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Alarm list item text for 1 minute before +// d: Value for N: 1 +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_alarm_minute "%N minute before" -// d:Alarm list item text for %N minutes before -// d:Values for N: 5, 15,30 -// l:list_set_graphic_pane_t1 -// r:TB9.1 +// d: Alarm list item text for %N minutes before +// d: Values for N: 5, 15,30 +// l: list_set_graphic_pane_t1 +// r: TB9.1 // #define qtn_meet_req_alarm_minutes "%N minutes before" -// d:Alarm list item text for 0 minutes before -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_alarm_zero_minutes "0 minutes before" - -// d:Alarm list item text for 1 hour before -// d:Value for N: 1 -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Alarm list item text for 1 hour before +// d: Value for N: 1 +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_alarm_hour "%N hour" -// d:Alarm list item text for %N hours before -// d:Values for N: 2, 3, 4, 5, 6, 7, 8, 12 -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Alarm list item text for %N hours before +// d: Values for N: 2, 3, 4, 5, 6, 7, 8, 12 +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_alarm_hours "%N hours" -// d:Alarm list item text for 1 day before -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Alarm list item text for 1 day before +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_alarm_one_day "1 day" -// d:Alarm list item text for %N days before -// d:Values for N: 2 -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Alarm list item text for %N days before +// d: Values for N: 2 +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_alarm_days "%N days" -// d:Alarm list item text for 1 week before -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Alarm list item text for 1 week before +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_alarm_one_week "1 week" -// d:Synchronisation popup setting list "Private" item -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Synchronisation popup setting list "Private" item +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_calendar_task_sync_private "Private" -// d:Synchronisation popup setting list "Public" item -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Synchronisation popup setting list "Public" item +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_calendar_task_sync_public "Public" -// d:Synchronisation popup setting list "None" item -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Synchronisation popup setting list "None" item +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_calendar_task_sync_none "None" -// d:Default text for description field -// l:fscal_editor_field_text_2 -// r:TB9.1 +// d: Default text for description field +// l: fscal_editor_field_text_2 +// r: TB9.1 // #define qtn_meet_req_details_field "(Enter details)" -// d:Information note shown in case of very long description in description field -// l:popup_note_window -// r:TB9.1 +// d: Information note shown in case of very long description in description field +// l: popup_note_window +// r: TB9.1 // -#define qtn_meet_req_long_description "Unable to display content" +#define qtn_meet_req_long_description "The content can not be displayed" -// d:Heading text for open this occurence or series list popup query -// l:heading_pane_t1 -// r:TB9.1 +// d: Heading text for open this occurence or series list popup query +// l: heading_pane_t1 +// r: TB9.1 // -#define qtn_meet_req_recurrent_heading_open "Open:" +#define qtn_meet_req_recurrent_heading_open "Open" -// d:This occurance popup setting list item text -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: This occurance popup setting list item text +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_recurrent_this_occurrence "This occurrence" +#define qtn_meet_req_recurrent_this_occurrence "Open this occurrence" -// d:Open the series popup setting list item text -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Open the series popup setting list item text +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurrent_series "Open the series" -// d:Recurrence list item text in case the recurrence type is not supported -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Recurrence list item text in case the recurrence type is not supported +// l: fscal_editor_field_text_1 +// r: TB9.1 // #define qtn_meet_req_recurrence_event "Recurrent event" -// d:Heading text for set recurrence pop up list -// l:heading_pane_t1 -// r:TB9.1 +// d: Heading text for set recurrence pop up list +// l: heading_pane_t1 +// r: TB9.1 // #define qtn_meet_req_set_recurrence_header "Set recurrence" -// d:Recurrence list item text for not repeated -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Recurrence list item text for not repeated +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurring_not "Not repeated" -// d:Recurrence list item text for daily -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Recurrence list item text for daily +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurring_daily "Daily" -// d:Recurrence list item text for weekly -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Recurrence list item text for weekly +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurring_weekly "Weekly" -// d:Recurrence list item text for every second week -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Recurrence list item text for every second week +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_recurring_sec_week "Fortnightly" +#define qtn_meet_req_recurring_sec_week "Every second week" -// d:Recurrence list item text for monthly -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Recurrence list item text for monthly +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurring_monthly "Monthly" -// d:Recurrence list item text for yearly -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Recurrence list item text for yearly +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurring_yearly "Yearly" -// d:The label for the field that defines the end date for recurring -// l:fscal_mr_field_label_text -// r:TB9.1 +// d: The label for the field that defines the end date for recurring +// l: fscal_mr_field_label_text +// r: TB9.1 // #define qtn_meet_req_repeat_until "Repeat until" -// d:Information note shown in case of repeat until date is the same or earlier date than MR's start date -// l:popup_note_window -// r:TB9.1 +// d: Information note shown in case of repeat until date is the same or earlier date than MR's start date +// l: popup_note_window +// r: TB9.1 // -#define qtn_calendar_info_repeat_invalid "'Repeat until' date must be later than entry start date" +#define qtn_calendar_info_repeat_invalid "Repeat until date must be later than entry start date" -// d:Command in options menu -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Command in options menu +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_send "Send" -// d:Command in options menu -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Command in options menu +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_send_update "Send update" -// d:Command in options menu -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Command in options menu +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_add_participants "Add participants" -// d:Command in options menu -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Command in options menu +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_optional "Add optional participants" -// d:Command in options menu -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_opt_availability "Check availability" - -// d:Confirmation query text for deleting meeting request -// l:popup_note_window/opt2 -// r:TB9.1 -// -#define qtn_meet_req_delete_query "Delete?" - -// d:Command in options menu -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: Command in options menu +// l: list_single_pane_t1_cp2/opt3 +// r: TB9.1 // #define qtn_meet_req_opt_priority "Priority" -// d:Option submenu item -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Option submenu item +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_opt_priority_high "High" -// d:Option submenu item -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Option submenu item +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_opt_priority_normal "Normal" -// d:Option submenu item -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Option submenu item +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_opt_priority_low "Low" -// d:Options menu item -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Response area of meeting request viewer text in case the meeting request is out of date +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // -#define qtn_meet_req_opt_language "Writing language" - -// d:Confirmation query prompting to save the meeting request draft -// l:popup_note_window/opt2 -// r:TB9.1 -// -//Already defined by Avkon -//#define qtn_form_quest_save_changes "Save changes?" -// +#define qtn_meet_req_response_out_of_date "Request is out of date" -// d:Response area of meeting request viewer text in case the meeting request is out of date -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case the meeting has been cancelled +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // -#define qtn_meet_req_response_out_of_date "Request out of date" +#define qtn_meet_req_response_cancelled "Meeting has been canceled" -// d:Response area of meeting request viewer text in case the meeting has been cancelled -// l:fscal_mr_response_area_text_1 -// r:TB9.1 -// -#define qtn_meet_req_response_cancelled "Meeting cancelled" - -// d:Response area of meeting request viewer text in case the user has accepted the request -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case the user has accepted the request +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // #define qtn_meet_req_respond_accepted "Accepted" -// d:Response area of meeting request viewer text in case the user has tentatively accepted the request -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case the user has tentatively accepted the request +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // #define qtn_meet_req_respond_tentative "Tentatively accepted" -// d:Response area of meeting request viewer text in case the user has declined the request -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case the user has declined the request +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // #define qtn_meet_req_respond_declined "Declined" -// d:Response area of meeting request viewer text in case the meeting occurs in past -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case the meeting occurs in past +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // -#define qtn_meet_req_response_occurs_past "Meeting occurs in the past" +#define qtn_meet_req_response_occurs_past "Meeting occurs in past" -// d:Response area of meeting request viewer text in case there is conflicts with another appointment in the users calendar -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case there is conflicts with another appointment in the users calendar +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // #define qtn_meet_req_response_conflict "Conflicts with another entry" -// d:Response area of meeting request viewer text in case no other information to show -// l:fscal_mr_response_area_text_1 -// r:TB9.1 +// d: Response area of meeting request viewer text in case no other information to show +// l: fscal_mr_response_area_text_1 +// r: TB9.1 // #define qtn_meet_req_response_please_respond "Please respond" -// d:Response area of meeting request viewer selection list item -// l:fscal_mr_response_area_text_2 -// r:TB9.1 +// d: Response area of meeting request viewer selection list item +// l: fscal_mr_response_area_text_2 +// r: TB9.1 // #define qtn_meet_req_response_accept "Accept" -// d:Response area of meeting request viewer selection list item -// l:fscal_mr_response_area_text_2 -// r:TB9.1 +// d: Response area of meeting request viewer selection list item +// l: fscal_mr_response_area_text_2 +// r: TB9.1 // #define qtn_meet_req_response_tentative "Tentative" -// d:Response area of meeting request viewer selection list item -// l:fscal_mr_response_area_text_2 -// r:TB9.1 +// d: Response area of meeting request viewer selection list item +// l: fscal_mr_response_area_text_2 +// r: TB9.1 // #define qtn_meet_req_response_decline "Decline" -// d:Response area of meeting request viewer selection list item -// l:fscal_mr_response_area_text_2 -// r:TB9.1 -// -#define qtn_meet_req_response_remove_calendar_event "Remove from calendar" - -// d:Response area of meeting request viewer selection list item -// l:fscal_mr_response_area_text_2 -// r:TB9.1 -// -#define qtn_meet_req_response_new_time "Prop. new time" - -// d:Response area of meeting request viewer popup tooltip first line text -// l:fscal_mr_tooltip_text -// r:TB9.1 +// d: Response area of meeting request viewer popup tooltip first line text +// l: fscal_mr_tooltip_text +// r: TB9.1 // #define qtn_meet_req_conflicts_with_label "Conflicts with:" -// d:Response area of meeting request viewer popup tooltip text for time of conflicting event -// d:%U1 is start time of conflicting event -// d:%U2 is end time of conflicting event -// l:none -// r:TB9.1 +// d: Response area of meeting request viewer popup tooltip text for time of conflicting event +// d: %U1 is start time of conflicting event +// d: %U2 is end time of conflicting event +// l: fscal_mr_tooltip_text +// r: TB9.1 // #define qtn_meet_req_time_separator "%0U - %1U" -// d:Response area of meeting request viewer popup tooltip text for location of conflicting event -// d:%U is location of conflicting event -// l:fscal_mr_tooltip_text -// r:TB9.1 -// -#define qtn_meet_req_location_parenthesis "(%U)" - -// d:Response area of meeting request viewer popup tooltip text for title of conflicting event in case the event has no title defined -// l:fscal_mr_tooltip_text -// r:TB9.1 +// d: Response area of meeting request viewer popup tooltip text for title of conflicting event in case the event has no title defined +// l: fscal_mr_tooltip_text +// r: TB9.1 // #define qtn_meet_req_conflict_unnamed "Unnamed" -// d:Command in options menu, opens Calendar application in Day view -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Command in options menu, opens Calendar application in Day view +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_view_cal "View calendar" -// d:List item text for send response now -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: List item text for send response now +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_send_now "Send response now" -// d:List item text for edit before sending -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: List item text for edit before sending +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_edit_before_send "Edit resp. before sending" - -// d:List item text for don't send response -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_dont_send_response "Do not send response" - -// d:Beginning of Subject field in response to the meeting organizer if meeting is accepted -// l:none -// r:TB9.1 -// -#define qtn_meet_req_label_accept "Accepted" +#define qtn_meet_req_edit_before_send "Edit response" -// d:Beginning of Subject field in response to the meeting organizer if meeting is declined -// l:none -// r:TB9.1 -// -#define qtn_meet_req_label_decline "Declined" - -// d:Beginning of Subject field in response to the meeting organizer if meeting is tentative accepted -// l:none -// r:TB9.1 +// d: List item text for don't send response +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_label_tentative "Tentative" +#define qtn_meet_req_dont_send_response "Don’t send response" -// d:Beginning of Subject field in response to the meeting organizer if new time is proposing -// l:none -// r:TB9.1 -// -#define qtn_meet_req_label_propose "Propose new time" - -// d:Accepted heading text for edit before send list pop-up query -// l:heading_pane_t1 -// r:TB9.1 +// d: Accepted heading text for edit before send list pop-up query +// l: heading_pane_t1 +// r: TB9.1 // #define qtn_meet_req_send_query_accepted "Accepted:" -// d:Tentative heading text for edit before send list pop-up query -// l:heading_pane_t1 -// r:TB9.1 +// d: Tentative heading text for edit before send list pop-up query +// l: heading_pane_t1 +// r: TB9.1 // #define qtn_meet_req_send_query_tentative "Tentative:" -// d:Declined heading text for edit before send list pop-up query -// l:heading_pane_t1 +// d: Declined heading text for edit before send list pop-up query +// l: heading_pane_t1 // #define qtn_meet_req_send_query_declined "Declined:" -// d:The response editor prefilled texts in case the meeting start and end date is the same -// d:%0N is date -// d:%1U is start time -// d:%2U is end time -// l:none -// r:TB9.1 -// -#define qtn_meet_req_response_editor_prefilled1 "Propose new time: %0N %1U-%2U" - -// d:The response editor prefilled texts in case the meeting start and end date is not the same -// d:%0N is start date -// d:%1N is end date -// d:%2U is start time -// d:%3U is end time -// l:none -// r:TB9.1 -// -#define qtn_meet_req_response_editor_prefilled2 "Propose new time: %0N-%1N %2U-%3U" - -// d:Softkey text to send the response -// l:control_pane_t1/opt7 -// r:TB9.1 +// d: Softkey text to send the response +// l: control_pane_t1/opt7 +// r: TB9.1 // #define qtn_meet_req_softkey_send "Send" -// d:Command in options menu, changes the meeting request viewer to editing mode -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Command in options menu, changes the meeting request viewer to editing mode +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_edit "Edit" -// d:Meeting request viewer "From" field label -// l:fscal_mr_field_label_text -// r:TB9.1 +// d: Meeting request viewer "From" field label +// l: fscal_mr_field_label_text +// r: TB9.1 // #define qtn_meet_req_label_from "From" -// d:Meeting request viewer "Required" field text in case there is more than three participants -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Meeting request viewer "Required" field text in case there is more than three participants +// l: fscal_editor_field_text_1 +// r: TB9.1 // #define qtn_meet_req_show_all "Show all" -// d:Actions Menu item, opens the link within the device browser -// l:fs_action_menu_text -// r:TB9.1 +// d: Actions Menu item, opens the link within the device browser +// l: fs_action_menu_text +// r: TB9.1 // #define qtn_meet_req_viewer_options_open_in_web "Open in web" -// d:Actions Menu item, opens the link within the device browser through the intranet -// l:fs_action_menu_text -// r:TB9.1 +// d: Actions Menu item, opens the link within the device browser through the intranet +// l: fs_action_menu_text +// r: TB9.1 // #define qtn_meet_req_fsoptions_open_in_intra "Open in intranet" -// d:Actions Menu item, adds the highlighted link to the Bookmark list within the device -// l:fs_action_menu_text -// r:TB9.1 +// d: Actions Menu item, adds the highlighted link to the Bookmark list within the device +// l: fs_action_menu_text +// r: TB9.1 // #define qtn_meet_req_viewer_options_bookmark "Bookmark" -// d:Popup query for bookmark name label -// l:popup_query_data_window -// r:TB9.1 -// -#define qtn_meet_req_enter_bookmark_name "Enter bookmark name" - -// d:Popup query for bookmark name default text -// l:query_popup_data_pane_t1/opt4 -// r:TB9.1 -// -#define qtn_meet_req_default_bookmark "Bookmark" - -// d:Confirmation note text shown when user confirms popup query for bookmark name -// l:popup_note_window/opt2 -// r:TB9.1 -// -#define qtn_meet_req_bookmark_saved "Bookmark saved" - -// d:options menu item in response editor for cancelling -// d:and closing the dialog -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_opt_cancel "Cancel" - -// d:Options menu command, opens response query with "Accept" heading -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu command, opens response query with "Accept" heading +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_accept "Accept" -// d:Options menu command, opens response query with "Tentative" heading -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu command, opens response query with "Tentative" heading +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_tentative "Tentative" -// d:Options menu command, opens response query with "Decline" heading -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu command, opens response query with "Decline" heading +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_decline "Decline" -// d:Options menu command, opens the email editor with the sender displayed in the Required field -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu command, opens the email editor with the sender displayed in the Required field +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_opt_reply "Reply" -// d:Options menu command, opens the email editor with the sender and all the other recipients displayed in the address field -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu command, opens the email editor with the sender and all the other recipients displayed in the address field +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_opt_reply_all "Reply to all" +#define qtn_meet_req_opt_reply_all "Reply all" -// d:Options menu command to forward a meeting request -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: Options menu command to forward a meeting request, opens submenu +// l: list_single_pane_t1_cp2/opt3 +// r: TB9.1 // #define qtn_meet_req_opt_forward "Forward" -// This is obsolete, at moment there's just the Forward option -// d:Option submenu item, opens meeting editor with fields pre-filled -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Option submenu item, opens meeting editor with fields pre-filled +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // -// #define qtn_meet_req_opt_meeting "As meeting" +#define qtn_meet_req_opt_meeting "As meeting" -// This is obsolete, at moment there's just the Forward option -// d:Sub menu item for forwarding meeting request as email message -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -// -// #define qtn_meet_req_opt_message "As message" - -// d:Option submenu item, opens email editor with fields pre-filled -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Option submenu item, opens email editor with fields pre-filled +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_opt_email "As e-mail" -// d:Options menu command, opens the actions submenu list -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: Options menu command, opens the actions submenu list +// l: list_single_pane_t1_cp2/opt3 +// r: TB9.1 // #define qtn_meet_req_opt_actions "Actions" -// d:Options menu command, opens tracking view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: Options menu command, opens tracking view +// l: list_single_pane_t1_cp2/opt3 +// r: TB9.1 // #define qtn_meet_req_opt_tracking "Tracking" -// d:Options menu command, opens Meeting details view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_opt_details "Meeting details" - -// d:Delete confirmation query heading -// l:heading_pane_t1 -// r:TB9.1 +// d: Delete confirmation query heading +// l: heading_pane_t1 +// r: TB9.1 // #define qtn_meet_req_recurrent_heading_delete "Delete" -// d:Delete confirmation query selection list item "Delete the series" -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Delete confirmation query selection list item "Delete the series" +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurrent_series_delete "Delete the series" -// d:Delete confirmation query selection list item "Delete this occurrence" -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Delete confirmation query selection list item "Delete this occurrence" +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_recurrent_this_occurrence_delete "Delete this occurrence" -// d:Confirmation query text for sending cancellation information for participants -// l:popup_note_window/opt2 -// r:TB9.1 +// d: Confirmation query text for sending cancellation information for participants +// l: popup_note_window/opt2 +// r: TB9.1 // -#define qtn_meet_req_send_cancellation_query "Send cancellation information to participants?" - -// d:Tracking view control bar text in case of both subject and location are missing -// l:fscal_tracking_view_text_1 -// r:TB9.1 -// -#define qtn_meet_req_title_unnamed "Unnamed" +#define qtn_meet_req_send_cancellation_query "Send cancellation information for participants?" -// d:Tracking view main pane label for required attendees -// l:fscal_tracking_view_text_1 -// r:TB9.1 -// -#define qtn_meet_req_tracking_required_label "Required participants:" - -// d:Tracking view main pane label for optional attendees -// l:fscal_tracking_view_text_1 -// r:TB9.1 -// -#define qtn_meet_req_tracking_optional_label "Optional participants:" - -// d:Softkey text to call -// l:control_pane_t3/opt7 -// r:TB9.1 +// d: Softkey text to call +// l: control_pane_t3/opt7 +// r: TB9.1 // #define text_softkey_msk_call "Call" -// d:Schedulig view Meeting details main pane first line label in case of both title and location are missing -// l:fscal_scheduling_view_text_1 -// r:TB9.1 -// -#define qtn_meet_req_propose_unnamed "Unnamed" - -// d:Schedulig view Meeting details main pane "All attendees" label -// l:fscal_scheduling_view_text_2 -// r:TB9.1 -// -#define qtn_meet_req_scheduling_sum "All partic." - -// d:Options menu command, shows the free time of attendees in Schedulig view Attendees calendar details main pane -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_scheduling_opt_free "Show free time" - -// d:Middle softkey text, saves changes done in Scheduling view -// l:control_pane_t3/opt7 -// r:TB9.1 -// -#define text_softkey_msk_done "Done" - -// d:Options menu command, saves changes done in Scheduling view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_opt_done "Done" - -// d:Options menu command, opens Contacts Markable list view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_scheduling_add "Add new participants" - -// d:Options menu command for deleting selected participant -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_scheduling_delete "Delete participants" - -// d:Options menu command for adding optional participants into the Scheduling view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_schedulig_show_opt "Show optional particip." - -// d:Options menu command for hiding optional participants in the Scheduling view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_scheduling_hide_opt "Hide optional particip." - -// d:Options menu command for hiding free time hours in the Scheduling view -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_scheduling_hide_free "Hide free time" - -// d:Options menu command, opens Calendar settings -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_opt_settings "Settings" - -// d:The beginning of subject field in updated meeting in Calendar -// l:none -// r:TB9.1 -// -#define qtn_meet_req_label_updated "Updated" - -// d:The beginning of subject field in cancellation message -// l:none -// r:TB9.1 -// -#define qtn_meet_req_label_cancelled "Cancelled" - -// d:Send update heading text for send update list query -// l:heading_pane_t1 -// r:TB9.1 +// d: Send update heading text for send update list query +// l: heading_pane_t1 +// r: TB9.1 // #define qtn_meet_req_send_update_query "Send update:" -// d:List item text for send update to all participants -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: List item text for send update to all participants +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_send_update_all_query "To all part. in addr. field" - -// d:List item text for send update to added and removed participants -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_send_update_updated_query "Added or removed part." +#define qtn_meet_req_send_update_all_query "To all attendees" -// d:Plain text format subject line -// l:none -// r:TB9.1 +// d: List item text for send update to added and removed participants +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -#define qtn_meet_req_plain_text_subject "Subject:" +#define qtn_meet_req_send_update_updated_query "To new attendees only" -// d:Plain text format location line -// l:none -// r:TB9.1 +// d: Subject line beginning, when MR is accepted +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // -#define qtn_meet_req_plain_text_location "Location:" - -// d:Plain text format start time line -// l:none -// r:TB9.1 -// -#define qtn_meet_req_plain_text_start_time "Start time:" +#define qtn_meet_req_plain_text_accepted "Has accepted" -// d:Plain text format end time line -// l:none -// r:TB9.1 -// -#define qtn_meet_req_plain_text_end_time "End time:" - -// d:Plain text format description line -// l:none -// r:TB9.1 -// -#define qtn_meet_req_plain_text_description "Description:" - -// d:Subject line beginning, when MR is accepted -// l:none -// r:TB9.1 +// d: Subject line beginning, when MR is tentatively accepted +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // -#define qtn_meet_req_plain_text_accepted "Has accepted:" - -// d:Subject line beginning, when MR is tentatively accepted -// l:none -// r:TB9.1 -// -#define qtn_meet_req_plain_text_tentative "Has tentatively accepted:" +#define qtn_meet_req_plain_text_tentative "Has tentatively accepted" -// d:Subject line beginning, when MR is declined -// l:none -// r:TB9.1 +// d: Subject line beginning, when MR is declined +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // -#define qtn_meet_req_plain_text_declined "Has declined:" +#define qtn_meet_req_plain_text_declined "Has declined" -// d:Subject line beginning, when sending plain text version for meeting request update -// l:none -// r:TB9.1 +// d: Subject line beginning, when sending plain text version for meeting request update +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // #define qtn_meet_req_plain_text_update "Update:" -// d:Subject line beginning, when sending plain text version for meeting request cancellation -// l:none -// r:TB9.1 +// d: Subject line beginning, when sending plain text version for meeting request cancellation +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // #define qtn_meet_req_plain_text_cancelled "Cancelled:" -// d:Subject line beginning, when sending plain text version for meeting request forwarding -// l:none -// r:TB9.1 +// d: Subject line beginning, when sending plain text version for meeting request forwarding +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // -#define qtn_meet_req_plain_text_forwarded "FW:" +#define qtn_meet_req_plain_text_forwarded "Fw:" -// d:Subject line beginning, when sending plain text version for meeting request forwarding -// l:none -// r:TB9.1 +// d: Subject line beginning, when sending plain text version for meeting request forwarding +// d: No layout data required, this goes directly to MR response email +// l: none +// r: TB9.1 // #define qtn_meet_req_viewer_subject_prefix_repl "RE:" -// d:Confirmation query text for removing an appointment from calendar -// l:popup_note_window/opt2 -// r:TB9.1 +// d: Confirmation query text for removing an appointment from calendar +// l: popup_note_window/opt2 +// r: TB9.1 // #define qtn_meet_req_remove_appointment_query "Remove appointment from calendar?" -// d:Confirmation query text for sending decline message to organizer -// l:popup_note_window/opt2 -// r:TB9.1 +// d: Confirmation query text for sending decline message to organizer +// l: popup_note_window/opt2 +// r: TB9.1 // -#define qtn_meet_req_decline_query "Send decline message to organiser?" - -// d:Subject line beginning, when MR is forwarded -// l:none -// r:TB9.1 -// -#define qtn_meet_req_label_fw "FW:" +#define qtn_meet_req_decline_query "Send decline message to the organizer?" -// d:Error note text for corrupted meeting request -// l:popup_note_window -// r:TB9.1 +// d: Error note text for corrupted meeting request +// l: popup_note_window +// r: TB9.1 // -#define qtn_meet_req_corrupted_note "Meeting request corrupted" +#define qtn_meet_req_corrupted_note "Meeting request is corrupted" -// d:Meeting editor error note -// d:Shown when setting repeat -// l:popup_note_window -// r:TB9.1 +// d: Meeting editor error note +// d: Shown when setting repeat +// l: popup_note_window +// r: TB9.1 // -#define qtn_meet_req_info_start_end_date "Repeat option valid only when entry has same start and end date" +#define qtn_meet_req_info_start_end_date "Because of repeated note the end date has to be the same as the start date" -// d:Error prompt for alarm time has been set later than current time -// l:popup_note_window -// r:TB9.1 +// d: Error prompt for alarm time has been set later than current time +// l: popup_note_window +// r: TB9.1 // #define qtn_calendar_alarm_passed "Alarm already passed" -// d:Error prompt for alarm time has been set too early before event start time -// l:popup_note_window -// r:TB9.1 +// d: Error prompt for alarm time has been set too early before event start time +// l: popup_note_window +// r: TB9.1 // -#define qtn_calendar_alarm_difference "Alarm set for more than 1 month earlier than entry starts" +#define qtn_calendar_alarm_difference "Alarm difference is more than month" -// d:Options menu item for deleting an entry -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_options_delete "Delete" - -// d:Confirmation prompt for updating start date on repeat note. -// l:popup_note_window -// r:TB9.1 +// d: Confirmation prompt for updating start date on repeat note. +// l: popup_note_window +// r: TB9.1 // #define qtn_meet_req_quest_change_start_day "Change start date of repeated entry?" -// d:Attachment query -// l:popup_note_window -// r:TB9.1 -// -#define qtn_meet_req_note_attachments "Responding will discard any unsaved attachments. Continue anyway?" - -// d:Top Ribbon mark in 24h clock -// l:none -// r:TB9.1 -// -#define qtn_meet_req_ribbon_00 "00" - -// d:Top Ribbon mark in 12h clock -// l:none -// r:TB9.1 -// -#define qtn_meet_req_ribbon_am "a.m." - -// d:Middle Ribbon mark in 24h clock -// l:none -// r:TB9.1 -// -#define qtn_meet_req_ribbon_12 "12" - -// d:Bottom Ribbon mark in 24h clock -// l:none -// r:TB9.1 -// -#define qtn_meet_req_ribbon_24 "24" - -// d:Bottom Ribbon mark in 12h clock -// l:none -// r:TB9.1 -// -#define qtn_meet_req_ribbon_pm "p.m." - -// d:Actions Menu item, initiates a call to the highlighted phone number -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_actions_call "Call" - -// d:Actions Menu item, adds the corresponding information to Contacts -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_actions_add_to_contacts "Add to Contacts" - -// d:List query item, initiates addition of highlighted recipient/attendee to Contacts -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Attachment query +// l: popup_note_window +// r: TB9.1 // -#define qtn_meet_req_actions_add_to_contacts_create_new "Create new" - -// d:List query item, initiates update to existing contact for the highlighted recipient/attendee -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_actions_add_to_contacts_update_existing "Update existing" - -// d:Actions Menu item, opens the corresponding editor based on the List query item the user selects -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_actions_create_message "Create message" - -// d:List query item, text message -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_actions_text_message "Text message" - -// d:List query item, multimedia message -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_actions_multimedia_message "Multimedia message" +#define qtn_meet_req_note_attachments "Attachment(s) will not be saved in the phone calendar. Save attachment(s) separately?" -// d:List query item, voice message -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_meet_req_actions_voice_message "Voice message" - -// d:Actions Menu item, initiates a remote address search for the contact to potentially retrieve additional contact details -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_actions_remote_lookup "Search from rem." - -// d:Actions Menu item, opens the contact within the Contacts application -// l:fs_action_menu_text -// r:TB9.1 -// -#define qtn_meet_req_actions_contact_details "Contact details" - -// d:Options menu item for mr viewer more submenu -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_meet_req_options_more "More" - -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_mark_unread_msg "Mark as unread" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_mark_read_msg "Mark as read" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_delete_msg "Delete" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_move_msg "Move message" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_copy_msg "Copy message" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_flag_msg "Flag message" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_compose_msg "Create message" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_msg_details "Meeting details" -// d:Options menu item for mr viewer xxx command -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for mr viewer xxx command +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_download_mgr "Download manager" -// d:Options menu item for move to drafts message -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item for move to drafts message +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_options_move_to_drafts_msg "Move to Drafts" -// d:Options menu item for previous message -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu item for previous message +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_options_next_msg "Next message" -// d:Options menu item for next message -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu item for next message +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_options_prev_msg "Previous message" -// d:Options menu item for removing cancelled entry -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: Options menu item for removing cancelled entry +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_meet_req_options_remove_from_cal "Remove from calendar" -// d:To-do editor and to-do viewer title pane -// l:title_pane_t2/opt9 -// r:TB9.1 +// d: To-do editor and to-do viewer title pane +// l: title_pane_t2/opt9 +// r: TB9.1 // #define qtn_calendar_title_todo "To-do" -// d:To-do editor control bar text -// l:fscal_editor_control_bar_text -// r:TB9.1 +// d: To-do editor control bar text +// l: fscal_editor_control_bar_text +// r: TB9.1 // #define qtn_calendar_title_new_todo "New to-do" -// d:To-do editor, To-do viewer, meeting editor, meeting viewer, memo editor, memo viewer, anniversary editor and -// d:anniversary viewer control bar additional text (in case there is no subject) -// l:fscal_editor_control_bar_text -// r:TB9.1 -// -#define qtn_calendar_title_unnamed "Unnamed" - -// d:To-do editor default text in subject field -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_todo_type_subj "(Enter subject)" - -// d:To-do editor and anniversry editor alarm field "off" value -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_task_alarm_off "Off" - -// d:To-do editor and anniversry editor alarm field "on" value -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_task_alarm_on "On" - -// d:To-do editor priority field "high" value -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: To-do editor priority field "high" value +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_calendar_task_priority_high "High" -// d:To-do editor priority field "normal" value -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: To-do editor priority field "normal" value +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_calendar_task_priority_normal "Normal" -// d:To-do editor priority field "low" value -// l:list_single_pane_t1_cp2 -// r:TB9.1 +// d: To-do editor priority field "low" value +// l: list_single_pane_t1_cp2 +// r: TB9.1 // #define qtn_calendar_task_priority_low "Low" -// d:To-do editor, memo editor and anniversary editor text editor field default text -// l:fscal_editor_field_text_2 -// r:TB9.1 -// -#define qtn_calendar_todo_type_description "(Enter description)" - -// d:Meeting,To-do, memo and anniversary editors Synchronization popup list title -// l:heading_pane_t1 -// r:TB9.1 +// d: Meeting,To-do, memo and anniversary editors Synchronization popup list title +// l: heading_pane_t1 +// r: TB9.1 // #define qtn_calendar_task_sync_title "Synchronisation" -// d:Menu option, sends To-do, meeting, memo or anniversary -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: All event editors Event type popup list title +// l: heading_pane_t1 +// r: TB9.1 // -#define qtn_calendar_opt_send "Send" +#define qtn_calendar_task_unified_title "Event type" -// d:Menu option for marking To-do done -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: All event editors Event type popup list title +// l: heading_pane_t1 +// r: TB9.1 +// +#define qtn_calendar_task_calendar_title "Save to calendar" + +// d: Menu option for marking To-do done +// l: list_single_pane_t1_cp2/opt3 +// r: TB9.1 // #define qtn_calendar_opt_mark_done "Mark as done" -// d:Menu option for marking To-do not done -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 +// d: Menu option for marking To-do not done +// l: list_single_pane_t1_cp2/opt3 +// r: TB9.1 // #define qtn_calendar_opt_mark_not_done "Mark as not done" -// d:Options menu item for deleting calendar entry -// l:list_single_pane_t1_cp2/opt3 -// r:TB9.1 -// -#define qtn_calendar_opt_delete "Delete entry" - -// d:Options menu sub item for high priority -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu sub item for high priority +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_calendar_meeting_opt_priority_high "High" -// d:Options menu sub item for low priority -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu sub item for low priority +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_calendar_meeting_opt_priority_low "Low" -// d:Options menu sub item for normal priority -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu sub item for normal priority +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_calendar_meeting_opt_priority_normal "Normal" -// d:Meeting editor and meeting viewer title pane -// l:title_pane_t2/opt9 -// r:TB9.1 +// d: Meeting editor and meeting viewer title pane +// l: title_pane_t2/opt9 +// r: TB9.1 // #define qtn_calendar_title_meeting "Meeting" -// d:Meeting editor control bar text -// l:fscal_editor_control_bar_text -// r:TB9.1 -// -#define qtn_calendar_meeting_title "New meeting" - -// d:Meeting editor default text in subject field -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_meeting_subject_field "(Enter subject)" - -// d:Meeting editor and meeting viewer all day event text -// l:fscal_editor_all_day_text -// r:TB9.1 -// -#define qtn_calendar_all_day_event "All-day event" - -// d:Meeting editor default text in location field -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_meeting_location_field "(Enter location)" - -// d:Meeting editor alarm popup setting list "off" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_off "Off" - -// d:Meeting editor alarm popup setting list "0 minutes vefore" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_zero_minutes "0 minutes before" - -// d:Meeting editor alarm popup setting list "%N minutes before" option -// d:%N is the number of minutes -// d:Values for %N are: 5, 15, 30 -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_minutes "%N minutes before" - -// d:Meeting editor alarm popup setting list "%N hour" option -// d:%N is the number of hours -// d:Value for %N: 1 -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_hour "%N hour" - -// d:Meeting editor alarm popup setting list "%N hours" option -// d:%N is the number of hours -// d:Values for %N: 2, 3, 4, 5, 6, 7, 8, 12 -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_hours "%N hours" - -// d:Meeting editor alarm popup setting list "1 day" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_one_day "1 day" - -// d:Meeting editor alarm popup setting list "%N days" option -// d:%N is the number of days -// d:Values for %N: 2 -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_days "%N days" - -// d:Meeting editor alarm popup setting list "1 week" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_alarm_one_week "1 week" - -// d:Meeting editor recurrence popup setting list "Not repeated" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_recurring_not "Not repeated" - -// d:Meeting editor recurrence popup setting list "Daily" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_recurring_daily "Daily" - -// d:Meeting editor recurrence popup setting list "Weekly" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_recurring_weekly "Weekly" - -// d:Meeting editor recurrence popup setting list "Every second week" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_recurring_sec_week "Fortnightly" - -// d:Meeting editor recurrence popup setting list "Monthly" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_recurring_monthly "Monthly" - -// d:Meeting editor recurrence popup setting list "Yearly" option -// l:list_single_pane_t1_cp2 -// r:TB9.1 -// -#define qtn_calendar_meeting_recurring_yearly "Yearly" - -// d:Meeting editor default text in description field -// l:fscal_editor_field_text_2 -// r:TB9.1 -// -#define qtn_calendar_meeting_details_field "(Enter details)" - -// d:Meeting viewer subject field text in case there is no subject -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_subject_unnamed "Unnamed" - -// d:Memo editor and memo viewer title pane -// l:title_pane_t2/opt9 -// r:TB9.1 +// d: Memo editor and memo viewer title pane +// l: title_pane_t2/opt9 +// r: TB9.1 // #define qtn_calendar_title_memo "Memo" -// d:Memo editor control bar text -// l:fscal_editor_control_bar_text -// r:TB9.1 +// d: Memo editor control bar text +// l: fscal_editor_control_bar_text +// r: TB9.1 // #define qtn_calendar_title_new_memo "New memo" -// d:Memo editor default text in subject field -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_calendar_memo_type_subj "(Enter subject)" - -// d:Anniversary editor and anniversary viewer title pane -// l:title_pane_t2/opt9 -// r:TB9.1 +// d: Anniversary editor and anniversary viewer title pane +// l: title_pane_t2/opt9 +// r: TB9.1 // #define qtn_calendar_title_anniversary "Anniversary" -// d:Anniversary editor control bar text -// l:fscal_editor_control_bar_text -// r:TB9.1 +// d: Anniversary editor control bar text +// l: fscal_editor_control_bar_text +// r: TB9.1 // #define qtn_calendar_title_new_anniversary "New anniversary" -// d:Anniversary editor text editor field default text -// l:fscal_editor_field_text_1 -// r:TB9.1 +// d: Anniversary editor text editor field default text +// l: fscal_editor_field_text_1 +// r: TB9.1 // #define qtn_calendar_anniversary_type_occasion "(Enter occasion)" -// d:Middle softkey text, when in field that consists of two option items changes the value to "on" -// l:control_pane_t3/opt7 -// r:TB9.1 -// -#define text_softkey_msk_on "On" - -// d:Middle softkey text, when in field that consists of two option items changes the value to "off" -// l:control_pane_t3/opt7 -// r:TB9.1 -// -#define text_softkey_msk_off "Off" - -// d:Middle softkey text, when in popup setting list confirms selection -// l:control_pane_t3/opt7 -// r:TB9.1 -// -#define text_softkey_msk_ok "OK" - -// d:Confirmation query for deleting selected entry -// l:popup_note_window -// r:TB9.1 -// -#define qtn_calendar_opt_delete_entry "Delete entry?" - -// d:Confirmation query for deleting To-do note (in case only one To-do is marked) -// l:popup_note_window -// r:TB9.1 -// -#define qtn_todo_quest_delete_note "Delete to-do note?" - -// d:Confirmation query for deleting To-do notes (in case of multiple marked To-dos) -// d:%N is the number of marked To-dos -// l:popup_note_window -// r:TB9.1 -// -#define qtn_todo_quest_delete_notes "Delete %N to-do notes?" - -// d:To-do editor information note -// l:popup_note_window -// r:TB9.1 -// -#define qtn_calendar_later_date "Alarm set for later than entry starts" - -// d:Meeting editor and memo editor information note -// d:Shown if user has defined the entry end time before start time -// l:popup_note_window -// r:TB9.1 -// -#define qtn_calendar_info_note_ends_before "Entry ends earlier than it starts" - -// d:Bookmark popup query (Bookmark item is selected from Action Menu) -// l:popup_query_data_window_t3/opt2 -// r:TB9.1 +// d: Bookmark popup query (Bookmark item is selected from Action Menu) +// l: popup_query_data_window_t3/opt2 +// r: TB9.1 // #define qtn_calendar_enter_bookmark_name "Bookmark name" -// d:Bookmark popup query text field default text -// l:query_popup_data_pane_t1/opt4 -// r:TB9.1 +// d: Bookmark popup query text field default text +// l: query_popup_data_pane_t1/opt4 +// r: TB9.1 // #define qtn_calendar_default_bookmark "Bookmark" -// d:Bookmark confirmation note -// l:popup_note_window -// r:TB9.1 +// d: Bookmark confirmation note +// l: popup_note_window +// r: TB9.1 // #define qtn_calendar_bookmark_saved "Bookmark saved" -// d:Shortcut setting information note -// l:popup_note_window -// r:TB9.1 -// -#define qtn_calendar_event_creation_note "Event creation by typing disabled" - -// d:Meeting, memo, anniversary and To-do editors confirmation note -// d:Shown when entry has been saved -// d:duplicated in calendar.loc -// l:popup_note_window -// r:TB9.1 +// d: Meeting, memo, anniversary and To-do editors confirmation note +// d: Shown when entry has been saved +// d: duplicated in calendar.loc +// l: popup_note_window +// r: TB9.1 // #define text_calendar_note_saved "Note saved" -// d:Meeting editor confirmation note -// d:Shown when entry has been saved from the Option menu -// l:popup_note_window -// r:TB9.1 +// d: Meeting editor confirmation note +// d: Shown when entry has been saved from the Option menu +// l: popup_note_window +// r: TB9.1 // -#define qtn_meet_req_note_saved "Calendar entry saved" +#define qtn_meet_req_note_saved "Note saved" -// d:To-do editor confirmation note -// d:Shown when entry has been saved from the Option menu -// l:popup_note_window -// r:TB9.1 +// d: To-do editor confirmation note +// d: Shown when entry has been saved from the Option menu +// l: popup_note_window +// r: TB9.1 // #define qtn_meet_req_todo_saved "To-do note saved" -// d:Meeting request viewer attachments field text, 1 attachment > 1Kb -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_fse_viewer_header_attachment "%0U %1N kB" - -// d:Meeting request viewer attachments field text, 1 attachment < 1Kb -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_fse_viewer_header_attachment_less_than_kb " %U < 1 kB" - -// d:Meeting request viewer attachments field text, >1 attachments > 1Kb -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_fse_viewer_header_attachments_total "Attachms. (%0N) %1N kB" - -// d:Meeting request viewer attachments field text, >1 attachments < 1Kb -// l:fscal_editor_field_text_1 -// r:TB9.1 -// -#define qtn_fse_viewer_header_attachments_less_than_kb "Attachmts. (%N) < 1 kB" - -//d:Submenu item -//l:list_single_popup_submenu_pane_t1 -//r:TB9.1 -// -//same as #define qtn_fse_viewer_options_add_to_contacts -#define qtn_meet_req_editor_options_add_to_contacts "Save to Contacts" - -//d:Selectable line text in popup selection list -//l:list_single_graphic_pane_t1_cp2 -//r:TB9.1 -// -#define qtn_meet_req_editor_options_add_to_contacts_create_new "Create new" - -//d:Selectable line text in popup selection list -//l:list_single_graphic_pane_t1_cp2 -//r:TB9.1 -// -#define qtn_meet_req_editor_options_add_to_contacts_update_existing "Update existing" - -//d:Confirmation query. Informs that phone number was not found and asks if search from remote should be started. -//l:popup_note_window -//r:TB9.1 -// -#define qtn_meet_req_editor_no_phone_number_found_search_server "No number found in contacts. Search on server?" - -//d:Information note. -//l:popup_note_window/opt2 -//r:TB9.1 -// -#define qtn_meet_req_editor_error_general_no_phone_number "No phone number available" - -//d:Query note for call sender functionality -//l:popup_note_window/opt2 -//r:TB9.1 -// -#define qtn_meet_req_editor_call_sender_query "Call sender?\n%U" - -//d:Call popup note -//l:popup_note_window/opt2 -//r:TB9.1 -// -#define qtn_meet_req_editor_call_hotspot_popup_note "Call?\n%U" - -//d:Upmost item in addressfield match popup list. For selecting Remote lookup server search -//l:fse_editor_field_text_1 -//r:TB9.1 +// d: Upmost item in addressfield match popup list. For selecting Remote lookup server search +// l: fse_editor_field_text_1 +// r: TB9.1 // #define qtn_meet_req_editor_address_list_remote_lookup_search "Search '%U' on server" -//d:mrui viewer options menu item for copying links to clipboard -//l:fse_editor_field_text_1 -//r:TB9.1 +// d: mrui viewer options menu item for copying links to clipboard +// l: fse_editor_field_text_1 +// r: TB9.1 // -#define qtn_meet_req_options_copy_to_clipboard "Copy to clipboard" +#define qtn_meet_req_options_copy_to_clipboard "Copy to clipboard" -// -// d:Option menu item available when one file is attached and downloaded. Opens the downloaded attachment. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// +// d: Option menu item available when one file is attached and downloaded. Opens the downloaded attachment. +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_viewer_options_attach_open "Open" -// d:Options menu item available when one file is attached and not yet downloaded. Initiates download to focused attachment. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item available when one file is attached and not yet downloaded. Initiates download to focused attachment. +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_viewer_options_attach_download "Download" -// d:Options menu item available when one file is attached. Initiates save to focused attachment. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item available when one file is attached. Initiates save to focused attachment. +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_viewer_options_attach_save "Save" -// d:Options menu item vailable when one file is attached and downloading is ongoing. Cancels ongoing download. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 -// -#define qtn_meet_req_viewer_options_attach_cancel_download "Cancel download" - -// d:Options menu item available when multiple files are attached. Displays the Attachment list view where files are listed under title dividers "not yet downloaded" and "downloaded" depending on the attachment status. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item available when multiple files are attached. Displays the Attachment list view where files are listed under title dividers "not yet downloaded" and "downloaded" depending on the attachment status. +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_viewer_options_attach_view_list "View list" -// d:Options menu item available when multiple files are attached. Initiates download all to files attached. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item available when multiple files are attached. Initiates download all to files attached. +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_viewer_options_attach_download_all "Download all" -// d:Options menu item available when multiple files are attached. Initiates save all to files attached. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 +// d: Options menu item available when multiple files are attached. Initiates save all to files attached. +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // #define qtn_meet_req_viewer_options_attach_save_all "Save all" -// d:Options menu item available when multiple files are attached and downloading is ongoing to multiple files. Cancels ongoing download. -// l:list_single_popup_submenu_pane_t1 -// r:TB9.1 // -#define qtn_meet_req_viewer_options_attach_cancel_all_downloads "Cancel all downloads" - -// d:Middle soft key label. Initiates download to focused attachment. -// l:control_pane_t3/opt7 -// r:TB9.1 -// -#define qtn_msk_download "Download" - -// d:Middle soft key label. Displays attachment list view. -// l:control_pane_t3/opt7 -// r:TB9.1 -// -#define qtn_msk_viewlist "View list" -// - -// Uncomment if location support is enabled. Otherwise remove. -// Change r: 3.2 => r:TB9.1 -// -// FOR LOCATION INTEGRATION +// FOR LOCATION INTEGRATION // -// Meeting / MR editor - -//d: Add location options menu item -//l: -//r: 3.2 -// -//#define qtn_meet_req_options_add_location "Add location" +// Meeting / MR editor -//d: Assign from map options menu item -//l: -//r: 3.2 +// d: Add location options menu item +// l: list_single_pane_t1_cp2 +// r: TB9.1 // -//#define qtn_meet_req_options_assign_from_map "Assign from Map" - -//d: Recent locations options menu item -//l: -//r: 3.2 -// -//#define qtn_meet_req_options_recent_locations "Recent locations" +#define qtn_meet_req_options_add_location "Add location" -//d: Landmarks options menu item -//l: -//r: 3.2 -// -//#define qtn_meet_req_options_landmarks "Landmarks" - -//d: Search from contacts options menu item -//l: -//r: 3.2 +// d: Assign from map options menu item +// l: list_single_popup_submenu_pane_t1 +// r: TB9.1 // -//#define qtn_meet_req_options_search_from_contacts "Search from contacts" +#define qtn_meet_req_options_assign_from_map "Nokia Maps" -//d: Assign from map context menu item in editor location field context menu -//l: -//r: 3.2 -// -//#define qtn_meet_req_ctx_assign_from_map "Assign from Map" - -//d: Search from contacts context menu item in editor location field context menu -//l: -//r: 3.2 +// d: Replace previous location query +// d: %U stands for previous location string +// l: popup_note_window +// r: TB9.1 // -//#define qtn_meet_req_ctx_search_from_contacts "Search from contacts" - -//d: Recent locations context menu item in editor location field context menu -//l: -//r: 3.2 -// -//#define qtn_meet_req_ctx_recent_locations "Recent locations" - -//d: Landmarks context menu item in editor location field context menu -//l: -//r: 3.2 -// -//#define qtn_meet_req_ctx_landmarks "Landmarks" - -//d: Replace previous location query -//d: %U stands for previous location string -//l: -//r: 3.2 -//#define qtn_meet_req_replace_previous_location "New location replaces previous\n\"%U\".\nReplace?" +#define qtn_meet_req_replace_previous_location "New location replaces previous '%U'. Replace?" -//d: Concatenate new location to previous. -//d: %0U stands for the previous location. -//d: %1U stands for the new location. -//l: -//r: 3.2 -//#define qtn_meet_req_new_location_format "%0U; %1U" +// d: Concatenate new location to previous. +// d: %0U stands for the previous location. +// d: %1U stands for the new location. +// d: Does not require specific layout. Uses the same layout as location field +// l: none +// r: TB9.1 +// +#define qtn_meet_req_new_location_format "%0U; %1U" -//d: Format for address that is returned from maps application -//d: %0U stands for the street address -//d: %1U stands for the city -//l: -//r: 3.2 +// d: Format for address that is returned from maps application +// d: %0U stands for the street address +// d: %1U stands for the city +// d: Does not require specific layout. Uses the same layout as location field +// l: none +// r: TB9.1 // -//#define qtn_meet_req_address_street_city "%0U, %1U" - -//d: Title of address selection query when contact has multiple addresses -//l: -//r: 3.2 -// -//#define qtn_meet_req_loc_address_selection_title "Select location:" - - - +#define qtn_meet_req_address_street_city "%0U, %1U" // Meeting / MR viewer -//d: Show on map options menu item -//l: -//r: 3.2 +// d: Show on map options menu item +// l: list_single_pane_t1_cp2 +// r: TB9.1 +// +#define qtn_meet_req_options_show_on_map "Show on Map" + +// d: Search from map options menu item +// l: list_single_pane_t1_cp2 +// r: TB9.1 +// +#define qtn_meet_req_options_search_from_map "Search from Map" + +// d: Show on map link text in description field +// l: fscal_editor_field_text_2 +// r: TB9.1 +// +#define qtn_meet_req_link_show_on_map "Show on Map" + +// d: Assign updated location from Map query +// l: popup_note_window +// r: TB9.1 +// +#define qtn_meet_req_assign_updated_location "Assign updated location from Map?" + +// d: Meeting request editor information note +// d: Shown if user tries to reschedule instance to same day with another instance +// l: popup_note_window +// r: TB9.1 // -//#define qtn_meet_req_options_show_on_map "Show on Map" +#define qtn_meet_req_reschedule_instance "Two occurences cannot be on the same day" + +// d: Meeting request editor information note +// d: Shown if user tries to reschedule instance earlier than recurrence starts +// l: popup_note_window +// r: TB9.1 +// +#define qtn_meet_req_instance_starts_earlier_than_series "Instance cannot start earlier than series" + +// d: Event editor field text +// d: Shown when user adds more than 1 attachments to the event +// l: fscal_editor_field_text_1 +// r: TB9.2 +#define qtn_meet_req_editor_header_attachments "Attachments (%N)" + +// d: Default text for attachment field +// l: fscal_editor_field_text_1 +// r: TB9.2 +// +#define qtn_meet_req_attachment_field "(Add attachment)" + +// d: Information note for displaying data type not supported in attachments +// l: popup_note_window +// r: TB9.2 +// +#define qtn_meet_req_info_cannot_open_attachment "Cannot open attachment" + +// d: Editor attachment context menu item Add attachment +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_add_attachment "Add attachment" -//d: Search from map options menu item -//l: -//r: 3.2 +// d: Viewer attachment context menu item Open attachment +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_open_attachment "Open" + +// d: Viewer attachment context menu item Save attachment +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_save_attachment "Save" + +// d: Viewer attachment context menu item Save all attachments +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_save_all_attachments "Save all" + +// d: Viewer attachment context menu item to cancel attachment download +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_cancel_attachment_download "Cancel download" + +// d: Wait note text during attachment handling, when attachment size less than mega byte +// l: popup_note_wait_window +// r: TB9.2 +// +#define qtn_meet_req_note_attachment_progress_kilobyte "%0U (%1N kB)" + +// d: Wait note text during attachment handling, when attachment size more than mega byte +// l: popup_note_wait_window +// r: TB9.2 // -//#define qtn_meet_req_options_search_from_map "Search from Map" +#define qtn_meet_req_note_attachment_progress_megabyte "%0U (%1N MB)" + +//d: Info note, when try to attach the same file. +//l: popup_note_window +//w: +//r: 9.2 +#define qtn_meet_req_info_already_attached "File already attached" + +// d: Command in options menu +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_opt_save_close "Save and close" + +// d: Query text for note "attachments will be removed" in case if mailbox does not support attachments +// l: popup_note_window +// r: TB9.2 +// +#define qtn_meet_req_note_attachments_not_supported "Attachments cannot be sent with a meeting request. Continue anyway?" + +// d: Confirmation query text for deleting calendar entry (everything except MR) +// l: popup_note_window/opt2 +// r: TB9.2 +// +#define qtn_meet_req_delete_query "Delete?" + +// d: Selection query heading for selecting attachment type +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_query_heading_select_attachment_type "Select attachment type" + +// d: Attachment type selection query text: image +// l: cell_tb_ext_pane_t1/opt1 +// r: TB9.2 +// +#define qtn_meet_req_attachment_type_image "Image" -//d: Show on map context menu item in viewer location field context menu -//l: -//r: 3.2 +// d: Attachment type selection query text: video +// l: cell_tb_ext_pane_t1/opt1 +// r: TB9.2 +// +#define qtn_meet_req_attachment_type_video "Video clip" + +// d: Attachment type selection query text: sound clip +// l: cell_tb_ext_pane_t1/opt1 +// r: TB9.2 +// +#define qtn_meet_req_attachment_type_soundclip "Sound clip" + +// d: Attachment type selection query text: note +// l: cell_tb_ext_pane_t1/opt1 +// r: TB9.2 +// +#define qtn_meet_req_attachment_type_note "Note" + +// d: Attachment type selection query text: other +// l: cell_tb_ext_pane_t1/opt1 +// r: TB9.2 +// +#define qtn_meet_req_attachment_type_other "Other" + +// d: My Locations options menu item +// l: list_single_popup_submenu_pane_t1 +// r: TB9.2 // -//#define qtn_meet_req_ctx_show_on_map "Show on Map" +#define qtn_meet_req_options_my_locations "My Locations" + +// d: Toolbar help text for accepting meeting +// l: popup_preview_text_window_t1 +// r: TB9.2 +// +#define qtn_meet_req_toolbar_hlp_accept "Accept" + +// d: Toolbar help text for tentatively accepting meeting +// l: popup_preview_text_window_t1 +// r: TB9.2 +// +#define qtn_meet_req_toolbar_hlp_tentative "Tentative" + +// d: Toolbar help text for declining meeting +// l: popup_preview_text_window_t1 +// r: TB9.2 +// +#define qtn_meet_req_toolbar_hlp_decline "Decline" + +// d: Download status item in the meeting request viewer +// d: %0U stands for the percent of attachment file which has been downloaded. +// d: %1U stands for the name of the attachment +// l: list_single_cmail_header_detail_pane_t1 +// r: TB9.2 +// +#define qtn_meet_req_attachments_download_prefix "%0N% %1U" + +// d: Locked field notify string +// l: popup_note_window +// r: TB9.2 +// +#define qtn_meet_req_info_field_locked "Unable to edit" -//d: Search from map context menu item in viewer location field context menu -//l: -//r: 3.2 +// d: One attachment saved info note +// l: popup_note_window/opt2 +// r: TB9.2 +// +#define qtn_meet_req_info_note_one_attachment_saved "Attachment saved" + +// d: Multiple attachment saved info note +// l: popup_note_window/opt2 +// r: TB9.2 +// +#define qtn_meet_req_info_note_multiple_attachments_saved "%N attachments saved" + +// d: Warning note when edit singal instance of one series +// l: popup_note_window/opt2 +// r: TB9.2 // -//#define qtn_meet_req_ctx_search_from_map "Search from Map" +#define qtn_meet_req_instance_out_of_sequence "Unable to move a meeting out of sequence" + +// d: Warning note when edit singal instance of one series +// l: popup_note_window/opt2 +// r: TB9.2 +// +#define qtn_meet_req_instance_already_exists_on_this_day "Two occurences of the meeting cannot occur on the same day" + +// d: Warning note when edit singal instance of one series +// l: popup_note_window/opt2 +// r: TB9.2 +// +#define qtn_meet_req_instance_overlaps_existing_instance "Meeting cannot overlap another instance of itself" + +// d: Attachment file name link text in attachment field +// l: fscal_editor_field_text_2 +// r: TB9.2 +// +#define qtn_meet_req_attachment_file_kilobyte "%0U (%1N kB)" -//d: Show on map link text in description field -//l: -//r: 3.2 +// d: Attachment file name link text in attachment field when file size is over 1MB +// l: fscal_editor_field_text_2 +// r: TB9.2 +// +#define qtn_meet_req_attachment_file_megabyte "%0U (%1N MB)" + +// d: Editor attendees context menu item add attendees. +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_add_attendees_from_contacts "Add from Contacts" + +// d: Attachment file name link text in attachment field when file size is under 1kB +// l: fscal_editor_field_text_2 +// r: TB9.2 // -//#define qtn_meet_req_link_show_on_map "Show on map" -// +#define qtn_meet_req_attachment_file_less_than_kilobyte "%0U (< 1 kB)" + +// d: Heading text for forwarding this occurence or series list popup query +// l: heading_pane_t1 +// r: TB9.2 +// +#define qtn_meet_req_recurrent_heading_forward "Forward" + +// d: Forward this occurance popup setting list item text +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_recurrent_fw_this_occurrence "Forward this occurrence" + +// d: Forward the series popup setting list item text +// l: list_single_pane_t1_cp2 +// r: TB9.2 +// +#define qtn_meet_req_fw_recurrent_series "Forward the series" + // end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/bwins/esmrfieldbuildercommonu.def --- a/meetingrequest/mrgui/mrfieldbuildercommon/bwins/esmrfieldbuildercommonu.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/bwins/esmrfieldbuildercommonu.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,128 +1,120 @@ EXPORTS ?InsertLinkL@CESMRRichTextViewer@@QAEXPAVCESMRRichTextLink@@H@Z @ 1 NONAME ; void CESMRRichTextViewer::InsertLinkL(class CESMRRichTextLink *, int) ??1CMRBackground@@UAE@XZ @ 2 NONAME ; CMRBackground::~CMRBackground(void) - ?RowHeight@CESMRRichTextViewer@@QAEHXZ @ 3 NONAME ; int CESMRRichTextViewer::RowHeight(void) - ?ConstructL@CESMRIconField@@IAEXVTAknsItemID@@PAVCCoeControl@@W4TESMRFieldFocusType@@@Z @ 4 NONAME ; void CESMRIconField::ConstructL(class TAknsItemID, class CCoeControl *, enum TESMRFieldFocusType) + ?LatestOperationResult@CMRAttachmentUi@@QAE?AVTAttachmentOpResult@@XZ @ 3 NONAME ; class TAttachmentOpResult CMRAttachmentUi::LatestOperationResult(void) + ?RowHeight@CESMRRichTextViewer@@QAEHXZ @ 4 NONAME ; int CESMRRichTextViewer::RowHeight(void) ?SetListObserver@CESMRRichTextViewer@@QAEXPAVMESMRListObserver@@@Z @ 5 NONAME ; void CESMRRichTextViewer::SetListObserver(class MESMRListObserver *) ?RestoreMiddleSoftKeyL@CESMRField@@IAEXXZ @ 6 NONAME ; void CESMRField::RestoreMiddleSoftKeyL(void) - ?InitializeL@CESMRField@@UAEXXZ @ 7 NONAME ; void CESMRField::InitializeL(void) - ?HasFocus@CESMRBorderLayer@@QBEHXZ @ 8 NONAME ; int CESMRBorderLayer::HasFocus(void) const - ?Draw@CMRBackground@@MBEXAAVCWindowGc@@ABVCCoeControl@@ABVTRect@@@Z @ 9 NONAME ; void CMRBackground::Draw(class CWindowGc &, class CCoeControl const &, class TRect const &) const - ?GetSelectedLink@CESMRRichTextViewer@@QBEPBVCESMRRichTextLink@@XZ @ 10 NONAME ; class CESMRRichTextLink const * CESMRRichTextViewer::GetSelectedLink(void) const - ?FocusChanged@CESMRRichTextViewer@@UAEXW4TDrawNow@@@Z @ 11 NONAME ; void CESMRRichTextViewer::FocusChanged(enum TDrawNow) - ?SetFontL@CESMREditor@@QAEXPBVCFont@@PAVCESMRLayoutManager@@@Z @ 12 NONAME ; void CESMREditor::SetFontL(class CFont const *, class CESMRLayoutManager *) - ?NewL@CMRBackground@@SAPAV1@AAVCESMRLayoutManager@@@Z @ 13 NONAME ; class CMRBackground * CMRBackground::NewL(class CESMRLayoutManager &) - ??1CESMREditor@@UAE@XZ @ 14 NONAME ; CESMREditor::~CESMREditor(void) - ?NewL@CESMRRichTextViewer@@SAPAV1@PBVCCoeControl@@@Z @ 15 NONAME ; class CESMRRichTextViewer * CESMRRichTextViewer::NewL(class CCoeControl const *) - ?SetListObserver@CESMRField@@UAEXPAVMESMRListObserver@@@Z @ 16 NONAME ; void CESMRField::SetListObserver(class MESMRListObserver *) - ?SetFocusRect@CESMRField@@QAEXABVTRect@@@Z @ 17 NONAME ; void CESMRField::SetFocusRect(class TRect const &) - ?HasOutlineFocus@CESMRField@@QBEHXZ @ 18 NONAME ; int CESMRField::HasOutlineFocus(void) const - ??1CESMRIconField@@UAE@XZ @ 19 NONAME ; CESMRIconField::~CESMRIconField(void) - ?SetContainerWindowL@CESMRBorderLayer@@UAEXABVCCoeControl@@@Z @ 20 NONAME ; void CESMRBorderLayer::SetContainerWindowL(class CCoeControl const &) - ?RowHeight@CESMREditor@@QAEHXZ @ 21 NONAME ; int CESMREditor::RowHeight(void) - ?SetExpandable@CESMRField@@UAEXXZ @ 22 NONAME ; void CESMRField::SetExpandable(void) - ?NewLC@CESMRFieldCommandEvent@@SAPAV1@PAVMESMRFieldEventNotifier@@H@Z @ 23 NONAME ; class CESMRFieldCommandEvent * CESMRFieldCommandEvent::NewLC(class MESMRFieldEventNotifier *, int) - ?FocusChanged@CESMRViewerLabelField@@UAEXW4TDrawNow@@@Z @ 24 NONAME ; void CESMRViewerLabelField::FocusChanged(enum TDrawNow) + ?DynInitMenuPaneL@CESMRField@@UAEXHPAVCEikMenuPane@@@Z @ 7 NONAME ; void CESMRField::DynInitMenuPaneL(int, class CEikMenuPane *) + ?FieldMode@CESMRField@@QBE?AW4TESMRFieldMode@@XZ @ 8 NONAME ; enum TESMRFieldMode CESMRField::FieldMode(void) const + ?ConstructL@CESMRField@@QAEXPAVCCoeControl@@@Z @ 9 NONAME ; void CESMRField::ConstructL(class CCoeControl *) + ?ApplyLayoutChangesL@CESMRRichTextViewer@@QAEXXZ @ 10 NONAME ; void CESMRRichTextViewer::ApplyLayoutChangesL(void) + ?InitializeL@CESMRField@@UAEXXZ @ 11 NONAME ; void CESMRField::InitializeL(void) + ?Draw@CMRBackground@@MBEXAAVCWindowGc@@ABVCCoeControl@@ABVTRect@@@Z @ 12 NONAME ; void CMRBackground::Draw(class CWindowGc &, class CCoeControl const &, class TRect const &) const + ?GetSelectedLink@CESMRRichTextViewer@@QBEPBVCESMRRichTextLink@@XZ @ 13 NONAME ; class CESMRRichTextLink const * CESMRRichTextViewer::GetSelectedLink(void) const + ?FieldViewMode@CESMRField@@QBE?AW4TESMRFieldType@@XZ @ 14 NONAME ; enum TESMRFieldType CESMRField::FieldViewMode(void) const + ?FocusChanged@CESMRRichTextViewer@@UAEXW4TDrawNow@@@Z @ 15 NONAME ; void CESMRRichTextViewer::FocusChanged(enum TDrawNow) + ?HandlePointerEventL@CESMRField@@EAEXABUTPointerEvent@@@Z @ 16 NONAME ; void CESMRField::HandlePointerEventL(struct TPointerEvent const &) + ??1CESMREditor@@UAE@XZ @ 17 NONAME ; CESMREditor::~CESMREditor(void) + ?NewL@CESMRRichTextViewer@@SAPAV1@PBVCCoeControl@@@Z @ 18 NONAME ; class CESMRRichTextViewer * CESMRRichTextViewer::NewL(class CCoeControl const *) + ?SetListObserver@CESMRField@@UAEXPAVMESMRListObserver@@@Z @ 19 NONAME ; void CESMRField::SetListObserver(class MESMRListObserver *) + ?SetFocusRect@CESMRField@@QAEXABVTRect@@@Z @ 20 NONAME ; void CESMRField::SetFocusRect(class TRect const &) + ?HandleTactileFeedbackL@CESMRField@@IAEXXZ @ 21 NONAME ; void CESMRField::HandleTactileFeedbackL(void) + ?SetFocusLink@CESMRRichTextViewer@@QAEXH@Z @ 22 NONAME ; void CESMRRichTextViewer::SetFocusLink(int) + ?HasOutlineFocus@CESMRField@@QBEHXZ @ 23 NONAME ; int CESMRField::HasOutlineFocus(void) const + ?RowHeight@CESMREditor@@QAEHXZ @ 24 NONAME ; int CESMREditor::RowHeight(void) ?ComponentControl@CESMRField@@UBEPAVCCoeControl@@H@Z @ 25 NONAME ; class CCoeControl * CESMRField::ComponentControl(int) const - ?PositionChanged@CESMREditor@@UAEXXZ @ 26 NONAME ; void CESMREditor::PositionChanged(void) - ?NotifyEventL@CESMRField@@IAEXH@Z @ 27 NONAME ; void CESMRField::NotifyEventL(int) - ?NotifyEventL@CESMRField@@IAEXABVMESMRFieldEvent@@@Z @ 28 NONAME ; void CESMRField::NotifyEventL(class MESMRFieldEvent const &) - ?ComponentControl@CESMRBorderLayer@@UBEPAVCCoeControl@@H@Z @ 29 NONAME ; class CCoeControl * CESMRBorderLayer::ComponentControl(int) const - ?IconL@CESMRIconField@@UAEXVTAknsItemID@@@Z @ 30 NONAME ; void CESMRIconField::IconL(class TAknsItemID) + ?SetObserver@CMRAttachmentUi@@QAEXAAVMMRAttachmentUiObserver@@@Z @ 26 NONAME ; void CMRAttachmentUi::SetObserver(class MMRAttachmentUiObserver &) + ?PositionChanged@CESMREditor@@UAEXXZ @ 27 NONAME ; void CESMREditor::PositionChanged(void) + ?NotifyEventL@CESMRField@@IAEXH@Z @ 28 NONAME ; void CESMRField::NotifyEventL(int) + ?NotifyEventL@CESMRField@@IAEXABVMESMRFieldEvent@@@Z @ 29 NONAME ; void CESMRField::NotifyEventL(class MESMRFieldEvent const &) + ?ChangeMiddleSoftKeyL@CESMRField@@QAEXHH@Z @ 30 NONAME ; void CESMRField::ChangeMiddleSoftKeyL(int, int) ?Type@CESMRRichTextLink@@QBE?AW4TType@1@XZ @ 31 NONAME ; enum CESMRRichTextLink::TType CESMRRichTextLink::Type(void) const - ?SetFontL@CESMRRichTextViewer@@QAEXPBVCFont@@PAVCESMRLayoutManager@@@Z @ 32 NONAME ; void CESMRRichTextViewer::SetFontL(class CFont const *, class CESMRLayoutManager *) - ?NotifyEventAsyncL@CESMRField@@IAEXH@Z @ 33 NONAME ; void CESMRField::NotifyEventAsyncL(int) - ?OfferKeyEventL@CESMRBorderLayer@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 34 NONAME ; enum TKeyResponse CESMRBorderLayer::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - ??1CESMRViewerLabelField@@UAE@XZ @ 35 NONAME ; CESMRViewerLabelField::~CESMRViewerLabelField(void) - ?ExecuteGenericCommandL@CESMRField@@UAEXH@Z @ 36 NONAME ; void CESMRField::ExecuteGenericCommandL(int) - ?GetFocusRect@CESMRField@@QBE?AVTRect@@XZ @ 37 NONAME ; class TRect CESMRField::GetFocusRect(void) const - ?OfferKeyEventL@CESMRField@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 38 NONAME ; enum TKeyResponse CESMRField::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - ?ConstructL@CESMRViewerLabelField@@IAEXVTAknsItemID@@@Z @ 39 NONAME ; void CESMRViewerLabelField::ConstructL(class TAknsItemID) - ?IsExpandable@CESMRField@@UBEHXZ @ 40 NONAME ; int CESMRField::IsExpandable(void) const - ?InternalizeL@CESMRField@@UAEXAAVMESMRCalEntry@@@Z @ 41 NONAME ; void CESMRField::InternalizeL(class MESMRCalEntry &) - ?SetEventQueueL@CESMRField@@UAEXPAVMESMRFieldEventQueue@@@Z @ 42 NONAME ; void CESMRField::SetEventQueueL(class MESMRFieldEventQueue *) - ??1CESMRBorderLayer@@UAE@XZ @ 43 NONAME ; CESMRBorderLayer::~CESMRBorderLayer(void) - ?InitializeL@CESMRViewerLabelField@@UAEXXZ @ 44 NONAME ; void CESMRViewerLabelField::InitializeL(void) - ?ChangeMiddleSoftKeyL@CESMRField@@IAEXH@Z @ 45 NONAME ; void CESMRField::ChangeMiddleSoftKeyL(int) - ?SetLayoutManager@CESMRField@@UAEXPAVCESMRLayoutManager@@@Z @ 46 NONAME ; void CESMRField::SetLayoutManager(class CESMRLayoutManager *) - ?ClearSelectionAndSetTextL@CESMREditor@@QAEXABVTDesC16@@@Z @ 47 NONAME ; void CESMREditor::ClearSelectionAndSetTextL(class TDesC16 const &) - ?NewL@CESMRRichTextLink@@SAPAV1@HHABVTDesC16@@W4TType@1@W4TTriggerKey@1@@Z @ 48 NONAME ; class CESMRRichTextLink * CESMRRichTextLink::NewL(int, int, class TDesC16 const &, enum CESMRRichTextLink::TType, enum CESMRRichTextLink::TTriggerKey) - ?SetLinkObserver@CESMRRichTextViewer@@QAEXPAVMESMRRichTextObserver@@@Z @ 49 NONAME ; void CESMRRichTextViewer::SetLinkObserver(class MESMRRichTextObserver *) - ?OkToLoseFocusL@CESMRField@@UAEHW4TESMREntryFieldId@@@Z @ 50 NONAME ; int CESMRField::OkToLoseFocusL(enum TESMREntryFieldId) - ?MinimumSize@CESMRField@@UAE?AVTSize@@XZ @ 51 NONAME ; class TSize CESMRField::MinimumSize(void) - ??0CESMRField@@IAE@XZ @ 52 NONAME ; CESMRField::CESMRField(void) + ?NotifyEventAsyncL@CESMRField@@IAEXH@Z @ 32 NONAME ; void CESMRField::NotifyEventAsyncL(int) + ?SetValidatorL@CESMRField@@UAEXPAVMESMRFieldValidator@@@Z @ 33 NONAME ; void CESMRField::SetValidatorL(class MESMRFieldValidator *) + ?GetLinkTextLC@CESMRRichTextViewer@@QBEPAVHBufC16@@ABVCESMRRichTextLink@@@Z @ 34 NONAME ; class HBufC16 * CESMRRichTextViewer::GetLinkTextLC(class CESMRRichTextLink const &) const + ?GetFocusRect@CESMRField@@QBE?AVTRect@@XZ @ 35 NONAME ; class TRect CESMRField::GetFocusRect(void) const + ?OfferKeyEventL@CESMRField@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 36 NONAME ; enum TKeyResponse CESMRField::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) + ?LockL@CESMRField@@UAEXXZ @ 37 NONAME ; void CESMRField::LockL(void) + ?InternalizeL@CESMRField@@UAEXAAVMESMRCalEntry@@@Z @ 38 NONAME ; void CESMRField::InternalizeL(class MESMRCalEntry &) + ?SetEventQueueL@CESMRField@@UAEXPAVMESMRFieldEventQueue@@@Z @ 39 NONAME ; void CESMRField::SetEventQueueL(class MESMRFieldEventQueue *) + ?CurrentItemIndex@CESMRField@@QBEHXZ @ 40 NONAME ; int CESMRField::CurrentItemIndex(void) const + ?ChangeMiddleSoftKeyL@CESMRField@@IAEXH@Z @ 41 NONAME ; void CESMRField::ChangeMiddleSoftKeyL(int) + ?ClearSelectionAndSetTextL@CESMREditor@@QAEXABVTDesC16@@@Z @ 42 NONAME ; void CESMREditor::ClearSelectionAndSetTextL(class TDesC16 const &) + ?NewL@CESMRRichTextLink@@SAPAV1@HHABVTDesC16@@W4TType@1@W4TTriggerKey@1@@Z @ 43 NONAME ; class CESMRRichTextLink * CESMRRichTextLink::NewL(int, int, class TDesC16 const &, enum CESMRRichTextLink::TType, enum CESMRRichTextLink::TTriggerKey) + ?SetLinkObserver@CESMRRichTextViewer@@QAEXPAVMESMRRichTextObserver@@@Z @ 44 NONAME ; void CESMRRichTextViewer::SetLinkObserver(class MESMRRichTextObserver *) + ?OkToLoseFocusL@CESMRField@@UAEHW4TESMREntryFieldId@@@Z @ 45 NONAME ; int CESMRField::OkToLoseFocusL(enum TESMREntryFieldId) + ?SetFieldViewMode@CESMRField@@QAEXW4TESMRFieldType@@@Z @ 46 NONAME ; void CESMRField::SetFieldViewMode(enum TESMRFieldType) + ?MinimumSize@CESMRField@@UAE?AVTSize@@XZ @ 47 NONAME ; class TSize CESMRField::MinimumSize(void) + ?HandleLongtapEventL@CESMRField@@MAEXABVTPoint@@@Z @ 48 NONAME ; void CESMRField::HandleLongtapEventL(class TPoint const &) + ??0CESMRField@@IAE@XZ @ 49 NONAME ; CESMRField::CESMRField(void) + ?SetLineSpacingL@CESMRRichTextViewer@@QAEXH@Z @ 50 NONAME ; void CESMRRichTextViewer::SetLineSpacingL(int) + ?SetFontL@CESMREditor@@QAEXPBVCFont@@@Z @ 51 NONAME ; void CESMREditor::SetFontL(class CFont const *) + ?IsLocked@CESMRField@@QAEHXZ @ 52 NONAME ; int CESMRField::IsLocked(void) ?DefaultText@CESMREditor@@QAEABVTDesC16@@XZ @ 53 NONAME ; class TDesC16 const & CESMREditor::DefaultText(void) ?SetListObserver@CESMREditor@@QAEXPAVMESMRListObserver@@@Z @ 54 NONAME ; void CESMREditor::SetListObserver(class MESMRListObserver *) - ?ConstructL@CESMRField@@QAEXPAVCCoeControl@@W4TESMRFieldFocusType@@@Z @ 55 NONAME ; void CESMRField::ConstructL(class CCoeControl *, enum TESMRFieldFocusType) + ?LaunchFetchUi@CMRAttachmentUi@@QAEHAAVMESMRCalEntry@@@Z @ 55 NONAME ; int CMRAttachmentUi::LaunchFetchUi(class MESMRCalEntry &) ?SetOutlineFocusL@CESMRField@@UAEXH@Z @ 56 NONAME ; void CESMRField::SetOutlineFocusL(int) - ?NewL@CESMRFieldCommandEvent@@SAPAV1@PAVMESMRFieldEventNotifier@@H@Z @ 57 NONAME ; class CESMRFieldCommandEvent * CESMRFieldCommandEvent::NewL(class MESMRFieldEventNotifier *, int) - ??0CESMRIconField@@QAE@XZ @ 58 NONAME ; CESMRIconField::CESMRIconField(void) - ?SetLayoutManager@CESMRBorderLayer@@QAEXPAVCESMRLayoutManager@@@Z @ 59 NONAME ; void CESMRBorderLayer::SetLayoutManager(class CESMRLayoutManager *) - ?ExternalizeL@CESMRField@@UAEXAAVMESMRCalEntry@@@Z @ 60 NONAME ; void CESMRField::ExternalizeL(class MESMRCalEntry &) - ?FontChangedL@CESMRField@@UAEXXZ @ 61 NONAME ; void CESMRField::FontChangedL(void) - ?SizeChanged@CESMRField@@UAEXXZ @ 62 NONAME ; void CESMRField::SizeChanged(void) - ?CurrentLineNumber@CESMREditor@@QAEHXZ @ 63 NONAME ; int CESMREditor::CurrentLineNumber(void) - ?HandleFieldEventL@CESMRField@@MAEXABVMESMRFieldEvent@@@Z @ 64 NONAME ; void CESMRField::HandleFieldEventL(class MESMRFieldEvent const &) - ?CurrentLineNumber@CESMRRichTextViewer@@QAEHXZ @ 65 NONAME ; int CESMRRichTextViewer::CurrentLineNumber(void) - ?ExpandedHeight@CESMRField@@UBEHXZ @ 66 NONAME ; int CESMRField::ExpandedHeight(void) const - ?OfferKeyEventL@CESMRRichTextViewer@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 67 NONAME ; enum TKeyResponse CESMRRichTextViewer::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - ?ConstructL@CESMRBorderLayer@@AAEXXZ @ 68 NONAME ; void CESMRBorderLayer::ConstructL(void) - ?LineCount@CESMREditor@@QBEHXZ @ 69 NONAME ; int CESMREditor::LineCount(void) const - ?SetFocusType@CESMRField@@QAEXW4TESMRFieldFocusType@@@Z @ 70 NONAME ; void CESMRField::SetFocusType(enum TESMRFieldFocusType) - ?SetFieldId@CESMRField@@UAEXW4TESMREntryFieldId@@@Z @ 71 NONAME ; void CESMRField::SetFieldId(enum TESMREntryFieldId) - ?CopyCurrentLinkToClipBoardL@CESMRRichTextViewer@@QBEXXZ @ 72 NONAME ; void CESMRRichTextViewer::CopyCurrentLinkToClipBoardL(void) const - ?FocusChanged@CESMREditor@@UAEXW4TDrawNow@@@Z @ 73 NONAME ; void CESMREditor::FocusChanged(enum TDrawNow) - ?SetDefaultTextL@CESMREditor@@QAEXPAVHBufC16@@@Z @ 74 NONAME ; void CESMREditor::SetDefaultTextL(class HBufC16 *) - ?CountComponentControls@CESMRBorderLayer@@UBEHXZ @ 75 NONAME ; int CESMRBorderLayer::CountComponentControls(void) const - ?TriggerKey@CESMRRichTextLink@@QBE?AW4TTriggerKey@1@XZ @ 76 NONAME ; enum CESMRRichTextLink::TTriggerKey CESMRRichTextLink::TriggerKey(void) const - ?NewL@CESMRBorderLayer@@SAPAV1@PAVCCoeControl@@W4TESMRFieldFocusType@@@Z @ 77 NONAME ; class CESMRBorderLayer * CESMRBorderLayer::NewL(class CCoeControl *, enum TESMRFieldFocusType) - ?NewL@CESMRViewerLabelField@@SAPAV1@XZ @ 78 NONAME ; class CESMRViewerLabelField * CESMRViewerLabelField::NewL(void) - ?Draw@CESMRBorderLayer@@UBEXAAVCWindowGc@@ABVCCoeControl@@ABVTRect@@@Z @ 79 NONAME ; void CESMRBorderLayer::Draw(class CWindowGc &, class CCoeControl const &, class TRect const &) const - ??0CESMRViewerLabelField@@IAE@XZ @ 80 NONAME ; CESMRViewerLabelField::CESMRViewerLabelField(void) - ?ComponentControl@CESMRIconField@@UBEPAVCCoeControl@@H@Z @ 81 NONAME ; class CCoeControl * CESMRIconField::ComponentControl(int) const - ?CountComponentControls@CESMRField@@UBEHXZ @ 82 NONAME ; int CESMRField::CountComponentControls(void) const - ?LinkSelectedL@CESMRRichTextViewer@@QAEHXZ @ 83 NONAME ; int CESMRRichTextViewer::LinkSelectedL(void) - ?Value@CESMRRichTextLink@@QBEAAVTDesC16@@XZ @ 84 NONAME ; class TDesC16 & CESMRRichTextLink::Value(void) const - ?AddLinkL@CESMRRichTextViewer@@QAEXPAVCESMRRichTextLink@@@Z @ 85 NONAME ; void CESMRRichTextViewer::AddLinkL(class CESMRRichTextLink *) - ?StartPos@CESMRRichTextLink@@QBEHXZ @ 86 NONAME ; int CESMRRichTextLink::StartPos(void) const - ?SizeChanged@CESMRBorderLayer@@UAEXXZ @ 87 NONAME ; void CESMRBorderLayer::SizeChanged(void) - ?NewL@CESMREditor@@SAPAV1@XZ @ 88 NONAME ; class CESMREditor * CESMREditor::NewL(void) - ?SetTextL@CESMRRichTextViewer@@QAEXPBVTDesC16@@H@Z @ 89 NONAME ; void CESMRRichTextViewer::SetTextL(class TDesC16 const *, int) - ?ChangeMiddleSoftKeyL@CESMRField@@IAEXHH@Z @ 90 NONAME ; void CESMRField::ChangeMiddleSoftKeyL(int, int) - ?ListObserverSet@CESMRField@@UAEXXZ @ 91 NONAME ; void CESMRField::ListObserverSet(void) - ?SetTitlePaneObserver@CESMRField@@UAEXPAVMESMRTitlePaneObserver@@@Z @ 92 NONAME ; void CESMRField::SetTitlePaneObserver(class MESMRTitlePaneObserver *) - ?OfferKeyEventL@CESMREditor@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 93 NONAME ; enum TKeyResponse CESMREditor::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - ?SetOutlineFocusL@CESMRBorderLayer@@QAEXH@Z @ 94 NONAME ; void CESMRBorderLayer::SetOutlineFocusL(int) - ?GetMinimumVisibleVerticalArea@CESMRField@@UAEXAAH0@Z @ 95 NONAME ; void CESMRField::GetMinimumVisibleVerticalArea(int &, int &) - ?HandleEdwinEventL@CESMREditor@@UAEXPAVCEikEdwin@@W4TEdwinEvent@MEikEdwinObserver@@@Z @ 96 NONAME ; void CESMREditor::HandleEdwinEventL(class CEikEdwin *, enum MEikEdwinObserver::TEdwinEvent) - ?SetActionMenuStatus@CESMRRichTextViewer@@QAEXH@Z @ 97 NONAME ; void CESMRRichTextViewer::SetActionMenuStatus(int) - ?GetLinkTextL@CESMRRichTextViewer@@QBEPAVHBufC16@@ABVCESMRRichTextLink@@@Z @ 98 NONAME ; class HBufC16 * CESMRRichTextViewer::GetLinkTextL(class CESMRRichTextLink const &) const - ?SetEventQueue@CESMRRichTextViewer@@QAEXPAVMESMRFieldEventQueue@@@Z @ 99 NONAME ; void CESMRRichTextViewer::SetEventQueue(class MESMRFieldEventQueue *) - ?BorderSize@CESMRIconField@@MBE?AVTSize@@XZ @ 100 NONAME ; class TSize CESMRIconField::BorderSize(void) const - ?NotifyEventAsyncL@CESMRField@@IAEXPAVMESMRFieldEvent@@@Z @ 101 NONAME ; void CESMRField::NotifyEventAsyncL(class MESMRFieldEvent *) - ?NewL@CESMREditor@@SAPAV1@PBVCCoeControl@@HHH@Z @ 102 NONAME ; class CESMREditor * CESMREditor::NewL(class CCoeControl const *, int, int, int) - ??1CESMRRichTextLink@@UAE@XZ @ 103 NONAME ; CESMRRichTextLink::~CESMRRichTextLink(void) - ?LineCount@CESMRRichTextViewer@@QAEHXZ @ 104 NONAME ; int CESMRRichTextViewer::LineCount(void) - ?FieldId@CESMRField@@UBE?AW4TESMREntryFieldId@@XZ @ 105 NONAME ; enum TESMREntryFieldId CESMRField::FieldId(void) const - ??1CESMRRichTextViewer@@UAE@XZ @ 106 NONAME ; CESMRRichTextViewer::~CESMRRichTextViewer(void) - ?SetStartPos@CESMRRichTextLink@@QAEXH@Z @ 107 NONAME ; void CESMRRichTextLink::SetStartPos(int) - ?SetMiddleSoftKeyVisible@CESMRField@@IAEXH@Z @ 108 NONAME ; void CESMRField::SetMiddleSoftKeyVisible(int) - ?CursorLinePos@CESMREditor@@QBEHXZ @ 109 NONAME ; int CESMREditor::CursorLinePos(void) const - ??1CESMRField@@UAE@XZ @ 110 NONAME ; CESMRField::~CESMRField(void) - ?CalculateVisibleRect@CESMRField@@UAE?AVTRect@@V2@@Z @ 111 NONAME ; class TRect CESMRField::CalculateVisibleRect(class TRect) - ?Length@CESMRRichTextLink@@QBEHXZ @ 112 NONAME ; int CESMRRichTextLink::Length(void) const - ?SetContainerWindowL@CESMRIconField@@UAEXABVCCoeControl@@@Z @ 113 NONAME ; void CESMRIconField::SetContainerWindowL(class CCoeControl const &) - ?PositionChanged@CESMRRichTextViewer@@UAEXXZ @ 114 NONAME ; void CESMRRichTextViewer::PositionChanged(void) - ?CountComponentControls@CESMRIconField@@UBEHXZ @ 115 NONAME ; int CESMRIconField::CountComponentControls(void) const - ?SizeChanged@CESMRIconField@@UAEXXZ @ 116 NONAME ; void CESMRIconField::SizeChanged(void) - ?GetFocusType@CESMRField@@QBE?AW4TESMRFieldFocusType@@XZ @ 117 NONAME ; enum TESMRFieldFocusType CESMRField::GetFocusType(void) const - ?SetContainerWindowL@CESMRField@@UAEXABVCCoeControl@@@Z @ 118 NONAME ; void CESMRField::SetContainerWindowL(class CCoeControl const &) - ?EventObserver@CESMRField@@MBEPAVMESMRFieldEventObserver@@XZ @ 119 NONAME ; class MESMRFieldEventObserver * CESMRField::EventObserver(void) const - ?GetLimitLength@CESMREditor@@QBEHXZ @ 120 NONAME ; int CESMREditor::GetLimitLength(void) const - ?ResetActionMenuL@CESMRRichTextViewer@@QBEXXZ @ 121 NONAME ; void CESMRRichTextViewer::ResetActionMenuL(void) const - ?GetTextDrawer@CESMRBorderLayer@@UBEXAAPAVCCoeTextDrawerBase@@PBVCCoeControl@@@Z @ 122 NONAME ; void CESMRBorderLayer::GetTextDrawer(class CCoeTextDrawerBase * &, class CCoeControl const *) const - ?FieldMode@CESMRField@@QBE?AW4TESMRFieldMode@@XZ @ 123 NONAME ; enum TESMRFieldMode CESMRField::FieldMode(void) const - ?SetFieldMode@CESMRField@@QAEXW4TESMRFieldMode@@@Z @ 124 NONAME ; void CESMRField::SetFieldMode(enum TESMRFieldMode) - ?SetMargins@CESMRRichTextViewer@@QAEXH@Z @ 125 NONAME ; void CESMRRichTextViewer::SetMargins(int) - ?CopyCurrentLinkValueToClipBoardL@CESMRRichTextViewer@@QBEXXZ @ 126 NONAME ; void CESMRRichTextViewer::CopyCurrentLinkValueToClipBoardL(void) const + ?ExternalizeL@CESMRField@@UAEXAAVMESMRCalEntry@@@Z @ 57 NONAME ; void CESMRField::ExternalizeL(class MESMRCalEntry &) + ?FontChangedL@CESMRField@@UAEXXZ @ 58 NONAME ; void CESMRField::FontChangedL(void) + ?SizeChanged@CESMRField@@UAEXXZ @ 59 NONAME ; void CESMRField::SizeChanged(void) + ?CurrentLineNumber@CESMREditor@@QAEHXZ @ 60 NONAME ; int CESMREditor::CurrentLineNumber(void) + ?SetPreItemIndex@CESMRField@@QAEXH@Z @ 61 NONAME ; void CESMRField::SetPreItemIndex(int) + ?HandleFieldEventL@CESMRField@@MAEXABVMESMRFieldEvent@@@Z @ 62 NONAME ; void CESMRField::HandleFieldEventL(class MESMRFieldEvent const &) + ?CurrentLineNumber@CESMRRichTextViewer@@QAEHXZ @ 63 NONAME ; int CESMRRichTextViewer::CurrentLineNumber(void) + ?OfferKeyEventL@CESMRRichTextViewer@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 64 NONAME ; enum TKeyResponse CESMRRichTextViewer::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) + ?LineCount@CESMREditor@@QBEHXZ @ 65 NONAME ; int CESMREditor::LineCount(void) const + ?SetFocusType@CESMRField@@QAEXW4TESMRFieldFocusType@@@Z @ 66 NONAME ; void CESMRField::SetFocusType(enum TESMRFieldFocusType) + ?SetFieldId@CESMRField@@UAEXW4TESMREntryFieldId@@@Z @ 67 NONAME ; void CESMRField::SetFieldId(enum TESMREntryFieldId) + ?CopyCurrentLinkToClipBoardL@CESMRRichTextViewer@@QBEXXZ @ 68 NONAME ; void CESMRRichTextViewer::CopyCurrentLinkToClipBoardL(void) const + ?FocusChanged@CESMREditor@@UAEXW4TDrawNow@@@Z @ 69 NONAME ; void CESMREditor::FocusChanged(enum TDrawNow) + ?SetDefaultTextL@CESMREditor@@QAEXPAVHBufC16@@@Z @ 70 NONAME ; void CESMREditor::SetDefaultTextL(class HBufC16 *) + ?TriggerKey@CESMRRichTextLink@@QBE?AW4TTriggerKey@1@XZ @ 71 NONAME ; enum CESMRRichTextLink::TTriggerKey CESMRRichTextLink::TriggerKey(void) const + ?LongtapDetectedL@CESMRField@@QAEXABVTPoint@@@Z @ 72 NONAME ; void CESMRField::LongtapDetectedL(class TPoint const &) + ?IsFieldActivated@CESMRField@@QBEHXZ @ 73 NONAME ; int CESMRField::IsFieldActivated(void) const + ?CountComponentControls@CESMRField@@UBEHXZ @ 74 NONAME ; int CESMRField::CountComponentControls(void) const + ?LinkSelectedL@CESMRRichTextViewer@@QAEHXZ @ 75 NONAME ; int CESMRRichTextViewer::LinkSelectedL(void) + ?Value@CESMRRichTextLink@@QBEAAVTDesC16@@XZ @ 76 NONAME ; class TDesC16 & CESMRRichTextLink::Value(void) const + ?PreItemIndex@CESMRField@@QBEHXZ @ 77 NONAME ; int CESMRField::PreItemIndex(void) const + ?AddLinkL@CESMRRichTextViewer@@QAEXPAVCESMRRichTextLink@@@Z @ 78 NONAME ; void CESMRRichTextViewer::AddLinkL(class CESMRRichTextLink *) + ?StartPos@CESMRRichTextLink@@QBEHXZ @ 79 NONAME ; int CESMRRichTextLink::StartPos(void) const + ?NewL@CESMREditor@@SAPAV1@XZ @ 80 NONAME ; class CESMREditor * CESMREditor::NewL(void) + ?SetTextL@CESMRRichTextViewer@@QAEXPBVTDesC16@@H@Z @ 81 NONAME ; void CESMRRichTextViewer::SetTextL(class TDesC16 const *, int) + ?ListObserverSet@CESMRField@@UAEXXZ @ 82 NONAME ; void CESMRField::ListObserverSet(void) + ?ExecuteGenericCommandL@CESMRField@@UAEHH@Z @ 83 NONAME ; int CESMRField::ExecuteGenericCommandL(int) + ?SetTitlePaneObserver@CESMRField@@UAEXPAVMESMRTitlePaneObserver@@@Z @ 84 NONAME ; void CESMRField::SetTitlePaneObserver(class MESMRTitlePaneObserver *) + ?OfferKeyEventL@CESMREditor@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 85 NONAME ; enum TKeyResponse CESMREditor::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) + ?GetMinimumVisibleVerticalArea@CESMRField@@UAEXAAH0@Z @ 86 NONAME ; void CESMRField::GetMinimumVisibleVerticalArea(int &, int &) + ?GetCursorLineVerticalPos@CESMRField@@UAEXAAH0@Z @ 87 NONAME ; void CESMRField::GetCursorLineVerticalPos(int &, int &) + ?HandleEdwinEventL@CESMREditor@@UAEXPAVCEikEdwin@@W4TEdwinEvent@MEikEdwinObserver@@@Z @ 88 NONAME ; void CESMREditor::HandleEdwinEventL(class CEikEdwin *, enum MEikEdwinObserver::TEdwinEvent) + ?LaunchViewerUi@CMRAttachmentUi@@QAEHAAVMESMRCalEntry@@@Z @ 89 NONAME ; int CMRAttachmentUi::LaunchViewerUi(class MESMRCalEntry &) + ?UpdateExtControlL@CESMRField@@QAEXPAVCCoeControl@@@Z @ 90 NONAME ; void CESMRField::UpdateExtControlL(class CCoeControl *) + ?SetCurrentItemIndex@CESMRField@@QAEXH@Z @ 91 NONAME ; void CESMRField::SetCurrentItemIndex(int) + ?SetEventQueue@CESMRRichTextViewer@@QAEXPAVMESMRFieldEventQueue@@@Z @ 92 NONAME ; void CESMRRichTextViewer::SetEventQueue(class MESMRFieldEventQueue *) + ?HandleRawPointerEventL@CESMRField@@MAEHABUTPointerEvent@@@Z @ 93 NONAME ; int CESMRField::HandleRawPointerEventL(struct TPointerEvent const &) + ?NotifyEventAsyncL@CESMRField@@IAEXPAVMESMRFieldEvent@@@Z @ 94 NONAME ; void CESMRField::NotifyEventAsyncL(class MESMRFieldEvent *) + ?NewL@CESMREditor@@SAPAV1@PBVCCoeControl@@HHH@Z @ 95 NONAME ; class CESMREditor * CESMREditor::NewL(class CCoeControl const *, int, int, int) + ??1CESMRRichTextLink@@UAE@XZ @ 96 NONAME ; CESMRRichTextLink::~CESMRRichTextLink(void) + ?LineCount@CESMRRichTextViewer@@QAEHXZ @ 97 NONAME ; int CESMRRichTextViewer::LineCount(void) + ?FieldId@CESMRField@@UBE?AW4TESMREntryFieldId@@XZ @ 98 NONAME ; enum TESMREntryFieldId CESMRField::FieldId(void) const + ?SetFontL@CESMRRichTextViewer@@QAEXPBVCFont@@@Z @ 99 NONAME ; void CESMRRichTextViewer::SetFontL(class CFont const *) + ??1CESMRRichTextViewer@@UAE@XZ @ 100 NONAME ; CESMRRichTextViewer::~CESMRRichTextViewer(void) + ?SetStartPos@CESMRRichTextLink@@QAEXH@Z @ 101 NONAME ; void CESMRRichTextLink::SetStartPos(int) + ?SetMiddleSoftKeyVisible@CESMRField@@IAEXH@Z @ 102 NONAME ; void CESMRField::SetMiddleSoftKeyVisible(int) + ?NewL@CMRAttachmentUi@@SAPAV1@XZ @ 103 NONAME ; class CMRAttachmentUi * CMRAttachmentUi::NewL(void) + ?CursorLinePos@CESMREditor@@QBEHXZ @ 104 NONAME ; int CESMREditor::CursorLinePos(void) const + ??1CESMRField@@UAE@XZ @ 105 NONAME ; CESMRField::~CESMRField(void) + ?Length@CESMRRichTextLink@@QBEHXZ @ 106 NONAME ; int CESMRRichTextLink::Length(void) const + ?PositionChanged@CESMRRichTextViewer@@UAEXXZ @ 107 NONAME ; void CESMRRichTextViewer::PositionChanged(void) + ??1CMRAttachmentUi@@UAE@XZ @ 108 NONAME ; CMRAttachmentUi::~CMRAttachmentUi(void) + ?GetFocusType@CESMRField@@QBE?AW4TESMRFieldFocusType@@XZ @ 109 NONAME ; enum TESMRFieldFocusType CESMRField::GetFocusType(void) const + ?HandleSingletapEventL@CESMRField@@MAEHABVTPoint@@@Z @ 110 NONAME ; int CESMRField::HandleSingletapEventL(class TPoint const &) + ?SetContainerWindowL@CESMRField@@UAEXABVCCoeControl@@@Z @ 111 NONAME ; void CESMRField::SetContainerWindowL(class CCoeControl const &) + ?EventObserver@CESMRField@@MBEPAVMESMRFieldEventObserver@@XZ @ 112 NONAME ; class MESMRFieldEventObserver * CESMRField::EventObserver(void) const + ?SetMargins@CESMRRichTextViewer@@QAEXH@Z @ 113 NONAME ; void CESMRRichTextViewer::SetMargins(int) + ?NewL@CMRBackground@@SAPAV1@XZ @ 114 NONAME ; class CMRBackground * CMRBackground::NewL(void) + ?GetFocusLink@CESMRRichTextViewer@@QBEHXZ @ 115 NONAME ; int CESMRRichTextViewer::GetFocusLink(void) const + ?GetLimitLength@CESMREditor@@QBEHXZ @ 116 NONAME ; int CESMREditor::GetLimitLength(void) const + ?SetFieldMode@CESMRField@@QAEXW4TESMRFieldMode@@@Z @ 117 NONAME ; void CESMRField::SetFieldMode(enum TESMRFieldMode) + ?ResetActionMenuL@CESMRRichTextViewer@@QBEXXZ @ 118 NONAME ; void CESMRRichTextViewer::ResetActionMenuL(void) const diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/eabi/esmrfieldbuildercommonu.def --- a/meetingrequest/mrgui/mrfieldbuildercommon/eabi/esmrfieldbuildercommonu.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/eabi/esmrfieldbuildercommonu.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ EXPORTS - _ZN10CESMRField10ConstructLEP11CCoeControl19TESMRFieldFocusType @ 1 NONAME + _ZN10CESMRField10ConstructLEP11CCoeControl @ 1 NONAME _ZN10CESMRField10SetFieldIdE17TESMREntryFieldId @ 2 NONAME _ZN10CESMRField11InitializeLEv @ 3 NONAME _ZN10CESMRField11MinimumSizeEv @ 4 NONAME @@ -9,164 +9,142 @@ _ZN10CESMRField12InternalizeLER13MESMRCalEntry @ 8 NONAME _ZN10CESMRField12NotifyEventLERK15MESMRFieldEvent @ 9 NONAME _ZN10CESMRField12NotifyEventLEi @ 10 NONAME - _ZN10CESMRField12SetFocusRectERK5TRect @ 11 NONAME - _ZN10CESMRField12SetFocusTypeE19TESMRFieldFocusType @ 12 NONAME - _ZN10CESMRField13SetExpandableEv @ 13 NONAME - _ZN10CESMRField14OfferKeyEventLERK9TKeyEvent10TEventCode @ 14 NONAME - _ZN10CESMRField14OkToLoseFocusLE17TESMREntryFieldId @ 15 NONAME - _ZN10CESMRField14SetEventQueueLEP20MESMRFieldEventQueue @ 16 NONAME - _ZN10CESMRField15ListObserverSetEv @ 17 NONAME - _ZN10CESMRField15SetListObserverEP17MESMRListObserver @ 18 NONAME - _ZN10CESMRField16SetLayoutManagerEP18CESMRLayoutManager @ 19 NONAME - _ZN10CESMRField16SetOutlineFocusLEi @ 20 NONAME - _ZN10CESMRField17HandleFieldEventLERK15MESMRFieldEvent @ 21 NONAME - _ZN10CESMRField17NotifyEventAsyncLEP15MESMRFieldEvent @ 22 NONAME - _ZN10CESMRField17NotifyEventAsyncLEi @ 23 NONAME - _ZN10CESMRField19SetContainerWindowLERK11CCoeControl @ 24 NONAME - _ZN10CESMRField20CalculateVisibleRectE5TRect @ 25 NONAME - _ZN10CESMRField20ChangeMiddleSoftKeyLEi @ 26 NONAME - _ZN10CESMRField20ChangeMiddleSoftKeyLEii @ 27 NONAME - _ZN10CESMRField20SetTitlePaneObserverEP22MESMRTitlePaneObserver @ 28 NONAME - _ZN10CESMRField21RestoreMiddleSoftKeyLEv @ 29 NONAME - _ZN10CESMRField22ExecuteGenericCommandLEi @ 30 NONAME - _ZN10CESMRField23SetMiddleSoftKeyVisibleEi @ 31 NONAME - _ZN10CESMRField29GetMinimumVisibleVerticalAreaERiS0_ @ 32 NONAME - _ZN10CESMRFieldC1Ev @ 33 NONAME - _ZN10CESMRFieldC2Ev @ 34 NONAME - _ZN10CESMRFieldD0Ev @ 35 NONAME - _ZN10CESMRFieldD1Ev @ 36 NONAME - _ZN10CESMRFieldD2Ev @ 37 NONAME - _ZN11CESMREditor11DefaultTextEv @ 38 NONAME - _ZN11CESMREditor12FocusChangedE8TDrawNow @ 39 NONAME - _ZN11CESMREditor14OfferKeyEventLERK9TKeyEvent10TEventCode @ 40 NONAME - _ZN11CESMREditor15PositionChangedEv @ 41 NONAME - _ZN11CESMREditor15SetDefaultTextLEP7HBufC16 @ 42 NONAME - _ZN11CESMREditor15SetListObserverEP17MESMRListObserver @ 43 NONAME - _ZN11CESMREditor17CurrentLineNumberEv @ 44 NONAME - _ZN11CESMREditor17HandleEdwinEventLEP9CEikEdwinN17MEikEdwinObserver11TEdwinEventE @ 45 NONAME - _ZN11CESMREditor25ClearSelectionAndSetTextLERK7TDesC16 @ 46 NONAME - _ZN11CESMREditor4NewLEPK11CCoeControliii @ 47 NONAME - _ZN11CESMREditor4NewLEv @ 48 NONAME - _ZN11CESMREditor8SetFontLEPK5CFontP18CESMRLayoutManager @ 49 NONAME - _ZN11CESMREditor9RowHeightEv @ 50 NONAME - _ZN11CESMREditorD0Ev @ 51 NONAME - _ZN11CESMREditorD1Ev @ 52 NONAME - _ZN11CESMREditorD2Ev @ 53 NONAME - _ZN13CMRBackground4NewLER18CESMRLayoutManager @ 54 NONAME - _ZN13CMRBackgroundD0Ev @ 55 NONAME - _ZN13CMRBackgroundD1Ev @ 56 NONAME - _ZN13CMRBackgroundD2Ev @ 57 NONAME - _ZN14CESMRIconField10ConstructLE11TAknsItemIDP11CCoeControl19TESMRFieldFocusType @ 58 NONAME - _ZN14CESMRIconField11SizeChangedEv @ 59 NONAME - _ZN14CESMRIconField19SetContainerWindowLERK11CCoeControl @ 60 NONAME - _ZN14CESMRIconField5IconLE11TAknsItemID @ 61 NONAME - _ZN14CESMRIconFieldC1Ev @ 62 NONAME - _ZN14CESMRIconFieldC2Ev @ 63 NONAME - _ZN14CESMRIconFieldD0Ev @ 64 NONAME - _ZN14CESMRIconFieldD1Ev @ 65 NONAME - _ZN14CESMRIconFieldD2Ev @ 66 NONAME - _ZN16CESMRBorderLayer10ConstructLEv @ 67 NONAME - _ZN16CESMRBorderLayer11SizeChangedEv @ 68 NONAME - _ZN16CESMRBorderLayer14OfferKeyEventLERK9TKeyEvent10TEventCode @ 69 NONAME - _ZN16CESMRBorderLayer16SetLayoutManagerEP18CESMRLayoutManager @ 70 NONAME - _ZN16CESMRBorderLayer16SetOutlineFocusLEi @ 71 NONAME - _ZN16CESMRBorderLayer19SetContainerWindowLERK11CCoeControl @ 72 NONAME - _ZN16CESMRBorderLayer4NewLEP11CCoeControl19TESMRFieldFocusType @ 73 NONAME - _ZN16CESMRBorderLayerD0Ev @ 74 NONAME - _ZN16CESMRBorderLayerD1Ev @ 75 NONAME - _ZN16CESMRBorderLayerD2Ev @ 76 NONAME - _ZN17CESMRRichTextLink11SetStartPosEi @ 77 NONAME - _ZN17CESMRRichTextLink4NewLEiiRK7TDesC16NS_5TTypeENS_11TTriggerKeyE @ 78 NONAME - _ZN17CESMRRichTextLinkD0Ev @ 79 NONAME - _ZN17CESMRRichTextLinkD1Ev @ 80 NONAME - _ZN17CESMRRichTextLinkD2Ev @ 81 NONAME - _ZN19CESMRRichTextViewer11InsertLinkLEP17CESMRRichTextLinki @ 82 NONAME - _ZN19CESMRRichTextViewer12FocusChangedE8TDrawNow @ 83 NONAME - _ZN19CESMRRichTextViewer13LinkSelectedLEv @ 84 NONAME - _ZN19CESMRRichTextViewer13SetEventQueueEP20MESMRFieldEventQueue @ 85 NONAME - _ZN19CESMRRichTextViewer14OfferKeyEventLERK9TKeyEvent10TEventCode @ 86 NONAME - _ZN19CESMRRichTextViewer15PositionChangedEv @ 87 NONAME - _ZN19CESMRRichTextViewer15SetLinkObserverEP21MESMRRichTextObserver @ 88 NONAME - _ZN19CESMRRichTextViewer15SetListObserverEP17MESMRListObserver @ 89 NONAME - _ZN19CESMRRichTextViewer17CurrentLineNumberEv @ 90 NONAME - _ZN19CESMRRichTextViewer19SetActionMenuStatusEi @ 91 NONAME - _ZN19CESMRRichTextViewer4NewLEPK11CCoeControl @ 92 NONAME - _ZN19CESMRRichTextViewer8AddLinkLEP17CESMRRichTextLink @ 93 NONAME - _ZN19CESMRRichTextViewer8SetFontLEPK5CFontP18CESMRLayoutManager @ 94 NONAME - _ZN19CESMRRichTextViewer8SetTextLEPK7TDesC16i @ 95 NONAME - _ZN19CESMRRichTextViewer9LineCountEv @ 96 NONAME - _ZN19CESMRRichTextViewer9RowHeightEv @ 97 NONAME - _ZN19CESMRRichTextViewerD0Ev @ 98 NONAME - _ZN19CESMRRichTextViewerD1Ev @ 99 NONAME - _ZN19CESMRRichTextViewerD2Ev @ 100 NONAME - _ZN21CESMRViewerLabelField10ConstructLE11TAknsItemID @ 101 NONAME - _ZN21CESMRViewerLabelField11InitializeLEv @ 102 NONAME - _ZN21CESMRViewerLabelField12FocusChangedE8TDrawNow @ 103 NONAME - _ZN21CESMRViewerLabelField4NewLEv @ 104 NONAME - _ZN21CESMRViewerLabelFieldC1Ev @ 105 NONAME - _ZN21CESMRViewerLabelFieldC2Ev @ 106 NONAME - _ZN21CESMRViewerLabelFieldD0Ev @ 107 NONAME - _ZN21CESMRViewerLabelFieldD1Ev @ 108 NONAME - _ZN21CESMRViewerLabelFieldD2Ev @ 109 NONAME - _ZN22CESMRFieldCommandEvent4NewLEP23MESMRFieldEventNotifieri @ 110 NONAME - _ZN22CESMRFieldCommandEvent5NewLCEP23MESMRFieldEventNotifieri @ 111 NONAME - _ZNK10CESMRField12GetFocusRectEv @ 112 NONAME - _ZNK10CESMRField12GetFocusTypeEv @ 113 NONAME - _ZNK10CESMRField12IsExpandableEv @ 114 NONAME - _ZNK10CESMRField13EventObserverEv @ 115 NONAME - _ZNK10CESMRField14ExpandedHeightEv @ 116 NONAME - _ZNK10CESMRField15HasOutlineFocusEv @ 117 NONAME - _ZNK10CESMRField16ComponentControlEi @ 118 NONAME - _ZNK10CESMRField22CountComponentControlsEv @ 119 NONAME - _ZNK10CESMRField7FieldIdEv @ 120 NONAME - _ZNK11CESMREditor13CursorLinePosEv @ 121 NONAME - _ZNK11CESMREditor14GetLimitLengthEv @ 122 NONAME - _ZNK11CESMREditor9LineCountEv @ 123 NONAME - _ZNK13CMRBackground4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 124 NONAME - _ZNK14CESMRIconField10BorderSizeEv @ 125 NONAME - _ZNK14CESMRIconField16ComponentControlEi @ 126 NONAME - _ZNK14CESMRIconField22CountComponentControlsEv @ 127 NONAME - _ZNK16CESMRBorderLayer13GetTextDrawerERP18CCoeTextDrawerBasePK11CCoeControl @ 128 NONAME - _ZNK16CESMRBorderLayer16ComponentControlEi @ 129 NONAME - _ZNK16CESMRBorderLayer22CountComponentControlsEv @ 130 NONAME - _ZNK16CESMRBorderLayer4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 131 NONAME - _ZNK16CESMRBorderLayer8HasFocusEv @ 132 NONAME - _ZNK17CESMRRichTextLink10TriggerKeyEv @ 133 NONAME - _ZNK17CESMRRichTextLink4TypeEv @ 134 NONAME - _ZNK17CESMRRichTextLink5ValueEv @ 135 NONAME - _ZNK17CESMRRichTextLink6LengthEv @ 136 NONAME - _ZNK17CESMRRichTextLink8StartPosEv @ 137 NONAME - _ZNK19CESMRRichTextViewer12GetLinkTextLERK17CESMRRichTextLink @ 138 NONAME - _ZNK19CESMRRichTextViewer15GetSelectedLinkEv @ 139 NONAME - _ZNK19CESMRRichTextViewer16ResetActionMenuLEv @ 140 NONAME - _ZNK19CESMRRichTextViewer27CopyCurrentLinkToClipBoardLEv @ 141 NONAME - _ZTI10CESMRField @ 142 NONAME - _ZTI14CESMRIconField @ 143 NONAME - _ZTI21CESMRViewerLabelField @ 144 NONAME - _ZTV10CESMRField @ 145 NONAME - _ZTV14CESMRIconField @ 146 NONAME - _ZTV21CESMRViewerLabelField @ 147 NONAME - _ZThn340_N11CESMREditor17HandleEdwinEventLEP9CEikEdwinN17MEikEdwinObserver11TEdwinEventE @ 148 NONAME - _ZThn4_NK13CMRBackground4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 149 NONAME - _ZThn52_N10CESMRField17HandleFieldEventLERK15MESMRFieldEvent @ 150 NONAME - _ZThn52_N10CESMRFieldD0Ev @ 151 NONAME - _ZThn52_N10CESMRFieldD1Ev @ 152 NONAME - _ZThn52_N14CESMRIconFieldD0Ev @ 153 NONAME - _ZThn52_N14CESMRIconFieldD1Ev @ 154 NONAME - _ZThn52_N21CESMRViewerLabelFieldD0Ev @ 155 NONAME - _ZThn52_N21CESMRViewerLabelFieldD1Ev @ 156 NONAME - _ZThn52_NK16CESMRBorderLayer13GetTextDrawerERP18CCoeTextDrawerBasePK11CCoeControl @ 157 NONAME - _ZThn52_NK16CESMRBorderLayer4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 158 NONAME - _ZThn56_N10CESMRField14SetEventQueueLEP20MESMRFieldEventQueue @ 159 NONAME - _ZThn56_N10CESMRFieldD0Ev @ 160 NONAME - _ZThn56_N10CESMRFieldD1Ev @ 161 NONAME - _ZThn56_N14CESMRIconFieldD0Ev @ 162 NONAME - _ZThn56_N14CESMRIconFieldD1Ev @ 163 NONAME - _ZThn56_N21CESMRViewerLabelFieldD0Ev @ 164 NONAME - _ZThn56_N21CESMRViewerLabelFieldD1Ev @ 165 NONAME - _ZThn56_NK10CESMRField13EventObserverEv @ 166 NONAME - _ZN10CESMRField12SetFieldModeE14TESMRFieldMode @ 167 NONAME - _ZNK10CESMRField9FieldModeEv @ 168 NONAME - _ZN19CESMRRichTextViewer10SetMarginsEi @ 169 NONAME - _ZNK19CESMRRichTextViewer32CopyCurrentLinkValueToClipBoardLEv @ 170 NONAME + _ZN10CESMRField12SetFieldModeE14TESMRFieldMode @ 11 NONAME + _ZN10CESMRField12SetFocusRectERK5TRect @ 12 NONAME + _ZN10CESMRField12SetFocusTypeE19TESMRFieldFocusType @ 13 NONAME + _ZN10CESMRField13SetValidatorLEP19MESMRFieldValidator @ 14 NONAME + _ZN10CESMRField14OfferKeyEventLERK9TKeyEvent10TEventCode @ 15 NONAME + _ZN10CESMRField14OkToLoseFocusLE17TESMREntryFieldId @ 16 NONAME + _ZN10CESMRField14SetEventQueueLEP20MESMRFieldEventQueue @ 17 NONAME + _ZN10CESMRField15ListObserverSetEv @ 18 NONAME + _ZN10CESMRField15SetListObserverEP17MESMRListObserver @ 19 NONAME + _ZN10CESMRField15SetPreItemIndexEi @ 20 NONAME + _ZN10CESMRField16DynInitMenuPaneLEiP12CEikMenuPane @ 21 NONAME + _ZN10CESMRField16LongtapDetectedLERK6TPoint @ 22 NONAME + _ZN10CESMRField16SetFieldViewModeE14TESMRFieldType @ 23 NONAME + _ZN10CESMRField16SetOutlineFocusLEi @ 24 NONAME + _ZN10CESMRField17HandleFieldEventLERK15MESMRFieldEvent @ 25 NONAME + _ZN10CESMRField17NotifyEventAsyncLEP15MESMRFieldEvent @ 26 NONAME + _ZN10CESMRField17NotifyEventAsyncLEi @ 27 NONAME + _ZN10CESMRField17UpdateExtControlLEP11CCoeControl @ 28 NONAME + _ZN10CESMRField19HandleLongtapEventLERK6TPoint @ 29 NONAME + _ZN10CESMRField19HandlePointerEventLERK13TPointerEvent @ 30 NONAME + _ZN10CESMRField19SetContainerWindowLERK11CCoeControl @ 31 NONAME + _ZN10CESMRField19SetCurrentItemIndexEi @ 32 NONAME + _ZN10CESMRField20ChangeMiddleSoftKeyLEi @ 33 NONAME + _ZN10CESMRField20ChangeMiddleSoftKeyLEii @ 34 NONAME + _ZN10CESMRField20SetTitlePaneObserverEP22MESMRTitlePaneObserver @ 35 NONAME + _ZN10CESMRField21HandleSingletapEventLERK6TPoint @ 36 NONAME + _ZN10CESMRField21RestoreMiddleSoftKeyLEv @ 37 NONAME + _ZN10CESMRField22ExecuteGenericCommandLEi @ 38 NONAME + _ZN10CESMRField22HandleRawPointerEventLERK13TPointerEvent @ 39 NONAME + _ZN10CESMRField22HandleTactileFeedbackLEv @ 40 NONAME + _ZN10CESMRField23SetMiddleSoftKeyVisibleEi @ 41 NONAME + _ZN10CESMRField24GetCursorLineVerticalPosERiS0_ @ 42 NONAME + _ZN10CESMRField29GetMinimumVisibleVerticalAreaERiS0_ @ 43 NONAME + _ZN10CESMRField5LockLEv @ 44 NONAME + _ZN10CESMRField8IsLockedEv @ 45 NONAME + _ZN10CESMRFieldC1Ev @ 46 NONAME + _ZN10CESMRFieldC2Ev @ 47 NONAME + _ZN10CESMRFieldD0Ev @ 48 NONAME + _ZN10CESMRFieldD1Ev @ 49 NONAME + _ZN10CESMRFieldD2Ev @ 50 NONAME + _ZN11CESMREditor11DefaultTextEv @ 51 NONAME + _ZN11CESMREditor12FocusChangedE8TDrawNow @ 52 NONAME + _ZN11CESMREditor14OfferKeyEventLERK9TKeyEvent10TEventCode @ 53 NONAME + _ZN11CESMREditor15PositionChangedEv @ 54 NONAME + _ZN11CESMREditor15SetDefaultTextLEP7HBufC16 @ 55 NONAME + _ZN11CESMREditor15SetListObserverEP17MESMRListObserver @ 56 NONAME + _ZN11CESMREditor17CurrentLineNumberEv @ 57 NONAME + _ZN11CESMREditor17HandleEdwinEventLEP9CEikEdwinN17MEikEdwinObserver11TEdwinEventE @ 58 NONAME + _ZN11CESMREditor25ClearSelectionAndSetTextLERK7TDesC16 @ 59 NONAME + _ZN11CESMREditor4NewLEPK11CCoeControliii @ 60 NONAME + _ZN11CESMREditor4NewLEv @ 61 NONAME + _ZN11CESMREditor8SetFontLEPK5CFont @ 62 NONAME + _ZN11CESMREditor9RowHeightEv @ 63 NONAME + _ZN11CESMREditorD0Ev @ 64 NONAME + _ZN11CESMREditorD1Ev @ 65 NONAME + _ZN11CESMREditorD2Ev @ 66 NONAME + _ZN13CMRBackground4NewLEv @ 67 NONAME + _ZN13CMRBackgroundD0Ev @ 68 NONAME + _ZN13CMRBackgroundD1Ev @ 69 NONAME + _ZN13CMRBackgroundD2Ev @ 70 NONAME + _ZN15CMRAttachmentUi11SetObserverER23MMRAttachmentUiObserver @ 71 NONAME + _ZN15CMRAttachmentUi13LaunchFetchUiER13MESMRCalEntry @ 72 NONAME + _ZN15CMRAttachmentUi14LaunchViewerUiER13MESMRCalEntry @ 73 NONAME + _ZN15CMRAttachmentUi21LatestOperationResultEv @ 74 NONAME + _ZN15CMRAttachmentUi4NewLEv @ 75 NONAME + _ZN15CMRAttachmentUiD0Ev @ 76 NONAME + _ZN15CMRAttachmentUiD1Ev @ 77 NONAME + _ZN15CMRAttachmentUiD2Ev @ 78 NONAME + _ZN17CESMRRichTextLink11SetStartPosEi @ 79 NONAME + _ZN17CESMRRichTextLink4NewLEiiRK7TDesC16NS_5TTypeENS_11TTriggerKeyE @ 80 NONAME + _ZN17CESMRRichTextLinkD0Ev @ 81 NONAME + _ZN17CESMRRichTextLinkD1Ev @ 82 NONAME + _ZN17CESMRRichTextLinkD2Ev @ 83 NONAME + _ZN19CESMRRichTextViewer10SetMarginsEi @ 84 NONAME + _ZN19CESMRRichTextViewer11InsertLinkLEP17CESMRRichTextLinki @ 85 NONAME + _ZN19CESMRRichTextViewer12FocusChangedE8TDrawNow @ 86 NONAME + _ZN19CESMRRichTextViewer13LinkSelectedLEv @ 87 NONAME + _ZN19CESMRRichTextViewer13SetEventQueueEP20MESMRFieldEventQueue @ 88 NONAME + _ZN19CESMRRichTextViewer14OfferKeyEventLERK9TKeyEvent10TEventCode @ 89 NONAME + _ZN19CESMRRichTextViewer15PositionChangedEv @ 90 NONAME + _ZN19CESMRRichTextViewer15SetLineSpacingLEi @ 91 NONAME + _ZN19CESMRRichTextViewer15SetLinkObserverEP21MESMRRichTextObserver @ 92 NONAME + _ZN19CESMRRichTextViewer15SetListObserverEP17MESMRListObserver @ 93 NONAME + _ZN19CESMRRichTextViewer17CurrentLineNumberEv @ 94 NONAME + _ZN19CESMRRichTextViewer19ApplyLayoutChangesLEv @ 95 NONAME + _ZN19CESMRRichTextViewer4NewLEPK11CCoeControl @ 96 NONAME + _ZN19CESMRRichTextViewer8AddLinkLEP17CESMRRichTextLink @ 97 NONAME + _ZN19CESMRRichTextViewer8SetFontLEPK5CFont @ 98 NONAME + _ZN19CESMRRichTextViewer8SetTextLEPK7TDesC16i @ 99 NONAME + _ZN19CESMRRichTextViewer9LineCountEv @ 100 NONAME + _ZN19CESMRRichTextViewer9RowHeightEv @ 101 NONAME + _ZN19CESMRRichTextViewerD0Ev @ 102 NONAME + _ZN19CESMRRichTextViewerD1Ev @ 103 NONAME + _ZN19CESMRRichTextViewerD2Ev @ 104 NONAME + _ZNK10CESMRField12GetFocusRectEv @ 105 NONAME + _ZNK10CESMRField12GetFocusTypeEv @ 106 NONAME + _ZNK10CESMRField12PreItemIndexEv @ 107 NONAME + _ZNK10CESMRField13EventObserverEv @ 108 NONAME + _ZNK10CESMRField13FieldViewModeEv @ 109 NONAME + _ZNK10CESMRField15HasOutlineFocusEv @ 110 NONAME + _ZNK10CESMRField16ComponentControlEi @ 111 NONAME + _ZNK10CESMRField16CurrentItemIndexEv @ 112 NONAME + _ZNK10CESMRField16IsFieldActivatedEv @ 113 NONAME + _ZNK10CESMRField22CountComponentControlsEv @ 114 NONAME + _ZNK10CESMRField7FieldIdEv @ 115 NONAME + _ZNK10CESMRField9FieldModeEv @ 116 NONAME + _ZNK11CESMREditor13CursorLinePosEv @ 117 NONAME + _ZNK11CESMREditor14GetLimitLengthEv @ 118 NONAME + _ZNK11CESMREditor9LineCountEv @ 119 NONAME + _ZNK13CMRBackground4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 120 NONAME + _ZNK17CESMRRichTextLink10TriggerKeyEv @ 121 NONAME + _ZNK17CESMRRichTextLink4TypeEv @ 122 NONAME + _ZNK17CESMRRichTextLink5ValueEv @ 123 NONAME + _ZNK17CESMRRichTextLink6LengthEv @ 124 NONAME + _ZNK17CESMRRichTextLink8StartPosEv @ 125 NONAME + _ZNK19CESMRRichTextViewer13GetLinkTextLCERK17CESMRRichTextLink @ 126 NONAME + _ZNK19CESMRRichTextViewer15GetSelectedLinkEv @ 127 NONAME + _ZNK19CESMRRichTextViewer16ResetActionMenuLEv @ 128 NONAME + _ZNK19CESMRRichTextViewer27CopyCurrentLinkToClipBoardLEv @ 129 NONAME + _ZTI10CESMRField @ 130 NONAME + _ZTV10CESMRField @ 131 NONAME + _ZThn12_N15CMRAttachmentUiD0Ev @ 132 NONAME + _ZThn12_N15CMRAttachmentUiD1Ev @ 133 NONAME + _ZThn340_N11CESMREditor17HandleEdwinEventLEP9CEikEdwinN17MEikEdwinObserver11TEdwinEventE @ 134 NONAME + _ZThn348_N19CESMRRichTextViewerD0Ev @ 135 NONAME + _ZThn348_N19CESMRRichTextViewerD1Ev @ 136 NONAME + _ZThn4_NK13CMRBackground4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 137 NONAME + _ZThn52_N10CESMRField17HandleFieldEventLERK15MESMRFieldEvent @ 138 NONAME + _ZThn52_N10CESMRFieldD0Ev @ 139 NONAME + _ZThn52_N10CESMRFieldD1Ev @ 140 NONAME + _ZThn56_N10CESMRField14SetEventQueueLEP20MESMRFieldEventQueue @ 141 NONAME + _ZThn56_N10CESMRFieldD0Ev @ 142 NONAME + _ZThn56_N10CESMRFieldD1Ev @ 143 NONAME + _ZThn56_NK10CESMRField13EventObserverEv @ 144 NONAME + _ZThn8_N15CMRAttachmentUiD0Ev @ 145 NONAME + _ZThn8_N15CMRAttachmentUiD1Ev @ 146 NONAME + _ZN19CESMRRichTextViewer12SetFocusLinkEi @ 147 NONAME + _ZNK19CESMRRichTextViewer12GetFocusLinkEv @ 148 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/group/bld.inf --- a/meetingrequest/mrgui/mrfieldbuildercommon/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,14 +18,12 @@ #include PRJ_EXPORTS -../inc/cesmrborderlayer.h |../../inc/cesmrborderlayer.h ../inc/cesmreditor.h |../../inc/cesmreditor.h ../inc/cesmrfield.h |../../inc/cesmrfield.h -../inc/cesmriconfield.h |../../inc/cesmriconfield.h ../inc/cesmrrichtextlink.h |../../inc/cesmrrichtextlink.h ../inc/cesmrrichtextviewer.h |../../inc/cesmrrichtextviewer.h -../inc/cesmrviewerlabelfield.h |../../inc/cesmrviewerlabelfield.h ../inc/cmrbackground.h |../../inc/cmrbackground.h +../inc/cmrattachmentui.h |../../inc/cmrattachmentui.h PRJ_MMPFILES esmrfieldbuildercommon.mmp diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/group/esmrfieldbuildercommon.mmp --- a/meetingrequest/mrgui/mrfieldbuildercommon/group/esmrfieldbuildercommon.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/group/esmrfieldbuildercommon.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,8 +18,8 @@ #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../../inc/esmrinternaluid.h" #include "../../../../inc/emailtraceconfig.hrh" -#include "../../../inc/esmrinternaluid.h" #include #include @@ -30,32 +30,28 @@ CAPABILITY CAP_GENERAL_DLL -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging +// Includes -// Includes APP_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc USERINCLUDE ../../inc USERINCLUDE ../../../inc -USERINCLUDE ../../../../inc +USERINCLUDE ../../../../inc SOURCEPATH ../src -SOURCE cesmrfield.cpp -SOURCE cesmrborderlayer.cpp -SOURCE cesmriconfield.cpp -SOURCE cesmrviewerlabelfield.cpp -SOURCE cesmreditor.cpp -SOURCE cesmrrichtextlink.cpp -SOURCE cesmrrichtextviewer.cpp -SOURCE cmrbackground.cpp +SOURCE cesmrfield.cpp +SOURCE cesmreditor.cpp +SOURCE cesmrrichtextlink.cpp +SOURCE cesmrrichtextviewer.cpp +SOURCE cmrbackground.cpp +SOURCE cmrattachmentui.cpp +SOURCE cmrattachmentprogressinfo.cpp +SOURCE cmrfilemanager.cpp +SOURCE cmrgrid.cpp -SOURCEPATH ../../mrfieldevent/src -SOURCE cesmrfieldcommandevent.cpp - -LIBRARY esmrgui.lib LIBRARY esmrcommon.lib LIBRARY esmrfieldevent.lib +LIBRARY mrguicommon.lib // Dependencies to Symbian OS & S60 components LIBRARY commonengine.lib @@ -76,10 +72,19 @@ LIBRARY bafl.lib//clipboard copy LIBRARY estor.lib //clipboard copy streamdictionary LIBRARY touchfeedback.lib -LIBRARY ws32.lib -LIBRARY cmaillogger.lib +LIBRARY mgfetch.lib +LIBRARY efsrv.lib +LIBRARY sysutil.lib // SysUtil +LIBRARY calinterimapi.lib +LIBRARY npdlib.lib // Note fetch +LIBRARY commondialogs.lib // Common Dialogs API +LIBRARY apgrfx.lib +LIBRARY apmime.lib +LIBRARY egul.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +LIBRARY cmaillogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrborderlayer.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrborderlayer.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR service policy -* -*/ - -#ifndef CESMRBORDERLAYER_H -#define CESMRBORDERLAYER_H - -#include -#include "cesmrlayoutmgr.h" - -#include "cesmrfield.h" - -/** - * CESMRBorderLayer draws border around the focused control. - * - * @lib esmrgui.lib - */ -NONSHARABLE_CLASS( CESMRBorderLayer ): public CCoeControl, - public MCoeControlBackground - { -public: - /** - * Two-phased constructor. - * - * @param aExt Control which has border around it. - * @param aFocusType - * @return Pointer to created and initialized esmr borderlayer object. - */ - IMPORT_C static CESMRBorderLayer* NewL( - CCoeControl* aExt, - TESMRFieldFocusType aFocusType = EESMRBorderFocus ); - - /** - * Destructor. - */ - IMPORT_C ~CESMRBorderLayer(); - - /** - * Set outline focus (rectangle) around the fields control. - * @param aFocus - */ - IMPORT_C void SetOutlineFocusL( TBool aFocus ); - - /** - * Test if this border layer has focus. - * @return TBool - */ - IMPORT_C TBool HasFocus() const; - - /** - * Gives pointer to layoutmanager for this class - * @param aLayout - */ - IMPORT_C void SetLayoutManager( CESMRLayoutManager* aLayout ); - -private: - CESMRBorderLayer( CCoeControl* aExtControl, - TESMRFieldFocusType aFocusType ); - void ConstructL(); - -public: // From MCoeControlBackground - IMPORT_C void Draw( CWindowGc &aGc, const - CCoeControl &aControl, - const TRect &aRect) const; - IMPORT_C void GetTextDrawer( - CCoeTextDrawerBase *&aTextDrawer, - const CCoeControl *aDrawingControl) const; - -public: // From CCoeControl - IMPORT_C TKeyResponse OfferKeyEventL( - const TKeyEvent& aEvent, - TEventCode aType ); - IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer); - IMPORT_C TInt CountComponentControls() const; - IMPORT_C CCoeControl* ComponentControl( TInt aInd ) const; - IMPORT_C void SizeChanged(); - -protected: - /// Own: control which is surrounded by border - CCoeControl* iExtControl; - /// Ref: Wheater this layer has focus or not - TBool iFocus; - /// Own: Inofmation about focus type, needed when border/highlight is drawn - TESMRFieldFocusType iFocusType; - /// Ref: Pointer to layputmanager - CESMRLayoutManager* iLayout; - }; - -#endif // CESMRBORDERLAYER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmreditor.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmreditor.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmreditor.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,10 +21,10 @@ #include #include -#include "mesmrlistobserver.h" - -class CESMRLayoutManager; +// Forward declarations +class MESMRListObserver; +class MMRFieldScrollObserver; NONSHARABLE_CLASS( CESMREditor ): public CEikRichTextEditor, public MEikEdwinObserver @@ -60,6 +60,7 @@ const TKeyEvent& aKeyEvent, TEventCode aType); IMPORT_C void FocusChanged(TDrawNow aDrawNow); + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); public: // From MEikEdwinObserver IMPORT_C void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); @@ -78,7 +79,7 @@ * @param aFont new font * @param aLayout */ - IMPORT_C void SetFontL( const CFont* aFont, CESMRLayoutManager* aLayout ); + IMPORT_C void SetFontL( const CFont* aFont ); /** * Returns cursor line number. @@ -161,10 +162,8 @@ private: /// Ref: MESMRListObserver* iObserver; - /// Own: HBufC* iDefaultText; - /// Own; TInt iLimitLength; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrfield.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,18 +11,19 @@ * * Contributors: * -* Description: ESMR Field item for CESMRListComponent +* Description: Parent class for specific fields owned by fieldcontainer * */ #ifndef CESMRFIELD_H #define CESMRFIELD_H +#include +#include // #include "esmrdef.h" #include "esmrcommands.h" // -#include "cesmrlayoutmgr.h" #include "mesmrcalentry.h" #include "mesmrtitlepaneobserver.h" #include "mesmrfieldeventobserver.h" @@ -34,8 +35,11 @@ class MESMRListObserver; class MESMRCalEntry; class CESMRBorderLayer; -class CESMRLayoutManager; class CMRBackground; +class MTouchFeedback; +class MESMRFieldValidator; +class CEikMenuPane; +class MTouchFeedback; // Enumeration for border type enum TESMRFieldFocusType @@ -46,7 +50,7 @@ }; /** - * CESMRField defines a list item for CESMRListComponent. + * CESMRField defines a list item. * This is the base class for all fields. * * @lib esmrgui.lib @@ -67,9 +71,8 @@ * * @param aControl Field control, ownership transferred */ - IMPORT_C void ConstructL( - CCoeControl* aControl, - TESMRFieldFocusType aFocusType = EESMRBorderFocus ); + IMPORT_C void ConstructL( + CCoeControl* aControl ); /** * Observer interface is used to notify the list component when @@ -86,6 +89,20 @@ */ IMPORT_C virtual void SetFieldId( TESMREntryFieldId aFieldId ); + /** + * Set identifier for preceding item index. + * + * @param PreItemIndex Index for pre item in the list + */ + IMPORT_C void SetPreItemIndex( TInt aPreItemIndex ); + + /** + * Set identifier for current item index. + * + * @param aCurrentItemIndex Index for current item in the list + */ + IMPORT_C void SetCurrentItemIndex( TInt aCurrentItemIndex ); + public: /** * Layout this field relative to given TRect. Implementation MUST @@ -93,18 +110,9 @@ * list component knows where to place the next field. * * @param aRect Contains the rect for this field. The height must be updated. - * @param aMgr LayoutManager (LAF) * @deprecated Use InitializeL() and ExpandableHeight() instead. */ - IMPORT_C void DoLayout( TRect& aRect, CESMRLayoutManager& aMgr ); - - /** - * Method is called by list component to retrieve new height of the field. - * - * @see SetExpandable() - * @return height after expansion - */ - IMPORT_C virtual TInt ExpandedHeight() const; + IMPORT_C void DoLayout( TRect& aRect ); /** * Called in the constuct phase. Font and colors are typically set here @@ -119,27 +127,6 @@ IMPORT_C virtual void FontChangedL(); /** - * Sets this field to be expandable. After this is called list - * component asks the new height of the field every time its size changes. - * - * @see ExpandedHeight() - */ - IMPORT_C virtual void SetExpandable(); - - /** - * Method is called to ask is this field expandable or not. - * - * @return boolean ETrue/EFalse - */ - IMPORT_C virtual TBool IsExpandable() const; - - /** Sets the layoutmanager for the field. If overwritten, the derived class MUST - * call iBorder->SetLayoutManager() to enable intended behaviour. - * @param layoutmanager for the field - */ - IMPORT_C virtual void SetLayoutManager( CESMRLayoutManager* aLayout ); - - /** * Identifier for this field. * * @return TESMRField @@ -147,6 +134,20 @@ IMPORT_C virtual TESMREntryFieldId FieldId() const; /** + * Identifier for preceding item index. + * + * @return The pre item index in the listpane + */ + IMPORT_C TInt PreItemIndex() const; + + /** + * Identifier for preceding item index. + * + * @return The current item index in the listpane + */ + IMPORT_C TInt CurrentItemIndex() const; + + /** * Called by the list component. Implementations should update the * the field according to MESMRCalEntry argument. Default implementation * does nothing. @@ -186,40 +187,56 @@ IMPORT_C virtual void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); /** + * Get current cursor line virtical position, it's relative to current field + * If no internal cursor in this field, default return whole field rect size. + * @param aUpper, the upper vertical coordinate + * @param aLower, the lower vertical coordinate + */ + IMPORT_C virtual void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); + + /** * Trigger for notifying when the list observer is set */ IMPORT_C virtual void ListObserverSet(); /** - * Calculates the shown rect in given rect within the list area + * Executes generic command if needed by the field. + * + * @param aCommand, commandId to handle specific command + * @return ETrue if the command is used, EFalse otherwise */ - IMPORT_C virtual TRect CalculateVisibleRect( TRect aRect ); + IMPORT_C virtual TBool ExecuteGenericCommandL( TInt aCommand ); /** - * Executes generic command if needed by the field - * @param aCommand, commandId to handle specific command + * Notifies long tap event to field. + * Calls virtual CESMRField::HandleLongtapEventL for + * field specific event handling. + * + * @param aPosition position of the long tap event. + * @see HandleLongtapEventL */ - IMPORT_C virtual void ExecuteGenericCommandL( TInt aCommand ); + IMPORT_C void LongtapDetectedL( const TPoint& aPosition ); + /** * Set titlepane observer to see title pane subject events * @param aObserver title pane observer to be set */ IMPORT_C virtual void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ); - + /** * From MESMRFieldEventNotifier * Sets field event queue. - * @param aObserver observer to receive field events. + * @param aObserver observer to receive field events. */ IMPORT_C void SetEventQueueL( MESMRFieldEventQueue* aEventQueue ); - + /** * Getter for retrieving outline focus state. * @return ETrue if field is focused EFalse otherwise. */ IMPORT_C TBool HasOutlineFocus() const; - + /** * Getter for focus rect. CMRBackground uses this to get rectangle * it draws background focus to. @@ -227,7 +244,7 @@ * @return focus rectangle. */ IMPORT_C TRect GetFocusRect() const; - + /** * Setter for background focus area. Every field should set * this in their SizeChanged methods. @@ -235,47 +252,108 @@ * @param aFocusRect rectangle for focus. */ IMPORT_C void SetFocusRect( const TRect& aFocusRect ); - + /** * Getter for background focus type. CMRBackground uses this * method to determine how to draw focus. * @return focus type. */ IMPORT_C TESMRFieldFocusType GetFocusType() const; - + /** * Setter for focus type. Every field should set this in e.g. their * ConstructL. * @param aFocusType focus type. */ IMPORT_C void SetFocusType( TESMRFieldFocusType aFocusType ); - + /** * Setter for field mode. Field is either in viewer or editor mode. * @param aModeOfField Mode of the field */ IMPORT_C void SetFieldMode( TESMRFieldMode aMode ); - + /** * Getter for the field mode. * @return Field mode */ IMPORT_C TESMRFieldMode FieldMode() const; + + /** + * Set middle softkey command and name + * @param aCommandId, command to execute on MSK press + * @param aResourceId, resource string to display on MSK + */ + IMPORT_C void ChangeMiddleSoftKeyL( TInt aCommandId, TInt aResourceId); + + /** + * Sets validator for field. + * + * @param aValidator validator to use. + */ + IMPORT_C virtual void SetValidatorL( MESMRFieldValidator* aValidator ); + + /** + * Tests if field control has been activated. + */ + IMPORT_C TBool IsFieldActivated() const; + /** + * Provides possibility for field to dynamically + * intialize context menu. + * + * @param aResourceId Context menu resource ID + * @param aMenuPane Pointer to menu pane + */ + IMPORT_C virtual void DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ); + + /** + * Setter for field view mode. Enumeration TESMRFieldType + * lists possible view modes. + * @param aViewMode View mode of the field + */ + IMPORT_C void SetFieldViewMode( TESMRFieldType aViewMode ); + + /** + * Getter for the field view mode. + * @return Field view mode + */ + IMPORT_C TESMRFieldType FieldViewMode() const; + + /** + * Updates field extension control and takes ownership + * @param aControl Pointer to extension control. + */ + IMPORT_C void UpdateExtControlL( + CCoeControl* aControl ); + + /** + * Set field as locked field(can't be deleted or edited) + */ + IMPORT_C void virtual LockL(); + + /** + * Get lock status of the field + * @return ETrue shows field locked EFalse shows field not locked + */ + IMPORT_C TBool IsLocked(); + protected: - + /** * Sends event to the event queue. * @param aEvent event to send. */ IMPORT_C void NotifyEventL( const MESMRFieldEvent& aEvent ); - + /** * Sends command event to the event queue. * @param aCommand command to send */ IMPORT_C void NotifyEventL( TInt aCommand ); - + /** * Sends event to the event queue asynchronously. * Ownership of the event is transferred to the event queue. @@ -291,18 +369,11 @@ IMPORT_C void NotifyEventAsyncL( TInt aCommand ); /** - * Set middle softkey command and name - * @param aCommandId, command to execute on MSK press - * @param aResourceId, resource string to display on MSK - */ - IMPORT_C void ChangeMiddleSoftKeyL( TInt aCommandId, TInt aResourceId); - - /** * Set middle softkey command - * @param aResourceId, MSK CBA_BUTTON resource id + * @param aResourceId, MSK CBA_BUTTON resource id */ IMPORT_C void ChangeMiddleSoftKeyL( TInt aResourceId ); - + /** * Requests dialog to restore middle softkey to the default one. */ @@ -314,18 +385,54 @@ */ IMPORT_C void SetMiddleSoftKeyVisible( TBool aVisible ); -public: // From CCoeControl + /** + * Long tap event handler for field. Subclasses should execute their + * specific long tap action when this event handler is called. + * + * @param aPosition position of long tap event + */ + IMPORT_C virtual void HandleLongtapEventL( const TPoint& aPosition ); + + /** + * Single tap event handler for field. Subclasses should execute their + * specific single tap action when this event handler is called. + * @param aPosition position of single tap event + * @return ETrue if field handles single tap event. + */ + IMPORT_C virtual TBool HandleSingletapEventL( const TPoint& aPosition ); + /** + * Pointer event handler for field. This is being called if the received + * pointer event has not been handled by single tap or long tap handler. + * @param aPointerEvent the pointer event + * @return ETrue if pointer event was consumed + */ + IMPORT_C virtual TBool HandleRawPointerEventL( const TPointerEvent& aPointerEvent ); + +public: // From base class CCoeControl IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer); IMPORT_C virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); IMPORT_C virtual void SizeChanged(); IMPORT_C virtual TInt CountComponentControls() const; IMPORT_C virtual CCoeControl* ComponentControl( TInt aInd ) const; - IMPORT_C virtual TSize MinimumSize(); + IMPORT_C virtual TSize MinimumSize(); + +private: // From base class CCoeControl + + /** + * Implements pointer event handling for fields. + * Subclasses must not override this but implement the field specific + * actions using the template methods. + * + * @param aPointerEvent the pointer event to handle + * @see HandleSingletapEventL + * @see HandleRawPointerEventL + */ + IMPORT_C void HandlePointerEventL( const TPointerEvent& aPointerEvent ); protected: - + IMPORT_C CESMRField(); - + // From MESMRFieldEventObserver /** * Handles an event from other field. @@ -334,31 +441,40 @@ * @param aEvent event to handle */ IMPORT_C void HandleFieldEventL( const MESMRFieldEvent& aEvent ); - + // From MESMRFieldEventNotifier /** * Returns the event observer interface */ IMPORT_C MESMRFieldEventObserver* EventObserver() const; -protected: - /// Own: Border control. Draws the outline border - CESMRBorderLayer* iBorder; + /** + * Initiates tactile feedback when called + */ + IMPORT_C void HandleTactileFeedbackL(); + + +private: + void AquireTactileFeedback(); + +protected: // data + /// Own: control which is surrounded by border + CCoeControl* iExtControl; /// Ref: Observer for notifying list component MESMRListObserver* iObserver; /// Ref: Id for this field. TESMREntryFieldId iFieldId; - /// Ref: Pointer to layoutmanager - CESMRLayoutManager* iLayout; - /// Own: Flag to inform is this field expandable or not. - TBool iExpandable; - /// Field event queue. + /// Ref: Id for preceding item index. + TInt iPreItemIndex; + /// Ref: Id for current item index. + TInt iCurrentItemIndex; + /// Field event queue. MESMRFieldEventQueue* iEventQueue; /// Custom MSK flag TBool iCustomMsk; - /// Own: + /// Redraw flag TBool iDisableRedraw; - /// + /// Field default value for MSK visibility TBool iDefaultMskVisible; /// Msk disable/enable flag TBool iMskVisible; @@ -369,9 +485,17 @@ /// Background focus rect TRect iFocusRect; /// Background focus type - TESMRFieldFocusType iFocusType; + TESMRFieldFocusType iFocusType; /// Field mode (editor or viewer) TESMRFieldMode iFieldMode; + /// Field view mode. Required for disabling a field + TESMRFieldType iFieldViewMode; + /// Ref: Reference to tactile feedback + MTouchFeedback* iTactileFeedback; + /// Ref: Validator + MESMRFieldValidator* iValidator; + /// Own: lock status + TBool iLocked; }; #endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmriconfield.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmriconfield.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Edit before send list pop-up query -* -*/ - -#ifndef CESMRICONFIELD_H -#define CESMRICONFIELD_H - -#include "cesmrfield.h" -#include "esmrfieldbuilderdef.h" -#include - -class CEikImage; - -/** - * CESMRIconField is base class for all the fields that has icon. - */ -class CESMRIconField : public CESMRField - { -public: - - /** - * C++ default constructor - */ - IMPORT_C CESMRIconField(); - - /** - * C++ Destructor - */ - IMPORT_C virtual ~CESMRIconField(); - -protected: - /** - * Second phase constructor for the CESMRIconField. - * - * @param aIconID - ID for the icon that this field should show - * @param aControl - control that needs to have the highlight or border - * @param aFocusType - Focus type (border/highlight or none) - */ - IMPORT_C void ConstructL( - TAknsItemID aIconID, - CCoeControl* aControl, - TESMRFieldFocusType aFocusType = EESMRBorderFocus ); - - /* - * Calculates icon field border size. - * Sub classes may override this if border size needs to be adjusted. - * - * @return border size - */ - IMPORT_C virtual TSize BorderSize() const; - -public: - // This method can be called by the derived classes to update the icon - IMPORT_C virtual void IconL( TAknsItemID aIconID ); - -public: // From CCoeControl - IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer); - IMPORT_C TInt CountComponentControls() const; - IMPORT_C CCoeControl* ComponentControl( TInt aInd ) const; - IMPORT_C void SizeChanged(); - -private: - /// Own: Pointer to the image that is drawn in the screen - CEikImage* iIcon; - /// Own: Pointer to the bitmap. iIcon is created by using this bitmap - CFbsBitmap* iBitmap; - /// Own: Pointer to the bitmap mask. iIcon is created by using this bitmap mask - CFbsBitmap* iBitmapMask; - /// Own: ID of the needed bitmap - TAknsItemID iIconID; - }; - -#endif //CESMRICONFIELD_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrrichtextlink.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrrichtextlink.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrrichtextlink.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -106,6 +106,18 @@ */ IMPORT_C void SetStartPos( TInt aPos ); + /** + * Gets the MSK command id based on link type. + * @return the command id + */ + TInt MSKCommand() const; + + /** + * Gets the MSK text resource id based on link type. + * @return the resource id. + */ + TInt MSKText() const; + private: // Implementation CESMRRichTextLink( TInt aStartPos, diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrrichtextviewer.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrrichtextviewer.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrrichtextviewer.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,7 +12,7 @@ * Contributors: * * Description : CEikRichTextEditor based Rich Text viewer -* Version : %version: tr1sido#4.1.4 % +* Version : %version: e002sa32#19 % * */ @@ -22,16 +22,16 @@ #include #include #include -#include #include "resmrstatic.h" +#include "mmrcontactmenuobserver.h" class CESMRRichTextLink; -class CESMRLayoutManager; class MESMRFieldEventQueue; // SCROLLING_MOD: List observer forward declaraion class MESMRListObserver; +class MMRFieldScrollObserver; /* * Pure virtual link selection observer. @@ -53,14 +53,14 @@ * CEikRichTextEditor based Rich Text viewer. */ NONSHARABLE_CLASS( CESMRRichTextViewer ) : public CEikRichTextEditor, - public MEikCommandObserver, - public MAknLongTapDetectorCallBack + public MEikCommandObserver, + public MMRContactMenuObserver { public: /* * Two-phase constructor. - * @param aParent if aParent is NULL, - * CEikRichTextEditor is constucted as + * @param aParent if aParent is NULL, + * CEikRichTextEditor is constucted as * window owning control. * @return Created object */ @@ -76,14 +76,20 @@ IMPORT_C void PositionChanged( ); IMPORT_C void FocusChanged( TDrawNow aDrawNow ); IMPORT_C TKeyResponse OfferKeyEventL( - const TKeyEvent &aKeyEvent, + const TKeyEvent &aKeyEvent, TEventCode aType ); - IMPORT_C void SetMargins( TInt sMargin ); - IMPORT_C void SetFontL( - const CFont* aFont, - CESMRLayoutManager* aLayout = NULL ); + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /* + * Sets the given font for the rich text component. Also + * sets the default main area color. Changes take effect + * after AppliyLayoutChanges is called. + * + * @param aFont, the font to be set for the rich text component. + */ + IMPORT_C void SetFontL( const CFont* aFont ); /* * Sets CEikRichTextEditor's text and searches text for emails, @@ -105,7 +111,7 @@ * @param aLink link to be added */ IMPORT_C void AddLinkL(CESMRRichTextLink* aLink ); - + /** * Inserts link to text. * @param aLink link to be added @@ -123,7 +129,7 @@ * * @param aLink link */ - IMPORT_C HBufC* GetLinkTextL( const CESMRRichTextLink& aLink ) const; + IMPORT_C HBufC* GetLinkTextLC( const CESMRRichTextLink& aLink ) const; /* * Returns pointer to new CContactItem constructed from aLink. @@ -134,14 +140,13 @@ */ IMPORT_C CContactItem* CreateContactItemL( const CESMRRichTextLink& aLink ); - /* * Method for cesmrviewerdescriptionfield to set the list observer * * @param aObserver observer that should be notified */ IMPORT_C void SetListObserver( MESMRListObserver* aObserver ); - + /** * Returns height of one row. * @@ -155,9 +160,9 @@ */ IMPORT_C TInt LineCount(); /** - * Returns line number of currenly + * Returns line number of currenly * focused row starting from one. - * + * * @return row's height */ IMPORT_C TInt CurrentLineNumber(); @@ -169,20 +174,14 @@ IMPORT_C void SetActionMenuStatus( TBool aStatus ); /** - * Copies currently selected richtext link associated with + * Copies currently selected richtext link associated with * action menu to the clipboard */ IMPORT_C void CopyCurrentLinkToClipBoardL() const; /** - * Copies currently link value to clipboard - * action menu to the clipboard - */ - IMPORT_C void CopyCurrentLinkValueToClipBoardL() const; - - /** - * convenience method to reset TLS static contactactionmenuhandler - * for classes that only have access to richtextviewer. + * convenience method to reset TLS static contactactionmenuhandler + * for classes that only have access to richtextviewer. * Needed for richtextviewer fields when they lose focus. */ IMPORT_C void ResetActionMenuL() const; @@ -199,28 +198,56 @@ * @return ETrue if link selected */ IMPORT_C TBool LinkSelectedL(); + + /** + * Handles long tap event in rich text viewer. + * @param aPosition position of long tap event. + */ + IMPORT_C void HandleLongtapEventL( TPoint& aPosition ); + + /* + * Sets the given line spacing for the rich text component. + * Changes take effect after AppliyLayoutChanges is called. + * + * @param aLineSpacingInTwips, the line spacing to be used. + */ + IMPORT_C void SetLineSpacingL( TInt aLineSpacingInTwips ); + + /* + * Applies the layout changes to the rich text component. + */ + IMPORT_C void ApplyLayoutChangesL(); + /* + * Set selected link according to the index in the array. + * @param aLinkIndex the index of link need to be selected. + */ + IMPORT_C void SetFocusLink( TInt aLinkIndex ); + + /* + * Get the index of selected link in the array. + * @return The index of selected link in the array. + */ + IMPORT_C TInt GetFocusLink( ) const; + protected: // From MEikCommandObserver - + /** * Process commands from contact menu handler. - * Forwards commands to event observer. + * Forwards commands to event observer. */ void ProcessCommandL( TInt aCommandId ); -protected: // From MAknLongTapDetectorCallBack - virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, - const TPoint& aPenEventScreenLocation ); - protected: // From CEikEdwin /** * Sets the control as ready to be drawn. */ void ActivateL(); -protected: // From CCoeControl - virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); - +protected: // From MMRContactMenuObserver + + void ContactActionQueryComplete(); + private: /* * Private constuctor. @@ -229,28 +256,17 @@ /* * Two-phase constructor. - * @param aParent if aParent is NULL, CEikRichTextEditor + * @param aParent if aParent is NULL, CEikRichTextEditor * is constucted as window owning control. */ void ConstructL(const CCoeControl* aParent ); /* - * CCoeControl::Draw is overridden. - */ - void Draw( const TRect& aRect ) const; - - /* - * Draws right-click icon. - * @param aLink link to which draw icon - */ - void DrawRightClickIconL(const CESMRRichTextLink& aLink) const; - - /* * Highlights link in CEikRichTextEditor. * * @param aLink link to be highlighted */ - void HighlightLink(const CESMRRichTextLink& aLink ); + void HighlightLinkL(const CESMRRichTextLink& aLink ); /* * Private internal function which searches for emails, @@ -260,63 +276,59 @@ */ void SearchLinksL(const TDesC& aText ); - void ScrollViewL( - TInt aNumberOfRows, - TCursorPosition::TMovementType aDirection); TInt FindTextLinkBetweenNextScrollArea( - TInt aStartRow, - TInt aEndRow, + TInt aStartRow, + TInt aEndRow, TCursorPosition::TMovementType aDirection); - TBool SetHighLightToNextLinkL( TCursorPosition::TMovementType aDirection, - TInt aStartRow, - TInt aEndRow); TInt ValidLinkForFocusing( TInt aIndex, TCursorPosition::TMovementType aDirection, TInt aStartRow, TInt aEndRow); - void SetFontColorL( TBool aFocused = EFalse ); - void SetValueL( const CESMRRichTextLink& aLink ); + void ShowContextMenuL(); + + void GetLinkAreaL( TRegion& aRegion, + const CESMRRichTextLink& aLink ) const; + + void ChangeMiddleSoftkeyL( const CESMRRichTextLink& aLink ); + + void UpdateViewL( const TKeyEvent &aKeyEvent ); + private: // Data - /// Own: - TInt iCurrentLinkIndex; - /// Own: + + /// Own: Array of hyperlinks in viewer RPointerArray iLinkList; /// Ref: MESMRRichTextObserver* iLinkObserver; /// Own: RESMRStatic iESMRStatic; - /// Own: - CFbsBitmap* iActionMenuIcon; - /// Own: - CFbsBitmap* iActionMenuIconMask; /// Ref: MESMRListObserver* iObserver; /// Own: - TInt iNumberOfLines; - /// Own: TInt iApproximatelyRowHeight; /// Ref: pointer to font const CFont* iFont; - /// Ref: Pointer to layout manager - CESMRLayoutManager* iLayout; /// Ref: Contact Menu handler CESMRContactMenuHandler* iCntMenuHdlr; /// Ref: Pointer to event queue MESMRFieldEventQueue* iEventQueue; - /// Own: Flag for action menu status - TBool iActionMenuStatus; - /// Own: - TCharFormat iFormat; + /// Own: Rich text link format + TCharFormat iRichTextLinkFormat; + /// Own: Rich text link format mask + TCharFormatMask iRichTextLinkFormatMask; /// Own: - TCharFormatMask iFormatMask; - // Own: - CAknLongTapDetector* iLongTapDetector; - // Indicates is action menu opened - TBool iActionMenuOpen; + TBool iOpenActionMenu; + // Own: Paragraph formatter + CParaFormat* iParaFormat; + // Own: Paragraph formatter mask + TParaFormatMask iParaFormatMask; + // Own: Character formatter + TCharFormat iCharFormat; + // Own: Character formatter mask + TCharFormatMask iCharFormatMask; }; #endif /*CESMRRICHTEXTVIEWER_H*/ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrviewerlabelfield.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cesmrviewerlabelfield.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR base field for viewer fields in CESMRListComponent -* -*/ - - -#ifndef CESMRVIEWERLABELFIELD_H -#define CESMRVIEWERLABELFIELD_H - -#include -#include -#include -// -#include "esmrdef.h" -// - -#include "cesmrfield.h" -#include "cesmrlayoutmgr.h" -#include "cesmriconfield.h" - -class CEikLabel; -class CESMREditor; - -/** - * Base class for most of the fields in viewer mode. - */ -class CESMRViewerLabelField : public CESMRIconField - { -public: - /** - * Creates new CESMRViewerLabelField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - IMPORT_C static CESMRViewerLabelField* NewL(); - - /** - * C++ destructor - */ - IMPORT_C ~CESMRViewerLabelField(); - -public: //from CESMRField - IMPORT_C void InitializeL(); - - IMPORT_C void FocusChanged( TDrawNow aDrawNow ); - -protected: //Implementation - IMPORT_C CESMRViewerLabelField(); - IMPORT_C void ConstructL( TAknsItemID aIconID ); - IMPORT_C void ConstructL(); - -protected: - /// Ref: Label for the text in the field - CEikLabel* iLabel; - }; - -#endif // __CESMRVIEWERLABELFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrattachmentprogressinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrattachmentprogressinfo.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment progress info +* +*/ + +#ifndef CMRATTACHMENTPROGRESSINFO_H +#define CMRATTACHMENTPROGRESSINFO_H + +// INCLUDES +#include +#include + +#include "cmrfilemanager.h" + +// FORWARD DECLARATIONS +class CAsyncCallBack; + +// CLASS DECLRATIONS +/** + * + */ +NONSHARABLE_CLASS( CMRAttachmentProgressInfo ) + : public CBase, public MProgressDialogCallback, public MMRFileManObserver + { + public: + /** + * static c'tor + */ + static CMRAttachmentProgressInfo* NewL( CMRFileManager& aFileMan, MProgressDialogCallback& aObserver ); + /** + * d'tor + */ + ~CMRAttachmentProgressInfo(); + + public: // Inteface + /** + * Start the progress note + * @param aFinalValue End value of the process + */ + void StartProgressNoteL(TInt aFinalValue); + /** + * Stop the progress. The dialog is dismissed. + */ + void StopL(); + + public: // From MFileManObserver + void NotifyStartL( const TDesC& aFilename ); + void NotifyProgress( TInt aBytesCopied ); + void NotifyEnd(); + void NotifyError( TInt aError ); + + protected: // Inteface + /** + * The observer will be notified + */ + void NotifyObserver(); + /** + * Static callback function + */ + static TInt NotifyObserverCallback( TAny* aThis ); + + protected: // From MProgressDialogCallback + void DialogDismissedL (TInt aButtonId); + + private: + CMRAttachmentProgressInfo( CMRFileManager& aFileMan, MProgressDialogCallback& aObserver ); + + private: + /// Ref: + CAknProgressDialog* iProgressDialog; + /// Ref: + CEikProgressInfo* iProgressInfo; + /// Ref: Manages the file copy op + CMRFileManager& iFileMan; + /// Own: Total amount of copied bytes + TInt iBytesTransferred; + /// Ref: Client observer + MProgressDialogCallback& iObserver; + /// Own: To make observer notification async + CAsyncCallBack* iAsynCallBack; + /// Own: Size of the attachment file + TInt iAttachmentSize; + }; + +#endif // CMRATTACHMENTPROGRESSINFO_H +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrattachmentui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrattachmentui.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment fetch utility class for event viewers and editors +* +*/ + +#ifndef CMRATTACHMENTUI_H +#define CMRATTACHMENTUI_H + +// INCLUDES +#include +#include // RFs +#include // TMediaFileType +#include // MProgressDialogCallback +#include +#include + +// FORWARD DECLARATIONS +class MESMRCalEntry; +class CMRAttachmentProgressInfo; +class CMRFileManager; +class CMRGrid; + +// CLASS DECLARATIONS +/** + * Observer for the attachment operation + */ +class MMRAttachmentUiObserver + { + public: + virtual void AttachmentOperationCompleted( MDesC16Array& aArray ) = 0; + + protected: + virtual ~MMRAttachmentUiObserver() { } + }; + +/** + * Class for attachment operation results + */ +class TAttachmentOpResult + { + public: + inline TAttachmentOpResult() : iFiles( NULL ){} + + public: + MDesC16Array* iFiles; + }; + +/** + * Facade class for the attachment related ui operations + */ +NONSHARABLE_CLASS( CMRAttachmentUi ): public CBase, public MProgressDialogCallback, + public MMGFetchVerifier, public MAknFileSelectionObserver + { + public: + /** + * Static c'tor + */ + IMPORT_C static CMRAttachmentUi* NewL(); + + /** + * D'tor + */ + IMPORT_C ~CMRAttachmentUi(); + + public: // Interface + + /** + * Launches Attachment Fetch UI + * Works synchronously + * @param aEntry Entry that will updated with attachments + * @return System wide error code + */ + IMPORT_C TInt LaunchFetchUi( MESMRCalEntry& aEntry ); + + /** + * Launches Attachment Fetch UI + * Works synchronously + * @param aEntry Entry which attachments will be listed. + * Attachments can be added by user also. + * @return System wide error code + */ + IMPORT_C TInt LaunchViewerUi( MESMRCalEntry& aEntry ); + + /** + * Add observer + * @param aObserver Observer for attachment process + */ + IMPORT_C void SetObserver( MMRAttachmentUiObserver& aObserver ); + + IMPORT_C TAttachmentOpResult LatestOperationResult(); + + public: // From MProgressDialogCallback + void DialogDismissedL( TInt aButtonId ); + + public: // From MMGFetchVerifier + TBool VerifySelectionL( const MDesCArray* aSelectedFiles ); + + public: // From MAknFileSelectionObserver + TBool OkToExitL( const TDesC& aDriveAndPath, const TEntry& aEntry ); + + private: // Implementation + CMRAttachmentUi(); + void ConstructL(); + void DoLaunchFetchUiL(); + void DoLaunchViewerUiL(); + TMediaFileType ResolveAttachmentTypeL(); + void StartCopyOpL(); + void UpdateEntryL(); + TBool FileDrmProtectedL( RFile& aFile ); + TBool IsDuplicateNameL( const TDesC& aSelectedFile ); + + private: // Data + /// Ref: Currently active entry + MESMRCalEntry* iEntry; + /// Own: file server sesssion handle + RFs iFsSession; + /// Own: Progress bar + CMRAttachmentProgressInfo* iProgress; + /// Own: File count for files to be copied + TInt iFileCount; + /// Own: Array of files to be copied + CDesCArrayFlat* iFilesToCopy; + /// Own: Array of files to be added without copy + CDesCArrayFlat* iFilesToAdd; + /// Own: File copy manager + CMRFileManager* iManager; + /// Ref: Attachment ui process observer reference + MMRAttachmentUiObserver* iObserver; + }; +#endif // CMRATTACHMENTUI_H +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrbackground.h --- a/meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrbackground.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrbackground.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,8 +22,6 @@ #include "nmrbitmapmanager.h" #include "cesmrfield.h" -class CESMRLayoutManager; - /** * CESMRBorderLayer draws border around the focused control. * @@ -40,7 +38,7 @@ * @param aFocusType * @return Pointer to created and initialized esmr borderlayer object. */ - IMPORT_C static CMRBackground* NewL( CESMRLayoutManager& aLayoutManager ); + IMPORT_C static CMRBackground* NewL(); /** * Destructor. @@ -59,7 +57,7 @@ EViewerFieldWithFocus }; - CMRBackground( CESMRLayoutManager& aLayoutManager ); + CMRBackground(); void CMRBackground::DrawFocus( CWindowGc& aGc, TRect aRect, @@ -67,9 +65,7 @@ TBgType aType ) const; CArrayFixFlat* IconSkinIdL( TBgType aType ) const; - private: - /// Ref: Layout manager. - CESMRLayoutManager& iLayoutManager; + private: // Data }; #endif // CESMRBORDERLAYER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrfilemanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrfilemanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File manager for managing file copy op +* +*/ + +#ifndef CMRFILEMANAGER_H +#define CMRFILEMANAGER_H + +// INCLUDES +#include +#include // RFs +#include // Streams +#include // CDesCArrayFlat + +// FORWARD DECLARATIONS +class MDesC16Array; +// CLASS DECLARATIONS + +/** + * Notification interface for copy operation + */ +class MMRFileManObserver + { + public: + virtual void NotifyStartL( const TDesC& aFilename ) = 0; + virtual void NotifyProgress( TInt aBytesCopied ) = 0; + virtual void NotifyEnd() = 0; + virtual void NotifyError( TInt aError ) = 0; + + protected: + virtual ~MMRFileManObserver(){} + }; +/** + * Class for managing async file copy operations + */ +NONSHARABLE_CLASS( CMRFileManager ) : public CActive + { + public: // c'tor and d'tor + static CMRFileManager* NewL( RFs& aFs ); + + ~CMRFileManager(); + + public: // Interface + void CopyFilesL( MDesC16Array& aFilenameArray ); + void CopyFileL( const TDesC& aSourceFilename, const TDesC& aDestFilename ); + void CopyFileL( RFile& aSource, RFile& aDest ); + void CancelOp(); + + void SetObserver( MMRFileManObserver& aObserver ); + MDesC16Array& CopiedFiles() const; + + public: // From CActive + void RunL(); + TInt RunError( TInt aError ); + void DoCancel(); + + private: // Impl + CMRFileManager( RFs& aFs ); + void ConstructL(); + void AsyncOp(); + void CopyFileL(); + void PrepareNextFileL(); + + private: // Data + enum TState + { + ECopyFile, + ECancelled, + EDone + } iState; + + RFs& iFs; + /// + RFileReadStream iReadStream; + /// + RFileWriteStream iWriteStream; + /// Own: + CDesCArrayFlat* iFileArray; + /// Own: + CDesCArrayFlat* iOutputFileArray; + /// Own: current file index + TInt iFileIndex; + /// Own: + HBufC* iCurrentFilename; + /// Own: + HBufC* iTempFilename; + /// Ref: + MMRFileManObserver* iObserver; + }; + +#endif // CMRFILEMANAGER_H +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrgrid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/inc/cmrgrid.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR grid impl. +* +*/ +#ifndef CMRGRID_H +#define CMRGRID_H + +// INCLUDES +#include +//#include +//#include + +// FORWARD DECLARATIONS +class CAknGrid; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRGrid ) : public CBase + { + public: + /** + * Executes selection grid. + * + * @param aSelectedOption on return contains the selection + * @return ETrue if user selected an option. Otherwise EFalse. + */ + static TBool ExecuteL( TInt& aSelectedOption ); + + private: + CMRGrid(); + virtual ~CMRGrid(); + void AddGridIconsL(); + TBool ShowGridL( TInt& aSelectedOption ); + + private: + /// Own: Grid control + CAknGrid* iGrid; + }; + +#endif // CMRGRID_H +// End of file + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrborderlayer.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrborderlayer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class draws focus for the fields -* -*/ - -#include "emailtrace.h" -#include "cesmrborderlayer.h" - -#include -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRBorderLayer* CESMRBorderLayer::NewL( - CCoeControl* aExt, TESMRFieldFocusType aFocusType ) - { - FUNC_LOG; - CESMRBorderLayer* self = new (ELeave) CESMRBorderLayer( aExt, aFocusType ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::CESMRBorderLayer -// --------------------------------------------------------------------------- -// -CESMRBorderLayer::CESMRBorderLayer( - CCoeControl* aExtControl, - TESMRFieldFocusType aFocusType ) - :iExtControl( aExtControl ), - iFocus( EFalse ), - iFocusType( aFocusType ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::~CESMRBorderLayer -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRBorderLayer::~CESMRBorderLayer() - { - FUNC_LOG; - delete iExtControl; - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::ConstructL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::ConstructL() // codescanner::LFunctionCantLeave - { - FUNC_LOG; - SetBackground( this ); - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::SetContainerWindowL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::SetContainerWindowL( - const CCoeControl& aContainer) - { - FUNC_LOG; - CCoeControl::SetContainerWindowL( aContainer ); - if ( iExtControl ) - { - iExtControl->SetContainerWindowL( aContainer ); - } - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::SetOutlineFocusL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::SetOutlineFocusL( // codescanner::LFunctionCantLeave - TBool aFocus ) - { - FUNC_LOG; - iFocus = aFocus; - if ( iExtControl ) - { - iExtControl->SetFocus( aFocus ); - } - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::HasFocus -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CESMRBorderLayer::HasFocus() const - { - FUNC_LOG; - return iFocus; - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::Draw -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::Draw( - CWindowGc &/*aGc*/, - const CCoeControl &/*aControl*/, - const TRect& /*aRect*/) const - { - FUNC_LOG; - // Do nothing. Deprecated. - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::GetTextDrawer -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::GetTextDrawer( - CCoeTextDrawerBase*& /*aTextDrawer*/, - const CCoeControl* /*aDrawingControl*/) const - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::CountComponentControls -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRBorderLayer::CountComponentControls() const - { - FUNC_LOG; - TInt count( 0 ); - if ( iExtControl ) - { - ++count; - } - return count; - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::ComponentControl -// --------------------------------------------------------------------------- -// -EXPORT_C CCoeControl* CESMRBorderLayer::ComponentControl( TInt /*aInd*/ ) const - { - FUNC_LOG; - return iExtControl; - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::SizeChanged -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::SizeChanged() - { - FUNC_LOG; - TRect rect = Rect(); - if ( iExtControl ) - { - iExtControl->SetRect( rect ); - } - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::OfferKeyEventL -// --------------------------------------------------------------------------- -// -EXPORT_C TKeyResponse CESMRBorderLayer::OfferKeyEventL( - const TKeyEvent& aEvent, TEventCode aType ) - { - FUNC_LOG; - if ( iExtControl ) - { - return iExtControl->OfferKeyEventL( aEvent, aType ); - } - return EKeyWasNotConsumed; - } - -// --------------------------------------------------------------------------- -// CESMRBorderLayer::SetLayoutManager() -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRBorderLayer::SetLayoutManager( - CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - iLayout = aLayout; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmreditor.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmreditor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmreditor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,8 +15,12 @@ * */ +#include "cesmreditor.h" +#include "nmrcolormanager.h" +#include "esmrfieldbuilderdef.h" +#include "esmrdef.h" +#include "mesmrlistobserver.h" -#include "emailtrace.h" #include #include #include @@ -24,9 +28,8 @@ #include #include -#include "cesmreditor.h" -#include "cesmrlayoutmgr.h" -#include "esmrfieldbuilderdef.h" + +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== @@ -125,7 +128,7 @@ // edwinTlY negative if ( cursorLowerPosition > ( listHeight - edwinTlY )) { - iObserver->MoveListAreaUpL(RowHeight()); + iObserver->RePositionFields( -RowHeight() ); } } else if ( aKeyEvent.iCode == EKeyUpArrow && iObserver) @@ -140,7 +143,7 @@ { if ( (cursorPos.iY - firstRowExtra.iY * 2) < (-hiddenHeight)) { - iObserver->MoveListAreaDownL(RowHeight()); + iObserver->RePositionFields( RowHeight() ); } } } @@ -151,17 +154,42 @@ } // --------------------------------------------------------------------------- -// CESMREditor::ClearSelectionAndSetTextL +// CESMREditor::FocusChanged // --------------------------------------------------------------------------- // EXPORT_C void CESMREditor::FocusChanged(TDrawNow aDrawNow) { FUNC_LOG; + CEikRichTextEditor::FocusChanged( aDrawNow ); + TRAPD( error, TryToSetSelectionL() ); if ( error != KErrNone ) { - CEikonEnv::Static()->HandleError( error );// codescanner::eikonenvstatic + iCoeEnv->HandleError( error );// codescanner::eikonenvstatic + } + } + +// --------------------------------------------------------------------------- +// CESMREditor::HandlePointerEventL +// --------------------------------------------------------------------------- +// + +void CESMREditor::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + if ( Rect().Contains( aPointerEvent.iPosition ) ) + { + switch ( aPointerEvent.iType ) + { + case TPointerEvent::EButton1Down: + case TPointerEvent::EButton1Up: + { + CEikRichTextEditor::HandlePointerEventL( aPointerEvent ); + break; + } + default: + break; + } } } @@ -196,22 +224,41 @@ CEikEdwin* aEdwin,TEdwinEvent aEventType ) { FUNC_LOG; - if ( aEdwin == this && aEventType == EEventNavigation && iObserver) + if ( aEdwin == this ) { - TInt curPos = CursorPos (); - TInt textLength = TextLength(); - // Update viewarea scrolling in cases where the cursor location - // is changed directly from bottom to upmost position or vise versa. - if ( CursorPos () == TextLength() ) - { - // KErrNotFound as field id is interpret as focused field: - iObserver->ScrollItemVisible( KErrNotFound ); - } - if ( CursorPos () == 0 ) - { - // KErrNotFound as field id is interpret as focused field: - iObserver->ScrollItemVisible( KErrNotFound ); - } + switch( aEventType ) + { + case EEventNavigation: + { + if ( iObserver ) + { + TInt curPos = CursorPos (); + TInt textLength = TextLength(); + // Update viewarea scrolling in cases where the cursor location + // is changed directly from bottom to upmost position or vise versa. + if ( CursorPos () == TextLength() || CursorPos () == 0 ) + { + // KErrNotFound as field id is interpret as focused field: + iObserver->ScrollControlVisible( KErrNotFound ); + } + } + break; + } + + case EEventTextUpdate: + { + if ( IsVisible() ) + { + DrawDeferred(); + } + break; + } + + default: + { + break; + } + } } } @@ -233,8 +280,7 @@ // CESMREditor::SetFontL // --------------------------------------------------------------------------- // -EXPORT_C void CESMREditor::SetFontL( - const CFont* aFont, CESMRLayoutManager* aLayout ) +EXPORT_C void CESMREditor::SetFontL( const CFont* aFont ) { FUNC_LOG; const CFont* font = aFont; @@ -256,9 +302,14 @@ formatMask.SetAttrib( EAttFontHeight ); formatMask.SetAttrib( EAttFontPosture ); formatMask.SetAttrib( EAttFontStrokeWeight ); + formatMask.SetAttrib(EAttFontHighlightColor); + formatMask.SetAttrib( EAttColor ); - charFormat.iFontPresentation.iTextColor = aLayout->NormalTextColor(); - formatMask.SetAttrib( EAttColor ); + charFormat.iFontPresentation.iTextColor = + NMRColorManager::Color( NMRColorManager::EMRMainAreaTextColor ); + + charFormat.iFontPresentation.iHighlightColor = + NMRColorManager::Color( NMRColorManager::EMRCutCopyPasteHighlightColor ); CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL( paraFormat, paraFormatMask ); @@ -295,7 +346,9 @@ EXPORT_C TInt CESMREditor::LineCount( ) const { FUNC_LOG; - return TextLayout()->GetLineNumber ( TextLength ( ) ); + // first line is zero, that's why + 1 is added + TInt lineCount( TextLayout()->GetLineNumber ( TextLength ( ) ) + 1 ); + return lineCount; } // --------------------------------------------------------------------------- @@ -352,7 +405,7 @@ } // --------------------------------------------------------------------------- -// CESMREditor::LineCount +// CESMREditor::SetListObserver // --------------------------------------------------------------------------- // EXPORT_C void CESMREditor::SetListObserver( MESMRListObserver* aObserver ) @@ -379,7 +432,7 @@ TInt aTextLimit, TInt aEdwinFlags ) { FUNC_LOG; - CEikRichTextEditor::ConstructL (aParent, aNumberOfLines, aTextLimit, + CEikRichTextEditor::ConstructL ( aParent, aNumberOfLines, aTextLimit, aEdwinFlags ); AddEdwinObserverL(this); @@ -387,10 +440,6 @@ SetUpperFullFormattingLength( aTextLimit ); iLimitLength = aTextLimit; - - SetAlignment ( CESMRLayoutManager::IsMirrored ( ) ? EAknEditorAlignRight - : EAknEditorAlignLeft ); - SetHighlightStyleL ( EEikEdwinHighlightLink ); } // --------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrfield.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,12 +18,11 @@ #include "cesmrfield.h" #include "esmrcommands.h" -#include "cesmrborderlayer.h" -#include "cesmrlayoutmgr.h" #include "nmrlayoutmanager.h" #include "mesmrfieldeventqueue.h" #include "cesmrfieldcommandevent.h" #include "cmrbackground.h" +#include "esmrcommands.h" #include "emailtrace.h" @@ -31,20 +30,22 @@ #include #include #include -#include -#include +#include +#include +#include // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- -// CESMRField::CESMRField() +// CESMRField::CESMRField // --------------------------------------------------------------------------- // EXPORT_C CESMRField::CESMRField() : iCustomMsk( EFalse ), iDisableRedraw( EFalse ), iDefaultMskVisible( EFalse ), - iMskVisible( EFalse ) + iMskVisible( EFalse ), + iLocked( EFalse ) { FUNC_LOG; // do nothing @@ -52,13 +53,13 @@ // --------------------------------------------------------------------------- -// CESMRField::~CESMRField() +// CESMRField::~CESMRField // --------------------------------------------------------------------------- // EXPORT_C CESMRField::~CESMRField() { FUNC_LOG; - delete iBorder; + delete iExtControl; if ( iEventQueue ) { iEventQueue->RemoveObserver( this ); @@ -67,37 +68,23 @@ } // --------------------------------------------------------------------------- -// CESMRField::SetExpandable() +// CESMRField::ConstructL // --------------------------------------------------------------------------- // -EXPORT_C void CESMRField::SetExpandable() +EXPORT_C void CESMRField::ConstructL( + CCoeControl* aControl ) { FUNC_LOG; - iExpandable = ETrue; + iExtControl = aControl; + + // TODO: This should be made in ConstructL instead as soon we + // get rid of old CESMRLayoutManager. + iBackground = CMRBackground::NewL(); + this->SetBackground( iBackground ); } // --------------------------------------------------------------------------- -// CESMRField::IsExpandable() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CESMRField::IsExpandable() const - { - FUNC_LOG; - return iExpandable; - } - -// --------------------------------------------------------------------------- -// CESMRField::ExpandedHeight() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRField::ExpandedHeight() const - { - FUNC_LOG; - return 0; - } - -// --------------------------------------------------------------------------- -// CESMRField::InitializeL() +// CESMRField::InitializeL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::InitializeL() @@ -107,7 +94,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::FontChangedL() +// CESMRField::FontChangedL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::FontChangedL() @@ -118,7 +105,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::SetFieldId() +// CESMRField::SetFieldId // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetFieldId( TESMREntryFieldId aFieldId ) @@ -127,8 +114,30 @@ iFieldId = aFieldId; } + // --------------------------------------------------------------------------- -// CESMRField::FieldId() +// CESMRField::SetPreItemIndex +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::SetPreItemIndex( TInt aPreItemIndex ) + { + FUNC_LOG; + iPreItemIndex = aPreItemIndex; + } + + +// --------------------------------------------------------------------------- +// CESMRField::SetCurrentItemIndex +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::SetCurrentItemIndex( TInt aCurrentItemIndex ) + { + FUNC_LOG; + iCurrentItemIndex = aCurrentItemIndex; + } + +// --------------------------------------------------------------------------- +// CESMRField::FieldId // --------------------------------------------------------------------------- // EXPORT_C TESMREntryFieldId CESMRField::FieldId() const @@ -138,15 +147,23 @@ } // --------------------------------------------------------------------------- -// CESMRField::ConstructL() +// CESMRField::PreItemIndex // --------------------------------------------------------------------------- // -EXPORT_C void CESMRField::ConstructL( - CCoeControl* aControl, TESMRFieldFocusType aFocusType ) +EXPORT_C TInt CESMRField::PreItemIndex() const { FUNC_LOG; - iBorder = CESMRBorderLayer::NewL( aControl, aFocusType ); - iBorder->SetParent( this ); + return iPreItemIndex; + } + +// --------------------------------------------------------------------------- +// CESMRField::CurrentItemIndex +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRField::CurrentItemIndex() const + { + FUNC_LOG; + return iCurrentItemIndex; } // --------------------------------------------------------------------------- @@ -157,9 +174,9 @@ { FUNC_LOG; TRect rect( Rect() ); - if ( iBorder ) + if ( iExtControl ) { - iBorder->SetRect( rect ); + iExtControl->SetRect( rect ); } } @@ -171,7 +188,7 @@ { FUNC_LOG; TInt count( 0 ); - if ( iBorder ) + if ( iExtControl ) { ++count; } @@ -180,17 +197,17 @@ } // --------------------------------------------------------------------------- -// CESMRField::ComponentControl() +// CESMRField::ComponentControl // --------------------------------------------------------------------------- // EXPORT_C CCoeControl* CESMRField::ComponentControl( TInt /*aInd*/ ) const { FUNC_LOG; - return iBorder; + return iExtControl; } // --------------------------------------------------------------------------- -// CESMRField::MinimumSize() +// CESMRField::MinimumSize // --------------------------------------------------------------------------- // EXPORT_C TSize CESMRField::MinimumSize() @@ -204,21 +221,53 @@ } // --------------------------------------------------------------------------- -// CESMRField::SetContainerWindowL() +// CESMRField::HandlePointerEventL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::HandlePointerEventL( + const TPointerEvent& aPointerEvent ) + { + FUNC_LOG; + // Sanity check that pointer event occurs in field area + if ( Rect().Contains( aPointerEvent.iPosition ) ) + { + if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if ( !HandleSingletapEventL( aPointerEvent.iPosition ) ) + { + // Provide raw pointer event to field + HandleRawPointerEventL( aPointerEvent ); + } + } + else // Provide other pointer events to fields + { + if ( !HandleRawPointerEventL( aPointerEvent ) ) + { + // Provide pointer events to child components if field + // did not already consume the event + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + } + } + } + +// --------------------------------------------------------------------------- +// CESMRField::SetContainerWindowL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetContainerWindowL(const CCoeControl& aContainer) { FUNC_LOG; CCoeControl::SetContainerWindowL( aContainer ); - if ( iBorder ) + if ( iExtControl ) { - iBorder->SetContainerWindowL( aContainer ); + iExtControl->SetContainerWindowL( aContainer ); + iExtControl->SetParent( this ); } } // --------------------------------------------------------------------------- -// CESMRField::SetListObserver() +// CESMRField::SetListObserver // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetListObserver( MESMRListObserver* aObserver ) @@ -229,7 +278,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::SetListObserver() +// CESMRField::ListObserverSet // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::ListObserverSet() @@ -239,49 +288,31 @@ } // --------------------------------------------------------------------------- -// CESMRField::SetLayoutManager() +// CESMRField::OfferKeyEventL // --------------------------------------------------------------------------- // -EXPORT_C void CESMRField::SetLayoutManager( CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - iLayout = aLayout; - if ( iBorder ) - { - iBorder->SetLayoutManager( iLayout ); - } - TRAP_IGNORE( - iBackground = CMRBackground::NewL( *aLayout ); - this->SetBackground( iBackground ); - ); - } - -// --------------------------------------------------------------------------- -// CESMRField::OfferKeyEventL() -// --------------------------------------------------------------------------- -// -EXPORT_C TKeyResponse CESMRField::OfferKeyEventL( +EXPORT_C TKeyResponse CESMRField::OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ) { FUNC_LOG; - if ( iBorder ) + if ( iExtControl ) { - return iBorder->OfferKeyEventL( aEvent, aType ); + return iExtControl->OfferKeyEventL( aEvent, aType ); } return EKeyWasNotConsumed; } // --------------------------------------------------------------------------- -// CESMRField::SetOutlineFocusL() +// CESMRField::SetOutlineFocusL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetOutlineFocusL( TBool aFocus ) { FUNC_LOG; iOutlineFocus = aFocus; - if ( iBorder ) + if ( iExtControl ) { - iBorder->SetOutlineFocusL( aFocus ); + iExtControl->SetFocus( aFocus ); } if ( aFocus ) { @@ -300,7 +331,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::OkToLoseFocusL() +// CESMRField::OkToLoseFocusL // --------------------------------------------------------------------------- // EXPORT_C TBool CESMRField::OkToLoseFocusL( // codescanner::LFunctionCantLeave @@ -323,7 +354,18 @@ } // --------------------------------------------------------------------------- -// CESMRField::InternalizeL() +// CESMRField::GetCursorLineVerticalPos +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower) + { + FUNC_LOG; + aUpper = 0; + aLower = Rect().iBr.iY - Rect().iTl.iY; + } + +// --------------------------------------------------------------------------- +// CESMRField::InternalizeL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::InternalizeL( // codescanner::LFunctionCantLeave @@ -334,7 +376,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::ExternalizeL() +// CESMRField::ExternalizeL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::ExternalizeL( // codescanner::LFunctionCantLeave @@ -345,21 +387,32 @@ } // --------------------------------------------------------------------------- -// CESMRField::ExecuteGenericCommandL() +// CESMRField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -EXPORT_C void CESMRField::ExecuteGenericCommandL( // codescanner::LFunctionCantLeave - TInt /*aCommand*/ ) +EXPORT_C TBool CESMRField::ExecuteGenericCommandL( TInt /*aCommand*/ ) { FUNC_LOG; - /* Empty implementation, subclasses should overwrite */ + return EFalse; + /* Subclasses should overwrite */ } // --------------------------------------------------------------------------- -// CESMRField::SetTitlePaneObserver() +// CESMRField::LongtapDetectedL // --------------------------------------------------------------------------- // -EXPORT_C void CESMRField::SetTitlePaneObserver( +EXPORT_C void CESMRField::LongtapDetectedL( const TPoint& aPosition ) + { + FUNC_LOG; + + HandleLongtapEventL( aPosition ); + } + +// --------------------------------------------------------------------------- +// CESMRField::SetTitlePaneObserver +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::SetTitlePaneObserver( MESMRTitlePaneObserver* /*aObserver*/ ) { FUNC_LOG; @@ -367,109 +420,103 @@ } // --------------------------------------------------------------------------- -// CESMRField::ChangeMiddleSoftKeyL() +// CESMRField::ChangeMiddleSoftKeyL // --------------------------------------------------------------------------- // -EXPORT_C void CESMRField::ChangeMiddleSoftKeyL( TInt aCommandId, - TInt aResourceId ) +EXPORT_C void CESMRField::ChangeMiddleSoftKeyL( + TInt aCommandId, + TInt aResourceId ) { FUNC_LOG; - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if ( cba ) + + if ( AknLayoutUtils::MSKEnabled() ) { - HBufC* middleSKText = StringLoader::LoadLC( aResourceId, - iCoeEnv ); - cba->SetCommandL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - aCommandId, *middleSKText ); - CleanupStack::PopAndDestroy( middleSKText ); - if ( !iMskVisible ) + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if ( cba ) { - cba->MakeCommandVisibleByPosition( + HBufC* middleSKText = StringLoader::LoadLC( aResourceId, + iCoeEnv ); + cba->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition, - ETrue ); - iMskVisible = ETrue; + aCommandId, *middleSKText ); + CleanupStack::PopAndDestroy( middleSKText ); + if ( !iMskVisible ) + { + cba->MakeCommandVisibleByPosition( + CEikButtonGroupContainer::EMiddleSoftkeyPosition, + ETrue ); + iMskVisible = ETrue; + } + cba->DrawDeferred(); + iCustomMsk = ETrue; } - cba->DrawDeferred(); - iCustomMsk = ETrue; } } // --------------------------------------------------------------------------- -// CESMRField::ChangeMiddleSoftKeyL() +// CESMRField::SetValidatorL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::SetValidatorL( MESMRFieldValidator* aValidator ) + { + FUNC_LOG; + + iValidator = aValidator; + } + +// --------------------------------------------------------------------------- +// CESMRField::IsFieldActivated +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRField::IsFieldActivated() const + { + FUNC_LOG; + + return IsActivated(); + } + +// --------------------------------------------------------------------------- +// CESMRField::DynInitMenuPaneL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::DynInitMenuPaneL( + TInt /*aResourceId*/, + CEikMenuPane* /*aMenuPane*/ ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRField::ChangeMiddleSoftKeyL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::ChangeMiddleSoftKeyL( TInt aResourceId ) { FUNC_LOG; - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if ( cba ) + + if ( AknLayoutUtils::MSKEnabled() ) { - cba->SetCommandL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - aResourceId ); - if ( !iMskVisible ) + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if ( cba ) { - cba->MakeCommandVisibleByPosition( + cba->SetCommandL( CEikButtonGroupContainer::EMiddleSoftkeyPosition, - ETrue ); - iMskVisible = ETrue; + aResourceId ); + if ( !iMskVisible ) + { + cba->MakeCommandVisibleByPosition( + CEikButtonGroupContainer::EMiddleSoftkeyPosition, + ETrue ); + iMskVisible = ETrue; + } + cba->DrawDeferred(); + iCustomMsk = ETrue; } - cba->DrawDeferred(); - iCustomMsk = ETrue; - } + } } // --------------------------------------------------------------------------- -// CESMRField::CalculateVisibleRect() -// --------------------------------------------------------------------------- -// -EXPORT_C TRect CESMRField::CalculateVisibleRect( TRect aRect ) - { - FUNC_LOG; - TRect targetRect(aRect); - // highlight bitmap target size: - TSize targetSize( Rect().Size() ); - - // fetch the size of main pane - TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect( - AknLayoutUtils::EMainPane, mainPaneRect ); - - // the list drawable height: - TInt listAreaHeight = mainPaneRect.Height() - iLayout->TitlePaneHeight(); - - // if the size of field is larger than drawable height - // let's downsize it: - if ( Rect().Size().iHeight > listAreaHeight ) - { - TInt shownHeight = Rect().Size().iHeight + Rect().iTl.iY; - // check should the highlight be smaller than - // whole screen: - if ( shownHeight < listAreaHeight ) - { - targetSize.iHeight = shownHeight; - } - else - { - targetSize.iHeight = listAreaHeight; - } - } - - // If part of the rect is not visible: - if ( targetRect.iTl.iY < 0 ) - { - targetRect.iTl.iY = 0; - } - - // visible height: - targetRect.SetHeight(listAreaHeight); - - return targetRect; - } - -// --------------------------------------------------------------------------- -// CESMRField::SetEventQueueL() +// CESMRField::SetEventQueueL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetEventQueueL( MESMRFieldEventQueue* aEventQueue ) @@ -479,67 +526,72 @@ { if ( aEventQueue ) { - // Add self to new queue + // Add self to new queue aEventQueue->AddObserverL( this ); } - + if ( iEventQueue ) { // Remove self from old queue iEventQueue->RemoveObserver( this ); } - + iEventQueue = aEventQueue; } } // --------------------------------------------------------------------------- -// CESMRField::HasOutlineFocus() +// CESMRField::HasOutlineFocus // --------------------------------------------------------------------------- // EXPORT_C TBool CESMRField::HasOutlineFocus() const { + FUNC_LOG; return iOutlineFocus; } // --------------------------------------------------------------------------- -// CESMRField::GetFocusRect() +// CESMRField::GetFocusRect // --------------------------------------------------------------------------- // EXPORT_C TRect CESMRField::GetFocusRect() const { + FUNC_LOG; return iFocusRect; } // --------------------------------------------------------------------------- -// CESMRField::SetFocusRect() +// CESMRField::SetFocusRect // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetFocusRect( const TRect& aFocusRect ) { + FUNC_LOG; iFocusRect = aFocusRect; } // --------------------------------------------------------------------------- -// CESMRField::GetFocusType() +// CESMRField::GetFocusType // --------------------------------------------------------------------------- // EXPORT_C TESMRFieldFocusType CESMRField::GetFocusType() const { + FUNC_LOG; return iFocusType; } // --------------------------------------------------------------------------- -// CESMRField::SetFocusType() +// CESMRField::SetFocusType // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetFocusType( TESMRFieldFocusType aFocusType ) { + FUNC_LOG; iFocusType = aFocusType; } // --------------------------------------------------------------------------- -// CESMRField::NotifyEventL() +// CESMRField::NotifyEventL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::NotifyEventL( const MESMRFieldEvent& aEvent ) @@ -552,7 +604,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::NotifyEventL() +// CESMRField::NotifyEventL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::NotifyEventL( TInt aCommand ) @@ -565,7 +617,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::NotifyEventAsyncL() +// CESMRField::NotifyEventAsyncL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::NotifyEventAsyncL( MESMRFieldEvent* aEvent ) @@ -578,7 +630,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::NotifyEventAsyncL() +// CESMRField::NotifyEventAsyncL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::NotifyEventAsyncL( TInt aCommand ) @@ -591,44 +643,105 @@ } // --------------------------------------------------------------------------- -// CESMRField::RestoreMiddleSoftKeyL() +// CESMRField::RestoreMiddleSoftKeyL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::RestoreMiddleSoftKeyL() { FUNC_LOG; - if ( iMskVisible != iDefaultMskVisible ) + if ( AknLayoutUtils::MSKEnabled() ) { - SetMiddleSoftKeyVisible( iDefaultMskVisible ); - } - - if ( iCustomMsk ) - { - NotifyEventL( EESMRCmdRestoreMiddleSoftKey ); - iCustomMsk = EFalse; + if ( iMskVisible != iDefaultMskVisible ) + { + SetMiddleSoftKeyVisible( iDefaultMskVisible ); + } + + if ( iCustomMsk ) + { + NotifyEventL( EESMRCmdRestoreMiddleSoftKey ); + iCustomMsk = EFalse; + } } } +// --------------------------------------------------------------------------- +// CESMRField::SetMiddleSoftKeyVisible +// --------------------------------------------------------------------------- +// EXPORT_C void CESMRField::SetMiddleSoftKeyVisible( TBool aVisible ) { FUNC_LOG; - if ( iMskVisible != aVisible ) + if ( AknLayoutUtils::MSKEnabled() ) { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if ( cba ) + if ( iMskVisible != aVisible ) { - cba->MakeCommandVisibleByPosition( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - aVisible ); - iMskVisible = aVisible; // Visibility has been changed + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if ( cba ) + { + cba->MakeCommandVisibleByPosition( + CEikButtonGroupContainer::EMiddleSoftkeyPosition, + aVisible ); + iMskVisible = aVisible; // Visibility has been changed + } } + + iCustomMsk = ETrue; // Field has modified editor default MSK } - - iCustomMsk = ETrue; // Field has modified editor default MSK + } + +// --------------------------------------------------------------------------- +// CESMRField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::HandleLongtapEventL( const TPoint& /*aPosition*/ ) + { + FUNC_LOG; + // Default action for long tap event. + ExecuteGenericCommandL( EESMRCmdLongtapDetected ); } // --------------------------------------------------------------------------- -// CESMRField::HandleFieldEventL() +// CESMRField::HandleSingletapEventL +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRField::HandleSingletapEventL( const TPoint& /*aPosition*/ ) + { + FUNC_LOG; + // Subclasses may override for field specific actions + return EFalse; + } + +// --------------------------------------------------------------------------- +// CESMRField::HandleRawPointerEventL +// Default implementation for pointer event handling in field +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRField::HandleRawPointerEventL( + const TPointerEvent& aPointerEvent ) + { + FUNC_LOG; + + if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + // Default action for touch release + if ( !ExecuteGenericCommandL( EAknCmdOpen ) ) + { + // If the base class implementation does not use the command + // then the pointer event is propagated to children. + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + } + else + { + // Propagate the pointer event to child components + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + + return ETrue; + } + +// --------------------------------------------------------------------------- +// CESMRField::HandleFieldEventL // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::HandleFieldEventL( const MESMRFieldEvent& aEvent ) @@ -645,7 +758,7 @@ } // --------------------------------------------------------------------------- -// CESMRField::EventObserver() +// CESMRField::EventObserver // --------------------------------------------------------------------------- // EXPORT_C MESMRFieldEventObserver* CESMRField::EventObserver() const @@ -655,21 +768,105 @@ } // --------------------------------------------------------------------------- -// CESMRField::SetFieldMode() +// CESMRField::SetFieldMode // --------------------------------------------------------------------------- // EXPORT_C void CESMRField::SetFieldMode( TESMRFieldMode aMode ) { + FUNC_LOG; iFieldMode = aMode; } // --------------------------------------------------------------------------- -// CESMRField::FieldMode() +// CESMRField::FieldMode // --------------------------------------------------------------------------- // EXPORT_C TESMRFieldMode CESMRField::FieldMode() const { + FUNC_LOG; return iFieldMode; } + +// --------------------------------------------------------------------------- +// CESMRField::SetFieldViewMode +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::SetFieldViewMode( TESMRFieldType aViewMode ) + { + FUNC_LOG; + iFieldViewMode = aViewMode; + } + +// --------------------------------------------------------------------------- +// CESMRField::FieldViewMode +// --------------------------------------------------------------------------- +// +EXPORT_C TESMRFieldType CESMRField::FieldViewMode() const + { + FUNC_LOG; + return iFieldViewMode; + } + +// --------------------------------------------------------------------------- +// CESMRField::UpdateExtControlL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::UpdateExtControlL( + CCoeControl* aControl ) + { + FUNC_LOG; + delete iExtControl; + iExtControl = aControl; + } + +// --------------------------------------------------------------------------- +// CESMRField::Lock +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::LockL() + { + iLocked = ETrue; + } + +// --------------------------------------------------------------------------- +// CESMRField::IsLocked +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRField::IsLocked() + { + return iLocked; + } + + +// --------------------------------------------------------------------------- +// CESMRField::HandleTactileFeedbackL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRField::HandleTactileFeedbackL() + { + FUNC_LOG; + + AquireTactileFeedback(); + + if ( iTactileFeedback && iTactileFeedback->FeedbackEnabledForThisApp() ) + { + iTactileFeedback->InstantFeedback( ETouchFeedbackBasic ); + } + } + +// --------------------------------------------------------------------------- +// CESMRField::AquireTactileFeedback +// --------------------------------------------------------------------------- +// +void CESMRField::AquireTactileFeedback() + { + if( !iTactileFeedback ) + { + // Aquire tactile feedback pointer from TLS + iTactileFeedback = MTouchFeedback::Instance(); + } + } + + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmriconfield.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmriconfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Base class for icon fields -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include - -#include "cesmriconfield.h" -#include "cesmrborderlayer.h" -#include "esmrhelper.h" -#include "cesmrlayoutmgr.h" - -using namespace ESMRLayout; - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRIconField::CESMRIconField -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRIconField::CESMRIconField() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRIconField::~CESMRIconField -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRIconField::~CESMRIconField() - { - FUNC_LOG; - delete iIcon; - delete iBitmap; - delete iBitmapMask; - } - -// --------------------------------------------------------------------------- -// CESMRIconField::ConstructL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRIconField::ConstructL( - TAknsItemID aIconID, - CCoeControl* aControl, - TESMRFieldFocusType aFocusType ) - { - FUNC_LOG; - IconL( aIconID ); - iIconID = aIconID; - CESMRField::ConstructL( aControl, aFocusType ); - } - -// --------------------------------------------------------------------------- -// CESMRIconField::SetContainerWindowL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRIconField::SetContainerWindowL( - const CCoeControl& aContainer ) - { - FUNC_LOG; - CESMRField::SetContainerWindowL( aContainer ); - - if ( iIcon ) - { - iIcon->SetContainerWindowL( aContainer ); - } - } - -// --------------------------------------------------------------------------- -// CESMRIconField::IconL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRIconField::IconL( TAknsItemID aIconID ) - { - FUNC_LOG; - - // update the icon id: - iIconID = aIconID; - - delete iIcon; - iIcon = NULL; - delete iBitmap; - iBitmap = NULL; - delete iBitmapMask; - iBitmapMask = NULL; - - TInt fileIndex(-1); - TInt fileMaskIndex(-1); - - CESMRLayoutManager::SetBitmapFallback( aIconID, fileIndex, fileMaskIndex ); - - TFileName bitmapFilePath; - ESMRHelper::LocateResourceFile( - KESMRMifFile, - KDC_APP_BITMAP_DIR, - bitmapFilePath); - - AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - aIconID, - iBitmap, - iBitmapMask, - bitmapFilePath, - fileIndex, - fileMaskIndex - ); - - - // Even if creating mask failed, bitmap can be used - // (background is just not displayed correctly) - if( iBitmap ) - { - AknIconUtils::SetSize( iBitmap, KIconSize, EAspectRatioPreserved ); - iIcon = new (ELeave) CEikImage; - iIcon->SetPictureOwnedExternally(ETrue); - iIcon->SetBrushStyle( CWindowGc::ENullBrush ); - iIcon->SetPicture( iBitmap, iBitmapMask ); - } - } - -// --------------------------------------------------------------------------- -// CESMRIconField::CountComponentControls -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRIconField::CountComponentControls() const - { - FUNC_LOG; - TInt count( 0 ); - if ( iBorder ) - { - ++count; - } - - if ( iIcon ) - { - ++count; - } - - return count; - } - -// --------------------------------------------------------------------------- -// CESMRIconField::ComponentControl -// --------------------------------------------------------------------------- -// -EXPORT_C CCoeControl* CESMRIconField::ComponentControl( TInt aInd ) const - { - FUNC_LOG; - switch( aInd ) - { - case 0: - { - return iIcon; - } - case 1: - { - return iBorder; - } - default: - { - return NULL; - } - } - } - -// --------------------------------------------------------------------------- -// CESMRIconField::SizeChanged -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRIconField::SizeChanged() - { - FUNC_LOG; - TRect rect = Rect(); - TPoint iconPos( - TPoint( rect.iTl.iX, rect.iTl.iY + iLayout->IconTopMargin() )); - TPoint borderPos( - iconPos.iX + KIconSize.iWidth + KIconBorderMargin, rect.iTl.iY ); - TSize borderSize( - rect.Width() - (KIconSize.iWidth + KIconBorderMargin ), rect.Height() ); - - TRAPD( error, IconL( iIconID ) ); - - if ( CESMRLayoutManager::IsMirrored() ) - { - CCoeControl* parent = Parent(); - TRect r = parent->Rect(); - - iconPos.iX = r.iBr.iX - KIconSize.iWidth - KMirroredIconMargin; - borderPos.iX = iconPos.iX - (borderSize.iWidth + KIconBorderMargin ); - } - - if ( iIcon && error == KErrNone ) - { - iIcon->SetPosition( iconPos ); - iIcon->SetSize( KIconSize ); - } - - if ( iBorder && error == KErrNone ) - { - // reserve icon rect. - iBorder->SetExtent( borderPos, BorderSize() ); - } - } - -// --------------------------------------------------------------------------- -// CESMRIconField::BorderSize -// --------------------------------------------------------------------------- -// -EXPORT_C TSize CESMRIconField::BorderSize() const - { - FUNC_LOG; - TSize borderSize( Rect().Width() - ( KIconSize.iWidth + - KIconBorderMargin ), Rect().Height() ); - - return borderSize; - } - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextlink.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextlink.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextlink.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,8 +16,13 @@ */ +#include "cesmrrichtextlink.h" +#include "esmrcommands.h" #include "emailtrace.h" -#include "cesmrrichtextlink.h" + +#include +#include +#include // ======== MEMBER FUNCTIONS ======== @@ -112,6 +117,74 @@ } // --------------------------------------------------------------------------- +// CESMRRichTextLink::MSKCommand +// --------------------------------------------------------------------------- +// +TInt CESMRRichTextLink::MSKCommand() const + { + TInt command = EAknSoftkeySelect; + switch ( iType ) + { + case ETypeEmail: + case ETypePhoneNumber: + case ETypeURL: + case ETypeAttachment: + { + command = EAknSoftkeyContextOptions; + break; + } + case ETypeShowAll: + { + command = EESMRCmdShowAllAttendees; + break; + } + case ETypeLocationUrl: + { + command = EESMRCmdShowOnMap; + break; + } + default: + { + break; + } + } + + return command; + } + +// --------------------------------------------------------------------------- +// CESMRRichTextLink::MSKText +// --------------------------------------------------------------------------- +// +TInt CESMRRichTextLink::MSKText() const + { + TInt resource = R_QTN_MSK_SELECT; + switch ( iType ) + { + case ETypeEmail: + case ETypePhoneNumber: + case ETypeURL: + case ETypeAttachment: + case ETypeLocationUrl: + { + resource = R_QTN_MSK_OPEN; + break; + } + case ETypeShowAll: + { + resource = R_QTN_MEET_REQ_SHOW_ALL; + break; + } + default: + { + break; + } + } + + return resource; +} + +// --------------------------------------------------------------------------- // CESMRRichTextLink::CESMRRichTextLink // --------------------------------------------------------------------------- // diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextviewer.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextviewer.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextviewer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,6 +12,7 @@ * Contributors: * * Description : CEikRichTextEditor based Rich Text viewer +* Version : %version: e002sa32#36 % * */ @@ -20,39 +21,47 @@ #include "mesmrlistobserver.h"// SCROLLING_MOD: List observer header #include "esmrconfig.hrh" #include "esmrhelper.h" -#include "cesmriconfield.h" #include "cesmrfieldcommandevent.h" #include "mesmrfieldeventqueue.h" -#include "cesmrlayoutmgr.h" #include "cesmrrichtextlink.h" #include "cesmrcontactmenuhandler.h" #include "nmrbitmapmanager.h" +#include "nmrcolormanager.h" +#include "esmrfieldbuilderdef.h" +#include "cesmrfield.h" #include #include #include #include -#include +#include +#include +#include #include #include #include // for clipboard copy -#include -#include - -#ifndef FF_CMAIL_INTEGRATION #include -#endif // FF_CMAIL_INTEGRATION // DEBUG #include "emailtrace.h" -// Removed profiling. - // Unnamed namespace for local definitions namespace{ // codescanner::namespace -const TInt KArrowUpperMargin (2); -const TInt KArrowRightMargin (5); +#ifdef _DEBUG + enum TPanic + { + EParaFormatNotInitialised = 1 + }; + void Panic( TPanic aPanic ) + { + _LIT( KCategory, "CESMRRichTextViewer" ); + User::Panic( KCategory(), aPanic ); + } +#endif // DEBUG + +// Side margin in twips, needed because not possible to set it in pixels +const TInt KDefaultTextSideMargin( 1 ); }//namespace @@ -81,10 +90,8 @@ { FUNC_LOG; iLinkList.ResetAndDestroy ( ); - delete iActionMenuIcon; - delete iActionMenuIconMask; iESMRStatic.Close ( ); - delete iLongTapDetector; + delete iParaFormat; } // ----------------------------------------------------------------------------- @@ -116,61 +123,41 @@ return; } - if ( IsFocused() ) + // Check the current selection. + // If a link has been highlighted, don't change it. + TCursorSelection selection = Selection(); + + // Gaining focus + if ( IsFocused() + && iLinkList.Count() > 0 + && selection.Length() == 0 ) { - if( iLayout ) - { - TRAP_IGNORE( SetFontColorL( ETrue ) ); - } + // We need the field indexes, cast required + CESMRField* parent = static_cast< CESMRField* >( Parent() ); - if ( iCurrentLinkIndex == KErrNotFound ) + iCntMenuHdlr->SetContactMenuObserver( this ); + // Focus coming from above ... + if( parent->CurrentItemIndex() > parent->PreItemIndex() ) { - TInt linkRow = KErrNotFound; - if ( CursorPos() == 0 ) - { - // focus is coming from field above: - linkRow = FindTextLinkBetweenNextScrollArea( - 0, 1, TCursorPosition::EFLineDown ); - } - else - { - linkRow = FindTextLinkBetweenNextScrollArea( - LineCount()-2, - LineCount()-1, - TCursorPosition::EFLineUp); - } - if ( linkRow != KErrNotFound ) - { - const CESMRRichTextLink* link = GetSelectedLink ( ); - if (link ) - { - HighlightLink (*link ); - DrawDeferred ( ); - } - } + // ... Highlight first link + TRAP_IGNORE( HighlightLinkL( *( iLinkList[0] ) ) ); } + // Focus coming from below ... else { - const CESMRRichTextLink* link = GetSelectedLink ( ); - if ( link ) - { - HighlightLink( *link ); - DrawDeferred(); - } + // ... Highlight last link + TRAP_IGNORE( HighlightLinkL( *( iLinkList[iLinkList.Count() - 1 ] ) ) ); } + DrawDeferred(); } - if (!IsFocused()) + // Losing focus + if ( !IsFocused() ) { - // losing focus - // codescanner - TRAP_IGNORE(SetSelectionL(CursorPos(), CursorPos())); - if( iLayout ) - { - TRAP_IGNORE(SetFontColorL( EFalse )); - } - // - TRAP_IGNORE( TextView()->SetDocPosL( 0 )); + TRAP_IGNORE( + SetSelectionL( CursorPos(), CursorPos() ); + ResetActionMenuL(); + ); } } @@ -208,7 +195,6 @@ } } - iCurrentLinkIndex = KErrNotFound; return linkRow; } @@ -224,23 +210,26 @@ { FUNC_LOG; + if ( iLinkList.Count() > aIndex) + { + TInt currPos( KErrNotFound ); + const CESMRRichTextLink* currentLink = GetSelectedLink(); + if ( currentLink ) + { + currPos = currentLink->StartPos(); + } - if(iLinkList.Count() > aIndex) - { - TInt pos = iLinkList[aIndex]->StartPos(); + TInt pos = iLinkList[ aIndex ]->StartPos(); TInt checkRow = TextLayout()->GetLineNumber( pos ); - if ( checkRow >= aStartRow && checkRow <= ( aEndRow ) ) + if ( checkRow >= aStartRow && checkRow <= aEndRow ) { if ( aDirection == TCursorPosition::EFLineDown && - aIndex > iCurrentLinkIndex || + pos > currPos || aDirection == TCursorPosition::EFLineUp && - ( aIndex < iCurrentLinkIndex || - iCurrentLinkIndex == KErrNotFound )) + ( pos < currPos || currPos == KErrNotFound ) ) { - iCurrentLinkIndex = aIndex; - // link found between next scroll area. return checkRow; } @@ -250,60 +239,6 @@ } // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::SetHighLightToNextLinkL -// ----------------------------------------------------------------------------- -// -TBool CESMRRichTextViewer::SetHighLightToNextLinkL( - TCursorPosition::TMovementType aDirection, - TInt aStartRow, - TInt aEndRow ) - { - FUNC_LOG; - TBool ret( EFalse ); - - TInt currentLineNumber = TextLayout()->GetLineNumber( CursorPos() ); - - // check is there a link before next scroll point: - TInt linkRow = FindTextLinkBetweenNextScrollArea( - aStartRow , aEndRow, aDirection); - - if ( linkRow != KErrNotFound && iCurrentLinkIndex != KErrNotFound ) - { - const CESMRRichTextLink* link = GetSelectedLink ( ); - if (link ) - { - HighlightLink (*link ); - - if ( iObserver && linkRow != currentLineNumber ) - { - TInt endOfLink = link->StartPos()+link->Length(); - TInt line = TextLayout()->GetLineNumber( endOfLink ); - if ( aDirection == TCursorPosition::EFLineUp ) // moving up: - { - iObserver->MoveListAreaDownL( - RowHeight() * ( currentLineNumber - line )); - } - else - { - iObserver->MoveListAreaUpL( - RowHeight() * ( line - currentLineNumber )); - } - } - - DrawDeferred ( ); - ret = ETrue; - } - } - else - { - // no link are focused, do reset work to refresh the option menu. - ResetActionMenuL(); - } - - return ret; - } - -// ----------------------------------------------------------------------------- // CESMRRichTextViewer::OfferKeyEventL // ----------------------------------------------------------------------------- // @@ -312,167 +247,160 @@ TEventCode aType ) { FUNC_LOG; - // Handle only event keys - if ( aType == EEventKey ) + TKeyResponse response( EKeyWasNotConsumed ); + + // Handle only event keys. + if( aType != EEventKey ) { - if ( iObserver ) // only description field has observer set. + return response; + } + + /* + * Handles scrolling between rich text links. + */ + const CESMRRichTextLink* selectedLink = GetSelectedLink(); + TInt linkCount = iLinkList.Count(); + + // If a link is selected, it means that we are operating within + // the field and can move focus between the links. + if( linkCount && selectedLink ) + { + TInt selectedLinkIndex = iLinkList.Find( selectedLink ); + + switch ( aKeyEvent.iCode ) { - // fetch the current line number: - TInt currentLineNumber = TextLayout()->GetLineNumber( CursorPos() ); - - if ( aKeyEvent.iCode == EKeyDownArrow && aType == EEventKey ) + case EKeyLeftArrow: + case EKeyUpArrow: { - if ( !iObserver->IsFieldBottomVisible() && - SetHighLightToNextLinkL( - TCursorPosition::EFLineDown, - currentLineNumber, - currentLineNumber + KMaxAddressFieldLines) ) - { - return EKeyWasConsumed; - } - else if ( iObserver->IsFieldBottomVisible() ) + // If possible and exists ... + if( selectedLinkIndex > 0 && + selectedLinkIndex < linkCount ) { - if ( SetHighLightToNextLinkL(TCursorPosition::EFLineDown, - currentLineNumber, - iNumberOfLines) ) - { - return EKeyWasConsumed; - } - // means that the whole control is visible: - // and we can skip to next field - return EKeyWasNotConsumed; - } + // ...Highlight previous link. + HighlightLinkL( *( iLinkList[ selectedLinkIndex - 1 ] ) ); + response = EKeyWasConsumed; - if ( currentLineNumber == iNumberOfLines ) - { - // the end of text has been reached - return EKeyWasConsumed; - } - - // move three lines... - ScrollViewL( KMaxAddressFieldLines, - TCursorPosition::EFLineDown); - - - SetSelectionL( CursorPos(), CursorPos() ); - iCurrentLinkIndex = KErrNotFound; - if ( iObserver ) - { - iObserver->MoveListAreaUpL( - RowHeight() * KMaxAddressFieldLines ); + // View update required, for example if link is out of + // viewable area. + UpdateViewL( aKeyEvent ); } - return EKeyWasConsumed; + break; } - else if ( aKeyEvent.iCode == EKeyUpArrow && aType == EEventKey ) + case EKeyRightArrow: + case EKeyDownArrow: { - if (iPosition.iY < 0 && - SetHighLightToNextLinkL( - TCursorPosition::EFLineUp, - currentLineNumber - KMaxAddressFieldLines, - currentLineNumber)) - { - return EKeyWasConsumed; - } - if ( iPosition.iY > 0 ) + // If possible and exists ... + if( selectedLinkIndex + 1 < linkCount && + selectedLinkIndex >= 0 ) { - // before changing the focus the field above, - // check is there any links in rest of text - if (SetHighLightToNextLinkL(TCursorPosition::EFLineUp, - 0, - currentLineNumber)) - { - return EKeyWasConsumed; - } - - // means that the whole control is visible: - // and we can skip to next field - return EKeyWasNotConsumed; - } - else - { - TInt currentLineNumber = - TextLayout()->GetLineNumber( CursorPos() ); - // move three lines... - ScrollViewL( KMaxAddressFieldLines, - TCursorPosition::EFLineUp); - - SetSelectionL( CursorPos(), CursorPos()); - iCurrentLinkIndex = KErrNotFound; - - if ( iObserver ) - { - iObserver->MoveListAreaDownL( - RowHeight() * KMaxAddressFieldLines ); - } + // ...Highlight next link. + HighlightLinkL( *( iLinkList[ selectedLinkIndex + 1 ] ) ); + response = EKeyWasConsumed; - currentLineNumber = - TextLayout()->GetLineNumber( CursorPos() ); - return EKeyWasConsumed; + // View update required, for example if link is out of + // viewable area. + UpdateViewL( aKeyEvent ); } - } - } - if ( aKeyEvent.iCode == EKeyRightArrow || - aKeyEvent.iCode == EKeyDevice3 || - aKeyEvent.iCode == EKeyDevice4 || - aKeyEvent.iCode == EKeyEnter ) - { - // Show right click menu (action menu) - const CESMRRichTextLink* link = GetSelectedLink(); - if (link && - link->TriggerKey ( )== CESMRRichTextLink::ETriggerKeyRight ) - { - if ( !iLinkObserver || - !iLinkObserver->HandleRichTextLinkSelection(link) ) - { - iCntMenuHdlr->ShowActionMenuL(); - } - return EKeyWasConsumed; + + break; } - } - if ( aKeyEvent.iCode == EKeyLeftArrow ) - { - const CESMRRichTextLink* link = GetSelectedLink(); - if ( link ) + case EKeyDevice3: // Selection key { - return EKeyWasConsumed; + // No implementation. Non-MSK devices might require this. + break; } - } - if ( aKeyEvent.iCode == EKeyDevice3 || - aKeyEvent.iCode == EKeyDevice4 || - aKeyEvent.iCode == EKeyEnter ) - { - // Select link - const CESMRRichTextLink* link = GetSelectedLink ( ); - if (link && - link->TriggerKey ( )== CESMRRichTextLink::ETriggerKeyOk ) - { - if (iLinkObserver && - iLinkObserver->HandleRichTextLinkSelection (link ) ) - { - return EKeyWasConsumed; - } - } + default: + break; } } - return EKeyWasNotConsumed; + return response; } - // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::ScrollViewL +// CESMRRichTextViewer::HandlePointerEventL // ----------------------------------------------------------------------------- // -void CESMRRichTextViewer::ScrollViewL( - TInt aNumberOfRows, - TCursorPosition::TMovementType aDirection) +void CESMRRichTextViewer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { - FUNC_LOG; - for( TInt i=0; i < aNumberOfRows; i++ ) + if ( Rect().Contains( aPointerEvent.iPosition) ) { - MoveCursorL( aDirection, EFalse); + TBool linkFound( EFalse ); + + switch ( aPointerEvent.iType ) + { + case TPointerEvent::EButton1Down: + case TPointerEvent::EDrag: + { + RRegion linkArea; + CleanupClosePushL( linkArea ); + + // Find matching link + TInt count = iLinkList.Count(); + + for ( TInt i = 0; i < count; ++i ) + { + CESMRRichTextLink* link = iLinkList[ i ]; + GetLinkAreaL( linkArea, *link ); + + if ( linkArea.Contains( aPointerEvent.iPosition ) ) + { + if ( link != GetSelectedLink() ) + { + iCntMenuHdlr->SetContactMenuObserver( this ); + HighlightLinkL( *link ); + DrawDeferred(); + } + + linkFound = ETrue; + break; + } + } + + CleanupStack::PopAndDestroy( &linkArea ); + + break; + } + + case TPointerEvent::EButton1Up: + { + const CESMRRichTextLink* link = GetSelectedLink(); + + TBool menuAvailable = iCntMenuHdlr->OptionsMenuAvailable(); + + if ( link + && ( menuAvailable + || link->Type() == CESMRRichTextLink::ETypeLocationUrl + || link->Type() == CESMRRichTextLink::ETypeAttachment ) ) + { + linkFound = ETrue; + + LinkSelectedL(); + } + else if ( link && !menuAvailable ) + { + linkFound = ETrue; + iOpenActionMenu = ETrue; + } + break; + } + default: + { + break; + } + } + + if ( !linkFound ) + { + // Tap on plain text + TextView()->ClearSelectionL(); + ResetActionMenuL(); + DrawDeferred(); + } + } + } // ----------------------------------------------------------------------------- @@ -482,88 +410,10 @@ EXPORT_C void CESMRRichTextViewer::SetMargins( TInt sMargin ) { // Set new value for left and right margins - if ( TextView() ) - { - TextView()->SetMarginWidths( sMargin ,0); - } + TextView()->SetMarginWidths( sMargin ,0); } // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::SetFontL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CESMRRichTextViewer::SetFontL( const CFont* aFont, - CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - // These pointers are stored to able font color changing when losing or - // gaining focus - iLayout = aLayout; - iFont = aFont; - - SetFontColorL( IsFocused() ); - - // This forces CEikEdwin::OnReformatL to notify observer - // through HandleEdwinSizeEventL about changed size. - // It is notified only if linecount changes. - CEikEdwin::iNumberOfLines = 0; - CEikEdwin::FormatTextL(); - } - -// ----------------------------------------------------------------------------- -// CESMRRichTextViewer::SetFontColor -// ----------------------------------------------------------------------------- -// -void CESMRRichTextViewer::SetFontColorL( TBool aFocused ) - { - FUNC_LOG; - // all this stuff is needed to be set, otherwise the - // font loses its antialiasing drawing - - TFontSpec fontSpec = iFont->FontSpecInTwips(); - - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLineSpacingControl = CParaFormat::ELineSpacingExactlyInPixels; - - paraFormatMask.SetAttrib( EAttLineSpacing ); - paraFormat.iHorizontalAlignment = CParaFormat::ELeftAlign; - paraFormatMask.SetAttrib( EAttAlignment ); - - TCharFormat charFormat; - TCharFormatMask formatMask; - charFormat.iFontSpec = fontSpec; - - formatMask.SetAttrib( EAttFontTypeface ); - formatMask.SetAttrib( EAttFontHeight ); - formatMask.SetAttrib( EAttFontPosture ); - formatMask.SetAttrib( EAttFontStrokeWeight ); - - if( aFocused ) - { - charFormat.iFontPresentation.iTextColor = - iLayout->ViewerListAreaHighlightedTextColor(); - } - else - { - charFormat.iFontPresentation.iTextColor = KRgbBlack; - } - formatMask.SetAttrib( EAttColor ); - - CParaFormatLayer* paraFormatLayer = - CParaFormatLayer::NewL( ¶Format, paraFormatMask ); - CleanupStack::PushL( paraFormatLayer ); - - CCharFormatLayer* charFormatLayer = - CCharFormatLayer::NewL( charFormat, formatMask ); - - SetParaFormatLayer( paraFormatLayer ); - SetCharFormatLayer( charFormatLayer ); - - CleanupStack::Pop( paraFormatLayer ); - } - -// ----------------------------------------------------------------------------- // CESMRRichTextViewer::SetTextL // ----------------------------------------------------------------------------- // @@ -572,34 +422,37 @@ TBool aSearchLinks ) { FUNC_LOG; - iCurrentLinkIndex = KErrNotFound; - iLinkList.ResetAndDestroy ( ); + + iLinkList.ResetAndDestroy(); + + TextView()->SetMarginWidths( KDefaultTextSideMargin ,0); // Clear edwin text CEikEdwin::SetCursorPosL( 0, EFalse ); + CEikRichTextEditor::SetTextL( &KNullDesC ); + RichText()->Reset(); // text lenght plus one to ensure the formatting // used is full, not band formatting. SetUpperFullFormattingLength( aText->Length() + 1 ); // Set new edwin text + CEikEdwin::SetTextLimit( aText->Length ( ) ); CEikRichTextEditor::SetTextL( aText ); //Make sure cursor is invisible and selection visible - TextView()->SetCursorVisibilityL (TCursor::EFCursorInvisible, + TextView()->SetCursorVisibilityL( + TCursor::EFCursorInvisible, TCursor::EFCursorInvisible ); - TextView()->SetSelectionVisibilityL (ETrue ); + TextView()->SetSelectionVisibilityL( ETrue ); // Search text for links (highlights) - if (aSearchLinks ) + if ( aSearchLinks ) { SearchLinksL( *aText ); // find first link. FindTextLinkBetweenNextScrollArea(0, KMaxAddressFieldLines, TCursorPosition::EFLineDown); } - - // first row is 0, so let's add one... - iNumberOfLines = TextLayout()->GetLineNumber( TextLength() ) + 1; } // ----------------------------------------------------------------------------- @@ -626,8 +479,8 @@ // Reserve space for new link iLinkList.ReserveL( iLinkList.Count() + 1 ); - RichText()->ApplyCharFormatL( iFormat, - iFormatMask, + RichText()->ApplyCharFormatL( iRichTextLinkFormat, + iRichTextLinkFormatMask, aLink->StartPos(), aLink->Length() ); @@ -636,7 +489,7 @@ if ( highlight ) { - HighlightLink( *aLink ); + HighlightLinkL( *aLink ); } } @@ -654,8 +507,8 @@ // Reserve space for new link iLinkList.ReserveL( iLinkList.Count() + 1 ); - RichText()->ApplyCharFormatL( iFormat, - iFormatMask, + RichText()->ApplyCharFormatL( iRichTextLinkFormat, + iRichTextLinkFormatMask, aLink->StartPos(), aLink->Length() ); @@ -665,7 +518,7 @@ if ( highlight ) { - HighlightLink( *aLink ); + HighlightLinkL( *aLink ); } } @@ -676,25 +529,38 @@ EXPORT_C const CESMRRichTextLink* CESMRRichTextViewer::GetSelectedLink( ) const { FUNC_LOG; - if (iCurrentLinkIndex >= 0 && iCurrentLinkIndex < iLinkList.Count ( ) ) + CESMRRichTextLink* link( NULL ); + + TCursorSelection currentSelection = Selection(); + + for ( TInt i = 0; i < iLinkList.Count(); ++i ) { - return iLinkList[iCurrentLinkIndex]; + CESMRRichTextLink* tempLink = iLinkList[i]; + TInt startPos = tempLink->StartPos(); + TInt length = tempLink->Length(); + + TCursorSelection linkSelection( startPos, startPos + length ); + + if( currentSelection.iCursorPos == linkSelection.iCursorPos && + currentSelection.iAnchorPos == linkSelection.iAnchorPos ) + { + link = tempLink; + break; + } } - else - { - return NULL; - } + + return link; } // ----------------------------------------------------------------------------- // CESMRRichTextViewer::GetLinkTextL // ----------------------------------------------------------------------------- // -EXPORT_C HBufC* CESMRRichTextViewer::GetLinkTextL( +EXPORT_C HBufC* CESMRRichTextViewer::GetLinkTextLC( const CESMRRichTextLink& aLink ) const { FUNC_LOG; - return RichText()->Read( aLink.StartPos ( ), aLink.Length ( ) ).AllocL(); + return RichText()->Read( aLink.StartPos(), aLink.Length() ).AllocLC(); } // ----------------------------------------------------------------------------- @@ -729,7 +595,9 @@ EXPORT_C TInt CESMRRichTextViewer::LineCount() { FUNC_LOG; - return iNumberOfLines; + + // First row is 0, so let's add one... + return ( TextLayout()->GetLineNumber( TextLength() ) + 1 ); } // ----------------------------------------------------------------------------- // CESMRRichTextViewer::CurrentLineNumber @@ -743,13 +611,133 @@ } // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::CESMRRichTextViewer +// CESMRRichTextViewer::SetFontL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRRichTextViewer::SetFontL( const CFont* aFont ) + { + FUNC_LOG; + // iFont is stored for changing font color when losing or + // gaining focus + iFont = aFont; + if ( !iParaFormat ) + { + iParaFormat = new ( ELeave ) CParaFormat(); + } + + // All this required, otherwise the font loses its + // antialiasing drawing. + iParaFormat->iLineSpacingControl = CParaFormat::ELineSpacingExactlyInPixels; + + iParaFormatMask.SetAttrib( EAttLineSpacing ); + iParaFormat->iHorizontalAlignment = CParaFormat::ELeftAlign; + iParaFormat->iVerticalAlignment = CParaFormat::ECenterAlign; + iParaFormatMask.SetAttrib( EAttAlignment ); + iParaFormatMask.SetAttrib( EAttVerticalAlignment ); + + iCharFormat.iFontSpec = iFont->FontSpecInTwips(); + + iCharFormatMask.SetAttrib( EAttFontTypeface ); + iCharFormatMask.SetAttrib( EAttFontHeight ); + iCharFormatMask.SetAttrib( EAttFontPosture ); + iCharFormatMask.SetAttrib( EAttFontStrokeWeight ); + + iCharFormat.iFontPresentation.iTextColor = + NMRColorManager::Color( NMRColorManager::EMRMainAreaTextColor ); + + iCharFormatMask.SetAttrib( EAttColor ); + } + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::SetLineSpacingL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRRichTextViewer::SetLineSpacingL( TInt aLineSpacingInTwips ) + { + __ASSERT_DEBUG( iParaFormat, Panic( EParaFormatNotInitialised ) ); + iParaFormatMask.SetAttrib( EAttLineSpacing ); + iParaFormatMask.SetAttrib( EAttLineSpacingControl ); + iParaFormat->iLineSpacingControl = + CParaFormat::ELineSpacingExactlyInPixels; + + iParaFormat->iLineSpacingInTwips = aLineSpacingInTwips; + } + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::ApplyLayoutChanges // ----------------------------------------------------------------------------- // -EXPORT_C void CESMRRichTextViewer::SetActionMenuStatus( TBool aStatus ) +EXPORT_C void CESMRRichTextViewer::ApplyLayoutChangesL() + { + __ASSERT_DEBUG( iParaFormat, Panic( EParaFormatNotInitialised ) ); + CRichText* richtext = RichText(); + TInt paraCount( richtext->ParagraphCount() ); + // Go through each paragraph and apply the same format + for( TInt i = 0; i < paraCount; ++i ) + { + TInt paraLen( 0 ); // Length of paragraph + TInt fiChPos( 0 ); // First character position of paragraph + // Get the length of the paragraph + fiChPos = richtext->CharPosOfParagraph( paraLen, i ); + richtext->ApplyParaFormatL( + iParaFormat, iParaFormatMask, fiChPos, paraLen ); + richtext->ApplyCharFormatL( + iCharFormat, iCharFormatMask, fiChPos, paraLen ); + } + // This forces CEikEdwin::OnReformatL to notify observer + // through HandleEdwinSizeEventL about changed size. + // It is notified only if linecount changes. + CEikEdwin::iNumberOfLines = 0; + CEikEdwin::FormatTextL(); + } + + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::SetSelectedLink +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRRichTextViewer::SetFocusLink( TInt aLinkIndex ) + { + if ( ( aLinkIndex >= 0 ) && ( aLinkIndex < iLinkList.Count() ) ) + { + TRAP_IGNORE( HighlightLinkL( *( iLinkList[aLinkIndex] ) ) ); + DrawDeferred(); + } + } + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::GetSelectedLink +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRRichTextViewer::GetFocusLink( ) const { FUNC_LOG; - iActionMenuStatus = aStatus; + // "-1" stand for no link be selected now. + TInt linkIndex( KErrNotFound ); + if ( 0 == iLinkList.Count() ) + { + return linkIndex; + } + + TCursorSelection currentSelection = Selection(); + + for ( TInt i = 0; i < iLinkList.Count(); ++i ) + { + CESMRRichTextLink* tempLink = iLinkList[i]; + TInt startPos = tempLink->StartPos(); + TInt length = tempLink->Length(); + + TCursorSelection linkSelection( startPos, startPos + length ); + + if( currentSelection.iCursorPos == linkSelection.iCursorPos && + currentSelection.iAnchorPos == linkSelection.iAnchorPos ) + { + linkIndex = i; + break; + } + } + + return linkIndex; } // ----------------------------------------------------------------------------- @@ -757,7 +745,6 @@ // ----------------------------------------------------------------------------- // CESMRRichTextViewer::CESMRRichTextViewer( ) -: iActionMenuStatus( ETrue ), iActionMenuOpen( EFalse ) { FUNC_LOG; } @@ -779,103 +766,40 @@ flags |= CEikEdwin::EOwnsWindow; } - CEikRichTextEditor::ConstructL (aParent, 1, 1, flags ); - SetSuppressBackgroundDrawing (ETrue ); - - User::LeaveIfError( - NMRBitmapManager::GetSkinBasedBitmap( - NMRBitmapManager::EMRBitmapRightClickArrow, iActionMenuIcon, - iActionMenuIconMask, KIconSize ) ); - - iESMRStatic.ConnectL ( ); - iCntMenuHdlr = &iESMRStatic.ContactMenuHandlerL(); - iCurrentLinkIndex = KErrNotFound; - iFormatMask.SetAttrib( EAttFontUnderline ); - iFormat.iFontPresentation.iUnderline = EUnderlineOn; - iFormatMask.SetAttrib( EAttColor ); - iFormat.iFontPresentation.iTextColor = KRgbBlue; + CEikRichTextEditor::ConstructL( aParent, 1, 1, flags ); + SetSuppressBackgroundDrawing( ETrue ); - iLongTapDetector = CAknLongTapDetector::NewL(this); - } - -// ----------------------------------------------------------------------------- -// CESMRRichTextViewer::Draw -// ----------------------------------------------------------------------------- -// -void CESMRRichTextViewer::Draw( const TRect& aRect ) const - { - FUNC_LOG; - CEikEdwin::Draw( aRect ); - if (IsFocused ( ) && iActionMenuStatus ) - { - const CESMRRichTextLink* link = GetSelectedLink ( ); - if (link && link->TriggerKey ( )== CESMRRichTextLink::ETriggerKeyRight ) - { - TRAP_IGNORE(DrawRightClickIconL(*link)); - } - } + iESMRStatic.ConnectL(); + iCntMenuHdlr = &iESMRStatic.ContactMenuHandlerL(); + iRichTextLinkFormatMask.SetAttrib( EAttFontUnderline ); + iRichTextLinkFormat.iFontPresentation.iUnderline = EUnderlineOn; + iRichTextLinkFormatMask.SetAttrib( EAttColor ); + iRichTextLinkFormat.iFontPresentation.iTextColor = + NMRColorManager::Color( + NMRColorManager::EMRCutCopyPasteHighlightColor ); } // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::DrawRightClickIconL +// CESMRRichTextViewer::HighlightLinkL // ----------------------------------------------------------------------------- // -void CESMRRichTextViewer::DrawRightClickIconL( - const CESMRRichTextLink& aLink ) const +void CESMRRichTextViewer::HighlightLinkL(const CESMRRichTextLink& aLink ) { FUNC_LOG; - TTmDocPosSpec posSpec; - TTmPosInfo2 posInfo; - - posSpec.iPos = aLink.StartPos ( )+ aLink.Length ( ); - posSpec.iType = TTmDocPosSpec::ETrailing; - - if (TextView()->FindDocPosL (posSpec, posInfo ) ) - { - TPoint pt = posInfo.iEdge; - pt -= iActionMenuIcon->SizeInPixels ( ); - - pt.iY = pt.iY + KArrowUpperMargin; - pt.iX = Parent()->Rect().iBr.iX - - iActionMenuIcon->SizeInPixels().iWidth - KArrowRightMargin; - TRect dst(pt, iActionMenuIcon->SizeInPixels ( )); - TRect src(TPoint (0, 0 ), iActionMenuIcon->SizeInPixels ( )); - - CWindowGc& gc = SystemGc ( ); - gc.DrawBitmapMasked (dst, iActionMenuIcon, src, iActionMenuIconMask, - EFalse ); - } - } - -// ----------------------------------------------------------------------------- -// CESMRRichTextViewer::HighlightLink -// ----------------------------------------------------------------------------- -// -void CESMRRichTextViewer::HighlightLink(const CESMRRichTextLink& aLink ) - { - FUNC_LOG; - TInt error = KErrNone; TCursorSelection selection( aLink.StartPos(), aLink.StartPos() + aLink.Length() ); // If TextView is not constructed yet. if ( !TextView() ) { - TRAP( error, SetSelectionL( selection.iCursorPos, selection.iAnchorPos ) ); + SetSelectionL( selection.iCursorPos, selection.iAnchorPos ); } else { TextView()->SetPendingSelection( selection ); } - if ( error == KErrNone ) - { - TRAP( error, SetValueL( aLink ) ); - if ( error != KErrNone ) - { - CEikonEnv::Static()->// codescanner::eikonenvstatic - HandleError( error ); - } - } + SetValueL( aLink ); + ChangeMiddleSoftkeyL( aLink ); } // ----------------------------------------------------------------------------- @@ -908,15 +832,7 @@ } case CESMRRichTextLink::ETypeAttachment: { - // Set this as command observer. - // Commands from contact menu handler are - // processed in ProcessCommandL and forwarded - // as field command events - // - //iCntMenuHdlr->SetCommandObserver( this ); - // - iCntMenuHdlr->SetValueL( aLink.Value(), - CESMRContactMenuHandler::EValueTypeAttachment ); + break; } default: @@ -1005,68 +921,42 @@ // ----------------------------------------------------------------------------- // CESMRRichTextViewer::CopyCurrentLinkToClipBoardL // ----------------------------------------------------------------------------- +// EXPORT_C void CESMRRichTextViewer::CopyCurrentLinkToClipBoardL() const { FUNC_LOG; const CESMRRichTextLink* link = GetSelectedLink(); - - if( link ) - { - HBufC* clipBoardText = GetLinkTextL(*link); + HBufC* clipBoardText = NULL; - if ( clipBoardText ) - { - CleanupStack::PushL( clipBoardText ); - CClipboard* cb = - CClipboard::NewForWritingLC( CCoeEnv::Static()->FsSession() ); - cb->StreamDictionary().At( KClipboardUidTypePlainText ); - CPlainText* plainText = CPlainText::NewL(); - CleanupStack::PushL( plainText ); - plainText->InsertL( 0 , *clipBoardText); - plainText->CopyToStoreL( cb->Store(), - cb->StreamDictionary(), 0, plainText->DocumentLength()); - CleanupStack::PopAndDestroy( plainText ); - cb->CommitL(); - CleanupStack::PopAndDestroy( cb ); - CleanupStack::PopAndDestroy( clipBoardText ); - } - } - } + if ( link ) + { + clipBoardText = GetLinkTextLC( *link ); + } -// ----------------------------------------------------------------------------- -// CESMRRichTextViewer::CopyCurrentLinkValueToClipBoardL -// ----------------------------------------------------------------------------- -EXPORT_C void CESMRRichTextViewer::CopyCurrentLinkValueToClipBoardL() const - { - FUNC_LOG; - const CESMRRichTextLink* link = GetSelectedLink(); - - if( link ) + if ( clipBoardText ) { - TDesC& clipBoardText = link->Value(); - - CClipboard* cb = + CClipboard* cb = CClipboard::NewForWritingLC( CCoeEnv::Static()->FsSession() ); cb->StreamDictionary().At( KClipboardUidTypePlainText ); CPlainText* plainText = CPlainText::NewL(); CleanupStack::PushL( plainText ); - plainText->InsertL( 0 , clipBoardText); + plainText->InsertL( 0 , *clipBoardText); plainText->CopyToStoreL( cb->Store(), - cb->StreamDictionary(), 0, plainText->DocumentLength()); + cb->StreamDictionary(), 0, plainText->DocumentLength()); CleanupStack::PopAndDestroy( plainText ); cb->CommitL(); CleanupStack::PopAndDestroy( cb ); + CleanupStack::PopAndDestroy( clipBoardText ); } } - // ----------------------------------------------------------------------------- // CESMRRichTextViewer::ResetActionMenu // ----------------------------------------------------------------------------- EXPORT_C void CESMRRichTextViewer::ResetActionMenuL() const // codescanner::LFunctionCantLeave { FUNC_LOG; - if(iCntMenuHdlr) + if ( iCntMenuHdlr ) { iCntMenuHdlr->Reset(); } @@ -1095,7 +985,6 @@ const CESMRRichTextLink* link = GetSelectedLink(); if ( link ) { - iActionMenuOpen = ETrue; switch ( link->TriggerKey() ) { case CESMRRichTextLink::ETriggerKeyRight: @@ -1103,7 +992,7 @@ if ( !iLinkObserver || !iLinkObserver->HandleRichTextLinkSelection(link) ) { - iCntMenuHdlr->ShowActionMenuL(); + ShowContextMenuL(); } linkSelected = ETrue; break; @@ -1111,7 +1000,7 @@ case CESMRRichTextLink::ETriggerKeyOk: { if (iLinkObserver && - iLinkObserver->HandleRichTextLinkSelection (link ) ) + iLinkObserver->HandleRichTextLinkSelection( link ) ) { linkSelected = ETrue; } @@ -1122,13 +1011,11 @@ break; } } - iActionMenuOpen = EFalse; } return linkSelected; } - // ----------------------------------------------------------------------------- // CESMRRichTextViewer::ProcessCommandL // ----------------------------------------------------------------------------- @@ -1157,101 +1044,198 @@ FUNC_LOG; CEikRichTextEditor::ActivateL(); - // Make sure correct font color is in use. - SetFontColorL( IsFocused() ); - // CEikEdwin::ActivateL removes selection, re-set highlight // if focused and there's a selected link. - if ( IsFocused() && GetSelectedLink() ) + const CESMRRichTextLink* link = GetSelectedLink(); + if ( link && IsFocused() ) { - HighlightLink( *GetSelectedLink() ); + HighlightLinkL( *link ); DrawDeferred(); } } // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::HandlePointerEventL +// CESMRRichTextViewer::ContactActionQueryComplete // ----------------------------------------------------------------------------- // -void CESMRRichTextViewer::HandlePointerEventL(const TPointerEvent& aPointerEvent) +void CESMRRichTextViewer::ContactActionQueryComplete() { - TBool linkTapped( EFalse ); - CESMRRichTextLink* link = NULL; - // fetch the current line number: - TInt currentLineNumber = TextLayout()->GetLineNumber( CursorPos() ); - // find out tapped position - TPoint touchPoint = aPointerEvent.iPosition; - - TInt tappedPos = TextView()->XyPosToDocPosL( touchPoint ); - for (TInt i = 0; iStartPos(); - TInt linkEnd = link->StartPos() + link->Length() - 1; - if ( tappedPos >= linkStart && tappedPos <= linkEnd ) - { - // link tapped - linkTapped = ETrue; - iCurrentLinkIndex = i; - break; - } + // Activate link as actions have been discovered + TRAP_IGNORE( LinkSelectedL() ); } - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + // Reset menu observer + iCntMenuHdlr->SetContactMenuObserver( NULL ); + iOpenActionMenu = EFalse; + } + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::ShowContextMenuL +// ----------------------------------------------------------------------------- +// +void CESMRRichTextViewer::ShowContextMenuL() + { + FUNC_LOG; + iOpenActionMenu = EFalse; + ProcessCommandL( EAknSoftkeyContextOptions ); + } + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::GetLinkAreaL +// ----------------------------------------------------------------------------- +// +void CESMRRichTextViewer::GetLinkAreaL( + TRegion& aRegion, + const CESMRRichTextLink& aLink ) const + { + FUNC_LOG; + TTmDocPosSpec posSpec; + TTmPosInfo2 posInfo; + + posSpec.iPos = aLink.StartPos(); + posSpec.iType = TTmDocPosSpec::ELeading; + + aRegion.Clear(); + + if ( TextView()->FindDocPosL( posSpec, posInfo ) ) { - if ( linkTapped ) - { - // tactile feedback - MTouchFeedback* feedback = MTouchFeedback::Instance(); - if ( feedback ) - { - feedback->InstantFeedback( this, ETouchFeedbackBasic ); - } + TRect linkRect( 0, 0, 0, 0 ); + + // Create link surrounding rectangle + HBufC* text = GetLinkTextLC( aLink ); + TInt textWidth = AknBidiTextUtils::MeasureTextBoundsWidth( + *iFont, + *text, + CFont::TMeasureTextInput::EFVisualOrder ); - TPointerEvent pointerEvent = aPointerEvent; - pointerEvent.iParentPosition = pointerEvent.iPosition - + DrawableWindow()->AbsPosition(); - iLongTapDetector->PointerEventL( pointerEvent ); - HighlightLink( *link ); - if ( Parent() ) + TPoint tl( posInfo.iEdge ); + + if ( AknLayoutUtils::LayoutMirrored() ) + { + // move top left x to end of text + tl.iX -= textWidth; + } + + tl.iY -= iFont->FontMaxAscent(); + TPoint br( tl.iX + textWidth, tl.iY + iFont->FontMaxHeight() ); + + TRect rect( Rect() ); + + while ( ( tl.iX < rect.iTl.iX || br.iX > rect.iBr.iX ) + && !aRegion.CheckError() ) + { + // Link on multiple lines + + tl.iX = Max( rect.iTl.iX, tl.iX ); + br.iX = Min( br.iX, rect.iBr.iX ); + linkRect.SetRect( tl, br ); + aRegion.AddRect( linkRect ); + + TPtrC remainder( text->Mid( posSpec.iPos - aLink.StartPos() ) ); + TInt numChars = iFont->TextCount( remainder, + linkRect.Width() ); + posSpec.iPos += numChars; + remainder.Set( remainder.Mid( numChars) ); + + if ( TextView()->FindDocPosL( posSpec, posInfo ) ) { - Parent()->DrawDeferred(); - } - else - { - DrawDeferred(); + textWidth = AknBidiTextUtils::MeasureTextBoundsWidth( + *iFont, + remainder, + CFont::TMeasureTextInput::EFVisualOrder ); + + tl = posInfo.iEdge; + + if ( AknLayoutUtils::LayoutMirrored() ) + { + // move top left x to end of text + tl.iX -= textWidth; + } + + tl.iY -= iFont->FontMaxAscent(); + br.SetXY( tl.iX + textWidth, tl.iY + iFont->FontMaxHeight() ); } } - } - else - { - TPointerEvent pointerEvent = aPointerEvent; - pointerEvent.iParentPosition = pointerEvent.iPosition - + DrawableWindow()->AbsPosition(); - iLongTapDetector->PointerEventL( pointerEvent ); - if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - if ( linkTapped && !iActionMenuOpen ) - { - // tapped highlighted field, execute action - LinkSelectedL(); - } - } + linkRect.SetRect( tl, br ); + aRegion.AddRect( linkRect ); + + CleanupStack::PopAndDestroy( text ); } } // ----------------------------------------------------------------------------- -// CESMRRichTextViewer::HandleLongTapEventL +// CESMRRichTextViewer::ChangeMiddleSoftkeyL +// ----------------------------------------------------------------------------- +// +void CESMRRichTextViewer::ChangeMiddleSoftkeyL( const CESMRRichTextLink& aLink ) + { + FUNC_LOG; + CESMRField* field = static_cast< CESMRField* >( Parent() ); + + if ( field ) + { + field->ChangeMiddleSoftKeyL( aLink.MSKCommand(), aLink.MSKText() ); + } + } + +// ----------------------------------------------------------------------------- +// CESMRRichTextViewer::UpdateViewL // ----------------------------------------------------------------------------- // -void CESMRRichTextViewer::HandleLongTapEventL( const TPoint& /*aPenEventLocation*/, - const TPoint& /*aPenEventScreenLocation*/ ) +void CESMRRichTextViewer::UpdateViewL( const TKeyEvent &aKeyEvent ) { - if ( !iActionMenuOpen ) + FUNC_LOG; + const CESMRRichTextLink* selectedLink = GetSelectedLink(); + + if( !selectedLink ) + { + return; + } + + RRegion linkRegion; + CleanupClosePushL( linkRegion ); + + GetLinkAreaL( linkRegion, *selectedLink ); + TRect linkRect = linkRegion.BoundingRect(); + + CleanupStack::PopAndDestroy( &linkRegion ); + + TRect viewableAreaRect = iObserver->ViewableAreaRect(); + + + switch ( aKeyEvent.iCode ) { - LinkSelectedL(); + case EKeyLeftArrow: + case EKeyUpArrow: + { + if( linkRect.iTl.iY < viewableAreaRect.iTl.iY ) + { + // Move fields down + iObserver->RePositionFields( + -( linkRect.iTl.iY - viewableAreaRect.iTl.iY ) ); + } + + break; + } + case EKeyRightArrow: + case EKeyDownArrow: + { + if( linkRect.iBr.iY > viewableAreaRect.iBr.iY ) + { + // Move fields up + iObserver->RePositionFields( + -( linkRect.iBr.iY - viewableAreaRect.iBr.iY ) ); + } + break; + } + default: + break; } } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrviewerlabelfield.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrviewerlabelfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Base class for most of the fields in viewer -* -*/ - - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -// -#include "esmrdef.h" -// -#include "cesmrviewerlabelfield.h" -#include "cesmreditor.h" -#include "mesmrlistobserver.h" - -// --------------------------------------------------------------------------- -// CESMRViewerLabelField::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRViewerLabelField* CESMRViewerLabelField::NewL() - { - FUNC_LOG; - CESMRViewerLabelField* self = new (ELeave) CESMRViewerLabelField(); - CleanupStack::PushL( self ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRViewerLabelField::~CESMRViewerLabelField -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRViewerLabelField::~CESMRViewerLabelField() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRViewerLabelField::CESMRViewerLabelField -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRViewerLabelField::CESMRViewerLabelField() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRViewerLabelField::InitializeL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRViewerLabelField::InitializeL() - { - FUNC_LOG; - iLabel->SetFont( iLayout->Font( iCoeEnv, iFieldId )); - - if( CESMRLayoutManager::IsMirrored() ) - { - iLabel->iMargin.iRight = iLayout->TextSideMargin(); - } - else - { - iLabel->iMargin.iLeft = iLayout->TextSideMargin(); - } - - // Set the text color. - if ( IsFocused() ) - { - AknLayoutUtils::OverrideControlColorL( *iLabel, EColorLabelText, - iLayout->ViewerListAreaHighlightedTextColor() ); - } - else - { - AknLayoutUtils::OverrideControlColorL( *iLabel, EColorLabelText, - iLayout->ViewerListAreaTextColor() ); - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerLabelField::ConstructL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRViewerLabelField::ConstructL( TAknsItemID aIconID ) - { - FUNC_LOG; - // If field id is not specified, make this field a "basic" field: - // Basic field can't be hidden from the list. - if( iFieldId == 0 ) - { - SetFieldId( EESMRFieldViewerBasic ); - } - - iLabel = new (ELeave) CEikLabel(); - iLabel->SetLabelAlignment(CESMRLayoutManager::IsMirrored() ? - ELayoutAlignRight : - ELayoutAlignLeft ); - - _LIT( KEmptyText, "" ); - iLabel->SetTextL( KEmptyText ); - CESMRIconField::ConstructL( aIconID, iLabel, EESMRHighlightFocus ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerLabelField::FocusChanged -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRViewerLabelField::FocusChanged( TDrawNow /*aDrawNow*/ ) - { - FUNC_LOG; - // Focus received - if ( IsFocused() ) - { - // If function leaves we continue w/o changing the color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iLabel, EColorLabelText, - iLayout->ViewerListAreaHighlightedTextColor() ) ); - DrawDeferred(); - } - else - { - // If function leaves we continue w/o changing the color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iLabel, EColorLabelText, - iLayout->ViewerListAreaTextColor() ) ); - DrawDeferred(); - } - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cmrattachmentprogressinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cmrattachmentprogressinfo.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment progress info +* +*/ + +#include "cmrattachmentprogressinfo.h" + +#include +#include +#include +#include + +// Unnamed namespace for local definitions +namespace { // codescanner::namespace + +const TInt KOneKiloByte( 1024 ); +const TInt KOneMegaByte( 1048576 ); // (1024^2 or 2^20): + +}//namespace + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NewL +// --------------------------------------------------------------------------- +// +CMRAttachmentProgressInfo* CMRAttachmentProgressInfo::NewL( + CMRFileManager& aFileMan, MProgressDialogCallback& aObserver ) + { + CMRAttachmentProgressInfo* self = + new (ELeave) CMRAttachmentProgressInfo( aFileMan, aObserver ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::CMRAttachmentProgressInfo +// --------------------------------------------------------------------------- +// +CMRAttachmentProgressInfo::CMRAttachmentProgressInfo( + CMRFileManager& aFileMan, MProgressDialogCallback& aObserver ) +: iFileMan( aFileMan ), iObserver( aObserver ) + { + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::~CMRAttachmentProgressInfo +// --------------------------------------------------------------------------- +// +CMRAttachmentProgressInfo::~CMRAttachmentProgressInfo() + { + if( iProgressDialog ) + { + // We cannot do anything for an error at this point + TRAP_IGNORE( iProgressDialog->ProcessFinishedL() ); + } + delete iAsynCallBack; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::StopL +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::StopL() + { + iProgressDialog->ProcessFinishedL(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::StartProgressNoteL +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::StartProgressNoteL(TInt aFinalValue) + { + iAttachmentSize = aFinalValue; + + iProgressDialog = new (ELeave) CAknProgressDialog( + (REINTERPRET_CAST(CEikDialog**, &iProgressDialog)), + ETrue); + iProgressDialog->PrepareLC(R_ATTACHMENT_PROGRESS_NOTE); + iProgressInfo = iProgressDialog->GetProgressInfoL(); + iProgressDialog->SetCallback(this); + iProgressDialog->RunLD(); + iProgressInfo->SetFinalValue(aFinalValue); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::DialogDismissedL +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::DialogDismissedL( TInt aButtonId ) + { + iProgressDialog = NULL; + iProgressInfo = NULL; + if (aButtonId == EAknSoftkeyCancel) + { + // cancel any process in here + iFileMan.CancelOp(); + } + + // Notify client asynchronously + if( iAsynCallBack ) + { + delete iAsynCallBack; + iAsynCallBack = NULL; + } + TCallBack callback( NotifyObserverCallback, this ); + iAsynCallBack = new (ELeave) CAsyncCallBack( + callback, + CActive::EPriorityStandard ); + + // The observer will not be notified if this is not called + iAsynCallBack->CallBack(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NotifyStart +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::NotifyStartL( const TDesC& aFilename ) + { + TParse parser; + parser.Set( aFilename , NULL, NULL ); + const TDesC& filename = parser.NameAndExt(); + + HBufC* stringholder; + + CDesCArrayFlat* attachmentStrings = + new(ELeave)CDesCArrayFlat( 1 ); + CleanupStack::PushL( attachmentStrings ); + + CArrayFixFlat* integers = + new (ELeave) CArrayFixFlat(1); + CleanupStack::PushL( integers ); + + if ( iAttachmentSize >= KOneMegaByte ) + { + attachmentStrings->AppendL( filename ); + + integers->AppendL( iAttachmentSize / KOneMegaByte ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_NOTE_ATTACHMENT_PROGRESS_MEGABYTE, + *attachmentStrings, + *integers ); + } + else + { + attachmentStrings->AppendL( filename ); + + integers->AppendL( iAttachmentSize / KOneKiloByte ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_NOTE_ATTACHMENT_PROGRESS_KILOBYTE, + *attachmentStrings, + *integers ); + } + + iProgressDialog->SetTextProcessing( ETrue ); + iProgressDialog->SetTextL( *stringholder ); + + CleanupStack::PopAndDestroy( stringholder ); + CleanupStack::PopAndDestroy( integers ); + CleanupStack::PopAndDestroy( attachmentStrings ); + + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NotifyProgress +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::NotifyProgress( TInt aBytesCopied ) + { + iBytesTransferred += aBytesCopied; + if(iProgressInfo) + { + iProgressInfo->SetAndDraw(iBytesTransferred); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NotifyEnd +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::NotifyEnd() + { + if( iProgressDialog ) + { + // We can't do anything if this leaves + TRAP_IGNORE( iProgressDialog->ProcessFinishedL() ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NotifyObserverCallback +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentProgressInfo::NotifyObserverCallback( TAny* aThis ) + { + (static_cast( aThis ))->NotifyObserver(); + return 0; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NotifyObserver +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::NotifyObserver() + { + // We don't do anything with observer's leaves + TRAP_IGNORE( iObserver.DialogDismissedL( 0 ) ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentProgressInfo::NotifyError +// --------------------------------------------------------------------------- +// +void CMRAttachmentProgressInfo::NotifyError( TInt /*aError*/ ) + { + NotifyEnd(); + } +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cmrattachmentui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cmrattachmentui.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,634 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment fetch utility class for event viewers and editors +* +*/ + +#include "cmrattachmentui.h" +#include "cmrattachmentprogressinfo.h" +#include "mesmrcalentry.h" +#include "cmrfilemanager.h" +#include "cmrgrid.h" +#include "cesmrglobalnote.h" +#include "esmrhelper.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" + +namespace // codescanner::namespace + { + _LIT8( KUnknownDatatype, "unknown"); + + const TInt KTempTextFileNameLength( 20 ); + _LIT( KTextFilenameExtension, ".txt" ); + + /** + * Check if the character is illegal for the filename + */ + TBool IsIllegalChar(const TUint aChar) + { + return ( + aChar == '*' || + aChar == '\\' || + aChar == '<' || + aChar == '>' || + aChar == ':' || + aChar == '.' || + aChar == '"' || + aChar == '/' || + aChar == '|' || + aChar == '?' || + aChar == CEditableText::EParagraphDelimiter || + aChar == CEditableText::ELineBreak || + aChar < ' ' ); + } + + /** + * Get the file name by making use of the content + */ + void GetFileNameFromBuffer( TFileName& aFileName, + const TDesC& aBuffer, TInt aMaxLength, const TDesC* aExt /*= NULL*/ ) + { + if(aExt!=NULL) + { + aMaxLength -= aExt->Length(); + } + + TInt len = aBuffer.Length(); + TInt max = Min( len, aMaxLength ); + aFileName.Zero(); + + TInt cc = 0; + TUint ch; + TUint ch1 = 0; + TBool spaces = EFalse; + for( TInt i = 0; i < len && cc < max; i++ ) + { + ch = aBuffer[i]; + + // ignore spaces from beginning of the buffer until first + // non-space is encountered. + if( !spaces && ch != ' ' ) + { + spaces = ETrue; + } + + if(i>0) + { + ch1 = aBuffer[i-1]; + } + + // strip illegal chars away. + // checks also if previous and current chars are '.' + if( spaces && !IsIllegalChar(ch) ) + { + if( !( i > 0 && ch == '.' && ch1 == '.' ) ) + { + aFileName.Append( ch ); + cc++; + } + } + } + + aFileName.Trim(); + + // If filename is empty at this point, do not append extension either. + // Instead, empty filename is returned so that caller can use whatever + // default name + if( aFileName.Length() > 0 && aExt != NULL ) + { + aFileName.Append(*aExt); + } + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +EXPORT_C CMRAttachmentUi* CMRAttachmentUi::NewL() + { + FUNC_LOG; + + CMRAttachmentUi* self = new ( ELeave ) CMRAttachmentUi(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CMRAttachmentUi::LaunchFetchUi( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + iEntry = &aEntry; + + TInt error( KErrNone ); + TRAP( error, DoLaunchFetchUiL() ); + return error; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CMRAttachmentUi::LaunchViewerUi( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + iEntry = &aEntry; + TInt error( KErrNone ); + TRAP( error, DoLaunchViewerUiL() ); + return error; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +EXPORT_C CMRAttachmentUi::~CMRAttachmentUi() + { + FUNC_LOG; + + delete iFilesToCopy; + delete iFilesToAdd; + delete iManager; + delete iProgress; + iFsSession.Close(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +EXPORT_C void CMRAttachmentUi::SetObserver( MMRAttachmentUiObserver& aObserver ) + { + FUNC_LOG; + + iObserver = &aObserver; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +EXPORT_C TAttachmentOpResult CMRAttachmentUi::LatestOperationResult() + { + FUNC_LOG; + + TAttachmentOpResult result; + result.iFiles = &(iManager->CopiedFiles()); + return result; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +CMRAttachmentUi::CMRAttachmentUi() + { + FUNC_LOG; + + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentUi::ConstructL() + { + FUNC_LOG; + + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentUi::DoLaunchFetchUiL() + { + FUNC_LOG; + + TMediaFileType type = ResolveAttachmentTypeL(); + + if ( ENoMediaFile != type ) + { + // Create array of descriptors for the selected files + iFilesToCopy = new ( ELeave ) CDesCArrayFlat( 5 ); + iFilesToAdd = new ( ELeave ) CDesCArrayFlat( 1 ); + TBool retval( EFalse ); + HBufC* buf = NULL; + // Connect session + User::LeaveIfError( iFsSession.Connect() ); + User::LeaveIfError( iFsSession.ShareProtected() ); + + if( type == EPresentationsFile ) + { + buf = CNotepadApi::FetchMemoL(); + if( buf ) + { + CleanupStack::PushL(buf); + + TFileName filename; + TInt max = KTempTextFileNameLength; + + // first try to create filename from memo text. + GetFileNameFromBuffer( filename, *buf, max, &KTextFilenameExtension ); + + TFileName tempPath; + User::LeaveIfError( ESMRHelper::CreateAndAppendPrivateDirToFileName( tempPath ) ); + tempPath.Append( filename ); + + // check the file name for validity and possible name duplicates. + TInt err = CApaApplication::GenerateFileName( iFsSession, tempPath ); + + if( err == KErrNone ) + { + // write buffer to text file + CPlainText* text = CPlainText::NewL(); + CleanupStack::PushL( text ); + text->InsertL( 0, *buf ); + text->ExportAsTextL( tempPath, CPlainText::EOrganiseByParagraph, 0 ); + CleanupStack::PopAndDestroy( text ); + iFilesToAdd->AppendL( tempPath ); + } + + CleanupStack::PopAndDestroy( buf ); + } + } + else if( type == EAnyMediaFile ) + { + TInt supportedTypes = AknCommonDialogsDynMem::EMemoryTypePhone | + AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage | + AknCommonDialogsDynMem::EMemoryTypeMMCExternal; + + TFileName filename; + retval = AknCommonDialogsDynMem::RunSelectDlgLD( supportedTypes, + filename, + R_MR_ATTACHMENT_MEMORY_SELECTION_DIALOG, + /*aFilter*/NULL, + /*aVerifier*/this ); + if( retval ) + { + iFilesToCopy->AppendL( filename ); + } + } + else + { + // Open the dialog. + retval = MGFetch::RunL( + *iFilesToCopy, // When dialog is closed, fileArray contains selected files + type, // Displays only media files of type aMediaType + ETrue, // single or multiple file selection + this // Pointer to class implementing MMGFetchVerifier; + // when user has selected file(s), + // MMGFetchVerifier::VerifySelectionL is called. + ); + } + + TInt index(0); + while ( index < iFilesToCopy->MdcaCount() ) + { + TPtrC filename( iFilesToCopy->MdcaPoint(index) ); + if ( IsDuplicateNameL( filename ) ) + { + iFilesToCopy->Delete( index ); + + //though attachment is aleady attached to this entry, show the info note for this info. + CAknInformationNote* note = new ( ELeave ) CAknInformationNote(ETrue); + HBufC* cannotAttach = StringLoader::LoadLC( + R_QTN_MEET_REQ_INFO_ALREADY_ATTACHED ); + note->ExecuteLD( *cannotAttach ); + CleanupStack::PopAndDestroy( cannotAttach ); + } + else + { + ++index; + } + } + + // Start copy + if( iFilesToCopy->MdcaCount() > 0 ) + { + // Count files to be copied + iFileCount = iFilesToCopy->Count(); + if( iFileCount > 0 ) + { + StartCopyOpL(); + } + } + // Add directly to CCalAttachment, no copy needed + else if( iFilesToAdd->MdcaCount() > 0 ) + { + UpdateEntryL(); + } + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentUi::StartCopyOpL() + { + FUNC_LOG; + + // Fetch the first filename from the array + TInt size( 0 ); + for( TInt i = 0; i < iFileCount; ++i ) + { + const TDesC& originalPath = (*iFilesToCopy)[i]; + TEntry entry; + User::LeaveIfError( iFsSession.Entry( originalPath,entry ) ); + // Count total size for the progressbar + size += entry.iSize; + } + + if( !iManager ) + { + iManager = CMRFileManager::NewL(iFsSession); + } + if( !iProgress ) + { + iProgress = CMRAttachmentProgressInfo::NewL( *iManager, *this ); + } + // Give total size to progress bar + // Set progressbar as a observer to copy operation + iProgress->StartProgressNoteL( size ); + + // Check if there is space available + if( !SysUtil::FFSSpaceBelowCriticalLevelL( &iFsSession, size ) ) + { + iManager->SetObserver( *iProgress ); + iManager->CopyFilesL( *iFilesToCopy ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentUi::UpdateEntryL() + { + FUNC_LOG; + + MDesC16Array* fileArray = NULL; + if( iFilesToAdd->MdcaCount() > 0 ) + { + fileArray = iFilesToAdd; + } + else + { + fileArray = &iManager->CopiedFiles(); + } + + TInt fileCount( fileArray->MdcaCount() ); + + for( TInt i = 0; i < fileCount; ++i ) + { + const TDesC& fileName( fileArray->MdcaPoint(i) ); + // When copy done add attachment File handles to calentry + RFile fileHandle; + User::LeaveIfError( fileHandle.Open( + iFsSession, fileName, EFileWrite ) ); + CleanupClosePushL( fileHandle ); + // create attachment and add to calendar entry + CCalAttachment* attachment = CCalAttachment::NewFileL( fileHandle ); + + RApaLsSession apaSession; + TDataRecognitionResult dataType; + User::LeaveIfError(apaSession.Connect()); + apaSession.RecognizeData(fileHandle, dataType); + apaSession.Close(); + + TPtrC8 contentType( dataType.iDataType.Des8() ); + + if ( contentType.Length() ) + { + attachment->SetMimeTypeL( contentType ); + } + else + { + attachment->SetMimeTypeL( KUnknownDatatype ); + } + + CleanupStack::PopAndDestroy( &fileHandle ); + CleanupStack::PushL( attachment ); + // set attachment properties + const TDesC& filenameOriginal = iFilesToCopy->MdcaPoint( i ); + TFileName label; + TParse parser; + parser.Set( filenameOriginal , NULL, NULL ); + label.Append( parser.NameAndExt() ); + attachment->SetLabelL( label ); + + + + iEntry->Entry().AddAttachmentL( *attachment ); // calEntry takes ownership + CleanupStack::Pop( attachment ); + } + + if( iObserver ) + { + iObserver->AttachmentOperationCompleted( *iFilesToCopy ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentUi::DoLaunchViewerUiL() + { + FUNC_LOG; + + // TODO: Launch attachment view + // read attachments from calentry and populate the listbox + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +TMediaFileType CMRAttachmentUi::ResolveAttachmentTypeL() + { + FUNC_LOG; + + TMediaFileType type = ENoMediaFile; + TInt selectedOption( 0 ); + + if ( CMRGrid::ExecuteL( selectedOption ) ) + { + switch( selectedOption ) + { + case 0: + type = EImageFile; + break; + case 1: + type = EVideoFile; + break; + case 2: + type = EMusicFile; + break; + case 3: + type = EPresentationsFile; + break; + case 4: + type = EAnyMediaFile; + break; + + default: + break; + } + } + + return type; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentUi::DialogDismissedL( TInt /*aButtonId*/ ) + { + FUNC_LOG; + + // Called whent the copy process has ended + UpdateEntryL(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::VerifySelectionL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentUi::VerifySelectionL( const MDesCArray* aSelectedFiles ) + { + FUNC_LOG; + + TInt fileCount = aSelectedFiles->MdcaCount(); + TBool isProtected = EFalse; + for( TInt i = 0; i < fileCount; ++i ) + { + const TDesC& originalPath = aSelectedFiles->MdcaPoint( i ); + RFile selected; + User::LeaveIfError( selected.Open( + iFsSession, originalPath, EFileRead ) ); + CleanupClosePushL( selected ); + isProtected = FileDrmProtectedL( selected ); + CleanupStack::PopAndDestroy(); + if ( isProtected ) + { + break; + } + } + // Protected file returns verification fail and + // unprotected file returns verification ok + return !isProtected; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::OkToExitL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentUi::OkToExitL( + const TDesC& aDriveAndPath, + const TEntry& aEntry ) + { + FUNC_LOG; + + TFileName path; + path = aDriveAndPath; + path.Append( aEntry.iName ); + + RFile selected; + User::LeaveIfError( selected.Open( iFsSession, path, EFileRead ) ); + CleanupClosePushL( selected ); + TBool isProtected = FileDrmProtectedL( selected ); + CleanupStack::PopAndDestroy(); + + // Protected file returns not ok to exit and + // unprotected file returns ok to exit + return !isProtected; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::FileDrmProtectedL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentUi::FileDrmProtectedL( RFile& aFile ) + { + FUNC_LOG; + + TBool isProtected( EFalse ); + CCommonContentPolicy* ccp = CCommonContentPolicy::NewLC(); + isProtected = ccp->IsClosedFileL( aFile ); + if ( isProtected ) + { + // TODO: Add suitable note to cesmrglobalnote.cpp + CESMRGlobalNote::ExecuteL + ( CESMRGlobalNote::EESMRAlarmAlreadyPassed ); + } + CleanupStack::PopAndDestroy( ccp ); + return isProtected; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentUi::IsDuplicateNameL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentUi::IsDuplicateNameL( + const TDesC& aSelectedFile ) + { + FUNC_LOG; + + CCalEntry& entry( iEntry->Entry() ); + + TInt attachmentCount = entry.AttachmentCountL(); + + TBool matchNotFound( ETrue ); + if( attachmentCount ) + { + TParsePtrC fileNameParser(aSelectedFile); + TPtrC parsedFileName = fileNameParser.NameAndExt(); + + for(TInt index = 0; index < attachmentCount && matchNotFound; ++index) + { + CCalAttachment* attachment = entry.AttachmentL(index); + matchNotFound = parsedFileName.Compare( attachment->Label() ); + } + } + + return !matchNotFound; + } + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cmrbackground.cpp --- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cmrbackground.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cmrbackground.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,7 +16,9 @@ */ #include "cmrbackground.h" -#include + +#include "nmrglobalfeaturesettings.h" +#include // unnamed namespace for local definitions @@ -37,6 +39,19 @@ User::Panic( KCategory(), aPanic ); } #endif // _DEBUG + + TBool IsFocusUsed() + { + TBool retval( EFalse ); + if ( NMRGlobalFeatureSettings::KeyboardType() != + NMRGlobalFeatureSettings::ENoKeyboard ) + { + // If there is a keyboard then we can show the focus + retval = ETrue; + } + + return retval; + } }//namespace // ======== MEMBER FUNCTIONS ======== @@ -46,9 +61,9 @@ // --------------------------------------------------------------------------- // EXPORT_C -CMRBackground* CMRBackground::NewL( CESMRLayoutManager& aLayoutManager ) +CMRBackground* CMRBackground::NewL() { - CMRBackground* self = new (ELeave) CMRBackground( aLayoutManager ); + CMRBackground* self = new (ELeave) CMRBackground(); CleanupStack::PushL( self ); CleanupStack::Pop( self ); return self; @@ -58,8 +73,7 @@ // CMRBackground::CMRBackground // --------------------------------------------------------------------------- // -CMRBackground::CMRBackground( CESMRLayoutManager& aLayoutManager ) - : iLayoutManager( aLayoutManager ) +CMRBackground::CMRBackground() { // Do nothing } @@ -81,24 +95,41 @@ const CCoeControl& aControl, const TRect& /*aRect*/ ) const { - const CESMRField& ctrl = - static_cast ( aControl ); - TBool hasOutlineFocus = ctrl.HasOutlineFocus(); - TESMRFieldFocusType focusType = ctrl.GetFocusType(); - // highlight bitmap target rect: - TRect rect( ctrl.GetFocusRect() ); - rect.Move( ctrl.Position() ); - - if ( hasOutlineFocus ) + if ( IsFocusUsed() ) { - if( focusType == EESMRHighlightFocus ) + const CESMRField& ctrl = + static_cast ( aControl ); + TBool hasOutlineFocus = ctrl.HasOutlineFocus(); + TESMRFieldFocusType focusType = ctrl.GetFocusType(); + // highlight bitmap target rect: + TRect rect( ctrl.GetFocusRect() ); + rect.Move( ctrl.Position() ); + + if ( hasOutlineFocus ) { - if( ctrl.FieldMode() == EESMRFieldModeView ) + if( focusType == EESMRHighlightFocus ) { - // Focused viewer field - DrawFocus( aGc, rect, aControl, EViewerFieldWithFocus ); - } + if( ctrl.FieldMode() == EESMRFieldModeView ) + { + // Focused viewer field + DrawFocus( aGc, rect, aControl, EViewerFieldWithFocus ); + } + else + { + // Focused editor field + DrawFocus( aGc, rect, aControl, EEditorFieldWithFocus ); + } + } } + // TODO: Need to be removed after ui designer says that it can be removed. + // else + // { + // if( ctrl.FieldMode() == EESMRFieldModeEdit ) + // { + // // Not focused editor field + // DrawFocus( aGc, rect, aControl, EEditorFieldNoFocus ); + // } + // } } } @@ -124,6 +155,18 @@ array->AppendL( NMRBitmapManager::EMRBitmapListRight ); array->AppendL( NMRBitmapManager::EMRBitmapListBottomRight ); } + else if ( aType == EEditorFieldWithFocus ) + { + array->AppendL( NMRBitmapManager::EMRBitmapInputTopLeft ); + array->AppendL( NMRBitmapManager::EMRBitmapInputLeft ); + array->AppendL( NMRBitmapManager::EMRBitmapInputBottomLeft ); + array->AppendL( NMRBitmapManager::EMRBitmapInputTop ); + array->AppendL( NMRBitmapManager::EMRBitmapInputCenter ); + array->AppendL( NMRBitmapManager::EMRBitmapInputBottom ); + array->AppendL( NMRBitmapManager::EMRBitmapInputTopRight ); + array->AppendL( NMRBitmapManager::EMRBitmapInputRight ); + array->AppendL( NMRBitmapManager::EMRBitmapInputBottomRight ); + } else { array->AppendL( NMRBitmapManager::EMRBitmapSetOptTopLeft ); @@ -134,7 +177,7 @@ array->AppendL( NMRBitmapManager::EMRBitmapSetOptBottom ); array->AppendL( NMRBitmapManager::EMRBitmapSetOptTopRight ); array->AppendL( NMRBitmapManager::EMRBitmapSetOptRight ); - array->AppendL( NMRBitmapManager::EMRBitmapSetOptBottomRight ); + array->AppendL( NMRBitmapManager::EMRBitmapSetOptBottomRight ); } CleanupStack::Pop( array ); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cmrfilemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cmrfilemanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,368 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File manager for managing file copy op +* +*/ + +#include "cmrfilemanager.h" +#include "esmrhelper.h" +#include + +/// LOCAL NAMESPACE +namespace + { +// File copying block size +const TInt KWriteBlockSize( 1024 ); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::NewL +// --------------------------------------------------------------------------- +// +CMRFileManager* CMRFileManager::NewL( RFs& aFs ) + { + CMRFileManager* self = new ( ELeave ) CMRFileManager( aFs ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRFileManager::~CMRFileManager +// --------------------------------------------------------------------------- +// +CMRFileManager::~CMRFileManager() + { + delete iFileArray; + delete iCurrentFilename; + delete iTempFilename; + delete iOutputFileArray; + iReadStream.Close(); + iWriteStream.Close(); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CMRFileManager +// --------------------------------------------------------------------------- +// +CMRFileManager::CMRFileManager( RFs& aFs ) +: CActive( CActive::EPriorityStandard ), iFs( aFs ) + { + + } + +// --------------------------------------------------------------------------- +// CMRFileManager::ConstructL +// --------------------------------------------------------------------------- +// +void CMRFileManager::ConstructL() + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CopyFilesL +// --------------------------------------------------------------------------- +// +void CMRFileManager::CopyFilesL( MDesC16Array& aFilenameArray ) + { + // Take copy of the original filename array + TInt count( aFilenameArray.MdcaCount() ); + if( iFileArray ) + { + delete iFileArray; + iFileArray = NULL; + } + iFileArray = new (ELeave) CDesCArrayFlat( count ); + for( TInt i = 0; i < count; ++i ) + { + iFileArray->AppendL( aFilenameArray.MdcaPoint( i ) ); + } + + if( iOutputFileArray ) + { + delete iOutputFileArray; + iOutputFileArray = NULL; + } + iOutputFileArray = new (ELeave) CDesCArrayFlat( count ); + if( iCurrentFilename ) + { + delete iCurrentFilename; + iCurrentFilename = NULL; + } + + PrepareNextFileL(); + + iState = ECopyFile; + AsyncOp(); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CopyFileL +// --------------------------------------------------------------------------- +// +void CMRFileManager::CopyFileL( + const TDesC& aSourceFilename, + const TDesC& aDestFilename ) + { + Cancel(); + + iReadStream.Close(); + iWriteStream.Close(); + iReadStream.Open( iFs, aSourceFilename, EFileShareReadersOnly ); + iWriteStream.Open( iFs, aDestFilename, EFileWrite|EFileShareAny ); + + if ( iObserver ) + { + iObserver->NotifyStartL( aSourceFilename ); + } + + iState = ECopyFile; + + AsyncOp(); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CopyFileL +// --------------------------------------------------------------------------- +// +void CMRFileManager::CopyFileL( RFile& aSource, RFile& aDest ) + { + Cancel(); + + iReadStream.Close(); + iWriteStream.Close(); + iReadStream.Attach( aSource ); + iWriteStream.Attach( aDest ); + + if ( iObserver ) + { + TFileName name; + + if ( KErrNone == aSource.Name( name ) ) + { + iObserver->NotifyStartL( name ); + } + } + + iState = ECopyFile; + AsyncOp(); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CancelOp +// --------------------------------------------------------------------------- +// +void CMRFileManager::CancelOp() + { + iState = ECancelled; + } + +// --------------------------------------------------------------------------- +// CMRFileManager::PrepareNextFileL +// --------------------------------------------------------------------------- +// +void CMRFileManager::PrepareNextFileL() + { + // Take first item as current + if( iCurrentFilename ) + { + delete iCurrentFilename; + iCurrentFilename = NULL; + } + iCurrentFilename = (*iFileArray)[ 0 ].AllocL(); + + + TParse parser; + parser.Set( *iCurrentFilename , NULL, NULL ); + TFileName attachmentName( parser.NameAndExt() ); + + User::LeaveIfError( ESMRHelper::CreateAndAppendPrivateDirToFileName( attachmentName ) ); + + iReadStream.Close(); + iWriteStream.Close(); + User::LeaveIfError( iWriteStream.Replace( iFs, attachmentName, EFileWrite|EFileShareAny ) ); + iReadStream.Open( iFs, *iCurrentFilename, EFileRead ); + iOutputFileArray->AppendL( attachmentName ); + + delete iTempFilename; + iTempFilename = NULL; + iTempFilename = attachmentName.AllocL(); + + if( iObserver ) + { + iObserver->NotifyStartL( *iCurrentFilename ); + } + } + +// --------------------------------------------------------------------------- +// CMRFileManager::SetObserver +// --------------------------------------------------------------------------- +// +void CMRFileManager::SetObserver( MMRFileManObserver& aObserver ) + { + iObserver = &aObserver; + } + +// --------------------------------------------------------------------------- +// CMRFileManager::RunL +// --------------------------------------------------------------------------- +// +void CMRFileManager::RunL() + { + if( iStatus.Int() != KErrNone ) + { + iReadStream.Close(); + iWriteStream.Close(); + + if( iObserver ) + { + iObserver->NotifyError( iStatus.Int() ); + } + return; + } + switch( iState ) + { + case ECopyFile: + { + CopyFileL(); + + if( iObserver ) + { + iObserver->NotifyProgress( KWriteBlockSize ); + } + AsyncOp(); + break; + } + case ECancelled: + { + if( iObserver ) + { + iReadStream.Close(); + iWriteStream.Close(); + // Delete last because it was cancelled + if ( iOutputFileArray ) + { + iOutputFileArray->Delete( iOutputFileArray->Count() - 1 ); + } + iObserver->NotifyEnd(); + iState = EDone; + } + break; + } + case EDone: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// CMRFileManager::RunError +// --------------------------------------------------------------------------- +// +TInt CMRFileManager::RunError( TInt aError ) + { + if ( aError == KErrEof ) // File has been copied fully + { + aError = KErrNone; + if( iFileArray && iFileArray->Count() > 1 ) + { + iFileArray->Delete( 0 ); + + // Start new file copy op + TRAP( aError, + { + PrepareNextFileL(); + AsyncOp(); + } ) + } + else + { + if( iObserver ) + { + iReadStream.Close(); + iWriteStream.Close(); + + iObserver->NotifyEnd(); + iState = EDone; + } + } + } + + if ( aError ) + { + iReadStream.Close(); + iWriteStream.Close(); + + if( iObserver ) + { + iObserver->NotifyError( aError ); + iState = EDone; + } + } + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CMRFileManager::DoCancel +// --------------------------------------------------------------------------- +// +void CMRFileManager::DoCancel() + { + iReadStream.Close(); + iWriteStream.Close(); + delete iFileArray; + iFileArray = NULL; + delete iOutputFileArray; + iOutputFileArray = NULL; + iFileIndex = KErrNotFound; + delete iCurrentFilename; + iCurrentFilename = NULL; + delete iTempFilename; + iTempFilename = NULL; + } + +// --------------------------------------------------------------------------- +// CMRFileManager::AsyncOp +// --------------------------------------------------------------------------- +// +void CMRFileManager::AsyncOp() + { + SetActive(); + TRequestStatus *stat = &iStatus; + User::RequestComplete( stat, KErrNone ); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CopyFileL +// --------------------------------------------------------------------------- +// +void CMRFileManager::CopyFileL() + { + iWriteStream.WriteL( iReadStream, KWriteBlockSize ); + } + +// --------------------------------------------------------------------------- +// CMRFileManager::CopiedFiles +// --------------------------------------------------------------------------- +// +MDesC16Array& CMRFileManager::CopiedFiles() const + { + return *iOutputFileArray; + } +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuildercommon/src/cmrgrid.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cmrgrid.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,323 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR grid impl. +* +*/ + +#include "cmrgrid.h" + +#include "nmrbitmapmanager.h" +#include "nmrlayoutmanager.h" +#include "esmrhelper.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + +namespace { // codescanner::namespace + +//CONSTANTS +const TInt KColumns( 3 ); +const TInt KRows( 2 ); + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRGrid::CMRGrid() +// --------------------------------------------------------------------------- +// +CMRGrid::CMRGrid() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRGrid::NewL +// --------------------------------------------------------------------------- +// +TBool CMRGrid::ExecuteL( TInt& aSelectedOption ) + { + FUNC_LOG; + + CMRGrid* self = new( ELeave )CMRGrid(); + CleanupStack::PushL ( self ); + TBool ret = self->ShowGridL( aSelectedOption ); + CleanupStack::PopAndDestroy( self ); + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRGrid::~CMRGrid +// --------------------------------------------------------------------------- +// +CMRGrid::~CMRGrid( ) + { + FUNC_LOG; + delete iGrid; + } + +// --------------------------------------------------------------------------- +// CMRGrid::AddGridIconsL +// --------------------------------------------------------------------------- +// +void CMRGrid::AddGridIconsL() + { + FUNC_LOG; + + CArrayPtr* iconArray = new( ELeave ) CAknIconArray( 1 ); + CleanupStack::PushL( iconArray ); + + /* + * 1. Item: Image + */ + CFbsBitmap* imageBitmap = NULL; + CFbsBitmap* imageBitmapMask = NULL; + GetSkinBasedBitmapLC( NMRBitmapManager::EMRBitmapAttachmentTypeImage, + imageBitmap, + imageBitmapMask, + TSize( 100, 100 ) ); + + CGulIcon* imageIcon = CGulIcon::NewL( imageBitmap, imageBitmapMask ); + CleanupStack::Pop( 2 ); // imageBitmap, imageBitmapMask + CleanupStack::PushL( imageIcon ); + iconArray->AppendL( imageIcon ); + CleanupStack::Pop( imageIcon ); + + /* + * 2. Item: Video clip + */ + CFbsBitmap* videoClipBitmap = NULL; + CFbsBitmap* videoClipBitmapMask = NULL; + GetSkinBasedBitmapLC( NMRBitmapManager::EMRBitmapAttachmentTypeVideo, + videoClipBitmap, + videoClipBitmapMask, + TSize( 100, 100 ) ); + + CGulIcon* videoClipIcon = CGulIcon::NewL( videoClipBitmap, videoClipBitmapMask ); + CleanupStack::Pop( 2 ); // videoClipBitmap, videoClipBitmapMask + CleanupStack::PushL( videoClipIcon ); + iconArray->AppendL( videoClipIcon ); + CleanupStack::Pop( videoClipIcon ); + + /* + * 3. Item: Sound clip + */ + CFbsBitmap* soundClipBitmap = NULL; + CFbsBitmap* soundClipBitmapMask = NULL; + GetSkinBasedBitmapLC( NMRBitmapManager::EMRBitmapAttachmentTypeMusic, + soundClipBitmap, + soundClipBitmapMask, + TSize( 100, 100 ) ); + + CGulIcon* soundClipIcon = CGulIcon::NewL( soundClipBitmap, soundClipBitmapMask ); + CleanupStack::Pop( 2 ); // soundClipBitmap, soundClipBitmapMask + CleanupStack::PushL( soundClipIcon ); + iconArray->AppendL( soundClipIcon ); + CleanupStack::Pop( soundClipIcon ); + + /* + * 4. Item: Note + */ + CFbsBitmap* noteBitmap = NULL; + CFbsBitmap* noteBitmapMask = NULL; + GetSkinBasedBitmapLC( NMRBitmapManager::EMRBitmapAttachmentTypeNote, + noteBitmap, + noteBitmapMask, + TSize( 100, 100 ) ); + + CGulIcon* noteIcon = CGulIcon::NewL( noteBitmap, noteBitmapMask ); + CleanupStack::Pop( 2 ); // noteBitmap, noteBitmapMask + CleanupStack::PushL( noteIcon ); + iconArray->AppendL( noteIcon ); + CleanupStack::Pop( noteIcon ); + + /* + * 5. Item: Other + */ + CFbsBitmap* otherBitmap = NULL; + CFbsBitmap* otherBitmapMask = NULL; + GetSkinBasedBitmapLC( NMRBitmapManager::EMRBitmapAttachmentTypeOther, + otherBitmap, + otherBitmapMask, + TSize( 100, 100 ) ); + + CGulIcon* otherIcon = CGulIcon::NewL( otherBitmap, otherBitmapMask ); + CleanupStack::Pop( 2 ); // otherBitmap, otherBitmapMask + CleanupStack::PushL( otherIcon ); + iconArray->AppendL( otherIcon ); + CleanupStack::Pop( otherIcon ); + + iGrid->ItemDrawer()->ColumnData()->SetIconArray( iconArray ); + + CleanupStack::Pop( iconArray ); + iGrid->HandleItemAdditionL(); + } + +// --------------------------------------------------------------------------- +// CMRGrid::ShowGridL +// --------------------------------------------------------------------------- +// +TBool CMRGrid::ShowGridL( TInt& aSelectedOption ) + { + FUNC_LOG; + TRect mainPaneRect( 0, 0, 0, 0 ); + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EMainPane, mainPaneRect ); + + TAknLayoutRect gridLayoutRect = + NMRLayoutManager::GetLayoutRect( + mainPaneRect, + NMRLayoutManager::EMRLayoutAttachmentSelectionGrid ); + + TRect gridRect( gridLayoutRect.Rect() ); + + TAknLayoutRect cellLayoutRect = + NMRLayoutManager::GetLayoutRect( + gridRect, + NMRLayoutManager::EMRLayoutAttachmentSelectionGridCell ); + + TRect cellRect( cellLayoutRect.Rect() ); + cellRect.Move( -gridRect.iTl); + + iGrid = new( ELeave ) CAknGrid; + CAknPopupList* gridList = CAknPopupList::NewL( + iGrid, R_AVKON_SOFTKEYS_SELECT_BACK ); + CleanupStack::PushL( gridList ); + + // Load query heading + HBufC* buf( StringLoader::LoadLC( + R_QTN_MEET_REQ_QUERY_HEADING_SELECT_ATTACHMENT_TYPE ) ); + gridList->SetTitleL( *buf ); + CleanupStack::PopAndDestroy( buf ); + + iGrid->ConstructL( gridList, EAknListBoxMenuGrid ); + iGrid->SetLayoutL( + EFalse, ETrue, ETrue, KColumns, KRows, cellRect.Size() ); + iGrid->SetPrimaryScrollingType( + CAknGridView::EScrollIncrementLineAndLoops ); + iGrid->SetSecondaryScrollingType( + CAknGridView::EScrollIncrementLineAndLoops ); + + iGrid->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOff ); + + CDesCArray *gridItemArray = static_cast( + iGrid->Model()->ItemTextArray() ); + + // The order of the items should be in line with + // CMRAttachmentUi::ResolveAttachmentTypeL switch case items. + // TODO: update texts to be read from resource + HBufC* textImage = StringLoader::LoadLC( + R_QTN_MEET_REQ_ATTACHMENT_TYPE_IMAGE ); + gridItemArray->AppendL( _L("0\tImage") /*textImage*/ ); + CleanupStack::PopAndDestroy( textImage ); + + HBufC* textVideo = StringLoader::LoadLC( + R_QTN_MEET_REQ_ATTACHMENT_TYPE_VIDEO ); + gridItemArray->AppendL( _L("1\tVideo clip") /*textVideo*/ ); + CleanupStack::PopAndDestroy( textVideo ); + + HBufC* textSound = StringLoader::LoadLC( + R_QTN_MEET_REQ_ATTACHMENT_TYPE_SOUNDCLIP ); + gridItemArray->AppendL( _L("2\tSound clip") /*textSound*/ ); + CleanupStack::PopAndDestroy( textSound ); + + HBufC* textNote = StringLoader::LoadLC( + R_QTN_MEET_REQ_ATTACHMENT_TYPE_NOTE ); + gridItemArray->AppendL( _L("3\tNote") /*textNote*/ ); + CleanupStack::PopAndDestroy( textNote ); + + HBufC* textOther = StringLoader::LoadLC( + R_QTN_MEET_REQ_ATTACHMENT_TYPE_NOTE ); + gridItemArray->AppendL( _L("4\tOther") /*textOther*/ ); + CleanupStack::PopAndDestroy( textOther ); + + iGrid->HandleItemAdditionL(); + + AddGridIconsL(); + + TAknLayoutRect graphicLayoutRect = + NMRLayoutManager::GetLayoutRect( + cellRect, + NMRLayoutManager:: + EMRLayoutAttachmentSelectionGridCellGraphic ); + + TRect graphicRect( graphicLayoutRect.Rect() ); + + // Setup grid graphics + AknListBoxLayouts::SetupFormGfxCell( + *iGrid, iGrid->ItemDrawer(), + 0 /*Column index*/, + graphicRect.iTl.iX /*Left pos*/, + graphicRect.iTl.iY /*Top pos*/, + 0 /*unused*/, + 0 /*unused*/, + graphicRect.Width() /*Icon width*/, + graphicRect.Height() /*Icon height*/, + graphicRect.iTl /*Start pos*/, + graphicRect.iBr /*End pos*/ ); + + TAknLayoutText gridTextLayout( + NMRLayoutManager::GetLayoutText( + cellRect, + NMRLayoutManager:: + EMRTextLayoutAttachmentSelectionGridCellText ) ); + + TRect textRect( gridTextLayout.TextRect() ); + + // Calculate the text baseline + TInt baseLine( cellRect.iBr.iY - ( cellRect.iBr.iY - textRect.iBr.iY ) ); + // Reduce font's descent -> Baseline calculated + baseLine -= gridTextLayout.Font()->DescentInPixels(); + + // Setup grid texts + AknListBoxLayouts::SetupFormTextCell( + *iGrid, iGrid->ItemDrawer(), + 1 /*Column index*/, + gridTextLayout.Font() /*Font type*/, + gridTextLayout.Color().Value() /*color*/, + 0 /*Left margin*/, + 0 /*unused*/, + baseLine/*Baseline*/, + 0 /*Text width*/, + gridTextLayout.Align() /*Text alignment*/, + textRect.iTl /*Start pos*/, + textRect.iBr /*End pos*/); + + TBool popupOk = gridList->ExecuteLD(); + aSelectedOption = iGrid->CurrentDataIndex(); + CleanupStack::Pop( gridList ); + + return popupOk; + } + +//EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/data/esmrfieldbuilderplugin.rss --- a/meetingrequest/mrgui/mrfieldbuilderplugin/data/esmrfieldbuilderplugin.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/data/esmrfieldbuilderplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/group/bld.inf --- a/meetingrequest/mrgui/mrfieldbuilderplugin/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,13 +15,11 @@ * */ - -#include -#include - #include "../../../inc/esmrinternaluid.h" #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber #include "../../../../inc/emailtraceconfig.hrh" +#include +#include TARGET esmrfieldbuilderplugin.dll TARGETTYPE PLUGIN @@ -30,26 +28,23 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging +// Includes +APP_LAYER_SYSTEMINCLUDE -// Includes -APP_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc USERINCLUDE ../../inc USERINCLUDE ../../../inc USERINCLUDE ../../../../inc //implementations -SOURCEPATH ../src -SOURCE CESMRFieldBuilderPluginProxy.cpp -SOURCE CESMRFieldBuilderPlugin.cpp - SOURCEPATH ../src +SOURCE cesmrfieldbuilderpluginproxy.cpp +SOURCE cesmrfieldbuilderplugin.cpp SOURCE cesmrrepeatuntil.cpp SOURCE cesmrsubjectfield.cpp SOURCE cesmrtimefield.cpp +SOURCE cmrtimecontainer.cpp SOURCE cesmrdatefield.cpp SOURCE cesmrlocationfield.cpp SOURCE cesmralarmfield.cpp @@ -57,11 +52,20 @@ SOURCE cesmrdescriptionfield.cpp SOURCE cesmrcheckbox.cpp SOURCE cesmrsingletimefield.cpp -SOURCE cesmrbooleanfield.cpp SOURCE cesmrsyncfield.cpp -SOURCE cesmrsync.cpp +SOURCE cesmrtextitem.cpp SOURCE cesmrpriority.cpp SOURCE cesmrpriorityfield.cpp +SOURCE cmrattachmentsfield.cpp +SOURCE cmrunifiededitorfield.cpp +SOURCE cmrmulticalenfield.cpp +SOURCE cmrviewerattachmentfield.cpp +SOURCE cmrattachmentcommandhandler.cpp +SOURCE cmrattachmentcommand.cpp +SOURCE cmropenattachmentcommand.cpp +SOURCE cmrremoveattachmentcommand.cpp +SOURCE cmrsaveattachmentcommand.cpp +SOURCE cmralarmonofffield.cpp SOURCE cesmrviewerlocationfield.cpp SOURCE cesmrviewerstartdatefield.cpp @@ -77,6 +81,7 @@ SOURCE cesmrvieweralarmdatefield.cpp SOURCE cesmrvieweralarmtimefield.cpp SOURCE cesmrviewerdetailedsubjectfield.cpp +SOURCE cmrsaveandopenattachmentcommand.cpp SOURCEPATH ../data START RESOURCE esmrfieldbuilderplugin.rss @@ -84,11 +89,12 @@ END // Dependencies to mrui components -LIBRARY esmrgui.lib -LIBRARY esmrservices.lib //attachmentinfo handling -LIBRARY esmrfieldbuildercommon.lib //cesmrfield, cesmrborderlayer etc -LIBRARY esmrcommon.lib //esmrhelper::locateresourcefile() +LIBRARY esmrcommon.lib +LIBRARY esmrservices.lib +LIBRARY esmrfieldbuildercommon.lib LIBRARY esmrfieldevent.lib +LIBRARY mrguicommon.lib +LIBRARY remoteattachment.lib // Dependencies to Symbian/S60 OS components LIBRARY apparc.lib @@ -111,10 +117,18 @@ LIBRARY avkon.lib LIBRARY aknlayout2.lib LIBRARY cdlengine.lib -LIBRARY cmaillogger.lib +LIBRARY caleninterimutils2.lib +LIBRARY eikcore.lib +LIBRARY npdlib.lib +LIBRARY apgrfx.lib +LIBRARY efsrv.lib +LIBRARY commonui.lib +LIBRARY apmime.lib +LIBRARY aknnotify.lib -#ifdef TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +LIBRARY cmaillogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/CESMRFieldBuilderPlugin.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/CESMRFieldBuilderPlugin.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/CESMRFieldBuilderPlugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmralarmfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmralarmfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmralarmfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,10 +19,11 @@ #ifndef CESMRALARMFIELD_H #define CESMRALARMFIELD_H -#include "cesmriconfield.h" +#include "cesmrfield.h" -class CEikLabel; +class CMRLabel; class CESMRAlarm; +class CMRImage; class MESMRFieldValidator; /** @@ -33,7 +34,7 @@ * * @see cesmralarm.h */ -NONSHARABLE_CLASS( CESMRAlarmField ) : public CESMRIconField +NONSHARABLE_CLASS( CESMRAlarmField ) : public CESMRField { public: /** @@ -47,16 +48,18 @@ ~CESMRAlarmField(); public: // From CESMRField - void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void ExternalizeL( MESMRCalEntry& aEntry ); void SetOutlineFocusL( TBool aFocus ); TBool OkToLoseFocusL( TESMREntryFieldId aId ); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); public: // From CCoeControl TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SizeChanged(); + private: /** * Constructor @@ -98,9 +101,12 @@ private: /** - * Not own: Label for current alarm value + * Own: Label for current alarm value */ - CEikLabel* iAlarm; + CMRLabel* iAlarm; + + /// Own: Icon for alarm field + CMRImage* iIcon; /** * Own: List of CESMRAlarm objects @@ -113,11 +119,6 @@ TInt iOptIndex; /** - * Not owned. Validator class for time and sanity checks. - */ - MESMRFieldValidator* iValidator; - - /** * Own: Relative alarm validity */ TBool iRelativeAlarmValid; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrbooleanfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrbooleanfield.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR boolean field implementation - * -*/ - - -#ifndef CESMRBOOLEANFIELD_H -#define CESMRBOOLEANFIELD_H - -#include "cesmriconfield.h" - -class CEikLabel; -class MESMRFieldValidator; - -/** - * Creates a boolean checkbox type field for misc calendar event related info - */ -NONSHARABLE_CLASS( CESMRBooleanField ): public CESMRIconField - { -public: - /** - * Creates new CESMRBooleanField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - static CESMRBooleanField* NewL( MESMRFieldValidator* aValidator ); - - /** - * C++ Destructor. - */ - ~CESMRBooleanField(); - -public: // From CESMRField - void InitializeL(); - void InternalizeL( MESMRCalEntry& aEntry ); - void SetOutlineFocusL( TBool aFocus ); - void ExecuteGenericCommandL( TInt aCommand ); - -public: // From CCoeControl - TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - void MakeVisible(TBool aVisible); - -private: - /** - * Constructor. - * - * @param aValidator validator object - */ - CESMRBooleanField( MESMRFieldValidator* aValidator ); - - /** - * Second phase constructor. - */ - void ConstructL(); - - /** - * Reset field value. - */ - void ResetFieldL(); - - /** - * Switch middle softkey: on/off - */ - void SwitchMiddleSoftKeyL(); - -private: - /** - * Not owned. Field label. - */ - CEikLabel* iLabel; - - /** - * Current value. - */ - TBool iStatus; - - /** - * Not owned. Validator object. - */ - MESMRFieldValidator* iValidator; - }; - -#endif // CESMRBOOLEANFIELD_H - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrcheckbox.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrcheckbox.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrcheckbox.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,8 +21,8 @@ #include "cesmrfield.h" -class CEikLabel; -class CEikImage; +class CMRLabel; +class CMRImage; class MESMRFieldValidator; /** @@ -51,13 +51,13 @@ TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aInd ) const; void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); public: // From CESMRField - void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void ExternalizeL( MESMRCalEntry& aEntry ); void SetOutlineFocusL( TBool aFocus ); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); private: // Implemenation /** @@ -91,32 +91,16 @@ * */ void SwitchMSKLabelL(); - + void SendFieldChangeEventL( TESMREntryFieldId aFieldId ); private: - /** - * Not owned. Checkbox text label - */ - CEikLabel* iLabel; - - /** - * Owned. checkbox_mark/checkbox_unmark - */ - CEikImage* iIcon; + + //Not owned. Checkbox text label + CMRLabel* iLabel; + + // Owned. checkbox_mark/checkbox_unmark + CMRImage* iFieldIcon; - // Pointer to the bitmap. iIcon is created by using this bitmap - CFbsBitmap* iBitmap; - - // Pointer to the bitmap mask. iIcon is created by using this bitmap mask - CFbsBitmap* iBitmapMask; - - /** - * Not owned. Validator class for time and sanity checks. - */ - MESMRFieldValidator* iValidator; - - /** - * If checkbox is marked or unmarked. - */ + // If checkbox is marked or unmarked. TBool iChecked; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrdatefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrdatefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrdatefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,14 +19,14 @@ #ifndef CESMRDATEFIELD_H #define CESMRDATEFIELD_H -#include "cesmriconfield.h" +#include "cesmrfield.h" class MESMRFieldValidator; class CEikDateEditor; -class CAknsFrameBackgroundControlContext; -class MAknsControlContext; +class CMRImage; +class CAknsBasicBackgroundControlContext; -NONSHARABLE_CLASS( CESMRDateField ): public CESMRIconField +NONSHARABLE_CLASS( CESMRDateField ): public CESMRField { public: /** @@ -42,15 +42,18 @@ */ ~CESMRDateField(); -public: // From CESMRField - void InitializeL(); +protected: // From CESMRField TBool OkToLoseFocusL( TESMREntryFieldId aId ); void SetOutlineFocusL( TBool aFocus ); + void SetValidatorL( MESMRFieldValidator* aValidator ); + TBool ExecuteGenericCommandL( TInt aCommand ); -public: // From CCoeControl +protected: // From CCoeControl TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - void ActivateL(); - void PositionChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); private: // Implementation CESMRDateField( MESMRFieldValidator* aValidator ); @@ -58,26 +61,25 @@ void CheckIfValidatingNeededL( TInt aStartFieldIndex ); TBool TriggerValidatorL(); + void InitializeValidatorL(); + void DoEnvChangeL(); private: - /** - * Not owned. Date editor. - */ + + // Not owned. Date editor. CEikDateEditor* iDate; - /** - * Not owned. Validator object. - */ - MESMRFieldValidator* iValidator; - - // Background control context - MAknsControlContext* iBackground; - - // Actual background for the editor - CAknsFrameBackgroundControlContext* iFrameBgContext;//own - // Rect of this field TRect iFieldRect; + + // Own: Field icon + CMRImage* iFieldIcon; + + // Own: Background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + + /// Ref: Pointer to container window + const CCoeControl* iContainerWindow; }; #endif // CESMRDATEFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrdescriptionfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrdescriptionfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrdescriptionfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR Description field for CESMRListComponent +* Description: ESMR Description field. * */ @@ -19,119 +19,120 @@ #ifndef CESMRDESCRIPTIONFIELD_H #define CESMRDESCRIPTIONFIELD_H +#include #include #include #include "cesmrfield.h" class CESMREditor; class CCalEntry; -class CAknsFrameBackgroundControlContext; class CESMRRichTextLink; class CESMRFeatureSettings; +class CAknsBasicBackgroundControlContext; +class CESMRUrlParserPlugin; /** * This class is a custom field control that shows the description of calendar events */ -NONSHARABLE_CLASS( CESMRDescriptionField ): public CESMRField, - public MEikEdwinSizeObserver, - public MEikEdwinObserver +NONSHARABLE_CLASS( CESMRDescriptionField ): public CESMRField, + public MEikEdwinSizeObserver, + public MEikEdwinObserver { -public: - /** - * Creates new CESMRDescriptionField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - static CESMRDescriptionField* NewL(); + public: + /** + * Creates new CESMRDescriptionField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CESMRDescriptionField* NewL(); - /** - * C++ Destructor. - */ - ~CESMRDescriptionField(); + /** + * C++ Destructor. + */ + ~CESMRDescriptionField(); -public: // From CESMRField - void InitializeL(); - void InternalizeL( MESMRCalEntry& aEntry ); - void ExternalizeL( MESMRCalEntry& aEntry ); - void SetOutlineFocusL( TBool aFocus ); - TInt ExpandedHeight() const; - TInt GetVerticalFocusPosition(); - void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); - void ListObserverSet(); - void ExecuteGenericCommandL( TInt aCommand ); -public: // From CCoeControl - TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - void ActivateL(); - void PositionChanged(); + public: // From CESMRField + void InitializeL(); + void InternalizeL( MESMRCalEntry& aEntry ); + void ExternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + TInt GetVerticalFocusPosition(); + void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); + void ListObserverSet(); + TBool ExecuteGenericCommandL( TInt aCommand ); -public: // From MEikEdwinSizeObserver - TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); + public: // From CCoeControl + TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + TSize MinimumSize(); + void SetContainerWindowL( + const CCoeControl& aContainer ); -public: // From MEikEdwinObserver - void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); - -private: - /** - * Constructor. - */ - CESMRDescriptionField(); + public: // From MEikEdwinSizeObserver + TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); + + public: // From MEikEdwinObserver + void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); - /** - * Second phase constructor. - */ - void ConstructL(); + private: + /** + * Constructor. + */ + CESMRDescriptionField(); - /** - * Converts raw URL text to a link in description editor field - * - * @param aEntry Calendar entry from which the description text is received - */ - void StoreLinkL( MESMRCalEntry& aEntry ); + /** + * Second phase constructor. + */ + void ConstructL(); + + /** + * Converts raw URL text to a link in description editor field + * + * @param aEntry Calendar entry from which the description text is received + */ + void StoreLinkL( MESMRCalEntry& aEntry ); + + /** + * Adds link to the beginning of text from editor field + * + * @param abuf initial description text buffer before addition + * + * @return The description text buffer with link added + */ + HBufC* AddLinkToTextL( const TDesC& aBuf ); + + /** + * Gets feature settings + */ + CESMRFeatureSettings& FeaturesL(); - /** - * Adds link to the beginning of text from editor field - * - * @param abuf initial description text buffer before addition - * - * @return The description text buffer with link added - */ - HBufC* AddLinkToTextL( const TDesC& aBuf ); - - /** - * Gets feature settings - */ - CESMRFeatureSettings& FeaturesL(); - -private: - /** - * Not owned. Description editor object. - */ - CESMREditor* iDescription; + /** + * Converts location URL to vCal GEO value in calendar entry + */ + void StoreGeoValueL( CCalEntry& aCalEntry, + const TDesC& aLocationUrl ); + + CESMRUrlParserPlugin& UrlParserL(); - /** - * Field size. - */ - TSize iSize; - - /** - * Background control context - */ - MAknsControlContext* iBackground; - - /** - * Actual background for the editor - */ - CAknsFrameBackgroundControlContext* iFrameBgContext; - - /** - * Own: Location Url link - */ - CESMRRichTextLink* iLocationLink; - - /** - * Own: Feature settings. - */ - CESMRFeatureSettings* iFeatures; + private: + // Not owned. Description editor object. + CESMREditor* iDescription; + // Field size. + TSize iSize; + // Own: Location Url link + CESMRRichTextLink* iLocationLink; + // Own: Feature settings. + CESMRFeatureSettings* iFeatures; + // Field editor line count + TInt iLineCount; + // Own: Background for the editor when it is focused + CAknsBasicBackgroundControlContext* iBgControlContext; + // Field rect for comparison purposes + TRect iFieldRect; + // Own: URL parser plugin + CESMRUrlParserPlugin* iUrlParser; }; #endif // CESMRDESCRIPTIONFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrlocationfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrlocationfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrlocationfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR location field for CESMRListComponent +* Description: ESMR location field. * */ @@ -20,100 +20,114 @@ #define CESMRLOCATIONFIELD_H #include -#include //MEikEdwinSizeObserver -#include "cesmriconfield.h" +#include // MEikEdwinSizeObserver +#include // MEikMenuObserver + +#include "cesmrfield.h" //Forward declarations class CESMREditor; -class CAknsFrameBackgroundControlContext; -class MAknsControlContext; -class CAknsFrameBackgroundControlContext; class CESMRFeatureSettings; class CFbsBitmap; +class CMRImage; +class CAknsBasicBackgroundControlContext; +class CMRStylusPopupMenu; +class CMRLabel; +class CMRButton; /** * This class is a custom field control that shows the location of calendar events */ -NONSHARABLE_CLASS( CESMRLocationField ): public CESMRIconField, +NONSHARABLE_CLASS( CESMRLocationField ): public CESMRField, public MEikEdwinSizeObserver, - public MEikEdwinObserver + public MEikEdwinObserver, + public MEikMenuObserver { -public: - /** - * Creates new CESMRLocationField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - static CESMRLocationField* NewL(); - - /** - * C++ Destructor. - */ - ~CESMRLocationField(); + public: + /** + * Creates new CESMRLocationField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CESMRLocationField* NewL(); + + /** + * C++ Destructor. + */ + ~CESMRLocationField(); + + protected: // From CESMRField + TSize MinimumSize(); + void InitializeL(); + void InternalizeL( MESMRCalEntry& aEntry ); + void ExternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); + void ListObserverSet(); + TBool ExecuteGenericCommandL( TInt aCommand ); + TBool HandleSingletapEventL( const TPoint& aPosition ); + void HandleLongtapEventL( const TPoint& aPosition ); + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); -public: // From CESMRField - void InitializeL(); - void InternalizeL( MESMRCalEntry& aEntry ); - void ExternalizeL( MESMRCalEntry& aEntry ); - void SetOutlineFocusL( TBool aFocus ); - TInt ExpandedHeight() const; - void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); - void ListObserverSet(); - void ExecuteGenericCommandL( TInt aCommand ); - TSize BorderSize() const; - -public: // From MEikEdwinSizeObserver - TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); - -public: // From MEikEdwinObserver - void HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType); + protected: // From MEikEdwinSizeObserver + TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); -public: // From CCoeControl - void ActivateL(); - void PositionChanged(); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aInd ) const; - void SizeChanged(); + protected: // From MEikEdwinObserver + void HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType); + + protected: // From MEikMenuObserver + void ProcessCommandL( TInt aCommandId ); + void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/){} + + protected: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aType ); + TBool HandleRawPointerEventL( const TPointerEvent &aPointerEvent ); + + private: + /** + * Constructor. + */ + CESMRLocationField(); -private: - /** - * Constructor. - */ - CESMRLocationField(); - - /** - * Second phase constructor. - */ - void ConstructL(); - - CESMRFeatureSettings& FeaturesL(); - void SetWaypointIconL( TBool aEnabled ); - void PositionFieldElements(); - void LayoutWaypointIcon(); + /** + * Second phase constructor. + */ + void ConstructL(); - // From MESMRFieldEventObserver - void HandleFieldEventL( const MESMRFieldEvent& aEvent ); - TSize CalculateEditorSize( const TSize& aSize ); - -private: - // Not owned. Location editor. - CESMREditor* iLocation; - // Field size. - TSize iSize; - // Background control context. not owned - MAknsControlContext* iBackground; - // Actual background for the editor. owned - CAknsFrameBackgroundControlContext* iFrameBgContext; - // Feature settings. own. - CESMRFeatureSettings* iFeatures; - // waypointicon bitmap for coordinates. Own - CFbsBitmap* iWaypointIcon; - // waypointicon bitmap for coordinates. Own - CFbsBitmap* iWaypointIconMask; - // waypointicon icon for coordinates. Own - CEikImage* iIcon; - // Location text. Own. - HBufC* iLocationText; + CESMRFeatureSettings& FeaturesL(); + void SetWaypointIconL( TBool aEnabled ); + + // From MESMRFieldEventObserver + void HandleFieldEventL( const MESMRFieldEvent& aEvent ); + + private: + // Own: Title of this field + CMRLabel* iTitle; + // Not owned. Location editor. + CESMREditor* iLocation; + // Own: Edwin size + TSize iSize; + // Feature settings. own. + CESMRFeatureSettings* iFeatures; + // Location text. Own. + HBufC* iLocationText; + // Own:Field left button + CMRButton* iFieldButton; + // Own: Waypoint icon + CMRImage* iWaypointIcon; + // Field editor line count + TInt iLineCount; + // Own: Background for the editor when it is focused + CAknsBasicBackgroundControlContext* iBgControlContext; + // Field rect for comparison purposes + TRect iFieldRect; + /// Own: Stylus popup menu + CMRStylusPopupMenu* iMenu; TBool iMenuIsShown; }; #endif // CESMRLOCATIONFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriority.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriority.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriority.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriorityfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriorityfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriorityfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,14 +19,14 @@ #ifndef CESMRPRIORITYFIELD_H #define CESMRPRIORITYFIELD_H -#include "cesmriconfield.h" +#include "cesmrfield.h" #include "cesmrpriority.h" +#include "mesmrcalentry.h" -class MESMRCalEntry; -class CEikLabel; -class MESMRTitlePaneObserver; +class CMRImage; +class CMRLabel; -NONSHARABLE_CLASS( CESMRPriorityField ): public CESMRIconField +NONSHARABLE_CLASS( CESMRPriorityField ): public CESMRField { public: /** @@ -41,17 +41,19 @@ */ ~CESMRPriorityField(); -public: // From CESMRIconField +public: // From base class CESMRField void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void ExternalizeL( MESMRCalEntry& aEntry ); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); void SetOutlineFocusL( TBool aFocus ); - void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ); -public: // From CCoeControl +public: // From base class CCoeControl TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - + void SizeChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + private: // Implementation /** * Constructor. @@ -78,10 +80,6 @@ void ExecutePriorityQueryL(); private: - /** - * Not owned. Priority label. - */ - CEikLabel* iPriority; /** * Own. Array of available priorities. @@ -97,11 +95,16 @@ * Entry type */ MESMRCalEntry::TESMRCalEntryType iEntryType; + + /** + * Owned: Field icon + */ + CMRImage* iIcon; /** - * Title pane observer for setting the priority icon + * Not own: Field text label */ - MESMRTitlePaneObserver* iObserver; + CMRLabel* iLabel; }; #endif // CESMRPRIORITYFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrrecurencefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrrecurencefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrrecurencefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR Recurence field for CESMRListComponent +* Description: ESMR Recurence field. * */ @@ -19,13 +19,14 @@ #ifndef CESMRRECURENCEFIELD_H #define CESMRRECURENCEFIELD_H -#include "cesmriconfield.h" +#include "cesmrfield.h" -class CEikLabel; +class CMRLabel; +class CMRImage; class CESMRRecurrence; class MESMRFieldValidator; -NONSHARABLE_CLASS( CESMRRecurenceField ): public CESMRIconField +NONSHARABLE_CLASS( CESMRRecurenceField ): public CESMRField { public: /** @@ -41,13 +42,16 @@ ~CESMRRecurenceField(); public: // From CESMRField - void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void SetOutlineFocusL( TBool aFocus ); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); public: // From CCoeControl TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); private: // implementation /** @@ -77,24 +81,17 @@ void ExecuteRecurrenceQueryL(); private: // data - /** - * Not owned. Label for current recurrence. - */ - CEikLabel* iRecurence; - - /** - * Own. Array of recurrence objects. - */ + + // Not owned. Label for current recurrence. + CMRLabel* iRecurrence; + + // Own. Field icon. + CMRImage* iFieldIcon; + + // Own. Array of recurrence objects. RPointerArray< CESMRRecurrence > iArray; - /** - * Not owned. Helper class for sanity and time checks. - */ - MESMRFieldValidator* iValidator; - - /** - * Index for selected recurrence (index to iArray) - */ + // Index for selected recurrence (index to iArray) TInt iIndex; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrrepeatuntil.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrrepeatuntil.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrrepeatuntil.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,12 +21,11 @@ #include "cesmrfield.h" -#include - -class CEikLabel; +class CMRLabel; class CEikDateEditor; class MESMRFieldValidator; -class CAknsFrameBackgroundControlContext; +class CAknsBasicBackgroundControlContext; + NONSHARABLE_CLASS( CESMRRepeatUntilField ) : public CESMRField { @@ -44,21 +43,22 @@ ~CESMRRepeatUntilField(); public: // From CESMRField - void InitializeL(); TBool OkToLoseFocusL( TESMREntryFieldId aNextItem ); void SetOutlineFocusL( TBool aFocus ); + void SetValidatorL( MESMRFieldValidator* aValidator ); + TBool ExecuteGenericCommandL( TInt aCommand ); public: // From CCoeControl + TSize MinimumSize(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aInd ) const; void SizeChanged(); - void ActivateL(); - void PositionChanged(); TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); void CheckIfValidatingNeededL( TInt aStartFieldIndex ); + void SetContainerWindowL( const CCoeControl& aContainer ); private: /** @@ -72,31 +72,21 @@ */ void ConstructL(); + void DoEnvChangeL(); + private: - /** - * Own. Repeat until field label. - */ - CEikLabel* iLabel; - /** - * Not owned. Repeat until field editor. - */ + // Own. Repeat until field label. + CMRLabel* iLabel; + + // Not owned. Repeat until field editor. CEikDateEditor* iDate; - /** - * Not owned. Validator object. - */ - MESMRFieldValidator* iValidator; - - /** - * Background control context - */ - MAknsControlContext* iBackground; - - /** - * Actual background for the editor. - */ - CAknsFrameBackgroundControlContext* iFrameBgContext; + // Own. Background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + + /// Ref: Pointer to container window + const CCoeControl* iContainerWindow; }; #endif // CESMRREPEATUNTIL_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsingletimefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsingletimefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsingletimefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,13 +19,14 @@ #ifndef CESMRSINGLETIMEFIELD_H #define CESMRSINGLETIMEFIELD_H -#include "cesmriconfield.h" +#include "cesmrfield.h" class MESMRFieldValidator; class CEikTimeEditor; -class CAknsFrameBackgroundControlContext; +class CMRImage; +class CAknsBasicBackgroundControlContext; -NONSHARABLE_CLASS( CESMRSingleTimeField ): public CESMRIconField +NONSHARABLE_CLASS( CESMRSingleTimeField ): public CESMRField { public: @@ -42,14 +43,17 @@ ~CESMRSingleTimeField(); public: // From CESMRField - void InitializeL(); TBool OkToLoseFocusL( TESMREntryFieldId aNextItem ); void SetOutlineFocusL( TBool aFocus ); + void SetValidatorL( MESMRFieldValidator* aValidator ); + TBool ExecuteGenericCommandL( TInt aCommand ); public: // From CCoeControl - TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - void ActivateL(); - void PositionChanged(); + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); + void SizeChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SetContainerWindowL( const CCoeControl& aContainer ); private: /** @@ -65,26 +69,20 @@ void CheckIfValidatingNeededL( TInt aStartFieldIndex ); + void DoEnvChangeL(); + private: - /** - * Not owned. Validator object. - */ - MESMRFieldValidator* iValidator; - /** - * Not owned. Time editor. - */ + // Not owned. Time editor. CEikTimeEditor* iTime; - - /** - * Background control context. Not own - */ - MAknsControlContext* iBackground; - - /** - * Actual background for the editor. Own - */ - CAknsFrameBackgroundControlContext* iFrameBgContext; + + // Own. Field icon + CMRImage* iFieldIcon; + + // Own. Background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + /// Ref: Pointer to container window + const CCoeControl* iContainerWindow; }; #endif // CESMRSINGLETIMEFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsubjectfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsubjectfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsubjectfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,19 +21,21 @@ #include #include -#include +#include -#include "cesmriconfield.h" +#include "cesmrfield.h" +#include "nmrbitmapmanager.h" class CESMREditor; class MESMRTitlePaneObserver; -class CAknsFrameBackgroundControlContext; +class CMRImage; +class CAknsBasicBackgroundControlContext; /** * This class is a custom field control that shows the subject of calendar events */ NONSHARABLE_CLASS( CESMRSubjectField ) : - public CESMRIconField, + public CESMRField, public MEikEdwinSizeObserver, public MEikEdwinObserver { @@ -55,28 +57,33 @@ * Destructor. */ virtual ~CESMRSubjectField(); - -public: // From CESMRField + +public: // Interface + void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ); + +protected: // From CESMRField + TSize MinimumSize(); void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void ExternalizeL( MESMRCalEntry& aEntry ); - void SetOutlineFocusL( TBool aFocus ); - TInt ExpandedHeight() const; - void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); + void SetOutlineFocusL( TBool aFocus ); + void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); void ListObserverSet(); - void ExecuteGenericCommandL( TInt aCommand ); -public: // From MEikEdwinSizeObserver + TBool ExecuteGenericCommandL( TInt aCommand ); + +protected: // From MEikEdwinSizeObserver TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); -public: // From MEikEdwinObserver - void HandleEdwinEventL( CEikEdwin *aEdwin, TEdwinEvent aEventType ); +protected: // From MEikEdwinObserver + void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); -public: // From CCoeControl - void ActivateL(); - void PositionChanged(); - -public: // Interface - void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ); +protected: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); + TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aType ); private: /** @@ -91,26 +98,30 @@ * @param aTextId default text id * @param aIconID icon id */ - void ConstructL( TESMREntryFieldId aId, TInt aTextId, TAknsItemID aIconID ); - + void ConstructL( + TESMREntryFieldId aId, + TInt aTextId, + NMRBitmapManager::TMRBitmapId aIconID ); + + void SetPriorityIconL( TUint aPriority ); + private: // Not owned. Text editor. CESMREditor* iSubject; - - // Field size. + // Own: Field icon + CMRImage* iFieldIcon; + // Own: Priority icon + CMRImage* iPriorityIcon; + // Own: Edwin size TSize iSize; - - // Default text id. - TInt iTextId; - // Not owned MESMRTitlePaneObserver* iTitlePaneObserver; - - // Background control context - MAknsControlContext* iBackground; - - // Actual background for the editor - CAknsFrameBackgroundControlContext* iFrameBgContext; + // Field editor line count + TInt iLineCount; + // Own: Background for the editor when it is focused + CAknsBasicBackgroundControlContext* iBgControlContext; + // Stores current priority value + TUint iCurrentPriority; }; #endif // CESMRSUBJECTFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsync.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsync.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsync.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsyncfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsyncfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsyncfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,19 +15,21 @@ * */ - #ifndef CESMRSYNCFIELD_H #define CESMRSYNCFIELD_H -#include "cesmriconfield.h" +// INCLUDES +#include "cesmrfield.h" -class CEikLabel; -class CESMRSync; +// FORWARD DECLARATIONS +class CMRLabel; +class CMRImage; +class CESMRTextItem; /** * This class is a custom field control that shows the sync status of calendar events */ -NONSHARABLE_CLASS( CESMRSyncField ) : public CESMRIconField +NONSHARABLE_CLASS( CESMRSyncField ) : public CESMRField { public: /** @@ -43,15 +45,17 @@ ~CESMRSyncField(); public: // From CESMRField - void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void ExternalizeL( MESMRCalEntry& aEntry ); void SetOutlineFocusL( TBool aFocus ); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); public: // From CCoeControl TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SizeChanged(); + private: /** * Constructor. @@ -81,12 +85,15 @@ /** * Not owned. Synchronization label. */ - CEikLabel* iSync; + CMRLabel* iSync; + + /// Own: Icon field + CMRImage* iIcon; /** * Own. Array of synchronization objects. */ - RPointerArray< CESMRSync > iArray; + RPointerArray< CESMRTextItem > iArray; /** * Index of selected synchronization. diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtextitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtextitem.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR text item implementation, used to map text resource to id +* +*/ + + +#ifndef CESMRTEXTITEM_H +#define CESMRTEXTITEM_H + +#include +// +#include "esmrdef.h" +// +#include + +class TResourceReader; + +/** + * Wrapper class for descriptors for easier usage in fields + */ +NONSHARABLE_CLASS( CESMRTextItem ) : public CBase + { +public: + /** + * Constructor. + */ + CESMRTextItem(); + + /** + * Destructor. + */ + ~CESMRTextItem(); + + /** + * Loads values from resources. + * @param aReader resource reader + */ + void ConstructFromResourceL( TResourceReader& aReader ); + +public: + /** + * Returns text. + * @return text + */ + TDesC& TextL(); + + /** + * Returns id value. + * @return id value + */ + TInt Id(); + +private: + /** + * Own. Text. + */ + HBufC* iText; + + /** + * Id value. + */ + TInt iId; + }; + +#endif // CESMRTEXTITEM_H + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtimefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtimefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrtimefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,20 +19,20 @@ #ifndef CESMRTIMEFIELD_H #define CESMRTIMEFIELD_H -#include "cesmriconfield.h" +// INCLUDES +#include "cesmrfield.h" //Forward declarations -class CEikLabel; -class CTimeContainer; +class CMRImage; +class CMRTimeContainer; class MESMRFieldValidator; -class CEikTimeEditor; /** * Time field for ESMR editor. Time field has start and end time * separated by a '-'. Focus traverses from left to right and right * to left. */ -NONSHARABLE_CLASS( CESMRTimeField ): public CESMRIconField +NONSHARABLE_CLASS( CESMRTimeField ): public CESMRField { public: /** @@ -51,12 +51,16 @@ public: // From CCoeControl void SetContainerWindowL( const CCoeControl& aControl ); TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SizeChanged(); public: // From ESMRField - void InitializeL(); TBool OkToLoseFocusL( TESMREntryFieldId aNext ); void SetOutlineFocusL( TBool aFocus ); - + void SetValidatorL( MESMRFieldValidator* aValidator ); + TBool ExecuteGenericCommandL( TInt aCommand ); + private: /** * Constructor. @@ -72,147 +76,13 @@ private: /** - * Own. Container for the time fields. - */ - CTimeContainer* iContainer; - }; - - -//Forward declarations -class MAknsControlContext; -class CAknsFrameBackgroundControlContext; - -/** - * Container control for the time fields and the separator. - */ -NONSHARABLE_CLASS( CTimeContainer ): public CCoeControl - { - -public: - /** - * Creates new CTimeContainer object. Ownership - * is transferred to caller. - * @param aValidator validator object - * @param aParent parent control - * @param aFieldId CESMRField id of the control/container - * @return Pointer to created object, - */ - static CTimeContainer* NewL( - MESMRFieldValidator* aValidator, - CCoeControl* aParent, - TESMREntryFieldId aFieldId ); - - /** - * Destructor. - */ - ~CTimeContainer(); - -public: // From CCoeControl - void SetContainerWindowL( const CCoeControl& aControl ); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aInd ) const; - void SizeChanged(); - TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); - void FocusChanged(TDrawNow aDrawNow); - void ActivateL(); - void PositionChanged(); - -public: // interface - /** - * Sets font and font color for editors. - * - * @param aFont new font - * @param aLayout pointer to layoutmanager - */ - void SetFontL( const CFont* aFont, CESMRLayoutManager* aLayout ); - - /** - * Returns currently focused editor. - * - * @return currently focused editor - */ - CEikTimeEditor* FocusedEditor(); - - /** - * Returns ETrue if its ok to change focus. - * - * @param current field id - * @param next field id - * @return ETrue if its ok to change focus + * Ref: Container for the time fields. + * Created by this class but deleted by base class. */ - TBool OkToLoseFocusL( TESMREntryFieldId aFrom, TESMREntryFieldId aTo ); - -private: // Implementation - /** - * Constructor. - * - * @param aValidator validator object - */ - CTimeContainer( MESMRFieldValidator* aValidator, TESMREntryFieldId aFieldId ); - - /** - * Second phase constructor. - * - * @param aParent parent control - */ - void ConstructL( CCoeControl* aParent ); - - /** - * Changes focus to left if its possible. - * - * @param aEvent key event - * @param aType event code - */ - TKeyResponse ChangeFocusLeftL(const TKeyEvent& aEvent, TEventCode aType); - - /** - * Changes focus to right if its possible. - * - * @param aEvent key event - * @param aType event code - */ - TKeyResponse ChangeFocusRightL(const TKeyEvent& aEvent, TEventCode aType); - - void CheckIfValidatingNeededL( - TBool aStartFocusedBefore, - TInt aStartFieldIndex, - TBool aEndFocusedBefore, - TInt aEndFieldIndex ); - - void TriggerStartTimeChangedL(); - void TriggerEndTimeChangedL(); - -private: // data - /** - * Own. Start time editor. - */ - CEikTimeEditor* iStartTime; - - /** - * Own. End time editor. - */ - CEikTimeEditor* iEndTime; - - /** - * Own. Separator label between start and end fields. - */ - CEikLabel* iSeparator; - - /** - * Not owned. Validator class for time and sanity checks. - */ + CMRTimeContainer* iContainer; - MESMRFieldValidator* iValidator; - // Own: Field Id - TESMREntryFieldId iFieldId; - // Background control context - MAknsControlContext* iBackground; - // Actual background for the start time editor - CAknsFrameBackgroundControlContext* iStartTimeBgContext; - // Actual background for the end time editor - CAknsFrameBackgroundControlContext* iEndTimeBgContext; - // Not owned. Layout manager. - CESMRLayoutManager* iLayout; + /// Own: Field icon + CMRImage* iFieldIcon; }; #endif // CESMRTIMEFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmdatefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmdatefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmdatefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR viewer alarm field for CESMRListComponent +* Description: ESMR viewer alarm field. * */ @@ -29,7 +29,7 @@ /** * Field for showing the alarm date. */ -NONSHARABLE_CLASS( CESMRViewerAlarmDateField ) : public CESMRField +NONSHARABLE_CLASS( CESMRViewerAlarmDateField ): public CESMRField { public: /** @@ -46,23 +46,28 @@ public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); - void InitializeL(); void SetOutlineFocusL( TBool aFocus ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aIndex ) const; - + CCoeControl* ComponentControl( TInt aIndex ) const; private: // Implementation CESMRViewerAlarmDateField(); void ConstructL(); + void FormatAlarmTimeL(); private: // Data // Owned: Field icon CMRImage* iIcon; - // Owned: Field text label + /// Own: lock icon + CMRImage* iLockIcon; + // Not own: Field text label CMRLabel* iLabel; + /// Own: Alarm time + TTime iAlarmTime; }; #endif // __CESMRVIEWERALARMFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR viewer alarm field for CESMRListComponent +* Description: ESMR viewer alarm field. * */ @@ -47,12 +47,14 @@ void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); void SetOutlineFocusL( TBool aFocus ); - + void LockL(); + TBool ExecuteGenericCommandL( TInt aCommand ); + public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aIndex ) const; - + private: // Implementation CESMRViewerAlarmField(); void ConstructL(); @@ -60,10 +62,11 @@ private: // members // Owned: Field icon CMRImage* iIcon; - // Owned: Field text label + // Not own: Field text label CMRLabel* iLabel; - + // Own: lock icon + CMRImage* iLockIcon; }; - + #endif // __CESMRVIEWERALARMFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmtimefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmtimefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralarmtimefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR viewer alarm field for CESMRListComponent +* Description: ESMR viewer alarm field. * */ @@ -19,10 +19,12 @@ #ifndef CESMRVIEWERALARMTIMEFIELD_H #define CESMRVIEWERALARMTIMEFIELD_H -// INCLUDES +#include +#include + #include "cesmrfield.h" -// FORWARD DECLARATIONS +// Forward declarations class CMRImage; class CMRLabel; @@ -46,23 +48,29 @@ public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); - void InitializeL(); void SetOutlineFocusL( TBool aFocus ); - + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); + public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aIndex ) const; - + private: // Implementation CESMRViewerAlarmTimeField(); void ConstructL(); + void FormatAlarmTimeL(); -private: - // Owned: Field icon +private: // data + // Own: Field icon CMRImage* iIcon; - // Owned: Field text label + /// Own: lock icon + CMRImage* iLockIcon; + // Ref: Field text label CMRLabel* iLabel; + /// Own: Alarm time + TTime iAlarmTime; }; #endif // CESMRVIEWERALARMTIMEFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralldayeventfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralldayeventfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrvieweralldayeventfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -42,17 +42,20 @@ * C++ Destructor. */ ~CESMRViewerAllDayEventField(); - + public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); void SetOutlineFocusL( TBool aFocus ); + void LockL(); + TBool ExecuteGenericCommandL( TInt aCommand ); + public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aIndex ) const; - + private: // Implementation CESMRViewerAllDayEventField(); void ConstructL(); @@ -60,7 +63,9 @@ private: // Owned: Field icon CMRImage* iIcon; - // Owned: Field text label + /// Owned: Lock icon + CMRImage* iLockIcon; + // Not own: Field text label CMRLabel* iLabel; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerdescriptionfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerdescriptionfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerdescriptionfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,17 +21,19 @@ #include #include #include "cesmrfield.h" +#include "cesmrrichtextviewer.h" -class CESMRRichTextViewer; class CESMRLocationPlugin; class CESMRFeatureSettings; +class CESMRUrlParserPlugin; /** * Description field is a custom control * that shows the description of a calendar event. */ NONSHARABLE_CLASS( CESMRViewerDescriptionField ): public CESMRField, - public MEikEdwinSizeObserver + public MEikEdwinSizeObserver, + public MESMRRichTextObserver { public: @@ -48,10 +50,11 @@ public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); - void GetMinimumVisibleVerticalArea( TInt& aUpper, TInt& aLower ); + void GetCursorLineVerticalPos( TInt& aUpper, TInt& aLower ); void ListObserverSet(); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); void SetOutlineFocusL( TBool aFocus ); + void HandleLongtapEventL( const TPoint& aPosition ); public: // From CCoeControl TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType ); @@ -65,7 +68,10 @@ // From MEikEdwinSizeObserver TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); - + +protected: + TBool HandleRichTextLinkSelection( const CESMRRichTextLink* aLink ); + private: // Implementation CESMRViewerDescriptionField(); void ConstructL(); @@ -73,37 +79,41 @@ void SetShowOnMapLinkMiddleSoftKeyL(); CESMRFeatureSettings& FeaturesL(); CESMRLocationPlugin& LocationPluginL(); + void ShowLocationOnMapL( const CESMRRichTextLink& aLink ); + void StoreGeoValueL( CCalEntry& aCalEntry, + const TDesC& aLocationUrl ); + CESMRUrlParserPlugin& UrlParserL(); private: - + /** * Field size. */ TSize iSize; - + /** * Rich text viewer. * Own. */ CESMRRichTextViewer* iRichTextViewer; - + /** * Location plugin. * Own. */ CESMRLocationPlugin* iLocationPlugin; - + /** * Feature settings. * Own. */ CESMRFeatureSettings* iFeatures; - + /** - * Location title. + * Location URL parser. * Own. */ - HBufC* iLocation; + CESMRUrlParserPlugin* iUrlParser; }; #endif /* CESMRVIEWERDESCRIPTIONFIELD_H */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerdetailedsubjectfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerdetailedsubjectfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerdetailedsubjectfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -24,6 +24,7 @@ #include // MEikEdwinSizeObserver #include "cesmrfield.h" +#include "cesmrrichtextviewer.h" // FORWARD DECLARATIONS class CESMRRichTextViewer; @@ -37,7 +38,8 @@ */ NONSHARABLE_CLASS( CESMRViewerDetailedSubjectField ): public CESMRField, - public MEikEdwinSizeObserver + public MEikEdwinSizeObserver, + public MESMRRichTextObserver { public: /** @@ -65,9 +67,12 @@ void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); void ListObserverSet(); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); void SetOutlineFocusL( TBool aFocus ); - + void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); + void HandleLongtapEventL( const TPoint& aPosition ); + void LockL(); + public: // From CCoeControl TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); @@ -81,21 +86,24 @@ CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize ); + +protected: // From CESMRRichTextViewer + TBool HandleRichTextLinkSelection( const CESMRRichTextLink* aLink ); private: // Implementation CESMRViewerDetailedSubjectField(); void ConstructL(); - TRect RichTextViewerRect(); + void SetMiddleSoftkeyL(); private: // data // Own: Edwin size TSize iSize; // Own: Field icon CMRImage* iFieldIcon; - // Own: Subject text is storaged here + // Own: Priority icon + CMRImage* iPriorityIcon; + // Not own: Subject text is storaged here CESMRRichTextViewer* iRichTextViewer; - // RichTextViewer line count. Own - TInt iLineCount; /// Ref: Pointer to title pane observer MESMRTitlePaneObserver* iTitlePaneObserver; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerlocationfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerlocationfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerlocationfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,73 +19,90 @@ #ifndef CESMRVIEWERLOCATIONFIELD_H_ #define CESMRVIEWERLOCATIONFIELD_H_ +// INCLUDES +#include #include +#include +#include #include "cesmrfield.h" +// FORWARD DECLARATIONS class CMRImage; class CESMRRichTextViewer; +class CAknButton; class CESMRFeatureSettings; /** * Shows the location of the meeting/event */ -NONSHARABLE_CLASS( CESMRViewerLocationField ): public CESMRField, - MEikEdwinSizeObserver +NONSHARABLE_CLASS( CESMRViewerLocationField ): public CESMRField, + public MEikEdwinSizeObserver, + public MCoeControlObserver { -public: - /** - * Creates new CESMRViewerLocationField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - static CESMRViewerLocationField* NewL( ); - - /** - * C++ Destructor. - */ - ~CESMRViewerLocationField( ); + public: + /** + * Creates new CESMRViewerLocationField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CESMRViewerLocationField* NewL( ); + -public:// From CESMRField - void InternalizeL( MESMRCalEntry& aEntry ); - TSize MinimumSize(); - void InitializeL(); - void ListObserverSet(); - void ExecuteGenericCommandL( TInt aCommand ); - void SetOutlineFocusL( TBool aFocus ); + /** + * C++ Destructor. + */ + ~CESMRViewerLocationField( ); + + public:// From CESMRField + void InternalizeL( MESMRCalEntry& aEntry ); + TSize MinimumSize(); + void InitializeL(); + void ListObserverSet(); + TBool ExecuteGenericCommandL( TInt aCommand ); + void SetOutlineFocusL( TBool aFocus ); + void HandleLongtapEventL( const TPoint& aPosition ); + void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); + void LockL(); + protected: + TBool HandleSingletapEventL( const TPoint& aPosition ); -public: // From CCoeControl - TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType ); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aInd ) const; - void SizeChanged(); - void SetContainerWindowL( const CCoeControl& aContainer ); + public: // From CCoeControl + TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType ); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); + void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); -public: // From MEikEdwinSizeObserver - TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, - TSize aSize ); + public: // From MEikEdwinSizeObserver + TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, + TSize aSize ); + + public: // From MCoeControlObserver + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); -private: // Implementation - CESMRViewerLocationField( ); - void ConstructL( ); - CESMRFeatureSettings& FeaturesL(); - void SetWaypointIconL( TBool aEnabled ); - TRect RichTextViewerRect(); + private: // Implementation + CESMRViewerLocationField( ); + void ConstructL( ); + void SetWaypointIconL( TBool aEnabled ); + TBool HandleTapEventL( const TPoint& aPosition ); -private: // data - - TSize iSize; - // Owned: Field icon - CMRImage* iFieldIcon; - // Owned: Field text label - CESMRRichTextViewer* iRichTextViewer; - // Owned: Waypoint icon - // Feature settings. Own - CESMRFeatureSettings* iFeatures; - // RichTextViewer line count. Own - TInt iLineCount; - // Middle softkey command id - TInt iMskCommandId; + private: // data + // Own: Edwin size + TSize iSize; + /// Own: Field button + CAknButton* iFieldButton; + /// Ref: Field text label + CESMRRichTextViewer* iRichTextViewer; + /// Own: Waypoint icon + CMRImage* iWaypointIcon; + /// Own: RichTextViewer line count. + TInt iLineCount; + /// Own: Middle softkey command id + TInt iMskCommandId; + /// Own: Feature settings + CESMRFeatureSettings* iFeatures; }; #endif /*CESMRVIEWERLOCATIONFIELD_H_*/ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerpriorityfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerpriorityfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerpriorityfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,12 +22,16 @@ #include #include -#include "cesmrviewerlabelfield.h" +#include "cesmrfield.h" + +// Forward declarations +class CMRImage; +class CMRLabel; /** * This class shows the priority of the event */ -NONSHARABLE_CLASS( CESMRViewerPriorityField ) : public CESMRViewerLabelField +NONSHARABLE_CLASS( CESMRViewerPriorityField ) : public CESMRField { public: /** @@ -44,10 +48,27 @@ public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + void LockL(); + TBool ExecuteGenericCommandL( TInt aCommand ); + +public: // From CCoeControl + void SizeChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; private: // Implementation CESMRViewerPriorityField(); void ConstructL(); + +private: // data + + // Owned: Field icon + CMRImage* iIcon; + /// Owned: Lock icon + CMRImage* iLockIcon; + // Not own: Field text label + CMRLabel* iLabel; }; #endif //__CESMRVIEWERPRIORITYFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerrecurrencedatefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerrecurrencedatefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerrecurrencedatefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -49,22 +49,26 @@ public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); - + TBool ExecuteGenericCommandL( TInt aCommand ); + public: // From CCoeControl TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aInd ) const; void SizeChanged(); TSize MinimumSize(); - + private: // Implementation CESMRViewerRecurrenceDateField(); void ConstructL(); - + void FormatRepeatUntilDateL(); + private: /// Own: topic label CMRLabel* iRepeatTopic; /// Own: date label CMRLabel* iRepeatDate; + /// Own: Repeat until date + TTime iRepeatUntilDate; }; #endif // CESMRVIEWERRECURRENCECONTAINER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerrecurrencefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerrecurrencefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerrecurrencefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -37,31 +37,35 @@ * @return Pointer to created object, */ static CESMRViewerRecurrenceField* NewL(); - + /** * C++ destructor */ ~CESMRViewerRecurrenceField(); - + public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); void SetOutlineFocusL( TBool aFocus ); - + void LockL(); + TBool ExecuteGenericCommandL( TInt aCommand ); + public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aIndex ) const; - + private: // Implementation CESMRViewerRecurrenceField(); void ConstructL(); - + private: // Data - /// Own: The recurrence topic field + /// Not own: The recurrence topic field CMRLabel* iLabel; - /// Own: Recurrence icon (default) + /// Owned: Recurrence icon (default) CMRImage* iIcon; + // Own: lock icon + CMRImage* iLockIcon; }; #endif // __CESMRVIEWERRECURRENCEFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerstartdatefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerstartdatefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerstartdatefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR viewer start date field for CESMRListComponent +* Description: ESMR viewer start date field. * */ @@ -32,38 +32,44 @@ */ NONSHARABLE_CLASS( CESMRViewerStartDateField ) : public CESMRField { - public: - /** - * Creates new CESMRViewerStartDateField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - static CESMRViewerStartDateField* NewL(); - - /** - * C++ destructor - */ - ~CESMRViewerStartDateField(); - - public: // From CESMRField - void InternalizeL( MESMRCalEntry& aEntry ); - void InitializeL(); - void SetOutlineFocusL( TBool aFocus ); - - public: // From CCoeControl - void SizeChanged(); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aIndex ) const; - - private: // Implementation - CESMRViewerStartDateField(); - void ConstructL(); - - private: // Data - // Owned: Field icon - CMRImage* iIcon; - // Owned: Field text label - CMRLabel* iLabel; +public: + /** + * Creates new CESMRViewerStartDateField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CESMRViewerStartDateField* NewL(); + + /** + * C++ destructor + */ + ~CESMRViewerStartDateField(); + +public: // From CESMRField + void InternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); + +public: // From CCoeControl + void SizeChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + +private: // Implementation + CESMRViewerStartDateField(); + void ConstructL(); + void FormatDateStringL(); + +private: // Data + // Owned: Field icon + CMRImage* iIcon; + /// Own: lock icon + CMRImage* iLockIcon; + // Not own: Field text label + CMRLabel* iLabel; + /// Own: Meeting start time + TTime iStartTime; }; #endif // __CESMRVIEWERSTARTDATEFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerstopdatefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerstopdatefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewerstopdatefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR viewer end date field for CESMRListComponent +* Description: ESMR viewer end date field. * */ @@ -32,38 +32,45 @@ */ NONSHARABLE_CLASS( CESMRViewerStopDateField ) : public CESMRField { - public: - /** - * Creates new CESMRViewerStopDateField object. Ownership - * is transferred to caller. - * @return Pointer to created object, - */ - static CESMRViewerStopDateField* NewL(); +public: + /** + * Creates new CESMRViewerStopDateField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CESMRViewerStopDateField* NewL(); + + /** + * C++ destructor + */ + ~CESMRViewerStopDateField(); + +public: // From CESMRField + void InternalizeL( MESMRCalEntry& aEntry ); + void InitializeL(); + void SetOutlineFocusL( TBool aFocus ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); + +public: // From CCoeControl + void SizeChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + +private: // Implementation + CESMRViewerStopDateField(); + void ConstructL(); + void FormatDateStringL(); - /** - * C++ destructor - */ - ~CESMRViewerStopDateField(); - - public: // From CESMRField - void InternalizeL( MESMRCalEntry& aEntry ); - void InitializeL(); - void SetOutlineFocusL( TBool aFocus ); - - public: // From CCoeControl - void SizeChanged(); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aIndex ) const; - - private: // Implementation - CESMRViewerStopDateField(); - void ConstructL(); - - private: // Data - // Owned: Field icon - CMRImage* iIcon; - // Owned: Field text label - CMRLabel* iLabel; - }; +private: // Data + // Owned: Field icon + CMRImage* iIcon; + /// Own: lock icon + CMRImage* iLockIcon; + // Not own: Field text label + CMRLabel* iLabel; + /// Own: Meeting stop time + TTime iStopTime; +}; #endif // __CESMRVIEWERSTOPDATEFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewersyncfield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewersyncfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewersyncfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -44,25 +44,29 @@ * C++ destructor */ ~CESMRViewerSyncField(); - + public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); void SetOutlineFocusL( TBool aFocus ); - + void LockL(); + TBool ExecuteGenericCommandL( TInt aCommand ); + public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aIndex ) const; - + private: // Implementation CESMRViewerSyncField(); void ConstructL(); - + private: // Owned: Field icon CMRImage* iIcon; - // Owned: Field text label + /// Own: lock icon + CMRImage* iLockIcon; + // Not own: Field text label CMRLabel* iLabel; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewertimefield.h --- a/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewertimefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrviewertimefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: ESMR viewer time field for CESMRListComponent +* Description: ESMR viewer time field. * */ @@ -48,21 +48,30 @@ void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); void SetOutlineFocusL( TBool aFocus ); - + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); + public: // From CCoeControl void SizeChanged(); TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aIndex ) const; - + private: // Implementation CESMRViewerTimeField(); void ConstructL(); - + void FormatTimeFieldStringL(); + private: // Owned: Field icon CMRImage* iIcon; - // Owned: Field text label + /// Own: lock icon + CMRImage* iLockIcon; + // Not own: Field text label CMRLabel* iLabel; + /// Own: Entry start time + TTime iStartTime; + /// Own: Entry end time + TTime iEndTime; }; #endif // __CESMRVIEWERTIMEFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmralarmonofffield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmralarmonofffield.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR alarm on off field header + * +*/ + + +#ifndef CMRALARMONOFFFIELD_H +#define CMRALARMONOFFFIELD_H + +#include "CESMRfield.h" +#include "mmrabsolutealarmcontroller.h" + +class CMRLabel; +class CMRImage; +class MESMRFieldValidator; +//class MMRAbsoluteAlarmController; + +/** + * Creates an alarm on off field for setting absolute alarm on/off + */ +NONSHARABLE_CLASS( CMRAlarmOnOffField ): public CESMRField, + public MMRAbsoluteAlarmController + { +public: + /** + * Creates new CMRAlarmOnOffField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CMRAlarmOnOffField* NewL( MESMRFieldValidator* aValidator ); + + /** + * C++ Destructor. + */ + ~CMRAlarmOnOffField(); + +public: // From MMRAbsoluteAlarmController + void SetAbsoluteAlarmOn(); + void SetAbsoluteAlarmOff(); + +private: // From CMRField + void InternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + TBool ExecuteGenericCommandL( TInt aCommand ); + +private: // From CCoeControl + TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); + void MakeVisible(TBool aVisible); + void SizeChanged(); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SetContainerWindowL( const CCoeControl& aContainer ); + +private: + /** + * Constructor. + * + * @param aValidator validator object + */ + CMRAlarmOnOffField(); + + /** + * Second phase constructor. + */ + void ConstructL( MESMRFieldValidator* aValidator ); + + /** + * Reset field value. + */ + void ResetFieldL(); + + /** + * Switch middle softkey: on/off + */ + void SwitchMiddleSoftKeyL(); + +private: + + // Not Own. Field label. + CMRLabel* iLabel; + + // Own. Field icon + CMRImage* iIcon; + + // Current value. + TBool iStatus; + }; + +#endif // CMRALARMONOFFFIELD_H + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrattachmentcommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrattachmentcommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field for editor and viewer + * +*/ + +#ifndef CMRATTACHMENTCOMMAND_H +#define CMRATTACHMENTCOMMAND_H + +#include +#include +#include "esmrdef.h" + +// Forward declarations +class CCalEntry; +class CESMRRichTextLink; +class RFile; + +/** + * CMRAttachmentCommandHandler is responsible for handling attachment + * related commands. + */ +NONSHARABLE_CLASS( CMRAttachmentCommand ) : public CBase + { +public: // Destruction + + /** + * C++ destructor + */ + virtual ~CMRAttachmentCommand(); + +public: // Interface + + /** + * Executes attachment command. + * @param aEntry Reference to attachemnt entry + * @param aAttachmentIndex Index of attachment to be processed + */ + virtual void ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ) = 0; + +protected: + + CMRAttachmentCommand(); + TDataType GetMimeType( RFile& aFile ); + +private: + }; + +#endif // CMRATTACHMENTCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrattachmentcommandhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrattachmentcommandhandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field for editor and viewer + * +*/ + + +#ifndef CMRATTACHMENTCOMMANDHANDLER_H +#define CMRATTACHMENTCOMMANDHANDLER_H + +#include +#include + +#include "esmrdef.h" +#include "mcalremoteattachmentoperationobserver.h" + +// Forward declarations +class CCalEntry; +class CESMRRichTextLink; +class CCalRemoteAttachmentApi; +class CCalRemoteAttachmentInfo; +class CDocumentHandler; +class MESMRFieldEventQueue; +class CMRAttachmentCommand; + +/** + * CMRAttachmentCommandHandler is responsible for handling attachment + * related commands. + */ +NONSHARABLE_CLASS( CMRAttachmentCommandHandler ): + public CBase, + public MCalRemoteAttachmentOperationObserver + + { +public: // Construction and destructions + + /** + * Creates and initializes new CMRAttachmentCommandHandler object. + * Ownership is transferred to caller. + * @param aEntry Reference to calendar entry + */ + static CMRAttachmentCommandHandler* NewL( + CCalEntry& aEntry, + MESMRFieldEventQueue& aEventQueue ); + + /** + * C++ destructor + */ + ~CMRAttachmentCommandHandler(); + +public: // Interface + + /** + * Handles attachment related command for currently selected + * attachment link. + * @param aCommandId Defines the command to be executed + * @param aSelectedLink Reference to selected link. + */ + void HandleAttachmentCommandL( + TInt aCommandId, + const CESMRRichTextLink& aSelectedLink ); + + /** + * Tests whether curerntly selected link is remote or not. + * @param aSelectedLink Reference to selected link. + * @return ETrue, if currently selected link is remote attachment + */ + TBool IsRemoteAttachmentL( + const CESMRRichTextLink& aSelectedLink ); + + /** + * Sets remote attachment API information for the command handler. + * @param aRemoteaAttaApi Reference to remote attachment API + * @param aAttachmentInfo Reference to attachment information structure + */ + void SetRemoteAttachmentInformationL( + CCalRemoteAttachmentApi& aRemoteAttaApi, + CCalRemoteAttachmentInfo& aAttachmentInfo ); + + /** + * Handles remote attachment command. + * @param aCommandId Defines the command to be executed + * @param aSelectedLink Reference to selected link. + */ + void HandleRemoteAttachmentCommandL( + TInt aCommandId, + const CESMRRichTextLink& aSelectedLink ); + + /** + * Fetches reference to remote operations + * @return REference to download operation list. + */ + RPointerArray& RemoteOperations(); + + /** + * Returns the current command id in progress. + * @return current command id or 0 + */ + TInt CurrentCommandInProgress() const; + +private: // From MCalRemoteAttachmentOperationObserver + void Progress( + MCalRemoteAttachmentOperation* aOperation, + TInt aPercentageCompleted ); + void OperationCompleted( + MCalRemoteAttachmentOperation* aOperation, + RFile& aAttachment ); + void OperationError( + MCalRemoteAttachmentOperation* aOperation, + TInt aErrorCode ); + +private: // Implementation + CMRAttachmentCommandHandler( + CCalEntry& aEntry, + MESMRFieldEventQueue& aEventQueue ); + void ConstructL(); + TInt ResolveAttachmentIndexL( + const TDesC& aAttachmentLabel ); + TInt CommandIndex( const TDesC& aAttachmentLabel ); + TInt RemoteAttachmentIndexL( + const TDesC& aAttachmentLabel ); + void HandleOperationCompletedL( + MCalRemoteAttachmentOperation* aOperation, + RFile& aAttachment ); + void HandleAttachmentCommandInternalL( + TInt aCommandId, + TInt aAttachmentIndex ); + void UpdateLocalAttachmentL( + const TDesC& aAttachmentLabel, + RFile& aAttachment, + TInt aAttachmentIndex ); + void NotifyProgressL( + const TDesC& aAttachmentLabel, + TInt aPercentageCompleted ); + void HandleRemoteAttachmentCommandInternalL( + TInt aCommandId, + const TDesC& aRemoteAttachmentLabel ); + void HideDownloadIndicatorL(); + void ExecuteCommandL( + TInt aCommandId, + CMRAttachmentCommand& aCommand, + TInt aAttachmentIndex ); + void SaveAllAttachmentsL(); + void SaveNextRemoteAttachmentL(); + +private: // Data + /// Ref: Reference to calendar entry + CCalEntry& iEntry; + /// Ref: Remote attachment API + CCalRemoteAttachmentApi* iRemoteAttachmentApi; + /// Ref: Remote attachment info + CCalRemoteAttachmentInfo* iAttachmentInfo; + /// Own: Download operation + RPointerArray iDownloadOperations; + /// Own: Remote command in progress + TInt iCommandInProgress; + /// Own: Document handler + CDocumentHandler* iDocHandler; + /// Ref: Event queue + MESMRFieldEventQueue& iEventQueue; + }; + +#endif // CMRATTACHMENTCOMMANDHANDLER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrattachmentsfield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrattachmentsfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field for editor and viewer + * +*/ + + +#ifndef CMRATTACHMENTSFIELD_H +#define CMRATTACHMENTSFIELD_H + +#include +#include + +#include "esmrdef.h" +#include "cesmrfield.h" +#include "cesmrrichtextviewer.h" +#include "cmrattachmentui.h" + +// Forward declarations +class CEikButtonGroupContainer; +class MESMRMeetingRequestEntry; +class CMRLabel; +class CAknsBasicBackgroundControlContext; +class CMRImage; +class CESMRRichTextViewer; +class CCalAttachment; +class CMRAttachmentUi; +class CMRAttachmentCommandHandler; + +NONSHARABLE_CLASS( CMRAttachmentsField ): public CESMRField, + public MEikEdwinSizeObserver, + public MESMRRichTextObserver, + public MMRAttachmentUiObserver + + { +public: + /** + * Two phase constructor. + */ + static CMRAttachmentsField* NewL(); + + /** + * Destructor. + */ + ~CMRAttachmentsField(); + +protected: // From CESMRField + TSize MinimumSize(); + void InitializeL(); + void InternalizeL( MESMRCalEntry& aEntry ); + void ExternalizeL( MESMRCalEntry& aEntry ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void SetOutlineFocusL( TBool aFocus ); + void ListObserverSet(); + TBool HandleSingletapEventL( const TPoint& aPosition ); + void HandleLongtapEventL( const TPoint& aPosition ); + TBool HandleRawPointerEventL( const TPointerEvent& aPointerEvent ); + void DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ); + +protected: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + void SetContainerWindowL( const CCoeControl& aControl ); + +protected: // From MEikEdwinSizeObserver + TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aDesirableEdwinSize); + +public: // From MESMRRichTextObserver + TBool HandleRichTextLinkSelection( const CESMRRichTextLink* aLink ); + +public: // From MMRAttachmentUiObserver + void AttachmentOperationCompleted( MDesC16Array& aArray ); + +private: // Implementation + + CMRAttachmentsField(); + void ConstructL(); + + void UpdateAttachmentsListL(); + HBufC* ClipTextLC( const TDesC& aText, const CFont& aFont, TInt aWidth ); + void UpdateFieldL(); + HBufC* AttachmentNameAndSizeL( const TDesC& aDes, const CCalAttachment& aAttachment ); + TBool AddAttachmentL(); + TInt LineSpacing(); + TInt FocusMargin(); + +private: //data + // Own: Title of this field + CMRLabel* iTitle; + // Own: Field icon + CMRImage* iFieldIcon; + // Owned. Attendee editor. + CESMRRichTextViewer* iRichTextViewer; + // Not owned. CBA. + CEikButtonGroupContainer* iButtonGroupContainer; + // Own. Background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + // Attachment count + TInt iAttachmentCount; + /// Own: Attachment ui for adding attachments + CMRAttachmentUi* iAttachmentUi; + /// Ref: Reference to internalized entry + MESMRCalEntry* iEntry; + // Field rect for comparison purposes + TRect iFieldRect; + // Rich Text viewer size + TSize iRichTextSize; + /// Own: Attachment command handler + CMRAttachmentCommandHandler* iAttCommandHandler; + }; + +#endif // CMRATTACHMENTSFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrmulticalenfield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrmulticalenfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR multi calendar field impl. + * +*/ + +#ifndef CMRMULTICALENFIELD_H +#define CMRMULTICALENFIELD_H + +// INCLUDES +#include "cesmrfield.h" + +// FORWARD DECLARATIONS +class CMRLabel; +class CMRImage; +class CESMRTextItem; +class CESMRMultiCalenItem; +class MESMRCalDbMgr; + +/** + * This class is a custom field control that shows the calendar type of multi calendar + */ +NONSHARABLE_CLASS( CMRMultiCalenField ) : public CESMRField + { +public: + /** + * Creates new CMRMultiCalenField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CMRMultiCalenField* NewL(); + + /** + * Destructor. + */ + ~CMRMultiCalenField(); + +public: // From CESMRField + void InitializeL(); + void InternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); + +public: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SizeChanged(); + void SetContainerWindowL( const CCoeControl& aContainer ); + +private: + /** + * Constructor. + */ + CMRMultiCalenField(); + + /** + * Second phase constructor. + */ + void ConstructL(); + + /** + * Updates event type text to aIndex. + * + * @param aIndex new event type index + */ + void UpdateLabelL( TInt aIndex ); + + /** + * Shows query dialog for selecting + * event type + */ + void ExecuteTypeQueryL(); + + /** + * Sets the label text color dimmed + */ + void SetTextDimmed(); + + /** + * Tests if calendar type change is enabled or not. + * + * @return Boolean, ETrue if type change is enabled, otherwise EFalse. + */ + TBool TypeChangeEnabledL(); + +private: + /** + * Not owned. Event type label. + */ + CMRLabel* iCalenName; + + /// Own: Icon field + CMRImage* iIcon; + + /// Own: lock icon + CMRImage* iLockIcon; + + /** + * Index of selected event type. + */ + TInt iIndex; + + /** + * ref to cur entry + */ + MESMRCalEntry* iEntry; + + /** + * reserve multi-calendar name list + */ + RArray iCalenNameList; + + /** + * Own: Indicates if calendar type change is enabled or disabled + */ + TBool iTypeChangeEnabled; + }; + +#endif // CMRMULTICALENFIELD_H + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmropenattachmentcommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmropenattachmentcommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field for editor and viewer + * +*/ + +#ifndef CMROPENATTACHMENTCOMMAND_H +#define CMROPENATTACHMENTCOMMAND_H + +#include +#include +#include "cmrattachmentcommand.h" + +// Forward declarations +class CCalEntry; +class CDocumentHandler; + +/** + * CMROpenAttachmentCommand is responsible for opening attachment. + */ +NONSHARABLE_CLASS( CMROpenAttachmentCommand ) : + public CMRAttachmentCommand + { +public: // Destruction + + /** + * Creates and initializes new CMROpenAttachmentCommand object. + * Ownership is transferred to caller. + * + * @return Pointer to CMROpenAttachmentCommand object. + */ + static CMROpenAttachmentCommand* NewL( CDocumentHandler& aDocHandler ); + ~CMROpenAttachmentCommand(); + +public: // From base class CMRAttachmentCommand + void ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ); + +private: // Implementation + CMROpenAttachmentCommand( CDocumentHandler& aDocHandler ); + void ConstructL(); + +private: + + /// Ref: Document handler + CDocumentHandler& iDocHandler; + }; + +#endif // CMROPENATTACHMENTCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrremoveattachmentcommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrremoveattachmentcommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field command to remove attachment + * +*/ + +#ifndef CMRREMOVEATTACHMENTCOMMAND_H +#define CMRREMOVEATTACHMENTCOMMAND_H + +#include +#include +#include "cmrattachmentcommand.h" + +// Forward declarations +class CCalEntry; + +/** + * CMRRemoveAttachmentCommand is responsible for removing attachment from entry + */ +NONSHARABLE_CLASS( CMRRemoveAttachmentCommand ) : + public CMRAttachmentCommand, + public MAknServerAppExitObserver + { +public: // Construction and destruction + + static CMRRemoveAttachmentCommand* NewL(); + ~CMRRemoveAttachmentCommand(); + +public: // From CMRAttachmentCommand + + void ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ); + +private: // Implementation + CMRRemoveAttachmentCommand(); + void ConstructL(); + + }; + +#endif // CMRREMOVEATTACHMENTCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrsaveandopenattachmentcommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrsaveandopenattachmentcommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field command to save and open attachment + * +*/ + +#ifndef CMRSAVEANDOPENATTACHMENTCOMMAND_H +#define CMRSAVEANDOPENATTACHMENTCOMMAND_H + +#include +#include +#include "cmrattachmentcommand.h" + +// Forward declarations +class CCalEntry; +class CDocumentHandler; + +/** + * CMRSaveAttachmentCommand is responsible for saving attachment + */ +NONSHARABLE_CLASS( CMRSaveAndOpenAttachmentCommand ) : + public CMRAttachmentCommand + { +public: // Construction and destructors + + static CMRSaveAndOpenAttachmentCommand* NewL( CDocumentHandler& aDocHandler ); + ~CMRSaveAndOpenAttachmentCommand(); + +public: // CMRAttachmentCommand + + void ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ); + +private: // Implementation + CMRSaveAndOpenAttachmentCommand( CDocumentHandler& aDocHandler ); + void ConstructL(); + +private: + + /// Ref: Document handler + CDocumentHandler& iDocHandler; + + }; + +#endif // CMRSAVEANDOPENATTACHMENTCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrsaveattachmentcommand.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrsaveattachmentcommand.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field command to save attachment + * +*/ + +#ifndef CMRSAVEATTACHMENTCOMMAND_H +#define CMRSAVEATTACHMENTCOMMAND_H + +#include +#include "cmrattachmentcommand.h" + +// Forward declarations +class CCalEntry; +class CDocumentHandler; + +/** + * CMRSaveAttachmentCommand is responsible for saving attachment + */ +NONSHARABLE_CLASS( CMRSaveAttachmentCommand ) : + public CMRAttachmentCommand + { +public: // Construction and destructors + + static CMRSaveAttachmentCommand* NewL( CDocumentHandler& aDocHandler ); + ~CMRSaveAttachmentCommand(); + +public: // CMRAttachmentCommand + + void ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ); + +private: // Implementation + CMRSaveAttachmentCommand( CDocumentHandler& aDocHandler ); + void ConstructL(); + +private: // Data + /// Ref: Document handler + CDocumentHandler& iDocHandler; + }; + +#endif // CMRSAVEATTACHMENTCOMMAND_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrtimecontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrtimecontainer.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR time (start-end) field implementation + * +*/ + +#ifndef CMRTIMECONTAINER_H +#define CMRTIMECONTAINER_H + +// INCLUDES +#include +#include "esmrdef.h" + +// FORWARD DECLARATIONS +class MAknsControlContext; +class CAknsFrameBackgroundControlContext; +class MESMRFieldValidator; +class CESMRLayoutManager; +class CEikTimeEditor; +class CMRLabel; +class CAknsBasicBackgroundControlContext; + +/** + * Container control for the time fields and the separator. + */ +NONSHARABLE_CLASS( CMRTimeContainer ): public CCoeControl + { + +public: + /** + * Creates new CMRTimeContainer object. Ownership + * is transferred to caller. + * @param aValidator validator object + * @param aParent parent control + * @param aFieldId CESMRField id of the control/container + * @return Pointer to created object, + */ + static CMRTimeContainer* NewL( + MESMRFieldValidator* aValidator, + CCoeControl* aParent, + TESMREntryFieldId aFieldId ); + + /** + * Destructor. + */ + ~CMRTimeContainer(); + +public: // From CCoeControl + void SetContainerWindowL( const CCoeControl& aControl ); + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType); + void FocusChanged(TDrawNow aDrawNow); + void HandlePointerEventL( const TPointerEvent &aPointerEvent ); + void ActivateL(); + +public: // interface + + /** + * Returns currently focused editor. + * + * @return currently focused editor + */ + CEikTimeEditor* FocusedEditor(); + + /** + * Returns ETrue if its ok to change focus. + * + * @param current field id + * @param next field id + * @return ETrue if its ok to change focus + */ + TBool OkToLoseFocusL( TESMREntryFieldId aFrom, TESMREntryFieldId aTo ); + + /** + * Sets Background rect of Time editor field. + * + * @param current background rect of time field + */ + void SetBgRect( TRect bgRect ); + + /** + * Sets Field valiator + * + * @param aValidator + */ + void SetValidatorL( MESMRFieldValidator* aValidator ); + + /** + * Called when locale environemnt has changed + */ + void EnvironmentChangedL(); + +private: // Implementation + /** + * Constructor. + * + * @param aValidator validator object + */ + CMRTimeContainer( MESMRFieldValidator* aValidator, TESMREntryFieldId aFieldId ); + + /** + * Second phase constructor. + * + * @param aParent parent control + */ + void ConstructL( CCoeControl* aParent ); + + /** + * Changes focus to left if its possible. + * + * @param aEvent key event + * @param aType event code + */ + TKeyResponse ChangeFocusLeftL(const TKeyEvent& aEvent, TEventCode aType); + + /** + * Changes focus to right if its possible. + * + * @param aEvent key event + * @param aType event code + */ + TKeyResponse ChangeFocusRightL(const TKeyEvent& aEvent, TEventCode aType); + + void CheckIfValidatingNeededL( + TBool aStartFocusedBefore, + TInt aStartFieldIndex, + TBool aEndFocusedBefore, + TInt aEndFieldIndex ); + + void TriggerStartTimeChangedL(); + void TriggerEndTimeChangedL(); + + void InitializeL(); + void Reset(); + +private: // data + /** + * Own. Start time editor. + */ + CEikTimeEditor* iStartTime; + + /** + * Own. End time editor. + */ + CEikTimeEditor* iEndTime; + + /** + * Own. Separator label between start and end fields. + */ + CMRLabel* iSeparator; + + /** + * Not owned. Validator class for time and sanity checks. + */ + + MESMRFieldValidator* iValidator; + // Own: Field Id + TESMREntryFieldId iFieldId; + // Background control context + MAknsControlContext* iBackground; + // Actual background for the start time editor + CAknsFrameBackgroundControlContext* iStartTimeBgContext; + // Actual background for the end time editor + CAknsFrameBackgroundControlContext* iEndTimeBgContext; + // Not owned. Layout manager. + CESMRLayoutManager* iLayout; + // Own. Field background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + /// Own: Focus rect + TRect iBgRect; + /// Ref: Pointer to container window + const CCoeControl* iContainerWindow; + }; + +#endif // CMRTIMECONTAINER_H +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrunifiededitorfield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrunifiededitorfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Unified editor field impl. + * +*/ + +#ifndef CMRUNIFIEDEDITORFIELD_H +#define CMRUNIFIEDEDITORFIELD_H + +// INCLUDES +#include "cesmrfield.h" + +// FORWARD DECLARATIONS +class CMRLabel; +class CMRImage; +class CESMRTextItem; + +/** + * This class is a custom field control that shows the event type of calendar events + */ +NONSHARABLE_CLASS( CMRUnifiedEditorField ) : public CESMRField + { +public: + /** + * Creates new CMRUnifiedEditorField object. Ownership + * is transferred to caller. + * @return Pointer to created object, + */ + static CMRUnifiedEditorField* NewL(); + + /** + * Destructor. + */ + ~CMRUnifiedEditorField(); + +public: // From CESMRField + void InternalizeL( MESMRCalEntry& aEntry ); + void SetOutlineFocusL( TBool aFocus ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void LockL(); + +public: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aIndex ) const; + void SizeChanged(); + +private: + /** + * Constructor. + */ + CMRUnifiedEditorField(); + + /** + * Second phase constructor. + */ + void ConstructL(); + + /** + * Updates event type text to aIndex. + * + * @param aIndex new event type index + */ + void UpdateLabelL( TInt aIndex ); + + /** + * Shows query dialog for selecting + * event type + */ + void ExecuteTypeQueryL(); + + /** + * Sets the correct icon for the field according + * to the entry type. + */ + void SetIconL( MESMRCalEntry& aEntry ); + +private: + /** + * Not owned. Event type label. + */ + CMRLabel* iType; + + /// Own: Icon field + CMRImage* iIcon; + + /// Own: lock icon + CMRImage* iLockIcon; + + /** + * Own. Array of event type objects. + */ + RPointerArray< CESMRTextItem > iArray; + + /** + * Index of selected event type. + */ + TInt iIndex; + + /** + * Own: Filter for dynamic popup, not showing all items + */ + RArray iFilter; + }; + +#endif // CMRUNIFIEDEDITORFIELD_H + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrviewerattachmentfield.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/inc/cmrviewerattachmentfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Attachment field for editor and viewer + * +*/ + + +#ifndef CMRVIEWERATTACHMENTSFIELD_H +#define CMRVIEWERATTACHMENTSFIELD_H + +#include +#include + +#include "esmrdef.h" +#include "cesmrfield.h" +#include "cesmrrichtextviewer.h" + +// Forward declarations +class CMRImage; +class CEikButtonGroupContainer; +class CAknsBasicBackgroundControlContext; +class CESMRRichTextViewer; +class CCalAttachment; +class CMRAttachmentCommandHandler; +class CCalRemoteAttachmentApi; +class CCalRemoteAttachmentInfo; +class MCalRemoteAttachmentOperation; + +/** + * CMRViewerAttachmentsField is entry viewer attachment field + */ +NONSHARABLE_CLASS( CMRViewerAttachmentsField ): + public CESMRField, + public MEikEdwinSizeObserver, + public MESMRRichTextObserver + { +public: + /** + * Two phase constructor. + */ + static CMRViewerAttachmentsField* NewL(); + + /** + * Destructor. + */ + ~CMRViewerAttachmentsField(); + +protected: // From CESMRField + TSize MinimumSize(); + void InitializeL(); + void InternalizeL( MESMRCalEntry& aEntry ); + void ExternalizeL( MESMRCalEntry& aEntry ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void SetOutlineFocusL( TBool aFocus ); + void ListObserverSet(); + void HandleLongtapEventL( const TPoint& aPosition ); + TBool HandleRawPointerEventL( const TPointerEvent& aPointerEvent ); + void DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ); + void LockL(); + +protected: // From CCoeControl + TInt CountComponentControls() const; + CCoeControl* ComponentControl( TInt aInd ) const; + void SizeChanged(); + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + void SetContainerWindowL( const CCoeControl& aControl ); + +protected: // From MEikEdwinSizeObserver + TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aDesirableEdwinSize); + +public: // From MESMRRichTextObserver + TBool HandleRichTextLinkSelection( const CESMRRichTextLink* aLink ); + +private: // Implementation + CMRViewerAttachmentsField(); + void ConstructL(); + + void UpdateAttachmentsListL(); + HBufC* ClipTextLC( const TDesC& aText, const CFont& aFont, TInt aWidth ); + void UpdateFieldL(); + HBufC* AttachmentNameAndSizeL( const TDesC& aDes, const CCalAttachment& aAttachment ); + TInt LineSpacing(); + TInt FocusMargin(); + void CreateRemoteAttApiL(); + void DynInitMenuPaneForCurrentAttachmentL( + CEikMenuPane* aMenuPane ); + TBool IsAttachmentDownloadInProgress( const CCalAttachment& aAttachment ); + +private: //data + // Own: Field icon + CMRImage* iFieldIcon; + /// Own: Lock icon + CMRImage* iLockIcon; + // Owned. Attachment list. + CESMRRichTextViewer* iRichTextViewer; + // Not owned. CBA. + CEikButtonGroupContainer* iButtonGroupContainer; + // Own. Background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + // Attachment count + TInt iAttachmentCount; + /// Ref: Reference to internalized entry + MESMRCalEntry* iEntry; + // Field rect for comparison purposes + TRect iFieldRect; + // Rich Text viewer size + TSize iRichTextSize; + /// Own: Attachment command handler + CMRAttachmentCommandHandler* iAttachmentCommandHandler; + /// Own: Remote attachment API + CCalRemoteAttachmentApi* iRemoteAttApi; + /// Own: Remote attachment URIs + CDesCArrayFlat* iRemoteAttUris; + /// Own: Remote attachment info + CCalRemoteAttachmentInfo* iAttachmentInfo; + }; + +#endif // CMRATTACHMENTSFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/CESMRFieldBuilderPlugin.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/CESMRFieldBuilderPlugin.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/CESMRFieldBuilderPlugin.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,7 +17,7 @@ #include "emailtrace.h" -#include "CESMRFieldBuilderPlugin.h" +#include "cesmrfieldbuilderplugin.h" // #include "esmrdef.h" @@ -34,12 +34,14 @@ #include "cesmrdescriptionfield.h" #include "cesmrcheckbox.h" #include "cesmrsingletimefield.h" -#include "cesmrbooleanfield.h" +#include "cmralarmonofffield.h" #include "cesmrsyncfield.h" #include "cesmrpriorityfield.h" +#include "cmrattachmentsfield.h" +#include "cmrunifiededitorfield.h" +#include "cmrmulticalenfield.h" // Viewer fields -#include "cesmrviewerlabelfield.h" #include "cesmrviewerlocationfield.h" #include "cesmrviewerstartdatefield.h" #include "cesmrviewertimefield.h" @@ -55,14 +57,12 @@ #include "cesmrvieweralarmtimefield.h" #include "cesmrviewerdetailedsubjectfield.h" #include "cesmrrepeatuntil.h" +#include "cmrviewerattachmentfield.h" -// Removed profiling. /// Unnamed namespace for local definitions namespace { // codescanner::namespace -#ifdef _DEBUG - // Panic literal _LIT( KESMRFieldBuilderPlugin, "ESMRFieldBuilderPlugin" ); @@ -77,8 +77,6 @@ User::Panic( KESMRFieldBuilderPlugin, aPanic ); } -#endif // _DEBUG - } // namespace // ======== MEMBER FUNCTIONS ======== @@ -177,7 +175,7 @@ field = CESMRCheckBox::NewL( aValidator ); break; case EESMRFieldAlarmOnOff: - field = CESMRBooleanField::NewL( aValidator ); + field = CMRAlarmOnOffField::NewL( aValidator ); break; case EESMRFieldAlarmTime: field = CESMRSingleTimeField::NewL( aValidator ); @@ -206,6 +204,15 @@ case EESMRFieldPriority: field = CESMRPriorityField::NewL(); break; + case EESMRFieldAttachments: + field = CMRAttachmentsField::NewL(); + break; + case EESMRFieldUnifiedEditor: + field = CMRUnifiedEditorField::NewL(); + break; + case EESMRFieldCalendarName: + field = CMRMultiCalenField::NewL(); + break; default: { field = FieldBuilderExtensionL()->CreateEditorFieldL( @@ -215,7 +222,10 @@ break; } - __ASSERT_DEBUG( field, Panic(EInvalidFieldId) ); + __ASSERT_ALWAYS( field, Panic(EInvalidFieldId) ); + // Set field mode + field->SetFieldMode( EESMRFieldModeEdit ); + return field; } @@ -301,6 +311,17 @@ field = CESMRViewerDetailedSubjectField::NewL(); break; } + case EESMRFieldViewerAttachments: + { + field = CMRViewerAttachmentsField::NewL(); + break; + } + case EESMRFieldCalendarName: + { + field = CMRMultiCalenField::NewL(); + break; + } + default: { MESMRFieldBuilder* extension = FieldBuilderExtensionL(); @@ -315,10 +336,10 @@ break; } - __ASSERT_DEBUG( field, Panic(EInvalidFieldId) ); + __ASSERT_ALWAYS( field, Panic(EInvalidFieldId) ); // Set field mode field->SetFieldMode( EESMRFieldModeView ); - + return field; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/CESMRFieldBuilderPluginProxy.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/CESMRFieldBuilderPluginProxy.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/CESMRFieldBuilderPluginProxy.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,7 +17,7 @@ #include "emailtrace.h" -#include "CESMRFieldBuilderPlugin.h" +#include "cesmrfieldbuilderplugin.h" #include #include diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmralarmfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmralarmfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmralarmfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,10 +15,16 @@ * */ -#include "emailtrace.h" #include "cesmralarmfield.h" +#include "cesmralarm.h" +#include "esmrcommands.h" +#include "cesmrglobalnote.h" +#include "mesmrfieldvalidator.h" +#include "cesmrlistquery.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "nmrlayoutmanager.h" -#include #include #include #include @@ -29,20 +35,16 @@ // #include "esmrdef.h" // -#include +#include -#include "cesmrborderlayer.h" -#include "cesmralarm.h" -#include "esmrcommands.h" -#include "cesmrglobalnote.h" -#include "mesmrfieldvalidator.h" -#include "cesmrlistquery.h" +// DEBUG +#include "emailtrace.h" // Unnamed namespace for local definitions namespace{ // codescanner::namespace -_LIT( KNoText, "" ); const TInt KMinuteInMicroSeconds(60000000); +const TInt KComponentCount( 2 ); }//namespace @@ -71,23 +73,7 @@ FUNC_LOG; iArray.ResetAndDestroy ( ); iArray.Close ( ); - } - -// --------------------------------------------------------------------------- -// CESMRAlarmField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRAlarmField::InitializeL() - { - FUNC_LOG; - iAlarm->SetFont( iLayout->Font(iCoeEnv, iFieldId ) ); - iAlarm->SetLabelAlignment( CESMRLayoutManager::IsMirrored() - ? ELayoutAlignRight : ELayoutAlignLeft ); - - // Update text color - AknLayoutUtils::OverrideControlColorL(*iAlarm, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); + delete iIcon; } // --------------------------------------------------------------------------- @@ -277,11 +263,13 @@ // CESMRAlarmField::CESMRAlarmField( MESMRFieldValidator* aValidator ) : iOptIndex(0), - iValidator( aValidator ), iRelativeAlarmValid( ETrue ) { FUNC_LOG; - //do nothing + + iValidator = aValidator; + SetFieldId ( EESMRFieldAlarm ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -291,10 +279,75 @@ void CESMRAlarmField::ConstructL( ) { FUNC_LOG; - SetFieldId ( EESMRFieldAlarm ); - iAlarm = new (ELeave) CEikLabel; // base class takes ownership - iAlarm->SetTextL ( KNoText ); - CESMRIconField::ConstructL (KAknsIIDQgnMeetReqIndiAlarm, iAlarm ); + iAlarm = CMRLabel::NewL(); // base class takes ownership + CESMRField::ConstructL( iAlarm ); + iAlarm->SetTextL ( KNullDesC() ); + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarm ); + iIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRAlarmField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRAlarmField::CountComponentControls() const + { + return KComponentCount; + } + +// --------------------------------------------------------------------------- +// CESMRAlarmField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRAlarmField::ComponentControl( TInt aIndex ) const + { + CCoeControl* control = NULL; + switch( aIndex ) + { + case 0: + { + control = iAlarm; + break; + } + case 1: + { + control = iIcon; + break; + } + default: + ASSERT( EFalse ); + } + + return control; + } + +// --------------------------------------------------------------------------- +// CESMRAlarmField::SizeChanged +// --------------------------------------------------------------------------- +// +void CESMRAlarmField::SizeChanged() + { + TRect rect( Rect() ); + TAknLayoutRect iconLayout = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorIcon ); + TRect iconRect( iconLayout.Rect() ); + iIcon->SetRect( iconRect ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknTextComponentLayout editorLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutTextEditor ); + + AknLayoutUtils::LayoutLabel( iAlarm, rect, editorLayout ); } // --------------------------------------------------------------------------- @@ -319,7 +372,7 @@ iRelativeAlarmValid ); } } - iBorder->DrawDeferred ( ); + iAlarm->DrawDeferred ( ); } // --------------------------------------------------------------------------- @@ -365,14 +418,19 @@ // CESMRAlarmField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRAlarmField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRAlarmField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if(aCommand == EESMRCmdOpenAlarmQuery || aCommand == EAknCmdOpen ) { ExecuteMSKCommandL(); + isUsed = ETrue; + + HandleTactileFeedbackL(); } + return isUsed; } // --------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrbooleanfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrbooleanfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR boolean field implementation -* -*/ - -#include "emailtrace.h" -#include "cesmrbooleanfield.h" - -#include -#include -#include -#include -#include -#include "mesmrcalentry.h" -#include "mesmrlistobserver.h" -#include "mesmrfieldvalidator.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRBooleanField::NewL -// --------------------------------------------------------------------------- -// -CESMRBooleanField* CESMRBooleanField::NewL( MESMRFieldValidator* aValidator ) - { - FUNC_LOG; - CESMRBooleanField* self = new (ELeave) CESMRBooleanField( aValidator ); - CleanupStack::PushL ( self ); - self->ConstructL ( ); - CleanupStack::Pop ( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::~CESMRBooleanField -// --------------------------------------------------------------------------- -// -CESMRBooleanField::~CESMRBooleanField( ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::InitializeL() - { - FUNC_LOG; - iLabel->SetFont ( iLayout->Font (iCoeEnv, iFieldId ) ); - iLabel->SetLabelAlignment (CESMRLayoutManager::IsMirrored ( ) ? ELayoutAlignRight - : ELayoutAlignLeft ); - AknLayoutUtils::OverrideControlColorL ( *iLabel, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::InternalizeL -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::InternalizeL( MESMRCalEntry& aEntry ) - { - FUNC_LOG; - if (aEntry.IsStoredL ( ) ) // entry is already stored in db - { - MESMRCalEntry::TESMRAlarmType alarmType; - TTime alarmTime; - aEntry.GetAlarmL (alarmType, alarmTime ); - - switch (alarmType ) - { - //flow through - case MESMRCalEntry::EESMRAlarmAbsolute: - case MESMRCalEntry::EESMRAlarmRelative: // Show alarm as - ON - { - iStatus = ETrue; - } - break; - //flow through - case MESMRCalEntry::EESMRAlarmNotFound: - default: // Show alarm as - OFF - { - iStatus = EFalse; - } - break; - } - } - else // This is a new entry and default implementation is required - { - switch (aEntry.Type ( ) ) - { - case MESMRCalEntry::EESMRCalEntryTodo: // To-do - { - TTime alarmTime; - MESMRCalEntry::TESMRAlarmType alarmType; - aEntry.GetAlarmL (alarmType, alarmTime ); - - // Change status to "ON" if alarm has been set by default - iStatus = alarmType != MESMRCalEntry::EESMRAlarmNotFound; - } - break; - // Flow through - case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Meeting request - case MESMRCalEntry::EESMRCalEntryMeeting: // Meeting - { - iStatus = ETrue;// Change the status to "ON" for these dialog default - } - break; - - case MESMRCalEntry::EESMRCalEntryAnniversary: // Anniversary - { - iStatus = ETrue;// Change the status to "ON" for these dialog default - } - break; - // Flow through - case MESMRCalEntry::EESMRCalEntryMemo: // Memo - case MESMRCalEntry::EESMRCalEntryReminder: // Reminder - - default: - iStatus = EFalse; // Change the status to "OFF" for these dialog default - break; - } - } - ResetFieldL ( ); - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CESMRBooleanField::OfferKeyEventL(const TKeyEvent& aEvent, - TEventCode aType ) - { - FUNC_LOG; - TKeyResponse response( EKeyWasNotConsumed); - if ( aType == EEventKey ) - { - switch ( aEvent.iScanCode ) - { - // Flowthrough, doesn't matter which key was pressed since - // the value is always changes from "off" to "on" or vice versus. - case EStdKeyDevice3: // selection key - case EStdKeyLeftArrow: - case EStdKeyRightArrow: - iStatus = !iStatus; // change status - ResetFieldL ( ); - response = EKeyWasConsumed; - break; - - default: - break; - } - } - return response; - } - - -// --------------------------------------------------------------------------- -// CESMRBooleanField::SetOutlineFocusL -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::SetOutlineFocusL( TBool aFocus ) - { - FUNC_LOG; - CESMRField::SetOutlineFocusL( aFocus ); - - if (aFocus) //Focus is gained on the field - { - if (iStatus) - { - ChangeMiddleSoftKeyL(EESMRCmdAlarmOff,R_QTN_MEET_REQ_ALARM_OFF); //R_TEXT_SOFTKEY_OFF - } - else - { - ChangeMiddleSoftKeyL(EESMRCmdAlarmOn,R_QTN_MEET_REQ_ALARM_ON); //R_TEXT_SOFTKEY_ON - } - } - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::MakeVisible -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::MakeVisible(TBool aVisible ) - { - FUNC_LOG; - CCoeControl::MakeVisible (aVisible ); - if ( iObserver ) - { - TRAP_IGNORE(ResetFieldL ( ) ); - } - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::ExecuteGenericCommandL() -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::ExecuteGenericCommandL( TInt aCommand ) - { - FUNC_LOG; - if( aCommand == EESMRCmdAlarmOn || aCommand == EESMRCmdAlarmOff ) - { - SwitchMiddleSoftKeyL(); - } - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::SwitchMiddleSoftKeyL -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::SwitchMiddleSoftKeyL() - { - FUNC_LOG; - iStatus = !iStatus; // change status - ResetFieldL ( ); - if (iStatus) - { - ChangeMiddleSoftKeyL(EESMRCmdAlarmOff,R_QTN_MEET_REQ_ALARM_OFF); - } - else - { - ChangeMiddleSoftKeyL(EESMRCmdAlarmOn,R_QTN_MEET_REQ_ALARM_ON); - } - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::CESMRBooleanField -// --------------------------------------------------------------------------- -// -CESMRBooleanField::CESMRBooleanField( MESMRFieldValidator* aValidator ) : - iValidator( aValidator) - { - FUNC_LOG; - iStatus = ETrue; - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::ConstructL( ) - { - FUNC_LOG; - _LIT(KEmptyText, "" ); - SetFieldId ( EESMRFieldAlarmOnOff ); - iLabel = new (ELeave) CEikLabel(); - iLabel->SetTextL (KEmptyText ); - - CESMRIconField::ConstructL (KAknsIIDQgnMeetReqIndiAlarm, iLabel ); - } - -// --------------------------------------------------------------------------- -// CESMRBooleanField::ResetFieldL -// --------------------------------------------------------------------------- -// -void CESMRBooleanField::ResetFieldL( ) - { - FUNC_LOG; - iValidator->SetAlarmOnOffL( iStatus ); - - HBufC* buf = StringLoader::LoadLC ( iStatus ? - R_QTN_MEET_REQ_ALARM_ON : - R_QTN_MEET_REQ_ALARM_OFF ); - - iLabel->SetTextL ( *buf ); - CleanupStack::PopAndDestroy ( buf ); - - // if status on 'on', add time and date fields for - // all day event alert, otherwise remove them. - // if this field is not visible -> alldayevent not set - // let's not show the date and time fields either. - if ( iStatus && IsVisible ( ) ) - { - iObserver->InsertControl ( EESMRFieldAlarmTime ); - iObserver->InsertControl ( EESMRFieldAlarmDate ); - } - else - { - iObserver->RemoveControl ( EESMRFieldAlarmTime ); - iObserver->RemoveControl ( EESMRFieldAlarmDate ); - } - - iLabel->DrawDeferred ( ); - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrcheckbox.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrcheckbox.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrcheckbox.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,30 +15,26 @@ * */ -#include "emailtrace.h" #include "cesmrcheckbox.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include "cesmrborderlayer.h" #include "mesmrlistobserver.h" #include "mesmrmeetingrequestentry.h" #include "mesmrfieldvalidator.h" #include "esmrconfig.hrh" -#include "cesmriconfield.h" #include "esmrhelper.h" -#include "cesmrlayoutmgr.h" +#include "nmrbitmapmanager.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "nmrlayoutmanager.h" +#include "mesmrfieldeventqueue.h" +#include "cesmrgenericfieldevent.h" -using namespace ESMRLayout; +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + // ======== MEMBER FUNCTIONS ======== @@ -49,23 +45,56 @@ CESMRCheckBox* CESMRCheckBox::NewL( MESMRFieldValidator* aValidator ) { FUNC_LOG; - CESMRCheckBox* self = new (ELeave) CESMRCheckBox( aValidator ); - CleanupStack::PushL ( self ); - self->ConstructL ( ); - CleanupStack::Pop ( self ); + CESMRCheckBox* self = new( ELeave )CESMRCheckBox( aValidator ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); return self; } // --------------------------------------------------------------------------- +// CESMRCheckbox::CESMRCheckbox +// --------------------------------------------------------------------------- +// +CESMRCheckBox::CESMRCheckBox( MESMRFieldValidator* aValidator ) +: iChecked( EFalse ) + { + FUNC_LOG; + + iValidator = aValidator; + + SetFieldId( EESMRFieldAllDayEvent ); + SetFocusType ( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRCheckbox::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRCheckBox::ConstructL() + { + FUNC_LOG; + iLabel = CMRLabel::NewL(); + iLabel->SetParent( this ); + + CESMRField::ConstructL( iLabel ); //ownership transfered + + HBufC* txt = StringLoader::LoadLC ( R_QTN_MEET_REQ_ALL_DAY_EVENT ); + iLabel->SetTextL( *txt ); + CleanupStack::PopAndDestroy( txt ); + + // Creating field icon + SetIconL ( iChecked ); + } + +// --------------------------------------------------------------------------- // CESMRCheckbox::~CESMRCheckbox // --------------------------------------------------------------------------- // CESMRCheckBox::~CESMRCheckBox( ) { FUNC_LOG; - delete iIcon; - delete iBitmap; - delete iBitmapMask; + delete iFieldIcon; } // --------------------------------------------------------------------------- @@ -88,14 +117,21 @@ // CESMRCheckbox::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRCheckBox::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRCheckBox::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; - if(aCommand == EESMRCmdCheckEvent) + TBool isUsed( EFalse ); + // EAknCmdOpen is added for the Pointer events, see ListPane + if( aCommand == EESMRCmdCheckEvent || aCommand == EAknCmdOpen ) { HandleCheckEventL(); SwitchMSKLabelL(); + SendFieldChangeEventL( EESMRFieldAllDayEvent ); + isUsed = ETrue; + + HandleTactileFeedbackL(); } + return isUsed; } // --------------------------------------------------------------------------- @@ -111,8 +147,9 @@ { if ( aEvent.iScanCode == EStdKeyDevice3 ) { - HandleCheckEventL ( ); + HandleCheckEventL(); SwitchMSKLabelL(); + SendFieldChangeEventL( EESMRFieldAllDayEvent ); response = EKeyWasConsumed; } } @@ -126,8 +163,12 @@ TInt CESMRCheckBox::CountComponentControls( ) const { FUNC_LOG; - TInt count = CESMRField::CountComponentControls ( ); - if ( iIcon ) + TInt count( 0 ); + if ( iFieldIcon ) + { + ++count; + } + if ( iLabel ) { ++count; } @@ -141,66 +182,50 @@ CCoeControl* CESMRCheckBox::ComponentControl( TInt aInd ) const { FUNC_LOG; - if ( aInd == 0 ) + switch ( aInd ) { - return iIcon; + case 0: + return iFieldIcon; + case 1: + return iLabel; + default: + return NULL; } - return CESMRField::ComponentControl ( aInd ); } // --------------------------------------------------------------------------- // CESMRCheckbox::SizeChanged // --------------------------------------------------------------------------- // -void CESMRCheckBox::SizeChanged( ) +void CESMRCheckBox::SizeChanged() { FUNC_LOG; - TRect rect = Rect ( ); - - TInt iconTopMargin = ( rect.Height() - KIconSize.iHeight ) / 2; - - TPoint iconPos( rect.iTl.iX + KIconSize.iWidth + KIconBorderMargin, - rect.iTl.iY + iconTopMargin ); - - - TPoint borderPos( iconPos.iX + KIconSize.iWidth + KIconBorderMargin, - rect.iTl.iY); - - TSize borderSize( rect.Width() - - (2 * KIconSize.iWidth + 2 * KIconBorderMargin ), - rect.Height ( )); - - if ( CESMRLayoutManager::IsMirrored ( ) ) - { - iconPos.iX = rect.iBr.iX - ( 2 * KIconSize.iWidth ); - borderPos.iX = iconPos.iX - borderSize.iWidth - KIconBorderMargin; - } - - if ( iIcon ) - { - iIcon->SetPosition ( iconPos ); - iIcon->SetSize ( KIconSize ); - } - - if ( iBorder ) - { - iBorder->SetPosition ( borderPos ); - iBorder->SetSize ( borderSize ); - } - } - -// --------------------------------------------------------------------------- -// CESMRCheckbox::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRCheckBox::InitializeL() - { - FUNC_LOG; - iLabel->SetFont( iLayout->Font( iCoeEnv, iFieldId ) ); - AknLayoutUtils::OverrideControlColorL( - *iLabel, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); + TRect rect = Rect(); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + rect = rowLayoutRect.Rect(); + + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ); + AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + iLabel->SetRect( labelLayout.TextRect() ); + + // Setting font also for the label + iLabel->SetFont( labelLayout.Font() ); } // --------------------------------------------------------------------------- @@ -213,7 +238,7 @@ TBool alldayEvent( aEntry.IsAllDayEventL() ); // Update the validator - iValidator->SetAllDayEventL( alldayEvent ); + iValidator->SetAllDayEventL( alldayEvent ); // if this is all day event and not checked if ( alldayEvent && !iChecked ) @@ -240,56 +265,23 @@ void CESMRCheckBox::SetIconL( TBool aChecked ) { FUNC_LOG; - delete iIcon; - iIcon = NULL; - delete iBitmap; - iBitmap = NULL; - delete iBitmapMask; - iBitmapMask = NULL; - - TAknsItemID iconID; - TInt fileIndex(KErrNotFound); - TInt fileMaskIndex(KErrNotFound); - + delete iFieldIcon; + iFieldIcon = NULL; + + NMRBitmapManager::TMRBitmapId iconID; if( aChecked ) { - iconID = KAknsIIDQgnMeetReqIndiCheckboxMark; + iconID = NMRBitmapManager::EMRBitmapCheckBoxOn; } else { - iconID = KAknsIIDQgnMeetReqIndiCheckboxUnmark; + iconID = NMRBitmapManager::EMRBitmapCheckBoxOff; } - - CESMRLayoutManager::SetBitmapFallback( iconID, fileIndex, fileMaskIndex ); - - TFileName bitmapFilePath; - ESMRHelper::LocateResourceFile( - KESMRMifFile, - KDC_APP_BITMAP_DIR, - bitmapFilePath); + + iFieldIcon = CMRImage::NewL( iconID ); + iFieldIcon->SetParent( this ); - TRAPD( err, AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - iconID, - iBitmap, - iBitmapMask, - bitmapFilePath, - fileIndex, - fileMaskIndex - ) ); - - if (err == KErrNotFound) - { - User::Leave(KErrNotFound); - } - - // Even if creating mask failed, bitmap can be used (background is just not displayed correctly) - if( iBitmap ) - { - AknIconUtils::SetSize( iBitmap, KIconSize, EAspectRatioPreserved ); - iIcon = new (ELeave) CEikImage; - iIcon->SetPictureOwnedExternally(ETrue); - iIcon->SetPicture( iBitmap, iBitmapMask ); - } + SizeChanged(); } // --------------------------------------------------------------------------- @@ -315,18 +307,18 @@ { // start - end time should be removed // relateive alarm should be removed - iObserver->RemoveControl ( EESMRFieldMeetingTime ); - iObserver->RemoveControl ( EESMRFieldAlarm ); + iObserver->HideControl ( EESMRFieldMeetingTime ); + iObserver->HideControl ( EESMRFieldAlarm ); // absolute alarm should be inserted - iObserver->InsertControl ( EESMRFieldAlarmOnOff ); + iObserver->ShowControl ( EESMRFieldAlarmOnOff ); } else { - iObserver->InsertControl ( EESMRFieldMeetingTime ); - iObserver->InsertControl ( EESMRFieldAlarm ); - iObserver->RemoveControl ( EESMRFieldAlarmOnOff ); - iObserver->RemoveControl ( EESMRFieldAlarmTime ); - iObserver->RemoveControl ( EESMRFieldAlarmDate ); + iObserver->ShowControl ( EESMRFieldMeetingTime ); + iObserver->ShowControl ( EESMRFieldAlarm ); + iObserver->HideControl ( EESMRFieldAlarmOnOff ); + iObserver->HideControl ( EESMRFieldAlarmTime ); + iObserver->HideControl ( EESMRFieldAlarmDate ); } } @@ -337,7 +329,7 @@ void CESMRCheckBox::SwitchMSKLabelL() { FUNC_LOG; - if(iChecked) + if( iChecked ) { ChangeMiddleSoftKeyL(EESMRCmdCheckEvent, R_QTN_MSK_UNMARK); } @@ -348,36 +340,40 @@ } // --------------------------------------------------------------------------- -// CESMRCheckbox::CESMRCheckbox +// CESMRCheckbox::SetContainerWindowL // --------------------------------------------------------------------------- // -CESMRCheckBox::CESMRCheckBox( MESMRFieldValidator* aValidator ) : - iValidator( aValidator), iChecked( EFalse) +void CESMRCheckBox::SetContainerWindowL( + const CCoeControl& aContainer ) { - FUNC_LOG; - //do nothing + CCoeControl::SetContainerWindowL( aContainer ); + iLabel->SetContainerWindowL( aContainer ); + iLabel->SetParent( this ); } - // --------------------------------------------------------------------------- -// CESMRCheckbox::ConstructL +// CESMRCheckBox::SendFieldChangeEventL // --------------------------------------------------------------------------- // -void CESMRCheckBox::ConstructL( ) +void CESMRCheckBox::SendFieldChangeEventL( + TESMREntryFieldId aFieldId ) { FUNC_LOG; - SetFieldId( EESMRFieldAllDayEvent ); - iLabel = new (ELeave) CEikLabel; - iLabel->SetLabelAlignment( CESMRLayoutManager::IsMirrored() - ? ELayoutAlignRight : ELayoutAlignLeft ); - - HBufC* txt = StringLoader::LoadLC ( R_QTN_MEET_REQ_ALL_DAY_EVENT ); - iLabel->SetTextL( *txt ); - CleanupStack::PopAndDestroy( txt ); - - iIcon = new (ELeave) CEikImage; - - CESMRField::ConstructL( iLabel ); + if ( iEventQueue ) + { + CESMRGenericFieldEvent* event = + CESMRGenericFieldEvent::NewLC( NULL, + MESMRFieldEvent::EESMRFieldChangeEvent ); + TInt fieldId = aFieldId; + CESMRFieldEventValue* field = CESMRFieldEventValue::NewLC( + CESMRFieldEventValue::EESMRInteger, &fieldId ); + event->AddParamL( field ); + CleanupStack::Pop( field ); + CESMRFieldEventValue* checked = CESMRFieldEventValue::NewLC( + CESMRFieldEventValue::EESMRInteger, &iChecked ); + event->AddParamL( checked ); + CleanupStack::Pop( checked ); + iEventQueue->NotifyEventL( *event ); + CleanupStack::PopAndDestroy( event ); + } } - // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrdatefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrdatefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrdatefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,24 +15,25 @@ * */ -#include "emailtrace.h" #include "cesmrdatefield.h" - -#include -#include -#include -#include -#include -#include -// -#include "esmrdef.h" -// - #include "cesmrmeetingtimevalidator.h" #include "cesmrglobalnote.h" #include "esmrfieldbuilderdef.h" #include "mesmrlistobserver.h" #include "cesmrgenericfieldevent.h" +#include "cmrimage.h" +#include "nmrlayoutmanager.h" +#include "nmrcolormanager.h" +#include "nmrbitmapmanager.h" + +#include + +#include +// +#include "esmrdef.h" +// + +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== @@ -40,22 +41,24 @@ // CESMRDateField::CESMRDateField // --------------------------------------------------------------------------- // -CESMRDateField::CESMRDateField( - MESMRFieldValidator* aValidator ) : - iValidator(aValidator) +CESMRDateField::CESMRDateField( MESMRFieldValidator* aValidator ) { FUNC_LOG; - //do nothing + + iValidator = aValidator; + + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- // CESMRDateField::~CESMRDateField // --------------------------------------------------------------------------- // -CESMRDateField::~CESMRDateField( ) +CESMRDateField::~CESMRDateField() { FUNC_LOG; - delete iFrameBgContext; + delete iFieldIcon; + delete iBgCtrlContext; } // --------------------------------------------------------------------------- @@ -67,8 +70,8 @@ TESMREntryFieldId aId ) { FUNC_LOG; - CESMRDateField* self = new (ELeave) CESMRDateField( aValidator ); - CleanupStack::PushL ( self ); + CESMRDateField* self = new(ELeave)CESMRDateField( aValidator ); + CleanupStack::PushL( self ); self->ConstructL( aId ); CleanupStack::Pop( self ); return self; @@ -82,53 +85,40 @@ { FUNC_LOG; SetFieldId ( aId ); - + SetComponentsToInheritVisibility( ETrue ); + TTime startTime; - startTime.UniversalTime ( ); + startTime.UniversalTime(); - iDate = new (ELeave) CEikDateEditor; - iDate->ConstructL( TTIME_MINIMUMDATE, TTIME_MAXIMUMDATE, startTime, EFalse ); - iDate->SetUpAndDownKeysConsumed ( EFalse ); + iDate = new( ELeave )CEikDateEditor; + iDate->ConstructL( + TTIME_MINIMUMDATE, TTIME_MAXIMUMDATE, startTime, EFalse ); + iDate->SetUpAndDownKeysConsumed( EFalse ); + + CESMRField::ConstructL( iDate ); //ownership transferred - TAknsItemID aIconID = (iFieldId == EESMRFieldStartDate) ? KAknsIIDQgnMeetReqIndiDateStart - : KAknsIIDQgnMeetReqIndiDateEnd; + NMRBitmapManager::TMRBitmapId iconId = + ( iFieldId == EESMRFieldStartDate ) ? + NMRBitmapManager::EMRBitmapDateStart : + NMRBitmapManager::EMRBitmapDateEnd; - iBackground = AknsDrawUtils::ControlContext( this ); - CESMRIconField::ConstructL( aIconID, iDate ); // ownership transferred + iFieldIcon = CMRImage::NewL( iconId ); + iFieldIcon->SetParent( this ); // Initialize validator - if ( iValidator ) - { - switch ( iFieldId ) - { - case EESMRFieldStartDate: - iValidator->SetStartDateFieldL( *iDate ); - break; - case EESMRFieldStopDate: - iValidator->SetEndDateFieldL( *iDate ); - break; - case EESMRFieldAlarmDate: - iValidator->SetAlarmDateFieldL( *iDate ); - break; - default: - break; - } - } - } + InitializeValidatorL(); + + // Setting background instead of theme skin + TRect tempRect(0, 0, 0, 0); + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); -// --------------------------------------------------------------------------- -// CESMRDateField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRDateField::InitializeL() - { - FUNC_LOG; - iDate->SetFont( iLayout->Font(iCoeEnv, iFieldId ) ); - iDate->SetMfneAlignment( CESMRLayoutManager::IsMirrored() - ? EAknEditorAlignRight : EAknEditorAlignLeft ); - - iDate->SetSkinTextColorL( iLayout->NormalTextColorID() ); - iDate->SetBorder( TGulBorder::ENone ); + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + tempRect, + EFalse ); + + iDate->SetSkinBackgroundControlContextL( iBgCtrlContext ); } // --------------------------------------------------------------------------- @@ -152,55 +142,29 @@ FUNC_LOG; TKeyResponse response( EKeyWasNotConsumed); + TInt fieldIndex( iDate->CurrentField() ); + if ( aType == EEventKey ) { - TInt fieldIndex( iDate->CurrentField() ); // flowthrough, these events shouldn't be consumed if ( aEvent.iScanCode != EStdKeyUpArrow && aEvent.iScanCode != EStdKeyDownArrow ) { response = iDate->OfferKeyEventL( aEvent, aType ); + iDate->DrawDeferred(); } } - - return response; - } - -// --------------------------------------------------------------------------- -// CESMRDateField::PositionChanged() -// --------------------------------------------------------------------------- -// -void CESMRDateField::PositionChanged() - { - FUNC_LOG; - CCoeControl::PositionChanged(); - if( iFrameBgContext ) - { - iFrameBgContext->SetFrameRects( iDate->Rect(), iDate->Rect() ); - } - } + + TInt endIndex( iDate->CurrentField()); -// --------------------------------------------------------------------------- -// CESMRDateField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRDateField::ActivateL() - { - FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect(TPoint(iDate->Position()), iDate->Size()); - TRect inner(rect); - TRect outer(rect); - - iDate->SetSize(iLayout->FieldSize( FieldId() )); + if ( ( response == EKeyWasConsumed ) && + ( fieldIndex != endIndex) ) + { + CheckIfValidatingNeededL ( fieldIndex ); + } - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL(KAknsIIDQsnFrInput, outer, inner, EFalse ) ; - - iFrameBgContext->SetParentContext( iBackground ); - iDate->SetSkinBackgroundControlContextL(iFrameBgContext); + return response; } // --------------------------------------------------------------------------- @@ -228,7 +192,7 @@ FUNC_LOG; TInt err( KErrNone ); - if (iValidator ) + if ( iValidator ) { switch ( iFieldId ) { @@ -246,15 +210,22 @@ } } - if ( KErrNone != err ) { switch ( iFieldId ) { case EESMRFieldStartDate: { - CESMRGlobalNote::ExecuteL( - CESMRGlobalNote::EESMRRepeatReSchedule ); + if ( err == KErrOverflow ) + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRRepeatReSchedule ); + } + else if ( err == KErrUnderflow ) + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRRepeatInstanceTooEarly ); + } } break; case EESMRFieldStopDate: @@ -269,6 +240,11 @@ CESMRGlobalNote::ExecuteL( CESMRGlobalNote::EESMRRepeatReSchedule ); } + else if ( err == KErrUnderflow ) + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRRepeatInstanceTooEarly ); + } } break; @@ -297,8 +273,197 @@ CESMRField::SetOutlineFocusL ( aFocus ); if ( aFocus ) { - ChangeMiddleSoftKeyL(EESMRCmdSaveMR,R_QTN_MSK_SAVE); + ChangeMiddleSoftKeyL( EESMRCmdSaveMR,R_QTN_MSK_SAVE ); + } + } + +// --------------------------------------------------------------------------- +// CESMRDateField::SetValidatorL +// --------------------------------------------------------------------------- +// +void CESMRDateField::SetValidatorL( MESMRFieldValidator* aValidator ) + { + CESMRField::SetValidatorL( aValidator ); + InitializeValidatorL(); + } + +// --------------------------------------------------------------------------- +// CESMRDateField::SizeChanged() +// --------------------------------------------------------------------------- +// +TBool CESMRDateField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if ( EMRCmdDoEnvironmentChange == aCommand ) + { + DoEnvChangeL(); + retValue = ETrue; + } + + return retValue; + } + + +// --------------------------------------------------------------------------- +// CESMRDateField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRDateField::CountComponentControls( ) const + { + FUNC_LOG; + TInt count( 0 ); + if( iFieldIcon ) + { + ++count; + } + if( iDate ) + { + ++count; + } + + return count; + } + +// --------------------------------------------------------------------------- +// CESMRDateField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRDateField::ComponentControl( TInt aInd ) const + { + FUNC_LOG; + + switch ( aInd ) + { + case 0: + return iFieldIcon; + case 1: + return iDate; + default: + return NULL; } } +// --------------------------------------------------------------------------- +// CESMRDateField::SizeChanged +// --------------------------------------------------------------------------- +// +void CESMRDateField::SizeChanged() + { + FUNC_LOG; + TRect rect( Rect() ); + + // Layouting field icon + if( iFieldIcon ) + { + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutDateEditorIcon ); + AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); + } + + // Layouting date editor + if( iDate ) + { + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknTextComponentLayout editorLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutDateEditor ); + AknLayoutUtils::LayoutMfne( iDate, rect, editorLayout ); + + NMRColorManager::SetColor( *iDate, + NMRColorManager::EMRMainAreaTextColor ); + } + } + +// --------------------------------------------------------------------------- +// CESMRDateField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRDateField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + iContainerWindow = &aContainer; + + CCoeControl::SetContainerWindowL( *iContainerWindow ); + iDate->SetContainerWindowL( *iContainerWindow ); + iFieldIcon->SetContainerWindowL( *iContainerWindow ); + + iDate->SetParent( this ); + iFieldIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRDateField::InitializeValidatorL +// --------------------------------------------------------------------------- +// +void CESMRDateField::InitializeValidatorL() + { + FUNC_LOG; + + // Initialize validator + if ( iValidator ) + { + switch ( iFieldId ) + { + case EESMRFieldStartDate: + iValidator->SetStartDateFieldL( *iDate ); + break; + case EESMRFieldStopDate: + iValidator->SetEndDateFieldL( *iDate ); + break; + case EESMRFieldAlarmDate: + iValidator->SetAlarmDateFieldL( *iDate ); + break; + default: + break; + } + } + } + +// --------------------------------------------------------------------------- +// CESMRDateField::DoEnvChangeL +// --------------------------------------------------------------------------- +// +void CESMRDateField::DoEnvChangeL() + { + FUNC_LOG; + + CEikDateEditor* date = new( ELeave )CEikDateEditor; + CleanupStack::PushL( date ); + + TTime startTime; + startTime.UniversalTime(); + + date->ConstructL( + TTIME_MINIMUMDATE, + TTIME_MAXIMUMDATE, + startTime, + EFalse ); + + date->SetUpAndDownKeysConsumed( EFalse ); + + UpdateExtControlL( date ); + + CleanupStack::Pop( date ); + iDate = date; + InitializeValidatorL(); + + iDate->SetSkinBackgroundControlContextL( iBgCtrlContext ); + SetContainerWindowL( *iContainerWindow ); + + iDate->ActivateL(); + SizeChanged(); + DrawDeferred(); + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrdescriptionfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrdescriptionfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrdescriptionfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,30 +15,34 @@ * */ - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include +#include "cesmrdescriptionfield.h" +#include "mesmrlistobserver.h" +#include "cesmreditor.h" +#include "cesmrrichtextlink.h" +#include "esmrfieldbuilderdef.h" +#include "cesmrfeaturesettings.h" +#include "cesmrglobalnote.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" // #include "cesmrurlparserplugin.h" // -#include "cesmrdescriptionfield.h" -#include "mesmrlistobserver.h" -#include "cesmreditor.h" -#include "cesmrrichtextlink.h" -#include "cesmrlayoutmgr.h" -#include "esmrfieldbuilderdef.h" -#include "cesmrfeaturesettings.h" -#include "cesmrglobalnote.h" +#include +#include +#include +#include +#include +#include -namespace{ // codescanner::namespace -const TInt KFieldInnerShrink(3); -}//namespace +// DEBUG +#include "emailtrace.h" + +namespace // codescanner::namespace + { + /// Field's component count, iDescription + const TInt KComponentCount( 1 ); + }//namespace // ======== MEMBER FUNCTIONS ======== @@ -63,11 +67,10 @@ CESMRDescriptionField::~CESMRDescriptionField( ) { FUNC_LOG; - delete iFrameBgContext; - delete iLocationLink; - delete iFeatures; + delete iBgControlContext; + delete iUrlParser; } // --------------------------------------------------------------------------- @@ -77,7 +80,7 @@ void CESMRDescriptionField::InitializeL() { FUNC_LOG; - iDescription->SetFontL( iLayout->Font (iCoeEnv, iFieldId ), iLayout ); + // Do nothing } // --------------------------------------------------------------------------- @@ -91,7 +94,8 @@ HBufC* summary = entry.DescriptionL().AllocLC ( ); // externalize is done only when there is text and its NOT the default one. - if ( summary->Length ( )> 0 && iDescription->DefaultText().Compare (*summary )!= 0 ) + if ( summary->Length ( )> 0 && + iDescription->DefaultText().Compare (*summary )!= 0 ) { iDescription->ClearSelectionAndSetTextL ( *summary ); if ( FeaturesL().FeatureSupported( @@ -116,15 +120,15 @@ { FUNC_LOG; HBufC* buf = iDescription->GetTextInHBufL(); - + CCalEntry& entry = aEntry.Entry(); + if( buf ) { CleanupStack::PushL( buf ); if( iDescription->DefaultText().Compare( *buf ) != 0 ) { - CCalEntry& entry = aEntry.Entry(); - + // Edited text. Add link to description text HBufC* newBuf = AddLinkToTextL( *buf ); if( newBuf ) { @@ -134,16 +138,24 @@ } entry.SetDescriptionL( *buf ); } + else if ( iLocationLink ) + { + // Location link set + entry.SetDescriptionL( iLocationLink->Value() ); + } + else if ( entry.DescriptionL().Length() != 0 ) + { + // Clear old description + entry.SetDescriptionL( KNullDesC ); + } CleanupStack::PopAndDestroy( buf ); } else if( iLocationLink ) { - CCalEntry& entry = aEntry.Entry(); entry.SetDescriptionL( iLocationLink->Value() ); } else { - CCalEntry& entry = aEntry.Entry(); entry.SetDescriptionL( KNullDesC ); } } @@ -163,16 +175,6 @@ } // --------------------------------------------------------------------------- -// CESMRDescriptionField::ExpandedHeight -// --------------------------------------------------------------------------- -// -TInt CESMRDescriptionField::ExpandedHeight( ) const - { - FUNC_LOG; - return iSize.iHeight; - } - -// --------------------------------------------------------------------------- // CESMRDescriptionField::OfferKeyEventL // --------------------------------------------------------------------------- // @@ -180,7 +182,17 @@ TEventCode aType ) { FUNC_LOG; - return iDescription->OfferKeyEventL( aEvent, aType ); + TKeyResponse response( EKeyWasNotConsumed); + response = iDescription->OfferKeyEventL( aEvent, aType ); + + if ( aType == EEventKey && + ( aEvent.iScanCode != EStdKeyUpArrow && + aEvent.iScanCode != EStdKeyDownArrow )) + { + iDescription->DrawDeferred(); + } + + return response; } // --------------------------------------------------------------------------- @@ -191,24 +203,31 @@ TEdwinSizeEvent /*aType*/, TSize aSize ) { FUNC_LOG; - iSize = aSize; - iSize.iHeight -= KEditorDifference; + if ( aSize != iSize ) + { + iSize = aSize; - if (iLayout->CurrentFontZoom() == EAknUiZoomSmall || - iLayout->CurrentFontZoom() == EAknUiZoomVerySmall) - { - iSize.iHeight -= KEditorDifference; - } + if ( iObserver ) + { + iObserver->ControlSizeChanged ( this ); + } - if ( iObserver ) - { - iObserver->ControlSizeChanged ( this ); - } + if( iDescription->LineCount() != iLineCount ) + { + // Line count has changed, the whole component needs + // to be redrawn + DrawDeferred(); - if( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iDescription->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); + // Also if new line count is less than previous one, we + // need to redraw the parent also (this is the last field). + // Otherwise the removed line will remain on the screen + // until parent is redrawn. + if( iDescription->LineCount() < iLineCount ) + { + Parent()->DrawDeferred(); + } + iLineCount = iDescription->LineCount(); + } } return ETrue; @@ -218,11 +237,12 @@ // CESMRDescriptionField::HandleEdwinEventL // --------------------------------------------------------------------------- // -void CESMRDescriptionField::HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType) - { +void CESMRDescriptionField::HandleEdwinEventL( + CEikEdwin* aEdwin,TEdwinEvent aEventType) + { FUNC_LOG; if ( aEdwin == iDescription - && aEventType == EEventTextUpdate ) + && aEventType == EEventTextUpdate ) { HBufC* text = iDescription->GetTextInHBufL(); if ( text ) @@ -230,61 +250,23 @@ CleanupStack::PushL( text ); TInt textLength( text->Length() ); if ( iDescription->GetLimitLength() <= textLength ) - { - NotifyEventAsyncL( EESMRCmdSizeExceeded ); - } + { + NotifyEventAsyncL( EESMRCmdSizeExceeded ); + } CleanupStack::PopAndDestroy( text ); } } - } + } // --------------------------------------------------------------------------- // CESMRDescriptionField::CESMRDescriptionField // --------------------------------------------------------------------------- // -CESMRDescriptionField::CESMRDescriptionField() : - iSize( TSize( 0, 0 )) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CESMRDescriptionField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRDescriptionField::ActivateL() +CESMRDescriptionField::CESMRDescriptionField() { FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect(TPoint(iDescription->Position()), iDescription->Size()); - TRect inner(rect); - inner.Shrink( KFieldInnerShrink, KFieldInnerShrink ); - TRect outer(rect); - - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL( KAknsIIDQsnFrInput, - outer, - inner, - EFalse ); - - iFrameBgContext->SetParentContext( iBackground ); - iDescription->SetSkinBackgroundControlContextL( iFrameBgContext ); - } - -// --------------------------------------------------------------------------- -// CESMRDescriptionField::PositionChanged() -// --------------------------------------------------------------------------- -// -void CESMRDescriptionField::PositionChanged() - { - FUNC_LOG; - CCoeControl::PositionChanged(); - if( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iDescription->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } + SetFieldId( EESMRFieldDescription ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -294,32 +276,28 @@ void CESMRDescriptionField::ConstructL() { FUNC_LOG; - SetFieldId( EESMRFieldDescription ); - SetExpandable( ); iDescription = CESMREditor::NewL( this, 1, KTextLimit, CEikEdwin::EResizable | CEikEdwin::EAvkonEditor ); iDescription->SetEdwinSizeObserver( this ); iDescription->SetEdwinObserver( this ); + CESMRField::ConstructL( iDescription ); HBufC* buf = StringLoader::LoadLC( R_QTN_MEET_REQ_DETAILS_FIELD ); iDescription->SetDefaultTextL( buf ); // ownership transferred CleanupStack::Pop( buf ); - iBackground = AknsDrawUtils::ControlContext( this ); - - CESMRField::ConstructL( iDescription ); - } + // Setting background instead of theme skin + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); -// --------------------------------------------------------------------------- -// CESMRDescriptionField::GetMinimumVisibleVerticalArea -// --------------------------------------------------------------------------- -// -void CESMRDescriptionField::GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower) - { - FUNC_LOG; - aLower = iDescription->CurrentLineNumber() * iDescription->RowHeight(); - aUpper = aLower - iDescription->RowHeight(); + TRect initialisationRect( 0, 0, 0, 0 ); + iBgControlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + initialisationRect, + EFalse ); + + iDescription->SetSkinBackgroundControlContextL( iBgControlContext ); } // --------------------------------------------------------------------------- @@ -333,23 +311,29 @@ } // --------------------------------------------------------------------------- +// CESMRDescriptionField::GetCursorLineVerticalPos +// --------------------------------------------------------------------------- +// +void CESMRDescriptionField::GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower) + { + aLower = iDescription->CurrentLineNumber() * iDescription->RowHeight(); + aUpper = aLower - iDescription->RowHeight(); + } + +// --------------------------------------------------------------------------- // CESMRDescriptionField::StoreLinkL // --------------------------------------------------------------------------- // void CESMRDescriptionField::StoreLinkL( MESMRCalEntry& aEntry ) { FUNC_LOG; - TInt command( EESMRCmdDisableWaypointIcon ); - CESMRUrlParserPlugin* urlParser = CESMRUrlParserPlugin::NewL(); - CleanupStack::PushL( urlParser ); TPtrC urlPointer; TInt position; - position = urlParser->FindLocationUrl( aEntry.Entry().DescriptionL(), + position = UrlParserL().FindLocationUrl( aEntry.Entry().DescriptionL(), urlPointer ); - CleanupStack::PopAndDestroy( urlParser ); + if ( position >= KErrNone ) { - command = EESMRCmdEnableWaypointIcon; HBufC* description = HBufC::NewL( aEntry.Entry().DescriptionL().Length() ); CleanupStack::PushL( description ); @@ -363,7 +347,8 @@ } else { - iDescription->ClearSelectionAndSetTextL( iDescription->DefaultText() ); + iDescription->ClearSelectionAndSetTextL( + iDescription->DefaultText() ); } CleanupStack::PopAndDestroy( description ); @@ -373,16 +358,17 @@ iLocationLink = NULL; } HBufC* showOnMapBuf = - StringLoader::LoadLC( R_MEET_REQ_LINK_SHOW_ON_MAP ); - iLocationLink = CESMRRichTextLink::NewL( position, - showOnMapBuf->Length(), + StringLoader::LoadLC( R_MEET_REQ_LINK_SHOW_ON_MAP ); + iLocationLink = CESMRRichTextLink::NewL( position, + showOnMapBuf->Length(), urlPointer, CESMRRichTextLink::ETypeLocationUrl, CESMRRichTextLink::ETriggerKeyOk ); - CleanupStack::PopAndDestroy( showOnMapBuf ); + CleanupStack::PopAndDestroy( showOnMapBuf ); + + StoreGeoValueL( aEntry.Entry(), + urlPointer ); } - - NotifyEventL( command ); } // --------------------------------------------------------------------------- @@ -396,7 +382,7 @@ { TInt newTextLen = aBuf.Length() + iLocationLink->Value().Length() + 1; HBufC* retBuf = HBufC::NewL( newTextLen ); - + retBuf->Des().Append( iLocationLink->Value() ); _LIT( KParagraphSeparator, "\x2029" ); // unicode paragraph separator // add the separator after url @@ -422,7 +408,7 @@ { iFeatures = CESMRFeatureSettings::NewL(); } - + return *iFeatures; } @@ -430,37 +416,184 @@ // CESMRDescriptionField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRDescriptionField::ExecuteGenericCommandL( - TInt aCommand ) - { +TBool CESMRDescriptionField::ExecuteGenericCommandL( + TInt aCommand ) + { FUNC_LOG; - if ( EESMRCmdSizeExceeded == aCommand ) - { - CESMRGlobalNote::ExecuteL ( - CESMRGlobalNote::EESMRCannotDisplayMuchMore ); - - HBufC* text = iDescription->GetTextInHBufL(); - CleanupDeletePushL( text ); - if ( text ) - { - TInt curPos = iDescription->CursorPos(); - if( curPos > iDescription->GetLimitLength() - 1 ) - curPos = iDescription->GetLimitLength() - 1; - HBufC* newText = - text->Des().Mid( 0, iDescription->GetLimitLength() - 1 ).AllocLC(); - - iDescription->SetTextL ( newText ); - CleanupStack::PopAndDestroy( newText ); - newText = NULL; + TBool isUsed( EFalse ); + if ( EESMRCmdSizeExceeded == aCommand ) + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRCannotDisplayMuchMore ); + + HBufC* text = iDescription->GetTextInHBufL(); + CleanupDeletePushL( text ); + if ( text ) + { + TInt curPos = iDescription->CursorPos(); + if( curPos > iDescription->GetLimitLength() - 1 ) + curPos = iDescription->GetLimitLength() - 1; + HBufC* newText = + text->Des().Mid( 0, + iDescription->GetLimitLength() - 1 ).AllocLC(); + + iDescription->SetTextL ( newText ); + CleanupStack::PopAndDestroy( newText ); + newText = NULL; + + iDescription->SetCursorPosL (curPos, EFalse ); + iDescription->HandleTextChangedL(); + iDescription->UpdateScrollBarsL(); + SetFocus(ETrue); + } + CleanupStack::PopAndDestroy( text ); + isUsed = ETrue; + } + else if ( EESMRCmdDisableWaypointIcon == aCommand ) + { + isUsed = ETrue; + + // Clear location link + delete iLocationLink; + iLocationLink = NULL; + } + + return isUsed; + } + +// --------------------------------------------------------------------------- +// CESMRDescriptionField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRDescriptionField::CountComponentControls() const + { + return KComponentCount; + } + +// --------------------------------------------------------------------------- +// CESMRDescriptionField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRDescriptionField::ComponentControl( TInt aInd ) const + { + if( aInd == 0 ) + { + return iDescription; + } + return NULL; + } + +// --------------------------------------------------------------------------- +// CESMRDescriptionField::SizeChanged +// --------------------------------------------------------------------------- +// +void CESMRDescriptionField::SizeChanged() + { + TRect rect( Rect() ); + + // Optimization: Layouting only when necessary + if( iFieldRect != rect ) + { + rect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ).Rect(); + + TAknLayoutText editorLayoutText = NMRLayoutManager::GetLayoutText( + rect, + NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); + + TRect editorRect = editorLayoutText.TextRect(); - iDescription->SetCursorPosL (curPos, EFalse ); - iDescription->HandleTextChangedL(); - iDescription->UpdateScrollBarsL(); - SetFocus(ETrue); - } - CleanupStack::PopAndDestroy( text ); - } - } + TRect bgRect( editorRect ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + if( iSize.iHeight > 0 ) + { + bgRect.SetHeight( iSize.iHeight ); + } + SetFocusRect( bgRect ); + + iDescription->SetRect( + TRect( editorRect.iTl, + TSize( editorRect.Width(), iSize.iHeight ) ) ); + + // Set also correct font for description field + TRAP_IGNORE( iDescription->SetFontL( editorLayoutText.Font() ) ); + + iFieldRect = rect; + } + } + +// --------------------------------------------------------------------------- +// CESMRDescriptionField::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CESMRDescriptionField::MinimumSize() + { + TRect rect( Parent()->Rect() ); + TRect listRect = + NMRLayoutManager::GetLayoutRect( + rect, + NMRLayoutManager::EMRLayoutListArea ).Rect(); + TRect fieldRect = + NMRLayoutManager::GetFieldLayoutRect( listRect, 1 ).Rect(); + TRect rowRect = + NMRLayoutManager::GetFieldRowLayoutRect( fieldRect, 1 ).Rect(); + TRect viewerRect = + NMRLayoutManager::GetLayoutText( + rowRect, + NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ).TextRect(); + + fieldRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); + + return fieldRect.Size(); + } +// --------------------------------------------------------------------------- +// CESMRRepeatUntilField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRDescriptionField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + CCoeControl::SetContainerWindowL( aContainer ); + iDescription->SetContainerWindowL( aContainer ); + + iDescription->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRDescriptionField::StoreGeoValueL +// --------------------------------------------------------------------------- +// +void CESMRDescriptionField::StoreGeoValueL( + CCalEntry& aCalEntry, + const TDesC& aLocationUrl ) + { + TReal lat, lon; + CCalGeoValue* geoVal = aCalEntry.GeoValueL(); + + if ( !geoVal || ! geoVal->GetLatLong( lat, lon ) ) + { + // GEO value not set. Convert URL + geoVal = UrlParserL().CreateGeoValueLC( aLocationUrl ); + aCalEntry.SetGeoValueL( *geoVal ); + CleanupStack::Pop( geoVal ); + + NotifyEventL( EESMRCmdEnableWaypointIcon ); + } + } + +// --------------------------------------------------------------------------- +// CESMRDescriptionField::UrlParserL +// --------------------------------------------------------------------------- +// +CESMRUrlParserPlugin& CESMRDescriptionField::UrlParserL() + { + if ( !iUrlParser ) + { + iUrlParser = CESMRUrlParserPlugin::NewL(); + } + + return *iUrlParser; + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,34 +12,37 @@ * Contributors: * * Description : ESMR location field implementation - * Version : %version: tr1sido#10 % + * Version : %version: e002sa33#52 % * */ -#include "emailtrace.h" + #include "cesmrlocationfield.h" - -// SYSTEM INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// INCLUDES #include "esmrfieldbuilderdef.h" #include "cesmreditor.h" #include "cesmrfeaturesettings.h" #include "esmrhelper.h" -#include "cesmrborderlayer.h" #include "mesmrfieldevent.h" #include "cesmrgenericfieldevent.h" -#include "cesmrlayoutmgr.h" #include "cesmrglobalnote.h" +#include "cmrbutton.h" +#include "cmrlabel.h" +#include "cmrimage.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" +#include "cmrstyluspopupmenu.h" +#include "mesmrlistobserver.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" +#include "esmrconfig.hrh" // ======== MEMBER FUNCTIONS ======== @@ -47,29 +50,119 @@ // CESMRLocationField::NewL // --------------------------------------------------------------------------- // -CESMRLocationField* CESMRLocationField::NewL( ) +CESMRLocationField* CESMRLocationField::NewL() { FUNC_LOG; CESMRLocationField* self = new (ELeave) CESMRLocationField; - CleanupStack::PushL ( self ); - self->ConstructL ( ); - CleanupStack::Pop ( self ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); return self; } // --------------------------------------------------------------------------- +// CESMRLocationField::CESMRLocationField +// --------------------------------------------------------------------------- +// +CESMRLocationField::CESMRLocationField() + { + FUNC_LOG; + SetFieldId( EESMRFieldLocation ); + SetFocusType( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRLocationField::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRLocationField::ConstructL() + { + FUNC_LOG; + + iFieldButton = CMRButton::NewL( NMRBitmapManager::EMRBitmapLocation ); + iFieldButton->SetParent( this ); + + iTitle = CMRLabel::NewL(); + iTitle->SetParent( this ); + HBufC* title = StringLoader::LoadLC( + R_MEET_REQ_OPTIONS_ADD_LOCATION, + iCoeEnv ); + iTitle->SetTextL( *title ); + CleanupStack::PopAndDestroy( title ); + + iLocation = CESMREditor::NewL( this, + 1, + KMaxTextLength, //from ICAL spec. + // do not change. other text fields do not + // have this limitation + CEikEdwin::EResizable | + CEikEdwin::EAvkonEditor ); + + CESMRField::ConstructL( iLocation ); //ownership transfered + + iLocation->SetEdwinSizeObserver( this ); + iLocation->SetEdwinObserver( this ); + iLocation->SetParent( this ); + + HBufC* buf = StringLoader::LoadLC( R_QTN_MEET_REQ_LOCATION_FIELD, iCoeEnv ); + iLocation->SetDefaultTextL( buf ); // ownership is transferred + CleanupStack::Pop( buf ); + + // Setting background instead of theme skin + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); + + TRect initialisationRect( 0, 0, 0, 0 ); + iBgControlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + initialisationRect, + EFalse ); + + iLocation->SetSkinBackgroundControlContextL( iBgControlContext ); + } + + +// --------------------------------------------------------------------------- // CESMRLocationField::~CESMRLocationField // --------------------------------------------------------------------------- // -CESMRLocationField::~CESMRLocationField( ) +CESMRLocationField::~CESMRLocationField() { FUNC_LOG; - delete iIcon; + delete iFieldButton; delete iWaypointIcon; - delete iWaypointIconMask; - delete iFrameBgContext; delete iFeatures; delete iLocationText; + delete iBgControlContext; + delete iMenu; + delete iTitle; + } + +// --------------------------------------------------------------------------- +// CESMRLocationField::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CESMRLocationField::MinimumSize() + { + TRect parentRect( Parent()->Rect() ); + + TRect richTextRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); + + TRect textRect( NMRLayoutManager::GetLayoutText( + richTextRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + // Adjust field size so that there's room for expandable editor. + richTextRect.Resize( 0, iSize.iHeight - textRect.Height() ); + + // Add title area to the required size + TSize titleSize( CESMRField::MinimumSize() ); + + TSize completeFieldSize( titleSize ); + completeFieldSize.iHeight += richTextRect.Height(); + + return completeFieldSize; } // --------------------------------------------------------------------------- @@ -79,10 +172,7 @@ void CESMRLocationField::InitializeL() { FUNC_LOG; - iLocation->SetFontL( iLayout->Font(iCoeEnv, iFieldId ), iLayout ); - AknLayoutUtils::OverrideControlColorL( *iLocation, - EColorControlBackground, - iLayout->NormalTextBgColor() ); + // Do nothing } // --------------------------------------------------------------------------- @@ -104,6 +194,12 @@ CleanupStack::PopAndDestroy( location ); + // If the geo value has been set, the waypoint icon has to be shown on right + // side of the location field + CCalGeoValue* geoValue = aEntry.Entry().GeoValueL(); + TReal dummy; + SetWaypointIconL( geoValue && geoValue->GetLatLong( dummy, dummy ) ); + // this is needed to be re-called here, otherwise the CEikEdwin // does not get correctly instantiated with default text iLocation->FocusChanged( EDrawNow ); @@ -125,12 +221,18 @@ // externalize the text only if it differs from the // default text. In other words, default text is not // externalized. - HBufC* defaultText = StringLoader::LoadLC( R_QTN_MEET_REQ_LOCATION_FIELD ); + HBufC* defaultText = StringLoader::LoadLC( + R_QTN_MEET_REQ_LOCATION_FIELD, + iCoeEnv ); if ( defaultText->Compare( *loc ) != 0 ) { CCalEntry& entry = aEntry.Entry(); entry.SetLocationL( *loc ); } + else if ( !iWaypointIcon ) + { + aEntry.Entry().ClearGeoValueL(); + } CleanupStack::PopAndDestroy( defaultText ); CleanupStack::PopAndDestroy( loc ); @@ -139,6 +241,7 @@ { CCalEntry& entry = aEntry.Entry(); entry.SetLocationL( KNullDesC ); + entry.ClearGeoValueL(); } } @@ -150,7 +253,7 @@ { FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); - + if ( FeaturesL().FeatureSupported( CESMRFeatureSettings::EESMRUILocationFeatures ) ) { @@ -166,16 +269,18 @@ iLocationText = NULL; } iLocationText = iLocation->GetTextInHBufL(); - - HBufC* defaultText = StringLoader::LoadLC( R_QTN_MEET_REQ_LOCATION_FIELD ); - + + HBufC* defaultText = StringLoader::LoadLC( + R_QTN_MEET_REQ_LOCATION_FIELD, + iCoeEnv ); + if ( iLocationText && iLocationText->Compare( *defaultText ) != 0 ) { // Create field change event CESMRGenericFieldEvent* event = CESMRGenericFieldEvent::NewLC( this, MESMRFieldEvent::EESMRFieldChangeEvent ); - + // Add this field as parameter TInt fieldId = iFieldId; CESMRFieldEventValue* field = CESMRFieldEventValue::NewLC( @@ -183,7 +288,7 @@ &fieldId ); event->AddParamL( field ); CleanupStack::Pop( field ); - + // Add new value as parameter CESMRFieldEventValue* value = CESMRFieldEventValue::NewLC( CESMRFieldEventValue::EESMRString, @@ -192,7 +297,7 @@ // Encapsulate value, so receiver gets the field value type event->AddParamL( value, ETrue ); CleanupStack::Pop( value ); - + // Send event NotifyEventAsyncL( event ); CleanupStack::Pop( event ); @@ -203,16 +308,6 @@ } // --------------------------------------------------------------------------- -// CESMRLocationField::ExpandedHeight -// --------------------------------------------------------------------------- -// -TInt CESMRLocationField::ExpandedHeight( ) const - { - FUNC_LOG; - return iSize.iHeight; - } - -// --------------------------------------------------------------------------- // CESMRLocationField::HandleEdwinSizeEventL // --------------------------------------------------------------------------- // @@ -220,28 +315,29 @@ TEdwinSizeEvent /*aType*/, TSize aSize ) { FUNC_LOG; - TBool ret( EFalse ); - - TSize newSize = CalculateEditorSize( aSize ); + TBool reDraw( EFalse ); + + if( iSize != aSize ) + { + // Let's save the required size for the iLocation + iSize = aSize; - if ( aEdwin == iLocation && iSize != newSize ) - { - iSize = newSize; + if ( iObserver && aEdwin == iLocation ) + { + iObserver->ControlSizeChanged( this ); + reDraw = ETrue; + } - if ( iObserver && aEdwin->IsFocused() ) + if( iLocation->LineCount() != iLineCount ) { - iObserver->ControlSizeChanged (this ); + // Line count has changed, the whole component needs + // to be redrawn + DrawDeferred(); + iLineCount = iLocation->LineCount(); } + } - if ( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iLocation->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } - - ret = ETrue; - } - return ret; + return reDraw; } // --------------------------------------------------------------------------- @@ -249,110 +345,30 @@ // --------------------------------------------------------------------------- // void CESMRLocationField::HandleEdwinEventL(CEikEdwin* aEdwin, TEdwinEvent aEventType) - { + { FUNC_LOG; if ( aEdwin == iLocation && aEventType == EEventTextUpdate ) { - HBufC* text = iLocation->GetTextInHBufL(); - if ( text ) + TInt textLength( iLocation->TextLength() ); + + if ( iLocation->GetLimitLength() <= textLength ) { - CleanupStack::PushL( text ); - TInt textLength( text->Length() ); - if ( iLocation->GetLimitLength() <= textLength ) - { - NotifyEventAsyncL( EESMRCmdSizeExceeded ); - } - CleanupStack::PopAndDestroy( text ); + NotifyEventAsyncL( EESMRCmdSizeExceeded ); } - } - } -// --------------------------------------------------------------------------- -// CESMRLocationField::CESMRLocationField -// --------------------------------------------------------------------------- -// -CESMRLocationField::CESMRLocationField() - : iSize( TSize( 0, 0 ) ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRLocationField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRLocationField::ActivateL() - { - FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect( iLocation->Rect() ); - TRect inner(rect); - TRect outer(rect); - - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL( - KAknsIIDQsnFrInput, - outer, - inner, - EFalse ) ; - - iFrameBgContext->SetParentContext( iBackground ); - iLocation->SetSkinBackgroundControlContextL( iFrameBgContext ); - } - - -// --------------------------------------------------------------------------- -// CESMRLocationField::PositionChanged() -// --------------------------------------------------------------------------- -// -void CESMRLocationField::PositionChanged() - { - FUNC_LOG; - CCoeControl::PositionChanged(); - - if ( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iLocation->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); + else if ( iWaypointIcon && textLength == 0 ) + { + SetWaypointIconL( EFalse ); + NotifyEventL( EESMRCmdDisableWaypointIcon ); + } } } // --------------------------------------------------------------------------- -// CESMRLocationField::ConstructL +// CESMRLocationField::GetCursorLineVerticalPos // --------------------------------------------------------------------------- // -void CESMRLocationField::ConstructL() +void CESMRLocationField::GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower) { - FUNC_LOG; - SetFieldId( EESMRFieldLocation ); - SetExpandable(); - - iLocation = CESMREditor::NewL( this, - 1, - KMaxTextLength, //from ICAL spec. - // do not change. other text fields do not - // have this limitation - CEikEdwin::EResizable | - CEikEdwin::EAvkonEditor ); - - iLocation->SetEdwinSizeObserver( this ); - iLocation->SetEdwinObserver( this ); - - HBufC* buf = StringLoader::LoadLC( R_QTN_MEET_REQ_LOCATION_FIELD ); - iLocation->SetDefaultTextL( buf ); // ownership is transferred - CleanupStack::Pop( buf ); - - CESMRIconField::ConstructL( KAknsIIDQgnMeetReqIndiLocation, iLocation ); - } - -// --------------------------------------------------------------------------- -// CESMRLocationField::GetMinimumVisibleVerticalArea -// --------------------------------------------------------------------------- -// -void CESMRLocationField::GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower) - { - FUNC_LOG; aLower = iLocation->CurrentLineNumber() * iLocation->RowHeight(); aUpper = aLower - iLocation->RowHeight(); } @@ -378,63 +394,27 @@ { iFeatures = CESMRFeatureSettings::NewL(); } - + return *iFeatures; } // --------------------------------------------------------------------------- -// CESMRCheckbox::SetWaypointIconL +// CESMRLocationField::SetWaypointIconL // --------------------------------------------------------------------------- // void CESMRLocationField::SetWaypointIconL( TBool aEnabled ) { - FUNC_LOG; - delete iIcon; - iIcon = NULL; delete iWaypointIcon; iWaypointIcon = NULL; - delete iWaypointIconMask; - iWaypointIconMask = NULL; - - if( aEnabled ) - { - TAknsItemID iconID; - TInt fileIndex(-1); - TInt fileMaskIndex(-1); - iconID = KAknsIIDQgnPropBlidWaypoint; - CESMRLayoutManager::SetBitmapFallback( iconID, - fileIndex, - fileMaskIndex ); - - TFileName bitmapFilePath; - ESMRHelper::LocateResourceFile( - KESMRMifFile, - KDC_APP_BITMAP_DIR, - bitmapFilePath); - AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - iconID, - iWaypointIcon, - iWaypointIconMask, - bitmapFilePath, - fileIndex, - fileMaskIndex - ); + if ( aEnabled ) + { + iWaypointIcon = CMRImage::NewL( + NMRBitmapManager::EMRBitmapLocationWaypoint, ETrue ); + iWaypointIcon->SetParent( this ); + } - // Even if creating mask failed, bitmap can be used (background is just not displayed correctly) - if( iWaypointIcon ) - { - AknIconUtils::SetSize( iWaypointIcon, KIconSize, EAspectRatioPreserved ); - iIcon = new (ELeave) CEikImage; - iIcon->SetPictureOwnedExternally(ETrue); - iIcon->SetPicture( iWaypointIcon, iWaypointIconMask ); - - LayoutWaypointIcon(); - - // change text rect size to fit icon - iBorder->SetSize( BorderSize() ); - } - } + SizeChanged(); } // --------------------------------------------------------------------------- @@ -444,11 +424,27 @@ TInt CESMRLocationField::CountComponentControls( ) const { FUNC_LOG; - TInt count = CESMRIconField::CountComponentControls ( ); - if ( iIcon ) + TInt count( 0 ); + if( iFieldButton ) + { + ++count; + } + + if ( iTitle ) { ++count; } + + if( iLocation ) + { + ++count; + } + + if( iWaypointIcon ) + { + ++count; + } + return count; } @@ -459,42 +455,111 @@ CCoeControl* CESMRLocationField::ComponentControl( TInt aInd ) const { FUNC_LOG; - if ( aInd == 2 ) + + switch ( aInd ) { - return iIcon; + case 0: + return iFieldButton; + case 1: + return iTitle; + case 2: + return iLocation; + case 3: + return iWaypointIcon; + default: + return NULL; } - return CESMRIconField::ComponentControl ( aInd ); } // --------------------------------------------------------------------------- // CESMRLocationField::SizeChanged // --------------------------------------------------------------------------- // -void CESMRLocationField::SizeChanged( ) +void CESMRLocationField::SizeChanged() { FUNC_LOG; - CESMRIconField::SizeChanged(); - - PositionFieldElements(); - } + TRect rect( Rect() ); + + TAknLayoutRect firstRowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect firstRowRect( firstRowLayoutRect.Rect() ); + + TRect secondRowRect( firstRowRect ); + secondRowRect.Move( 0, firstRowRect.Height() ); + + // Layout field button + if( iFieldButton ) + { + TAknWindowComponentLayout buttonLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ) ); + AknLayoutUtils::LayoutControl( + iFieldButton, firstRowRect, buttonLayout ); + } + + // Layout field title + if( iTitle ) + { + TAknLayoutText labelLayout( + NMRLayoutManager::GetLayoutText( + firstRowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ) ); + + iTitle->SetRect( labelLayout.TextRect() ); + + // Setting font also for the label. Failures are ignored. + iTitle->SetFont( labelLayout.Font() ); + } + + TRect editorRect( 0, 0, 0, 0 ); + + // Layout field editor + if( iLocation ) + { + TAknLayoutText editorLayoutText; -// --------------------------------------------------------------------------- -// CESMRLocationField::PositionFieldElements -// --------------------------------------------------------------------------- -// -void CESMRLocationField::PositionFieldElements() - { - FUNC_LOG; - // editor (editor is wrapped inside the 'iBorder' member) - if ( iIcon ) + if( iWaypointIcon ) + { + editorLayoutText = NMRLayoutManager::GetLayoutText( + secondRowRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + editorLayoutText = NMRLayoutManager::GetLayoutText( + secondRowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + editorRect = editorLayoutText.TextRect(); + + // Resize height according to actual height required by edwin. + editorRect.Resize( 0, iSize.iHeight - editorRect.Height() ); + + iLocation->SetRect( editorRect ); + + // Try setting font. Failures are ignored. + TRAP_IGNORE( iLocation->SetFontL( editorLayoutText.Font() ) ); + } + + // Layout the waypoint icon + if ( iWaypointIcon ) { - LayoutWaypointIcon(); - - if ( iFrameBgContext && iBorder ) - { - TRect visibleRect = CalculateVisibleRect( iLocation->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iWaypointIcon, secondRowRect, iconLayout ); + } + + // Layout field focus + if( iLocation ) + { + // Layouting focus for rich text editor area + TRect bgRect( iLocation->Rect() ); + + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); } } @@ -508,17 +573,13 @@ if ( aEvent.Type() == MESMRFieldEvent::EESMRFieldCommandEvent ) { TInt* command = static_cast< TInt* >( aEvent.Param( 0 ) ); - + switch ( *command ) { case EESMRCmdDisableWaypointIcon: - { - SetWaypointIconL( EFalse ); - break; - } case EESMRCmdEnableWaypointIcon: { - SetWaypointIconL( ETrue ); + SetWaypointIconL( *command == EESMRCmdEnableWaypointIcon ); break; } default: @@ -533,97 +594,315 @@ // CESMRLocationField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRLocationField::ExecuteGenericCommandL( - TInt aCommand ) - { +TBool CESMRLocationField::ExecuteGenericCommandL( + TInt aCommand ) + { FUNC_LOG; - if ( EESMRCmdSizeExceeded == aCommand ) - { - CESMRGlobalNote::ExecuteL( - CESMRGlobalNote::EESMRCannotDisplayMuchMore ); - - HBufC* text = iLocation->GetTextInHBufL(); - CleanupDeletePushL( text ); - if ( text ) - { - TInt curPos = iLocation->CursorPos(); - if ( curPos > iLocation->GetLimitLength() - 1 ) - curPos = iLocation->GetLimitLength() - 1; - HBufC* newText = - text->Mid( 0, iLocation->GetLimitLength() - 1 ).AllocLC(); - - iLocation->SetTextL ( newText ); - CleanupStack::PopAndDestroy( newText ); - newText = NULL; - - iLocation->SetCursorPosL( curPos, EFalse ); - iLocation->HandleTextChangedL(); - iLocation->UpdateScrollBarsL(); - SetFocus( ETrue ); - } - CleanupStack::PopAndDestroy( text ); - } - } + TBool isUsed( EFalse ); + switch(aCommand) + { + case EESMRCmdSizeExceeded: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRCannotDisplayMuchMore ); + + HBufC* text = iLocation->GetTextInHBufL(); + CleanupDeletePushL( text ); + if ( text ) + { + TInt curPos = iLocation->CursorPos(); + if ( curPos > iLocation->GetLimitLength() - 1 ) + curPos = iLocation->GetLimitLength() - 1; + HBufC* newText = + text->Mid( 0, iLocation->GetLimitLength() - 1 ).AllocLC(); + + iLocation->SetTextL ( newText ); + CleanupStack::PopAndDestroy( newText ); + newText = NULL; + + iLocation->SetCursorPosL( curPos, EFalse ); + iLocation->HandleTextChangedL(); + iLocation->UpdateScrollBarsL(); + SetFocus( ETrue ); + } + CleanupStack::PopAndDestroy( text ); + isUsed = ETrue; + break; + } + default: + break; + } + return isUsed; + } + + +// --------------------------------------------------------------------------- +// CESMRLocationField::HandleSingletapEventL +// --------------------------------------------------------------------------- +// +TBool CESMRLocationField::HandleSingletapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + TBool ret( EFalse ); + + if( iTitle->Rect().Contains( aPosition ) || + iFieldButton->Rect().Contains( aPosition ) ) + { + NotifyEventL( EAknSoftkeyContextOptions ); + HandleTactileFeedbackL(); + ret = ETrue; + } + + return ret; + } // --------------------------------------------------------------------------- -// CESMRLocationField::CalculateEditorSize +// CESMRLocationField::HandleLongtapEventL // --------------------------------------------------------------------------- // -TSize CESMRLocationField::CalculateEditorSize( const TSize& aSize ) +void CESMRLocationField::HandleLongtapEventL( const TPoint& aPosition ) { FUNC_LOG; - TSize size( aSize ); - size.iHeight -= KEditorDifference; + + if ( iLocation->Rect().Contains( aPosition ) ) + { + if ( !iMenu ) + { + iMenu = CMRStylusPopupMenu::NewL( *this ); + } + RArray items; + CleanupClosePushL( items ); + + HBufC* maps= NULL; + HBufC* myLocations = NULL; + + if ( FeaturesL().FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + maps = StringLoader::LoadLC( + R_MEET_REQ_OPTIONS_ASSIGN_FROM_MAP, + iCoeEnv ); + CMRStylusPopupMenu::TMenuItem mapsItem( + *maps, + EESMRCmdAssignFromMap ); + items.AppendL( mapsItem ); + } + +//#ifdef RD_USE_MYLOCATIONUI + + myLocations = StringLoader::LoadLC( + R_MEET_REQ_OPTIONS_MY_LOCATIONS, + iCoeEnv ); + + CMRStylusPopupMenu::TMenuItem myLocationsItem( + *myLocations, + EMRCommandMyLocations ); - if ( iLayout->CurrentFontZoom() == EAknUiZoomSmall || - iLayout->CurrentFontZoom() == EAknUiZoomVerySmall) + items.AppendL( myLocationsItem ); + +//#endif //RD_USE_MYLOCATIONUI + + if ( items.Count() == 1 ) + { + // Only one option. Issue command directly + NotifyEventL( items[ 0 ].iCommandId ); + } + else if ( items.Count() > 1 ) + { + iMenu->LaunchPopupL( items.Array(), aPosition ); + iMenuIsShown = ETrue; + } + + if (myLocations ) + { + CleanupStack::PopAndDestroy( myLocations ); + } + + if ( maps ) + { + CleanupStack::PopAndDestroy( maps ); + } + + CleanupStack::PopAndDestroy( &items ); + } + + if( iTitle->Rect().Contains( aPosition ) || + iFieldButton->Rect().Contains( aPosition ) ) { - size.iHeight -= KEditorDifference; + NotifyEventL( EAknSoftkeyContextOptions ); + HandleTactileFeedbackL(); } - - return size; } // --------------------------------------------------------------------------- -// CESMRLocationField::BorderSize +// CESMRLocationField::DynInitMenuPaneL // --------------------------------------------------------------------------- // -TSize CESMRLocationField::BorderSize() const +void CESMRLocationField::DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ) { FUNC_LOG; - TSize borderSize( CESMRIconField::BorderSize() ); - - // If icon exists, we have to adjust the border width - if ( iIcon ) + + if ( aResourceId == R_MR_EDITOR_ORGANIZER_MENU) { - borderSize.iWidth -= ( KIconSize.iWidth + 2 * KEditorDifference ); + // Init assign options + TInt numOptions( 1 ); // My Locations + + if ( FeaturesL().FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + ++numOptions; + } + + #ifndef RD_USE_MYLOCATIONUI + // Disable My Locations + --numOptions; + #endif // RD_USE_MYLOCATIONUI + + switch ( numOptions ) + { + case 0: + { + aMenuPane->SetItemDimmed( EESMRCmdAddLocation, ETrue ); + break; + } + + case 1: + { + // Replace Add location with actual command + TInt pos( 0 ); + CEikMenuPaneItem* item = + aMenuPane->ItemAndPos( EESMRCmdAddLocation, pos ); + + item->iData.iCascadeId = 0; + + if ( FeaturesL().FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + item->iData.iCommandId = EESMRCmdAssignFromMap; + StringLoader::Load(item->iData.iText, + R_MEET_REQ_OPTIONS_ASSIGN_FROM_MAP, iCoeEnv ); + } + +#ifdef RD_USE_MYLOCATIONUI + else + { + item->iData.iCommandId = EMRCommandMyLocations; + StringLoader::Load( item->iData.iText, + R_MEET_REQ_OPTIONS_MY_LOCATIONS, iCoeEnv ); + } +#endif //RD_USE_MYLOCATIONUI + + aMenuPane->SetItemDimmed( item->iData.iCommandId, EFalse ); + break; + } + default: + { + aMenuPane->SetItemDimmed( EESMRCmdAddLocation, EFalse ); + break; + } + } + // Init Show/Search options + TBool showOnMap( EFalse ); + TBool searchFromMap( EFalse ); + + if ( iWaypointIcon ) + { + // Coordinates available -> show on map + showOnMap = ETrue; + } + else + { + HBufC* text = iLocation->GetTextInHBufL(); + if ( text && *text != iLocation->DefaultText() ) + { + // Edited text in field -> enable search from map + searchFromMap = ETrue; + } + delete text; + } + + aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); + aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, !searchFromMap ); } - - return borderSize; + else if ( aResourceId == R_MR_EDITOR_LOCATION_MENU ) + { + if ( !FeaturesL().FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + aMenuPane->SetItemDimmed( EESMRCmdAssignFromMap, ETrue ); + } +#ifndef RD_USE_MYLOCATIONUI + aMenuPane->SetItemDimmed( EMRCommandMyLocations, ETrue ); +#endif //RD_USE_MYLOCATIONUI + } } // --------------------------------------------------------------------------- -// CESMRLocationField::LayoutWaypointIcon +// CESMRLocationField::SetContainerWindowL // --------------------------------------------------------------------------- // -void CESMRLocationField::LayoutWaypointIcon() +void CESMRLocationField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + FUNC_LOG; + CCoeControl::SetContainerWindowL( aContainer ); + + iLocation->SetContainerWindowL( aContainer ); + iLocation->SetParent( this ); + + iTitle->SetContainerWindowL( aContainer ); + iTitle->SetParent( this ); + + iFieldButton->SetContainerWindowL(aContainer); + iFieldButton->SetParent(this); + } + +// --------------------------------------------------------------------------- +// CESMRLocationField::OfferKeyEventL() +// --------------------------------------------------------------------------- +// +TKeyResponse CESMRLocationField::OfferKeyEventL( + const TKeyEvent& aEvent, + TEventCode aType ) { FUNC_LOG; - if ( iIcon ) + TKeyResponse response( EKeyWasNotConsumed ); + response = iLocation->OfferKeyEventL ( aEvent, aType ); + + if ( aType == EEventKey && + ( aEvent.iScanCode != EStdKeyUpArrow && + aEvent.iScanCode != EStdKeyDownArrow )) { - // Layout the icon - TRect fieldRect( Rect() ); - TPoint iconPos( fieldRect.iBr.iX - KIconSize.iWidth, - fieldRect.iTl.iY + iLayout->IconTopMargin() ); - - if ( CESMRLayoutManager::IsMirrored() ) - { - iconPos.iX = fieldRect.iTl.iX; - } - - iIcon->SetPosition( iconPos ); - iIcon->SetSize( KIconSize ); + iLocation->DrawDeferred(); } + + return response; } +// --------------------------------------------------------------------------- +// CESMRLocationField::HandlePointerEventL +// --------------------------------------------------------------------------- +// +TBool CESMRLocationField::HandleRawPointerEventL( const TPointerEvent &aPointerEvent ) + { + if ( !iMenuIsShown ) + { + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + + return ETrue; + } + +// --------------------------------------------------------------------------- +// CESMRLocationField::ProcessCommandL +// --------------------------------------------------------------------------- +// +void CESMRLocationField::ProcessCommandL( TInt aCommandId ) + { + NotifyEventL( aCommandId ); + + iMenuIsShown = EFalse; + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriority.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriority.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriority.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,7 +19,7 @@ #include "emailtrace.h" #include "cesmrpriority.h" #include -#include +#include // --------------------------------------------------------------------------- // CESMRPriority::CESMRPriority diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,31 +15,58 @@ * */ -#include "emailtrace.h" #include "cesmrpriorityfield.h" #include "cesmrlistquery.h" +#include "nmrcolormanager.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" #include "mesmrtitlepaneobserver.h" -// -#include "mesmrcalentry.h" -// #include #include -#include +#include #include #include #include -#include -#include +#include +#include + +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- +// CESMRPriorityField::CESMRPriorityField +// --------------------------------------------------------------------------- +// +CESMRPriorityField::CESMRPriorityField() + { + FUNC_LOG; + SetFieldId( EESMRFieldPriority ); + SetFocusType( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRPriorityField::~CESMRPriorityField +// --------------------------------------------------------------------------- +// +CESMRPriorityField::~CESMRPriorityField() + { + FUNC_LOG; + iArray.ResetAndDestroy(); + iArray.Close(); + + delete iIcon; + } + +// --------------------------------------------------------------------------- // CESMRPriorityField::NewL // --------------------------------------------------------------------------- // -CESMRPriorityField* CESMRPriorityField::NewL( ) +CESMRPriorityField* CESMRPriorityField::NewL() { FUNC_LOG; CESMRPriorityField* self = new (ELeave) CESMRPriorityField; @@ -50,14 +77,18 @@ } // --------------------------------------------------------------------------- -// CESMRPriorityField::~CESMRPriorityField +// CESMRPriorityField::ConstructL // --------------------------------------------------------------------------- // -CESMRPriorityField::~CESMRPriorityField( ) +void CESMRPriorityField::ConstructL() { - FUNC_LOG; - iArray.ResetAndDestroy ( ); - iArray.Close ( ); + FUNC_LOG; + iLabel = CMRLabel::NewL(); + iLabel->SetParent( this ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal ); + iIcon->SetParent( this ); } // --------------------------------------------------------------------------- @@ -67,13 +98,8 @@ void CESMRPriorityField::InitializeL() { FUNC_LOG; - iPriority->SetFont( iLayout->Font( iCoeEnv, iFieldId ) ); - iPriority->SetLabelAlignment( CESMRLayoutManager::IsMirrored() - ? ELayoutAlignRight : ELayoutAlignLeft ); - - AknLayoutUtils::OverrideControlColorL(*iPriority, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); + NMRColorManager::SetColor( *iLabel, + NMRColorManager::EMRMainAreaTextColor ); } // --------------------------------------------------------------------------- @@ -146,7 +172,8 @@ void CESMRPriorityField::SetOutlineFocusL( TBool aFocus ) { FUNC_LOG; - CESMRField::SetOutlineFocusL ( aFocus ); + CESMRField::SetOutlineFocusL ( aFocus ); + iLabel->SetFocus( aFocus ); //Focus gained if ( aFocus ) @@ -156,17 +183,93 @@ } // --------------------------------------------------------------------------- +// CESMRPriorityField::SizeChanged() +// --------------------------------------------------------------------------- +// +void CESMRPriorityField::SizeChanged() + { + FUNC_LOG; + TRect rect = Rect(); + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + rect = rowLayoutRect.Rect(); + + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ); + AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + iLabel->SetRect( labelLayout.TextRect() ); + } + +// --------------------------------------------------------------------------- +// CESMRPriorityField::CountComponentControls() +// --------------------------------------------------------------------------- +// +TInt CESMRPriorityField::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iLabel ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CESMRPriorityField::ComponentControl() +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRPriorityField::ComponentControl( TInt aIndex ) const + { + FUNC_LOG; + switch ( aIndex ) + { + case 0: + return iIcon; + case 1: + return iLabel; + default: + return NULL; + } + } + + + +// --------------------------------------------------------------------------- // CESMRPriorityField::ExecuteGenericCommandL() // --------------------------------------------------------------------------- // -void CESMRPriorityField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRPriorityField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if( aCommand == EESMRCmdOpenPriorityQuery || aCommand == EAknCmdOpen ) { ExecutePriorityQueryL(); + isUsed = ETrue; + + HandleTactileFeedbackL(); } + return isUsed; } // --------------------------------------------------------------------------- @@ -269,32 +372,6 @@ } // --------------------------------------------------------------------------- -// CESMRPriorityField::CESMRPriorityField -// --------------------------------------------------------------------------- -// -CESMRPriorityField::CESMRPriorityField( ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRPriorityField::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRPriorityField::ConstructL( ) - { - FUNC_LOG; - SetFieldId ( EESMRFieldPriority ); - iPriority = new( ELeave ) CEikLabel(); - _LIT(KEmptyText, ""); - iPriority->SetTextL( KEmptyText ); - - // ownership transferred - CESMRIconField::ConstructL (KAknsIIDQgnFsIndiPriorityNormal, iPriority ); - } - -// --------------------------------------------------------------------------- // CESMRPriorityField::UpdateTextL // --------------------------------------------------------------------------- // @@ -302,56 +379,44 @@ { FUNC_LOG; CESMRPriority* priority = iArray[ aIndex ]; - iPriority->SetTextL ( priority->Text ( ) ); + iLabel->SetTextL ( priority->Text ( ) ); - TAknsItemID iconID = { 0 , 0 }; + NMRBitmapManager::TMRBitmapId bitmapId( + NMRBitmapManager::EMRBitmapPriorityNormal ); switch ( priority->Id() ) { case EFSCalenMRPriorityLow: case EFSCalenTodoPriorityLow: { - iconID = KAknsIIDQgnFsIndiPriorityLow; + bitmapId = NMRBitmapManager::EMRBitmapPriorityLow; break; } case EFSCalenMRPriorityUnknown: case EFSCalenMRPriorityNormal: case EFSCalenTodoPriorityNormal: { - iconID = KAknsIIDQgnFsIndiPriorityNormal; + bitmapId = NMRBitmapManager::EMRBitmapPriorityNormal; break; } case EFSCalenMRPriorityHigh: // same value as EFSCalenTodoPriorityHigh { - iconID = KAknsIIDQgnFsIndiPriorityHigh; + bitmapId = NMRBitmapManager::EMRBitmapPriorityHigh; break; } default: ASSERT(EFalse); break; } - IconL( iconID ); - DrawDeferred ( ); - - // update titlepane priority icon - if ( iObserver ) - { - iObserver->UpdateTitlePanePriorityIconL( priority->Id() ); - } + + delete iIcon; + iIcon = NULL; + iIcon = CMRImage::NewL( bitmapId ); + iIcon->SetParent( this ); - // this is needed to call in order to get new - // icon drawn - CESMRIconField::SizeChanged(); - } - - -// --------------------------------------------------------------------------- -// CESMRPriorityField::UpdateTextL -// --------------------------------------------------------------------------- -// -void CESMRPriorityField::SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver ) - { - iObserver = aObserver; + // This needs to be called so icon will be redrawn + SizeChanged(); + DrawDeferred(); } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrecurencefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrecurencefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrecurencefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,23 +17,22 @@ #include "emailtrace.h" #include "cesmrrecurencefield.h" - -#include -#include -#include -#include -// -#include "esmrdef.h" -// -#include - #include "cesmrrecurrence.h" -#include "cesmrborderlayer.h" #include "mesmrlistobserver.h" #include "cesmrlistquery.h" #include "mesmrmeetingrequestentry.h" #include "mesmrfieldvalidator.h" #include "cesmrglobalnote.h" +#include "nmrlayoutmanager.h" +#include "cmrimage.h" +#include "cmrlabel.h" + +#include +#include +// +#include "esmrdef.h" +// + // Unnamed namespace for local definitions namespace { // codescanner::namespace @@ -69,13 +68,15 @@ // CESMRRecurrenceField::CESMRRecurrenceField // --------------------------------------------------------------------------- // -CESMRRecurenceField::CESMRRecurenceField( - MESMRFieldValidator* aValidator ) -: iValidator( aValidator), - iIndex( 0 ) +CESMRRecurenceField::CESMRRecurenceField( MESMRFieldValidator* aValidator ) + : iIndex( 0 ) { FUNC_LOG; - //do nothing + + iValidator = aValidator; + + SetFieldId ( EESMRFieldRecurrence ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -87,6 +88,8 @@ FUNC_LOG; iArray.ResetAndDestroy(); iArray.Close(); + + delete iFieldIcon; } // --------------------------------------------------------------------------- @@ -97,8 +100,8 @@ MESMRFieldValidator* aValidator ) { FUNC_LOG; - CESMRRecurenceField* self = - new (ELeave) CESMRRecurenceField( aValidator ); + CESMRRecurenceField* self = + new( ELeave )CESMRRecurenceField( aValidator ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -112,40 +115,21 @@ void CESMRRecurenceField::ConstructL( ) { FUNC_LOG; - _LIT(KEmptyText, "" ); - SetFieldId ( EESMRFieldRecurrence ); - iRecurence = new (ELeave) CEikLabel(); - iRecurence->SetTextL( KEmptyText ); - CESMRIconField::ConstructL ( - KAknsIIDQgnFscalIndiRecurrence, - iRecurence ); - } - -// --------------------------------------------------------------------------- -// CESMRRecurrenceField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRRecurenceField::InitializeL() - { - FUNC_LOG; - iRecurence->SetFont ( iLayout->Font( iCoeEnv, iFieldId ) ); - - iRecurence->SetLabelAlignment( - CESMRLayoutManager::IsMirrored() ? - ELayoutAlignRight : ELayoutAlignLeft ); - - AknLayoutUtils::OverrideControlColorL( - *iRecurence, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); + iRecurrence = CMRLabel::NewL(); + iRecurrence->SetParent( this ); + CESMRField::ConstructL( iRecurrence ); + + iRecurrence->SetTextL( KNullDesC() ); + + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapRecurrence ); + iFieldIcon->SetParent( this ); } // --------------------------------------------------------------------------- // CESMRRecurrenceField::InternalizeL // --------------------------------------------------------------------------- // -void CESMRRecurenceField::InternalizeL( - MESMRCalEntry& aEntry ) +void CESMRRecurenceField::InternalizeL( MESMRCalEntry& aEntry ) { FUNC_LOG; if ( aEntry.CanSetRecurrenceL() ) @@ -180,7 +164,7 @@ else { __ASSERT_DEBUG( iObserver, Panic( EESMRRecurenceFieldNoObserver ) ); - iObserver->RemoveControl ( iFieldId ); + iObserver->HideControl ( iFieldId ); } } @@ -204,14 +188,19 @@ // CESMRRecurenceField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRRecurenceField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRRecurenceField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if (aCommand == EESMRCmdOpenRecurrenceQuery || aCommand == EAknCmdOpen ) { ExecuteRecurrenceQueryL(); + isUsed = ETrue; + + HandleTactileFeedbackL(); } + return isUsed; } // --------------------------------------------------------------------------- @@ -221,7 +210,8 @@ void CESMRRecurenceField::ExecuteRecurrenceQueryL() { FUNC_LOG; - TInt ret = CESMRListQuery::ExecuteL(CESMRListQuery::EESMRRecurrenceQuery ); + TInt ret = CESMRListQuery::ExecuteL( + CESMRListQuery::EESMRRecurrenceQuery ); if ( ret != KErrCancel ) { @@ -229,7 +219,6 @@ } } - // --------------------------------------------------------------------------- // CESMRRecurrenceField::OfferKeyEventL // --------------------------------------------------------------------------- @@ -288,22 +277,22 @@ TRAPD( err, iValidator->RecurrenceChangedL( rec->RecurrenceValue() ) ); if ( err == KErrNone ) { - iRecurence->SetTextL ( rec->RecurrenceText() ); - iBorder->DrawDeferred ( ); + iRecurrence->SetTextL( rec->RecurrenceText() ); + iRecurrence->DrawDeferred(); iIndex = aIndex; if ( rec->RecurrenceValue() != ERecurrenceNot ) { // if recurrence is switched "on", the end date should be removed - iObserver->RemoveControl ( EESMRFieldStopDate ); - iObserver->InsertControl ( EESMRFieldRecurrenceDate ); + iObserver->HideControl ( EESMRFieldStopDate ); + iObserver->ShowControl ( EESMRFieldRecurrenceDate ); } else { // if recurrence is switched off, end date should be visible - iObserver->InsertControl ( EESMRFieldStopDate ); - iObserver->RemoveControl ( EESMRFieldRecurrenceDate ); + iObserver->ShowControl ( EESMRFieldStopDate ); + iObserver->HideControl ( EESMRFieldRecurrenceDate ); } } else @@ -314,5 +303,89 @@ } } +// --------------------------------------------------------------------------- +// CESMRRecurenceField::SizeChanged +// --------------------------------------------------------------------------- +// +void CESMRRecurenceField::SizeChanged() + { + FUNC_LOG; + TRect rect = Rect(); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + rect = rowLayoutRect.Rect(); + + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ); + AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + iRecurrence->SetRect( labelLayout.TextRect() ); + + // Setting font also for the field + iRecurrence->SetFont( labelLayout.Font() ); + } + +// --------------------------------------------------------------------------- +// CESMRRecurenceField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRRecurenceField::CountComponentControls( ) const + { + FUNC_LOG; + TInt count( 0 ); + if ( iFieldIcon ) + { + ++count; + } + if ( iRecurrence ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CESMRRecurenceField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRRecurenceField::ComponentControl( TInt aInd ) const + { + FUNC_LOG; + switch ( aInd ) + { + case 0: + return iFieldIcon; + case 1: + return iRecurrence; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CESMRRecurenceField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRRecurenceField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + CCoeControl::SetContainerWindowL( aContainer ); + iRecurrence->SetContainerWindowL( aContainer ); + + iRecurrence->SetParent( this ); + } + // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrepeatuntil.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrepeatuntil.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrepeatuntil.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,25 +15,22 @@ * */ -#include "emailtrace.h" + #include "cesmrrepeatuntil.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cesmrborderlayer.h" #include "mesmrfieldvalidator.h" #include "cesmrglobalnote.h" #include "esmrfieldbuilderdef.h" -#include "cesmrlayoutmgr.h" +#include "nmrlayoutmanager.h" +#include "nmrcolormanager.h" +#include "cmrlabel.h" +#include "nmrbitmapmanager.h" -using namespace ESMRLayout; +#include +#include +#include +#include + +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== @@ -41,12 +38,14 @@ // CESMRRepeatUntilField::CESMRRepeatUntilField // --------------------------------------------------------------------------- // -CESMRRepeatUntilField::CESMRRepeatUntilField( +CESMRRepeatUntilField::CESMRRepeatUntilField( MESMRFieldValidator* aValidator ) -: iValidator(aValidator) { FUNC_LOG; - //do nothing + + iValidator = aValidator; + SetFieldId( EESMRFieldRecurrenceDate ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -57,7 +56,7 @@ { FUNC_LOG; delete iLabel; - delete iFrameBgContext; + delete iBgCtrlContext; } // --------------------------------------------------------------------------- @@ -69,10 +68,10 @@ { FUNC_LOG; CESMRRepeatUntilField* self = - new (ELeave) CESMRRepeatUntilField( aValidator ); - CleanupStack::PushL ( self ); - self->ConstructL ( ); - CleanupStack::Pop ( self ); + new( ELeave )CESMRRepeatUntilField( aValidator ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); return self; } @@ -83,51 +82,65 @@ void CESMRRepeatUntilField::ConstructL( ) { FUNC_LOG; + SetComponentsToInheritVisibility( ETrue ); HBufC* label = StringLoader::LoadLC( R_QTN_MEET_REQ_REPEAT_UNTIL ); - SetFieldId ( EESMRFieldRecurrenceDate ); - iLabel = new (ELeave) CEikLabel(); - iLabel->SetTextL ( *label ); + + iLabel = CMRLabel::NewL(); + iLabel->SetParent( this ); + iLabel->SetTextL( *label ); CleanupStack::PopAndDestroy( label ); TTime startTime; - startTime.UniversalTime ( ); + startTime.UniversalTime(); - iDate = new (ELeave) CEikDateEditor; + iDate = new( ELeave )CEikDateEditor; + CESMRField::ConstructL( iDate ); //ownership transferred + iDate->ConstructL( KAknMinimumDate, TTIME_MAXIMUMDATE, startTime, EFalse ); + iDate->SetUpAndDownKeysConsumed ( EFalse ); - iBackground = AknsDrawUtils::ControlContext( this ); - CESMRField::ConstructL ( iDate ); - if ( iValidator ) { iValidator->SetRecurrenceUntilDateFieldL( *iDate ); } + + TRect tempRect( 0, 0, 0, 0 ); + + // Setting background instead of theme skin + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); + + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + tempRect, + EFalse ); + + iDate->SetSkinBackgroundControlContextL( iBgCtrlContext ); } // --------------------------------------------------------------------------- -// CESMRRepeatUntilField::InitializeL +// CESMRRepeatUntilField::MinimumSize // --------------------------------------------------------------------------- // -void CESMRRepeatUntilField::InitializeL() +TSize CESMRRepeatUntilField::MinimumSize() { - FUNC_LOG; - iLabel->SetFont( iLayout->Font( iCoeEnv, iFieldId ) ); - iLabel->SetLabelAlignment( CESMRLayoutManager::IsMirrored ( ) - ? ELayoutAlignRight : ELayoutAlignLeft ); - AknLayoutUtils::OverrideControlColorL( - *iLabel, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); - - iDate->SetFont( iLayout->Font( iCoeEnv, iFieldId ) ); - iDate->SetMfneAlignment( CESMRLayoutManager::IsMirrored ( ) - ? EAknEditorAlignRight : EAknEditorAlignLeft ); - iDate->SetSkinTextColorL( iLayout->NormalTextColorID() ); + TRect parentRect( Parent()->Rect() ); + + TRect richTextRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); + + // Add title area to the required size + TSize titleSize( CESMRField::MinimumSize() ); + + TSize completeFieldSize( titleSize ); + completeFieldSize.iHeight += richTextRect.Height(); + + return completeFieldSize; } // --------------------------------------------------------------------------- @@ -144,7 +157,7 @@ CESMRGlobalNote::ExecuteL( CESMRGlobalNote::EESMRRepeatEndEarlierThanItStart ); } - return (KErrNone == err); + return( KErrNone == err ); } // --------------------------------------------------------------------------- @@ -154,13 +167,16 @@ TInt CESMRRepeatUntilField::CountComponentControls( ) const { FUNC_LOG; - TInt count = CESMRField::CountComponentControls(); - - if ( iLabel ) + TInt count( 0 ); + if( iLabel ) { ++count; } - + if( iDate ) + { + ++count; + } + return count; } @@ -171,112 +187,62 @@ CCoeControl* CESMRRepeatUntilField::ComponentControl( TInt aInd ) const { FUNC_LOG; - if ( aInd == 0 ) + + switch ( aInd ) { - return iLabel; + case 0: + return iLabel; + case 1: + return iDate; + default: + return NULL; } - - return CESMRField::ComponentControl ( aInd ); } // --------------------------------------------------------------------------- // CESMRRepeatUntilField::SizeChanged // --------------------------------------------------------------------------- // -void CESMRRepeatUntilField::SizeChanged( ) +void CESMRRepeatUntilField::SizeChanged() { FUNC_LOG; - TRect rect = Rect(); - TPoint titlePos; - TSize titleSize; - - if ( CESMRLayoutManager::IsMirrored ( ) ) - { - titleSize = TSize( rect.Width()- ( KIconSize.iWidth + KIconBorderMargin ), - iLayout->FieldSize( EESMRFieldAlarmDate ).iHeight ); - - TPoint titlePos( rect.iBr.iX - KIconSize.iWidth - titleSize.iWidth, - rect.iTl.iY); - iLabel->SetExtent ( titlePos, titleSize ); - - TSize dateSize( rect.Width()- ( KIconSize.iWidth + KIconBorderMargin ), - rect.Height() - titleSize.iHeight ); - TPoint datePos(rect.iBr.iX - KIconSize.iWidth - dateSize.iWidth, - rect.iTl.iY + titleSize.iHeight); - iBorder->SetExtent ( datePos, dateSize ); - } - else + TRect rect( Rect() ); + + // Layouting label + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + // Layout label to first row's rect + TAknTextComponentLayout titleLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutText ); + AknLayoutUtils::LayoutLabel( iLabel, rect, titleLayout ); + + // Move upper left corner below first line and get second row's rect. + rect.iTl.iY += rowRect.Height(); + rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 ); + rowRect = rowLayoutRect.Rect(); + + // Layouting date editor + if( iDate ) { - // title - titlePos = TPoint( rect.iTl.iX + KIconSize.iWidth + KIconBorderMargin, - rect.iTl.iY); - titleSize = TSize ( - rect.Width() - KIconSize.iWidth - KIconBorderMargin, - iLayout->FieldSize( EESMRFieldAlarmDate ).iHeight ); - - iLabel->SetExtent ( titlePos, titleSize ); - - // Current implemenattion does not need the ID here - CESMRLayoutManager::TMarginsId nullID = CESMRLayoutManager::EFieldMargins; - TInt topMargin = iLayout->Margins( nullID ).iTop; - - TPoint datePosition = TPoint ( - rect.iTl.iX + KIconSize.iWidth + KIconBorderMargin, - rect.iTl.iY + iLabel->Size().iHeight + topMargin ); - - TSize dateSize = TSize ( - rect.Width() - KIconSize.iWidth - KIconBorderMargin, - iLayout->FieldSize( EESMRFieldAlarmDate ).iHeight ); - - iBorder->SetPosition( datePosition ); - iBorder->SetSize( dateSize ); - - TInt h = iLabel->Size().iHeight + iDate->Size().iHeight; - - if( iFrameBgContext ) - { - iFrameBgContext->SetFrameRects( iDate->Rect(), iDate->Rect() ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRRepeatUntilField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRRepeatUntilField::ActivateL() - { - FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect(TPoint(iDate->Position()), iDate->Size()); - TRect inner(rect); - TRect outer(rect); - - iDate->SetSize( TSize( iDate->Size().iWidth, - iLayout->FieldSize( FieldId() ).iHeight )); - - iDate->SetBorder( TGulBorder::ENone ); - - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL( - KAknsIIDQsnFrInput, outer, inner, EFalse ) ; - - iFrameBgContext->SetParentContext( iBackground ); - iDate->SetSkinBackgroundControlContextL(iFrameBgContext); - } - -// --------------------------------------------------------------------------- -// CESMRRepeatUntilField::PositionChanged -// --------------------------------------------------------------------------- -// -void CESMRRepeatUntilField::PositionChanged() - { - FUNC_LOG; - CCoeControl::PositionChanged(); - if( iFrameBgContext ) - { - iFrameBgContext->SetFrameRects( iDate->Rect(), iDate->Rect() ); + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rowRect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknTextComponentLayout editorLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutDateEditor ); + AknLayoutUtils::LayoutMfne( iDate, rect, editorLayout ); + + NMRColorManager::SetColor( *iDate, + NMRColorManager::EMRMainAreaTextColor ); } } @@ -295,6 +261,12 @@ { TInt fieldIndex( iDate->CurrentField() ); response = CESMRField::OfferKeyEventL( aEvent, aType ); + + if ( aEvent.iScanCode != EStdKeyUpArrow && + aEvent.iScanCode != EStdKeyDownArrow ) + { + iDate->DrawDeferred(); + } } return response; @@ -323,7 +295,7 @@ } // --------------------------------------------------------------------------- -// CESMRTimeField::SetOutlineFocusL +// CESMRRepeatUntilField::SetOutlineFocusL // --------------------------------------------------------------------------- // void CESMRRepeatUntilField::SetOutlineFocusL( TBool aFocus ) @@ -336,5 +308,94 @@ } } +// --------------------------------------------------------------------------- +// CESMRRepeatUntilField::SetValidatorL +// --------------------------------------------------------------------------- +// +void CESMRRepeatUntilField::SetValidatorL( MESMRFieldValidator* aValidator ) + { + FUNC_LOG; + + CESMRField::SetValidatorL( aValidator ); + + if ( iValidator ) + { + iValidator->SetRecurrenceUntilDateFieldL( *iDate ); + } + } + +// --------------------------------------------------------------------------- +// CESMRRepeatUntilField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRRepeatUntilField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if ( EMRCmdDoEnvironmentChange == aCommand ) + { + // Locale has been changed + DoEnvChangeL(); + retValue = ETrue; + } + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRRepeatUntilField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRRepeatUntilField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + iContainerWindow = &aContainer; + + CCoeControl::SetContainerWindowL( aContainer ); + iDate->SetContainerWindowL( aContainer ); + iLabel->SetContainerWindowL( aContainer ); + + iDate->SetParent( this ); + iLabel->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRRepeatUntilField::DoEnvChangeL +// --------------------------------------------------------------------------- +// +void CESMRRepeatUntilField::DoEnvChangeL() + { + FUNC_LOG; + + CEikDateEditor* date = new( ELeave )CEikDateEditor; + CleanupStack::PushL( date ); + + date->ConstructL( + TTIME_MINIMUMDATE, + TTIME_MAXIMUMDATE, + iDate->Date(), + EFalse ); + date->SetUpAndDownKeysConsumed( EFalse ); + + UpdateExtControlL( date ); + + CleanupStack::Pop( date ); + iDate = date; + + if ( iValidator ) + { + iValidator->SetRecurrenceUntilDateFieldL( *iDate ); + } + + iDate->SetSkinBackgroundControlContextL( iBgCtrlContext ); + SetContainerWindowL( *iContainerWindow ); + + iDate->ActivateL(); + SizeChanged(); + DrawDeferred(); + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsingletimefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsingletimefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsingletimefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,20 +15,19 @@ * */ - -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include - #include "cesmrsingletimefield.h" #include "mesmrfieldvalidator.h" #include "cesmrglobalnote.h" #include "esmrfieldbuilderdef.h" -#include +#include "cmrimage.h" +#include "nmrlayoutmanager.h" +#include "nmrcolormanager.h" +#include "nmrbitmapmanager.h" + +#include +#include + +#include "emailtrace.h" namespace{ // codescanner::namespace #define KMinimumTime (TTime(0)) // codescanner::baddefines @@ -38,41 +37,45 @@ #define KMaximumTime (TTime(KDayInMicroSeconds)) // codescanner::baddefines } +// ======== MEMBER FUNCTIONS ======== + // --------------------------------------------------------------------------- // CESMRSingleTimeField::CESMRSingleTimeField // --------------------------------------------------------------------------- // -CESMRSingleTimeField::CESMRSingleTimeField( - MESMRFieldValidator* aValidator ) : - iValidator( aValidator ) +CESMRSingleTimeField::CESMRSingleTimeField( MESMRFieldValidator* aValidator ) { FUNC_LOG; - //do nothing + + iValidator = aValidator; + SetFieldId ( EESMRFieldAlarmTime ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- // CESMRSingleTimeField::~CESMRSingleTimeField // --------------------------------------------------------------------------- // -CESMRSingleTimeField::~CESMRSingleTimeField( ) +CESMRSingleTimeField::~CESMRSingleTimeField() { FUNC_LOG; - delete iFrameBgContext; + delete iFieldIcon; + delete iBgCtrlContext; } // --------------------------------------------------------------------------- // CESMRSingleTimeField::NewL // --------------------------------------------------------------------------- // -CESMRSingleTimeField* CESMRSingleTimeField::NewL( +CESMRSingleTimeField* CESMRSingleTimeField::NewL( MESMRFieldValidator* aValidator ) { FUNC_LOG; CESMRSingleTimeField* self = - new (ELeave) CESMRSingleTimeField( aValidator ); - CleanupStack::PushL ( self ); - self->ConstructL ( ); - CleanupStack::Pop ( self ); + new( ELeave )CESMRSingleTimeField( aValidator ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); return self; } @@ -83,44 +86,43 @@ void CESMRSingleTimeField::ConstructL( ) { FUNC_LOG; - SetFieldId ( EESMRFieldAlarmTime ); - + + SetComponentsToInheritVisibility( ETrue ); + TTime startTime; startTime.HomeTime(); - iTime = new (ELeave) CEikTimeEditor(); + iTime = new( ELeave )CEikTimeEditor(); + + CESMRField::ConstructL( iTime ); //ownership transferred + iTime->ConstructL( KMinimumTime, KMaximumTime, startTime, EEikTimeWithoutSecondsField ); iTime->SetUpAndDownKeysConsumed( EFalse ); - - iBackground = AknsDrawUtils::ControlContext( this ); - - CESMRIconField::ConstructL( - KAknsIIDQgnFscalIndiAlarmTime, - iTime ); - - if ( iValidator ) + + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarmClock ); + iFieldIcon->SetParent( this ); + + if( iValidator ) { iValidator->SetAlarmTimeFieldL( *iTime ); } - } + + TRect tempRect( 0, 0, 0, 0 ); + + // Setting background instead of theme skin + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); -// --------------------------------------------------------------------------- -// CESMRSingleTimeField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRSingleTimeField::InitializeL() - { - FUNC_LOG; - iTime->SetFont ( iLayout->Font (iCoeEnv, iFieldId ) ); - iTime->SetMfneAlignment ( CESMRLayoutManager::IsMirrored ( ) ? EAknEditorAlignRight - : EAknEditorAlignLeft ); - - iTime->SetBorder( TGulBorder::ENone ); - iTime->SetSkinTextColorL( iLayout->NormalTextColorID ( ) ); + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + tempRect, + EFalse ); + + iTime->SetSkinBackgroundControlContextL( iBgCtrlContext ); } // --------------------------------------------------------------------------- @@ -131,14 +133,14 @@ TESMREntryFieldId /*aNextItem*/ ) { FUNC_LOG; - TInt err(KErrNone ); - if ( iValidator ) + TInt err( KErrNone ); + if( iValidator ) { TRAP( err, iValidator->AlarmTimeChangedL() ); } - if ( err != KErrNone ) + if( err != KErrNone ) { - CESMRGlobalNote::ExecuteL ( + CESMRGlobalNote::ExecuteL( CESMRGlobalNote::EESMRCalenLaterDate ); return EFalse; } @@ -149,16 +151,16 @@ // CESMRSingleTimeField::OfferKeyEventL // --------------------------------------------------------------------------- // -TKeyResponse CESMRSingleTimeField::OfferKeyEventL(const TKeyEvent& aEvent, +TKeyResponse CESMRSingleTimeField::OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ) { FUNC_LOG; - TKeyResponse response( EKeyWasNotConsumed); + TKeyResponse response( EKeyWasNotConsumed ); if ( aType == EEventKey ) { TInt fieldIndex( iTime->CurrentField() ); - switch ( aEvent.iScanCode ) + switch( aEvent.iScanCode ) { // make sure these events are NOT consumed case EStdKeyUpArrow: @@ -167,6 +169,7 @@ default: response = iTime->OfferKeyEventL ( aEvent, aType ); + iTime->DrawDeferred(); break; } @@ -176,42 +179,6 @@ } // --------------------------------------------------------------------------- -// CESMRSingleTimeField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRSingleTimeField::ActivateL() - { - FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect(TPoint(iTime->Position()), iTime->Size()); - TRect inner(rect); - TRect outer(rect); - - iTime->SetSize(iLayout->FieldSize( FieldId() )); - - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL( KAknsIIDQsnFrInput, outer, inner, EFalse ) ; - - iFrameBgContext->SetParentContext( iBackground ); - iTime->SetSkinBackgroundControlContextL(iFrameBgContext); - } - -// --------------------------------------------------------------------------- -// CESMRSingleTimeField::PositionChanged -// --------------------------------------------------------------------------- -// -void CESMRSingleTimeField::PositionChanged() - { - FUNC_LOG; - CCoeControl::PositionChanged(); - if( iFrameBgContext ) - { - iFrameBgContext->SetFrameRects( iTime->Rect(), iTime->Rect() ); - } - } - -// --------------------------------------------------------------------------- // CESMRSingleTimeField::CheckIfValidatingNeededL // --------------------------------------------------------------------------- // @@ -222,12 +189,12 @@ TInt err( KErrNone ); TInt fieldIndex( iTime->CurrentField() ); - if ( fieldIndex != aStartFieldIndex ) + if( fieldIndex != aStartFieldIndex ) { TRAP( err, iValidator->AlarmTimeChangedL() ); } - if ( err != KErrNone ) + if( err != KErrNone ) { CESMRGlobalNote::ExecuteL ( CESMRGlobalNote::EESMRCalenLaterDate ); @@ -240,12 +207,183 @@ void CESMRSingleTimeField::SetOutlineFocusL( TBool aFocus ) { FUNC_LOG; - CESMRField::SetOutlineFocusL ( aFocus ); - if ( aFocus ) + CESMRField::SetOutlineFocusL( aFocus ); + + if( aFocus ) + { + ChangeMiddleSoftKeyL( EESMRCmdSaveMR, R_QTN_MSK_SAVE ); + } + } + +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::SetValidatorL +// --------------------------------------------------------------------------- +// +void CESMRSingleTimeField::SetValidatorL( MESMRFieldValidator* aValidator ) + { + FUNC_LOG; + + CESMRField::SetValidatorL( aValidator ); + + if ( iValidator ) + { + iValidator->SetAlarmTimeFieldL( *iTime ); + } + } + +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::SizeChanged() +// --------------------------------------------------------------------------- +// +TBool CESMRSingleTimeField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if ( EMRCmdDoEnvironmentChange == aCommand ) + { + // Locale has been changed + DoEnvChangeL(); + retValue = ETrue; + } + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::SizeChanged() +// --------------------------------------------------------------------------- +// +void CESMRSingleTimeField::SizeChanged() + { + TRect rect( Rect() ); + + // Layouting field icon + if( iFieldIcon ) + { + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutDateEditorIcon ); + AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); + } + + // Layouting time editor + if( iTime ) { - ChangeMiddleSoftKeyL(EESMRCmdSaveMR,R_QTN_MSK_SAVE); + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknTextComponentLayout editorLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutDateEditor ); + AknLayoutUtils::LayoutMfne( iTime, rect, editorLayout ); + + NMRColorManager::SetColor( *iTime, + NMRColorManager::EMRMainAreaTextColor ); + + } + } + +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::CountComponentControls() +// --------------------------------------------------------------------------- +// +TInt CESMRSingleTimeField::CountComponentControls() const + { + TInt count( 0 ); + if( iFieldIcon ) + { + ++count; + } + + if( iTime ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::ComponentControl() +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRSingleTimeField::ComponentControl( TInt aIndex ) const + { + switch( aIndex ) + { + case 0: + return iFieldIcon; + case 1: + return iTime; + default: + return NULL; } } +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRSingleTimeField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + iContainerWindow = &aContainer; + + CCoeControl::SetContainerWindowL( *iContainerWindow ); + + iFieldIcon->SetContainerWindowL( *iContainerWindow ); + iTime->SetContainerWindowL( *iContainerWindow ); + + iFieldIcon->SetParent( this ); + iTime->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRSingleTimeField::DoEnvChangeL +// --------------------------------------------------------------------------- +// +void CESMRSingleTimeField::DoEnvChangeL() + { + FUNC_LOG; + + CEikTimeEditor* time = new( ELeave )CEikTimeEditor; + CleanupStack::PushL( time ); + + TTime startTime; + startTime.HomeTime(); + + time->ConstructL( + KMinimumTime, + KMaximumTime, + startTime, + EEikTimeWithoutSecondsField ); + + time->SetUpAndDownKeysConsumed( EFalse ); + + UpdateExtControlL( time ); + + CleanupStack::Pop( time ); + iTime = time; + + iTime->SetSkinBackgroundControlContextL( iBgCtrlContext ); + SetContainerWindowL( *iContainerWindow ); + + if ( iValidator ) + { + iValidator->SetAlarmTimeFieldL( *iTime ); + } + + iTime->ActivateL(); + + SizeChanged(); + DrawDeferred(); + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsubjectfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsubjectfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsubjectfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,23 +15,25 @@ * */ -#include "emailtrace.h" #include "cesmrsubjectfield.h" - -#include -#include -#include -#include -#include -#include -#include -#include "esmrfieldbuilderdef.h" - -#include - +#include "cmrimage.h" +#include "nmrlayoutmanager.h" #include "cesmreditor.h" #include "mesmrtitlepaneobserver.h" #include "cesmrglobalnote.h" +#include "esmrfieldbuilderdef.h" +#include "nmrcolormanager.h" +#include "nmrbitmapmanager.h" +#include "mesmrlistobserver.h" + +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== @@ -39,11 +41,10 @@ // CESMRSubjectField::CESMRSubjectField // --------------------------------------------------------------------------- // -CESMRSubjectField::CESMRSubjectField( ) -: CESMRIconField() +CESMRSubjectField::CESMRSubjectField() { FUNC_LOG; - //do nothing + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -53,7 +54,9 @@ CESMRSubjectField::~CESMRSubjectField( ) { FUNC_LOG; - delete iFrameBgContext; + delete iFieldIcon; + delete iBgControlContext; + delete iPriorityIcon; } // --------------------------------------------------------------------------- @@ -61,24 +64,41 @@ // --------------------------------------------------------------------------- // void CESMRSubjectField::ConstructL( TESMREntryFieldId aId, TInt aTextId, - TAknsItemID aIconID ) + NMRBitmapManager::TMRBitmapId aIconID ) { FUNC_LOG; - SetFieldId ( aId ); - SetExpandable ( ); + SetFieldId( aId ); + iFieldIcon = CMRImage::NewL( aIconID ); + iFieldIcon->SetParent( this ); + iSubject = CESMREditor::NewL ( this, 1, KMaxTextLength, CEikEdwin::EResizable | CEikEdwin::EAvkonEditor | EAknEditorFlagNoLRNavigation); iSubject->SetEdwinSizeObserver ( this ); iSubject->SetEdwinObserver( this ); + iSubject->SetParent( this ); + + CESMRField::ConstructL( iSubject ); // iSubject ownership transfered HBufC* buf = StringLoader::LoadLC ( aTextId ); iSubject->SetDefaultTextL( buf ); // ownership transferred CleanupStack::Pop( buf ); + + // Setting background instead of theme skin + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( + NMRBitmapManager::EMRBitmapInputCenter ); - iBackground = AknsDrawUtils::ControlContext( this ); - - CESMRIconField::ConstructL ( aIconID, iSubject ); + TRect initialisationRect( 0, 0, 0, 0 ); + iBgControlContext = + CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + initialisationRect, + EFalse ); + + iSubject->SetSkinBackgroundControlContextL( iBgControlContext ); + + iCurrentPriority = EFSCalenMRPriorityNormal; } // --------------------------------------------------------------------------- @@ -88,32 +108,60 @@ CESMRSubjectField* CESMRSubjectField::NewL( TFieldType aType ) { FUNC_LOG; - CESMRSubjectField* self = new (ELeave) CESMRSubjectField; + CESMRSubjectField* self = new( ELeave )CESMRSubjectField; CleanupStack::PushL ( self ); if ( aType == ETypeSubject ) { - self->ConstructL (EESMRFieldSubject, + self->ConstructL( EESMRFieldSubject, R_QTN_MEET_REQ_SUBJECT_FIELD, - KAknsIIDQgnFscalIndiSubject ); + NMRBitmapManager::EMRBitmapSubject ); } else { - self->ConstructL (EESMRFieldOccasion, + self->ConstructL( EESMRFieldOccasion, R_QTN_CALENDAR_ANNIVERSARY_TYPE_OCCASION, - KAknsIIDQgnFscalIndiOccasion ); + NMRBitmapManager::EMRBitmapOccasion ); } - CleanupStack::Pop ( self ); + CleanupStack::Pop( self ); return self; } // --------------------------------------------------------------------------- +// CESMRSubjectField::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CESMRSubjectField::MinimumSize() + { + TRect parentRect( Parent()->Rect() ); + + TRect fieldRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); + + TRect editorRect( NMRLayoutManager::GetLayoutText( + fieldRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + if( iPriorityIcon ) + { + editorRect = NMRLayoutManager::GetLayoutText( + fieldRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ).TextRect(); + } + + // Adjust field size so that there's room for expandable editor. + fieldRect.Resize( 0, iSize.iHeight - editorRect.Height() ); + + return fieldRect.Size(); + } + +// --------------------------------------------------------------------------- // CESMRSubjectField::InitializeL // --------------------------------------------------------------------------- // void CESMRSubjectField::InitializeL() { FUNC_LOG; - iSubject->SetFontL( iLayout->Font( iCoeEnv, iFieldId ), iLayout ); + // Do nothing } // --------------------------------------------------------------------------- @@ -136,10 +184,16 @@ iTitlePaneObserver->UpdateTitlePaneTextL( *subject ); } } + + if( entry.PriorityL() != EFSCalenMRPriorityNormal && + entry.EntryTypeL() == CCalEntry::EAppt ) + { + SetPriorityIconL( entry.PriorityL() ); + } // this is needed to be re-called here, otherwise the CEikEdwin // does not get correctly instantiated with default text - iSubject->FocusChanged(EDrawNow); + iSubject->FocusChanged( EDrawNow ); CleanupStack::PopAndDestroy ( subject ); } @@ -152,7 +206,9 @@ { FUNC_LOG; HBufC* subject = iSubject->GetTextInHBufL ( ); - + + CCalEntry& entry = aEntry.Entry(); + if ( subject ) { CleanupStack::PushL ( subject ); @@ -160,20 +216,19 @@ // externalize the text only if it differs from the // default text. In other words, default text is not // externalized. - - if ( iSubject->DefaultText().Compare (*subject )!= 0 ) + if ( iSubject->DefaultText().Compare (*subject )!= 0 ) { - CCalEntry& entry = aEntry.Entry ( ); - entry.SetSummaryL ( *subject ); + entry.SetSummaryL( *subject ); } - CleanupStack::PopAndDestroy ( subject ); + CleanupStack::PopAndDestroy( subject ); } else { - CCalEntry& entry = aEntry.Entry ( ); entry.SetSummaryL( KNullDesC ); } + + entry.SetPriorityL( iCurrentPriority ); } // --------------------------------------------------------------------------- @@ -185,27 +240,9 @@ FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); - if (aFocus) //Focus is gained on the field + if ( aFocus ) //Focus is gained on the field { - ChangeMiddleSoftKeyL(EESMRCmdSaveMR,R_QTN_MSK_SAVE); - } - } - -// --------------------------------------------------------------------------- -// CESMRSubjectField::ExpandedHeight -// --------------------------------------------------------------------------- -// -TInt CESMRSubjectField::ExpandedHeight( ) const - { - FUNC_LOG; - TInt height = iLayout->FieldSize( FieldId() ).iHeight; - if( iSize.iHeight < height ) - { - return height - KEditorDifference; - } - else - { - return iSize.iHeight; + ChangeMiddleSoftKeyL( EESMRCmdSaveMR,R_QTN_MSK_SAVE ); } } @@ -213,31 +250,32 @@ // CESMRSubjectField::HandleEdwinSizeEventL // --------------------------------------------------------------------------- // -TBool CESMRSubjectField::HandleEdwinSizeEventL(CEikEdwin* /*aEdwin*/, +TBool CESMRSubjectField::HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent /*aType*/, TSize aSize ) { FUNC_LOG; - iSize = aSize; - iSize.iHeight -= KEditorDifference; - - if (iLayout->CurrentFontZoom() == EAknUiZoomSmall || - iLayout->CurrentFontZoom() == EAknUiZoomVerySmall) - { - iSize.iHeight -= KEditorDifference; - } - - if ( iObserver ) + TBool reDraw( EFalse ); + + if( iSize != aSize ) { - iObserver->ControlSizeChanged ( this ); + // Let's save the required size for the iSubject + iSize = aSize; + + if ( iObserver && aEdwin == iSubject ) + { + iObserver->ControlSizeChanged( this ); + reDraw = ETrue; + } + + if( iSubject->LineCount() != iLineCount ) + { + // Line count has changed, the whole component needs + // to be redrawn + DrawDeferred(); + iLineCount = iSubject->LineCount(); + } } - - if( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iSubject->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } - - return ETrue; + return reDraw; } // --------------------------------------------------------------------------- @@ -260,9 +298,9 @@ TInt textLength( text->Length() ); if ( iSubject->GetLimitLength() <= textLength ) - { - NotifyEventAsyncL( EESMRCmdSizeExceeded ); - } + { + NotifyEventAsyncL( EESMRCmdSizeExceeded ); + } CleanupStack::PopAndDestroy( text ); } @@ -284,54 +322,14 @@ } // --------------------------------------------------------------------------- -// CESMRSubjectField::PositionChanged() +// CESMRSubjectField::GetCursorLineVerticalPos // --------------------------------------------------------------------------- // -void CESMRSubjectField::PositionChanged() +void CESMRSubjectField::GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower) { - FUNC_LOG; - CCoeControl::PositionChanged(); - if( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iSubject->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } - } - -// --------------------------------------------------------------------------- -// CESMRSubjectField::GetVerticalFocusPosition -// --------------------------------------------------------------------------- -// -void CESMRSubjectField::GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower) - { - FUNC_LOG; aLower = iSubject->CurrentLineNumber() * iSubject->RowHeight(); aUpper = aLower - iSubject->RowHeight(); } -// --------------------------------------------------------------------------- -// CESMRSubjectField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRSubjectField::ActivateL() - { - FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect(TPoint(iSubject->Position()), iSubject->Size()); - TRect inner(rect); - TRect outer(rect); - - iSubject->SetSize( TSize( iSubject->Size().iWidth, iLayout->FieldSize( FieldId() ).iHeight )); - - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL( KAknsIIDQsnFrInput, outer, inner, EFalse ) ; - - iFrameBgContext->SetParentContext( iBackground ); - iSubject->SetSkinBackgroundControlContextL(iFrameBgContext); - - // update base class rects and redraw: - SizeChanged(); - } // --------------------------------------------------------------------------- // CESMRSubjectField::ListObserverSet @@ -347,35 +345,264 @@ // CESMRSubjectField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRSubjectField::ExecuteGenericCommandL( - TInt aCommand ) - { +TBool CESMRSubjectField::ExecuteGenericCommandL( + TInt aCommand ) + { FUNC_LOG; - if ( EESMRCmdSizeExceeded == aCommand ) - { - CESMRGlobalNote::ExecuteL ( - CESMRGlobalNote::EESMRCannotDisplayMuchMore ); + TBool isUsed( EFalse ); + switch ( aCommand ) + { + case EESMRCmdPriorityHigh: + { + SetPriorityIconL( EFSCalenMRPriorityHigh ); + isUsed = ETrue; + break; + } + case EESMRCmdPriorityNormal: + { + SetPriorityIconL( EFSCalenMRPriorityNormal ); + isUsed = ETrue; + break; + } + case EESMRCmdPriorityLow: + { + SetPriorityIconL( EFSCalenMRPriorityLow ); + isUsed = ETrue; + break; + } + + case EESMRCmdSizeExceeded: + { + CESMRGlobalNote::ExecuteL ( + CESMRGlobalNote::EESMRCannotDisplayMuchMore ); + + HBufC* text = iSubject->GetTextInHBufL(); + CleanupDeletePushL( text ); + if ( text ) + { + TInt curPos = iSubject->CursorPos(); + if( curPos > iSubject->GetLimitLength() - 1 ) + curPos = iSubject->GetLimitLength() - 1; + HBufC* newText = + text->Des().Mid( 0, iSubject->GetLimitLength() - 1 ).AllocLC(); + + iSubject->SetTextL ( newText ); + CleanupStack::PopAndDestroy( newText ); + newText = NULL; + + iSubject->SetCursorPosL (curPos, EFalse ); + iSubject->HandleTextChangedL(); + iSubject->UpdateScrollBarsL(); + SetFocus(ETrue); + } + CleanupStack::PopAndDestroy( text ); + isUsed = ETrue; + break; + } + default: + { + break; + } + } + return isUsed; + } + +// --------------------------------------------------------------------------- +// CESMRSubjectField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRSubjectField::CountComponentControls() const + { + TInt count( 0 ); + if ( iFieldIcon ) + { + ++count; + } + + if ( iSubject ) + { + ++count; + } + + if ( iPriorityIcon ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CESMRSubjectField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRSubjectField::ComponentControl( + TInt aIndex ) const + { + switch ( aIndex ) + { + case 0: + return iFieldIcon; + case 1: + return iSubject; + case 2: + return iPriorityIcon; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CESMRSubjectField::SizeChanged +// --------------------------------------------------------------------------- +// +void CESMRSubjectField::SizeChanged( ) + { + TRect rect( Rect() ); - HBufC* text = iSubject->GetTextInHBufL(); - CleanupDeletePushL( text ); - if ( text ) - { - TInt curPos = iSubject->CursorPos(); - if( curPos > iSubject->GetLimitLength() - 1 ) - curPos = iSubject->GetLimitLength() - 1; - HBufC* newText = - text->Des().Mid( 0, iSubject->GetLimitLength() - 1 ).AllocLC(); - - iSubject->SetTextL ( newText ); - CleanupStack::PopAndDestroy( newText ); - newText = NULL; - - iSubject->SetCursorPosL (curPos, EFalse ); - iSubject->HandleTextChangedL(); - iSubject->UpdateScrollBarsL(); - SetFocus(ETrue); - } - CleanupStack::PopAndDestroy( text ); - } - } + TAknLayoutRect rowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect rowRect( rowLayoutRect.Rect() ); + + // Layouting field icon + if( iFieldIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowAColumnGraphic ) ); + AknLayoutUtils::LayoutControl( iFieldIcon, rowRect, iconLayout ); + } + + // Layouting priority icon + if( iPriorityIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iPriorityIcon, rowRect, iconLayout ); + } + + TAknLayoutText editorLayoutText; + + if( iPriorityIcon ) + { + editorLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + editorLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + // Layouting editor field + TRect editorRect( editorLayoutText.TextRect() ); + + // Resize height according to actual height required by edwin. + editorRect.Resize( 0, iSize.iHeight - editorRect.Height() ); + iSubject->SetRect( editorRect ); + + // Try setting font. Failures are ignored. + TRAP_IGNORE( iSubject->SetFontL( editorLayoutText.Font() ) ); + + // Layouting focus + TRect bgRect( TPoint( editorRect.iTl.iX, editorRect.iTl.iY ), + editorRect.Size() ); + + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + } + +// --------------------------------------------------------------------------- +// CESMRSubjectField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRSubjectField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + CCoeControl::SetContainerWindowL( aContainer ); + iSubject->SetContainerWindowL( aContainer ); + + iSubject->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRSubjectField::OfferKeyEventL() +// --------------------------------------------------------------------------- +// +TKeyResponse CESMRSubjectField::OfferKeyEventL( + const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TKeyResponse response( EKeyWasNotConsumed); + response = iSubject->OfferKeyEventL ( aEvent, aType ); + + if ( aType == EEventKey && + ( aEvent.iScanCode != EStdKeyUpArrow && + aEvent.iScanCode != EStdKeyDownArrow )) + { + iSubject->DrawDeferred(); + } + return response; + } + +// --------------------------------------------------------------------------- +// CESMRSubjectField::SetPriorityIconL +// --------------------------------------------------------------------------- +// +void CESMRSubjectField::SetPriorityIconL( TUint aPriority ) + { + switch ( aPriority ) + { + case EFSCalenMRPriorityHigh: + { + delete iPriorityIcon; + iPriorityIcon = NULL; + + iPriorityIcon = CMRImage::NewL( + NMRBitmapManager::EMRBitmapPriorityHigh, ETrue ); + iPriorityIcon->SetParent( this ); + if( iCurrentPriority == EFSCalenMRPriorityNormal ) + { + SizeChanged(); + } + iCurrentPriority = EFSCalenMRPriorityHigh; + break; + } + + case EFSCalenMRPriorityNormal: + { + delete iPriorityIcon; + iPriorityIcon = NULL; + if( iCurrentPriority != EFSCalenMRPriorityNormal ) + { + SizeChanged(); + } + iCurrentPriority = EFSCalenMRPriorityNormal; + break; + } + + case EFSCalenMRPriorityLow: + { + delete iPriorityIcon; + iPriorityIcon = NULL; + + iPriorityIcon = CMRImage::NewL( + NMRBitmapManager::EMRBitmapPriorityLow ); + iPriorityIcon->SetParent( this ); + if( iCurrentPriority == EFSCalenMRPriorityNormal ) + { + SizeChanged(); + } + iCurrentPriority = EFSCalenMRPriorityLow; + break; + } + default: + { + break; + } + } + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsync.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsync.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsync.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,7 +19,7 @@ #include "cesmrsync.h" #include -#include +#include // ======== MEMBER FUNCTIONS ======== diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsyncfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsyncfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsyncfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,55 +15,58 @@ * */ -#include "emailtrace.h" #include "cesmrsyncfield.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "cesmrtextitem.h" +#include "cesmrlistquery.h" +#include "nmrlayoutmanager.h" -#include #include -#include +#include #include #include -#include -#include - -#include "cesmrsync.h" -#include "cesmrlistquery.h" +#include #include +// DEBUG +#include "emailtrace.h" // Unnamed namespace for local definitions and functions -namespace{ // codescanner::namespace - -CCalEntry::TReplicationStatus MapToReplicationStatus( - TESMRSyncValue aSyncValue ) - { - CCalEntry::TReplicationStatus ret; - switch ( aSyncValue ) +namespace // codescanner::namespace + { + CCalEntry::TReplicationStatus MapToReplicationStatus( + TESMRSyncValue aSyncValue ) { - case ESyncNone: + CCalEntry::TReplicationStatus ret; + switch ( aSyncValue ) { - ret = CCalEntry::ERestricted; - break; + case ESyncNone: + { + ret = CCalEntry::ERestricted; + break; + } + case ESyncPrivate: + { + ret = CCalEntry::EPrivate; + break; + } + case ESyncPublic: + { + ret = CCalEntry::EOpen; + break; + } + default: + { + ret = CCalEntry::ERestricted; + } } - case ESyncPrivate: - { - ret = CCalEntry::EPrivate; - break; - } - case ESyncPublic: - { - ret = CCalEntry::EOpen; - break; - } - default: - { - ret = CCalEntry::ERestricted; - } + + return ret; } - return ret; - } - -} // namespace + // Field's component count, icon and label + const TInt KComponentCount( 2 ); + } // namespace // ======== MEMBER FUNCTIONS ======== @@ -90,21 +93,8 @@ FUNC_LOG; iArray.ResetAndDestroy ( ); iArray.Close ( ); - } - -// --------------------------------------------------------------------------- -// CESMRSyncField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRSyncField::InitializeL() - { - FUNC_LOG; - iSync->SetFont( iLayout->Font( iCoeEnv, iFieldId ) ); - iSync->SetLabelAlignment( CESMRLayoutManager::IsMirrored() - ? ELayoutAlignRight : ELayoutAlignLeft ); - AknLayoutUtils::OverrideControlColorL(*iSync, - EColorLabelText, - iLayout->GeneralListAreaTextColor() ); + + delete iIcon; } // --------------------------------------------------------------------------- @@ -125,12 +115,12 @@ TInt count = reader.ReadInt16 ( ); for (TInt i(0); i < count; i++ ) { - CESMRSync* sync = new (ELeave) CESMRSync(); + CESMRTextItem* sync = new (ELeave) CESMRTextItem(); CleanupStack::PushL( sync ); sync->ConstructFromResourceL ( reader ); iArray.AppendL ( sync ); CleanupStack::Pop( sync ); - if ( synchValue == MapToReplicationStatus ( sync->Id ( ) ) ) + if ( synchValue == MapToReplicationStatus ( static_cast( sync->Id ( ) ) ) ) { iIndex = i; iSync->SetTextL ( sync->TextL ( ) ); @@ -150,7 +140,7 @@ if ( iIndex < iArray.Count() ) { CCalEntry::TReplicationStatus - repStatus = MapToReplicationStatus ( iArray[iIndex]->Id ( ) ); + repStatus = MapToReplicationStatus ( static_cast( iArray[iIndex]->Id ( ) ) ); aEntry.Entry().SetReplicationStatusL (repStatus ); } else @@ -179,14 +169,19 @@ // CESMRPriorityField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRSyncField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRSyncField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if(aCommand == EESMRCmdOpenSyncQuery || aCommand == EAknCmdOpen ) { ExecuteSyncQueryL(); + isUsed = ETrue; + + HandleTactileFeedbackL(); } + return isUsed; } // --------------------------------------------------------------------------- @@ -255,7 +250,8 @@ iIndex(0) { FUNC_LOG; - //do nothing + SetFieldId( EESMRFieldSync ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -265,19 +261,16 @@ void CESMRSyncField::ConstructL( ) { FUNC_LOG; - SetFieldId( EESMRFieldSync ); - - iSync = new (ELeave) CEikLabel; - iSync->SetTextL( KNullDesC ); + iSync = CMRLabel::NewL(); + CESMRField::ConstructL( iSync ); + iSync->SetTextL( KNullDesC() ); TGulAlignment align; align.SetHAlignment( EHLeft ); align.SetVAlignment( EVCenter ); iSync->SetAlignment( align ); - CESMRIconField::ConstructL( - KAknsIIDQgnFscalIndiSynchronisation, - iSync ); + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapSynchronization ); } // --------------------------------------------------------------------------- @@ -287,10 +280,73 @@ void CESMRSyncField::UpdateLabelL( TInt aIndex ) { FUNC_LOG; - CESMRSync* sync = iArray[ aIndex ]; + CESMRTextItem* sync = iArray[ aIndex ]; iSync->SetTextL( sync->TextL() ); iSync->DrawDeferred(); } +// --------------------------------------------------------------------------- +// CESMRSyncField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRSyncField::CountComponentControls() const + { + return KComponentCount; + } + +// --------------------------------------------------------------------------- +// CESMRSyncField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRSyncField::ComponentControl( TInt aIndex ) const + { + CCoeControl* control = NULL; + switch( aIndex ) + { + case 0: + { + control = iSync; + break; + } + case 1: + { + control = iIcon; + break; + } + default: + ASSERT( EFalse ); + } + + return control; + } + +// --------------------------------------------------------------------------- +// CESMRSyncField::SizeChanged +// --------------------------------------------------------------------------- +// +void CESMRSyncField::SizeChanged() + { + TRect rect( Rect() ); + TAknLayoutRect iconLayout = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorIcon ); + TRect iconRect( iconLayout.Rect() ); + iIcon->SetRect( iconRect ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknTextComponentLayout editorLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutTextEditor ); + + AknLayoutUtils::LayoutLabel( iSync, rect, editorLayout ); + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrtextitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrtextitem.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR text item implementation, used to map text resource to id + * +*/ + +#include "emailtrace.h" +#include "cesmrtextitem.h" + +#include +#include + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// ESMRTextItem::CESMRTextItem +// --------------------------------------------------------------------------- +// +CESMRTextItem::CESMRTextItem( ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTextItem::~CESMRTextItem +// --------------------------------------------------------------------------- +// +CESMRTextItem::~CESMRTextItem( ) + { + FUNC_LOG; + delete iText; + } + +// --------------------------------------------------------------------------- +// CESMRTextItem::ConstructFromResourceL +// --------------------------------------------------------------------------- +// +void CESMRTextItem::ConstructFromResourceL( TResourceReader& aReader ) + { + FUNC_LOG; + iId = aReader.ReadInt16 ( ); + TInt textId = aReader.ReadInt32 ( ); + iText = StringLoader::LoadL ( textId ); + } + +// --------------------------------------------------------------------------- +// CESMRTextItem::TextL +// --------------------------------------------------------------------------- +// +TDesC& CESMRTextItem::TextL( ) + { + FUNC_LOG; + return *iText; + } + +// --------------------------------------------------------------------------- +// CESMRTextItem::Id +// --------------------------------------------------------------------------- +// +TInt CESMRTextItem::Id( ) + { + FUNC_LOG; + return iId; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrtimefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrtimefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrtimefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,22 +15,21 @@ * */ -#include "emailtrace.h" #include "cesmrtimefield.h" - -#include -#include -#include -#include -#include -#include - -#include "mesmrfieldvalidator.h" -#include "cesmrglobalnote.h" +#include "cmrtimecontainer.h" // #include "esmrdef.h" // -#include "esmrfieldbuilderdef.h" +#include "cmrimage.h" +#include "nmrlayoutmanager.h" + +// DEBUG +#include "emailtrace.h" + +namespace // codescanner::namespace + { + const TInt KFieldComponentCount( 2 ); + } // unnamed namespace // ======== MEMBER FUNCTIONS ======== @@ -41,7 +40,8 @@ CESMRTimeField::CESMRTimeField( ) { FUNC_LOG; - // do nothing + SetFieldId ( EESMRFieldMeetingTime ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -52,7 +52,7 @@ { FUNC_LOG; // iContainer is deleted by framework - // do nothing + delete iFieldIcon; } // --------------------------------------------------------------------------- @@ -78,16 +78,17 @@ MESMRFieldValidator* aValidator ) { FUNC_LOG; - SetFieldId ( EESMRFieldMeetingTime ); + CCoeControl::SetComponentsToInheritVisibility( ETrue ); iContainer = - CTimeContainer::NewL( + CMRTimeContainer::NewL( aValidator, this, EESMRFieldMeetingTime ); + // This is taking ownership + CESMRField::ConstructL( iContainer ); - CESMRIconField::ConstructL( - KAknsIIDQgnMeetReqIndiClock, - iContainer ); + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapClock ); + iFieldIcon->SetParent( this ); } // --------------------------------------------------------------------------- @@ -102,6 +103,12 @@ if ( iContainer ) { iContainer->SetContainerWindowL ( aControl ); + iContainer->SetParent( this ); + } + if ( iFieldIcon ) + { + iFieldIcon->SetContainerWindowL( aControl ); + iFieldIcon->SetParent( this ); } } @@ -123,19 +130,6 @@ } // --------------------------------------------------------------------------- -// CESMRTimeField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRTimeField::InitializeL() - { - FUNC_LOG; - if ( iContainer ) - { - iContainer->SetFontL( iLayout->Font ( iCoeEnv, iFieldId ), iLayout ); - } - } - -// --------------------------------------------------------------------------- // CESMRTimeField::OkToLoseFocusL // --------------------------------------------------------------------------- // @@ -165,584 +159,95 @@ } // --------------------------------------------------------------------------- -// CTimeContainer::CTimeContainer -// --------------------------------------------------------------------------- -// -CTimeContainer::CTimeContainer( - MESMRFieldValidator* aValidator, - TESMREntryFieldId aFieldId ) : - iValidator(aValidator), - iFieldId( aFieldId ) - { - FUNC_LOG; - // do nothing - } - -// --------------------------------------------------------------------------- -// CTimeContainer::~CTimeContainer +// CESMRTimeField::SetValidatorL // --------------------------------------------------------------------------- // -CTimeContainer::~CTimeContainer( ) - { - FUNC_LOG; - delete iStartTime; - delete iEndTime; - delete iSeparator; - delete iStartTimeBgContext; - delete iEndTimeBgContext; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::NewL -// --------------------------------------------------------------------------- -// -CTimeContainer* CTimeContainer::NewL( - MESMRFieldValidator* aValidator, - CCoeControl* aParent, - TESMREntryFieldId aFieldId ) +void CESMRTimeField::SetValidatorL( MESMRFieldValidator* aValidator ) { FUNC_LOG; - CTimeContainer* self = - new (ELeave) CTimeContainer( aValidator, aFieldId ); - CleanupStack::PushL ( self ); - self->ConstructL ( aParent ); - CleanupStack::Pop ( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::ConstructL -// --------------------------------------------------------------------------- -// -void CTimeContainer::ConstructL( - CCoeControl* /*aParent*/) - { - FUNC_LOG; - TTime startTime; - startTime.UniversalTime ( ); - - iStartTime = new (ELeave) CEikTimeEditor; - iEndTime = new (ELeave) CEikTimeEditor; - iSeparator = new (ELeave) CEikLabel; - - iStartTime->ConstructL ( TTIME_TIMEFIELDMINIMUMDATE, - TTIME_TIMEFIELDMAXIMUMDATE, - startTime, - EEikTimeWithoutSecondsField ); + + // Update iValidator member + CESMRField::SetValidatorL( aValidator ); - iEndTime->ConstructL ( TTIME_TIMEFIELDMINIMUMDATE, - TTIME_TIMEFIELDMAXIMUMDATE, - startTime, - EEikTimeWithoutSecondsField ); - - iBackground = AknsDrawUtils::ControlContext( this ); - - TInt align = CESMRLayoutManager::IsMirrored ( ) ? EAknEditorAlignRight - : EAknEditorAlignLeft; - iStartTime->SetMfneAlignment ( align ); - iEndTime->SetMfneAlignment ( align ); - - iSeparator->SetTextL ( KTimeFieldSeparator ); - - if ( iValidator ) + if ( iContainer ) { - iValidator->SetStartTimeFieldL( *iStartTime ); - iValidator->SetEndTimeFieldL( *iEndTime ); + iContainer->SetValidatorL( iValidator ); } } // --------------------------------------------------------------------------- -// CTimeContainer::SetContainerWindowL +// CESMRTimeField::SizeChanged() // --------------------------------------------------------------------------- // -void CTimeContainer::SetContainerWindowL( - const CCoeControl& aControl ) +TBool CESMRTimeField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; - CCoeControl::SetContainerWindowL ( aControl ); - iStartTime->SetContainerWindowL ( aControl ); - iEndTime->SetContainerWindowL ( aControl ); + + TBool retValue( EFalse ); + + if ( iContainer && EMRCmdDoEnvironmentChange == aCommand ) + { + iContainer->EnvironmentChangedL(); + SizeChanged(); + DrawDeferred(); + + retValue = ETrue; + } + + return retValue; } // --------------------------------------------------------------------------- -// CTimeContainer::CountComponentControls +// CESMRTimeField::SizeChanged() // --------------------------------------------------------------------------- // -TInt CTimeContainer::CountComponentControls() const +void CESMRTimeField::SizeChanged() { - FUNC_LOG; - TInt count( 0); - - if ( iStartTime ) - { - ++count; - } + TRect rect( Rect() ); + TAknLayoutRect iconLayout = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTimeEditorIcon ); + TRect iconRect( iconLayout.Rect() ); + iFieldIcon->SetRect( iconRect ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + iContainer->SetRect( rect ); + iContainer->SetBgRect( bgRect ); + } - if ( iSeparator ) - { - ++count; - } - - if ( iEndTime ) - { - ++count; - } - +// --------------------------------------------------------------------------- +// CESMRTimeField::CountComponentControls() +// --------------------------------------------------------------------------- +// +TInt CESMRTimeField::CountComponentControls() const + { + TInt count( KFieldComponentCount ); return count; } // --------------------------------------------------------------------------- -// CTimeContainer::ComponentControl +// CESMRTimeField::ComponentControl() // --------------------------------------------------------------------------- // -CCoeControl* CTimeContainer::ComponentControl( - TInt aInd ) const +CCoeControl* CESMRTimeField::ComponentControl( TInt aIndex ) const { - FUNC_LOG; - switch ( aInd ) + switch ( aIndex ) { case 0: - return iStartTime; + return iFieldIcon; case 1: - return iSeparator; - case 2: - return iEndTime; + return iContainer; default: return NULL; } } - -// --------------------------------------------------------------------------- -// CTimeContainer::PositionChanged() -// --------------------------------------------------------------------------- -// -void CTimeContainer::PositionChanged() - { - FUNC_LOG; - CCoeControl::PositionChanged(); - if( iStartTimeBgContext ) - { - iStartTimeBgContext->SetFrameRects( - iStartTime->Rect(), - iStartTime->Rect() ); - } - - if( iEndTimeBgContext ) - { - iEndTimeBgContext->SetFrameRects( - iEndTime->Rect(), - iEndTime->Rect() ); - } - } - -// --------------------------------------------------------------------------- -// CTimeContainer::SizeChanged -// --------------------------------------------------------------------------- -// -void CTimeContainer::SizeChanged() - { - FUNC_LOG; - TInt x = CESMRLayoutManager::IsMirrored ( ) ? Rect().iBr.iX : Rect().iTl.iX; - TPoint p( x, Rect().iTl.iY); - - TSize editorSize; - TSize separatorSize; - - editorSize = iStartTime->MinimumSize(); - editorSize.iHeight = Rect().Height(); - - separatorSize = iSeparator->MinimumSize(); - separatorSize.iHeight = Rect().Height(); - - iStartTime->SetBorder( TGulBorder::ENone ); - iEndTime->SetBorder( TGulBorder::ENone ); - - if ( CESMRLayoutManager::IsMirrored ( ) ) - { - p.iX -= editorSize.iWidth; - iStartTime->SetExtent ( p, editorSize ); - - p.iX -= separatorSize.iWidth; - iSeparator->SetExtent ( p, separatorSize ); - - p.iX -= editorSize.iWidth; - iEndTime->SetExtent ( p, editorSize ); - } - else - { - iStartTime->SetExtent ( p, editorSize ); - p.iX += editorSize.iWidth; - - iSeparator->SetExtent ( p, separatorSize ); - p.iX += separatorSize.iWidth; - - iEndTime->SetExtent ( p, editorSize ); - } - } - -// --------------------------------------------------------------------------- -// CTimeContainer::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CTimeContainer::OfferKeyEventL( - const TKeyEvent& aEvent, - TEventCode aType ) - { - FUNC_LOG; - TBool startFocusedBefore( iStartTime->IsFocused() ); - TInt startIndex( iStartTime->CurrentField() ); - - TBool endFocusedBefore( iEndTime->IsFocused() ); - TInt endIndex( iEndTime->CurrentField() ); - - TKeyResponse response = EKeyWasNotConsumed; - if ( aType == EEventKey ) - { - switch ( aEvent.iScanCode ) - { - case EStdKeyLeftArrow: - response = ChangeFocusLeftL( aEvent, aType ); - break; - - case EStdKeyRightArrow: - response = ChangeFocusRightL( aEvent, aType ); - break; - - default: // other events than left/right arrows - { - response = FocusedEditor()->OfferKeyEventL( aEvent, aType ); - } - break; - } - } - - if ( EKeyWasConsumed == response ) - { - CheckIfValidatingNeededL( - startFocusedBefore, - startIndex, - endFocusedBefore, - endIndex ); - } - - return response; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::FocusChanged -// --------------------------------------------------------------------------- -// -void CTimeContainer::FocusChanged( - TDrawNow /*aDrawNow*/) - { - FUNC_LOG; - if ( IsFocused ( ) ) // if focus is gained - { - iStartTime->SetFocus ( ETrue ); - } - else - { - if ( iStartTime->IsFocused() ) - { - iStartTime->SetFocus( EFalse, EDrawNow ); - } - - if ( iEndTime->IsFocused() ) - { - iEndTime->SetFocus( EFalse, EDrawNow ); - } - } - } - -// --------------------------------------------------------------------------- -// CTimeContainer::SetFont -// --------------------------------------------------------------------------- -// -void CTimeContainer::SetFontL( - const CFont* aFont, - CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - iLayout = aLayout; - - iStartTime->SetFont ( aFont ); - iSeparator->SetFont ( aFont ); - iEndTime->SetFont ( aFont ); - - iStartTime->SetSkinTextColorL( aLayout->NormalTextColorID() ); - iEndTime->SetSkinTextColorL( aLayout->NormalTextColorID() ); - - AknLayoutUtils::OverrideControlColorL ( *iSeparator, EColorLabelText, - aLayout->NormalTextColor() ); - } - -// --------------------------------------------------------------------------- -// CTimeContainer::FocusedEditor -// --------------------------------------------------------------------------- -// -CEikTimeEditor* CTimeContainer::FocusedEditor( ) - { - FUNC_LOG; - return iStartTime->IsFocused ( ) ? iStartTime : iEndTime; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::OkToLoseFocusL -// --------------------------------------------------------------------------- -// -TBool CTimeContainer::OkToLoseFocusL( - TESMREntryFieldId /*aFrom*/, - TESMREntryFieldId /*aTo*/ ) - { - FUNC_LOG; - // validate the current time - FocusedEditor()->PrepareForFocusLossL(); - - if ( iStartTime->IsFocused() ) - { - TriggerStartTimeChangedL(); - } - else - { - TriggerEndTimeChangedL(); - } - - return ETrue; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::ActivateL -// --------------------------------------------------------------------------- -// -void CTimeContainer::ActivateL() - { - FUNC_LOG; - CCoeControl::ActivateL(); - TRect rect(TPoint(iStartTime->Position()), iStartTime->Size()); - TRect inner(rect); - TRect outer(rect); - - delete iStartTimeBgContext; - delete iEndTimeBgContext; - iStartTimeBgContext = NULL; - iEndTimeBgContext = NULL; - - iStartTimeBgContext = - CAknsFrameBackgroundControlContext::NewL( - KAknsIIDQsnFrInput, - outer, - inner, - EFalse ) ; - - rect.SetRect( iEndTime->Position(), iEndTime->Size()); - inner = rect; - iEndTimeBgContext = - CAknsFrameBackgroundControlContext::NewL( - KAknsIIDQsnFrInput, - outer, - inner, - EFalse ) ; - - iStartTimeBgContext->SetParentContext( iBackground ); - iEndTimeBgContext->SetParentContext( iBackground ); - iStartTime->SetSkinBackgroundControlContextL(iStartTimeBgContext); - iEndTime->SetSkinBackgroundControlContextL(iEndTimeBgContext); - } - -// --------------------------------------------------------------------------- -// CTimeContainer::ChangeFocusRightL -// --------------------------------------------------------------------------- -// -TKeyResponse CTimeContainer::ChangeFocusRightL(const TKeyEvent& aEvent, - TEventCode aType ) - { - FUNC_LOG; - TKeyResponse response = EKeyWasNotConsumed; - - if ( iStartTime->IsFocused ( ) ) - { - // if the focus is in the last field of start time, move focus - // to end times first field. - TInt current = iStartTime->CurrentField(); - TInt count = iStartTime->NumFields(); - if ( current == (count - 1) ) - { - iStartTime->SetFocus( EFalse, EDrawNow ); - iEndTime->SetFocus( ETrue, EDrawNow ); - response = EKeyWasConsumed; - } - else - { - response = iStartTime->OfferKeyEventL ( aEvent, aType ); - } - TriggerStartTimeChangedL(); - } - - else if ( iEndTime->IsFocused ( ) ) - { - if ( iEndTime->CurrentField() == (iEndTime->NumFields() - 1) ) - { - iEndTime->SetFocus ( EFalse, EDrawNow ); - iStartTime->SetFocus ( ETrue, EDrawNow ); - response = EKeyWasConsumed; - } - else - { - response = iEndTime->OfferKeyEventL ( aEvent, aType ); - } - TriggerEndTimeChangedL(); - } - return response; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::ChangeFocusLeftL -// --------------------------------------------------------------------------- -// -TKeyResponse CTimeContainer::ChangeFocusLeftL( - const TKeyEvent& aEvent, - TEventCode aType ) - { - FUNC_LOG; - TKeyResponse response = EKeyWasNotConsumed; - if ( iStartTime->IsFocused ( ) ) - { - // if the focus is in the first field of start time, move focus - // to end times last field. - if ( iStartTime->CurrentField ( )== 0 ) - { - iStartTime->SetFocus ( EFalse, EDrawNow ); - iEndTime->SetFocus ( ETrue, EDrawNow ); - // last item should highlighted, API does not export the highlight - // function, so emulate key presses - response = iEndTime->OfferKeyEventL ( aEvent, aType ); - } - else - { - response = iStartTime->OfferKeyEventL ( aEvent, aType ); - } - TriggerStartTimeChangedL(); - } - - else if ( iEndTime->IsFocused ( ) ) - { - if ( iEndTime->CurrentField ( )== 0 ) - { - iEndTime->SetFocus ( EFalse, EDrawNow ); - iStartTime->SetFocus ( ETrue, EDrawNow ); - // last item should highlighted, API does not export the highlight - // function, so emulate key presses - response = iStartTime->OfferKeyEventL ( aEvent, aType ); - } - else - { - response = iEndTime->OfferKeyEventL ( aEvent, aType ); - } - - TriggerEndTimeChangedL(); - } - return response; - } - -// --------------------------------------------------------------------------- -// CTimeContainer::CheckIfValidatingNeededL -// --------------------------------------------------------------------------- -// -void CTimeContainer::CheckIfValidatingNeededL( - TBool aStartFocusedBefore, - TInt aStartFieldIndex, - TBool aEndFocusedBefore, - TInt aEndFieldIndex ) - { - FUNC_LOG; - TBool startFocusedAfter( iStartTime->IsFocused() ); - TBool endFocusedAfter( iEndTime->IsFocused() ); - - if ( aStartFocusedBefore != startFocusedAfter ) - { - if ( startFocusedAfter ) - { - TriggerEndTimeChangedL(); - } - else - { - TriggerStartTimeChangedL(); - } - } - - else if ( startFocusedAfter && - aStartFocusedBefore == startFocusedAfter ) - { - TInt fieldIndex( iStartTime->CurrentField() ); - if ( fieldIndex != aStartFieldIndex ) - { - TriggerStartTimeChangedL(); - } - } - - else if ( endFocusedAfter && - aEndFocusedBefore == endFocusedAfter ) - { - TInt fieldIndex( iEndTime->CurrentField() ); - if ( fieldIndex != aEndFieldIndex ) - { - TriggerEndTimeChangedL(); - } - } - } - -// --------------------------------------------------------------------------- -// CTimeContainer::TriggerStartTimeChangedL -// --------------------------------------------------------------------------- -// -void CTimeContainer::TriggerStartTimeChangedL() - { - FUNC_LOG; - if ( iValidator ) - { - TRAPD( err, iValidator->StartTimeChangedL() ); - if ( err != KErrNone ) - { - switch ( err ) - { - case KErrOverflow: - CESMRGlobalNote::ExecuteL( - CESMRGlobalNote::EESMRRepeatReSchedule ); - break; - } - } - } - } - -// --------------------------------------------------------------------------- -// CTimeContainer::TriggerEndTimeChangedL -// --------------------------------------------------------------------------- -// -void CTimeContainer::TriggerEndTimeChangedL() - { - FUNC_LOG; - if ( iValidator ) - { - TRAPD( err, iValidator->EndTimeChangedL() ); - if ( err != KErrNone ) - { - switch ( err ) - { - case KErrArgument: - // Assuming that end date is different - // and this is repeating entry - CESMRGlobalNote::ExecuteL( - CESMRGlobalNote::EESMRRepeatDifferentStartAndEndDate ); - break; - case KErrOverflow: - CESMRGlobalNote::ExecuteL( - CESMRGlobalNote::EESMRRepeatReSchedule ); - break; - } - } - } - } - // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmdatefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmdatefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmdatefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,34 +19,48 @@ #include "cesmreditor.h" #include "mesmrlistobserver.h" -#include "nmrlayoutmanager.h" -#include "nmrbitmapmanager.h" +#include "mesmrmeetingrequestentry.h" +#include "mesmrcalentry.h" +#include "esmrfieldbuilderdef.h" +#include "cmrimage.h" #include "cmrlabel.h" -#include "cmrimage.h" -#include +#include "nmrlayoutmanager.h" +#include "cesmrglobalnote.h" -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include +#include +#include -// ======== LOCAL FUNCTIONS ======== -namespace // codescanner::namespace - { - const TInt KComponentCount( 2 ); // icon and label - const TInt KMaxTimeBuffer( 32 ); // buffer for date formatting - } // unnamed namespace +#include "emailtrace.h" + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- +// CESMRViewerAlarmDateField::CESMRViewerAlarmDateField() +// --------------------------------------------------------------------------- +// +CESMRViewerAlarmDateField::CESMRViewerAlarmDateField() + { + FUNC_LOG; + SetFieldId ( EESMRFieldAlarmDate ); + SetFocusType( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmDateField::~CESMRViewerAlarmDateField() +// --------------------------------------------------------------------------- +// +CESMRViewerAlarmDateField::~CESMRViewerAlarmDateField() + { + FUNC_LOG; + delete iIcon; + delete iLockIcon; + } + +// --------------------------------------------------------------------------- // CESMRViewerAlarmDateField::NewL() // --------------------------------------------------------------------------- // @@ -60,89 +74,37 @@ } // --------------------------------------------------------------------------- -// CESMRViewerAlarmDateField::~CESMRViewerAlarmDateField() -// --------------------------------------------------------------------------- -// -CESMRViewerAlarmDateField::~CESMRViewerAlarmDateField() - { - delete iLabel; - delete iIcon; - } - +// CESMRViewerAlarmDateField::ConstructL() // --------------------------------------------------------------------------- -// CESMRViewerAlarmDateField::CESMRViewerAlarmDateField() -// --------------------------------------------------------------------------- -// -CESMRViewerAlarmDateField::CESMRViewerAlarmDateField() - { - SetFieldId ( EESMRFieldAlarmDate ); - SetFocusType( EESMRHighlightFocus ); - } - -// ----------------------------------------------------------------------------- -// CESMRViewerAlarmDateField::ConstructL() -// ----------------------------------------------------------------------------- // void CESMRViewerAlarmDateField::ConstructL() { + FUNC_LOG; iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); - iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarmDate ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapDateStart ); iIcon->SetParent( this ); } // --------------------------------------------------------------------------- -// CESMRViewerAlarmDateField::InitializeL() -// --------------------------------------------------------------------------- -// -void CESMRViewerAlarmDateField::InitializeL() - { - // Setting Font for the rich text viewer - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), - NMRLayoutManager::EMRTextLayoutTextEditor ); - - iLabel->SetFont( text.Font() ); - - // This is called so theme changes will apply when changing theme "on the fly" - if ( IsFocused() ) - { - iLabel->FocusChanged( EDrawNow ); - } - - AknLayoutUtils::OverrideControlColorL( *iLabel, EColorLabelText, - KRgbBlack ); - } - - -// --------------------------------------------------------------------------- // CESMRViewerAlarmDateField::InternalizeL() // --------------------------------------------------------------------------- // void CESMRViewerAlarmDateField::InternalizeL( MESMRCalEntry& aEntry ) { MESMRCalEntry::TESMRAlarmType alarmType; - TTime alarmTime; - - aEntry.GetAlarmL( alarmType, alarmTime ); + aEntry.GetAlarmL( alarmType, iAlarmTime ); if( alarmType == MESMRCalEntry::EESMRAlarmAbsolute ) { - // Read format string from AVKON resource - HBufC* dateFormatString = iEikonEnv->AllocReadResourceLC( - R_QTN_DATE_USUAL_WITH_ZERO ); - TBuf buf; - - alarmTime.FormatL( buf, *dateFormatString ); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf ); - iLabel->SetTextL( buf ); - - CleanupStack::PopAndDestroy( dateFormatString ); + FormatAlarmTimeL(); } else // Remove the alarm fields { CCoeControl::MakeVisible(EFalse); - iObserver->RemoveControl(EESMRFieldAlarmDate); + iObserver->HideControl( EESMRFieldAlarmDate ); } } @@ -152,28 +114,48 @@ // void CESMRViewerAlarmDateField::SizeChanged() { + FUNC_LOG; TRect rect = Rect(); TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -182,7 +164,23 @@ // TInt CESMRViewerAlarmDateField::CountComponentControls() const { - TInt count( KComponentCount ); + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iLabel ) + { + ++count; + } + + if ( iLockIcon ) + { + ++count; + } + return count; } @@ -192,12 +190,15 @@ // CCoeControl* CESMRViewerAlarmDateField::ComponentControl( TInt aIndex ) const { + FUNC_LOG; switch ( aIndex ) { case 0: return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -209,15 +210,80 @@ // void CESMRViewerAlarmDateField::SetOutlineFocusL( TBool aFocus ) { + FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); + + iLabel->SetFocus( aFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmDateField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerAlarmDateField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; - iLabel->SetFocus( aFocus ); - - if ( !aFocus ) + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + if ( EMRCmdDoEnvironmentChange == aCommand ) { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); + FormatAlarmTimeL(); + retValue = ETrue; } + + return retValue; } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmDateField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerAlarmDateField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmDateField::FormatAlarmTimeL() +// --------------------------------------------------------------------------- +// +void CESMRViewerAlarmDateField::FormatAlarmTimeL() + { + FUNC_LOG; + + // Read format string from AVKON resource + HBufC* dateFormatString = iEikonEnv->AllocReadResourceLC( + R_QTN_DATE_USUAL_WITH_ZERO ); + HBufC* buf = HBufC::NewLC( KBufferLength ); + TPtr ptr( buf->Des() ); + + iAlarmTime.FormatL( ptr, *dateFormatString ); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); + iLabel->SetTextL( *buf ); + + CleanupStack::PopAndDestroy( 2, dateFormatString ); + } + + // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,12 +20,14 @@ #include "cmrlabel.h" #include "cmrimage.h" #include "nmrlayoutmanager.h" +#include "mesmrlistobserver.h" +#include "cesmrglobalnote.h" #include #include #include -#include -#include +#include +#include #include // DEBUG @@ -63,7 +65,7 @@ { FUNC_LOG; delete iIcon; - delete iLabel; + delete iLockIcon; } // --------------------------------------------------------------------------- @@ -74,6 +76,7 @@ { FUNC_LOG; SetFieldId ( EESMRFieldAlarm ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -85,10 +88,10 @@ FUNC_LOG; iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); - iIcon = CMRImage::NewL( KAknsIIDQgnMeetReqIndiAlarm ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarm ); iIcon->SetParent( this ); - - SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -100,7 +103,7 @@ FUNC_LOG; if ( aEntry.IsAllDayEventL() ) { - iObserver->RemoveControl( FieldId() ); + iObserver->HideControl( FieldId() ); } else { @@ -115,7 +118,7 @@ } else { - stringholder = StringLoader::LoadLC( + stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_ALARM_OFF , iEikonEnv ); iLabel->SetTextL( *stringholder ); CleanupStack::PopAndDestroy( stringholder ); @@ -129,27 +132,27 @@ if( minutes == KHourInMinutes ) { timeUnits = minutes / KHourInMinutes; - stringholder = StringLoader::LoadLC( + stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_ALARM_HOUR , timeUnits, iEikonEnv ); } // Alarm time is more than one hour and less than one day before else if( minutes > KHourInMinutes && minutes < KDayInMinutes ) { timeUnits = minutes / KHourInMinutes; - stringholder = StringLoader::LoadLC( + stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_ALARM_HOURS , timeUnits, iEikonEnv ); } - // Alarm is several days before // + // Alarm is several days before // else if( minutes >= KDayInMinutes ) { timeUnits = minutes / KDayInMinutes; - stringholder = StringLoader::LoadLC( + stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_ALARM_DAYS , timeUnits, iEikonEnv ); } - // Alarm is minutes before // + // Alarm is minutes before // else { - stringholder = StringLoader::LoadLC( + stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_ALARM_MINUTES , minutes, iEikonEnv ); } @@ -165,19 +168,17 @@ void CESMRViewerAlarmField::InitializeL() { FUNC_LOG; - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - + iLabel->SetFont( text.Font() ); // This is called so that theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iLabel->FocusChanged( EDrawNow ); } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); + // No implementation yet } // --------------------------------------------------------------------------- @@ -191,24 +192,43 @@ TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -228,6 +248,11 @@ { ++count; } + + if ( iLockIcon ) + { + ++count; + } return count; } @@ -244,6 +269,8 @@ return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -257,14 +284,50 @@ { FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); - - iLabel->SetFocus( aFocus ); - if ( !aFocus ) - { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } + iLabel->SetFocus( aFocus ); } +// --------------------------------------------------------------------------- +// CESMRViewerAlarmField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerAlarmField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerAlarmField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + return retValue; + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmtimefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmtimefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmtimefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,34 +16,22 @@ */ #include "cesmrvieweralarmtimefield.h" + #include "cesmreditor.h" #include "mesmrlistobserver.h" -#include "nmrbitmapmanager.h" -#include "nmrlayoutmanager.h" +#include "esmrfieldbuilderdef.h" +#include "cmrimage.h" #include "cmrlabel.h" -#include "cmrimage.h" +#include "nmrlayoutmanager.h" +#include "cesmrglobalnote.h" -#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include - -//unnamed namespace for local constants functions -namespace{ // codescanner::namespace - -const TInt KComponentCount( 2 ); // icon and label -const TInt KMaxTimeBuffer( 50 ); // buffer for time formatting - -}//namespace +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== @@ -51,13 +39,11 @@ // CESMRViewerAlarmTimeField::CESMRViewerAlarmTimeField() // --------------------------------------------------------------------------- // -CESMRViewerAlarmTimeField* CESMRViewerAlarmTimeField::NewL() +CESMRViewerAlarmTimeField::CESMRViewerAlarmTimeField() { - CESMRViewerAlarmTimeField* self = new (ELeave) CESMRViewerAlarmTimeField(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; + FUNC_LOG; + SetFieldId ( EESMRFieldAlarmTime ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -66,18 +52,23 @@ // CESMRViewerAlarmTimeField::~CESMRViewerAlarmTimeField() { + FUNC_LOG; delete iIcon; - delete iLabel; + delete iLockIcon; } // --------------------------------------------------------------------------- -// CESMRViewerAlarmTimeField::CESMRViewerAlarmTimeField() +// CESMRViewerAlarmTimeField::NewL // --------------------------------------------------------------------------- // -CESMRViewerAlarmTimeField::CESMRViewerAlarmTimeField() +CESMRViewerAlarmTimeField* CESMRViewerAlarmTimeField::NewL() { - SetFieldId ( EESMRFieldAlarmTime ); - SetFocusType( EESMRHighlightFocus ); + FUNC_LOG; + CESMRViewerAlarmTimeField* self = new (ELeave) CESMRViewerAlarmTimeField(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; } // --------------------------------------------------------------------------- @@ -86,31 +77,13 @@ // void CESMRViewerAlarmTimeField::ConstructL() { + FUNC_LOG; iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); - iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarmTime ); - iIcon->SetParent( this ); - } + CESMRField::ConstructL( iLabel ); // ownership transfered -// --------------------------------------------------------------------------- -// CESMRViewerAlarmTimeField::InitializeL() -// --------------------------------------------------------------------------- -// -void CESMRViewerAlarmTimeField::InitializeL() - { - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), - NMRLayoutManager::EMRTextLayoutTextEditor ); - - iLabel->SetFont( text.Font() ); - // This is called so that theme changes will apply when changing theme "on the fly" - if ( IsFocused() ) - { - iLabel->FocusChanged( EDrawNow ); - } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarmClock ); //TODO: Is this correct icon + iIcon->SetParent( this ); } // --------------------------------------------------------------------------- @@ -119,27 +92,18 @@ // void CESMRViewerAlarmTimeField::InternalizeL( MESMRCalEntry& aEntry ) { + FUNC_LOG; MESMRCalEntry::TESMRAlarmType alarmType; - TTime alarmTime; - - aEntry.GetAlarmL( alarmType, alarmTime ); + aEntry.GetAlarmL( alarmType, iAlarmTime ); if( alarmType == MESMRCalEntry::EESMRAlarmAbsolute ) { - // Read format string from AVKON resource - HBufC* dateFormatString = - iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO ); - TBuf buf; - - alarmTime.FormatL( buf, *dateFormatString ); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf ); - iLabel->SetTextL( buf ); - CleanupStack::PopAndDestroy( dateFormatString ); + FormatAlarmTimeL(); } else // Remove the alarm fields { CCoeControl::MakeVisible( EFalse ); - iObserver->RemoveControl( EESMRFieldAlarmTime ); + iObserver->HideControl( EESMRFieldAlarmTime ); } } @@ -149,28 +113,48 @@ // void CESMRViewerAlarmTimeField::SizeChanged() { + FUNC_LOG; TRect rect = Rect(); TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -179,7 +163,22 @@ // TInt CESMRViewerAlarmTimeField::CountComponentControls() const { - TInt count( KComponentCount ); + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iLabel ) + { + ++count; + } + + if ( iLockIcon ) + { + ++count; + } return count; } @@ -189,12 +188,15 @@ // CCoeControl* CESMRViewerAlarmTimeField::ComponentControl( TInt aIndex ) const { + FUNC_LOG; switch ( aIndex ) { case 0: return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -206,14 +208,78 @@ // void CESMRViewerAlarmTimeField::SetOutlineFocusL( TBool aFocus ) { + FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); - iLabel->SetFocus( aFocus ); + + iLabel->SetFocus( aFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmTimeField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerAlarmTimeField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + if ( EMRCmdDoEnvironmentChange == aCommand ) + { + FormatAlarmTimeL(); + retValue = ETrue; + } + + return retValue; + } - if ( !aFocus ) - { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } +// --------------------------------------------------------------------------- +// CESMRViewerAlarmTimeField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerAlarmTimeField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerAlarmTimeField::FormatAlarmTimeL +// --------------------------------------------------------------------------- +// +void CESMRViewerAlarmTimeField::FormatAlarmTimeL() + { + FUNC_LOG; + + // Read format string from AVKON resource + HBufC* dateFormatString = + iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO ); + HBufC* buf = HBufC::NewLC( KBufferLength ); + TPtr ptr( buf->Des() ); + + iAlarmTime.FormatL( ptr, *dateFormatString ); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); + iLabel->SetTextL( ptr ); + CleanupStack::PopAndDestroy( 2, dateFormatString ); } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,12 +22,13 @@ #include "nmrlayoutmanager.h" #include "cmrlabel.h" #include "cmrimage.h" +#include "cesmrglobalnote.h" #include #include #include -#include -#include +#include +#include #include #include "emailtrace.h" @@ -57,7 +58,7 @@ { FUNC_LOG; delete iIcon; - delete iLabel; + delete iLockIcon; } // --------------------------------------------------------------------------- @@ -68,6 +69,7 @@ { FUNC_LOG; SetFieldId( EESMRFieldAllDayEvent ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -79,10 +81,10 @@ FUNC_LOG; iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); - iIcon = CMRImage::NewL( KAknsIIDQgnMeetReqIndiCheckboxMark ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapCheckBoxOn ); iIcon->SetParent( this ); - - SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -112,19 +114,7 @@ // void CESMRViewerAllDayEventField::InitializeL() { - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), - NMRLayoutManager::EMRTextLayoutTextEditor ); - - iLabel->SetFont( text.Font() ); - // This is called so that theme changes will apply when changing theme "on the fly" - if ( IsFocused() ) - { - iLabel->FocusChanged( EDrawNow ); - } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); + // No implementation yet } // --------------------------------------------------------------------------- @@ -137,22 +127,39 @@ TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); } // --------------------------------------------------------------------------- @@ -171,6 +178,10 @@ { ++count; } + if ( iLockIcon ) + { + ++count; + } return count; } @@ -186,6 +197,8 @@ return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -198,14 +211,50 @@ void CESMRViewerAllDayEventField::SetOutlineFocusL( TBool aFocus ) { CESMRField::SetOutlineFocusL ( aFocus ); - - iLabel->SetFocus( aFocus ); - if ( !aFocus ) - { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } + iLabel->SetFocus( aFocus ); } +// --------------------------------------------------------------------------- +// CESMRViewerStartDateField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerAllDayEventField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerStartDateField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerAllDayEventField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + return retValue; + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -31,8 +31,8 @@ #include "cesmrurlparserplugin.h" // #include -#include -#include +#include +#include #include #include #include @@ -71,7 +71,7 @@ FUNC_LOG; delete iLocationPlugin; delete iFeatures; - delete iLocation; + delete iUrlParser; } // --------------------------------------------------------------------------- @@ -83,13 +83,16 @@ FUNC_LOG; TAknLayoutText layoutText = NMRLayoutManager::GetLayoutText( Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - iRichTextViewer->SetFontL ( layoutText.Font(), iLayout ); + iRichTextViewer->SetFontL( layoutText.Font() ); + iRichTextViewer->ApplyLayoutChangesL(); + if ( IsFocused() ) { iRichTextViewer->FocusChanged( EDrawNow ); } iRichTextViewer->HandleTextChangedL(); + iRichTextViewer->SetEventQueue( iEventQueue ); } // --------------------------------------------------------------------------- @@ -102,7 +105,7 @@ TPtrC text = aEntry.Entry().DescriptionL ( ); if( text.Length() == 0 ) { - iObserver->RemoveControl( FieldId() ); + iObserver->HideControl( FieldId() ); } else if ( FeaturesL().FeatureSupported( CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) @@ -111,6 +114,7 @@ } else { + TPtrC text = aEntry.Entry().DescriptionL(); iRichTextViewer->SetTextL( &text, ETrue ); iRichTextViewer->SetMargins( KMargin ); } @@ -127,30 +131,19 @@ FUNC_LOG; TKeyResponse response = EKeyWasNotConsumed; response = iRichTextViewer->OfferKeyEventL ( aEvent, aType ); - + //track up and down events to change MSK if ( aType == EEventKey ) { if ( aEvent.iCode == EKeyUpArrow || aEvent.iCode == EKeyDownArrow ) { - if ( FeaturesL().FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) - { - SetShowOnMapLinkMiddleSoftKeyL(); - } - else + if ( !iRichTextViewer->GetSelectedLink() ) { - if ( iRichTextViewer->GetSelectedLink() ) - { - SetMiddleSoftKeyVisible( ETrue ); - } - else - { - RestoreMiddleSoftKeyL(); - } + // Restore default middle softkey if field does not contain link + RestoreMiddleSoftKeyL(); } } - } + } return response; } @@ -162,6 +155,7 @@ { CESMRField::SetContainerWindowL( aContainer ); iRichTextViewer->SetContainerWindowL( aContainer ); + iRichTextViewer->SetParent( this ); } // --------------------------------------------------------------------------- @@ -179,7 +173,7 @@ NMRLayoutManager::GetFieldRowLayoutRect( fieldRect, 1 ).Rect(); TRect viewerRect = NMRLayoutManager::GetLayoutText( rowRect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ).TextRect(); - + fieldRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); fieldRect.SetWidth( Parent()->Rect().Width() ); return fieldRect.Size(); @@ -193,15 +187,36 @@ { TRect rect( Rect() ); rect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ).Rect(); - + TRect viewerRect = - NMRLayoutManager::GetLayoutText( - rect, + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ).TextRect(); - - iRichTextViewer->SetRect( - TRect( viewerRect.iTl, + + TRect bgRect( viewerRect.iTl, + TSize( viewerRect.Width(), iSize.iHeight ) ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + + // Setting Font for the rich text viewer + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + + // Failures are ignored. + TRAP_IGNORE( + // Try setting font + iRichTextViewer->SetFontL( text.Font() ); + // Try applying changes + iRichTextViewer->ApplyLayoutChangesL(); + ); + + iRichTextViewer->SetRect( + TRect( viewerRect.iTl, TSize( viewerRect.Width(), iSize.iHeight ) ) ); + + bgRect.SetHeight( iRichTextViewer->Rect().Height() ); + SetFocusRect( bgRect ); } // --------------------------------------------------------------------------- @@ -237,7 +252,7 @@ { FUNC_LOG; iSize = aSize; - + if ( iObserver && iDisableRedraw ) { iObserver->ControlSizeChanged ( this ); @@ -247,13 +262,35 @@ } // --------------------------------------------------------------------------- +// CESMRViewerDescriptionField::HandleRichTextLinkSelection +// --------------------------------------------------------------------------- +// +TBool CESMRViewerDescriptionField::HandleRichTextLinkSelection( + const CESMRRichTextLink* aLink ) + { + TBool result = EFalse; + if ( aLink && + aLink->Type() == CESMRRichTextLink::ETypeLocationUrl ) + { + TRAPD( error, ShowLocationOnMapL( *aLink ) ) + if ( error ) + { + iCoeEnv->HandleError( error ); + } + result = ETrue; + } + return result; + } + +// --------------------------------------------------------------------------- // CESMRViewerDescriptionField::CESMRViewerDescriptionField() // --------------------------------------------------------------------------- // CESMRViewerDescriptionField::CESMRViewerDescriptionField( ) { FUNC_LOG; - //do nothing + SetFieldId( EESMRFieldDescription ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -265,16 +302,16 @@ FUNC_LOG; iRichTextViewer = CESMRRichTextViewer::NewL( this ); iRichTextViewer->SetEdwinSizeObserver( this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transferred iRichTextViewer->SetParent( this ); - - SetFieldId( EESMRFieldDescription ); + iRichTextViewer->SetLinkObserver( this ); } // --------------------------------------------------------------------------- -// CESMRViewerDescriptionField::GetMinimumVisibleVerticalArea() +// CESMRViewerDescriptionField::GetCursorLineVerticalPos() // --------------------------------------------------------------------------- // -void CESMRViewerDescriptionField::GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower) +void CESMRViewerDescriptionField::GetCursorLineVerticalPos( TInt& aUpper, TInt& aLower ) { FUNC_LOG; aLower = iRichTextViewer->CurrentLineNumber() * iRichTextViewer->RowHeight(); @@ -295,33 +332,22 @@ // CESMRViewerDescriptionField::ExecuteGenericCommandL() // --------------------------------------------------------------------------- // -void CESMRViewerDescriptionField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRViewerDescriptionField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); switch ( aCommand ) { case EESMRCmdClipboardCopy: { iRichTextViewer->CopyCurrentLinkToClipBoardL(); - break; - } - case EESMRCmdShowOnMap: - { - if ( FeaturesL().FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) - { - const CESMRRichTextLink* link = - iRichTextViewer->GetSelectedLink(); - if ( link ) - { - LocationPluginL().ShowOnMapL( *iLocation, link->Value() ); - } - } + isUsed = ETrue; break; } case EAknSoftkeySelect: { iRichTextViewer->LinkSelectedL(); + isUsed = ETrue; break; } default: @@ -329,6 +355,7 @@ break; } } + return isUsed; } // --------------------------------------------------------------------------- @@ -339,9 +366,9 @@ { FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); - + iRichTextViewer->SetFocus( aFocus ); - + if ( FeaturesL().FeatureSupported( CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) { @@ -350,7 +377,7 @@ SetShowOnMapLinkMiddleSoftKeyL(); } } - + if ( !aFocus ) { //need to tell action menu that focus has changed @@ -359,20 +386,37 @@ } // --------------------------------------------------------------------------- +// CESMRDescriptionField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CESMRViewerDescriptionField::HandleLongtapEventL( + const TPoint& aPosition ) + { + FUNC_LOG; + + if ( iRichTextViewer->Rect().Contains( aPosition ) ) + { + if( iRichTextViewer->LinkSelectedL() ) + { + HandleTactileFeedbackL(); + } + + } + } + +// --------------------------------------------------------------------------- // CESMRViewerDescriptionField::AddShowOnMapLinkL // --------------------------------------------------------------------------- // void CESMRViewerDescriptionField::AddShowOnMapLinkL( MESMRCalEntry& aEntry ) { FUNC_LOG; - TInt command( EESMRCmdDisableWaypointIcon ); - CESMRUrlParserPlugin* urlParser = CESMRUrlParserPlugin::NewL(); - CleanupStack::PushL( urlParser ); + TPtrC urlPointer; TInt position; - position = urlParser->FindLocationUrl( aEntry.Entry().DescriptionL(), + position = UrlParserL().FindLocationUrl( aEntry.Entry().DescriptionL(), urlPointer ); - CleanupStack::PopAndDestroy( urlParser ); + // Location url is found and need to be replaced with show on map link if ( position >= KErrNone ) { @@ -387,24 +431,22 @@ descriptionPointer.Replace( position, urlPointer.Length(), *showOnMapBuf ); - CESMRRichTextLink* showOnMapLink = CESMRRichTextLink::NewL( position, - showOnMapBuf->Length(), + CESMRRichTextLink* showOnMapLink = CESMRRichTextLink::NewL( position, + showOnMapBuf->Length(), urlPointer, CESMRRichTextLink::ETypeLocationUrl, CESMRRichTextLink::ETriggerKeyOk ); CleanupStack::PushL( showOnMapLink ); iRichTextViewer->SetTextL( description, ETrue ); - iRichTextViewer->InsertLinkL( showOnMapLink, 0 ); - CleanupStack::Pop( showOnMapLink ); + iRichTextViewer->InsertLinkL( showOnMapLink, 0 ); + CleanupStack::Pop( showOnMapLink ); iRichTextViewer->HandleTextChangedL(); CleanupStack::PopAndDestroy( description ); CleanupStack::PopAndDestroy( showOnMapBuf ); - command = EESMRCmdEnableWaypointIcon; - - const TDesC& location = aEntry.Entry().LocationL(); - delete iLocation; - iLocation = NULL; - iLocation = location.AllocL(); + + StoreGeoValueL( + aEntry.Entry(), + urlPointer ); } // No location url found. Other description text is added to field. else @@ -412,9 +454,8 @@ TPtrC text = aEntry.Entry().DescriptionL(); iRichTextViewer->SetTextL( &text, ETrue ); } - + iRichTextViewer->SetMargins( KMargin ); - NotifyEventL( command ); } // --------------------------------------------------------------------------- @@ -435,7 +476,7 @@ { RestoreMiddleSoftKeyL(); } - + SetMiddleSoftKeyVisible( ETrue ); } else @@ -455,7 +496,7 @@ { iFeatures = CESMRFeatureSettings::NewL(); } - + return *iFeatures; } @@ -470,9 +511,65 @@ { iLocationPlugin = CESMRLocationPlugin::NewL(); } - + return *iLocationPlugin; } +// --------------------------------------------------------------------------- +// CESMRViewerDescriptionField::ShowLocationOnMapL +// --------------------------------------------------------------------------- +// +void CESMRViewerDescriptionField::ShowLocationOnMapL( + const CESMRRichTextLink& aLink ) + { + FUNC_LOG; + + if ( FeaturesL().FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + LocationPluginL().ShowOnMapL( aLink.Value() ); + } + } + +// --------------------------------------------------------------------------- +// CESMRViewerDescriptionField::StoreGeoValueL +// --------------------------------------------------------------------------- +// +void CESMRViewerDescriptionField::StoreGeoValueL( + CCalEntry& aCalEntry, + const TDesC& aLocationUrl ) + { + FUNC_LOG; + + TReal lat, lon; + CCalGeoValue* geoVal = aCalEntry.GeoValueL(); + + if ( !geoVal || ! geoVal->GetLatLong( lat, lon ) ) + { + // GEO value not set. Convert URL + geoVal = UrlParserL().CreateGeoValueLC( aLocationUrl ); + aCalEntry.SetGeoValueL( *geoVal ); + CleanupStack::Pop( geoVal ); + + NotifyEventL( EESMRCmdEnableWaypointIcon ); + } + } + +// --------------------------------------------------------------------------- +// CESMRViewerDescriptionField::UrlParserL +// --------------------------------------------------------------------------- +// +CESMRUrlParserPlugin& CESMRViewerDescriptionField::UrlParserL() + { + FUNC_LOG; + + if ( !iUrlParser ) + { + iUrlParser = CESMRUrlParserPlugin::NewL(); + } + + return *iUrlParser; + } + //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdetailedsubjectfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdetailedsubjectfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdetailedsubjectfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,11 +23,13 @@ #include "mesmrmeetingrequestentry.h" #include "cmrimage.h" #include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" +#include "cesmrglobalnote.h" #include -#include +#include #include -#include +#include // DEBUG #include "emailtrace.h" @@ -77,6 +79,7 @@ { FUNC_LOG; SetFieldId ( EESMRFieldDetailedSubject ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -87,7 +90,6 @@ { FUNC_LOG; iObserver = NULL; - delete iRichTextViewer; delete iFieldIcon; } @@ -113,14 +115,14 @@ void CESMRViewerDetailedSubjectField::ConstructL() { FUNC_LOG; - SetFocusType( EESMRHighlightFocus ); - - iFieldIcon = CMRImage::NewL( KAknsIIDQgnFscalIndiOccasion ); + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapOccasion ); iFieldIcon->SetParent( this ); iRichTextViewer = CESMRRichTextViewer::NewL( this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transferred iRichTextViewer->SetEdwinSizeObserver( this ); iRichTextViewer->SetParent( this ); + iRichTextViewer->SetLinkObserver( this ); } // --------------------------------------------------------------------------- @@ -140,14 +142,19 @@ // TSize CESMRViewerDetailedSubjectField::MinimumSize() { - // Let's calculate the required rect of the iRichTextViewer. - // We will not use directly the iRichTextViewer height, because it might - // not exist, or the height of the viewer might still be incorrect - TRect richTextViewerRect = RichTextViewerRect(); + TRect parentRect( Parent()->Rect() ); + + TRect fieldRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); - // We will use as minimum size the parents width - // but the calculated iRichTextViewers height - return TSize( Parent()->Size().iWidth, richTextViewerRect.Height() ); + TRect viewerRect( NMRLayoutManager::GetLayoutText( + fieldRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + // Adjust field size so that there's room for expandable editor. + fieldRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); + + return fieldRect.Size(); } @@ -163,13 +170,15 @@ Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - iRichTextViewer->SetFontL( text.Font(), iLayout ); + iRichTextViewer->SetFontL( text.Font() ); + iRichTextViewer->ApplyLayoutChangesL(); // This is called so theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iRichTextViewer->FocusChanged( EDrawNow ); } + iRichTextViewer->SetEventQueue( iEventQueue ); } // --------------------------------------------------------------------------- @@ -184,7 +193,24 @@ aEntry.Type() ); CCalEntry& entry = aEntry.Entry(); - + + if( !IsLocked() ) + { + if( entry.PriorityL() == EFSCalenMRPriorityHigh ) + { + iPriorityIcon = CMRImage::NewL( + NMRBitmapManager::EMRBitmapPriorityHigh, ETrue ); + iPriorityIcon->SetParent( this ); + } + if( entry.PriorityL() == EFSCalenMRPriorityLow ) + { + iPriorityIcon = CMRImage::NewL( + NMRBitmapManager::EMRBitmapPriorityLow, ETrue ); + iPriorityIcon->SetParent( this ); + } + } + + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == entryType ) { MESMRMeetingRequestEntry* mrEntry = @@ -210,14 +236,10 @@ if ( summary.Length() ) { iRichTextViewer->SetTextL( subject, ETrue ); - // After setting the text, the viewer line count is known - iLineCount = iRichTextViewer->LineCount(); } else { iRichTextViewer->SetTextL( unnamed, ETrue ); - // After setting the text, the viewer line count is known - iLineCount = iRichTextViewer->LineCount(); } CleanupStack::PopAndDestroy( subject ); subject = NULL; @@ -237,16 +259,16 @@ CleanupStack::PopAndDestroy( unnamed ); unnamed = NULL; - // if the entry is anniversary let's change the icon. + // if the entry isn't anniversary let's change the icon. if ( CCalEntry::EAnniv != aEntry.Entry().EntryTypeL() ) - { + { delete iFieldIcon; iFieldIcon = NULL; - - iFieldIcon = CMRImage::NewL( KAknsIIDQgnFscalIndiSubject ); + + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapSubject ); iFieldIcon->SetParent( this ); - - DrawDeferred(); + + DrawDeferred(); } iDisableRedraw = ETrue; } @@ -301,17 +323,32 @@ // CESMRViewerDetailedSubjectField::ExecuteGenericCommandL() // --------------------------------------------------------------------------- // -void CESMRViewerDetailedSubjectField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRViewerDetailedSubjectField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if (aCommand == EESMRCmdClipboardCopy) { iRichTextViewer->CopyCurrentLinkToClipBoardL(); + isUsed = ETrue; } else if ( aCommand == EAknSoftkeySelect ) { iRichTextViewer->LinkSelectedL(); - } + isUsed = ETrue; + } + else if ( aCommand == EAknCmdOpen ) + { + if ( IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + isUsed = ETrue; + } + } + return isUsed; } // --------------------------------------------------------------------------- @@ -322,9 +359,14 @@ { FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); + iRichTextViewer->SetFocus( aFocus ); - iRichTextViewer->SetFocus( aFocus ); - if ( !aFocus ) + if( aFocus ) + { + SetMiddleSoftkeyL(); + } + + else { //need to tell action menu that focus has changed iRichTextViewer->ResetActionMenuL(); @@ -332,6 +374,93 @@ } // --------------------------------------------------------------------------- +// CESMRViewerDetailedSubjectField::GetCursorLineVerticalPos +// --------------------------------------------------------------------------- +// +void CESMRViewerDetailedSubjectField::GetCursorLineVerticalPos( + TInt& aUpper, + TInt& aLower ) + { + FUNC_LOG; + + aLower = iRichTextViewer->CurrentLineNumber() * iRichTextViewer->RowHeight(); + aUpper = aLower - iRichTextViewer->RowHeight(); + } + +// --------------------------------------------------------------------------- +// CESMRViewerDetailedSubjectField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CESMRViewerDetailedSubjectField::HandleLongtapEventL( + const TPoint& aPosition ) + { + FUNC_LOG; + + if ( iRichTextViewer->Rect().Contains( aPosition ) ) + { + iRichTextViewer->LinkSelectedL(); + } + } + +// --------------------------------------------------------------------------- +// CESMRViewerDetailedSubjectField::LockL +// --------------------------------------------------------------------------- +// +void CESMRViewerDetailedSubjectField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iPriorityIcon; + iPriorityIcon = NULL; + iPriorityIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iPriorityIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerDetailedSubjectField::SetMiddleSoftkeyL +// --------------------------------------------------------------------------- +// +void CESMRViewerDetailedSubjectField::SetMiddleSoftkeyL() + { + FUNC_LOG; + const CESMRRichTextLink* link = iRichTextViewer->GetSelectedLink(); + if( link ) + { + if ( ( link->Type() == CESMRRichTextLink::ETypeURL ) || + ( link->Type() == CESMRRichTextLink::ETypeEmail ) || + ( link->Type() == CESMRRichTextLink::ETypePhoneNumber ) ) + { + SetMiddleSoftKeyVisible( ETrue ); + } + else + { + RestoreMiddleSoftKeyL(); + } + } + } + + +// --------------------------------------------------------------------------- +// CESMRViewerDetailedSubjectField::HandleRichTextLinkSelection +// --------------------------------------------------------------------------- +// +TBool CESMRViewerDetailedSubjectField::HandleRichTextLinkSelection( + const CESMRRichTextLink* /*aLink*/ ) + { + TBool result = EFalse; + + // No implementation yet: waiting for UI spec. + + return result; + } + +// --------------------------------------------------------------------------- // CESMRViewerDetailedSubjectField::CountComponentControls // --------------------------------------------------------------------------- // @@ -347,6 +476,12 @@ { ++count; } + + if ( iPriorityIcon ) + { + ++count; + } + return count; } @@ -363,6 +498,9 @@ return iFieldIcon; case 1: return iRichTextViewer; + case 2: + return iPriorityIcon; + default: return NULL; } @@ -374,32 +512,64 @@ // void CESMRViewerDetailedSubjectField::SizeChanged( ) { - TRect rect = Rect(); + TRect rect( Rect() ); - // LAYOUTING FIELD ICON + TAknLayoutRect rowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect rowRect( rowLayoutRect.Rect() ); + + // Layouting field icon if( iFieldIcon ) { - TAknWindowComponentLayout iconLayout = + TAknWindowComponentLayout iconLayout( NMRLayoutManager::GetWindowComponentLayout( - NMRLayoutManager::EMRLayoutTextEditorIcon ); - AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); + NMRLayoutManager::EMRLayoutSingleRowAColumnGraphic ) ); + AknLayoutUtils::LayoutControl( iFieldIcon, rowRect, iconLayout ); + } + + // Layouting priority icon + if( iPriorityIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iPriorityIcon, rowRect, iconLayout ); } - // LAYOUTING FIELD BACKGROUND - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); - // Move focus rect so that it's relative to field's position + TAknLayoutText viewerLayoutText; + + if( iPriorityIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + // Layouting viewer field + TRect viewerRect( viewerLayoutText.TextRect() ); + + // Resize height according to actual height required by edwin. + viewerRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); + iRichTextViewer->SetRect( viewerRect ); + + // Layouting focus + TRect bgRect( viewerRect ); + + // Move focus rect so that it's relative to field's position. bgRect.Move( -Position() ); SetFocusRect( bgRect ); - - // LAYOUTING FIELD TEXT VIEWER - if( iRichTextViewer ) - { - iRichTextViewer->SetRect( RichTextViewerRect() ); - } + // Failures are ignored. + TRAP_IGNORE( + // Try setting font + iRichTextViewer->SetFontL( viewerLayoutText.Font() ); + // Try applying changes + iRichTextViewer->ApplyLayoutChangesL(); + ); } // --------------------------------------------------------------------------- @@ -410,43 +580,8 @@ const CCoeControl& aContainer ) { CCoeControl::SetContainerWindowL( aContainer ); - iRichTextViewer->SetContainerWindowL( aContainer ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerDetailedSubjectField::RichTextViewerRect -// --------------------------------------------------------------------------- -// -TRect CESMRViewerDetailedSubjectField::RichTextViewerRect() - { - TRect rect = Rect(); - - TAknTextComponentLayout edwinLayout = NMRLayoutManager::GetTextComponentLayout( - NMRLayoutManager::EMRTextLayoutTextEditor ); - - // Text layout rect for one line viewer - TAknLayoutText textLayout; - textLayout.LayoutText( rect, edwinLayout ); - TRect textLayoutRect = textLayout.TextRect(); - - TRect viewerRect = textLayoutRect; - - // If iRichTextViewer has lines and iSize has been set, - // we will use iSize.iHeight as the viewers height - if( iLineCount > 0 && iSize.iHeight > 0 ) - { - viewerRect.SetHeight( iSize.iHeight ); - } - // Otherwise we will use one row height as the height of the - // iRichTextViewer - else - { - TAknLayoutRect rowLayoutRect = - NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); - viewerRect.SetHeight( rowLayoutRect.Rect().Height() ); - } - - return viewerRect; + iRichTextViewer->SetContainerWindowL( aContainer ); + iRichTextViewer->SetParent( this ); } //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,18 +15,24 @@ * */ +#include "cesmrviewerlocationfield.h" +#include "cesmrrichtextviewer.h" +#include "mesmrlistobserver.h" +#include "nmrlayoutmanager.h" +#include "cmrimage.h" +#include "cesmrfeaturesettings.h" +#include "emailtrace.h" +#include "cesmrglobalnote.h" +#include "cmrbutton.h" + #include #include #include -#include +#include +#include +#include -#include "cesmrviewerlocationfield.h" -#include "cesmrrichtextviewer.h" -#include "mesmrlistobserver.h" -#include "cesmrfeaturesettings.h" -#include "nmrlayoutmanager.h" -#include "cmrimage.h" - +// LOCAL DEFINITIONS // ======== MEMBER FUNCTIONS ======== @@ -49,9 +55,8 @@ // CESMRViewerLocationField::~CESMRViewerLocationField() { - iObserver = NULL; - delete iFieldIcon; - delete iRichTextViewer; + delete iFieldButton; + delete iWaypointIcon; delete iFeatures; } @@ -61,14 +66,19 @@ // TSize CESMRViewerLocationField::MinimumSize() { - // Let's calculate the required rect of the iRichTextViewer. - // We will not use directly the iRichTextViewer height, because it might - // not exist, or the height of the viewer might still be incorrect - TRect richTextViewerRect = RichTextViewerRect(); + TRect parentRect( Parent()->Rect() ); + + TRect fieldRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); - // We will use as minimum size the parents width - // but the calculated iRichTextViewers height - return TSize( Parent()->Size().iWidth, richTextViewerRect.Height() ); + TRect viewerRect( NMRLayoutManager::GetLayoutText( + fieldRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + // Adjust field size so that there's room for expandable editor. + fieldRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); + + return fieldRect.Size(); } @@ -79,17 +89,19 @@ void CESMRViewerLocationField::InitializeL() { // Setting Font for the rich text viewer - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - - iRichTextViewer->SetFontL( text.Font(), iLayout ); + + iRichTextViewer->SetFontL( text.Font() ); + iRichTextViewer->ApplyLayoutChangesL(); // This is called so that theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iRichTextViewer->FocusChanged( EDrawNow ); } + iRichTextViewer->SetEventQueue( iEventQueue ); } // --------------------------------------------------------------------------- @@ -99,19 +111,30 @@ void CESMRViewerLocationField::InternalizeL( MESMRCalEntry& aEntry ) { TPtrC text = aEntry.Entry().LocationL( ); - + // Hide this field if location is not set if( text.Length() == 0 ) { - iObserver->RemoveControl( FieldId() ); + iObserver->HideControl( FieldId() ); } else { iRichTextViewer->SetTextL( &text, ETrue ); - // After setting the text, the viewer line count is known - iLineCount = iRichTextViewer->LineCount(); } - iDisableRedraw = ETrue; + + // If the geo value has set, the waypoint icon has to be shown on right + // side of the location field + CCalGeoValue* geoValue = aEntry.Entry().GeoValueL(); + TReal dummy; + if( !iLocked ) + { + if( geoValue && geoValue->GetLatLong( dummy, dummy ) ) + { + iWaypointIcon = + CMRImage::NewL( NMRBitmapManager::EMRBitmapLocationWaypoint, ETrue ); + iWaypointIcon->SetParent( this ); + } + } } // --------------------------------------------------------------------------- @@ -133,7 +156,7 @@ TEdwinSizeEvent /*aType*/, TSize aSize ) { TBool reDraw( EFalse ); - + // Let's save the required size for the iRichTextViewer iSize = aSize; @@ -153,6 +176,7 @@ CESMRViewerLocationField::CESMRViewerLocationField() { SetFieldId( EESMRFieldLocation ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -161,14 +185,16 @@ // void CESMRViewerLocationField::ConstructL( ) { - SetFocusType( EESMRHighlightFocus ); - - iFieldIcon = CMRImage::NewL( KAknsIIDQgnMeetReqIndiLocation ); - iFieldIcon->SetParent( this ); - + iFieldButton = CMRButton::NewL( NMRBitmapManager::EMRBitmapLocation ); + iFieldButton->SetParent( this ); + iFieldButton->SetObserver(this); + iRichTextViewer = CESMRRichTextViewer::NewL( this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transfered iRichTextViewer->SetEdwinSizeObserver( this ); iRichTextViewer->SetParent( this ); + + iFeatures = CESMRFeatureSettings::NewL(); } // --------------------------------------------------------------------------- @@ -184,24 +210,42 @@ // CESMRViewerLocationField::ExecuteGenericCommandL() // --------------------------------------------------------------------------- // -void CESMRViewerLocationField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRViewerLocationField::ExecuteGenericCommandL( TInt aCommand ) { + TBool isUsed( EFalse ); switch ( aCommand ) { case EESMRCmdClipboardCopy: - { - iRichTextViewer->CopyCurrentLinkToClipBoardL(); - break; + { + iRichTextViewer->CopyCurrentLinkToClipBoardL(); + isUsed = ETrue; + break; } case EESMRCmdDisableWaypointIcon: case EESMRCmdEnableWaypointIcon: { SetWaypointIconL( aCommand == EESMRCmdEnableWaypointIcon ); + isUsed = ETrue; break; } case EAknSoftkeySelect: { iRichTextViewer->LinkSelectedL(); + isUsed = ETrue; + + break; + } + case EAknCmdOpen: + { + // Open command is handled only when field is locked + if ( IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + isUsed = ETrue; + } break; } default: @@ -209,6 +253,7 @@ break; } } + return isUsed; } // --------------------------------------------------------------------------- @@ -218,84 +263,35 @@ void CESMRViewerLocationField::SetOutlineFocusL( TBool aFocus ) { CESMRField::SetOutlineFocusL( aFocus ); - - iRichTextViewer->SetFocus( aFocus ); - if ( FeaturesL().FeatureSupported( - CESMRFeatureSettings::EESMRUILocationFeatures ) ) - { - - if ( aFocus ) - { - //Store MSK function before changing it - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - if ( cba->PositionById( EESMRCmdEdit ) == - CEikButtonGroupContainer::EMiddleSoftkeyPosition ) - { - iMskCommandId = EESMRCmdEdit; - - } - else if ( cba->PositionById( EESMRCmdEditLocal ) == - CEikButtonGroupContainer::EMiddleSoftkeyPosition ) - { - iMskCommandId = EESMRCmdEditLocal; - } - else if ( cba->PositionById( EESMRCmdCalEntryUIEdit ) == - CEikButtonGroupContainer::EMiddleSoftkeyPosition ) - { - iMskCommandId = EESMRCmdCalEntryUIEdit; - } - - ChangeMiddleSoftKeyL( EAknSoftkeyContextOptions, R_QTN_MSK_OPEN ); - } - else - { - switch ( iMskCommandId ) - { - case EESMRCmdEdit: - case EESMRCmdEditLocal: - case EESMRCmdCalEntryUIEdit: - { - ChangeMiddleSoftKeyL( iMskCommandId, R_QTN_MSK_EDIT ); - break; - } - default: - { - CEikButtonGroupContainer* cba = - CEikButtonGroupContainer::Current(); - cba->SetCommandL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, - R_MR_SELECT_SOFTKEY ); - cba->DrawNow(); - break; - } - } - - //need to tell action menu that focus has changed - iRichTextViewer->ResetActionMenuL(); - } - } + if ( aFocus ) + { + ChangeMiddleSoftKeyL( EAknSoftkeyContextOptions, R_QTN_MSK_OPEN ); + } + else + { + //need to tell action menu that focus has changed + iRichTextViewer->ResetActionMenuL(); + } } // --------------------------------------------------------------------------- -// CESMRViewerLocationField::FeaturesL() +// CESMRViewerLocationField::SetWaypointIconL // --------------------------------------------------------------------------- // -CESMRFeatureSettings& CESMRViewerLocationField::FeaturesL() +void CESMRViewerLocationField::SetWaypointIconL( TBool aEnabled ) { - if ( !iFeatures ) + delete iWaypointIcon; + iWaypointIcon = NULL; + + if ( aEnabled ) { - iFeatures = CESMRFeatureSettings::NewL(); + iWaypointIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLocationWaypoint, ETrue ); + iWaypointIcon->SetParent( this ); } - return *iFeatures; - } -// --------------------------------------------------------------------------- -// CESMRCheckbox::SetWaypointIconL -// --------------------------------------------------------------------------- -// -void CESMRViewerLocationField::SetWaypointIconL( TBool /*aEnabled*/ ) - { + // Relayout + SizeChanged(); } // --------------------------------------------------------------------------- @@ -305,7 +301,7 @@ TInt CESMRViewerLocationField::CountComponentControls() const { TInt count( 0 ); - if ( iFieldIcon ) + if ( iFieldButton ) { ++count; } @@ -314,6 +310,11 @@ { ++count; } + + if( iWaypointIcon ) + { + ++count; + } return count; } @@ -326,9 +327,11 @@ switch ( aIndex ) { case 0: - return iFieldIcon; + return iFieldButton; case 1: return iRichTextViewer; + case 2: + return iWaypointIcon; default: return NULL; } @@ -340,75 +343,242 @@ // void CESMRViewerLocationField::SizeChanged( ) { - TRect rect = Rect(); + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect rowRect( rowLayoutRect.Rect() ); - // LAYOUTING FIELD ICON - if( iFieldIcon ) + // Layouting field icon + if( iFieldButton ) { - TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); - AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowAColumnGraphic ) ); + AknLayoutUtils::LayoutControl( iFieldButton, rowRect, iconLayout ); + } + + // Layouting waypoint icon + if( iWaypointIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iWaypointIcon, rowRect, iconLayout ); } - // LAYOUTING FIELD BACKGROUND - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); - // Move focus rect so that it's relative to field's position + TAknLayoutText viewerLayoutText; + + if( iWaypointIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + // Layouting viewer field + TRect viewerRect( viewerLayoutText.TextRect() ); + + // Resize height according to actual height required by edwin. + viewerRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); + iRichTextViewer->SetRect( viewerRect ); + + // Layouting focus + TRect bgRect( viewerRect ); + + // Move focus rect so that it's relative to field's position. bgRect.Move( -Position() ); SetFocusRect( bgRect ); - // LAYOUTING FIELD TEXT VIEWER - if( iRichTextViewer ) - { - iRichTextViewer->SetRect( RichTextViewerRect() ); - } + // Failures are ignored. + TRAP_IGNORE( + // Try setting font + iRichTextViewer->SetFontL( viewerLayoutText.Font() ); + // Try applying changes + iRichTextViewer->ApplyLayoutChangesL(); + ); } // --------------------------------------------------------------------------- // CESMRViewerLocationField::SetContainerWindowL // --------------------------------------------------------------------------- // -void CESMRViewerLocationField::SetContainerWindowL( const CCoeControl& aContainer ) +void CESMRViewerLocationField::SetContainerWindowL( + const CCoeControl& aContainer ) { CCoeControl::SetContainerWindowL( aContainer ); iRichTextViewer->SetContainerWindowL( aContainer ); + iRichTextViewer->SetParent( this ); + iFieldButton->SetContainerWindowL( aContainer ); + iFieldButton->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerLocationField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CESMRViewerLocationField::HandleLongtapEventL( + const TPoint& aPosition ) + { + if ( !iRichTextViewer->LinkSelectedL() ) + { + HandleTapEventL( aPosition ); + } + else + { + // Reset action menu after link selection + iRichTextViewer->ResetActionMenuL(); + } + } + +// --------------------------------------------------------------------------- +// CESMRViewerLocationField::DynInitMenuPaneL +// --------------------------------------------------------------------------- +// +void CESMRViewerLocationField::DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + if ( aResourceId == R_MR_VIEWER_MENU || + aResourceId == R_MR_VIEWER_LOCATION_MENU ) + { + TBool showOnMap( EFalse ); + + if ( iWaypointIcon ) + { + showOnMap = ETrue; + } + + TBool searchFromMap = !showOnMap; + + if ( !iFeatures->FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + // Maps disabled + showOnMap = EFalse; + searchFromMap = EFalse; + } + + aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); + aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, !searchFromMap ); + } } // --------------------------------------------------------------------------- -// CESMRViewerLocationField::RichTextViewerRect +// CESMRViewerLocationField::LockL +// --------------------------------------------------------------------------- +// +void CESMRViewerLocationField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iWaypointIcon; + iWaypointIcon = NULL; + iWaypointIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + + iWaypointIcon->SetParent( this ); + iWaypointIcon->SetObserver( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerLocationField::GetCursorLineVerticalPos +// --------------------------------------------------------------------------- +// +void CESMRViewerLocationField::GetCursorLineVerticalPos( + TInt& aUpper, TInt& aLower) + { + aLower = iRichTextViewer->CurrentLineNumber() * iRichTextViewer->RowHeight(); + aUpper = aLower - iRichTextViewer->RowHeight(); + } + +// --------------------------------------------------------------------------- +// CESMRViewerLocationField::HandleControlEventL // --------------------------------------------------------------------------- // -TRect CESMRViewerLocationField::RichTextViewerRect() - { - TRect rect = Rect(); - - TAknTextComponentLayout edwinLayout = NMRLayoutManager::GetTextComponentLayout( - NMRLayoutManager::EMRTextLayoutTextEditor ); - - // Text layout rect for one line viewer - TAknLayoutText textLayout; - textLayout.LayoutText( rect, edwinLayout ); - TRect textLayoutRect = textLayout.TextRect(); - TRect viewerRect = textLayoutRect; - - // If iRichTextViewer has lines and iSize has been set, - // we will use iSize.iHeight as the viewers height - if( iLineCount > 0 && iSize.iHeight > 0 ) +void CESMRViewerLocationField::HandleControlEventL( + CCoeControl* aControl,TCoeEvent aEventType ) + { + if ( aControl == iFieldButton ) { - viewerRect.SetHeight( iSize.iHeight ); + if( iLocked ) + { + //if field is locked, iFieldButton can't be used. + return; + } + switch ( aEventType ) + { + // Button state changed (button was pressed) + case EEventRequestFocus: + { + // Clear viewer selection + iRichTextViewer->ClearSelectionL(); + iRichTextViewer->DrawDeferred(); + + // Show context menu + HandleTactileFeedbackL(); + NotifyEventL( EAknSoftkeyContextOptions ); + } + + default: + break; + } } - // Otherwise we will use one row height as the height of the - // iRichTextViewer - else - { - TAknLayoutRect rowLayoutRect = - NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); - viewerRect.SetHeight( rowLayoutRect.Rect().Height() ); - } - - return viewerRect; } +// --------------------------------------------------------------------------- +// CESMRViewerLocationField::HandleSingletapEventL +// --------------------------------------------------------------------------- +// +TBool CESMRViewerLocationField::HandleSingletapEventL( const TPoint& aPosition ) + { + return HandleTapEventL( aPosition ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerLocationField::HandletapEventL +// --------------------------------------------------------------------------- +// +TBool CESMRViewerLocationField::HandleTapEventL( const TPoint& aPosition ) + { + TBool ret( EFalse ); + + if( iLocked ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + + // Field locked, let's consume the event + ret = ETrue; + } + else + { + // Button events are handled by HandleControlEvent. + // Tap on link is handled by rich text viewer. + if ( !iFieldButton->Rect().Contains( aPosition ) + && !iRichTextViewer->GetSelectedLink() ) + { + NotifyEventL( EAknSoftkeyContextOptions ); + + ret = ETrue; + + HandleTactileFeedbackL(); + } + } + + return ret; + } + //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,18 +15,23 @@ * */ -#include "emailtrace.h" #include "cesmrviewerpriorityfield.h" -#include +#include "esmrdef.h" +#include "mesmrlistobserver.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" +#include "cesmrglobalnote.h" + #include #include -#include -#include +#include +#include -#include -#include "esmrdef.h" -#include "mesmrlistobserver.h" +// DEBUG +#include "emailtrace.h" // ======== MEMBER FUNCTIONS ======== @@ -51,7 +56,8 @@ CESMRViewerPriorityField::~CESMRViewerPriorityField() { FUNC_LOG; - //do nothing + delete iIcon; + delete iLockIcon; } // --------------------------------------------------------------------------- @@ -61,7 +67,8 @@ CESMRViewerPriorityField::CESMRViewerPriorityField() { FUNC_LOG; - //do nothing + SetFieldId( EESMRFieldPriority ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -71,9 +78,13 @@ void CESMRViewerPriorityField::ConstructL() { FUNC_LOG; - // As a default set icon and text as it should be in priority NORMAL - SetFieldId( EESMRFieldPriority ); - CESMRViewerLabelField::ConstructL( KAknsIIDQgnFsIndiPriorityNormal); + iLabel = CMRLabel::NewL(); + iLabel->SetParent( this ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal ); + iIcon->SetParent( this ); + HBufC* priorityText = StringLoader::LoadLC( R_QTN_CALENDAR_MEETING_OPT_PRIORITY_NORMAL, iEikonEnv ); @@ -93,7 +104,7 @@ HBufC* priorityText; TInt resourceId(KErrNotFound); - TAknsItemID priorityIconId; + NMRBitmapManager::TMRBitmapId bitmapId; if ( aEntry.Type() == MESMRCalEntry::EESMRCalEntryTodo ) { @@ -102,13 +113,13 @@ case EFSCalenTodoPriorityLow: { resourceId = R_QTN_CALENDAR_MEETING_OPT_PRIORITY_LOW; - priorityIconId = KAknsIIDQgnFsIndiPriorityLow; + bitmapId = NMRBitmapManager::EMRBitmapPriorityLow; break; } case EFSCalenTodoPriorityHigh: { resourceId = R_QTN_CALENDAR_MEETING_OPT_PRIORITY_HIGH; - priorityIconId = KAknsIIDQgnFsIndiPriorityHigh; + bitmapId = NMRBitmapManager::EMRBitmapPriorityHigh; break; } default: @@ -117,7 +128,6 @@ break; } } - } else { @@ -126,13 +136,13 @@ case EFSCalenMRPriorityLow: { resourceId = R_QTN_CALENDAR_MEETING_OPT_PRIORITY_LOW; - priorityIconId = KAknsIIDQgnFsIndiPriorityLow; + bitmapId = NMRBitmapManager::EMRBitmapPriorityLow; break; } case EFSCalenMRPriorityHigh: { resourceId = R_QTN_CALENDAR_MEETING_OPT_PRIORITY_HIGH; - priorityIconId = KAknsIIDQgnFsIndiPriorityHigh; + bitmapId = NMRBitmapManager::EMRBitmapPriorityHigh; break; } default: @@ -151,12 +161,162 @@ iLabel->SetTextL( *priorityText ); CleanupStack::PopAndDestroy( priorityText ); - IconL( priorityIconId ); + delete iIcon; + iIcon = NULL; + iIcon = CMRImage::NewL( bitmapId ); + iIcon->SetParent( this ); // This needs to be called so icon will be redrawn SizeChanged(); } } +// --------------------------------------------------------------------------- +// CESMRViewerPriorityField::SizeChanged() +// --------------------------------------------------------------------------- +// +void CESMRViewerPriorityField::SizeChanged() + { + FUNC_LOG; + TRect rect = Rect(); + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + rect = rowLayoutRect.Rect(); + + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ); + AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + + // Move focus rect so that it's relative to field's position. + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerPriorityField::CountComponentControls() +// --------------------------------------------------------------------------- +// +TInt CESMRViewerPriorityField::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iLabel ) + { + ++count; + } + if ( iLockIcon ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CESMRViewerPriorityField::ComponentControl() +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRViewerPriorityField::ComponentControl( TInt aIndex ) const + { + FUNC_LOG; + switch ( aIndex ) + { + case 0: + return iIcon; + case 1: + return iLabel; + case 2: + return iLockIcon; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CESMRViewerPriorityField::SetOutlineFocusL() +// --------------------------------------------------------------------------- +// +void CESMRViewerPriorityField::SetOutlineFocusL( TBool aFocus ) + { + FUNC_LOG; + CESMRField::SetOutlineFocusL ( aFocus ); + + iLabel->SetFocus( aFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerPriorityField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerPriorityField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerPriorityField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerPriorityField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + return retValue; + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencedatefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencedatefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencedatefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,27 +15,25 @@ * */ + #include "cesmrviewerrecurrencedatefield.h" #include "mesmrresponseobserver.h" -#include "cesmrborderlayer.h" #include "mesmrlistobserver.h" #include "esmrfieldbuilderdef.h" -#include "cesmrlayoutmgr.h" #include "cmrlabel.h" #include "nmrlayoutmanager.h" +#include "nmrcolormanager.h" +#include "cesmrglobalnote.h" #include #include #include -#include -#include +#include +#include #include #include // DEBUG #include "emailtrace.h" - -using namespace ESMRLayout; - namespace // codescanner::namespace { const TInt KComponentCount( 2 ); @@ -44,17 +42,15 @@ // ======== MEMBER FUNCTIONS ======== // ----------------------------------------------------------------------------- -// CESMRViewerRecurrenceDateField::NewL +// CESMRViewerRecurrenceDateField::CESMRViewerRecurrenceDateField // ----------------------------------------------------------------------------- // -CESMRViewerRecurrenceDateField* CESMRViewerRecurrenceDateField::NewL() +CESMRViewerRecurrenceDateField::CESMRViewerRecurrenceDateField() +: iRepeatUntilDate( Time::NullTTime() ) { FUNC_LOG; - CESMRViewerRecurrenceDateField* self = new (ELeave) CESMRViewerRecurrenceDateField(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; + SetFieldId( EESMRFieldRecurrenceDate ); + SetFocusType( EESMRHighlightFocus ); } // ----------------------------------------------------------------------------- @@ -69,13 +65,18 @@ } // ----------------------------------------------------------------------------- -// CESMRViewerRecurrenceDateField::CESMRViewerRecurrenceDateField +// CESMRViewerRecurrenceDateField::NewL // ----------------------------------------------------------------------------- // -CESMRViewerRecurrenceDateField::CESMRViewerRecurrenceDateField() +CESMRViewerRecurrenceDateField* CESMRViewerRecurrenceDateField::NewL() { FUNC_LOG; - SetFieldId( EESMRFieldRecurrenceDate ); + CESMRViewerRecurrenceDateField* self = + new (ELeave) CESMRViewerRecurrenceDateField(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; } // ----------------------------------------------------------------------------- @@ -99,22 +100,43 @@ void CESMRViewerRecurrenceDateField::InitializeL() { FUNC_LOG; - TAknLayoutText editorRect = - NMRLayoutManager::GetLayoutText( - Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - - iRepeatTopic->SetFont( editorRect.Font() ); - iRepeatDate->SetFont( editorRect.Font() ); + NMRColorManager::SetColor( *iRepeatTopic, + NMRColorManager::EMRMainAreaTextColor ); - AknLayoutUtils::OverrideControlColorL( *iRepeatTopic, EColorLabelText, - KRgbBlack ); - AknLayoutUtils::OverrideControlColorL( *iRepeatDate, EColorLabelText, - KRgbBlack ); + NMRColorManager::SetColor( *iRepeatDate, + NMRColorManager::EMRMainAreaTextColor ); //this control cannot ever get keyboard focus SetFocusing(EFalse); } // ----------------------------------------------------------------------------- +// CESMRViewerRecurrenceDateField::ExecuteGenericCommandL +// ----------------------------------------------------------------------------- +// +TBool CESMRViewerRecurrenceDateField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + else if ( EMRCmdDoEnvironmentChange == aCommand ) + { + FormatRepeatUntilDateL(); + retValue = ETrue; + } + + return retValue; + } + +// ----------------------------------------------------------------------------- // CESMRViewerRecurrenceDateField::SizeChanged // ----------------------------------------------------------------------------- // @@ -125,33 +147,37 @@ // First row TAknLayoutRect row1LayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); - rect = row1LayoutRect.Rect(); - - TAknLayoutText topicRect = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - + rect = row1LayoutRect.Rect(); + + TAknLayoutText topicRect = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); + TRect rectWithMargin = topicRect.TextRect(); rectWithMargin.iTl.iX += KMargin; iRepeatTopic->SetRect( rectWithMargin ); - + rect = Rect(); // Move the iY down the height of the topic field TInt movement = row1LayoutRect.Rect().Height(); - rect.Move( 0, movement ); - + rect.Move( 0, movement ); + // Second row TAknLayoutRect row2LayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 ); - rect = row2LayoutRect.Rect(); - - TAknLayoutText dateRect = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - - rectWithMargin = dateRect.TextRect(); + rect = row2LayoutRect.Rect(); + + TAknLayoutText dateRect = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); + + rectWithMargin = dateRect.TextRect(); rectWithMargin.iTl.iX += KMargin; iRepeatDate->SetRect( rectWithMargin ); + + // Setting font also for the label + iRepeatTopic->SetFont( topicRect.Font() ); + iRepeatDate->SetFont( dateRect.Font() ); } // ----------------------------------------------------------------------------- @@ -168,8 +194,8 @@ // Second row TAknLayoutRect row2LayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( Rect(), 2 ); - height += row2LayoutRect.Rect().Height(); - + height += row2LayoutRect.Rect().Height(); + TInt width( Parent()->Size().iWidth ); return TSize( width, height ); } @@ -183,40 +209,19 @@ { FUNC_LOG; // Get recurrence - TESMRRecurrenceValue recValue( ERecurrenceNot ); - TTime recTime( Time::NullTTime() ); - aEntry.GetRecurrenceL( recValue, recTime ); + TESMRRecurrenceValue recValue( ERecurrenceNot ); + aEntry.GetRecurrenceL( recValue, iRepeatUntilDate ); // Recurrence time has to be shown in the viewer as local time TCalTime recurrenceTime; - recurrenceTime.SetTimeUtcL( recTime ); - TTime localRecurrenceTime; - localRecurrenceTime = recurrenceTime.TimeLocalL(); + recurrenceTime.SetTimeUtcL( iRepeatUntilDate ); + iRepeatUntilDate = recurrenceTime.TimeLocalL(); if( aEntry.IsRecurrentEventL() && recValue != ERecurrenceNot && - Time::NullTTime() != recTime ) + Time::NullTTime() != iRepeatUntilDate ) { - HBufC* topicHolder = - StringLoader::LoadLC( - R_QTN_MEET_REQ_REPEAT_UNTIL, - iEikonEnv ); - // Set text for repeat topic (e.g. "Repeat until") - iRepeatTopic->SetTextL( topicHolder->Des() ); - CleanupStack::PopAndDestroy( topicHolder ); - - // Format date string - HBufC* timeFormatString = iEikonEnv->AllocReadResourceLC( - R_QTN_DATE_USUAL); - - TBuf< KDateStringLength > finalBuf; - localRecurrenceTime.FormatL( finalBuf, *timeFormatString ); - - // Set repeat until date value - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalBuf ); - iRepeatDate->SetTextL( finalBuf ); - CleanupStack::PopAndDestroy( timeFormatString ); - timeFormatString = NULL; + FormatRepeatUntilDateL(); } else { @@ -260,6 +265,37 @@ return retVal; } +// ----------------------------------------------------------------------------- +// CESMRViewerRecurrenceDateField::FormatRepeatUntilDateL +// ----------------------------------------------------------------------------- +// +void CESMRViewerRecurrenceDateField::FormatRepeatUntilDateL() + { + FUNC_LOG; + + HBufC* topicHolder = + StringLoader::LoadLC( + R_QTN_MEET_REQ_REPEAT_UNTIL, + iEikonEnv ); + + // Set text for repeat topic (e.g. "Repeat until") + iRepeatTopic->SetTextL( topicHolder->Des() ); + CleanupStack::PopAndDestroy( topicHolder ); + + // Format date string + HBufC* timeFormatString = iEikonEnv->AllocReadResourceLC( + R_QTN_DATE_USUAL); + + TBuf< KDateStringLength > finalBuf; + iRepeatUntilDate.FormatL( finalBuf, *timeFormatString ); + + // Set repeat until date value + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalBuf ); + iRepeatDate->SetTextL( finalBuf ); + CleanupStack::PopAndDestroy( timeFormatString ); + timeFormatString = NULL; + } + // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,6 +20,8 @@ #include "cmrlabel.h" #include "cmrimage.h" #include "mesmrlistobserver.h" +#include "nmrbitmapmanager.h" +#include "cesmrglobalnote.h" #include #include @@ -27,8 +29,8 @@ #include #include #include -#include -#include +#include +#include #include // DEBUG @@ -64,7 +66,7 @@ { FUNC_LOG; delete iIcon; - delete iLabel; + delete iLockIcon; } // ----------------------------------------------------------------------------- @@ -75,6 +77,7 @@ { FUNC_LOG; SetFieldId( EESMRFieldRecurrence ); + SetFocusType( EESMRHighlightFocus ); } // ----------------------------------------------------------------------------- @@ -86,10 +89,10 @@ FUNC_LOG; iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); - iIcon = CMRImage::NewL( KAknsIIDQgnFscalIndiRecurrence ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapRecurrence ); iIcon->SetParent( this ); - - SetFocusType( EESMRHighlightFocus ); } // ----------------------------------------------------------------------------- @@ -100,20 +103,17 @@ { FUNC_LOG; // Setting Font for the rich text viewer - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - + iLabel->SetFont( text.Font() ); - + // This is called so theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iLabel->FocusChanged( EDrawNow ); } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); } // ----------------------------------------------------------------------------- @@ -172,7 +172,7 @@ default: { // Hide the field if there is no recurrence - iObserver->RemoveControl( iFieldId ); + iObserver->HideControl( iFieldId ); break; } } @@ -193,24 +193,43 @@ TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // ----------------------------------------------------------------------------- @@ -219,7 +238,13 @@ // TInt CESMRViewerRecurrenceField::CountComponentControls() const { - return KComponentCount; + TInt count( KComponentCount ); + if( iLockIcon ) + { + ++count; + } + + return count; } // ----------------------------------------------------------------------------- @@ -234,6 +259,8 @@ return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -247,14 +274,50 @@ { FUNC_LOG; CESMRField::SetOutlineFocusL ( aFocus ); - - iLabel->SetFocus( aFocus ); + + iLabel->SetFocus( aFocus ); + } - if ( !aFocus ) - { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } - } +// --------------------------------------------------------------------------- +// CESMRViewerRecurrenceField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerRecurrenceField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerRecurrenceField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerRecurrenceField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + return retValue; + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstartdatefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstartdatefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstartdatefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,6 +23,8 @@ #include "nmrbitmapmanager.h" #include "cmrlabel.h" #include "cmrimage.h" +#include "emailtrace.h" +#include "cesmrglobalnote.h" #include #include @@ -32,10 +34,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include // ======== LOCAL FUNCTIONS ======== namespace // codescanner::namespace @@ -47,16 +49,15 @@ // ======== MEMBER FUNCTIONS ======== // ----------------------------------------------------------------------------- -// CESMRViewerStartDateField::NewL() +// CESMRViewerStartDateField::CESMRViewerStartDateField() // ----------------------------------------------------------------------------- // -CESMRViewerStartDateField* CESMRViewerStartDateField::NewL() +CESMRViewerStartDateField::CESMRViewerStartDateField() { - CESMRViewerStartDateField* self = new (ELeave) CESMRViewerStartDateField(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; + FUNC_LOG; + + SetFieldId ( EESMRFieldStartDate ); + SetFocusType( EESMRHighlightFocus ); } // ----------------------------------------------------------------------------- @@ -65,18 +66,26 @@ // CESMRViewerStartDateField::~CESMRViewerStartDateField() { - delete iLabel; + FUNC_LOG; + delete iIcon; + delete iLockIcon; } // ----------------------------------------------------------------------------- -// CESMRViewerStartDateField::CESMRViewerStartDateField() +// CESMRViewerStartDateField::NewL() // ----------------------------------------------------------------------------- // -CESMRViewerStartDateField::CESMRViewerStartDateField() +CESMRViewerStartDateField* CESMRViewerStartDateField::NewL() { - SetFieldId ( EESMRFieldStartDate ); - SetFocusType( EESMRHighlightFocus ); + FUNC_LOG; + + CESMRViewerStartDateField* self = + new (ELeave) CESMRViewerStartDateField(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; } // ----------------------------------------------------------------------------- @@ -85,51 +94,28 @@ // void CESMRViewerStartDateField::ConstructL() { + FUNC_LOG; + iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); + CESMRField::ConstructL( iLabel ); // ownership transfered + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapDateStart ); iIcon->SetParent( this ); } -// --------------------------------------------------------------------------- -// CESMRViewerStartDateField::InitializeL() -// --------------------------------------------------------------------------- -// -void CESMRViewerStartDateField::InitializeL() - { - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), - NMRLayoutManager::EMRTextLayoutTextEditor ); - - iLabel->SetFont( text.Font() ); - // This is called so that theme changes will apply when changing theme "on the fly" - if ( IsFocused() ) - { - iLabel->FocusChanged( EDrawNow ); - } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } - // ----------------------------------------------------------------------------- // CESMRViewerStartDateField::InternalizeL() // ----------------------------------------------------------------------------- // void CESMRViewerStartDateField::InternalizeL( MESMRCalEntry& aEntry ) { - // Read format string from AVKON resource - HBufC* dateFormatString = iEikonEnv->AllocReadResourceLC - (R_QTN_DATE_USUAL_WITH_ZERO); - TBuf buf; - CCalEntry& entry = aEntry.Entry(); - TTime startTime = entry.StartTimeL().TimeLocalL(); + FUNC_LOG; - startTime.FormatL(buf,*dateFormatString); + CCalEntry& entry = aEntry.Entry(); + iStartTime = entry.StartTimeL().TimeLocalL(); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf ); - iLabel->SetTextL( buf ); - CleanupStack::PopAndDestroy( dateFormatString ); + FormatDateStringL(); } // --------------------------------------------------------------------------- @@ -138,29 +124,50 @@ // void CESMRViewerStartDateField::SizeChanged() { + FUNC_LOG; + TRect rect = Rect(); TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); - bgRect.SetHeight( bgRect.Height() + 1 ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + // Layouting viewer field + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -169,7 +176,13 @@ // TInt CESMRViewerStartDateField::CountComponentControls() const { + FUNC_LOG; + TInt count( KComponentCount ); + if( iLockIcon ) + { + ++count; + } return count; } @@ -179,12 +192,16 @@ // CCoeControl* CESMRViewerStartDateField::ComponentControl( TInt aIndex ) const { + FUNC_LOG; + switch ( aIndex ) { case 0: return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -196,14 +213,79 @@ // void CESMRViewerStartDateField::SetOutlineFocusL( TBool aFocus ) { + FUNC_LOG; + CESMRField::SetOutlineFocusL ( aFocus ); - iLabel->SetFocus( aFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerStartDateField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerStartDateField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; - if ( !aFocus ) + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + if ( EMRCmdDoEnvironmentChange == aCommand ) { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); + FormatDateStringL(); + retValue = ETrue; } + + return retValue; } + +// --------------------------------------------------------------------------- +// CESMRViewerStartDateField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerStartDateField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerStartDateField::FormatDateStringL() +// --------------------------------------------------------------------------- +// +void CESMRViewerStartDateField::FormatDateStringL() + { + FUNC_LOG; + + // Read format string from AVKON resource + HBufC* dateFormatString = + iEikonEnv->AllocReadResourceLC( + R_QTN_DATE_USUAL_WITH_ZERO); + + TBuf buf; + iStartTime.FormatL(buf, *dateFormatString); + + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf ); + iLabel->SetTextL( buf ); + CleanupStack::PopAndDestroy( dateFormatString ); + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstopdatefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstopdatefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstopdatefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,14 +18,15 @@ #include "cesmrviewerstopdatefield.h" #include "cesmreditor.h" #include "mesmrlistobserver.h" -#include "emailtrace.h" #include "nmrlayoutmanager.h" #include "cmrlabel.h" #include "cmrimage.h" #include "nmrbitmapmanager.h" +#include "emailtrace.h" +#include "cesmrglobalnote.h" #include -#include +#include #include #include #include @@ -33,14 +34,17 @@ #include #include #include -#include -#include +#include +#include #include "esmrfieldbuilderdef.h" // ======== LOCAL FUNCTIONS ======== -namespace // codescanner::namespace - { - const TInt KComponentCount( 2 ); // icon and label +namespace + { // codescanner::namespace + +const TInt KComponentCount( 2 ); // icon and label +const TInt KMaxTimeBuffer( 32 ); // buffer for date formatting + } // unnamed namespace // ======== MEMBER FUNCTIONS ======== @@ -53,7 +57,7 @@ { FUNC_LOG; SetFieldId ( EESMRFieldStopDate ); - SetFocusType( EESMRHighlightFocus ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -63,8 +67,8 @@ CESMRViewerStopDateField::~CESMRViewerStopDateField() { FUNC_LOG; - delete iLabel; delete iIcon; + delete iLockIcon; } // --------------------------------------------------------------------------- @@ -90,8 +94,10 @@ { iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); + CESMRField::ConstructL( iLabel ); // ownership transfered + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapDateEnd ); - iIcon->SetParent( this ); + iIcon->SetParent( this ); } // --------------------------------------------------------------------------- @@ -100,19 +106,16 @@ // void CESMRViewerStopDateField::InitializeL() { - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - + iLabel->SetFont( text.Font() ); // This is called so that theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iLabel->FocusChanged( EDrawNow ); } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); } // --------------------------------------------------------------------------- @@ -145,20 +148,13 @@ ( startDate.Month() == endDate.Month() ) && ( startDate.Day() == endDate.Day() ) ) { - iObserver->RemoveControl( FieldId() ); + iObserver->HideControl( FieldId() ); } else // else set the text for end time label { // Read format string from AVKON resource - HBufC* dateFormatString = - iEikonEnv->AllocReadResourceLC( R_QTN_DATE_USUAL_WITH_ZERO ); - HBufC* buf = HBufC::NewLC( KBufferLength ); - TPtr ptr( buf->Des() ); - - endTime.FormatL( ptr, *dateFormatString ); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr ); - iLabel->SetTextL( ptr ); - CleanupStack::PopAndDestroy( 2, dateFormatString ); + iStopTime = endTime; + FormatDateStringL(); } } // --------------------------------------------------------------------------- @@ -171,22 +167,43 @@ TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = NMRLayoutManager::GetLayoutRect( rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -196,6 +213,10 @@ TInt CESMRViewerStopDateField::CountComponentControls() const { TInt count( KComponentCount ); + if( iLockIcon ) + { + ++count; + } return count; } @@ -211,6 +232,8 @@ return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -223,14 +246,77 @@ void CESMRViewerStopDateField::SetOutlineFocusL( TBool aFocus ) { CESMRField::SetOutlineFocusL ( aFocus ); + + iLabel->SetFocus( aFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerStopDateField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerStopDateField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; - iLabel->SetFocus( aFocus ); - - if ( !aFocus ) + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + if ( EMRCmdDoEnvironmentChange == aCommand ) { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); + FormatDateStringL(); + retValue = ETrue; } + + return retValue; } + +// --------------------------------------------------------------------------- +// CESMRViewerStopDateField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerStopDateField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerStopDateField::FormatDateStringL() +// --------------------------------------------------------------------------- +// +void CESMRViewerStopDateField::FormatDateStringL() + { + FUNC_LOG; + + // Read format string from AVKON resource + HBufC* dateFormatString = + iEikonEnv->AllocReadResourceLC( + R_QTN_DATE_USUAL_WITH_ZERO); + + TBuf buf; + iStopTime.FormatL(buf, *dateFormatString); + + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf ); + iLabel->SetTextL( buf ); + CleanupStack::PopAndDestroy( dateFormatString ); + } + // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,10 +21,11 @@ #include "cmrlabel.h" #include "cmrimage.h" #include "mesmrlistobserver.h" +#include "cesmrglobalnote.h" #include -#include -#include +#include +#include #include // DEBUG @@ -54,7 +55,7 @@ { FUNC_LOG; delete iIcon; - delete iLabel; + delete iLockIcon; } // --------------------------------------------------------------------------- @@ -65,6 +66,7 @@ { FUNC_LOG; SetFieldId( EESMRFieldSync ); + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -76,10 +78,10 @@ FUNC_LOG; iLabel = CMRLabel::NewL(); iLabel->SetParent( this ); + CESMRField::ConstructL( iLabel ); // ownership transfered + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapSynchronization ); iIcon->SetParent( this ); - - SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -115,10 +117,10 @@ } default: // There is no replication status set - hide field- this should never happen { - iObserver->RemoveControl( iFieldId ); + iObserver->HideControl( iFieldId ); } } - + if ( statusHolder ) { iLabel->SetTextL( *statusHolder ); @@ -134,20 +136,17 @@ { FUNC_LOG; // Setting Font for the rich text viewer - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - + iLabel->SetFont( text.Font() ); - + // This is called so theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iLabel->FocusChanged( EDrawNow ); } - - AknLayoutUtils::OverrideControlColorL( *iLabel, EColorLabelText, - KRgbBlack ); } // --------------------------------------------------------------------------- @@ -160,24 +159,43 @@ TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -196,6 +214,10 @@ { ++count; } + if ( iLockIcon ) + { + ++count; + } return count; } @@ -211,6 +233,8 @@ return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } @@ -223,14 +247,50 @@ void CESMRViewerSyncField::SetOutlineFocusL( TBool aFocus ) { CESMRField::SetOutlineFocusL ( aFocus ); - - iLabel->SetFocus( aFocus ); + + iLabel->SetFocus( aFocus ); + } - if ( !aFocus ) - { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } - } +// --------------------------------------------------------------------------- +// CESMRViewerSyncField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerSyncField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerSyncField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerSyncField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + return retValue; + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewertimefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewertimefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewertimefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,6 +22,7 @@ #include "nmrlayoutmanager.h" #include "cmrlabel.h" #include "cmrimage.h" +#include "cesmrglobalnote.h" #include #include @@ -30,10 +31,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include // DEBUG #include "emailtrace.h" @@ -42,13 +43,41 @@ namespace{ // codescanner::namespace const TInt KTimeBufferSize( 50 ); + const TInt KTempBufferSize( 20 ); +// Literal for start and end time separator +_LIT(KTimeSeparator," - "); + }//namespace // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- +// CESMRViewerTimeField::CESMRViewerTimeField() +// --------------------------------------------------------------------------- +// +CESMRViewerTimeField::CESMRViewerTimeField() + { + FUNC_LOG; + + SetFieldId( EESMRFieldMeetingTime ); + SetFocusType( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerTimeField::~CESMRViewerTimeField() +// --------------------------------------------------------------------------- +// +CESMRViewerTimeField::~CESMRViewerTimeField() + { + FUNC_LOG; + delete iIcon; + delete iLockIcon; + } + + +// --------------------------------------------------------------------------- // CESMRViewerTimeField::NewL() // --------------------------------------------------------------------------- // @@ -63,14 +92,19 @@ } // --------------------------------------------------------------------------- -// CESMRViewerTimeField::~CESMRViewerTimeField() +// CESMRViewerTimeField::ConstructL() // --------------------------------------------------------------------------- // -CESMRViewerTimeField::~CESMRViewerTimeField() +void CESMRViewerTimeField::ConstructL() { FUNC_LOG; - delete iIcon; - delete iLabel; + + iLabel = CMRLabel::NewL(); + iLabel->SetParent( this ); + CESMRField::ConstructL( iLabel ); // ownership transfered + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapClock ); + iIcon->SetParent( this ); } // --------------------------------------------------------------------------- @@ -80,37 +114,20 @@ void CESMRViewerTimeField::InternalizeL( MESMRCalEntry& aEntry ) { FUNC_LOG; + + CCalEntry& entry = aEntry.Entry(); + + iStartTime = entry.StartTimeL().TimeLocalL(); + iEndTime = entry.EndTimeL().TimeLocalL(); + if ( aEntry.IsAllDayEventL() ) { // set the field as hidden: - iObserver->RemoveControl( FieldId() ); + iObserver->HideControl( FieldId() ); } else { - _LIT(KTimeSeparator," - "); - CCalEntry& entry = aEntry.Entry(); - - TTime startTime = entry.StartTimeL().TimeLocalL(); - TTime endTime = entry.EndTimeL().TimeLocalL(); - - HBufC* timeFormatString = - iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO ); - HBufC* finalBuf = HBufC::NewLC( KTimeBufferSize ); - HBufC* startBuf = HBufC::NewLC( KTempBufferSize ); - HBufC* endBuf = HBufC::NewLC( KTempBufferSize ); - const TInt KNumBuffers( 4 ); - - TPtr startPtr( startBuf->Des() ); - startTime.FormatL( startPtr, *timeFormatString ); - TPtr endPtr( endBuf->Des() ); - endTime.FormatL( endPtr, *timeFormatString ); - TPtr finalPtr( finalBuf->Des() ); - finalPtr.Append( startPtr ); - finalPtr.Append( KTimeSeparator ); - finalPtr.Append( endPtr ); - AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalPtr ); - iLabel->SetTextL( finalPtr ); - CleanupStack::PopAndDestroy( KNumBuffers, timeFormatString ); + FormatTimeFieldStringL(); } } @@ -120,19 +137,18 @@ // void CESMRViewerTimeField::InitializeL() { - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), + FUNC_LOG; + + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); - + iLabel->SetFont( text.Font() ); // This is called so that theme changes will apply when changing theme "on the fly" if ( IsFocused() ) { iLabel->FocusChanged( EDrawNow ); } - - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); } // --------------------------------------------------------------------------- @@ -141,28 +157,49 @@ // void CESMRViewerTimeField::SizeChanged() { + FUNC_LOG; + TRect rect = Rect(); TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = rowLayoutRect.Rect(); - + TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutTextEditorIcon ); AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iLabel->SetRect( viewerRect ); + // Move focus rect so that it's relative to field's position. - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - TAknLayoutText labelLayout = - NMRLayoutManager::GetLayoutText( - rect, NMRLayoutManager::EMRTextLayoutTextEditor ); - iLabel->SetRect( labelLayout.TextRect() ); + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + // Setting font also for the label + iLabel->SetFont( viewerLayoutText.Font() ); } // --------------------------------------------------------------------------- @@ -171,7 +208,23 @@ // TInt CESMRViewerTimeField::CountComponentControls() const { - TInt count( 2 ); + FUNC_LOG; + + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iLabel ) + { + ++count; + } + + if ( iLockIcon ) + { + ++count; + } return count; } @@ -181,54 +234,108 @@ // CCoeControl* CESMRViewerTimeField::ComponentControl( TInt aIndex ) const { + FUNC_LOG; + switch ( aIndex ) { case 0: return iIcon; case 1: return iLabel; + case 2: + return iLockIcon; default: return NULL; } } // --------------------------------------------------------------------------- -// CESMRViewerTimeField::CESMRViewerTimeField() -// --------------------------------------------------------------------------- -// -CESMRViewerTimeField::CESMRViewerTimeField() - { - SetFieldId( EESMRFieldMeetingTime ); - SetFocusType( EESMRHighlightFocus ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerTimeField::ConstructL() -// --------------------------------------------------------------------------- -// -void CESMRViewerTimeField::ConstructL() - { - iLabel = CMRLabel::NewL(); - iLabel->SetParent( this ); - iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapClock ); - iIcon->SetParent( this ); - } - -// --------------------------------------------------------------------------- // CESMRViewerTimeField::SetOutlineFocusL() // --------------------------------------------------------------------------- // void CESMRViewerTimeField::SetOutlineFocusL( TBool aFocus ) { + FUNC_LOG; + CESMRField::SetOutlineFocusL ( aFocus ); + + iLabel->SetFocus( aFocus ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerTimeField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CESMRViewerTimeField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool retValue( EFalse ); - iLabel->SetFocus( aFocus ); + if( (aCommand == EAknCmdOpen) && IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + retValue = ETrue; + } + + if ( EMRCmdDoEnvironmentChange == aCommand ) + { + FormatTimeFieldStringL(); + retValue = ETrue; + } + + return retValue; + } - if ( !aFocus ) - { - AknLayoutUtils::OverrideControlColorL ( *iLabel, EColorLabelText, - KRgbBlack ); - } +// --------------------------------------------------------------------------- +// CESMRViewerTimeField::LockL() +// --------------------------------------------------------------------------- +// +void CESMRViewerTimeField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerTimeField::FormatTimeFieldStringL() +// --------------------------------------------------------------------------- +// +void CESMRViewerTimeField::FormatTimeFieldStringL() + { + HBufC* timeFormatString = + iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO ); + + HBufC* finalBuf = HBufC::NewLC( KTimeBufferSize ); + HBufC* startBuf = HBufC::NewLC( KTempBufferSize ); + HBufC* endBuf = HBufC::NewLC( KTempBufferSize ); + const TInt KNumBuffers( 4 ); + + TPtr startPtr( startBuf->Des() ); + iStartTime.FormatL( startPtr, *timeFormatString ); + TPtr endPtr( endBuf->Des() ); + iEndTime.FormatL( endPtr, *timeFormatString ); + TPtr finalPtr( finalBuf->Des() ); + finalPtr.Append( startPtr ); + finalPtr.Append( KTimeSeparator ); + finalPtr.Append( endPtr ); + AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalPtr ); + iLabel->SetTextL( finalPtr ); + CleanupStack::PopAndDestroy( KNumBuffers, timeFormatString ); + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmralarmonofffield.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmralarmonofffield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,410 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR alarm on off field implementation +* +*/ + +#include "emailtrace.h" +#include "cmralarmonofffield.h" +#include "cmrlabel.h" +#include "cmrimage.h" +#include "mesmrcalentry.h" +#include "mesmrlistobserver.h" +#include "mesmrfieldvalidator.h" +#include "nmrlayoutmanager.h" + +#include +#include +#include +#include + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::NewL +// --------------------------------------------------------------------------- +// +CMRAlarmOnOffField* CMRAlarmOnOffField::NewL( MESMRFieldValidator* aValidator ) + { + FUNC_LOG; + CMRAlarmOnOffField* self = new (ELeave) CMRAlarmOnOffField(); + CleanupStack::PushL ( self ); + self->ConstructL ( aValidator ); + CleanupStack::Pop ( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::CMRAlarmOnOffField +// --------------------------------------------------------------------------- +// +CMRAlarmOnOffField::CMRAlarmOnOffField() + { + FUNC_LOG; + iStatus = ETrue; + + SetFieldId ( EESMRFieldAlarmOnOff ); + SetFocusType ( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::ConstructL +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::ConstructL( MESMRFieldValidator* aValidator ) + { + FUNC_LOG; + iValidator = aValidator; + iValidator->SetAbsoluteAlarmOnOffFieldL( *this ); + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarm ); + iIcon->SetParent( this ); + + iLabel = CMRLabel::NewL(); + CESMRField::ConstructL( iLabel ); // ownership transfered + iLabel->SetTextL( KNullDesC() ); + iLabel->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::~CMRAlarmOnOffField +// --------------------------------------------------------------------------- +// +CMRAlarmOnOffField::~CMRAlarmOnOffField( ) + { + FUNC_LOG; + delete iIcon; + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::InternalizeL +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::InternalizeL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + if ( aEntry.IsStoredL() ) // entry is already stored in db + { + MESMRCalEntry::TESMRAlarmType alarmType; + TTime alarmTime; + aEntry.GetAlarmL( alarmType, alarmTime ); + + switch( alarmType ) + { + //flow through + case MESMRCalEntry::EESMRAlarmAbsolute: + case MESMRCalEntry::EESMRAlarmRelative: // Show alarm as - ON + { + iStatus = ETrue; + } + break; + //flow through + case MESMRCalEntry::EESMRAlarmNotFound: + default: // Show alarm as - OFF + { + iStatus = EFalse; + } + break; + } + } + else // This is a new entry and default implementation is required + { + switch( aEntry.Type() ) + { + case MESMRCalEntry::EESMRCalEntryTodo: // To-do + { + TTime alarmTime; + MESMRCalEntry::TESMRAlarmType alarmType; + aEntry.GetAlarmL (alarmType, alarmTime ); + + // Change status to "ON" if alarm has been set by default + iStatus = alarmType != MESMRCalEntry::EESMRAlarmNotFound; + } + break; + // Flow through + case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Meeting request + case MESMRCalEntry::EESMRCalEntryMeeting: // Meeting + { + iStatus = ETrue;// Change the status to "ON" for these dialog default + } + break; + + case MESMRCalEntry::EESMRCalEntryAnniversary: // Anniversary + { + iStatus = ETrue;// Change the status to "ON" for these dialog default + } + break; + // Flow through + case MESMRCalEntry::EESMRCalEntryMemo: // Memo + case MESMRCalEntry::EESMRCalEntryReminder: // Reminder + + default: + iStatus = EFalse; // Change the status to "OFF" for these dialog default + break; + } + } + ResetFieldL(); + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRAlarmOnOffField::OfferKeyEventL( const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TKeyResponse response( EKeyWasNotConsumed ); + if ( aType == EEventKey ) + { + switch( aEvent.iScanCode ) + { + // Flowthrough, doesn't matter which key was pressed since + // the value is always changes from "off" to "on" or vice versus. + case EStdKeyDevice3: // selection key + case EStdKeyLeftArrow: + case EStdKeyRightArrow: + iStatus = !iStatus; // change status + ResetFieldL(); + response = EKeyWasConsumed; + break; + + default: + break; + } + } + return response; + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::SetOutlineFocusL +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::SetOutlineFocusL( TBool aFocus ) + { + FUNC_LOG; + CESMRField::SetOutlineFocusL( aFocus ); + + iLabel->SetFocus( aFocus ); + + if( aFocus ) //Focus is gained on the field + { + if ( iStatus ) + { + ChangeMiddleSoftKeyL( EESMRCmdAlarmOff,R_QTN_MEET_REQ_ALARM_OFF ); //R_TEXT_SOFTKEY_OFF + } + else + { + ChangeMiddleSoftKeyL( EESMRCmdAlarmOn,R_QTN_MEET_REQ_ALARM_ON ); //R_TEXT_SOFTKEY_ON + } + } + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::MakeVisible +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::MakeVisible( TBool aVisible ) + { + FUNC_LOG; + CCoeControl::MakeVisible( aVisible ); + if ( iObserver ) + { + TRAP_IGNORE( ResetFieldL() ); + } + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::ExecuteGenericCommandL() +// --------------------------------------------------------------------------- +// +TBool CMRAlarmOnOffField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + TBool isUsed( EFalse ); + // EAknCmdOpen is added for the Pointer events, see ListPane + if( aCommand == EESMRCmdAlarmOn || aCommand == EESMRCmdAlarmOff + || aCommand == EAknCmdOpen ) + { + SwitchMiddleSoftKeyL(); + isUsed = ETrue; + + HandleTactileFeedbackL(); + } + return isUsed; + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::SwitchMiddleSoftKeyL +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::SwitchMiddleSoftKeyL() + { + FUNC_LOG; + iStatus = !iStatus; // change status + ResetFieldL(); + if( iStatus ) + { + ChangeMiddleSoftKeyL( EESMRCmdAlarmOff,R_QTN_MEET_REQ_ALARM_OFF ); + } + else + { + ChangeMiddleSoftKeyL( EESMRCmdAlarmOn,R_QTN_MEET_REQ_ALARM_ON ); + } + + if( iLabel->IsVisible() ) + { + iLabel->DrawDeferred(); + } + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::ResetFieldL +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::ResetFieldL() + { + FUNC_LOG; + iValidator->SetAlarmOnOffL( iStatus ); + + HBufC* buf = StringLoader::LoadLC( iStatus ? + R_QTN_MEET_REQ_ALARM_ON : + R_QTN_MEET_REQ_ALARM_OFF ); + + iLabel->SetTextL( *buf ); + CleanupStack::PopAndDestroy( buf ); + + // if status on 'on', add time and date fields for + // all day event alert, otherwise remove them. + // if this field is not visible -> alldayevent not set + // let's not show the date and time fields either. + if ( iStatus && IsVisible() ) + { + iObserver->ShowControl ( EESMRFieldAlarmTime ); + iObserver->ShowControl ( EESMRFieldAlarmDate ); + } + else + { + iObserver->HideControl ( EESMRFieldAlarmTime ); + iObserver->HideControl ( EESMRFieldAlarmDate ); + } + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::SizeChanged() +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::SizeChanged() + { + FUNC_LOG; + TRect rect = Rect(); + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + rect = rowLayoutRect.Rect(); + + TAknWindowComponentLayout iconLayout = + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ); + AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect bgRect( bgLayoutRect.Rect() ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + iLabel->SetRect( labelLayout.TextRect() ); + + // Setting font for the label also + iLabel->SetFont( labelLayout.Font() ); + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::CountComponentControls() +// --------------------------------------------------------------------------- +// +TInt CMRAlarmOnOffField::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iLabel ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::ComponentControl() +// --------------------------------------------------------------------------- +// +CCoeControl* CMRAlarmOnOffField::ComponentControl( TInt aIndex ) const + { + FUNC_LOG; + switch ( aIndex ) + { + case 0: + return iIcon; + case 1: + return iLabel; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + FUNC_LOG; + CCoeControl::SetContainerWindowL( aContainer ); + iLabel->SetContainerWindowL( aContainer ); + iLabel->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::SetAbsoluteAlarmOn +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::SetAbsoluteAlarmOn() + { + FUNC_LOG; + iStatus = ETrue; + } + +// --------------------------------------------------------------------------- +// CMRAlarmOnOffField::SetAbsoluteAlarmOn +// --------------------------------------------------------------------------- +// +void CMRAlarmOnOffField::SetAbsoluteAlarmOff() + { + FUNC_LOG; + iStatus = EFalse; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR attahcment field implementation + * + */ +#include "cmrattachmentcommand.h" +#include +#include + +// DEBUG +#include "emailtrace.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRAttachmentCommand::CMRAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRAttachmentCommand::CMRAttachmentCommand() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommand::CMRAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRAttachmentCommand::~CMRAttachmentCommand() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentCommand::GetMimeTypeL +// ----------------------------------------------------------------------------- +// +TDataType CMRAttachmentCommand::GetMimeType( RFile& aFile ) + { + FUNC_LOG; + TDataType dataType; + RApaLsSession aApaSession; + if( aFile.SubSessionHandle() ) + { + TInt error(0); + + if( !aApaSession.Handle() ) + { + error = aApaSession.Connect(); + } + if( error == KErrNone ) + { + TDataRecognitionResult recognitionResult; + error = aApaSession.RecognizeData( aFile, recognitionResult ); + if( recognitionResult.iConfidence != + CApaDataRecognizerType::ENotRecognized && + error == KErrNone ) + { + dataType = recognitionResult.iDataType; + } + } + } + + aApaSession.Close(); + return dataType; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,880 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR attahcment field implementation + * + */ + +#include "cmrattachmentcommandhandler.h" +#include "cmropenattachmentcommand.h" +#include "cmrremoveattachmentcommand.h" +#include "cmrsaveattachmentcommand.h" +#include "cmrsaveandopenattachmentcommand.h" +#include "cesmrrichtextlink.h" +#include "mcalremoteattachmentinfo.h" +#include "mcalremoteattachment.h" +#include "mcalremoteattachmentoperation.h" +#include "ccalremoteattachmentinfo.h" +#include "ccalremoteattachmentapi.h" +#include "cesmrgenericfieldevent.h" +#include "cesmrfieldcommandevent.h" +#include "mesmrfieldeventqueue.h" +#include "esmrdef.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + + +// unnamed namespace for local definitions +namespace { // codescanner::namespace + +_LIT8( KUnknownDatatype, "unknown"); + +#if defined(_DEBUG) + +// Panic literal +_LIT( KMRAttachmentCommandHandler, "MRAttachmentCommandHandler" ); + +/** + * Panic codes + */ +enum TMRAttachmentCommandHandlerPanic + { + // Invalid command + EMRAttachmentCommandHandlerInvalidCommand, + // Attachment is not found + EMRAttachmentCommandHandlerAttachmentNotFound, + // Remote attachment information not set + EMRAttachmentCommandHandlerRemoteInfoNotSet, + // Remote command cannot be found + EMRAttachmentCommandHandlerRemoteCommandNotFound, + // Remote attachment is not found + EMRAttachmentCommandHandlerRemoteAttachmentNotFound + }; + +void Panic( TMRAttachmentCommandHandlerPanic aPanic ) + { + User::Panic( KMRAttachmentCommandHandler, aPanic ); + } + +#endif // _DEBUG + +/** + * Shows information note when one attachment is saved. + */ +void ShowInfoNoteL() + { + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + HBufC* text = + StringLoader::LoadLC( R_MEET_REQ_INFO_NOTE_ONE_ATTACHMENT_SAVED ); + note->ShowNoteL( + EAknGlobalInformationNote, + *text ); + CleanupStack::PopAndDestroy( 2, note ); + } + +/** + * Shows information note when multiple attachments have been saved. + */ +void ShowInfoNoteL( TInt aAttachmentCount ) + { + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + HBufC* text = StringLoader::LoadLC( + R_MEET_REQ_INFO_NOTE_MULTIPLE_ATTACHMENTS_SAVED, + aAttachmentCount ); + note->ShowNoteL( + EAknGlobalInformationNote, + *text ); + CleanupStack::PopAndDestroy( 2, note ); + } + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::CMRAttachmentCommandHandler +// --------------------------------------------------------------------------- +// +CMRAttachmentCommandHandler::CMRAttachmentCommandHandler( + CCalEntry& aEntry, + MESMRFieldEventQueue& aEventQueue) : + iEntry( aEntry ), + iEventQueue( aEventQueue ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::~CMRAttachmentCommandHandler +// --------------------------------------------------------------------------- +// +CMRAttachmentCommandHandler::~CMRAttachmentCommandHandler() + { + FUNC_LOG; + + iDownloadOperations.ResetAndDestroy(); + delete iDocHandler; + } + + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::NewL +// --------------------------------------------------------------------------- +// +CMRAttachmentCommandHandler* CMRAttachmentCommandHandler::NewL( + CCalEntry& aEntry, + MESMRFieldEventQueue& aEventQueue ) + { + FUNC_LOG; + + CMRAttachmentCommandHandler* self = + new (ELeave) CMRAttachmentCommandHandler( aEntry, aEventQueue ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::ConstructL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::ConstructL() + { + FUNC_LOG; + + iDocHandler = CDocumentHandler::NewL(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::HandleAttachmentCommandL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::HandleAttachmentCommandL( + TInt aCommandId, + const CESMRRichTextLink& aSelectedLink ) + { + FUNC_LOG; + + TInt attachmentIndex( ResolveAttachmentIndexL( aSelectedLink.Value() ) ); + HandleAttachmentCommandInternalL( aCommandId, attachmentIndex ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::IsRemoteAttachmentL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentCommandHandler::IsRemoteAttachmentL( + const CESMRRichTextLink& aSelectedLink ) + { + FUNC_LOG; + + TInt index = ResolveAttachmentIndexL( aSelectedLink.Value() ); + + CCalAttachment* attachment = iEntry.AttachmentL( index ); + + TBool remoteAttachment( ETrue ); + + if ( CCalAttachment::EFile == attachment->Type() ) + { + remoteAttachment = EFalse; + } + + return remoteAttachment; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::SetRemoteAttachmentInformationL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::SetRemoteAttachmentInformationL( + CCalRemoteAttachmentApi& aRemoteAttaApi, + CCalRemoteAttachmentInfo& aAttachmentInfo ) + { + FUNC_LOG; + + iRemoteAttachmentApi = &aRemoteAttaApi; + iAttachmentInfo = &aAttachmentInfo; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::SetRemoteAttachmentInformationL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::HandleRemoteAttachmentCommandL( + TInt aCommandId, + const CESMRRichTextLink& aSelectedLink ) + { + FUNC_LOG; + + // Check that remote attachment information is being set + __ASSERT_DEBUG( + iRemoteAttachmentApi, + Panic(EMRAttachmentCommandHandlerRemoteInfoNotSet) ); + + __ASSERT_DEBUG( + iAttachmentInfo, + Panic(EMRAttachmentCommandHandlerRemoteInfoNotSet) ); + + HandleRemoteAttachmentCommandInternalL( + aCommandId, + aSelectedLink.Value() ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::RemoteOperations +// --------------------------------------------------------------------------- +// +RPointerArray& + CMRAttachmentCommandHandler::RemoteOperations() + { + FUNC_LOG; + return iDownloadOperations; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::CurrentCommandInProgress +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentCommandHandler::CurrentCommandInProgress() const + { + FUNC_LOG; + + return iCommandInProgress; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::Progress +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::Progress( + MCalRemoteAttachmentOperation* aOperation, + TInt aPercentageCompleted ) + { + FUNC_LOG; + + TRAP_IGNORE( NotifyProgressL( + aOperation->AttachmentInformation().AttachmentLabel(), + aPercentageCompleted )); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::OperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::OperationCompleted( + MCalRemoteAttachmentOperation* aOperation, + RFile& aAttachment ) + { + FUNC_LOG; + + TRAP_IGNORE( HandleOperationCompletedL( aOperation, aAttachment ) ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::OperationError +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::OperationError( + MCalRemoteAttachmentOperation* /*aOperation*/, + TInt aErrorCode ) + { + FUNC_LOG; + + // Operation failed or cancelled, hide download indicator + TRAP_IGNORE( HideDownloadIndicatorL() ); + iCommandInProgress = 0; + + if ( aErrorCode != KErrCancel ) + { + // Operation failed, show error note + CCoeEnv::Static()->HandleError( aErrorCode ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::ResolveAttachmentIndexL +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentCommandHandler::ResolveAttachmentIndexL( + const TDesC& aAttachmentLabel ) + { + FUNC_LOG; + + TInt index( KErrNotFound ); + + TInt attachmentCount( iEntry.AttachmentCountL() ); + for (TInt i(0); i < attachmentCount && KErrNotFound == index; ++i ) + { + CCalAttachment* attachment = iEntry.AttachmentL(i); + + TPtrC attachmentLabel( attachment->Label() ); + if ( !aAttachmentLabel.Compare(attachmentLabel) ) + { + index = i; + } + } + + // Check that attachment is always found + // If attachment is not found --> Our data is corrupted + __ASSERT_DEBUG( + KErrNotFound != index, + Panic( EMRAttachmentCommandHandlerAttachmentNotFound) ); + + return index; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::ResolveAttachmentIndexL +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentCommandHandler::CommandIndex( + const TDesC& aAttachmentLabel ) + { + FUNC_LOG; + + TInt index( KErrNotFound ); + + TInt commandCount( iDownloadOperations.Count() ); + for ( TInt i(0); i < commandCount && KErrNotFound == index; ++i ) + { + // There are download operations in progress + const MCalRemoteAttachment& attachInfo = + iDownloadOperations[i]->AttachmentInformation(); + + TPtrC label( attachInfo.AttachmentLabel() ); + if ( !label.Compare( aAttachmentLabel ) ) + { + index = i; + } + } + + return index; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::RemoteAttachmentIndex +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentCommandHandler::RemoteAttachmentIndexL( + const TDesC& aAttachmentLabel ) + { + FUNC_LOG; + + TInt index( KErrNotFound ); + + TInt remoteAttCount( iAttachmentInfo->AttachmentCount() ); + for ( TInt i(0); i < remoteAttCount && index == KErrNotFound; ++i ) + { + TPtrC remoteAttName( iAttachmentInfo->AttachmentL(i).AttachmentLabel() ); + + if ( !remoteAttName.Compare( aAttachmentLabel ) ) + { + index = i; + } + } + + return index; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::HandleOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::HandleOperationCompletedL( + MCalRemoteAttachmentOperation* aOperation, + RFile& aAttachment ) + { + FUNC_LOG; + + // Notify 'download ready' event + CESMRFieldCommandEvent* event = CESMRFieldCommandEvent::NewLC( + NULL, + EMRCmdHideAttachmentIndicator ); + + iEventQueue.NotifyEventAsyncL( event ); + + CleanupStack::Pop( event ); + + // First search the correct operation from the list + TInt operationIndex( CommandIndex(aOperation->AttachmentInformation().AttachmentLabel() ) ); + + __ASSERT_DEBUG( + operationIndex != KErrNotFound, + Panic( EMRAttachmentCommandHandlerRemoteCommandNotFound) ); + + // Resolve current download operation in progress + MCalRemoteAttachmentOperation* operation = iDownloadOperations[ operationIndex ]; + CleanupDeletePushL( operation ); + iDownloadOperations.Remove( operationIndex ); + + TInt attachmentIndex( ResolveAttachmentIndexL( + operation->AttachmentInformation().AttachmentLabel() ) ); + + if ( KErrNotFound == attachmentIndex ) + { + User::Leave( KErrNotFound ); + } + + if ( EESMRViewerCancelAttachmentDownload != iCommandInProgress ) + { + // Update the remote attachment to be local attachment ... + UpdateLocalAttachmentL( + operation->AttachmentInformation().AttachmentLabel(), + aAttachment, + attachmentIndex ); + } + + // Then execute normal local file attachment command + if ( EESMRViewerOpenAttachment == iCommandInProgress || + EESMRViewerSaveAttachment == iCommandInProgress || + EESMRViewerSaveAllAttachments == iCommandInProgress ) + { + TInt attachmentIndex( + ResolveAttachmentIndexL( + operation->AttachmentInformation().AttachmentLabel() ) ); + + if ( EESMRViewerOpenAttachment == iCommandInProgress ) + { + // When opening attachment from remote storage --> Ask user to + // save attachment first as well. + HandleAttachmentCommandInternalL( + EESMRViewerOpenAndSaveAttachment, attachmentIndex ); + + iCommandInProgress = 0; + } + else + { + HandleAttachmentCommandInternalL( + EESMRViewerSaveAttachment, attachmentIndex ); + + if ( EESMRViewerSaveAllAttachments == iCommandInProgress && + iAttachmentInfo->AttachmentCount() ) + { + iCommandInProgress = 0; + + // There are more attachments to be downloaded --> Download next + SaveNextRemoteAttachmentL(); + } + else + { + if ( !iAttachmentInfo->AttachmentCount() ) + { + // All remote attachments have been saved. Show info note. + ShowInfoNoteL( iEntry.AttachmentCountL() ); + } + iCommandInProgress = 0; + } + } + } + + CleanupStack::PopAndDestroy( operation ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::HandleAttachmentCommandInternalL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::HandleAttachmentCommandInternalL( + TInt aCommandId, + TInt aAttachmentIndex ) + { + FUNC_LOG; + + if ( iDownloadOperations.Count() ) + { + // Cancel ongoing remote operations ... + iDownloadOperations.ResetAndDestroy(); + } + + CMRAttachmentCommand* command = NULL; + + // Creating command + switch ( aCommandId ) + { + case EESMRViewerOpenAttachment: + case EESMREditorOpenAttachment: + { + command = CMROpenAttachmentCommand::NewL( *iDocHandler ); + } + break; + case EESMREditorRemoveAttachment: + case EESMREditorRemoveAllAttachments: + { + command = CMRRemoveAttachmentCommand::NewL(); + } + break; + case EESMRViewerSaveAttachment: + { + command = CMRSaveAttachmentCommand::NewL( *iDocHandler ); + } + break; + case EESMRViewerOpenAndSaveAttachment: + { + command = CMRSaveAndOpenAttachmentCommand::NewL( *iDocHandler ); + } + break; + case EESMRViewerSaveAllAttachments: + { + SaveAllAttachmentsL(); + } + break; + default: + break; + } + + if ( command ) + { + CleanupDeletePushL( command ); + + // Executing command. TRAP errors so cancellation can be handled + // without an extra error note. + TRAPD( error, + ExecuteCommandL( aCommandId, *command, aAttachmentIndex ) ) + + if ( error != KErrCancel ) + { + User::LeaveIfError( error ); + + if ( aCommandId == EESMRViewerSaveAttachment + && iCommandInProgress != EESMRViewerSaveAllAttachments ) + { + ShowInfoNoteL(); + } + } + else // KErrCancel + { + iCommandInProgress = 0; + } + + CleanupStack::PopAndDestroy( command ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::UpdateLocalAttachmentL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::UpdateLocalAttachmentL( + const TDesC& aAttachmentLabel, + RFile& aAttachment, + TInt aAttachmentIndex ) + { + FUNC_LOG; + + // Create file attachment and add to calendar entry + CCalAttachment* fileAttachment = CCalAttachment::NewFileL( aAttachment ); + CleanupStack::PushL( fileAttachment ); + + RApaLsSession apaSession; + TDataRecognitionResult dataType; + User::LeaveIfError( apaSession.Connect() ); + apaSession.RecognizeData( aAttachment, dataType ); + apaSession.Close(); + + // set attachment properties + TPtrC8 contentType( dataType.iDataType.Des8() ); + + if ( contentType.Length() ) + { + fileAttachment->SetMimeTypeL( contentType ); + } + else + { + fileAttachment->SetMimeTypeL( KUnknownDatatype ); + } + + fileAttachment->SetLabelL( aAttachmentLabel ); + iEntry.AddAttachmentL( *fileAttachment ); // calEntry takes ownership + CleanupStack::Pop( fileAttachment ); + + // Remove remote attachment + CCalAttachment* attachment = iEntry.AttachmentL( aAttachmentIndex ); + iEntry.DeleteAttachmentL( *attachment ); + attachment = NULL; + + TInt remoteAttachmentIndex( RemoteAttachmentIndexL( aAttachmentLabel ) ); + if ( KErrNotFound != remoteAttachmentIndex ) + { + iAttachmentInfo->RemoveAttachmentAtL( remoteAttachmentIndex ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::NotifyProgressL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::NotifyProgressL( + const TDesC& aAttachmentLabel, + TInt aPercentageCompleted ) + { + FUNC_LOG; + + CDesCArray* descArray = new (ELeave) CDesCArrayFlat( 1 ); + CleanupStack::PushL( descArray ); + descArray->AppendL( aAttachmentLabel ); + CArrayFix* intArray = new (ELeave) CArrayFixFlat( 1 ); + CleanupStack::PushL( intArray ); + intArray->AppendL( aPercentageCompleted ); + + HBufC* statusText = StringLoader::LoadL( + R_QTN_MEET_REQ_ATTACHMENTS_DOWNLOAD_PREFIX, + *descArray, + *intArray ); + + CleanupStack::PushL( statusText ); + + // Create field change event + CESMRGenericFieldEvent* event = CESMRGenericFieldEvent::NewLC( + NULL, + MESMRFieldEvent::EESMRFieldChangeEvent ); + + // Add this field as parameter + TInt fieldId = EESMRFieldViewerAttachments; + CESMRFieldEventValue* field = CESMRFieldEventValue::NewLC( + MESMRFieldEventValue::EESMRInteger, + &fieldId ); + event->AddParamL( field ); + CleanupStack::Pop( field ); + + // Add new value as parameter + CESMRFieldEventValue* value = CESMRFieldEventValue::NewLC( + CESMRFieldEventValue::EESMRString, + statusText ); + + // Encapsulate value, so receiver gets the field value type + event->AddParamL( value, ETrue ); + CleanupStack::Pop( value ); + + // Send event + iEventQueue.NotifyEventAsyncL( event ); + CleanupStack::Pop( event ); + + // Ownership transferred to field event value + CleanupStack::Pop( statusText ); + CleanupStack::PopAndDestroy( intArray ); + CleanupStack::PopAndDestroy( descArray ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::HandleRemoteAttachmentCommandInternalL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::HandleRemoteAttachmentCommandInternalL( + TInt aCommandId, + const TDesC& aRemoteAttachmentLabel ) + { + FUNC_LOG; + + // Fetch correct attachment from the entry + TInt index = ResolveAttachmentIndexL( aRemoteAttachmentLabel ); + CCalAttachment* attachment = iEntry.AttachmentL( index ); + + if ( CCalAttachment::EFile == attachment->Type() ) + { + // This is local attachment ... + User::Leave( KErrArgument ); + } + + switch ( aCommandId ) + { + case EESMRViewerOpenAttachment: + case EESMRViewerSaveAttachment: + { + TInt remoteAttIndex( + RemoteAttachmentIndexL( aRemoteAttachmentLabel ) ); + + RPointerArray attachmentArray; + CleanupClosePushL( attachmentArray ); + const MCalRemoteAttachment& remoteAttachment( + iAttachmentInfo->AttachmentL(remoteAttIndex) ); + attachmentArray.Append( &remoteAttachment ); + + if ( !iCommandInProgress ) + { + // There are no ongoing command for this attachment + // ==> We can start new one ... + + iCommandInProgress = aCommandId; + + // Before we can execute the actual command, we need to be sure + // that attachments are being downloaded to device. + iRemoteAttachmentApi->DownloadAttachmentsL( + attachmentArray, + iDownloadOperations, + *this ); + } + + CleanupStack::PopAndDestroy( &attachmentArray ); + } + break; + + case EESMRViewerCancelAttachmentDownload: + { + if ( EESMRViewerSaveAllAttachments == iCommandInProgress ) + { + iCommandInProgress = aCommandId; + iDownloadOperations.ResetAndDestroy(); + } + else + { + // Cancelling is done by simply deleting the command + iCommandInProgress = aCommandId; + TInt remoteCommand( CommandIndex( + aRemoteAttachmentLabel )); + + MCalRemoteAttachmentOperation* command = + iDownloadOperations[remoteCommand]; + + iDownloadOperations.Remove( remoteCommand ); + delete command; + } + } + break; + case EESMRViewerSaveAllAttachments: + { + SaveAllAttachmentsL(); + } + break; + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::HideDownloadIndicatorL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::HideDownloadIndicatorL() + { + FUNC_LOG; + + CESMRFieldCommandEvent* event = CESMRFieldCommandEvent::NewLC( + NULL, + EMRCmdHideAttachmentIndicator ); + iEventQueue.NotifyEventAsyncL(event); + CleanupStack::Pop(event); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::ExecuteCommandL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::ExecuteCommandL( + TInt aCommandId, + CMRAttachmentCommand& aCommand, + TInt aAttachmentIndex ) + { + // Executing command + switch ( aCommandId ) + { + case EESMREditorRemoveAllAttachments: + { + for( TInt i = iEntry.AttachmentCountL() ; i > 0; --i ) + { + aCommand.ExecuteAttachmentCommandL( iEntry, i - 1 ); + } + } + case EESMRViewerSaveAllAttachments: + { + for( TInt i = 0; i < iEntry.AttachmentCountL(); ++i ) + { + aCommand.ExecuteAttachmentCommandL( iEntry, i ); + } + } + break; + default: + { + aCommand.ExecuteAttachmentCommandL( iEntry, aAttachmentIndex ); + } + break; + } + + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::SaveAllAttachmentsL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::SaveAllAttachmentsL() + { + // Save local attachments + CMRAttachmentCommand* command = + CMRSaveAttachmentCommand::NewL( *iDocHandler ); + + TRAPD( error, + ExecuteCommandL( EESMRViewerSaveAllAttachments, *command, 0 ) ) + + delete command; + + if ( error != KErrCancel ) + { + // Check if error happened during local attachment saving + User::LeaveIfError( error ); + + // Proceed with remote attachments + if ( iAttachmentInfo->AttachmentCount() > 0 ) + { + SaveNextRemoteAttachmentL(); + } + else // Show Save all info note + { + ShowInfoNoteL( iEntry.AttachmentCountL() ); + } + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentCommandHandler::SaveNextRemoteAttachmentL +// --------------------------------------------------------------------------- +// +void CMRAttachmentCommandHandler::SaveNextRemoteAttachmentL() + { + __ASSERT_DEBUG( iAttachmentInfo->AttachmentCount() > 0, + Panic( EMRAttachmentCommandHandlerRemoteAttachmentNotFound ) ); + + // Save first remote attachment of attachment info + RPointerArray attachmentArray; + CleanupClosePushL( attachmentArray ); + const MCalRemoteAttachment& remoteAttachment( + iAttachmentInfo->AttachmentL( 0 ) ); + attachmentArray.AppendL( &remoteAttachment ); + + if ( !iCommandInProgress ) + { + // There are no ongoing command for this attachment + // ==> We can start new one ... + iCommandInProgress = EESMRViewerSaveAllAttachments; + + // Before we can execute the actual command, we need to be sure + // that attachments are being downloaded to device. + iRemoteAttachmentApi->DownloadAttachmentsL( + attachmentArray, + iDownloadOperations, + *this ); + } + + CleanupStack::PopAndDestroy( &attachmentArray ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentsfield.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentsfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,1040 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR attahcment field implementation + * + */ +#include "cmrattachmentsfield.h" + +#include "mesmrlistobserver.h" +#include "mesmrmeetingrequestentry.h" +#include "cmrlabel.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" +#include "cmrimage.h" +#include "cesmrrichtextviewer.h" +#include "cesmreditor.h" +#include "cesmrrichtextlink.h" +#include "cmrattachmentcommandhandler.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + + +// unnamed namespace for local definitions +namespace { // codescanner::namespace +//CONSTANTS + +// TODO: Read default text from resource +_LIT( KAddAttachment, "Add attachment" ); +_LIT( KNewLine, "\f" ); + +const TInt KOneKiloByte( 1024 ); +const TInt KOneMegaByte( 1048576 ); // (1024^2 or 2^20): +const TInt KMargin = 5; + +/** + * Checks that command is valid attachment viewer command. + * @param aCommmand Command ID + */ +TBool IsValidAttachmentEditorCommand( TInt aCommand ) + { + TBool ret( EFalse ); + + switch( aCommand ) + { + case EESMREditorOpenAttachment: + case EESMREditorRemoveAttachment: + case EESMREditorRemoveAllAttachments: + case EESMREditorAddAttachment: + ret = ETrue; + break; + + default: + ret = EFalse; + break; + } + + return ret; + } + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::CMRAttachmentsField +// --------------------------------------------------------------------------- +// +CMRAttachmentsField::CMRAttachmentsField() + { + FUNC_LOG; + SetFocusType( EESMRHighlightFocus ); + SetFieldId( EESMRFieldAttachments ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::~CMRAttachmentsField +// --------------------------------------------------------------------------- +// +CMRAttachmentsField::~CMRAttachmentsField( ) + { + FUNC_LOG; + delete iBgCtrlContext; + delete iFieldIcon; + delete iTitle; + delete iAttCommandHandler; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::NewL +// --------------------------------------------------------------------------- +// +CMRAttachmentsField* CMRAttachmentsField::NewL() + { + FUNC_LOG; + CMRAttachmentsField* self = new( ELeave )CMRAttachmentsField(); + CleanupStack::PushL ( self ); + self->ConstructL(); + CleanupStack::Pop ( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::ConstructL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::ConstructL() + { + FUNC_LOG; + + SetComponentsToInheritVisibility( ETrue ); + + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAttachment ); + iFieldIcon->SetParent( this ); + + iTitle = CMRLabel::NewL(); + iTitle->SetParent( this ); + + iRichTextViewer = CESMRRichTextViewer::NewL( this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transferred + iRichTextViewer->SetEdwinSizeObserver ( this ); + iRichTextViewer->SetLinkObserver (this ); + iRichTextViewer->SetParent( this ); + + // TODO: read from resource + iTitle->SetTextL( KAddAttachment ); + + // Draw bg instead of using skin bg + TRect tempRect( 0, 0, 0, 0 ); + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( + NMRBitmapManager::EMRBitmapInputCenter ); + + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + tempRect, + EFalse ); + + iRichTextViewer->SetSkinBackgroundControlContextL( iBgCtrlContext ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CMRAttachmentsField::MinimumSize() + { + TRect parentRect( Parent()->Rect() ); + + TRect richTextRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); + + TRect textRect( NMRLayoutManager::GetLayoutText( + richTextRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + // Adjust field size so that there's room for expandable editor. + richTextRect.Resize( 0, iRichTextSize.iHeight - textRect.Height() ); + + // Add title area to the required size + TSize titleSize( CESMRField::MinimumSize() ); + + TSize completeFieldSize( titleSize ); + if( iAttachmentCount ) + { + completeFieldSize.iHeight += richTextRect.Height(); + } + + return completeFieldSize; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::InitializeL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::InitializeL() + { + FUNC_LOG; + TAknLayoutText layoutText = + NMRLayoutManager::GetLayoutText( Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + iRichTextViewer->SetFontL( layoutText.Font() ); + if( iAttachmentCount > 1 ) + { + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + iRichTextViewer->ApplyLayoutChangesL(); + + //wake up current contact menu selection by calling this + iRichTextViewer->FocusChanged( ENoDrawNow ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::InternalizeL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::InternalizeL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + iEntry = &aEntry; + + if ( aEntry.SupportsCapabilityL( MESMRCalEntry::EMRCapabilityAttachments ) ) + { + UpdateAttachmentsListL(); + + //wake up current contact menu selection by calling this + iRichTextViewer->FocusChanged( ENoDrawNow ); + + iDisableRedraw = ETrue; + } + else + { + // Field does not support attachments --> Remove field from UI. + iObserver->HideControl( EESMRFieldAttachments ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::ExternalizeL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::ExternalizeL( MESMRCalEntry& /*aEntry*/ ) + { + FUNC_LOG; + // No implementation + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentsField::CountComponentControls( ) const + { + FUNC_LOG; + TInt count( 0 ); + if ( iFieldIcon ) + { + ++count; + } + + if ( iRichTextViewer ) + { + ++count; + } + if ( iTitle ) + { + ++count; + } + + return count; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRAttachmentsField::ComponentControl( TInt aInd ) const + { + FUNC_LOG; + switch ( aInd ) + { + case 0: + return iRichTextViewer; + case 1: + return iFieldIcon; + case 2: + return iTitle; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::SizeChanged( ) + { + FUNC_LOG; + TRect rect( Rect() ); + + TAknLayoutRect firstRowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect firstRowRect( firstRowLayoutRect.Rect() ); + + TRect secondRowRect( firstRowRect ); + secondRowRect.Move( 0, firstRowRect.Height() ); + + // Layout field button + if( iFieldIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ) ); + AknLayoutUtils::LayoutControl( + iFieldIcon, firstRowRect, iconLayout ); + } + + // Layout field title + if( iTitle ) + { + TAknLayoutText labelLayout( + NMRLayoutManager::GetLayoutText( + firstRowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ) ); + + iTitle->SetRect( labelLayout.TextRect() ); + + // Setting font also for the label. Failures are ignored. + TRAP_IGNORE( iTitle->SetFont( labelLayout.Font() ) ); + } + + TRect edwinRect( 0, 0, 0, 0 ); + + // Layout field editor + if( iRichTextViewer ) + { + TAknLayoutText layoutText = NMRLayoutManager::GetLayoutText( + secondRowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + + edwinRect = layoutText.TextRect(); + + // Resize height according to actual height required by edwin. + edwinRect.Resize( 0, iRichTextSize.iHeight - edwinRect.Height() ); + + iRichTextViewer->SetRect( edwinRect ); + + // Try setting font. Failures are ignored. + TRAP_IGNORE( + iRichTextViewer->SetFontL( layoutText.Font() ); + if( iAttachmentCount > 1 ) + { + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + iRichTextViewer->ApplyLayoutChangesL(); + ); + } + + // Layouting focus + TRect bgRect( 0, 0, 0, 0 ); + // No attachments -> Focus to the title + if( iAttachmentCount == 0 ) + { + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + firstRowRect, NMRLayoutManager::EMRLayoutTextEditorBg ); + bgRect = bgLayoutRect.Rect(); + } + // One attachment -> Focus to the attachment according to layout data + if( iAttachmentCount == 1 ) + { + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + secondRowRect, NMRLayoutManager::EMRLayoutTextEditorBg ); + bgRect = bgLayoutRect.Rect(); + } + // More than one attachements -> Focus calculated manually + if( iAttachmentCount > 1 ) + { + bgRect.SetRect( + TPoint( edwinRect.iTl.iX, + edwinRect.iTl.iY - FocusMargin() ), + TPoint( edwinRect.iBr.iX, + edwinRect.iBr.iY + FocusMargin() ) ); + } + + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRAttachmentsField::OfferKeyEventL( + const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TKeyResponse response( EKeyWasNotConsumed ); + + if( iAttachmentCount == 0 ) + { + response = iTitle->OfferKeyEventL( aEvent, aType ); + } + + if( iAttachmentCount > 0 ) + { + response = iRichTextViewer->OfferKeyEventL( aEvent, aType ); + } + + if ( aType == EEventKey && + ( aEvent.iScanCode != EStdKeyUpArrow && + aEvent.iScanCode != EStdKeyDownArrow )) + { + iTitle->DrawDeferred(); // ?? + } + return response; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::SetContainerWindowL() +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::SetContainerWindowL( const CCoeControl& aControl ) + { + FUNC_LOG; + CESMRField::SetContainerWindowL( aControl ); + iRichTextViewer->SetContainerWindowL( aControl ); + iRichTextViewer->SetParent( this ); + iTitle->SetContainerWindowL( aControl ); + iTitle->SetParent( this ); + iFieldIcon->SetContainerWindowL( aControl ); + iFieldIcon->SetParent( this ); + + iButtonGroupContainer = CEikButtonGroupContainer::Current(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::HandleEdwinSizeEventL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentsField::HandleEdwinSizeEventL( CEikEdwin* aEdwin, + TEdwinSizeEvent /*aType*/, TSize aSize ) + { + FUNC_LOG; + TBool reDraw( EFalse ); + + if( iRichTextSize.iHeight != aSize.iHeight && iAttachmentCount > 0 ) + { + // Let's save the required size of the rich text viewer + iRichTextSize = aSize; + + if ( iObserver && aEdwin == iRichTextViewer ) + { + iObserver->ControlSizeChanged( this ); + reDraw = ETrue; + } + } + + return reDraw; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::ListObserverSet +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::ListObserverSet() + { + FUNC_LOG; + iRichTextViewer->SetListObserver( iObserver ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::ExecuteGenericCommandL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentsField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + // TODO: Changes from other fields have to be implemented here + TBool handled( EFalse ); + + // From cesmrattachmentfield + if( aCommand == EAknCmdOpen ) + { + handled = ETrue; + HandleTactileFeedbackL(); + } + else if ( aCommand == EESMREditorAddAttachment ) + { + handled = AddAttachmentL(); + if( handled ) + { + HandleTactileFeedbackL(); + } + } + + else if ( IsValidAttachmentEditorCommand(aCommand) && + iAttCommandHandler ) + { + const CESMRRichTextLink* currentLink = iRichTextViewer->GetSelectedLink(); + + ASSERT( currentLink ); + + iAttCommandHandler->HandleAttachmentCommandL( + aCommand, + *currentLink ); + + HandleTactileFeedbackL(); + + handled = ETrue; + + if( aCommand == EESMREditorRemoveAttachment || + aCommand == EESMREditorRemoveAllAttachments ) + { + // Attachment list needs to be updated after removing + // attachment(s) + UpdateAttachmentsListL(); + + //wake up current contact menu selection by calling this + iRichTextViewer->FocusChanged( ENoDrawNow ); + + if( iAttachmentCount == 0 ) + { + // If no attachments are present anymore, let's hide the + // whole rich text viewer. + iRichTextViewer->MakeVisible( EFalse ); + + // Because rich text part is removed from the UI, + // we need to inform the parent, to re-size the + // field container and re-initialize the physics + // world size + iObserver->ControlSizeChanged( this ); + } + } + } + + return handled; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::SetOutlineFocusL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::SetOutlineFocusL( TBool aFocus ) + { + FUNC_LOG; + CESMRField::SetOutlineFocusL( aFocus ); + + if ( aFocus ) + { + if ( iAttachmentCount ) + { + ChangeMiddleSoftKeyL( + EAknSoftkeyContextOptions, + R_QTN_MSK_OPEN ); + } + else + { + ChangeMiddleSoftKeyL( + EESMREditorAddAttachment, + R_QTN_MSK_ADD ); + + } + } + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentsField::HandleRichTextLinkSelection +// ----------------------------------------------------------------------------- +// +TBool CMRAttachmentsField::HandleRichTextLinkSelection( + const CESMRRichTextLink* aLink ) + { + FUNC_LOG; + TBool ret( EFalse ); + + // Open context menu in editor and viewer modes with link selection + if ( aLink->Type() == CESMRRichTextLink::ETypeAttachment ) + { + TRAP_IGNORE( NotifyEventL( EMRLaunchAttachmentContextMenu )); + ret = ETrue; + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentsField::UpdateAttachmentsListL +// ----------------------------------------------------------------------------- +// +void CMRAttachmentsField::UpdateAttachmentsListL() + { + FUNC_LOG; + + RBuf buffer; // codescanner::resourcenotoncleanupstack + buffer.CleanupClosePushL(); + + RCPointerArray attachmentLinks; + CleanupClosePushL( attachmentLinks ); + + iAttachmentCount = iEntry->Entry().AttachmentCountL(); + + TAknLayoutText layoutText = NMRLayoutManager::GetLayoutText( + Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + + attachmentLinks.ReserveL( iAttachmentCount ); + for ( TInt i = 0; i < iAttachmentCount; ++i ) + { + CCalAttachment* att = iEntry->Entry().AttachmentL( i ); // Ownership not gained + + // Reducing space required by file size information from + // max line width, so that file name can be trimmed to correct + // length + TInt maxLineWidth = MinimumSize().iWidth; + const CFont* font = layoutText.Font(); + + HBufC* attachmentSize = AttachmentNameAndSizeL( KNullDesC(), *att ); + TInt attachmentSizeLength = attachmentSize->Length(); + maxLineWidth -= font->TextWidthInPixels( *attachmentSize ); + delete attachmentSize; + attachmentSize = NULL; + + // TODO: correct icon zise to correct one. Ask from UI specifier. + TSize iconSize( 20, 20); + maxLineWidth -= iconSize.iWidth; + + // Trimming file name to fit to one line + TPtrC text = att->Label(); + HBufC* clippedTextHBufC = ClipTextLC( text, *font, maxLineWidth ); + TPtr clippedText = clippedTextHBufC->Des(); + clippedText.Trim(); + + if ( clippedText.Length() > 0 ) + { + // Creating rich text link + CESMRRichTextLink* link = CESMRRichTextLink::NewL( + buffer.Length(), + clippedText.Length() + attachmentSizeLength, + text, + CESMRRichTextLink::ETypeAttachment, + CESMRRichTextLink::ETriggerKeyRight ); + CleanupStack::PushL( link ); + attachmentLinks.AppendL( link ); + CleanupStack::Pop( link ); + + HBufC* buf = AttachmentNameAndSizeL( clippedText, *att ); + CleanupStack::PushL( buf ); + + // Append attachment name and size with line feed to buffer + buffer.ReAllocL( buffer.Length() + + clippedText.Length() + + buf->Length() + + KNewLine().Length() ); + + buffer.Append( buf->Des() ); + buffer.Append( KNewLine ); + + CleanupStack::PopAndDestroy( buf ); + } + + CleanupStack::PopAndDestroy( clippedTextHBufC ); + } + + // Remove unnecessary new line from the end of buffer. + if ( buffer.Length() >= KNewLine().Length() ) + { + buffer.SetLength( buffer.Length() - KNewLine().Length() ); + } + + // Adding all rich text links to the rich text viewer + if ( buffer.Length() > 0 ) + { + iRichTextViewer->SetTextL( &buffer ); + iRichTextViewer->SetFontL( layoutText.Font() ); + if( iAttachmentCount > 1 ) + { + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + iRichTextViewer->ApplyLayoutChangesL(); + iRichTextViewer->SetMargins( KMargin ); // What's this? + iRichTextViewer->HandleTextChangedL(); + + while ( attachmentLinks.Count() > 0 ) + { + CESMRRichTextLink* link = attachmentLinks[0]; + CleanupStack::PushL( link ); + attachmentLinks.Remove( 0 ); + iRichTextViewer->AddLinkL( link ); + CleanupStack::Pop( link ); + } + } + + CleanupStack::PopAndDestroy( &attachmentLinks ); + CleanupStack::PopAndDestroy( &buffer ); + + if ( iAttachmentCount ) + { + iRichTextViewer->MakeVisible( ETrue ); + + iObserver->ControlSizeChanged( this ); + + ChangeMiddleSoftKeyL( + EAknSoftkeyContextOptions, + R_QTN_MSK_OPEN ); + + delete iAttCommandHandler; + iAttCommandHandler = NULL; + + iAttCommandHandler = + CMRAttachmentCommandHandler::NewL( + iEntry->Entry(), + *iEventQueue ); + } + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentsField::ClipTextLC +// ----------------------------------------------------------------------------- +// +HBufC* CMRAttachmentsField::ClipTextLC( + const TDesC& aText, const CFont& aFont, TInt aWidth ) + { + FUNC_LOG; + HBufC* text = HBufC::NewLC( aText.Length() + KAknBidiExtraSpacePerLine ); + TPtr textPtr = text->Des(); + AknBidiTextUtils::ConvertToVisualAndClip( + aText, textPtr, aFont, aWidth, aWidth ); + return text; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::AttachmentOperationCompleted +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::AttachmentOperationCompleted( + MDesC16Array& /*aArray*/ ) + { + TRAPD( error, UpdateAttachmentsListL() ); + if( error != KErrNone ) + { + // Error occured, could not update the field + iCoeEnv->HandleError( error ); + } + + delete iAttachmentUi; + iAttachmentUi = NULL; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::AttachmentNameAndSizeL +// --------------------------------------------------------------------------- +// +HBufC* CMRAttachmentsField::AttachmentNameAndSizeL( + const TDesC& aDes, + const CCalAttachment& aAttachment ) + { + HBufC* stringholder; + + CDesCArrayFlat* attachmentStrings = + new(ELeave)CDesCArrayFlat( 1 ); + CleanupStack::PushL( attachmentStrings ); + + CArrayFixFlat* integers = + new (ELeave) CArrayFixFlat(1); + CleanupStack::PushL( integers ); + + TInt attachmentSize = aAttachment.FileAttachment()->Size(); + + if ( attachmentSize >= KOneMegaByte ) + { + attachmentStrings->AppendL( aDes ); + + integers->AppendL( attachmentSize / KOneMegaByte ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_ATTACHMENT_FILE_MEGABYTE, + *attachmentStrings, + *integers ); + } + else if (( attachmentSize < KOneKiloByte ) && (attachmentSize != 0)) + { + attachmentStrings->AppendL( aDes ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_ATTACHMENT_FILE_LESS_THAN_KILOBYTE, + *attachmentStrings); + } + else + { + attachmentStrings->AppendL( aDes ); + + integers->AppendL( attachmentSize / KOneKiloByte ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_ATTACHMENT_FILE_KILOBYTE, + *attachmentStrings, + *integers ); + } + + CleanupStack::Pop( stringholder ); + CleanupStack::PopAndDestroy( integers ); + CleanupStack::PopAndDestroy( attachmentStrings ); + + return stringholder; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::AddAttachmentL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentsField::AddAttachmentL() + { + TBool ret( EFalse ); + + if( iEntry ) + { + if ( !iAttachmentUi ) + { + iAttachmentUi = CMRAttachmentUi::NewL(); + } + + iAttachmentUi->SetObserver( *this ); + TInt error( iAttachmentUi->LaunchFetchUi( *iEntry ) ); + ret = ETrue; + if( error != KErrNone ) + { + iCoeEnv->HandleError( error ); + ret = EFalse; + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::HandleSingletapEventL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentsField::HandleSingletapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + TBool ret( EFalse ); + + // When there are no attachments, the whole field area + // will execute single tap the action + if( iAttachmentCount == 0 ) + { + if( Rect().Contains( aPosition ) ) + { + ret = AddAttachmentL(); + if( ret ) + { + HandleTactileFeedbackL(); + } + } + } + // Otherwise only the title and the fieldIcon will + // execute the single tap action + else + { + if( iTitle->Rect().Contains( aPosition ) || + iFieldIcon->Rect().Contains( aPosition ) ) + { + ret = AddAttachmentL(); + if( ret ) + { + HandleTactileFeedbackL(); + } + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::HandleLongtapEventL( const TPoint& aPosition ) + { + // When there are no attachments, the whole field area + // will execute long tap the action + if( iAttachmentCount == 0 ) + { + if( Rect().Contains( aPosition ) ) + { + if( AddAttachmentL() ) + { + HandleTactileFeedbackL(); + } + } + } + else + { + if ( iRichTextViewer->Rect().Contains( aPosition ) ) + { + if( iRichTextViewer->LinkSelectedL() ) + { + HandleTactileFeedbackL(); + } + } + + if( iTitle->Rect().Contains( aPosition ) || + iFieldIcon->Rect().Contains( aPosition ) ) + { + if( AddAttachmentL() ) + { + HandleTactileFeedbackL(); + } + } + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::HandleRawPointerEventL +// --------------------------------------------------------------------------- +// +TBool CMRAttachmentsField::HandleRawPointerEventL( + const TPointerEvent& aPointerEvent ) + { + FUNC_LOG; + TBool ret( EFalse ); + + if( iAttachmentCount > 0 && + aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if( iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) ) + { + iRichTextViewer->HandlePointerEventL( aPointerEvent ); + ret = ETrue; + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::DynInitMenuPaneL +// --------------------------------------------------------------------------- +// +void CMRAttachmentsField::DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FUNC_LOG; + + if ( R_MR_EDITOR_ATTACHMENT_MENU == aResourceId ) + { + if ( !iAttachmentCount ) + { + aMenuPane->SetItemDimmed( + EESMREditorOpenAttachment, + ETrue ); + + aMenuPane->SetItemDimmed( + EESMREditorRemoveAttachment, + ETrue ); + + aMenuPane->SetItemDimmed( + EESMREditorRemoveAllAttachments, + ETrue ); + } + else if ( iAttachmentCount == 1 ) + { + aMenuPane->SetItemDimmed( + EESMREditorRemoveAllAttachments, + ETrue ); + + } + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::LineSpacing +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentsField::LineSpacing() + { + FUNC_LOG; + // Calculates the line spacing based on default one line layout data + TInt lineSpacing( 0 ); + + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect defaultTextRect = labelLayout.TextRect(); + + TInt difference = rowRect.Height() - defaultTextRect.Height(); + + lineSpacing = difference * 2; + + return lineSpacing; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentsField::FocusMargin +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentsField::FocusMargin() + { + FUNC_LOG; + // Calculates focus margin based on default one line layout data + TInt focusMagin( 0 ); + + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect defaultTextRect = labelLayout.TextRect(); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect defaultBgRect( bgLayoutRect.Rect() ); + + TInt difference = defaultBgRect.Height() - defaultTextRect.Height(); + + focusMagin = TReal( difference / 2 ); + + return focusMagin; + } + +//EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrmulticalenfield.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrmulticalenfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,450 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR multi calendar field implementation + * +*/ + +#include "cmrmulticalenfield.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "cesmrtextitem.h" +#include "cesmrlistquery.h" +#include "nmrlayoutmanager.h" +#include "nmrcolormanager.h" +#include "mesmrmeetingrequestentry.h" +#include "cesmrglobalnote.h" +#include +#include +#include +#include +#include +#include +#include +#include +// DEBUG +#include "emailtrace.h" +#include "cesmrcaldbmgr.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::NewL +// --------------------------------------------------------------------------- +// +CMRMultiCalenField* CMRMultiCalenField::NewL( ) + { + FUNC_LOG; + CMRMultiCalenField* self = new (ELeave) CMRMultiCalenField; + CleanupStack::PushL ( self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::~CMRMultiCalenField +// --------------------------------------------------------------------------- +// +CMRMultiCalenField::~CMRMultiCalenField( ) + { + FUNC_LOG; + iCalenNameList.Close(); + delete iIcon; + delete iLockIcon; + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::InitializeL() +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::InitializeL() + { + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + + iCalenName->SetFont( text.Font() ); + // This is called so that theme changes will apply when changing theme "on the fly" + if ( IsFocused() ) + { + iCalenName->FocusChanged( EDrawNow ); + } + } +// --------------------------------------------------------------------------- +// CMRMultiCalenField::InternalizeL +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::InternalizeL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + MESMRCalDbMgr& dbMgr = aEntry.GetDBMgr(); + iCalenNameList.Reset(); + + dbMgr.GetMultiCalendarNameListL( iCalenNameList ); + TPtrC calenName = dbMgr.GetCalendarNameByEntryL( aEntry ); + iIndex = dbMgr.GetCurCalendarIndex(); + iCalenName->SetTextL( calenName ); + + iEntry = &aEntry; + + // Set's the calendar type change enabled or disabled. + if( FieldMode() == EESMRFieldModeEdit && !TypeChangeEnabledL() ) + { + iTypeChangeEnabled = EFalse; + + LockL(); + } + else + { + iTypeChangeEnabled = ETrue; + } + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::SetOutlineFocusL +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::SetOutlineFocusL( TBool aFocus ) + { + FUNC_LOG; + CESMRField::SetOutlineFocusL ( aFocus ); + + //Focus gained + if ( aFocus ) + { + ChangeMiddleSoftKeyL( + EESMRCmdOpenMultiCalenSelectQuery, R_QTN_MSK_OPEN ); + } + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::ExecuteGenericCommandL +// --------------------------------------------------------------------------- +// +TBool CMRMultiCalenField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + + TBool isUsed( EFalse ); + if( aCommand == EESMRCmdOpenMultiCalenSelectQuery || + aCommand == EAknCmdOpen ) + { + if( IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + isUsed = ETrue; + } + + else if( iTypeChangeEnabled ) + { + ExecuteTypeQueryL(); + isUsed = ETrue; + + HandleTactileFeedbackL(); + } + } + + return isUsed; + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::Lock +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::ExecuteTypeQueryL +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::ExecuteTypeQueryL() + { + FUNC_LOG; + if ( FieldMode() == EESMRFieldModeView ) + return; + + TInt ret = + CESMRListQuery::ExecuteL( + CESMRListQuery::EESMRMultiCalenQuery, + iCalenNameList ); + + if ( ret != KErrCancel ) + { + iIndex = ret; + iEntry->GetDBMgr().SetCurCalendarByIndex( iIndex ); + + // Send command to dialog + NotifyEventAsyncL( EESMRCmdCalendarChange ); + UpdateLabelL( ret ); + } + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::CMRMultiCalenField +// --------------------------------------------------------------------------- +// +CMRMultiCalenField::CMRMultiCalenField( ) : + iIndex( 0 ) + { + FUNC_LOG; + SetFieldId( EESMRFieldCalendarName ); + SetFocusType( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::ConstructL +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::ConstructL( ) + { + FUNC_LOG; + + iCalenName = CMRLabel::NewL(); + CESMRField::ConstructL( iCalenName ); + iCalenName->SetTextL( KNullDesC() ); + + TGulAlignment align; + align.SetHAlignment( EHLeft ); + align.SetVAlignment( EVCenter ); + iCalenName->SetAlignment( align ); + + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapCalendarSelection ); + + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::UpdateLabelL +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::UpdateLabelL( TInt aIndex ) + { + FUNC_LOG; + + iCalenName->SetTextL( iCalenNameList[aIndex] ); + iCalenName->DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRMultiCalenField::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iCalenName ) + { + ++count; + } + + if ( iLockIcon ) + { + ++count; + } + return count; + + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRMultiCalenField::ComponentControl( TInt aIndex ) const + { + FUNC_LOG; + CCoeControl* control = NULL; + switch( aIndex ) + { + case 0: + { + control = iCalenName; + break; + } + case 1: + { + control = iIcon; + break; + } + case 2: + { + control = iLockIcon; + break; + } + default: + ASSERT( EFalse ); + } + + return control; + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::SizeChanged() + { + FUNC_LOG; + TRect rect( Rect() ); + TAknLayoutRect iconLayout = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorIcon ); + TRect iconRect( iconLayout.Rect() ); + iIcon->SetRect( iconRect ); + + // Layouting lock icon + TAknLayoutRect rowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect rowRect( rowLayoutRect.Rect() ); + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rowRect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iCalenName->SetRect( viewerRect ); + + // Move focus rect so that it's relative to field's position. + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::SetContainerWindowL( + const CCoeControl& aContainer ) + { + FUNC_LOG; + CCoeControl::SetContainerWindowL( aContainer ); + iCalenName->SetContainerWindowL( aContainer ); + iCalenName->SetParent( this ); + iIcon->SetContainerWindowL( aContainer ); + iIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::SetTextDimmed +// --------------------------------------------------------------------------- +// +void CMRMultiCalenField::SetTextDimmed() + { + FUNC_LOG; + + NMRColorManager::SetColor( + *iCalenName, + NMRColorManager::EMRMainAreaTextColorDimmed ); + } + +// --------------------------------------------------------------------------- +// CMRMultiCalenField::TypeChangeEnabledL +// --------------------------------------------------------------------------- +// +TBool CMRMultiCalenField::TypeChangeEnabledL() + { + TBool ret( ETrue ); + + /* + * Case 1: + * If entry is single occurancy of a series, calendar type change + * is disabled for the user. + */ + if( iEntry->IsRecurrentEventL() && + iEntry->RecurrenceModRule() == MESMRCalEntry::EESMRThisOnly && + FieldMode() == EESMRFieldModeEdit ) + { + ret = EFalse; + } + + /* + * Case 2: + * If entry is meeting request, and opened from mailbox that does not + * support multiple calendar, calendar type change is disabled + * for the user. + */ + if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) && + FieldMode() == EESMRFieldModeEdit ) + { + MESMRMeetingRequestEntry* entry = + static_cast< MESMRMeetingRequestEntry* >( iEntry ); + + // If entry's current plugin is active sync, it means that + // Mail For Exchange is in use. This means, that multiple calendar + // functionality is not supported. + if( entry->CurrentPluginL() == EESMRActiveSync ) + { + ret = EFalse; + } + } + + /* + * Case 3: + * When the organizer of the MR edits an already sent MR, calendar + * cannot be changed --> calendar selection needs to be locked. + */ + if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) && + FieldMode() == EESMRFieldModeEdit ) + { + MESMRMeetingRequestEntry* entry = + static_cast< MESMRMeetingRequestEntry* >( iEntry ); + if( entry->RoleL() == EESMRRoleOrganizer && entry->IsSentL() ) + { + ret = EFalse; + } + } + + return ret; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR attahcment field implementation + * + */ +#include "cmropenattachmentcommand.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + +// Unnamed namespace for local definitions +namespace { // codescanner::namespace + +// Notepad data type +_LIT8( KNotePadTextDataType, "text/plain" ); + +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMROpenAttachmentCommand::CMROpenAttachmentCommand +// --------------------------------------------------------------------------- +// +CMROpenAttachmentCommand::CMROpenAttachmentCommand( + CDocumentHandler& aDocHandler ) + : iDocHandler( aDocHandler ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMROpenAttachmentCommand::CMROpenAttachmentCommand +// --------------------------------------------------------------------------- +// +CMROpenAttachmentCommand::~CMROpenAttachmentCommand() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMROpenAttachmentCommand::NewL +// --------------------------------------------------------------------------- +// +CMROpenAttachmentCommand* CMROpenAttachmentCommand::NewL( + CDocumentHandler& aDocHandler ) + { + FUNC_LOG; + + CMROpenAttachmentCommand* self = + new (ELeave) CMROpenAttachmentCommand( aDocHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMROpenAttachmentCommand::ConstructL +// --------------------------------------------------------------------------- +// +void CMROpenAttachmentCommand::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMROpenAttachmentCommand::ExecuteAttachmentCommandL +// --------------------------------------------------------------------------- +// +void CMROpenAttachmentCommand::ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ) + { + FUNC_LOG; + + // Ownership not gained + CCalAttachmentFile* attachmentFile = + aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); + + RFile file; + attachmentFile->FetchFileHandleL( file ); + CleanupClosePushL( file ); + + TDataType datatype( + aEntry.AttachmentL( aAttachmentIndex )->MimeType() ); + + TInt err( KErrNone ); + if( datatype == KNotePadTextDataType() ) + { + // Notepad will try to open text/plain type data + err = CNotepadApi::ExecFileViewerL( + file, + NULL, + ETrue, + EFalse, + KCharacterSetIdentifierIso88591 ); + } + else + { + // Doc handler will try to open other than text files + TRAP( err, iDocHandler.OpenFileEmbeddedL( file, datatype ) ); + } + + CleanupStack::PopAndDestroy( &file ); + + if( err != KErrNone ) + { + CAknInformationNote* note = new ( ELeave ) CAknInformationNote; + CleanupStack::PushL( note ); + HBufC* buf = StringLoader::LoadLC( + R_MEET_REQ_INFO_CANNOT_OPEN_ATTACHMENT ); + note->ExecuteLD( *buf ); + CleanupStack::PopAndDestroy( buf ); + CleanupStack::Pop( note ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrremoveattachmentcommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrremoveattachmentcommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR remove attachment command implementation + * + */ +#include "cmrremoveattachmentcommand.h" + +#include +#include + +// DEBUG +#include "emailtrace.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRRemoveAttachmentCommand::CMRRemoveAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRRemoveAttachmentCommand::CMRRemoveAttachmentCommand() : + CMRAttachmentCommand() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRRemoveAttachmentCommand::CMRRemoveAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRRemoveAttachmentCommand::~CMRRemoveAttachmentCommand() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRRemoveAttachmentCommand::NewL +// --------------------------------------------------------------------------- +// +CMRRemoveAttachmentCommand* CMRRemoveAttachmentCommand::NewL() + { + FUNC_LOG; + + CMRRemoveAttachmentCommand* self = new( ELeave )CMRRemoveAttachmentCommand; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRRemoveAttachmentCommand::ConstructL +// --------------------------------------------------------------------------- +// +void CMRRemoveAttachmentCommand::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRRemoveAttachmentCommand::ExecuteAttachmentCommandL +// --------------------------------------------------------------------------- +// +void CMRRemoveAttachmentCommand::ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ) + { + FUNC_LOG; + aEntry.DeleteAttachmentL( *( aEntry.AttachmentL( aAttachmentIndex ) ) ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveandopenattachmentcommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveandopenattachmentcommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR save and open attachment command implementation + * + */ +#include "cmrsaveandopenattachmentcommand.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + + +namespace { // codescanner::namespace + +// Notepad data type +_LIT8( KNotePadTextDataType, "text/plain" ); + +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRSaveAndOpenAttachmentCommand::CMRSaveAndOpenAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRSaveAndOpenAttachmentCommand::CMRSaveAndOpenAttachmentCommand( + CDocumentHandler& aDocHandler ) + : CMRAttachmentCommand(), + iDocHandler( aDocHandler ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSaveAndOpenAttachmentCommand::CMRSaveAndOpenAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRSaveAndOpenAttachmentCommand::~CMRSaveAndOpenAttachmentCommand() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSaveAndOpenAttachmentCommand::NewL +// --------------------------------------------------------------------------- +// +CMRSaveAndOpenAttachmentCommand* CMRSaveAndOpenAttachmentCommand::NewL( + CDocumentHandler& aDocHandler ) + { + FUNC_LOG; + + CMRSaveAndOpenAttachmentCommand* self = + new( ELeave )CMRSaveAndOpenAttachmentCommand( aDocHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRSaveAndOpenAttachmentCommand::ConstructL +// --------------------------------------------------------------------------- +// +void CMRSaveAndOpenAttachmentCommand::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSaveAndOpenAttachmentCommand::ExecuteAttachmentCommandL +// --------------------------------------------------------------------------- +// +void CMRSaveAndOpenAttachmentCommand::ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ) + { + FUNC_LOG; + + CCoeEnv* coeEnv = CCoeEnv::Static(); + ASSERT( coeEnv ); + + TDataType type; + + // Ownership not gained + CCalAttachmentFile* attachmentFile = + aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); + + RFile file; + attachmentFile->FetchFileHandleL( file ); + CleanupClosePushL( file ); + + TFileName fileName; + file.FullName( fileName ); + + // Document handler takes care of the saving process. Return value does + // not require any action + iDocHandler.CopyL( file, fileName, type, NULL ); + + TFileName copiedFileName; + iDocHandler.GetPath(copiedFileName); + + RFs& fsSession = coeEnv->FsSession(); + User::LeaveIfError( fsSession.ShareProtected() ); + + RFile copiedFile; + TInt err = copiedFile.Open( + fsSession, + copiedFileName, + EFileRead | EFileShareReadersOnly); + User::LeaveIfError( err ); + + CleanupClosePushL( copiedFile ); + + TDataType datatype( + aEntry.AttachmentL( aAttachmentIndex )->MimeType() ); + + if( datatype == KNotePadTextDataType() ) + { + // Notepad will try to open text/plain type data + err = CNotepadApi::ExecFileViewerL( + copiedFile, + NULL, + ETrue, + EFalse, + KCharacterSetIdentifierIso88591 ); + } + else + { + // Doc handler will try to open other than text files + TRAP( err, iDocHandler.OpenFileEmbeddedL( copiedFile, datatype ) ); + } + + CleanupStack::PopAndDestroy( &copiedFile ); + CleanupStack::PopAndDestroy( &file ); + + if( err != KErrNone ) + { + CAknInformationNote* note = new ( ELeave ) CAknInformationNote; + CleanupStack::PushL( note ); + HBufC* buf = StringLoader::LoadLC( + R_MEET_REQ_INFO_CANNOT_OPEN_ATTACHMENT ); + note->ExecuteLD( *buf ); + CleanupStack::PopAndDestroy( buf ); + CleanupStack::Pop( note ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveattachmentcommand.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveattachmentcommand.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR save attachment command implementation + * + */ +#include "cmrsaveattachmentcommand.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRSaveAttachmentCommand::CMRSaveAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRSaveAttachmentCommand::CMRSaveAttachmentCommand( + CDocumentHandler& aDocHandler ) : + CMRAttachmentCommand(), + iDocHandler( aDocHandler ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSaveAttachmentCommand::CMRSaveAttachmentCommand +// --------------------------------------------------------------------------- +// +CMRSaveAttachmentCommand::~CMRSaveAttachmentCommand() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSaveAttachmentCommand::NewL +// --------------------------------------------------------------------------- +// +CMRSaveAttachmentCommand* CMRSaveAttachmentCommand::NewL( + CDocumentHandler& aDocHandler ) + { + FUNC_LOG; + + CMRSaveAttachmentCommand* self = + new( ELeave )CMRSaveAttachmentCommand( aDocHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRSaveAttachmentCommand::ConstructL +// --------------------------------------------------------------------------- +// +void CMRSaveAttachmentCommand::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSaveAttachmentCommand::ExecuteAttachmentCommandL +// --------------------------------------------------------------------------- +// +void CMRSaveAttachmentCommand::ExecuteAttachmentCommandL( + CCalEntry& aEntry, + TInt aAttachmentIndex ) + { + FUNC_LOG; + + CCalAttachmentFile* attachmentFile = + aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); // Ownership not gained + + if ( attachmentFile ) // Ignore URI attachment + { + RFile file; + attachmentFile->FetchFileHandleL( file ); + CleanupClosePushL( file ); + + TFileName fileName; + file.FullName( fileName ); + + TDataType type; + + // Document handler takes care of the saving process. + TInt res = iDocHandler.CopyL( file, fileName, type, NULL ); + + if ( KUserCancel == res ) + { + User::Leave( KErrCancel ); + } + + CleanupStack::PopAndDestroy( &file ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrtimecontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrtimecontainer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,691 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR time (start-end) field implementation + * +*/ +#include "cmrtimecontainer.h" +#include "esmrfieldbuilderdef.h" +#include "mesmrfieldvalidator.h" +#include "nmrlayoutmanager.h" +#include "nmrcolormanager.h" +#include "cesmrglobalnote.h" +#include "nmrbitmapmanager.h" +#include "cmrlabel.h" + +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + +namespace { // codescanner::namespace +// start time field count of 24-hour format +const TInt KNumsFieldOf24F = 3; + +#define KMinimumTime (TTime(0)) // codescanner::baddefines + +// 24 hours in microseconds +const TInt64 KDayInMicroSeconds = 86400000000; +#define KMaximumTime (TTime(KDayInMicroSeconds)) // codescanner::baddefines + +} + +// --------------------------------------------------------------------------- +// CMRTimeContainer::CMRTimeContainer +// --------------------------------------------------------------------------- +// +CMRTimeContainer::CMRTimeContainer( + MESMRFieldValidator* aValidator, + TESMREntryFieldId aFieldId ) : + iValidator(aValidator), + iFieldId( aFieldId ) + { + FUNC_LOG; + // do nothing + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::~CMRTimeContainer +// --------------------------------------------------------------------------- +// +CMRTimeContainer::~CMRTimeContainer( ) + { + FUNC_LOG; + Reset(); + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::NewL +// --------------------------------------------------------------------------- +// +CMRTimeContainer* CMRTimeContainer::NewL( + MESMRFieldValidator* aValidator, + CCoeControl* aParent, + TESMREntryFieldId aFieldId ) + { + FUNC_LOG; + CMRTimeContainer* self = + new (ELeave) CMRTimeContainer( aValidator, aFieldId ); + CleanupStack::PushL ( self ); + self->ConstructL ( aParent ); + CleanupStack::Pop ( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::ConstructL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::ConstructL( + CCoeControl* /*aParent*/) + { + FUNC_LOG; + InitializeL(); + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::SetContainerWindowL( + const CCoeControl& aControl ) + { + FUNC_LOG; + + iContainerWindow = &aControl; + + CCoeControl::SetContainerWindowL ( *iContainerWindow ); + iStartTime->SetContainerWindowL ( *iContainerWindow ); + iEndTime->SetContainerWindowL ( *iContainerWindow ); + iSeparator->SetContainerWindowL( *iContainerWindow ); + + iStartTime->SetParent( this ); + iEndTime->SetParent( this ); + iSeparator->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRTimeContainer::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0); + + if ( iStartTime ) + { + ++count; + } + + if ( iSeparator ) + { + ++count; + } + + if ( iEndTime ) + { + ++count; + } + + return count; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRTimeContainer::ComponentControl( + TInt aInd ) const + { + FUNC_LOG; + switch ( aInd ) + { + case 0: + return iStartTime; + case 1: + return iSeparator; + case 2: + return iEndTime; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::SizeChanged() + { + FUNC_LOG; + TRect rect( Rect() ); + TAknTextComponentLayout startTimeLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutTimeEditorStart ); + AknLayoutUtils::LayoutMfne( iStartTime, rect, startTimeLayout ); + + NMRColorManager::SetColor( *iStartTime, + NMRColorManager::EMRMainAreaTextColor ); + + TAknLayoutText hyphonLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTimeEditorSeparator ); + iSeparator->SetRect( hyphonLayout.TextRect() ); + + NMRColorManager::SetColor( *iSeparator, + NMRColorManager::EMRMainAreaTextColor ); + + TAknTextComponentLayout endTimeLayout = + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutTimeEditorEnd ); + AknLayoutUtils::LayoutMfne( iEndTime, rect, endTimeLayout ); + + NMRColorManager::SetColor( *iEndTime, + NMRColorManager::EMRMainAreaTextColor ); + + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRTimeContainer::OfferKeyEventL( + const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TBool startFocusedBefore( iStartTime->IsFocused() ); + TInt startIndex( iStartTime->CurrentField() ); + + TBool endFocusedBefore( iEndTime->IsFocused() ); + TInt endIndex( iEndTime->CurrentField() ); + + TKeyResponse response = EKeyWasNotConsumed; + if ( aType == EEventKey ) + { + switch ( aEvent.iScanCode ) + { + case EStdKeyLeftArrow: + response = ChangeFocusLeftL( aEvent, aType ); + break; + + case EStdKeyRightArrow: + response = ChangeFocusRightL( aEvent, aType ); + break; + + default: // other events than left/right arrows + { + response = FocusedEditor()->OfferKeyEventL( aEvent, aType ); + iStartTime->DrawDeferred(); + iEndTime->DrawDeferred(); + } + break; + } + } + + if ( EKeyWasConsumed == response ) + { + CheckIfValidatingNeededL( + startFocusedBefore, + startIndex, + endFocusedBefore, + endIndex ); + } + + return response; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::FocusChanged +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::FocusChanged( + TDrawNow /*aDrawNow*/) + { + FUNC_LOG; + if ( IsFocused ( ) ) // if focus is gained + { + iStartTime->SetFocus ( ETrue ); + } + else + { + if ( iStartTime->IsFocused() ) + { + iStartTime->SetFocus( EFalse, EDrawNow ); + } + + if ( iEndTime->IsFocused() ) + { + iEndTime->SetFocus( EFalse, EDrawNow ); + } + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::FocusedEditor +// --------------------------------------------------------------------------- +// +CEikTimeEditor* CMRTimeContainer::FocusedEditor( ) + { + FUNC_LOG; + return iStartTime->IsFocused ( ) ? iStartTime : iEndTime; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::OkToLoseFocusL +// --------------------------------------------------------------------------- +// +TBool CMRTimeContainer::OkToLoseFocusL( + TESMREntryFieldId /*aFrom*/, + TESMREntryFieldId /*aTo*/ ) + { + FUNC_LOG; + // validate the current time + FocusedEditor()->PrepareForFocusLossL(); + + if ( iStartTime->IsFocused() ) + { + TriggerStartTimeChangedL(); + } + else + { + TriggerEndTimeChangedL(); + } + + return ETrue; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::SetBgRect +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::SetBgRect( TRect bgRect ) + { + iBgRect = bgRect; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::SetValidatorL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::SetValidatorL( MESMRFieldValidator* aValidator ) + { + iValidator = aValidator; + + if ( iValidator ) + { + iValidator->SetStartTimeFieldL( *iStartTime ); + iValidator->SetEndTimeFieldL( *iEndTime ); + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::SetValidatorL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::EnvironmentChangedL() + { + FUNC_LOG; + + Reset(); + InitializeL(); + + SetContainerWindowL( *iContainerWindow ); + + iStartTime->ActivateL(); + iEndTime->ActivateL(); + iSeparator->ActivateL(); + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::ChangeFocusRightL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRTimeContainer::ChangeFocusRightL(const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TKeyResponse response = EKeyWasNotConsumed; + + if ( iStartTime->IsFocused ( ) ) + { + // if the focus is in the last field of start time, move focus + // to end times first field. + TInt current = iStartTime->CurrentField(); + TInt count = iStartTime->NumFields(); + if ( current == (count - 1) ) + { + iStartTime->SetFocus( EFalse, EDrawNow ); + iEndTime->SetFocus( ETrue, EDrawNow ); + response = EKeyWasConsumed; + } + else + { + response = iStartTime->OfferKeyEventL ( aEvent, aType ); + } + TriggerStartTimeChangedL(); + } + + else if ( iEndTime->IsFocused ( ) ) + { + if ( iEndTime->CurrentField() == (iEndTime->NumFields() - 1) ) + { + iEndTime->SetFocus ( EFalse, EDrawNow ); + iStartTime->SetFocus ( ETrue, EDrawNow ); + response = EKeyWasConsumed; + } + else + { + response = iEndTime->OfferKeyEventL ( aEvent, aType ); + } + TriggerEndTimeChangedL(); + } + return response; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::ChangeFocusLeftL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRTimeContainer::ChangeFocusLeftL( + const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TKeyResponse response = EKeyWasNotConsumed; + if ( iStartTime->IsFocused ( ) ) + { + // if the focus is in the first field of start time, move focus + // to end times last field. + if ( iStartTime->CurrentField ( )== 0 ) + { + iStartTime->SetFocus ( EFalse, EDrawNow ); + iEndTime->SetFocus ( ETrue, EDrawNow ); + // last item should highlighted, API does not export the highlight + // function, so emulate key presses + response = iEndTime->OfferKeyEventL ( aEvent, aType ); + } + else + { + response = iStartTime->OfferKeyEventL ( aEvent, aType ); + } + + TriggerStartTimeChangedL(); + } + + else if ( iEndTime->IsFocused ( ) ) + { + if ( iEndTime->CurrentField ( )== 0 ) + { + iEndTime->SetFocus ( EFalse, EDrawNow ); + iStartTime->SetFocus ( ETrue, EDrawNow ); + // last item should highlighted, API does not export the highlight + // function, so emulate key presses + response = iStartTime->OfferKeyEventL ( aEvent, aType ); + } + else + { + response = iEndTime->OfferKeyEventL ( aEvent, aType ); + } + + TriggerEndTimeChangedL(); + } + return response; + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::CheckIfValidatingNeededL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::CheckIfValidatingNeededL( + TBool aStartFocusedBefore, + TInt aStartFieldIndex, + TBool aEndFocusedBefore, + TInt aEndFieldIndex ) + { + FUNC_LOG; + TBool startFocusedAfter( iStartTime->IsFocused() ); + TBool endFocusedAfter( iEndTime->IsFocused() ); + + if ( aStartFocusedBefore != startFocusedAfter ) + { + if ( startFocusedAfter ) + { + TriggerEndTimeChangedL(); + } + else + { + TriggerStartTimeChangedL(); + } + } + + else if ( startFocusedAfter && + aStartFocusedBefore == startFocusedAfter ) + { + TInt fieldIndex( iStartTime->CurrentField() ); + if ( fieldIndex != aStartFieldIndex ) + { + TriggerStartTimeChangedL(); + } + } + + else if ( endFocusedAfter && + aEndFocusedBefore == endFocusedAfter ) + { + TInt fieldIndex( iEndTime->CurrentField() ); + if ( fieldIndex != aEndFieldIndex ) + { + TriggerEndTimeChangedL(); + } + } + + if ( iStartTime->IsFocused ( ) ) + { + // if the focus is in the last field of start time + TInt current = iStartTime->CurrentField(); + TInt count = iStartTime->NumFields(); + + if ( ( count > KNumsFieldOf24F ) && ( current == (count - 1) ) ) + { + TriggerStartTimeChangedL(); + } + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::TriggerStartTimeChangedL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::TriggerStartTimeChangedL() + { + FUNC_LOG; + if ( iValidator ) + { + TRAPD( err, iValidator->StartTimeChangedL() ); + if ( err != KErrNone ) + { + switch ( err ) + { + case KErrOverflow: + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRRepeatReSchedule ); + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::TriggerEndTimeChangedL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::TriggerEndTimeChangedL() + { + FUNC_LOG; + if ( iValidator ) + { + TRAPD( err, iValidator->EndTimeChangedL() ); + if ( err != KErrNone ) + { + switch ( err ) + { + case KErrArgument: + // Assuming that end date is different + // and this is repeating entry + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRRepeatDifferentStartAndEndDate ); + break; + case KErrOverflow: + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRRepeatReSchedule ); + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::HandlePointerEventL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::HandlePointerEventL( const TPointerEvent &aPointerEvent ) + { + TBool startTimeEvent = + iStartTime->Rect().Contains( aPointerEvent.iPosition ); + TBool endTimeEvent = + iEndTime->Rect().Contains( aPointerEvent.iPosition ); + + if( startTimeEvent ) + { + if( !iStartTime->IsFocused() ) + { + iStartTime->SetFocus( ETrue, ENoDrawNow ); + iEndTime->SetFocus( EFalse, ENoDrawNow ); + TriggerEndTimeChangedL(); + } + + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + + if( endTimeEvent ) + { + if( !iEndTime->IsFocused() ) + { + iEndTime->SetFocus( ETrue, ENoDrawNow ); + iStartTime->SetFocus( EFalse, ENoDrawNow ); + TriggerStartTimeChangedL(); + } + + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::ActivateL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::ActivateL() + { + FUNC_LOG; + CCoeControl::ActivateL(); + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::InitializeL +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::InitializeL() + { + FUNC_LOG; + + SetComponentsToInheritVisibility( ETrue ); + + TTime startTime; + startTime.UniversalTime ( ); + + iStartTime = new (ELeave) CEikTimeEditor; + iEndTime = new (ELeave) CEikTimeEditor; + iSeparator = CMRLabel::NewL(); + + iStartTime->ConstructL ( + KMinimumTime, + KMaximumTime, + startTime, + EEikTimeWithoutSecondsField ); + + iEndTime->ConstructL ( + KMinimumTime, + KMaximumTime, + startTime, + EEikTimeWithoutSecondsField ); + + TInt align = Layout_Meta_Data::IsMirrored() ? EAknEditorAlignRight + : EAknEditorAlignLeft; + iStartTime->SetMfneAlignment ( align ); + iEndTime->SetMfneAlignment ( align ); + + iSeparator->SetTextL ( KTimeFieldSeparator ); + + if ( iValidator ) + { + iValidator->SetStartTimeFieldL( *iStartTime ); + iValidator->SetEndTimeFieldL( *iEndTime ); + } + + // Setting background instead of theme skin + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); + + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + iBgRect, + EFalse ); + + iStartTime->SetSkinBackgroundControlContextL( iBgCtrlContext ); + iEndTime->SetSkinBackgroundControlContextL( iBgCtrlContext ); + } + +// --------------------------------------------------------------------------- +// CMRTimeContainer::Reset +// --------------------------------------------------------------------------- +// +void CMRTimeContainer::Reset() + { + FUNC_LOG; + + delete iStartTime; + iStartTime = NULL; + + delete iEndTime; + iEndTime = NULL; + + delete iSeparator; + iSeparator = NULL; + + delete iStartTimeBgContext; + iStartTimeBgContext = NULL; + + delete iEndTimeBgContext; + iEndTimeBgContext = NULL; + + delete iBgCtrlContext; + iBgCtrlContext = NULL; + } +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrunifiededitorfield.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrunifiededitorfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,479 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR Unified editor field implementation + * +*/ + +#include "cmrunifiededitorfield.h" +#include "cmrimage.h" +#include "cmrlabel.h" +#include "cesmrtextitem.h" +#include "cesmrlistquery.h" +#include "nmrlayoutmanager.h" +#include "mesmrlistobserver.h" +#include "cesmrglobalnote.h" + +#include +#include +#include +#include +#include +#include +#include +// DEBUG +#include "emailtrace.h" + +namespace + { + /** + * Maps listbox selection index to correct command id + */ + TInt MapIndexToCommandId( TInt aIndex ) + { + TInt command = KErrNotFound; + + switch ( aIndex ) + { + case EMRTypeMeetingRequest: + { + command = EMRCommandSwitchToMR; + break; + } + + case EMRTypeMeeting: + { + command = EMRCommandSwitchToMeeting; + break; + } + + case EMRTypeMemo: + { + command = EMRCommandSwitchToMemo; + break; + } + + case EMRTypeAnniversary: + { + command = EMRCommandSwitchToAnniversary; + break; + } + + case EMRTypeToDo: + { + command = EMRCommandSwitchToTodo; + break; + } + + default: + { + ASSERT( EFalse ); + break; + } + } + + return command; + } + + } // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::NewL +// --------------------------------------------------------------------------- +// +CMRUnifiedEditorField* CMRUnifiedEditorField::NewL( ) + { + FUNC_LOG; + CMRUnifiedEditorField* self = new (ELeave) CMRUnifiedEditorField; + CleanupStack::PushL ( self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::~CMRUnifiedEditorField +// --------------------------------------------------------------------------- +// +CMRUnifiedEditorField::~CMRUnifiedEditorField( ) + { + FUNC_LOG; + iArray.ResetAndDestroy ( ); + iArray.Close ( ); + iFilter.Reset(); + + delete iIcon; + delete iLockIcon; + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::InternalizeL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::InternalizeL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + if ( aEntry.IsRecurrentEventL() + && aEntry.RecurrenceModRule() == MESMRCalEntry::EESMRThisOnly ) + { + // Hide Unified editor type field + iObserver->HideControl( EESMRFieldUnifiedEditor ); + } + else + { + // Make sure field is visible + iObserver->ShowControl( EESMRFieldUnifiedEditor ); + + TInt eventValue = aEntry.Type(); + iFilter.Reset(); + + // Checking if mailbox has been defined and unified editor + // field value can be changed to Meeting Request + CCalenInterimUtils2* calUtils = CCalenInterimUtils2::NewL(); + CleanupStack::PushL( calUtils ); + TBool mrEnabled = calUtils->MRViewersEnabledL( ETrue ); + CleanupStack::PopAndDestroy(); + + if ( !mrEnabled ) + { + iFilter.AppendL( 0 ); + } + + // esmrgui.rss + TResourceReader reader; + iCoeEnv->CreateResourceReaderLC ( reader, R_ESMREDITOR_UNIFIED ); + + // Read event type items to array + iArray.ResetAndDestroy( ); + TInt count = reader.ReadInt16 ( ); + iArray.ReserveL( count ); + + for (TInt i(0); i < count; i++ ) + { + CESMRTextItem* event = new (ELeave) CESMRTextItem(); + CleanupStack::PushL( event ); + event->ConstructFromResourceL ( reader ); + iArray.AppendL ( event ); + CleanupStack::Pop( event ); + if ( eventValue == event->Id ( ) ) + { + iIndex = i; + iType->SetTextL ( event->TextL ( ) ); + + // Adding current event type to filter, not to be shown in popup + iFilter.AppendL( event->Id() ); + } + } + // resource reader + CleanupStack::PopAndDestroy(); // codescanner::cleanup + + SetIconL( aEntry ); + } + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::SetOutlineFocusL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::SetOutlineFocusL( TBool aFocus ) + { + FUNC_LOG; + CESMRField::SetOutlineFocusL ( aFocus ); + + //Focus gained + if ( aFocus ) + { + ChangeMiddleSoftKeyL(EESMRCmdOpenUnifiedEditorQuery, R_QTN_MSK_OPEN); + } + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::ExecuteGenericCommandL +// --------------------------------------------------------------------------- +// +TBool CMRUnifiedEditorField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + TBool isUsed( EFalse ); + if(aCommand == EESMRCmdOpenUnifiedEditorQuery || + aCommand == EAknCmdOpen ) + { + if( IsLocked() ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + isUsed = ETrue; + } + else + { + HandleTactileFeedbackL(); + + ExecuteTypeQueryL(); + isUsed = ETrue; + } + } + return isUsed; + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::LockL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::ExecuteTypeQueryL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::ExecuteTypeQueryL() + { + FUNC_LOG; + + TInt ret = + CESMRListQuery::ExecuteL( CESMRListQuery::EESMRUnifiedEditorPopup, + iFilter ); + + if ( ret != KErrCancel ) + { + // Send command to dialog + NotifyEventAsyncL( MapIndexToCommandId( ret ) ); + } + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::CMRUnifiedEditorField +// --------------------------------------------------------------------------- +// +CMRUnifiedEditorField::CMRUnifiedEditorField( ) : + iIndex(0) + { + FUNC_LOG; + SetFieldId( EESMRFieldUnifiedEditor ); + SetFocusType( EESMRHighlightFocus ); + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::ConstructL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::ConstructL( ) + { + FUNC_LOG; + iType = CMRLabel::NewL(); + CESMRField::ConstructL( iType ); + iType->SetTextL( KNullDesC() ); + + TGulAlignment align; + align.SetHAlignment( EHLeft ); + align.SetVAlignment( EVCenter ); + iType->SetAlignment( align ); + + // An icon is required for layouting the field. Actual correct icon + // is set after InternalizeL. + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapEventTypeMeeting ); + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::UpdateLabelL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::UpdateLabelL( TInt aIndex ) + { + FUNC_LOG; + CESMRTextItem* event = iArray[ aIndex ]; + iType->SetTextL( event->TextL() ); + iType->DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRUnifiedEditorField::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0 ); + if ( iIcon ) + { + ++count; + } + + if ( iType ) + { + ++count; + } + + if ( iLockIcon ) + { + ++count; + } + return count; + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRUnifiedEditorField::ComponentControl( TInt aIndex ) const + { + FUNC_LOG; + CCoeControl* control = NULL; + switch( aIndex ) + { + case 0: + { + control = iType; + break; + } + case 1: + { + control = iIcon; + break; + } + case 2: + { + control = iLockIcon; + break; + } + default: + ASSERT( EFalse ); + } + + return control; + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::SizeChanged() + { + FUNC_LOG; + TRect rect( Rect() ); + TAknLayoutRect iconLayout( NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorIcon ) ); + iIcon->SetRect( iconLayout.Rect() ); + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout ); + } + + // Layouting label + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + iType->SetRect( viewerRect ); + + // Move focus rect so that it's relative to field's position. + viewerRect.Move( -Position() ); + SetFocusRect( viewerRect ); + + TAknTextComponentLayout editorLayout( + NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::EMRTextLayoutTextEditor ) ); + AknLayoutUtils::LayoutLabel( iType, rect, editorLayout ); + } + +// --------------------------------------------------------------------------- +// CMRUnifiedEditorField::SetIconL +// --------------------------------------------------------------------------- +// +void CMRUnifiedEditorField::SetIconL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + NMRBitmapManager::TMRBitmapId bitmapId( + NMRBitmapManager::EMRBitmapNotSet ); + + CCalEntry& entry = aEntry.Entry(); + + switch ( entry.EntryTypeL() ) + { + case CCalEntry::EAppt: + { + if( CCalenInterimUtils2::IsMeetingRequestL( entry ) ) + { + bitmapId = NMRBitmapManager::EMRBitmapEventTypeMR; + } + else + { + bitmapId = NMRBitmapManager::EMRBitmapEventTypeMeeting; + } + break; + } + + case CCalEntry::ETodo: + { + bitmapId = NMRBitmapManager::EMRBitmapEventTypeTodo; + break; + } + + case CCalEntry::EEvent: // Memo + { + bitmapId = NMRBitmapManager::EMRBitmapEventTypeMemo; + break; + } + + case CCalEntry::EAnniv: + { + bitmapId = NMRBitmapManager::EMRBitmapEventTypeAnniversary; + break; + } + + default: + { + ASSERT( EFalse ); + break; + } + } + + delete iIcon; + iIcon = NULL; + iIcon = CMRImage::NewL( bitmapId ); + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,1123 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* + * Contributors: + * + * Description: MR viewer attahcment field implementation + * + */ +#include "cmrviewerattachmentfield.h" + +#include "mesmrlistobserver.h" +#include "mesmrmeetingrequestentry.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" +#include "cmrimage.h" +#include "cesmrrichtextviewer.h" +#include "cesmreditor.h" +#include "cesmrrichtextlink.h" +#include "cmrattachmentcommandhandler.h" +#include "ccalremoteattachmentapi.h" +#include "ccalremoteattachmentinfo.h" +#include "mcalremoteattachmentoperation.h" +#include "cesmrglobalnote.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + + +// unnamed namespace for local definitions +namespace { // codescanner::namespace +//CONSTANTS + +_LIT( KNewLine, "\f" ); + +const TInt KOneKiloByte( 1024 ); +const TInt KOneMegaByte( 1048576 ); // (1024^2 or 2^20): +const TInt KMargin = 5; + +/** + * Checks that command is valid attachment viewer command. + * @param aCommmand Command ID + */ +TBool IsValidAttachmentViewerCommand( TInt aCommand ) + { + TBool ret( EFalse ); + + switch( aCommand ) + { + case EESMRViewerOpenAttachment: + case EESMRViewerSaveAttachment: + case EESMRViewerSaveAllAttachments: + case EESMRViewerCancelAttachmentDownload: + ret = ETrue; + break; + + default: + ret = EFalse; + break; + } + + return ret; + } + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::CMRViewerAttachmentsField +// --------------------------------------------------------------------------- +// +CMRViewerAttachmentsField::CMRViewerAttachmentsField() + { + FUNC_LOG; + SetFocusType( EESMRHighlightFocus ); + SetFieldId( EESMRFieldViewerAttachments ); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::~CMRViewerAttachmentsField +// --------------------------------------------------------------------------- +// +CMRViewerAttachmentsField::~CMRViewerAttachmentsField( ) + { + FUNC_LOG; + delete iBgCtrlContext; + delete iFieldIcon; + delete iLockIcon; + delete iAttachmentCommandHandler; + delete iRemoteAttUris; + delete iAttachmentInfo; + delete iRemoteAttApi; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::NewL +// --------------------------------------------------------------------------- +// +CMRViewerAttachmentsField* CMRViewerAttachmentsField::NewL() + { + FUNC_LOG; + CMRViewerAttachmentsField* self = new( ELeave )CMRViewerAttachmentsField(); + CleanupStack::PushL ( self ); + self->ConstructL ( ); + CleanupStack::Pop ( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::ConstructL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::ConstructL( ) + { + FUNC_LOG; + SetComponentsToInheritVisibility( ETrue ); + + iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAttachment ); + iFieldIcon->SetParent( this ); + + iRichTextViewer = CESMRRichTextViewer::NewL( this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transferred + iRichTextViewer->SetEdwinSizeObserver ( this ); + iRichTextViewer->SetLinkObserver (this ); + iRichTextViewer->SetParent( this ); + + // Draw bg instead of using skin bg + TRect tempRect( 0, 0, 0, 0 ); + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( + NMRBitmapManager::EMRBitmapInputCenter ); + + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + tempRect, + EFalse ); + + iRichTextViewer->SetSkinBackgroundControlContextL( iBgCtrlContext ); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CMRViewerAttachmentsField::MinimumSize() + { + TRect parentRect( Parent()->Rect() ); + + TRect fieldRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); + + TRect viewerRect( NMRLayoutManager::GetLayoutText( + fieldRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + // Adjust field size so that there's room for expandable editor. + fieldRect.Resize( 0, iRichTextSize.iHeight - viewerRect.Height() ); + + return fieldRect.Size(); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::InitializeL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::InitializeL() + { + FUNC_LOG; + TAknLayoutText layoutText = + NMRLayoutManager::GetLayoutText( Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + iRichTextViewer->SetFontL( layoutText.Font() ); + if( iAttachmentCount > 1 ) + { + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + + iRichTextViewer->ApplyLayoutChangesL(); + + //wake up current contact menu selection by calling this + iRichTextViewer->FocusChanged( ENoDrawNow ); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::InternalizeL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::InternalizeL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + delete iAttachmentCommandHandler; + iAttachmentCommandHandler = NULL; + + iEntry = &aEntry; + + CreateRemoteAttApiL(); + UpdateAttachmentsListL(); + + if ( iAttachmentCount ) + { + //wake up current contact menu selection by calling this + iRichTextViewer->FocusChanged( ENoDrawNow ); + iDisableRedraw = ETrue; + iAttachmentCommandHandler = + CMRAttachmentCommandHandler::NewL( iEntry->Entry(), *iEventQueue ); + + if ( iRemoteAttApi ) + { + iAttachmentCommandHandler->SetRemoteAttachmentInformationL( + *iRemoteAttApi, + *iAttachmentInfo ); + } + } + else + { + iObserver->HideControl( EESMRFieldViewerAttachments ); + } + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::ExternalizeL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::ExternalizeL( MESMRCalEntry& /*aEntry*/ ) + { + FUNC_LOG; + // No implementation + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRViewerAttachmentsField::CountComponentControls( ) const + { + FUNC_LOG; + TInt count( 0 ); + if ( iFieldIcon ) + { + ++count; + } + + if ( iRichTextViewer ) + { + ++count; + } + + if ( iLockIcon ) + { + ++count; + } + + return count; + + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRViewerAttachmentsField::ComponentControl( TInt aInd ) const + { + FUNC_LOG; + switch ( aInd ) + { + case 0: + return iRichTextViewer; + case 1: + return iFieldIcon; + case 2: + return iLockIcon; + default: + return NULL; + } + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::SizeChanged( ) + { + FUNC_LOG; + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect rowRect( rowLayoutRect.Rect() ); + + // Layouting field icon + if( iFieldIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowAColumnGraphic ) ); + AknLayoutUtils::LayoutControl( iFieldIcon, rowRect, iconLayout ); + } + + // Layouting lock icon + if( iLockIcon ) + { + TAknWindowComponentLayout iconLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); + AknLayoutUtils::LayoutImage( iLockIcon, rowRect, iconLayout ); + } + + // Layouting viewer rect + TAknLayoutText viewerLayoutText; + if( iLockIcon ) + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); + } + else + { + viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + } + + TRect viewerRect( viewerLayoutText.TextRect() ); + + // Resize height according to actual height required by edwin. + viewerRect.Resize( 0, iSize.iHeight - viewerRect.Height() ); + iRichTextViewer->SetRect( viewerRect ); + + // Layouting focus + TRect bgRect( 0, 0, 0, 0 ); + if( iAttachmentCount > 1 ) + { + bgRect.SetRect( + TPoint( viewerRect.iTl.iX, + viewerRect.iTl.iY - FocusMargin() ), + TPoint( viewerRect.iBr.iX, + viewerRect.iBr.iY + FocusMargin() ) ); + } + else + { + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rowRect, NMRLayoutManager::EMRLayoutTextEditorBg ); + bgRect = bgLayoutRect.Rect(); + } + + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + // Failures are ignored. + TRAP_IGNORE( + // Set font + iRichTextViewer->SetFontL( viewerLayoutText.Font() ); + if( iAttachmentCount > 1 ) + { + // Set line spacing + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + + // Apply changes. + iRichTextViewer->ApplyLayoutChangesL(); + ) + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRViewerAttachmentsField::OfferKeyEventL( + const TKeyEvent& aEvent, + TEventCode aType ) + { + FUNC_LOG; + TKeyResponse response( EKeyWasNotConsumed ); + + if( iAttachmentCount > 0 ) + { + response = iRichTextViewer->OfferKeyEventL( aEvent, aType ); + } + + return response; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::SetContainerWindowL() +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::SetContainerWindowL( const CCoeControl& aControl ) + { + FUNC_LOG; + CESMRField::SetContainerWindowL( aControl ); + iRichTextViewer->SetContainerWindowL( aControl ); + iRichTextViewer->SetParent( this ); + + iFieldIcon->SetContainerWindowL( aControl ); + iFieldIcon->SetParent( this ); + + iButtonGroupContainer = CEikButtonGroupContainer::Current(); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::HandleEdwinSizeEventL +// --------------------------------------------------------------------------- +// +TBool CMRViewerAttachmentsField::HandleEdwinSizeEventL( CEikEdwin* aEdwin, + TEdwinSizeEvent /*aType*/, TSize aSize ) + { + FUNC_LOG; + TBool reDraw( EFalse ); + + if( iRichTextSize.iHeight != aSize.iHeight && iAttachmentCount > 0 ) + { + // Let's save the required size of the rich text viewer + iRichTextSize = aSize; + + if ( iObserver && aEdwin == iRichTextViewer ) + { + iObserver->ControlSizeChanged( this ); + reDraw = ETrue; + } + } + + return reDraw; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::ListObserverSet +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::ListObserverSet() + { + FUNC_LOG; + iRichTextViewer->SetListObserver( iObserver ); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::ExecuteGenericCommandL +// --------------------------------------------------------------------------- +// +TBool CMRViewerAttachmentsField::ExecuteGenericCommandL( TInt aCommand ) + { + FUNC_LOG; + // TODO: Changes from other fields have to be implemented here + TBool handled( EFalse ); + + //handle locked field first + if( IsLocked() ) + { + if( aCommand == EESMRViewerOpenAttachment || + aCommand == EAknCmdOpen ) + { + HandleTactileFeedbackL(); + + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRUnableToEdit ); + return ETrue; + } + } + + if ( IsValidAttachmentViewerCommand(aCommand) && iAttachmentCommandHandler ) + { + const CESMRRichTextLink* currentLink = iRichTextViewer->GetSelectedLink(); + + ASSERT( currentLink ); + + TBool remoteCommand( + iAttachmentCommandHandler->IsRemoteAttachmentL( *currentLink) ); + + if ( !remoteCommand ) + { + iAttachmentCommandHandler->HandleAttachmentCommandL( + aCommand, + *currentLink ); + + HandleTactileFeedbackL(); + } + else + { + iAttachmentCommandHandler->HandleRemoteAttachmentCommandL( + aCommand, + *currentLink ); + + HandleTactileFeedbackL(); + } + + handled = ETrue; + } + return handled; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::SetOutlineFocusL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::SetOutlineFocusL( TBool aFocus ) + { + FUNC_LOG; + CESMRField::SetOutlineFocusL( aFocus ); + + if ( aFocus && iAttachmentCount) + { + ChangeMiddleSoftKeyL( + EAknSoftkeyContextOptions, + R_QTN_MSK_OPEN ); + } + } + +// ----------------------------------------------------------------------------- +// CMRViewerAttachmentsField::HandleRichTextLinkSelection +// ----------------------------------------------------------------------------- +// +TBool CMRViewerAttachmentsField::HandleRichTextLinkSelection( + const CESMRRichTextLink* aLink ) + { + FUNC_LOG; + TBool ret( EFalse ); + + // Open context menu in editor and viewer modes with link selection + if ( aLink->Type() == CESMRRichTextLink::ETypeAttachment ) + { + TRAP_IGNORE( NotifyEventL( EMRLaunchAttachmentContextMenu )); + ret = ETrue; + + TRAP_IGNORE( HandleTactileFeedbackL() ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CMRViewerAttachmentsField::UpdateAttachmentsListL +// ----------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::UpdateAttachmentsListL() + { + FUNC_LOG; + + + if ( iRemoteAttApi ) + { + // Let's fetch remote attachment information + iRemoteAttApi->AttachmentInfo( + *iAttachmentInfo, + *iRemoteAttUris ); + } + + RBuf buffer; // codescanner::resourcenotoncleanupstack + buffer.CleanupClosePushL(); + + RCPointerArray attachmentLinks; + CleanupClosePushL( attachmentLinks ); + + TAknLayoutText layoutText = NMRLayoutManager::GetLayoutText( + Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + + iAttachmentCount = iEntry->Entry().AttachmentCountL(); + attachmentLinks.ReserveL( iAttachmentCount ); + for ( TInt i = 0; i < iAttachmentCount; ++i ) + { + CCalAttachment* att = iEntry->Entry().AttachmentL( i ); // Ownership not gained + + // Reducing space required by file size information from + // max line width, so that file name can be trimmed to correct + // length + TInt maxLineWidth = layoutText.TextRect().Width(); + const CFont* font = layoutText.Font(); + + HBufC* attachmentSize = AttachmentNameAndSizeL( KNullDesC(), *att ); + TInt attachmentSizeLength = attachmentSize->Length(); + maxLineWidth -= font->TextWidthInPixels( *attachmentSize ); + delete attachmentSize; + attachmentSize = NULL; + + // TODO: correct icon zise to correct one. Ask from UI specifier. + TSize iconSize( 20, 20); + maxLineWidth -= iconSize.iWidth; + + // Trimming file name to fit to one line + TPtrC text = att->Label(); + HBufC* clippedTextHBufC = ClipTextLC( text, *font, maxLineWidth ); + TPtr clippedText = clippedTextHBufC->Des(); + clippedText.Trim(); + + if ( clippedText.Length() > 0 ) + { + // Creating rich text link + CESMRRichTextLink* link = CESMRRichTextLink::NewL( + buffer.Length(), + clippedText.Length() + attachmentSizeLength, + text, + CESMRRichTextLink::ETypeAttachment, + CESMRRichTextLink::ETriggerKeyRight ); + CleanupStack::PushL( link ); + attachmentLinks.AppendL( link ); + CleanupStack::Pop( link ); + + HBufC* buf = AttachmentNameAndSizeL( clippedText, *att ); + CleanupStack::PushL( buf ); + + // Append attachment name and size with line feed to buffer + buffer.ReAllocL( buffer.Length() + + clippedText.Length() + + buf->Length() + + KNewLine().Length() ); + + buffer.Append( buf->Des() ); + buffer.Append( KNewLine ); + + CleanupStack::PopAndDestroy( buf ); + } + + CleanupStack::PopAndDestroy( clippedTextHBufC ); + } + + // Remove unnecessary new line from the end of buffer. + if ( buffer.Length() >= KNewLine().Length() ) + { + buffer.SetLength( buffer.Length() - KNewLine().Length() ); + } + + // Adding all rich text links to the rich text viewer + if ( buffer.Length() > 0 ) + { + iRichTextViewer->SetTextL( &buffer ); + iRichTextViewer->SetFontL( layoutText.Font() ); + if( iAttachmentCount > 1 ) + { + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + + iRichTextViewer->ApplyLayoutChangesL(); + + iRichTextViewer->SetMargins( KMargin ); // What's this? + iRichTextViewer->HandleTextChangedL(); + + while ( attachmentLinks.Count() > 0 ) + { + CESMRRichTextLink* link = attachmentLinks[0]; + CleanupStack::PushL( link ); + attachmentLinks.Remove( 0 ); + iRichTextViewer->AddLinkL( link ); + CleanupStack::Pop( link ); + } + } + + CleanupStack::PopAndDestroy( &attachmentLinks ); + CleanupStack::PopAndDestroy( &buffer ); + + if ( iAttachmentCount ) + { + ChangeMiddleSoftKeyL( + EAknSoftkeyContextOptions, + R_QTN_MSK_OPEN ); + } + } + +// ----------------------------------------------------------------------------- +// CMRViewerAttachmentsField::ClipTextLC +// ----------------------------------------------------------------------------- +// +HBufC* CMRViewerAttachmentsField::ClipTextLC( + const TDesC& aText, const CFont& aFont, TInt aWidth ) + { + FUNC_LOG; + HBufC* text = HBufC::NewLC( aText.Length() + KAknBidiExtraSpacePerLine ); + TPtr textPtr = text->Des(); + AknBidiTextUtils::ConvertToVisualAndClip( + aText, textPtr, aFont, aWidth, aWidth ); + return text; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::AttachmentNameAndSizeL +// --------------------------------------------------------------------------- +// +HBufC* CMRViewerAttachmentsField::AttachmentNameAndSizeL( + const TDesC& aDes, + const CCalAttachment& aAttachment ) + { + HBufC* stringholder = NULL; + + CDesCArrayFlat* attachmentStrings = + new(ELeave)CDesCArrayFlat( 1 ); + CleanupStack::PushL( attachmentStrings ); + + CArrayFixFlat* integers = + new (ELeave) CArrayFixFlat(1); + CleanupStack::PushL( integers ); + + CCalAttachment::TType attType( aAttachment.Type() ); + + TInt attachmentSize(0); + if ( CCalAttachment::EFile == attType ) + { + attachmentSize = aAttachment.FileAttachment()->Size(); + } + else if ( iAttachmentInfo && iAttachmentInfo->AttachmentCount() ) + { + TInt remoteAttCount( iAttachmentInfo->AttachmentCount() ); + for ( TInt i(0); i < remoteAttCount; ++i ) + { + TPtrC label( aAttachment.Label() ); + TPtrC remoteLabel( + iAttachmentInfo->AttachmentL(i).AttachmentLabel() ); + if ( !label.Compare( remoteLabel ) ) + { + attachmentSize = iAttachmentInfo->AttachmentL(i).AttachmentSizeInBytes(); + } + } + } + + if ( attachmentSize >= KOneMegaByte ) + { + attachmentStrings->AppendL( aDes ); + + integers->AppendL( attachmentSize / KOneMegaByte ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_ATTACHMENT_FILE_MEGABYTE, + *attachmentStrings, + *integers ); + } + else if (( attachmentSize < KOneKiloByte ) && (attachmentSize != 0)) + { + attachmentStrings->AppendL( aDes ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_ATTACHMENT_FILE_LESS_THAN_KILOBYTE , + *attachmentStrings ); + } + else + { + attachmentStrings->AppendL( aDes ); + + integers->AppendL( attachmentSize / KOneKiloByte ); + + stringholder = StringLoader::LoadLC( + R_MEET_REQ_ATTACHMENT_FILE_KILOBYTE, + *attachmentStrings, + *integers ); + } + + CleanupStack::Pop( stringholder ); + CleanupStack::PopAndDestroy( integers ); + CleanupStack::PopAndDestroy( attachmentStrings ); + + return stringholder; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::HandleLongtapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + + if ( iRichTextViewer->Rect().Contains( aPosition ) ) + { + if( iRichTextViewer->LinkSelectedL() ) + { + HandleTactileFeedbackL(); + } + } + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::HandleRawPointerEventL +// --------------------------------------------------------------------------- +// +TBool CMRViewerAttachmentsField::HandleRawPointerEventL( + const TPointerEvent& aPointerEvent ) + { + FUNC_LOG; + // Handles short on attachment fields actual attachments + TBool ret( EFalse ); + + if( iAttachmentCount > 0 && + aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if( iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) ) + { + iRichTextViewer->HandlePointerEventL( aPointerEvent ); + ret = ETrue; + } + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::DynInitMenuPaneL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::DynInitMenuPaneL( + TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FUNC_LOG; + + if ( R_MR_VIEWER_ATTACHMENT_MENU == aResourceId ) + { + DynInitMenuPaneForCurrentAttachmentL( aMenuPane ); + } + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::LockL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::LockL() + { + FUNC_LOG; + if( IsLocked() ) + { + return; + } + + CESMRField::LockL(); + + delete iLockIcon; + iLockIcon = NULL; + iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue ); + iLockIcon->SetParent( this ); + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::LineSpacing +// --------------------------------------------------------------------------- +// +TInt CMRViewerAttachmentsField::LineSpacing() + { + FUNC_LOG; + // Calculates the line spacing based on default one line layout data + TInt lineSpacing( 0 ); + + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect defaultTextRect = labelLayout.TextRect(); + + TInt difference = rowRect.Height() - defaultTextRect.Height(); + + lineSpacing = difference * 2; + + return lineSpacing; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::FocusMargin +// --------------------------------------------------------------------------- +// +TInt CMRViewerAttachmentsField::FocusMargin() + { + FUNC_LOG; + // Calculates focus margin based on default one line layout data + TInt focusMagin( 0 ); + + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect defaultTextRect = labelLayout.TextRect(); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect defaultBgRect( bgLayoutRect.Rect() ); + + TInt difference = defaultBgRect.Height() - defaultTextRect.Height(); + + focusMagin = TReal( difference / 2 ); + + return focusMagin; + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::CreateRemoteAttApiL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::CreateRemoteAttApiL() + { + FUNC_LOG; + + delete iAttachmentCommandHandler; + iAttachmentCommandHandler = NULL; + + delete iRemoteAttUris; + iRemoteAttUris = NULL; + + delete iAttachmentInfo; + iAttachmentInfo = NULL; + + TInt attachmentCount( iEntry->Entry().AttachmentCountL() ); + if ( attachmentCount ) + { + iRemoteAttUris = new (ELeave) CDesCArrayFlat( 4 ); + iAttachmentInfo = CCalRemoteAttachmentInfo::NewL(); + } + + for (TInt i(0); i < attachmentCount; ++i ) + { + // Ownership not gained + CCalAttachment* att = iEntry->Entry().AttachmentL( i ); + CCalAttachment::TType attachhmentType( att->Type() ); + + if ( CCalAttachment::EUri == attachhmentType ) + { + if ( !iRemoteAttApi ) + { + TPtrC8 uri( att->Value() ); + iRemoteAttApi = CCalRemoteAttachmentApi::NewL( uri ); + } + + HBufC* uri16 = HBufC16::NewLC(att->Value().Length() ); + uri16->Des().Copy( att->Value() ); + iRemoteAttUris->AppendL( *uri16 ); + CleanupStack::PopAndDestroy( uri16 ); + } + } + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::DynInitMenuPaneForCurrentAttachmentL +// --------------------------------------------------------------------------- +// +void CMRViewerAttachmentsField::DynInitMenuPaneForCurrentAttachmentL( + CEikMenuPane* aMenuPane ) + { + FUNC_LOG; + TInt commandInProgress( + iAttachmentCommandHandler->CurrentCommandInProgress() ); + + // Get selected attachment + CCalAttachment* selectedAttachment = NULL; + + const CESMRRichTextLink* currentLink = iRichTextViewer->GetSelectedLink(); + ASSERT( currentLink ); + + TPtrC currentAttachmentName( currentLink->Value() ); + for ( TInt i(0); i < iAttachmentCount && !selectedAttachment; ++i ) + { + CCalAttachment* attachment = iEntry->Entry().AttachmentL( i ); + TPtrC attachmentLabel ( attachment->Label() ); + + if ( !attachmentLabel.Compare( currentAttachmentName ) ) + { + selectedAttachment = attachment; + } + } + + ASSERT( selectedAttachment ); + + + /* + * Case 1: Download in progress + */ + if( commandInProgress ) + { + // A) If selected attachment is remote attachment and download is in progress + // or attachment is queued for downloading + if( selectedAttachment->Type() == CCalAttachment::EUri && + EESMRViewerSaveAllAttachments == commandInProgress ) + { + aMenuPane->SetItemDimmed( + EESMRViewerOpenAttachment, + ETrue ); + + aMenuPane->SetItemDimmed( + EESMRViewerSaveAttachment, + ETrue ); + + aMenuPane->SetItemDimmed( + EESMRViewerSaveAllAttachments, + ETrue ); + } + + // B) If selected attachment is local attachment + else if( selectedAttachment->Type() == CCalAttachment::EFile ) + { + // Always hide cancel attachment download item + aMenuPane->SetItemDimmed( + EESMRViewerCancelAttachmentDownload, + ETrue ); + + // If attachment count is one, hide 'Save All' also + if ( iAttachmentCount == 1 ) + { + aMenuPane->SetItemDimmed( + EESMRViewerSaveAllAttachments, + ETrue ); + } + } + + // C) If selected attachment is Uri, and some other command is in progress + // than save all + else if( selectedAttachment->Type() == CCalAttachment::EUri && + commandInProgress != EESMRViewerSaveAllAttachments ) + { + // If this attachment is the one being downloaded + if( IsAttachmentDownloadInProgress( *selectedAttachment ) ) + { + aMenuPane->SetItemDimmed( + EESMRViewerOpenAttachment, + ETrue ); + + aMenuPane->SetItemDimmed( + EESMRViewerSaveAttachment, + ETrue ); + + aMenuPane->SetItemDimmed( + EESMRViewerSaveAllAttachments, + ETrue ); + } + + + // if this attacment is not the one being downloaded + else + { + // Always hide cancel attachment download item + aMenuPane->SetItemDimmed( + EESMRViewerCancelAttachmentDownload, + ETrue ); + + // If attachment count is one, hide 'Save All' also + if ( iAttachmentCount == 1 ) + { + aMenuPane->SetItemDimmed( + EESMRViewerSaveAllAttachments, + ETrue ); + } + } + } + } + + /* + * Case 2: No download in progress + */ + else + { + // Always hide cancel attachment download item + aMenuPane->SetItemDimmed( + EESMRViewerCancelAttachmentDownload, + ETrue ); + + // If attachment count is one, hide 'Save All' also + if ( iAttachmentCount == 1 ) + { + aMenuPane->SetItemDimmed( + EESMRViewerSaveAllAttachments, + ETrue ); + } + } + } + +// --------------------------------------------------------------------------- +// CMRViewerAttachmentsField::IsAttachmentDownloadInProgress +// --------------------------------------------------------------------------- +// +TBool CMRViewerAttachmentsField::IsAttachmentDownloadInProgress( + const CCalAttachment& aAttachment ) + { + TBool ret( EFalse ); + + RPointerArray& remoteOperations( + iAttachmentCommandHandler->RemoteOperations() ); + + TPtrC currentAttachmentName( aAttachment.Label() ); + + TInt downloadOperationCount( remoteOperations.Count() ); + if ( downloadOperationCount ) + { + for ( TInt i(0); i < downloadOperationCount; ++i ) + { + // There are download operations in progress + const MCalRemoteAttachment& attachInfo = + remoteOperations[i]->AttachmentInformation(); + + TPtrC label( attachInfo.AttachmentLabel() ); + + if ( label.Compare( currentAttachmentName ) == 0 ) + { + ret = ETrue; + } + } + } + + return ret; + } + +//EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/data/esmrfieldbuilderpluginextension.rss --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/data/esmrfieldbuilderpluginextension.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/data/esmrfieldbuilderpluginextension.rss Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/group/bld.inf --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/group/esmrfieldbuilderpluginextension.mmp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/group/esmrfieldbuilderpluginextension.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/group/esmrfieldbuilderpluginextension.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -20,8 +20,10 @@ #include #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../../inc/esmrinternaluid.h" #include "../../../../inc/emailtraceconfig.hrh" -#include "../../../inc/esmrinternaluid.h" +#include +#include TARGET esmrfieldbuilderpluginextension.dll TARGETTYPE PLUGIN @@ -30,23 +32,20 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - // Includes APP_LAYER_SYSTEMINCLUDE USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc USERINCLUDE ../../../../inc //implementations -SOURCEPATH ../src +SOURCEPATH ../src -SOURCE CESMRFieldBuilderPluginExtensionProxy.cpp -SOURCE CESMRFieldBuilderPluginExtension.cpp +SOURCE cesmrfieldbuilderpluginextensionproxy.cpp +SOURCE cesmrfieldbuilderpluginextension.cpp SOURCE resmrpluginextensionstatic.cpp // Source for Tracking view firlds @@ -65,11 +64,9 @@ SOURCE cesmrcontacthandler.cpp SOURCE cesmrviewerfromfield.cpp -SOURCE cesmrviewerattachmentsfield.cpp SOURCE cesmrviewerattendeesfield.cpp SOURCE cesmrresponsefield.cpp SOURCE cesmrresponseitem.cpp -SOURCE cesmrresponsereadyfield.cpp SOURCE cesmrconflictpopup.cpp SOURCEPATH ../data @@ -79,11 +76,13 @@ // fsemail framework LIBRARY fsfwcommonlib.lib +LIBRARY fsmailframework.lib // Dependencies to mrui components -LIBRARY esmrgui.lib //layoutmanager, mrstatic -LIBRARY esmrfieldbuildercommon.lib //cesmrfield, cesmrborderlayer -LIBRARY esmrcommon.lib //esmrhelper::locateresourcefile() +LIBRARY esmrcommon.lib +LIBRARY esmrservices.lib +LIBRARY esmrfieldbuildercommon.lib +LIBRARY mrguicommon.lib // Dependencies to Symbian OS components LIBRARY apparc.lib @@ -111,9 +110,6 @@ LIBRARY cenrepnotifhandler.lib LIBRARY estor.lib -LIBRARY fsmailframework.lib -LIBRARY esmrservices.lib - LIBRARY servicehandler.lib // for aiw LIBRARY aiwdialdata.lib LIBRARY pbk2commonui.lib @@ -126,9 +122,10 @@ LIBRARY cdlengine.lib LIBRARY aknlayout2scalable.lib LIBRARY aknlayout2.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/CESMRFieldBuilderPluginExtension.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/CESMRFieldBuilderPluginExtension.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/CESMRFieldBuilderPluginExtension.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,6 +23,8 @@ #include "cesmrfieldbuilderinterface.h" #include "resmrpluginextensionstatic.h" +class CFSMailBox; + /** * This class implements most of the field builder composite. * All Freestyle email related MRUI fields are built here @@ -73,13 +75,18 @@ TBool aResponseReady ); protected: //from MESMRBuilderExtension - TBool CFSMailBoxCapabilityL( EMRCFSMailBoxCapability aCapa ); - TBool MRCanBeOriginateedL( TBool aForceResetDefaultMRMailbox ); + TBool CFSMailBoxCapabilityL( TMRCFSMailBoxCapability aCapa ); + TBool CFSMailBoxCapabilityL( + const TDesC& aEmailAddress, + TMRCFSMailBoxCapability aCapa ); + TBool MRCanBeOriginateedL(); private: // Implementation CESMRFieldBuilderPluginExtension(); void ConstructL(); - + TBool HasCapability( const CFSMailBox& aMailBox, + MESMRBuilderExtension::TMRCFSMailBoxCapability aCapability ) const; + /** * Access CFSmailbox TLS static */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrattendeefield.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrattendeefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrattendeefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,8 +19,11 @@ #ifndef CESMRATTENDEEFIELD_H #define CESMRATTENDEEFIELD_H +#include +#include #include -#include +#include + // #include "esmrdef.h" // @@ -29,18 +32,22 @@ #include "mesmrcontacthandlerobserver.h" #include "cesmrncsaifeditor.h" -class CEikLabel; class CESMRNcsPopupListBox; class CEikButtonGroupContainer; class MESMRMeetingRequestEntry; class CAknsFrameBackgroundControlContext; +class CMRLabel; +class CAknsBasicBackgroundControlContext; +class CMRImage; +class CAknButton; +class CMRButton; -NONSHARABLE_CLASS( CESMRAttendeeField ): -public CESMRField, -public MEikEdwinSizeObserver, -public MESMRNcsAddressPopupList, -public MESMRContactHandlerObserver, -public MCoeControlObserver +NONSHARABLE_CLASS( CESMRAttendeeField ): public CESMRField, + MEikEdwinSizeObserver, + MESMRNcsAddressPopupList, + MESMRContactHandlerObserver, + MCoeControlObserver, + MEikListBoxObserver { public: /** @@ -54,37 +61,39 @@ */ ~CESMRAttendeeField(); -public: // From CESMRField +protected: // MESMRNcsAddressPopupList + void UpdatePopupContactListL( const TDesC& aMatchString, TBool iListAll ); + +protected: // from MFSEmailUiContactHandlerObserver + void OperationCompleteL( TContactHandlerCmd aCmd, const RPointerArray* aContacts ); + void OperationErrorL( TContactHandlerCmd aCmd, TInt aError ); + +protected: // from MCoeControlObserver + void HandleControlEventL( CCoeControl *aControl, TCoeEvent aEventType ); + +protected: // From CESMRField + TSize MinimumSize(); void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); void ExternalizeL( MESMRCalEntry& aEntry ); - TInt ExpandedHeight() const; - void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); void SetOutlineFocusL( TBool aFocus ); + TBool HandleSingletapEventL( const TPoint& aPosition ); + void HandleLongtapEventL( const TPoint& aPosition ); -public: // From CCoeControl +protected: // From CCoeControl TInt CountComponentControls() const; CCoeControl* ComponentControl( TInt aInd ) const; void SizeChanged(); - void PositionChanged(); TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); void SetContainerWindowL( const CCoeControl& aControl ); - void ActivateL(); - -public: // From MEikEdwinSizeObserver + +protected: // From MEikEdwinSizeObserver TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aDesirableEdwinSize); -public: // MESMRNcsAddressPopupList - void UpdatePopupContactListL( const TDesC& aMatchString, TBool iListAll ); - -public: // from MFSEmailUiContactHandlerObserver - void OperationCompleteL( TContactHandlerCmd aCmd, const RPointerArray* aContacts ); - void OperationErrorL( TContactHandlerCmd aCmd, TInt aError ); - -public: // from MCoeControlObserver - void HandleControlEventL( CCoeControl *aControl, TCoeEvent aEventType ); - +protected: // from MEikListBoxObserver + void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); + private: // Implementation /** * Constructor. @@ -98,20 +107,6 @@ void ConstructL(); /** - * Removes all attendees. - * @param aEntry calendar entry - */ - void ClearAttendeeListL( CCalEntry& aEntry ); - - /** - * Adds attendees to calendar entry. - * @param aEntry calendar entry - * @param aPhoneOwnerRole Phone owner's role - */ - void ParseAttendeesL( - MESMRMeetingRequestEntry& aMREntry ); - - /** * Calculates rect for predictive participant popup. * @return rect for popup */ @@ -153,68 +148,38 @@ void ShowPopupCbaL( TBool aShow ); void UpdateSendOptionL(); - + void GetCursorLineVerticalPos( TInt& aUpper, TInt& aLower ); + void UpdateAttendeesL( + MESMRMeetingRequestEntry& aEntry ); + private: //data - /** - * Own. Field title label. - */ - CEikLabel* iTitle; - - /** - * Temporary expanded size when editor line count grows. - */ - TSize iExpandedSize; - /** - * Field title size. - */ + // Editor size provided by edwin event. + TSize iSize; + // Field title size. TSize iTitleSize; - - /** - * Attendee role. - */ + // Attendee role. CCalAttendee::TCalRole iRole; - - /** - * Not owned. Attendee editor. - */ + // Own: Title of this field + CMRLabel* iTitle; + // Owned. Attendee editor. CESMRNcsAifEditor* iEditor; - - /** - * Own. Predictive attendee popup. - */ + // Own. Predictive attendee popup. CESMRNcsPopupListBox* iAacListBox; - - /** - * Own. - */ + // Own. Contact handler CESMRContactHandler* iContactHandler; - - /** - * Own. for default text of this field. - */ + // Own. for default text of this field. HBufC* iDefaultText; - - /** - * Enable / Disable contact popup list - */ + // Enable / Disable contact popup list TBool iAacListBoxEnabled; - - /** - * Not owned. CBA. - */ + // Not owned. CBA. CEikButtonGroupContainer* iButtonGroupContainer; - - // Not owned. Background control context - MAknsControlContext* iBackground; - - /** - * Own. for record entry's phone owner - */ - HBufC* iPhoneOwnerAddr; - - // Owned. Actual background for the editor - CAknsFrameBackgroundControlContext* iFrameBgContext; + // Own. Background control context. + CAknsBasicBackgroundControlContext* iBgCtrlContext; + /// Own: Field icon + CMRButton* iFieldButton; + // Own: Listboxes previous highlighted index + TInt iPreviousIndex; }; #endif // CESMRATTENDEEFIELD_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsitem.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsitem.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsitem.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,7 +23,7 @@ #include #include -#include // TPsMatchLocation +#include // TPsMatchLocation // FORWARD DECLARATIONS class MVPbkContactLink; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclslistshandler.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclslistshandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclslistshandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,8 +22,8 @@ #include #include // TContactItemId #include // MDesCArray -#include -#include +#include +#include #include "cesmrclsitem.h" #include "resmrstatic.h" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsmatchobserver.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsmatchobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrclsmatchobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,9 +23,9 @@ #include #include -#include -#include -#include +#include +#include +#include // FORWARD DECLARATIONS class CRepository; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrconflictpopup.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrconflictpopup.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrconflictpopup.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,6 +19,7 @@ #define __CESMRCONFLICTPOPUP_H_ #include +#include #include #include @@ -64,4 +65,4 @@ #endif /*__CESMRCONFLICTPOPUP_H_*/ -// EOF \ No newline at end of file +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrinputmodeobserver.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrinputmodeobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrinputmodeobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsaifeditor.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsaifeditor.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsaifeditor.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsaifeditor.inl --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsaifeditor.inl Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsaifeditor.inl Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncseditor.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncseditor.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncseditor.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,11 +19,7 @@ #define CESMRNCSEDITOR_H #include -#include - -class CAknsBasicBackgroundControlContext; -class CNcsCustomDraw; -class CESMRLayoutManager; +#include /** * CESMRNcsEditor is a specialised CEikRichTextEditor for @@ -160,9 +156,8 @@ /** * Set the font of the editor * @param aFont font of the editor - * @param aLayout pointer to layout manager to get the font and sizes */ - void SetFontL( const CFont* aFont, CESMRLayoutManager* aLayout ); + void SetFontL( const CFont* aFont ); #ifdef _DEBUG void DebugDump(); @@ -171,7 +166,9 @@ public: // from CoeControl TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); void SetTextL( const TDesC* aDes ); - void SetRect( const TRect& aRect ); + void FocusChanged( TDrawNow aDrawNow ); + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + protected: // from CEikEdwin virtual void HandleResourceChange( TInt aType ); @@ -190,9 +187,6 @@ HBufC* iDefaultText;//not own TBool iHasDefaultText; TRgb iTextColor; - - // background control context. Owned. - CAknsBasicBackgroundControlContext* iBgContext; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsemailaddressobject.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsemailaddressobject.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsemailaddressobject.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsemailaddressobject.inl --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsemailaddressobject.inl Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncsemailaddressobject.inl Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncspopuplistbox.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncspopuplistbox.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrncspopuplistbox.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,7 +19,10 @@ #define CESMRNCSPOPUPLISTBOX_H // INCLUDES +#include +#include #include + #include "mesmrcontacthandlerobserver.h" // FORWARD DECLARATIONS @@ -27,7 +30,6 @@ class CAknsBasicBackgroundControlContext; class CESMRContactHandler; class CFSMailBox; -class CESMRLayoutManager; // CLASS DECLARATION @@ -118,12 +120,6 @@ * @return iRMLUItemPosition value; */ TInt RMLUItemPosition() const; - - /** - * Initialise skin/theme/laf support and set layoutmanager to be used by the list - * @param aLayout LayoutManager to be used by the list - */ - void Initialise(CESMRLayoutManager* aLayout); private: // Implementation enum TRemoteLookupItemMoveDirection @@ -133,8 +129,7 @@ }; void SetListItemsFromArrayL(); void SetPopupHeightL(); - void SetRemoteLookupItemFirstToTheListL(); - void MoveRemoteLookupItemL( TRemoteLookupItemMoveDirection aDirection ); + void SetRemoteLookupItemLastToTheListL(); void CreateTextArrayAndSetToTheListboxL(); private: @@ -142,7 +137,7 @@ virtual void CreateItemDrawerL(); private: // data - CAknsBasicBackgroundControlContext* iBaseBackroundContext;//own + CAknsBasicBackgroundControlContext* iBaseBackroundContext; //own RPointerArray iMatchingArray; //own CDesCArray* iItemTextsArray;//own HBufC* iCurrentSearchText;//own @@ -168,8 +163,6 @@ */ CESMRNcsListItemDrawer( CESMRNcsPopupListBox& aListBox ); - void SetLayoutManager( CESMRLayoutManager* aLayout ); - private: // from CListItemDrawer void DrawActualItem( TInt aItemIndex, const TRect& aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, @@ -179,13 +172,19 @@ void DoDrawActualItemL( TInt aItemIndex, const TRect& aActualItemRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, TBool aItemIsSelected ) const; + void DrawPartOfItem( const TRect& aItemRect, const CFont& aFont, TInt aStartPos, TInt aLength, const TDesC& aDes, TBool aUnderlined, TInt aBaseline ) const; +private: // Implementation + void DrawPopUpBackGroundL( const TRect& aActualItemRect ) const; + void DrawPopUpSelectorL( const TRect& aActualItemRect ) const; + void DrawPopUpTextL( TInt aItemIndex, const TRect& aActualItemRect ) const; + private: //data - CESMRNcsPopupListBox& iListBox; - CESMRLayoutManager* iLayout;//not own + + CESMRNcsPopupListBox& iListBox; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponsefield.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponsefield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponsefield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,8 +19,11 @@ #define CESMRRESPONSEFIELD_H // INCLUDES +#include +#include + #include "cesmrfield.h" -#include "resmrstatic.h" +#include "resmrpluginextensionstatic.h" // FORWARD DECLARATIONS class CLayoutManager; @@ -56,13 +59,14 @@ TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); void FocusChanged( TDrawNow aDrawNow ); TSize MinimumSize(); - + public: // From CESMRField void InitializeL(); void InternalizeL( MESMRCalEntry& aEntry ); - void ExecuteGenericCommandL( TInt aCommand ); - void SetLayoutManager( CESMRLayoutManager* aLayout ); + TBool ExecuteGenericCommandL( TInt aCommand ); void SetOutlineFocusL( TBool aFocus ); + TBool HandleSingletapEventL( const TPoint& aPosition ); + void HandleLongtapEventL( const TPoint& aPosition ); public: // New methods /** @@ -88,9 +92,9 @@ private: // Implementation CESMRResponseField(MESMRResponseObserver* aResponseObserver); void ConstructL(); - void Draw( const TRect& aRect ) const; void HandleCancelledEventItemsL( MESMRCalEntry& aEntry ); CCoeControl* ControlItem( TInt aIndex ); + TBool HandleTapEventL( const TPoint& aPosition ); private: /// Own: Conflict popup @@ -101,14 +105,25 @@ MESMRResponseObserver* iResponseObserver; /// Currently selected index TInt iSelectionIndex; - /// Layout data - CESMRLayoutManager* iLayout; /// Font for the label text const CFont* iFont; /// Own: Static TLS data handler - RESMRStatic iESMRStatic; + RESMRPluginExtensionStatic iESMRStatic; /// iESMRstatic accessed TBool iESMRStaticAccessed; + /// whether a normal response + TBool iNormalResponse; + /// whether a remove response + TBool iRemoveResponse; + /// Judge if there is any event conflict with current event. + TBool iConflicted; + /// Judge whether it has implemented HandleSingletapEventL + TBool iPointEvent; + /// Judge whether the long tap have been consumed. + /// To avoid the same event be handled by + /// HandleSingletapEventL() when HandleLongtapEventL(). + TBool iLongTapEventConsumed; + }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponseitem.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponseitem.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponseitem.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,7 +23,6 @@ #include "esmrcommands.h" // FORWARD DECLARATIONS -class CESMRLayoutManager; class CMRLabel; class CMRImage; @@ -86,14 +85,14 @@ * @param Text for the item */ void SetTextL( const TDesC& aItemText ); - + /** - * Gives pointer to layoutmanager for this class. - * - * @param aLayout- Layout manager + * Sets response topic text to Response label. Setting text is done + * in two phases (SetTextL and SetTextToLabelL), so that correct Rect + * has been set before trying to wrap the text into Label. */ - void SetLayoutManager( CESMRLayoutManager* aLayout ); - + void SetTextToLabelL(); + /** * Counts the number of lines that item needs for the text. * This is called to give enough space for the item. @@ -108,6 +107,14 @@ * @return A command id */ TESMRCommand CommandId() const; + + /** + * Set the label underlined. + * + * @param set underline true or false. + * @return void + */ + void SetUnderlineL( TBool aUndreline ); private: // Implementation CMRImage* IconL(TBool aChecked ); @@ -126,8 +133,6 @@ HBufC* iItemText; /// Item's command id TESMRCommand iCmd; - /// Layout data - CESMRLayoutManager* iLayout; /// Flag for the item highlight status TBool iHighlighted; /// Flag for telling whether the item needs the icon diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponsereadyfield.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrresponsereadyfield.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This field is shown when MR has a response value, -* -*/ - -#ifndef __CESMRRESPONSEREADYFIELD_H__ -#define __CESMRRESPONSEREADYFIELD_H__ - -#include -#include "cesmrfield.h" - -class MESMRResponseObserver; - -/** - * This field is shown instead of response field when MR has response value. - * When pressing "OK" button on the top of this field, this field is hided and - * response field is shown. - */ -NONSHARABLE_CLASS( CESMRResponseReadyField ): public CESMRField - { -public: - /** - * Creates new instance from response ready field and returns it. - * @param aResponseObserver - Observer is called when user wants to change response value - * @return New CESMRResponseReadyField object. - */ - static CESMRResponseReadyField* NewL( MESMRResponseObserver* aResponseObserver ); - - /** - * C++ Destructor. - */ - ~CESMRResponseReadyField(); - -public: // From CCoeControl - TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - -public: // From CESMRField - void InitializeL(); - void InternalizeL( MESMRCalEntry& aEntry ); - void SetOutlineFocusL( TBool aFocus ); - void ExecuteGenericCommandL( TInt aCommand ); - -protected: - CEikLabel* iLabel; - -private: // Implementation - void ConstructL(); - CESMRResponseReadyField( MESMRResponseObserver* aResponseObserver ); - -private: //data - // Pointer to response observer. not own. - MESMRResponseObserver* iResponseObserver; - }; - -#endif // __CESMRRESPONSEREADYFIELD_H__ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrtrackingfieldlabel.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrtrackingfieldlabel.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrtrackingfieldlabel.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrtrackstatus.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrtrackstatus.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrtrackstatus.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,21 +19,24 @@ #ifndef CESMRTRACKSTATUS_H_ #define CESMRTRACKSTATUS_H_ -#include "resmrstatic.h" -#include "cesmrviewerlabelfield.h" #include #include #include #include +#include "cesmrfield.h" +#include "resmrstatic.h" + + // Forward declarations class CCalAttendee; +class CMRImage; /** * This class shows the status of the attendee of a meeting request * a meeting request can have many of these in several modes */ -NONSHARABLE_CLASS( CESMRTrackStatus ) : public CESMRViewerLabelField +NONSHARABLE_CLASS( CESMRTrackStatus ) : public CESMRField { public: /** @@ -109,7 +112,7 @@ /** * Owned. checkbox_mark/checkbox_unmark */ - CEikImage* iIcon; + CMRImage* iIcon; }; #endif /*CESMRTRACKSTATUS_H_*/ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerattachmentsfield.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerattachmentsfield.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Meeting request attachments field - * -*/ - - -#ifndef CESMRVIEWERATTACHMENTSFIELD_H -#define CESMRVIEWERATTACHMENTSFIELD_H - -#include - -#include "cesmrfield.h" -#include "cesmrrichtextviewer.h" -#include "resmrstatic.h" - -class CESMRRichTextViewer; -class CESMRRichTextLink; -class CMRImage; - -// -class CESMRAttachmentInfo; -class CFSMailMessage; -// - -/** - * Shows the attachments - **/ -NONSHARABLE_CLASS( CESMRViewerAttachmentsField ): - public CESMRField, - public MEikEdwinSizeObserver, - public MESMRRichTextObserver, - public MEikCommandObserver - { -public: - /** - * Constructor for attachments field - * - * @return New attachments field object - */ - static CESMRViewerAttachmentsField* NewL( ); - - /** - * C++ Destructor. - */ - ~CESMRViewerAttachmentsField( ); - -public: // From CESMRField - TSize MinimumSize(); - void InternalizeL( MESMRCalEntry& aEntry ); - void InitializeL(); - void ListObserverSet(); - void SetOutlineFocusL( TBool aFocus ); - void ExecuteGenericCommandL( TInt aCommand ); - -public: // From MESMRRichTextObserver - TBool HandleRichTextLinkSelection(const CESMRRichTextLink* aLink ); - -public: // From CCoeControl - TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType ); - TInt CountComponentControls() const; - CCoeControl* ComponentControl( TInt aInd ) const; - void SizeChanged(); - void SetContainerWindowL( const CCoeControl& aContainer ); - -public: // From MEikEdwinSizeObserver - TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, - TSize aSize ); - -protected: // From MEikCommandObserver - - /** - * Process commands from contact menu handler. - * Forwards commands to event observer. - */ - void ProcessCommandL( TInt aCommandId ); - -private: // Implementation - CESMRViewerAttachmentsField(); - void ConstructL(); - TRect RichTextViewerRect(); - - // - /** - * Cleanup operations for RPointerArray. - * - * @param aArray Pointer to RPointerArray. - */ - static void MessagePartPointerArrayCleanup( TAny* aArray ); - - void UpdateAttachmentInfoL(); - // - -private: - // Size of this field - TSize iSize; - // Own: Field icon - CMRImage* iFieldIcon; - // Actual text of this field - CESMRRichTextViewer* iRichTextViewer; - // RichTextViewer line count. Own - TInt iLineCount; - // - /// Own: - RESMRStatic iESMRStatic; - /// Ref: Contact Menu handler - CESMRContactMenuHandler* iCntMenuHdlr; - // - // The number of attached files. - TInt iAttachmentCount; - // The attachment text - HBufC* iAttachmentText; - // - CFSMailMessage* iMailMessage; // ref - CESMRAttachmentInfo* iAttachmentInfo; // own - - TBool iFocused; - // - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerattendeesfield.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerattendeesfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerattendeesfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -56,15 +56,16 @@ TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); void SetContainerWindowL(const CCoeControl& aContainer); TSize MinimumSize(); - virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); public: // From CESMRField void InitializeL(); void SetOutlineFocusL( TBool aFocus ); void InternalizeL( MESMRCalEntry& aEntry ); void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower); + void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower); void ListObserverSet( ); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); + void HandleLongtapEventL( const TPoint& aPosition ); public: // From MEikEdwinSizeObserver TBool HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aType, @@ -78,11 +79,13 @@ void ConstructL( ); HBufC* ClipTextLC( const TDesC& aText, const CFont& aFont, TInt aWidth ); void UpdateAttendeesListL(); + TInt LineSpacing(); + TInt FocusMargin(); private: // data // Own: Title of this field CMRLabel* iTitle; - // Own: Container for all the attendees + // Not own: Container for all the attendees CESMRRichTextViewer* iRichTextViewer; // Size of the field when after field has expanded. TSize iExpandedSize; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerfromfield.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerfromfield.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerfromfield.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,6 +20,8 @@ #define CESMRVIEWERFROMFIELD_H_ // INCLUDES +#include +#include #include #include @@ -33,8 +35,8 @@ * Field for showing the "from" information. In other words this field shows * that who sent/organized this meeting request. */ -NONSHARABLE_CLASS( CESMRViewerFromField ) : - public CESMRField, public MEikEdwinSizeObserver +NONSHARABLE_CLASS( CESMRViewerFromField ) : public CESMRField, + MEikEdwinSizeObserver { public: /** @@ -52,8 +54,9 @@ public: // From CESMRField void InternalizeL( MESMRCalEntry& aEntry ); void InitializeL(); - void ExecuteGenericCommandL( TInt aCommand ); + TBool ExecuteGenericCommandL( TInt aCommand ); void SetOutlineFocusL( TBool aFocus ); + void HandleLongtapEventL( const TPoint& aPosition ); public: // From CCoeControl TKeyResponse OfferKeyEventL( @@ -64,7 +67,6 @@ void SizeChanged(); TSize MinimumSize(); void SetContainerWindowL(const CCoeControl& aContainer); - virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); public: // From MEikEdwinSizeObserver TBool HandleEdwinSizeEventL( @@ -77,7 +79,7 @@ void ConstructL( ); private: // data - // Own: Actual text of this field, not owned + // Not own: Actual text of this field, not owned CESMRRichTextViewer* iRichTextViewer; // Own: Topic text of this fiels CMRLabel* iFieldTopic; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/mesmrclslistsobserver.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/mesmrclslistsobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/mesmrclslistsobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/mesmrcontacthandlerobserver.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/mesmrcontacthandlerobserver.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/mesmrcontacthandlerobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,7 +21,7 @@ #include // -#include "cfsmailclient.h" +#include "CFSMailClient.h" // class TESMRPluginExtensionData; @@ -53,14 +53,20 @@ */ void Close(); - /* + /** * Returns global instance of default CFSMailBox. - * @param aForceReset If ETrue, the default FS mailbox is reset - * before returning it. * @return Reference to CFSMailBox object */ - CFSMailBox& DefaultFSMailBoxL( TBool aForceReset = EFalse ); + CFSMailBox& DefaultFSMailBoxL(); + /** + * Returns mail box instance for given email address. + * Ownership of mail box is transferred to caller. + * + * @param aEmailAddress email address of the desired mail box + * @return CFSMailBox instance. Ownership is transferred to caller. + */ + CFSMailBox* MailBoxL( const TDesC& aEmailAddress ); private: // Implementation diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtension.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtension.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtension.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,13 +25,13 @@ #include "cesmrattendeefield.h" #include "cesmrtrackingfieldlabel.h" #include "cesmrtrackstatus.h" -#include "cesmrviewerattachmentsfield.h" #include "cesmrviewerattendeesfield.h" #include "cesmrresponsefield.h" -#include "cesmrresponsereadyfield.h" #include "cesmrviewerfromfield.h" +#include "cesmrfieldbuilderinterface.h" +#include "CFSMailCommon.h" -#include +#include // DEBUG #include "emailtrace.h" @@ -74,33 +74,45 @@ } // ---------------------------------------------------------------------------- -// CESMRFieldBuilderPluginExtension::ExtensionL +// CESMRFieldBuilderPluginExtension::CFSMailBoxCapabilityL // ---------------------------------------------------------------------------- // TBool CESMRFieldBuilderPluginExtension::CFSMailBoxCapabilityL( - EMRCFSMailBoxCapability aCapa ) + TMRCFSMailBoxCapability aCapa ) { FUNC_LOG; + iESMRStatic.ConnectL(); iESMRStaticAccessed = ETrue; - TBool response(EFalse); + return HasCapability( iESMRStatic.DefaultFSMailBoxL(), aCapa ); + } - if (aCapa == EMRCFSAttendeeStatus) - { - response = iESMRStatic.DefaultFSMailBoxL().HasCapability( - EFSMBoxCapaMeetingRequestAttendeeStatus ); - } +// ---------------------------------------------------------------------------- +// CESMRFieldBuilderPluginExtension::CFSMailBoxCapabilityL +// ---------------------------------------------------------------------------- +// +TBool CESMRFieldBuilderPluginExtension::CFSMailBoxCapabilityL( + const TDesC& aEmailAddress, + TMRCFSMailBoxCapability aCapa ) + { + FUNC_LOG; + + iESMRStatic.ConnectL(); + iESMRStaticAccessed = ETrue; - return response; + CFSMailBox* mailBox = iESMRStatic.MailBoxL( aEmailAddress ); + TBool result = HasCapability( *mailBox, aCapa ); + delete mailBox; + + return result; } // ---------------------------------------------------------------------------- // CESMRFieldBuilderPluginExtension::MRCanBeOriginateedL // ---------------------------------------------------------------------------- // -TBool CESMRFieldBuilderPluginExtension::MRCanBeOriginateedL( - TBool aForceResetDefaultMRMailbox ) +TBool CESMRFieldBuilderPluginExtension::MRCanBeOriginateedL() { FUNC_LOG; TBool retValue( EFalse ); @@ -112,8 +124,7 @@ CleanupStack::PushL( calUtils2 ); if ( calUtils2->MRViewersEnabledL() ) { - TRAPD( err, - iESMRStatic.DefaultFSMailBoxL( aForceResetDefaultMRMailbox ) ); + TRAPD( err, iESMRStatic.DefaultFSMailBoxL() ); if ( KErrNone == err ) { @@ -191,6 +202,9 @@ User::Leave( KErrArgument ); } } + // Set field mode + field->SetFieldMode( EESMRFieldModeEdit ); + return field; } @@ -207,11 +221,6 @@ CESMRField* field = NULL; switch ( aField.iFieldId ) { - case EESMRFieldAttachments: - { - field = CESMRViewerAttachmentsField::NewL(); - } - break; case EESMRFieldAttendee: { field = CESMRViewerAttendeesField::NewL( CCalAttendee::EReqParticipant ); @@ -227,11 +236,6 @@ field = CESMRResponseField::NewL( aResponseObserver ); break; } - case EESMRFieldResponseReadyArea: - { - field = CESMRResponseReadyField::NewL( aResponseObserver ); - break; - } case EESMRFieldOrganizer: { field = CESMRViewerFromField::NewL(); @@ -262,5 +266,46 @@ return field; } + +// ----------------------------------------------------------------------------- +// CESMRFieldBuilderPluginExtension::HasCapability +// ----------------------------------------------------------------------------- +// +TBool CESMRFieldBuilderPluginExtension::HasCapability( + const CFSMailBox& aMailBox, + MESMRBuilderExtension::TMRCFSMailBoxCapability aCapability ) const + { + TBool response(EFalse); + + switch ( aCapability ) + { + case EMRCFSAttendeeStatus: + { + response = aMailBox.HasCapability( + EFSMBoxCapaMeetingRequestAttendeeStatus ); + break; + } + + case EMRCFSRemoveFromCalendar: + { + response = aMailBox.HasCapability( EFSMBoxCapaRemoveFromCalendar ); + break; + } + + case EMRCFSSupportsAttachmentsInMR: + { + response = aMailBox.HasCapability( EFSMboxCapaSupportsAttahmentsInMR ); + } + break; + + default: + { + break; + } + } + + return response; + } + //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtensionProxy.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtensionProxy.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtensionProxy.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -9,52 +9,46 @@ * Initial Contributors: * Nokia Corporation - initial contribution. * -* Contributors: -* -* Description: ESMR titled field implementation + * Contributors: * -*/ - -#include "emailtrace.h" + * Description: ESMR titled field implementation + * + */ #include "cesmrattendeefield.h" - -#include -#include -#include -#include -#include -#include -#include // #include "esmrcommands.h" -#include "cfsmailclient.h" +#include "CFSMailClient.h" // #include "cesmrncspopuplistbox.h" #include "cesmrncsemailaddressobject.h" #include "mesmrlistobserver.h" -#include "cesmrborderlayer.h" #include "cesmrcontacthandler.h" #include "mesmrmeetingrequestentry.h" #include "esmrfieldbuilderdef.h" -#include "cesmrlayoutmgr.h" -// Removed profiling. +#include "cmrlabel.h" +#include "nmrlayoutmanager.h" +#include "nmrbitmapmanager.h" +#include "cmrimage.h" +#include "cmrbutton.h" -using namespace ESMRLayout; +#include +#include +#include +#include +#include +#include +#include -//CONSTANTS +// DEBUG +#include "emailtrace.h" + // unnamed namespace for local definitions namespace { // codescanner::namespace - +//CONSTANTS +const TInt KMaxAmountOfItems( 4 ); const TInt KMaxRemoteSearchResponseLength = 255; -static void RPointerArrayResetAndDestroy( TAny* aPtr ) - { - static_cast*>( aPtr )->ResetAndDestroy(); - } - -#ifdef _DEBUG - // Panic code literal _LIT( KESMRAttendeeField, "ESMRAttendeeField" ); @@ -69,8 +63,6 @@ User::Panic( KESMRAttendeeField, aPanic ); } -#endif // _DEBUG - }//namespace // ======== MEMBER FUNCTIONS ======== @@ -79,11 +71,13 @@ // CESMRAttendeeField::CESMRAttendeeField // --------------------------------------------------------------------------- // -CESMRAttendeeField::CESMRAttendeeField( CCalAttendee::TCalRole aRole ) : - iRole( aRole) +CESMRAttendeeField::CESMRAttendeeField( CCalAttendee::TCalRole aRole ) +:iRole( aRole ) { FUNC_LOG; - //do nothing + SetFocusType( EESMRHighlightFocus ); + SetFieldId ( (iRole == CCalAttendee::EReqParticipant) ? + EESMRFieldAttendee : EESMRFieldOptAttendee ); } // --------------------------------------------------------------------------- @@ -94,11 +88,11 @@ { FUNC_LOG; delete iAacListBox; - delete iTitle; delete iContactHandler; delete iDefaultText; - delete iFrameBgContext; - delete iPhoneOwnerAddr; + delete iBgCtrlContext; + delete iFieldButton; + delete iTitle; } // --------------------------------------------------------------------------- @@ -122,31 +116,90 @@ void CESMRAttendeeField::ConstructL( ) { FUNC_LOG; - SetExpandable ( ); - - SetFieldId ( (iRole == CCalAttendee::EReqParticipant) ? EESMRFieldAttendee - : EESMRFieldOptAttendee ); - - iTitle = new (ELeave) CEikLabel(); - iTitle->SetLabelAlignment ( CESMRLayoutManager::IsMirrored ( ) ? ELayoutAlignRight - : ELayoutAlignLeft ); + SetComponentsToInheritVisibility( ETrue ); iContactHandler = CESMRContactHandler::NewL(); iDefaultText = StringLoader::LoadL ( R_QTN_MEET_REQ_CONTACT_FIELD ); - iEditor = new ( ELeave ) CESMRNcsAifEditor( *iContactHandler, iDefaultText ); + + iFieldButton = CMRButton::NewL( NMRBitmapManager::EMRBitmapSearchContacts ); + iFieldButton->SetParent( this ); + iFieldButton->SetObserver( this ); - iEditor->SetPopupList(this ); - - HBufC* label = StringLoader::LoadLC (iRole == CCalAttendee::EReqParticipant ? - R_QTN_MEET_REQ_LABEL_REQUIRED:R_QTN_MEET_REQ_LABEL_OPT ); + iTitle = CMRLabel::NewL(); + iTitle->SetParent( this ); + + HBufC* buf = NULL; + if( FieldId() == EESMRFieldAttendee ) + { + buf = StringLoader::LoadLC( R_QTN_MEET_REQ_LABEL_REQUIRED ); + } + + if( FieldId() == EESMRFieldOptAttendee ) + { + buf = StringLoader::LoadLC( R_QTN_MEET_REQ_LABEL_OPT ); + } + + iTitle->SetTextL( *buf ); // ownership transferred + CleanupStack::Pop( buf ); - iTitle->SetTextL ( *label ); - CleanupStack::PopAndDestroy (label ); - iBackground = AknsDrawUtils::ControlContext( this ); + iEditor = + new ( ELeave ) CESMRNcsAifEditor( *iContactHandler, iDefaultText ); + CESMRField::ConstructL( iEditor ); + iEditor->ConstructL ( + this, + KMaxAddressFieldLines, + 0, + CEikEdwin::EAvkonEditor | CEikEdwin::EResizable | + CEikEdwin::ENoAutoSelection |CEikEdwin::EInclusiveSizeFixed | + CEikEdwin::ENoHorizScrolling + ); + iEditor->SetEdwinSizeObserver( this ); + iEditor->SetParent( this ); + iEditor->SetPopupList( this ); + iEditor->SetAlignment ( EAknEditorAlignBidi | EAknEditorAlignCenter ); + iEditor->SetAknEditorInputMode ( EAknEditorTextInputMode ); + iEditor->SetAknEditorFlags ( + EAknEditorFlagNoT9| EAknEditorFlagUseSCTNumericCharmap ); + iEditor->SetAknEditorCurrentCase ( EAknEditorLowerCase ); + + // Draw bg instead of using skin bg + TRect tempRect( 0, 0, 0, 0 ); + NMRBitmapManager::TMRBitmapStruct bitmapStruct; + bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter ); + iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( + bitmapStruct.iItemId, + tempRect, + EFalse ); + iEditor->SetSkinBackgroundControlContextL( iBgCtrlContext ); + } + +// --------------------------------------------------------------------------- +// CESMRAttendeeField::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CESMRAttendeeField::MinimumSize() + { + TRect parentRect( Parent()->Rect() ); - CESMRField::ConstructL ( iEditor ); + TRect richTextRect = + NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect(); + + TRect textRect( NMRLayoutManager::GetLayoutText( + richTextRect, + NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() ); + + // Adjust field size so that there's room for expandable editor. + richTextRect.Resize( 0, iSize.iHeight - textRect.Height() ); + + // Add title area to the required size + TSize titleSize( CESMRField::MinimumSize() ); + + TSize completeFieldSize( titleSize ); + completeFieldSize.iHeight += richTextRect.Height(); + + return completeFieldSize; } // --------------------------------------------------------------------------- @@ -156,19 +209,7 @@ void CESMRAttendeeField::InitializeL() { FUNC_LOG; - iEditor->SetFontL( iLayout->Font(iCoeEnv, iFieldId), iLayout ); - iEditor->SetAlignment ( EAknEditorAlignBidi | EAknEditorAlignCenter ); - iEditor->SetAknEditorInputMode ( EAknEditorTextInputMode ); - iEditor->SetAknEditorFlags ( EAknEditorFlagNoT9| EAknEditorFlagUseSCTNumericCharmap ); - iEditor->SetAknEditorCurrentCase ( EAknEditorLowerCase ); - iEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL ( CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EOff ); - iEditor->SetEdwinSizeObserver ( this ); - - iTitleSize = iLayout->FieldSize ( EESMRFieldAttendeeLabel ); - iTitle->SetFont( iLayout->Font(iCoeEnv, EESMRFieldAttendeeLabel) ); - - iAacListBox->Initialise(iLayout); + // No Implementation } // --------------------------------------------------------------------------- @@ -178,31 +219,39 @@ void CESMRAttendeeField::InternalizeL( MESMRCalEntry& aEntry ) { FUNC_LOG; + iEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL ( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOff ); + + TInt fieldAttendeeCount( 0 ); + CCalEntry& entry = aEntry.Entry ( ); RPointerArray< CCalAttendee > attendees = entry.AttendeesL ( ); - RPointerArray< CESMRNcsEmailAddressObject > addressList; // codescanner::resourcenotoncleanupstack - TCleanupItem arrayCleanup( RPointerArrayResetAndDestroy, &addressList ); - CleanupStack::PushL( arrayCleanup ); + RCPointerArray< CESMRNcsEmailAddressObject > addressList; + CleanupClosePushL( addressList ); - for (TInt i(0); i < attendees.Count ( ); i++ ) + for (TInt i(0); i < attendees.Count(); i++ ) { if ( attendees[i]->RoleL() == iRole ) { + fieldAttendeeCount++; + const TDesC& addr = attendees[i]->Address ( ); const TDesC& commonName = attendees[i]->CommonName ( ); - CESMRNcsEmailAddressObject* obj = CESMRNcsEmailAddressObject::NewL ( commonName, addr ); + CESMRNcsEmailAddressObject* obj = + CESMRNcsEmailAddressObject::NewL ( commonName, addr ); CleanupStack::PushL (obj ); addressList.AppendL( obj ); CleanupStack::Pop( obj ); } } - if (attendees.Count() > 0 ) + if ( fieldAttendeeCount > 0 ) { if ( !iObserver->IsControlVisible(iFieldId ) ) { - iObserver->InsertControl(iFieldId ); + iObserver->ShowControl( iFieldId ); } iEditor->SetAddressesL( addressList ); } @@ -214,9 +263,9 @@ } //don't show optional attendees field on initialisation if there are none - if ( iRole == CCalAttendee::EOptParticipant ) + if ( ( EESMRFieldModeEdit == FieldMode() ) && ( iRole == CCalAttendee::EOptParticipant ) ) { - if ( addressList.Count() == 0 ) + if ( fieldAttendeeCount == 0 ) { this->MakeVisible(EFalse); } @@ -244,32 +293,19 @@ } // This should always be called for MR entries - __ASSERT_DEBUG( mrEntry, Panic(EESMRAttendeeFieldNotMeetingRequestEntry ) ); + __ASSERT_ALWAYS( mrEntry, Panic( EESMRAttendeeFieldNotMeetingRequestEntry )); - if(iEditor->HasDefaultText()) + if( iEditor->HasDefaultText() ) { ClearDefaultTextL(); } - // remove all previous attendees from the attendee list - CCalEntry& entry = mrEntry->Entry(); - - if ( !iPhoneOwnerAddr ) - { - CCalUser* phoneOwner = entry.PhoneOwnerL(); - if (phoneOwner) - { - iPhoneOwnerAddr = phoneOwner->Address().AllocL(); - } - } - - ClearAttendeeListL ( entry ); - ParseAttendeesL ( *mrEntry ); - - HBufC *text = iEditor->GetTextInHBufL(); + UpdateAttendeesL( *mrEntry ); + + HBufC* text = iEditor->GetTextInHBufL(); - //If there is no added attendees put back the default text - if(!text) + //If there is no attendees, put back the default text + if( !text ) { AppendDefaultTextL(); //during initialisation, SelectAllL() in setoutlinefocus gets overridden so this is needed @@ -279,50 +315,24 @@ } // --------------------------------------------------------------------------- -// CESMRAttendeeField::ExpandedHeight -// --------------------------------------------------------------------------- -// -TInt CESMRAttendeeField::ExpandedHeight( ) const - { - FUNC_LOG; - return iTitleSize.iHeight + iExpandedSize.iHeight; - } - -// --------------------------------------------------------------------------- -// CESMRSubjectField::GetMinimumVisibleVerticalArea -// --------------------------------------------------------------------------- -// -void CESMRAttendeeField::GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower) - { - FUNC_LOG; - TRect rect; - - TRAPD( err, iEditor->GetLineRectL( rect ) ); - - if ( err == KErrNone ) - { - rect.Move( 0, iTitleSize.iHeight ); - aUpper = rect.iTl.iY; - aLower = rect.iBr.iY; - } - else - { - // This isn't expected to happen in any situation. - // but if it does at least there will be no zero size - CESMRField::GetMinimumVisibleVerticalArea( aUpper, aLower ); - } - } - -// --------------------------------------------------------------------------- // CESMRAttendeeField::CountComponentControls // --------------------------------------------------------------------------- // TInt CESMRAttendeeField::CountComponentControls( ) const { FUNC_LOG; - TInt count = CESMRField::CountComponentControls ( ); + TInt count( 0 ); + if( iFieldButton ) + { + ++count; + } + + if ( iTitle ) + { + ++count; + } - if ( iTitle ) + if( iEditor ) { ++count; } @@ -337,11 +347,17 @@ CCoeControl* CESMRAttendeeField::ComponentControl( TInt aInd ) const { FUNC_LOG; - if ( aInd == 0 ) + switch ( aInd ) { - return iTitle; + case 0: + return iFieldButton; + case 1: + return iTitle; + case 2: + return iEditor; + default: + return NULL; } - return CESMRField::ComponentControl ( aInd ); } // --------------------------------------------------------------------------- @@ -351,73 +367,76 @@ void CESMRAttendeeField::SizeChanged( ) { FUNC_LOG; - TRect rect = Rect ( ); - - if ( CESMRLayoutManager::IsMirrored ( ) ) + TRect rect( Rect() ); + + TAknLayoutRect firstRowLayoutRect( + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); + TRect firstRowRect( firstRowLayoutRect.Rect() ); + + TRect secondRowRect( firstRowRect ); + secondRowRect.Move( 0, firstRowRect.Height() ); + + // Layout field button + if( iFieldButton ) + { + TAknWindowComponentLayout buttonLayout( + NMRLayoutManager::GetWindowComponentLayout( + NMRLayoutManager::EMRLayoutTextEditorIcon ) ); + AknLayoutUtils::LayoutControl( + iFieldButton, firstRowRect, buttonLayout ); + } + + // Layout field title + if( iTitle ) + { + TAknLayoutText labelLayout( + NMRLayoutManager::GetLayoutText( + firstRowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ) ); + + iTitle->SetRect( labelLayout.TextRect() ); + + // Setting font also for the label. Failures are ignored. + iTitle->SetFont( labelLayout.Font() ); + } + + // Layout field editor + if( iEditor ) { - TPoint titlePos( rect.iBr.iX - iTitleSize.iWidth, rect.iTl.iY ); - iTitle->SetExtent ( titlePos, iTitleSize ); + TAknLayoutText editorLayoutText = NMRLayoutManager::GetLayoutText( + secondRowRect, + NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect editorRect = editorLayoutText.TextRect(); - TSize textSize( rect.Width ( ) - ( KIconSize.iWidth + KIconBorderMargin ), - iExpandedSize.iHeight ); - TPoint textPos( rect.iBr.iX - KIconSize.iWidth- textSize.iWidth, - rect.iTl.iY + iTitleSize.iHeight ); - iBorder->SetExtent ( textPos, textSize ); + // Resize height according to actual height required by edwin. + editorRect.Resize( 0, iSize.iHeight - editorRect.Height() ); + + iEditor->SetRect( editorRect ); + + // Try setting font. Failures are ignored. + TRAP_IGNORE( iEditor->SetFontL( editorLayoutText.Font() ) ); } - else - { - // title - iTitle->SetExtent ( rect.iTl, iTitleSize ); - - // editor (editor is wrapped inside the 'iBorder' member) - TRect borderRect(TPoint ( - rect.iTl.iX + KIconSize.iWidth + KIconBorderMargin, - rect.iTl.iY + iTitleSize.iHeight ), TSize ( - rect.Width ( )- KIconSize.iWidth + KIconBorderMargin - KFieldEndMargin, - iExpandedSize.iHeight )); - - iBorder->SetRect (borderRect ); - } + + // Layout field focus + if( iEditor ) + { + // Layouting focus for rich text editor area + TRect bgRect( iEditor->Rect() ); + + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + } if ( iAacListBox && iAacListBox->IsVisible ( ) ) { TRAPD( error, iAacListBox->SetPopupMaxRectL( ResolvePopupRectL()) ) if ( error ) { - CEikonEnv::Static()->// codescanner::eikonenvstatic - HandleError( error ); + iCoeEnv->HandleError( error ); } } - - if( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iEditor->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } - } - -// --------------------------------------------------------------------------- -// CESMRAttendeeField::PositionChanged -// --------------------------------------------------------------------------- -// -void CESMRAttendeeField::PositionChanged( ) - { - FUNC_LOG; - if ( iAacListBox && iAacListBox->IsVisible ( ) ) - { - TRAPD( error, iAacListBox->SetPopupMaxRectL( ResolvePopupRectL()) ) - if ( error ) - { - CEikonEnv::Static()->// codescanner::eikonenvstatic - HandleError( error ); - } - } - - if( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iEditor->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); - } } // ----------------------------------------------------------------------------- @@ -429,38 +448,57 @@ FUNC_LOG; if ( !iAacListBox ) { - return TRect(0,0,0,0); + return TRect( 0, 0, 0, 0 ); + } + + TRect popupRect( 0, 0, 0, 0 ); + + // Let's determine Popup's maximum height + TInt requiredPopupHeight = iAacListBox->CalcHeightBasedOnNumOfItems( + iAacListBox->Model()->NumberOfItems() ); + TInt numberOfItemsInPopUp = iAacListBox->Model()->NumberOfItems(); + + if( numberOfItemsInPopUp > KMaxAmountOfItems ) + { + // reducing popup item count shown at once to maximum value + requiredPopupHeight = iAacListBox->CalcHeightBasedOnNumOfItems( + KMaxAmountOfItems ); + } + + // Popup x-coords are always the same + TInt topLeftX = iEditor->Rect().iTl.iX; + TInt bottomRightX = iEditor->Rect().iBr.iX; + + // Popup y-coords need to be calculated + TInt topLeftY( 0 ); + TInt bottomRightY( 0 ); + + // Next we have to resolve if popup needs to be drawn below or + // above the cursor (space requirement) + + TRect editorLineRect; + iEditor->GetLineRectL( editorLineRect ); + TInt editorLineTopLeftY = editorLineRect.iTl.iY; + TInt diff = iEditor->Rect().iTl.iY; + TInt editorLineTopLeftYRelativeToParent = editorLineTopLeftY + diff; + + TInt listPaneHeight = Parent()->Rect().Height(); + + // Popup will be drawn above the cursor + if( editorLineTopLeftYRelativeToParent > TReal( listPaneHeight / 2 ) ) + { + topLeftY = editorLineTopLeftYRelativeToParent - requiredPopupHeight; + bottomRightY = editorLineTopLeftYRelativeToParent; + } + // Popup will be drawn below the cursor + else + { + topLeftY = editorLineTopLeftYRelativeToParent + iEditor->GetLineHeightL(); + bottomRightY = topLeftY + requiredPopupHeight; } - TRect popupRect = iBorder->Rect(); - TRect lineRect; - iEditor->GetLineRectL( lineRect ); - lineRect.Move( 0, popupRect.iTl.iY ); - TRect parentRect = Parent()->Rect(); - - TInt listBoxBorderHeight = iAacListBox->CalcHeightBasedOnNumOfItems( 0 ); - TInt listBoxItemHeight = iAacListBox->CalcHeightBasedOnNumOfItems( 1 ) - - listBoxBorderHeight; - - if ( lineRect.iTl.iY > ( parentRect.Height() >> 1 ) ) - { - // Draw popup list on top of cursor - popupRect.iTl.iY = parentRect.iTl.iY; - popupRect.iBr.iY = lineRect.iTl.iY; - - TInt diff = popupRect.Height() % listBoxItemHeight; - popupRect.iTl.iY += diff - listBoxBorderHeight; - } - else - { - // Draw popup list below cursor - popupRect.iTl.iY = lineRect.iBr.iY; - popupRect.iBr.iY = parentRect.iBr.iY; - - TInt diff = popupRect.Height() % listBoxItemHeight; - popupRect.iBr.iY -= diff - listBoxBorderHeight; - } - + popupRect.SetRect( topLeftX, topLeftY, bottomRightX, bottomRightY ); + return popupRect; } @@ -536,7 +574,8 @@ UpdateSendOptionL(); } - // Scroll editor. + // Scroll editor visible, if for example cursor is out of the + // viewable area when user enters more text. if ( iObserver && aType == EEventKey ) { CTextLayout* textLayout = iEditor->TextLayout(); @@ -546,7 +585,7 @@ textLayout->DocPosToXyPosL( iEditor->CursorPos(), cursorPos ); TInt editorTlY = iEditor->Position().iY; - TInt listHeight = iObserver->ListHeight(); + TInt listHeight = iObserver->ViewableAreaRect().Height(); TInt cursorTopY = cursorPos.iY - lineHeight + editorTlY; TInt cursorBottomY = cursorPos.iY + lineHeight + editorTlY; @@ -554,20 +593,15 @@ // If cursor is below visible area if ( cursorBottomY > listHeight ) { - iObserver->MoveListAreaUpL( cursorBottomY - listHeight ); + iObserver->RePositionFields( -( cursorBottomY - listHeight ) ); } // If cursor is over the top of visible area else if ( cursorTopY < 0 ) { - iObserver->MoveListAreaDownL( -cursorTopY ); + iObserver->RePositionFields( -cursorTopY ); } - // Latch on top of the screen - else if ( textLayout->GetLineNumber( iEditor->CursorPos() ) < 2 ) - { - iObserver->MoveListAreaDownL( iTitleSize.iHeight ); - } - } + return ret; } @@ -578,64 +612,49 @@ void CESMRAttendeeField::SetContainerWindowL( const CCoeControl& aControl ) { FUNC_LOG; - CESMRField::SetContainerWindowL ( aControl ); + CCoeControl::SetContainerWindowL( aControl ); - iEditor->ConstructL ( - this, - KMaxAddressFieldLines, - 0, - CEikEdwin::EAvkonEditor | CEikEdwin::EResizable | - CEikEdwin::ENoAutoSelection |CEikEdwin::EInclusiveSizeFixed | - CEikEdwin::ENoHorizScrolling - ); - + iFieldButton->SetContainerWindowL( aControl ); + iFieldButton->SetParent( this ); + + iTitle->SetContainerWindowL( aControl ); + iTitle->SetParent( this ); + + iEditor->SetContainerWindowL( aControl ); + iEditor->SetParent( this ); + iAacListBox = CESMRNcsPopupListBox::NewL ( this, *iContactHandler ); iAacListBox->MakeVisible ( EFalse ); + iAacListBox->SetListBoxObserver( this ); iAacListBox->SetObserver( this ); iAacListBox->ActivateL(); + iButtonGroupContainer = CEikButtonGroupContainer::Current(); - - } - -// --------------------------------------------------------------------------- -// CESMRAttendeeField::ActivateL -// --------------------------------------------------------------------------- -// -void CESMRAttendeeField::ActivateL() - { - CCoeControl::ActivateL(); - - TRect editorRect = iEditor->Rect(); - - delete iFrameBgContext; - iFrameBgContext = NULL; - iFrameBgContext = CAknsFrameBackgroundControlContext::NewL( KAknsIIDQsnFrInput, editorRect, editorRect, EFalse ) ; - - iFrameBgContext->SetParentContext( iBackground ); - iEditor->SetSkinBackgroundControlContextL( iFrameBgContext ); - } + } // --------------------------------------------------------------------------- // CESMRAttendeeField::HandleEdwinSizeEventL // --------------------------------------------------------------------------- // -TBool CESMRAttendeeField::HandleEdwinSizeEventL(CEikEdwin* /*aEdwin*/, +TBool CESMRAttendeeField::HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent /*aType*/, TSize aSize ) { FUNC_LOG; - iExpandedSize = aSize; - if ( iObserver ) + TBool reDraw( EFalse ); + + if( iSize != aSize ) { - iObserver->ControlSizeChanged ( this ); - } + // Let's save the required size for the iEditor + iSize = aSize; - if ( iFrameBgContext ) - { - TRect visibleRect = CalculateVisibleRect( iEditor->Rect() ); - iFrameBgContext->SetFrameRects( visibleRect, visibleRect ); + if ( iObserver && aEdwin == iEditor ) + { + iObserver->ControlSizeChanged ( this ); + reDraw = ETrue; + } } - - return ETrue; + + return reDraw; } // --------------------------------------------------------------------------- @@ -647,9 +666,10 @@ TBool /*iListAll*/) { FUNC_LOG; - if ( aMatchString.CompareC ( KNullDesC )== 0 ) + if ( aMatchString.CompareC( KNullDesC ) == 0 || + aMatchString.CompareC( *iDefaultText ) == 0 ) { - ClosePopupContactListL ( ); + ClosePopupContactListL(); } else if ( iAacListBox ) { @@ -662,61 +682,77 @@ } else { - iAacListBox->InitAndSearchL ( aMatchString ); + iAacListBox->InitAndSearchL( aMatchString ); } } } // --------------------------------------------------------------------------- -// CESMRHeaderContainer:ShowPopupCbaL +// CESMRAttendeeField::ShowPopupCbaL // --------------------------------------------------------------------------- // void CESMRAttendeeField::ShowPopupCbaL( TBool aShow ) { if( aShow ) - { - iButtonGroupContainer->SetCommandSetL( - R_CONTACT_POPUP_SOFTKEYS_SELECT_CANCEL); - } - else - { - iButtonGroupContainer->SetCommandSetL( - R_CONTACT_EDITOR_SOFTKEYS_OPTIONS_DONE__ADD); - } - iButtonGroupContainer->DrawDeferred(); + { + iButtonGroupContainer->SetCommandSetL( + R_CONTACT_POPUP_SOFTKEYS_SELECT_CANCEL); + } + else + { + iButtonGroupContainer->SetCommandSetL( + R_CONTACT_EDITOR_SOFTKEYS_OPTIONS_DONE__ADD); + } + + iButtonGroupContainer->DrawDeferred(); } // --------------------------------------------------------------------------- -// CESMRHeaderContainer:ExecuteGenericCommandL +// CESMRAttendeeField::ExecuteGenericCommandL // --------------------------------------------------------------------------- // -void CESMRAttendeeField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRAttendeeField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); switch ( aCommand ) { case EESMRCmdAttendeeInsertContact: { + HandleTactileFeedbackL(); iContactHandler->GetAddressesFromPhonebookL( this ); + isUsed = ETrue; + break; } - break; case EESMRCmdAttendeeSoftkeySelect: { DoPopupSelectL(); + isUsed = ETrue; + break; } - break; case EESMRCmdAttendeeSoftkeyCancel: { ClosePopupContactListL(); + isUsed = ETrue; + break; } + case EESMRCmdLongtapDetected: + { + if(iEditor->IsFocused()) + NotifyEventL(EESMRCmdLongtapDetected); + isUsed = ETrue; + + HandleTactileFeedbackL(); break; + } default: break; } + return isUsed; } // --------------------------------------------------------------------------- -// CESMRBooleanField::SetOutlineFocusL +// CESMRAttendeeField::SetOutlineFocusL // --------------------------------------------------------------------------- // void CESMRAttendeeField::SetOutlineFocusL( TBool aFocus ) @@ -724,6 +760,7 @@ FUNC_LOG; CESMRField::SetOutlineFocusL( aFocus ); + if (aFocus) //Focus is gained on the field { if ( iEditor->HasDefaultText() ) @@ -745,22 +782,24 @@ FUNC_LOG; if ( aContacts ) { - RPointerArray ncsObjects; // codescanner::resourcenotoncleanupstack - TCleanupItem arrayCleanup( RPointerArrayResetAndDestroy, &ncsObjects ); - CleanupStack::PushL( arrayCleanup ); - for ( int i = 0; i < aContacts->Count(); i++ ) + if( aContacts->Count() > 0 ) { - CESMRNcsEmailAddressObject* object = - CESMRNcsEmailAddressObject::NewL( - (*aContacts)[i]->DisplayName(), - (*aContacts)[i]->EmailAddress() ); - object->SetDisplayFull( (*aContacts)[i]->MultipleEmails() ); - ncsObjects.Append( object ); + RCPointerArray ncsObjects; // codescanner::resourcenotoncleanupstack + CleanupClosePushL( ncsObjects ); + for ( int i = 0; i < aContacts->Count(); i++ ) + { + CESMRNcsEmailAddressObject* object = + CESMRNcsEmailAddressObject::NewL( + ( *aContacts )[i]->DisplayName(), + ( *aContacts )[i]->EmailAddress() ); + object->SetDisplayFull( ( *aContacts)[i]->MultipleEmails() ); + ncsObjects.Append( object ); + } + + iEditor->AppendAddressesL( ncsObjects ); + CleanupStack::PopAndDestroy( &ncsObjects ); + UpdateSendOptionL(); } - - iEditor->AppendAddressesL(ncsObjects); - CleanupStack::PopAndDestroy( &ncsObjects ); - UpdateSendOptionL(); } } @@ -792,7 +831,7 @@ { ClosePopupContactListL(); } - else if ( iAacListBox && !iAacListBox->IsVisible() && !iAacListBox->IsPopupEmpty() ) + else if ( iAacListBox && !iAacListBox->IsPopupEmpty() ) { iAacListBox->SetPopupMaxRectL( ResolvePopupRectL() ); iAacListBox->MakeVisible ( ETrue ); @@ -803,68 +842,10 @@ UpdateSendOptionL(); } } - } - -// --------------------------------------------------------------------------- -// CESMRAttendeeField::ClearAttendeeListL -// --------------------------------------------------------------------------- -// -void CESMRAttendeeField::ClearAttendeeListL( CCalEntry& aEntry ) - { - FUNC_LOG; - RPointerArray< CCalAttendee > & att = aEntry.AttendeesL( ); - for (TInt i(0); i < att.Count( ); ) - { - // if there is an attendee with this fields role, remove it - if ( att[i]->RoleL( )== iRole ) - { - aEntry.DeleteAttendeeL( i ); - } - else - { - ++i; - } - } - } - -// --------------------------------------------------------------------------- -// CESMRAttendeeField::ParseAttendeesL -// --------------------------------------------------------------------------- -// -void CESMRAttendeeField::ParseAttendeesL( - MESMRMeetingRequestEntry& aMREntry ) - { - FUNC_LOG; - iEditor->CheckAddressWhenFocusLostL ( ); - - RPointerArray attendees = iEditor->GetAddressesL ( ); - CCalEntry& entry( aMREntry.Entry() ); - TInt count = attendees.Count ( ); - - for (TInt i=0; iEmailAddress ( ) ); - attendee->SetRoleL ( iRole ); - attendee->SetCommonNameL ( obj->DisplayName ( ) ); - - if ( EESMRRoleOrganizer == aMREntry.RoleL() || - aMREntry.IsForwardedL() ) - { - attendee->SetResponseRequested( ETrue ); - } - - entry.AddAttendeeL ( attendee ); - if (iPhoneOwnerAddr && attendee->Address().CompareF(*iPhoneOwnerAddr) == 0) - { - entry.SetPhoneOwnerL(static_cast(attendee)); - } - } - - } + } // ----------------------------------------------------------------------------- -// CESMRHeaderContainer::DoPopupSelect +// CESMRAttendeeField::DoPopupSelect // ----------------------------------------------------------------------------- // void CESMRAttendeeField::DoPopupSelectL() @@ -919,7 +900,7 @@ } // ----------------------------------------------------------------------------- -// CNcsHeaderContainer::ClosePopupContactListL() +// CESMRAttendeeField::ClosePopupContactListL() // ----------------------------------------------------------------------------- // void CESMRAttendeeField::ClosePopupContactListL() @@ -932,14 +913,14 @@ { iAacListBox->MakeVisible( EFalse ); AknsUtils::SetAvkonSkinEnabledL( ETrue ); - ShowPopupCbaL( EFalse ); } + ShowPopupCbaL( EFalse ); UpdateSendOptionL(); } // --------------------------------------------------------------------------- -// CNcsHeaderContainer::ExecuteRemoteSearchL +// CESMRAttendeeField::ExecuteRemoteSearchL // --------------------------------------------------------------------------- // CESMRNcsEmailAddressObject* CESMRAttendeeField::ExecuteRemoteSearchL( @@ -954,6 +935,12 @@ emailAddress.CreateL( KMaxRemoteSearchResponseLength ); emailAddress.CleanupClosePushL(); + // Pop-up needs to be closed before executing remote lookup with + // query dialog, because combination of this pop-up and any query dialog + // causes background drawing problems with CEikMfne editors. + // Reason unknown. + ClosePopupContactListL(); + TBool contactSelected = iContactHandler->LaunchRemoteLookupL( aSearchText, displayname, emailAddress ); @@ -973,7 +960,7 @@ CleanupStack::PopAndDestroy( &emailAddress ); CleanupStack::PopAndDestroy( &displayname ); - + return address; } @@ -987,6 +974,12 @@ // Check if editor has text and it is different from default text. HBufC *text = iEditor->GetTextInHBufL(); TBool enable = text && text->Length() > 0 && text->Compare( *iDefaultText ) != 0; + if( enable ) + { + TPtr ptr = text->Des(); + ptr.Trim(); + } + enable = text && text->Length() > 0 && text->Compare( *iDefaultText ) != 0; delete text; // Send proper command to CESMREditorDialog::ProcessCommandL @@ -1017,5 +1010,197 @@ NotifyEventL( command ); } +// --------------------------------------------------------------------------- +// CESMRAttendeeField::HandleListBoxEventL +// --------------------------------------------------------------------------- +// +void CESMRAttendeeField::HandleListBoxEventL( CEikListBox* aListBox, + TListBoxEvent aEventType ) + { + if( aEventType == EEventEnterKeyPressed || aEventType == EEventItemClicked + || aEventType == EEventItemDoubleClicked || aEventType == EEventItemSingleClicked ) + { + TInt newIndex = aListBox->CurrentItemIndex(); + + // if item is already highlighted and then clicked, + // it is considered that it has been selected + if( newIndex == iPreviousIndex ) + { + HandleTactileFeedbackL(); + DoPopupSelectL(); + + // Item selected, index reseted + iPreviousIndex = 0; + } + else + { + iPreviousIndex = newIndex; + } + } + } + +// ----------------------------------------------------------------------------- +// CESMRAttendeeField::GetCursorLineVerticalPos +// ----------------------------------------------------------------------------- +// +void CESMRAttendeeField::GetCursorLineVerticalPos( + TInt& aUpper, TInt& aLower) + { + FUNC_LOG; + TRect rect; + + TRAPD( err, iEditor->GetLineRectL( rect ) ); + + if ( err == KErrNone ) + { + rect.Move( 0, iFieldButton->Rect().Size().iHeight ); + aUpper = rect.iTl.iY; + aLower = rect.iBr.iY; + } + else + { + // This isn't expected to happen in any situation. + // but if it does at least there will be no zero size + CESMRField::GetCursorLineVerticalPos( aUpper, aLower ); + } + } + +// --------------------------------------------------------------------------- +// CESMRAttendeeField::HandleSingletapEventL +// --------------------------------------------------------------------------- +// +TBool CESMRAttendeeField::HandleSingletapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + TBool ret( EFalse ); + + if( iTitle->Rect().Contains( aPosition ) || + iFieldButton->Rect().Contains( aPosition ) ) + { + iContactHandler->GetAddressesFromPhonebookL( this ); + ret = ETrue; + + HandleTactileFeedbackL(); + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CESMRAttendeeField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CESMRAttendeeField::HandleLongtapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + + if( iTitle->Rect().Contains( aPosition ) || + iFieldButton->Rect().Contains( aPosition ) ) + { + NotifyEventL( EAknSoftkeyContextOptions ); + HandleTactileFeedbackL(); + } + } + +// --------------------------------------------------------------------------- +// CESMRAttendeeField::UpdateAttendeesL +// --------------------------------------------------------------------------- +// +void CESMRAttendeeField::UpdateAttendeesL( MESMRMeetingRequestEntry& aMREntry ) + { + FUNC_LOG; + /* + * Compare editor attendees to existing attendees and add / remove + * when necessary. + */ + iEditor->CheckAddressWhenFocusLostL(); + + CCalEntry& entry( aMREntry.Entry() ); + + // Get editor's attendees + RPointerArray editorAttendees = + iEditor->GetAddressesL(); + TInt editorAttendeesCount( editorAttendees.Count() ); + + // Get existing attendees + RPointerArray& existingAttendees = entry.AttendeesL(); + TInt existingAttendeesCount( existingAttendees.Count() ); + + // Remove removed attendees from entry + for( TInt i( existingAttendeesCount - 1 ); i >= 0 ; --i ) + { + // existing address and role + const TDesC& address = existingAttendees[i]->Address(); + CCalAttendee::TCalRole role = existingAttendees[i]->RoleL(); + + // Let's try to find them amongst editor attendees + TBool matchFound( EFalse ); + for( TInt j( 0 ); j < editorAttendeesCount ; ++j ) + { + // if address match is found ... + if( editorAttendees[j]->EmailAddress().Compare( address ) == 0 ) + { + // ... And roles match also + if( role == iRole ) + { + // This attendee is left to the entry + matchFound = ETrue; + break; + } + } + } + if( !matchFound ) + { + // Existing attendee not found from editor -> Let's delete that + // from entry if roles match + if ( existingAttendees[i]->RoleL( )== iRole ) + { + entry.DeleteAttendeeL( i ); + } + } + } + + // Update existing attendees count, because some attendees might + // have been removed + existingAttendees.Reset(); + existingAttendees = entry.AttendeesL(); + existingAttendeesCount = existingAttendees.Count(); + + // Add new attendees to entry + for( TInt i( 0 ); i < editorAttendeesCount ; ++i ) + { + CESMRNcsEmailAddressObject* obj = editorAttendees[i]; + CCalAttendee* attendee = CCalAttendee::NewL( obj->EmailAddress() ); + attendee->SetRoleL( iRole ); + attendee->SetCommonNameL( obj->DisplayName() ); + + if ( EESMRRoleOrganizer == aMREntry.RoleL() || + aMREntry.IsForwardedL() ) + { + attendee->SetResponseRequested( ETrue ); + } + + TBool isNewAttendee( ETrue ); + for( TInt i( 0 ); i < existingAttendeesCount; ++i ) + { + if( existingAttendees[i]->Address().Compare( attendee->Address() ) == 0 ) + { + if( existingAttendees[i]->RoleL() == iRole ) + { + // Match found, this is not a new attendee + isNewAttendee = EFalse; + break; + } + } + } + // If this is new attendee, let's add it to entry + if( isNewAttendee ) + { + entry.AddAttendeeL( attendee ); + } + } + } + + //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclsitem.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclsitem.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclsitem.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,7 +20,7 @@ #include "cesmrclsitem.h"// CESMRClsItem #include "esmrfieldbuilderdef.h" -#include +#include // ======== MEMBER FUNCTIONS ======== diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,20 +20,20 @@ #include // CEikonEnv #include // CRepository -#include // KCRUidAknFep -#include // CPbkContactEngine -#include // CPbkContactItem, TPbkContactItemField +#include // KCRUidAknFep +#include // CPbkContactEngine +#include // CPbkContactItem, TPbkContactItemField #include // CAknErrorNote // -#include "cfsmailbox.h" // cfsmailbox +#include "CFSMailBox.h" // cfsmailbox // -#include -#include -#include -#include +#include +#include +#include +#include #include // TLanguage -#include +#include #include "mesmrclslistsobserver.h" #include "cesmrclsmatchobserver.h" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclsmatchobserver.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclsmatchobserver.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclsmatchobserver.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,17 +22,17 @@ #include "esmrfieldbuilderdef.h" // for PCS support -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include // CRepository -#include // KCRUidAknFep, KAknFepPredTxtFlag -#include +#include // KCRUidAknFep, KAknFepPredTxtFlag +#include //Constants diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -14,24 +14,22 @@ * Description: ESMR Conflict popup implementation * */ +#include "cesmrconflictpopup.h" +#include "mesmrcalentry.h" +#include "mesmrmeetingrequestentry.h" + +#include +#include +#include +#include +#include #include "emailtrace.h" -#include "cesmrconflictpopup.h" - -#include -#include -#include - -#include "cesmrlayoutmgr.h" -#include "mesmrcalentry.h" -#include "mesmrmeetingrequestentry.h" -#include -#include // Unnamed namespace for local definitions namespace{ -const TInt KTimeDelayBeforeShow(2000); // 2 Seconds +const TInt KTimeDelayBeforeShow(0); // 0 Seconds const TInt KTimeForView(5000); // 5 Seconds const TInt KZero(0); const TInt KTimeStringLength(20); @@ -44,6 +42,15 @@ _LIT (KSpace , " " ); const TInt KFullTimeStringSize(256); +void CalEntryPointerArrayCleanup( TAny* aArray ) + { + RPointerArray* entryArray = + static_cast*>( aArray ); + + entryArray->ResetAndDestroy(); + entryArray->Close(); + } + }//namespace // ======== MEMBER FUNCTIONS ======== @@ -112,7 +119,11 @@ { FUNC_LOG; RPointerArray entryArray; - CleanupClosePushL( entryArray ); + CleanupStack::PushL( + TCleanupItem( + CalEntryPointerArrayCleanup, + &entryArray ) ); + TInt ret = iEntry->FetchConflictingEntriesL( entryArray ); if( ret == KErrNotFound ) { @@ -131,6 +142,16 @@ // get the first conflicting entry and set the string for display meetingTitle = entryArray[KZero]->SummaryL(); meetingLocation = entryArray[KZero]->LocationL(); + + + if ( ( meetingLocation.Length()== 0 ) && ( meetingTitle.Length() == 0 ) ) + { + // if no title, set unnamed text: + HBufC* title = StringLoader::LoadLC ( R_QTN_MEET_REQ_CONFLICT_UNNAMED ); + meetingTitle.Copy( *title ); + CleanupStack::PopAndDestroy( title ); + } + dispStrLength = meetingTitle.Length() + meetingLocation.Length(); startTime = entryArray[KZero]->StartTimeL().TimeLocalL(); endTime = entryArray[KZero]->EndTimeL().TimeLocalL(); @@ -209,8 +230,10 @@ CEikonEnv::Static()-> // codescanner::eikonenvstatic HandleError(error); } - iNote->SetPositionAndAlignment( CESMRLayoutManager::ConflictPopupPosition(), - EHLeftVCenter ); + + // TODO: use XML layout data. Use this one popup_preview_text_window + /*iNote->SetPositionAndAlignment( CESMRLayoutManager::ConflictPopupPosition(), + EHLeftVCenter );*/ iNote->ShowInfoPopupNote(); } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrinputmodeobserver.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrinputmodeobserver.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrinputmodeobserver.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,10 +21,10 @@ #include "cesmrclslistshandler.h" #include // TUid -#include // KCRUidAknFep, KAknFepPredTxtFlag +#include // KCRUidAknFep, KAknFepPredTxtFlag #include // CRepository -#include // PCS TKeyboardModes enum +#include // PCS TKeyboardModes enum #include // Unnamed namespace for local definitions diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncsaifeditor.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncsaifeditor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncsaifeditor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,17 +18,14 @@ #include "emailtrace.h" #include "cesmrncsaifeditor.h" -#include +#include #include #include #include -#include -#include +#include +#include #include - -#ifndef FF_CMAIL_INTEGRATION #include -#endif // FF_CMAIL_INTEGRATION #include "cesmrncsemailaddressobject.h" #include "cesmrcontacthandler.h" @@ -276,6 +273,10 @@ { HandleContactDeletionL(); HandleTextUpdateL(); + if ( IsVisible() ) + { + DrawDeferred(); + } } else if ( aEventType == MEikEdwinObserver::EEventNavigation ) { @@ -356,6 +357,7 @@ iAddressPopupList->ClosePopupContactListL(); } + DrawDeferred(); return response; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncseditor.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncseditor.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncseditor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,19 +17,19 @@ #include "emailtrace.h" #include "cesmrncseditor.h" +#include "nmrcolormanager.h" #include #include // CAknEnv #include -#include // AknLayoutUtils +#include // AknLayoutUtils #include -#include -#include -#include -#include +#include +#include +#include +#include -#include "cesmrlayoutmgr.h" // ======== MEMBER FUNCTIONS ======== @@ -53,7 +53,6 @@ CESMRNcsEditor::~CESMRNcsEditor() { FUNC_LOG; - delete iBgContext; } // ----------------------------------------------------------------------------- @@ -133,17 +132,35 @@ } // ----------------------------------------------------------------------------- -// CESMRNcsEditor::SetRect +// CESMRNcsEditor::FocusChanged +// ----------------------------------------------------------------------------- +// +void CESMRNcsEditor::FocusChanged( TDrawNow aDrawNow ) + { + CEikRichTextEditor::FocusChanged( aDrawNow ); + } + +// ----------------------------------------------------------------------------- +// CESMRNcsEditor::HandlePointerEventL // ----------------------------------------------------------------------------- // -void CESMRNcsEditor::SetRect( const TRect& aRect ) +void CESMRNcsEditor::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { - FUNC_LOG; - CCoeControl::SetRect( aRect ); - - if ( iBgContext ) + if ( Rect().Contains( aPointerEvent.iPosition ) ) { - iBgContext->SetRect( aRect ); + switch ( aPointerEvent.iType ) + { + case TPointerEvent::EButton1Down: + case TPointerEvent::EButton1Up: + { + CEikRichTextEditor::HandlePointerEventL( aPointerEvent ); + break; + } + default: + { + break; + } + } } } @@ -204,6 +221,10 @@ return lineCount; } +// ----------------------------------------------------------------------------- +// CESMRNcsEditor::ScrollableLines() const +// ----------------------------------------------------------------------------- +// TInt CESMRNcsEditor::ScrollableLines() const { FUNC_LOG; @@ -216,7 +237,7 @@ } // ----------------------------------------------------------------------------- -// CESMRNcsEditor::PositionChanged() const +// CESMRNcsEditor::PositionChanged() // ----------------------------------------------------------------------------- // void CESMRNcsEditor::PositionChanged() @@ -306,8 +327,7 @@ TRAPD( error, text = GetTextInHBufL()); if (error!= KErrNone) { - CEikonEnv::Static()-> // codescanner::eikonenvstatic - HandleError(error); + iCoeEnv->HandleError(error); } // if we are adding or removing multiple characters check @@ -427,7 +447,7 @@ // CESMRNcsEditor::SetFontL // ----------------------------------------------------------------------------- // -void CESMRNcsEditor::SetFontL( const CFont* aFont, CESMRLayoutManager* aLayout ) +void CESMRNcsEditor::SetFontL( const CFont* aFont ) { FUNC_LOG; const CFont* font = aFont; @@ -449,9 +469,14 @@ formatMask.SetAttrib( EAttFontHeight ); formatMask.SetAttrib( EAttFontPosture ); formatMask.SetAttrib( EAttFontStrokeWeight ); + formatMask.SetAttrib(EAttFontHighlightColor); + formatMask.SetAttrib( EAttColor ); - charFormat.iFontPresentation.iTextColor = aLayout->NormalTextColor(); - formatMask.SetAttrib( EAttColor ); + charFormat.iFontPresentation.iTextColor = + NMRColorManager::Color( NMRColorManager::EMRMainAreaTextColor ); + + charFormat.iFontPresentation.iHighlightColor = + NMRColorManager::Color( NMRColorManager::EMRCutCopyPasteHighlightColor ); CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL( paraFormat, paraFormatMask ); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncsemailaddressobject.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncsemailaddressobject.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncsemailaddressobject.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncspopuplistbox.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncspopuplistbox.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncspopuplistbox.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,29 +15,28 @@ * */ -#include "emailtrace.h" #include "cesmrncspopuplistbox.h" +#include "cesmrncsemailaddressobject.h" +#include "cesmrcontacthandler.h" +#include "nmrbitmapmanager.h" +#include "nmrcolormanager.h" #include -#include -#include // StringLoader +#include +#include // StringLoader #include - //text truncation -#include //line wrapping and mirroring +#include //line wrapping and mirroring #include //xml layout data for applications #include //xml layout data of avkon components - #include - -#include "cesmrncsemailaddressobject.h" -#include "cesmrcontacthandler.h" -#include "cesmrlayoutmgr.h" +#include +// DEBUG +#include "emailtrace.h" namespace { // codescanner::namespace const TInt KItemExtraHeight = 8; const TInt KEdge (8); -const TInt KScrollbarWidth (6); const TInt KListBoxDrawMargin (4); //drop down list colors since we have no official LAF #define KWhite TRgb( 255,255,255 ) @@ -110,7 +109,6 @@ RCPointerArray matchingArray; // Empty array CleanupClosePushL( matchingArray ); SetSearchTextL( aText ); - OperationCompleteL( ESearchContacts, &matchingArray ); CleanupStack::PopAndDestroy( &matchingArray ); } @@ -174,7 +172,6 @@ TKeyResponse ret( EKeyWasNotConsumed ); if( aKeyEvent.iCode == EKeyDownArrow ) { - MoveRemoteLookupItemL( ERemoteLookupItemDown ); iView->MoveCursorL( CListBoxView::ECursorNextItem, CListBoxView::ENoSelection ); ret = EKeyWasConsumed; } @@ -184,17 +181,13 @@ // Move cursor separator line over if( CurrentItemIndex() - 1 > 0 && CurrentItemIndex() - 1 == iRMLUItemPosition ) { - MoveRemoteLookupItemL( ERemoteLookupItemUp ); iView->MoveCursorL( CListBoxView::ECursorPreviousItem, CListBoxView::ENoSelection ); stay = ETrue; } - MoveRemoteLookupItemL( ERemoteLookupItemUp ); iView->MoveCursorL( CListBoxView::ECursorPreviousItem, CListBoxView::ENoSelection ); if( stay ) { - MoveRemoteLookupItemL( ERemoteLookupItemDown ); - iView->MoveCursorL( CListBoxView::ECursorNextItem, CListBoxView::ENoSelection ); } @@ -281,14 +274,7 @@ if( iMatchingArray.Count() > 0 ) { CESMRClsItem* clsItem = NULL; - if( iRemoteLookupSupported ) - { - clsItem =iMatchingArray[CurrentItemIndex()-1]; // -1 because of iRMLUItemPosition - } - else - { - clsItem =iMatchingArray[CurrentItemIndex()]; // no iRMLUItemPosition - } + clsItem =iMatchingArray[CurrentItemIndex()]; addressObject= CESMRNcsEmailAddressObject::NewL( clsItem->DisplayName(), clsItem->EmailAddress() ); CleanupStack::PushL( addressObject ); if ( clsItem->MultipleEmails() ) @@ -378,7 +364,7 @@ } // Update rmlu item - SetRemoteLookupItemFirstToTheListL(); + SetRemoteLookupItemLastToTheListL(); HandleItemAdditionL(); @@ -433,61 +419,26 @@ } // ----------------------------------------------------------------------------- -// CESMRNcsPopupListBox::SetRemoteLookupItemFirstToTheListL +// CESMRNcsPopupListBox::SetRemoteLookupItemLastToTheListL // ----------------------------------------------------------------------------- // -void CESMRNcsPopupListBox::SetRemoteLookupItemFirstToTheListL() +void CESMRNcsPopupListBox::SetRemoteLookupItemLastToTheListL() { FUNC_LOG; + if( iRemoteLookupSupported ) { - HBufC* rmluText = StringLoader::LoadLC( R_MEET_REQ_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, *iCurrentSearchText ); + HBufC* rmluText = StringLoader::LoadLC( + R_MEET_REQ_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, + *iCurrentSearchText ); - iItemTextsArray->InsertL( 0, *rmluText ); + iItemTextsArray->AppendL( *rmluText ); CleanupStack::PopAndDestroy( rmluText ); - iRMLUItemPosition = 0; + iRMLUItemPosition = iItemTextsArray->Count() - 1; } else { - iRMLUItemPosition = -1; - } - } - -// ----------------------------------------------------------------------------- -// CESMRNcsPopupListBox::MoveRemoteLookupItemL -// ----------------------------------------------------------------------------- -// -void CESMRNcsPopupListBox::MoveRemoteLookupItemL( TRemoteLookupItemMoveDirection aDirection ) - { - FUNC_LOG; - if( iRemoteLookupSupported ) - { - TInt newRMLUItemIndex = -1; - TInt newCurrentItem = -1; - if( aDirection == ERemoteLookupItemUp && - iView->CurrentItemIndex() == iView->TopItemIndex() ) - { - newRMLUItemIndex = iRMLUItemPosition - 1; - newCurrentItem = CurrentItemIndex() - 1; - } - else if( aDirection == ERemoteLookupItemDown && - iView->CurrentItemIndex() == iView->BottomItemIndex() ) - { - newRMLUItemIndex = iRMLUItemPosition + 1; - newCurrentItem = CurrentItemIndex() + 1; - } - - - if( ItemExists ( newCurrentItem ) ) - { - iItemTextsArray->Delete( iRMLUItemPosition ); - - HBufC* rmluText = StringLoader::LoadLC( R_MEET_REQ_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, *iCurrentSearchText ); - - iItemTextsArray->InsertL( newRMLUItemIndex, *rmluText ); - CleanupStack::PopAndDestroy( rmluText ); - iRMLUItemPosition = newRMLUItemIndex; - } + iRMLUItemPosition = KErrNotFound; } } @@ -516,16 +467,6 @@ } // ----------------------------------------------------------------------------- -// CESMRNcsPopupListBox::InitialiseL -// ----------------------------------------------------------------------------- -// -void CESMRNcsPopupListBox::Initialise(CESMRLayoutManager* aLayout) - { - FUNC_LOG; - static_cast( iItemDrawer )->SetLayoutManager(aLayout); - } - -// ----------------------------------------------------------------------------- // CESMRNcsListItemDrawer::CESMRNcsListItemDrawer // ----------------------------------------------------------------------------- // @@ -558,291 +499,314 @@ } // ----------------------------------------------------------------------------- -// CESMRNcsListItemDrawer::SetLayoutManager -// ----------------------------------------------------------------------------- -// -void CESMRNcsListItemDrawer::SetLayoutManager(CESMRLayoutManager* aLayout) - { - FUNC_LOG; - iLayout = aLayout; - } - -// ----------------------------------------------------------------------------- // CESMRNcsListItemDrawer::DoDrawActualItemL // ----------------------------------------------------------------------------- // void CESMRNcsListItemDrawer::DoDrawActualItemL( TInt aItemIndex, - const TRect& aActualItemRect, TBool aItemIsCurrent, - TBool /*aViewIsEmphasized*/, TBool /*aViewIsDimmed*/, - TBool /*aItemIsSelected*/ ) const - { + const TRect& aActualItemRect, TBool aItemIsCurrent, + TBool /*aViewIsEmphasized*/, TBool /*aViewIsDimmed*/, + TBool /*aItemIsSelected*/ ) const + { FUNC_LOG; - // Get reference to curren popup cls item list. - const RPointerArray& clsItemArray = iListBox.CurrentPopupClsItemsArray(); - TInt rmluPosition = iListBox.RMLUItemPosition(); + DrawPopUpBackGroundL( aActualItemRect ); + + // Draw the selector if current item is the focused one + if( aItemIsCurrent ) + { + DrawPopUpSelectorL( aActualItemRect ); + } - // Sets all the attributes, like font, text color and background color. - const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); - iGc->UseFont(font); + DrawPopUpTextL( aItemIndex, aActualItemRect ); + } - // We have to draw the item in layered fashion in order to do the skin - // First clear the backround by drawing a solid rect. +// ----------------------------------------------------------------------------- +// CESMRNcsListItemDrawer::DrawPopUpBackGroundL +// ----------------------------------------------------------------------------- +// +void CESMRNcsListItemDrawer::DrawPopUpBackGroundL( + const TRect& aActualItemRect ) const + { iGc->SetPenColor( KGrayBackground ); iGc->SetBrushColor( KGrayBackground ); - iGc->SetPenStyle(CGraphicsContext::ESolidPen); - iGc->SetBrushStyle(CGraphicsContext::ESolidBrush); + + iGc->SetPenStyle( CGraphicsContext::ESolidPen ); + iGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); - // Now draw the highlight - if( aItemIsCurrent ) - { - if (iLayout) - { - CFbsBitmap* selector = NULL; - CFbsBitmap* selectorMask = NULL; + iGc->DrawRect( aActualItemRect ); + } + +// ----------------------------------------------------------------------------- +// CESMRNcsListItemDrawer::DrawPopUpSelectorL +// ----------------------------------------------------------------------------- +// +void CESMRNcsListItemDrawer::DrawPopUpSelectorL( + const TRect& aActualItemRect ) const + { + CFbsBitmap* selector = NULL; + CFbsBitmap* selectorMask = NULL; - // highlight bitmap target rect: - TRect rect( aActualItemRect ); + // Highlight bitmap target rect: + TRect rect( aActualItemRect ); - TSize corner(KEdge, KEdge); - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListCornerTl, selector, selectorMask, corner ); - - //adjust selector size for if scrollbar is on screen - if (iListBox.ScrollBarFrame()->ScrollBarVisibility(CEikScrollBar::EVertical) == - CEikScrollBarFrame::EOn) - { - rect.SetWidth( (rect.Width() - KScrollbarWidth) ); - } - - if( selector && selectorMask) - { - //corner TL - iGc->BitBltMasked( - rect.iTl, selector, corner, selectorMask, EFalse ); + TSize corner( KEdge, KEdge ); + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListTopLeft, + selector, selectorMask, corner ); + + // Adjust selector size if scrollbar is present + if ( iListBox.ScrollBarFrame()-> + ScrollBarVisibility( CEikScrollBar::EVertical ) == + CEikScrollBarFrame::EOn ) + { + TInt scrollBarWidth = + iListBox.ScrollBarFrame()->VerticalScrollBar()->Rect().Width(); + rect.SetWidth( ( rect.Width() - scrollBarWidth ) ); + } + + if( selector && selectorMask ) + { + //corner TL + iGc->BitBltMasked( + rect.iTl, selector, corner, selectorMask, EFalse ); - //side L - TSize side(KEdge, (rect.Height() - 2 * KEdge) ); - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListSideL, selector, selectorMask, side ); - iGc->BitBltMasked( TPoint(rect.iTl.iX, rect.iTl.iY + KEdge), - selector, side, selectorMask, EFalse ); - - //corner BL - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListCornerBl, selector, selectorMask, corner ); - iGc->BitBltMasked( - TPoint(rect.iTl.iX, rect.iTl.iY + KEdge + side.iHeight), - selector, corner, selectorMask, EFalse ); - - //top - TSize top( (rect.Width() - 2 * KEdge) , KEdge); - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListSideT, selector, selectorMask, top ); - iGc->BitBltMasked( TPoint(rect.iTl.iX + KEdge, rect.iTl.iY), - selector, top, selectorMask, EFalse ); + //side L + TSize side( KEdge, ( rect.Height() - 2 * KEdge ) ); + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListLeft, + selector, selectorMask, side ); + iGc->BitBltMasked( TPoint(rect.iTl.iX, rect.iTl.iY + KEdge ), + selector, side, selectorMask, EFalse ); - //center - TSize center( top.iWidth, side.iHeight); - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListCenter, selector, selectorMask, center ); - iGc->BitBltMasked( - TPoint(rect.iTl.iX + KEdge, rect.iTl.iY + KEdge), - selector, center, selectorMask, EFalse ); + //corner BL + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListBottomLeft, + selector, selectorMask, corner ); + iGc->BitBltMasked( + TPoint(rect.iTl.iX, rect.iTl.iY + KEdge + side.iHeight ), + selector, corner, selectorMask, EFalse ); - //bottom - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListSideB, selector, selectorMask, top ); - iGc->BitBltMasked( - TPoint(rect.iTl.iX + KEdge, rect.iTl.iY + side.iHeight + KEdge), - selector, top, selectorMask, EFalse ); + //top + TSize top( ( rect.Width() - 2 * KEdge ) , KEdge ); + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListTop, + selector, selectorMask, top ); + iGc->BitBltMasked( TPoint( rect.iTl.iX + KEdge, rect.iTl.iY ), + selector, top, selectorMask, EFalse ); - //corner TR - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListCornerTr, selector, selectorMask, corner ); - iGc->BitBltMasked( - TPoint(rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY), - selector, corner, selectorMask, EFalse ); - - //side R - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListSideR, selector, selectorMask, side ); - iGc->BitBltMasked( - TPoint(rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY + KEdge), - selector, side, selectorMask, EFalse ); + //center + TSize center( top.iWidth, side.iHeight ); + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListCenter, + selector, selectorMask, center ); + iGc->BitBltMasked( + TPoint( rect.iTl.iX + KEdge, rect.iTl.iY + KEdge ), + selector, center, selectorMask, EFalse ); - //corner Br - iLayout->GetSkinBasedBitmap( - KAknsIIDQgnFsListCornerBr, selector, selectorMask, corner ); - iGc->BitBltMasked( - TPoint(rect.iTl.iX + KEdge + top.iWidth, - rect.iTl.iY + KEdge + side.iHeight), - selector, corner, selectorMask, EFalse ); - } - else - { - iGc->SetBrushColor( KSelectorFallbackColor ); - } - - delete selector; - delete selectorMask; - } - else - { - iGc->SetBrushColor( KSelectorFallbackColor ); - } - } - else - { - iGc->DrawRect(aActualItemRect); - } - - if(aItemIsCurrent) - { - iGc->SetPenColor( KWhite ); + //bottom + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListBottom, + selector, selectorMask, top ); + iGc->BitBltMasked( + TPoint( rect.iTl.iX + KEdge, rect.iTl.iY + side.iHeight + KEdge ), + selector, top, selectorMask, EFalse ); + + //corner TR + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListTopRight, + selector, selectorMask, corner ); + iGc->BitBltMasked( + TPoint( rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY ), + selector, corner, selectorMask, EFalse ); + + //side R + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListRight, + selector, selectorMask, side ); + + iGc->BitBltMasked( + TPoint( rect.iTl.iX + KEdge + top.iWidth, rect.iTl.iY + KEdge ), + selector, side, selectorMask, EFalse ); + + //corner Br + NMRBitmapManager::GetSkinBasedBitmap( + NMRBitmapManager::EMRBitmapListBottomRight, + selector, selectorMask, corner ); + iGc->BitBltMasked( + TPoint( rect.iTl.iX + KEdge + top.iWidth, + rect.iTl.iY + KEdge + side.iHeight ), + selector, corner, selectorMask, EFalse ); } else { - iGc->SetPenColor( KGraySelectable ); - } + iGc->SetBrushColor( KSelectorFallbackColor ); + } + delete selector; + delete selectorMask; + } - iGc->SetPenStyle(CGraphicsContext::ESolidPen); - iGc->SetBrushStyle(CGraphicsContext::ENullBrush); - TInt topToBaseline = ( aActualItemRect.Height() - font->HeightInPixels() ) / 2 - + font->AscentInPixels(); - - TPtrC itemText = iListBox.Model()->ItemText( aItemIndex ); +// ----------------------------------------------------------------------------- +// CESMRNcsListItemDrawer::DrawPopUpTextL +// ----------------------------------------------------------------------------- +// +void CESMRNcsListItemDrawer::DrawPopUpTextL( + TInt aItemIndex, + const TRect& aActualItemRect ) const + { + // Get reference to curren popup cls item list. + const RPointerArray& clsItemArray = + iListBox.CurrentPopupClsItemsArray(); + TInt rmluPosition = iListBox.RMLUItemPosition(); - // Construct bidirectional text object - TBidiText* bidiText = TBidiText::NewL( itemText, 1 ); - CleanupStack::PushL( bidiText ); - bidiText->WrapText( aActualItemRect.Width(), *font, NULL ); - TPoint leftBase = aActualItemRect.iTl + TPoint( 0, topToBaseline ); - leftBase.iX += KListBoxDrawMargin; - - // check if we are drawing remote lookup item or contact match - if ( rmluPosition == aItemIndex ) - { - iGc->SetUnderlineStyle( EUnderlineOff ); - bidiText->DrawText( *iGc, leftBase ); - } - else - { - // if list has rmlu item change item index right - if ( rmluPosition >= 0 ) - { - --aItemIndex; - aItemIndex = Max( 0, aItemIndex ); - } + iGc->SetPenColor( NMRColorManager::Color( + NMRColorManager::EMRMainAreaTextColor ) ); + + // Sets all the attributes, like font, text color and background color. + const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); + iGc->UseFont( font ); + + iGc->SetPenStyle(CGraphicsContext::ESolidPen); + iGc->SetBrushStyle(CGraphicsContext::ENullBrush); + TInt topToBaseline = ( aActualItemRect.Height() - font->HeightInPixels() ) / 2 + + font->AscentInPixels(); + + TPtrC itemText( iListBox.Model()->ItemText( aItemIndex ) ); - // change color to gray if match doesn't have email address. - if ( clsItemArray[aItemIndex]->EmailAddress().Compare( KNullDesC ) == 0 ) - { + // Construct bidirectional text object + TBidiText* bidiText = TBidiText::NewL( itemText, 1 ); + CleanupStack::PushL( bidiText ); + bidiText->WrapText( aActualItemRect.Width(), *font, NULL ); + TPoint leftBase = aActualItemRect.iTl + TPoint( 0, topToBaseline ); + leftBase.iX += KListBoxDrawMargin; + + // check if we are drawing remote lookup item or contact match + if ( rmluPosition == aItemIndex ) + { + iGc->SetUnderlineStyle( EUnderlineOff ); + bidiText->DrawText( *iGc, leftBase ); + } + else + { + // if list has rmlu item change item index right +// if ( rmluPosition >= 0 ) +// { +// --aItemIndex; +// aItemIndex = Max( 0, aItemIndex ); +// } + + TPtrC email = clsItemArray[aItemIndex]->EmailAddress().Ptr(); + // change color to gray if match doesn't have email address. + if ( clsItemArray[aItemIndex]->EmailAddress().Compare( KNullDesC ) == 0 ) + { iGc->SetPenColor( KGrayNoEmail ); iGc->SetBrushColor( KGrayNoEmail ); - } - - // We know the text contains RTL script if the display string is not just - // truncated version of the original string. - TPtrC dispText = bidiText->DisplayText(); - TInt compLength = dispText.Length() - 1; // -1 to omit the truncation character - TBool textContainsRtl = + } + + // TO-DO: For now, we support underlining the matching part only if the + // text is written completely with left-to-right script + + // We know the text contains RTL script if the display string is not just + // truncated version of the original string. + TPtrC dispText = bidiText->DisplayText(); + TInt compLength = dispText.Length() - 1; // -1 to omit the truncation character + TBool textContainsRtl = ( itemText.Left(compLength) != dispText.Left(compLength) ); - + const RArray& underlines = clsItemArray[aItemIndex]->Highlights(); - if ( underlines.Count() > 0 && !textContainsRtl ) - { - TInt i = 0; - TBool partsLeft = ETrue; - TInt currentTextStart = 0; - TInt currentTextLength = 0; + if ( underlines.Count() > 0 && !textContainsRtl ) + { + TInt i = 0; + TBool partsLeft = ETrue; + TInt currentTextStart = 0; + TInt currentTextLength = 0; - while ( partsLeft ) - { - if ( currentTextStart < underlines[i].index ) - { - // draw letters to the start of the underlined part - currentTextLength = underlines[i].index - currentTextStart; - DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, - EFalse, topToBaseline ); - } - else if ( currentTextStart == underlines[i].index ) - { - // draw underlined letters - currentTextLength = underlines[i].length; - - DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, - ETrue, topToBaseline ); - i++; - } - else - { - // This is here, because PCS Engine might give you duplicate match entries, - // in this case we're not advancing text but we'll skip that match - currentTextLength = 0; - i++; - } - // update text start point - currentTextStart += currentTextLength; - - if ( i >= underlines.Count() ) - { - partsLeft = EFalse; - // draw rest of the letters, if there are any after the last underlined part - if ( currentTextStart < itemText.Length() ) - { - currentTextLength = itemText.Length() - currentTextStart; - DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, - EFalse, topToBaseline ); - } - } - } - } - else - { - iGc->SetUnderlineStyle( EUnderlineOff ); - bidiText->DrawText( *iGc, leftBase ); - } - } - CleanupStack::PopAndDestroy( bidiText ); + while ( partsLeft ) + { + if ( currentTextStart < underlines[i].index ) + { + // draw letters to the start of the underlined part + currentTextLength = underlines[i].index - currentTextStart; + DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, + EFalse, topToBaseline ); + } + else if ( currentTextStart == underlines[i].index ) + { + // draw underlined letters + currentTextLength = underlines[i].length; + + DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, + ETrue, topToBaseline ); + i++; + } + else + { + // This is here, because PCS Engine might give you duplicate match entries, + // in this case we're not advancing text but we'll skip that match + currentTextLength = 0; + i++; + } + // update text start point + currentTextStart += currentTextLength; + + if ( i >= underlines.Count() ) + { + partsLeft = EFalse; + // draw rest of the letters, if there are any after the last underlined part + if ( currentTextStart < itemText.Length() ) + { + currentTextLength = itemText.Length() - currentTextStart; + DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, + EFalse, topToBaseline ); + } + } + } + } + else + { + iGc->SetUnderlineStyle( EUnderlineOff ); + bidiText->DrawText( *iGc, leftBase ); + } + } + CleanupStack::PopAndDestroy( bidiText ); } // ----------------------------------------------------------------------------- // CESMRNcsListItemDrawer::DrawPartOfItem // ----------------------------------------------------------------------------- void CESMRNcsListItemDrawer::DrawPartOfItem( const TRect& aItemRect, const CFont& aFont, - TInt aStartPos, TInt aLength, const TDesC& aDes, - TBool aUnderlined, TInt aBaselineOffsetFromTop ) const - { + TInt aStartPos, TInt aLength, const TDesC& aDes, + TBool aUnderlined, TInt aBaselineOffsetFromTop ) const + { FUNC_LOG; - if( aUnderlined ) - { - iGc->SetUnderlineStyle( EUnderlineOn ); - } - else - { - iGc->SetUnderlineStyle( EUnderlineOff ); - } - TRect currentTextRect( aItemRect ); - TInt pixels = aFont.TextWidthInPixels( aDes.Left( aStartPos ) ); - currentTextRect.iTl.iX = currentTextRect.iTl.iX + pixels + KListBoxDrawMargin; - - //adjust selector size for if scrollbar is on screen - if (iListBox.ScrollBarFrame()->ScrollBarVisibility(CEikScrollBar::EVertical) == - CEikScrollBarFrame::EOn) + if( aUnderlined ) + { + iGc->SetUnderlineStyle( EUnderlineOn ); + } + else { - currentTextRect.iBr.iX = currentTextRect.iBr.iX - KListBoxDrawMargin - KScrollbarWidth; + iGc->SetUnderlineStyle( EUnderlineOff ); + } + TRect currentTextRect( aItemRect ); + TInt pixels = aFont.TextWidthInPixels( aDes.Left( aStartPos ) ); + currentTextRect.iTl.iX = currentTextRect.iTl.iX + pixels + KListBoxDrawMargin; + + // adjust selector size for if scrollbar is on screen + if ( iListBox.ScrollBarFrame()-> + ScrollBarVisibility( CEikScrollBar::EVertical ) == + CEikScrollBarFrame::EOn ) + { + TInt scrollBarWidth = + iListBox.ScrollBarFrame()->VerticalScrollBar()->Rect().Width(); + currentTextRect.iBr.iX = + currentTextRect.iBr.iX - KListBoxDrawMargin - scrollBarWidth; } else { currentTextRect.iBr.iX = currentTextRect.iBr.iX - KListBoxDrawMargin; } - iGc->DrawText( aDes.Mid( aStartPos, aLength ), currentTextRect, aBaselineOffsetFromTop ); - - } - - + iGc->DrawText( aDes.Mid( aStartPos, aLength ), currentTextRect, aBaselineOffsetFromTop ); + + } // End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -14,34 +14,28 @@ * Description: Meeting Request viewer response field implementation * */ - #include "cesmrresponsefield.h" #include "cesmrresponseitem.h" #include "mesmrresponseobserver.h" #include "mesmrmeetingrequestentry.h" #include "cesmrconflictpopup.h" -#include "cesmrlayoutmgr.h" #include "nmrlayoutmanager.h" #include "esmrhelper.h" -#include "cfsmailbox.h" +#include "cfsmailcommon.h" +#include "cesmrlistquery.h" #include -#include -#include +#include #include // DEBUG #include "emailtrace.h" /// Unnamed namespace for local definitions -namespace // codescanner::namespace - { - const TInt KSelectionTopic(0); - const TInt KOnlyTwoLines( 2 ); - const TInt KFirstCheckboxRow( 2 ); - const TInt KFirstControlItemIndex( 1 ); - const TInt KTopicFieldCount( 1 ); - const TInt KFirstSelectedItem( 1 ); +namespace + { + const TInt KConflictItemIndex( 0 ); + const TInt KExtraInfoItemIndex( 1 ); //"Request is out of date" "Please respond", ect } // namespace // ----------------------------------------------------------------------------- @@ -76,8 +70,8 @@ FUNC_LOG; iResponseItemArray.ResetAndDestroy(); delete iConfPopup; - - if( iESMRStaticAccessed ) + + if( iESMRStaticAccessed ) { iESMRStatic.Close(); } @@ -88,8 +82,8 @@ // ----------------------------------------------------------------------------- // CESMRResponseField::CESMRResponseField(MESMRResponseObserver* aResponseObserver) -: iResponseObserver(aResponseObserver), iSelectionIndex( KFirstSelectedItem ), - iESMRStaticAccessed(EFalse) +: iResponseObserver(aResponseObserver), iSelectionIndex( 0 ), + iESMRStaticAccessed(EFalse), iConflicted(EFalse) { FUNC_LOG; SetFieldId( EESMRFieldResponseArea ); @@ -102,38 +96,12 @@ void CESMRResponseField::ConstructL() { FUNC_LOG; - // Construct the topic for response area - // Topic line is without icon and text. Text is set later + + // Add pls resopond item to this field. CESMRResponseItem* responseItem = CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse ); iResponseItemArray.AppendL( responseItem ); CleanupStack::Pop( responseItem ); - - // Create tick boxes only in non touch environment - if ( !AknLayoutUtils::PenEnabled() ) - { - // Constuct the first item (Accept) - HBufC* stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_ACCEPT , - iEikonEnv ); - responseItem = CESMRResponseItem::NewLC( EESMRCmdAcceptMR, *stringholder, ETrue ); - iResponseItemArray.AppendL( responseItem ); - CleanupStack::Pop( responseItem ); - CleanupStack::PopAndDestroy( stringholder ); - - // Constuct the second item (Tentative) - stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_TENTATIVE , iEikonEnv ); - responseItem = CESMRResponseItem::NewLC( EESMRCmdTentativeMR, *stringholder, ETrue ); - iResponseItemArray.AppendL( responseItem ); - CleanupStack::Pop( responseItem ); - CleanupStack::PopAndDestroy( stringholder ); - - // Constuct the third item (Decline) - stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_DECLINE , iEikonEnv ); - responseItem = CESMRResponseItem::NewLC( EESMRCmdDeclineMR, *stringholder, ETrue ); - iResponseItemArray.AppendL( responseItem ); - CleanupStack::Pop( responseItem ); - CleanupStack::PopAndDestroy( stringholder ); - } } // ----------------------------------------------------------------------------- @@ -143,14 +111,10 @@ void CESMRResponseField::InitializeL() { FUNC_LOG; - TAknLayoutText layout = - NMRLayoutManager::GetLayoutText( - Rect(), NMRLayoutManager::EMRTextLayoutCheckboxEditor ); + TAknLayoutText layout = + NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutCheckboxEditor ); SetFont( layout.Font() ); - if( iSelectionIndex < iResponseItemArray.Count() ) - { - iResponseItemArray[iSelectionIndex]->SetHighlight(); - } } // ----------------------------------------------------------------------------- @@ -174,64 +138,35 @@ } // ----------------------------------------------------------------------------- -// CESMRResponseField::Draw -// ----------------------------------------------------------------------------- -// -void CESMRResponseField::Draw( - const TRect& /*aRect*/ ) const - { - FUNC_LOG; - } - -// ----------------------------------------------------------------------------- // CESMRResponseField::SizeChanged // ----------------------------------------------------------------------------- // void CESMRResponseField::SizeChanged() { FUNC_LOG; - TRect rect( Rect() ); - - // Topic field - TAknLayoutRect topicLayoutRect = - NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); - AknLayoutUtils::LayoutControl( - ControlItem( KSelectionTopic ), - rect, - topicLayoutRect.Color().Value(), - topicLayoutRect.Rect().iTl.iX, - topicLayoutRect.Rect().iTl.iY, - topicLayoutRect.Rect().iBr.iX, - topicLayoutRect.Rect().iBr.iY, - topicLayoutRect.Rect().Width(), - topicLayoutRect.Rect().Height()); - - // Items - // Remove one for the topic field - TInt count( iResponseItemArray.Count() - KTopicFieldCount ); - TInt row( KFirstCheckboxRow ); - TInt controlIndex( KFirstControlItemIndex ); + TInt count( iResponseItemArray.Count() ); TRect parentRect( Rect() ); - for( TInt i = 0; i < count; ++i ) - { + TRect rect; + for( TInt i = 1; i <= count; ++i ) + { TAknLayoutRect choiceLayoutRect = - NMRLayoutManager::GetFieldRowLayoutRect( parentRect, row + i ); + NMRLayoutManager::GetFieldRowLayoutRect( parentRect, i ); rect = parentRect; // Move the row down then it will be drawn to correct position. // controlIndex+1 tells the fields index. TInt movement = choiceLayoutRect.Rect().Height(); - rect.Move( 0, movement * ( controlIndex + i ) ); - + rect.Move( 0, movement * ( i - 1 ) ); + AknLayoutUtils::LayoutControl( - ControlItem( controlIndex + i ), + ControlItem( i - 1 ), rect, - choiceLayoutRect.Color().Value(), - choiceLayoutRect.Rect().iTl.iX, - choiceLayoutRect.Rect().iTl.iY, - choiceLayoutRect.Rect().iBr.iX, + choiceLayoutRect.Color().Value(), + choiceLayoutRect.Rect().iTl.iX, + 0, + choiceLayoutRect.Rect().iBr.iX, choiceLayoutRect.Rect().iBr.iY, - choiceLayoutRect.Rect().Width(), - choiceLayoutRect.Rect().Height() ); + choiceLayoutRect.Rect().Width(), + choiceLayoutRect.Rect().Height() ); } } @@ -247,7 +182,7 @@ TAknLayoutRect row1LayoutRect( NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); rect = row1LayoutRect.Rect(); - + TInt rowCount( iResponseItemArray.Count() ); TInt height( rect.Height() * rowCount ); return TSize( Parent()->Size().iWidth, height ); @@ -261,30 +196,27 @@ TEventCode aType ) { FUNC_LOG; - TKeyResponse consumed( EKeyWasNotConsumed ); + TKeyResponse consumed( EKeyWasNotConsumed ); - if ( aType == EEventKey && iSelectionIndex < iResponseItemArray.Count() ) + if ( aType == EEventKey ) { - if ( aKeyEvent.iScanCode == EStdKeyUpArrow && iSelectionIndex > 1) + if ( iConflicted ) { - iResponseItemArray[iSelectionIndex]->RemoveHighlight(); - iSelectionIndex--; - iResponseItemArray[iSelectionIndex]->SetHighlight(); - consumed = EKeyWasConsumed; - } - if ( aKeyEvent.iScanCode == EStdKeyDownArrow && - iSelectionIndex < iResponseItemArray.Count() - 1 ) - { - iResponseItemArray[iSelectionIndex]->RemoveHighlight(); - iSelectionIndex++; - iResponseItemArray[iSelectionIndex]->SetHighlight(); - consumed = EKeyWasConsumed; - } - // If ok button is pressed and highlight is not in the topic item - if ( aKeyEvent.iScanCode == EStdKeyDevice3 - && ItemSelectedL() ) - { - consumed = EKeyWasConsumed; + if ( aKeyEvent.iScanCode == EStdKeyUpArrow && iSelectionIndex > 0 ) + { + iResponseItemArray[KExtraInfoItemIndex]->RemoveHighlight(); + iResponseItemArray[KConflictItemIndex]->SetHighlight(); + iSelectionIndex = KConflictItemIndex; + consumed = EKeyWasConsumed; + } + + if ( aKeyEvent.iScanCode == EStdKeyDownArrow && iSelectionIndex < iResponseItemArray.Count()-1 ) + { + iResponseItemArray[KConflictItemIndex]->RemoveHighlight(); + iResponseItemArray[KExtraInfoItemIndex]->SetHighlight(); + iSelectionIndex = KExtraInfoItemIndex; + consumed = EKeyWasConsumed; + } } } @@ -303,16 +235,27 @@ void CESMRResponseField::FocusChanged( TDrawNow /*aDrawNow*/ ) { FUNC_LOG; + if ( iConflicted && !iPointEvent ) + { + // set the default value for iSelectionIndex, depend on iPreItemIndex + if ( PreItemIndex() <= CurrentItemIndex() ) + { + iSelectionIndex = 0; + } + else + { + iSelectionIndex = 1; + } + } // Focus received if ( IsFocused() && iSelectionIndex < iResponseItemArray.Count() ) { - // By default, highlight the first item - iResponseItemArray[iSelectionIndex]->SetHighlight(); - DrawDeferred(); - if (iConfPopup) - { - iConfPopup->ShowPopup(); - } + if( !iPointEvent ) + { + // By default, highlight the first item + iResponseItemArray[iSelectionIndex]->SetHighlight(); + DrawDeferred(); + } } else // Focus lost remove highlight { @@ -321,6 +264,7 @@ iResponseItemArray[i]->RemoveHighlight(); } } + iPointEvent = EFalse; } // ----------------------------------------------------------------------------- @@ -330,7 +274,8 @@ void CESMRResponseField::InternalizeL( MESMRCalEntry& aEntry ) { FUNC_LOG; - + iNormalResponse = EFalse; + iRemoveResponse = EFalse; MESMRMeetingRequestEntry* entry = NULL; if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == aEntry.Type() ) { @@ -341,6 +286,33 @@ User::Leave( KErrNotSupported ); } + // Judge if there is any conflicts with other existed event. + iConflicted = entry->Conflicts(); + if ( iConflicted ) + { + // Construct the item to show conflicts info, and insert it to the beginning of array + CESMRResponseItem* conflictItem = + CESMRResponseItem::NewLC( EESMRCmdUndefined, KNullDesC, EFalse ); + iResponseItemArray.Insert( conflictItem, 0 ); + CleanupStack::Pop( conflictItem ); + + HBufC* conflictString; + conflictString = StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_CONFLICT , iEikonEnv ); + // Show prompt conflict dialog + iConfPopup = CESMRConflictPopup::NewL(aEntry); + + if ( iResponseItemArray.Count() > 0 ) + { + iResponseItemArray[KConflictItemIndex]->SetUnderlineL( ETrue ); + iResponseItemArray[KConflictItemIndex]->SetTextL( conflictString->Des() ); + } + CleanupStack::PopAndDestroy( conflictString ); + } + + + // Set other info, for example, "please respond", "Request is out of date", + // "Meeting has been canceled" ...... MESMRMeetingRequestEntry::TESMREntryInfo attendeeInfo = entry->EntryAttendeeInfoL(); HBufC* stringholder; switch( attendeeInfo ) @@ -349,6 +321,10 @@ { stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_OUT_OF_DATE , iEikonEnv ); + if( entry->IsOpenedFromMail() ) + { + iRemoveResponse = ETrue; + } break; } @@ -357,6 +333,10 @@ stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_CANCELLED , iEikonEnv ); HandleCancelledEventItemsL( aEntry ); + if( entry->IsOpenedFromMail() ) + { + iRemoveResponse = ETrue; + } break; } @@ -364,6 +344,7 @@ { stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPOND_ACCEPTED , iEikonEnv ); + iNormalResponse = ETrue; break; } @@ -371,6 +352,7 @@ { stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPOND_TENTATIVE , iEikonEnv ); + iNormalResponse = ETrue; break; } @@ -378,6 +360,7 @@ { stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPOND_DECLINED , iEikonEnv ); + iNormalResponse = ETrue; break; } @@ -385,15 +368,10 @@ { stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_OCCURS_PAST , iEikonEnv ); - break; - } - - case MESMRMeetingRequestEntry::EESMREntryInfoConflicts: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_CONFLICT , iEikonEnv ); - iConfPopup = CESMRConflictPopup::NewL(aEntry); - iConfPopup->ShowPopup(); + if( entry->IsOpenedFromMail() ) + { + iRemoveResponse = ETrue; + } break; } @@ -401,22 +379,27 @@ { stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_RESPONSE_PLEASE_RESPOND , iEikonEnv ); + iNormalResponse = ETrue; break; } default: - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_PLEASE_RESPOND , iEikonEnv ); + stringholder = StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_PLEASE_RESPOND , iEikonEnv ); + iNormalResponse = ETrue; break; } - iResponseItemArray[0]->SetTextL( stringholder->Des() ); - // Check do we need to expand because of the long topic text ( two lines max ) - if ( iResponseItemArray[0]->ItemTextLineCount() > 1 || - iResponseItemArray.Count() == KOnlyTwoLines ) + TInt repondItemIndex( 0 ); + if ( iConflicted && iResponseItemArray.Count() == 2 ) { - SizeChanged(); + repondItemIndex = 1; } + + iResponseItemArray[repondItemIndex]->SetUnderlineL( ETrue ); + iResponseItemArray[repondItemIndex]->SetTextL( stringholder->Des() ); + + SizeChanged(); CleanupStack::PopAndDestroy( stringholder ); } @@ -438,7 +421,7 @@ { FUNC_LOG; iFont = aFont; - // Set font for the response items (Tpoic, Accept, Tentative, Decline ) + // Set font for the response items (conflict and extrainfo item ) TInt itemCount = iResponseItemArray.Count(); for( TInt i = 0; i < itemCount; i++ ) { @@ -447,23 +430,6 @@ } // ----------------------------------------------------------------------------- -// CESMRResponseField::SetLayoutManager -// ----------------------------------------------------------------------------- -// -void CESMRResponseField::SetLayoutManager( CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - iLayout = aLayout; - - // Set layoutmanager for the response items - TInt itemCount = iResponseItemArray.Count(); - for( TInt i = 0; i < itemCount; i++ ) - { - iResponseItemArray[i]->SetLayoutManager( aLayout ); - } - } - -// ----------------------------------------------------------------------------- // CESMRResponseField::ItemSelectedL // ----------------------------------------------------------------------------- // @@ -471,37 +437,68 @@ { FUNC_LOG; TBool selected( EFalse ); - - if ( iSelectionIndex > KSelectionTopic ) + TInt ret( KErrCancel ); + + if ( iConflicted ) { - if( iSelectionIndex < iResponseItemArray.Count() ) + if ( iSelectionIndex == 0 ) { - iResponseItemArray[iSelectionIndex]->ChangeIconL( ETrue ); - } - // Redraw to enable new checked icon in the screen - DrawDeferred(); - - TBool response( EFalse ); - - TInt cmd( 0 ); - if( iSelectionIndex < iResponseItemArray.Count() ) - { - cmd = static_cast< TInt >( iResponseItemArray[iSelectionIndex]->CommandId() ); - } - response = iResponseObserver->Response( cmd ); - - if ( !response ) - { - // Cancel was selected, update the icon - if( iSelectionIndex < iResponseItemArray.Count() ) + if ( iConfPopup ) { - iResponseItemArray[iSelectionIndex]->ChangeIconL( EFalse ); + iConfPopup->ShowPopup(); } } - - selected = ETrue; + + if ( KExtraInfoItemIndex == iSelectionIndex ) + { + if ( iNormalResponse ) + { + // Try to send response + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRNormalResponseQuery ); + CleanupStack::PushL( query ); + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + if ( iRemoveResponse ) + { + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRRemoveResponseQuery ); + CleanupStack::PushL( query ); + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + } } - + else + { + if ( KConflictItemIndex == iSelectionIndex ) + { + if ( iNormalResponse ) + { + // Try to send response + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRNormalResponseQuery ); + CleanupStack::PushL( query ); + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + if ( iRemoveResponse ) + { + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRRemoveResponseQuery ); + CleanupStack::PushL( query ); + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + } + } + + if ( KErrCancel != ret ) + { + NotifyEventAsyncL( ret ); + } + return selected; } @@ -512,59 +509,33 @@ void CESMRResponseField::HandleCancelledEventItemsL( MESMRCalEntry& aEntry ) { FUNC_LOG; - // Remove all other but title items from response array. Only 'Remove from Cal' - // should be shown. - TInt count = iResponseItemArray.Count(); - for ( TInt i = count - 1; i > 0; --i ) - { - CESMRResponseItem* item = iResponseItemArray[i]; - iResponseItemArray.Remove( i ); - delete item; - item = NULL; - } - CCalEntry& entry = aEntry.Entry(); CCalUser* calUser = entry.PhoneOwnerL(); TPtrC addr = ESMRHelper::AddressWithoutMailtoPrefix( calUser->Address() ); - + iESMRStatic.ConnectL(); iESMRStaticAccessed = ETrue; - - if( iESMRStatic.MailBoxL( addr ).HasCapability( - EFSMBoxCapaRemoveFromCalendar ) && - aEntry.IsStoredL() ) - { - // Construct the 'Remove from Calendar' item - HBufC* stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_REMOVE_CALENDAR_EVENT, iEikonEnv ); - CESMRResponseItem* responseItem = - CESMRResponseItem::NewL( EESMRCmdRemoveFromCalendar, *stringholder, ETrue ); - CleanupStack::PopAndDestroy( stringholder ); - CleanupStack::PushL( responseItem ); - // Set layout manager and font for the item - responseItem->SetLayoutManager( iLayout ); - responseItem->SetFont( iFont ); - responseItem->SetHighlight(); - User::LeaveIfError( iResponseItemArray.Append( responseItem ) ); - CleanupStack::Pop( responseItem ); - } } // ----------------------------------------------------------------------------- // CESMRResponseField::ExecuteGenericCommandL // ----------------------------------------------------------------------------- // -void CESMRResponseField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRResponseField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if ( aCommand == EAknSoftkeySelect ) { ItemSelectedL(); + isUsed = ETrue; } else { - CESMRField::ExecuteGenericCommandL( aCommand ); + isUsed = CESMRField::ExecuteGenericCommandL( aCommand ); } + + return isUsed; } // ----------------------------------------------------------------------------- @@ -575,7 +546,7 @@ { FUNC_LOG; CESMRField::SetOutlineFocusL( aFocus ); - + if ( aFocus ) { SetMiddleSoftKeyVisible( ETrue ); @@ -583,6 +554,126 @@ } // ----------------------------------------------------------------------------- +// CESMRResponseField::HandleSingletapEventL +// ----------------------------------------------------------------------------- +// +TBool CESMRResponseField::HandleSingletapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + + TBool handled( EFalse ); + if( !iLongTapEventConsumed ) + { + handled = HandleTapEventL( aPosition ); + } + iLongTapEventConsumed = EFalse; + + return handled; + } + +// --------------------------------------------------------------------------- +// CESMRResponseField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CESMRResponseField::HandleLongtapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + HandleTapEventL( aPosition ); + } + +// --------------------------------------------------------------------------- +// CESMRResponseField::HandletapEventL +// --------------------------------------------------------------------------- +// +TBool CESMRResponseField::HandleTapEventL( const TPoint& aPosition ) + { + TBool handled = EFalse; + TInt ret = KErrCancel; + + if ( Rect().Contains( aPosition ) ) + { + if ( iConflicted ) + { + TRect conflictItemRect = iResponseItemArray[KConflictItemIndex]->Rect(); + if ( conflictItemRect.Contains( aPosition ) ) + { + iResponseItemArray[KExtraInfoItemIndex]->RemoveHighlight(); + iResponseItemArray[KConflictItemIndex]->SetHighlight(); + iSelectionIndex = KConflictItemIndex; + if ( iConfPopup ) + { + iLongTapEventConsumed = ETrue; + iConfPopup->ShowPopup(); + } + } + else + { + iResponseItemArray[KConflictItemIndex]->RemoveHighlight(); + iResponseItemArray[KExtraInfoItemIndex]->SetHighlight(); + iSelectionIndex = KExtraInfoItemIndex; + DrawDeferred(); + if ( iNormalResponse ) + { + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRNormalResponseQuery ); + CleanupStack::PushL( query ); + // Use this flag to avoid the same event be handled by + // HandleSingletapEventL() when HandleLongtapEventL(). + iLongTapEventConsumed = ETrue; + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + if ( iRemoveResponse ) + { + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRRemoveResponseQuery ); + CleanupStack::PushL( query ); + iLongTapEventConsumed = ETrue; + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + } + } + else + { + iResponseItemArray[0]->SetHighlight(); + if ( iNormalResponse ) + { + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRNormalResponseQuery ); + CleanupStack::PushL( query ); + iLongTapEventConsumed = ETrue; + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + + if ( iRemoveResponse ) + { + CESMRListQuery* query = + CESMRListQuery::NewL( CESMRListQuery::EESMRRemoveResponseQuery ); + CleanupStack::PushL( query ); + iLongTapEventConsumed = ETrue; + ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + } + } + + DrawDeferred(); + + handled = ETrue; + iPointEvent = ETrue; + + if ( KErrCancel != ret ) + { + NotifyEventAsyncL( ret ); + } + + } + + return handled; + } + +// ----------------------------------------------------------------------------- // CESMRResponseField::ControlItem // ----------------------------------------------------------------------------- // @@ -593,7 +684,7 @@ { control = static_cast( iResponseItemArray[aIndex] ); } - + return control; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponseitem.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponseitem.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponseitem.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,7 +17,7 @@ #include "cesmrresponseitem.h" #include "nmrlayoutmanager.h" #include "nmrbitmapmanager.h" -#include "cesmrlayoutmgr.h" +#include "nmrcolormanager.h" #include "cmrimage.h" #include "cmrlabel.h" @@ -112,21 +112,11 @@ void CESMRResponseItem::Draw( const TRect& aRect ) const { FUNC_LOG; - //switch font color to unhighlighted, leave can be ignored - //since it's just a color change - TRAP_IGNORE(AknLayoutUtils::OverrideControlColorL( - *iSelectionLabel, - EColorLabelText, - KRgbBlack )); + NMRColorManager::SetColor( *iSelectionLabel, + NMRColorManager::EMRMainAreaTextColor ); + if( iHighlighted ) { - //switch font color to highlighted, leave can be ignored - //since it's just a color change - TRAP_IGNORE(AknLayoutUtils::OverrideControlColorL( - *iSelectionLabel, - EColorLabelText, - iLayout->ViewerListAreaHighlightedTextColor() )); - CWindowGc& gc = SystemGc(); TRect rect = aRect; TBool enableEdges(ETrue); @@ -302,9 +292,10 @@ NMRLayoutManager::GetTextComponentLayout( NMRLayoutManager::EMRTextLayoutText ); AknLayoutUtils::LayoutLabel( iSelectionLabel, rect, labelLayout ); + // SizeChange() is called when rect for ResponseItem is ready to be used. + // If setting text to response topic label fails, no need to catch it. + TRAP_IGNORE(SetTextToLabelL()); } - - } // ----------------------------------------------------------------------------- @@ -366,11 +357,9 @@ { FUNC_LOG; iSelectionLabel->SetFont( aFont ); - // Leave case can be ignored here because there is nothing to do about it - TRAP_IGNORE(AknLayoutUtils::OverrideControlColorL( - *iSelectionLabel, - EColorLabelText, - KRgbBlack ) ); + + NMRColorManager::SetColor( *iSelectionLabel, + NMRColorManager::EMRMainAreaTextColor ); } // ----------------------------------------------------------------------------- @@ -392,59 +381,66 @@ } else if( !iItemText && aItemText.Length() <= 0 ) { - // if there is no text yet, there is nothing to do here. + // if there is no new text yet, there is nothing to do here. return; } - - TInt lineCount = 1; // Default line count. - // If this item has no icon, it may use two lines for the text - if( !iIcon ) - { - lineCount = KMaxLinesInResponseTopicItem; - } - // Text wrapping - CArrayFixFlat* widthArray = - new (ELeave) CArrayFixFlat( lineCount ); - CleanupStack::PushL( widthArray ); - for ( TInt i(0); i < lineCount; i++ ) - { - // If this item has no icon, all the space is for text - if( !iIcon ) - { - TAknLayoutText layout = NMRLayoutManager::GetLayoutText( Rect(), NMRLayoutManager::EMRTextLayoutText ); - widthArray->AppendL( layout.TextRect().Width() ); - } - else - { - widthArray->AppendL( iLayout->ResponseAreaAnswerTextSize().iWidth ); - } - } - - HBufC* wrappedText; - // Set the font for the text - const CFont* font = iSelectionLabel->Font(); - RBuf buffer; // codescanner::resourcenotoncleanupstack - buffer.CreateL( iOriginalTextLength + widthArray->Count() ); - buffer.CleanupClosePushL(); - - // Wrap the text - AknTextUtils::WrapToStringAndClipL( iItemText->Des(), *widthArray, *font, buffer ); - wrappedText = buffer.AllocLC(); - - // Set the text to label - iSelectionLabel->SetTextL( *wrappedText ); - CleanupStack::PopAndDestroy(3); // widthArray, wrappedText, buffer + SetTextToLabelL(); } // ----------------------------------------------------------------------------- -// CESMRResponseItem::SetLayoutManager +// CESMRResponseItem::SetTextToLabelL // ----------------------------------------------------------------------------- // -void CESMRResponseItem::SetLayoutManager( CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - iLayout = aLayout; - } +void CESMRResponseItem::SetTextToLabelL() + { + if( iItemText ) + { + TInt lineCount = 1; // Default line count. + // If this item has no icon, it may use two lines for the text + if( !iIcon ) + { + lineCount = KMaxLinesInResponseTopicItem; + } + + // Text wrapping + CArrayFixFlat* widthArray = + new (ELeave) CArrayFixFlat( lineCount ); + CleanupStack::PushL( widthArray ); + + for ( TInt i(0); i < lineCount; i++ ) + { + // If this item has no icon, all the space is for text + if( !iIcon ) + { + TAknLayoutText layout = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutText ); + widthArray->AppendL( layout.TextRect().Width() ); + } + else + { + // This layout leaves space for the icon to the left side + TAknLayoutText layout = NMRLayoutManager::GetLayoutText( + Rect(), NMRLayoutManager::EMRTextLayoutTextEditor ); + widthArray->AppendL( layout.TextRect().Width() ); + } + } + + HBufC* wrappedText; + // Set the font for the text + const CFont* font = iSelectionLabel->Font(); + RBuf buffer; // codescanner::resourcenotoncleanupstack + buffer.CreateL( iOriginalTextLength + widthArray->Count() ); + buffer.CleanupClosePushL(); + + // Wrap the text + AknTextUtils::WrapToStringAndClipL( *iItemText, *widthArray, *font, buffer ); + wrappedText = buffer.AllocLC(); + + // Set the text to label + iSelectionLabel->SetTextL( *wrappedText ); + CleanupStack::PopAndDestroy(3); // widthArray, wrappedText, buffer + } + } // ----------------------------------------------------------------------------- // CESMRResponseItem::ItemTextLineCount @@ -471,3 +467,12 @@ return iCmd; } +// ----------------------------------------------------------------------------- +// CESMRResponseItem::SetUnderlineL +// ----------------------------------------------------------------------------- +// +void CESMRResponseItem::SetUnderlineL( TBool aUndreline ) + { + iSelectionLabel->SetUnderlining( aUndreline ); + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsereadyfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsereadyfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file implements class CESMRResponseReadyField. -* -*/ - - -#include "emailtrace.h" -#include "cesmrresponsereadyfield.h" -#include "mesmrmeetingrequestentry.h" -#include "mesmrresponseobserver.h" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::CESMRResponseReadyField -// --------------------------------------------------------------------------- -// -CESMRResponseReadyField::CESMRResponseReadyField( - MESMRResponseObserver* aResponseObserver ) -: iResponseObserver(aResponseObserver) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::~CESMRResponseReadyField -// --------------------------------------------------------------------------- -// -CESMRResponseReadyField::~CESMRResponseReadyField() - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::CESMRResponseReadyField -// --------------------------------------------------------------------------- -// -CESMRResponseReadyField* CESMRResponseReadyField::NewL( - MESMRResponseObserver* aResponseObserver ) - { - FUNC_LOG; - CESMRResponseReadyField* self = - new (ELeave) CESMRResponseReadyField( aResponseObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRResponseReadyField::ConstructL() - { - FUNC_LOG; - iLabel = new (ELeave) CEikLabel; - iLabel->SetTextL( KNullDesC ); - SetFieldId( EESMRFieldResponseReadyArea ); - CESMRField::ConstructL( iLabel, EESMRHighlightFocus ); - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRResponseReadyField::InitializeL() - { - FUNC_LOG; - iLabel->SetFont( iLayout->Font( iCoeEnv, iFieldId )); - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::InternalizeL -// --------------------------------------------------------------------------- -// -void CESMRResponseReadyField::InternalizeL( - MESMRCalEntry& aEntry ) - { - FUNC_LOG; - MESMRMeetingRequestEntry* entry = NULL; - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == aEntry.Type() ) - { - entry = static_cast(&aEntry); - } - else - { - User::Leave( KErrNotSupported ); - } - - TInt attendeeInfo = entry->EntryAttendeeInfoL(); - HBufC* stringholder = NULL; - switch( attendeeInfo ) - { - case MESMRMeetingRequestEntry::EESMREntryInfoOutOfDate: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_OUT_OF_DATE, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoCancelled: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_CANCELLED, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoAccepted: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPOND_ACCEPTED, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoTentativelyAccepted: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPOND_TENTATIVE, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoDeclined: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPOND_DECLINED, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoOccursInPast: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_OCCURS_PAST, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoConflicts: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_CONFLICT, - iEikonEnv ); - } - break; - case MESMRMeetingRequestEntry::EESMREntryInfoNormal: - { - stringholder = StringLoader::LoadLC( - R_QTN_MEET_REQ_RESPONSE_PLEASE_RESPOND, - iEikonEnv ); - } - break; - default: - { - User::Leave( KErrNotSupported ); - break; - } - } - - iLabel->SetTextL( *stringholder ); - CleanupStack::PopAndDestroy( stringholder ); - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CESMRResponseReadyField::OfferKeyEventL( - const TKeyEvent& aEvent, - TEventCode aType) - { - FUNC_LOG; - TKeyResponse response = EKeyWasNotConsumed; - - if( aType == EEventKey ) - { - if( aEvent.iScanCode == EStdKeyDevice3 ) - { - iResponseObserver->ChangeReadyResponseL(); - response = EKeyWasConsumed; - } - } - return response; - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::SetOutlineFocusL -// --------------------------------------------------------------------------- -// -void CESMRResponseReadyField::SetOutlineFocusL( TBool aFocus ) - { - FUNC_LOG; - CESMRField::SetOutlineFocusL( aFocus ); - - TRgb fontColor( 0, 0, 0 ); - if ( aFocus ) - { - SetMiddleSoftKeyVisible( ETrue ); - fontColor = iLayout->ViewerListAreaHighlightedTextColor(); - } - else - { - fontColor = iLayout->ViewerListAreaTextColor(); - } - - AknLayoutUtils::OverrideControlColorL( *iLabel, - EColorLabelText, - fontColor ); - } - -// --------------------------------------------------------------------------- -// CESMRResponseReadyField::SetOutlineFocusL -// --------------------------------------------------------------------------- -// -void CESMRResponseReadyField::ExecuteGenericCommandL( TInt aCommand ) - { - FUNC_LOG; - if ( aCommand == EAknSoftkeySelect ) - { - iResponseObserver->ChangeReadyResponseL(); - } - } - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrtrackingfieldlabel.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrtrackingfieldlabel.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrtrackingfieldlabel.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,14 +21,13 @@ // USER INCLUDES #include "mesmrlistobserver.h" -#include "cesmrborderlayer.h" // SYSTEM INCLUDES #include #include #include #include -#include +#include #include // ======== MEMBER FUNCTIONS ======== @@ -59,9 +58,6 @@ : EESMRFieldOptTrack ); iTitle = new (ELeave) CEikLabel(); - iTitle->SetLabelAlignment ( CESMRLayoutManager::IsMirrored ( ) ? ELayoutAlignRight - : ELayoutAlignLeft ); - HBufC* label = StringLoader::LoadLC (iRole == CCalAttendee::EReqParticipant ? R_QTN_MEET_REQ_LABEL_REQUIRED : R_QTN_MEET_REQ_LABEL_OPT ); @@ -80,8 +76,11 @@ void CESMRTrackingFieldLabel::InitializeL() { FUNC_LOG; - iTitleSize = iLayout->FieldSize ( EESMRFieldAttendeeLabel ); - iTitle->SetFont( iLayout->Font (iCoeEnv, EESMRFieldAttendeeLabel ) ); + // TODO: Do not use old layout manager anymore + //iTitleSize = iLayout->FieldSize ( EESMRFieldAttendeeLabel ); + + // TODO: use XML Data + //iTitle->SetFont( iLayout->Font (iCoeEnv, EESMRFieldAttendeeLabel ) ); } // --------------------------------------------------------------------------- @@ -92,7 +91,7 @@ { FUNC_LOG; TRect rect = Rect ( ); - if ( CESMRLayoutManager::IsMirrored ( ) ) + /*if ( CESMRLayoutManager::IsMirrored ( ) ) { TPoint titlePos( rect.iBr.iX - iTitleSize.iWidth, rect.iTl.iY); iTitle->SetExtent ( titlePos, iTitleSize ); @@ -102,6 +101,7 @@ // title iTitle->SetExtent ( rect.iTl, iTitleSize ); } + */ } // --------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrtrackstatus.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrtrackstatus.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrtrackstatus.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,32 +16,38 @@ */ // CLASS HEADER + #include "cesmrtrackstatus.h" + #include "cesmrfield.h" -#include "cesmriconfield.h" -#include "cesmrborderlayer.h" #include "esmrdef.h" #include "mesmrlistobserver.h" #include "cesmrcontactmenuhandler.h" #include "esmrhelper.h" #include "nmrbitmapmanager.h" +#include "cmrimage.h" + #include #include #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include +#include + // DEBUG #include "emailtrace.h" -using namespace ESMRLayout; +// TODO: THIS WHOLE CLASS NEEDS TO BE REIMPLEMENTED USING XML LAYOUT DATA +// IF THIS IS TAKEN INTO USE + // ======== MEMBER FUNCTIONS ======== @@ -86,7 +92,7 @@ CESMRTrackStatus::CESMRTrackStatus() { FUNC_LOG; - //do nothing + SetFieldId( EESMRTrackStatus ); } // --------------------------------------------------------------------------- @@ -96,13 +102,11 @@ void CESMRTrackStatus::ConstructL() { FUNC_LOG; - // As a default set icon and text as it should be in status Needs action - SetFieldId( EESMRTrackStatus ); - CESMRViewerLabelField::ConstructL( KAknsIIDQgnFsIndiCaleTrackingNone ); + iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapTrackingNone ); + iIcon->SetParent( this ); + iESMRStatic.ConnectL(); iMenuHandler = &iESMRStatic.ContactMenuHandlerL(); - - iIcon = new (ELeave) CEikImage; } // --------------------------------------------------------------------------- @@ -112,7 +116,7 @@ void CESMRTrackStatus::InternalizeL( MESMRCalEntry& aEntry ) { FUNC_LOG; - TAknsItemID statusIconId = KAknsIIDQgnFsIndiCaleTrackingNone; + RPointerArray attendee = aEntry.Entry().AttendeesL(); // The array is already in sorted order with ReqAttendee coming first and // OptAttendee coming later. @@ -139,75 +143,85 @@ iAddress = attendee[currentIndex]->Address().AllocL(); } - const CFont* font = iLayout->Font (iCoeEnv, iFieldId ); - TInt maxLineWidth = iLabel->Size().iWidth; - maxLineWidth -= KIconSize.iWidth; + // TODO: set font with XML data + //const CFont* font = iLayout->Font (iCoeEnv, iFieldId ); + //TInt maxLineWidth = iLabel->Size().iWidth; + //maxLineWidth -= KIconSize.iWidth; - HBufC* clippedTextHBufC = ClipTextLC( text, *font, maxLineWidth ); - TPtr clippedText = clippedTextHBufC->Des(); - clippedText.Trim(); - iLabel->SetTextL( clippedText ); - CleanupStack::PopAndDestroy( clippedTextHBufC ); - clippedTextHBufC = NULL; + //HBufC* clippedTextHBufC = ClipTextLC( text, *font, maxLineWidth ); + //TPtr clippedText = clippedTextHBufC->Des(); + //clippedText.Trim(); + //iLabel->SetTextL( clippedText ); + //CleanupStack::PopAndDestroy( clippedTextHBufC ); + //clippedTextHBufC = NULL; + + NMRBitmapManager::TMRBitmapId bitmapId; switch( status ) { case CCalAttendee::ENeedsAction: { - statusIconId = KAknsIIDQgnFsIndiCaleTrackingNone; + bitmapId = NMRBitmapManager::EMRBitmapTrackingNone; break; } case CCalAttendee::ETentative: { - statusIconId = KAknsIIDQgnFsIndiCaleTrackingTentative; + bitmapId = NMRBitmapManager::EMRBitmapTrackingTentative; break; } case CCalAttendee::EAccepted: case CCalAttendee::EConfirmed: { - statusIconId = KAknsIIDQgnFsIndiCaleTrackingAccept; + bitmapId = NMRBitmapManager::EMRBitmapTrackingAccept; break; } case CCalAttendee::EDeclined: { - statusIconId = KAknsIIDQgnFsIndiCaleTrackingReject; + bitmapId = NMRBitmapManager::EMRBitmapTrackingReject; break; } default: { - statusIconId = KAknsIIDQgnFsIndiCaleTrackingNone; + bitmapId = NMRBitmapManager::EMRBitmapTrackingNone; break; } } - iESMRStatic.SetCurrentFieldIndex(++currentIndex); // Move to next index + iESMRStatic.SetCurrentFieldIndex(++currentIndex); // Move to next index - IconL( statusIconId ); - - //store default list selection to contactmenuhandler - iDefaultAddress = attendee[0]->Address().AllocL(); - iMenuHandler->SetValueL(*iDefaultAddress, CESMRContactMenuHandler::EValueTypeEmail); + delete iIcon; + iIcon = NULL; + iIcon = CMRImage::NewL( bitmapId ); + iIcon->SetParent( this ); + + //store default list selection to contactmenuhandler + iDefaultAddress = attendee[0]->Address().AllocL(); + iMenuHandler->SetValueL(*iDefaultAddress, CESMRContactMenuHandler::EValueTypeEmail); - // This needs to be called so icon will be redrawn - SizeChanged(); + // This needs to be called so icon will be redrawn + SizeChanged(); } // --------------------------------------------------------------------------- // CESMRTrackStatus::OfferKeyEventL // --------------------------------------------------------------------------- // -TKeyResponse CESMRTrackStatus::OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ) +TKeyResponse CESMRTrackStatus::OfferKeyEventL( + const TKeyEvent& aEvent, + TEventCode /*aType*/ ) { FUNC_LOG; + TKeyResponse response( EKeyWasNotConsumed ); + if ( aEvent.iScanCode == EStdKeyRightArrow ) { // Show right click menu (action menu) iMenuHandler->ShowActionMenuL(); - return EKeyWasConsumed; + response = EKeyWasConsumed; } - return CESMRViewerLabelField::OfferKeyEventL(aEvent,aType); + return response; } // --------------------------------------------------------------------------- @@ -217,12 +231,13 @@ void CESMRTrackStatus::SetOutlineFocusL(TBool aFocus ) { FUNC_LOG; - CESMRViewerLabelField::SetOutlineFocusL (aFocus ); + CESMRField::SetOutlineFocusL (aFocus ); + SetActionMenuIconL(aFocus); TRgb fontColor( 0, 0, 0 ); if ( aFocus ) { - if(iAddress) + if( iAddress ) { //no longer needed delete iDefaultAddress; @@ -230,18 +245,11 @@ //give contact to actionmenuhandler iMenuHandler->SetValueL(*iAddress, CESMRContactMenuHandler::EValueTypeEmail); } - fontColor = iLayout->ViewerListAreaHighlightedTextColor(); } else { iMenuHandler->Reset(); - fontColor = iLayout->ViewerListAreaTextColor(); } - - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iLabel, - EColorLabelText, - fontColor ) ); } // --------------------------------------------------------------------------- @@ -251,7 +259,7 @@ TInt CESMRTrackStatus::CountComponentControls( ) const { FUNC_LOG; - TInt count = CESMRViewerLabelField::CountComponentControls ( ); + TInt count( 0 ); if ( iIcon ) { ++count; @@ -266,11 +274,17 @@ CCoeControl* CESMRTrackStatus::ComponentControl( TInt aInd ) const { FUNC_LOG; + + CCoeControl* control = NULL; + if ( aInd == 2 ) { - return iIcon; + control = iIcon; } - return CESMRViewerLabelField::ComponentControl ( aInd ); + + ASSERT( control ); + + return control; } // --------------------------------------------------------------------------- @@ -289,25 +303,29 @@ if( aFocused ) { + // TODO: correct this User::LeaveIfError( NMRBitmapManager::GetSkinBasedBitmap( NMRBitmapManager::EMRBitmapRightClickArrow, - iActionMenuIcon, iActionMenuIconMask, KIconSize ) ); + iActionMenuIcon, iActionMenuIconMask, TSize(20, 20) ) ); + // TODO: USE XML LAYOUT DATA AND CMRIMAGE // Even if creating mask failed, bitmap can be used (background is just not displayed correctly) - if( iActionMenuIcon ) + /*if( iActionMenuIcon ) { iIcon = new (ELeave) CEikImage; iIcon->SetPictureOwnedExternally(ETrue); iIcon->SetPicture( iActionMenuIcon, iActionMenuIconMask ); - TRect rect = Rect ( ); - TInt iconTopMargin = ( rect.Height() - KIconSize.iHeight ) / 2; + TRect rect = Rect ( );*/ + + // TODO: use layout data + /*TInt iconTopMargin = ( rect.Height() - KIconSize.iHeight ) / 2; TPoint iconPos( rect.iBr.iX - KIconSize.iWidth - KIconBorderMargin, rect.iBr.iY - iconTopMargin - KIconSize.iHeight); iIcon->SetPosition ( iconPos ); - iIcon->SetSize ( KIconSize ); - } + iIcon->SetSize ( KIconSize );*/ + //} } } @@ -318,17 +336,18 @@ void CESMRTrackStatus::SizeChanged( ) { FUNC_LOG; - CESMRViewerLabelField::SizeChanged(); if ( iIcon ) { TRect rect = Rect ( ); + // TODO: use XML layout + /* TInt iconTopMargin = ( rect.Height() - KIconSize.iHeight ) / 2; TPoint iconPos( rect.iBr.iX - KIconSize.iWidth - KIconBorderMargin, rect.iBr.iY - iconTopMargin - KIconSize.iHeight); iIcon->SetPosition ( iconPos ); - iIcon->SetSize ( KIconSize ); + iIcon->SetSize ( KIconSize );*/ } } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,686 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Meeting request attachments field - * -*/ -#include "emailtrace.h" -#include "cesmrviewerattachmentsfield.h" - -// -#include "mesmrcalentry.h" -#include "cesmrcontactmenuattachmenthandler.h" -// -#include -#include -// -#include "esmricalvieweropcodes.hrh" -#include "cfsmailmessage.h" -// - -#include "cesmrrichtextviewer.h" -#include "cesmrrichtextlink.h" -#include "mesmrlistobserver.h" -#include "mesmrmeetingrequestentry.h" -#include "tesmrinputparams.h" -#include "cesmrattachment.h" -#include "cesmrattachmentinfo.h" -#include "cesmrcontactmenuhandler.h" -#include "cmrimage.h" -#include "nmrlayoutmanager.h" - - -// Unnamed namespace for local definitions -namespace { // codescanner::namespace - -// -// MR does not contain attachments -const TInt KNoAttachments( 0 ); -// MR contains one attachment -const TInt KOneAttachment( 1 ); -// - -const TInt KOneKiloByte( 1024 ); - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::CESMRViewerAttachmentsField -// --------------------------------------------------------------------------- -// -CESMRViewerAttachmentsField::CESMRViewerAttachmentsField() -: iFocused(EFalse) - { - FUNC_LOG; - SetFieldId( EESMRFieldAttachments ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::~CESMRViewerAttachmentsField -// --------------------------------------------------------------------------- -// -CESMRViewerAttachmentsField::~CESMRViewerAttachmentsField() - { - FUNC_LOG; - delete iFieldIcon; - delete iRichTextViewer; - delete iAttachmentText; - - iESMRStatic.Close(); - - delete iAttachmentInfo; - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::NewL -// --------------------------------------------------------------------------- -// -CESMRViewerAttachmentsField* CESMRViewerAttachmentsField::NewL() - { - FUNC_LOG; - CESMRViewerAttachmentsField* self = new( ELeave )CESMRViewerAttachmentsField; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::ConstructL() -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::ConstructL() - { - FUNC_LOG; - SetFocusType( EESMRNoFocus ); - - iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapMailAttachment ); - iFieldIcon->SetParent( this ); - - iRichTextViewer = CESMRRichTextViewer::NewL( this ); - iRichTextViewer->SetEdwinSizeObserver( this ); - iRichTextViewer->SetLinkObserver( this ); - iRichTextViewer->SetParent( this ); - - iRichTextViewer->SetActionMenuStatus( ETrue ); - iESMRStatic.ConnectL(); - iCntMenuHdlr = &iESMRStatic.ContactMenuHandlerL(); - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::MinimumSize -// --------------------------------------------------------------------------- -// -TSize CESMRViewerAttachmentsField::MinimumSize() - { - // Let's calculate the required rect of the iRichTextViewer. - // We will not use directly the iRichTextViewer height, because it might - // not exist, or the height of the viewer might still be incorrect - TRect richTextViewerRect = RichTextViewerRect(); - - // We will use as minimum size the parents width - // but the calculated iRichTextViewers height - return TSize( Parent()->Size().iWidth, richTextViewerRect.Height() ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::InitializeL -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::InitializeL() - { - FUNC_LOG; - // Setting Font for the rich text viewer - TAknLayoutText text = NMRLayoutManager::GetLayoutText( - Rect(), - NMRLayoutManager::EMRTextLayoutTextEditor ); - - iRichTextViewer->SetFontL( text.Font(), iLayout ); - - // This is called so theme changes will apply when changing theme "on the fly" - if ( IsFocused() ) - { - iRichTextViewer->FocusChanged( EDrawNow ); - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::InternalizeL() -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::InternalizeL( MESMRCalEntry& aEntry ) - { - FUNC_LOG; - MESMRMeetingRequestEntry* mrEntry = NULL; - if ( aEntry.Type() != MESMRCalEntry::EESMRCalEntryMeetingRequest ) - { - // This is not meeting request entry so attachment field should be removed from ui - iObserver->RemoveControl( FieldId() ); - return; - } - else - { - mrEntry = static_cast( &aEntry ); - - TESMRInputParams startupParams; - if ( mrEntry && mrEntry->StartupParameters(startupParams) ) - { - // Startup parameters exist --> Let's check if there are attachments - - if ( startupParams.iAttachmentInfo ) - { - iMailMessage = startupParams.iMailMessage; - - UpdateAttachmentInfoL(); - - iCntMenuHdlr->SetCommandObserver( this ); - - iAttachmentCount = 0; - - if ( iAttachmentInfo ) - { - iAttachmentCount = iAttachmentInfo->AttachmentCount(); - } - - if ( iAttachmentCount > KOneAttachment ) - { - // There are more than one attachments - TInt attachmentsSizeSum(0); - for (TInt i(0); i < iAttachmentCount; ++i ) - { - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( i ) ); - - TInt attachmentSize( attachment.AttachmentSizeInBytes() ); - attachmentsSizeSum += attachmentSize; - } - if ( attachmentsSizeSum >= KOneKiloByte ) - { - CArrayFixFlat* ints = - new ( ELeave ) CArrayFixFlat( 1 ); - - CleanupStack::PushL(ints); - ints->AppendL( iAttachmentCount ); - ints->AppendL( attachmentsSizeSum / KOneKiloByte ); - - iAttachmentText = StringLoader::LoadL( - R_QTN_FSE_VIEWER_HEADER_ATTACHMENTS_TOTAL, - *ints ); - - CleanupStack::PopAndDestroy(ints); - } - else - { - iAttachmentText = StringLoader::LoadL( - R_QTN_FSE_VIEWER_HEADER_ATTACHMENTS_LESS_THAN_KB, - iAttachmentCount); - } - } - else if ( iAttachmentCount > 0 ) - { - // There is one attachment - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( 0 ) ); - TPtrC attachmentName( attachment.AttachmentName() ); - - TInt attachmentSize( attachment.AttachmentSizeInBytes() ); - - if ( attachmentSize >= KOneKiloByte ) - { - // "%0U %1N kB" - - CDesCArrayFlat* attachmentStrings = - new(ELeave)CDesCArrayFlat( 1 ); - CleanupStack::PushL( attachmentStrings ); - //First string - attachmentStrings->AppendL( attachmentName ); - - CArrayFixFlat* integers = - new (ELeave) CArrayFixFlat(1); - CleanupStack::PushL( integers ); - integers->AppendL( attachmentSize / KOneKiloByte ); - - iAttachmentText = StringLoader::LoadL( - R_QTN_FSE_VIEWER_HEADER_ATTACHMENT, - *attachmentStrings, - *integers ); - - // Pop and delete strings array - CleanupStack::PopAndDestroy( integers ); - CleanupStack::PopAndDestroy( attachmentStrings ); - } - else - { - iAttachmentText = StringLoader::LoadL( - R_QTN_FSE_VIEWER_HEADER_ATTACHMENT_LESS_THAN_KB, - attachmentName); - } - } - - if ( iAttachmentText ) - { - iRichTextViewer->SetTextL( iAttachmentText, EFalse ); - // After setting the text, the viewer line count is known - iLineCount = iRichTextViewer->LineCount(); - - CESMRRichTextLink* link = CESMRRichTextLink::NewL ( - 0, iAttachmentText->Length ( ), - iAttachmentText->Des(), - CESMRRichTextLink::ETypeAttachment, - CESMRRichTextLink::ETriggerKeyRight ); - - CleanupStack::PushL( link ); - iRichTextViewer->AddLinkL( link ); - CleanupStack::Pop( link ); - } - } - } - } - - if ( KNoAttachments == iAttachmentCount ) - { - iObserver->RemoveControl( FieldId() ); - } - - iDisableRedraw = ETrue; - } - -// ----------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::HandleRichTextLinkSelection -// ----------------------------------------------------------------------------- -// -TBool CESMRViewerAttachmentsField::HandleRichTextLinkSelection( - const CESMRRichTextLink* /*aLink*/ ) - { - FUNC_LOG; - - // - TRAP_IGNORE( iCntMenuHdlr->ShowActionMenuL() ); - // - - return ETrue; - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::OfferKeyEventL() -// --------------------------------------------------------------------------- -// -TKeyResponse CESMRViewerAttachmentsField::OfferKeyEventL( - const TKeyEvent& aEvent, - TEventCode aType ) - { - FUNC_LOG; - TKeyResponse response( EKeyWasNotConsumed ); - - if ( ( aType == EEventKey || aType == EEventKeyUp ) && - aEvent.iScanCode == EStdKeyDevice3 ) - { - // Selection key was pressed --> Trigger open attachment view command - NotifyEventL( EESMRCmdMskOpenEmailAttachment ); - - response = EKeyWasConsumed; - } - else - { - response = iRichTextViewer->OfferKeyEventL ( aEvent, aType ); - } - - return response; - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::HandleEdwinSizeEventL() -// --------------------------------------------------------------------------- -// -TBool CESMRViewerAttachmentsField::HandleEdwinSizeEventL( - CEikEdwin* aEdwin, - TEdwinSizeEvent /*aType*/, - TSize aSize ) - { - FUNC_LOG; - TBool reDraw( EFalse ); - - // Let's save the required size for the iRichTextViewer - iSize = aSize; - - if ( iObserver && aEdwin == iRichTextViewer ) - { - iObserver->ControlSizeChanged( this ); - reDraw = ETrue; - } - return reDraw; - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::ListObserverSet -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::ListObserverSet() - { - FUNC_LOG; - iRichTextViewer->SetListObserver( iObserver ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::SetOutlineFocusL -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::SetOutlineFocusL( TBool aFocus ) - { - FUNC_LOG; - CESMRField::SetOutlineFocusL( aFocus ); - - if ( iRichTextViewer ) - { - iRichTextViewer->SetFocus( aFocus ); - } - - if ( aFocus && aFocus != iFocused ) - { - // - UpdateAttachmentInfoL(); - - if( iAttachmentInfo->AttachmentCount() > KOneAttachment ) - { - ChangeMiddleSoftKeyL( EESMRCmdOpenAttachmentView, - R_QTN_MSK_VIEWLIST ); - } - else - { - // There is one attachment - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( 0 ) ); - - if( attachment.AttachmenState() == CESMRAttachment::EAttachmentStateDownloaded ) - { - ChangeMiddleSoftKeyL( EESMRCmdOpenAttachment, - R_QTN_MSK_OPEN ); - } - else - { - ChangeMiddleSoftKeyL( EESMRCmdDownloadAttachment, - R_QTN_MSK_DOWNLOAD ); - } - } - // - } - iFocused = aFocus; - } - -// -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::MessagePartPointerArrayCleanup -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::MessagePartPointerArrayCleanup( TAny* aArray ) - { - FUNC_LOG; - RPointerArray* messagePartArray = - static_cast*>( aArray ); - - messagePartArray->ResetAndDestroy(); - messagePartArray->Close(); - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::UpdateAttachmentInfoL -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::UpdateAttachmentInfoL() - { - if ( iMailMessage->IsFlagSet( EFSMsgFlag_Attachments ) ) - { - RPointerArray attachmentParts; - CleanupStack::PushL( - TCleanupItem( - MessagePartPointerArrayCleanup, - &attachmentParts) ); - - iMailMessage->AttachmentListL( attachmentParts ); - - // find calendar part from the list - CFSMailMessagePart* calendarPart = - iMailMessage->FindBodyPartL( KFSMailContentTypeTextCalendar ); - CleanupStack::PushL( calendarPart ); - - if ( calendarPart ) - { - // remove calendar body part from attachment list - for ( TInt ii = attachmentParts.Count() - 1; ii >= 0; --ii ) - { - if ( attachmentParts[ii]->GetPartId() == calendarPart->GetPartId() ) - { - delete attachmentParts[ii]; - attachmentParts.Remove(ii); - break; - } - } - } - CleanupStack::PopAndDestroy( calendarPart ); - - iAttachmentCount = attachmentParts.Count(); - if ( iAttachmentCount > 0 ) - { - delete iAttachmentInfo; - iAttachmentInfo = NULL; - - CESMRAttachmentInfo* attachmentInfo = CESMRAttachmentInfo::NewL(); - CleanupStack::PushL( attachmentInfo ); - - for( TInt i(0); i < iAttachmentCount; ++i ) - { - CESMRAttachment::TESMRAttachmentState state( - CESMRAttachment::EAttachmentStateDownloaded ); - - if ( EFSFull != attachmentParts[i]->FetchLoadState() ) - { - state = CESMRAttachment::EAttachmentStateNotDownloaded; - } - - TInt contentSize( attachmentParts[i]->ContentSize() ); - TPtrC attachmentName( attachmentParts[i]->AttachmentNameL() ); - if ( contentSize > 0 && attachmentName.Length() ) - { - attachmentInfo->AddAttachmentInfoL( - attachmentName, - contentSize, - state ); - } - } - - if ( attachmentInfo->AttachmentCount() ) - { - iAttachmentInfo = attachmentInfo; - CleanupStack::Pop( attachmentInfo ); - } - else - { - CleanupStack::PopAndDestroy( attachmentInfo ); - } - - attachmentInfo = NULL; - } - CleanupStack::PopAndDestroy(); // attachmentparts - - // relay attachment info to contact menu so we can display - // options based on attachment state - if ( iAttachmentInfo ) - { - iCntMenuHdlr->SetAttachmentInfoL( iAttachmentInfo ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::ExecuteGenericCommandL -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::ExecuteGenericCommandL( TInt aCommand ) - { - FUNC_LOG; - - switch ( aCommand ) - { - case EESMRCmdOpenAttachment:// Fall through - case EESMRCmdOpenAttachmentView:// Fall through - case EESMRCmdDownloadAttachment: // Fall through - { - NotifyEventL( aCommand ); - - break; - } - case EESMRCmdClipboardCopy: - { - iRichTextViewer->CopyCurrentLinkValueToClipBoardL(); - break; - } - default: - { - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CESMRRichTextViewer::ProcessCommandL -// ----------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::ProcessCommandL( TInt aCommandId ) - { - FUNC_LOG; - - NotifyEventL( aCommandId ); - } - - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::CountComponentControls -// --------------------------------------------------------------------------- -// -TInt CESMRViewerAttachmentsField::CountComponentControls() const - { - TInt count( 0 ); - if ( iFieldIcon ) - { - ++count; - } - - if ( iRichTextViewer ) - { - ++count; - } - return count; - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::ComponentControl -// --------------------------------------------------------------------------- -// -CCoeControl* CESMRViewerAttachmentsField::ComponentControl( - TInt aIndex ) const - { - switch ( aIndex ) - { - case 0: - return iFieldIcon; - case 1: - return iRichTextViewer; - default: - return NULL; - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::SizeChanged -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::SizeChanged( ) - { - TRect rect = Rect(); - - // LAYOUTING FIELD ICON - if( iFieldIcon ) - { - TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( - NMRLayoutManager::EMRLayoutTextEditorIcon ); - AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout ); - } - - // LAYOUTING FIELD BACKGROUND - TAknLayoutRect bgLayoutRect = - NMRLayoutManager::GetLayoutRect( - rect, NMRLayoutManager::EMRLayoutTextEditorBg ); - TRect bgRect( bgLayoutRect.Rect() ); - // Move focus rect so that it's relative to field's position - bgRect.Move( -Position() ); - SetFocusRect( bgRect ); - - - // LAYOUTING FIELD TEXT VIEWER - if( iRichTextViewer ) - { - iRichTextViewer->SetRect( RichTextViewerRect() ); - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::SetContainerWindowL -// --------------------------------------------------------------------------- -// -void CESMRViewerAttachmentsField::SetContainerWindowL( - const CCoeControl& aContainer ) - { - CCoeControl::SetContainerWindowL( aContainer ); - iRichTextViewer->SetContainerWindowL( aContainer ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerAttachmentsField::RichTextViewerRect -// --------------------------------------------------------------------------- -// -TRect CESMRViewerAttachmentsField::RichTextViewerRect() - { - TRect rect = Rect(); - - TAknTextComponentLayout edwinLayout = NMRLayoutManager::GetTextComponentLayout( - NMRLayoutManager::EMRTextLayoutTextEditor ); - - // Text layout rect for one line viewer - TAknLayoutText textLayout; - textLayout.LayoutText( rect, edwinLayout ); - TRect textLayoutRect = textLayout.TextRect(); - - TRect viewerRect = textLayoutRect; - - // If iRichTextViewer has lines and iSize has been set, - // we will use iSize.iHeight as the viewers height - if( iLineCount > 0 && iSize.iHeight > 0 ) - { - viewerRect.SetHeight( iSize.iHeight ); - } - // Otherwise we will use one row height as the height of the - // iRichTextViewer - else - { - TAknLayoutRect rowLayoutRect = - NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); - viewerRect.SetHeight( rowLayoutRect.Rect().Height() ); - } - - return viewerRect; - } - -//EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattendeesfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattendeesfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattendeesfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,25 +18,21 @@ #include "cesmrviewerattendeesfield.h" #include "mesmrlistobserver.h" -#include "cesmrborderlayer.h" #include "cesmrrichtextlink.h" #include "esmrfieldbuilderdef.h" -#include "cesmrlayoutmgr.h" #include "cmrlabel.h" #include "nmrlayoutmanager.h" #include #include -#include +#include #include -#include -#include -#include "cmrlistpane.h" +#include +#include // DEBUG #include "emailtrace.h" -using namespace ESMRLayout; // CONSTANTS /// Unnamed namespace for local definitions @@ -65,7 +61,7 @@ CCalAttendee::TCalRole aRole ) { FUNC_LOG; - CESMRViewerAttendeesField* self = + CESMRViewerAttendeesField* self = new (ELeave) CESMRViewerAttendeesField( aRole ); CleanupStack::PushL ( self ); self->ConstructL ( ); @@ -86,8 +82,9 @@ iTitle = CMRLabel::NewL(); iTitle->SetParent( this ); - + iRichTextViewer = CESMRRichTextViewer::NewL (this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transferred iRichTextViewer->SetEdwinSizeObserver ( this ); iRichTextViewer->SetLinkObserver (this ); iRichTextViewer->SetParent( this ); @@ -107,12 +104,14 @@ { FUNC_LOG; TAknLayoutText layoutText = - NMRLayoutManager::GetLayoutText( Rect(), + NMRLayoutManager::GetLayoutText( Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - iRichTextViewer->SetFontL( layoutText.Font(), iLayout ); + iRichTextViewer->SetFontL( layoutText.Font() ); + iRichTextViewer->ApplyLayoutChangesL(); UpdateAttendeesListL(); //wake up current contact menu selection by calling this iRichTextViewer->FocusChanged( ENoDrawNow ); + iRichTextViewer->SetEventQueue( iEventQueue ); } // ----------------------------------------------------------------------------- @@ -122,21 +121,18 @@ void CESMRViewerAttendeesField::SetOutlineFocusL( TBool aFocus ) { FUNC_LOG; - CESMRField::SetOutlineFocusL( aFocus ); + CESMRField::SetOutlineFocusL (aFocus ); iRichTextViewer->SetFocus( aFocus ); - + if ( aFocus ) { SetMiddleSoftKeyVisible( ETrue ); } else { - TInt oldShowAttendees = iShowAllAttendees; iShowAllAttendees = EFalse; - if (oldShowAttendees != iShowAllAttendees) - { - UpdateAttendeesListL(); - } + UpdateAttendeesListL(); + iRichTextViewer->ResetActionMenuL(); } } @@ -168,7 +164,7 @@ } else { - iObserver->RemoveControl( iFieldId ); + iObserver->HideControl( iFieldId ); } iDisableRedraw = ETrue; } @@ -181,8 +177,19 @@ TInt& aUpper, TInt& aLower) { FUNC_LOG; - aLower = iRichTextViewer->CurrentLineNumber() * iRichTextViewer->RowHeight() + iTitle->Size().iHeight; - aUpper = aLower - iRichTextViewer->RowHeight() - iTitle->Size().iHeight; + aLower = iRichTextViewer->CurrentLineNumber() * iRichTextViewer->RowHeight(); + aUpper = aLower - iRichTextViewer->RowHeight(); + } + +// ----------------------------------------------------------------------------- +// CESMRViewerAttendeesField::GetCursorLineVerticalPos +// ----------------------------------------------------------------------------- +// +void CESMRViewerAttendeesField::GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower) + { + FUNC_LOG; + aLower = iRichTextViewer->CurrentLineNumber() * iRichTextViewer->RowHeight(); + aUpper = aLower - iRichTextViewer->RowHeight(); } // ----------------------------------------------------------------------------- @@ -204,41 +211,75 @@ FUNC_LOG; // Store iRichTextViewer original width. TInt richTextViewerWidth = iRichTextViewer->Size().iWidth; - + // Get field's rect TRect rect( Rect() ); - + // First row for title TAknLayoutRect rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); TRect rowRect = rowLayoutRect.Rect(); - + // Layout title to first row's rect TAknTextComponentLayout titleLayout = - NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::GetTextComponentLayout( NMRLayoutManager::EMRTextLayoutText ); AknLayoutUtils::LayoutLabel( iTitle, rect, titleLayout ); - // Color should be overrided after layouting - // If this function leaves we'll have to use default color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iTitle, - EColorLabelText, - KRgbBlack )); - + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutText ); + + // Setting font for the label + iTitle->SetFont( labelLayout.Font() ); + // Move upper left corner below first line and get second row's rect. rect.iTl.iY += rowRect.Height(); rowLayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 ); rowRect = rowLayoutRect.Rect(); - + // Get default 1 row editor rect. TAknLayoutText viewerLayoutText = - NMRLayoutManager::GetLayoutText( rowRect, + NMRLayoutManager::GetLayoutText( rowRect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); TRect viewerRect = viewerLayoutText.TextRect(); // Resize resize it's height according to actual height required by edwin. viewerRect.Resize( 0, iExpandedSize.iHeight - viewerRect.Height() ); - iRichTextViewer->SetRect( viewerRect ); + + // Layouting focus + TRect bgRect( 0, 0, 0, 0 ); + if( iCalAttendees.Count() > 1 ) + { + bgRect.SetRect( + TPoint( viewerRect.iTl.iX, + viewerRect.iTl.iY - FocusMargin() ), + TPoint( viewerRect.iBr.iX, + viewerRect.iBr.iY + FocusMargin() ) ); + } + else + { + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rowRect, NMRLayoutManager::EMRLayoutTextEditorBg ); + bgRect = bgLayoutRect.Rect(); + } + + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); + + iRichTextViewer->SetRect( viewerRect ); + + // Failures are ignored. + TRAP_IGNORE( + iRichTextViewer->SetFontL( viewerLayoutText.Font() ); + if( iCalAttendees.Count() > 0 ) + { + iRichTextViewer->SetLineSpacingL( LineSpacing() ); + } + iRichTextViewer->ApplyLayoutChangesL(); + ); // Update AttendeesList only if iRichTextViewer width was changed. // This happens when screen orientation changes e.g. This check @@ -246,13 +287,19 @@ // it causes edwin size changed event. if ( iRichTextViewer->Size().iWidth != richTextViewerWidth ) { + // Most of this case is screen orientation, in this case we need to + // Record the index of focusing link, after updating link array, then + // reset the focusing to original one. + TInt focusingIndex = iRichTextViewer->GetFocusLink(); // Ignore leave, there's nothing we can do if leave occurs. TRAP_IGNORE( UpdateAttendeesListL() ); + if ( KErrNotFound != focusingIndex ) + { + iRichTextViewer->SetFocusLink( focusingIndex ); + } //wake up current contact menu selection by calling this iRichTextViewer->FocusChanged(ENoDrawNow); } - - DrawDeferred(); } // ----------------------------------------------------------------------------- @@ -272,7 +319,7 @@ if ( aEvent.iScanCode == EStdKeyUpArrow || aEvent.iScanCode == EStdKeyDownArrow ) { - const CESMRRichTextLink* link = + const CESMRRichTextLink* link = iRichTextViewer->GetSelectedLink ( ); if( link ) { @@ -297,11 +344,12 @@ // CESMRViewerAttendeesField::SetContainerWindowL() // --------------------------------------------------------------------------- // -void CESMRViewerAttendeesField::SetContainerWindowL( +void CESMRViewerAttendeesField::SetContainerWindowL( const CCoeControl& aContainer ) { CESMRField::SetContainerWindowL( aContainer ); iRichTextViewer->SetContainerWindowL( aContainer ); + iRichTextViewer->SetParent( this ); } // --------------------------------------------------------------------------- @@ -312,17 +360,18 @@ { // Parent rect will be list area later --> no need to calculate it manually. TRect parentRect = Parent()->Rect(); - TRect contentRect = NMRLayoutManager::GetLayoutRect( + // TODO: Remove this after new list area is completed. See previous comment. + TRect contentRect = NMRLayoutManager::GetLayoutRect( parentRect, NMRLayoutManager::EMRLayoutListArea ).Rect(); // We have two lines; title and richtextviewer. - TRect fieldRect = + TRect fieldRect = NMRLayoutManager::GetFieldLayoutRect( contentRect, 2 ).Rect(); // Get row size for second row (richtext viewer). - TRect rowRect = + TRect rowRect = NMRLayoutManager::GetFieldRowLayoutRect( fieldRect, 2 ).Rect(); // Get size for default 1 line editor. - TRect viewerRect = NMRLayoutManager::GetLayoutText( - rowRect, + TRect viewerRect = NMRLayoutManager::GetLayoutText( + rowRect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ).TextRect(); // Adjust field size so that there's room for expandable editor. fieldRect.Resize( 0, iExpandedSize.iHeight - viewerRect.Height() ); @@ -333,34 +382,43 @@ // CESMRViewerAttendeesField::ExecuteGenericCommandL() // --------------------------------------------------------------------------- // -void CESMRViewerAttendeesField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRViewerAttendeesField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; - switch ( aCommand ) + + TBool isUsed( EFalse ); + if (aCommand == EESMRCmdShowAllAttendees) + { + iShowAllAttendees = ETrue; + UpdateAttendeesListL(); + + RestoreMiddleSoftKeyL(); + //wake up current contact menu selection by calling this + iRichTextViewer->FocusChanged(ENoDrawNow); + + isUsed = ETrue; + } + if ( aCommand == EAknSoftkeySelect ) { - case EESMRCmdClipboardCopy: - { - iRichTextViewer->CopyCurrentLinkValueToClipBoardL(); - break; - } - case EESMRCmdShowAllAttendees: - { - iShowAllAttendees = ETrue; - UpdateAttendeesListL(); - - RestoreMiddleSoftKeyL(); - //wake up current contact menu selection by calling this - iRichTextViewer->FocusChanged(ENoDrawNow); - break; - } - case EAknSoftkeySelect: - { - iRichTextViewer->LinkSelectedL(); - break; - } - default: - // do nothing for now.. - break; + iRichTextViewer->LinkSelectedL(); + isUsed = ETrue; + } + + return isUsed; + } + +// ----------------------------------------------------------------------------- +// CESMRViewerAttendeesField::HandleLongtapEventL +// ----------------------------------------------------------------------------- +// +void CESMRViewerAttendeesField::HandleLongtapEventL( const TPoint& aPosition ) + { + FUNC_LOG; + + if ( iRichTextViewer->Rect().Contains( aPosition ) ) + { + iRichTextViewer->LinkSelectedL(); + HandleTactileFeedbackL(); } } @@ -388,12 +446,12 @@ const CESMRRichTextLink* aLink ) { FUNC_LOG; - if ( aLink->Type() == CESMRRichTextLink::ETypeShowAll ) + if (aLink->Type ( )== CESMRRichTextLink::ETypeShowAll ) { iShowAllAttendees = ETrue; TRAPD( err, UpdateAttendeesListL() ); - if ( err == KErrNone ) + if (err == KErrNone ) { return ETrue; } @@ -444,7 +502,6 @@ { FUNC_LOG; delete iTitle; - delete iRichTextViewer; iCalAttendees.Reset(); } @@ -457,25 +514,24 @@ iRole( aRole) { FUNC_LOG; - //do nothing + SetFocusType( EESMRHighlightFocus ); } // ----------------------------------------------------------------------------- // CESMRViewerAttendeesField::ClipTextLC // ----------------------------------------------------------------------------- // -HBufC* CESMRViewerAttendeesField::ClipTextLC( +HBufC* CESMRViewerAttendeesField::ClipTextLC( const TDesC& aText, const CFont& aFont, TInt aWidth ) { FUNC_LOG; HBufC* text = HBufC::NewLC( aText.Length() + KAknBidiExtraSpacePerLine ); TPtr textPtr = text->Des(); - AknBidiTextUtils::ConvertToVisualAndClip( + AknBidiTextUtils::ConvertToVisualAndClip( aText, textPtr, aFont, aWidth, aWidth ); return text; } - // ----------------------------------------------------------------------------- // CESMRViewerAttendeesField::UpdateAttendeesListL // ----------------------------------------------------------------------------- @@ -486,137 +542,195 @@ RBuf buffer; // codescanner::resourcenotoncleanupstack buffer.CleanupClosePushL(); - iRichTextViewer->SetMargins( KMargin ); - - TSize oldSize = Size(); + TAknLayoutText text = NMRLayoutManager::GetLayoutText( + Rect(), + NMRLayoutManager::EMRTextLayoutTextEditor ); + const CFont* font = text.Font(); + + // TODO: correct icon zise to correct one. Ask from UI specifier. + TSize iconSize( 20, 20); - TRect rect( Rect() ); - TAknLayoutText layoutText = - NMRLayoutManager::GetLayoutText( rect, - NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - TRect viewerRect = layoutText.TextRect(); - TInt maxLineWidth = viewerRect.Size().iWidth; - const CFont* font = layoutText.Font(); + TInt maxLineWidth = iRichTextViewer->LayoutWidth(); + maxLineWidth -= font->TextWidthInPixels( KAddressDelimeterSemiColon ); + maxLineWidth -= iconSize.iWidth; - if ( maxLineWidth > 0 ) // control size is set + RPointerArray attendeeLinks; // codescanner::resourcenotoncleanupstack + TCleanupItem arrayCleanup( RPointerArrayResetAndDestroy, &attendeeLinks ); + CleanupStack::PushL( arrayCleanup ); + attendeeLinks.ReserveL(iCalAttendees.Count()); + for ( TInt i = 0; i < iCalAttendees.Count(); ++i ) { - TInt linkCount = iCalAttendees.Count(); - TBool notAllShown(EFalse); - if ( !iShowAllAttendees ) - { - linkCount = Min(KMaxLineCount, iCalAttendees.Count() ); - notAllShown = ( linkCount != iCalAttendees.Count() ); - } - - RPointerArray attendeeLinks; // codescanner::resourcenotoncleanupstack - TCleanupItem arrayCleanup( RPointerArrayResetAndDestroy, &attendeeLinks ); - CleanupStack::PushL( arrayCleanup ); - attendeeLinks.ReserveL( linkCount ); - - for ( TInt i = 0; i < linkCount; ++i ) - { - CCalAttendee* attendee = iCalAttendees[i]; - - // Attendee email address. - TPtrC addr = attendee->Address(); - // Attendee common name. - TPtrC name = attendee->CommonName(); - // Actual text to be added to attendee field (email or common name). - TPtrC text = addr; + CCalAttendee* attendee = iCalAttendees[i]; + + // Attendee email address. + TPtrC addr = attendee->Address(); + // Attendee common name. + TPtrC name = attendee->CommonName(); + // Actual text to be added to attendee field (email or common name). + TPtrC text = addr; - // If attendee has common name, use it instead. - if ( name.Length() > 0 ) - { - text.Set( name ); - } - - if ( text.Length() > 0 ) - { - CESMRRichTextLink* link = CESMRRichTextLink::NewL( - buffer.Length(), - text.Length() + - KAddressDelimeterSemiColon().Length(), - addr, - CESMRRichTextLink::ETypeEmail, - CESMRRichTextLink::ETriggerKeyRight ); - CleanupStack::PushL( link ); - attendeeLinks.AppendL( link ); - CleanupStack::Pop( link ); - - // Append text and semicolon to buffer. - buffer.ReAllocL( buffer.Length() + - text.Length() + - KAddressDelimeterSemiColon().Length() + - KNewLine().Length() ); - buffer.Append( text ); - buffer.Append( KAddressDelimeterSemiColon ); - buffer.Append( KNewLine ); - } + // If attendee has common name, use it instead. + if ( name.Length() > 0 ) + { + text.Set( name ); } - - // If there are more lines in use than KMaxLineCount and - // we don't want to show all attendees, leave only - // KMaxLineCount-1 attendees and add 'show all' - // link to the end. - if ( notAllShown ) + + HBufC* clippedTextHBufC = ClipTextLC( text, *font, maxLineWidth ); + TPtr clippedText = clippedTextHBufC->Des(); + clippedText.Trim(); + + if ( clippedText.Length() > 0 ) { - // Create and append 'show all' link. - CESMRRichTextLink* showAllLink; - HBufC* showAllBuf = StringLoader::LoadLC( R_QTN_MEET_REQ_SHOW_ALL ); - buffer.ReAllocL( buffer.Length() + - showAllBuf->Length() ); - showAllLink = CESMRRichTextLink::NewL( buffer.Length ( ), - showAllBuf->Length(), KNullDesC, - CESMRRichTextLink::ETypeShowAll, - CESMRRichTextLink::ETriggerKeyOk ); - buffer.Append( *showAllBuf ); - CleanupStack::PopAndDestroy( showAllBuf ); - CleanupStack::PushL( showAllLink ); - attendeeLinks.AppendL( showAllLink ); - CleanupStack::Pop( showAllLink ); - } - - // Remove unnecessary new line from the end of buffer. - else if ( buffer.Length() >= KNewLine().Length() ) - { - buffer.SetLength( buffer.Length() - KNewLine().Length() ); + CESMRRichTextLink* link = CESMRRichTextLink::NewL( + buffer.Length(), + clippedText.Length() + + KAddressDelimeterSemiColon().Length(), + addr, + CESMRRichTextLink::ETypeEmail, + CESMRRichTextLink::ETriggerKeyRight ); + CleanupStack::PushL( link ); + attendeeLinks.AppendL( link ); + CleanupStack::Pop( link ); + + // Append text and semicolon to buffer. + buffer.ReAllocL( buffer.Length() + + clippedText.Length() + + KAddressDelimeterSemiColon().Length() + + KNewLine().Length() ); + buffer.Append( clippedText ); + buffer.Append( KAddressDelimeterSemiColon ); + buffer.Append( KNewLine ); } - if ( buffer.Length() > 0 ) + CleanupStack::PopAndDestroy( clippedTextHBufC ); + + // End loop if we have exceeded KMaxLineCount and + // we don't want to show all attendees + if ( attendeeLinks.Count() > KMaxLineCount && !iShowAllAttendees ) { - iRichTextViewer->SetTextL( &buffer ); + break; + } + } - // Add all links to iRichTextViewer. - while ( attendeeLinks.Count() > 0 ) - { - CESMRRichTextLink* link = attendeeLinks[0]; - CleanupStack::PushL( link ); - attendeeLinks.Remove( 0 ); - iRichTextViewer->AddLinkL( link ); - CleanupStack::Pop( link ); - } + // If there are more lines in use than KMaxLineCount and + // we don't want to show all attendees, leave only + // KMaxLineCount-1 attendees and add 'show all' + // link to the end. + if ( attendeeLinks.Count() > KMaxLineCount && !iShowAllAttendees ) + { + // Remove unnecessary part of buffer. + buffer.SetLength( attendeeLinks[KMaxLineCount - 1]->StartPos() ); + + // Remove links from the list. + while ( attendeeLinks.Count() >= KMaxLineCount ) + { + delete attendeeLinks[KMaxLineCount - 1]; + attendeeLinks.Remove( KMaxLineCount - 1 ); } - CleanupStack::PopAndDestroy( &attendeeLinks ); - - TSize newSize = Size(); - if (oldSize != newSize) + // Create and append 'show all' link. + CESMRRichTextLink* showAllLink; + HBufC* showAllBuf = StringLoader::LoadLC( R_QTN_MEET_REQ_SHOW_ALL ); + buffer.ReAllocL( buffer.Length() + + showAllBuf->Length() ); + showAllLink = CESMRRichTextLink::NewL( buffer.Length ( ), + showAllBuf->Length(), KNullDesC, + CESMRRichTextLink::ETypeShowAll, + CESMRRichTextLink::ETriggerKeyOk ); + buffer.Append( *showAllBuf ); + CleanupStack::PopAndDestroy( showAllBuf ); + CleanupStack::PushL( showAllLink ); + attendeeLinks.AppendL( showAllLink ); + CleanupStack::Pop( showAllLink ); + } + // Remove unnecessary new line from the end of buffer. + else if ( buffer.Length() >= KNewLine().Length() ) + { + buffer.SetLength( buffer.Length() - KNewLine().Length() ); + } + + if ( buffer.Length() > 0 ) + { + iRichTextViewer->SetTextL( &buffer ); + iRichTextViewer->SetMargins( KMargin ); + + // Add all links to iRichTextViewer. + while ( attendeeLinks.Count() > 0 ) { - CMRListPane* parent = static_cast(Parent()); - parent->SizeChanged(); + CESMRRichTextLink* link = attendeeLinks[0]; + CleanupStack::PushL( link ); + attendeeLinks.Remove( 0 ); + iRichTextViewer->AddLinkL( link ); + CleanupStack::Pop( link ); } } + SizeChanged(); + CleanupStack::PopAndDestroy( &attendeeLinks ); CleanupStack::PopAndDestroy( &buffer ); } - -// ----------------------------------------------------------------------------- -// CESMRViewerAttendeesField::HandlePointerEventL -// ----------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// CESMRViewerAttendeesField::LineSpacing +// --------------------------------------------------------------------------- // -void CESMRViewerAttendeesField::HandlePointerEventL(const TPointerEvent& aPointerEvent) +TInt CESMRViewerAttendeesField::LineSpacing() { - CCoeControl::HandlePointerEventL(aPointerEvent); + FUNC_LOG; + // Calculates the line spacing based on default one line layout data + TInt lineSpacing( 0 ); + + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect defaultTextRect = labelLayout.TextRect(); + + TInt difference = rowRect.Height() - defaultTextRect.Height(); + + lineSpacing = difference * 2; + + return lineSpacing; } + +// --------------------------------------------------------------------------- +// CESMRViewerAttendeesField::FocusMargin +// --------------------------------------------------------------------------- +// +TInt CESMRViewerAttendeesField::FocusMargin() + { + FUNC_LOG; + // Calculates focus margin based on default one line layout data + TInt focusMagin( 0 ); + + TRect rect( Rect() ); + + TAknLayoutRect rowLayoutRect = + NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); + TRect rowRect = rowLayoutRect.Rect(); + + TAknLayoutText labelLayout = + NMRLayoutManager::GetLayoutText( + rect, NMRLayoutManager::EMRTextLayoutTextEditor ); + + TRect defaultTextRect = labelLayout.TextRect(); + + TAknLayoutRect bgLayoutRect = + NMRLayoutManager::GetLayoutRect( + rect, NMRLayoutManager::EMRLayoutTextEditorBg ); + TRect defaultBgRect( bgLayoutRect.Rect() ); + + TInt difference = defaultBgRect.Height() - defaultTextRect.Height(); + + focusMagin = TReal( difference / 2 ); + + return focusMagin; + } + // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerfromfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerfromfield.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerfromfield.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,29 +20,20 @@ #include "cesmrrichtextlink.h" #include "mesmrlistobserver.h" #include "esmrfieldbuilderdef.h" -#include "cesmrlayoutmgr.h" #include "nmrlayoutmanager.h" #include "cmrlabel.h" #include #include -#include +#include #include #include -#include +#include #include // DEBUG #include "emailtrace.h" -/// Unnamed namespace for local definitions -namespace { // codescanner::namespace - -const TInt KMargin = 5; - -} // namespace - -using namespace ESMRLayout; // ======== MEMBER FUNCTIONS ======== @@ -68,7 +59,6 @@ { FUNC_LOG; delete iFieldTopic; - delete iRichTextViewer; } // --------------------------------------------------------------------------- @@ -78,13 +68,16 @@ void CESMRViewerFromField::InitializeL() { FUNC_LOG; - TAknLayoutText editorRect = - NMRLayoutManager::GetLayoutText( + TAknLayoutText editorRect = + NMRLayoutManager::GetLayoutText( Rect(), NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - iRichTextViewer->SetFontL( editorRect.Font(), iLayout ); - const CFont* topicFont = + iRichTextViewer->SetFontL( editorRect.Font() ); + iRichTextViewer->ApplyLayoutChangesL(); + + const CFont* topicFont = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont, NULL ); iFieldTopic->SetFont( topicFont ); + iRichTextViewer->SetEventQueue( iEventQueue ); } // --------------------------------------------------------------------------- @@ -103,7 +96,6 @@ text.Set (organizer->Address() ); } iRichTextViewer->SetTextL( &text ); - iRichTextViewer->SetMargins( KMargin ); TPtrC address = organizer->Address(); if ( address.Length() > 0 ) @@ -117,14 +109,13 @@ } // Set the topic text - HBufC* stringholder = + HBufC* stringholder = StringLoader::LoadLC( R_QTN_MEET_REQ_LABEL_FROM, iEikonEnv ); iFieldTopic->SetTextL( *stringholder ); CleanupStack::PopAndDestroy( stringholder ); //wake up current contact menu selection by calling this iRichTextViewer->FocusChanged( ENoDrawNow ); - SizeChanged( ); } iDisableRedraw = ETrue; } @@ -137,21 +128,15 @@ { FUNC_LOG; TRect rect( Rect() ); - + TAknLayoutRect row1LayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); rect = row1LayoutRect.Rect(); - + TAknTextComponentLayout labelLayout = - NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::GetTextComponentLayout( NMRLayoutManager::EMRTextLayoutText ); AknLayoutUtils::LayoutLabel( iFieldTopic, rect, labelLayout ); - // Color should be overrided after layouting - // If this function leaves we'll have to use default color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iFieldTopic, - EColorLabelText, - KRgbBlack )); rect = Rect(); TAknLayoutRect row2LayoutRect = @@ -162,17 +147,29 @@ TInt moveHeight = row1LayoutRect.Rect().Height(); rect.Move( 0, moveHeight ); - TAknLayoutText editorRect = - NMRLayoutManager::GetLayoutText( + TAknLayoutText editorRect = + NMRLayoutManager::GetLayoutText( rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); - // Count the rect for the richtextviewer. It will be placed into the - // top left corner of the editorRect and size is calculated from + // Count the rect for the richtextviewer. It will be placed into the + // top left corner of the editorRect and size is calculated from // viewer's real size iExpandedSize and editorRect's width. - TPoint tlPoint( + TPoint tlPoint( editorRect.TextRect().iTl.iX, editorRect.TextRect().iTl.iY ); TSize prefSize( editorRect.TextRect().Width(), iExpandedSize.iHeight ); TRect viewerRect( tlPoint, prefSize ); + // Failures are ignored. + TRAP_IGNORE( + // Try setting font + iRichTextViewer->SetFontL( editorRect.Font() ); + // Try applying changes + iRichTextViewer->ApplyLayoutChangesL(); + ); iRichTextViewer->SetRect( viewerRect ); + + TRect bgRect( viewerRect ); + // Move focus rect so that it's relative to field's position. + bgRect.Move( -Position() ); + SetFocusRect( bgRect ); } // --------------------------------------------------------------------------- @@ -180,23 +177,23 @@ // --------------------------------------------------------------------------- // TSize CESMRViewerFromField::MinimumSize() - { + { // Minimum size -> Height: TitleRow + Editor size + Margin - // Width: Parent's Width - // (so the content pane that holds all the fields) + // Width: Parent's Width + // (so the content pane that holds all the fields) TRect rect = Rect(); TAknLayoutRect row1LayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ); TInt titleHeight = row1LayoutRect.Rect().Height(); // Add title field height TInt totalHeight = titleHeight; - + TAknLayoutRect row2LayoutRect = NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 ); TInt editorRowHeight = row2LayoutRect.Rect().Height(); - + TAknTextComponentLayout editorLayout = - NMRLayoutManager::GetTextComponentLayout( + NMRLayoutManager::GetTextComponentLayout( NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); // Editor height from Layout data TInt editorHeight = editorLayout.H(); @@ -227,7 +224,7 @@ { count++; } - + return count; } @@ -283,7 +280,7 @@ CESMRViewerFromField::CESMRViewerFromField( ) { FUNC_LOG; - //do nothing + SetFocusType( EESMRHighlightFocus ); } // --------------------------------------------------------------------------- @@ -299,28 +296,34 @@ iFieldTopic->SetTextL( KNullDesC() ); iRichTextViewer = CESMRRichTextViewer::NewL ( this ); + CESMRField::ConstructL( iRichTextViewer ); // ownership transferred iRichTextViewer->SetEdwinSizeObserver ( this ); + iRichTextViewer->SetParent( this ); } // --------------------------------------------------------------------------- // CESMRViewerFromField::ExecuteGenericCommandL() // --------------------------------------------------------------------------- // -void CESMRViewerFromField::ExecuteGenericCommandL( TInt aCommand ) +TBool CESMRViewerFromField::ExecuteGenericCommandL( TInt aCommand ) { FUNC_LOG; + TBool isUsed( EFalse ); if (aCommand == EESMRCmdClipboardCopy) { - iRichTextViewer->CopyCurrentLinkValueToClipBoardL(); + iRichTextViewer->CopyCurrentLinkToClipBoardL(); + isUsed = ETrue; } if ( aCommand == EAknSoftkeySelect ) { iRichTextViewer->LinkSelectedL(); + isUsed = ETrue; } + return isUsed; } // --------------------------------------------------------------------------- -// CESMRViewerFromField::ExecuteGenericCommandL() +// CESMRViewerFromField::SetOutlineFocusL // --------------------------------------------------------------------------- // void CESMRViewerFromField::SetOutlineFocusL( TBool aFocus ) @@ -330,17 +333,31 @@ if ( iRichTextViewer ) { iRichTextViewer->SetFocus( aFocus ); + } + if ( aFocus ) + { + SetMiddleSoftKeyVisible( ETrue ); + } + else if( iRichTextViewer ) + { + //need to tell action menu that focus has changed + iRichTextViewer->ResetActionMenuL(); + } + } + +// --------------------------------------------------------------------------- +// CESMRViewerFromField::HandleLongtapEventL +// --------------------------------------------------------------------------- +// +void CESMRViewerFromField::HandleLongtapEventL( const TPoint& aPosition ) + { + FUNC_LOG; - if ( aFocus ) - { - SetMiddleSoftKeyVisible( ETrue ); - } - else - { - //need to tell action menu that focus has changed - iRichTextViewer->ResetActionMenuL(); - } - } + if ( iRichTextViewer->Rect().Contains( aPosition ) ) + { + iRichTextViewer->LinkSelectedL(); + HandleTactileFeedbackL(); + } } // --------------------------------------------------------------------------- @@ -354,20 +371,9 @@ if ( iRichTextViewer ) { iRichTextViewer->SetContainerWindowL( aContainer ); + iRichTextViewer->SetParent( this ); } } -// ----------------------------------------------------------------------------- -// CESMRViewerFromField::HandlePointerEventL -// ----------------------------------------------------------------------------- -// -void CESMRViewerFromField::HandlePointerEventL(const TPointerEvent& aPointerEvent) - { - CCoeControl::HandlePointerEventL(aPointerEvent); - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - iRichTextViewer->SetFocus( ETrue ); - } - } //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/resmrpluginextensionstatic.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/resmrpluginextensionstatic.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/resmrpluginextensionstatic.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,6 +18,10 @@ #include "emailtrace.h" #include "resmrpluginextensionstatic.h" #include "cmrmailboxutils.h" +#include "esmrhelper.h" +#include + +// Removed profiling. /** * Storage class for RESMRStatic. @@ -39,21 +43,6 @@ // Definition for equal string const TInt KEqualString(0); -// --------------------------------------------------------------------------- -// Cleanup operation for RPointerArray. -// @param aArray Pointer to RPointerArray. -// --------------------------------------------------------------------------- -// -void MailboxPointerArrayCleanup( TAny* aArray ) - { - // just to avoid warnings when MR not supported - RPointerArray* entryArray = - static_cast*>( aArray ); - - entryArray->ResetAndDestroy(); - entryArray->Close(); - } - }//namespace // --------------------------------------------------------------------------- @@ -83,7 +72,7 @@ void RESMRPluginExtensionStatic::ConnectL( ) { FUNC_LOG; - if ( iStaticData ) + if (iStaticData ) { return; } @@ -93,7 +82,7 @@ // If Tls pointer was not set, create new static stuct // with NULL values - if ( !iStaticData ) + if (!iStaticData) { iStaticData = new (ELeave) TESMRPluginExtensionData(); memset ( iStaticData, 0, sizeof( TESMRPluginExtensionData) ); @@ -109,17 +98,17 @@ void RESMRPluginExtensionStatic::Close( ) { FUNC_LOG; - if ( iStaticData ) + if (iStaticData ) { // If FSMailClientL or DefaultFSMailBox was used - if ( iUsedTypes & KMailBox ) + if (iUsedTypes & KMailBox ) { // Decrease counter --iStaticData->iFSMailBoxCount; // If this was last instance using pointer - if ( iStaticData->iFSMailBoxCount == 0 ) + if (iStaticData->iFSMailBoxCount == 0 ) { // Owned by CFSMailClient delete iStaticData->iDefaultFSMailBox; @@ -163,16 +152,9 @@ // RESMRPluginExtensionStatic::DefaultFSMailBoxL // --------------------------------------------------------------------------- // -CFSMailBox& RESMRPluginExtensionStatic::DefaultFSMailBoxL( TBool aForceReset ) +CFSMailBox& RESMRPluginExtensionStatic::DefaultFSMailBoxL() { FUNC_LOG; - - if ( aForceReset && iStaticData->iDefaultFSMailBox ) - { - delete iStaticData->iDefaultFSMailBox; - iStaticData->iDefaultFSMailBox = NULL; - } - if ( !iStaticData->iDefaultFSMailBox ) { CFSMailClient& fsMailClient = FSMailClientL(); @@ -186,12 +168,9 @@ mbUtils->GetDefaultMRMailBoxL( mbInfo ) ); // Loop throug all mailboxes in this plug-in - RPointerArray mailboxes; // codescanner::resourcenotoncleanupstack - CleanupStack::PushL( - TCleanupItem( - MailboxPointerArrayCleanup, - &mailboxes ) ); - + RCPointerArray mailboxes; + CleanupClosePushL( mailboxes ); + // With null uid we get all mailboxes TFSMailMsgId msgId; fsMailClient.ListMailBoxes( @@ -212,8 +191,7 @@ } } - CleanupStack::PopAndDestroy(); // mailboxes - CleanupStack::PopAndDestroy( mbUtils ); + CleanupStack::PopAndDestroy( 2, mbUtils ); // mailboxes mbUtils = NULL; if ( !iStaticData->iDefaultFSMailBox ) @@ -228,6 +206,48 @@ } // --------------------------------------------------------------------------- +// RESMRPluginExtensionStatic::MailBoxL +// --------------------------------------------------------------------------- +// +CFSMailBox* RESMRPluginExtensionStatic::MailBoxL( const TDesC& aEmailAddress ) + { + TPtrC address( ESMRHelper::AddressWithoutMailtoPrefix( aEmailAddress ) ); + CFSMailClient& fsMailClient = FSMailClientL(); + + // Loop throug all mailboxes in this plug-in + RCPointerArray mailboxes; + CleanupClosePushL( mailboxes ); + + // With null uid we get all mailboxes + TFSMailMsgId msgId; + fsMailClient.ListMailBoxes( + msgId, mailboxes ); + + TInt mailboxCount( mailboxes.Count() ); + CFSMailBox* mailBox = NULL; + + for ( TInt i(0); i < mailboxCount && !mailBox; ++i ) + { + TPtrC mailboxOwnerAddName( + mailboxes[i]->OwnMailAddress().GetEmailAddress() ); + if ( mailboxOwnerAddName.CompareF( address ) == 0 ) + { + // Correct mailbox is found + mailBox = mailboxes[ i ]; + mailboxes.Remove( i ); + } + } + CleanupStack::PopAndDestroy( &mailboxes ); + + if ( !mailBox ) + { + User::Leave( KErrNotFound ); + } + + return mailBox; + } + +// --------------------------------------------------------------------------- // RESMRPluginExtensionStatic::FSMailClientL // --------------------------------------------------------------------------- // diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/group/bld.inf --- a/meetingrequest/mrgui/mrfieldevent/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/group/esmrfieldevent.mmp --- a/meetingrequest/mrgui/mrfieldevent/group/esmrfieldevent.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/group/esmrfieldevent.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,8 +16,8 @@ */ #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../../inc/esmrinternaluid.h" #include "../../../../inc/emailtraceconfig.hrh" -#include "../../../inc/esmrinternaluid.h" #include #include @@ -28,9 +28,6 @@ CAPABILITY CAP_GENERAL_DLL -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - // Includes APP_LAYER_SYSTEMINCLUDE @@ -46,10 +43,10 @@ // Dependencies to Symbian OS & S60 components LIBRARY euser.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib LIBRARY cmaillogger.lib - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/inc/cesmrfieldcommandevent.h --- a/meetingrequest/mrgui/mrfieldevent/inc/cesmrfieldcommandevent.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/inc/cesmrfieldcommandevent.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/inc/cesmrgenericfieldevent.h --- a/meetingrequest/mrgui/mrfieldevent/inc/cesmrgenericfieldevent.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/inc/cesmrgenericfieldevent.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/inc/mesmrfieldevent.h --- a/meetingrequest/mrgui/mrfieldevent/inc/mesmrfieldevent.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/inc/mesmrfieldevent.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/inc/mesmrfieldeventnotifier.h --- a/meetingrequest/mrgui/mrfieldevent/inc/mesmrfieldeventnotifier.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/inc/mesmrfieldeventnotifier.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/src/cesmrfieldcommandevent.cpp --- a/meetingrequest/mrgui/mrfieldevent/src/cesmrfieldcommandevent.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/src/cesmrfieldcommandevent.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrfieldevent/src/cesmrgenericfieldevent.cpp --- a/meetingrequest/mrgui/mrfieldevent/src/cesmrgenericfieldevent.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldevent/src/cesmrgenericfieldevent.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrlocationplugin/data/esmrlocationplugin.rss --- a/meetingrequest/mrgui/mrlocationplugin/data/esmrlocationplugin.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrlocationplugin/data/esmrlocationplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrlocationplugin/group/bld.inf --- a/meetingrequest/mrgui/mrlocationplugin/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrlocationplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrlocationplugin/group/esmrlocationplugin.mmp --- a/meetingrequest/mrgui/mrlocationplugin/group/esmrlocationplugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrlocationplugin/group/esmrlocationplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,11 +16,10 @@ */ -#include +#include "../../../inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" #include -#include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../../inc/emailtraceconfig.hrh" -#include "../../../inc/esmrinternaluid.h" +#include TARGET esmrlocationplugin.dll TARGETTYPE PLUGIN @@ -29,9 +28,6 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrlocationpluginimpl.cpp SOURCE esmrlocationpluginentrypoint.cpp @@ -54,12 +50,14 @@ LIBRARY eposlandmarks.lib LIBRARY lbs.lib LIBRARY cone.lib -LIBRARY commonengine.lib +LIBRARY commonengine.lib LIBRARY bafl.lib LIBRARY avkon.lib LIBRARY apparc.lib -LIBRARY cmaillogger.lib +LIBRARY calinterimapi.lib -#ifdef TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrlocationplugin/inc/cesmrlocationpluginimpl.h --- a/meetingrequest/mrgui/mrlocationplugin/inc/cesmrlocationpluginimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrlocationplugin/inc/cesmrlocationpluginimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,7 +22,7 @@ #include // -#include "AknServerApp.h" +#include "aknserverapp.h" // #include "cesmrlocationplugin.h" @@ -45,57 +45,68 @@ * * @param aObserver extension for the API */ - static CESMRLocationPluginImpl* NewL(); - - /** + static CESMRLocationPluginImpl* NewL(); + + /** * C++ Destructor. */ virtual ~CESMRLocationPluginImpl(); public:// from base CESMRLocationPlugin ecom interface void SetObserver ( MESMRLocationPluginObserver* aObserver ); - + public:// from base class MESMRLocationPlugin - void SelectFromMapL( const TDesC& aSearchQuery, const TDesC& aLocationUrl ); + void SelectFromMapL( + const TDesC& aSearchQuery, + const TDesC& aLocationUrl ); + void SelectFromMapL( + const TDesC& aSearchQuery, + const CCalGeoValue* aGeoValue ); void SearchFromMapL( const TDesC& aSearchQuery ); - void ShowOnMapL( const TDesC& aLocation, const TDesC& aLocationUrl ); + void ShowOnMapL( const TDesC& aLocationUrl ); + void ShowOnMapL( const CCalGeoValue& aGeoValue ); protected: // from base class CActive - void DoCancel(); - void RunL(); - TInt RunError( TInt aError ); - + void DoCancel(); + void RunL(); + TInt RunError( TInt aError ); + protected:// from base class MAknServerAppExitObserver void HandleServerAppExit( TInt aReason ); - + private: - CESMRLocationPluginImpl(); + CESMRLocationPluginImpl(); void ConstructL(); void CreateMapViewL(); void HandleSelectFromMapCompletedL(); + void SelectFromMapL( + const TDesC& aSearchQuery, + CPosLandmark* aLandmark ); + void ShowLandmarkL( CPosLandmark* aLandmark ); + CESMRUrlParserPlugin& UrlParserL(); private: // data - MESMRLocationPluginObserver* iObserver; - + MESMRLocationPluginObserver* iObserver; + /** * Map provider. * Own. */ - CMnProvider* iProvider; + CMnProvider* iProvider; /** * Map view. * Own. */ CMnMapView* iMapView; - + /** * UrlparserPlugin * Own. */ CESMRUrlParserPlugin* iUrlParser; - + /** * RPointerArray for landmarks to perform for example search from maps * with search string functionality diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrlocationplugin/src/cesmrlocationpluginimpl.cpp --- a/meetingrequest/mrgui/mrlocationplugin/src/cesmrlocationpluginimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrlocationplugin/src/cesmrlocationpluginimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,21 +16,50 @@ */ -#include "emailtrace.h" +#include "cesmrlocationpluginimpl.h" +#include "mesmrlocationpluginobserver.h" +#include "cesmrurlparserplugin.h" + #include #include -// -#include "mnmapview.h" -#include -#include +#include +#include +#include #include -#include "cesmrurlparserplugin.h" -// #include +#include + +#include "emailtrace.h" + +// ======== LOCAL FUNCTIONS ======== -#include "cesmrlocationpluginimpl.h" -#include "mesmrlocationpluginobserver.h" +namespace + { +/** + * Converts vCal GEO value to landmark with coordinates + * + * @param aGeoValue coordinates + * @return a landmark with coordinates + */ +CPosLandmark* CreateLandmarkL( const CCalGeoValue& aGeoValue ) + { + TReal lat; + TReal lon; + if( !aGeoValue.GetLatLong( lat, lon ) ) + { + User::Leave( KErrArgument ); + } + + CPosLandmark* landmark = CPosLandmark::NewLC(); + TLocality coordinate; + coordinate.SetCoordinate( lat, lon ); + landmark->SetPositionL( coordinate ); + CleanupStack::Pop( landmark ); + return landmark; + } + + } // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -38,7 +67,7 @@ // --------------------------------------------------------------------------- // CESMRLocationPluginImpl::CESMRLocationPluginImpl() - : CESMRLocationPlugin( CActive::EPriorityStandard ) + : CESMRLocationPlugin( CActive::EPriorityStandard ) { FUNC_LOG; } @@ -54,23 +83,20 @@ RCPointerArray providers; CleanupClosePushL( providers ); MnProviderFinder::FindProvidersL( providers, - CMnProvider::EServiceMapView - | CMnProvider::EServiceNavigation - | CMnProvider::EServiceGeocoding ); + CMnProvider::EServiceMapView + | CMnProvider::EServiceNavigation ); if ( providers.Count() == 0 ) - { - User::Leave( KErrNotSupported ); - } + { + User::Leave( KErrNotSupported ); + } iProvider = providers[ 0 ]; - providers.Remove( 0 ); + providers.Remove( 0 ); // PopAndDestroy provides from cleanupstack CleanupStack::PopAndDestroy( &providers ); - + // Create Map & Navigation view CreateMapViewL(); - - iUrlParser = CESMRUrlParserPlugin::NewL(); - + CActiveScheduler::Add( this ); } @@ -113,7 +139,7 @@ } delete iProvider; delete iUrlParser; - + iLandMarks.ResetAndDestroy(); } @@ -137,66 +163,38 @@ // --------------------------------------------------------------------------- // void CESMRLocationPluginImpl::SelectFromMapL( const TDesC& aSearchQuery, - const TDesC& aLocationUrl ) - { + const TDesC& aLocationUrl ) + { FUNC_LOG; - iLandMarks.ResetAndDestroy(); - - if ( IsActive() ) - { - User::Leave( KErrInUse ); - } - - CreateMapViewL(); - - iMapView->ResetMapArea(); - - // Create landmark from location URL. TRAP errors because URL is optional. - CPosLandmark* location = NULL; - TRAP_IGNORE( location = //codescanner::forgottoputptroncleanupstack - iUrlParser->CreateLandmarkFromUrlL( aLocationUrl ) ) - - if ( location ) // Landmark created. Set search string as landmark name - { - if ( aSearchQuery.Length() > 0 ) - { - CleanupStack::PushL( location ); - - location->SetLandmarkNameL( aSearchQuery ); - - iLandMarks.AppendL( location ); - CleanupStack::Pop( location ); - - iMapView->ResetLandmarksToShow(); - iMapView->AddLandmarksToShowL( iLandMarks ); - } - } - else + + // Create landmark from location URL. TRAP errors because URL is optional. + CPosLandmark* location = NULL; + TRAP_IGNORE( location = //codescanner::forgottoputptroncleanupstack + UrlParserL().CreateLandmarkFromUrlL( aLocationUrl ) ) + + SelectFromMapL( aSearchQuery, location ); + } + +// --------------------------------------------------------------------------- +// CESMRLocationPluginImpl::SelectFromMapL +// From class MESMRLocationPlugin. +// --------------------------------------------------------------------------- +// +void CESMRLocationPluginImpl::SelectFromMapL( + const TDesC& aSearchQuery, + const CCalGeoValue* aGeoValue ) + { + FUNC_LOG; + + CPosLandmark* location = NULL; + + if ( aGeoValue ) { - // No location url provided, let's search from maps - // with search string. It was agreed that search is done by - // passing a landmark with search string as the name of the landmark - // forward - if ( aSearchQuery.Length() > 0 ) - { - location = CPosLandmark::NewLC(); - location->SetLandmarkNameL( aSearchQuery ); + location = CreateLandmarkL( *aGeoValue ); + } - iLandMarks.AppendL( location ); - CleanupStack::Pop( location ); - - iMapView->ResetLandmarksToShow(); - iMapView->AddLandmarksToShowL( iLandMarks ); - } - - // Enable current location focus on map - iMapView-> - SetCurrentLocationOption( CMnMapView::ECurrentLocationEnabled ); - } - - SetActive(); - iMapView->SelectFromMapL( iStatus ); - } + SelectFromMapL( aSearchQuery, location ); + } // --------------------------------------------------------------------------- // CESMRLocationPluginImpl::SearchFromMapL @@ -207,13 +205,13 @@ { FUNC_LOG; iLandMarks.ResetAndDestroy(); - + CPosLandmark* location = CPosLandmark::NewLC(); location->SetLandmarkNameL( aSearchQuery ); iLandMarks.AppendL( location ); CleanupStack::Pop( location ); - + iMapView->ResetLandmarksToShow(); iMapView->AddLandmarksToShowL( iLandMarks ); iMapView->ShowMapL(); @@ -224,23 +222,27 @@ // From class MESMRLocationPlugin. // --------------------------------------------------------------------------- // -void CESMRLocationPluginImpl::ShowOnMapL( const TDesC& aLocation, const TDesC& aLocationUrl ) - { +void CESMRLocationPluginImpl::ShowOnMapL( const TDesC& aLocationUrl ) + { FUNC_LOG; - CreateMapViewL(); + + CPosLandmark* landmark = + UrlParserL().CreateLandmarkFromUrlL( aLocationUrl ); + ShowLandmarkL( landmark ); + } - iMapView->ResetLandmarksToShow(); - RCPointerArray landmarks; - CleanupClosePushL( landmarks ); - CPosLandmark* landmark = iUrlParser->CreateLandmarkFromUrlL( aLocationUrl ); - landmark->SetLandmarkNameL(aLocation); - CleanupStack::PushL( landmark ); - landmarks.AppendL( landmark ); - CleanupStack::Pop( landmark ); - iMapView->AddLandmarksToShowL( landmarks ); - CleanupStack::PopAndDestroy( &landmarks ); - iMapView->ShowMapL(); - } +// --------------------------------------------------------------------------- +// CESMRLocationPluginImpl::ShowOnMapL +// From class MESMRLocationPlugin. +// --------------------------------------------------------------------------- +// +void CESMRLocationPluginImpl::ShowOnMapL( const CCalGeoValue& aGeoValue ) + { + FUNC_LOG; + + CPosLandmark* landmark = CreateLandmarkL( aGeoValue ); + ShowLandmarkL( landmark ); + } // --------------------------------------------------------------------------- // CESMRLocationPluginImpl::DoCancel @@ -252,9 +254,9 @@ { FUNC_LOG; if( iMapView ) - { - iMapView->Cancel(); - } + { + iMapView->Cancel(); + } } // --------------------------------------------------------------------------- @@ -268,7 +270,7 @@ FUNC_LOG; HandleSelectFromMapCompletedL(); } - + // --------------------------------------------------------------------------- // CESMRLocationPluginImpl::HandleSelectFromMapCompletedL // --------------------------------------------------------------------------- @@ -280,7 +282,7 @@ { CMnMapView::TSelectionResultType type; type = iMapView->SelectionResultType(); - + if ( iObserver ) { switch ( type ) @@ -288,9 +290,9 @@ case CMnMapView::ESelectionFreeLandmark: { // Read selection from map view, send result to observer - CPosLandmark* landmark = + CPosLandmark* landmark = iMapView->RetrieveSelectionResultL(); - iObserver->SelectFromMapCompleted( iStatus.Int(), + iObserver->SelectFromMapCompleted( iStatus.Int(), landmark ); break; } @@ -298,11 +300,11 @@ { TInt landmarkIndex = 0; iMapView->RetrieveSelectionResultL( landmarkIndex ); - + if ( landmarkIndex < iLandMarks.Count() ) { - iObserver->SelectFromMapCompleted( - iStatus.Int(), + iObserver->SelectFromMapCompleted( + iStatus.Int(), iLandMarks[landmarkIndex] ); iLandMarks.Remove( landmarkIndex ); } @@ -326,9 +328,9 @@ iObserver->SelectFromMapCompleted( iStatus.Int(), NULL ); } - // Close Map view + // Close Map view delete iMapView; - iMapView = NULL; + iMapView = NULL; } // --------------------------------------------------------------------------- @@ -337,20 +339,20 @@ // --------------------------------------------------------------------------- // TInt CESMRLocationPluginImpl::RunError( TInt aError ) - { + { FUNC_LOG; - // Notify error to observer - if(iObserver) - { - iObserver->SelectFromMapCompleted( aError, NULL ); - } - - // Close Map view - delete iMapView; - iMapView = NULL; - - return KErrNone; - } + // Notify error to observer + if(iObserver) + { + iObserver->SelectFromMapCompleted( aError, NULL ); + } + + // Close Map view + delete iMapView; + iMapView = NULL; + + return KErrNone; + } // --------------------------------------------------------------------------- // CESMRLocationPluginImpl::HandleServerAppExit @@ -361,14 +363,111 @@ { FUNC_LOG; Cancel(); - + if ( iObserver ) { // Notify observer that application has been closed without selection. iObserver->SelectFromMapCompleted( aReason, NULL ); } - + delete iMapView; iMapView = NULL; } +// --------------------------------------------------------------------------- +// CESMRLocationPluginImpl::ShowLandmarkL +// --------------------------------------------------------------------------- +// +void CESMRLocationPluginImpl::SelectFromMapL( + const TDesC& aSearchQuery, + CPosLandmark* aLandmark ) + { + iLandMarks.ResetAndDestroy(); + + if ( IsActive() ) + { + User::Leave( KErrInUse ); + } + + CreateMapViewL(); + + iMapView->ResetMapArea(); + + CPosLandmark* location = aLandmark; + + if ( location ) // Landmark created. Set search string as landmark name + { + if ( aSearchQuery.Length() > 0 ) + { + CleanupStack::PushL( location ); + + location->SetLandmarkNameL( aSearchQuery ); + + iLandMarks.AppendL( location ); + CleanupStack::Pop( location ); + + iMapView->ResetLandmarksToShow(); + iMapView->AddLandmarksToShowL( iLandMarks ); + } + } + else + { + // No location url provided, let's search from maps + // with search string. It was agreed that search is done by + // passing a landmark with search string as the name of the landmark + // forward + if ( aSearchQuery.Length() > 0 ) + { + location = CPosLandmark::NewLC(); + location->SetLandmarkNameL( aSearchQuery ); + + iLandMarks.AppendL( location ); + CleanupStack::Pop( location ); + + iMapView->ResetLandmarksToShow(); + iMapView->AddLandmarksToShowL( iLandMarks ); + } + + // Enable current location focus on map + iMapView-> + SetCurrentLocationOption( CMnMapView::ECurrentLocationEnabled ); + } + + SetActive(); + iMapView->SelectFromMapL( iStatus ); + } + +// --------------------------------------------------------------------------- +// CESMRLocationPluginImpl::ShowLandmarkL +// --------------------------------------------------------------------------- +// +void CESMRLocationPluginImpl::ShowLandmarkL( CPosLandmark* aLandmark ) + { + CreateMapViewL(); + + iMapView->ResetLandmarksToShow(); + RCPointerArray landmarks; + CleanupClosePushL( landmarks ); + CleanupStack::PushL( aLandmark ); + landmarks.AppendL( aLandmark ); + CleanupStack::Pop( aLandmark ); + iMapView->AddLandmarksToShowL( landmarks ); + CleanupStack::PopAndDestroy( &landmarks ); + iMapView->ShowMapL(); + } + +// --------------------------------------------------------------------------- +// CESMRLocationPluginImpl::UrlParserL +// --------------------------------------------------------------------------- +// +CESMRUrlParserPlugin& CESMRLocationPluginImpl::UrlParserL() + { + if ( !iUrlParser ) + { + iUrlParser = CESMRUrlParserPlugin::NewL(); + } + + return *iUrlParser; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/mrlocationplugin/src/esmrlocationpluginentrypoint.cpp --- a/meetingrequest/mrgui/mrlocationplugin/src/esmrlocationpluginentrypoint.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/mrlocationplugin/src/esmrlocationpluginentrypoint.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmraddressinfohandler.cpp --- a/meetingrequest/mrgui/src/cesmraddressinfohandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmraddressinfohandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,22 +20,22 @@ #include "cesmraddressinfohandler.h" #include -#include -#include -#include +#include +#include +#include #include #include #include //Virtual Phonebook -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "cesmrdynamicitemselectionlist.h" #include "cesmrlocationpluginhandler.h" @@ -519,8 +519,13 @@ FUNC_LOG; TInt offset = iCompleteAddresses[aIndex]->Find( KTab ); //codescanner::accessArrayElementWithoutCheck2 TPtrC address( iCompleteAddresses[aIndex]->Mid( offset + 1) ); //codescanner::accessArrayElementWithoutCheck2 + TBool replaced; iEntryUpdated = - CESMRLocationPluginHandler::UpdateEntryLocationL( *iEntry, address, EFalse ); + CESMRLocationPluginHandler::UpdateEntryLocationL( + *iEntry, + address, + EFalse, + replaced ); } //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmraddressselectionquery.cpp --- a/meetingrequest/mrgui/src/cesmraddressselectionquery.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmraddressselectionquery.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,7 +21,7 @@ #include "cesmraddressselectionquery.h" #include -#include +#include #include #include #include @@ -115,7 +115,7 @@ // ----------------------------------------------------------------------------- // TInt CESMRAddressSelectionQuery::ExecuteAddressSelectionListL( - const RPointerArray& aAddressArray ) + const RPointerArray& aAddressArray ) { FUNC_LOG; TInt ret = ExecuteL( aAddressArray ); @@ -127,13 +127,13 @@ // ----------------------------------------------------------------------------- // TInt CESMRAddressSelectionQuery::ExecuteL( - const RPointerArray& aAddressArray ) + const RPointerArray& aAddressArray ) { FUNC_LOG; TInt response( KErrCancel ); CAknDoublePopupMenuStyleListBox* list = - new( ELeave )CAknDoublePopupMenuStyleListBox; + new( ELeave )CAknDoublePopupMenuStyleListBox; CleanupStack::PushL( list ); CAknPopupList* popupList = CAknPopupList::NewL( list, @@ -175,14 +175,14 @@ // void CESMRAddressSelectionQuery::SetListQueryTextsL( - CDesCArrayFlat* aItemArray, - CAknPopupList* aPopupList, - const RPointerArray& aAddressArray ) + CDesCArrayFlat* aItemArray, + CAknPopupList* aPopupList, + const RPointerArray& aAddressArray ) { FUNC_LOG; // Set title for popup aPopupList->SetTitleL( *iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_LOC_ADDRESS_SELECTION_TITLE ) ); + R_QTN_MEET_REQ_LOC_ADDRESS_SELECTION_TITLE ) ); CleanupStack::PopAndDestroy(); // Resource string // Amount of addresses the contact has @@ -193,7 +193,7 @@ item.CleanupClosePushL(); for ( TInt i(0); i < itemCount; ++i ) - { + { // Descriptor has separator between label and the actual address TPtr16 temp = aAddressArray[i]->Des(); @@ -203,25 +203,25 @@ temp.SetLength( KMaxLength ); } - // Finding the first instance of a separator - TInt offset = temp.Find( KSeparator ); - - if( 0 <= offset && offset < KMaxLength ) - { - // Forming label from the beginning to the first separator - TPtrC16 tempLabel = temp.Mid( 0, offset ); - - // Forming address from the first separator to the end - TPtrC16 tempAddress = temp.Mid( - offset + KSeparatorLength, - temp.Length() - offset - KSeparatorLength ); - - // appending address item to array - item.Format( KListItemFormat, &tempLabel, &tempAddress ); - aItemArray->AppendL( item ); - } - - } + // Finding the first instance of a separator + TInt offset = temp.Find( KSeparator ); + + if( 0 <= offset && offset < KMaxLength ) + { + // Forming label from the beginning to the first separator + TPtrC16 tempLabel = temp.Mid( 0, offset ); + + // Forming address from the first separator to the end + TPtrC16 tempAddress = temp.Mid( + offset + KSeparatorLength, + temp.Length() - offset - KSeparatorLength ); + + // appending address item to array + item.Format( KListItemFormat, &tempLabel, &tempAddress ); + aItemArray->AppendL( item ); + } + + } CleanupStack::PopAndDestroy( &item ); } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmralarm.cpp --- a/meetingrequest/mrgui/src/cesmralarm.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR alarm implementation -* -*/ - - -#include "emailtrace.h" -#include -#include "cesmralarm.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRAlarm::CESMRAlarm -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAlarm::CESMRAlarm( ) - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::~CESMRAlarm -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAlarm::~CESMRAlarm( ) - { - FUNC_LOG; - delete iText; - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::ConstructFromResourceL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAlarm::ConstructFromResourceL( TResourceReader& aReader ) - { - FUNC_LOG; - iId = aReader.ReadInt16(); - iValue = aReader.ReadInt16(); - iRelative = aReader.ReadInt16(); - iTxtLink = aReader.ReadInt32(); // link to TBUF - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::LoadTextL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAlarm::LoadTextL( CCoeEnv* aEnv ) - { - FUNC_LOG; - delete iText; - iText = NULL; - - if ( iValue != KErrNotFound ) - { - iText = StringLoader::LoadL ( iTxtLink, iValue, aEnv ); - } - else - { - iText = StringLoader::LoadL ( iTxtLink, aEnv ); - } - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::RelativeTimeInMinutes -// --------------------------------------------------------------------------- -// -EXPORT_C TTimeIntervalMinutes CESMRAlarm::RelativeTimeInMinutes( ) - { - FUNC_LOG; - return TTimeIntervalMinutes ( iRelative ); - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::Text -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC* CESMRAlarm::Text( ) - { - FUNC_LOG; - return iText; - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::Id -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRAlarm::Id( ) - { - FUNC_LOG; - return iId; - } - -// --------------------------------------------------------------------------- -// CESMRAlarm::Relative -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRAlarm::Relative( ) - { - FUNC_LOG; - return iRelative; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrannivtimevalidator.cpp --- a/meetingrequest/mrgui/src/cesmrannivtimevalidator.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrannivtimevalidator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -147,7 +147,11 @@ inline CESMRAnnivTimeValidator::CESMRAnnivTimeValidator() : iCurrentAnnivDate( Time::NullTTime() ), iCurrentAlarmTime( Time::NullTTime() ), - iAlarmOnOff( EFalse ) + iAlarmOnOff( EFalse ), + iInitialAlarmTime( Time::NullTTime() ), + iInitialAlarmOnOff( EFalse ), + iInitialStartDate( Time::NullTTime() ) + { } @@ -237,7 +241,7 @@ TCalTime startTime = entry.StartTimeL(); iCurrentAnnivDate = startTime.TimeLocalL(); SetDateToEditor( *iStartDate, iCurrentAnnivDate ); - + iInitialStartDate = iStartDate->Date(); CCalAlarm* alarm = entry.AlarmL(); CleanupStack::PushL( alarm ); @@ -246,9 +250,13 @@ { iCurrentAlarmTime = iCurrentAnnivDate - alarm->TimeOffset(); iAlarmOnOff = ETrue; + iInitialAlarmOnOff = iAlarmOnOff; SetTimeToEditor( *iAlarmTime, iCurrentAlarmTime ); SetDateToEditor( *iAlarmDate, iCurrentAlarmTime ); + + iInitialAlarmTime = iAlarmTime->Time(); + iInitialAlarmDate = iAlarmDate->Date(); } CleanupStack::PopAndDestroy( alarm ); @@ -268,66 +276,75 @@ { PreValidateEditorContent(); CCalEntry& entry( aEntry.Entry() ); - - TTime annivEdirotTime = StartTimeL(); - - TCalTime annivTime; - - // The default mode for anniversary is EFloating, - // But some 3rd party application might have saved a different type - // for one reason or another. In that case we are using - // the existing value. - if ( aEntry.IsStoredL() ) + TDateTime annivEditorTime = StartTimeL(); + + // If entry has been modified, we will write new values to entry. + // Otherwise entry will not be modified and thus saved + // (ex. new entry and press only Done ) + if( IsModifiedL( aEntry ) ) { - TCalTime::TTimeMode timeMode = - aEntry.Entry().StartTimeL().TimeMode(); - - switch ( timeMode ) + TCalTime annivTime; + + // The default mode for anniversary is EFloating, + // But some 3rd party application might have saved a different type + // for one reason or another. In that case we are using + // the existing value. + if ( aEntry.IsStoredL() ) { - case TCalTime::EFixedUtc: - { - annivTime.SetTimeUtcL( annivEdirotTime ); - break; - } - case TCalTime::EFixedTimeZone: - { - annivTime.SetTimeLocalL( annivEdirotTime ); - break; - } - case TCalTime::EFloating: - default: - { - annivTime.SetTimeLocalFloatingL( annivEdirotTime ); - } + TCalTime::TTimeMode timeMode = + aEntry.Entry().StartTimeL().TimeMode(); + + switch ( timeMode ) + { + case TCalTime::EFixedUtc: + { + annivTime.SetTimeUtcL( annivEditorTime ); + break; + } + case TCalTime::EFixedTimeZone: + { + annivTime.SetTimeLocalL( annivEditorTime ); + break; + } + case TCalTime::EFloating: + default: + { + annivTime.SetTimeLocalFloatingL( annivEditorTime ); + } + } } - } - else - { - annivTime.SetTimeLocalFloatingL( annivEdirotTime ); - } + else + { + annivTime.SetTimeLocalFloatingL( annivEditorTime ); + } + + entry.SetStartAndEndTimeL( annivTime, annivTime ); - entry.SetStartAndEndTimeL( annivTime, annivTime ); - if ( iAlarmOnOff ) - { - TTimeIntervalMinutes diff; - TTime alarm = AlarmTimeL(); - annivEdirotTime.MinutesFrom( alarm, diff ); - - CCalAlarm* alarmObject = entry.AlarmL(); - if ( !alarmObject ) + // Setting alarm only if entry needs to be saved + if ( iAlarmOnOff ) { - alarmObject = CCalAlarm::NewL(); + TTimeIntervalMinutes diff; + + TTime alarm = AlarmTimeL(); + TTime editorTime = annivEditorTime; + editorTime.MinutesFrom( alarm, diff ); + + CCalAlarm* alarmObject = entry.AlarmL(); + if ( !alarmObject ) + { + alarmObject = CCalAlarm::NewL(); + } + CleanupStack::PushL( alarmObject ); + alarmObject->SetTimeOffset( diff ); + entry.SetAlarmL( alarmObject ); + CleanupStack::PopAndDestroy( alarmObject ); + alarmObject = NULL; } - CleanupStack::PushL( alarmObject ); - alarmObject->SetTimeOffset( diff ); - entry.SetAlarmL( alarmObject ); - CleanupStack::PopAndDestroy( alarmObject ); - alarmObject = NULL; - } - else - { - entry.SetAlarmL( NULL ); + else + { + entry.SetAlarmL( NULL ); + } } } } @@ -363,6 +380,11 @@ { FUNC_LOG; iStartDate = &aStartDate; + + if ( Time::NullTTime() != iCurrentAnnivDate ) + { + SetDateToEditor( *iStartDate, iCurrentAnnivDate ); + } } // --------------------------------------------------------------------------- @@ -385,6 +407,11 @@ { FUNC_LOG; iAlarmTime = &aAlarmTime; + + if ( iAlarmOnOff ) + { + SetTimeToEditor( *iAlarmTime, iCurrentAlarmTime ); + } } // --------------------------------------------------------------------------- @@ -396,6 +423,11 @@ { FUNC_LOG; iAlarmDate = &aAlarmDate; + + if ( iAlarmOnOff ) + { + SetDateToEditor( *iAlarmDate, iCurrentAlarmTime ); + } } // --------------------------------------------------------------------------- @@ -410,6 +442,17 @@ } // --------------------------------------------------------------------------- +// CESMRAnnivTimeValidator::SetAbsoluteAlarmOnOffFieldL +// --------------------------------------------------------------------------- +// +void CESMRAnnivTimeValidator::SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& /*aAbsoluteAlarmController*/ ) + { + FUNC_LOG; + // No implementation for anniversary + } + +// --------------------------------------------------------------------------- // CESMRAnnivTimeValidator::StartTimeChangedL // --------------------------------------------------------------------------- // @@ -620,12 +663,12 @@ iStartDate->PrepareForFocusLossL(); } - if ( iAlarmTime && iAlarmTime->IsVisible() ) + if ( iAlarmOnOff && iAlarmTime && iAlarmTime->IsVisible() ) { iAlarmTime->PrepareForFocusLossL(); } - if ( iAlarmDate && iAlarmDate->IsVisible() ) + if ( iAlarmOnOff && iAlarmDate && iAlarmDate->IsVisible() ) { iAlarmDate->PrepareForFocusLossL(); } @@ -731,5 +774,36 @@ } } +// --------------------------------------------------------------------------- +// CESMRAnnivTimeValidator::IsModifiedL +// --------------------------------------------------------------------------- +// +TBool CESMRAnnivTimeValidator::IsModifiedL( MESMRCalEntry& aEntry ) + { + // Checks if any of the editor fields have changed from the original / + // initial values + TBool isEdited( EFalse ); + + TBool isSame = aEntry.Entry().CompareL( aEntry.OriginalEntry() ); + + if( !isSame || + iInitialAlarmOnOff != iAlarmOnOff || + iStartDate->Date() != iInitialStartDate ) + { + isEdited = ETrue; + } + + // If alarm is on, we will check alarm time and date also for changes + if( iAlarmOnOff ) + { + if( iAlarmTime->Time() != iInitialAlarmTime || + iAlarmDate->Date() != iInitialAlarmDate ) + { + isEdited = ETrue; + } + } + + return isEdited; + } + // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrconfirmationquery.cpp --- a/meetingrequest/mrgui/src/cesmrconfirmationquery.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,344 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class is responsible of showing confirmation queries -* -*/ - -// INCLUDE FILES -#include "emailtrace.h" -#include "cesmrconfirmationquery.h" - -// -#include "esmrdef.h" -// -#include -#include -#include -#include -#include -#include -#include -#include //line wrapping and mirroring -#include //xml layout data for applications -#include //xml layout data of avkon components -#include "esmrhelper.h"//locateresourcefile - -// Unnamed namespace for local definitions -namespace { - -#ifdef _DEBUG - -// Definition for panic text -_LIT( KESMRConfirmationQueryPanicTxt, "ESMRConfirmationQueryPanic" ); - -/** Panic code enumaration */ -enum TESMRConfirmationQueryPanic - { - EESMRInvalidIdentifier = 0 // Invalid identifier - }; - -void Panic( TESMRConfirmationQueryPanic aPanic ) - { - User::Panic( KESMRConfirmationQueryPanicTxt, aPanic ); - } - -#endif - -_LIT(KResourceFileName,"esmrgui.rsc"); - -const TInt KVariantIndex(2); //a LAF variant value required for pop up window -const TInt KRequiredLinesPlus(2); //minimum lines needed for aknbiditextutils API array set up -const TInt KActualLine(0); //minimum lines needed for aknbiditextutils API array set up -const TInt KDummyLineForcedByAPI(1); //minimum lines needed for aknbiditextutils API array set up -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::CESMRConfirmationQuery -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CESMRConfirmationQuery::CESMRConfirmationQuery( - TESMRConfirmationQueryType aType) : - iType(aType) - { - FUNC_LOG; - //do nothing - } - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::~CESMRConfirmationQuery -// ----------------------------------------------------------------------------- -// -CESMRConfirmationQuery::~CESMRConfirmationQuery() - { - FUNC_LOG; - iEnv->DeleteResourceFile(iResourceOffset); - } - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::ConstructL -// ----------------------------------------------------------------------------- -// -void CESMRConfirmationQuery::ConstructL() - { - FUNC_LOG; - TFileName filename; - - //cache the Eikon pointer, as Static() is slow - iEnv = CEikonEnv::Static(); // codescanner::eikonenvstatic - - ESMRHelper::LocateResourceFile( - KResourceFileName, - KDC_RESOURCE_FILES_DIR, - filename, - &iEnv->FsSession() ); - - //for localization - BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); - iResourceOffset = iEnv->AddResourceFileL(filename); - } - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::ExecuteLD -// ----------------------------------------------------------------------------- -// -TBool CESMRConfirmationQuery::ExecuteLD() - { - FUNC_LOG; - HBufC* noteText = NULL; - switch ( iType ) - { - case EESMRDeleteMR: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_DELETE_QUERY); - break; - } - case EESMRSendCancellationInfoToParticipants: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_CANCELLATION_QUERY); - break; - } - case EESMRRemoveAppointment: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_REMOVE_APPOINTMENT_QUERY); - break; - } - case EESMRSaveChanges: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_FORM_QUEST_SAVE_CHANGES); - break; - } - case EESMRDeleteEntry: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_DELETE_QUERY); - break; - } - case EESMRSendDecline: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_DECLINE_QUERY ); - } - break; - case EESMRSaveAnnivChangedStartDay: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_QUEST_CHANGE_START_DAY ); - } - break; - case EESMRAttachments: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_NOTE_ATTACHMENTS ); - } - break; - case EESMRCancelDownloadingAttachment: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_VIEWER_CANCEL_DOWNLOAD_QUERY ); - } - break; - case EESMRCancelDownloadingAllAttachments: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_VIEWER_CANCEL_DOWNLOADS_QUERY ); - } - break; - case EESMRSaveMeetingChangedStartDay: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_QUEST_CHANGE_START_DAY ); - } - break; - case EESMRAssignUpdatedLocation: - { - noteText = - iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_ASSIGN_UPDATED_LOCATION ); - } - break; - default: - { - #ifdef _DEBUG - // Invalid identifier --> panic - Panic( EESMRInvalidIdentifier ); - #endif - } - break; - } - - TBool response(EFalse); - if ( noteText ) - { - CAknQueryDialog* dlg = CAknQueryDialog::NewL(); - if( dlg->ExecuteLD(R_MR_CONFIRMATION_QUERY, *noteText) ) - { - response = ETrue; - } - CleanupStack::PopAndDestroy(noteText); - } - - delete this; - return response; - } - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::ExecuteL -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CESMRConfirmationQuery::ExecuteL( TESMRConfirmationQueryType aType) - { - FUNC_LOG; - CESMRConfirmationQuery* query = new (ELeave) CESMRConfirmationQuery(aType); - CleanupStack::PushL( query ); - query->ConstructL( ); - TBool ret = query->ExecuteLD(); - CleanupStack::Pop( query ); - return ret; - } - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::ExecuteL -// ----------------------------------------------------------------------------- -// -TBool CESMRConfirmationQuery::ExecuteL( const TDesC& aLocation ) - { - FUNC_LOG; - CESMRConfirmationQuery* query = new (ELeave) CESMRConfirmationQuery(EESMRDeleteMR); - CleanupStack::PushL( query ); - query->ConstructL( ); - - HBufC* location = NULL; - - if ( aLocation.Length() > 0 ) - { - location = query->TruncateTextToLAFNoteL( aLocation ); - CleanupDeletePushL( location ); - } - else - { - // Allocate dummy buffer for query. - location = aLocation.AllocLC(); - } - - HBufC* noteText = StringLoader::LoadLC( R_MEET_REQ_REPLACE_PREVIOUS_LOCATION, *location ); - - TBool response = EFalse; - - CAknQueryDialog* dlg = CAknQueryDialog::NewL(); - if( dlg->ExecuteLD( R_MR_CONFIRMATION_QUERY, *noteText) ) - { - response = ETrue; - } - - CleanupStack::PopAndDestroy( noteText ); - CleanupStack::PopAndDestroy( location ); - CleanupStack::Pop( query ); - return response; - } - -// ----------------------------------------------------------------------------- -// CESMRConfirmationQuery::TruncateTextToLAFNoteL -// ----------------------------------------------------------------------------- -// -HBufC* CESMRConfirmationQuery::TruncateTextToLAFNoteL( const TDesC& aLocation ) - { - FUNC_LOG; - //wrap long string into array of individual lines - CArrayFixFlat* textLines = new(ELeave)CArrayFixFlat( KRequiredLinesPlus ); - CleanupStack::PushL( textLines ); - - //layout stuff to fetch list font and list line width - TAknLayoutText fontType; - - TSize main_pane_Size; - AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EMainPane, main_pane_Size ); - TRect main_pane( main_pane_Size ); - - fontType.LayoutText( main_pane, AknLayoutScalable_Avkon::popup_note_window_t4( KVariantIndex ).LayoutLine() ); - - TInt lineWidth = fontType.TextRect().Width(); - - //extra bidi space for the two lines. second line is not actually used in the query but is required by the API - HBufC* locationText = HBufC::NewLC( aLocation.Length() + KAknBidiExtraSpacePerLine + KAknBidiExtraSpacePerLine); - TPtr locationTextPtr = locationText->Des(); - locationTextPtr.Append(aLocation); - - // First wrap, then do formatting. - CArrayFixFlat* lineWidths = new( ELeave )CArrayFixFlat( KRequiredLinesPlus ); - CleanupStack::PushL( lineWidths ); - lineWidths->InsertL( KActualLine, lineWidth ); - lineWidths->InsertL( KDummyLineForcedByAPI, lineWidth ); - - TBool useEllipsis(ETrue); - - // measure, wrap and truncate location item. - AknBidiTextUtils::ConvertToVisualAndWrapToArrayL( - locationTextPtr, - *lineWidths, - *fontType.Font(), - *textLines, - useEllipsis ); - - //place result to new created target buffer - HBufC* target = HBufC::NewL( textLines->At(KActualLine).Length() ); - target->Des().Append(textLines->At( KActualLine )); - - CleanupStack::PopAndDestroy( lineWidths ); - CleanupStack::PopAndDestroy( locationText ); - CleanupStack::PopAndDestroy( textLines ); - delete this; - return target; - } - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrcontactlinkiterator.cpp --- a/meetingrequest/mrgui/src/cesmrcontactlinkiterator.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CESMRContactLinkIterator. -* -*/ - - -#include "emailtrace.h" -#include "cesmrcontactlinkiterator.h" -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::NewL( ) -// --------------------------------------------------------------------------- -// -CESMRContactLinkIterator* CESMRContactLinkIterator::NewL( ) - { - FUNC_LOG; - CESMRContactLinkIterator* self = new (ELeave) CESMRContactLinkIterator(); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::~CESMRContactLinkIterator( ) -// --------------------------------------------------------------------------- -// -CESMRContactLinkIterator::~CESMRContactLinkIterator( ) - { - FUNC_LOG; - delete iContactLinkArray; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::SetContactLinkArray -// --------------------------------------------------------------------------- -// -void CESMRContactLinkIterator::SetContactLinkArray( - MVPbkContactLinkArray* aContactLinkArray ) - { - FUNC_LOG; - delete iContactLinkArray; - iContactLinkArray = aContactLinkArray; - iContactLinkArrayIndex = 0; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::ContactCount -// --------------------------------------------------------------------------- -// -TInt CESMRContactLinkIterator::ContactCount() const - { - FUNC_LOG; - TInt count( KErrNotFound ); - if ( iContactLinkArray ) - { - count = iContactLinkArray->Count(); - } - return count; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::HasNextContact -// --------------------------------------------------------------------------- -// -TBool CESMRContactLinkIterator::HasNextContact() const - { - FUNC_LOG; - return iContactLinkArrayIndex < ContactCount(); - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::NextContactL -// --------------------------------------------------------------------------- -// -MVPbkContactLink* CESMRContactLinkIterator::NextContactL() - { - FUNC_LOG; - MVPbkContactLink* link = NULL; - if ( iContactLinkArray ) - { - link = (MVPbkContactLink*) - &(iContactLinkArray->At( iContactLinkArrayIndex++ )); - } - - return link; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::SetToFirstContact( ) -// --------------------------------------------------------------------------- -// -void CESMRContactLinkIterator::SetToFirstContact( ) - { - FUNC_LOG; - iContactLinkArrayIndex = 0; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::GroupCount( ) -// --------------------------------------------------------------------------- -// -TInt CESMRContactLinkIterator::GroupCount( ) const - { - FUNC_LOG; - return 0; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::HasNextGroup( ) -// --------------------------------------------------------------------------- -// -TBool CESMRContactLinkIterator::HasNextGroup( ) const - { - FUNC_LOG; - return EFalse; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::NextGroupL( ) -// --------------------------------------------------------------------------- -// -MVPbkContactLink* CESMRContactLinkIterator::NextGroupL( ) - { - FUNC_LOG; - return NULL; - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::SetToFirstGroup( ) -// --------------------------------------------------------------------------- -// -void CESMRContactLinkIterator::SetToFirstGroup( ) - { - FUNC_LOG; - //Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactLinkIterator::CESMRContactLinkIterator( ) -// --------------------------------------------------------------------------- -// -CESMRContactLinkIterator::CESMRContactLinkIterator( ) - { - FUNC_LOG; - //Do nothing - } - -// End of file - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrcontactmanagerhandler.cpp --- a/meetingrequest/mrgui/src/cesmrcontactmanagerhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CESMRContactManagerHandler. -* -*/ - - -#include "emailtrace.h" -#include "cesmrcontactmanagerhandler.h" - -#include -#include -#include -#include -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::CESMRContactManagerHandler -// --------------------------------------------------------------------------- -// -CESMRContactManagerHandler::CESMRContactManagerHandler() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::NewL -// --------------------------------------------------------------------------- -// -CESMRContactManagerHandler* CESMRContactManagerHandler::NewL() - { - FUNC_LOG; - CESMRContactManagerHandler* self = new (ELeave) CESMRContactManagerHandler(); - CleanupStack::PushL (self ); - self->ConstructL ( ); - CleanupStack::Pop (self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRContactManagerHandler::ConstructL ( ) - { - FUNC_LOG; - CVPbkContactStoreUriArray* uriList = CVPbkContactStoreUriArray::NewLC(); - uriList->AppendL(VPbkContactStoreUris::DefaultCntDbUri() ); - iContactManager = CVPbkContactManager::NewL( *uriList ); - CleanupStack::PopAndDestroy(uriList); - - MVPbkContactStoreList& stores = iContactManager->ContactStoresL( ); - stores.OpenAllL( *this ); - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::~CESMRContactManagerHandler -// --------------------------------------------------------------------------- -// -CESMRContactManagerHandler::~CESMRContactManagerHandler() - { - FUNC_LOG; - delete iContactManager; - iObservers.Reset(); - iObservers.Close(); - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::IsReady -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CESMRContactManagerHandler::IsReady() - { - FUNC_LOG; - return iContactManagerReady; - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::AddObserverL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactManagerHandler::AddObserverL( - MESMRContactManagerObserver* aObserver ) - { - FUNC_LOG; - if ( iObservers.Find(aObserver) == KErrNotFound ) - { - iObservers.AppendL(aObserver); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::RemoveObserver -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactManagerHandler::RemoveObserver( - MESMRContactManagerObserver* aObserver ) - { - FUNC_LOG; - TInt index = iObservers.Find(aObserver ); - if ( index != KErrNotFound ) - { - iObservers.Remove(index ); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::GetContactManager -// --------------------------------------------------------------------------- -// -EXPORT_C CVPbkContactManager& CESMRContactManagerHandler::GetContactManager() - { - FUNC_LOG; - return *iContactManager; - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::OpenComplete -// --------------------------------------------------------------------------- -// -void CESMRContactManagerHandler::OpenComplete ( ) - { - FUNC_LOG; - iContactManagerReady = ETrue; - const TInt count(iObservers.Count()); - for (TInt i=count-1; i>=0; --i ) - { - iObservers[i]->ContactManagerReady( ); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::StoreReady -// --------------------------------------------------------------------------- -// -void CESMRContactManagerHandler::StoreReady( - MVPbkContactStore& /*aContactStore*/ ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::StoreUnavailable -// --------------------------------------------------------------------------- -// -void CESMRContactManagerHandler::StoreUnavailable ( - MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactManagerHandler::HandleStoreEventL -// --------------------------------------------------------------------------- -// -void CESMRContactManagerHandler::HandleStoreEventL ( - MVPbkContactStore& /*aContactStore*/, - TVPbkContactStoreEvent /*aStoreEvent*/) - { - FUNC_LOG; - // Do nothing - } - -// End of file - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrcontactmenuattachmenthandler.cpp --- a/meetingrequest/mrgui/src/cesmrcontactmenuattachmenthandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Creates and display action menu. -* -*/ - - -#include "cesmrcontactmenuattachmenthandler.h" -#include "cesmrconfirmationquery.h" - -#include "cfsccontactactionmenu.h" -#include "fsccontactactionmenuuids.hrh" -#include "cfsccontactactionmenuitem.h" -#include "tfsccontactactionmenuconstructparameters.h" -#include "mfsccontactactionmenumodel.h" -#include "cesmrattachmentinfo.h" -#include "esmrhelper.h" -#include "cesmriconfield.h" -#include "nmrbitmapmanager.h" -#include "cfsccontactactionservice.h" -#include "esmrcommands.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// DEBUG -#include "emailtrace.h" - -/// Unnamed namespace for local definitions -namespace { - -// MR contains one attachment -const TInt KOneAttachment( 1 ); - -// Attachment actions menu uids -static const TUid KOpenAttachmentViewUid = { 1 }; -static const TUid KOpenAttachmentUid = { 2 }; -static const TUid KDownloadAttachmentUid = { 3 }; -static const TUid KDownloadAllAttachmentsUid = { 4 }; -static const TUid KSaveAttachmentUid = { 5 }; -static const TUid KSaveAllAttachmentsUid = { 6 }; - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// C++ default constructor. -// --------------------------------------------------------------------------- -// -CESMRContactMenuAttachmentHandler::CESMRContactMenuAttachmentHandler( - CFscContactActionMenu& aContactActionMenu ) : - iContactActionMenu( aContactActionMenu ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// Symbian two phased constructor that does not leave a pointer to the cleanup -// stack. -// --------------------------------------------------------------------------- -// -CESMRContactMenuAttachmentHandler* CESMRContactMenuAttachmentHandler::NewL( - CFscContactActionMenu& aContactActionMenu ) - { - FUNC_LOG; - CESMRContactMenuAttachmentHandler* self = - new (ELeave) CESMRContactMenuAttachmentHandler( aContactActionMenu ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor. -// Creates the action menu object. -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::ConstructL() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// Destructor. -// --------------------------------------------------------------------------- -// -CESMRContactMenuAttachmentHandler::~CESMRContactMenuAttachmentHandler() - { - FUNC_LOG; - iIconArray.ResetAndDestroy(); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::Reset( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::Reset( ) - { - FUNC_LOG; - iOptionsMenuAvailable = EFalse; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::SetAttachmentInfo( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::SetAttachmentInfo( - CESMRAttachmentInfo* aAttachmentInfo ) - { - iAttachmentInfo = aAttachmentInfo; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::InitActionMenuL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::InitActionMenuL( ) - { - FUNC_LOG; - - if ( iAttachmentInfo ) - { - iOptionsMenuAvailable = ETrue; - - MFscContactActionMenuModel& actionMenuModel = iContactActionMenu.Model(); - - TInt attachmentCount( iAttachmentInfo->AttachmentCount() ); - - if( attachmentCount > KOneAttachment ) - { - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_ACTION_ATTACH_VIEW_LIST, - KOpenAttachmentViewUid ); - - // go through the list to see if we need to download - // some attachment - TBool needDownload(EFalse); - - for( TInt ii = attachmentCount-1; ii >= 0 && !needDownload; --ii ) - { - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( ii ) ); - - needDownload = attachment.AttachmenState() != - CESMRAttachment::EAttachmentStateDownloaded; - } - - // download all command - if( needDownload ) - { - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_ACTION_ATTACH_DOWNLOAD_ALL, - KDownloadAllAttachmentsUid ); - } - - // save all command - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_ACTION_ATTACH_SAVE_ALL, - KSaveAllAttachmentsUid ); - } - else - { - // There is one attachment - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( 0 ) ); - - // open or download command - if( attachment.AttachmenState() == CESMRAttachment::EAttachmentStateDownloaded ) - { - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_ACTION_ATTACH_OPEN, - KOpenAttachmentUid ); - } - else - { - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_ACTION_ATTACH_DOWNLOAD, - KDownloadAttachmentUid ); - } - - // save command - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_ACTION_ATTACH_SAVE, - KSaveAttachmentUid ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::CreateMenuItemL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::CreateMenuItemL( - TInt aResourceId, - TUid aCommandUid ) - { - FUNC_LOG; - CGulIcon* itemIcon = CreateIconL(aCommandUid); - //ownership transferred - CleanupStack::PushL( itemIcon ); - iIconArray.AppendL( itemIcon ); - CleanupStack::Pop( itemIcon ); - - HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aResourceId ); - CFscContactActionMenuItem* newItem = - iContactActionMenu.Model().NewMenuItemL( *text, - itemIcon, - 1, - EFalse, - aCommandUid ); - - CleanupStack::PopAndDestroy( text ); - CleanupStack::PushL( newItem ); - iContactActionMenu.Model().AddItemL( newItem ); - CleanupStack::Pop( newItem ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::CreateIconL -// --------------------------------------------------------------------------- -// -CGulIcon* CESMRContactMenuAttachmentHandler::CreateIconL(TUid aCommandUid) - { - FUNC_LOG; - // Define default icon object - CFbsBitmap* iconBitmap( NULL ); - CFbsBitmap* iconMaskBitmap( NULL ); - NMRBitmapManager::TMRBitmapId iconID( NMRBitmapManager::EMRBitmapNotSet ); - - //select correct icon for item - if( aCommandUid == KOpenAttachmentViewUid ) - { - iconID = NMRBitmapManager::EMRBitmapOpenAttachmentView; - } - else if ( aCommandUid ==KOpenAttachmentUid ) - { - iconID = NMRBitmapManager::EMRBitmapOpenAttachment; - } - else if( aCommandUid == KDownloadAttachmentUid ) - { - iconID = NMRBitmapManager::EMRBitmapDownloadAttachment; - } - else if( aCommandUid == KDownloadAllAttachmentsUid ) - { - iconID = NMRBitmapManager::EMRBitmapDownloadAllAttachments; - } - else if( aCommandUid == KSaveAttachmentUid ) - { - iconID = NMRBitmapManager::EMRBitmapSaveAttachment; - } - else if( aCommandUid == KSaveAllAttachmentsUid ) - { - iconID = NMRBitmapManager::EMRBitmapSaveAllAttachments; - } - - User::LeaveIfError( - NMRBitmapManager::GetSkinBasedBitmap( - iconID, iconBitmap, iconMaskBitmap, KIconSize ) ); - - CGulIcon* icon = CGulIcon::NewL( iconBitmap, iconMaskBitmap ); - return icon; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::OptionsMenuAvailable( ) -// --------------------------------------------------------------------------- -// -TBool CESMRContactMenuAttachmentHandler::OptionsMenuAvailable( ) - { - FUNC_LOG; - return iOptionsMenuAvailable; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::InitOptionsMenuL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::InitOptionsMenuL( - CEikMenuPane* aActionMenuPane ) - { - FUNC_LOG; - - if ( iAttachmentInfo ) - { - iOptionsMenuAvailable = ETrue; - - CEikMenuPaneItem::SData data; - - TInt attachmentCount( iAttachmentInfo->AttachmentCount() ); - - CCoeEnv* coeEnv = CCoeEnv::Static(); - - if( attachmentCount > KOneAttachment ) - { - // command to open download manager - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdOpenAttachmentView; - - TRAP_IGNORE( coeEnv->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_ATTACH_VIEW_LIST ) ); - aActionMenuPane->AddMenuItemL( data ); - - // go through the list to see if we need to download - // some attachment - TBool needDownload(EFalse); - - for( TInt ii = attachmentCount-1; ii >= 0 && !needDownload; --ii ) - { - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( ii ) ); - - needDownload = attachment.AttachmenState() != - CESMRAttachment::EAttachmentStateDownloaded; - } - - // download all command - if( needDownload ) - { - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdDownloadAllAttachments; - - TRAP_IGNORE( coeEnv->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_ATTACH_DOWNLOAD_ALL ) ); - aActionMenuPane->AddMenuItemL( data ); - } - - // save all command - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdSaveAllAttachments; - - TRAP_IGNORE( coeEnv->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_ATTACH_SAVE_ALL ) ); - aActionMenuPane->AddMenuItemL( data ); - } - else - { - // There is one attachment - const CESMRAttachment& attachment( - iAttachmentInfo->AttachmentL( 0 ) ); - - // open or download command - if( attachment.AttachmenState() == CESMRAttachment::EAttachmentStateDownloaded ) - { - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdOpenAttachment; - - TRAP_IGNORE( coeEnv->ReadResourceL( - data.iText, R_QTN_OPTIONS_OPEN ) ); - aActionMenuPane->AddMenuItemL( data ); - } - else - { - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdDownloadAttachment; - - TRAP_IGNORE( coeEnv->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_ATTACH_DOWNLOAD ) ); - aActionMenuPane->AddMenuItemL( data ); - } - - // save command - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdSaveAttachment; - - TRAP_IGNORE( coeEnv->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_ATTACH_SAVE ) ); - aActionMenuPane->AddMenuItemL( data ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::ShowActionMenuL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::ShowActionMenuL( ) - { - FUNC_LOG; - TFscActionMenuResult menuResult = iContactActionMenu.ExecuteL(); - - if ( menuResult == EFscCustomItemSelected ) - { - TUid uid = iContactActionMenu.FocusedItem().ImplementationUid(); - if ( uid == KOpenAttachmentViewUid ) - { - //OpenAttachmentViewL(); - iCommandObserver->ProcessCommandL( EESMRCmdOpenAttachmentView ); - } - else - if( uid == KOpenAttachmentUid ) - { - iCommandObserver->ProcessCommandL( EESMRCmdOpenAttachment ); - } - else - if( uid == KDownloadAllAttachmentsUid ) - { - iCommandObserver->ProcessCommandL( EESMRCmdDownloadAllAttachments ); - } - else - if( uid == KDownloadAttachmentUid ) - { - iCommandObserver->ProcessCommandL( EESMRCmdDownloadAttachment ); - } - else - if( uid == KSaveAllAttachmentsUid ) - { - iCommandObserver->ProcessCommandL( EESMRCmdSaveAllAttachments ); - } - else - if( uid == KSaveAttachmentUid ) - { - iCommandObserver->ProcessCommandL( EESMRCmdSaveAttachment ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuAttachmentHandler::SetCommandObserver() -// --------------------------------------------------------------------------- -// -void CESMRContactMenuAttachmentHandler::SetCommandObserver( - MEikCommandObserver* aCommandObserver ) - { - FUNC_LOG; - iCommandObserver = aCommandObserver; - } -// End of file - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrcontactmenuhandler.cpp --- a/meetingrequest/mrgui/src/cesmrcontactmenuhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,778 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CESMRContactMenuHandler. -* -*/ - - -#include "emailtrace.h" -#include "cesmrcontactmenuhandler.h" -#include "cesmrcontactmenuurlhandler.h" -#include "cesmrcontactmenuattachmenthandler.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cfsccontactactionservice.h" -#include "cfsccontactactionmenu.h" -#include "tfsccontactactionqueryresult.h" -#include "tfsccontactactionvisibility.h" -#include "mfsccontactaction.h" -#include "mfsccontactactionmenumodel.h" -#include "cesmrattachmentinfo.h" - -#include -#include -#include - -#include -#include "esmrcommands.h" - -#include -#include -#include - -/// Unnamed namespace for local definitions -namespace{ // codescanner::namespace - -const TInt KGranularity( 8 ); - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::CESMRContactMenuHandler( ) -// --------------------------------------------------------------------------- -// -CESMRContactMenuHandler::CESMRContactMenuHandler( - CESMRContactManagerHandler& aContactManagerHandler ): - iContactManagerHandler( aContactManagerHandler ), - iContactActionList( KGranularity ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::NewL( ) -// --------------------------------------------------------------------------- -// -CESMRContactMenuHandler* CESMRContactMenuHandler::NewL( - CESMRContactManagerHandler& aContactManagerHandler ) - { - FUNC_LOG; - CESMRContactMenuHandler* self = new (ELeave) CESMRContactMenuHandler( - aContactManagerHandler ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::ConstructL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::ConstructL( ) - { - FUNC_LOG; - - CVPbkContactManager& contactManager = - iContactManagerHandler.GetContactManager(); - - iContactActionService = CFscContactActionService::NewL( contactManager ); - iContactActionMenu = CFscContactActionMenu::NewL( - *iContactActionService, EFscContactActionMenuModeNormal, ETrue ); - - iContactMenuUrlHandler - = CESMRContactMenuUrlHandler::NewL( *iContactActionMenu ); - - // - iContactMenuAttachmentHandler - = CESMRContactMenuAttachmentHandler::NewL( *iContactActionMenu ); - // - - if ( iContactManagerHandler.IsReady() ) - { - iContactManagerReady = ETrue; - } - else - { - iContactManagerHandler.AddObserverL ( this ); - } - - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::~CESMRContactMenuHandler( ) -// --------------------------------------------------------------------------- -// -CESMRContactMenuHandler::~CESMRContactMenuHandler( ) - { - FUNC_LOG; - iStoreContactList.ResetAndDestroy(); - delete iFindResultsArray; - delete iContactMenuUrlHandler; - delete iContactMenuAttachmentHandler; - delete iContactOperationBase; - delete iContactActionMenu; - delete iContactActionService; - delete iValue; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::OptionsMenuAvailable( ) -// --------------------------------------------------------------------------- -// -TBool CESMRContactMenuHandler::OptionsMenuAvailable( ) - { - FUNC_LOG; - return iOptionsMenuReady || - iContactMenuUrlHandler->OptionsMenuAvailable( ) || - iContactMenuAttachmentHandler->OptionsMenuAvailable(); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::InitOptionsMenuL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::InitOptionsMenuL( - CEikMenuPane* aActionMenuPane ) - { - FUNC_LOG; - switch ( iValueType ) - { - case EValueTypeEmail: // Fall through - case EValueTypePhoneNumber: - { - // Add actions to options / actions submenu - const TInt count(iContactActionList.Count()); - for ( TInt i = 0; i < count; ++i ) - { - CEikMenuPaneItem::SData data; - data.iFlags = 0; - data.iCascadeId = 0; - data.iCommandId = EESMRCmdActionMenuFirst + i; - data.iText = iContactActionList[i].iAction->ActionMenuText(); - aActionMenuPane->AddMenuItemL( data ); - - aActionMenuPane->SetItemDimmed( - data.iCommandId, - iContactActionList[i].iOptionsMenuVisibility.iVisibility - == TFscContactActionVisibility::EFscActionDimmed ); - } - break; - } - case EValueTypeURL: - { - iContactMenuUrlHandler->InitOptionsMenuL( aActionMenuPane ); - break; - } - case EValueTypeAttachment: - { - iContactMenuAttachmentHandler->InitOptionsMenuL( aActionMenuPane ); - break; - } - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::ExecuteOptionsMenuL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::ExecuteOptionsMenuL( TInt aCommand ) - { - FUNC_LOG; - switch ( iValueType ) - { - case EValueTypeEmail: // Fall through - case EValueTypePhoneNumber: - { - TInt index = aCommand - EESMRCmdActionMenuFirst; - if ( index >= 0 && index < iContactActionList.Count() ) - { - TUid uid = iContactActionList[index].iAction->Uid(); - iContactActionService->ExecuteL( uid, this ); - } - break; - } - case EValueTypeURL: - { - iContactMenuUrlHandler->ExecuteOptionsMenuL( aCommand ); - break; - } - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::Reset( ) -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactMenuHandler::Reset( ) - { - FUNC_LOG; - delete iContactOperationBase; - iContactOperationBase = NULL; - - delete iFindResultsArray; - iFindResultsArray = NULL; - - iContactMenuUrlHandler->Reset(); - iContactMenuAttachmentHandler->Reset(); - - iContactActionMenu->Model().RemoveAll(); - - delete iValue; - iValue = NULL; - - iContactActionList.Reset(); - iStoreContactList.ResetAndDestroy(); - iActionMenuReady = EFalse; - iOptionsMenuReady = EFalse; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::SetValueL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactMenuHandler::SetValueL( - const TDesC& aValue, TValueType aValueType ) - { - FUNC_LOG; - Reset(); - - if ( aValueType == EValueTypeURL ) - { - iContactMenuUrlHandler->SetUrlL( aValue ); - iValueType = aValueType; - } - else if( aValueType == EValueTypeAttachment ) - { - iContactMenuAttachmentHandler->InitActionMenuL(); - iValueType = aValueType; - } - else - { - iValue = aValue.AllocL(); - iValueType = aValueType; - if ( iContactManagerReady ) - { - SearchContactL(); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::SetAttachmentInfoL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactMenuHandler::SetAttachmentInfoL( - CESMRAttachmentInfo* aAttachmentInfo ) - { - FUNC_LOG; - - iContactMenuAttachmentHandler->SetAttachmentInfo( aAttachmentInfo ); - SetValueL( KNullDesC, EValueTypeAttachment ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::SetCommandObserver() -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactMenuHandler::SetCommandObserver( - MEikCommandObserver* aCommandObserver ) - { - FUNC_LOG; - iCommandObserver = aCommandObserver; - - if ( iValueType == EValueTypeAttachment ) - { - iContactMenuAttachmentHandler->SetCommandObserver( aCommandObserver ); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::ShowActionMenuL( ) -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRContactMenuHandler::ShowActionMenuL( ) - { - FUNC_LOG; - if ( iValueType == EValueTypeURL ) - { - iContactMenuUrlHandler->ShowActionMenuL(); - } - else if ( iValueType == EValueTypeAttachment ) - { - iContactMenuAttachmentHandler->ShowActionMenuL(); - } - else if ( iActionMenuReady ) - { - iContactActionMenu->ExecuteL( ); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::VerifyContactDetailsL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::VerifyContactDetailsL() - { - FUNC_LOG; - if ( iFindResultsArrayIndex < iFindResultsArray->Count() ) - { - CVPbkContactManager& contactManager = - iContactManagerHandler.GetContactManager(); - - iContactOperationBase = - contactManager.RetrieveContactL( - iFindResultsArray->At( iFindResultsArrayIndex ), - *this ); - } - else - { - delete iFindResultsArray; - iFindResultsArray = NULL; - - if ( iStoreContactList.Count() > 0 ) - { - iContactActionService->SetContactSetL( iStoreContactList ); - iContactActionService->QueryActionsL( this ); - } - else - { - CreateContactL ( ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::ContactManagerReady( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::ContactManagerReady( ) - { - FUNC_LOG; - iContactManagerReady = ETrue; - iContactManagerHandler.RemoveObserver( this ); - if ( iValue ) - { - TRAP_IGNORE( SearchContactL() ); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::VPbkSingleContactOperationComplete -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& /*aOperation*/, - MVPbkStoreContact* aContact ) - { - FUNC_LOG; - delete iContactOperationBase; - iContactOperationBase = NULL; - - MVPbkStoreContactFieldCollection& fieldCollection = - aContact->Fields(); - - TBool valueMatchFound = EFalse; - const TInt count(fieldCollection.FieldCount()); - for ( TInt i = 0; valueMatchFound == EFalse && i < count; ++i ) - { - MVPbkStoreContactField& contactField = fieldCollection.FieldAt( i ); - MVPbkContactFieldData& fieldData = contactField.FieldData(); - if ( fieldData.DataType() == EVPbkFieldStorageTypeText ) - { - MVPbkContactFieldTextData& fieldTextData = - MVPbkContactFieldTextData::Cast( fieldData ); - - if ( fieldTextData.Text().CompareF( *iValue ) == 0 ) - { - valueMatchFound = ETrue; - } - } - } - - if ( valueMatchFound ) - { - TRAP_IGNORE( iStoreContactList.AppendL( aContact ) ); - } - else - { - delete aContact; - } - - ++iFindResultsArrayIndex; - TRAPD( err, VerifyContactDetailsL() ); - if ( err != KErrNone ) - { - Reset(); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::VPbkSingleContactOperationFailed -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aError*/ ) - { - FUNC_LOG; - delete iContactOperationBase; - iContactOperationBase = NULL; - - ++iFindResultsArrayIndex; - TRAPD( err, VerifyContactDetailsL() ); - if ( err != KErrNone ) - { - Reset(); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::FindCompleteL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::FindCompleteL( MVPbkContactLinkArray* aResults ) - { - FUNC_LOG; - delete iContactOperationBase; - iContactOperationBase = NULL; - - iStoreContactList.ResetAndDestroy(); - iFindResultsArray = aResults; - iFindResultsArrayIndex = 0; - - VerifyContactDetailsL(); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::FindFailed -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::FindFailed( TInt /*aError*/) - { - FUNC_LOG; - delete iContactOperationBase; - iContactOperationBase = NULL; - - Reset ( ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::QueryActionsComplete( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::QueryActionsComplete( ) - { - FUNC_LOG; - const CFscContactActionList& actionList = - iContactActionService->QueryResults(); - - // Add visible actions to local contact action list for - // options menu / actions. - const TInt count(actionList.Count()); - for ( TInt i = 0; i < count; ++i ) - { - TFscContactActionVisibility::TVisibility visibility = - actionList[i].iOptionsMenuVisibility.iVisibility; - if ( visibility == TFscContactActionVisibility::EFscActionVisible || - visibility == TFscContactActionVisibility::EFscActionDimmed ) - { - TRAP_IGNORE( iContactActionList.AppendL( actionList.At(i) ) ); - } - } - - const TInt count2(iContactActionList.Count()); - for ( TInt i = 0; i < count2; ++i ) - { - iContactActionList[i].iPriority = -iContactActionList[i].iPriority; - } - - // Sort local list of actions by priority. - TKeyArrayFix sortKey( _FOFF( TFscContactActionQueryResult, // codescanner::foff - iPriority ), - ECmpTInt); - iContactActionList.Sort( sortKey ); - - // Enable options menu / actions if there are actions available. - iOptionsMenuReady = iContactActionList.Count() > 0; - - // Initialize contact action menu and enable it. - TRAPD( error, iContactActionMenu->Model().AddPreQueriedCasItemsL ( ) ); - if ( error != KErrNone ) - { - iActionMenuReady = EFalse; - } - else - { - iActionMenuReady = ETrue; - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::QueryActionsFailed -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::QueryActionsFailed( TInt /*aError*/) - { - FUNC_LOG; - Reset(); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::ExecuteComplete( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::ExecuteComplete( ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::ExecuteFailed -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::ExecuteFailed( TInt /*aError*/) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::SearchContactL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::SearchContactL( ) - { - FUNC_LOG; - // Cancel ongoing search if one exists. - if ( iContactOperationBase ) - { - delete iContactOperationBase; - iContactOperationBase = NULL; - } - - CVPbkContactManager& contactManager = - iContactManagerHandler.GetContactManager(); - - switch ( iValueType ) - { - case EValueTypeEmail: - { - const MVPbkFieldTypeList& fieldTypeList = - contactManager.FieldTypes(); - - CVPbkFieldTypeRefsList* fieldTypeRefsList = - CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( fieldTypeRefsList ); - - // Search for all email fields. - const TInt count(fieldTypeList.FieldTypeCount()); - for ( TInt i = 0; i < count; ++i ) - { - const MVPbkFieldType& fieldType = - fieldTypeList.FieldTypeAt( i ); - TArray versitProperties = - fieldType.VersitProperties(); - - const TInt count2(versitProperties.Count()); - for ( TInt ii=0; ii < count2; ++ii ) - { - if ( versitProperties[ii].Name() == EVPbkVersitNameEMAIL ) - { - fieldTypeRefsList->AppendL( fieldType ); - break; - } - } - } - - // Initiate find operation, returns to FindCompleteL. - iContactOperationBase = contactManager.FindL( *iValue, - *fieldTypeRefsList, *this ); - - CleanupStack::PopAndDestroy ( fieldTypeRefsList ); - break; - } - case EValueTypePhoneNumber: - { - if ( CommonPhoneParser::IsValidPhoneNumber( *iValue, - CommonPhoneParser::EPlainPhoneNumber ) ) - { - // Initiate find operation, returns to FindCompleteL. - const MVPbkFieldTypeList& fieldTypeList = - contactManager.FieldTypes(); - - CVPbkFieldTypeRefsList* fieldTypeRefsList = - CVPbkFieldTypeRefsList::NewL(); - CleanupStack::PushL( fieldTypeRefsList ); - - // Search for all email fields. - const TInt count(fieldTypeList.FieldTypeCount()); - for ( TInt i = 0; i < count; ++i ) - { - const MVPbkFieldType& fieldType = - fieldTypeList.FieldTypeAt( i ); - TArray versitProperties = - fieldType.VersitProperties(); - - const TInt count2(versitProperties.Count()); - for ( TInt ii=0; ii < count2; ++ii ) - { - if ( versitProperties[ii].Name() == EVPbkVersitNameTEL ) - { - fieldTypeRefsList->AppendL( fieldType ); - break; - } - } - } - // Initiate find operation, returns to FindCompleteL. - iContactOperationBase = contactManager.FindL( *iValue, - *fieldTypeRefsList, *this ); - - CleanupStack::PopAndDestroy ( fieldTypeRefsList ); - } - else - { - CreateContactL(); - } - break; - } - default: - { - // Disable contact action handler. - Reset(); - break; - } - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::CreateContactL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuHandler::CreateContactL( ) - { - FUNC_LOG; - CVPbkContactManager& contactManager = - iContactManagerHandler.GetContactManager(); - - const MVPbkFieldTypeList& fieldTypeList = contactManager.FieldTypes(); - const MVPbkFieldType* fieldType= NULL; - - // Try to find appropriate field type. - switch ( iValueType ) - { - case EValueTypeEmail: - { - fieldType = fieldTypeList.Find ( R_VPBK_FIELD_TYPE_EMAILGEN ); - break; - } - case EValueTypePhoneNumber: - { - fieldType = fieldTypeList.Find ( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); - break; - } - default: - { - break; - } - } - - // If field type was found. - if ( fieldType ) - { - // Create temporary store contact. - MVPbkContactStore& store = LocalContactStoreL(); - MVPbkStoreContact* storeContact = store.CreateNewContactLC(); - iStoreContactList.AppendL( storeContact ); - CleanupStack::Pop(); // codescanner::cleanup - - // Add link value to field. - MVPbkStoreContactField* field = - storeContact->CreateFieldLC ( *fieldType ); - MVPbkContactFieldTextData::Cast(field->FieldData()).SetTextL(*iValue); - storeContact->AddFieldL( field ); - CleanupStack::Pop( field ); - - // Add link value to first name too. - // Otherwise t.ex send multimedia shows contact as 'unnamed'. - fieldType = fieldTypeList.Find( R_VPBK_FIELD_TYPE_FIRSTNAME ); - if ( fieldType ) - { - field = storeContact->CreateFieldLC( *fieldType ); - MVPbkContactFieldTextData::Cast( - field->FieldData() ).SetTextL( *iValue ); - storeContact->AddFieldL( field ); - CleanupStack::Pop( field ); - } - - // Set contact set for contact action service. - iContactActionService->SetContactSetL( iStoreContactList ); - // Initiate query actions, returns to QueryActionsComplete. - iContactActionService->QueryActionsL( this ); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuHandler::LocalContactStoreL( ) -// --------------------------------------------------------------------------- -// -MVPbkContactStore& CESMRContactMenuHandler::LocalContactStoreL( ) - { - FUNC_LOG; - CVPbkContactManager& contactManager = - iContactManagerHandler.GetContactManager(); - - // Search for local contact store. - MVPbkContactStoreList& storeList = contactManager.ContactStoresL(); - const TInt count(storeList.Count()); - for ( TInt i = 0; i< count; ++i ) - { - MVPbkContactStore& store = storeList.At( i ); - if ( store.StoreProperties().Local() ) - { - return store; - } - } - // Leave if not found. - User::Leave ( KErrNotFound ); - // Disables warning. - MVPbkContactStore* null = NULL; - return *null; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp --- a/meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,475 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of class CESMRContactMenuUrlHandler. -* -*/ - - -#include "cesmrcontactmenuurlhandler.h" -#include "esmrhelper.h" -#include "cesmriconfield.h" -#include "nmrbitmapmanager.h" -// -#include "cfsccontactactionmenu.h" -#include "cfsccontactactionmenuitem.h" -#include "mfsccontactaction.h" -#include "mfsccontactactionmenumodel.h" -#include "esmrcommands.h" -#include -// -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// for intranet application opening -#include -#include -#include - - -// DEBUG -#include "emailtrace.h" - -/// Unnamed namespace for local definitions -namespace // codescanner::namespace - { -// URL actionmenu uids -const TUid KUidOpenInBrowser = - { - 1 - }; - -const TUid KUidOpenInIntranet = - { - 2 - }; - -const TUid KUidBookmark = - { - 3 // codescanner::magicnumbers - }; - -// Browser app uid -const TUid KUidBrowser = - { - 0x10008D39 - }; - -// Maximum length of Browser bookmark -const TInt KMaxBookmarkNameLength = 50; -// Browser protocol -// 4 is number used for opening the browser -_LIT( KBrowserProtocol, "4 " ); - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::CESMRContactMenuUrlHandler -// --------------------------------------------------------------------------- -// -CESMRContactMenuUrlHandler::CESMRContactMenuUrlHandler( - CFscContactActionMenu& aContactActionMenu ) : - iContactActionMenu( aContactActionMenu ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::NewL -// --------------------------------------------------------------------------- -// -CESMRContactMenuUrlHandler* CESMRContactMenuUrlHandler::NewL( - CFscContactActionMenu& aContactActionMenu ) - { - FUNC_LOG; - CESMRContactMenuUrlHandler* self = - new (ELeave) CESMRContactMenuUrlHandler( aContactActionMenu ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::~CESMRContactMenuUrlHandler( ) -// --------------------------------------------------------------------------- -// -CESMRContactMenuUrlHandler::~CESMRContactMenuUrlHandler( ) - { - FUNC_LOG; - delete iUrl; - delete iServiceHandler; - iIconArray.ResetAndDestroy(); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::Reset( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::Reset( ) - { - FUNC_LOG; - delete iUrl; - iUrl = NULL; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::SetUrlL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::SetUrlL( const TDesC& aUrl ) - { - FUNC_LOG; - HBufC* temp = aUrl.AllocL(); - delete iUrl; - iUrl = temp; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::CreateMenuItemL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::CreateMenuItemL( - TInt aResourceId, - TUid aCommandUid ) - { - FUNC_LOG; - CGulIcon* itemIcon = CreateIconL(aCommandUid); - //ownership transferred - CleanupStack::PushL( itemIcon ); - iIconArray.AppendL( itemIcon ); - CleanupStack::Pop( itemIcon ); - - HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aResourceId ); - CFscContactActionMenuItem* newItem = - iContactActionMenu.Model().NewMenuItemL( *text, - itemIcon, - 1, - EFalse, - aCommandUid ); - - CleanupStack::PopAndDestroy( text ); - CleanupStack::PushL( newItem ); - iContactActionMenu.Model().AddItemL( newItem ); - CleanupStack::Pop( newItem ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::CreateActionMenuIconL -// --------------------------------------------------------------------------- -// -CGulIcon* CESMRContactMenuUrlHandler::CreateIconL(TUid aCommandUid) - { - FUNC_LOG; - // Define default icon object - CFbsBitmap* iconBitmap( NULL ); - CFbsBitmap* iconMaskBitmap( NULL ); - NMRBitmapManager::TMRBitmapId iconID( NMRBitmapManager::EMRBitmapNotSet ); - - //select correct icon for item - if( aCommandUid == KUidOpenInBrowser ) - { - // icon is not available in Cmail - iconID = NMRBitmapManager::EMRBitmapBrowser; - // - } - else if( aCommandUid == KUidOpenInIntranet) - { - // icon is not available in Cmail - iconID = NMRBitmapManager::EMRBitmapIntranet; - // - } - else - { - // icon is not available in Cmail - iconID = NMRBitmapManager::EMRBitmapBookmark; - // - } - - User::LeaveIfError( - NMRBitmapManager::GetSkinBasedBitmap( - iconID, iconBitmap, iconMaskBitmap, KIconSize ) ); - - CGulIcon* icon = CGulIcon::NewL(iconBitmap, iconMaskBitmap); - return icon; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::OptionsMenuAvailable( ) -// --------------------------------------------------------------------------- -// -TBool CESMRContactMenuUrlHandler::OptionsMenuAvailable( ) - { - FUNC_LOG; - return iUrl != NULL; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::InitOptionsMenuL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::InitOptionsMenuL( - CEikMenuPane* aActionMenuPane ) - { - FUNC_LOG; - CEikMenuPaneItem::SData data; - data.iFlags = 0; - data.iCascadeId = 0; - - //action menu is dynamic so commands are assigned dynamically here - TInt command = EESMRCmdActionMenuFirst; - - data.iCommandId = command; - command++;//dynamic command ids - CCoeEnv::Static()->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB ); - aActionMenuPane->AddMenuItemL( data ); - - if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) && - FeatureManager::FeatureSupported( KFeatureIdFfIntranetBrowsing ) ) - { - data.iCommandId = command; - command++;//dynamic command ids - CCoeEnv::Static()->ReadResourceL( - data.iText, R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA ); - aActionMenuPane->AddMenuItemL( data ); - } - - data.iCommandId = command; - CCoeEnv::Static()->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK ); - aActionMenuPane->AddMenuItemL( data ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::IsServiceAvailableL -// --------------------------------------------------------------------------- -// -TBool CESMRContactMenuUrlHandler::IsServiceAvailableL(TInt aResourceId) - { - FUNC_LOG; - //read resource and check if that service is available - TResourceReader reader; - CCoeEnv::Static()->CreateResourceReaderLC( reader, aResourceId ); - // Read first the count of the Criteria Items in resource. - // After this the reader is in correct position at the start - // of the first criteria. - const TInt count = reader.ReadInt16(); - CAiwCriteriaItem* criteriaItem = CAiwCriteriaItem::NewLC(); - criteriaItem->ReadFromResoureL( reader ); - TInt serviceAvailable = ServiceHandlerL().NbrOfProviders(criteriaItem); - CleanupStack::PopAndDestroy( criteriaItem ); - // destroy -> resource reader - CleanupStack::PopAndDestroy( ); // codescanner::cleanup - return serviceAvailable; - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::ExecuteOptionsMenuL -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::ExecuteOptionsMenuL( TInt aCommand ) - { - FUNC_LOG; - TInt command = EESMRCmdActionMenuFirst; - - if( (aCommand == KUidOpenInBrowser.iUid) || (aCommand == command) ) - { - OpenUrlInBrowserL(); - return; - } - command++;//next item in the dynamic list - - if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) && - FeatureManager::FeatureSupported( KFeatureIdFfIntranetBrowsing ) ) - { - if( (aCommand == KUidOpenInIntranet.iUid) || (aCommand == command)) - { - OpenUrlInIntranetL(); - } - command++;//next item in the dynamic list - } - - if( (aCommand == KUidBookmark.iUid) || (aCommand == command) ) - { - BookmarkUrlL(); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::ShowActionMenuL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::ShowActionMenuL( ) - { - FUNC_LOG; - //reset - iIconArray.ResetAndDestroy(); - iContactActionMenu.Model().RemoveAll(); - - //fill list - CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB, - KUidOpenInBrowser); - - if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) && - FeatureManager::FeatureSupported( KFeatureIdFfIntranetBrowsing ) ) - { - CreateMenuItemL( R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA, - KUidOpenInIntranet); - } - - CreateMenuItemL(R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK, KUidBookmark); - - //show list - if ( iContactActionMenu.ExecuteL() == EFscCustomItemSelected ) - { - TUid uid = iContactActionMenu.FocusedItem().ImplementationUid(); - - //handle command - ExecuteOptionsMenuL(uid.iUid); - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::OpenUrlInBrowserL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::OpenUrlInBrowserL( ) - { - FUNC_LOG; - HBufC* param = HBufC::NewLC( KFavouritesMaxUrl ); - param->Des().Copy( KBrowserProtocol() ); - param->Des().Append( *iUrl ); - TApaTaskList taskList( - CEikonEnv::Static()->WsSession() ); // codescanner::eikonenvstatic - TApaTask task = taskList.FindApp( KUidBrowser ); - if ( task.Exists() ) - { - HBufC8* param8 = HBufC8::NewLC( param->Length() ); - param8->Des().Append( *param ); - task.SendMessage( TUid::Uid ( 0 ), *param8 ); // Uid is not used - CleanupStack::PopAndDestroy( param8 ); - } - else - { - RApaLsSession appArcSession; - CleanupClosePushL( appArcSession ); - // connect to AppArc server - User::LeaveIfError( appArcSession.Connect() ); - TThreadId id; - User::LeaveIfError( appArcSession.StartDocument ( - *param, KUidBrowser, id ) ); - CleanupStack::PopAndDestroy( &appArcSession ); - } - CleanupStack::PopAndDestroy( param ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::OpenUrlInIntranetL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::OpenUrlInIntranetL( ) - { - FUNC_LOG; - HBufC8* eightBitUrl = HBufC8::NewLC( iUrl->Length() ); - eightBitUrl->Des().Copy( *iUrl ); - - TAiwGenericParam inParam(EGenericParamURL, TAiwVariant(*eightBitUrl)); - CAiwGenericParamList& inParamList = ServiceHandlerL().InParamListL(); - inParamList.AppendL( inParam ); - - ServiceHandlerL().ExecuteServiceCmdL( - KAiwCmdView, - inParamList, - ServiceHandlerL().OutParamListL() ); - CleanupStack::PopAndDestroy( eightBitUrl ); - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::BookmarkUrlL( ) -// --------------------------------------------------------------------------- -// -void CESMRContactMenuUrlHandler::BookmarkUrlL( ) - { - FUNC_LOG; - // Create an item - CFavouritesItem* item = CFavouritesItem::NewLC(); - item->SetParentFolder( KFavouritesRootUid ); - item->SetType( CFavouritesItem::EItem ); - - // Read default name from resources - HBufC* defaultName =CCoeEnv::Static()->AllocReadResourceLC ( - R_QTN_CALENDAR_DEFAULT_BOOKMARK ); - - TBuf retName; - retName.Copy( defaultName->Des() ); - - // Query bookmark name from user - CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( retName ); - dlg->SetMaxLength( KMaxBookmarkNameLength ); - if ( !dlg->ExecuteLD( R_ADD_BOOKMARK_QUERY_DIALOG ) ) - { - // User press cancel - do not add bookmark - CleanupStack::PopAndDestroy ( 2, item ); // item, defaultName - } - else - { - item->SetNameL( retName ); - item->SetUrlL( *iUrl ); - - RFavouritesSession sess; // codescanner::resourcenotoncleanupstack - RFavouritesDb db; // codescanner::resourcenotoncleanupstack - - User::LeaveIfError( sess.Connect() ); - CleanupClosePushL ( sess ); - User::LeaveIfError( db.Open( sess, KBrowserBookmarks ) ); - CleanupClosePushL ( db ); - - // add item - db.Add( *item, ETrue ); - // Close the database. - db.Close(); - - HBufC * msgBuffer = CCoeEnv::Static()->AllocReadResourceLC( - R_QTN_CALENDAR_BOOKMARK_SAVED ); - CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote( ETrue ); - note->ExecuteLD ( *msgBuffer ); - - // item, db, sess, defaultName, msgBuffer - CleanupStack::PopAndDestroy ( 5, item ); // codescanner::magicnumbers - } - } - -// --------------------------------------------------------------------------- -// CESMRContactMenuUrlHandler::ServiceHandlerL -// --------------------------------------------------------------------------- -// -CAiwServiceHandler& CESMRContactMenuUrlHandler::ServiceHandlerL() - { - FUNC_LOG; - if ( !iServiceHandler ) - { - iServiceHandler = CAiwServiceHandler::NewL(); - iServiceHandler->AttachL( R_INTRANET_AIW_INTEREST ); - } - return *iServiceHandler; - } -// End of file - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrdynamicitemselectionlist.cpp --- a/meetingrequest/mrgui/src/cesmrdynamicitemselectionlist.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrdynamicitemselectionlist.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -21,7 +21,7 @@ #include "cesmrdynamicitemselectionlist.h" #include -#include +#include #include #include #include diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmreditordialog.cpp --- a/meetingrequest/mrgui/src/cesmreditordialog.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmreditordialog.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,41 +15,7 @@ * */ -#include "emailtrace.h" #include "cesmreditordialog.h" - -// -#include "esmrdef.h" -#include -#include "cesmrpolicy.h" -// -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -// -#include -// -#include "esmrcommands.h" -// - -#include -#include -#include - #include "esmrgui.hrh" #include "cesmrview.h" #include "mesmrmeetingrequestentry.h" @@ -68,8 +34,41 @@ #include "cesmraddressinfohandler.h" #include "cesmrfeaturesettings.h" #include "mesmrfieldevent.h" +#include "esmrconfig.hrh" +#include "esmrdef.h" +#include "esmrcommands.h" +#include "cesmrpolicy.h" +#include "cmrtoolbar.h" +#include "mmrpolicyprovider.h" +#include "mmrinfoprovider.h" +#include "cesmrcaldbmgr.h" +#include "cmrfocusstrategyeditor.h" +#include "cesmrfieldbuilderinterface.h" -#include "esmrconfig.hrh" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" // Removed profiling. @@ -77,7 +76,6 @@ namespace { // codescanner::namespace #ifdef _DEBUG - _LIT( KESMREditDlgPanicTxt, "ESMREDITORDIALOG" ); /** Enumeration for panic codes */ enum TESMREditDlgPanicCode { @@ -88,6 +86,7 @@ void Panic( TESMREditDlgPanicCode aPanic ) { + _LIT( KESMREditDlgPanicTxt, "ESMREDITORDIALOG" ); User::Panic ( KESMREditDlgPanicTxt, aPanic ); } #endif @@ -137,36 +136,8 @@ } else { - TInt result = - CESMRListQuery::ExecuteL( aQueryType ); - - if( KErrCancel == result ) - { - // User has cancelled selecting opening the instance - User::Leave( KErrCancel ); - } - - TESMRThisOccurenceOrSeriesQuery recurrenceModRule = - static_cast( result ); - - switch( recurrenceModRule ) - { - case EESMRThisOccurence: - { - aEntry.SetModifyingRuleL( - MESMRMeetingRequestEntry::EESMRThisOnly ); - } - break; - case EESMRSeries: - { - aEntry.SetModifyingRuleL( - MESMRMeetingRequestEntry::EESMRAllInSeries ); - } - break; - default: - __ASSERT_DEBUG( EFalse, Panic(EESMREditDlgInvalidSeriesResult)); - break; - } + aEntry.SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRThisOnly ); } } @@ -174,13 +145,13 @@ * Creates correct type of storage for editing calendar entry. * @param aCommandObserver Reference to command observer * @param aEntry Reference to ES calendar entry - * @param aPolicy. Pointer to used policy. + * @param aPolicyProvider. Pointer to used policy. * @param aResponseObserver Pointer to response observer. */ CESMRFieldStorage* CreateCorrectStorageLC( MESMRFieldEventObserver& aEventObserver, MESMRCalEntry& aEntry, - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver ) { CESMRFieldStorage* storage = NULL; @@ -188,8 +159,7 @@ MESMRCalEntry::TESMRRecurrenceModifyingRule rule( aEntry.RecurrenceModRule() ); - TESMRViewMode mode( - aPolicy->ViewMode() ); + TESMRViewMode mode( aPolicy.ViewMode() ); if ( ( aEntry.IsRecurrentEventL() && rule == MESMRCalEntry::EESMRThisOnly ) || @@ -253,9 +223,10 @@ // --------------------------------------------------------------------------- // CESMREditorDialog::CESMREditorDialog( - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ) : - iEntry( aEntry), iCallback( aCallback) + iInfoProvider( aInfoProvider ), + iCallback( aCallback) { FUNC_LOG; // Do nothing @@ -268,18 +239,6 @@ CESMREditorDialog::~CESMREditorDialog( ) { FUNC_LOG; - if ( iFeatureManagerInitialized ) - { - FeatureManager::UnInitializeLib(); - } - - if ( iServiceHandler ) - { - iServiceHandler->DetachMenu ( - R_MR_EDITOR_ORGANIZER_MENU, - R_PS_AIW_INTEREST ); - delete iServiceHandler; - } delete iESMRSendUI; if ( iTitlePane ) @@ -288,14 +247,13 @@ iTitlePane->Rollback(); delete iTitlePane; } - delete iInterimUtils; - delete iLocationPluginHandler; - delete iAddressInfoHandler; - delete iFeatures; + delete iToolbar; + delete iFocusStrategy; + // iView is deleted by framework because it uses the // custom control mechanism. } @@ -305,15 +263,14 @@ // --------------------------------------------------------------------------- // EXPORT_C CESMREditorDialog* CESMREditorDialog::NewL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ) { FUNC_LOG; CESMREditorDialog* self = - new (ELeave) CESMREditorDialog( aEntry, aCallback ); + new (ELeave) CESMREditorDialog( aInfoProvider, aCallback ); CleanupStack::PushL( self ); - self->ConstructL( aPolicy ); + self->ConstructL(); CleanupStack::Pop( self ); return self; } @@ -322,31 +279,42 @@ // CESMREditorDialog::ConstructL // --------------------------------------------------------------------------- // -void CESMREditorDialog::ConstructL( - CESMRPolicy* aPolicy ) +void CESMREditorDialog::ConstructL() { FUNC_LOG; CAknDialog::ConstructL ( R_MREDITOR_MENUBAR ); - iPolicy = aPolicy; iESMRSendUI = CESMRSendUI::NewL (EESMRCmdSendAs ); - FeatureManager::InitializeLibL(); - iFeatureManagerInitialized = ETrue; + MESMRCalEntry* entry = iInfoProvider.EntryL(); + CESMRFieldStorage* storage = CreateCorrectStorageLC( + *this, + *entry, + iInfoProvider.PolicyProvider().CurrentPolicy(), + this ); - // remove custom feature KFeatureIdPrintingFrameworkCalendarPlugin - // + iStartTimeUtc = entry->Entry().StartTimeL().TimeUtcL(); - CESMRFieldStorage* storage = - CreateCorrectStorageLC( *this, iEntry, aPolicy, this ); + //clean previous toolbar if there is, and be sure restore toolbar area to EMainPane + iToolbar = CMRToolbar::NewL(); TRect clientRect; AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, clientRect ); + // Create focus strategy + iFocusStrategy = CMRFocusStrategyEditor::NewL( *storage ); + // storage ownership is transferred to CESMRView - iView = CESMRView::NewL( storage, iEntry, clientRect ); + iView = CESMRView::NewL( + storage, + *entry, + clientRect, + *iFocusStrategy, + *iToolbar ); + + iView->SetViewMode( EESMREditMR ); CleanupStack::Pop( storage ); // try to find subject field and set title pane observer @@ -366,62 +334,21 @@ { field->SetTitlePaneObserver( iView ); break; - } + } default: - break; + break; } } - TInt titleStringId = -1; - switch ( iEntry.Type() ) - { - case MESMRCalEntry::EESMRCalEntryMeetingRequest: - titleStringId = R_QTN_MEET_REQ_TITLE_MEETING; - break; - case MESMRCalEntry::EESMRCalEntryMeeting: - titleStringId = R_QTN_CALENDAR_TITLE_MEETING; - break; - case MESMRCalEntry::EESMRCalEntryTodo: - titleStringId = R_QTN_CALENDAR_TITLE_TODO; - break; - case MESMRCalEntry::EESMRCalEntryMemo: - titleStringId = R_QTN_CALENDAR_TITLE_MEMO; - break; - case MESMRCalEntry::EESMRCalEntryReminder: - break; - case MESMRCalEntry::EESMRCalEntryAnniversary: - titleStringId = R_QTN_CALENDAR_TITLE_ANNIVERSARY; - break; - default: - break; - } - if ( titleStringId != -1 ) - { - iTitlePane = CESMRTitlePaneHandler::NewL( *iEikonEnv ); - HBufC* titleText = StringLoader::LoadLC( titleStringId, iCoeEnv ); - iTitlePane->SetNewTitle( titleText ); - CleanupStack::PopAndDestroy( titleText ); - } - + SetTitleL(); + if(!iInterimUtils) { iInterimUtils = CCalenInterimUtils2::NewL(); } - + iFeatures = CESMRFeatureSettings::NewL(); - - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUILocationFeatures ) ) - { - if ( iPolicy->FieldL( EESMRFieldLocation ).iFieldMode == EESMRFieldModeEdit ) - { - iMenuBar->SetContextMenuTitleResourceId( R_MR_EDITOR_CONTEXT_MENU ); - } - else - { - iMenuBar->SetContextMenuTitleResourceId( R_MR_VIEWER_CONTEXT_MENU ); - } - } + } // --------------------------------------------------------------------------- @@ -477,7 +404,7 @@ { FUNC_LOG; TBool res( EFalse ); - + MESMRCalEntry* entry = iInfoProvider.EntryL(); switch ( aButtonId ) { case EAknSoftkeyOptions: @@ -486,25 +413,53 @@ CAknDialog::DisplayMenuL(); break; } + case EAknSoftkeySend: + { + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == entry->Type() ) + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( + iInfoProvider.EntryL() ); + + const CESMRPolicy& policy = Policy(); + if ( policy.IsDefaultCommand(EESMRCmdSendMRUpdate ) && + ( mrEntry->IsSentL() && mrEntry->IsStoredL() ) ) + { + ProcessCommandL( EESMRCmdSendMRUpdate ); + } + else + { + ProcessCommandL( EESMRCmdSendMR ); + } + } + break; + } case EESMRCmdSaveMR: { ProcessCommandL( EESMRCmdSaveMR ); break; } + case EESMREditorAddAttachment: + { + ProcessCommandL( EESMREditorAddAttachment ); + break; + } + + case EESMRCmdLongtapDetected: case EAknSoftkeyContextOptions: { - // Show context menu - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUILocationFeatures ) ) + if( SetContextMenuL() ) { - iMenuBar->TryDisplayContextMenuBarL(); + ShowContextMenuL();; } - break; + break; } case EESMRCmdAlarmOn: case EESMRCmdAlarmOff: case EESMRCmdOpenPriorityQuery: case EESMRCmdOpenSyncQuery: + case EESMRCmdOpenUnifiedEditorQuery: + case EESMRCmdOpenMultiCalenSelectQuery: case EESMRCmdOpenRecurrenceQuery: case EESMRCmdOpenAlarmQuery: case EESMRCmdCheckEvent: @@ -533,7 +488,7 @@ { // Exit dialog TRAPD( err, HandleExitL() ) - + switch ( err ) { case KErrNone: @@ -581,19 +536,18 @@ FUNC_LOG; CAknDialog::ActivateL(); iView->InternalizeL(); - + // Notification that MR editor is ready to be shown on screen. - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + MESMRCalEntry* entry = iInfoProvider.EntryL(); + if ( entry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) { - TTime start = iEntry.Entry().StartTimeL().TimeUtcL(); - TTime now; - now.UniversalTime(); - if ( start < now ) - { - iOccursInPast = ETrue; - } iCallback.ProcessCommandL( EESMRCmdEditorInitializationComplete ); } + + // initial stripe color + MESMRCalDbMgr& dbMgr = entry->GetDBMgr(); + TPtrC calenName = dbMgr.GetCalendarNameByEntryL( *entry ); + dbMgr.SetCurCalendarByNameL( calenName ); } // --------------------------------------------------------------------------- @@ -605,16 +559,16 @@ FUNC_LOG; TBool ret(ETrue); - - if ( ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest || - iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeeting ) && - iEntry.IsStoredL() && iEntry.IsRecurrentEventL() && - MESMRCalEntry::EESMRAllInSeries == iEntry.RecurrenceModRule() ) + MESMRCalEntry* entry = iInfoProvider.EntryL(); + if ( ( entry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest || + entry->Type() == MESMRCalEntry::EESMRCalEntryMeeting ) && + entry->IsStoredL() && entry->IsRecurrentEventL() && + MESMRCalEntry::EESMRAllInSeries == entry->RecurrenceModRule() ) { TDateTime originalDate = - iEntry.OriginalEntry().StartTimeL().TimeLocalL().DateTime(); + entry->OriginalEntry().StartTimeL().TimeLocalL().DateTime(); TDateTime modifiedDate = - iEntry.Entry().StartTimeL().TimeLocalL().DateTime(); + entry->Entry().StartTimeL().TimeLocalL().DateTime(); if ( !IsSameDay( originalDate, modifiedDate ) ) { @@ -640,11 +594,10 @@ TRAPD( err, DoProcessCommandL( aCommand ) ); if ( err != KErrNone && err != KErrCancel && - err != KErrArgument&& - err !=EESMRCmdSendMR) + err != KErrArgument ) { User::Leave(err); - } + } } // --------------------------------------------------------------------------- @@ -657,27 +610,10 @@ FUNC_LOG; CAknDialog::ProcessCommandL ( aCommand ); + MESMRCalEntry* entry = iInfoProvider.EntryL(); + switch ( aCommand ) { - case EESMRCmdPrint: //Fall through - case EESMRCmdPrint_Reserved1: //Fall through - case EESMRCmdPrint_Reserved2: //Fall through - case EESMRCmdPrint_Reserved3: //Fall through - case EESMRCmdPrint_Reserved4: - { - iView->ExternalizeL(); // no force validation - TInt res(KErrGeneral); - res = iCallback.ProcessCommandWithResultL ( EESMRCmdSaveMR ); - - if (res == KErrNone ) - { - this->MakeVisible(EFalse); - HandlePrintCommandL (aCommand ); - this->MakeVisible(ETrue); - } - break; - } - case EESMRCmdSendAs: { SendCalendarEntryL (aCommand ); @@ -687,37 +623,38 @@ case EESMRCmdCalEntryUISend: { User::LeaveIfError( - iCallback.ProcessCommandWithResultL ( aCommand )); - break; - } - case EESMRCmdCalEntryUIDelete: - { - iView->ExternalizeL(); // no force validation - if (!(iCallback.ProcessCommandWithResultL(aCommand) == KErrCancel)) - { - TryExitL( EESMRCmdCalEntryUIDelete ); - } + iCallback.ProcessCommandWithResultL ( aCommand )); break; } case EESMRCmdCalEntryUIAddParticipants: { - iView->ExternalizeL (); // no force validation - TInt result; - TRAPD(err,result=iCallback.ProcessCommandWithResultL ( aCommand )) - if (err != EESMRCmdSendMR&&err!=KErrNone) - { - User::Leave(err); - } - User::LeaveIfError(result); - TryExitL ( EESMRCmdForceExit ); + TRAPD( err, SwitchEntryTypeL( EMRCommandSwitchToMR, ETrue ) ) + + if (KErrArgument == err ) + { + // There was validation error --> Just show the + // existing editor. + err = KErrNone; + } + else if ( err ) + { + iCoeEnv->HandleError( err ); + TryExitL( EESMRCmdForceExit ); + } + + break; + } + case EAknSoftkeyClose: + { + TryExitL ( EAknCmdExit ); break; } case EEikBidCancel: //Fall through case EAknCmdExit: - { + { TryExitL ( aCommand ); break; - } + } case EAknCmdHelp: { iView->LaunchEditorHelpL ( ); @@ -749,27 +686,31 @@ if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) { - LocationPluginHandlerL().StoreLocationToHistoryL( iEntry ); + LocationPluginHandlerL().StoreLocationToHistoryL( *entry ); } - - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryTodo ) + + if ( entry->Type() == MESMRCalEntry::EESMRCalEntryTodo ) { CESMRGlobalNote* note = - CESMRGlobalNote::NewL( - CESMRGlobalNote::EESMRTodoEntrySaved ); + CESMRGlobalNote::NewL( + CESMRGlobalNote::EESMRTodoEntrySaved ); note->ExecuteLD(); } else { CESMRGlobalNote* note = - CESMRGlobalNote::NewL( - CESMRGlobalNote::EESMREntrySaved ); + CESMRGlobalNote::NewL( + CESMRGlobalNote::EESMREntrySaved ); note->ExecuteLD(); } } } break; - + case EESMRCmdSaveCloseMR: + { + TryExitL( EAknSoftkeyDone ); + break; + } case EESMRCmdSendMR: //Fall through case EESMRCmdSendMRUpdate: { @@ -785,9 +726,9 @@ if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) { - LocationPluginHandlerL().StoreLocationToHistoryL( iEntry ); + LocationPluginHandlerL().StoreLocationToHistoryL( *entry ); } - + TInt exitCode = aCommand == EESMRCmdDeleteMR ? EESMRCmdDeleteMR : EAknSoftkeyDone; TryExitL ( exitCode ); @@ -796,59 +737,69 @@ break; case EESMRCmdDeleteMR: + case EESMRCmdCalEntryUIDelete: { - if ( iEntry.Type () == MESMRCalEntry::EESMRCalEntryMeetingRequest ) - { - TBool okToDelete = ETrue; + TBool okToDelete = ETrue; - if ( iEntry.IsRecurrentEventL() ) + if ( entry->IsRecurrentEventL() ) + { + SetRecurrenceModRuleL( + *entry, + CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + } + else + { + if( CCalenInterimUtils2::IsMeetingRequestL( entry->Entry() ) ) { - SetRecurrenceModRuleL( - iEntry, - CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + okToDelete = CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery::EESMRDeleteMR ); } else { okToDelete = CESMRConfirmationQuery::ExecuteL( - CESMRConfirmationQuery::EESMRDeleteMR ); - + CESMRConfirmationQuery::EESMRDeleteEntry ); } + } - if ( okToDelete ) + if ( okToDelete ) + { + // When deleting we do not need to externalize entry + if( entry->IsStoredL() ) { - // When deleting we do not need to externalize entry TInt res = iCallback.ProcessCommandWithResultL( aCommand ); if ( res != KErrCancel ) { - TInt exitCode = aCommand == EESMRCmdDeleteMR ? - EESMRCmdDeleteMR : EAknSoftkeyDone; - TryExitL ( exitCode ); + TryExitL( EESMRCmdDeleteMR ); } } + else + { + TryExitL( EESMRCmdDeleteMR ); + } } } break; - + case EESMRCmdAssignFromMap: case EESMRCmdLandmarks: case EESMRCmdPreviousLocations: - { + { if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIMnFwIntegration | CESMRFeatureSettings::EESMRUILandmarksIntegration | CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) { TBool ignoreQuery = EFalse; - + if ( aCommand == EESMRCmdAssignFromMap ) { - HBufC* oldLocation = iEntry.Entry().LocationL().AllocLC(); + HBufC* oldLocation = entry->Entry().LocationL().AllocLC(); iView->ExternalizeL(); - + // if old and new locations are different and old location // exists, the user is updating existing location. Let's discard // the existing coordinates by using command EESMRCmdUpdateFromMap - if ( ( iEntry.Entry().LocationL().Compare( *oldLocation ) != 0 + if ( ( entry->Entry().LocationL().Compare( *oldLocation ) != 0 && oldLocation->Length() != 0 ) || iLocationModified ) { @@ -857,7 +808,7 @@ else if ( oldLocation->Length() == 0 ) { // Assigning location from Maps for first time. - ignoreQuery = EFalse; + ignoreQuery = EFalse; } CleanupStack::PopAndDestroy( oldLocation ); oldLocation = NULL; @@ -866,41 +817,73 @@ { iView->ExternalizeL(); } - + iLocationModified |= LocationPluginHandlerL().HandleCommandL( aCommand, - iEntry, - ignoreQuery ); + *entry, + ignoreQuery ); iView->InternalizeL(); iView->SetControlFocusedL( EESMRFieldLocation ); } - break; - } + break; + } case EESMRCmdSearchFromContacts: - { + { if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIContactsIntegration ) ) { iView->ExternalizeL(); iLocationModified |= - AddressInfoHandlerL().SearchAddressFromContactsL( iEntry ); + AddressInfoHandlerL().SearchAddressFromContactsL( *entry ); iView->InternalizeL(); iView->SetControlFocusedL( EESMRFieldLocation ); } - break; - } + break; + } // Scenarios with viewer location field in editor dialog. case EESMRCmdShowOnMap: case EESMRCmdSearchFromMap: { - LocationPluginHandlerL().HandleCommandL(aCommand, iEntry ); + if ( iFeatures->FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + LocationPluginHandlerL().HandleCommandL(aCommand, *entry ); + } break; - } + } case EAknCmdOpen: - { - HandleOpenCmdL(); - break; - } + { + HandleOpenCmdL(); + break; + } + case EESMRCmdAttendeeInsertContact: + { + OkToExitL(EESMRCmdAttendeeInsertContact); + break; + } + /* + * Attachment field editor context menu commands + */ + case EESMREditorOpenAttachment: + case EESMREditorRemoveAttachment: + case EESMREditorRemoveAllAttachments: + case EESMREditorAddAttachment: + { + iView->ProcessEditorCommandL( aCommand ); + break; + } + + case EMRCommandMyLocations: + { + iView->ExternalizeL(); + iLocationModified |= + LocationPluginHandlerL().HandleCommandL( aCommand, + *entry, + EFalse ); + iView->InternalizeL(); + iView->SetControlFocusedL( EESMRFieldLocation ); + break; + } default: break; } @@ -915,77 +898,80 @@ CEikMenuPane* aMenu ) { FUNC_LOG; + MESMRCalEntry* entry = iInfoProvider.EntryL(); - if ( iServiceHandler && iServiceHandler->HandleSubmenuL ( *aMenu ) ) - { - return; - } + TMRMenuStyle menuStyle( EMROptionsMenu ); if ( aResourceId == R_MR_EDITOR_ORGANIZER_MENU ) { - - if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) - { - // remove help support in pf5250 - aMenu->SetItemDimmed( EAknCmdHelp, ETrue); - } - + const CESMRPolicy& policy = Policy(); const TInt count(aMenu->NumberOfItemsInPane()); - for (TInt i(0); i < count; i++ ) - { - CEikMenuPaneItem::SData& item = aMenu->ItemDataByIndexL ( i ); - aMenu->SetItemDimmed ( - item.iCommandId, - !iPolicy->IsDefaultCommand(item.iCommandId) ); - } - - //Open command - if ( iView->IsComponentFocused( EESMRFieldSync ) || - iView->IsComponentFocused( EESMRFieldRecurrence ) || - iView->IsComponentFocused( EESMRFieldAlarm ) || - iView->IsComponentFocused( EESMRFieldPriority )) - { - aMenu->SetItemDimmed( EAknCmdOpen, EFalse ); - } - - if( iInterimUtils && !(iInterimUtils->MRViewersEnabledL())) - { - aMenu->SetItemDimmed( EESMRCmdCalEntryUIAddParticipants, ETrue ); - } - - // if the entry is saved (stored) and sent to recipients, - // show 'Send update', otherwise just 'Send' - TBool sentAndStored = iEntry.IsSentL() && iEntry.IsStoredL(); + for ( TInt i(0); i < count; i++ ) + { + CEikMenuPaneItem::SData& item = aMenu->ItemDataByIndexL ( i ); - // enable send only if attendee editors contain attendees and - // entry does not occur in past (unless if this is forwarded - // MR in which case the "in past" sending is also allowed). - TBool occurredInPastCheckPassed( !iOccursInPast ); - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry.Type() ) + if ( item.iCommandId ) + { + // Checking from policy for commands that has valid command id and + aMenu->SetItemDimmed ( + item.iCommandId, + !policy.IsDefaultCommand(item.iCommandId) ); + } + } + + //Open command + if ( iView->IsComponentFocused( EESMRFieldSync ) || + iView->IsComponentFocused( EESMRFieldRecurrence ) || + iView->IsComponentFocused( EESMRFieldAlarm ) || + iView->IsComponentFocused( EESMRFieldPriority )) { - // This is meeting request - MESMRMeetingRequestEntry* mrEntry = - static_cast( &iEntry ); - occurredInPastCheckPassed = mrEntry->IsForwardedL(); + aMenu->SetItemDimmed( EAknCmdOpen, EFalse ); } - TBool sendEnabled = - ( iRequiredAttendeesEnabled | iOptionalAttendeesEnabled ) && - occurredInPastCheckPassed; + if( iInterimUtils && !(iInterimUtils->MRViewersEnabledL())) + { + aMenu->SetItemDimmed( EESMRCmdCalEntryUIAddParticipants, ETrue ); + } - if ( iPolicy->IsDefaultCommand( EESMRCmdSendMR ) ) + + TBool sendEnabled( EFalse ); + TBool sentAndStored( EFalse ); + + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == entry->Type() ) + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( iInfoProvider.EntryL() ); + + // if the entry is saved (stored) and sent to recipients, + // show 'Send update', otherwise just 'Send' + sentAndStored = mrEntry->IsSentL() && mrEntry->IsStoredL(); + + // enable send only if attendee editors contain attendees and + // entry does not occur in past. + TBool bOccursInPast( OccursInPast( iStartTimeUtc ) ); + + TBool sendEnabled = ( !bOccursInPast && + ( mrEntry->RoleL() == EESMRRoleOrganizer ) && + ( iRequiredAttendeesEnabled | iOptionalAttendeesEnabled ) && + ((( mrEntry->RoleL() == EESMRRoleOrganizer ) && + ( iInfoProvider.PolicyProvider().CurrentPolicy().ViewMode() == EESMREditMR )) || + ( iInfoProvider.PolicyProvider().CurrentPolicy().ViewMode() == EESMRForwardMR ) + )); + } + + if ( policy.IsDefaultCommand( EESMRCmdSendMR ) ) { aMenu->SetItemDimmed ( EESMRCmdSendMR, !sendEnabled ); } - if ( iPolicy->IsDefaultCommand(EESMRCmdSendMRUpdate ) ) + if ( policy.IsDefaultCommand(EESMRCmdSendMRUpdate ) ) { if ( sendEnabled ) { - //EESMRCmdSendMRUpdate and EESMRCmdSendMR shouldn't + //EESMRCmdSendMRUpdate and EESMRCmdSendMR shouldn't //be visible at the same time aMenu->SetItemDimmed( EESMRCmdSendMRUpdate, !sentAndStored ); - if(iPolicy->IsDefaultCommand( EESMRCmdSendMR ) ) + if( policy.IsDefaultCommand( EESMRCmdSendMR ) ) { aMenu->SetItemDimmed( EESMRCmdSendMR, sentAndStored ); } @@ -996,12 +982,22 @@ } } - if(iPolicy->IsDefaultCommand( EESMRCmdViewTrack ) ) + if ( policy.IsDefaultCommand( EESMRCmdAddOptAttendee ) ) + { + // if optional attendee (recipient) is already visible, don't show + // the menu item. + TBool isVisible = + iView->IsControlVisible( EESMRFieldOptAttendee ); + aMenu->SetItemDimmed( EESMRCmdAddOptAttendee, isVisible ); + } + + if ( policy.IsDefaultCommand( EESMRCmdViewTrack ) ) { //only show tracking view option when item is sent, stored //and when cfsmailbox actually supports attendee status - if (SupportsAttendeeStatusL()) + if ( SupportsMailBoxCapabilityL( + MESMRBuilderExtension::EMRCFSAttendeeStatus ) ) { aMenu->SetItemDimmed( EESMRCmdViewTrack, !sentAndStored ); } @@ -1009,84 +1005,65 @@ { aMenu->SetItemDimmed( EESMRCmdViewTrack, ETrue ); } - - } - - if ( iPolicy->IsDefaultCommand( EESMRCmdAddOptAttendee ) ) - { - // if optional attendee (recipient) is already visible, don't show - // the menu item. - TBool isVisible = - iView->IsComponentVisible( EESMRFieldOptAttendee ); - aMenu->SetItemDimmed( EESMRCmdAddOptAttendee, isVisible ); } // Insert send ui menu for all other entry types than meeting request - if ( iEntry.Type ( )!= MESMRCalEntry::EESMRCalEntryMeetingRequest ) + if ( entry->Type ( )!= MESMRCalEntry::EESMRCalEntryMeetingRequest ) { TryInsertSendMenuL( aMenu ); } + } - if ( FeatureManager::FeatureSupported( - KFeatureIdPrintingFrameworkCalendarPlugin ) ) - { - // Initiliaze menu - iServiceHandler->InitializeMenuPaneL( - *aMenu, - aResourceId, - EESMRCmdPrint, - iServiceHandler->InParamListL() ); - } - else - { - aMenu->SetItemDimmed( EESMRCmdPrint, ETrue ); - } - - HandleLocationOptionsL( aResourceId, aMenu ); - } - if ( aResourceId == R_LOCATION_OPTIONS || aResourceId == R_MR_EDITOR_LOCATION_MENU || aResourceId == R_MR_VIEWER_LOCATION_MENU ) { + menuStyle = EMRContextMenu; HandleLocationOptionsL( aResourceId, aMenu ); } + if ( aResourceId == R_MR_EDITOR_ATTACHMENT_CONTEXT_MENU + || aResourceId == R_MR_EDITOR_ATTENDEE_CONTEXT_MENU ) + { + menuStyle = EMRContextMenu; + } + + // Field specific context menu + iView->DynInitMenuPaneL( menuStyle, aResourceId, aMenu ); } // --------------------------------------------------------------------------- // CESMREditorDialog::SupportsAttendeeStatusL // --------------------------------------------------------------------------- // -TBool CESMREditorDialog::SupportsAttendeeStatusL( ) +TBool CESMREditorDialog::SupportsMailBoxCapabilityL( + MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa ) { FUNC_LOG; - TBool supportsAttendeeStatus(EFalse); + TBool supportsCapability( EFalse ); CESMRFieldBuilderInterface* plugin = NULL; - TRAPD( error, - plugin = CESMRFieldBuilderInterface::CreatePluginL( - TUid::Uid(KESMRUIFieldBuilderPluginImplUId) ) ); + TRAPD( error, + plugin = CESMRFieldBuilderInterface::CreatePluginL( + TUid::Uid( KESMRUIFieldBuilderPluginImplUId ) ) ); CleanupStack::PushL( plugin ); - - if (error == KErrNone && plugin) + + if ( error == KErrNone && plugin ) { TUid uid = {0}; - MESMRBuilderExtension* extension = - static_cast( plugin->ExtensionL(uid) ); + MESMRBuilderExtension* extension = + static_cast( plugin->ExtensionL( uid ) ); - if (extension) + if ( extension ) { - supportsAttendeeStatus = - extension->CFSMailBoxCapabilityL( - MESMRBuilderExtension::EMRCFSAttendeeStatus); + supportsCapability = + extension->CFSMailBoxCapabilityL( aCapa ); } } CleanupStack::PopAndDestroy( plugin ); - return supportsAttendeeStatus; + return supportsCapability; } - // --------------------------------------------------------------------------- // CESMREditorDialog::ExecuteViewLD // --------------------------------------------------------------------------- @@ -1134,28 +1111,39 @@ { FUNC_LOG; TInt res( KErrNone); - + iView->ExternalizeL(); // no force validation - TBool isStored = iEntry.IsStoredL(); + + // If no attendees, switch MR to regular meeting + VerifyMeetingRequestL(); - if ( iEntry.IsEntryEditedL() ) + // Get the entry to be confirmed for saving + MESMRCalEntry* entry = iInfoProvider.EntryL(); + + // if entry is stored and type changed, we will always save it + if( entry->IsStoredL() && entry->IsEntryTypeChangedL() ) { - if ( IsAllowedToSaveL() ) + res = TryToSaveEntryL(); + } + // If entry is new and type changed, we have to see, if something has + // changed, before we save it. + else if( !entry->IsStoredL() && entry->IsEntryTypeChangedL() ) + { + if( entry->IsEntryEditedL() ) { - res = iCallback.ProcessCommandWithResultL( EESMRCmdSaveMR ); - - if ( res == KErrNone - && iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) - { - LocationPluginHandlerL().StoreLocationToHistoryL( iEntry ); - } - } - else - { - res = KErrCancel; + res = TryToSaveEntryL(); } } + // Entry is not type changed, we will use normal procedure to + // see if entry will be saved or not. + else + { + if( entry->IsEntryEditedL() ) + { + res = TryToSaveEntryL(); + } + } + return res; } @@ -1166,27 +1154,36 @@ TInt CESMREditorDialog::HandleForcedExitL( TBool aShowConfirmationQuery ) // codescanner::intleaves { FUNC_LOG; + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + TInt res( KErrNone); iView->ExternalizeL ( ETrue ); // force validation should be used - if ( iEntry.IsEntryEditedL() && - iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest) + // If no attendees, switch MR to regular meeting + VerifyMeetingRequestL(); + + // The entry data may be changed by the above function VerifyMeetingRequestL() + entry = iInfoProvider.EntryL(); + + if ( entry->IsEntryEditedL() ) { if ( !aShowConfirmationQuery || CESMRConfirmationQuery::ExecuteL( - CESMRConfirmationQuery::EESMRSaveChanges )) + CESMRConfirmationQuery::EESMRSaveChanges )) { res = iCallback.ProcessCommandWithResultL( EESMRCmdSaveMR ); - + if ( res == KErrNone && iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) { - LocationPluginHandlerL().StoreLocationToHistoryL( iEntry ); + LocationPluginHandlerL().StoreLocationToHistoryL( *entry ); } } } + return res; } @@ -1198,6 +1195,9 @@ TInt aCommandId ) { FUNC_LOG; + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + iView->ExternalizeL(); // no force validation TInt res(KErrGeneral); res = iCallback.ProcessCommandWithResultL( EESMRCmdSaveMR ); @@ -1207,21 +1207,21 @@ if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) { - LocationPluginHandlerL().StoreLocationToHistoryL( iEntry ); + LocationPluginHandlerL().StoreLocationToHistoryL( *entry ); } - + // we don't need MenuPane in CCalSend but we need it for the API CEikMenuPane* pane = NULL; // Show menu to user - // CCalenSend handles selection internally, + // CCalenSend handles selection internally, // so we don't get anything in return iESMRSendUI->DisplaySendCascadeMenuL( *pane ); // Try to send if (iESMRSendUI->CanSendL( aCommandId ) ) { - iESMRSendUI->SendAsVCalendarL( aCommandId, iEntry.Entry ( ) ); + iESMRSendUI->SendAsVCalendarL( aCommandId, entry->Entry ( ) ); } } } @@ -1246,50 +1246,14 @@ } // --------------------------------------------------------------------------- -// CESMREditorDialog::HandlePrintCommandL -// --------------------------------------------------------------------------- -// -void CESMREditorDialog::HandlePrintCommandL( - TInt aCommand ) - { - FUNC_LOG; - CAiwGenericParamList& inParams = iServiceHandler->InParamListL ( ); - - // Param date - - TCalTime startTime = iEntry.Entry().StartTimeL ( ); - - TAiwGenericParam dateParam( EGenericParamDateTime); - TTime activeDay = startTime.TimeUtcL ( ); - - TAiwGenericParam calendarParam( EGenericParamCalendarItem); - calendarParam.Value().Set ( TUid::Uid (iEntry.Entry().LocalUidL ( ) ) ); - inParams.AppendL ( calendarParam ); - - // Append date param - dateParam.Value().Set ( activeDay ); - inParams.AppendL ( dateParam ); - - const TUid uid( TUid::Uid( KUidCalendarApplication ) ); - TAiwGenericParam uidParam( EGenericParamApplication); - uidParam.Value().Set ( uid ); - inParams.AppendL ( uidParam ); - - // Execute service command with given parameters - iServiceHandler->ExecuteMenuCmdL ( aCommand, - inParams, iServiceHandler->OutParamListL ( ), 0, - NULL ); - } - -// --------------------------------------------------------------------------- // CESMREditorDialog::HandleOpenCmdL // --------------------------------------------------------------------------- // void CESMREditorDialog::HandleOpenCmdL() - { + { FUNC_LOG; - iView->ProcessEditorCommandL( EAknCmdOpen ); - } + iView->ProcessEditorCommandL( EAknCmdOpen ); + } // --------------------------------------------------------------------------- // CESMREditorDialog::HandleLocationOptionsL @@ -1299,184 +1263,34 @@ CEikMenuPane* aMenuPane ) { FUNC_LOG; - TInt menuPos = KErrNotFound; - - if ( aResourceId == R_MR_EDITOR_ORGANIZER_MENU ) - { - - if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - - if ( iPolicy->FieldL( EESMRFieldLocation ).iFieldMode == EESMRFieldModeView ) - { - // Dim Location cascade menu with viewer field - aMenuPane->SetItemDimmed( EESMRCmdAddLocation, ETrue ); - - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) - { - TBool showOnMap = - LocationPluginHandlerL().IsCommandAvailableL( EESMRCmdShowOnMap, - iEntry ); - aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); - aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, showOnMap ); - } - } - else if ( aMenuPane->MenuItemExists( EESMRCmdAddLocation, menuPos ) ) - { - TInt numOptions = 0; // number of sub menu items - TInt commandId = 0; // command id if only one sub menu item - - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) - { - ++numOptions; - commandId = EESMRCmdAssignFromMap; - } - - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIContactsIntegration ) ) - { - ++numOptions; - commandId = EESMRCmdSearchFromContacts; - } - - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUILandmarksIntegration) ) - { - ++numOptions; - commandId = EESMRCmdLandmarks; - } - - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) - { - ++numOptions; - commandId = EESMRCmdPreviousLocations; - } - - - - if ( numOptions == 0 ) - { - // Delete whole sub menu - aMenuPane->DeleteMenuItem( EESMRCmdAddLocation ); - } - else if ( numOptions == 1 ) - { - // Replace submenu with available command - aMenuPane->DeleteMenuItem( EESMRCmdAddLocation ); - - // Insert new menu item - HBufC* text = LoadOptionsMenuTextLC( commandId ); - CEikMenuPaneItem::SData menuItem; - menuItem.iCommandId = commandId; - menuItem.iCascadeId = 0; - menuItem.iFlags = 0; - menuItem.iText = *text; - CleanupStack::PopAndDestroy( text ); - aMenuPane->InsertMenuItemL( menuItem, menuPos ); - } - } - else if ( aMenuPane->MenuItemExists( EESMRCmdPreviousLocations, menuPos ) - && !LocationPluginHandlerL().IsCommandAvailableL( - EESMRCmdPreviousLocations, iEntry ) ) - { - // No items in location history. Dim item. - aMenuPane->SetItemDimmed( EESMRCmdPreviousLocations, ETrue ); - } - } - - if ( aResourceId == R_LOCATION_OPTIONS - || aResourceId == R_MR_EDITOR_LOCATION_MENU ) - { - TBool assignFromMap = iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ); - aMenuPane->SetItemDimmed( EESMRCmdAssignFromMap, !assignFromMap ); - - TBool searchFromContacts = iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIContactsIntegration ); - aMenuPane->SetItemDimmed( EESMRCmdSearchFromContacts, - !searchFromContacts ); - - TBool landmarks = iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUILandmarksIntegration ); - aMenuPane->SetItemDimmed( EESMRCmdLandmarks, - !landmarks ); - - TBool previousLocations = iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIPreviousLocationsList ); - if ( previousLocations - && !LocationPluginHandlerL().IsCommandAvailableL( - EESMRCmdPreviousLocations, iEntry ) ) - { - // No items in history. Dim option. - previousLocations = EFalse; - } - aMenuPane->SetItemDimmed( EESMRCmdPreviousLocations, - !previousLocations ); - } - + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + if ( aResourceId == R_MR_VIEWER_LOCATION_MENU ) { - TBool showOnMap = - LocationPluginHandlerL().IsCommandAvailableL( EESMRCmdShowOnMap, - iEntry ); - - aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); - aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, showOnMap ); - - aMenuPane->SetItemDimmed( EESMRCmdEdit, - !iPolicy->IsDefaultCommand( EESMRCmdEdit ) ); - aMenuPane->SetItemDimmed( EESMRCmdEditLocal, - !iPolicy->IsDefaultCommand( EESMRCmdEditLocal ) ); - aMenuPane->SetItemDimmed( EESMRCmdCalEntryUIEdit, - !iPolicy->IsDefaultCommand( EESMRCmdCalEntryUIEdit ) ); - } - } + TBool showOnMap = EFalse; + TBool searchFromMap = EFalse; + + if ( iFeatures->FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + { + showOnMap = LocationPluginHandlerL().IsCommandAvailableL( + EESMRCmdShowOnMap, + *entry ); + searchFromMap = !showOnMap; + } -// --------------------------------------------------------------------------- -// CESMREditorDialog::LoadOptionsMenuTextLC -// --------------------------------------------------------------------------- -// -HBufC* CESMREditorDialog::LoadOptionsMenuTextLC( TInt aCommandId ) - { - FUNC_LOG; - TInt resourceId = 0; - - switch ( aCommandId ) - { - case EESMRCmdAssignFromMap: - { - resourceId = R_MEET_REQ_OPTIONS_ASSIGN_FROM_MAP; - break; - } - case EESMRCmdSearchFromContacts: - { - resourceId = R_MEET_REQ_OPTIONS_SEARCH_FROM_CONTACTS; - break; - } - case EESMRCmdPreviousLocations: - { - resourceId = R_MEET_REQ_OPTIONS_PREVIOUS_LOCATIONS; - break; - } - case EESMRCmdLandmarks: - { - resourceId = R_MEET_REQ_OPTIONS_LANDMARKS; - break; - } - default: - { - User::Leave( KErrArgument ); - } + aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); + aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, !searchFromMap ); + + const CESMRPolicy& policy = Policy(); + aMenuPane->SetItemDimmed( EESMRCmdEdit, + !policy.IsDefaultCommand( EESMRCmdEdit ) ); + aMenuPane->SetItemDimmed( EESMRCmdEditLocal, + !policy.IsDefaultCommand( EESMRCmdEditLocal ) ); + aMenuPane->SetItemDimmed( EESMRCmdCalEntryUIEdit, + !policy.IsDefaultCommand( EESMRCmdCalEntryUIEdit ) ); } - - HBufC* text = StringLoader::LoadLC( resourceId, iCoeEnv ); - return text; } // --------------------------------------------------------------------------- @@ -1490,10 +1304,10 @@ { iLocationPluginHandler = CESMRLocationPluginHandler::NewL( *this ); } - + return *iLocationPluginHandler; } - + // --------------------------------------------------------------------------- // CESMREditorDialog::AddressInfoHandlerL // --------------------------------------------------------------------------- @@ -1505,7 +1319,7 @@ { iAddressInfoHandler = CESMRAddressInfoHandler::NewL(); } - + return *iAddressInfoHandler; } @@ -1527,7 +1341,7 @@ case MESMRFieldEvent::EESMRFieldChangeEvent: { HandleFieldChangeEventL( aEvent ); - break; + break; } default: { @@ -1544,6 +1358,7 @@ const MESMRFieldEvent& aEvent ) { FUNC_LOG; + CEikButtonGroupContainer& cba = ButtonGroupContainer(); TInt* command = static_cast< TInt* >( aEvent.Param( 0 ) ); switch ( *command ) { @@ -1551,12 +1366,12 @@ { iRequiredAttendeesEnabled = ETrue; break; - } + } case EESMRCmdAttendeeRequiredDisabled: { iRequiredAttendeesEnabled = EFalse; break; - } + } case EESMRCmdAttendeeOptionalEnabled: { iOptionalAttendeesEnabled = ETrue; @@ -1569,10 +1384,10 @@ } case EESMRCmdRestoreMiddleSoftKey: { - CEikButtonGroupContainer& cba = ButtonGroupContainer(); - - if ( iPolicy->FieldL( iView->FocusedField() ).iFieldMode - == EESMRFieldModeView ) + iContextMenuResourceId = 0; + + if ( Policy().FieldL( + iView->FocusedField() ).iFieldMode == EESMRFieldModeView ) { // Dim default MSK if editor contains viewer fields cba.MakeCommandVisibleByPosition( @@ -1582,9 +1397,9 @@ else { cba.SetCommandL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, + CEikButtonGroupContainer::EMiddleSoftkeyPosition, R_MR_SELECT_SOFTKEY ); - + cba.MakeCommandVisibleByPosition( CEikButtonGroupContainer::EMiddleSoftkeyPosition, ETrue ); @@ -1593,15 +1408,109 @@ } break; case EESMRCmdSizeExceeded: - iView->ProcessEditorCommandL( *command ); - break; + iView->ProcessEditorCommandL( *command ); + break; + + case EMRCommandSwitchToMR: + case EMRCommandSwitchToMeeting: + case EMRCommandSwitchToMemo: + case EMRCommandSwitchToAnniversary: + case EMRCommandSwitchToTodo: + { + TRAPD( err, SwitchEntryTypeL( *command, ETrue ) ) + + if (KErrArgument == err ) + { + // There was validation error --> Just show the + // existing editor. + err = KErrNone; + } + else if ( err ) + { + // UI and engine not consistent. Show error and exit + iCoeEnv->HandleError( err ); + TryExitL( EESMRCmdForceExit ); + } + + break; + } + case EESMRCmdLongtapDetected: + { + OkToExitL(EESMRCmdLongtapDetected); + break; + } + case EMRLaunchAttachmentContextMenu: + case EAknSoftkeyContextOptions: + { + OkToExitL( EAknSoftkeyContextOptions ); + break; + } + case EESMRCmdCalendarChange: + { + DrawDeferred(); + break; + } + case EESMRCmdAssignFromMap: + case EMRCommandMyLocations: + { + DoProcessCommandL( *command ); + break; + } default: { break; } } + + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + if ( entry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( iInfoProvider.EntryL() ); + + TBool bOccursInPast( OccursInPast( iStartTimeUtc ) ); + + TBool sendEnabled = ( !bOccursInPast && + ( mrEntry->RoleL() == EESMRRoleOrganizer || mrEntry->IsForwardedL() ) && + ( iRequiredAttendeesEnabled | iOptionalAttendeesEnabled ) && + (( ( iInfoProvider.PolicyProvider().CurrentPolicy().ViewMode() == EESMREditMR )) || + ( iInfoProvider.PolicyProvider().CurrentPolicy().ViewMode() == EESMRForwardMR ) + )); + + if( sendEnabled ) + { + cba.SetCommandL( + CEikButtonGroupContainer::ERightSoftkeyPosition, + R_MR_SEND_SOFTKEY); + cba.MakeCommandVisibleByPosition( + CEikButtonGroupContainer::ERightSoftkeyPosition, + ETrue ); + cba.DrawDeferred(); + } + else + { + cba.SetCommandL( + CEikButtonGroupContainer::ERightSoftkeyPosition, + R_MR_DONE_SOFTKEY); + cba.MakeCommandVisibleByPosition( + CEikButtonGroupContainer::ERightSoftkeyPosition, + ETrue ); + cba.DrawDeferred(); + } + } + else + { + cba.SetCommandL( + CEikButtonGroupContainer::ERightSoftkeyPosition, + R_MR_DONE_SOFTKEY); + cba.MakeCommandVisibleByPosition( + CEikButtonGroupContainer::ERightSoftkeyPosition, + ETrue ); + cba.DrawDeferred(); + } } - + // --------------------------------------------------------------------------- // CESMREditorDialog::HandleFieldChangeEventL // --------------------------------------------------------------------------- @@ -1610,80 +1519,258 @@ const MESMRFieldEvent& aEvent ) { FUNC_LOG; + TInt* fieldId = static_cast< TInt* >( aEvent.Param( 0 ) ); + MESMRCalEntry* entry = iInfoProvider.EntryL(); + switch ( *fieldId ) { case EESMRFieldLocation: { MESMRFieldEventValue* value = static_cast< MESMRFieldEventValue* >( aEvent.Param( 1 ) ); - if ( iEntry.Entry().LocationL() != value->StringValue() ) + if ( entry->Entry().LocationL() != value->StringValue() ) { // Show query dialog only if entry has geocoordinates. // It can be verified by checking if "Show on map" is available // for iEntry as geocoordinates are required for that. TBool enableQuery = LocationPluginHandlerL().IsCommandAvailableL( - EESMRCmdShowOnMap, iEntry ); - + EESMRCmdShowOnMap, *entry ); + if ( enableQuery && CESMRConfirmationQuery::ExecuteL( CESMRConfirmationQuery::EESMRAssignUpdatedLocation ) ) { - HBufC* oldLocation = iEntry.Entry().LocationL().AllocLC(); + HBufC* oldLocation = entry->Entry().LocationL().AllocLC(); iView->ExternalizeL(); - + // if old and new locations are different and old location // exists, the user is updating existing location. Let's discard // the existing coordinates by using command EESMRCmdUpdateFromMap - if ( iEntry.Entry().LocationL().Compare( *oldLocation ) != 0 && + if ( entry->Entry().LocationL().Compare( *oldLocation ) != 0 && oldLocation->Length() != 0 ) { - LocationPluginHandlerL().HandleCommandL( - EESMRCmdUpdateFromMap, - iEntry ); + LocationPluginHandlerL().HandleCommandL( + EESMRCmdUpdateFromMap, + *entry ); } else { LocationPluginHandlerL().HandleCommandL( EESMRCmdAssignFromMap, - iEntry, - EFalse ); + *entry, + EFalse ); } iView->InternalizeL(); iView->SetControlFocusedL( EESMRFieldLocation ); - + CleanupStack::PopAndDestroy( oldLocation ); oldLocation = NULL; } else if ( enableQuery ) { // Externalize entry, so query won't be displayed - // again for the same text. + // again for the same text. iView->ExternalizeL(); } } break; } + case EESMRFieldStartDate: { - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + // for update iStartTimeUtc when meeting & mr event changing start time + TBool bOccursInPast( OccursInPastL( aEvent ) ); + + if ( entry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( iInfoProvider.EntryL() ); + TBool bIsOrganizer( mrEntry->RoleL() == EESMRRoleOrganizer ); + + ChangeRightSoftkeyL( bOccursInPast, bIsOrganizer ); + } + break; + } + + case EESMRFieldAllDayEvent: + { + TBool bOccursInPast( OccursInPast( iStartTimeUtc ) ); + TInt* bChecked = static_cast< TInt* >( aEvent.Param( 1 ) ); + if( *bChecked == 1 ) + { + TDateTime startTime = iStartTimeUtc.DateTime(); + startTime.SetHour( 0 ); + startTime.SetMinute( 0 ); + startTime.SetSecond( 0 ); + bOccursInPast = OccursInPast( startTime ); + } + + if ( entry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( iInfoProvider.EntryL() ); + TBool bIsOrganizer( mrEntry->RoleL() == EESMRRoleOrganizer ); + + ChangeRightSoftkeyL( bOccursInPast, bIsOrganizer ); + } + break; + } + default: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// CESMREditorDialog::SetContextMenuL +// --------------------------------------------------------------------------- +// +TBool CESMREditorDialog::SetContextMenuL() + { + FUNC_LOG; + TInt ret( EFalse ); + + TESMREntryFieldId fieldId = iView->ClickedOrFocusedField(); + + switch( fieldId ) + { + case EESMRFieldLocation: + { + ret = ETrue; + + if ( Policy().FieldL( EESMRFieldLocation ).iFieldMode + == EESMRFieldModeEdit ) + { + iContextMenuResourceId = + R_MR_EDITOR_LOCATION_CONTEXT_MENU; + } + else + { + iContextMenuResourceId = + R_MR_VIEWER_CONTEXT_MENU; + } + + if ( !iFeatures->FeatureSupported( + CESMRFeatureSettings::EESMRUIMnFwIntegration ) + && iContextMenuResourceId == R_MR_EDITOR_LOCATION_CONTEXT_MENU ) { - MESMRFieldEventValue* value = - static_cast< MESMRFieldEventValue* >( aEvent.Param( 1 ) ); - TTime now; - now.UniversalTime(); - if ( value->TimeValue() < now ) +#ifndef RD_USE_MYLOCATIONUI + // Maps not supported and My Locations UI disabled + ret = EFalse; +#endif //RD_USE_MYLOCATIONUI + } + } + break; + + case EESMRFieldAttachments: + { + if ( Policy().FieldL( + EESMRFieldAttachments ).iFieldMode + == EESMRFieldModeEdit ) + { + iContextMenuResourceId = R_MR_EDITOR_ATTACHMENT_CONTEXT_MENU; + ret = ETrue; + } + } + break; + case EESMRFieldAttendee: + case EESMRFieldOptAttendee: + { + if ( Policy().FieldL( + EESMRFieldAttendee ).iFieldMode == EESMRFieldModeEdit || + Policy().FieldL( + EESMRFieldOptAttendee ).iFieldMode == EESMRFieldModeEdit ) + { + iContextMenuResourceId = R_MR_EDITOR_ATTENDEE_CONTEXT_MENU; + ret = ETrue; + } + } + break; + default: + break; + } + + if ( ret ) + { + iMenuBar->SetContextMenuTitleResourceId( + iContextMenuResourceId ); + } + else + { + iContextMenuResourceId = 0; + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CESMREditorDialog::SwitchEntryTypeL +// --------------------------------------------------------------------------- +// +void CESMREditorDialog::SwitchEntryTypeL( + TInt aCommand, + TBool aAdjustView ) + { + FUNC_LOG; + TBool change( EFalse ); + MESMRCalEntry* entry = iInfoProvider.EntryL(); + + switch ( aCommand ) + { + case EMRCommandSwitchToMR: + { + TBool ret( ETrue ); + + // Show confirmation note if current mailbox does not + // support attachments and attachments exist in the entry + if( entry->Entry().AttachmentCountL() > 0 && + !SupportsMailBoxCapabilityL( + MESMRBuilderExtension:: + EMRCFSSupportsAttachmentsInMR ) ) + { + if ( !CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery:: + EESMRAttachmentsNotSupported ) ) { - // disable send option - iOccursInPast = ETrue; - } - else - { - iOccursInPast = EFalse; + ret = EFalse; } } + + if( ret ) + { + change = + ( entry->Type() != + MESMRCalEntry::EESMRCalEntryMeetingRequest ); + } + + break; + } + case EMRCommandSwitchToMeeting: + { + change = + ( entry->Type() != MESMRCalEntry::EESMRCalEntryMeeting ); + break; + } + case EMRCommandSwitchToMemo: + { + change = + ( entry->Type() != MESMRCalEntry::EESMRCalEntryMemo ); + break; + } + case EMRCommandSwitchToAnniversary: + { + change = + ( entry->Type() != MESMRCalEntry::EESMRCalEntryAnniversary ); + break; + } + case EMRCommandSwitchToTodo: + { + change = + ( entry->Type() != MESMRCalEntry::EESMRCalEntryTodo); break; } default: @@ -1691,7 +1778,292 @@ break; } } + + if ( change ) + { + iView->ExternalizeL(ETrue); + iStartTimeUtc = entry->Entry().StartTimeL().TimeUtcL(); + iCallback.ProcessCommandL( aCommand ); + + if( aAdjustView ) + { + MESMRCalEntry* entry = iInfoProvider.EntryL(); + iView->AdjustViewL( entry, Policy() ); + SetTitleL(); + } + } + } + +// --------------------------------------------------------------------------- +// CESMREditorDialog::Policy +// --------------------------------------------------------------------------- +// +const CESMRPolicy& CESMREditorDialog::Policy() const + { + FUNC_LOG; + return iInfoProvider.PolicyProvider().CurrentPolicy(); + } + +// --------------------------------------------------------------------------- +// CESMREditorDialog::DynInitToolbarL +// --------------------------------------------------------------------------- +// +void CESMREditorDialog::DynInitToolbarL ( TInt /*aResourceId*/, + CAknToolbar* /*aToolbar*/ ) + { + // TODO: Not implemented yet + } + +// --------------------------------------------------------------------------- +// CESMREditorDialog::OfferToolbarEventL +// --------------------------------------------------------------------------- +// +void CESMREditorDialog::OfferToolbarEventL ( TInt aCommand ) + { + DoProcessCommandL(aCommand); + } + + +// --------------------------------------------------------------------------- +// CESMREditorDialog::SetTitleL +// --------------------------------------------------------------------------- +// +void CESMREditorDialog::SetTitleL () + { + FUNC_LOG; + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + + // Setting title to status pane's title pane + TInt titleStringId = -1; + switch ( entry->Type() ) + { + case MESMRCalEntry::EESMRCalEntryMeetingRequest: + titleStringId = R_QTN_MEET_REQ_TITLE_MEETING; + break; + case MESMRCalEntry::EESMRCalEntryMeeting: + titleStringId = R_QTN_CALENDAR_TITLE_MEETING; + break; + case MESMRCalEntry::EESMRCalEntryTodo: + titleStringId = R_QTN_CALENDAR_TITLE_TODO; + break; + case MESMRCalEntry::EESMRCalEntryMemo: + titleStringId = R_QTN_CALENDAR_TITLE_MEMO; + break; + case MESMRCalEntry::EESMRCalEntryReminder: + break; + case MESMRCalEntry::EESMRCalEntryAnniversary: + titleStringId = R_QTN_CALENDAR_TITLE_ANNIVERSARY; + break; + default: + break; + } + + if ( titleStringId != -1 ) + { + if( !iTitlePane ) + { + iTitlePane = CESMRTitlePaneHandler::NewL( *iEikonEnv ); + } + + HBufC* titleText = StringLoader::LoadLC( titleStringId, iCoeEnv ); + iTitlePane->SetNewTitle( titleText ); + CleanupStack::PopAndDestroy( titleText ); + } + + // If subject does not exist, let's update the title also + // to main window + if( entry->Entry().SummaryL().Length() <= 0 ) + { + HBufC* title ; + switch( entry->Type() ) + { + case MESMRCalEntry::EESMRCalEntryTodo: + { + title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_TODO ); + break; + } + case MESMRCalEntry::EESMRCalEntryMemo: + { + title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_MEMO ); + break; + } + case MESMRCalEntry::EESMRCalEntryAnniversary: + { + title = StringLoader::LoadLC(R_QTN_CALENDAR_TITLE_NEW_ANNIVERSARY); + break; + } + case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Fall through + case MESMRCalEntry::EESMRCalEntryMeeting: // Fall through + case MESMRCalEntry::EESMRCalEntryReminder: // Fall through + default: + { + title = StringLoader::LoadLC( R_QTN_MEET_REQ_TITLE ); + break; + } + } + iView->SetTitleL( *title ); + CleanupStack::PopAndDestroy( title ); + } + } + +// --------------------------------------------------------------------------- +// CESMREditorDialog::VerifyMeetingRequestL +// --------------------------------------------------------------------------- +// +void CESMREditorDialog::VerifyMeetingRequestL() + { + FUNC_LOG; + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + + // If entry is meeting request, but no attendees have been added, + // entry is switched to and saved as regular meeting + if( CCalenInterimUtils2::IsMeetingRequestL( entry->Entry() ) ) + { + RPointerArray& attendees( + entry->Entry().AttendeesL() ); + + TInt attendeeCount = attendees.Count(); + + if( ( attendeeCount == 0 ) && + (iInfoProvider.PolicyProvider().CurrentPolicy().ViewMode() != EESMRForwardMR) ) + { + TRAPD( err, SwitchEntryTypeL( EMRCommandSwitchToMeeting, EFalse ) ) + + if ( err ) + { + // UI and engine not consistent. Show error and exit + iCoeEnv->HandleError( err ); + TryExitL( EESMRCmdForceExit ); + } + } + } + } + +// ----------------------------------------------------------------------------- +// CESMREditorDialog::ShowContextMenuL +// ----------------------------------------------------------------------------- +// +void CESMREditorDialog::ShowContextMenuL() + { + FUNC_LOG; + + if ( iMenuBar ) + { + iMenuBar->TryDisplayContextMenuBarL(); + } + } + + +// ----------------------------------------------------------------------------- +// CESMREditorDialog::OccursInPast +// ----------------------------------------------------------------------------- +// +TBool CESMREditorDialog::OccursInPastL( const MESMRFieldEvent& aEvent ) + { + FUNC_LOG; + MESMRFieldEventValue* value = static_cast< MESMRFieldEventValue* >( aEvent.Param( 1) ); + + TCalTime startCalTime; + startCalTime.SetTimeLocalL( value->TimeValue() ); + + iStartTimeUtc = startCalTime.TimeUtcL(); + + return OccursInPast( iStartTimeUtc ); + } + +// ----------------------------------------------------------------------------- +// CESMREditorDialog::OccursInPast +// ----------------------------------------------------------------------------- +// +TBool CESMREditorDialog::OccursInPast( const TTime& aStartUtc ) + { + FUNC_LOG; + TBool bOccursInPast(EFalse); + + TTime now; + now.UniversalTime(); + + if ( aStartUtc < now ) + { + bOccursInPast = ETrue; + } + + return bOccursInPast; + } + +// ----------------------------------------------------------------------------- +// CESMREditorDialog::ChangeRightSoftkeyL +// ----------------------------------------------------------------------------- +// +void CESMREditorDialog::ChangeRightSoftkeyL( TBool aOccursInPast, TBool aIsOrganizer ) + { + FUNC_LOG; + TBool sendEnabled = + ( iRequiredAttendeesEnabled | iOptionalAttendeesEnabled ) && + !aOccursInPast && aIsOrganizer; + + CEikButtonGroupContainer& cba = ButtonGroupContainer(); + + if( sendEnabled ) + { + cba.SetCommandL( + CEikButtonGroupContainer::ERightSoftkeyPosition, + R_MR_SEND_SOFTKEY); + cba.DrawDeferred(); + } + else + { + cba.SetCommandL( + CEikButtonGroupContainer::ERightSoftkeyPosition, + R_MR_DONE_SOFTKEY); + cba.DrawDeferred(); + } + } + +// ----------------------------------------------------------------------------- +// CESMREditorDialog::TryToSaveEntryL +// ----------------------------------------------------------------------------- +// +TInt CESMREditorDialog::TryToSaveEntryL() + { + FUNC_LOG; + TInt res( KErrNone ); + + MESMRCalEntry* entry = iInfoProvider.EntryL(); + + if ( IsAllowedToSaveL() ) + { + res = iCallback.ProcessCommandWithResultL( EESMRCmdSaveMR ); + + if ( res == KErrNone + && iFeatures->FeatureSupported( + CESMRFeatureSettings::EESMRUIPreviousLocationsList ) ) + { + LocationPluginHandlerL().StoreLocationToHistoryL( *entry ); + } + if ( entry->Type() == MESMRCalEntry::EESMRCalEntryTodo ) + { + CESMRGlobalNote* note = + CESMRGlobalNote::NewL( + CESMRGlobalNote::EESMRTodoEntrySaved ); + note->ExecuteLD(); + } + else + { + CESMRGlobalNote* note = + CESMRGlobalNote::NewL( + CESMRGlobalNote::EESMREntrySaved ); + note->ExecuteLD(); + } + } + else + { + res = KErrCancel; + } + + return res; } // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmreditorfieldstorage.cpp --- a/meetingrequest/mrgui/src/cesmreditorfieldstorage.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmreditorfieldstorage.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -30,6 +30,8 @@ #include "cesmrfield.h" #include "cesmrfieldeventqueue.h" +#include + //logging //performance profiling // Removed profiling. @@ -131,8 +133,28 @@ { CESMRGlobalNote::ExecuteL( CESMRGlobalNote::EESMRRepeatReSchedule ); + break; } + case MESMRFieldValidator::EErrorInstanceOverlapsExistingOne: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMROverlapsExistingInstance ); break; + } + + case MESMRFieldValidator::EErrorInstanceAlreadyExistsOnThisDay: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRInstanceAlreadyExistsOnThisDay ); + break; + } + + case MESMRFieldValidator::EErrorInstanceOutOfSequence: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRInstanceOutOfSequence ); + break; + } default: { err = KErrNone; @@ -174,7 +196,7 @@ // --------------------------------------------------------------------------- // CESMREditorFieldStorage* CESMREditorFieldStorage::NewL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldEventObserver& aEventObserver ) { FUNC_LOG; @@ -190,32 +212,38 @@ // CESMREditorFieldStorage::ConstructL // --------------------------------------------------------------------------- // -void CESMREditorFieldStorage::ConstructL( CESMRPolicy* aPolicy ) +void CESMREditorFieldStorage::ConstructL( const CESMRPolicy& aPolicy ) { FUNC_LOG; CESMRFieldStorage::BaseConstructL(); iValidator = - CESMRValidatorFactory::CreateValidatorL ( - aPolicy->EventType() ); + CESMRValidatorFactory::CreateValidatorL( aPolicy.EventType() ); __ASSERT_DEBUG( iValidator, Panic( EESMREditorFieldStorageNoValidator) ); iValidator->SetFieldEventQueue( &EventQueueL() ); - RArray fields = aPolicy->Fields(); + RArray fields = aPolicy.Fields(); const TInt count(fields.Count()); for (TInt i(0); i < count; i++ ) { TESMREntryField entryField = fields[i]; - TBool visible( entryField.iFieldViewMode == EESMRFieldTypeDefault); + TBool visible( entryField.iFieldViewMode == EESMRFieldTypeDefault ); CESMRField* field = CreateEditorFieldL( iValidator, entryField ); - CleanupStack::PushL( field ); - AddFieldL( field, visible ); - CleanupStack::Pop( field ); + if( field->FieldViewMode() != EESMRFieldTypeDisabled ) + { + CleanupStack::PushL( field ); + AddFieldL( field, visible ); + CleanupStack::Pop( field ); + } + else + { + delete field; + field = NULL; + } } - } // --------------------------------------------------------------------------- @@ -265,5 +293,80 @@ return err; } +// --------------------------------------------------------------------------- +// CESMREditorFieldStorage::ChangePolicyL +// --------------------------------------------------------------------------- +// +void CESMREditorFieldStorage::ChangePolicyL( + const CESMRPolicy& aNewPolicy, + MESMRCalEntry& /*aEntry*/ ) + { + MESMRFieldValidator* validator = + CESMRValidatorFactory::CreateValidatorL( aNewPolicy.EventType() ); + + __ASSERT_DEBUG( validator, Panic( EESMREditorFieldStorageNoValidator) ); + CleanupDeletePushL( validator ); + + validator->SetFieldEventQueue( &EventQueueL() ); + + // Iterate through policy and create fields into tmp array + RArray fields = aNewPolicy.Fields(); + + TInt count( fields.Count() ); + + RCPointerArray< CESMRField > fieldArray; + CleanupClosePushL( fieldArray ); + + fieldArray.ReserveL( count ); + + CESMRField* field = NULL; + + // Append new fields to array + for (TInt i(0); i < count; ++i ) + { + field = CreateEditorFieldL( validator, fields[i] ); + // Append field + if( field->FieldViewMode() != EESMRFieldTypeDisabled ) + { + fieldArray.AppendL( field ); + } + else + { + delete field; + field = NULL; + } + } + + // Reseting field array from storage, so that it can be + // reused + Reset(); + + count = fieldArray.Count(); + + // Reserve space in strorage for all required fields + ReserveL( count ); + + // Insert fields from fieldArray into storage + for ( TInt i = 0; i < count; ++i ) + { + AddFieldL( fieldArray[ i ] ); + + TBool visible( fields[ i ].iFieldViewMode == EESMRFieldTypeDefault ); + Field( i )->MakeVisible( visible ); + } + + // Remove items from field array + for ( TInt i = 0; i < count; ++i ) + { + fieldArray.Remove( 0 ); + } + + // Assign new validator + delete iValidator; + iValidator = validator; + CleanupStack::PopAndDestroy( &fieldArray ); + CleanupStack::Pop( validator ); + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrfieldeventqueue.cpp --- a/meetingrequest/mrgui/src/cesmrfieldeventqueue.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrfieldeventqueue.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrfieldstorage.cpp --- a/meetingrequest/mrgui/src/cesmrfieldstorage.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrfieldstorage.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,12 +15,16 @@ * */ -#include "emailtrace.h" #include "cesmrfieldstorage.h" #include "cesmrfield.h" #include "mesmrcalentry.h" #include "cesmrfieldeventqueue.h" -// Removed profiling. +#include "cmrsystemnotifier.h" + +#include + +#include "emailtrace.h" + // ======== MEMBER FUNCTIONS ======== @@ -29,7 +33,7 @@ // --------------------------------------------------------------------------- // CESMRFieldStorage::CESMRFieldStorage( - MESMRFieldEventObserver& aEventObserver ): + MESMRFieldEventObserver& aEventObserver ): iEventObserver( aEventObserver ) { FUNC_LOG; @@ -40,9 +44,11 @@ { FUNC_LOG; // Add event observer to event queue - EventQueueL().AddObserverL( &iEventObserver ); + EventQueueL().AddObserverL( &iEventObserver ); + iSystemNotifier = CMRSystemNotifier::NewL( EventQueueL() ); + iSystemNotifier->StartL(); } - + // --------------------------------------------------------------------------- // CESMRFieldStorage::~CESMRFieldStorage() // --------------------------------------------------------------------------- @@ -51,9 +57,10 @@ { FUNC_LOG; iArray.ResetAndDestroy(); - + delete iPlugin; - delete iEventQueue; + delete iSystemNotifier; + delete iEventQueue; } // --------------------------------------------------------------------------- @@ -112,7 +119,7 @@ CESMRField* CESMRFieldStorage::FieldById( TESMREntryFieldId aId ) const { CESMRField* field = NULL; - + for ( TInt i = 0; i < iArray.Count(); ++i ) { if ( iArray[ i ]->FieldId() == aId ) @@ -121,7 +128,7 @@ break; } } - + return field; } @@ -129,8 +136,8 @@ // CESMRFieldStorage::Validate() // --------------------------------------------------------------------------- // -TInt CESMRFieldStorage::Validate( - TESMREntryFieldId& /*aId */, +TInt CESMRFieldStorage::Validate( + TESMREntryFieldId& /*aId */, TBool /*aForceValidation*/ ) { FUNC_LOG; @@ -144,9 +151,20 @@ void CESMRFieldStorage::InternalizeL( MESMRCalEntry& aEntry ) { FUNC_LOG; - for ( TInt i(0); i < iArray.Count(); i++ ) + + TInt index(0); + while( index < iArray.Count() ) { - iArray[ i ]->InternalizeL( aEntry ); + TInt fieldCount( iArray.Count() ); + iArray[ index ]->InternalizeL( aEntry ); + + if ( fieldCount == iArray.Count() ) + { + // Field that was internalized was not removed from list + // We can update field index. If field is removed the next + // field index is already the current index ... + index++; + } } } @@ -159,7 +177,10 @@ FUNC_LOG; for ( TInt i(0); i < iArray.Count(); i++ ) { - iArray[ i ]->ExternalizeL( aEntry ); + if(iArray[ i ]->IsVisible()) + { + iArray[ i ]->ExternalizeL( aEntry ); + } } } @@ -188,15 +209,15 @@ iFieldBuilder = NULL; CESMRFieldBuilderInterface* plugin = NULL; - TRAPD( error, plugin = - CESMRFieldBuilderInterface::CreatePluginL( + TRAPD( error, plugin = + CESMRFieldBuilderInterface::CreatePluginL( TUid::Uid(KESMRUIFieldBuilderPluginImplUId) ) ); - + if ( error == KErrNone && plugin) - { + { delete iPlugin; iPlugin = plugin; - + iFieldBuilder = iPlugin->FieldBuilderL(); } } @@ -205,8 +226,8 @@ // CESMRFieldStorage::CreateEditorFieldL() // ----------------------------------------------------------------------------- // -CESMRField* CESMRFieldStorage::CreateEditorFieldL( - MESMRFieldValidator* aValidator, +CESMRField* CESMRFieldStorage::CreateEditorFieldL( + MESMRFieldValidator* aValidator, TESMREntryField aField ) { FUNC_LOG; @@ -224,9 +245,9 @@ // CESMRFieldStorage::CreateViewerFieldL() // ----------------------------------------------------------------------------- // -CESMRField* CESMRFieldStorage::CreateViewerFieldL( - MESMRResponseObserver* aResponseObserver, - TESMREntryField aField, +CESMRField* CESMRFieldStorage::CreateViewerFieldL( + MESMRResponseObserver* aResponseObserver, + TESMREntryField aField, TBool aResponseReady ) { FUNC_LOG; @@ -241,6 +262,18 @@ } // ----------------------------------------------------------------------------- +// CESMRFieldStorage::ChangePolicyL() +// ----------------------------------------------------------------------------- +// +void CESMRFieldStorage::ChangePolicyL( + const CESMRPolicy& /*aNewPolicy*/, + MESMRCalEntry& /*aEntry*/ ) + { + ASSERT( EFalse ); // Assert for debug builds + User::Leave( KErrNotSupported ); + } + +// ----------------------------------------------------------------------------- // CESMRFieldStorage::EventQueueL() // ----------------------------------------------------------------------------- // @@ -254,5 +287,43 @@ return *iEventQueue; } +// ----------------------------------------------------------------------------- +// CESMRFieldStorage::RemoveField() +// ----------------------------------------------------------------------------- +// +void CESMRFieldStorage::RemoveField( TInt aInd ) + { + CESMRField* field = iArray[ aInd ]; + iArray.Remove( aInd ); + delete field; + } + +// ----------------------------------------------------------------------------- +// CESMRFieldStorage::InsertFieldL() +// ----------------------------------------------------------------------------- +// +void CESMRFieldStorage::InsertFieldL( CESMRField* aField, TInt aIndex ) + { + iArray.InsertL( aField, aIndex ); + aField->SetEventQueueL( iEventQueue ); + } + +// ----------------------------------------------------------------------------- +// CESMRFieldStorage::ReserveL() +// ----------------------------------------------------------------------------- +// +void CESMRFieldStorage::ReserveL( TInt aCount ) + { + iArray.ReserveL( aCount ); + } + +// ----------------------------------------------------------------------------- +// CESMRFieldStorage::Reset() +// ----------------------------------------------------------------------------- +// +void CESMRFieldStorage::Reset() + { + iArray.ResetAndDestroy(); + } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrglobalnote.cpp --- a/meetingrequest/mrgui/src/cesmrglobalnote.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Edit before send list pop-up query -* -*/ - - -// INCLUDE FILES -#include "emailtrace.h" -#include "cesmrglobalnote.h" -#include "esmrhelper.h"//locateresourcefile -// -#include "esmrdef.h" -// -#include -#include -#include -#include -#include -#include - -// CONSTANTS -// Unnamed namespace for local definitions -namespace { - -_LIT(KResourceFileName,"esmrgui.rsc"); - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::CESMRGlobalNote -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CESMRGlobalNote::CESMRGlobalNote( - TESMGlobalNoteType aType) -: iType(aType) - { - FUNC_LOG; - // Do nothing - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::~CESMRGlobalNote -// ----------------------------------------------------------------------------- -// -CESMRGlobalNote::~CESMRGlobalNote() - { - FUNC_LOG; - iEnv->DeleteResourceFile(iResourceOffset); - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::NewL -// ----------------------------------------------------------------------------- -// -EXPORT_C CESMRGlobalNote* CESMRGlobalNote::NewL( - TESMGlobalNoteType aType) - { - FUNC_LOG; - CESMRGlobalNote* self = - new (ELeave) CESMRGlobalNote(aType); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::ConstructL -// ----------------------------------------------------------------------------- -// -void CESMRGlobalNote::ConstructL() - { - FUNC_LOG; - TFileName filename; - iEnv = CEikonEnv::Static();// codescanner::eikonenvstatic - - ESMRHelper::LocateResourceFile( - KResourceFileName, - KDC_RESOURCE_FILES_DIR, - filename, - &iEnv->FsSession() ); - - - //for localization - BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); - iResourceOffset = iEnv->AddResourceFileL(filename); - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::ExecuteL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CESMRGlobalNote::ExecuteL(TESMGlobalNoteType aType) - { - FUNC_LOG; - CESMRGlobalNote* query = CESMRGlobalNote::NewL( aType ); - CleanupStack::PushL(query); - query->ExecuteLD(); - CleanupStack::Pop(query); - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::NoteType -// ----------------------------------------------------------------------------- -// -TAknGlobalNoteType CESMRGlobalNote::NoteType() - { - FUNC_LOG; - TAknGlobalNoteType type(EAknGlobalInformationNote); - switch ( iType ) - { - case EESMRCorruptedMR: - { - type = EAknGlobalErrorNote; - break; - } - case EESMRCalenLaterDate: // FALLTHROUGH - case EESMREndsBeforeStarts: // FALLTHROUGH - case EESMREntryEndEarlierThanItStart: // FALLTHROUGH - case EESMRRepeatEndEarlierThanItStart: // FALLTHROUGH - case EESMRAlarmAlreadyPassed: // FALLTHROUGH - case EESMRDiffMoreThanMonth: // FALLTHROUGH - case EESMREntrySaved: // FALLTHROUGH - case EESMRTodoEntrySaved: // FALLTHROUGH - case EESMRRepeatDifferentStartAndEndDate: - case EESMRRepeatReSchedule: - case EESMRCannotDisplayMuchMore: - { - type = EAknGlobalInformationNote; - break; - } - default: - { - break; - } - } - return type; - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::NoteTextLC -// ----------------------------------------------------------------------------- -// -HBufC* CESMRGlobalNote::NoteTextLC() - { - FUNC_LOG; - HBufC* noteText = NULL; - switch ( iType ) - { - case EESMRCorruptedMR: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_CORRUPTED_NOTE); - break; - } - case EESMREndsBeforeStarts: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_INFO_NOTE_ENDS_BEFORE); - break; - } - case EESMRCalenLaterDate: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_LATER_DATE); - break; - } - case EESMREntryEndEarlierThanItStart: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_INFO_NOTE_ENDS_BEFORE ); - break; - } - case EESMRRepeatEndEarlierThanItStart: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_CALENDAR_INFO_REPEAT_INVALID ); - break; - } - case EESMRAlarmAlreadyPassed: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_CALENDAR_ALARM_PASSED ); - break; - } - case EESMRDiffMoreThanMonth: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_CALENDAR_ALARM_DIFFERENCE ); - break; - } - case EESMREntrySaved: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_NOTE_SAVED ); - break; - } - case EESMRTodoEntrySaved: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_TODO_SAVED ); - break; - } - case EESMRRepeatDifferentStartAndEndDate: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_INFO_START_END_DATE ); - } - break; - case EESMRRepeatReSchedule: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_MEET_REQ_RESCHEDULE_INSTANCE ); - } - break; - case EESMRCannotDisplayMuchMore: - { - noteText = iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_LONG_DESCRIPTION ); - } - break; - default: - { - break; - } - } - return noteText; - } - -// ----------------------------------------------------------------------------- -// CESMRGlobalNote::ExecuteLD -// ----------------------------------------------------------------------------- -// -void CESMRGlobalNote::ExecuteLD() - { - FUNC_LOG; - CAknGlobalNote* note = CAknGlobalNote::NewLC(); - HBufC* noteText = NoteTextLC(); - - note->ShowNoteL( - NoteType(), - *noteText ); - - CleanupStack::PopAndDestroy( noteText ); - noteText = NULL; - - CleanupStack::PopAndDestroy( note ); - note = NULL; - - // Deleting 'this' object because this id D-method. - delete this; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrguilistquery.cpp --- a/meetingrequest/mrgui/src/cesmrguilistquery.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class is responsible of showing list queries -* -*/ - -// INCLUDE FILES -#include "emailtrace.h" -#include "cesmrguilistquery.h" -#include "esmrhelper.h" - -#include -#include -#include -#include -#include -#include - -// Unnamed namespace for local definitions -namespace { - -// Resource file definitions -_LIT(KResourceFileName,"esmrgui.rsc"); - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// CESMRGUIListQuery::CESMRConfirmationQuery -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -inline CESMRGUIListQuery::CESMRGUIListQuery( - TESMRListQueryType aType) : - iType(aType) - { - FUNC_LOG; - // Do nothing - } - -// ----------------------------------------------------------------------------- -// CESMRGUIListQuery::~CESMRConfirmationQuery -// ----------------------------------------------------------------------------- -// -CESMRGUIListQuery::~CESMRGUIListQuery() - { - FUNC_LOG; - iEnv->DeleteResourceFile(iResourceOffset); - } - -// ----------------------------------------------------------------------------- -// CESMRGUIListQuery::ConstructL -// ----------------------------------------------------------------------------- -// -void CESMRGUIListQuery::ConstructL() - { - FUNC_LOG; - TFileName filename; - - iEnv = CEikonEnv::Static(); // codescanner::eikonenvstatic - - ESMRHelper::LocateResourceFile( - KResourceFileName, - KDC_RESOURCE_FILES_DIR, - filename, - &iEnv->FsSession() ); - - //for localization - BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); - iResourceOffset = iEnv->AddResourceFileL(filename); - } - -// ----------------------------------------------------------------------------- -// CESMRGUIListQuery::ExecuteLD -// ----------------------------------------------------------------------------- -// -TInt CESMRGUIListQuery::ExecuteLD() - { - FUNC_LOG; - TInt resourceId( KErrNotFound ); - - switch ( iType ) - { - case EESMRSendUpdateToAllQuery: - { - resourceId = R_MEET_REQ_SEND_UPDATE_QUERY; - break; - } - default: - { - User::Leave( KErrArgument ); - break; - } - } - - TInt response( KErrCancel ); - CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog( &response ); - if( !dlg->ExecuteLD(resourceId ) ) - { - response = KErrCancel; - } - dlg = NULL; - - delete this; - return response; - } - -// ----------------------------------------------------------------------------- -// CESMRGUIListQuery::ExecuteL -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRGUIListQuery::ExecuteL( - TESMRListQueryType aType) - { - FUNC_LOG; - CESMRGUIListQuery* query = - new (ELeave) CESMRGUIListQuery(aType); - - CleanupStack::PushL( query ); - query->ConstructL( ); - - TInt ret = query->ExecuteLD(); - - CleanupStack::Pop( query ); - - return ret; - } - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlayoutmgr.cpp --- a/meetingrequest/mrgui/src/cesmrlayoutmgr.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1469 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR checkbox component for es mr gui (editor) -* -*/ - - -#include "emailtrace.h" -#include "cesmrlayoutmgr.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mesmrfontsizeobserver.h" -#include "esmrhelper.h" - -// Unnamed namespace for local definitions -namespace { - -// icon margins -const TInt KIconTopMarginSmallFont = 0; -const TInt KIconTopMarginNormalFont = 1; -const TInt KIconTopMarginLargeFont = 3; - -/** Enumeration for font sizes */ -enum TESMRFontSize - { - EESMRFontSmall = 21, - EESMRFontNormal = 23, - EESMRFontLarge = 26 - }; - -/** Enumeration for text top margin*/ -enum TESMRTextTopMargin - { - EESMRTextTopMarginSmall = 2, - EESMRTextTopMarginNormal = 2, - EESMRTextTopMarginLarge = 3 - }; - -// Field heights -const TInt KRegularFieldHeightSmallFont(20); -const TInt KRegularFieldHeightNormalFont(22); -const TInt KRegularFieldHeightLargeFont(25); -const TInt KTitlePaneHeight(26); - -// Basic margins -const TInt KBasicTopMargin( 3 ); -const TInt KBasicBottomMargin( 3 ); -const TInt KBasicLeftMargin( 9 ); -const TInt KBasicTightMargin( 3 ); - -// Response area related -#define KResponseAreaAnswerTextSize TSize( 180, 25 ) -#define KResponseAreaTopicTextSizePortrait TSize( 212, 25 ) -#define KResponseAreaTopicTextSizeLandscape TSize( 280, 25 ) -#define KResponseAreaAnswerTextPositionSmallFont TPoint( 27, 3 ) -#define KResponseAreaAnswerTextPositionNormalFont TPoint( 27, 3 ) -#define KResponseAreaAnswerTextPositionLargeFont TPoint( 27, 5 ) -#define KResponseAreaAnswerIconPositionSmallFont TPoint( 8, 3 ) -#define KResponseAreaAnswerIconPositionNormalFont TPoint( 8, 5 ) -#define KResponseAreaAnswerIconPositionLargeFont TPoint( 8, 7 ) -#define KResponseAreaAnswerTextPositionSmallFontMirrored TPoint( 46, 3 ) -#define KResponseAreaAnswerTextPositionNormalFontMirrored TPoint( 46, 3 ) -#define KResponseAreaAnswerTextPositionLargeFontMirrored TPoint( 46, 5 ) - -#define KResponseAreaAnswerTextPositionSmallFontMirroredLandscape TPoint( 127, 3 ) -#define KResponseAreaAnswerTextPositionNormalFontMirroredLandscape TPoint( 127, 3 ) -#define KResponseAreaAnswerTextPositionLargeFontMirroredLandscape TPoint( 127, 5 ) -#define KResponseAreaAnswerIconPositionSmallFontMirroredLandscape TPoint( 280, 3 ) -#define KResponseAreaAnswerIconPositionNormalFontMirroredLandscape TPoint( 280, 5 ) -#define KResponseAreaAnswerIconPositionLargeFontMirroredLandscape TPoint( 280, 7 ) - - -#define KResponseAreaAnswerIconPositionSmallFontMirrored TPoint( 194, 3 ) -#define KResponseAreaAnswerIconPositionNormalFontMirrored TPoint( 194, 5 ) -#define KResponseAreaAnswerIconPositionLargeFontMirrored TPoint( 194, 7 ) - -#define KConflictPopupPositionPortrait TPoint(30,150) -#define KConflictPopupPositionLandscape TPoint(30,100) - -const TInt KResponseAreaAnserItemHeightSmallFont(20); -const TInt KResponseAreaAnserItemHeightNormalFont(22); -const TInt KResponseAreaAnserItemHeightLargeFont(26); - -// Organizer field related -const TInt KOrganizerTextWidth(150); - -// Color id:s KViewerAreaTextColorID -const TInt KViewerAreaTextColorID( EAknsCIQsnTextColorsCG6 ); -const TInt KViewerAreaHighlightedTextColorID( EAknsCIQsnHighlightColorsCG2 ); -const TInt KNormalTextColorID( EAknsCIQsnTextColorsCG26 ); -const TInt KNormalHighLightedTextColorID( EAknsCIQsnTextColorsCG24 ); -const TInt KTitleAreaTextColorID( EAknsCIQsnTextColorsCG2 ); -const TInt KNormalTextBgColorID( EAknsCIFsOtherColorsCG12 ); -const TInt KListAreaTextColorID( EAknsCIQsnTextColorsCG6 ); -const TInt KListAreaBgColorID( EAknsCIFsOtherColorsCG13 ); -const TInt KFieldBorderColorID( EAknsCIFsOtherColorsCG14 ); - - -#define KDefaultListAreaBgColor TRgb( 0xffffff ); -#define KDefaultBorderColor TRgb( 0x000000 ); -#define KDefaultTextColor TRgb( 0x000000 ); -#define KDefaultNormalTextBgColor TRgb( 0xe8e8e8 ); - -// Text side margin in basic field (editor & viewer ) -const TInt KTextSideMargin( 5 ); - -TESMRFontSize MapFontSettingToFontSize( - TInt& aCurrentFontSetting ) - { - TESMRFontSize fontSize( EESMRFontNormal ); - - if ( EAknUiZoomSmall == aCurrentFontSetting ) - { - fontSize = EESMRFontSmall; - } - else if ( EAknUiZoomLarge == aCurrentFontSetting ) - { - fontSize = EESMRFontLarge; - } - return fontSize; - } - -TBool FindFieldSizeInfoById( - const CESMRLayoutManager::SFieldSize& aLhs, - const CESMRLayoutManager::SFieldSize& aRhs ) - { - if ( aLhs.iId == aRhs.iId ) - { - return ETrue; - } - return EFalse; - } - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::CESMRLayoutManager -// --------------------------------------------------------------------------- -// -inline CESMRLayoutManager::CESMRLayoutManager() -: iFontSettingsValue( EAknUiZoomNormal ), - iFontSettingsChanged( EFalse ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::~CESMRLayoutManager -// --------------------------------------------------------------------------- -// -CESMRLayoutManager::~CESMRLayoutManager() - { - FUNC_LOG; - iSize.Reset(); - iSize.Close(); - delete iFont; - delete iMfneFont; - if ( iNotifyHandler ) - { - iNotifyHandler->StopListening(); - } - delete iNotifyHandler; - delete iFontSettings;// session can be deleted only after iNotifyHandler - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::NewL -// --------------------------------------------------------------------------- -// -CESMRLayoutManager* CESMRLayoutManager::NewL() - { - FUNC_LOG; - CESMRLayoutManager* self = new (ELeave) CESMRLayoutManager; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRLayoutManager::ConstructL() - { - FUNC_LOG; - // args: field id, height(smallfont), - // height(normalfont), height(largefont), - // width(landscape), width(portrait) - - AddSize( EESMRFieldAttendeeLabel, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldAttendee, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldOptAttendee, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldMeetingTime, 22, 24, 26, 299, 218 ); - AddSize( EESMRFieldStartDate, 22, 24, 26, 299, 218 ); - AddSize( EESMRFieldStopDate, 22, 24, 26, 299, 218 ); - AddSize( EESMRFieldLocation, 19, 21, 25, 299, 218 ); - AddSize( EESMRFieldAlarm, 22, 24, 26, 299, 218 ); - AddSize( EESMRFieldAlarmDate, 22, 24, 26, 299, 218 ); - AddSize( EESMRFieldSubject, 19, 21, 25, 299, 218 ); - AddSize( EESMRFieldOccasion, 19, 21, 25, 299, 218 ); - AddSize( EESMRFieldDescription, 60, 63, 60, 299, 218 ); - AddSize( EESMRFieldRecurrence, 22, 24, 28, 299, 218 ); - AddSize( EESMRFieldRecurrenceDate, 44, 49, 53, 299, 218 ); - AddSize( EESMRFieldPriority, 24, 26, 26, 299, 218 ); - AddSize( EESMRFieldAllDayEvent, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldAlarmOnOff, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldAlarmTime, 22, 24, 26, 299, 218 ); - AddSize( EESMRFieldSync, 22, 24, 28, 299, 218 ); - AddSize( EESMRFieldViewerBasic, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldOrganizer, 40, 44, 52, 299, 218 ); - AddSize( EESMRFieldResponseArea, 93, 102, 120, 299,218 ); - AddSize( EESMRFieldResponseAreaWithOneItem, 48, 57, 65, 299, 218 ); - AddSize( EESMRFieldResponseReadyArea, 24, 26, 28, 299, 218 ); - AddSize( EESMRFieldDetailedSubject, 20, 22, 25, 299, 218 ); - AddSize( EESMRFieldAttachments, 22, 24, 28, 299, 218 ); - AddSize( EESMRFieldReqTrack, 20, 22, 26, 299, 218 ); - AddSize( EESMRFieldOptTrack, 20, 22, 26, 299, 218 ); - AddSize( EESMRTrackStatus, 20, 22, 26, 299, 218 ); - - iFontSettings = CRepository::NewL( KCRUidAvkon ); - iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iFontSettings, - CCenRepNotifyHandler::EIntKey, KAknGlobalUiZoom ); - iNotifyHandler->StartListeningL(); - - // Check the current font size - TAknUiZoom zoom; - zoom = static_cast( - CEikonEnv::Static()->AppUi()// codescanner::eikonenvstatic - )->LocalUiZoom(); - - if ( zoom == EAknUiZoomAutomatic ) - { - CAknEnv::Static()->GetCurrentGlobalUiZoom( zoom ); - } - - iFontSettingsValue = zoom; - - // Check the font settings, note that id is not used yet (can be anything) - Font(CCoeEnv::Static(), EESMRFieldViewerBasic ); - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::CurrentFontSizeL -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::CurrentFontZoom() - { - FUNC_LOG; - return iFontSettingsValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::FieldSize -// --------------------------------------------------------------------------- -// -TSize CESMRLayoutManager::FieldSize( TESMREntryFieldId aId ) - { - FUNC_LOG; - TSize size( 0, 0 ); - - CESMRLayoutManager::SFieldSize fieldToFound; - fieldToFound.iId = aId; - - TInt pos = iSize.Find( fieldToFound, FindFieldSizeInfoById ); - if ( KErrNotFound != pos ) - { - TInt width = Layout_Meta_Data::IsLandscapeOrientation() ? - iSize[pos].iWidthLandscape : iSize[pos].iWidthPortrait; - - TInt height; - - // Field height depends on font height - // Field height when small font is in use - if( iFontSettingsValue == EAknUiZoomSmall || - iFontSettingsValue == EAknUiZoomVerySmall ) - { - height = iSize[pos].iFontSmallHeight; - } - // Field height when large font is in use - else if( iFontSettingsValue == EAknUiZoomLarge || - iFontSettingsValue == EAknUiZoomVeryLarge ) - { - height = iSize[pos].iFontLargeHeight; - } - // Field height if font height is not specified or it's normal - else - { - height = iSize[pos].iFontNormalHeight; - } - - size.SetSize( width, height ); - } - - return size; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::Font -// --------------------------------------------------------------------------- -// -const CFont* CESMRLayoutManager::Font( - CCoeEnv* /*aEnv*/, - TESMREntryFieldId aId ) - { - FUNC_LOG; - if ( !iFont || !iMfneFont ) - { - TAknFontSpecification aknFontSpec( EAknLogicalFontTitleFont ); - aknFontSpec.SetUnits( TAknFontSpecification::EPixels ); - - TESMRFontSize fontSize = MapFontSettingToFontSize( iFontSettingsValue ); - - // text pane height for edwins (text fields) - aknFontSpec.SetTextPaneHeight( fontSize ); - - // There is nothing mrui can do if this method leaves - delete iFont; - iFont = NULL; - TRAP_IGNORE( iFont = AknLayoutUtils:: - CreateLayoutFontFromSpecificationL( aknFontSpec ) ); - - if ( fontSize == EESMRFontLarge ) - { - // If large font is used: - aknFontSpec.SetTextPaneHeight( fontSize - 2); - } - else - { - aknFontSpec.SetTextPaneHeight( fontSize - 1); - } - - - // separate font for CEikMfne based controls: - delete iMfneFont; - iMfneFont = NULL; - - TRAP_IGNORE( iMfneFont = AknLayoutUtils:: - CreateLayoutFontFromSpecificationL( aknFontSpec ) ); - - } - if ( aId == EESMRFieldStartDate || - aId == EESMRFieldStopDate || - aId == EESMRFieldMeetingTime || - aId == EESMRFieldAlarmDate || - aId == EESMRFieldRecurrenceDate || - aId == EESMRFieldAlarmTime || - aId == EESMRFieldDate ) - { - return static_cast(iMfneFont); - } - else - { - return static_cast(iFont); - } - } -// --------------------------------------------------------------------------- -// CESMRLayoutManager::Margins -// --------------------------------------------------------------------------- -// -TMargins CESMRLayoutManager::Margins( - TMarginsId /*aId*/ ) - { - FUNC_LOG; - TMargins m; - m.iTop = KBasicTopMargin; - m.iBottom = KBasicBottomMargin; - m.iLeft = KBasicLeftMargin; - m.iRight = KBasicTightMargin; - return m; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::IconTopMargin -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::IconTopMargin() - { - FUNC_LOG; - TInt retValue = 0; - - switch ( iFontSettingsValue ) - { - case EAknUiZoomSmall: //Fallthrough - case EAknUiZoomVerySmall: - { - retValue = KIconTopMarginSmallFont; - break; - } - case EAknUiZoomNormal: - { - retValue = KIconTopMarginNormalFont; - break; - } - case EAknUiZoomLarge: //Fallthrough - case EAknUiZoomVeryLarge: - { - retValue = KIconTopMarginLargeFont; - break; - } - default: - { - retValue = KIconTopMarginNormalFont; - break; - } - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::TextTopMargin -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::TextTopMargin() - { - FUNC_LOG; - TInt retValue = 0; - - switch ( iFontSettingsValue ) - { - case EAknUiZoomSmall: //Fallthrough - case EAknUiZoomVerySmall: - { - retValue = EESMRTextTopMarginSmall; - break; - } - case EAknUiZoomNormal: - { - retValue = EESMRTextTopMarginNormal; - break; - } - case EAknUiZoomLarge: //Fallthrough - case EAknUiZoomVeryLarge: - { - retValue = EESMRTextTopMarginLarge; - break; - } - default: - { - retValue = KIconTopMarginNormalFont; - break; - } - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::TextSideMargin -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::TextSideMargin() - { - FUNC_LOG; - return KTextSideMargin; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::TitlePaneHeight -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::TitlePaneHeight() - { - FUNC_LOG; - return KTitlePaneHeight; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::AddSize -// --------------------------------------------------------------------------- -// -void CESMRLayoutManager::AddSize( - TESMREntryFieldId aId, - TInt aFontSmallHeight, - TInt aFontNormalHeight, - TInt aFontLargeHeight, - TInt aWidthLandscape, - TInt aWidthPortrait ) - { - FUNC_LOG; - SFieldSize size; - size.iId = aId; - size.iFontSmallHeight = aFontSmallHeight; - size.iFontNormalHeight = aFontNormalHeight; - size.iFontLargeHeight = aFontLargeHeight; - size.iWidthLandscape = aWidthLandscape; - size.iWidthPortrait = aWidthPortrait; - iSize.Append( size ); - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::IsMirrored -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CESMRLayoutManager::IsMirrored() - { - FUNC_LOG; - return Layout_Meta_Data::IsMirrored(); - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::SetBitmapFallback -// If a new scalable graphic -// is added to the mif file, it should be mapped to fallback here. -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRLayoutManager::SetBitmapFallback(const TAknsItemID& aIconId, - TInt& aFileIndex, - TInt& aFileMaskIndex) - { -// icons changed - FUNC_LOG; - switch ( aIconId.iMinor ) - { - case EAknsMinorGenericQgnFscalIndiPriorityHigh: - case EAknsMinorGenericQgnFsIndiPriorityHigh: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiPriorityNormal: - case EAknsMinorGenericQgnFsIndiPriorityNormal: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiPriorityLow: - case EAknsMinorGenericQgnFsIndiPriorityLow: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiAlarmDay: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_day; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_day_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiAlarmTime: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiSubject: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiRecurrence: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiAlarm: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiCheckboxMark: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiCheckboxUnmark: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiClock: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiDateEnd: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiDateStart: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiLocation: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiSynchronisation: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiOccasion: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion_mask; - break; - } - - case EAknsMinorGenericQgnFsIndiCaleTrackingTentative: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative_mask; - break; - } - case EAknsMinorGenericQgnFsIndiCaleTrackingAccept: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept_mask; - break; - } - case EAknsMinorGenericQgnFsIndiCaleTrackingNone: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none_mask; - break; - } - case EAknsMinorGenericQgnFsIndiCaleTrackingReject: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject_mask; - break; - } - case EAknsMinorGenericQgnFseMailAttachment: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_attachment; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; - break; - } - case EAknsMinorGenericQgnFsGrafEmailCtrlbar: - { - aFileIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar; - aFileMaskIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar_mask; - break; - } - case EAknsMinorQgnPropCheckboxOn: - aFileIndex = EMbmEsmrguiQgn_prop_checkbox_on; - aFileMaskIndex = EMbmEsmrguiQgn_prop_checkbox_on_mask; - break; - case EAknsMinorQgnPropCheckboxOff: - aFileIndex = EMbmEsmrguiQgn_prop_checkbox_off; - aFileMaskIndex = EMbmEsmrguiQgn_prop_checkbox_off_mask; - break; - case EAknsMinorQgnFsListCenter: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_center; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; - break; - } - case EAknsMinorQgnFsListSideT: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_t; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; - break; - } - case EAknsMinorQgnFsListSideL: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_l; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; - break; - } - case EAknsMinorQgnFsListSideR: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_r; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; - break; - } - case EAknsMinorQgnFsListSideB: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_b; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; - break; - } - case EAknsMinorQgnFsListCornerTl: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_tl; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; - break; - } - case EAknsMinorQgnFsListCornerTr: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_tr; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; - break; - } - case EAknsMinorQgnFsListCornerBl: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_bl; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; - break; - } - case EAknsMinorQgnFsListCornerBr: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_br; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; - break; - } - case EAknsMinorGenericQgnFsHscrActionArrowLeft: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; - break; - } - // removed when icons changed to common ones - /* - case EAknsMinorGenericQgnFsHscrActionArrowRight: - { - aFileIndex = EMbmEsmrguiQgn_indi_action_menu; - aFileMaskIndex = EMbmEsmrguiQgn_indi_action_menu_mask; - break; - } - */ - // - // Commented to enable compilation in wk04 - /*case EAknsMinorGenericQgnFseActionMenuOpenInWebIcon: - { - aFileIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_web_icon; - aFileMaskIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_web_icon; - break; - } - case EAknsMinorGenericQgnFseActionMenuOpenInIntranetIcon: - { - aFileIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_intranet_icon; - aFileMaskIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_intranet_icon_mask; - break; - } - case EAknsMinorGenericQgnFseActionMenuBookmarkIcon: - { - aFileIndex = EMbmEsmrguiQgn_fse_action_menu_bookmark_icon; - aFileMaskIndex = EMbmEsmrguiQgn_fse_action_menu_bookmark_icon_mask; - break; - }*/ - // - // removed when icons changed to common ones - /* - case EAknsMinorGenericQgnPropBlidWaypoint: - { - aFileIndex = EMbmEsmrguiQgn_fs_action_show_on_maps; - aFileMaskIndex = EMbmEsmrguiQgn_fs_action_show_on_maps_mask; - break; - } - */ - // - default: - { - // icons changed - aFileIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; - break; - // - } - -// - } - } - - - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ResponseAreaAnswerTextSize -// --------------------------------------------------------------------------- -// -TSize CESMRLayoutManager::ResponseAreaAnswerTextSize() - { - FUNC_LOG; - return KResponseAreaAnswerTextSize; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ResponseAreaTopicTextSize -// --------------------------------------------------------------------------- -// -TSize CESMRLayoutManager::ResponseAreaTopicTextSize() - { - FUNC_LOG; - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - return KResponseAreaTopicTextSizeLandscape; - } - else - { - return KResponseAreaTopicTextSizePortrait; - } - } - - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ResponseAreaAnswerTextPosition -// --------------------------------------------------------------------------- -// -TPoint CESMRLayoutManager::ResponseAreaAnswerTextPosition() - { - FUNC_LOG; - TPoint retValue; - TBool mirrored = IsMirrored(); - - switch ( iFontSettingsValue ) - { - case EAknUiZoomSmall: //Fallthrough - case EAknUiZoomVerySmall: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerTextPositionSmallFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerTextPositionSmallFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerTextPositionSmallFontMirrored; - } - } - break; - } - case EAknUiZoomNormal: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerTextPositionNormalFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerTextPositionNormalFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerTextPositionNormalFontMirrored; - } - } - break; - } - case EAknUiZoomLarge: //Fallthrough - case EAknUiZoomVeryLarge: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerTextPositionLargeFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerTextPositionLargeFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerTextPositionLargeFontMirrored; - } - } - break; - } - default: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerTextPositionLargeFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerTextPositionNormalFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerTextPositionNormalFontMirrored; - } - } - break; - } - } - return retValue; - } - - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ResponseAreaAnswerIconPosition -// --------------------------------------------------------------------------- -// -TPoint CESMRLayoutManager::ResponseAreaAnswerIconPosition() - { - FUNC_LOG; - TPoint retValue; - TBool mirrored = IsMirrored(); - - switch ( iFontSettingsValue ) - { - case EAknUiZoomSmall: //Fallthrough - case EAknUiZoomVerySmall: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerIconPositionSmallFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerIconPositionSmallFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerIconPositionSmallFontMirrored; - } - } - break; - } - case EAknUiZoomNormal: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerIconPositionNormalFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerIconPositionNormalFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerIconPositionNormalFontMirrored; - } - } - break; - } - case EAknUiZoomLarge: //Fallthrough - case EAknUiZoomVeryLarge: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerIconPositionLargeFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerIconPositionLargeFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerIconPositionLargeFontMirrored; - } - } - break; - } - default: - { - if( !mirrored ) - { - retValue = KResponseAreaAnswerIconPositionNormalFont; - } - else - { - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - retValue = - KResponseAreaAnswerIconPositionNormalFontMirroredLandscape; - } - else - { - retValue = - KResponseAreaAnswerIconPositionNormalFontMirrored; - } - } - break; - } - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ResponseAreaAnswerItemheight -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::ResponseAreaAnswerItemheight() - { - FUNC_LOG; - TInt retValue; - - switch ( iFontSettingsValue ) - { - case EAknUiZoomSmall: //Fallthrough - case EAknUiZoomVerySmall: - { - retValue = KResponseAreaAnserItemHeightSmallFont; - break; - } - case EAknUiZoomNormal: - { - retValue = KResponseAreaAnserItemHeightNormalFont; - break; - } - case EAknUiZoomLarge: //Fallthrough - case EAknUiZoomVeryLarge: - { - retValue = KResponseAreaAnserItemHeightLargeFont; - break; - } - default: - { - retValue = KResponseAreaAnserItemHeightNormalFont; - break; - } - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::RegularFieldHeight -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::RegularFieldHeight() - { - FUNC_LOG; - TInt retValue; - - switch ( iFontSettingsValue ) - { - case EAknUiZoomSmall: //Fallthrough - case EAknUiZoomVerySmall: - { - retValue = KRegularFieldHeightSmallFont; - break; - } - case EAknUiZoomNormal: - { - retValue = KRegularFieldHeightNormalFont; - break; - } - case EAknUiZoomLarge: //Fallthrough - case EAknUiZoomVeryLarge: - { - retValue = KRegularFieldHeightLargeFont; - break; - } - default: - { - retValue = KRegularFieldHeightNormalFont; - break; - } - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::OrganizerTextWidth -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::OrganizerTextWidth() - { - FUNC_LOG; - return KOrganizerTextWidth; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::OrganizerTextPosition -// --------------------------------------------------------------------------- -// -TPoint CESMRLayoutManager::OrganizerTextPosition() - { - FUNC_LOG; - TPoint retValue(0,0); - if( IsMirrored() ) - { - TInt fieldWidth = FieldSize( EESMRFieldOrganizer ).iWidth; - retValue = TPoint( fieldWidth - KIconSize.iWidth - - ESMRLayout::KIconBorderMargin - OrganizerTextWidth(), - RegularFieldHeight() ); - } - else - { - retValue = TPoint( KIconSize.iWidth + - ESMRLayout::KIconBorderMargin + - TextSideMargin(), - RegularFieldHeight() ); - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ConflictPopupPosition -// --------------------------------------------------------------------------- -// -EXPORT_C TPoint CESMRLayoutManager::ConflictPopupPosition() - { - FUNC_LOG; - TPoint PopupPoint = Layout_Meta_Data::IsLandscapeOrientation() ? - KConflictPopupPositionLandscape : KConflictPopupPositionPortrait ; - - return PopupPoint; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ListAreaBgColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::ListAreaBgColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnOtherColors, - KListAreaBgColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultListAreaBgColor; - } - - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::GeneralListAreaTextColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::GeneralListAreaTextColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - KListAreaTextColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::NormalTextColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::NormalTextColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - KNormalTextColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::NormalTextColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::HighlightedTextColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - KNormalHighLightedTextColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ViewerListAreaTextColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::ViewerListAreaTextColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - KViewerAreaTextColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ViewerListAreaHighlightedTextColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::ViewerListAreaHighlightedTextColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnHighlightColors, - KViewerAreaHighlightedTextColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::TitleAreaTextColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::TitleAreaTextColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - KTitleAreaTextColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::NormalTextBgColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::NormalTextBgColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnOtherColors, - KNormalTextBgColorID ); - - if( err != KErrNone ) - { - bgColor = KDefaultNormalTextBgColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::FieldBorderColor -// --------------------------------------------------------------------------- -// -TRgb CESMRLayoutManager::FieldBorderColor() - { - FUNC_LOG; - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnOtherColors , - KFieldBorderColorID ); - if( err != KErrNone ) - { - bgColor = KDefaultBorderColor; - } - return bgColor; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::NormalTextColorID -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::NormalTextColorID() - { - FUNC_LOG; - return KNormalTextColorID; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::ViewerListAreaTextColorID -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::ViewerListAreaTextColorID() - { - FUNC_LOG; - return KListAreaTextColorID; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::GetSkinBasedBitmap -// --------------------------------------------------------------------------- -// -TInt CESMRLayoutManager::GetSkinBasedBitmap( - TAknsItemID aIconID, - CFbsBitmap*& aBitmap, - CFbsBitmap*& aMask, - TSize aSize ) - { - FUNC_LOG; - TInt retValue = KErrNone; - delete aBitmap; - aBitmap = NULL; - delete aMask; - aMask = NULL; - - TInt fileIndex(-1); - TInt fileMaskIndex(-1); - - SetBitmapFallback( aIconID, fileIndex, fileMaskIndex ); - - TFileName bitmapFilePath; - ESMRHelper::LocateResourceFile( - KESMRMifFile, - KDC_APP_BITMAP_DIR, - bitmapFilePath); - - TRAPD(error, AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - aIconID, - aBitmap, - aMask, - bitmapFilePath, - fileIndex, - fileMaskIndex )); - if ( error != KErrNone ) - { - return error; - } - - AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); - - if( !aBitmap || !aMask ) - { - retValue = KErrNotFound; - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::IsFontChanged -// --------------------------------------------------------------------------- -// -TBool CESMRLayoutManager::IsFontChanged() - { - FUNC_LOG; - return iFontSettingsChanged; - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::HandleNotifyInt -// --------------------------------------------------------------------------- -// -void CESMRLayoutManager::HandleNotifyInt( TUint32 aId, TInt aNewValue ) - { - FUNC_LOG; - if( aId == KAknGlobalUiZoom ) - { - iFontSettingsValue = aNewValue; - iFontSettingsChanged = ETrue; - - // Force CESMRLayoutManager::Font to create new font - delete iFont; - iFont = NULL; - - delete iMfneFont; - iMfneFont = NULL; - - if ( iFontSizeObserver ) - { - iFontSizeObserver->FontSizeSettingsChanged();//Synchronous update - iFontSettingsChanged = EFalse; - } - } - } - -// --------------------------------------------------------------------------- -// CESMRLayoutManager::SetObserver -// --------------------------------------------------------------------------- -// -void CESMRLayoutManager::SetObserver( MESMRFontSizeObserver* aObserver ) - { - FUNC_LOG; - iFontSizeObserver = aObserver; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlistcomponent.cpp --- a/meetingrequest/mrgui/src/cesmrlistcomponent.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,610 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR policy implementation -* -*/ - -#include "emailtrace.h" -#include -#include -#include -#include -#include - -#include "cesmrlistcomponent.h" -#include "cesmrlayoutmgr.h" -#include "nmrlayoutmanager.h" -#include "mesmrfieldstorage.h" -#include "mesmrcalentry.h" -#include "cesmrfield.h" -#include "cmrlistpane.h" -// Removed profiling. - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRListComponent::NewL() -// --------------------------------------------------------------------------- -// -CESMRListComponent* CESMRListComponent::NewL( const CCoeControl* aParent, - MESMRFieldStorage* aStorage, - CESMRLayoutManager* aLayout ) - { - FUNC_LOG; - CESMRListComponent* self = new (ELeave) CESMRListComponent( aStorage, - aLayout ); - CleanupStack::PushL( self ); - self->ConstructL( aParent ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::CESMRListComponent() -// --------------------------------------------------------------------------- -// -CESMRListComponent::CESMRListComponent( MESMRFieldStorage* aFactory, - CESMRLayoutManager* aLayout ) : - iFactory( aFactory ), - iLayout( aLayout ) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::~CESMRListComponent -// --------------------------------------------------------------------------- -// -CESMRListComponent::~CESMRListComponent() - { - FUNC_LOG; - delete iFactory; - delete iScroll; - delete iContainer; - - delete iPhysics; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ConstructL() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::ConstructL( const CCoeControl* aParent ) - { - FUNC_LOG; - CreateWindowL( aParent ); - - iScroll = new (ELeave) CAknDoubleSpanScrollBar( this ); - iScroll->ConstructL( EFalse, this, this, CEikScrollBar::EVertical, 0 ); - iScroll->SetModel( &iScrollModel ); - iScroll->MakeVisible( ETrue ); - - const TInt count(iFactory->Count()); - for ( TInt i = 0; i < count; i++ ) - { - CESMRField* field = iFactory->Field(i); - - field->SetListObserver( this ); - field->SetLayoutManager( iLayout ); - } - - iContainer = CMRListPane::NewL( *this, *iFactory, iScrollModel ); - iPrevThumbPos = iScroll->ThumbPosition(); - - if ( CAknPhysics::FeatureEnabled() ) - { - iPhysics = CAknPhysics::NewL( *this, iContainer ); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::InternalizeL() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::InitializeL() - { - FUNC_LOG; - const TInt count(iFactory->Count()); - for ( TInt i = 0; i < count; i++ ) - { - iFactory->Field(i)->InitializeL(); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::InternalizeL() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::InternalizeL( MESMRCalEntry& aEntry ) - { - FUNC_LOG; - iFactory->InternalizeL( aEntry ); - // This is called to make sure everything is drawn correctly - DrawDeferred(); - } - -void CESMRListComponent::DisableSizeChange(TBool aDisable ) - { - FUNC_LOG; - iDisableSizeChanged = aDisable; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ExternalizeL() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::ExternalizeL( - MESMRCalEntry& aEntry, - TBool aForceValidation ) - { - FUNC_LOG; - CESMRField* currentFocus = FocusedItem(); - ASSERT( currentFocus ); - TESMREntryFieldId id = currentFocus->FieldId(); - - if ( aForceValidation ) - { - // force validate the values: - TInt err = iFactory->Validate( id, aForceValidation ); - // fill the calendar entry with data in fields. - iFactory->ExternalizeL( aEntry ); - } - else - { - TInt err = iFactory->Validate( id ); - if ( err ) - { - SetControlFocusedL( id ); - User::Leave( err ); - } - else - { - // fill the calendar entry with data in fields. - iFactory->ExternalizeL( aEntry ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::CountComponentControls() -// --------------------------------------------------------------------------- -// -TInt CESMRListComponent::CountComponentControls() const - { - FUNC_LOG; - return 2; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::HandleFontChange() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::HandleFontChange() - { - FUNC_LOG; - // Disable SizeChanged handling until all fonts are updated - iDisableSizeChanged = ETrue; - const TInt count(iFactory->Count()); - for ( TInt i = 0; i < count; i++ ) - { - // Updates Font depending on the type of a field - TRAP_IGNORE( iFactory->Field(i)->FontChangedL() ); - } - // Enable and call SizeChanged - iDisableSizeChanged = EFalse; - SizeChanged(); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ComponentControl() -// --------------------------------------------------------------------------- -// -CCoeControl* CESMRListComponent::ComponentControl( TInt aInd ) const - { - FUNC_LOG; - CCoeControl* control = NULL; - switch ( aInd ) - { - case 0: - control = iContainer; - break; - case 1: - control = iScroll; - break; - default: - break; - } - return control; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::SizeChanged -// --------------------------------------------------------------------------- -// -void CESMRListComponent::SizeChanged() - { - FUNC_LOG; - if ( iDisableSizeChanged || Rect() == TRect( 0, 0, 0, 0 ) ) - { - return; - } - - TRect containerRect( Rect() ); - - TAknLayoutRect listareaLayoutRect = - NMRLayoutManager::GetLayoutRect( containerRect, NMRLayoutManager::EMRLayoutListArea ); - TRect listareaRect( listareaLayoutRect.Rect() ); - iContainer->SetRect( listareaRect ); - - TAknWindowComponentLayout scrollLayout = - NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutScrollBar ); - AknLayoutUtils::LayoutControl( iScroll, containerRect, scrollLayout ); - - ScrollItemVisible( KErrNotFound ); // Update scroll position - - // physics needs to be initialized before screensaver gets activated - TRAP_IGNORE( UpdatePhysicsL() ); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CESMRListComponent::OfferKeyEventL( - const TKeyEvent &aEvent, - TEventCode aType ) - { - FUNC_LOG; - TKeyResponse response = iContainer->OfferKeyEventL( aEvent, aType ); - - if ( EKeyWasConsumed == response ) - { - iScroll->SetModel( &iScrollModel ); - } - - TInt thumbPos = iScroll->ThumbPosition(); - iPrevThumbPos = thumbPos; - - if( iPhysics ) - { - iPhysics->StopPhysics(); - iPhysics->ResetFriction(); - } - - return response; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::HandleScrollEventL -// --------------------------------------------------------------------------- -// -void CESMRListComponent::HandleScrollEventL( - CEikScrollBar* aScrollBar, - TEikScrollEvent /*aEventType*/ ) - { - FUNC_LOG; - if ( aScrollBar == iScroll ) - { - TInt thumbPos = aScrollBar->ThumbPosition(); - TInt delta = thumbPos - iPrevThumbPos; - if ( delta != 0 ) - { - iPrevThumbPos = thumbPos; - iContainer->ScrollView( delta ); - } - } - if( iPhysics ) - { - iPhysics->StopPhysics(); - iPhysics->ResetFriction(); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::UpdatePhysicsL -// --------------------------------------------------------------------------- -// -void CESMRListComponent::UpdatePhysicsL() - { - FUNC_LOG; - if ( iPhysics ) - { - const TSize viewSize( Size() ); - TInt wSize = iScrollModel.ScrollSpan(); - const TSize worldSize( viewSize.iWidth, wSize ); - - - iPhysics->StopPhysics(); - iPhysics->ResetFriction(); - iPhysics->InitPhysicsL( worldSize, viewSize, EFalse ); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ViewPositionChanged -// --------------------------------------------------------------------------- -// -void CESMRListComponent::ViewPositionChanged( - const TPoint& aNewPosition, - TBool /*aDrawNow*/, - TUint /*aFlags*/ ) - { - // Sometimes ViewPositionChanged events come after view is already changed, - // so adding a safety check here - if( IsVisible() ) - { - TPoint centerPos = iContainer->GetViewCenterPosition(); - TInt scrollOffset = aNewPosition.iY - centerPos.iY; - - iContainer->ScrollView( scrollOffset ); - iPrevThumbPos = iScroll->ThumbPosition(); - // updates scrollbar thumb position and does redrawing - iScroll->SetModel( &iScrollModel ); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::PhysicEmulationEnded -// --------------------------------------------------------------------------- -// -void CESMRListComponent::PhysicEmulationEnded() - { - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ViewPosition -// --------------------------------------------------------------------------- -// -TPoint CESMRListComponent::ViewPosition() const - { - TPoint viewPos = iContainer->GetViewCenterPosition(); - return viewPos; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ScrollItemVisible() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::ScrollItemVisible( TInt aInd/*, TBool*/ /*aSizeChanged*/ ) - { - FUNC_LOG; - iContainer->ScrollItemVisible( aInd ); - UpdateScrollBar(); - DrawDeferred(); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::UpdateScrollBar() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::UpdateScrollBar() - { - FUNC_LOG; - iContainer->UpdateFocusPosition(); - iScroll->SetModel( &iScrollModel ); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ListObserver -// --------------------------------------------------------------------------- -// -MESMRListObserver& CESMRListComponent::ListObserver() - { - FUNC_LOG; - return *this; - } - -CESMRField* CESMRListComponent::FocusedItem() const - { - FUNC_LOG; - return iContainer->FocusedItem(); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::IsControlVisible() -// --------------------------------------------------------------------------- -// -TBool CESMRListComponent::IsControlVisible( TESMREntryFieldId aField ) - { - FUNC_LOG; - TBool ret( EFalse ); - - CESMRField* field = iFactory->FieldById( aField ); - if ( field && field->IsVisible() ) - { - ret = ETrue; - } - - return ret; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ControlSizeChanged() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::ControlSizeChanged( CESMRField* aField ) - { - FUNC_LOG; - /* Called whenever one of the controls size changed - * E.G. when a eik edwin expands */ - iContainer->ControlSizeChanged( aField ); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::InsertControl() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::InsertControl( TESMREntryFieldId aField ) - { - FUNC_LOG; - iContainer->InsertControl( aField ); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::RemoveControl() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::RemoveControl( TESMREntryFieldId aField ) - { - FUNC_LOG; - iContainer->RemoveControl( aField ); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::SetControlFocused() -// --------------------------------------------------------------------------- -// -void CESMRListComponent::SetControlFocusedL( TESMREntryFieldId aField ) - { - FUNC_LOG; - iContainer->SetControlFocusedL( aField ); - UpdateScrollBar(); - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::MoveListAreaDownL -// --------------------------------------------------------------------------- -// -void CESMRListComponent::MoveListAreaDownL( TInt aAmount ) - { - FUNC_LOG; - iContainer->MoveListAreaDownL( aAmount ); - - // Do the view scrolling if needed: - if ( aAmount ) - { - UpdateScrollBar(); - DrawDeferred(); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::MoveListAreaUpL -// --------------------------------------------------------------------------- -// -void CESMRListComponent::MoveListAreaUpL( TInt aAmount ) - { - FUNC_LOG; - iContainer->MoveListAreaUpL( aAmount ); - - // do the scrolling if needed: - if ( aAmount > 0 ) - { - UpdateScrollBar(); - DrawDeferred(); - } - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::ListHeight() -// --------------------------------------------------------------------------- -// -TInt CESMRListComponent::ListHeight() - { - FUNC_LOG; - return iContainer->Size().iHeight; - } - -// --------------------------------------------------------------------------- -// CESMRListComponent::IsFieldBottomVisible() -// --------------------------------------------------------------------------- -// - TBool CESMRListComponent::IsFieldBottomVisible() - { - FUNC_LOG; - return iContainer->IsFieldBottomVisible(); - } - - // ----------------------------------------------------------------------------- - // CESMRListComponent::HandlePointerEventL - // ----------------------------------------------------------------------------- - // - void CESMRListComponent::HandlePointerEventL( const TPointerEvent& aPointerEvent ) - { - FUNC_LOG; - - - CCoeControl::HandlePointerEventL(aPointerEvent); - TPoint position = aPointerEvent.iPosition; - - switch ( aPointerEvent.iType ) - { - case TPointerEvent::EButton1Down: - iPreviousPosition = iOriginalPosition = aPointerEvent.iPosition; - - iIsScrolling = iScroll->Rect().Contains(aPointerEvent.iPosition ); - iCurrentScrollSpan = iScrollModel.ScrollSpan(); - - - iIsDragging = EFalse; - if( iPhysics ) - { - iStartTime.HomeTime(); - UpdatePhysicsL(); - } - break; - - case TPointerEvent::EDrag: - if (!iIsScrolling) - { - // if when dragging scrollbar pointer touches container rectangle, - // do not activate physics! - iIsDragging = ETrue; - - if( iPhysics ) - { - TPoint delta( 0, iPreviousPosition.iY - position.iY ); - iPhysics->RegisterPanningPosition( delta ); - } - } - // Save current position as previous pos for future calculations - iPreviousPosition = position; - break; - - case TPointerEvent::EButton1Up: - if( iIsDragging && iPhysics ) - { - TPoint drag(iOriginalPosition - aPointerEvent.iPosition); - iPhysics->StartPhysics(drag, iStartTime); - } - - // some fields may change their size due to as result of click, update model if needed - if (iCurrentScrollSpan != iScrollModel.ScrollSpan()) - { - iScroll->SetModel( &iScrollModel ); - } - break; - } - } - - - // ----------------------------------------------------------------------------- - // CESMRListComponent::MakeVisible - // ----------------------------------------------------------------------------- - // -void CESMRListComponent::MakeVisible( TBool aIsVisible ) - { - if(!aIsVisible && IsVisible() ) - { - // hiding the control, stop physics for performance gain - if( iPhysics ) - { - iPhysics->StopPhysics(); - iPhysics->ResetFriction(); - } - } - } -// End of file - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlistquery.cpp --- a/meetingrequest/mrgui/src/cesmrlistquery.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,569 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for mrui list queries -* -*/ - - -// INCLUDE FILES -#include "emailtrace.h" -#include "cesmrlistquery.h" - -#include -// -#include "esmrdef.h" -// -#include -#include -#include -#include -#include - -#include "esmrgui.hrh" -#include "cesmralarm.h" -#include "cesmrrecurrence.h" -#include "esmrhelper.h"//locateresourcefile - -// CONSTANTS -// Unnamed namespace for local definitions -namespace { - -// resource file: -_LIT( KResourceFileName, "esmrgui.rsc"); - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// CESMRListQuery::CESMRListQuery -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -inline CESMRListQuery::CESMRListQuery( TESMRListQueryType aType ) : - iType(aType) - { - FUNC_LOG; - // Do nothing - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::~CESMRListQuery -// ----------------------------------------------------------------------------- -// -CESMRListQuery::~CESMRListQuery() - { - FUNC_LOG; - iAlarmArray.ResetAndDestroy(); - iRecurrenceArray.ResetAndDestroy(); - iEnv->DeleteResourceFile(iResourceOffset); - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::NewL -// ----------------------------------------------------------------------------- -// -EXPORT_C CESMRListQuery* - CESMRListQuery::NewL( TESMRListQueryType aType ) - { - CESMRListQuery* self = new (ELeave) CESMRListQuery(aType); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::ConstructL -// ----------------------------------------------------------------------------- -// -void CESMRListQuery::ConstructL() - { - FUNC_LOG; - TFileName filename; - - iEnv = CEikonEnv::Static(); // codescanner::eikonenvstatic - - ESMRHelper::LocateResourceFile( - KResourceFileName, - KDC_RESOURCE_FILES_DIR, - filename, - &iEnv->FsSession() ); - - //for localization - BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); - iResourceOffset = iEnv->AddResourceFileL(filename); - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::SetAttendeeStatus -// ----------------------------------------------------------------------------- -// -void CESMRListQuery::SetAttendeeStatus(TESMRAttendeeStatus aStatus) - { - FUNC_LOG; - iStatus = aStatus; - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::ExecuteL -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRListQuery::ExecuteEditBeforeSendL( - TESMRAttendeeStatus aStatus) - { - FUNC_LOG; - CESMRListQuery* query = - CESMRListQuery::NewL( EESMREditBeforeSendQuery ); - CleanupStack::PushL(query); - query->SetAttendeeStatus(aStatus); - TInt ret = query->ExecuteLD(); - CleanupStack::Pop(query); - return ret; - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::ExecuteL -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRListQuery::ExecuteEditBeforeSendWithSendOptOnlyL( - TESMRAttendeeStatus aStatus ) - { - FUNC_LOG; - CESMRListQuery* query = - CESMRListQuery::NewL( - EESMREditBeforeSendQueryWithSendOptionsOnly ); - CleanupStack::PushL(query); - query->SetAttendeeStatus(aStatus); - TInt ret = query->ExecuteLD(); - CleanupStack::Pop(query); - return ret; - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::ExecuteL -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRListQuery::ExecuteL( TESMRListQueryType aType ) - { - FUNC_LOG; - CESMRListQuery* query = CESMRListQuery::NewL(aType); - CleanupStack::PushL(query); - TInt ret = query->ExecuteLD(); - CleanupStack::Pop(query); - return ret; - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::SetListQueryTextsL -// ----------------------------------------------------------------------------- -// -void CESMRListQuery::SetListQueryTextsL( - CDesCArrayFlat* aItemArray, - CAknPopupList* aPopupList) - { - FUNC_LOG; - if ( iType == EESMREditBeforeSendQuery || - iType == EESMREditBeforeSendQueryWithSendOptionsOnly) - { - // Set title: - if (iStatus == EESMRAttendeeStatusAccept) - { - aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_QUERY_ACCEPTED)); - CleanupStack::PopAndDestroy(); // Resource string - } - else if (iStatus == EESMRAttendeeStatusTentative) - { - aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_QUERY_TENTATIVE)); - CleanupStack::PopAndDestroy(); // Resource string - } - else if (iStatus == EESMRAttendeeStatusDecline) - { - aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_QUERY_DECLINED)); - CleanupStack::PopAndDestroy(); // Resource string - } - - // Set list items: - aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_NOW)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_EDIT_BEFORE_SEND)); - CleanupStack::PopAndDestroy(); // Resource string - - if ( iType == EESMREditBeforeSendQuery ) - { - aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_DONT_SEND_RESPONSE)); - CleanupStack::PopAndDestroy(); // Resource string - } - } - - else if ( iType == EESMRSendUpdateToAllQuery ) - { - // Set title: - aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_UPDATE_QUERY)); - CleanupStack::PopAndDestroy(); // Resource string - - // Set list items: - aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_UPDATE_ALL_QUERY)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SEND_UPDATE_UPDATED_QUERY)); - CleanupStack::PopAndDestroy(); // Resource string - } - else if ( iType == EESMRRecurrenceQuery ) - { - // Set title: - aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_SET_RECURRENCE_HEADER)); - CleanupStack::PopAndDestroy(); // Resource string - const TInt count(iRecurrenceArray.Count()); - for ( TInt i=0; iAppendL(iRecurrenceArray[i]->RecurrenceText()); - } - } - else if ( iType == EESMRRelativeAlarmTimeQuery ) - { - aPopupList->SetTitleL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_SET_ALARM_HEADER)); - CleanupStack::PopAndDestroy(); // Resource string - - const TInt count(iAlarmArray.Count()); - for ( TInt i=0; iAppendL(*iAlarmArray[i]->Text()); - } - } - else if ( iType == EESMROpenThisOccurenceOrSeriesQuery ) - { - // Set title: - aPopupList->SetTitleL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_RECURRENT_HEADING_OPEN)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_RECURRENT_THIS_OCCURRENCE)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_RECURRENT_SERIES)); - CleanupStack::PopAndDestroy(); // Resource string - } - else if (iType == EESMRDeleteThisOccurenceOrSeriesQuery ) - { - // Deleting recurrent event - aPopupList->SetTitleL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_RECURRENT_HEADING_DELETE)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_RECURRENT_THIS_OCCURRENCE_DELETE)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_RECURRENT_SERIES_DELETE)); - CleanupStack::PopAndDestroy(); // Resource string - } - else if ( iType == EESMRPriorityPopup || iType == EESMRTodoPriorityPopup) - { - // Set title: - aPopupList->SetTitleL(*StringLoader::LoadLC( - R_QTN_MEET_REQ_OPT_PRIORITY)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_PRIORITY_HIGH)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_PRIORITY_NORMAL)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_PRIORITY_LOW)); - CleanupStack::PopAndDestroy(); // Resource string - } - else if ( iType == EESMRSynchronizationPopup ) - { - // Set title: - aPopupList->SetTitleL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_SYNC_TITLE)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_SYNC_PRIVATE)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_SYNC_PUBLIC)); - CleanupStack::PopAndDestroy(); // Resource string - aItemArray->AppendL(*StringLoader::LoadLC( - R_QTN_CALENDAR_TASK_SYNC_NONE)); - CleanupStack::PopAndDestroy(); // Resource string - } - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::MapSelectedIndexToReturnValue -// ----------------------------------------------------------------------------- -// -TInt CESMRListQuery::MapSelectedIndexToReturnValue(TInt aIndex) - { - FUNC_LOG; - TInt response (KErrCancel); - - if (iType == EESMREditBeforeSendQuery || - iType == EESMREditBeforeSendQueryWithSendOptionsOnly ) - { - switch( aIndex ) - { - case 0: - { - response = EESMRResponsePlain; - break; - } - case 1: - { - response = EESMRResponseMessage; - break; - } - case 2: - { - response = EESMRResponseDontSend; - break; - } - default: - { - break; - } - } - } - else if (iType == EESMRSendUpdateToAllQuery ) - { - switch( aIndex ) - { - case 0: - { - response = EESMRSendToAllParticipants; - break; - } - case 1: - { - response = EESMRSendToAddedOrRemovedParticipants; - break; - } - default: - { - break; - } - } - } - else if ( iType == EESMRRecurrenceQuery ) - { - return iRecurrenceArray[aIndex]->RecurrenceValue(); - } - else if ( iType == EESMRRelativeAlarmTimeQuery ) - { - return iAlarmArray[aIndex]->Id(); - } - else if ( iType == EESMROpenThisOccurenceOrSeriesQuery || - iType == EESMRDeleteThisOccurenceOrSeriesQuery ) - { - switch ( aIndex ) - { - case 0: - { - response = EESMRThisOccurence; - break; - } - case 1: - { - response = EESMRSeries; - break; - } - default: - break; - } - } - else if ( iType == EESMRPriorityPopup ) - { - switch ( aIndex ) - { - case 0: - { - response = EFSCalenMRPriorityHigh; - break; - } - case 1: - { - response = EFSCalenMRPriorityNormal; - break; - } - case 2: - { - response = EFSCalenMRPriorityLow; - break; - } - default: - break; - } - } - else if ( iType == EESMRTodoPriorityPopup ) - { - switch ( aIndex ) - { - case 0: - { - response = EFSCalenTodoPriorityHigh; - break; - } - case 1: - { - response = EFSCalenTodoPriorityNormal; - break; - } - case 2: - { - response = EFSCalenTodoPriorityLow; - break; - } - default: - break; - } - - } - else if ( iType == EESMRSynchronizationPopup ) - { - switch ( aIndex ) - { - case 0: - { - response = ESyncPublic; - break; - } - case 1: - { - response = ESyncPrivate; - break; - } - case 2: - { - response = ESyncNone; - break; - } - default: - break; - } - } - - return response; - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::ExecuteLD -// ----------------------------------------------------------------------------- -// -void CESMRListQuery::LoadTextsFromResourceL() - { - FUNC_LOG; - if ( iType == EESMRRelativeAlarmTimeQuery ) - { - TResourceReader reader; - iEnv->CreateResourceReaderLC( reader, R_ESMREDITOR_ALARMS ); - - // Read alarm items to array - iAlarmArray.Reset(); - TInt count = reader.ReadInt16(); - for ( TInt i(0); i < count; i++ ) - { - CESMRAlarm* alarm = new (ELeave) CESMRAlarm; - CleanupStack::PushL( alarm ); - alarm->ConstructFromResourceL( reader ); - alarm->LoadTextL( iEnv ); - CleanupStack::Pop( alarm ); - iAlarmArray.Append( alarm ); - } - CleanupStack::PopAndDestroy(); // resource reader - } - else if ( iType == EESMRRecurrenceQuery ) - { - TResourceReader reader; - iEnv->CreateResourceReaderLC( reader, R_ESMREDITOR_RECURRENCE ); - - // Read alarm items to array - iRecurrenceArray.Reset(); - TInt count = reader.ReadInt16(); - for ( TInt i(0); i < count; i++ ) - { - CESMRRecurrence* recurrence = new (ELeave) CESMRRecurrence; - CleanupStack::PushL( recurrence ); - recurrence->ConstructFromResourceL( iEnv, reader ); - CleanupStack::Pop( recurrence ); - iRecurrenceArray.Append( recurrence ); - } - CleanupStack::PopAndDestroy(); // resource reader - } - } - -// ----------------------------------------------------------------------------- -// CESMRListQuery::ExecuteLD -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRListQuery::ExecuteLD() - { - FUNC_LOG; - TInt response(KErrCancel); - - CAknSinglePopupMenuStyleListBox* list = - new(ELeave)CAknSinglePopupMenuStyleListBox; - CleanupStack::PushL(list); - - CAknPopupList* popupList = CAknPopupList::NewL(list, - R_AVKON_SOFTKEYS_OK_CANCEL, - AknPopupLayouts::EMenuGraphicHeadingWindow); - CleanupStack::PushL(popupList); - - list->ConstructL(popupList, 0); - list->CreateScrollBarFrameL(ETrue); - list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EOn); - - CDesCArrayFlat* itemArray = new(ELeave)CDesCArrayFlat(2); - CleanupStack::PushL(itemArray); - - LoadTextsFromResourceL(); - - SetListQueryTextsL(itemArray, popupList); - - CleanupStack::Pop(itemArray); - list->Model()->SetItemTextArray(itemArray); - list->Model()->SetOwnershipType(ELbmOwnsItemArray); - - // Show popup list and then show return value. - TInt popupOk = popupList->ExecuteLD(); - - if (popupOk) - { - response = MapSelectedIndexToReturnValue( list->CurrentItemIndex() ); - } - - CleanupStack::Pop(popupList); - CleanupStack::PopAndDestroy(list); - delete this; // red key works correctly and no double destruction possible - - return response; - } - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlocationhistoryitem.cpp --- a/meetingrequest/mrgui/src/cesmrlocationhistoryitem.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrlocationhistoryitem.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlocationhistoryitemfactory.cpp --- a/meetingrequest/mrgui/src/cesmrlocationhistoryitemfactory.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrlocationhistoryitemfactory.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlocationhistorymanager.cpp --- a/meetingrequest/mrgui/src/cesmrlocationhistorymanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrlocationhistorymanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrlocationpluginhandler.cpp --- a/meetingrequest/mrgui/src/cesmrlocationpluginhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrlocationpluginhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,20 +16,25 @@ */ #include "emailtrace.h" #include "cesmrlocationpluginhandler.h" +#include "esmrconfig.hrh" #include -#include -#include +#include +#include #include // #include "cesmrurlparserplugin.h" // -#include -#include -#include -#include +#include +#include +#include +#include #include +#ifdef RD_USE_MYLOCATIONUI +#include +#endif //RD_USE_MYLOCATIONUI + #include "cesmrlocationplugin.h" #include "esmrcommands.h" #include "mesmrcalentry.h" @@ -57,101 +62,91 @@ // CESMRLocationPluginHandler::CESMRLocationPluginHandler( MObjectProvider& aParent ) : iParent(&aParent) - { + { FUNC_LOG; - - } + + } // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::~CESMRLocationPluginHandler // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::~CESMRLocationPluginHandler() - { + { FUNC_LOG; delete iWait; delete iLocationPlugin; delete iLandmark; delete iUrlParser; - delete iLocationHistoryManager; - } + delete iLocationHistoryManager; + } // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::NewL // ----------------------------------------------------------------------------- // -CESMRLocationPluginHandler* CESMRLocationPluginHandler::NewL( +CESMRLocationPluginHandler* CESMRLocationPluginHandler::NewL( MObjectProvider& aParent ) - { + { FUNC_LOG; - CESMRLocationPluginHandler* self = - new (ELeave) CESMRLocationPluginHandler( aParent ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - + CESMRLocationPluginHandler* self = + new (ELeave) CESMRLocationPluginHandler( aParent ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::ConstructL // ----------------------------------------------------------------------------- // void CESMRLocationPluginHandler::ConstructL() - { + { FUNC_LOG; - iWait = new( ELeave ) CActiveSchedulerWait; - } + iWait = new( ELeave ) CActiveSchedulerWait; + } // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::HandleCommandL // ----------------------------------------------------------------------------- // TBool CESMRLocationPluginHandler::HandleCommandL( TInt aCommand, - MESMRCalEntry& aEntry, - TBool aIgnoreQuery ) - { + MESMRCalEntry& aEntry, + TBool aIgnoreQuery ) + { FUNC_LOG; - iIgnoreQuery = aIgnoreQuery; - iEntryUpdated = EFalse; - - switch ( aCommand ) - { - case EESMRCmdAssignFromMap: - { - if( !(iWait->IsStarted()) ) - { - const TDesC& location = aEntry.Entry().LocationL(); - - // Extract location URL from description - TPtrC locationUrl; - UrlParserL().FindLocationUrl( aEntry.Entry().DescriptionL(), - locationUrl ); - - // Launch Maps - LocationPluginL().SelectFromMapL( location, locationUrl ); - iWait->Start(); // codescanner::callActiveObjectWithoutCheckingOrStopping - - // iLandmark is set in async callback SelectFromMapCompleted - // from Maps application. - if ( iLandmark ) - { - UpdateEntryFromLandmarkL( aEntry, *iLandmark ); - delete iLandmark; - iLandmark = NULL; - } - } - } - break; - case EESMRCmdUpdateFromMap: + iIgnoreQuery = aIgnoreQuery; + iEntryUpdated = EFalse; + + switch ( aCommand ) + { + case EESMRCmdAssignFromMap: { - if ( !(iWait->IsStarted()) ) + if( !(iWait->IsStarted()) ) { - // Launch Maps and ignore existing coordinates, - // because location has been updated - LocationPluginL().SelectFromMapL( aEntry.Entry().LocationL(), - KNullDesC ); + CCalEntry& entry = aEntry.Entry(); + const TDesC& location = entry.LocationL(); + + CCalGeoValue* geoVal = entry.GeoValueL(); + + if ( geoVal ) + { + // Launch Maps + LocationPluginL().SelectFromMapL( location, geoVal ); + } + else + { + // Extract location URL from description + TPtrC locationUrl; + UrlParserL().FindLocationUrl( entry.DescriptionL(), + locationUrl ); + + // Launch Maps + LocationPluginL().SelectFromMapL( location, locationUrl ); + } iWait->Start(); // codescanner::callActiveObjectWithoutCheckingOrStopping - + // iLandmark is set in async callback SelectFromMapCompleted // from Maps application. if ( iLandmark ) @@ -159,45 +154,96 @@ UpdateEntryFromLandmarkL( aEntry, *iLandmark ); delete iLandmark; iLandmark = NULL; - } + } + } + } + break; + case EESMRCmdUpdateFromMap: + { + if ( !(iWait->IsStarted()) ) + { + // Launch Maps and ignore existing coordinates, + // because location has been updated + LocationPluginL().SelectFromMapL( aEntry.Entry().LocationL(), + KNullDesC ); + iWait->Start(); // codescanner::callActiveObjectWithoutCheckingOrStopping + + // iLandmark is set in async callback SelectFromMapCompleted + // from Maps application. + if ( iLandmark ) + { + UpdateEntryFromLandmarkL( aEntry, *iLandmark ); + delete iLandmark; + iLandmark = NULL; + } } break; } - case EESMRCmdSearchFromMap: - { - const TDesC& location = aEntry.Entry().LocationL(); - LocationPluginL().SearchFromMapL( location ); - } - break; - case EESMRCmdShowOnMap: - { - const TDesC& description = aEntry.Entry().DescriptionL(); - TPtrC locationUrl; - TInt position = iUrlParser->FindLocationUrl( description, - locationUrl ); - const TDesC& location = aEntry.Entry().LocationL(); - if ( position >= 0 ) - { - LocationPluginL().ShowOnMapL( location, locationUrl ); - } - break; - } - case EESMRCmdLandmarks: - { + case EESMRCmdSearchFromMap: + { + const TDesC& location = aEntry.Entry().LocationL(); + LocationPluginL().SearchFromMapL( location ); + } + break; + case EESMRCmdShowOnMap: + { + CCalGeoValue* geoVal = aEntry.Entry().GeoValueL(); + TReal lat, lon; + if ( geoVal && geoVal->GetLatLong( lat, lon ) ) + { + LocationPluginL().ShowOnMapL( *geoVal ); + } + else + { + const TDesC& description = aEntry.Entry().DescriptionL(); + TPtrC locationUrl; + TInt position = UrlParserL().FindLocationUrl( description, + locationUrl ); + if ( position >= 0 ) + { + LocationPluginL().ShowOnMapL( locationUrl ); + } + } + break; + } + case EESMRCmdLandmarks: + { SearchFromLandmarksL( iParent, aEntry ); - break; - } - case EESMRCmdPreviousLocations: - { - ShowSelectPreviousLocationQueryL( aEntry ); - break; - } - default: - User::Leave( KErrGeneral ); - } - - return iEntryUpdated; - } + break; + } + case EESMRCmdPreviousLocations: + { + ShowSelectPreviousLocationQueryL( aEntry ); + break; + } + case EMRCommandMyLocations: + { +#ifdef RD_USE_MYLOCATIONUI + CMyLocationSelectorUi* ui = CMyLocationSelectorUi::NewL(); + CleanupStack::PushL( ui ); + + CPosLandmark* landmark = ui->LaunchMyLocationSelectorUiL(); + + if ( landmark ) + { + CleanupStack::PushL( landmark ); + UpdateEntryFromLandmarkL( aEntry, *landmark ); + CleanupStack::PopAndDestroy( landmark ); + } + + CleanupStack::PopAndDestroy( ui ); +#else // RD_USE_MYLOCATIONUI + ASSERT( EFalse ); +#endif //RD_USE_MYLOCATIONUI + break; + } + + default: + User::Leave( KErrGeneral ); + } + + return iEntryUpdated; + } // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::IsCommandAvailableL @@ -209,7 +255,7 @@ { FUNC_LOG; TBool res( EFalse ); - + switch ( aCommand ) { case EESMRCmdAssignFromMap: //fallthrough @@ -230,22 +276,41 @@ } case EESMRCmdShowOnMap: { - const TDesC& description = aEntry.Entry().DescriptionL(); - TPtrC locationUrl; - TInt position = UrlParserL().FindLocationUrl( description, - locationUrl ); - if ( position >= 0 ) + // Try to fetch vCal GEO value from entry + CCalGeoValue* geoVal = aEntry.Entry().GeoValueL(); + TReal lat, lon; + if ( geoVal && geoVal->GetLatLong( lat, lon ) ) { res = ETrue; } + else + { + // Check if description field has location url + const TDesC& description = aEntry.Entry().DescriptionL(); + TPtrC locationUrl; + TInt position = UrlParserL().FindLocationUrl( description, + locationUrl ); + if ( position >= 0 ) + { + res = ETrue; + } + } + break; } +#ifdef RD_USE_MYLOCATIONUI + case EMRCommandMyLocations: + { + res = ETrue; + break; + } +#endif default: { break; } } - + return res; } @@ -259,23 +324,23 @@ FUNC_LOG; const CCalEntry& entry = aEntry.Entry(); const TDesC& entryLocation = entry.LocationL(); - + // Store location only if location field contains text. if ( entryLocation.Length() > 0 ) { const TDesC& entryDescription = entry.DescriptionL(); - + // Search for location url from description. TPtrC locationUrl; TInt position = UrlParserL().FindLocationUrl( entryDescription, locationUrl ); - + // If url was not found. if ( position < 0 ) { locationUrl.Set( KNullDesC ); } - + // Check if history item with same location and url // is already stored. TInt existingHistoryItemIndex = KErrNotFound; @@ -284,7 +349,7 @@ { const MESMRLocationHistoryItem& item = iLocationHistoryManager->LocationHistoryItemL( i ); - + if ( item.Address().Compare( entryLocation ) == 0 && item.Url().Compare( locationUrl ) == 0 ) { @@ -292,7 +357,7 @@ break; } } - + // If history item with same location and url existed // update it's position in history array only. if ( existingHistoryItemIndex >= 0 ) @@ -301,7 +366,7 @@ // existing item is already owned by location manager. const MESMRLocationHistoryItem& item = iLocationHistoryManager->LocationHistoryItemL( existingHistoryItemIndex ); - + iLocationHistoryManager->UpdateLocationHistoryL( &item ); } else @@ -311,7 +376,7 @@ iLocationHistoryManager->CreateLocationHistoryItemL( entryLocation, locationUrl ); - + // Store new item to history. CleanupDeletePushL( historyItem ); iLocationHistoryManager->UpdateLocationHistoryL( historyItem ); @@ -326,33 +391,35 @@ // TBool CESMRLocationPluginHandler::UpdateEntryLocationL( MESMRCalEntry& aEntry, const TDesC& aLocation, - TBool aIgnoreQuery ) + TBool aIgnoreQuery, + TBool& aLocationReplaced ) { FUNC_LOG; TBool entryUpdated = EFalse; - + if ( aLocation.Length() > 0 ) { CCalEntry& entry = aEntry.Entry(); const TDesC& location = entry.LocationL(); - + // Replace old location field content. TBool replace = ETrue; - + if ( !aIgnoreQuery && location.Length() > 0 && location != aLocation ) { - // Query for replacing old location field content - replace = CESMRConfirmationQuery::ExecuteL( location ); + // Query for replacing old location field content + replace = CESMRConfirmationQuery::ExecuteL( location ); } - + // If previous location was empty or user selects to // replace previous location with new one. if ( location.Length() == 0 || replace ) { entry.SetLocationL( aLocation.Left( KMaxLocationTextLength ) ); - entryUpdated = ETrue; + entryUpdated = ETrue; + aLocationReplaced = ETrue; } else { @@ -370,7 +437,7 @@ CleanupStack::PopAndDestroy( 2, strings ); } } - + return entryUpdated; } @@ -381,57 +448,57 @@ // void CESMRLocationPluginHandler::SelectFromMapCompleted( TInt aError, CPosLandmark* aLandmark ) - { + { FUNC_LOG; - // Remove previous landmark if one is set. + // Remove previous landmark if one is set. if ( iLandmark ) { delete iLandmark; iLandmark = NULL; } - - if ( aError == KErrNone ) - { - // pointer to the result of landmark fetch - iLandmark = aLandmark; - } - - if ( iWait->IsStarted() ) - { - iWait->AsyncStop(); - } - } + + if ( aError == KErrNone ) + { + // pointer to the result of landmark fetch + iLandmark = aLandmark; + } + + if ( iWait->IsStarted() ) + { + iWait->AsyncStop(); + } + } // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::LocationPluginL // ----------------------------------------------------------------------------- // CESMRLocationPlugin& CESMRLocationPluginHandler::LocationPluginL() - { + { FUNC_LOG; - if ( !iLocationPlugin ) - { - // Lazy construction of Location ECom plugin - iLocationPlugin = CESMRLocationPlugin::NewL(); - iLocationPlugin->SetObserver(this); - } - - return *iLocationPlugin; - } + if ( !iLocationPlugin ) + { + // Lazy construction of Location ECom plugin + iLocationPlugin = CESMRLocationPlugin::NewL(); + iLocationPlugin->SetObserver(this); + } + + return *iLocationPlugin; + } // --------------------------------------------------------------------------- // Creates adress descriptor from a landmark object // --------------------------------------------------------------------------- // -HBufC* CESMRLocationPluginHandler::CreateAddressFromLandmarkL( +HBufC* CESMRLocationPluginHandler::CreateAddressFromLandmarkL( const CPosLandmark& aLandmark ) { FUNC_LOG; CPtrCArray* addressStrings = new( ELeave ) CPtrCArray( 2 ); CleanupStack::PushL( addressStrings ); - + TBool streetAvailable = aLandmark.IsPositionFieldAvailable( EPositionFieldStreet ); TBool cityAvailable = aLandmark.IsPositionFieldAvailable( EPositionFieldCity ); - + if ( streetAvailable ) { TPtrC streetPtr( KNullDesC ); @@ -453,13 +520,13 @@ addressStrings->AppendL( cityPtr ); } } - + HBufC* address(NULL); - + if ( addressStrings->Count() == 2 ) { //format street and city to buffer - address = StringLoader::LoadL( R_MEET_REQ_ADDRESS_STREET_CITY, + address = StringLoader::LoadL( R_MEET_REQ_ADDRESS_STREET_CITY, *addressStrings ); } else if ( addressStrings->Count() == 1 ) @@ -476,9 +543,9 @@ address = namePtr.AllocL(); } } - - CleanupStack::PopAndDestroy( addressStrings ); - + + CleanupStack::PopAndDestroy( addressStrings ); + //Transfer ownership of address return address; } @@ -488,8 +555,10 @@ // Updates location information into calendar entry from aLandmark. // ----------------------------------------------------------------------------- // -void CESMRLocationPluginHandler::UpdateEntryFromLandmarkL( MESMRCalEntry& aEntry, const CPosLandmark& aLandmark ) - { +void CESMRLocationPluginHandler::UpdateEntryFromLandmarkL( + MESMRCalEntry& aEntry, + const CPosLandmark& aLandmark ) + { FUNC_LOG; //parse and add address to calendar entry HBufC* streetAddress = CreateAddressFromLandmarkL( aLandmark ); @@ -499,18 +568,38 @@ UpdateEntryLocationL( aEntry, *streetAddress ); CleanupStack::PopAndDestroy( streetAddress ); } - - //parse and add location url to calendar entry - HBufC* locationUrl = NULL; - TRAP_IGNORE( locationUrl = UrlParserL().CreateUrlFromLandmarkL( aLandmark ) ) - if ( locationUrl ) + + CCalEntry& entry = aEntry.Entry(); + TLocality locality; + if ( aLandmark.GetPosition( locality ) == KErrNone ) { + // Store GEO value to entry + CCalGeoValue* geoVal = CCalGeoValue::NewL(); + CleanupStack::PushL( geoVal ); + geoVal->SetLatLongL( locality.Latitude(), locality.Longitude() ); + entry.SetGeoValueL( *geoVal ); + CleanupStack::PopAndDestroy( geoVal ); + + //parse and add location url to calendar entry + HBufC* locationUrl = UrlParserL().CreateUrlFromLandmarkL( aLandmark ); CleanupDeletePushL( locationUrl ); UpdateEntryDescriptionL( aEntry, *locationUrl ); CleanupStack::PopAndDestroy( locationUrl ); } - - } + else if ( iLocationReplaced )// Location field content from this landmark + { + // Clear GEO value and location URL + entry.ClearGeoValueL(); + const TDesC& description = entry.DescriptionL(); + TPtrC url; + TInt pos = UrlParserL().FindLocationUrl( description, url ); + if ( pos > KErrNotFound ) + { + TPtrC desc = description.Mid( pos + url.Length() ); + entry.SetDescriptionL( desc ); + } + } + } // ----------------------------------------------------------------------------- // CESMRLocationPluginHandler::SearchFromLandmarksL @@ -523,7 +612,7 @@ CleanupStack::PushL( landmarkDlg ); landmarkDlg->SetMopParent( aParent ); TLmkItemIdDbCombiInfo selectedItem; - + // Execute landmark selection dialog TInt isAccepted = landmarkDlg->ExecuteLD( selectedItem ); CleanupStack::Pop( landmarkDlg ); @@ -532,12 +621,12 @@ TPosLmItemId itemId = selectedItem.GetItemId(); CPosLandmarkDatabase* lmDataBase = selectedItem.GetLmDb(); CleanupStack::PushL( lmDataBase ); - + // Read selected landmark from landmarks database CPosLandmark* landmark = lmDataBase->ReadLandmarkLC( itemId ); UpdateEntryFromLandmarkL( aEntry, *landmark ); CleanupStack::PopAndDestroy( landmark ); - CleanupStack::PopAndDestroy( lmDataBase ); + CleanupStack::PopAndDestroy( lmDataBase ); ReleaseLandmarkResources(); } } @@ -554,7 +643,7 @@ // Array for listbox items. RCPointerArray addressArray; CleanupClosePushL( addressArray ); - + // Populate address array. TInt itemCount = LocationHistoryManagerL().ItemCount(); for ( TInt i = 0; i < itemCount; ++i ) @@ -565,26 +654,26 @@ addressArray.AppendL( address ); CleanupStack::Pop( address ); } - + CESMRDynamicItemSelectionList* selectionQuery = CESMRDynamicItemSelectionList::NewL(); CleanupStack::PushL( selectionQuery ); - + // Execute selection query. TInt idx = selectionQuery->ExecuteL( addressArray, CESMRDynamicItemSelectionList::EESMRRecentLocationList ); - + CleanupStack::PopAndDestroy( selectionQuery ); - + if ( idx >= 0 && idx < addressArray.Count() ) { const MESMRLocationHistoryItem& item = iLocationHistoryManager->LocationHistoryItemL( idx ); - + // Update entry location. const TDesC& selectedLocation = item.Address(); UpdateEntryLocationL( aEntry, selectedLocation ); - + // Update entry description if url available. const TDesC& selectedLocationUrl = item.Url(); if ( selectedLocationUrl.Length() > 0 ) @@ -592,7 +681,7 @@ UpdateEntryDescriptionL( aEntry, selectedLocationUrl ); } } - + CleanupStack::PopAndDestroy( &addressArray ); } @@ -605,7 +694,10 @@ MESMRCalEntry& aEntry, const TDesC& aLocation ) { FUNC_LOG; - iEntryUpdated |= UpdateEntryLocationL( aEntry, aLocation, iIgnoreQuery ); + iEntryUpdated |= UpdateEntryLocationL( aEntry, + aLocation, + iIgnoreQuery, + iLocationReplaced ); } // ----------------------------------------------------------------------------- @@ -620,18 +712,18 @@ if ( aLocationUrl.Length() > 0 ) { CCalEntry& entry = aEntry.Entry(); - HBufC* description = HBufC::NewL( entry.DescriptionL().Length() + + HBufC* description = HBufC::NewL( entry.DescriptionL().Length() + aLocationUrl.Length() + 1); CleanupStack::PushL( description ); TPtr descriptionPointer( description->Des() ); TPtrC urlPointer; TInt position; position = UrlParserL().FindLocationUrl( entry.DescriptionL(), urlPointer); - + if ( position >= KErrNone ) { descriptionPointer.Copy( entry.DescriptionL() ); - if ( ( position > 0 ) && ( entry.DescriptionL().Length() > + if ( ( position > 0 ) && ( entry.DescriptionL().Length() > (position + aLocationUrl.Length() ) ) ) { descriptionPointer.Delete( position, ( urlPointer.Length() + 1 ) ); @@ -675,7 +767,7 @@ { iUrlParser = CESMRUrlParserPlugin::NewL(); } - + return *iUrlParser; } @@ -691,7 +783,7 @@ { iLocationHistoryManager = CESMRLocationHistoryManager::NewL(); } - + return *iLocationHistoryManager; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrmeetingtimevalidator.cpp --- a/meetingrequest/mrgui/src/cesmrmeetingtimevalidator.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrmeetingtimevalidator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -28,7 +28,9 @@ #include "mesmrcalentry.h" #include "mesmrmeetingrequestentry.h" #include "mesmrfieldeventqueue.h" +#include "mmrabsolutealarmcontroller.h" #include "cesmrgenericfieldevent.h" +#include "cesmrrecurrenceinfoHandler.h" // Unnamed namespace for local definitions namespace { // codescanner::namespace @@ -172,11 +174,8 @@ { aTime = KMaxTTime; } - - if ( aEditor.IsVisible() ) - { - aEditor.SetTime( aTime ); - } + + aEditor.SetTime( aTime ); } /** @@ -198,10 +197,28 @@ aDate = KMaxTTime; } - if ( aEditor.IsVisible() ) + aEditor.SetDate( aDate ); + } + +/** + * Compares two times and returns ETrue if they have same date components + * @param aLhs Left hand side component + * @param aRhs Right hand side component + */ +TBool IsSameDay( + const TDateTime& aLhs, + const TDateTime& aRhs ) + { + TBool retValue(EFalse); + + if ( aLhs.Day() == aRhs.Day() && + aLhs.Month() == aRhs.Month() && + aLhs.Year() == aRhs.Year() ) { - aEditor.SetDate( aDate ); + retValue = ETrue; } + + return retValue; } } // namespace @@ -309,8 +326,8 @@ TDateTime endDt = endTime.DateTime(); if ( startDt.Day() != endDt.Day() || - startDt.Month() != endDt.Month() || - startDt.Year() != endDt.Year() ) + startDt.Month() != endDt.Month() || + startDt.Year() != endDt.Year() ) { error = MESMRFieldValidator::EErrorRecDifferetStartAndEnd; } @@ -338,14 +355,47 @@ MESMRCalEntry::EESMRThisOnly == mrEntry->RecurrenceModRule() ) { TBool instanceAlreadyOnThisDay( - mrEntry->AnyInstanceOnDayL(startTime, endTime) ); + mrEntry->AnyInstancesBetweenTimePeriodL( + startTime, + endTime ) ); if ( instanceAlreadyOnThisDay ) { error = MESMRFieldValidator::EErrorRescheduleInstance; } } - } + } + + if ( KErrorNone == error && + MESMRCalEntry::EESMRCalEntryMeeting == iEntry->Type() ) + { + // Check that is modified entry + if ( iEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == iEntry->RecurrenceModRule() ) + { + TBool instanceAlreadyOnThisDay( + iEntry->AnyInstancesBetweenTimePeriodL( + startTime, + endTime ) ); + + if ( instanceAlreadyOnThisDay ) + { + error = MESMRFieldValidator::EErrorRescheduleInstance; + } + } + } + + if ( KErrorNone == error && + ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry->Type() || + MESMRCalEntry::EESMRCalEntryMeeting == iEntry->Type() ) ) + { + // Check that is modified entry + if ( iEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == iEntry->RecurrenceModRule() ) + { + error = ValidateEditedInstanceTimeL(); + } + } if ( KErrorNone == error && iAlldayEvent && iAlarmOnOff ) { @@ -397,8 +447,7 @@ TTime until; if ( iRecurrenceValue != ERecurrenceNot && - iRecurrenceValue != ERecurrenceUnknown && - iRecurrenceUntilDate && iRecurrenceUntilDate->IsVisible() ) + iRecurrenceValue != ERecurrenceUnknown ) { until = RecurrenceUntilTime(); @@ -417,6 +466,137 @@ } // --------------------------------------------------------------------------- +// CESMRMeetingTimeValidator::ValidateEditedInstanceTimeL +// --------------------------------------------------------------------------- +// +MESMRFieldValidator::TESMRFieldValidatorError CESMRMeetingTimeValidator::ValidateEditedInstanceTimeL() + { + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( iEntry->Entry(), &iEntry->GetDBMgr() ); + TCalTime preStartTime; + TCalTime preEndTime; + TCalTime nextStartTime; + TCalTime nextEndTime; + + CCalInstance* instance = iEntry->InstanceL(); + CleanupStack::PushL( instance ); + TTime instanceDateTime = instance->StartTimeL().TimeLocalL(); + CleanupStack::PopAndDestroy( instance ); + + recurrenceHandler->GetPreviousInstanceTimeL( preStartTime, preEndTime, instanceDateTime ); + recurrenceHandler->GetNextInstanceTimeL( nextStartTime, nextEndTime, instanceDateTime ); + + CleanupStack::PopAndDestroy( recurrenceHandler ); + + const TTime editedStartDateTime( StartDateTime() ); + const TTime editedEndDateTime( EndDateTime() ); + + if( preStartTime.TimeLocalL() != Time::NullTTime() ) + { + // Does the exception end on/after prevEnd? + if( editedStartDateTime < preEndTime.TimeLocalL() ) + { + // Does the exception start after prevStart? + if( editedStartDateTime > preStartTime.TimeLocalL() ) + { + return EErrorInstanceOverlapsExistingOne; + } + else + { + // Does the exception finish after prevStart? + if( editedEndDateTime > preStartTime.TimeLocalL() ) + { + return EErrorInstanceOverlapsExistingOne; + } + else + { + return EErrorInstanceOutOfSequence; + } + } + } + + // Does the exception start on the same day as prevStart? + if( IsSameDay( StartDateTime(), preStartTime.TimeLocalL().DateTime() ) ) + { + return EErrorInstanceAlreadyExistsOnThisDay; + } + } + + + if( nextStartTime.TimeLocalL() != Time::NullTTime() ) + { + // Does the exception finish on/before nextStart? + if( editedEndDateTime > nextStartTime.TimeLocalL() ) + { + // Does the exception finish before nextFinish? + if( editedEndDateTime < nextEndTime.TimeLocalL() ) + { + return EErrorInstanceOverlapsExistingOne; + } + else + { + // Does the exception start before nextFinish? + if( editedStartDateTime < nextEndTime.TimeLocalL() ) + { + return EErrorInstanceOverlapsExistingOne; + } + else + { + return EErrorInstanceOutOfSequence; + } + } + } + + // Does the exception start on the same day as nextStart? + if( IsSameDay( StartDateTime(), nextStartTime.TimeLocalL().DateTime() ) ) + { + return EErrorInstanceAlreadyExistsOnThisDay; + } + } + + + // Does the series have any rdates + RArray rDateArray; + CleanupClosePushL( rDateArray ); + iEntry->Entry().GetRDatesL( rDateArray ); + TInt rDateCount = rDateArray.Count(); + + if ( rDateCount > 0 ) + { + // If the series has rdates, check that the exception + // does not overlap or start on the same day + TTimeIntervalMinutes duration; + editedStartDateTime.MinutesFrom( editedEndDateTime, duration ); + + for ( TInt index = 0; index < rDateCount; index++ ) + { + const TTime& rDate = rDateArray[ index ].TimeLocalL(); + + if ( !IsSameDay( iEntry->Entry().StartTimeL().TimeLocalL().DateTime(), rDate.DateTime() ) ) + { + // Does the exception start or end on the same day as a rdate. + if ( IsSameDay( StartDateTime(), rDate.DateTime() ) ) + { + CleanupStack::PopAndDestroy(); // rDateArray + return EErrorInstanceAlreadyExistsOnThisDay; + } + + // Does the exception overlap an rdate? + TTime rDateEnd = rDate + duration; + if ( editedEndDateTime > rDateEnd && editedStartDateTime < rDate ) + { + CleanupStack::PopAndDestroy(); // rDateArray + return EErrorInstanceOverlapsExistingOne; + } + } + } + } + + CleanupStack::PopAndDestroy(); // rDateArray + return EErrorNone; + } + +// --------------------------------------------------------------------------- // CESMRMeetingTimeValidator::ReadValuesFromEntryL // --------------------------------------------------------------------------- // @@ -472,8 +652,9 @@ ReadAlarmFromEntryL( entry ); ReadRecurrenceFromEntryL( aEntry ); - + DrawEditorsDeferred(); + SendFieldChangeEventL( EESMRFieldStartDate ); } } // --------------------------------------------------------------------------- @@ -566,6 +747,7 @@ } } + if ( ERecurrenceNot != iRecurrenceValue && ERecurrenceUnknown != iRecurrenceValue ) { @@ -592,6 +774,11 @@ { FUNC_LOG; iStartTime = &aStartTime; + + if ( Time::NullTTime() != iCurrentStartTime ) + { + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + } } // --------------------------------------------------------------------------- @@ -603,6 +790,11 @@ { FUNC_LOG; iEndTime = &aEndTime; + + if ( Time::NullTTime() != iCurrentEndTime ) + { + SetTimeToEditor( *iEndTime, iCurrentEndTime ); + } } // --------------------------------------------------------------------------- @@ -614,6 +806,11 @@ { FUNC_LOG; iStartDate = &aStartDate; + + if ( Time::NullTTime() != iCurrentStartTime ) + { + SetDateToEditor( *iStartDate, iCurrentStartTime ); + } } // --------------------------------------------------------------------------- @@ -625,6 +822,11 @@ { FUNC_LOG; iEndDate = &aEndTime; + + if ( Time::NullTTime() != iCurrentEndTime ) + { + SetDateToEditor( *iEndDate, iCurrentEndTime ); + } } // --------------------------------------------------------------------------- @@ -635,7 +837,13 @@ CEikTimeEditor& aAlarmTime ) { FUNC_LOG; + iAlarmTime = &aAlarmTime; + + if ( iAlarmOnOff ) + { + SetTimeToEditor( *iAlarmTime, iCurrentAlarmTime ); + } } // --------------------------------------------------------------------------- @@ -647,10 +855,15 @@ { FUNC_LOG; iAlarmDate = &aAlarmDate; + + if ( iAlarmOnOff ) + { + SetDateToEditor( *iAlarmDate, iCurrentAlarmTime ); + } } // --------------------------------------------------------------------------- -// CESMRMeetingTimeValidator::StartTimeChangedL +// CESMRMeetingTimeValidator::SetRecurrenceUntilDateFieldL // --------------------------------------------------------------------------- // void CESMRMeetingTimeValidator::SetRecurrenceUntilDateFieldL( @@ -658,6 +871,23 @@ { FUNC_LOG; iRecurrenceUntilDate = &aRecurrenceUntil; + + if ( Time::NullTTime() != iCurrentRecurrenceUntil ) + { + SetDateToEditor( *iRecurrenceUntilDate, iCurrentRecurrenceUntil ); + } + + } + +// --------------------------------------------------------------------------- +// CESMRMeetingTimeValidator::SetAbsoluteAlarmOnOffFieldL +// --------------------------------------------------------------------------- +// +void CESMRMeetingTimeValidator::SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& aAbsoluteAlarmController ) + { + FUNC_LOG; + iAbsoluteAlarmController = &aAbsoluteAlarmController; } // --------------------------------------------------------------------------- @@ -727,7 +957,6 @@ } DrawEditorsDeferred(); - User::LeaveIfError( err ); } @@ -844,13 +1073,19 @@ { FUNC_LOG; iAlarmOnOff = aAlarmOn; + if( iAlarmOnOff ) + { + iAbsoluteAlarmController->SetAbsoluteAlarmOn(); + } + else + { + iAbsoluteAlarmController->SetAbsoluteAlarmOff(); + } if ( iAlarmOnOff && iAlldayEvent ) { - TTime nullTime = Time::NullTTime(); - if ( iCurrentAlarmTime > iCurrentStartTime || - iCurrentAlarmTime == nullTime ) + iCurrentAlarmTime == Time::NullTTime() ) { iCurrentAlarmTime = DefaultAlldayEventAlarmTime( iCurrentStartTime ); @@ -971,7 +1206,6 @@ } if ( iAlarmOnOff && iAlarmTime && iAlldayEvent && iAlarmTime->IsVisible() ) { - TDateTime dt = iAlarmTime->Time().DateTime(); iAlarmTime->PrepareForFocusLossL(); } if ( iAlarmOnOff && iAlarmDate && iAlldayEvent && iAlarmDate->IsVisible() ) @@ -991,6 +1225,9 @@ void CESMRMeetingTimeValidator::HandleStartTimeChangeL() { FUNC_LOG; + + TInt err( KErrNone ); + TTime startTime = StartDateTime(); TTime endTime = EndDateTime(); @@ -1003,65 +1240,127 @@ iCurrentStartTime, startTimeChange ) ); - endTime += startTimeChange; - - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry->Type() ) + if ( startTimeChange.Int() ) { - MESMRMeetingRequestEntry* mrEntry = - static_cast( iEntry ); - if ( mrEntry->IsRecurrentEventL() && - MESMRCalEntry::EESMRThisOnly == mrEntry->RecurrenceModRule() ) + endTime += startTimeChange; + + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry->Type() ) { - TBool instanceAlreadyOnThisDay( - mrEntry->AnyInstanceOnDayL(startTime, endTime) ); - - if ( instanceAlreadyOnThisDay ) + MESMRMeetingRequestEntry* mrEntry = + static_cast( iEntry ); + if ( mrEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == mrEntry->RecurrenceModRule() ) + { + TBool instanceAlreadyOnThisDay( + mrEntry->AnyInstancesBetweenTimePeriodL(startTime, endTime) ); + + if ( instanceAlreadyOnThisDay ) + { + // Restore previous time + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetDateToEditor( *iStartDate, iCurrentStartTime ); + + err = KErrOverflow; + } + else + { + TTime firstInstanceStart; + TTime firstInstanceEnd; + mrEntry->GetFirstInstanceStartAndEndTimeL( + firstInstanceStart, + firstInstanceEnd ); + + if ( startTime < firstInstanceStart ) + { + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetDateToEditor( *iStartDate, iCurrentStartTime ); + + err = KErrUnderflow; + } + } + } + } + + if ( MESMRCalEntry::EESMRCalEntryMeeting == iEntry->Type() ) + { + if ( iEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == iEntry->RecurrenceModRule() ) + { + TBool instanceAlreadyOnThisDay( + iEntry->AnyInstancesBetweenTimePeriodL( + startTime, + endTime ) ); + + if ( instanceAlreadyOnThisDay ) + { + // Restore previous time + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetDateToEditor( *iStartDate, iCurrentStartTime ); + + err = KErrOverflow; + } + else + { + TTime firstInstanceStart; + TTime firstInstanceEnd; + iEntry->GetFirstInstanceStartAndEndTimeL( + firstInstanceStart, + firstInstanceEnd ); + + if ( startTime < firstInstanceStart ) + { + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetDateToEditor( *iStartDate, iCurrentStartTime ); + + err = KErrUnderflow; + } + } + } + } + + if ( KErrNone == err ) + { + SetTimeToEditor( *iEndTime, endTime ); + SetDateToEditor( *iEndDate, endTime ); + + iCurrentStartTime = startTime; + iCurrentEndTime = endTime; + + if ( iAlldayEvent && iAlarmOnOff && + iAlarmTime->IsVisible() && iAlarmDate->IsVisible() ) { - // Restore previous time - SetTimeToEditor( *iStartTime, iCurrentStartTime ); - SetDateToEditor( *iStartDate, iCurrentStartTime ); - - User::Leave( KErrOverflow ); + TTime alarmTime = AlarmDateTime(); + alarmTime += startTimeChange; + + SetTimeToEditor( *iAlarmTime, alarmTime ); + SetDateToEditor( *iAlarmDate, alarmTime ); + + iCurrentAlarmTime = alarmTime; } + + if ( ERecurrenceNot != iRecurrenceValue && + iRecurrenceUntilDate && iRecurrenceUntilDate->IsVisible() ) + { + TTime recUntil = RecurrenceUntilTime(); + + if ( startTime.DateTime().Day() != iComparativeStartTime.Day() || + startTime.DateTime().Month() != iComparativeStartTime.Month() || + startTime.DateTime().Year() != iComparativeStartTime.Year() ) + { + // We want to update the recurrence until only when + // a) Day, b) Month, c) or Year of the start time has changed + recUntil += startTimeChange; + iComparativeStartTime = startTime.DateTime(); + } + + SetDateToEditor( *iRecurrenceUntilDate, recUntil ); + iCurrentRecurrenceUntil = recUntil; + } } } - SetTimeToEditor( *iEndTime, endTime ); - SetDateToEditor( *iEndDate, endTime ); - - iCurrentStartTime = startTime; - iCurrentEndTime = endTime; - - if ( iAlldayEvent && iAlarmOnOff && - iAlarmTime->IsVisible() && iAlarmDate->IsVisible() ) - { - TTime alarmTime = AlarmDateTime(); - alarmTime += startTimeChange; - - SetTimeToEditor( *iAlarmTime, alarmTime ); - SetDateToEditor( *iAlarmDate, alarmTime ); - - iCurrentAlarmTime = alarmTime; - } - - if ( ERecurrenceNot != iRecurrenceValue && - iRecurrenceUntilDate && iRecurrenceUntilDate->IsVisible() ) - { - TTime recUntil = RecurrenceUntilTime(); - - if ( startTime.DateTime().Day() != iComparativeStartTime.Day() || - startTime.DateTime().Month() != iComparativeStartTime.Month() || - startTime.DateTime().Year() != iComparativeStartTime.Year() ) - { - // We want to update the recurrence until only when - // a) Day, b) Month, c) or Year of the start time has changed - recUntil += startTimeChange; - iComparativeStartTime = startTime.DateTime(); - } - - SetDateToEditor( *iRecurrenceUntilDate, recUntil ); - iCurrentRecurrenceUntil = recUntil; - } + DrawEditorsDeferred(); + User::LeaveIfError( err ); } // --------------------------------------------------------------------------- @@ -1073,60 +1372,127 @@ FUNC_LOG; TInt err( KErrNone ); TTime startTime = StartDateTime(); - TTime endTime = EndDateTime(); - - if ( !iAlldayEvent && endTime < startTime ) - { - if( ERecurrenceNot != iRecurrenceValue ) - { - err = KErrArgument; - } - else - { - // End time is earlier than start time - // and this is not allday event. - endTime += TTimeIntervalDays( KOne ); - } - } + TTime endTime = EndDateTime(); - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry->Type() ) - { - // Check that is modified entry - MESMRMeetingRequestEntry* mrEntry = - static_cast( iEntry ); - if ( mrEntry->IsRecurrentEventL() && - MESMRCalEntry::EESMRThisOnly == mrEntry->RecurrenceModRule() ) + // Check first if end time has even changed + TTimeIntervalMinutes endTimeChange; + User::LeaveIfError( + endTime.MinutesFrom( + iCurrentEndTime, + endTimeChange ) ); + + if ( endTimeChange.Int() ) + { + if ( !iAlldayEvent && endTime < startTime ) { - TBool instanceAlreadyOnThisDay( - mrEntry->AnyInstanceOnDayL(startTime, endTime) ); - - if ( instanceAlreadyOnThisDay ) + if( ERecurrenceNot != iRecurrenceValue ) { - // Restore previous time - SetTimeToEditor( *iStartTime, iCurrentStartTime ); - SetDateToEditor( *iStartDate, iCurrentStartTime ); - - err = KErrOverflow; + err = KErrArgument; + } + else + { + // End time is earlier than start time + // and this is not allday event. + endTime += TTimeIntervalDays( KOne ); } } - } - if ( KErrNone == err ) - { - iCurrentStartTime = startTime; - iCurrentEndTime = endTime; + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry->Type() ) + { + // Check that is modified entry + MESMRMeetingRequestEntry* mrEntry = + static_cast( iEntry ); + if ( mrEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == mrEntry->RecurrenceModRule() ) + { + TBool instanceAlreadyOnThisDay( + mrEntry->AnyInstancesBetweenTimePeriodL(startTime, endTime) ); + + if ( instanceAlreadyOnThisDay ) + { + // Restore previous time + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetDateToEditor( *iStartDate, iCurrentStartTime ); + + err = KErrOverflow; + } + else + { + TTime firstInstanceStart; + TTime firstInstanceEnd; + mrEntry->GetFirstInstanceStartAndEndTimeL( + firstInstanceStart, + firstInstanceEnd ); + + if ( startTime < firstInstanceStart ) + { + // Restore previous time + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetTimeToEditor( *iEndTime, iCurrentEndTime ); + + err = KErrUnderflow; + } + } + } + } + + if ( MESMRCalEntry::EESMRCalEntryMeeting == iEntry->Type() ) + { + // Check that is modified entry + if ( iEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == iEntry->RecurrenceModRule() ) + { + TBool instanceAlreadyOnThisDay( + iEntry->AnyInstancesBetweenTimePeriodL( + startTime, + endTime ) ); + + if ( instanceAlreadyOnThisDay ) + { + // Restore previous time + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetDateToEditor( *iStartDate, iCurrentStartTime ); + + err = KErrOverflow; + } + else + { + TTime firstInstanceStart; + TTime firstInstanceEnd; + iEntry->GetFirstInstanceStartAndEndTimeL( + firstInstanceStart, + firstInstanceEnd ); + + if ( startTime < firstInstanceStart ) + { + // Restore previous time + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetTimeToEditor( *iEndTime, iCurrentEndTime ); + + err = KErrUnderflow; + } + } + } + } + + if ( KErrNone == err ) + { + iCurrentStartTime = startTime; + iCurrentEndTime = endTime; + } + + if ( !iAlldayEvent ) + { + SetTimeToEditor( *iStartTime, iCurrentStartTime ); + SetTimeToEditor( *iEndTime, iCurrentEndTime ); + } + + SetDateToEditor( *iStartDate, iCurrentStartTime ); + SetDateToEditor( *iEndDate, iCurrentEndTime ); + + DrawEditorsDeferred(); + User::LeaveIfError( err ); } - - if ( !iAlldayEvent ) - { - SetTimeToEditor( *iStartTime, iCurrentStartTime ); - SetTimeToEditor( *iEndTime, iCurrentEndTime ); - } - - SetDateToEditor( *iStartDate, iCurrentStartTime ); - SetDateToEditor( *iEndDate, iCurrentEndTime ); - - User::LeaveIfError( err ); } // --------------------------------------------------------------------------- @@ -1215,10 +1581,8 @@ TTime minTimeForRecurrenceEnd = TimeForNextInstaceStartTime( iRecurrenceValue, start ); - TDateTime a = iCurrentRecurrenceUntil.DateTime(); - TDateTime b = minTimeForRecurrenceEnd.DateTime(); - - if ( iCurrentRecurrenceUntil < minTimeForRecurrenceEnd ) + if ( Time::NullTTime() == iCurrentRecurrenceUntil || + iCurrentRecurrenceUntil < minTimeForRecurrenceEnd ) { iCurrentRecurrenceUntil = minTimeForRecurrenceEnd; } @@ -1227,7 +1591,7 @@ { iCurrentRecurrenceUntil = StartDateTime(); } - + if ( iRecurrenceUntilDate ) { SetDateToEditor( *iRecurrenceUntilDate, iCurrentRecurrenceUntil ); @@ -1257,7 +1621,9 @@ if ( iRecurrenceUntilDate ) { - SetDateToEditor( *iRecurrenceUntilDate, iCurrentRecurrenceUntil ); + SetDateToEditor( + *iRecurrenceUntilDate, + iCurrentRecurrenceUntil ); } User::LeaveIfError( err ); @@ -1409,6 +1775,7 @@ { iCurrentAlarmTime = Time::NullTTime(); iAlarmOnOff = EFalse; + iAbsoluteAlarmController->SetAbsoluteAlarmOff(); } CleanupStack::PopAndDestroy( alarm ); @@ -1443,7 +1810,9 @@ recurrenceTime.SetTimeUtcL( iCurrentRecurrenceUntil ); TTime localRecurrenceTime = recurrenceTime.TimeLocalL(); - SetDateToEditor( *iRecurrenceUntilDate, localRecurrenceTime ); + SetDateToEditor( + *iRecurrenceUntilDate, + localRecurrenceTime ); } } else @@ -1514,8 +1883,8 @@ recurUntil < startTime ) { recurUntil = startTime + TTimeIntervalYears( KOne ); - iCurrentRecurrenceUntil = recurUntil; } + iCurrentRecurrenceUntil = recurUntil; } if ( iAlldayEvent && iAlarmOnOff ) @@ -1549,6 +1918,7 @@ { // Setting alarm to default value if entry is not stored iAlarmOnOff = EFalse; + iAbsoluteAlarmController->SetAbsoluteAlarmOff(); } } @@ -1579,17 +1949,16 @@ SetDateToEditor( *iEndDate, endTime ); // Alarm - if(iAlarmTime) + if( iAlarmOnOff && iAlarmTime ) { SetTimeToEditor( *iAlarmTime, iCurrentAlarmTime ); } - if(iAlarmDate) + if( iAlarmOnOff && iAlarmDate ) { SetDateToEditor( *iAlarmDate, iCurrentAlarmTime ); } - // if editing certain occurance of recurrent event series // the repeat until date is not available. if ( iRecurrenceUntilDate ) @@ -1597,10 +1966,8 @@ // Recurrence until SetDateToEditor( *iRecurrenceUntilDate, iCurrentRecurrenceUntil ); } - } - // --------------------------------------------------------------------------- // CESMRMeetingTimeValidator::ForceEndDateTime // --------------------------------------------------------------------------- @@ -1674,13 +2041,12 @@ { FUNC_LOG; CCalEntry& entry( aEntry.Entry() ); - const CCalEntry& originalEntry( aEntry.OriginalEntry() ); TTime startTime = StartDateTime(); TTime endTime = EndDateTime(); - TTime orgStartTime = originalEntry.StartTimeL().TimeLocalL(); - TTime orgEndTime = originalEntry.EndTimeL().TimeLocalL(); + TTime orgStartTime = entry.StartTimeL().TimeLocalL(); + TTime orgEndTime = entry.EndTimeL().TimeLocalL(); if ( !aEntry.IsStoredL() || orgStartTime != startTime || orgEndTime != endTime ) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrmemotimevalidator.cpp --- a/meetingrequest/mrgui/src/cesmrmemotimevalidator.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrmemotimevalidator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -221,7 +221,8 @@ PreValidateEditorContent(); CCalEntry& entry( aEntry.Entry() ); - + const CCalEntry& originalEntry( aEntry.OriginalEntry() ); + TTime start = StartDateTimeL(); TTime end = EndDateTimeL(); @@ -230,48 +231,54 @@ User::Leave( KErrArgument ); } - TCalTime startTime; - TCalTime endTime; + TTime orgStartTime = originalEntry.StartTimeL().TimeLocalL(); + TTime orgEndTime = originalEntry.EndTimeL().TimeLocalL(); - // The default mode for memo is EFloating, - // But some 3rd party application might have saved a different type - // for one reason or another. In that case we are using - // the existing value. - if ( aEntry.IsStoredL() ) + if( orgStartTime != start || orgEndTime != end ) { - TCalTime::TTimeMode timeMode = - aEntry.Entry().StartTimeL().TimeMode(); - - switch ( timeMode ) + TCalTime startTime; + TCalTime endTime; + + // The default mode for memo is EFloating, + // But some 3rd party application might have saved a different type + // for one reason or another. In that case we are using + // the existing value. + if ( aEntry.IsStoredL() ) { - case TCalTime::EFixedUtc: - { - startTime.SetTimeUtcL( start ); - endTime.SetTimeUtcL( end ); - break; - } - case TCalTime::EFixedTimeZone: - { - startTime.SetTimeLocalL( start ); - endTime.SetTimeLocalL( end ); - break; - } - case TCalTime::EFloating: // Fall through - default: - { - startTime.SetTimeLocalFloatingL( start ); - endTime.SetTimeLocalFloatingL( end ); - break; - } + TCalTime::TTimeMode timeMode = + aEntry.Entry().StartTimeL().TimeMode(); + + switch ( timeMode ) + { + case TCalTime::EFixedUtc: + { + startTime.SetTimeUtcL( start ); + endTime.SetTimeUtcL( end ); + break; + } + case TCalTime::EFixedTimeZone: + { + startTime.SetTimeLocalL( start ); + endTime.SetTimeLocalL( end ); + break; + } + case TCalTime::EFloating: // Fall through + default: + { + startTime.SetTimeLocalFloatingL( start ); + endTime.SetTimeLocalFloatingL( end ); + break; + } + } } + else + { + startTime.SetTimeLocalFloatingL( start ); + endTime.SetTimeLocalFloatingL( end ); + } + + entry.SetStartAndEndTimeL( startTime, endTime ); } - else - { - startTime.SetTimeLocalFloatingL( start ); - endTime.SetTimeLocalFloatingL( end ); - } - - entry.SetStartAndEndTimeL( startTime, endTime ); } } @@ -306,6 +313,11 @@ { FUNC_LOG; iStartDate = &aStartDate; + + if ( Time::NullTTime() != iCurrentStartTime ) + { + SetDateToEditor( *iStartDate, iCurrentStartTime ); + } } // --------------------------------------------------------------------------- @@ -317,6 +329,11 @@ { FUNC_LOG; iEndDate = &aEndDate; + + if ( Time::NullTTime() != iCurrentEndTime ) + { + SetDateToEditor( *iEndDate, iCurrentEndTime ); + } } // --------------------------------------------------------------------------- @@ -353,6 +370,17 @@ } // --------------------------------------------------------------------------- +// CESMRMemoTimeValidator::SetAbsoluteAlarmOnOffFieldL +// --------------------------------------------------------------------------- +// +void CESMRMemoTimeValidator::SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& /*aAbsoluteAlarmController*/ ) + { + FUNC_LOG; + // No implementation for memo + } + +// --------------------------------------------------------------------------- // CESMRMemoTimeValidator::StartTimeChangedL // --------------------------------------------------------------------------- // diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrmixedfieldstorage.cpp --- a/meetingrequest/mrgui/src/cesmrmixedfieldstorage.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrmixedfieldstorage.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -30,6 +30,7 @@ #include "cesmrvalidatorfactory.h" #include "cesmrglobalnote.h" #include "cesmrfield.h" +#include "cesmrfieldeventqueue.h" // Unnamed namespace for local definitions namespace { // codescanner::namespace @@ -111,12 +112,35 @@ CESMRGlobalNote::EESMRAlarmAlreadyPassed ); } break; + case MESMRFieldValidator::EErrorRescheduleInstance: { CESMRGlobalNote::ExecuteL( CESMRGlobalNote::EESMRRepeatReSchedule ); } break; + + case MESMRFieldValidator::EErrorInstanceOverlapsExistingOne: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMROverlapsExistingInstance ); + } + break; + + case MESMRFieldValidator::EErrorInstanceAlreadyExistsOnThisDay: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRInstanceAlreadyExistsOnThisDay ); + } + break; + + case MESMRFieldValidator::EErrorInstanceOutOfSequence: + { + CESMRGlobalNote::ExecuteL( + CESMRGlobalNote::EESMRInstanceOutOfSequence ); + } + break; + default: err = KErrNone; break; @@ -135,11 +159,9 @@ // CESMRMixedFieldStorage::CESMRMixedFieldStorage( MESMRFieldEventObserver& aEventObserver, - MESMRResponseObserver* aResponseObserver, - MESMRCalEntry& aEntry ) : + MESMRResponseObserver* aResponseObserver ) : CESMRFieldStorage( aEventObserver), - iResponseObserver(aResponseObserver), - iEntry(aEntry) + iResponseObserver(aResponseObserver) { FUNC_LOG; // Do nothing @@ -161,7 +183,7 @@ // CESMRMixedFieldStorage* CESMRMixedFieldStorage::NewL( MESMRFieldEventObserver& aEventObserver, - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, MESMRCalEntry& aEntry ) { @@ -169,12 +191,11 @@ CESMRMixedFieldStorage* self = new (ELeave) CESMRMixedFieldStorage( aEventObserver, - aResponseObserver, - aEntry ); + aResponseObserver ); - CleanupStack::PushL ( self ); - self->ConstructL ( aPolicy ); - CleanupStack::Pop ( self ); + CleanupStack::PushL( self ); + self->ConstructL( aPolicy, aEntry ); + CleanupStack::Pop( self ); return self; } @@ -183,56 +204,14 @@ // CESMRMixedFieldStorage::ConstructL // --------------------------------------------------------------------------- // -void CESMRMixedFieldStorage::ConstructL( CESMRPolicy* aPolicy ) +void CESMRMixedFieldStorage::ConstructL( + const CESMRPolicy& aPolicy, + MESMRCalEntry& aEntry ) { FUNC_LOG; CESMRFieldStorage::BaseConstructL(); - // FORWARD allows only attendee fields and description to be edited. - // EDIT RECURRENT EVENT allows only start-end time and start date - // to be edited. - - MESMRCalEntry::TESMRRecurrenceModifyingRule rule( - iEntry.RecurrenceModRule() ); - - if ( iEntry.IsRecurrentEventL() && - rule == MESMRCalEntry::EESMRAllInSeries && - EESMREditMR == aPolicy->ViewMode()) - { - // Contruct edit series - // validator ownership is transferred - MESMRFieldValidator* validator = - CESMRValidatorFactory::CreateValidatorL ( - aPolicy->EventType() ); - - ConstructEditSeriesEventL( - aPolicy, - validator ); - - iEventType = EMixedFieldStorageEditSeriesEvent; - } - - else if ( aPolicy->ViewMode() != EESMRForwardMR ) - { - MESMRFieldValidator* validator = - CESMRValidatorFactory::CreateValidatorL ( - aPolicy->EventType() ); - - ConstructRecurrentEventL ( aPolicy, - validator ); - - iEventType = EMixedFieldStorageRecurrentEvent; - } - else - { - // No validator is needed because forwarding does not - // affecto to any time fields. - MESMRFieldValidator* validator = NULL; - ConstructForwardEventL ( - aPolicy, - validator ); - - iEventType = EMixedFieldStorageForward; - } + + DoChangePolicyL( aPolicy, aEntry ); } // --------------------------------------------------------------------------- @@ -292,17 +271,30 @@ } // --------------------------------------------------------------------------- +// CESMRMixedFieldStorage::ChangePolicyL +// --------------------------------------------------------------------------- +// +void CESMRMixedFieldStorage::ChangePolicyL( + const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ) + { + // Delegate to non-virtual + DoChangePolicyL( aNewPolicy, aEntry ); + } + + +// --------------------------------------------------------------------------- // CESMRMixedFieldStorage::ConstructForwardEventL // --------------------------------------------------------------------------- // void CESMRMixedFieldStorage::ConstructForwardEventL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldValidator* aValidator ) { FUNC_LOG; iValidator = aValidator; - RArray< TESMREntryField > array = aPolicy->Fields(); + RArray< TESMREntryField > array = aPolicy.Fields(); TInt fieldCount( array.Count() ); for (TInt i(0); i < fieldCount; i++ ) @@ -316,20 +308,28 @@ case EESMRFieldDescription: { field = CreateEditorFieldL( iValidator, array[i] ); - CleanupStack::PushL( field ); } break; default: { field = CreateViewerFieldL( iResponseObserver, array[i], visible ); - CleanupStack::PushL( field ); + field->LockL(); } break; } - AddFieldL( field, visible ); - CleanupStack::Pop( field ); + if( field->FieldViewMode() != EESMRFieldTypeDisabled ) + { + CleanupStack::PushL( field ); + AddFieldL( field, visible ); + CleanupStack::Pop( field ); + } + else + { + delete field; + field = NULL; + } } } @@ -338,13 +338,14 @@ // --------------------------------------------------------------------------- // void CESMRMixedFieldStorage::ConstructRecurrentEventL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldValidator* aValidator ) { FUNC_LOG; iValidator = aValidator; + iValidator->SetFieldEventQueue( &EventQueueL() ); - const RArray& array = aPolicy->Fields(); + const RArray& array = aPolicy.Fields(); TInt fieldCount( array.Count() ); for (TInt i(0); i < fieldCount; ++i ) { @@ -354,11 +355,6 @@ { case EESMRFieldRecurrence: //Fall through case EESMRFieldRecurrenceDate: - { - // When editing occurence --> Recurrence information - // is not shown - break; - } default: field = CreateEditorFieldL( iValidator, array[i] ); break; @@ -378,18 +374,20 @@ // --------------------------------------------------------------------------- // void CESMRMixedFieldStorage::ConstructEditSeriesEventL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRFieldValidator* aValidator ) { FUNC_LOG; TESMRRecurrenceValue recurrenceType; TBool validRecurrence( HasValidRecurrenceForEditingL( - iEntry, + *iEntry, recurrenceType ) ); iValidator = aValidator; - const RArray& array = aPolicy->Fields(); + iValidator->SetFieldEventQueue( &EventQueueL() ); + + const RArray& array = aPolicy.Fields(); CESMRField* field = NULL; TInt fieldCount( array.Count() ); @@ -405,8 +403,7 @@ { if ( validRecurrence ) { - field = CreateEditorFieldL( iValidator, tfield ); - CleanupStack::PushL( field ); + field = CreateEditorFieldL( iValidator, tfield ); } else { @@ -414,20 +411,98 @@ // --> Cannot be edited. field = CreateViewerFieldL( iResponseObserver, tfield, visible ); - CleanupStack::PushL( field ); + field->LockL(); } } break; default: { - field = CreateEditorFieldL( iValidator, tfield ); - CleanupStack::PushL( field ); + field = CreateEditorFieldL( iValidator, tfield ); } break; } - - AddFieldL( field, visible ); - CleanupStack::Pop( field ); + + if( field->FieldViewMode() != EESMRFieldTypeDisabled ) + { + CleanupStack::PushL( field ); + AddFieldL( field, visible ); + CleanupStack::Pop( field ); + } + else + { + delete field; + field = NULL; + } + } + } + +// --------------------------------------------------------------------------- +// CESMRMixedFieldStorage::ConstructEditSeriesEventL +// --------------------------------------------------------------------------- +// +void CESMRMixedFieldStorage::Reset() + { + CESMRFieldStorage::Reset(); + delete iValidator; + iValidator = NULL; + } + +// --------------------------------------------------------------------------- +// CESMRMixedFieldStorage::DoChangePolicyL +// --------------------------------------------------------------------------- +// +void CESMRMixedFieldStorage::DoChangePolicyL( + const CESMRPolicy& aNewPolicy, + MESMRCalEntry& aEntry ) + { + Reset(); + iEntry = &aEntry; + + // FORWARD allows only attendee fields and description to be edited. + // EDIT RECURRENT EVENT allows only start-end time and start date + // to be edited. + + MESMRCalEntry::TESMRRecurrenceModifyingRule rule( + iEntry->RecurrenceModRule() ); + + if ( iEntry->IsRecurrentEventL() && + rule == MESMRCalEntry::EESMRAllInSeries && + EESMREditMR == aNewPolicy.ViewMode()) + { + // Contruct edit series + // validator ownership is transferred + MESMRFieldValidator* validator = + CESMRValidatorFactory::CreateValidatorL ( + aNewPolicy.EventType() ); + + ConstructEditSeriesEventL( + aNewPolicy, + validator ); + + iEventType = EMixedFieldStorageEditSeriesEvent; + } + + else if ( aNewPolicy.ViewMode() != EESMRForwardMR ) + { + MESMRFieldValidator* validator = + CESMRValidatorFactory::CreateValidatorL ( + aNewPolicy.EventType() ); + + ConstructRecurrentEventL ( aNewPolicy, + validator ); + + iEventType = EMixedFieldStorageRecurrentEvent; + } + else + { + // No validator is needed because forwarding does not + // affecto to any time fields. + MESMRFieldValidator* validator = NULL; + ConstructForwardEventL ( + aNewPolicy, + validator ); + + iEventType = EMixedFieldStorageForward; } } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrrecurrence.cpp --- a/meetingrequest/mrgui/src/cesmrrecurrence.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Helper class for recurrence text -* -*/ - -#include "emailtrace.h" -#include -#include "cesmrrecurrence.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRRecurrence::CESMRRecurrence() -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRRecurrence::CESMRRecurrence() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRRecurrence::~CESMRRecurrence() -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRRecurrence::~CESMRRecurrence() - { - FUNC_LOG; - delete iTxt; - } - -// --------------------------------------------------------------------------- -// CESMRRecurrence::ConstructFromResourceL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRRecurrence::ConstructFromResourceL( - CCoeEnv* aEnv, - TResourceReader& aReader ) - { - FUNC_LOG; - iId = static_cast(aReader.ReadInt16()); // WORD - TInt llink = aReader.ReadInt32(); // LLINK - iTxt = StringLoader::LoadL( llink, aEnv ); // load text from TBUF llink - } - -// --------------------------------------------------------------------------- -// CESMRRecurrence::RecurrenceValue() -// --------------------------------------------------------------------------- -// -EXPORT_C TESMRRecurrenceValue CESMRRecurrence::RecurrenceValue() - { - FUNC_LOG; - return iId; - } - -// --------------------------------------------------------------------------- -// CESMRRecurrence::RecurrenceText() -// --------------------------------------------------------------------------- -// -EXPORT_C HBufC& CESMRRecurrence::RecurrenceText() - { - FUNC_LOG; - return *iTxt; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrresponsedialog.cpp --- a/meetingrequest/mrgui/src/cesmrresponsedialog.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrresponsedialog.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -24,31 +24,23 @@ #include "esmrinternaluid.h" #include +#include #include #include -#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include - -#include -// // custom sw help files not avilable in Cmail -//#include +#include // // DEBUG #include "emailtrace.h" - +#include "FreestyleEmailUiConstants.h" // --------------------------------------------------------------------------- // CESMRResponseDialog::CESMRResponseDialog @@ -67,7 +59,9 @@ CESMRResponseDialog::~CESMRResponseDialog() { FUNC_LOG; - TRAP_IGNORE( RestoreMrGuiToolbarL() ); + static_cast( + iEikonEnv->AppUiFactory() )->CurrentFixedToolbar()-> + SetToolbarVisibility( iPreviousVisibility ); // iView is deleted by framework because it uses the // custom control mechanism. } @@ -95,13 +89,14 @@ { FUNC_LOG; CAknDialog::ConstructL( R_RESPONSE_DIALOG_MENUBAR ); - CEikonEnv* eikonEnv = CEikonEnv::Static();// codescanner::eikonenvstatic - TRect clientRect = eikonEnv->EikAppUi()->ClientRect(); + iPreviousVisibility = static_cast( + iEikonEnv->AppUiFactory() )->CurrentFixedToolbar()->IsShown(); + static_cast( + iEikonEnv->AppUiFactory() )->CurrentFixedToolbar()->SetToolbarVisibility( EFalse ); + TRect clientRect = iEikonEnv->EikAppUi()->ClientRect(); iView = CESMRResponseDialogView::NewL(); iView->SetRect( clientRect ); iView->SetSize(clientRect.Size()); - - MakeResponseToolbarL(); } // --------------------------------------------------------------------------- @@ -117,15 +112,10 @@ { case EAknCmdHelp: { - // - // TUid uid = { KUidCalendarApplication }; - // - CArrayFix* cntx = + CArrayFix* cntx = new (ELeave) CArrayFixFlat(1); CleanupStack::PushL( cntx ); - // - //cntx->AppendL( TCoeHelpContext( uid, KFSCA_HLP_RESPONSE_EDITOR ) ); - // / + cntx->AppendL( TCoeHelpContext( KFSEmailUiUid, KFSCA_HLP_RESPONSE_EDITOR ) ); CleanupStack::Pop( cntx ); HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), cntx ); break; @@ -143,21 +133,7 @@ } } } -// --------------------------------------------------------------------------- -// CESMRResponseDialog::DynInitMenuPaneL() -// --------------------------------------------------------------------------- -// -void CESMRResponseDialog::DynInitMenuPaneL( - /*TInt aResourceId,*/ - CEikMenuPane* aMenuPane ) - { - FUNC_LOG; - if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - } + // --------------------------------------------------------------------------- // CESMRResponseDialog::OfferKeyEventL // --------------------------------------------------------------------------- @@ -236,53 +212,4 @@ return ExecuteLD( R_RESPONSE_DIALOG ); } -// --------------------------------------------------------------------------- -// CESMRViewerDialog::OfferToolbarEventL -// --------------------------------------------------------------------------- -// -void CESMRResponseDialog::OfferToolbarEventL( TInt aCommand ) - { - TryExitL( aCommand ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::MakeResponseToolbarL -// --------------------------------------------------------------------------- -// -void CESMRResponseDialog::MakeResponseToolbarL() - { - CAknToolbar* currentToolbar = static_cast( iEikonEnv->AppUiFactory() )->CurrentFixedToolbar(); - iOldObserver = currentToolbar->ToolbarObserver(); - currentToolbar->SetToolbarObserver( this ); - - CAknButton* buttonSend = CAknButton::NewL(); - buttonSend->ConstructFromResourceL( R_SEND_BUTTON ); - CAknButton* buttonEmpty1 = CAknButton::NewL(); - CAknButton* buttonEmpty2 = CAknButton::NewL(); - - currentToolbar->AddItemL( buttonSend, EAknCtButton, EESMRCmdSendMR, 0, 0 ); - currentToolbar->AddItemL( buttonEmpty1, EAknCtButton, EESMRCmdUndefined, 0, 1 ); - currentToolbar->AddItemL( buttonEmpty2, EAknCtButton, EESMRCmdUndefined, 0, 2 ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::RestoreMrGuiToolbarL -// --------------------------------------------------------------------------- -// -void CESMRResponseDialog::RestoreMrGuiToolbarL() - { - CAknToolbar* currentToolbar = static_cast( iEikonEnv->AppUiFactory() )->CurrentFixedToolbar(); - - currentToolbar->SetToolbarObserver( iOldObserver ); - - CAknButton* buttonAccept = CAknButton::NewL(); - CAknButton* buttonTentative = CAknButton::NewL(); - CAknButton* buttonDecline = CAknButton::NewL(); - buttonAccept->ConstructFromResourceL( R_ACCEPT_BUTTON ); - buttonTentative->ConstructFromResourceL( R_TENTATIVE_BUTTON ); - buttonDecline->ConstructFromResourceL( R_DECLINE_BUTTON ); - currentToolbar->AddItemL( buttonAccept, EAknCtButton, EESMRCmdAcceptMR, 0, 0 ); - currentToolbar->AddItemL( buttonTentative, EAknCtButton, EESMRCmdTentativeMR, 0, 1 ); - currentToolbar->AddItemL( buttonDecline, EAknCtButton, EESMRCmdDeclineMR, 0, 2 ); - } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrsendui.cpp --- a/meetingrequest/mrgui/src/cesmrsendui.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,268 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR send ui wrapper -* -*/ - -#include "emailtrace.h" -#include "cesmrsendui.h" -#include "esmrvcalexport.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Unnamed namespace for local definitions -namespace { - -_LIT( KVCalAttachmentFile, - "\\private\\10005901\\Calendar.vcs" ); - - -_LIT( KCalendarDatabaseFilePath, "c:Calendar" ); - -const TInt KNumMtmsToDim =6; - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRSendUI::NewL() -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRSendUI* CESMRSendUI::NewL(TInt aMenuCommandId) - { - FUNC_LOG; - CESMRSendUI* self = new (ELeave) CESMRSendUI(); - CleanupStack::PushL(self); - self->ConstructL(aMenuCommandId); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::CESMRSendUI() -// --------------------------------------------------------------------------- -// -CESMRSendUI::CESMRSendUI() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::ConstructL() -// --------------------------------------------------------------------------- -// -void CESMRSendUI::ConstructL(TInt aMenuCommandId) - { - FUNC_LOG; - iSession = CCalSession::NewL(); - iSession->OpenL( KCalendarDatabaseFilePath ); - iSendUi = CSendUi::NewL(); - iSendAsCmdId=aMenuCommandId; - iSendMtmsToDim = new (ELeave) CArrayFixFlat(2); - - iSendMtmsToDim->SetReserveL( KNumMtmsToDim ); - // Always disable sending via Audio message - iSendMtmsToDim->AppendL( KSenduiMtmAudioMessageUid ); - iSendMtmsToDim->AppendL( KSenduiMtmPostcardUid ); - iSendMtmsToDim->AppendL( KMmsDirectUpload ); - iSendMtmsToDim->AppendL( KMmsIndirectUpload ); - // - //iSendMtmsToDim->AppendL( KSenduiMtmOnlineAlbumUid ); - - if( ! iSendUi->CanSendBioMessage( KMsgBioUidVCalendar ) ) - { - // This disables sending of vCalendars via SMS - iSendMtmsToDim->AppendL(KSenduiMtmSmsUid); - } - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::~CESMRSendUI() -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRSendUI::~CESMRSendUI() - { - FUNC_LOG; - delete iSession; - delete iSendUi; - delete iSendMtmsToDim; - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::CanSendL() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CESMRSendUI::CanSendL(TInt /*aCommandId*/) - { - FUNC_LOG; - - if( iSelectedMtmUid != KNullUid ) - { - return ETrue; - } - else - { - return EFalse; - } - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::DisplaySendMenuItemL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRSendUI::DisplaySendMenuItemL(CEikMenuPane& aMenuPane, - TInt aIndex) - { - FUNC_LOG; - iSendUi->AddSendMenuItemL( - aMenuPane, aIndex, iSendAsCmdId, TSendingCapabilities() ); - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::DisplaySendCascadeMenuL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRSendUI::DisplaySendCascadeMenuL(CEikMenuPane& /*aMenuPane*/) - { - FUNC_LOG; - iSelectedMtmUid = iSendUi->ShowSendQueryL( - NULL, KCapabilitiesForAllServices, iSendMtmsToDim, KNullDesC ); - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::SendAsVCalendarL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRSendUI::SendAsVCalendarL( - TInt /*aCommand*/, - CCalEntry& aEntry) - { - FUNC_LOG; - - // If the user selected email as their protocol, - // and the entry is a MR, send using MR utils. - - CEikonEnv* eikonEnv = CEikonEnv::Static();// codescanner::eikonenvstatic - CRichText* text = CRichText::NewL( - eikonEnv->SystemParaFormatLayerL(), - eikonEnv->SystemCharFormatLayerL()); - CleanupStack::PushL(text); - - TESMRVCalExport exporter(*iSession, eikonEnv->FsSession()); - HBufC8* vcal = exporter.ExportVCalLC(aEntry); - - TUid mtmUid = iSelectedMtmUid; - TSendingCapabilities capabilities; - iSendUi->ServiceCapabilitiesL( mtmUid, capabilities ); - - if (capabilities.iFlags & TSendingCapabilities::ESupportsAttachments) - { - RFs fs; - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - // must share the handle between processes - User::LeaveIfError( fs.ShareProtected() ); - TFileName fileName(PathInfo::PhoneMemoryRootPath().Left(2)); - fileName.Append(KVCalAttachmentFile); - fs.MkDirAll(fileName); - RFile file; - User::LeaveIfError(file.Replace( - fs,fileName,EFileWrite | EFileShareAny )); - CleanupClosePushL(file); - TInt spaceNeeded = vcal->Size(); - if ( SysUtil::FFSSpaceBelowCriticalLevelL( &fs, spaceNeeded ) ) - { - // don't show any own notes here - User::Leave( KErrDiskFull ); - } - - User::LeaveIfError(file.Write(*vcal)); - - TParse parse; - User::LeaveIfError(parse.SetNoWild(fileName, - NULL, NULL)); - - TRAPD(err, DoSendAsAttachmentHandleL(file)); - - CleanupStack::PopAndDestroy(&file); - fs.Delete(parse.FullName()); - CleanupStack::PopAndDestroy( &fs ); - User::LeaveIfError(err); - } - else - { - TPtrC8 p8(*vcal); - HBufC* bufCnv = HBufC::NewLC(p8.Length()); - TPtr16 des(bufCnv->Des()); - des.Copy(p8); - text->InsertL(0, des); - - CMessageData* messageData = CMessageData::NewL(); - CleanupStack::PushL( messageData ); - messageData->SetBodyTextL( text ); - iSendUi->CreateAndSendMessageL( - iSelectedMtmUid, messageData, KMsgBioUidVCalendar, ETrue ); - CleanupStack::PopAndDestroy(); // messagedata - CleanupStack::PopAndDestroy(bufCnv); - } - CleanupStack::PopAndDestroy(vcal); - CleanupStack::PopAndDestroy(text); - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::DoSendAsAttachmentFileL() -// --------------------------------------------------------------------------- -// -void CESMRSendUI::DoSendAsAttachmentFileL(TInt /*aCommand*/, TParse& aFilename) - { - FUNC_LOG; - CMessageData* messageData = CMessageData::NewL(); - CleanupStack::PushL( messageData ); - messageData->AppendAttachmentL( aFilename.FullName() ); - iSendUi->CreateAndSendMessageL( - iSelectedMtmUid, messageData, KMsgBioUidVCalendar, ETrue ); - CleanupStack::PopAndDestroy(); // messagedata - } - -// --------------------------------------------------------------------------- -// CESMRSendUI::DoSendAsAttachmentHandleL() -// --------------------------------------------------------------------------- -// -void CESMRSendUI::DoSendAsAttachmentHandleL(const RFile& aHandle) - { - FUNC_LOG; - CMessageData* messageData = CMessageData::NewL(); - CleanupStack::PushL( messageData ); - messageData->AppendAttachmentHandleL(aHandle); - iSendUi->CreateAndSendMessageL( - iSelectedMtmUid, messageData, KMsgBioUidVCalendar, ETrue ); - CleanupStack::PopAndDestroy( messageData ); - } - - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrtitlepane.cpp --- a/meetingrequest/mrgui/src/cesmrtitlepane.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrtitlepane.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,14 +22,14 @@ // #include "esmrdef.h" // -#include +#include #include -#include -#include +#include +#include #include -#include +#include #include -#include +#include #include "emailtrace.h" @@ -50,30 +50,6 @@ */ _LIT( KReplaceWhitespaceChars, "\x0009\x000A\x000B\x000C\x000D\x2028\x2029" ); -#ifdef _DEBUG - -// Definition for panic text -_LIT( KESMRPanicTxt, "CESMRTitlePane" ); - -/** - * ES MR Entry panic codes - */ -enum TESMRPanicCodes - { - EESMREntryTypeNotSet = 1, // Entry does not exist - }; - -/** - * Raises panic. - * @param aPanic Panic code - */ -void Panic(TESMRPanicCodes aPanic) - { - User::Panic( KESMRPanicTxt, aPanic); - } - -#endif // _DEBUG - } // namespace // ======== MEMBER FUNCTIONS ======== @@ -111,7 +87,6 @@ { FUNC_LOG; delete iTitle; - delete iIcon; } // --------------------------------------------------------------------------- @@ -147,31 +122,21 @@ FUNC_LOG; TRect rect = Rect(); - TAknTextComponentLayout labelLayout = - NMRLayoutManager::GetTextComponentLayout( + TAknTextComponentLayout labelLayout = + NMRLayoutManager::GetTextComponentLayout( NMRLayoutManager::EMRLayoutCtrlBarTitle ); AknLayoutUtils::LayoutLabel( iTitle, rect, labelLayout ); - - iTitle->SetAlignment(EHCenterVCenter); - + TRgb color; AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG2 ); // If this leaves we'll have to use the default color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *iTitle, + TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( + *iTitle, EColorLabelText, - color ) ); - - if( iIcon ) - { - TAknWindowComponentLayout iconLayout = - NMRLayoutManager::GetWindowComponentLayout( - NMRLayoutManager::EMRLayoutCtrlBarGraphics ); - AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout ); - } + color ) ); } // --------------------------------------------------------------------------- @@ -186,9 +151,6 @@ if ( iTitle ) ++count; - if ( iIcon ) - ++count; - return count; } @@ -205,113 +167,12 @@ { return iTitle; } - case 1: - { - return iIcon; - } default: return NULL; } } // --------------------------------------------------------------------------- -// CESMRTitlePane::HandleSetPriorityCmdL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::HandleSetPriorityCmdL( TInt aPriority ) - { - FUNC_LOG; - - __ASSERT_DEBUG( iEntryType != MESMRCalEntry::EESMRCalEntryNotSupported, - Panic(EESMREntryTypeNotSet ) ); - - switch ( aPriority ) - { - case EESMRCmdPriorityHigh: - { - if ( iEntryType == MESMRCalEntry::EESMRCalEntryTodo ) - { - SetPriorityL(EFSCalenTodoPriorityHigh); - } - else - { - SetPriorityL(EFSCalenMRPriorityHigh); - } - break; - } - case EESMRCmdPriorityLow: - { - if ( iEntryType == MESMRCalEntry::EESMRCalEntryTodo ) - { - SetPriorityL(EFSCalenTodoPriorityLow); - } - else - { - SetPriorityL(EFSCalenMRPriorityLow); - } - break; - } - case EESMRCmdPriorityNormal: - { - if ( iEntryType == MESMRCalEntry::EESMRCalEntryTodo ) - { - SetPriorityL(EFSCalenTodoPriorityNormal); - } - else - { - SetPriorityL(EFSCalenMRPriorityNormal); - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CESMRTitlePane::SetPriorityL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::SetPriorityL(TUint aPriority ) - { - FUNC_LOG; - __ASSERT_DEBUG( iEntryType != MESMRCalEntry::EESMRCalEntryNotSupported, - Panic(EESMREntryTypeNotSet ) ); - - iPriority = aPriority; - - // icon added to MR-title only if the default icon is set and - // the priority is neither high or low (the possible high/low - // importance icons are currently only shown in navi pane). - delete iIcon; - iIcon = NULL; - if ( iDefaultIcon && - iEntryType != MESMRCalEntry::EESMRCalEntryTodo && - aPriority != EFSCalenMRPriorityHigh && - aPriority != EFSCalenMRPriorityLow ) - { - CreateIconL( KAknsIIDQgnFscalIndiSubject ); - } - - SizeChanged(); - DrawDeferred(); - } - -// --------------------------------------------------------------------------- -// CESMRTitlePane::CreateIconL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::CreateIconL( TAknsItemID aIconID ) - { - FUNC_LOG; - delete iIcon; - iIcon = NULL; - - iIcon = CMRImage::NewL( aIconID ); - iIcon->SetParent( this ); - } - -// --------------------------------------------------------------------------- // CESMRTitlePane::SetTextL() // --------------------------------------------------------------------------- // @@ -344,31 +205,7 @@ { FUNC_LOG; iEntryType = aEntry.Type(); - SetPriorityL( aEntry.GetPriorityL() ); - } - -// --------------------------------------------------------------------------- -// CESMRTitlePane::SetDefaultIcon() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::SetDefaultIcon( TBool aDefault ) - { - FUNC_LOG; - iDefaultIcon = aDefault; } -// --------------------------------------------------------------------------- -// CESMRTitlePane::ExternalizeL() -// --------------------------------------------------------------------------- -// -void CESMRTitlePane::ExternalizeL( MESMRCalEntry& aEntry ) - { - FUNC_LOG; - if ( aEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest || - aEntry.Type() == MESMRCalEntry::EESMRCalEntryMeeting ) - { - aEntry.SetPriorityL( iPriority ); - } - } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrtitlepanehandler.cpp --- a/meetingrequest/mrgui/src/cesmrtitlepanehandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrtitlepanehandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,172 +11,134 @@ * * Contributors: * -* Description: ESMR title pane handler implementation - - * +* Description: MR title pane handler implementation +* */ - -#include "emailtrace.h" #include "cesmrtitlepanehandler.h" - - #include - #include - #include // EEikStatusPaneUidTitle +// DEBUG +#include "emailtrace.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::CESMRTitlePaneHandler +// --------------------------------------------------------------------------- +// +CESMRTitlePaneHandler::CESMRTitlePaneHandler( CEikonEnv& aEnv ) + : iEikEnv( aEnv ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRTitlePaneHandler::ConstructL() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::NewL +// --------------------------------------------------------------------------- +// +CESMRTitlePaneHandler* CESMRTitlePaneHandler::NewL( CEikonEnv& aEnv ) + { + FUNC_LOG; + CESMRTitlePaneHandler* self = new (ELeave) CESMRTitlePaneHandler( aEnv ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::~CESMRTitlePaneHandler +// --------------------------------------------------------------------------- +// +CESMRTitlePaneHandler::~CESMRTitlePaneHandler() + { + FUNC_LOG; + delete iSaveTitlePaneText; + } + +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::SetNewTitle +// --------------------------------------------------------------------------- +// +void CESMRTitlePaneHandler::SetNewTitle( const TDesC* aNewTitle ) + { + FUNC_LOG; + TRAPD( error, SetTitlePaneTextL( aNewTitle ) ); + + if ( error != KErrNone ) + { + iEikEnv.HandleError( error ); + } + } + +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::Rollback +// --------------------------------------------------------------------------- +// +void CESMRTitlePaneHandler::Rollback() + { + FUNC_LOG; + if ( iTitlePane && iSaveTitlePaneText ) + { + // iTitlePane takes ownership of iSaveTitlePaneText + iTitlePane->SetText( iSaveTitlePaneText ); + iSaveTitlePaneText = NULL; + } + } -CESMRTitlePaneHandler::CESMRTitlePaneHandler( CEikonEnv& aEnv ) - -: iEikEnv( aEnv ) - - { - FUNC_LOG; - // Do nothing - - } - - - -void CESMRTitlePaneHandler::ConstructL() - - { - FUNC_LOG; - // Do nothing - - } - - - -CESMRTitlePaneHandler* CESMRTitlePaneHandler::NewL( CEikonEnv& aEnv ) - - { - FUNC_LOG; - CESMRTitlePaneHandler* self = new (ELeave) CESMRTitlePaneHandler( aEnv ); - - CleanupStack::PushL( self ); - - self->ConstructL(); - - CleanupStack::Pop( self ); - - return self; - - } - - - -CESMRTitlePaneHandler::~CESMRTitlePaneHandler() - - { +// --------------------------------------------------------------------------- +// CESMRTitlePaneHandler::SetTitlePaneTextL +// --------------------------------------------------------------------------- +// +void CESMRTitlePaneHandler::SetTitlePaneTextL( const TDesC* aNewTitle ) + { FUNC_LOG; - delete iSaveTitlePaneText; - - } - - - -void CESMRTitlePaneHandler::SetNewTitle( const TDesC* aNewTitle ) - - { - FUNC_LOG; - TRAPD( error, SetTitlePaneTextL( aNewTitle ) ); - - if ( error != KErrNone ) - - { - - iEikEnv.HandleError( error ); - - } - - } - - - -void CESMRTitlePaneHandler::Rollback() - - { - FUNC_LOG; - if ( iTitlePane && iSaveTitlePaneText ) - - { - - // iTitlePane takes ownership of iSaveTitlePaneText - - iTitlePane->SetText( iSaveTitlePaneText ); - - iSaveTitlePaneText = NULL; - - } - - } - - - -void CESMRTitlePaneHandler::SetTitlePaneTextL( const TDesC* aNewTitle ) - - { - FUNC_LOG; - // Reset saved state - + // Reset saved state delete iSaveTitlePaneText; - iSaveTitlePaneText = NULL; - - CEikStatusPane* statusPane = iEikEnv.AppUiFactory()->StatusPane(); - if (statusPane) - + if ( statusPane ) { - - if (statusPane->PaneCapabilities(TUid::Uid(EEikStatusPaneUidTitle)) - - .IsPresent()) - + if ( statusPane->PaneCapabilities( + TUid::Uid( EEikStatusPaneUidTitle ) ).IsPresent() ) { + iTitlePane = static_cast( + statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); - iTitlePane = static_cast - - (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle))); - - if (iTitlePane->Text()) - + if ( iTitlePane->Text() ) { - iSaveTitlePaneText = iTitlePane->Text()->AllocL(); - } - if (aNewTitle) - + if ( aNewTitle ) { - - iTitlePane->SetTextL(*aNewTitle); - + iTitlePane->SetTextL( *aNewTitle ); } - else - { - iTitlePane->SetTextToDefaultL(); - } - } - } - - } - - + } // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrtodotimevalidator.cpp --- a/meetingrequest/mrgui/src/cesmrtodotimevalidator.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrtodotimevalidator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -104,10 +104,7 @@ aTime = KMaxTTime; } - if ( aEditor.IsVisible() ) - { - aEditor.SetTime( aTime ); - } + aEditor.SetTime( aTime ); } /** @@ -128,15 +125,11 @@ { aDate = KMaxTTime; } - - if ( aEditor.IsVisible() ) - { - aEditor.SetDate( aDate ); - } + aEditor.SetDate( aDate ); } /** - * Returns the default alarm time for all day event + * Returns the default alarm time for to-do * @param allday event start time * @return alarm time */ @@ -168,7 +161,11 @@ inline CESMRTodoTimeValidator::CESMRTodoTimeValidator() : iCurrentDueDate( Time::NullTTime() ), iCurrentAlarmTime( Time::NullTTime() ), - iAlarmOnOff( EFalse ) + iAlarmOnOff( EFalse ), + iInitialAlarmTime( Time::NullTTime() ), + iInitialAlarmOnOff( EFalse ), + iInitialDueDate( Time::NullTTime() ) + { FUNC_LOG; // Do nothing @@ -233,6 +230,16 @@ error = MESMRFieldValidator::EErrorAlarmLaterThanStart; } + + if ( alarm < start ) + { + TTimeIntervalDays alarmBefore = start.DaysFrom(alarm); + if ( alarmBefore > KMaxAlarmTime ) + { + error = MESMRFieldValidator::EErrorAlarmTooMuchInPast; + } + } + } } return error; @@ -258,6 +265,8 @@ TCalTime dueDate = entry.EndTimeL(); iCurrentDueDate = dueDate.TimeLocalL(); SetDateToEditor( *iDueDate, iCurrentDueDate ); + + iInitialDueDate = iDueDate->Date(); TDateTime dueDt = iCurrentDueDate.DateTime(); @@ -268,9 +277,13 @@ { iCurrentAlarmTime = iCurrentDueDate - alarm->TimeOffset(); iAlarmOnOff = ETrue; + iInitialAlarmOnOff = iAlarmOnOff; SetTimeToEditor( *iAlarmTime, iCurrentAlarmTime ); SetDateToEditor( *iAlarmDate, iCurrentAlarmTime ); + + iInitialAlarmTime = iAlarmTime->Time(); + iInitialAlarmDate = iAlarmDate->Date(); } CleanupStack::PopAndDestroy( alarm ); @@ -293,66 +306,72 @@ PreValidateEditorContent(); CCalEntry& entry( aEntry.Entry() ); - TTime toEditorDueDate = DueDateTimeL(); - TCalTime todoDueDate; - - // The default mode for To-do is EFloating, - // But some 3rd party application might have saved a different type - // for one reason or another. In that case we are using - // the existing value. - if ( aEntry.IsStoredL() ) + // If entry has been modified, we will write new values to entry. + // Otherwise entry will not be modified and thus saved + // (ex. new entry and press only Done ) + if( IsModifiedL( aEntry ) ) { - TCalTime::TTimeMode timeMode = - aEntry.Entry().StartTimeL().TimeMode(); - - switch ( timeMode ) + TTime toEditorDueDate = DueDateTimeL(); + TCalTime todoDueDate; + + // The default mode for To-do is EFloating, + // But some 3rd party application might have saved a different type + // for one reason or another. In that case we are using + // the existing value. + if ( aEntry.IsStoredL() ) { - case TCalTime::EFixedUtc: - { - todoDueDate.SetTimeUtcL( toEditorDueDate ); - break; - } - case TCalTime::EFixedTimeZone: - { - todoDueDate.SetTimeLocalL( toEditorDueDate ); - break; - } - case TCalTime::EFloating: // Fall through - default: - { - todoDueDate.SetTimeLocalFloatingL( toEditorDueDate ); - break; - } + TCalTime::TTimeMode timeMode = + aEntry.Entry().StartTimeL().TimeMode(); + + switch ( timeMode ) + { + case TCalTime::EFixedUtc: + { + todoDueDate.SetTimeUtcL( toEditorDueDate ); + break; + } + case TCalTime::EFixedTimeZone: + { + todoDueDate.SetTimeLocalL( toEditorDueDate ); + break; + } + case TCalTime::EFloating: // Fall through + default: + { + todoDueDate.SetTimeLocalFloatingL( toEditorDueDate ); + break; + } + } } - } - else - { - todoDueDate.SetTimeLocalFloatingL( toEditorDueDate ); - } - - entry.SetStartAndEndTimeL( todoDueDate, todoDueDate ); - - if ( iAlarmOnOff ) - { - TTimeIntervalMinutes diff; - - TTime alarm = AlarmDateTimeL(); - toEditorDueDate.MinutesFrom( alarm, diff ); - - CCalAlarm* alarmObject = entry.AlarmL(); - if ( !alarmObject ) + else + { + todoDueDate.SetTimeLocalFloatingL( toEditorDueDate ); + } + + entry.SetStartAndEndTimeL( todoDueDate, todoDueDate ); + + if ( iAlarmOnOff ) { - alarmObject = CCalAlarm::NewL(); + TTimeIntervalMinutes diff; + + TTime alarm = AlarmDateTimeL(); + toEditorDueDate.MinutesFrom( alarm, diff ); + + CCalAlarm* alarmObject = entry.AlarmL(); + if ( !alarmObject ) + { + alarmObject = CCalAlarm::NewL(); + } + CleanupStack::PushL( alarmObject ); + alarmObject->SetTimeOffset( diff ); + entry.SetAlarmL( alarmObject ); + CleanupStack::PopAndDestroy( alarmObject ); + alarmObject = NULL; } - CleanupStack::PushL( alarmObject ); - alarmObject->SetTimeOffset( diff ); - entry.SetAlarmL( alarmObject ); - CleanupStack::PopAndDestroy( alarmObject ); - alarmObject = NULL; - } - else - { - entry.SetAlarmL( NULL ); + else + { + entry.SetAlarmL( NULL ); + } } } } @@ -399,6 +418,11 @@ { FUNC_LOG; iDueDate = &aEndDate; + + if ( Time::NullTTime() != iCurrentDueDate ) + { + SetDateToEditor( *iDueDate, iCurrentDueDate ); + } } // --------------------------------------------------------------------------- @@ -410,6 +434,11 @@ { FUNC_LOG; iAlarmTime = &aAlarmTime; + + if ( iAlarmOnOff ) + { + SetTimeToEditor( *iAlarmTime, iCurrentAlarmTime ); + } } // --------------------------------------------------------------------------- @@ -421,6 +450,11 @@ { FUNC_LOG; iAlarmDate = &aAlarmDate; + + if ( iAlarmOnOff ) + { + SetDateToEditor( *iAlarmDate, iCurrentAlarmTime ); + } } // --------------------------------------------------------------------------- @@ -435,6 +469,17 @@ } // --------------------------------------------------------------------------- +// CESMRTodoTimeValidator::SetAbsoluteAlarmOnOffFieldL +// --------------------------------------------------------------------------- +// +void CESMRTodoTimeValidator::SetAbsoluteAlarmOnOffFieldL( + MMRAbsoluteAlarmController& /*aAbsoluteAlarmController*/ ) + { + FUNC_LOG; + // No implementation for to-do + } + +// --------------------------------------------------------------------------- // CESMRTodoTimeValidator::StartTimeChangedL // --------------------------------------------------------------------------- // @@ -566,7 +611,7 @@ { FUNC_LOG; iAlarmOnOff = aAlarmOn; - + if ( iAlarmOnOff ) { if ( iCurrentAlarmTime == Time::NullTTime() || @@ -639,12 +684,12 @@ iDueDate->PrepareForFocusLossL(); } - if ( iAlarmTime && iAlarmTime->IsVisible() ) + if ( iAlarmOnOff && iAlarmTime && iAlarmTime->IsVisible() ) { iAlarmTime->PrepareForFocusLossL(); } - if ( iAlarmDate && iAlarmDate->IsVisible() ) + if ( iAlarmOnOff && iAlarmDate && iAlarmDate->IsVisible() ) { iAlarmDate->PrepareForFocusLossL(); } @@ -789,5 +834,36 @@ } } +// --------------------------------------------------------------------------- +// CESMRTodoTimeValidator::IsModifiedL +// --------------------------------------------------------------------------- +// +TBool CESMRTodoTimeValidator::IsModifiedL( MESMRCalEntry& aEntry ) + { + // Checks if any of the editor fields have changed from the original / + // initial values + TBool isEdited( EFalse ); + + TBool isSame = aEntry.Entry().CompareL( aEntry.OriginalEntry() ); + + if( !isSame || + iInitialAlarmOnOff != iAlarmOnOff || + iDueDate->Date() != iInitialDueDate ) + { + isEdited = ETrue; + } + + // If alarm is on, we will check alarm time and date also for changes + if( iAlarmOnOff ) + { + if( iAlarmTime->Time() != iInitialAlarmTime || + iAlarmDate->Date() != iInitialAlarmDate ) + { + isEdited = ETrue; + } + } + + return isEdited; + } + // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrtrackingview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cesmrtrackingview.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,614 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR Tracking view UI Container class +* +*/ + +// custom sw help files not avilable in Cmail +//#include //for custom_sw helps +//#include //for custom_sw helps +// +#include "cesmrtrackingview.h" +#include "mesmrmeetingrequestentry.h" +#include "esmrinternaluid.h" +#include "cesmrtitlepane.h" +#include "cesmrfield.h" +#include "mesmrcalentry.h" +#include "nmrlayoutmanager.h" +#include "cesmrtrackingviewdialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "emailtrace.h" + + +namespace{ +// The string format of item in listbox. +_LIT(KListItemFormat, "%d\t%S"); + +static const TInt KIconArrayCount( 4 ); +static const TInt KListboxItemGranularity( 3 ); +static const TInt KMaxItemStringLen (128); +} +// Removed profiling. + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRTrackingView::CESMRTrackingView() +// --------------------------------------------------------------------------- +// +CESMRTrackingView::CESMRTrackingView( MESMRCalEntry& aEntry, + const TInt &aReqAttendee, + const TInt &aOptAttendee) : + iEntry(aEntry),iReqAttendeeCount(aReqAttendee),iOptAttendeeCount(aOptAttendee) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::NewL() +// --------------------------------------------------------------------------- +// +CESMRTrackingView* CESMRTrackingView::NewL( + MESMRCalEntry& aEntry, + const TRect& aRect, + const TInt &aReqAttendee, + const TInt &aOptAttendee) + { + FUNC_LOG; + CESMRTrackingView* self = new (ELeave) CESMRTrackingView( aEntry ,aReqAttendee , aOptAttendee ); + CleanupStack::PushL( self ); + self->ConstructL( aRect ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::ConstructL() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::ConstructL( const TRect& aRect ) + { + FUNC_LOG; + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMain, aRect, ETrue); + + iTitle = CESMRTitlePane::NewL(); + // Default title text is set here. + + HBufC* title ; + switch (iEntry.Type()) + { + case MESMRCalEntry::EESMRCalEntryTodo: + { + title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_TODO ); + break; + } + case MESMRCalEntry::EESMRCalEntryMemo: + { + title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_MEMO ); + break; + } + case MESMRCalEntry::EESMRCalEntryAnniversary: + { + title = StringLoader::LoadLC(R_QTN_CALENDAR_TITLE_NEW_ANNIVERSARY); + break; + } + case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Fall through + case MESMRCalEntry::EESMRCalEntryMeeting: // Fall through + case MESMRCalEntry::EESMRCalEntryReminder: // Fall through + default: + { + title = StringLoader::LoadLC( R_QTN_MEET_REQ_TITLE ); + break; + } + } + + iTitle->SetTextL( *title ); + CleanupStack::PopAndDestroy( title ); + + iESMRStatic.ConnectL(); + iMenuHandler = &iESMRStatic.ContactMenuHandlerL(); + + SetRect( aRect ); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::~CESMRTrackingView() +// --------------------------------------------------------------------------- +// +CESMRTrackingView::~CESMRTrackingView() + { + FUNC_LOG; + if ( iMenuHandler ) + { + iMenuHandler->Reset(); + } + iESMRStatic.Close(); + delete iTitle; + iList->Reset(); + delete iList; + delete iBgContext; + delete iAddress; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::ExternalizeL() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::ExternalizeL( TBool /*aForceValidation*/ ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::InternalizeL() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::InternalizeL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::LaunchViewerHelpL +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::LaunchViewerHelpL() + { + FUNC_LOG; + + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::LaunchHelpL +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::LaunchHelpL( const TDesC& aContext ) + { + FUNC_LOG; + TUid uid = { KUidCalendarApplication }; + CArrayFix* cntx = + new (ELeave) CArrayFixFlat(1); + CleanupStack::PushL(cntx); + cntx->AppendL( TCoeHelpContext( uid, aContext ) ); + CleanupStack::Pop(cntx); + HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), cntx ); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::SetContainerWindowL +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::SetContainerWindowL(const CCoeControl& aContainer) + { + FUNC_LOG; + CCoeControl::SetContainerWindowL( aContainer ); + iTitle->SetContainerWindowL( *this ); + /** + * Somehow if list is constructed before this SetContainerWindowL is called, + * all redraws throws KERN-EXEC 3 (the CCoeControl's iWin variable is NULL) + */ + + CreateTrackingListL(); + InitTrackingListL(); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::CreateTrackingList +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::CreateTrackingListL() + { + iList = new(ELeave) CAknSingleGraphicStyleListBox(); + iList->ConstructL(this); + iList->SetContainerWindowL(*this); + iList->SetBackground( this ); + iList->CreateScrollBarFrameL(ETrue); + iList->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto ); + iList->SetListBoxObserver(this); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::InitTrackingList +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::InitTrackingListL() + { + RPointerArray attendees = iEntry.Entry().AttendeesL(); + + // Init the array of item string and send ownership to listbox + iItemArray = new (ELeave) CDesCArrayFlat( KListboxItemGranularity ); + iList->Model()->SetItemTextArray( iItemArray ); + iList->Model()->SetOwnershipType( ELbmOwnsItemArray ); + + InitStatusIconArrayL(); + + TBuf16 itemString; + + if(iReqAttendeeCount > 0) + { + // Add the "Required" item + TBuf<10> textRequired(_L("Required")); + itemString.Format( KListItemFormat, ENoneIcon, &textRequired); + static_cast(iItemArray)->AppendL( itemString ); + + // Add required attendees + for(TInt i = 0; i < iReqAttendeeCount; i++) + { + TPtrC text; + text.Set(attendees[i]->CommonName()); + HBufC* name = text.AllocL(); + itemString.Format( KListItemFormat, EAcceptIcon, name); + static_cast(iItemArray)->AppendL( itemString ); + } + + iIndexOfOptLabel = iReqAttendeeCount + 1; + } + + if(iOptAttendeeCount > 0) + { + // Add the "Optional" item + TBuf<10> textOptioal(_L("Optional")); + itemString.Format( KListItemFormat, ENoneIcon, &textOptioal); + static_cast(iItemArray)->AppendL( itemString ); + + // Add Optional attendees + for(TInt i = iReqAttendeeCount; i < iReqAttendeeCount + iOptAttendeeCount; i++) + { + TPtrC text; + text.Set(attendees[i]->CommonName()); + HBufC* name = text.AllocL(); + itemString.Format( KListItemFormat, EAcceptIcon, name); + static_cast(iItemArray)->AppendL( itemString ); + } + } + + iList->HandleItemAdditionL(); + + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::InitStatusIconArray +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::InitStatusIconArrayL() + { + // Set icon array for listbox + CArrayPtr* iconArray = new (ELeave) CAknIconArray( KIconArrayCount ); + CleanupStack::PushL( iconArray ); + + // Init status Icons + CGulIcon* acceptIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingAccept); + CGulIcon* rejectIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingReject); + CGulIcon* tentativeIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingTentative); + CGulIcon* noneIcon = InitStatusIconL(NMRBitmapManager::EMRBitmapTrackingNone); + + // Append status icons + iconArray->AppendL( acceptIcon ); + iconArray->AppendL( rejectIcon ); + iconArray->AppendL( tentativeIcon ); + iconArray->AppendL( noneIcon ); + + // set icons array to list + iList->ItemDrawer()->ColumnData()->SetIconArray( iconArray ); + CleanupStack::Pop( iconArray ); + + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::InitStatusIcon +// --------------------------------------------------------------------------- +// +CGulIcon* CESMRTrackingView::InitStatusIconL(NMRBitmapManager::TMRBitmapId aStatus) + { + CFbsBitmap* bitMap( NULL ); + CFbsBitmap* bitMapMask( NULL ); + TSize sz(0,0); + User::LeaveIfError( + NMRBitmapManager::GetSkinBasedBitmap( + aStatus, + bitMap, bitMapMask, sz ) ); + CGulIcon* icon = CGulIcon::NewL(bitMap, bitMapMask); + return icon; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CESMRTrackingView::CountComponentControls() const + { + FUNC_LOG; + TInt count( 0 ); + + if ( iTitle ) + ++count; + + if ( iList ) + ++count; + + return count; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::ComponentControl() +// --------------------------------------------------------------------------- +// +CCoeControl* CESMRTrackingView::ComponentControl( TInt aInd ) const + { + FUNC_LOG; + switch ( aInd ) + { + case 0: + { + return iTitle; + } + case 1: + { + return iList; + } + default: + { + return NULL; + } + } + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::SizeChanged() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::SizeChanged() + { + FUNC_LOG; + + TRect rect( Rect() ); + if ( iTitle ) + { + TAknWindowComponentLayout titleLayout = + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutCtrlBar ); + AknLayoutUtils::LayoutControl( iTitle, rect, titleLayout ); + } + if ( iList ) + { + TAknWindowComponentLayout listLayout = + NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutContentArea ); + AknLayoutUtils::LayoutControl( iList, rect, listLayout ); + } + if( iBgContext ) + { + iBgContext->SetRect( rect ); + if ( &Window() ) + { + iBgContext->SetParentPos( PositionRelativeToScreen() ); + } + } + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::MinimumSize() +// Gets the main pane size needed by CEikDialog to layout itself correctly +// --------------------------------------------------------------------------- +// +TSize CESMRTrackingView::MinimumSize() + { + FUNC_LOG; + TRect rect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + return rect.Size(); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::OfferKeyEventL +// --------------------------------------------------------------------------- +// +TKeyResponse CESMRTrackingView::OfferKeyEventL( + const TKeyEvent &aKeyEvent, + TEventCode aType) + { + FUNC_LOG; + TKeyResponse response( EKeyWasNotConsumed ); + if ( iList ) + { + response = iList->OfferKeyEventL( aKeyEvent, aType ); + iList->DrawDeferred(); + } + return response; + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::Draw +// This Draw is called when background for title pane (iTitle) is drawn +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::Draw( const TRect& aRect ) const + { + FUNC_LOG; + CWindowGc& gc = SystemGc(); + + // Draw the background for iTitle using the current skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, this, gc, aRect ); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::Draw +// This draw method draws the dialog area +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::Draw( + CWindowGc& aGc, + const CCoeControl& aControl, + const TRect& /*aRect*/) const + { + FUNC_LOG; + // Draw the background for aControl using the current skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, &aControl, aGc, aControl.Rect() ); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::GetTextDrawer +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::GetTextDrawer( + CCoeTextDrawerBase*& /*aText*/, + const CCoeControl* /*aControl*/) const + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::SetTitleL() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::SetTitleL( const TDesC& aTitle ) + { + FUNC_LOG; + iTitle->SetTextL( aTitle ); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::FontSizeSettingsChanged() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::FontSizeSettingsChanged() + { + FUNC_LOG; +// iList->HandleFontChange(); + SizeChanged(); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::HandleResourceChange() +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::HandleResourceChange( TInt aType ) + { + FUNC_LOG; + CCoeControl::HandleResourceChange( aType ); + TInt error = KErrNone; + + switch ( aType ) + { + case KEikDynamicLayoutVariantSwitch: + case KAknLocalZoomLayoutSwitch: + { + SizeChanged(); + break; + } + default: + { + break; + } + } + + if ( error != KErrNone ) + { + iCoeEnv->HandleError( error ); + } + } + +// --------------------------------------------------------------------------- +// CESMRTrackingView::MopSupplyObject() +// --------------------------------------------------------------------------- +// +TTypeUid::Ptr CESMRTrackingView::MopSupplyObject( TTypeUid aId ) + { + if ( iBgContext ) + { + return MAknsControlContext::SupplyMopObject( aId, iBgContext ); + } + return CCoeControl::MopSupplyObject( aId ); + } + +// --------------------------------------------------------------------------- +// CESMRTrackingViewDialog::HandleListBoxEventL +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) + { + if( EEventItemClicked == aEventType ) + { + TInt currentFocusingIndex = aListBox->CurrentItemIndex(); + // Make sure the focus item is not the req/opt + if(currentFocusingIndex != 0 && currentFocusingIndex != iIndexOfOptLabel) + { + // Tap on the focused item + if(currentFocusingIndex == iFocusedItemIndex) + { + iParentDialog->HandleListEventL(); + } + // Focus changed + else + { + TInt attendeeIndex = currentFocusingIndex; + + if(currentFocusingIndex > 0 && currentFocusingIndex < iIndexOfOptLabel) + attendeeIndex--; + if(currentFocusingIndex > iIndexOfOptLabel) + attendeeIndex -= 2; + + RPointerArray attendees = iEntry.Entry().AttendeesL(); + iAddress = attendees[attendeeIndex]->Address().AllocL(); + + iMenuHandler->SetValueL(*iAddress, CESMRContactMenuHandler::EValueTypeEmail); + } + } + else + { + iMenuHandler->Reset(); + } + // Record the focused item index + iFocusedItemIndex = currentFocusingIndex; + } + } + +// --------------------------------------------------------------------------- +// CESMRTrackingViewDialog::HandleListBoxEventL +// --------------------------------------------------------------------------- +// +void CESMRTrackingView::SetParentDialog(CCoeControl* aParentDialog) + { + iParentDialog = (CESMRTrackingViewDialog*)aParentDialog; + } + +// EOF + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrtrackingviewdialog.cpp --- a/meetingrequest/mrgui/src/cesmrtrackingviewdialog.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrtrackingviewdialog.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,7 +12,7 @@ * Contributors: * * Description : ESMR tracking view dialog -* Version : %version: tr1sido#9 % +* Version : %version: e002sa33#15 % * */ @@ -20,22 +20,17 @@ #include "cesmrtrackingviewdialog.h" // SYSTEM INCLUDE -#include -#include +#include +#include #include -#include -#include -#include +#include // -#include -// - #include "cesmrpolicy.h" // #include #include "esmrgui.hrh" -#include "cesmrview.h" +#include "cesmrtrackingview.h" #include "cesmrviewerfieldstorage.h" #include "mesmrcalentry.h" #include "cesmrcontactmenuhandler.h" @@ -67,15 +62,15 @@ // --------------------------------------------------------------------------- // CESMRTrackingViewDialog* CESMRTrackingViewDialog::NewL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRCalEntry& aEntry, MAgnEntryUiCallback& aCallback ) { FUNC_LOG; CESMRTrackingViewDialog* self = - new (ELeave) CESMRTrackingViewDialog(aEntry,aCallback); + new (ELeave) CESMRTrackingViewDialog( aPolicy, aEntry, aCallback); CleanupStack::PushL( self ); - self->ConstructL( aPolicy ); + self->ConstructL(); CleanupStack::Pop( self ); return self; } @@ -87,17 +82,7 @@ CESMRTrackingViewDialog::~CESMRTrackingViewDialog() { FUNC_LOG; - if ( iFeatureManagerInitialized ) - { - FeatureManager::UnInitializeLib(); - } - - if ( iServiceHandler ) - { - iServiceHandler->DetachMenu(R_MR_TRACKING_VIEW_MENU, R_PS_AIW_INTEREST); - delete iServiceHandler; - } - + iESMRStatic.Close(); } @@ -105,10 +90,12 @@ // CESMRTrackingViewDialog::CESMRTrackingViewDialog // --------------------------------------------------------------------------- // -CESMRTrackingViewDialog::CESMRTrackingViewDialog( +CESMRTrackingViewDialog::CESMRTrackingViewDialog( + const CESMRPolicy& aPolicy, MESMRCalEntry& aEntry, MAgnEntryUiCallback& aCallback) : - iEntry( aEntry ), + iPolicy( aPolicy ), + iEntry( aEntry ), iCallback(aCallback) { FUNC_LOG; @@ -119,25 +106,16 @@ // CESMRTrackingViewDialog::ConstructL // --------------------------------------------------------------------------- // -void CESMRTrackingViewDialog::ConstructL(CESMRPolicy* aPolicy) +void CESMRTrackingViewDialog::ConstructL() { FUNC_LOG; CAknDialog::ConstructL ( R_TRACKING_DIALOG_MENUBAR ); - iPolicy = aPolicy; iESMRStatic.ConnectL(); iESMRStatic.ContactMenuHandlerL().Reset(); TRect clientRect; AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, clientRect ); - TBool responseReady(EFalse); - - FeatureManager::InitializeLibL(); - iFeatureManagerInitialized = ETrue; - - // remove custom feature KFeatureIdPrintingFrameworkCalendarPlugin - // - // Sort the attendees list so that Req attendeees comes first // and then opt attendees SortAttendeesL(); @@ -147,31 +125,24 @@ iESMRStatic.SetCurrentFieldIndex(0); - CESMRViewerFieldStorage* storage = - CESMRViewerFieldStorage::NewL( - aPolicy, - NULL, - responseReady, - *this, - CountAttendeesL(CCalAttendee::EReqParticipant), - CountAttendeesL(CCalAttendee::EOptParticipant) ); + iView = CESMRTrackingView::NewL( iEntry, clientRect, + CountAttendeesL(CCalAttendee::EReqParticipant), + CountAttendeesL(CCalAttendee::EOptParticipant)); + iView->SetParentDialog(this); - CleanupStack::PushL( storage ); - // storage ownership is transferred to CESMRView - iView = CESMRView::NewL(storage, iEntry, clientRect ); - CleanupStack::Pop( storage ); - if ( iEntry.Entry().SummaryL().Length() == 0 ) { // if no title, set unnamed text: HBufC* title = StringLoader::LoadLC (R_QTN_MEET_REQ_CONFLICT_UNNAMED); - iView->SetTitleL( *title, ETrue ); + iView->SetTitleL( *title ); CleanupStack::PopAndDestroy( title ); } else { - iView->SetTitleL( iEntry.Entry().SummaryL(), ETrue ); + iView->SetTitleL( iEntry.Entry().SummaryL() ); } + + iMenuBar->SetContextMenuTitleResourceId( R_MR_TRACKING_VIEW_CONTEXT_MENU ); } // --------------------------------------------------------------------------- @@ -204,7 +175,7 @@ { FUNC_LOG; TKeyResponse response = CAknDialog::OfferKeyEventL( aEvent, aType ); - + if ( ( response == EKeyWasNotConsumed && aEvent.iCode != EKeyEscape) && (!MenuShowing()) ) { @@ -228,15 +199,15 @@ { CAknDialog::DisplayMenuL(); break; - } + } case EESMRCmdBack: { res = ETrue; break; - } + } case EESMRCmdCall: { - iESMRStatic.ContactMenuHandlerL().ExecuteOptionsMenuL( + iESMRStatic.ContactMenuHandlerL().ExecuteOptionsMenuL( EESMRCmdActionMenuFirst ); break; } @@ -244,7 +215,7 @@ { res = CAknDialog::OkToExitL( aButtonId ); break; - } + } } return res; @@ -259,7 +230,7 @@ { FUNC_LOG; RPointerArray& calAttendeeList = iEntry.Entry().AttendeesL(); - + TInt totalParticipants = calAttendeeList.Count(); TInt totalAttendees(0); @@ -334,17 +305,6 @@ CAknDialog::ProcessCommandL( aCommand ); switch ( aCommand ) { - case EESMRCmdPrint: // Fall through - case EESMRCmdPrint_Reserved1: // Fall through - case EESMRCmdPrint_Reserved2: // Fall through - case EESMRCmdPrint_Reserved3: // Fall through - case EESMRCmdPrint_Reserved4: - { - this->MakeVisible(EFalse); - HandlePrintCommandL(aCommand); - this->MakeVisible(ETrue); - break; - } case EAknCmdExit: { TryExitL( aCommand ); @@ -357,15 +317,15 @@ } default: { - if ( aCommand >= EESMRCmdActionMenuFirst && + if ( aCommand >= EESMRCmdActionMenuFirst && aCommand <= EESMRCmdActionMenuLast ) { - iESMRStatic.ContactMenuHandlerL().ExecuteOptionsMenuL( + iESMRStatic.ContactMenuHandlerL().ExecuteOptionsMenuL( aCommand ); } else { - __ASSERT_DEBUG( EFalse, + __ASSERT_DEBUG( EFalse, Panic( EESMRTrackingVieweDlgInvalidCommand ) ); } break; @@ -382,13 +342,6 @@ CEikMenuPane* aMenuPane ) { FUNC_LOG; - if ( iServiceHandler ) - { - if ( iServiceHandler->HandleSubmenuL ( *aMenuPane ) ) - { - return; - } - } if ( aResourceId == R_ACTION_MENU ) { iESMRStatic.ContactMenuHandlerL().InitOptionsMenuL( aMenuPane ); @@ -396,17 +349,7 @@ if ( aResourceId == R_MR_TRACKING_VIEW_MENU ) { - if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - - // remove custom feature KFeatureIdPrintingFrameworkCalendarPlugin - // - aMenuPane->SetItemDimmed( EESMRCmdPrint, ETrue ); - - aMenuPane->SetItemDimmed( EESMRCmdActionMenu, + aMenuPane->SetItemDimmed( EESMRCmdActionMenu, !iESMRStatic.ContactMenuHandlerL().OptionsMenuAvailable() ); } } @@ -433,52 +376,13 @@ } // --------------------------------------------------------------------------- -// CESMRTrackingViewDialog::HandlePrintCommandL +// CESMRTrackingViewDialog::HandleFieldEventL // --------------------------------------------------------------------------- -// -void CESMRTrackingViewDialog::HandlePrintCommandL(TInt aCommand) + +void CESMRTrackingViewDialog::HandleListEventL() { FUNC_LOG; - CAiwGenericParamList& inParams = iServiceHandler->InParamListL(); - - // Param date - - TCalTime startTime = iEntry.Entry().StartTimeL(); - - TAiwGenericParam dateParam( EGenericParamDateTime ); - TTime activeDay = startTime.TimeUtcL(); - - TAiwGenericParam calendarParam( EGenericParamCalendarItem ); - calendarParam.Value().Set( TUid::Uid(iEntry.Entry().LocalUidL()) ); - inParams.AppendL( calendarParam ); - - // Append date param - dateParam.Value().Set( activeDay ); - inParams.AppendL( dateParam ); - - const TUid uid( TUid::Uid( KUidCalendarApplication ) ); - TAiwGenericParam uidParam( EGenericParamApplication ); - uidParam.Value().Set( uid ); - inParams.AppendL( uidParam ); - - // Execute service command with given parameters - iServiceHandler->ExecuteMenuCmdL( aCommand, - inParams, - iServiceHandler->OutParamListL(), - 0, - NULL ); - - } - -// --------------------------------------------------------------------------- -// CESMRTrackingViewDialog::HandleFieldEventL -// --------------------------------------------------------------------------- -// -void CESMRTrackingViewDialog::HandleFieldEventL( - const MESMRFieldEvent& /*aEvent*/ ) - { - FUNC_LOG; - // From MESMRFieldEventObserver. Do nothing + iMenuBar->TryDisplayContextMenuBarL(); } // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmruifactory.cpp --- a/meetingrequest/mrgui/src/cesmruifactory.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmruifactory.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,8 +15,6 @@ * */ -// -#include "emailtrace.h" #include "cesmruifactory.h" #include "mesmruibase.h" #include "cesmreditordialog.h" @@ -24,15 +22,20 @@ #include "cesmrtrackingviewdialog.h" #include "cesmrviewerfieldstorage.h" #include "esmrhelper.h" +#include "cesmrpolicy.h" +#include "mmrinfoprovider.h" +#include "mmrpolicyprovider.h" + #include -#include "cesmrpolicy.h" -// #include #include -#include +#include #include #include +// DEBUG +#include "emailtrace.h" + // Unnamed namespace for local definitions namespace { @@ -123,14 +126,20 @@ { FUNC_LOG; TFileName pathAndFile; + + INFO_1( "Locating resource file for %S", &aFileName ); ESMRHelper::LocateResourceFile( aFileName, KDC_RESOURCE_FILES_DIR, pathAndFile, &aEikEnv->FsSession() ); + INFO_1( "Finding nearest language file for %S", &pathAndFile ); + // Find the resource file for the nearest language BaflUtils::NearestLanguageFile(aEikEnv->FsSession(), pathAndFile ); + + INFO( "Adding resource file" ); aResourceOffset = CCoeEnv::Static()->AddResourceFileL( pathAndFile ); } @@ -139,22 +148,22 @@ // --------------------------------------------------------------------------- // MESMRUiBase* CESMRUiFactory::CreateUIL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ) { FUNC_LOG; MESMRUiBase* ui = NULL; - TESMRViewMode viewMode = aPolicy->ViewMode(); + TESMRViewMode viewMode = + aInfoProvider.PolicyProvider().CurrentPolicy().ViewMode(); + switch ( viewMode ) { case EESMREditMR: // Fall through case EESMRForwardMR: { ui = CESMREditorDialog::NewL( - aPolicy, - aEntry, + aInfoProvider, aCallback ); break; } @@ -162,16 +171,15 @@ case EESMRViewAllDayMR: { ui = CESMRViewerDialog::NewL( - aPolicy, - aEntry, + aInfoProvider, aCallback ); break; } case EESMRTrackingViewMR: { ui = CESMRTrackingViewDialog::NewL( - aPolicy, - aEntry, + aInfoProvider.PolicyProvider().CurrentPolicy(), + *aInfoProvider.EntryL(), aCallback ); break; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrvalidatorfactory.cpp --- a/meetingrequest/mrgui/src/cesmrvalidatorfactory.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrvalidatorfactory.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -36,6 +36,7 @@ MESMRFieldValidator* validator= NULL; switch ( aType ) { + case EESMREventTypeMeetingRequest: case EESMREventTypeAppt: // activated by meeting and meeting request { validator = CESMRMeetingTimeValidator::NewL ( ); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrview.cpp --- a/meetingrequest/mrgui/src/cesmrview.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrview.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -26,26 +26,39 @@ #include "cesmrfield.h" #include "mesmrcalentry.h" #include "nmrlayoutmanager.h" +#include "mesmrfieldstorage.h" #include "FreestyleEmailUiConstants.h" +#include "cesmrcaldbmgr.h" +#include "mmrfocusstrategy.h" +#include "cmrnaviarrow.h" +#include "mesmrlistobserver.h" +#include "cmrtoolbar.h" +#include "cmrattachmentindicator.h" +#include "esmrdef.h" +#include "mesmrfieldevent.h" +#include "cesmrgenericfieldevent.h" #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include - -#include -//
+#include +#include +#include +#include +#include +#include #include "emailtrace.h" @@ -59,9 +72,16 @@ // CESMRView::CESMRView() // --------------------------------------------------------------------------- // -CESMRView::CESMRView( MESMRFieldStorage* aStorage, MESMRCalEntry& aEntry ) : - iStorage(aStorage), - iEntry(aEntry) +CESMRView::CESMRView( MESMRFieldStorage* aStorage, + MESMRCalEntry& aEntry, + MMRFocusStrategy& aFocusStrategy, + MESMRNaviArrowEventObserver* aObserver, + CMRToolbar& aToolbar ) + : iStorage( aStorage ), + iEntry( &aEntry ), + iFocusStrategy( aFocusStrategy ), + iObserver( aObserver ), + iToolbar( aToolbar ) { FUNC_LOG; // Do nothing @@ -74,10 +94,14 @@ CESMRView* CESMRView::NewL( MESMRFieldStorage* aStorage, MESMRCalEntry& aEntry, - const TRect& aRect ) + const TRect& aRect, + MMRFocusStrategy& aFocusStrategy, + CMRToolbar& aToolbar, + MESMRNaviArrowEventObserver* aObserver ) { FUNC_LOG; - CESMRView* self = new (ELeave) CESMRView( aStorage, aEntry ); + CESMRView* self = new (ELeave) CESMRView( + aStorage, aEntry, aFocusStrategy, aObserver, aToolbar ); CleanupStack::PushL( self ); self->ConstructL( aRect ); CleanupStack::Pop( self ); @@ -91,45 +115,7 @@ void CESMRView::ConstructL( const TRect& aRect ) { FUNC_LOG; - iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, aRect, ETrue); - - iLayout = CESMRLayoutManager::NewL(); - iLayout->SetObserver( NULL ); - iTitle = CESMRTitlePane::NewL(); - // Default title text is set here. - - HBufC* title ; - switch (iEntry.Type()) - { - case MESMRCalEntry::EESMRCalEntryTodo: - { - title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_TODO ); - break; - } - case MESMRCalEntry::EESMRCalEntryMemo: - { - title = StringLoader::LoadLC ( R_QTN_CALENDAR_TITLE_NEW_MEMO ); - break; - } - case MESMRCalEntry::EESMRCalEntryAnniversary: - { - title = StringLoader::LoadLC(R_QTN_CALENDAR_TITLE_NEW_ANNIVERSARY); - break; - } - case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Fall through - case MESMRCalEntry::EESMRCalEntryMeeting: // Fall through - case MESMRCalEntry::EESMRCalEntryReminder: // Fall through - default: - { - title = StringLoader::LoadLC( R_QTN_MEET_REQ_TITLE ); - break; - } - } - - iTitle->SetTextL( *title ); - CleanupStack::PopAndDestroy( title ); - + CreateWindowL(); SetRect( aRect ); } @@ -140,10 +126,12 @@ CESMRView::~CESMRView() { FUNC_LOG; - delete iTitle; - delete iList; - delete iLayout; + delete iListPane; delete iBgContext; + delete iNaviArrowLeft; + delete iNaviArrowRight; + delete iScrollBar; + delete iStorage; } // --------------------------------------------------------------------------- @@ -154,9 +142,7 @@ { FUNC_LOG; // externalize all fields: - iList->ExternalizeL( iEntry, aForceValidation ); - // externalize title pane for priority value - iTitle->ExternalizeL( iEntry ); + iListPane->ExternalizeL( *iEntry, aForceValidation ); } // --------------------------------------------------------------------------- @@ -166,56 +152,23 @@ void CESMRView::InternalizeL() { FUNC_LOG; - // internalize title pane ( for priority ) - iTitle->InternalizeL( iEntry ); - iList->DisableSizeChange( ETrue ); + iListPane->DisableSizeChange( ETrue ); // internalize all fields: - iList->InternalizeL( iEntry ); - iList->DisableSizeChange( EFalse ); - iList->SizeChanged(); + iListPane->InternalizeL( *iEntry ); + iListPane->DisableSizeChange( EFalse ); + iListPane->SizeChanged(); } // --------------------------------------------------------------------------- -// CESMRView::IsComponentVisible() +// CESMRView::IsControlVisible() // --------------------------------------------------------------------------- // -TBool CESMRView::IsComponentVisible( TESMREntryFieldId aField ) const - { - FUNC_LOG; - return iList->ListObserver().IsControlVisible( aField ); - } - - -// --------------------------------------------------------------------------- -// CESMRView::CanProcessEditorCommandL -// --------------------------------------------------------------------------- -// -TBool CESMRView::CanProcessEditorCommandL( TInt aCommand ) +TBool CESMRView::IsControlVisible( TESMREntryFieldId aFieldId ) const { FUNC_LOG; - CESMRField* field = iList->FocusedItem(); - TBool result(ETrue); - switch ( aCommand ) - { - case EESMRCmdClipboardCopy: - switch (field->FieldId()) - { - // quite few fields allow copiing - case EESMRFieldOrganizer: // fall through - case EESMRFieldAttendee: // fall through - case EESMRFieldDetailedSubject: // fall through - case EESMRFieldDescription: // fall through - result = ETrue; - break; - } - break; - default: - result = EFalse; - break; - } - return result; + return iListPane->IsControlVisible( aFieldId ); } - + // --------------------------------------------------------------------------- // CESMRView::ProcessCommandL // --------------------------------------------------------------------------- @@ -227,61 +180,94 @@ { case EESMRCmdPriorityHigh: // Fall through case EESMRCmdPriorityNormal: // Fall through - case EESMRCmdPriorityLow: - { - iTitle->HandleSetPriorityCmdL( aCommand ); - break; - } + case EESMRCmdPriorityLow: + { + CESMRField* field = iStorage->FieldById( EESMRFieldSubject ); + if ( field ) + { + field->ExecuteGenericCommandL( + aCommand ); + iListPane->SizeChanged(); + } + break; + } case EESMRCmdAddOptAttendee: { - iList->ListObserver().InsertControl( EESMRFieldOptAttendee ); - SetControlFocusedL(EESMRFieldOptAttendee); + iListPane->ShowControl( EESMRFieldOptAttendee ); + SetControlFocusedL( EESMRFieldOptAttendee ); break; } case EAknCmdHelp: { break; } - case EESMRCmdEdit: + case EMRCmdHideAttachmentIndicator: { - iList->ListObserver().InsertControl( EESMRFieldResponseArea ); - iList->ListObserver().RemoveControl( EESMRFieldResponseReadyArea ); - iList->ListObserver().SetControlFocusedL( EESMRFieldResponseArea ); + if ( iAttachmentIndicator ) + { + TInt pos = iControls.Find( iAttachmentIndicator ); + if (KErrNotFound != pos ) + { + iControls.Remove( pos ); + } + + delete iAttachmentIndicator; + iAttachmentIndicator = NULL; + + ReLayout(); + } + } break; - } default://forward to fields { - iList->FocusedItem()->ExecuteGenericCommandL(aCommand); + iListPane->FocusedField()->ExecuteGenericCommandL( aCommand ); break; } } } // --------------------------------------------------------------------------- -// CIpsSetUiDialogCtrl::DynInitMenuPaneL() -// --------------------------------------------------------------------------- -// -void CESMRView::DynInitMenuPaneL( - /*TInt aResourceId,*/ - CEikMenuPane* aMenuPane ) - { - FUNC_LOG; - if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - } - - -// --------------------------------------------------------------------------- // CESMRView::LaunchEditorHelpL // --------------------------------------------------------------------------- // void CESMRView::LaunchEditorHelpL() { FUNC_LOG; - LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); + + switch ( iEntry->Type() ) + { + case MESMRCalEntry::EESMRCalEntryTodo: + { + LaunchHelpL( KFSCA_HLP_TODO_EDITOR ); + break; + } + case MESMRCalEntry::EESMRCalEntryMemo: + { + LaunchHelpL( KFSCA_HLP_MEMO_EDITOR ); + break; + } + case MESMRCalEntry::EESMRCalEntryAnniversary: + { + LaunchHelpL( KFSCA_HLP_ANNIVERSARY_EDITOR ); + break; + } + case MESMRCalEntry::EESMRCalEntryMeeting: + { + LaunchHelpL( KFSCA_HLP_CALE_MEETING_EDITOR ); + break; + } + case MESMRCalEntry::EESMRCalEntryMeetingRequest: + { + LaunchHelpL( KMEET_REQ_HLP_EDITOR ); + break; + } + case MESMRCalEntry::EESMRCalEntryReminder: // Fall through + default: + { + break; + } + } + } // --------------------------------------------------------------------------- @@ -291,7 +277,68 @@ void CESMRView::LaunchViewerHelpL() { FUNC_LOG; - LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); + + + switch ( iEntry->Type() ) + { + case MESMRCalEntry::EESMRCalEntryTodo: + { + LaunchHelpL( KFSCA_HLP_TODO_VIEWER ); + break; + } + case MESMRCalEntry::EESMRCalEntryMemo: + { + LaunchHelpL( KFSCA_HLP_MEMO_VIEWER ); + break; + } + case MESMRCalEntry::EESMRCalEntryAnniversary: + { + LaunchHelpL( KFSCA_HLP_ANNI_VIEWER ); + break; + } + case MESMRCalEntry::EESMRCalEntryMeeting: + { + LaunchHelpL( KFSCA_HLP_CALE_MEETING_VIEWER ); + break; + } + case MESMRCalEntry::EESMRCalEntryMeetingRequest: + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( iEntry ); + + if ( mrEntry->IsOpenedFromMail() ) + { + if ( CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfCalMeetingRequestUi ) ) ) + { + // Full functionality + LaunchHelpL( KFS_VIEWER_HLP_MEETING_REQ_VIEW ); + } + else + { + // Only viewer from Mail supported + // TODO: Change to KFS_VIEWER_HLP_MR_RECEIVED + // when help id is released on wk9 platform + LaunchHelpL( KFS_VIEWER_HLP_MEETING_REQ_VIEW ); + } + } + else if ( mrEntry->RoleL() == EESMRRoleOrganizer ) + { + LaunchHelpL( KFSCA_HLP_VIEWER_ORGANIZER ); + } + else + { + LaunchHelpL( KFSCA_HLP_VIEWER ); + } + break; + } + case MESMRCalEntry::EESMRCalEntryReminder: // Fall through + default: + { + break; + } + } + } // --------------------------------------------------------------------------- @@ -305,23 +352,70 @@ } // --------------------------------------------------------------------------- -// CESMRView::IsComponentfocused +// CESMRView::FocusedField // --------------------------------------------------------------------------- // TESMREntryFieldId CESMRView::FocusedField() const { FUNC_LOG; TESMREntryFieldId fieldId( ( TESMREntryFieldId ) 0 ); - - CESMRField* field = iList->FocusedItem(); - + + CESMRField* field = iListPane->FocusedField(); + + if ( field ) + { + fieldId = field->FieldId(); + } + + return fieldId; + } + +// --------------------------------------------------------------------------- +// CESMRView::ClickedOrFocusedField +// --------------------------------------------------------------------------- +// +TESMREntryFieldId CESMRView::ClickedOrFocusedField() const + { + FUNC_LOG; + TESMREntryFieldId fieldId( ( TESMREntryFieldId ) 0 ); + + // Get clicked item if exists + CESMRField* field = iListPane->ClickedField(); + if ( field ) { fieldId = field->FieldId(); } - + // If doesn't, try getting focused item + else + { + field = iListPane->FocusedField(); + if( field ) + { + fieldId = FocusedField(); + } + } + return fieldId; - } + } + +// --------------------------------------------------------------------------- +// CESMRView::AdjustViewL +// --------------------------------------------------------------------------- +// +void CESMRView::AdjustViewL( + MESMRCalEntry* aNewEntry, + const CESMRPolicy& aNewPolicy ) + { + iStorage->ChangePolicyL( aNewPolicy,*aNewEntry ); + iEntry = aNewEntry; + iListPane->InitializeL(); + iListPane->ReActivateL(); + InternalizeL(); + SetControlFocusedL( EESMRFieldUnifiedEditor ); + SetTitlePaneObserver(); + DrawDeferred(); + } // --------------------------------------------------------------------------- // CESMRView::LaunchHelpL @@ -330,8 +424,8 @@ void CESMRView::LaunchHelpL( const TDesC& aContext ) { FUNC_LOG; - - CArrayFix* cntx = + + CArrayFix* cntx = new (ELeave) CArrayFixFlat(1); CleanupStack::PushL(cntx); cntx->AppendL( TCoeHelpContext( KFSEmailUiUid, aContext ) ); @@ -339,6 +433,36 @@ HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), cntx ); } + +// --------------------------------------------------------------------------- +// CESMRView::SetTitlePaneObserver +// --------------------------------------------------------------------------- +// +void CESMRView::SetTitlePaneObserver() + { + CESMRField* field = NULL; + TInt fieldCount( iStorage->Count() ); + for ( TInt i(0); i < fieldCount; ++i ) + { + field = iStorage->Field( i ); + TESMREntryFieldId fieldId( field->FieldId() ); + + switch( fieldId ) + { + case EESMRFieldSubject: //Fall through + case EESMRFieldOccasion://Fall through + case EESMRFieldPriority://Fall through + case EESMRFieldDetailedSubject: + { + field->SetTitlePaneObserver( this ); + break; + } + default: + break; + } + } + } + // --------------------------------------------------------------------------- // CESMRView::UpdateTitlePaneTextL // --------------------------------------------------------------------------- @@ -350,33 +474,161 @@ } // --------------------------------------------------------------------------- -// CESMRView::UpdateTitlePanePriorityIconL() +// CESMRView::HandleScrollEventL // --------------------------------------------------------------------------- // -void CESMRView::UpdateTitlePanePriorityIconL( TUint aPriority ) +void CESMRView::HandleScrollEventL( + CEikScrollBar* aScrollBar, + TEikScrollEvent aEventType ) { FUNC_LOG; - iTitle->SetPriorityL( aPriority ); + + if ( !aScrollBar ) + { + return; + } + + TInt newPosition = aScrollBar->ThumbPosition(); + + switch( aEventType ) + { + case EEikScrollThumbDragVert: // Drag started + case EEikScrollThumbReleaseVert: // Drag released + { + if( newPosition < iScrollBarThumbPosition ) + { + iListPane->ScrollFieldsDown( + iScrollBarThumbPosition - newPosition ); + + iScrollBarThumbPosition = newPosition; + } + + else if( newPosition > iScrollBarThumbPosition ) + { + iListPane->ScrollFieldsUp( + newPosition - iScrollBarThumbPosition ); + + iScrollBarThumbPosition = newPosition; + } + break; + } + case EEikScrollPageUp: + { + if( newPosition < iScrollBarThumbPosition ) + { + iListPane->ScrollFieldsDown( + iScrollBarThumbPosition - newPosition ); + + iScrollBarThumbPosition = newPosition; + } + break; + } + case EEikScrollPageDown: + { + if( newPosition > iScrollBarThumbPosition ) + { + iListPane->ScrollFieldsUp( + newPosition - iScrollBarThumbPosition ); + + iScrollBarThumbPosition = newPosition; + } + break; + } + default: + { + break; + } + } + + DrawNow(); + } + +// --------------------------------------------------------------------------- +// CESMRView::ScrollBarPositionChanged() +// --------------------------------------------------------------------------- +// +void CESMRView::ScrollBarPositionChanged( TInt aThumbPosition ) + { + FUNC_LOG; + iScrollBarThumbPosition = aThumbPosition; } // --------------------------------------------------------------------------- // CESMRView::SetContainerWindowL // --------------------------------------------------------------------------- // -void CESMRView::SetContainerWindowL(const CCoeControl& aContainer) +void CESMRView::SetContainerWindowL( const CCoeControl& aContainer ) { FUNC_LOG; CCoeControl::SetContainerWindowL( aContainer ); - iTitle->SetContainerWindowL( *this ); + /** * Somehow if list is constructed before this SetContainerWindowL is called, * all redraws throws KERN-EXEC 3 (the CCoeControl's iWin variable is NULL) */ + + iScrollBar = new (ELeave) CAknDoubleSpanScrollBar( this ); + iScrollBar->ConstructL( EFalse, this, this, CEikScrollBar::EVertical, 0 ); + iScrollBar->SetModel( &iScrollBarModel ); + iScrollBar->MakeVisible( ETrue ); + + iControls.AppendL( iScrollBar ); - iList = CESMRListComponent::NewL( this, iStorage, iLayout ); - iList->SetBackground( this ); - // Font size setting Observer can now be set - iLayout->SetObserver( this ); + iListPane = CMRListPane::NewL( + *this, + *iStorage, + iScrollBarModel, + *iScrollBar, + *this ); + + iControls.AppendL( iListPane ); + + iListPane->SetBackground( this ); + + iBgContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDQsnBgAreaMain, Rect(), ETrue ); + + if( iEntry ) + { + MESMRCalDbMgr& dbMgr = iEntry->GetDBMgr(); + dbMgr.SetCurCalendarByEntryL( *iEntry ); + } + + // Physics: enable needed pointer events + EnableDragEvents(); + ClaimPointerGrab(); + + // Initialize the focus + iFocusStrategy.InitializeFocus(); + + if( iEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + // Static cast is safe here. We know for sure that entry is MR + MESMRMeetingRequestEntry* mrEntry = + static_cast( iEntry ); + if ( mrEntry->IsOpenedFromMail() ) + { + TAknLayoutRect naviArrowRightLayoutRect = + NMRLayoutManager::GetLayoutRect( Rect(), + NMRLayoutManager::EMRLayoutMRNaviArrowRight ); + TRect naviArrowRect( naviArrowRightLayoutRect.Rect() ); + + iNaviArrowLeft = CMRNaviArrow::NewL( + this, + CMRNaviArrow::EMRArrowLeft, + iObserver, + naviArrowRect.Size() ); + + iNaviArrowRight = CMRNaviArrow::NewL( + this, + CMRNaviArrow::EMRArrowRight, + iObserver, + naviArrowRect.Size() ); + + iControls.AppendL( iNaviArrowLeft ); + iControls.AppendL( iNaviArrowRight ); + } + } } // --------------------------------------------------------------------------- @@ -386,15 +638,7 @@ TInt CESMRView::CountComponentControls() const { FUNC_LOG; - TInt count( 0 ); - - if ( iTitle ) - ++count; - - if ( iList ) - ++count; - - return count; + return iControls.Count(); } // --------------------------------------------------------------------------- @@ -404,21 +648,7 @@ CCoeControl* CESMRView::ComponentControl( TInt aInd ) const { FUNC_LOG; - switch ( aInd ) - { - case 0: - { - return iTitle; - } - case 1: - { - return iList; - } - default: - { - return NULL; - } - } + return iControls[aInd]; } // --------------------------------------------------------------------------- @@ -429,22 +659,187 @@ { FUNC_LOG; - TRect rect( Rect() ); - if ( iTitle ) + // If list pane is not yet constructed, no point in layouting anything + if( !iListPane ) { - TAknWindowComponentLayout titleLayout = - NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutCtrlBar ); - AknLayoutUtils::LayoutControl( iTitle, rect, titleLayout ); + return; } - if ( iList ) + + TRect containerRect( Rect() ); + + // Get the rect of stripe. + TAknLayoutRect stripeLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutStripe ); + iStripeRect = stripeLayoutRect.Rect(); + + // Layouting listpane, scroll bar and navi arrows in landscape mode + if( Layout_Meta_Data::IsLandscapeOrientation() ) { - TAknWindowComponentLayout listLayout = - NMRLayoutManager::GetWindowComponentLayout( NMRLayoutManager::EMRLayoutContentArea ); - AknLayoutUtils::LayoutControl( iList, rect, listLayout ); + TAknLayoutRect listareaLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutListArea ); + TRect listareaRect( listareaLayoutRect.Rect() ); + + // List panes default rect needs to be modified due to + // possible toolbar, scrollbar and calendar indication stripe + + // Remove stripe width from list pane width + listareaRect.iTl.iX += iStripeRect.Width(); + + // Remove toolbar width from list pane width + listareaRect.iBr.iX -= iToolbar.Rect().Width(); + + if( iScrollBar ) + { + TAknLayoutRect scrollareaLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutScrollBar ); + TRect scrollareaRect( scrollareaLayoutRect.Rect() ); + // Scroll bar's height is always the same as listpane's height + scrollareaRect.SetHeight( listareaRect.Height() ); + + // Scrollbar needs to be moved to the left side of possible + // toolbar + scrollareaRect.Move( -iToolbar.Rect().Width(), 0 ); + iScrollBar->SetRect( scrollareaRect ); + + // Remove scroll bar width from list area's width + listareaRect.iBr.iX -= iScrollBar->Rect().Width(); + } + + iListPane->SetRect( listareaRect ); + + // Make sure, that stripe height is the list pane height + iStripeRect.SetHeight( iListPane->Rect().Height() ); + + if(iViewMode == EESMRViewMR) + { + if( iNaviArrowLeft ) + { + TAknLayoutRect naviArrowLeftLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutMRNaviArrowLeft ); + TRect naviArrowLeftRect( naviArrowLeftLayoutRect.Rect() ); + + // Left arrow needs to be moved right the amount of + // stripe width in landscape + naviArrowLeftRect.Move( iStripeRect.Width(), 0 ); + + iNaviArrowLeft->SetRect( naviArrowLeftRect ); + } + + if( iNaviArrowRight ) + { + TAknLayoutRect naviArrowRightLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutMRNaviArrowRight ); + TRect naviArrowRightRect( naviArrowRightLayoutRect.Rect() ); + + // Right arrow needs to be moved left the amount of + // possible toolbar width in landscape + TInt scrollWidth( 0 ); + if( iScrollBar ) + { + scrollWidth = iScrollBar->Rect().Width(); + } + + naviArrowRightRect.Move( + -( iToolbar.Rect().Width() + scrollWidth ), 0 ); + + iNaviArrowRight->SetRect( naviArrowRightRect ); + } + } + else + { + SetNaviArrowStatus( EFalse, EFalse ); + } } + + // Layouting listpane, scroll bar and navi arrows in portrait mode + else + { + TAknLayoutRect listareaLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutListArea ); + TRect listareaRect( listareaLayoutRect.Rect() ); + + // The listPane's area should be: + // X: Should subtract the width of stripe + // Y: Should subtract the height of MRToolbar + listareaRect.iTl.iX += iStripeRect.Width(); + listareaRect.iBr.iY -= iToolbar.Rect().Height(); + + iListPane->SetRect( listareaRect ); + + if( iScrollBar ) + { + TAknLayoutRect scrollareaLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutScrollBar ); + TRect scrollareaRect( scrollareaLayoutRect.Rect() ); + // Scroll bar's height is always the same as listpane's height + scrollareaRect.SetHeight( iListPane->Rect().Height() ); + iScrollBar->SetRect( scrollareaRect ); + } + + // Make sure, that stripe height is the list pane height + iStripeRect.SetHeight( iListPane->Rect().Height() ); + + if(iViewMode == EESMRViewMR) + { + if( iNaviArrowLeft ) + { + TAknLayoutRect naviArrowLeftLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutMRNaviArrowLeft ); + TRect naviArrowLeftRect( naviArrowLeftLayoutRect.Rect() ); + + // Left arrow needs to be moved right the amount of + // stripe width in portrait + naviArrowLeftRect.Move( iStripeRect.Width(), 0 ); + + // Left arrow needs to be moved up the amount of + // possible toolbar height in portrait + naviArrowLeftRect.Move( 0, -iToolbar.Rect().Height() ); + + iNaviArrowLeft->SetRect( naviArrowLeftRect ); + } + + if( iNaviArrowRight ) + { + TAknLayoutRect naviArrowRightLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutMRNaviArrowRight ); + TRect naviArrowRightRect( naviArrowRightLayoutRect.Rect() ); + + // Right arrow needs to be moved right the amount of + // stripe width in portrait + naviArrowRightRect.Move( iStripeRect.Width(), 0 ); + + // Right arrow needs to be moved up the amount of + // possible toolbar height in portrait + naviArrowRightRect.Move( 0, -iToolbar.Rect().Height() ); + + + iNaviArrowRight->SetRect( naviArrowRightRect ); + } + } + else + { + SetNaviArrowStatus( EFalse, EFalse ); + } + } + + if ( iAttachmentIndicator ) + { + iAttachmentIndicator->SetRect( + CalculateAttachmentIndicatorLayout() ); + } + if( iBgContext ) { - iBgContext->SetRect( rect ); + iBgContext->SetRect( containerRect ); if ( &Window() ) { iBgContext->SetParentPos( PositionRelativeToScreen() ); @@ -470,18 +865,36 @@ // --------------------------------------------------------------------------- // TKeyResponse CESMRView::OfferKeyEventL( - const TKeyEvent &aKeyEvent, + const TKeyEvent &aKeyEvent, TEventCode aType) { FUNC_LOG; TKeyResponse response( EKeyWasNotConsumed ); - if ( iList ) + if ( iListPane ) { - response = iList->OfferKeyEventL( aKeyEvent, aType ); + // Use focus strategy + iFocusStrategy.EventOccured( MMRFocusStrategy::EFocusKeyEvent ); + + TBool forwardEvent( ETrue ); + // Remove Delete hw key command if the focus is not visible + if ( !iFocusStrategy.IsFocusVisible() ) + { + if ( aType == EEventKey && aKeyEvent.iCode == EKeyBackspace ) + { + forwardEvent = EFalse; + } + } + + if ( forwardEvent ) + { + response = iListPane->OfferKeyEventL( aKeyEvent, aType ); + iListPane->DrawDeferred(); + } } return response; } + // --------------------------------------------------------------------------- // CESMRView::Draw // This Draw is called when background for title pane (iTitle) is drawn @@ -491,11 +904,21 @@ { FUNC_LOG; CWindowGc& gc = SystemGc(); - + // Draw the background for iTitle using the current skin MAknsSkinInstance* skin = AknsUtils::SkinInstance(); MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); AknsDrawUtils::Background( skin, cc, this, gc, aRect ); + + // Draw color stripe + MESMRCalDbMgr& DbMgr = iEntry->GetDBMgr(); + + TRgb stripeColor = DbMgr.GetCurCalendarColor(); + gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); + gc.SetBrushColor( stripeColor ); + gc.DrawRect( iStripeRect ); + + gc.Reset(); } // --------------------------------------------------------------------------- @@ -504,12 +927,17 @@ // --------------------------------------------------------------------------- // void CESMRView::Draw( - CWindowGc& aGc , - const CCoeControl& /* aControl */, + CWindowGc& /* aGc */, + const CCoeControl& aControl, const TRect& /*aRect*/) const { FUNC_LOG; - aGc.Clear(); + CWindowGc& gc = SystemGc(); + + // Draw the background for aControl using the current skin + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); + AknsDrawUtils::Background( skin, cc, &aControl, gc, aControl.Rect() ); } // --------------------------------------------------------------------------- @@ -517,7 +945,7 @@ // --------------------------------------------------------------------------- // void CESMRView::GetTextDrawer( - CCoeTextDrawerBase*& /*aText*/, + CCoeTextDrawerBase*& /*aText*/, const CCoeControl* /*aControl*/) const { // Do nothing @@ -527,11 +955,9 @@ // CESMRView::SetTitleL() // --------------------------------------------------------------------------- // -void CESMRView::SetTitleL( const TDesC& aTitle, TBool aDefault) +void CESMRView::SetTitleL( const TDesC& /*aTitle*/, TBool /*aDefault*/) { FUNC_LOG; - iTitle->SetTextL( aTitle ); - iTitle->SetDefaultIcon(aDefault); } // --------------------------------------------------------------------------- @@ -541,18 +967,7 @@ void CESMRView::SetControlFocusedL( TESMREntryFieldId aField ) { FUNC_LOG; - iList->ListObserver().SetControlFocusedL( aField ); - } - -// --------------------------------------------------------------------------- -// CESMRView::FontSizeSettingsChanged() -// --------------------------------------------------------------------------- -// -void CESMRView::FontSizeSettingsChanged() - { - FUNC_LOG; - iList->HandleFontChange(); - SizeChanged(); + iListPane->SetControlFocusedL( aField ); } // --------------------------------------------------------------------------- @@ -564,25 +979,24 @@ FUNC_LOG; CCoeControl::HandleResourceChange( aType ); TInt error = KErrNone; - + switch ( aType ) { case KAknsMessageSkinChange: { - TRAP( error, iList->InitializeL() ); - SizeChanged(); + TRAP( error, iListPane->InitializeL() ); break; } case KEikMessageColorSchemeChange: { - TRAP( error, iList->InitializeL() ); - SizeChanged(); + TRAP( error, iListPane->InitializeL() ); break; } case KEikDynamicLayoutVariantSwitch: case KAknLocalZoomLayoutSwitch: { SizeChanged(); + DrawNow(); break; } default: @@ -603,30 +1017,219 @@ // TTypeUid::Ptr CESMRView::MopSupplyObject( TTypeUid aId ) { + FUNC_LOG; if ( iBgContext ) { return MAknsControlContext::SupplyMopObject( aId, iBgContext ); } return CCoeControl::MopSupplyObject( aId ); } - -// + +// ----------------------------------------------------------------------------- + // CESMRView::HandlePointerEventL() + // ----------------------------------------------------------------------------- + // + void CESMRView::HandlePointerEventL( + const TPointerEvent &aPointerEvent ) + { + FUNC_LOG; + // Call focus strategy + iFocusStrategy.EventOccured( MMRFocusStrategy::EFocusPointerEvent ); + + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + +// --------------------------------------------------------------------------- +// CESMRView::InitialScroll() +// --------------------------------------------------------------------------- +// +void CESMRView::InitialScrollL() + { + FUNC_LOG; + iListPane->InitialScrollL(); + } + +// --------------------------------------------------------------------------- +// CESMRView::DynInitMenuPaneL +// --------------------------------------------------------------------------- +// +void CESMRView::DynInitMenuPaneL( + TMRMenuStyle aMenuStyle, + TInt aResourceId, + CEikMenuPane* aMenuPane ) + { + FUNC_LOG; + // Initialize field specific options in context menu and options menu. + // Options menu has field specific options only when focus is visible. + if ( aMenuStyle != EMROptionsMenu + || ( aMenuStyle == EMROptionsMenu + && iFocusStrategy.IsFocusVisible() ) ) + { + CESMRField* field = iStorage->FieldById( ClickedOrFocusedField() ); + field->DynInitMenuPaneL( aResourceId, aMenuPane ); + } + } + // --------------------------------------------------------------------------- -// CESMRView::FocusChanged +// CESMRView::SetNaviArrowStatus +// --------------------------------------------------------------------------- +// +void CESMRView::SetNaviArrowStatus( + TBool aLeftArrowVisible, + TBool aRightArrowVisible ) + { + FUNC_LOG; + if ( iNaviArrowLeft ) + { + iNaviArrowLeft->SetNaviArrowStatus( aLeftArrowVisible ); + } + if ( iNaviArrowRight ) + { + iNaviArrowRight->SetNaviArrowStatus( aRightArrowVisible ); + } + } +// --------------------------------------------------------------------------- +// CESMRView::SetViewMode +// --------------------------------------------------------------------------- +// +void CESMRView::SetViewMode(TESMRViewMode aMode) + { + FUNC_LOG; + iViewMode = aMode; + } +// --------------------------------------------------------------------------- +// CESMRView::GetViewMode +// --------------------------------------------------------------------------- +// +TESMRViewMode CESMRView::GetViewMode() + { + FUNC_LOG; + return iViewMode; + } + +// --------------------------------------------------------------------------- +// CESMRView::ReLayout +// --------------------------------------------------------------------------- +// +void CESMRView::ReLayout() + { + FUNC_LOG; + SizeChanged(); + } + +// --------------------------------------------------------------------------- +// CESMRView::ProcessEventL // --------------------------------------------------------------------------- // -void CESMRView::FocusChanged(TDrawNow aDrawNow) +void CESMRView::ProcessEventL( const MESMRFieldEvent& aEvent ) { - CCoeControl::FocusChanged(aDrawNow); + FUNC_LOG; + + if ( MESMRFieldEvent::EESMRFieldChangeEvent == aEvent.Type() ) + { + TInt* fieldId = static_cast< TInt* >( aEvent.Param( 0 ) ); + + if ( EESMRFieldViewerAttachments == *fieldId ) + { + if ( !iAttachmentIndicator ) + { + TRect attachmentDownloadIndicatorRect( + CalculateAttachmentIndicatorLayout() ); + + iAttachmentIndicator = CMRAttachmentIndicator::NewL( + attachmentDownloadIndicatorRect, + this ); - // if attachments are focused, update the field to make sure - // attachment status is shown correctly - if( IsComponentFocused( EESMRFieldAttachments ) ) - { - TRAP_IGNORE( iList->FocusedItem()->SetOutlineFocusL(ETrue) ); + CFbsBitmap* bitMap( NULL ); + CFbsBitmap* bitMapMask( NULL ); + TSize size( 0,0 ); + NMRBitmapManager::GetSkinBasedBitmapLC( + NMRBitmapManager::EMRBitmapDownloadAttachment, + bitMap, bitMapMask, size ); + + CleanupStack::Pop( 2 ); // bitMap, bitMapMask + + + + iAttachmentIndicator->SetImage( bitMap, bitMapMask ); + iControls.AppendL( iAttachmentIndicator ); + } + + MESMRFieldEventValue* value = + static_cast< MESMRFieldEventValue* >( aEvent.Param( 1 ) ); + + iAttachmentIndicator->SetTextL( value->StringValue() ); + iAttachmentIndicator->MakeVisible( ETrue ); + + ReLayout(); + } } } -// + +// --------------------------------------------------------------------------- +// CESMRView::CalculateAttachmentIndicatorLayout +// --------------------------------------------------------------------------- +// +TRect CESMRView::CalculateAttachmentIndicatorLayout() + { + TRect containerRect( Rect() ); + + TAknLayoutRect naviArrowLeftLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutMRNaviArrowLeft ); + TRect naviArrowLeftRect = naviArrowLeftLayoutRect.Rect(); + + TAknLayoutRect naviArrowRightLayoutRect = + NMRLayoutManager::GetLayoutRect( containerRect, + NMRLayoutManager::EMRLayoutMRNaviArrowRight ); + TRect naviArrowRightRect = naviArrowRightLayoutRect.Rect(); + + if( Layout_Meta_Data::IsLandscapeOrientation() ) + { + naviArrowLeftRect.Move( iStripeRect.Width(), 0 ); + + TInt scrollWidth( 0 ); + if( iScrollBar ) + { + scrollWidth = iScrollBar->Rect().Width(); + } + + naviArrowRightRect.Move( + -( iToolbar.Rect().Width() + scrollWidth ), 0 ); + } + else + { + // Left arrow needs to be moved right the amount of + // stripe width in portrait + naviArrowLeftRect.Move( iStripeRect.Width(), 0 ); + naviArrowLeftRect.Move( 0, -iToolbar.Rect().Height() ); + + TRect naviArrowRightRect = naviArrowRightLayoutRect.Rect(); + + naviArrowRightRect.Move( iStripeRect.Width(), 0 ); + naviArrowRightRect.Move( 0, -iToolbar.Rect().Height() ); + } + + // Get height for one row + TAknLayoutRect rowLayout = + NMRLayoutManager::GetLayoutRect( + containerRect, NMRLayoutManager::EMRLayoutTextEditorIcon ); + TRect rowRect( rowLayout.Rect() ); + + TRect attachmentIndicatorRect; + /*attachmentIndicatorRect.iTl = + TPoint( naviArrowLeftRect.iBr.iX, + naviArrowLeftRect.iBr.iY - rowRect.Height() ); */ + + attachmentIndicatorRect.iTl = + TPoint( naviArrowLeftRect.iBr.iX, + naviArrowLeftRect.iBr.iY - naviArrowLeftRect.Height() ); + + attachmentIndicatorRect.iBr = + TPoint( naviArrowRightRect.iTl.iX, + naviArrowLeftRect.iBr.iY ); + + return attachmentIndicatorRect; + } // EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrviewerdialog.cpp --- a/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,50 +15,13 @@ * */ -#include "emailtrace.h" #include "cesmrviewerdialog.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//
-#include -//
-#include - #include "cesmrpolicy.h" #include "esmrdef.h" #include "cesmrpolicymanager.h" #include "cesmrurlparserplugin.h" #include "esmricalvieweropcodes.hrh" #include "tesmrinputparams.h" -#include "cesmrattachmentinfo.h" #include "cesmrview.h" #include "esmrgui.hrh" #include "cesmrfield.h" @@ -78,17 +41,42 @@ #include "cesmrfeaturesettings.h" #include "esmrconfig.hrh" #include "mesmrfieldevent.h" +#include "cmrtoolbar.h" +#include "cesmrlistquery.h" +#include "mmrinfoprovider.h" +#include "cmrfocusstrategyviewer.h" +#include "cesmrtitlepanehandler.h" -#include "cfsmailbox.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// DEBUG +#include "emailtrace.h" +#include "cesmrcaldbmgr.h" /// Unnamed namespace for local definitions namespace { // codescanner::namespace #ifdef _DEBUG -// Literal for viewer dialog -_LIT( KESMRViewerDlgPanicTxt, "ESMRViewerDlg" ); - enum TESMRViewerDlgPanic { EESMRViewerDlgInvalidCommand, @@ -98,7 +86,8 @@ void Panic( TESMRViewerDlgPanic aPanic ) { - + // Literal for viewer dialog + _LIT( KESMRViewerDlgPanicTxt, "ESMRViewerDlg" ); User::Panic( KESMRViewerDlgPanicTxt, aPanic ); } @@ -107,6 +96,10 @@ // Definition for default buffer length const TInt KCalDefaultBufferLen = 40; +// VGA resolution screen size in pixels +const TInt KVGAOneSide( 640 ); +const TInt KVGAOtherSide( 480 ); + // Calendar command parameter _LIT16( KCalCmdDATE, "GRAPHICDAY" ); @@ -116,45 +109,6 @@ // Definition for calendar application UID const TUid KCalendarAppUID = { KUidCalendarApplication }; -// Defs for prefix -_LIT( KMailtoMatchPattern, "mailto:*" ); // these are never localized -const TInt KMailtoLength = 7; // "mailto:" length - - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Set empty buttons to toolbar. -// --------------------------------------------------------------------------- -// -void SetEmptyButtonsL( CAknToolbar* aToolbar ) - { - aToolbar->AddItemL( CAknButton::NewL(), EAknCtButton, EESMRCmdUndefined, 0, 0 ); - aToolbar->AddItemL( CAknButton::NewL(), EAknCtButton, EESMRCmdUndefined, 0, 1 ); - aToolbar->AddItemL( CAknButton::NewL(), EAknCtButton, EESMRCmdUndefined, 0, 2 ); - } - -// --------------------------------------------------------------------------- -// Set buttons for responding to meeting request to toolbar. -// --------------------------------------------------------------------------- -// -void SetResponseButtonsL( CAknToolbar* aToolbar ) - { - CAknButton* buttonAccept = CAknButton::NewLC(); - buttonAccept->ConstructFromResourceL( R_ACCEPT_BUTTON ); - aToolbar->AddItemL( buttonAccept, EAknCtButton, EESMRCmdAcceptMR, 0, 0 ); - CleanupStack::Pop( buttonAccept ); - - CAknButton* buttonTentative = CAknButton::NewLC(); - buttonTentative->ConstructFromResourceL( R_TENTATIVE_BUTTON ); - aToolbar->AddItemL( buttonTentative, EAknCtButton, EESMRCmdTentativeMR, 0, 1 ); - CleanupStack::Pop( buttonTentative ); - - CAknButton* buttonDecline = CAknButton::NewLC(); - buttonDecline->ConstructFromResourceL( R_DECLINE_BUTTON ); - aToolbar->AddItemL( buttonDecline, EAknCtButton, EESMRCmdDeclineMR, 0, 2 ); - CleanupStack::Pop( buttonDecline ); - } /** * Sets recurrence modification rule to entry. Rule is queried @@ -188,16 +142,16 @@ aEntry.SetModifyingRuleL( MESMRMeetingRequestEntry::EESMRThisOnly ); break; - } + } case EESMRSeries: { aEntry.SetModifyingRuleL( MESMRMeetingRequestEntry::EESMRAllInSeries ); break; - } + } default: { - __ASSERT_DEBUG( EFalse, + __ASSERT_DEBUG( EFalse, Panic(EESMRViewerDlgnvalidSeriesResult) ); break; } @@ -218,11 +172,10 @@ // --------------------------------------------------------------------------- // CESMRViewerDialog::CESMRViewerDialog( - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ) : - iEntry( aEntry ), iCallback( aCallback ), - iClearToolbar( EFalse ) + iInfoProvider( aInfoProvider ) { FUNC_LOG; // Do nothing @@ -235,36 +188,23 @@ CESMRViewerDialog::~CESMRViewerDialog() { FUNC_LOG; - - if ( iIdleNaviEventRunner ) - { - iIdleNaviEventRunner->Cancel(); - delete iIdleNaviEventRunner; - } - iESMRStatic.Close(); - if ( iFeatureManagerInitialized ) - { - FeatureManager::UnInitializeLib(); - } - - if ( iServiceHandler ) + if ( iTitlePane ) { - iServiceHandler->DetachMenu( R_MRVIEWER_MENUBAR, R_PS_AIW_INTEREST ); - delete iServiceHandler; + // Returns the previous title back to titlepane + iTitlePane->Rollback(); + delete iTitlePane; } - + delete iESMRSendUI; - delete iLocationPluginHandler; - delete iFeatures; - - TRAP_IGNORE( ClearToolbarL() ); // iView is deleted by framework because it uses the // custom control mechanism. + delete iToolbar; + delete iFocusStrategy; } // --------------------------------------------------------------------------- @@ -272,15 +212,14 @@ // --------------------------------------------------------------------------- // EXPORT_C CESMRViewerDialog* CESMRViewerDialog::NewL( - CESMRPolicy* aPolicy, - MESMRCalEntry& aEntry, + MMRInfoProvider& aInfoProvider, MAgnEntryUiCallback& aCallback ) { FUNC_LOG; CESMRViewerDialog* self = - new (ELeave) CESMRViewerDialog( aEntry, aCallback ); + new (ELeave) CESMRViewerDialog( aInfoProvider, aCallback ); CleanupStack::PushL( self ); - self->ConstructL( aPolicy ); + self->ConstructL(); CleanupStack::Pop( self ); return self; } @@ -289,46 +228,61 @@ // CESMRViewerDialog::ConstructL // --------------------------------------------------------------------------- // -void CESMRViewerDialog::ConstructL( - CESMRPolicy* aPolicy ) +void CESMRViewerDialog::ConstructL() { FUNC_LOG; - - iIdleNaviEventRunner = CIdle::NewL( CActive::EPriorityStandard ); - - iPolicy = aPolicy; iESMRStatic.ConnectL(); CAknDialog::ConstructL( R_MRVIEWER_MENUBAR ); + // Class disables avkon toolbar by default, which + // we want in case of non-MR + iToolbar = CMRToolbar::NewL(); + TRect clientRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, clientRect ); + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EMainPane, + clientRect ); TBool responseReady(EFalse); + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); MESMRMeetingRequestEntry* mrEntry = NULL; - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry.Type() ) + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) { // This is meeting request - mrEntry = static_cast( &iEntry ); + mrEntry = static_cast( calEntry ); responseReady = mrEntry->IsSentL(); + + // Change the status pane layout to remove navi pane + CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane(); + sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT); } iESMRSendUI = CESMRSendUI::NewL(EESMRCmdSendAs); - FeatureManager::InitializeLibL(); - iFeatureManagerInitialized = ETrue; - CESMRViewerFieldStorage* storage = CESMRViewerFieldStorage::NewL( - aPolicy, + iInfoProvider.PolicyProvider().CurrentPolicy(), this, responseReady, *this ); + // Create focus strategy + iFocusStrategy = CMRFocusStrategyViewer::NewL( *storage ); + // Give the strategy to the iView + // storage ownership is transferred to CESMRView - iView = CESMRView::NewL(storage, iEntry, clientRect ); + iView = CESMRView::NewL( + storage, + *calEntry, + clientRect, + *iFocusStrategy, + *iToolbar, + this ); + + iView->SetViewMode( EESMRViewMR ); - if ( iEntry.Entry().SummaryL().Length() == 0 ) + if ( calEntry->Entry().SummaryL().Length() == 0 ) { // if no title, set unnamed text: HBufC* title = StringLoader::LoadLC ( R_QTN_MEET_REQ_CONFLICT_UNNAMED, @@ -338,12 +292,17 @@ } else { - iView->SetTitleL( iEntry.Entry().SummaryL() ); + iView->SetTitleL( calEntry->Entry().SummaryL() ); } TInt titleStringId = -1; - switch ( iEntry.Type() ) + switch ( calEntry->Type() ) { + case MESMRCalEntry::EESMRCalEntryMeetingRequest: + { + titleStringId = R_QTN_MEET_REQ_TITLE_MEETING; + break; + } case MESMRCalEntry::EESMRCalEntryMeeting: { titleStringId = R_QTN_CALENDAR_TITLE_MEETING; @@ -358,14 +317,13 @@ { titleStringId = R_QTN_CALENDAR_TITLE_MEMO; break; - } + } case MESMRCalEntry::EESMRCalEntryAnniversary: { titleStringId = R_QTN_CALENDAR_TITLE_ANNIVERSARY; break; } - case MESMRCalEntry::EESMRCalEntryReminder: // Fall through - case MESMRCalEntry::EESMRCalEntryMeetingRequest: // Fall through + case MESMRCalEntry::EESMRCalEntryReminder: // Fall through default: { break; @@ -373,46 +331,17 @@ } if ( titleStringId != -1 ) { - CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane(); - CAknTitlePane* tp = - static_cast( - sp->ControlL(TUid::Uid(EEikStatusPaneUidTitle)) ); + if( !iTitlePane ) + { + iTitlePane = CESMRTitlePaneHandler::NewL( *iEikonEnv ); + } + HBufC* titleText = StringLoader::LoadLC( titleStringId, iCoeEnv ); - tp->SetTextL( *titleText ); + iTitlePane->SetNewTitle( titleText ); CleanupStack::PopAndDestroy( titleText ); } - iFeatures = CESMRFeatureSettings::NewL(); - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) - { - iMenuBar->SetContextMenuTitleResourceId( R_MR_VIEWER_CONTEXT_MENU ); - } - - // start to observe navigation decorator - CEikStatusPane* sp = - static_cast( - iEikonEnv->AppUiFactory() )->StatusPane(); - - CAknNavigationControlContainer* naviPane = - static_cast( - sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - - if ( naviPane ) - { - iESMRNaviDecorator = naviPane->Top(); - - if ( iESMRNaviDecorator ) - { - iESMRNaviDecorator->SetNaviDecoratorObserver( this ); - } - } - - - //start service handler and add the interests of this class - iServiceHandler = CAiwServiceHandler::NewL(); - iServiceHandler->AttachL( R_PS_AIW_INTEREST ); } // --------------------------------------------------------------------------- @@ -424,6 +353,39 @@ FUNC_LOG; iView->InternalizeL(); CAknDialog::ActivateL(); + + // Needs to be constructed here + ConstructToolbarL(); + + switch ( iInfoProvider.EntryL()->Type() ) + { + case MESMRCalEntry::EESMRCalEntryMeetingRequest: + { + iView->InitialScrollL(); + + MESMRMeetingRequestEntry* entry = + static_cast( + iInfoProvider.EntryL() ); + + if ( entry->IsOpenedFromMail() ) + { + iView->SetNaviArrowStatus( + iCallback.IsCommandAvailable( + EESMRCmdMailPreviousMessage ), + iCallback.IsCommandAvailable( + EESMRCmdMailNextMessage ) ); + } + + } + + case MESMRCalEntry::EESMRCalEntryMeeting: + case MESMRCalEntry::EESMRCalEntryMemo: + case MESMRCalEntry::EESMRCalEntryAnniversary: + case MESMRCalEntry::EESMRCalEntryTodo: + case MESMRCalEntry::EESMRCalEntryReminder: // Fall through + default: + break; + } } // --------------------------------------------------------------------------- @@ -450,46 +412,37 @@ FUNC_LOG; TKeyResponse response( EKeyWasNotConsumed ); if ( aEvent.iCode != EKeyEscape && !MenuShowing() ) - { - response = iView->OfferKeyEventL( aEvent, aType ); - } + { + response = iView->OfferKeyEventL( aEvent, aType ); + } if ( response == EKeyWasNotConsumed ) { switch (aEvent.iScanCode) { - case EStdKeyLeftArrow: - if ( aType == EEventKey ) - { - response = EKeyWasConsumed; - if ( iCallback.IsCommandAvailable( - EESMRCmdMailPreviousMessage ) ) - { - ProcessCommandL( EESMRCmdMailPreviousMessage ); - } - } + case '4': + { + response = EKeyWasConsumed; + ProcessCommandL(EESMRCmdMailPreviousMessage); break; - case EStdKeyRightArrow: - if ( aType == EEventKey ) - { - response = EKeyWasConsumed; - if ( iCallback.IsCommandAvailable( - EESMRCmdMailNextMessage ) ) - { - ProcessCommandL( EESMRCmdMailNextMessage ); - } - } + } + case '6': + { + response = EKeyWasConsumed; + ProcessCommandL(EESMRCmdMailNextMessage); break; + } default: + { response = CAknDialog::OfferKeyEventL( aEvent, aType ); break; + } } } return response; } - // --------------------------------------------------------------------------- // CESMRViewerDialog::ProcessCommandL // --------------------------------------------------------------------------- @@ -497,6 +450,7 @@ void CESMRViewerDialog::ProcessCommandL( TInt aCommand ) { FUNC_LOG; + TRAPD( err, DoProcessCommandL( aCommand ) ); if ( err != KErrNone && err != KErrCancel && @@ -514,44 +468,37 @@ { FUNC_LOG; CAknDialog::ProcessCommandL( aCommand ); - switch ( aCommand ) { - case EESMRCmdPrint: // Fall through - case EESMRCmdPrint_Reserved1: // Fall through - case EESMRCmdPrint_Reserved2: // Fall through - case EESMRCmdPrint_Reserved3: // Fall through - case EESMRCmdPrint_Reserved4: - { - this->MakeVisible(EFalse); - HandlePrintCommandL(aCommand); - this->MakeVisible(ETrue); - break; - } case EESMRCmdSendAs: { SendCalendarEntryL(aCommand); break; } + case EESMRCmdSendMR: //Fall through + case EESMRCmdSendMRUpdate: + { + TInt ret( KErrGeneral ); + ret = iCallback.ProcessCommandWithResultL ( aCommand ); + + if ( ret == KErrNone ) + { + TryExitL ( EAknSoftkeyClose ); + } + break; + } // pass-through all calentryui related command to call back case EESMRCmdCalEntryUISend: // Fall through case EESMRCmdCalEntryUIAddParticipants: // Fall through case EESMRCmdCalEntryUISave: // Fall through { - User::LeaveIfError( + User::LeaveIfError( iCallback.ProcessCommandWithResultL( aCommand )); break; - } - case EESMRCmdCalEntryUIDelete: - { - if (!(iCallback.ProcessCommandWithResultL(aCommand) == KErrCancel)) - { - TryExitL( EAknSoftkeyClose ); - } - break; - } - // EEikBidCancel is called when Red End key is pressed or + } + + // EEikBidCancel is called when Red End key is pressed or // application is killed via Swap Window case EEikBidCancel: // Fall through case EAknSoftkeyClose: // Fall through @@ -565,25 +512,28 @@ iView->ProcessEditorCommandL( aCommand ); break; } - case EESMRCmdEdit: // Fall through - case EESMRCmdEditLocal: // Fall through - case EESMRCmdDeleteMR: // Fall through - case EESMRCmdCalEntryUIEdit: + case EESMRCmdEdit: // Fall through + case EESMRCmdEditLocal: // Fall through + case EESMRCmdDeleteMR: // Fall through + case EESMRCmdCalEntryUIEdit: // Fall through + case EESMRCmdCalEntryUIDelete: { - TBool closeDialog = HandleCommandForRecurrentEventL( aCommand ); + TBool closeDialog = HandleCommandForEventL( aCommand ); if ( closeDialog ) { TryExitL( EAknSoftkeyClose ); } break; } + case EESMRCmdReply: // Fall through case EESMRCmdReplyAll: { - User::LeaveIfError( + User::LeaveIfError( iCallback.ProcessCommandWithResultL( aCommand )); break; - } + } + case EAknCmdHelp: { iView->LaunchViewerHelpL(); @@ -600,12 +550,15 @@ case EESMRCmdTentativeMR: // Fall through case EESMRCmdDeclineMR: // Fall through { - iView->ExternalizeL(); // no forced validation - TInt res = iCallback.ProcessCommandWithResultL( aCommand ); - if ( res != KErrCancel ) + if ( !UserWantToHandleAttachmentsL() ) { - TryExitL( EAknSoftkeyClose ); - } + iView->ExternalizeL(); // no forced validation + TInt res = iCallback.ProcessCommandWithResultL( aCommand ); + if ( res != KErrCancel ) + { + TryExitL( EAknSoftkeyClose ); + } + } break; } case EESMRCmdRemoveFromCalendar: @@ -613,13 +566,14 @@ iView->ExternalizeL(); // no forced validation TryExitL( EESMRCmdRemoveFromCalendar ); break; - } + } case EESMRCmdViewCalendar: { OpenInDayModeL(); break; - } - // Email commands + } + + // Email commands case EESMRCmdMailDelete: { TBool executeCmd( CESMRConfirmationQuery::ExecuteL( @@ -634,12 +588,12 @@ } } break; - } + } case EESMRCmdClipboardCopy: { iView->ProcessEditorCommandL( aCommand ); break; - } + } case EESMRCmdMailPreviousMessage: // Fall through case EESMRCmdMailNextMessage: // Fall through case EESMRCmdMailForwardAsMessage: // Fall through @@ -648,7 +602,37 @@ case EESMRCmdMailMoveMessageToDrafts: // Fall through case EESMRCmdMailComposeMessage: // Fall through case EESMRCmdMailMessageDetails: + case EESMRCmdForwardAsMeeting: // Fall through + case EESMRCmdForwardAsMail: { + if( aCommand == EESMRCmdForwardAsMeeting && + iInfoProvider.EntryL()->Entry().AttachmentCountL() > 0 ) + { + // Show confirmation note if current mailbox does not + // support attachments and attachments exist in the entry + if( !SupportsMailBoxCapabilityL( + MESMRBuilderExtension:: + EMRCFSSupportsAttachmentsInMR ) ) + { + if ( !CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery:: + EESMRAttachmentsNotSupported ) ) + { + break; + } + } + } + + // If entry is recurring, we want to ask from user, if + // single instance or whole series will be forwarded + if( aCommand == EESMRCmdForwardAsMail && + iInfoProvider.EntryL()->IsRecurrentEventL() ) + { + SetRecurrenceModRuleL( + *( iInfoProvider.EntryL() ), + CESMRListQuery::EESMRForwardThisOccurenceOrSeriesQuery ); + } + TInt res = iCallback.ProcessCommandWithResultL( aCommand ); if ( res != KErrCancel ) { @@ -656,36 +640,8 @@ } break; } - case EESMRCmdForward: - { - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) - { - // Because this is MR entry, it is safe to cast it. - MESMRMeetingRequestEntry* mrEntry = - static_cast( &iEntry ); - __ASSERT_DEBUG( mrEntry, Panic( EESMRViewerDlgInvalidEntry ) ); - - TInt command = SupportsForwardingAsMeetingL( mrEntry, ETrue ) - ? EESMRCmdForwardAsMeeting : EESMRCmdForwardAsMail; - - CAknToolbar* currentToolbar = static_cast( - iEikonEnv->AppUiFactory() )->CurrentFixedToolbar(); - if ( currentToolbar ) - { - currentToolbar->SetToolbarVisibility( EFalse ); - } - TInt res = iCallback.ProcessCommandWithResultL( command ); - if ( currentToolbar ) - { - currentToolbar->SetToolbarVisibility( ETrue ); - } - if ( res != KErrCancel ) - { - TryExitL( aCommand ); - } - } - break; - } + +// case EESMRCmdDownloadManager: { TInt res = iCallback.ProcessCommandWithResultL( aCommand ); @@ -693,14 +649,18 @@ { TryExitL( EAknSoftkeyClose ); } +// break; } + +// case EESMRCmdOpenAttachment: // Fall through case EESMRCmdOpenAttachmentView: // Fall through case EESMRCmdDownloadAttachment: // Fall through case EESMRCmdDownloadAllAttachments: // Fall through case EESMRCmdSaveAttachment: // Fall through case EESMRCmdSaveAllAttachments: // Fall through +// { TInt res = iCallback.ProcessCommandWithResultL( aCommand ); @@ -710,6 +670,19 @@ } break; } + + /* + * Attachment field viewer context menu commands + */ + case EESMRViewerOpenAttachment: + case EESMRViewerSaveAttachment: + case EESMRViewerSaveAllAttachments: + case EESMRViewerCancelAttachmentDownload: + { + iView->ProcessEditorCommandL( aCommand ); + break; + } + case EESMRCmdMailFlagMessage: // Fall through case EESMRCmdMailMarkUnread: // Fall through case EESMRCmdMailMarkRead: @@ -720,34 +693,40 @@ case EESMRCmdTodoMarkAsDone: // Fall through case EESMRCmdTodoMarkAsNotDone: { - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryTodo ) + if ( iInfoProvider.EntryL()->Type() == MESMRCalEntry::EESMRCalEntryTodo ) { User::LeaveIfError( iCallback.ProcessCommandWithResultL( aCommand )); } break; - } + } case EESMRCmdSearchFromMap: - case EESMRCmdShowOnMap: + case EESMRCmdShowOnMap: { if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) { - LocationPluginHandlerL().HandleCommandL( aCommand, iEntry ); + MESMRCalEntry* entry = iInfoProvider.EntryL(); + LocationPluginHandlerL().HandleCommandL( aCommand, *entry ); iView->SetControlFocusedL( EESMRFieldLocation ); } break; } + case EMRCmdHideAttachmentIndicator: + { + iView->ProcessEditorCommandL( EMRCmdHideAttachmentIndicator ); + } + break; default: { - if ( aCommand >= EESMRCmdActionMenuFirst && + if ( aCommand >= EESMRCmdActionMenuFirst && aCommand < EESMRCmdActionMenuLast ) { iESMRStatic.ContactMenuHandlerL().ExecuteOptionsMenuL(aCommand); } else if ( aCommand == EESMRCmdActionMenuLast ) { - TInt res = iCallback.ProcessCommandWithResultL( + TInt res = iCallback.ProcessCommandWithResultL( EESMRCmdOpenAttachmentView ); if ( res != KErrCancel ) { @@ -784,7 +763,8 @@ if ( iFeatures->FeatureSupported( CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) { - iMenuBar->TryDisplayContextMenuBarL(); + SetContextMenu(); + ShowContextMenuL(); } break; } @@ -792,9 +772,9 @@ case EESMRCmdEditLocal: case EESMRCmdCalEntryUIEdit: { - res = HandleCommandForRecurrentEventL( aButtonId ); + res = HandleCommandForEventL( aButtonId ); break; - } + } case EAknSoftkeySelect: { iView->ProcessEditorCommandL( aButtonId ); @@ -805,22 +785,22 @@ } break; } - +// case EESMRCmdOpenAttachmentView: case EESMRCmdMskOpenEmailAttachment: case EESMRCmdOpenAttachment: - case EESMRCmdDownloadAttachment: + case EESMRCmdDownloadAttachment: { ProcessCommandL( aButtonId ); break; - } - + } +// case EESMRCmdShowAllAttendees: case EESMRCmdShowOnMap: { iView->ProcessEditorCommandL( aButtonId ); break; - } + } case EEikBidCancel: { res = ETrue; @@ -836,16 +816,12 @@ case EESMRCmdMailMoveMessageToDrafts: // Fall through case EESMRCmdMailComposeMessage: // Fall through case EESMRCmdMailMessageDetails: + case EESMRCmdRemoveFromCalendar: { - iClearToolbar = ETrue; res = HandleMRExitL( aButtonId ); break; - } - case EESMRCmdRemoveFromCalendar: - { - res = iCallback.ProcessCommandWithResultL ( aButtonId ); - break; - } + } + default: { if(iExitTriggered) @@ -853,7 +829,7 @@ res = ETrue; } break; - } + } } return res; @@ -886,7 +862,6 @@ TInt CESMRViewerDialog::ExecuteViewLD() { FUNC_LOG; - MakeMrGuiToolbarButtonsL(); return ExecuteLD( R_MRVIEWER_DIALOG ); } @@ -897,17 +872,30 @@ TBool CESMRViewerDialog::Response( TInt aCommand ) { FUNC_LOG; + + TBool retValue( EFalse ); iExitTriggered = EFalse; - // Documentation says that this function might leave and also might - // return system might error code. - TInt res = KErrNone; - TRAPD( error, res = iCallback.ProcessCommandWithResultL( aCommand ) ); - if ( res != KErrCancel && error == KErrNone ) + + if ( KErrCancel != aCommand ) { - iExitTriggered = ETrue; - return ETrue; + TBool handleAttachments( EFalse ); + TRAPD( error, handleAttachments = UserWantToHandleAttachmentsL() ); + + if ( !handleAttachments ) + { + // Documentation says that this function might leave and also might + // return system wide error code. + TInt res = KErrNone; + TRAP( error, res = iCallback.ProcessCommandWithResultL( aCommand ) ); + if ( res != KErrCancel && error == KErrNone ) + { + iExitTriggered = ETrue; + retValue = ETrue; + } + } } - return EFalse; + + return retValue; } // --------------------------------------------------------------------------- @@ -921,7 +909,7 @@ TRAPD( error, ProcessCommandL(EAknSoftkeyClose) ); if ( error != KErrNone ) { - CEikonEnv::Static()->HandleError( error );// codescanner::eikonenvstatic + iCoeEnv->HandleError( error ); } } @@ -936,6 +924,26 @@ } // --------------------------------------------------------------------------- +// CESMRViewerDialog::DynInitToolbarL +// --------------------------------------------------------------------------- +// +void CESMRViewerDialog::DynInitToolbarL ( + TInt /*aResourceId*/, + CAknToolbar* /*aToolbar*/ ) + { + // TODO: Not implemented yet + } + +// --------------------------------------------------------------------------- +// CESMRViewerDialog::OfferToolbarEventL +// --------------------------------------------------------------------------- +// +void CESMRViewerDialog::OfferToolbarEventL( TInt aCommand ) + { + ProcessCommandL( aCommand ); + } + +// --------------------------------------------------------------------------- // CESMRViewerDialog::DynInitMenuPaneL // --------------------------------------------------------------------------- // @@ -944,90 +952,56 @@ CEikMenuPane* aMenuPane ) { FUNC_LOG; - if ( iServiceHandler ) - { - if ( iServiceHandler->HandleSubmenuL( *aMenuPane ) ) - { - return; - } - } + MESMRCalEntry* entry = iInfoProvider.EntryL(); + + TMRMenuStyle menuStyle( EMROptionsMenu ); switch ( aResourceId ) { case R_ACTION_MENU: { - iESMRStatic.ContactMenuHandlerL().InitOptionsMenuL( aMenuPane ); + CESMRContactMenuHandler& handler = iESMRStatic.ContactMenuHandlerL(); + if ( handler.OptionsMenuAvailable() ) + { + handler.InitOptionsMenuL( aMenuPane ); + } break; } case R_MR_VIEWER_MENU: { - if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - HandlePolicyMenuL( aResourceId, aMenuPane ); - + // Insert send ui menu for all other entry types than meeting request - if ( iEntry.Type() != MESMRCalEntry::EESMRCalEntryMeetingRequest ) + if ( entry->Type() != MESMRCalEntry::EESMRCalEntryMeetingRequest ) { TryInsertSendMenuL(aMenuPane); } - - if ( iEntry.Entry().AttendeesL().Count() <= 1 ) + + if ( entry->Entry().AttendeesL().Count() <= 1 ) { aMenuPane->SetItemDimmed( EESMRCmdReplyAll, ETrue ); } - + HandleDynamicMenuItemsL( aResourceId, aMenuPane ); - if ( FeatureManager::FeatureSupported( - KFeatureIdPrintingFrameworkCalendarPlugin ) ) - { - // Initiliaze menu - iServiceHandler->InitializeMenuPaneL( - *aMenuPane, - aResourceId, - EESMRCmdPrint, - iServiceHandler->InParamListL() ); - } - else - { - aMenuPane->SetItemDimmed( EESMRCmdPrint, ETrue ); - } - - TBool canCopyToClipboard = iView->CanProcessEditorCommandL( EESMRCmdClipboardCopy ); - if ( !canCopyToClipboard ) - { - aMenuPane->SetItemDimmed( EESMRCmdClipboardCopy, ETrue ); - } - + break; + } + case R_FORWARD_OPTIONS: + { + HandleForwardMenuL( aResourceId, aMenuPane ); break; } - case R_MR_VIEWER_LOCATION_MENU: { - if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) - { - TBool showOnMap = - LocationPluginHandlerL().IsCommandAvailableL( EESMRCmdShowOnMap, - iEntry ); - - aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); - aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, showOnMap ); - - aMenuPane->SetItemDimmed( EESMRCmdEdit, - !iPolicy->IsDefaultCommand( EESMRCmdEdit ) ); - aMenuPane->SetItemDimmed( EESMRCmdEditLocal, - !iPolicy->IsDefaultCommand( EESMRCmdEditLocal ) ); - aMenuPane->SetItemDimmed( EESMRCmdCalEntryUIEdit, - !iPolicy->IsDefaultCommand( EESMRCmdCalEntryUIEdit ) ); - } - + menuStyle = EMRContextMenu; + InitLocationMenuL( aMenuPane ); + break; + } + case R_MR_VIEWER_ATTACHMENT_MENU: + { + menuStyle = EMRContextMenu; break; } default: @@ -1038,6 +1012,9 @@ // Handles email submenu HandleEmailSubmenuL( aResourceId, aMenuPane ); + + // Handles field specific context menu + iView->DynInitMenuPaneL( menuStyle, aResourceId, aMenuPane ); } // --------------------------------------------------------------------------- @@ -1050,34 +1027,23 @@ FUNC_LOG; if ( aResourceId == R_MR_VIEWER_MENU ) { - if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } + // Map and Navigation Fw support if ( iFeatures->FeatureSupported( - CESMRFeatureSettings::EESMRUIMnFwIntegration ) ) + CESMRFeatureSettings::EESMRUIMnFwIntegration ) && + iView->IsControlVisible( EESMRFieldLocation )) { - if ( !iView->IsComponentVisible( EESMRFieldLocation )) - { - aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, ETrue ); - aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, ETrue ); - } - else - { - TBool showOnMap = LocationPluginHandlerL(). - IsCommandAvailableL( EESMRCmdShowOnMap, - iEntry ); - aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, showOnMap ); - aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); - } + MESMRCalEntry* entry = iInfoProvider.EntryL(); + TBool showOnMap = LocationPluginHandlerL(). + IsCommandAvailableL( EESMRCmdShowOnMap, *entry ); + aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, showOnMap ); + aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, !showOnMap ); } else { aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap, ETrue ); aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, ETrue ); } - + // Handle Action Menu item TBool dim = !iESMRStatic.ContactMenuHandlerL().OptionsMenuAvailable(); aMenuPane->SetItemDimmed( EESMRCmdActionMenu, dim ); @@ -1093,7 +1059,7 @@ { FUNC_LOG; TInt index(KErrNotFound); - + // Insert send menu to the next position from "editing options" aMenuPane->ItemAndPos(EESMRCmdClipboardCopy, index); if (index == KErrNotFound) @@ -1109,6 +1075,30 @@ } // --------------------------------------------------------------------------- +// CESMRViewerDialog::SetContextMenu +// --------------------------------------------------------------------------- +// +void CESMRViewerDialog::SetContextMenu() + { + TESMREntryFieldId fieldId = iView->ClickedOrFocusedField(); + + switch( fieldId ) + { + case EESMRFieldViewerAttachments: + { + iContextMenuResourceId = R_MR_VIEWER_ATTACHMENT_CONTEXT_MENU; + } + break; + + default: + iContextMenuResourceId = R_MR_VIEWER_CONTEXT_MENU; + break; + } + + iMenuBar->SetContextMenuTitleResourceId( iContextMenuResourceId ); + } + +// --------------------------------------------------------------------------- // CESMRViewerDialog::OpenInDayModeL // --------------------------------------------------------------------------- // @@ -1127,7 +1117,7 @@ HBufC8* paramBuf = HBufC8::NewLC( tail->Length() *2 ); TPtr8 tailBuf = paramBuf->Des(); - tailBuf.Copy( + tailBuf.Copy( reinterpret_cast( tail->Ptr() ), tail->Length() *2 ); if( task.Exists() ) // Calendar already open @@ -1153,7 +1143,7 @@ lsSession.StartApp( *cmdLine ); CleanupStack::PopAndDestroy( cmdLine ); } - + // Close lsSession CleanupStack::PopAndDestroy(); // codescanner::cleanup } @@ -1169,11 +1159,11 @@ { FUNC_LOG; // "DATE YYYY MM DD HH MM SS MMMMMM" - aTailBuffer = HBufC::NewLC( KCalDefaultBufferLen ); + aTailBuffer = HBufC::NewLC( KCalDefaultBufferLen ); TPtr tailPtr = aTailBuffer->Des(); // get the start time of entry - CCalEntry& entry = iEntry.Entry(); + CCalEntry& entry = iInfoProvider.EntryL()->Entry(); TTime startTime = entry.StartTimeL().TimeLocalL(); startTime.FormatL(tailPtr, KCalCmdTimeFormat() ); @@ -1182,45 +1172,46 @@ } // --------------------------------------------------------------------------- -// CESMRViewerDialog::HandleCommandForRecurrentEventL +// CESMRViewerDialog::HandleCommandForEventL // --------------------------------------------------------------------------- // -TBool CESMRViewerDialog::HandleCommandForRecurrentEventL( TInt aCommand ) +TBool CESMRViewerDialog::HandleCommandForEventL( TInt aCommand ) { FUNC_LOG; TBool closeDialog( EFalse ); + MESMRCalEntry* calEntry( iInfoProvider.EntryL() ); + switch ( aCommand ) { - case EESMRCmdEdit: //Fall through - case EESMRCmdEditLocal: //Fall through + case EESMRCmdEdit: //Fall through + case EESMRCmdEditLocal: //Fall through case EESMRCmdCalEntryUIEdit: { - this->MakeVisible(EFalse); - if ( iEntry.IsRecurrentEventL() ) + if ( calEntry->IsRecurrentEventL() ) { // Check is the currently viewed entry a modifying entry. // MESMRCalEntry should provide this method. // if the entry is an exception to series, no query // should be asked in which mode the editor should be launched // in this occurance or series -mode. - if ( iEntry.Entry().RecurrenceIdL().TimeUtcL() != + if ( calEntry->Entry().RecurrenceIdL().TimeUtcL() != Time::NullTTime() ) { - iEntry.SetModifyingRuleL( MESMRCalEntry::EESMRThisOnly ); + calEntry->SetModifyingRuleL( MESMRCalEntry::EESMRThisOnly ); } else { SetRecurrenceModRuleL( - iEntry, + *calEntry, CESMRListQuery::EESMROpenThisOccurenceOrSeriesQuery ); } } MESMRMeetingRequestEntry* entry = NULL; - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry.Type() ) + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) { - entry = static_cast(&iEntry); + entry = static_cast(calEntry); TESMRRole role = entry->RoleL(); if ( role == EESMRRoleOrganizer ) @@ -1238,40 +1229,44 @@ } else { - User::LeaveIfError( + User::LeaveIfError( iCallback.ProcessCommandWithResultL( EESMRCmdCalEntryUIEdit)); closeDialog = ETrue; } - this->MakeVisible(ETrue); break; } - case EESMRCmdDeleteMR: + case EESMRCmdDeleteMR: // Fall through + case EESMRCmdCalEntryUIDelete: { - if ( iEntry.Type () == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + TBool okToDelete = ETrue; + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + if ( calEntry->IsRecurrentEventL() ) { - TBool okToDelete = ETrue; - - if ( iEntry.IsRecurrentEventL() ) + SetRecurrenceModRuleL( + *calEntry, + CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + } + else + { + if( CCalenInterimUtils2::IsMeetingRequestL( calEntry->Entry() ) ) { - SetRecurrenceModRuleL( - iEntry, - CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + okToDelete = CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery::EESMRDeleteMR ); } else { okToDelete = CESMRConfirmationQuery::ExecuteL( - CESMRConfirmationQuery::EESMRDeleteMR ); - + CESMRConfirmationQuery::EESMRDeleteEntry ); } + } - if ( okToDelete ) + if ( okToDelete ) + { + // When deleting we do not need to externalize entry + TInt res = iCallback.ProcessCommandWithResultL( aCommand ); + if ( res != KErrCancel ) { - // When deleting we do not need to externalize entry - TInt res = iCallback.ProcessCommandWithResultL( aCommand ); - if ( res != KErrCancel ) - { - closeDialog = ETrue; - } + closeDialog = ETrue; } } break; @@ -1297,53 +1292,18 @@ CEikMenuPane* pane=NULL; // Show menu to user - // CCalenSend handles selection internally, so we don't + // CCalenSend handles selection internally, so we don't // get anything in return iESMRSendUI->DisplaySendCascadeMenuL(*pane); // Try to send if (iESMRSendUI->CanSendL(aCommandId)) { - iESMRSendUI->SendAsVCalendarL(aCommandId, iEntry.Entry() ); + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + iESMRSendUI->SendAsVCalendarL(aCommandId, calEntry->Entry() ); } } -// --------------------------------------------------------------------------- -// CESMRViewerDialog::HandlePrintCommandL -// --------------------------------------------------------------------------- -// -void CESMRViewerDialog::HandlePrintCommandL(TInt aCommand) - { - FUNC_LOG; - CAiwGenericParamList& inParams = iServiceHandler->InParamListL(); - - // Param date - - TCalTime startTime = iEntry.Entry().StartTimeL(); - - TAiwGenericParam dateParam( EGenericParamDateTime ); - TTime activeDay = startTime.TimeUtcL(); - - TAiwGenericParam calendarParam( EGenericParamCalendarItem ); - calendarParam.Value().Set( TUid::Uid(iEntry.Entry().LocalUidL()) ); - inParams.AppendL( calendarParam ); - - // Append date param - dateParam.Value().Set( activeDay ); - inParams.AppendL( dateParam ); - - const TUid uid( TUid::Uid( KUidCalendarApplication ) ); - TAiwGenericParam uidParam( EGenericParamApplication ); - uidParam.Value().Set( uid ); - inParams.AppendL( uidParam ); - - // Execute service command with given parameters - iServiceHandler->ExecuteMenuCmdL( aCommand, - inParams, - iServiceHandler->OutParamListL(), - 0, - NULL ); - } // --------------------------------------------------------------------------- // CESMRViewerDialog::HandleEmailSubmenuL @@ -1354,36 +1314,17 @@ CEikMenuPane* aMenuPane ) { FUNC_LOG; + + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + // Insert send ui menu for all other entry types than meeting request - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) { - if ( R_MRVIEWER_EMAIL_MENU == aResourceId ) + if ( R_MR_VIEWER_MENU == aResourceId ) { - TInt menuItemCount( aMenuPane->NumberOfItemsInPane() ); - for ( TInt i(0); i < menuItemCount; ++i ) - { - CEikMenuPaneItem::SData& item( - aMenuPane->ItemDataByIndexL( i ) ); - aMenuPane->SetItemDimmed( - item.iCommandId, - !iCallback.IsCommandAvailable(item.iCommandId) ); - } - } - else if ( R_MR_VIEWER_MENU == aResourceId ) - { - if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - - TBool emailMenuDimmed( ETrue ); - // Try insert email specific menu - if ( EESMRAppESEmail == iPolicy->AllowedApp() ) - { - emailMenuDimmed = EFalse; - } - + const CESMRPolicy& currentPolicy( + iInfoProvider.PolicyProvider().CurrentPolicy() ); + aMenuPane->SetItemDimmed( EESMRCmdMailDelete, !iCallback.IsCommandAvailable( @@ -1402,10 +1343,6 @@ EESMRCmdMailNextMessage, !iCallback.IsCommandAvailable( EESMRCmdMailNextMessage ) ); - - aMenuPane->SetItemDimmed( - EESMRCmdMailEmailMoreMenu, - emailMenuDimmed ); } } } @@ -1419,18 +1356,16 @@ CEikMenuPane* aMenuPane ) { FUNC_LOG; + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + const CESMRPolicy& currentPolicy( + iInfoProvider.PolicyProvider().CurrentPolicy() ); + if ( aResourceId == R_MR_VIEWER_MENU ) { - if (FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration )) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue); - } - - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) { MESMRMeetingRequestEntry* mrEntry = - (MESMRMeetingRequestEntry*)( &iEntry ); + (MESMRMeetingRequestEntry*)( calEntry ); CCalEntry::TMethod method( mrEntry->Entry().MethodL() ); @@ -1457,11 +1392,9 @@ } case EESMRCmdRemoveFromCalendar: { - TPtrC addr = DigMailboxAndRemovePrefixL(); - - if( iESMRStatic.MailBoxL( addr ).HasCapability( - EFSMBoxCapaRemoveFromCalendar ) && - iEntry.IsStoredL() ) + if( SupportsMailBoxCapabilityL( + MESMRBuilderExtension:: + EMRCFSRemoveFromCalendar ) ) { aMenuPane->SetItemDimmed( item.iCommandId, @@ -1479,7 +1412,7 @@ { aMenuPane->SetItemDimmed( item.iCommandId, - !iPolicy->IsDefaultCommand( + !currentPolicy.IsDefaultCommand( item.iCommandId) ); break; } @@ -1487,17 +1420,46 @@ } else { - if ( EESMRCmdRemoveFromCalendar == item.iCommandId ) - { - aMenuPane->SetItemDimmed( - EESMRCmdRemoveFromCalendar, - ETrue ); - } - else - { - aMenuPane->SetItemDimmed( - item.iCommandId, - !iPolicy->IsDefaultCommand( item.iCommandId) ); + if( mrEntry->OccursInPastL() || + mrEntry->IsEntryOutOfDateL() || + mrEntry->IsMeetingCancelledL() ) + { + if( item.iCommandId == EESMRCmdAcceptMR || + item.iCommandId == EESMRCmdTentativeMR || + item.iCommandId == EESMRCmdDeclineMR ) + { + aMenuPane->SetItemDimmed( + item.iCommandId, + ETrue ); + } + else if ( EESMRCmdRemoveFromCalendar == item.iCommandId && + mrEntry->IsOpenedFromMail() ) + { + aMenuPane->SetItemDimmed( + EESMRCmdRemoveFromCalendar, + EFalse ); + } + else + { + aMenuPane->SetItemDimmed( + item.iCommandId, + !currentPolicy.IsDefaultCommand( item.iCommandId) ); + } + } + else + { + if ( EESMRCmdRemoveFromCalendar == item.iCommandId ) + { + aMenuPane->SetItemDimmed( + EESMRCmdRemoveFromCalendar, + ETrue ); + } + else + { + aMenuPane->SetItemDimmed( + item.iCommandId, + !currentPolicy.IsDefaultCommand( item.iCommandId) ); + } } } if ( EESMRRoleOrganizer == mrEntry->RoleL()) @@ -1508,7 +1470,9 @@ { TInt count(0); - if ( SupportsAttendeeStatusL() ) + if ( SupportsMailBoxCapabilityL( + MESMRBuilderExtension:: + EMRCFSAttendeeStatus ) ) { count = mrEntry->AttendeeCountL(EESMRRoleRequiredAttendee)+ mrEntry->AttendeeCountL(EESMRRoleOptionalAttendee); @@ -1531,15 +1495,15 @@ aMenuPane->SetItemDimmed( item.iCommandId, - !iPolicy->IsDefaultCommand( item.iCommandId) ); + !currentPolicy.IsDefaultCommand( item.iCommandId) ); } - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryTodo ) + if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryTodo ) { - if (iPolicy->IsDefaultCommand(EESMRCmdTodoMarkAsDone)) + if (currentPolicy.IsDefaultCommand( EESMRCmdTodoMarkAsDone ) ) { TBool dim(EFalse); - if( iEntry.Entry().StatusL() == CCalEntry::ETodoCompleted ) + if( calEntry->Entry().StatusL() == CCalEntry::ETodoCompleted ) { dim = ETrue; } @@ -1555,33 +1519,40 @@ // CESMRViewerDialog::SupportsAttendeeStatusL // --------------------------------------------------------------------------- // -TBool CESMRViewerDialog::SupportsAttendeeStatusL( ) +TBool CESMRViewerDialog::SupportsMailBoxCapabilityL( + MESMRBuilderExtension::TMRCFSMailBoxCapability aCapa ) { FUNC_LOG; - TBool supportsAttendeeStatus(EFalse); + TBool supportsCapability( EFalse ); CESMRFieldBuilderInterface* plugin = NULL; - TRAPD( error, - plugin = CESMRFieldBuilderInterface::CreatePluginL( + TRAPD( error, + plugin = CESMRFieldBuilderInterface::CreatePluginL( TUid::Uid(KESMRUIFieldBuilderPluginImplUId) ) ); CleanupStack::PushL( plugin ); - + if (error == KErrNone && plugin) { TUid uid = {0}; - MESMRBuilderExtension* extension = - static_cast( plugin->ExtensionL(uid) ); + MESMRBuilderExtension* extension = + static_cast( plugin->ExtensionL(uid) ); - if (extension) + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + + if ( extension && MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type()) { - supportsAttendeeStatus = - extension->CFSMailBoxCapabilityL( - MESMRBuilderExtension::EMRCFSAttendeeStatus); + // Static cast is safe here. We know for sure that entry is MR + MESMRMeetingRequestEntry* mrEntry = + static_cast( calEntry ); + + supportsCapability = extension->CFSMailBoxCapabilityL( + mrEntry->Entry().PhoneOwnerL()->Address(), + aCapa ); } } CleanupStack::PopAndDestroy( plugin ); - return supportsAttendeeStatus; + return supportsCapability; } // --------------------------------------------------------------------------- @@ -1592,10 +1563,10 @@ { FUNC_LOG; TBool deleteEntry( EFalse ); - + TBool queryAvailable( ETrue ); - - // disable EESMRRemoveAppointment query if exiting dialog + + // disable EESMRRemoveAppointment query if exiting dialog // through email-based option menu command, switch ( aCommand ) { @@ -1606,28 +1577,48 @@ case EESMRCmdMailCopyMessage: // Fall through case EESMRCmdMailMoveMessageToDrafts: // Fall through case EESMRCmdMailComposeMessage: // Fall through - case EESMRCmdMailMessageDetails: // Fall through - case EESMRCmdForward: + case EESMRCmdMailMessageDetails: + case EESMRCmdForwardAsMeeting: // Fall through + case EESMRCmdForwardAsMail: { queryAvailable = EFalse; break; } + case EAknSoftkeyClose: + { + queryAvailable = EFalse; + break; + } default: break; } - - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry.Type() ) + + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) { - MESMRMeetingRequestEntry* mrEntry = static_cast( &iEntry ); + // Static cast is safe here. We know for sure that entry is MR + MESMRMeetingRequestEntry* mrEntry = + static_cast( calEntry ); + + // Restore the status pane layout + CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane(); + sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL); - if ( mrEntry->IsOpenedFromMail() && - queryAvailable && - EESMRRoleOrganizer != mrEntry->RoleL() && - mrEntry->IsMeetingCancelledL() && - EESMRAttendeeStatusDecline != mrEntry->AttendeeStatusL() && - CESMRConfirmationQuery::ExecuteL( CESMRConfirmationQuery::EESMRRemoveAppointment) ) + if ( mrEntry->IsOpenedFromMail() ) { - deleteEntry = ETrue; + + + if( queryAvailable && + EESMRRoleOrganizer != mrEntry->RoleL() && + ( mrEntry->IsMeetingCancelledL() || + mrEntry->IsEntryOutOfDateL() || + mrEntry->OccursInPastL() ) && + EESMRAttendeeStatusDecline != mrEntry->AttendeeStatusL() && + CESMRConfirmationQuery::ExecuteL( CESMRConfirmationQuery::EESMRRemoveAppointment) ) + { + deleteEntry = ETrue; + } } } @@ -1643,60 +1634,59 @@ if ( EESMRCmdRemoveFromCalendar == aCommand ) { - return deleteEntry; + return deleteEntry; } - + return ETrue; } // --------------------------------------------------------------------------- -// CESMRViewerDialog::SupportsForwardingAsMeetingL +// CESMRViewerDialog::HandleForwardMenuL // --------------------------------------------------------------------------- // -TBool CESMRViewerDialog::SupportsForwardingAsMeetingL( - MESMRMeetingRequestEntry* aEntry, - TBool aForceResetDefaultMRMailbox ) +void CESMRViewerDialog::HandleForwardMenuL( + TInt /*aResourceId*/, + CEikMenuPane* aMenuPane ) { FUNC_LOG; - TBool sendingAsMRSupported( EFalse ); - TESMRMailPlugin currentPlugin = aEntry->CurrentPluginL(); + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + if ( calEntry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + // Because this is MR entry, it is safe to cast it. + MESMRMeetingRequestEntry* mrEntry = + (MESMRMeetingRequestEntry*)( calEntry ); - if ( EESMRIntelliSync != currentPlugin ) - { - if ( aEntry->IsOpenedFromMail() ) + __ASSERT_DEBUG( mrEntry, Panic( EESMRViewerDlgInvalidEntry) ); + + TBool mrOriginatingEnabled( EFalse ); + TESMRMailPlugin currentPlugin = mrEntry->CurrentPluginL(); + + if ( EESMRIntelliSync == currentPlugin ) { - // Set default MR mail box to the one used for this MR - // unless if it already is set - CMRMailboxUtils* mbUtils = CMRMailboxUtils::NewL(); - CleanupStack::PushL( mbUtils ); - TInt currentEntryId = AccountIdL( aEntry->CurrentMailBoxIdL() ); - CMRMailboxUtils::TMailboxInfo mrMailboxInfo; - mbUtils->GetDefaultMRMailBoxL( mrMailboxInfo ); - if ( mrMailboxInfo.iEntryId != currentEntryId ) - { - mbUtils->SetDefaultMRMailBoxL( currentEntryId ); - } - CleanupStack::PopAndDestroy( mbUtils ); - + mrOriginatingEnabled = EFalse; + } + else if ( mrEntry->IsOpenedFromMail() ) + { // When opened from email, we need to make sure that // meeting request sending is possible - CESMRFieldBuilderInterface* plugin = + CESMRFieldBuilderInterface* plugin = NULL; + TRAPD( error, plugin = CESMRFieldBuilderInterface::CreatePluginL( - TUid::Uid( KESMRUIFieldBuilderPluginImplUId ) ); + TUid::Uid(KESMRUIFieldBuilderPluginImplUId)) ); + CleanupDeletePushL( plugin ); - if ( plugin ) + if (error == KErrNone && plugin) { TUid uid = {0}; MESMRBuilderExtension* extension = static_cast( - plugin->ExtensionL( uid ) ); + plugin->ExtensionL(uid) ); - if ( extension ) + if (extension) { - sendingAsMRSupported = - extension->MRCanBeOriginateedL( - aForceResetDefaultMRMailbox ); + mrOriginatingEnabled = + extension->MRCanBeOriginateedL(); } } CleanupStack::PopAndDestroy( plugin ); @@ -1704,14 +1694,15 @@ } else { - sendingAsMRSupported = ETrue; + mrOriginatingEnabled = ETrue; } - } - return sendingAsMRSupported; + aMenuPane->SetItemDimmed( + EESMRCmdForwardAsMeeting, + !mrOriginatingEnabled ); + } } - // --------------------------------------------------------------------------- // CESMRViewerDialog::LocationPluginHandlerL // --------------------------------------------------------------------------- @@ -1723,46 +1714,27 @@ { iLocationPluginHandler = CESMRLocationPluginHandler::NewL( *this ); } - + return *iLocationPluginHandler; } // --------------------------------------------------------------------------- -// CESMRViewerDialog::LocationPluginHandlerL +// CESMRViewerDialog::HandleFieldEventL // --------------------------------------------------------------------------- // void CESMRViewerDialog::HandleFieldEventL( const MESMRFieldEvent& aEvent ) { FUNC_LOG; - if ( aEvent.Type() == MESMRFieldEvent::EESMRFieldCommandEvent ) + + MESMRFieldEvent::TEventType type( aEvent.Type() ); + + if ( MESMRFieldEvent::EESMRFieldCommandEvent == type ) { - TInt* command = static_cast< TInt* >( aEvent.Param( 0 ) ); - - switch ( *command ) - { - case EESMRCmdRestoreMiddleSoftKey: - { - SetDefaultMiddleSoftKeyL(); - ButtonGroupContainer().DrawDeferred(); - break; - } - case EESMRCmdOpenAttachment:// Fall through - case EESMRCmdOpenAttachmentView:// Fall through - case EESMRCmdDownloadAttachment: // Fall through - case EESMRCmdDownloadAllAttachments: // Fall through - case EESMRCmdSaveAttachment: // Fall through - case EESMRCmdSaveAllAttachments: // Fall through - case EESMRCmdMskOpenEmailAttachment: - { - ProcessCommandL( *command ); - - break; - } - default: - { - break; - } - } + ProcessCommandEventL( aEvent ); + } + else if ( MESMRFieldEvent::EESMRFieldChangeEvent == type ) + { + ProcessFieldEventL( aEvent ); } } @@ -1774,10 +1746,14 @@ { FUNC_LOG; TInt resourceId = KErrNotFound; - if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == iEntry.Type() ) + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + const CESMRPolicy& currentPolicy( + iInfoProvider.PolicyProvider().CurrentPolicy() ); + + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) { // If 'Edit' command is not allowed then we change the MSK to 'Select' - if ( !iPolicy->IsDefaultCommand( EESMRCmdEdit ) ) + if ( !currentPolicy.IsDefaultCommand( EESMRCmdEdit ) ) { resourceId = R_MR_SELECT_SOFTKEY; // Disable middle softkey by default @@ -1790,215 +1766,205 @@ { resourceId = R_MR_EDIT_SOFTKEY; } - + } - else if ( iPolicy->IsDefaultCommand( EESMRCmdCalEntryUIEdit ) ) + else if ( currentPolicy.IsDefaultCommand( EESMRCmdCalEntryUIEdit ) ) { // Set correct edit command in MSK. Dialog resource has EESMRCmdEdit resourceId = R_MR_CAL_EDIT_SOFTKEY; } - + if ( resourceId != KErrNotFound ) { ButtonGroupContainer().SetCommandL( - CEikButtonGroupContainer::EMiddleSoftkeyPosition, + CEikButtonGroupContainer::EMiddleSoftkeyPosition, resourceId ); } } +// ----------------------------------------------------------------------------- +// CESMRViewerDialog::ShowContextMenuL +// ----------------------------------------------------------------------------- +// +void CESMRViewerDialog::ShowContextMenuL() + { + FUNC_LOG; + + if ( iMenuBar ) + { + iMenuBar->TryDisplayContextMenuBarL(); + } + } + + // --------------------------------------------------------------------------- + // CESMRViewerDialog::HandleNaviArrowEventL + // --------------------------------------------------------------------------- + // + void CESMRViewerDialog::HandleNaviArrowEventL( const TInt aCommand ) + { + FUNC_LOG; + ProcessCommandL( aCommand ); + } + + // --------------------------------------------------------------------------- + // CESMRViewerDialog::UserWantToHandleAttachmentsL + // --------------------------------------------------------------------------- + // + TBool CESMRViewerDialog::UserWantToHandleAttachmentsL() + { + TBool retValue( EFalse ); + + MESMRCalEntry* calEntry = iInfoProvider.EntryL(); + MESMRMeetingRequestEntry* mrEntry = NULL; + if ( MESMRCalEntry::EESMRCalEntryMeetingRequest == calEntry->Type() ) + { + // This is meeting request + mrEntry = static_cast( calEntry ); + + TBool openedFromEmail( mrEntry->IsOpenedFromMail() ); + + // If entry is opened from mail, contains remote attachments and + // mailbox is MfE, we show the query. + if ( openedFromEmail && mrEntry->ContainsRemoteAttachmentsL() && + mrEntry->CurrentPluginL() == EESMRActiveSync ) + { + retValue = + CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery::EESMRAttachments ); + } + } + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRViewerDialog::InitLocationMenuL +// --------------------------------------------------------------------------- +// +void CESMRViewerDialog::InitLocationMenuL( CEikMenuPane* aMenuPane ) + { + FUNC_LOG; + + aMenuPane->SetItemDimmed( EESMRCmdSearchFromMap,ETrue ); + aMenuPane->SetItemDimmed( EESMRCmdShowOnMap, ETrue ); + } + +// --------------------------------------------------------------------------- +// CESMRViewerDialog::ConstructToolbarL +// --------------------------------------------------------------------------- +// +void CESMRViewerDialog::ConstructToolbarL() + { + FUNC_LOG; + if( iInfoProvider.EntryL()->Type() == + MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + MESMRMeetingRequestEntry* entry = + static_cast( + iInfoProvider.EntryL() ); + + if( !entry->OccursInPastL() && + !entry->IsEntryOutOfDateL() && + !entry->IsMeetingCancelledL() ) + { + if ( entry->RoleL()== EESMRRoleRequiredAttendee || + entry->RoleL()== EESMRRoleOptionalAttendee ) + { + TSize screenSize = + iEikonEnv->ScreenDevice()->SizeInPixels(); + + TBool isVGA( EFalse ); + if( ( screenSize.iHeight == KVGAOneSide || + screenSize.iWidth == KVGAOneSide ) && + ( screenSize.iHeight == KVGAOtherSide || + screenSize.iWidth == KVGAOtherSide ) && + screenSize.iHeight != screenSize.iWidth ) + { + isVGA = ETrue; + } + + // Toolbar is disabled in VGA mode + if( !isVGA ) + { + // Toolbar is always shown in MR viewer when user + // is attendee + iToolbar->SetObserver( this ); + iToolbar->InitializeToolbarL( + CMRToolbar::EMRViewerAttendee ); + iToolbar->ShowToolbar( ETrue ); + + // Toolbar created, relayouting needed + iView->ReLayout(); + } + } + } + } + } + // --------------------------------------------------------------------------- -// CESMRViewerDialog::DigMailboxAndRemovePrefixL +// CESMRViewerDialog::ProcessCommandEventL // --------------------------------------------------------------------------- // -TPtrC CESMRViewerDialog::DigMailboxAndRemovePrefixL() - { - CCalUser* calUser = iEntry.Entry().PhoneOwnerL(); - TPtrC addrWithoutPrefix = calUser->Address(); - TInt pos = KErrNotFound; - - do - { - pos = addrWithoutPrefix.MatchF( KMailtoMatchPattern ); - if ( pos != KErrNotFound ) - { - addrWithoutPrefix.Set( addrWithoutPrefix.Mid( KMailtoLength ) ); - } - } - while ( pos != KErrNotFound ); - - return addrWithoutPrefix; - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::OfferToolbarEventL -// --------------------------------------------------------------------------- -// -void CESMRViewerDialog::OfferToolbarEventL( TInt aCommand ) - { - ProcessCommandL( aCommand ); - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::HandleNaviDecoratorEventL -// --------------------------------------------------------------------------- -// -void CESMRViewerDialog::HandleNaviDecoratorEventL( TInt aEventID ) +void CESMRViewerDialog::ProcessCommandEventL( const MESMRFieldEvent& aEvent ) { FUNC_LOG; - if ( iESMRNaviDecorator ) - { - iESMRNaviDecorator->SetNaviDecoratorObserver( NULL ); - } - if ( iIdleNaviEventRunner && !iIdleNaviEventRunner->IsActive() ) - { - if( aEventID == - MAknNaviDecoratorObserver::EAknNaviDecoratorEventRightTabArrow ) - { - iIdleNaviEventRunner->Start( - TCallBack( RunCmdMailNextMessageIdle, this ) ); - } - else - { - iIdleNaviEventRunner->Start( - TCallBack( RunCmdMailPreviousMessageIdle, this ) ); - } - } - } - + + TInt* command = static_cast< TInt* >( aEvent.Param( 0 ) ); -// --------------------------------------------------------------------------- -// CESMRViewerDialog::HandleSessionEventL -// --------------------------------------------------------------------------- -// -void CESMRViewerDialog::HandleSessionEventL( - TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, - TAny* /*aArg2*/, TAny* /*aArg3*/ ) - { - FUNC_LOG; - } - - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::RunCmdMailNextMessageIdle [static] -// --------------------------------------------------------------------------- -// -TInt CESMRViewerDialog::RunCmdMailNextMessageIdle( TAny* aObjPtr ) - { - CESMRViewerDialog* self = - reinterpret_cast( aObjPtr ); - if ( self ) + switch ( *command ) { - TRAP_IGNORE( self->ProcessCommandL( EESMRCmdMailNextMessage ) ); - } - return KErrNone; + case EESMRCmdRestoreMiddleSoftKey: + { + SetDefaultMiddleSoftKeyL(); + ButtonGroupContainer().DrawDeferred(); + break; + } + case EESMRCmdEdit: // Fall through + case EESMRCmdViewTrack: // Fall through + case EESMRCmdOpenAttachment:// Fall through + case EESMRCmdOpenAttachmentView:// Fall through + case EESMRCmdDownloadAttachment: // Fall through + case EESMRCmdDownloadAllAttachments: // Fall through + case EESMRCmdSaveAttachment: // Fall through + case EESMRCmdSaveAllAttachments: // Fall through + case EESMRCmdMskOpenEmailAttachment: // Fall through + case EESMRCmdSearchFromMap: // Fall through + case EESMRCmdShowOnMap: + case EMRCmdHideAttachmentIndicator: + { + ProcessCommandL( *command ); + break; + } + case EMRLaunchAttachmentContextMenu: + case EAknSoftkeyContextOptions: + { + SetContextMenu(); + ShowContextMenuL(); + break; + } + case EESMRCmdAcceptMR: + case EESMRCmdTentativeMR: + case EESMRCmdDeclineMR: + case EESMRCmdRemoveFromCalendar: + { + ProcessCommandL( *command ); + } + break; + default: + { + break; + } + } } // --------------------------------------------------------------------------- -// CESMRViewerDialog::RunCmdMailPreviousMessageIdle [static] -// --------------------------------------------------------------------------- -// -TInt CESMRViewerDialog::RunCmdMailPreviousMessageIdle( TAny* aObjPtr ) - { - CESMRViewerDialog* self = - reinterpret_cast( aObjPtr ); - if ( self ) - { - TRAP_IGNORE( self->ProcessCommandL( EESMRCmdMailPreviousMessage ) ); - } - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::MakeMrGuiToolbarButtonsL -// --------------------------------------------------------------------------- -// -void CESMRViewerDialog::MakeMrGuiToolbarButtonsL() - { - CAknToolbar* currentToolbar = static_cast( - iEikonEnv->AppUiFactory() )->CurrentFixedToolbar(); - if ( currentToolbar ) - { - iOldObserver = currentToolbar->ToolbarObserver(); - currentToolbar->SetToolbarObserver( this ); - - TBool setResponseButtons = EFalse; - if ( iEntry.Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) - { - CCalEntry::TMethod method = iEntry.Entry().MethodL(); - if ( method != CCalEntry::EMethodCancel ) - { - setResponseButtons = ETrue; - } - } - - if ( setResponseButtons ) - { - SetResponseButtonsL( currentToolbar ); - } - else - { - SetEmptyButtonsL( currentToolbar ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::ClearToolbarL +// CESMRViewerDialog::ProcessFieldEventL // --------------------------------------------------------------------------- // -void CESMRViewerDialog::ClearToolbarL() - { - if ( iClearToolbar ) - { - // creating empty toolbar buttons - CAknToolbar* currentToolbar = static_cast( - iEikonEnv->AppUiFactory() )->CurrentFixedToolbar(); - if ( currentToolbar ) - { - SetEmptyButtonsL( currentToolbar ); - } - } - } - -// --------------------------------------------------------------------------- -// CESMRViewerDialog::AccountIdL -// --------------------------------------------------------------------------- -// -TInt CESMRViewerDialog::AccountIdL( const TFSMailMsgId& aMailboxId ) +void CESMRViewerDialog::ProcessFieldEventL( const MESMRFieldEvent& aEvent ) { - FUNC_LOG; - - CMsvSession* msvSession = CMsvSession::OpenSyncL( *this ); - CleanupStack::PushL( msvSession ); - CMsvEntry* rootEntry = msvSession->GetEntryL( KMsvRootIndexEntryIdValue ); - CleanupStack::PushL( rootEntry ); - - rootEntry->SetSortTypeL( - TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) ); - - TInt accountId = 0; - TBool found = EFalse; - const TInt count = rootEntry->Count(); - for ( TInt ii = 0; ii < count && !found; ++ii ) - { - const TMsvEntry& entry = (*rootEntry)[ii]; - if ( entry.iType == KUidMsvServiceEntry ) - { - if ( entry.iMtmData1 == aMailboxId.PluginId().iUid && - entry.iMtmData2 == aMailboxId.Id() ) - { - accountId = entry.Id(); - found = ETrue; - } - } - } - - if ( !found ) - { - User::Leave( KErrNotFound ); - } - - CleanupStack::PopAndDestroy( rootEntry ); - CleanupStack::PopAndDestroy( msvSession ); - return accountId; + FUNC_LOG; + iView->ProcessEventL( aEvent ); } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cesmrviewerfieldstorage.cpp --- a/meetingrequest/mrgui/src/cesmrviewerfieldstorage.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrviewerfieldstorage.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -12,7 +12,7 @@ * Contributors: * * Description : Storage for viewer fields -* Version : %version: tr1sido#6 % +* Version : %version: e002sa33#8 % * */ @@ -65,7 +65,7 @@ // --------------------------------------------------------------------------- // CESMRViewerFieldStorage* CESMRViewerFieldStorage::NewL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady, MESMRFieldEventObserver& aEventObserver, @@ -88,7 +88,7 @@ // --------------------------------------------------------------------------- // void CESMRViewerFieldStorage::ConstructL( - CESMRPolicy* aPolicy, + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady, const TInt &aReqAttendee, @@ -127,14 +127,15 @@ // CESMRViewerFieldStorage::CreatePolicyFieldsL // --------------------------------------------------------------------------- // -void CESMRViewerFieldStorage::CreatePolicyFieldsL(CESMRPolicy* aPolicy, +void CESMRViewerFieldStorage::CreatePolicyFieldsL( + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady) { FUNC_LOG; CESMRField* field = NULL; - RArray fields = aPolicy->Fields(); + RArray fields = aPolicy.Fields(); const TInt count = fields.Count(); for ( TInt i(0); i < count ; i++ ) { @@ -142,31 +143,7 @@ aResponseObserver, fields[i], aResponseReady ); TBool visible( ETrue ); - - switch ( fields[i].iFieldId ) - { - case EESMRFieldResponseArea: - { - if ( aResponseReady ) - { - visible = EFalse; - } - break; - } - case EESMRFieldResponseReadyArea: - { - if ( !aResponseReady ) - { - visible = EFalse; - } - break; - } - default: - { - break; - } - } - + CleanupStack::PushL( field ); AddFieldL( field, visible ); CleanupStack::Pop( field ); @@ -177,7 +154,8 @@ // CESMRViewerFieldStorage::CreateTrackingFieldsL // --------------------------------------------------------------------------- // -void CESMRViewerFieldStorage::CreateTrackingFieldsL(CESMRPolicy* aPolicy, +void CESMRViewerFieldStorage::CreateTrackingFieldsL( + const CESMRPolicy& aPolicy, MESMRResponseObserver* aResponseObserver, TBool aResponseReady, const TInt &aReqAttendee, @@ -185,7 +163,7 @@ { FUNC_LOG; CESMRField* field = NULL; - RArray fields = aPolicy->Fields(); + RArray fields = aPolicy.Fields(); if (aReqAttendee > 0) { diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrasynchcmd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrasynchcmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Asynch command notifier +* +*/ +#include "cmrasynchcmd.h" + +#include + +// --------------------------------------------------------------------------- +// CMRAsynchCmd::NewL +// --------------------------------------------------------------------------- +// +CMRAsynchCmd* CMRAsynchCmd::NewL() + { + CMRAsynchCmd* self = new (ELeave) CMRAsynchCmd(); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAsynchCmd::~CMRAsynchCmd +// --------------------------------------------------------------------------- +// +CMRAsynchCmd::~CMRAsynchCmd() + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CMRAsynchCmd::NotifyObserver +// --------------------------------------------------------------------------- +// +void CMRAsynchCmd::NotifyObserver( TInt aCmd, MAknToolbarObserver* aObserver ) + { + iCommand = aCmd; + iObserver = aObserver; + Call(); + } + +// --------------------------------------------------------------------------- +// CMRAsynchCmd::CMRAsynchCmd +// --------------------------------------------------------------------------- +// +CMRAsynchCmd::CMRAsynchCmd() +: CAsyncOneShot( CActive::EPriorityStandard ) + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRAsynchCmd::RunL +// --------------------------------------------------------------------------- +// +void CMRAsynchCmd::RunL() + { + if( iObserver ) + { + iObserver->OfferToolbarEventL( iCommand ); + } + } + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrattachmentindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrattachmentindicator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,405 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment indicator implementation +* +*/ + +#include "cmrattachmentindicator.h" + +#include +#include +#include +#include + +namespace +{ +const TInt KImageMargin = 8; +const TInt KTextMargin = 4; +const TInt KRoundBoundaryEllipse = 5; +const TInt KTruncationCharsWidth = 20; +} + + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::CMRAttachmentIndicator +// --------------------------------------------------------------------------- +// +CMRAttachmentIndicator::CMRAttachmentIndicator() + : iBitmap( NULL ), + iMaskBitmap( NULL ), + iText( NULL ), + iVisualText( NULL ), + iTextFont( NULL ) + { + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::~CMRAttachmentIndicator +// --------------------------------------------------------------------------- +// +CMRAttachmentIndicator::~CMRAttachmentIndicator() + { + ClearImage(); + ClearText(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::CMRAttachmentIndicator +// --------------------------------------------------------------------------- +// +CMRAttachmentIndicator* CMRAttachmentIndicator::NewL( + const TRect& aRect, + const CCoeControl* aParent ) + { + CMRAttachmentIndicator* self = new (ELeave) CMRAttachmentIndicator(); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aParent ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ConstructL +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::ConstructL( + const TRect& aRect, + const CCoeControl* aParent ) + { + CreateWindowL( aParent ); + + SetRect( aRect ); + ActivateL(); + + MakeVisible( EFalse ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ShowIndicatorL +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::ShowIndicatorL( + CFbsBitmap* aBitmap, + CFbsBitmap* aMaskBitmap, + const TDesC& aText, + TInt /*aDuration*/ ) + { + SetImage( aBitmap, aMaskBitmap ); + SetTextL( aText ); + + MakeVisible( ETrue ); + DrawNow(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::SetTextL +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::SetTextL( const TDesC& aText ) + { + SetTextFont(); + + ClearText(); + + iText = aText.AllocL(); + if ( aText.Length() ) + { + iVisualText = HBufC::NewL( aText.Length() + KAknBidiExtraSpacePerLine ); + CalculateVisualText(); + } + + if ( IsVisible() ) + { + DrawNow(); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::SetImage +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::SetImage( + CFbsBitmap* aBitmap, + CFbsBitmap* aMaskBitmap ) + { + ClearImage(); + iBitmap = aBitmap; + iMaskBitmap = aMaskBitmap; + ScaleImage(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::HideIndicator +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::HideIndicator( TInt aDelayBeforeHidingInMs ) + { + if ( aDelayBeforeHidingInMs == 0 ) + { + MakeVisible( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRAttachmentIndicator::CMRAttachmentIndicator::ComponentControl( TInt /*aIndex*/ ) const + { + return NULL; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRAttachmentIndicator::CountComponentControls() const + { + return 0; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::Draw +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::Draw( const TRect& aRect ) const + { + CWindowGc& gc = SystemGc(); + gc.Clear( aRect ); + + DrawBoundary( aRect ); + DrawImage( iImageRect ); + DrawText( iTextRect ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::SizeChanged() + { + CalculateLayout( Rect() ); + ScaleImage(); + CalculateVisualText(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::Image +// --------------------------------------------------------------------------- +// +const CFbsBitmap* CMRAttachmentIndicator::Image() const + { + return iBitmap; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ImageMask +// --------------------------------------------------------------------------- +// +const CFbsBitmap* CMRAttachmentIndicator::ImageMask() const + { + return iMaskBitmap; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::Text +// --------------------------------------------------------------------------- +// +const TDesC& CMRAttachmentIndicator::Text() const + { + return *iText; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::CalculateLayout +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::CalculateLayout( const TRect& aRect ) const + { + TSize imageSize = aRect.Size(); + imageSize.iHeight = imageSize.iHeight - 2 * KImageMargin; + imageSize.iWidth = imageSize.iWidth - 2 * KImageMargin; + if ( imageSize.iWidth > imageSize.iHeight ) + { + imageSize.iWidth = imageSize.iHeight; + } + else + { + imageSize.iHeight = imageSize.iWidth; + } + + TSize textSize = aRect.Size(); + textSize.iHeight = textSize.iHeight - 2 * KTextMargin; + textSize.iWidth = textSize.iWidth - 2 * KTextMargin - 2 * KImageMargin - imageSize.iWidth; + + TLanguage language = User::Language(); + TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language ); + if ( direction == TBidiText::ELeftToRight ) + { + TPoint imageLeftTop ( aRect.iTl.iX + KImageMargin, aRect.iTl.iY + KImageMargin ); + iImageRect.SetRect( imageLeftTop, imageSize ); + + TPoint textLeftTop ( aRect.iTl.iX + 2*KImageMargin + imageSize.iWidth + KTextMargin, aRect.iTl.iY + KTextMargin ); + iTextRect.SetRect( textLeftTop, textSize ); + } + else + { + TPoint imageLeftTop ( aRect.iBr.iX - KImageMargin - imageSize.iWidth, aRect.iTl.iY + KImageMargin ); + iImageRect.SetRect( imageLeftTop, imageSize ); + + TPoint textLeftTop ( aRect.iTl.iX + KTextMargin, aRect.iTl.iY + KTextMargin ); + iTextRect.SetRect( textLeftTop, textSize ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::SetTextFont +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::SetTextFont() const + { + if ( iTextFont ) + return; + + const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); + iTextFont = CONST_CAST( CFont*, font ); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::CalculateVisualText +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::CalculateVisualText() const + { + if ( iVisualText ) + { + TPtr visualText = iVisualText->Des(); + visualText.Zero(); + TInt MaxWidthInPixels = iTextRect.Size().iWidth - KTruncationCharsWidth; + TInt MaxClippedWidthInPixels = iTextRect.Size().iWidth; + AknBidiTextUtils::ConvertToVisualAndClip( *iText, + visualText, + *iTextFont, + MaxWidthInPixels, + MaxClippedWidthInPixels ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::DrawBoundary +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::DrawBoundary( const TRect& aRect ) const + { + CWindowGc& gc = SystemGc(); + gc.SetPenColor( KRgbCyan ); + TSize ellipse( KRoundBoundaryEllipse, KRoundBoundaryEllipse ); + gc.DrawRoundRect( aRect, ellipse); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::DrawImage +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::DrawImage( const TRect& aRect ) const + { + if ( !iBitmap ) + return; + + CWindowGc& gc = SystemGc(); + if ( iMaskBitmap ) + { + TRect bmpPieceRect(TPoint(0,0), aRect.Size() ); + gc.BitBltMasked( aRect.iTl, iBitmap, bmpPieceRect, iMaskBitmap, EFalse ); + } + else + { + gc.DrawBitmap( aRect, iBitmap ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::DrawText +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::DrawText( const TRect& aRect ) const + { + if ( !iVisualText ) + return; + if ( iVisualText->Length() == 0 ) + return; + + TLanguage language = User::Language(); + TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language ); + + CGraphicsContext::TTextAlign alignment = CGraphicsContext::ELeft; + if ( direction == TBidiText::ERightToLeft ) + { + alignment = CGraphicsContext::ERight; + } + + CWindowGc& gc = SystemGc(); + gc.UseFont( iTextFont ); + + TInt baseline = aRect.Height() / 2 + iTextFont->FontMaxAscent() / 2; + + gc.SetPenColor(KRgbBlack); + + gc.DrawText( *iVisualText, aRect, baseline, alignment, 0); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ScaleImage +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::ScaleImage() const + { + if ( iBitmap ) + { + AknIconUtils::DisableCompression( iBitmap ); + AknIconUtils::SetSize( iBitmap, iImageRect.Size(), EAspectRatioPreserved ); + } + if ( iMaskBitmap ) + { + AknIconUtils::DisableCompression( iMaskBitmap ); + AknIconUtils::SetSize( iMaskBitmap, iImageRect.Size(), EAspectRatioPreserved ); + } + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ClearImage +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::ClearImage() + { + delete iBitmap; + iBitmap = NULL; + delete iMaskBitmap; + iMaskBitmap = NULL; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentIndicator::ClearText +// --------------------------------------------------------------------------- +// +void CMRAttachmentIndicator::ClearText() + { + delete iText; + iText = NULL; + + delete iVisualText; + iVisualText = NULL; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrfieldcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrfieldcontainer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,1007 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Field container for UI fields +* +*/ +#include "cmrfieldcontainer.h" +#include "mesmrfieldstorage.h" +#include "mmrfieldcontainerobserver.h" +#include "cesmrfield.h" + +//DEBUG +#include "emailtrace.h" + +namespace { // codescanner::namespace + +/** + * Vertical scroll margin + */ +const TInt KVerticalScrollMargin = 3; + + +// ---------------- +// IndexByFieldId +// ---------------- +// +TInt IndexByFieldId( const MESMRFieldStorage& aFactory, + TESMREntryFieldId aFieldId ) + { + TInt index( KErrNotFound ); + TInt count( aFactory.Count() ); + + for ( TInt i = 0; i < count; ++i ) + { + if ( aFactory.Field( i )->FieldId() == aFieldId ) + { + index = i; + break; + } + } + + return index; + } +} + +//----- MEMBER FUNCTIONS ---- + +// --------------------------------------------------------------------------- +// CMRFieldContainer::CMRFieldContainer +// --------------------------------------------------------------------------- +// +CMRFieldContainer::CMRFieldContainer( MESMRFieldStorage& aFactory ) + : iFactory( aFactory ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::~CMRFieldContainer +// --------------------------------------------------------------------------- +// +CMRFieldContainer::~CMRFieldContainer() + { + FUNC_LOG; + // No implementation + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::NewL +// --------------------------------------------------------------------------- +// +CMRFieldContainer* CMRFieldContainer::NewL( + MESMRFieldStorage& aFactory, + const CCoeControl& aParent ) + { + FUNC_LOG; + CMRFieldContainer* self = new( ELeave )CMRFieldContainer( aFactory ); + CleanupStack::PushL( self ); + self->ConstructL( aParent ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ConstructL +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::ConstructL( const CCoeControl& aParent ) + { + FUNC_LOG; + CCoeControl::SetComponentsToInheritVisibility( ETrue ); + SetContainerWindowL( aParent ); + + TBool focusSet( EFalse ); + const TInt count( iFactory.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + iFactory.Field(i)->SetContainerWindowL( *this ); + } + + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + // Initialize field + field->InitializeL(); + User::LeaveIfError( field->SetParent( this ) ); + + if ( !focusSet + && field->IsVisible() + && !field->IsNonFocusing()) + { + field->SetOutlineFocusL( ETrue ); + focusSet = ETrue; + iFocusedFieldIndex = i; + } + } + + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + field->SetListObserver( this ); + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::FocusedItem +// --------------------------------------------------------------------------- +// +CESMRField* CMRFieldContainer::FocusedField() const + { + FUNC_LOG; + /* + * Returns currently focused field + */ + CESMRField* field = NULL; + if ( iFactory.Count() > 0 ) + { + field = iFactory.Field( iFocusedFieldIndex ); + } + return field; + } + + +// --------------------------------------------------------------------------- +// CMRFieldContainer::MoveFocusUpL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRFieldContainer::MoveFocusUpL( TBool aHiddenFocus ) + { + FUNC_LOG; + /* + * Moves focus up after key event. If aHiddenFocus, moves focus + * to the first visible field in the bottom of the viewable area. + */ + + if( aHiddenFocus ) + { + return MoveFocusVisibleL(); + } + else + { + TInt ind( iFocusedFieldIndex ); + + // search next visible focus item + while ( ind > 0 ) + { + CESMRField* field = iFactory.Field( --ind ); + + if ( !field->IsNonFocusing() ) + { + field = iFactory.Field( ind ); + + CESMRField* focusedField = iFactory.Field( iFocusedFieldIndex ); + if ( field->IsVisible() ) + { + TBool canLoseFocus( + focusedField->OkToLoseFocusL( field->FieldId() ) ); + + if ( canLoseFocus ) + { + field->SetPreItemIndex( iFocusedFieldIndex ); + iFocusedFieldIndex = ind; + field->SetCurrentItemIndex( iFocusedFieldIndex ); + + // Remove focus from previous position + focusedField->SetOutlineFocusL( EFalse ); + focusedField->SetFocus( EFalse ); + + // Set focus to new position + field->SetOutlineFocusL( ETrue ); + field->SetFocus( ETrue ); + + // Scrollbar and physics update is done here + ScrollControlVisible( iFocusedFieldIndex ); + + DrawDeferred(); + } + + return EKeyWasConsumed; + } + } + } + return EKeyWasNotConsumed; + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::MoveFocusDownL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRFieldContainer::MoveFocusDownL( TBool aHiddenFocus ) + { + FUNC_LOG; + /* + * Moves focus down after key event. If aHiddenFocus, moves focus + * to the first visible field in the top of the viewable area. + */ + + if( aHiddenFocus ) + { + return MoveFocusVisibleL(); + } + else + { + TInt ind( iFocusedFieldIndex ); + + // start searching next possible focus item + TInt maxItemIndex = iFactory.Count() - 1; + + while ( ind < maxItemIndex ) + { + // only visible and focusable items can be focused + CESMRField* field = iFactory.Field( ++ind ); + + if ( field->IsVisible() && !field->IsNonFocusing() ) + { + CESMRField* focusedField = iFactory.Field( iFocusedFieldIndex ); + + TBool canLoseFocus( + focusedField->OkToLoseFocusL( field->FieldId() ) ); + + // check it its ok for the old focus item to lose focus + if ( canLoseFocus ) + { + field->SetPreItemIndex( iFocusedFieldIndex ); + iFocusedFieldIndex = ind; + field->SetCurrentItemIndex( iFocusedFieldIndex ); + + // Remove focus from previous position + focusedField->SetOutlineFocusL( EFalse ); + focusedField->SetFocus( EFalse ); + + // Set focus to new position + field->SetOutlineFocusL( ETrue ); + field->SetFocus( ETrue ); + + // Scrollbar and physics update is done here + ScrollControlVisible( iFocusedFieldIndex ); + + DrawDeferred(); + } + + return EKeyWasConsumed; + } + } + return EKeyWasNotConsumed; + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::MoveFocusVisibleL +// --------------------------------------------------------------------------- +// +TKeyResponse CMRFieldContainer::MoveFocusVisibleL() + { + FUNC_LOG; + /* + * Move focus to first completely visible field in the view, + * if focus was in a field that was not visible in the view. + * Use case: After pointer scroll focus is hidden. User presses + * arrow keys -> Focus appears to the first visible field on the upper + * or bottom part of the viewable area. + */ + + TKeyResponse response( EKeyWasNotConsumed ); + + CESMRField* focusedField = FocusedField(); + CESMRField* visibleField = NULL; + TRect view( Parent()->Rect() ); + + // Focus is above the visible view area + if ( focusedField->Rect().iBr.iY <= view.iTl.iY ) + { + // Move focus to next visible field + TInt lastIndex = iFactory.Count() - 1; + TInt ind( iFocusedFieldIndex ); + while ( ind < lastIndex && !visibleField ) + { + visibleField = iFactory.Field( ++ind ); + TRect fieldRect = visibleField->Rect(); + if ( visibleField->IsVisible() + && !visibleField->IsNonFocusing() + && fieldRect.iTl.iY >= view.iTl.iY ) + { + // Update previous and current field indexes + visibleField->SetPreItemIndex( iFocusedFieldIndex ); + iFocusedFieldIndex = ind; + visibleField->SetCurrentItemIndex( iFocusedFieldIndex ); + } + else + { + visibleField = NULL; + } + } + } + // Focus is below the visible view area + else + { + // Move focus to previous visible field + TInt ind( iFocusedFieldIndex ); + while ( ind > 0 && !visibleField ) + { + visibleField = iFactory.Field( --ind ); + TRect fieldRect = visibleField->Rect(); + if ( visibleField->IsVisible() + && !visibleField->IsNonFocusing() + && fieldRect.iBr.iY <= view.iBr.iY ) + { + // Update previous and current field indexes + visibleField->SetPreItemIndex( iFocusedFieldIndex ); + iFocusedFieldIndex = ind; + visibleField->SetCurrentItemIndex( iFocusedFieldIndex ); + } + else + { + visibleField = NULL; + } + } + } + + if ( visibleField ) + { + // Remove existing focus + focusedField->SetOutlineFocusL( EFalse ); + focusedField->SetFocus( EFalse ); + + // Set focus to new field + visibleField->SetOutlineFocusL( ETrue ); + visibleField->SetFocus( ETrue ); + + response = EKeyWasConsumed; + + DrawDeferred(); + } + + return response; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::SetFieldContainerObserver +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::SetFieldContainerObserver( + MMRFieldContainerObserver* aObserver ) + { + FUNC_LOG; + iObserver = aObserver; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::CountComponentControls +// --------------------------------------------------------------------------- +// +TInt CMRFieldContainer::CountComponentControls() const + { + FUNC_LOG; + return iFactory.Count(); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ComponentControl +// --------------------------------------------------------------------------- +// +CCoeControl* CMRFieldContainer::ComponentControl( TInt aIndex ) const + { + FUNC_LOG; + return iFactory.Field( aIndex ); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::MinimumSize +// --------------------------------------------------------------------------- +// +TSize CMRFieldContainer::MinimumSize() + { + FUNC_LOG; + /* + * Returns the minimum size required by the field container + */ + + TSize containerSize; + + const TInt count( iFactory.Count() ); + + for ( TInt i(0); i < count; ++i ) + { + CESMRField* field = iFactory.Field( i ); + if ( field->IsVisible() ) + { + TRect rect( field->Rect() ); + containerSize.iHeight += rect.Height(); + } + } + + containerSize.iWidth = Parent()->Rect().Width(); + + return containerSize; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::SizeChanged() + { + FUNC_LOG; + + // TEST CODE: + TRect fieldcontainerRect = Rect(); + TRect parentRect = Parent()->Rect(); + + + // For example when orientation changes, we might need to scroll + // the currently focused control visible again. This handles also + // scrollbar and physics updates. + ScrollControlVisible( KErrNotFound ); + + TPoint tl( Position() ); + + const TInt count( iFactory.Count() ); + + // Loop all the visible fields and set size and position in the list + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + if ( field->IsVisible() ) + { + LayoutField( *field, tl ); + + TInt height = field->Size().iHeight; + tl.iY += height; + } + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ControlSizeChanged +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::ControlSizeChanged( CESMRField* aField ) + { + FUNC_LOG; + /* + * Called whenever a fields size has changed. Requires always + * relayouting. + */ + + if ( !aField ) + { + SizeChanged(); + } + else + { + // Relayout field if size has changed + TSize old( aField->Size() ); + TSize size( aField->MinimumSize() ); + if( size != old ) + { + aField->SetSize( size ); + + TPoint tl( aField->Position() ); + TInt index = IndexByFieldId( iFactory, aField->FieldId() ); + + // Move fields below this particular field + tl.iY += size.iHeight; + MoveFields( index + 1, tl ); + + // Fields have been re-layouted / moved. This requires resetting + // the size of this field container. + SetSize( MinimumSize() ); + + // Update also scrollbar and physics + iObserver->UpdateScrollBarAndPhysics(); + + if( index == iFocusedFieldIndex ) + { + // Scroll this field completely visible, if required. + // This updates also scrollbar and physics if scrolling + // is done. + ScrollControlVisible( iFocusedFieldIndex ); + } + + DrawDeferred(); + } + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ShowControl +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::ShowControl( TESMREntryFieldId aFieldId ) + { + FUNC_LOG; + /* + * Inserts field visible and layouts it. + */ + + CESMRField* field = iFactory.FieldById( aFieldId ); + + if ( field && !field->IsVisible() ) + { + // Make field visible + field->MakeVisible( ETrue ); + TInt index = IndexByFieldId( iFactory, aFieldId ); + + TPoint tl( Rect().iTl ); + TInt prevIndex = index - 1; + + // Get previous visible field position + // Index 0 must be included in attendee field case, + // to avoid field collision. But in response field, + // causes misplacing of area. + if ( ( prevIndex >= 0 ) && ( aFieldId != EESMRFieldResponseArea ) ) + { + CESMRField* previous = NULL; + do + { + previous = iFactory.Field( prevIndex-- ); + } + while ( prevIndex >= 0 && !previous->IsVisible() ); + + tl.iY = previous->Rect().iBr.iY; + } + + // Layout field + LayoutField( *field, tl); + + // Move following fields + tl.iY += field->Size().iHeight; + MoveFields( ++index, tl ); + + // Set fieldcontainer size again, because + // the amount of fields has changed. + SetSize( MinimumSize() ); + + // Scrollbar and physics require updating. + iObserver->UpdateScrollBarAndPhysics(); + } + + DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::HideControl() +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::HideControl( TESMREntryFieldId aFieldId ) + { + FUNC_LOG; + /* + * Sets field non-visible and moves other fields accordingly. + * Does not delete the field. + */ + CESMRField* field = iFactory.FieldById( aFieldId ); + + if ( field && field->IsVisible() ) + { + field->MakeVisible( EFalse ); + TInt index = IndexByFieldId( iFactory, aFieldId ); + TBool focused = ( index == iFocusedFieldIndex )? ETrue : EFalse; + + TPoint pos( field->Position() ); + MoveFields( index, pos ); + + // Set fieldcontainer size again, because + // the amount of fields has changed. + SetSize( MinimumSize() ); + + // Scrollbar and physics require updating. + iObserver->UpdateScrollBarAndPhysics(); + + if ( focused && !field->IsNonFocusing() ) + { + // Set focus to next field, or if removed field was the last + // field, then move focus to last visible field + TInt lastVisibleFieldIndex( LastVisibleField( aFieldId ) ); + + // If field was the last one... + if( lastVisibleFieldIndex == index ) + { + // ... Set focus to last visible field. + TRAP_IGNORE( DoSetFocusL( lastVisibleFieldIndex ) ) + } + else + { + // Othwerwise set focus to next field + TRAP_IGNORE( DoSetFocusL( index + 1 ) ) + } + } + } + DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::IsControlVisible +// --------------------------------------------------------------------------- +// +TBool CMRFieldContainer::IsControlVisible( TESMREntryFieldId aField ) + { + FUNC_LOG; + /* + * Returns ETrue/EFalse if the field with given field id is + * visible or not. + */ + + TBool ret( EFalse ); + + CESMRField* field = iFactory.FieldById( aField ); + if ( field && field->IsVisible() ) + { + ret = ETrue; + } + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::SetControlFocused +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::SetControlFocusedL( TESMREntryFieldId aField ) + { + FUNC_LOG; + /* + * Set the field with given field id focused. + */ + + // This handles scrollbar and physics updates also. + DoSetFocusL( IndexByFieldId( iFactory, aField ) ); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ListHeight +// --------------------------------------------------------------------------- +// +TInt CMRFieldContainer::ListHeight() + { + FUNC_LOG; + /* + * Returns the height of all fields, in other words the height + * of the field container. + */ + return MinimumSize().iHeight; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::IsFocusedControlsBottomVisible +// --------------------------------------------------------------------------- +// +TBool CMRFieldContainer::IsFocusedControlsBottomVisible() + { + FUNC_LOG; + /* + * Checks if focused field is completely visible in the viewable area. + */ + + // Fetch the position information about currently focused field: + CESMRField* field = iFactory.Field( iFocusedFieldIndex ); + TBool ret( EFalse ); + if ( field->Rect().iBr.iY <= Parent()->Rect().iBr.iY ) + { + ret = ETrue; + } + + return ret; + } + + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ScrollControlVisible +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::ScrollControlVisible( TInt aInd ) + { + FUNC_LOG; + /* + * Scrolls the field with the given index visible + */ + + CESMRField* field = NULL; + if ( aInd == KErrNotFound ) + { + field = FocusedField(); + } + else + { + field = iFactory.Field( aInd ); + } + + ASSERT( field ); + + TRect fieldRect( field->Position(), field->Size() ); + TRect parentRect( Parent()->Rect() ); + + /* + * Case 1: Field's height is less than the viewable area height, + * let's scroll the whole field visible. + */ + if( fieldRect.Height() < parentRect.Height() ) + { + // Scrolling down, let's move fields up + if( fieldRect.iBr.iY > parentRect.iBr.iY ) + { + iObserver->ScrollFieldsUp( + fieldRect.iBr.iY - parentRect.iBr.iY ); + } + // scrolling up, let's move field down + if( fieldRect.iTl.iY < parentRect.iTl.iY ) + { + iObserver->ScrollFieldsDown( + parentRect.iTl.iY - fieldRect.iTl.iY ); + } + } + + /* + * Case 2: Field's height is more than the viewable area's height. + */ + else + { + // Field is in view mode + if( field->FieldMode() == EESMRFieldModeView ) + { + // Focus to this field is coming from above + if( field->PreItemIndex() < field->CurrentItemIndex() ) + { + // Let's scroll the top of the field to the + // top of the viewable area + iObserver->ScrollFieldsUp( + fieldRect.iTl.iY - parentRect.iTl.iY ); + + } + // Focus to this field is coming from below + if( field->PreItemIndex() > field->CurrentItemIndex() ) + { + // Let's scroll the bottom of the field to the + // bottom of the viewable area + iObserver->ScrollFieldsDown( + parentRect.iBr.iY - fieldRect.iBr.iY ); + } + } + + // Field is in edit mode + if( field->FieldMode() == EESMRFieldModeEdit ) + { + // TODO: CORRECT if broken + TInt viewBottom( parentRect.iBr.iY ); + + TInt fieldUpper( 0 ); + TInt fieldLower( 0 ); + field->GetCursorLineVerticalPos( fieldUpper, fieldLower ); + + TInt focusFieldVisibleUp( fieldRect.iTl.iY + fieldUpper ); + TInt focusFieldVisibleBottom( fieldRect.iTl.iY + fieldLower ); + + // desired position below view rect: + TInt viewHeight( parentRect.Height() ); + if ( focusFieldVisibleBottom > viewBottom ) + { + // move field focus line bottom to view bottom + TInt px = focusFieldVisibleBottom - viewHeight; + + + // if focus on last field: add margin height to + // scroll amount. + if ( iFocusedFieldIndex == iFactory.Count()-1 ) + { + px += KVerticalScrollMargin; // TODO: Fix me! K-value must be removed. + } + + // Scrollbar and physics update is done here + iObserver->ScrollFieldsUp( px ); + } + else + { + // If field top is invisible, move downwards to make top visible. + TInt viewTop( parentRect.iTl.iY ); + + // recalculate field rect + focusFieldVisibleUp = fieldRect.iTl.iY + fieldUpper; + focusFieldVisibleBottom = fieldRect.iTl.iY + fieldLower; + + if ( focusFieldVisibleUp < viewTop ) + { + TInt px( viewTop - focusFieldVisibleUp ); + + // Scrollbar and physics update is done here + iObserver->ScrollFieldsDown( px ); + } + } + } + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::RePositionFields +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::RePositionFields( TInt aAmount ) + { + FUNC_LOG; + + // Movement downwards + if( aAmount >= 0 ) + { + // Also scrollbar and physics update is done here + iObserver->ScrollFieldsDown( aAmount ); + } + // Movement upwards + else + { + // Also scrollbar and physics update is done here + iObserver->ScrollFieldsUp( -aAmount ); + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::ViewableAreaRect +// --------------------------------------------------------------------------- +// +TRect CMRFieldContainer::ViewableAreaRect() + { + FUNC_LOG; + return Parent()->Rect(); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::MoveFields +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::MoveFields( TInt aIndex, TPoint& aTl ) + { + FUNC_LOG; + /* + * Moves fields from the given index towards the last item. + * This function does not update scrollbar or physics. + */ + + const TInt count( iFactory.Count() ); + + for ( TInt i = aIndex; i < count; ++i ) + { + CESMRField* field = iFactory.Field( i ); + + if ( field->IsVisible() ) + { + field->SetPosition( aTl ); + + aTl.iY += field->Size().iHeight; + } + } + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::LayoutField +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::LayoutField( CESMRField& aField, const TPoint& aTl ) + { + FUNC_LOG; + /* + * Layouts given field according to the size required by the field and + * given TPoint. This function does not update scrollbar or physics. + */ + + TSize size( aField.MinimumSize() ); + aField.SetPosition( aTl ); + aField.SetSize( size ); + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::IsLastVisibleField +// --------------------------------------------------------------------------- +// +TInt CMRFieldContainer::LastVisibleField( + TESMREntryFieldId aFieldId ) + { + /* + * Helper function to find out the last visible field in the list. + */ + + TInt lastVisibleFieldIndex( 0 ); + TInt count( iFactory.Count() ); + + // Go through fields from last field towards the first field + for( TInt i( 1 ); i > count; ++i ) + { + // Once last visible field is found... + if( iFactory.Field( count - i )->IsVisible() ) + { + // ... Compare it to the given field index ... + if( iFactory.Field( count - i )->FieldId() == aFieldId ) + { + // ... And if match is found, given fieldId is the + // the last visible field. + lastVisibleFieldIndex = + IndexByFieldId( iFactory, aFieldId ); + } + else + { + // Otherwise return the found last visible field. + lastVisibleFieldIndex = + IndexByFieldId( iFactory, + iFactory.Field( count - i )->FieldId() ); + } + break; + } + } + + return lastVisibleFieldIndex; + } + +// --------------------------------------------------------------------------- +// CMRFieldContainer::DoSetFocusL +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::DoSetFocusL( TInt aNewFocusIndex ) + { + FUNC_LOG; + /* + * Sets the focus according to the given index. + */ + + TInt count( iFactory.Count() ); + aNewFocusIndex = Max( 0, Min( aNewFocusIndex, count - 1 ) ); + + if ( aNewFocusIndex != iFocusedFieldIndex ) + { + // Get current focused field + CESMRField* old = iFactory.Field( iFocusedFieldIndex ); + + // Get next focused field + CESMRField* field = iFactory.Field( aNewFocusIndex ); + + // Do sanity checks + while ( aNewFocusIndex < count && !field->IsVisible() ) + { + field = iFactory.Field( aNewFocusIndex++ ); + } + + if ( !field->IsVisible() ) + { + aNewFocusIndex = iFocusedFieldIndex - 1; + while ( aNewFocusIndex > 0 && !field->IsVisible() ) + { + field = iFactory.Field( aNewFocusIndex-- ); + } + } + + ASSERT( field->IsVisible() ); + + // Update current and previous item indexes + field->SetPreItemIndex( iFocusedFieldIndex ); + iFocusedFieldIndex = aNewFocusIndex; + field->SetCurrentItemIndex( iFocusedFieldIndex ); + + // Remove focus from old + old->SetOutlineFocusL( EFalse ); + old->SetFocus( EFalse ); + + // update focus index to new index + field->SetOutlineFocusL( ETrue ); + field->SetFocus( ETrue ); + + // This handles also scrollbar and physics updating, + // if view scrolling is done. + ScrollControlVisible( iFocusedFieldIndex ); + + DrawDeferred(); + } + } + + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrfocusstrategybase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrfocusstrategybase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Focus strategy base class implementation +* +*/ + +#include "cmrfocusstrategybase.h" + +#include "mesmrfieldstorage.h" +#include "cesmrfield.h" +#include "emailtrace.h" + +// --------------------------------------------------------------------------- +// CMRFocusStrategyBase::CMRFocusStrategyBase +// --------------------------------------------------------------------------- +// +CMRFocusStrategyBase::CMRFocusStrategyBase( MESMRFieldStorage& aFactory ) +: iFactory( aFactory ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyBase::~CMRFocusStrategyBase +// --------------------------------------------------------------------------- +// +CMRFocusStrategyBase::~CMRFocusStrategyBase() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyBase::InitializeFocus +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyBase::InitializeFocus() + { + FUNC_LOG; + + HideFocus(); + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyBase::EventOccured +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyBase::EventOccured( TFocusEventType aEventType ) + { + FUNC_LOG; + + // Default implementation + if ( aEventType == MMRFocusStrategy::EFocusKeyEvent ) + { + ShowFocus(); + } + if ( aEventType == MMRFocusStrategy::EFocusPointerEvent ) + { + HideFocus(); + } + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyBase::HideFocus +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyBase::HideFocus() + { + FUNC_LOG; + + if ( iVisibleFocusOn ) + { + const TInt count( iFactory.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + // At the start there is no focus in hybrid or touch device. + // The hw key provokest the focus again + field->SetFocusType( EESMRNoFocus ); + } + iVisibleFocusOn = EFalse; + } + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyBase::ShowFocus +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyBase::ShowFocus() + { + FUNC_LOG; + + if ( !iVisibleFocusOn ) + { + const TInt count( iFactory.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + // At the start there is no focus in hybrid or touch device. + // The hw key provokes the focus again + field->SetFocusType( EESMRHighlightFocus ); + } + iVisibleFocusOn = ETrue; + } + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrfocusstrategyeditor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrfocusstrategyeditor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Focus strategy for editor implementation +* +*/ + +#include "cmrfocusstrategyeditor.h" +#include "emailtrace.h" + +// --------------------------------------------------------------------------- +// CMRFocusStrategyEditor::NewL +// --------------------------------------------------------------------------- +// +CMRFocusStrategyEditor* CMRFocusStrategyEditor::NewL( MESMRFieldStorage& aFactory ) + { + FUNC_LOG; + + CMRFocusStrategyEditor* self = + new ( ELeave ) CMRFocusStrategyEditor( aFactory ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyEditor::CMRFocusStrategyEditor +// --------------------------------------------------------------------------- +// +CMRFocusStrategyEditor::CMRFocusStrategyEditor( MESMRFieldStorage& aFactory ) +: CMRFocusStrategyBase( aFactory ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyEditor::~CMRFocusStrategyEditor +// --------------------------------------------------------------------------- +// +CMRFocusStrategyEditor::~CMRFocusStrategyEditor() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyEditor::EventOccured +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyEditor::EventOccured( TFocusEventType aEventType ) + { + FUNC_LOG; + + if ( aEventType == MMRFocusStrategy::EFocusKeyEvent ) + { + CMRFocusStrategyBase::ShowFocus(); + } + if ( aEventType == MMRFocusStrategy::EFocusPointerEvent ) + { + // We don't hide focus in editor + iVisibleFocusOn = ETrue; + } + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyEditor::InitializeFocus +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyEditor::InitializeFocus() + { + FUNC_LOG; + + // Our focus is always on in editor + CMRFocusStrategyBase::ShowFocus(); + } + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrfocusstrategyviewer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrfocusstrategyviewer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Focus strategy for editor implementation +* +*/ + +#include "cmrfocusstrategyviewer.h" + +#include "nmrglobalfeaturesettings.h" +#include "mesmrfieldstorage.h" +#include "cesmrfield.h" +#include "emailtrace.h" + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::NewL +// --------------------------------------------------------------------------- +// +CMRFocusStrategyViewer* CMRFocusStrategyViewer::NewL( MESMRFieldStorage& aFactory ) + { + FUNC_LOG; + + CMRFocusStrategyViewer* self = + new ( ELeave ) CMRFocusStrategyViewer( aFactory ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::CMRFocusStrategyViewer +// --------------------------------------------------------------------------- +// +CMRFocusStrategyViewer::CMRFocusStrategyViewer( MESMRFieldStorage& aFactory ) +: CMRFocusStrategyBase( aFactory ) + { + FUNC_LOG; + + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::~CMRFocusStrategyViewer +// --------------------------------------------------------------------------- +// +CMRFocusStrategyViewer::~CMRFocusStrategyViewer() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::ConstructL +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyViewer::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::InitializeFocus +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyViewer::InitializeFocus() + { + FUNC_LOG; + + // Focus is not on by default + const TInt count( iFactory.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + // At the start there is no focus in hybrid or touch device. + // The hw key provokest the focus again + field->SetFocusType( EESMRNoFocus ); + } + iVisibleFocusOn = EFalse; + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::EventOccured +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyViewer::EventOccured( TFocusEventType aEventType ) + { + FUNC_LOG; + + if ( aEventType == MMRFocusStrategy::EFocusKeyEvent ) + { + // If device has the keyboard, we should show the focus + if ( NMRGlobalFeatureSettings::KeyboardType() != + NMRGlobalFeatureSettings::ENoKeyboard ) + { + CMRFocusStrategyBase::ShowFocus(); + } + } + if ( aEventType == MMRFocusStrategy::EFocusPointerEvent ) + { + DoHideFocus(); + } + } + +// --------------------------------------------------------------------------- +// CMRFocusStrategyViewer::DoHideFocus +// --------------------------------------------------------------------------- +// +void CMRFocusStrategyViewer::DoHideFocus() + { + FUNC_LOG; + + if ( iVisibleFocusOn ) + { + const TInt count( iFactory.Count() ); + for ( TInt i = 0; i < count; i++ ) + { + CESMRField* field = iFactory.Field( i ); + + // At the start there is no focus in hybrid or touch device. + // The hw key provokest the focus again + field->SetFocusType( EESMRNoFocus ); + + // Every field is redrawn due to draw problems after + // focus removal + field->DrawDeferred(); + } + + iVisibleFocusOn = EFalse; + } + } +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrimage.cpp --- a/meetingrequest/mrgui/src/cmrimage.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,434 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of CMRImage class. -* -*/ - -#include "cmrimage.h" - -#include -#include -#include - -#include "esmrhelper.h" -#include "cesmrlayoutmgr.h" - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CMRImage::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CMRImage* CMRImage::NewL( - const TAknsItemID& aIconId, TScaleMode aScaleMode ) - { - CMRImage* self = new (ELeave) CMRImage( aScaleMode ); - CleanupStack::PushL( self ); - self->ConstructL( aIconId ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CMRImage::~CMRImage -// --------------------------------------------------------------------------- -// -EXPORT_C CMRImage* CMRImage::NewL( - NMRBitmapManager::TMRBitmapId aBitmapId, TScaleMode aScaleMode ) - { - CMRImage* self = new (ELeave) CMRImage( aScaleMode ); - CleanupStack::PushL( self ); - self->ConstructL( aBitmapId ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CMRImage::~CMRImage -// --------------------------------------------------------------------------- -// -EXPORT_C CMRImage::~CMRImage() - { - // Do nothing - } - -// --------------------------------------------------------------------------- -// CMRImage::SizeChanged -// --------------------------------------------------------------------------- -// -void CMRImage::SizeChanged() - { - TSize sz = Rect().Size(); - const CFbsBitmap* bitmap = Bitmap(); - AknIconUtils::SetSize( const_cast< CFbsBitmap* >( bitmap ), sz, iScaleMode ); - } - -// --------------------------------------------------------------------------- -// CMRImage::CMRImage -// --------------------------------------------------------------------------- -// -CMRImage::CMRImage( TScaleMode aScaleMode ) - : iScaleMode( aScaleMode ) - { - // Do nothing - } - -// --------------------------------------------------------------------------- -// CMRImage::ConstructL -// --------------------------------------------------------------------------- -// -void CMRImage::ConstructL( const TAknsItemID& aIconId ) - { - CreateIconL( aIconId ); - } - -// --------------------------------------------------------------------------- -// CMRImage::ConstructL -// --------------------------------------------------------------------------- -// -void CMRImage::ConstructL( NMRBitmapManager::TMRBitmapId aBitmapId ) - { - CreateIconL( aBitmapId ); - } - -// --------------------------------------------------------------------------- -// CMRImage::CreateIconL -// --------------------------------------------------------------------------- -// -void CMRImage::CreateIconL( const TAknsItemID& aIconId ) - { - TInt fileIndex(-1); - TInt fileMaskIndex(-1); - - SetBitmapFallback( aIconId, fileIndex, fileMaskIndex ); - - TFileName bitmapFilePath; - ESMRHelper::LocateResourceFile( - KESMRMifFile, - KDC_APP_BITMAP_DIR, - bitmapFilePath ); - - CFbsBitmap* bitMap; - CFbsBitmap* bitMapMask; - - AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - aIconId, - bitMap, - bitMapMask, - bitmapFilePath, - fileIndex, - fileMaskIndex - ); - - if( bitMap && bitMapMask ) - { - SetPictureOwnedExternally( EFalse ); - SetBrushStyle( CWindowGc::ENullBrush ); - SetPicture( bitMap, bitMapMask ); - } - } - -// --------------------------------------------------------------------------- -// CMRImage::CreateIconL -// --------------------------------------------------------------------------- -// -void CMRImage::CreateIconL( NMRBitmapManager::TMRBitmapId aBitmapId ) - { - CFbsBitmap* bitMap( NULL ); - CFbsBitmap* bitMapMask( NULL ); - TSize sz( Rect().Size() ); - User::LeaveIfError( - NMRBitmapManager::GetSkinBasedBitmap( - aBitmapId, - bitMap, bitMapMask, sz ) ); - - if( bitMap && bitMapMask ) - { - SetPictureOwnedExternally( EFalse ); - SetBrushStyle( CWindowGc::ENullBrush ); - SetPicture( bitMap, bitMapMask ); - } - } - -// --------------------------------------------------------------------------- -// CMRImage::SetBitmapFallback -// --------------------------------------------------------------------------- -// -void CMRImage::SetBitmapFallback( - const TAknsItemID& aIconId, - TInt& aFileIndex, - TInt& aFileMaskIndex ) - { - // icons changed - switch ( aIconId.iMinor ) - { - case EAknsMinorGenericQgnFscalIndiPriorityHigh: - case EAknsMinorGenericQgnFsIndiPriorityHigh: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiPriorityNormal: - case EAknsMinorGenericQgnFsIndiPriorityNormal: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiPriorityLow: - case EAknsMinorGenericQgnFsIndiPriorityLow: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiAlarmDay: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_day; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_day_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiAlarmTime: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiSubject: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiRecurrence: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiAlarm: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiCheckboxMark: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiCheckboxUnmark: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiClock: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiDateEnd: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiDateStart: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start_mask; - break; - } - case EAknsMinorGenericQgnMeetReqIndiLocation: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiSynchronisation: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation_mask; - break; - } - case EAknsMinorGenericQgnFscalIndiOccasion: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion_mask; - break; - } - - case EAknsMinorGenericQgnFsIndiCaleTrackingTentative: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative_mask; - break; - } - case EAknsMinorGenericQgnFsIndiCaleTrackingAccept: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept_mask; - break; - } - case EAknsMinorGenericQgnFsIndiCaleTrackingNone: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none_mask; - break; - } - case EAknsMinorGenericQgnFsIndiCaleTrackingReject: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject_mask; - break; - } - case EAknsMinorGenericQgnFseMailAttachment: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_attachment; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; - break; - } - case EAknsMinorGenericQgnFsGrafEmailCtrlbar: - { - aFileIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar; - aFileMaskIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar_mask; - break; - } - case EAknsMinorQgnPropCheckboxOn: - aFileIndex = EMbmEsmrguiQgn_prop_checkbox_on; - aFileMaskIndex = EMbmEsmrguiQgn_prop_checkbox_on_mask; - break; - case EAknsMinorQgnPropCheckboxOff: - aFileIndex = EMbmEsmrguiQgn_prop_checkbox_off; - aFileMaskIndex = EMbmEsmrguiQgn_prop_checkbox_off_mask; - break; - case EAknsMinorQgnFsListCenter: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_center; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; - break; - } - case EAknsMinorQgnFsListSideT: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_t; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; - break; - } - case EAknsMinorQgnFsListSideL: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_l; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; - break; - } - case EAknsMinorQgnFsListSideR: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_r; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; - break; - } - case EAknsMinorQgnFsListSideB: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_side_b; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; - break; - } - case EAknsMinorQgnFsListCornerTl: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_tl; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; - break; - } - case EAknsMinorQgnFsListCornerTr: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_tr; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; - break; - } - case EAknsMinorQgnFsListCornerBl: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_bl; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; - break; - } - case EAknsMinorQgnFsListCornerBr: - { - aFileIndex = EMbmEsmrguiQsn_fr_list_corner_br; - aFileMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; - break; - } - case EAknsMinorGenericQgnFsHscrActionArrowLeft: - { - aFileIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; - break; - } - // removed when icons changed to common ones - /* - case EAknsMinorGenericQgnFsHscrActionArrowRight: - { - aFileIndex = EMbmEsmrguiQgn_indi_action_menu; - aFileMaskIndex = EMbmEsmrguiQgn_indi_action_menu_mask; - break; - } - */ - // - // Commented to enable compilation in wk04 - /*case EAknsMinorGenericQgnFseActionMenuOpenInWebIcon: - { - aFileIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_web_icon; - aFileMaskIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_web_icon; - break; - } - case EAknsMinorGenericQgnFseActionMenuOpenInIntranetIcon: - { - aFileIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_intranet_icon; - aFileMaskIndex = EMbmEsmrguiQgn_fse_action_menu_open_in_intranet_icon_mask; - break; - } - case EAknsMinorGenericQgnFseActionMenuBookmarkIcon: - { - aFileIndex = EMbmEsmrguiQgn_fse_action_menu_bookmark_icon; - aFileMaskIndex = EMbmEsmrguiQgn_fse_action_menu_bookmark_icon_mask; - break; - }*/ - // - // removed when icons changed to common ones - /* - case EAknsMinorGenericQgnPropBlidWaypoint: - { - aFileIndex = EMbmEsmrguiQgn_fs_action_show_on_maps; - aFileMaskIndex = EMbmEsmrguiQgn_fs_action_show_on_maps_mask; - break; - } - */ - // - default: - { - // icons changed - aFileIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; - aFileMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; - break; - // - } -// - } - } - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrlabel.cpp --- a/meetingrequest/mrgui/src/cmrlabel.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: URL Parser ECom plugin entry point -* -*/ -#include "cmrlabel.h" - -#include -#include -#include -#include -#include - -// LOCAL DEFINITIONS -namespace // codescanner::namespace - { - #define KDefaultTextColor TRgb( 0x000000 ); - /// Get the text color from skin - TRgb TextColor( TInt aSkinColorId ) - { - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - aSkinColorId ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - - } - -// --------------------------------------------------------------------------- -// CMRLabel::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CMRLabel* CMRLabel::NewL() - { - CMRLabel* self = new (ELeave) CMRLabel(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CMRLabel::~CMRLabel -// --------------------------------------------------------------------------- -// -EXPORT_C CMRLabel::~CMRLabel() - { - // Do nothing - } - -// --------------------------------------------------------------------------- -// CMRLabel::FocusChanged -// --------------------------------------------------------------------------- -// -void CMRLabel::FocusChanged( TDrawNow /*aDrawNow*/ ) - { - // Focus received - if ( IsFocused() ) - { - // If function leaves we continue w/o changing the color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *this, EColorLabelText, - TextColor( EAknsCIQsnHighlightColorsCG2 ) ) ); - } - else - { - // If function leaves we continue w/o changing the color - TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( - *this, EColorLabelText, - TextColor( EAknsCIQsnTextColorsCG6 ) ) ); - } - } - -// --------------------------------------------------------------------------- -// CMRLabel::CMRLabel -// --------------------------------------------------------------------------- -// -CMRLabel::CMRLabel() - { - // Do nothing - } - -// --------------------------------------------------------------------------- -// CMRLabel::ConstructL -// --------------------------------------------------------------------------- -// -void CMRLabel::ConstructL() - { - AknLayoutUtils::OverrideControlColorL( - *this, EColorLabelText, - TextColor( EAknsCIQsnTextColorsCG6 ) ); - } - - -// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrlistpane.cpp --- a/meetingrequest/mrgui/src/cmrlistpane.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cmrlistpane.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -15,61 +15,64 @@ * */ #include "cmrlistpane.h" +#include "mesmrfieldstorage.h" +#include "mmrscrollbarobserver.h" +#include "esmrdef.h" +#include "cesmrfield.h" +#include "cmrfieldcontainer.h" +#include "cmrlistpanephysics.h" #include -#include -#include +#include -#include "mesmrfieldstorage.h" -#include "cesmrfield.h" - +//DEBUG #include "emailtrace.h" -namespace // codescanner::namespace - { - /** - * Vertical scroll margin - */ - const TInt KVerticalScrollMargin = 3; +namespace { // codescanner::namespace + +const TInt KLongTapDelay( 700000 ); // 0,7 sec +const TInt KLongTapAnimationDelay( 300000 ); // 0,3 sec - // --------------------------------------------------------------------------- - // IndexByFieldId - // --------------------------------------------------------------------------- - // - TInt IndexByFieldId( const MESMRFieldStorage& aFactory, - TESMREntryFieldId aFieldId ) +// ---------------- +// IndexByFieldId +// ---------------- +// +TInt IndexByFieldId( const MESMRFieldStorage& aFactory, + TESMREntryFieldId aFieldId ) + { + TInt index( KErrNotFound ); + TInt count( aFactory.Count() ); + + for ( TInt i = 0; i < count; ++i ) { - TInt index( KErrNotFound ); - TInt count( aFactory.Count() ); - - for ( TInt i = 0; i < count; ++i ) + if ( aFactory.Field( i )->FieldId() == aFieldId ) { - if ( aFactory.Field( i )->FieldId() == aFieldId ) - { - index = i; - break; - } + index = i; + break; } - - return index; } + + return index; } +} + //----- MEMBER FUNCTIONS ---- // --------------------------------------------------------------------------- -// CMRListPane::NewL +// CMRListPane::CMRListPane // --------------------------------------------------------------------------- // -CMRListPane* CMRListPane::NewL( const CCoeControl& aParent, - MESMRFieldStorage& aFactory, - TAknDoubleSpanScrollBarModel& aScrollModel ) +CMRListPane::CMRListPane( MESMRFieldStorage& aFactory, + TAknDoubleSpanScrollBarModel& aScrollModel, + CAknDoubleSpanScrollBar& aScroll, + MMRScrollBarObserver& aScrollBarObserver ) + : iFactory( aFactory ), + iScrollModel( aScrollModel ), + iScroll( aScroll ), + iScrollBarObserver( aScrollBarObserver ) { - CMRListPane* self = new (ELeave) CMRListPane( aFactory, aScrollModel ); - CleanupStack::PushL( self ); - self->ConstructL( aParent ); - CleanupStack::Pop( self ); - return self; + FUNC_LOG; } // --------------------------------------------------------------------------- @@ -78,17 +81,32 @@ // CMRListPane::~CMRListPane() { + FUNC_LOG; + delete iLongtapDetector; + delete iPhysics; + delete iFieldContainer; } // --------------------------------------------------------------------------- -// CMRListPane::CMRListPane +// CMRListPane::NewL // --------------------------------------------------------------------------- // -CMRListPane::CMRListPane( MESMRFieldStorage& aFactory, - TAknDoubleSpanScrollBarModel& aScrollModel ) - : iFactory( aFactory ), - iScrollModel( aScrollModel ) +CMRListPane* CMRListPane::NewL( const CCoeControl& aParent, + MESMRFieldStorage& aFactory, + TAknDoubleSpanScrollBarModel& aScrollModel, + CAknDoubleSpanScrollBar& aScroll, + MMRScrollBarObserver& aScrollBarObserver ) { + FUNC_LOG; + CMRListPane* self = new( ELeave )CMRListPane( + aFactory, + aScrollModel, + aScroll, + aScrollBarObserver ); + CleanupStack::PushL( self ); + self->ConstructL( aParent ); + CleanupStack::Pop( self ); + return self; } // --------------------------------------------------------------------------- @@ -97,64 +115,173 @@ // void CMRListPane::ConstructL( const CCoeControl& aParent ) { + FUNC_LOG; + CCoeControl::SetComponentsToInheritVisibility( ETrue ); SetContainerWindowL( aParent ); - TBool focusSet = EFalse; + + iLongtapDetector = CAknLongTapDetector::NewL( this ); + iLongtapDetector->SetLongTapDelay( KLongTapDelay ); + iLongtapDetector->SetTimeDelayBeforeAnimation( KLongTapAnimationDelay ); + + iFieldContainer = CMRFieldContainer::NewL( iFactory, *this ); + iFieldContainer->SetFieldContainerObserver( this ); + + // Physics: Create physics + // Give pointer to control that should be able to flick/drag + iPhysics = CMRListPanePhysics::NewL( *this, *iFieldContainer, *this ); + } + +// --------------------------------------------------------------------------- +// CMRListPane::InitializeL() +// --------------------------------------------------------------------------- +// +void CMRListPane::InitializeL() + { + FUNC_LOG; const TInt count( iFactory.Count() ); for ( TInt i = 0; i < count; i++ ) { - iFactory.Field(i)->SetContainerWindowL( *this ); + iFactory.Field(i)->InitializeL(); } + iClickedField = NULL; + } + - for ( TInt i = 0; i < count; i++ ) - { - CESMRField* field = iFactory.Field( i ); - - // Initialize field - field->InitializeL(); - User::LeaveIfError( field->SetParent( this ) ); +// --------------------------------------------------------------------------- +// CMRListPane::InternalizeL() +// --------------------------------------------------------------------------- +// +void CMRListPane::InternalizeL( MESMRCalEntry& aEntry ) + { + FUNC_LOG; + iFactory.InternalizeL( aEntry ); + + // This is called to make sure everything is drawn correctly + DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRListPane::ExternalizeL() +// --------------------------------------------------------------------------- +// +void CMRListPane::ExternalizeL( + MESMRCalEntry& aEntry, + TBool aForceValidation ) + { + FUNC_LOG; + CESMRField* currentFocus = FocusedField(); + ASSERT( currentFocus ); + TESMREntryFieldId id = currentFocus->FieldId(); - if ( !focusSet - && field->IsVisible() - && !field->IsNonFocusing()) + if ( aForceValidation ) + { + // force validate the values: + TInt err = iFactory.Validate( id, aForceValidation ); + // fill the calendar entry with data in fields. + iFactory.ExternalizeL( aEntry ); + } + else + { + TInt err = iFactory.Validate( id ); + if ( err ) + { + //SetControlFocusedL( id ); Why would we set this focused here? + User::Leave( err ); + } + else { - field->SetOutlineFocusL( ETrue ); - focusSet = ETrue; - iFocus = i; + // fill the calendar entry with data in fields. + iFactory.ExternalizeL( aEntry ); } - } + } + } + +// --------------------------------------------------------------------------- +// CMRListPane::DisableSizeChange() +// --------------------------------------------------------------------------- +// +void CMRListPane::DisableSizeChange(TBool aDisable ) + { + FUNC_LOG; + iDisableSizeChanged = aDisable; } // --------------------------------------------------------------------------- +// CMRListPane::InitialScroll +// --------------------------------------------------------------------------- +// +void CMRListPane::InitialScrollL() + { + FUNC_LOG; + // TODO: Fix or remove! L-Function called in non-leaving function! + // Suggestion: Move functionality to viewerdialog and use existing + // functions in listpane to do the required actions. + + // Check if the ResponseArea exist + TESMREntryFieldId id = GetResponseFieldsFieldId(); + + if( id == EESMRFieldResponseArea ) + { + // Set the focus on the ResponseArea + iFieldContainer->SetControlFocusedL( id ); + //iFactory.FieldById(id)->SetFocus( ETrue ); + + // Scroll the list to put the ResponseArea on the top + CESMRField* focusField = FocusedField(); + TPoint pos( focusField->Position() ); + ScrollFieldsUp(pos.iY); + } + } + + +// --------------------------------------------------------------------------- // CMRListPane::FocusedItem // --------------------------------------------------------------------------- // -CESMRField* CMRListPane::FocusedItem() const +CESMRField* CMRListPane::FocusedField() const + { + FUNC_LOG; + return iFieldContainer->FocusedField(); + } + +// --------------------------------------------------------------------------- +// CMRListPane::SetControlFocusedL +// --------------------------------------------------------------------------- +// +void CMRListPane::SetControlFocusedL( TESMREntryFieldId aFieldId ) { FUNC_LOG; - CESMRField* field = NULL; - if ( iFactory.Count() > 0 ) - { - field = iFactory.Field( iFocus ); - } - return field; + iFieldContainer->SetControlFocusedL( aFieldId ); } - + +// --------------------------------------------------------------------------- +// CMRListPane::ClickedItem +// --------------------------------------------------------------------------- +// +CESMRField* CMRListPane::ClickedField() const + { + return iClickedField; + } + // --------------------------------------------------------------------------- // CMRListPane::CountComponentControls // --------------------------------------------------------------------------- // TInt CMRListPane::CountComponentControls() const { - return iFactory.Count(); + FUNC_LOG; + return 1; // iFieldContainer + } // --------------------------------------------------------------------------- // CMRListPane::ComponentControl // --------------------------------------------------------------------------- // -CCoeControl* CMRListPane::ComponentControl( TInt aIndex ) const +CCoeControl* CMRListPane::ComponentControl( TInt /*aIndex*/ ) const { - return iFactory.Field( aIndex ); + FUNC_LOG; + return iFieldContainer; } // --------------------------------------------------------------------------- @@ -163,35 +290,19 @@ // void CMRListPane::SizeChanged() { - TPoint tl( Position() ); - TInt scrollSpan = 0; - // Loop all the visible fields and set size and position in the list - TBool topVisibleFound( EFalse ); - - const TInt count( iFactory.Count() ); - for ( TInt i = 0; i < count; i++ ) + FUNC_LOG; + if ( iDisableSizeChanged || Rect() == TRect( 0, 0, 0, 0 ) ) { - CESMRField* field = iFactory.Field( i ); - - if ( field->IsVisible() ) - { - LayoutField( *field, tl ); - - if ( !topVisibleFound ) - { - iTopVisibleIndex = i; - topVisibleFound = ETrue; - } - - TInt height = field->Size().iHeight; - tl.iY += height; - scrollSpan += height; - } + return; } + + TSize containerSize( iFieldContainer->MinimumSize() ); + iFieldContainer->SetSize( containerSize ); - iScrollModel.SetScrollSpan( scrollSpan ); - iScrollModel.SetWindowSize( iSize.iHeight ); - UpdateFocusPosition(); + // Physics: + iPhysics->InitPhysics(); + + DoUpdateScrollBar(); } // --------------------------------------------------------------------------- @@ -201,737 +312,111 @@ TKeyResponse CMRListPane::OfferKeyEventL( const TKeyEvent &aKeyEvent, TEventCode aType ) { + FUNC_LOG; TKeyResponse response( EKeyWasNotConsumed ); + + // First check if the focused item needs the key event + response = FocusedField()->OfferKeyEventL( aKeyEvent, aType ); - // If we have at least one item in the list - if ( iFocus < iFactory.Count() ) + if ( aType == EEventKey + && response == EKeyWasNotConsumed ) { - CESMRField* field = iFactory.Field( iFocus ); - // First check if the focused item needs the key event - response = field->OfferKeyEventL( aKeyEvent, aType ); - - if ( aType == EEventKey - && response == EKeyWasNotConsumed ) + // Check if the focus should be changed + switch ( aKeyEvent.iScanCode ) { - // Check if the focus should be changed - switch ( aKeyEvent.iScanCode ) + case EStdKeyUpArrow: { - case EStdKeyUpArrow: - { - response = MoveFocusUpL(); - break; - } - case EStdKeyDownArrow: - { - response = MoveFocusDownL(); - break; - } - default: - { - break; - } + response = iFieldContainer->MoveFocusUpL( HiddenFocus() ); + + // Focus changed via keyboard, iClickedItem is no + // longer valid + iClickedField = NULL; + break; + } + case EStdKeyDownArrow: + { + response = iFieldContainer->MoveFocusDownL( HiddenFocus() ); + + // Focus changed via keyboard, iClickedItem is no + // longer valid + iClickedField = NULL; + break; + } + default: + { + break; } } } + return response; } // --------------------------------------------------------------------------- -// CMRListPane::ControlSizeChanged -// --------------------------------------------------------------------------- -// -void CMRListPane::ControlSizeChanged( CESMRField* aCtrl ) - { - if ( !aCtrl ) - { - SizeChanged(); - } - else - { - TPoint tl( aCtrl->Position() ); - TInt index = IndexByFieldId( iFactory, aCtrl->FieldId() ); - - // Relayout aCtrl - TSize old( aCtrl->Size() ); - TSize size( aCtrl->MinimumSize() ); - if ( aCtrl->IsExpandable() ) - { - size.iHeight = aCtrl->ExpandedHeight(); - } - aCtrl->SetSize( size ); - iScrollModel.SetScrollSpan( iScrollModel.ScrollSpan() - + size.iHeight - old.iHeight ); - - // Move other fields - ++index; - tl.iY += size.iHeight; - MoveFields( index, tl ); - UpdateFocusPosition(); - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::InsertControl -// --------------------------------------------------------------------------- -// -void CMRListPane::InsertControl( TESMREntryFieldId aField ) - { - CESMRField* field = iFactory.FieldById( aField ); - - if ( field && !field->IsVisible() ) - { - // Make field visible - field->MakeVisible( ETrue ); - TInt index = IndexByFieldId( iFactory, aField ); - if ( index < iTopVisibleIndex ) - { - iTopVisibleIndex = index; - } - - TPoint tl( Rect().iTl ); - TInt prevIndex = index - 1; - - // Get previous visible field position - if ( prevIndex >= 0 ) - { - CESMRField* previous = NULL; - do - { - previous = iFactory.Field( prevIndex-- ); - } - while ( prevIndex >= 0 && !previous->IsVisible() ); - - tl.iY = previous->Rect().iBr.iY; - } - - // Layout field - LayoutField( *field, tl ); - iScrollModel.SetScrollSpan( iScrollModel.ScrollSpan() - + field->Size().iHeight ); - - // Move following fields - tl.iY += field->Size().iHeight; - MoveFields( ++index, tl ); - UpdateFocusPosition(); - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::InsertControl -// --------------------------------------------------------------------------- -// -void CMRListPane::RemoveControl( TESMREntryFieldId aField ) - { - CESMRField* field = iFactory.FieldById( aField ); - - if ( field && field->IsVisible() ) - { - field->MakeVisible( EFalse ); - iScrollModel.SetScrollSpan( iScrollModel.ScrollSpan() - field->Size().iHeight ); - TInt index = IndexByFieldId( iFactory, aField ); - TBool focused = ( index == iFocus )? ETrue : EFalse; - - if ( index == iTopVisibleIndex ) - { - // Find next - TInt count( iFactory.Count() ); - while ( index < count ) - { - if ( iFactory.Field( ++index )->IsVisible() ) - { - iTopVisibleIndex = index; - break; - } - } - } - else - { - ++index; - } - TPoint pos( field->Position() ); - MoveFields( index, pos ); - if ( focused && !field->IsNonFocusing() ) - { - TRAP_IGNORE( DoSetFocusL( index ) ) - } - UpdateFocusPosition(); - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::IsControlVisible -// --------------------------------------------------------------------------- -// -TBool CMRListPane::IsControlVisible( TESMREntryFieldId aField ) - { - TBool visible( EFalse ); - CESMRField* field = iFactory.FieldById( aField ); - - if ( field ) - { - visible = field->IsVisible(); - } - - return visible; - } - -// --------------------------------------------------------------------------- -// CMRListPane::SetControlFocusedL -// --------------------------------------------------------------------------- -// -void CMRListPane::SetControlFocusedL( TESMREntryFieldId aField ) - { - TInt count = iFactory.Count(); - for ( TInt i(0); i < count; i++ ) - { - CESMRField* field = iFactory.Field(i); - - if ( field->FieldId() == aField ) - { - if( field->IsVisible() && !field->IsNonFocusing() ) - { - // Remove current focus before setting new one - CESMRField* focusedField = FocusedItem(); - ASSERT( focusedField ); - focusedField->SetOutlineFocusL( EFalse ); - - // Set new focus - field->SetOutlineFocusL( ETrue ); - iFocus = i; - break; - } - else - { - // Not possible to set focus to non-visible control - User::Leave( KErrGeneral ); - } - } - } - } - -// SCROLLING_MOD: These two methods are for CESMRRichTextViewer to -// be able to control view area -// --------------------------------------------------------------------------- -// CMRListPane::MoveListAreaDownL -// --------------------------------------------------------------------------- -// -void CMRListPane::MoveListAreaDownL( TInt aAmount ) - { - FUNC_LOG; - // Method for CESMRRichTextViewer for moving view area down if the text in - // text field does not fit on the screen. - - // Fetch the position info about the first visible field in field set: - CESMRField* field; - if( iTopVisibleIndex != KErrNotFound ) - { - field = iFactory.Field( iTopVisibleIndex ); - } - else - { - field = iFactory.Field( iFactory.Count() - 1 ); - } - TRect rect( field->Rect() ); - - // check whether the first field is visible, if not, let's - // check should we scroll less than needed to get the first - // field shown. - if ( rect.iTl.iY + aAmount > Rect().iTl.iY ) - { - aAmount = Rect().iTl.iY - rect.iTl.iY + KVerticalScrollMargin; - } - else if ( rect.iTl.iY == Rect().iTl.iY ) - { - // field already visible, do not scroll. - aAmount = 0; - } - - // Do the view scrolling if needed: - if ( aAmount ) - { - ScrollItemsDown( aAmount ); - UpdateFocusPosition(); - //UpdateScrollBar(); - DrawDeferred(); - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::MoveListAreaUpL +// CMRListPane::HandleLongTapEventL // --------------------------------------------------------------------------- // -void CMRListPane::MoveListAreaUpL( TInt aAmount ) - { - FUNC_LOG; - // Fetch the position information about currently focused field: - CESMRField* field = iFactory.Field( iFocus ); - TRect rect( field->Rect() ); - - // check whether the scroll pixels should be less than normal - // scroll sequence to let the field bottom to be placed at - // the bottom of view rect. - if ( rect.iBr.iY - aAmount < Rect().iBr.iY ) - { - aAmount = rect.iBr.iY - Rect().iBr.iY + KVerticalScrollMargin; - } - else if ( rect.iBr.iY + aAmount == Rect().iBr.iY ) - { - // field already visible, do not scroll. - aAmount = 0; - } - - // do the scrolling if needed: - if ( aAmount > 0 ) - { - // if the focus is on last - ScrollItemsUp( aAmount ); - UpdateFocusPosition(); - //UpdateScrollBar(); - DrawDeferred(); - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::ListHeight -// --------------------------------------------------------------------------- -// -TInt CMRListPane::ListHeight() +void CMRListPane::HandleLongTapEventL( + const TPoint& aPenEventLocation, + const TPoint& /* aPenEventScreenLocation */ ) { FUNC_LOG; - return iSize.iHeight; - } - -// --------------------------------------------------------------------------- -// CMRListPane::IsFieldBottomVisible -// --------------------------------------------------------------------------- -// -TBool CMRListPane::IsFieldBottomVisible() - { - // Fetch the position information about currently focused field: - CESMRField* field = iFactory.Field( iFocus ); - TBool ret( EFalse ); - if ( field->Rect().iBr.iY <= Rect().iBr.iY ) - { - ret = ETrue; - } - - return ret; - } - -// --------------------------------------------------------------------------- -// CMRListPane::MoveFocusUpL -// --------------------------------------------------------------------------- -// -TKeyResponse CMRListPane::MoveFocusUpL() - { - TInt ind( iFocus ); - - // search next visible focus item - while ( ind > 0 ) - { - CESMRField* field = iFactory.Field( --ind ); - - if ( !field->IsNonFocusing() ) - { - field = iFactory.Field( ind ); - - CESMRField* focusedField = iFactory.Field( iFocus ); - if ( field->IsVisible() ) - { - TBool canLoseFocus( - focusedField->OkToLoseFocusL( field->FieldId() ) ); - - if ( canLoseFocus ) - { - iFocus = ind; - - // update focus index and scroll the item visible - focusedField->SetOutlineFocusL( EFalse ); - // This call changes the text color of previously - // focused field - focusedField->SetFocus( EFalse ); - field->SetOutlineFocusL( ETrue ); - // This call changes the text color of focused field - field->SetFocus( ETrue ); - - ScrollItemVisible( iFocus ); - } - return EKeyWasConsumed; - } - } - } - return EKeyWasNotConsumed; - } - -// --------------------------------------------------------------------------- -// CMRListPane::MoveFocusDownL -// --------------------------------------------------------------------------- -// -TKeyResponse CMRListPane::MoveFocusDownL() - { - TInt ind( iFocus ); - - // start searching next possible focus item - TInt maxItemIndex = iFactory.Count() - 1; - - while ( ind < maxItemIndex ) - { - // only visible and focusable items can be focused - CESMRField* field = iFactory.Field( ++ind ); - - if ( field->IsVisible() && !field->IsNonFocusing() ) - { - CESMRField* focusedField = iFactory.Field( iFocus ); - - TBool canLoseFocus( - focusedField->OkToLoseFocusL( field->FieldId() ) ); + iLongTapEventConsumed = EFalse; + // Long tap functionality may vary between fields + // ==> Command field to execute action related to long tap + TInt count( iFactory.Count() ); - // check it its ok for the old focus item to lose focus - if ( canLoseFocus ) - { - iFocus = ind; - - // update focus index and scroll the item visible - focusedField->SetOutlineFocusL( EFalse ); - // This call changes the text color of previously - // focused field - focusedField->SetFocus( EFalse ); - field->SetOutlineFocusL( ETrue ); - // This call changes the text color of focused field - field->SetFocus( ETrue ); - - ScrollItemVisible( iFocus ); - } - return EKeyWasConsumed; - } - } - return EKeyWasNotConsumed; - } - -// --------------------------------------------------------------------------- -// CMRListPane::MoveFocusL -// --------------------------------------------------------------------------- -// -TBool CMRListPane::MoveFocusL(TInt aNextFieldIndex) - { - // start searching next possible focus item - TInt maxItemIndex = iFactory.Count() - 1; - - CESMRField* focusedField = iFactory.Field( iFocus ); - - // only visible and focusable items can be focused - CESMRField* field = iFactory.Field( aNextFieldIndex ); - - if ( field->IsVisible() && !field->IsNonFocusing() ) - { - TBool canLoseFocus( - focusedField->OkToLoseFocusL( field->FieldId() ) ); - - // check it its ok for the old focus item to lose focus - if ( canLoseFocus ) - { - // tactile feedback if touch - if ( AknLayoutUtils::PenEnabled() ) - { - MTouchFeedback* feedback = MTouchFeedback::Instance(); - if ( feedback ) - { - feedback->InstantFeedback( this, ETouchFeedbackBasic ); - } - } - - iFocus = aNextFieldIndex; - - // update focus index and scroll the item visible - focusedField->SetOutlineFocusL( EFalse ); - // This call changes the text color of previously - // focused field - focusedField->SetFocus( EFalse ); - field->SetOutlineFocusL( ETrue ); - // This call changes the text color of focused field - field->SetFocus( ETrue ); - DrawDeferred(); - } - return ETrue; // operation succeed - } - return EFalse; - } - -// --------------------------------------------------------------------------- -// CMRListPane::LayoutField -// --------------------------------------------------------------------------- -// -void CMRListPane::LayoutField( CESMRField& aField, - const TPoint& aTl ) - { - TSize size( aField.MinimumSize() ); - if ( aField.IsExpandable() ) - { - size.iHeight = aField.ExpandedHeight(); - } - aField.SetPosition( aTl ); - aField.SetSize( size ); - } - -// --------------------------------------------------------------------------- -// CMRListPane::MoveFields -// --------------------------------------------------------------------------- -// -void CMRListPane::MoveFields( TInt aIndex, - TPoint& aTl ) - { - const TInt count( iFactory.Count() ); - - for ( TInt i = aIndex; i < count; ++i ) + for ( TInt i = 0; i < count; ++i ) { CESMRField* field = iFactory.Field( i ); - if ( field->IsVisible() ) + if ( field->IsVisible() + && field->Rect().Contains( aPenEventLocation ) ) { - field->SetPosition( aTl ); - - aTl.iY += field->Size().iHeight; + field->LongtapDetectedL( aPenEventLocation ); + iLongTapEventConsumed = ETrue; + break; } } } // --------------------------------------------------------------------------- -// CMRListPane::DoSetFocusL +// CMRListPane::DoUpdateScrollBar // --------------------------------------------------------------------------- // -void CMRListPane::DoSetFocusL( TInt aFocus ) - { - TInt count( iFactory.Count() ); - aFocus = Max( 0, Min( aFocus, count - 1 ) ); - - if ( aFocus != iFocus ) - { - // Get current focused field - CESMRField* old = iFactory.Field( iFocus ); - - // Get next focused field - CESMRField* field = iFactory.Field( aFocus ); - while ( aFocus < count && !field->IsVisible() ) - { - field = iFactory.Field( aFocus++ ); - } - - if ( !field->IsVisible() ) - { - aFocus = iFocus - 1; - while ( aFocus > 0 && !field->IsVisible() ) - { - field = iFactory.Field( aFocus-- ); - } - } - - ASSERT( field->IsVisible() ); - - // Remove focus from old - iFocus = aFocus; - // update focus index and scroll the item visible - old->SetOutlineFocusL( EFalse ); - // Change the text color of previously focused field - old->SetFocus( EFalse ); - field->SetOutlineFocusL( ETrue ); - // This call changes the text color of focused field - field->SetFocus( ETrue ); - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::ScrollItemVisible -// --------------------------------------------------------------------------- -// -void CMRListPane::ScrollItemVisible( TInt aInd ) +void CMRListPane::DoUpdateScrollBar( TInt aFocusPosition ) { FUNC_LOG; - CESMRField* field = NULL; - if ( aInd == KErrNotFound ) + // Set this lispane's size as scroll bar's window size + iScrollModel.SetWindowSize( iSize.iHeight ); + // Set fieldcontainer's height as scrolbar's scroll span + iScrollModel.SetScrollSpan( iFieldContainer->MinimumSize().iHeight ); + + // Update scrollbar focus position. + if( aFocusPosition == KErrNotFound ) { - field = FocusedItem(); + iScrollModel.SetFocusPosition( iPhysics->VerticalScrollIndex() ); } else { - field = iFactory.Field( aInd ); + iScrollModel.SetFocusPosition( aFocusPosition ); } - ASSERT( field ); - - TRect rect( field->Rect() ); - - // move all items upwards - TInt bottomRightY = Rect().iBr.iY; - - - TInt fieldUpper(0); - TInt fieldLower(0); - field->GetMinimumVisibleVerticalArea( fieldUpper, fieldLower ); - - // desired position below view rect: - if ( rect.iTl.iY + fieldLower > Rect().iBr.iY ) - { - // field rect Y position related to view rect: - TInt fieldRelYPos = rect.iTl.iY - Size().iHeight; - TInt px = fieldRelYPos + fieldLower; + iScroll.SetModel( &iScrollModel ); - // if focus on first or last field: add margin height to - // scroll amount. - if ( iFocus == 0 || iFocus == iFactory.Count()-1 ) - { - px += 2 * KVerticalScrollMargin; - } - - ScrollItemsUp( px ); - } - - // move all items downwards. - TInt topLeftY = Rect().iTl.iY; - - if ( rect.iBr.iY - (rect.Height() - fieldUpper ) < topLeftY ) - { - TInt fieldRelYPos = topLeftY - rect.iBr.iY; - TInt px = fieldRelYPos + ( rect.Height() - fieldUpper); - - // if focus on first or last field: add margin height to - // scroll amount. - if ( iFocus == 0 || iFocus == iFactory.Count()-1 ) - { - px += KVerticalScrollMargin; - } - - ScrollItemsDown( px ); - } - - UpdateFocusPosition();//UpdateScrollBar(); - DrawDeferred(); + // finally update the new thumb position to view's + // iScrollBarThumbPosition member. + iScrollBarObserver.ScrollBarPositionChanged( + iScroll.ThumbPosition() ); } // --------------------------------------------------------------------------- -// CMRListPane::UpdateScrollBar +// CMRListPane::UpdatedFocusPosition // --------------------------------------------------------------------------- // -void CMRListPane::UpdateScrollBar() - { - FUNC_LOG; - // Scroll span is the size of the scrolled list, - // including the items that doesn't fit in the screen - TInt spanSize( 0 ); - TInt hidden( 0 ); - const TInt count(iFactory.Count()); - for ( TInt i(0); i < count; i++ ) - { - CESMRField* field = iFactory.Field( i ); - if ( field->IsVisible() ) - { - TRect rect( field->Rect() ); - spanSize += rect.Height(); - // Check if the field's top Y-position is hidden. - if ( rect.iTl.iY < 0 ) - { - // whole field is hidden - if ( rect.iBr.iY < 0 ) - { - hidden += rect.Height(); - } - // partly hidden: - else - { - hidden += Abs( rect.iTl.iY ); - } - } - } - } - - iScrollModel.SetScrollSpan( spanSize ); - iScrollModel.SetWindowSize( iSize.iHeight ); - iScrollModel.SetFocusPosition( hidden ); - - } - -// --------------------------------------------------------------------------- -// CMRListPane::ScrollItemsUp -// --------------------------------------------------------------------------- -// -void CMRListPane::ScrollItemsUp( TInt aPx ) +TInt CMRListPane::UpdatedFocusPosition() { FUNC_LOG; - TInt count( iFactory.Count() ); - for ( TInt i = 0; i < count; ++i ) - { - CESMRField* field = iFactory.Field(i); - if ( field->IsVisible() ) - { - TPoint pos( field->Position() ); - pos.iY -= aPx; - if ( i == iTopVisibleIndex && pos.iY < 0 ) - { - iTopVisibleIndex = KErrNotFound; - } - else if ( iTopVisibleIndex == KErrNotFound && pos.iY >= 0 ) - { - iTopVisibleIndex = i; - } - field->SetPosition( pos ); - } - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::ScrollItemsDown -// --------------------------------------------------------------------------- -// -void CMRListPane::ScrollItemsDown( TInt aPx ) - { - FUNC_LOG; - TInt count( iFactory.Count() ); - for ( TInt i = 0; i < count; ++i ) - { - CESMRField* field = iFactory.Field( i ); - if ( field->IsVisible() ) - { - TPoint pos( field->Position() ); - pos.iY += aPx; - if ( pos.iY >= 0 && ( i < iTopVisibleIndex || iTopVisibleIndex == KErrNotFound ) ) - { - iTopVisibleIndex = i; - } - field->SetPosition( pos ); - } - } - } - -// --------------------------------------------------------------------------- -// CMRListPane::ScrollView -// --------------------------------------------------------------------------- -// -void CMRListPane::ScrollView( TInt aAmount ) - { - FUNC_LOG; - - if ( aAmount > 0 ) - { - // move list up - ScrollItemsUp( aAmount ); - UpdateFocusPosition(); - DrawDeferred(); - } - else if ( aAmount < 0 ) - { - // move list down - ScrollItemsDown( -aAmount ); - UpdateFocusPosition(); - DrawDeferred(); - } - } - - -// --------------------------------------------------------------------------- -// CMRListPane::UpdateFocusPosition -// --------------------------------------------------------------------------- -// -void CMRListPane::UpdateFocusPosition() - { TInt focusPos = 0; TInt count = iFactory.Count(); for ( TInt i = 0; i < count; ++i ) @@ -961,62 +446,300 @@ } } } + + return focusPos; + } + +// --------------------------------------------------------------------------- +// CMRListPane::ScrollFieldsUp +// --------------------------------------------------------------------------- +// +void CMRListPane::ScrollFieldsUp( TInt aPx ) + { + FUNC_LOG; + TPoint point = iFieldContainer->Position(); + point.iY -= aPx; - iScrollModel.SetFocusPosition( focusPos ); + // This initializes Draw also + iFieldContainer->SetPosition( point ); + + // Non-kinetic scrolling executed. Update + // new position to physics. + iPhysics->UpdateVerticalScrollIndex( UpdatedFocusPosition() ); + + DoUpdateScrollBar( UpdatedFocusPosition() ); + } + +// --------------------------------------------------------------------------- +// CMRListPane::ScrollFieldsDown +// --------------------------------------------------------------------------- +// +void CMRListPane::ScrollFieldsDown( TInt aPx ) + { + FUNC_LOG; + TPoint point = iFieldContainer->Position(); + point.iY += aPx; + + // This initializes Draw also + iFieldContainer->SetPosition( point ); + // Non-kinetic scrolling executed. Update + // new position to physics. + iPhysics->UpdateVerticalScrollIndex( UpdatedFocusPosition() ); + + DoUpdateScrollBar( UpdatedFocusPosition() ); } -// ----------------------------------------------------------------------------- -// CMRListPane::GetViewCenterPosition -// ----------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// CMRListPane::UpdateScrollBarAndPhysics +// --------------------------------------------------------------------------- +// +void CMRListPane::UpdateScrollBarAndPhysics() + { + // Update physics world size + iPhysics->InitPhysics(); + + // Update scrollbar + DoUpdateScrollBar(); + } + + +// --------------------------------------------------------------------------- +// CMRListPane::ShowControl +// --------------------------------------------------------------------------- +// +void CMRListPane::ShowControl( TESMREntryFieldId aFieldId ) + { + iFieldContainer->ShowControl( aFieldId ); + } + +// --------------------------------------------------------------------------- +// CMRListPane::ShowControl +// --------------------------------------------------------------------------- // -TPoint CMRListPane::GetViewCenterPosition() const +TBool CMRListPane::IsControlVisible( TESMREntryFieldId aFieldId ) + { + return iFieldContainer->IsControlVisible( aFieldId ); + } +// --------------------------------------------------------------------------- +// CMRListPane::GetResponseFieldsFieldId +// --------------------------------------------------------------------------- +// +TESMREntryFieldId CMRListPane::GetResponseFieldsFieldId() { - const TInt count( iFactory.Count() ); - TInt topFieldYPos( 0 ); - for ( TInt i = 0; i < count; i++ ) + // TODO: Should be removed. This shouldn't be even a public function! + CESMRField* rfield = iFactory.FieldById( EESMRFieldResponseArea ); + + if ( rfield && rfield->IsVisible() && !rfield->IsNonFocusing() ) + { + return EESMRFieldResponseArea; + } + else + { + return iFactory.Field(0)->FieldId(); + } + } + +// --------------------------------------------------------------------------- +// CMRListPane::ReActivateL +// --------------------------------------------------------------------------- +// +void CMRListPane::ReActivateL() + { + FUNC_LOG; + TInt count = iFactory.Count(); + + for ( TInt i = 0; i < count; ++i ) { CESMRField* field = iFactory.Field( i ); - if ( field->IsVisible() ) + if ( !field->IsFieldActivated() ) { - topFieldYPos = field->Position().iY; - break; + field->SetContainerWindowL( *iFieldContainer ); + field->SetListObserver( iFieldContainer ); + } + } + + // This "for" circle can not be mixed with the above one, since the + // field->ActivateL() will call some functions which will traverse + // all the fields, but that time, not all the fields have set the + // container window. + for ( TInt i = 0; i < count; ++i ) + { + CESMRField* field = iFactory.Field( i ); + if ( !field->IsFieldActivated() ) + { + field->ActivateL(); } } - TInt centerX = iSize.iWidth / 2; - TInt visibleHeight = iSize.iHeight; + } - TInt centerY = visibleHeight / 2 - topFieldYPos; +// --------------------------------------------------------------------------- +// CMRListPane::HandlePointerEventL +// --------------------------------------------------------------------------- +// +void CMRListPane::HandlePointerEventL( const TPointerEvent &aPointerEvent ) + { + // Check if touch is enabled or not + if( !AknLayoutUtils::PenEnabled() ) + { + return; + } + + // Forward all listpane related events to physics api first. + if ( iPhysics->HandlePointerEventL( aPointerEvent, iPhysicsActionOngoing ) ) + { + DoUpdateScrollBar(); + // Physics in action. If long tap detection is active, + // it should be cancelled. + if( iLongtapDetector->IsActive() ) + { + iLongtapDetector->Cancel(); + } + } - - return TPoint( centerX, centerY ); + if( !iPhysicsActionOngoing ) + { + // Offer pointer event to long tap detector + iLongtapDetector->PointerEventL( aPointerEvent ); + + SetFocusAfterPointerEventL( aPointerEvent ); + + // If longtap event has been handled, then do not handle signal event anymore. + if( !iLongTapEventConsumed ) + { + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + else + { + iLongTapEventConsumed = EFalse; + } + + UpdateClickedField( aPointerEvent ); + } } +// --------------------------------------------------------------------------- +// CMRListPane::ActivateL +// --------------------------------------------------------------------------- +// +void CMRListPane::ActivateL() + { + FUNC_LOG; + // This ActiveteL is required only for setting the initial position + // of the field container. After setting the position, physics is + // initialized with new values also. + + CCoeControl::ActivateL(); + iFieldContainer->SetPosition( Position() ); + + // Physics: + iPhysics->InitPhysics(); + } -// ----------------------------------------------------------------------------- -// CMRListPane::HandlePointerEventL -// ----------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// CMRListPane::PhysicsEmulationEnded +// --------------------------------------------------------------------------- +// +void CMRListPane::PhysicsEmulationEnded() + { + FUNC_LOG; + DoUpdateScrollBar(); + iPhysicsActionOngoing = EFalse; + Parent()->DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRListPane::SetFocusAfterPointerEventL +// --------------------------------------------------------------------------- // -void CMRListPane::HandlePointerEventL( const TPointerEvent& aPointerEvent ) +void CMRListPane::SetFocusAfterPointerEventL( + const TPointerEvent &aPointerEvent ) { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + FUNC_LOG; + + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + TInt count( iFactory.Count() ); + for( TInt i = 0; i < count; ++i ) + { + CESMRField* field = iFactory.Field( i ); + if ( field->IsVisible() && + field->Rect().Contains( aPointerEvent.iPosition ) ) + { + CESMRField* focusedField = iFieldContainer->FocusedField(); + + if ( field != focusedField ) + { + TBool canLoseFocus( + focusedField->OkToLoseFocusL( field->FieldId() ) ); + + if ( canLoseFocus ) + { + iFieldContainer->SetControlFocusedL( field->FieldId() ); + } + } + + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// CMRListPane::UpdateClickedField +// --------------------------------------------------------------------------- +// +void CMRListPane::UpdateClickedField( const TPointerEvent &aPointerEvent ) + { + FUNC_LOG; + TInt fieldCount( iFactory.Count() ); + + for( TInt i = 0; i < fieldCount; ++i ) { - TInt count = iFactory.Count(); - for ( TInt i = 0; i < count; ++i ) + if( iFactory.Field( i )->Rect().Contains( + aPointerEvent.iPosition ) ) { - CESMRField* field = static_cast(iFactory.Field( i ) ); - TRect r = field->Rect(); - TBool tapped = field->Rect().Contains( aPointerEvent.iPosition ); - if (tapped && field->IsVisible() && !field->IsFocused() ) + if( aPointerEvent.iType == TPointerEvent::EButton1Down ) { - MoveFocusL( i ); - break; + iClickedField = iFactory.Field( i ); } } } - // here some fields can further adjust their state (for example, CESMRResponseField has sub-fields) - CCoeControl::HandlePointerEventL(aPointerEvent); } + +// --------------------------------------------------------------------------- +// CMRListPane::HiddenFocus +// --------------------------------------------------------------------------- +// +TBool CMRListPane::HiddenFocus() + { + FUNC_LOG; + TBool hiddenFocus( EFalse ); + + CESMRField* focusedField( iFieldContainer->FocusedField() ); + TInt focusedFieldIndex( IndexByFieldId( + iFactory, focusedField->FieldId() ) ); + + if ( focusedFieldIndex < iFactory.Count() ) + { + TRect focusedFieldRect( focusedField->Rect() ); + TRect listPaneRect( Rect() ); + + TInt fieldTopY( focusedFieldRect.iTl.iY ); + TInt fieldBottomY( focusedFieldRect.iBr.iY ); + + TInt listTopY( listPaneRect.iTl.iY ); + TInt listBottomY( listPaneRect.iBr.iY ); + + if ( ( fieldBottomY > listBottomY || + fieldTopY < listTopY ) && + focusedFieldRect.Height() < listPaneRect.Height() ) + { + hiddenFocus = ETrue; + } + } + return hiddenFocus; + } + // End of file - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrlistpanephysics.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrlistpanephysics.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR listpane physics impl +* +*/ + +#include "cmrlistpanephysics.h" +#include "cmrlistpane.h" +#include "nmrlayoutmanager.h" +#include "cmrfieldcontainer.h" + +#include + +//DEBUG +#include "emailtrace.h" + + +namespace { // codescanner::namespace + +const TInt KCustomDragTreshold( 10 ); + +} // namespace + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::CMRListPanePhysics +// --------------------------------------------------------------------------- +// +CMRListPanePhysics::CMRListPanePhysics( + CCoeControl& aParent, + CMRFieldContainer& aViewControl, + MMRPhysicsObserver& aPhysicsObserver ) + : iParent( aParent ), + iViewControl( aViewControl ), + iPhysicsObserver( aPhysicsObserver ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::ConstructL +// --------------------------------------------------------------------------- +// +void CMRListPanePhysics::ConstructL() + { + FUNC_LOG; + iFeatureEnabled = CAknPhysics::FeatureEnabled(); + if ( iFeatureEnabled ) + { + // Physics: Create physics + // Give pointer to control that should be able to flick/drag + iPhysics = CAknPhysics::NewL( *this, &iViewControl ); + } + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::NewL +// --------------------------------------------------------------------------- +// +CMRListPanePhysics* CMRListPanePhysics::NewL( + CCoeControl& aParent, + CMRFieldContainer& aViewControl, + MMRPhysicsObserver& aPhysicsObserver ) + { + FUNC_LOG; + CMRListPanePhysics* self = + new ( ELeave ) CMRListPanePhysics( + aParent, + aViewControl, + aPhysicsObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::~CMRListPanePhysics +// --------------------------------------------------------------------------- +// +CMRListPanePhysics::~CMRListPanePhysics() + { + FUNC_LOG; + delete iPhysics; + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::HandlePointerEventL +// --------------------------------------------------------------------------- +// +TBool CMRListPanePhysics::HandlePointerEventL( + const TPointerEvent& aPointerEvent, TBool& aEventsBlocked ) + { + FUNC_LOG; + TBool physicsStarted( EFalse ); + if ( !iFeatureEnabled || iPhysics->OngoingPhysicsAction() == + CAknPhysics::EAknPhysicsActionBouncing ) + { + return physicsStarted; + } + + // Down + if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + { + // Save start time and start point + iStartTime.HomeTime(); + iStartPoint = aPointerEvent.iPosition; + iDragPoint = iStartPoint; + } + + // Drag + else if ( aPointerEvent.iType == TPointerEvent::EDrag ) + { + // Check how position was changed and report to physics + TPoint deltaPoint( iDragPoint - aPointerEvent.iPosition ); + if( Abs( deltaPoint.iY ) < KCustomDragTreshold ) + { + deltaPoint.iX = 0; + deltaPoint.iY = 0; + } + + iDragPoint = aPointerEvent.iPosition; + iPhysics->RegisterPanningPosition( deltaPoint ); + } + + // Up + else if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + // Calculate dragging distance + TPoint drag( iStartPoint - aPointerEvent.iPosition ); + + if( Abs( drag.iY ) < KCustomDragTreshold ) + { + drag.iX = 0; + drag.iY = 0; + } + + // Start physics + physicsStarted = iPhysics->StartPhysics( drag, iStartTime ); + + if( physicsStarted ) + { + aEventsBlocked = ETrue; + } + else + { + aEventsBlocked = EFalse; + } + } + + // Record previous pointer event + iPreviousPointerEvent = aPointerEvent; + + return physicsStarted; + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::InitPhysicsL +// --------------------------------------------------------------------------- +// +void CMRListPanePhysics::InitPhysics() + { + FUNC_LOG; + if ( !iFeatureEnabled ) + { + return; + } + TRect parentRect( iParent.Rect() ); + + iWorldSize.iHeight = iViewControl.MinimumSize().iHeight; + iWorldSize.iWidth = iViewControl.MinimumSize().iWidth; + + iViewSize.iHeight = parentRect.Height(); + iViewSize.iWidth = parentRect.Width(); + + if( iWorldSize.iHeight < iViewSize.iHeight ) + { + iWorldSize.iHeight = iViewSize.iHeight; + } + + + + iPhysics->ResetFriction(); + + TRAP_IGNORE( iPhysics->InitPhysicsL( iWorldSize, iViewSize, EFalse ) ); + iPhysics->UpdateViewWindowControl( &iParent ); + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::SetWorldHeight +// --------------------------------------------------------------------------- +// +void CMRListPanePhysics::SetWorldHeight( TInt aWorldHeight ) + { + FUNC_LOG; + if ( !iFeatureEnabled ) + { + return; + } + iWorldSize.iHeight = aWorldHeight; + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::ViewPositionChanged +// --------------------------------------------------------------------------- +// +void CMRListPanePhysics::ViewPositionChanged( const TPoint& aNewPosition, + TBool aDrawNow, + TUint /*aFlags*/ ) + { + FUNC_LOG; + if ( !iFeatureEnabled ) + { + return; + } + if ( iPhysics->OngoingPhysicsAction() == + CAknPhysics::EAknPhysicsActionBouncing ) + { + return; + } + + iVerScrollIndex = aNewPosition.iY - iViewSize.iHeight / 2; + + // Parents position is taken into account, by + // adding the extra x and y coordinates to field containers + // new position. + iViewControl.SetPosition( TPoint( + iParent.Position().iX, + -iVerScrollIndex + iParent.Position().iY ) ); + + // Draw only when drawing is allowed + if ( aDrawNow ) + { + iParent.DrawDeferred(); + } + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::PhysicEmulationEnded +// --------------------------------------------------------------------------- +// +void CMRListPanePhysics::PhysicEmulationEnded() + { + FUNC_LOG; + iPhysicsObserver.PhysicsEmulationEnded(); + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::ViewPosition +// --------------------------------------------------------------------------- +// +TPoint CMRListPanePhysics::ViewPosition() const + { + FUNC_LOG; + if ( !iFeatureEnabled ) + { + return TPoint( iParent.Position() ); + } + + // This is the default implementation + TPoint viewPosition( + iViewSize.iWidth / 2, + iViewSize.iHeight / 2 + iVerScrollIndex ); + + return viewPosition; + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::UpdateVerticalScrollIndex +// --------------------------------------------------------------------------- +// +void CMRListPanePhysics::UpdateVerticalScrollIndex( TInt aVerScrollIndex ) + { + FUNC_LOG; + if ( iFeatureEnabled ) + { + // Physics' new position is updated to this member, when field + // container is scrolled by someone else than physics. + iVerScrollIndex = aVerScrollIndex; + } + } + +// --------------------------------------------------------------------------- +// CMRListPanePhysics::VerticalScrollIndex +// --------------------------------------------------------------------------- +// +TInt CMRListPanePhysics::VerticalScrollIndex() + { + return iVerScrollIndex; + } +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrnaviarrow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrnaviarrow.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,292 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Navigation arrow (used to replace the navipane). +* +*/ + +#include "cmrnaviarrow.h" +#include "nmrbitmapmanager.h" +#include "cesmrviewerdialog.h" +#include "esmricalvieweropcodes.hrh" + +#include +#include +#include + +#include "emailtrace.h" + +namespace +{ +// Value table for 70% Transparency +const TInt KTransparency[256] = + { + 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, + 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 13, 13, 13, + 14, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, + 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, + 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, + 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, + 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 40, 40, 40, + 41, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 46, + 46, 46, 47, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, + 51, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, + 57, 57, 57, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, + 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 67, 67, 67, + 68, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 71, 71, 72, 72, 72, 73, + 73, 73, 74, 74, 74, 74, 75, 75, 75, 76, 76, 76, 77, 77 + }; + +} + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRNaviArrow::NewL() +// --------------------------------------------------------------------------- +// +CMRNaviArrow* CMRNaviArrow::NewL( const CCoeControl* aParent, + TArrowType aType, + MESMRNaviArrowEventObserver* aObserver, + TSize aIconSize ) + { + FUNC_LOG; + CMRNaviArrow* self = new (ELeave) CMRNaviArrow( aObserver, aType, aIconSize ); + CleanupStack::PushL( self ); + self->ConstructL( aParent); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::CMRNaviArrow() +// --------------------------------------------------------------------------- +// +CMRNaviArrow::CMRNaviArrow( MESMRNaviArrowEventObserver* aObserver, TArrowType aType, TSize aIconSize ) + :iObserver(aObserver), + iArrowType(aType), + iIconSize( aIconSize ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::~CMRNaviArrow +// --------------------------------------------------------------------------- +// +CMRNaviArrow::~CMRNaviArrow() + { + FUNC_LOG; + delete iArrow; + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::ConstructL() +// --------------------------------------------------------------------------- +// +void CMRNaviArrow::ConstructL( const CCoeControl* aParent ) + { + FUNC_LOG; + CreateWindowL( aParent ); + EnableWindowTransparency(); + InitNaviArrowsL(); + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::InitNaviArrows() +// --------------------------------------------------------------------------- +// +void CMRNaviArrow::InitNaviArrowsL() + { + FUNC_LOG; + // Button + // TODO: Icons id should be changed to correct one when available + CFbsBitmap* bitMapL( NULL ); + CFbsBitmap* bitMapMaskL( NULL ); + NMRBitmapManager::TMRBitmapId bitmapId; + if ( EMRArrowLeft == iArrowType ) + { + bitmapId = NMRBitmapManager::EMRBitmapMailPre; + } + else + { + bitmapId = NMRBitmapManager::EMRBitmapMailNext; + } + NMRBitmapManager::GetSkinBasedBitmapLC( + bitmapId, bitMapL, bitMapMaskL, iIconSize ); + + CGulIcon* transparentIconL = CreateSemiTransparentIconL( bitMapL, bitMapMaskL ); + CleanupStack::Pop( 2 ); // bitMap, bitMapMask + CleanupStack::PushL( transparentIconL ); + iArrow = CAknButton::NewL( transparentIconL, NULL, NULL, NULL, KNullDesC, + KNullDesC, KAknButtonNoFrame | KAknButtonPressedDownFrame, 0 ); + CleanupStack::Pop( transparentIconL ); + + iArrow->SetParent( this ); + iArrow->SetContainerWindowL(*this); + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRNaviArrow::SizeChanged() + { + FUNC_LOG; + iArrow->SetRect( Rect() ); + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::CountComponentControls() +// --------------------------------------------------------------------------- +// +TInt CMRNaviArrow::CountComponentControls() const + { + FUNC_LOG; + TInt count(0); + if( iArrow ) + { + count++; + } + return count; + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::ComponentControl() +// --------------------------------------------------------------------------- +// +CCoeControl* CMRNaviArrow::ComponentControl( TInt aInd ) const + { + FUNC_LOG; + CCoeControl* control = NULL; + switch ( aInd ) + { + case 0: + control = iArrow; + break; + default: + break; + } + + return control; + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::HandlePointerEventL() +// --------------------------------------------------------------------------- +// +void CMRNaviArrow::HandlePointerEventL( const TPointerEvent &aPointerEvent ) + { + FUNC_LOG; + CCoeControl::HandlePointerEventL(aPointerEvent); + TESMRIcalViewerOperationType operationType; + if ( EMRArrowLeft == iArrowType ) + { + operationType = EESMRCmdMailPreviousMessage; + } + else + { + operationType = EESMRCmdMailNextMessage; + } + if( aPointerEvent.iType == TPointerEvent::EButton1Up ) + { + if ( iArrow->Rect().Contains( aPointerEvent.iPosition ) ) + { + iObserver->HandleNaviArrowEventL( operationType ); + } + else + { + Parent()->HandlePointerEventL(aPointerEvent); + } + } + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::SetNaviArrowStatus() +// --------------------------------------------------------------------------- +// +void CMRNaviArrow::SetNaviArrowStatus( TBool aVisible ) + { + FUNC_LOG; + iArrow->MakeVisible( aVisible ); + DrawDeferred(); + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::Draw() +// --------------------------------------------------------------------------- +// +void CMRNaviArrow::Draw(const TRect& /*aRect*/) const + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRNaviArrow::CreateSemiTransparentIconL() +// --------------------------------------------------------------------------- +// +CGulIcon* CMRNaviArrow::CreateSemiTransparentIconL( CFbsBitmap* aBitMap, + CFbsBitmap* aBitMapMask ) + { + CGulIcon* newIcon(NULL); + + if ( aBitMap && aBitMapMask ) + { + newIcon = CGulIcon::NewLC(); + newIcon->SetBitmap( aBitMap ); + + CFbsBitmap* newMask = new ( ELeave ) CFbsBitmap; + CleanupStack::PushL( newMask ); + + User::LeaveIfError( newMask->Create( + newIcon->Bitmap()->SizeInPixels(), EGray256 ) ); + + CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL( newMask ); + CleanupStack::PushL( bitmapDevice ); + + CFbsBitGc* bitGc( NULL ); + User::LeaveIfError( bitmapDevice->CreateContext( bitGc ) ); + CleanupStack::PushL( bitGc ); + + bitGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); + bitGc->BitBlt( TPoint( 0, 0 ), aBitMapMask ); + + newMask->LockHeap(); + TInt w = aBitMapMask->SizeInPixels().iWidth; + TInt h = aBitMapMask->SizeInPixels().iHeight; + TInt dataStride = aBitMapMask->DataStride() - w; + unsigned char* address = (unsigned char *)newMask->DataAddress(); + + for ( TInt i = 0; i < h; ++i ) + { + for ( TInt j = 0; j < w; ++j ) + { + *address = KTransparency[*address]; + ++address; + } + address += dataStride; + } + + newMask->UnlockHeap(); + newIcon->SetMask( newMask ); + + CleanupStack::PopAndDestroy( 2 ); // bitmapDevice, bitGc + CleanupStack::Pop( 2 ); // newIcon, newMask + } + + return newIcon; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrresponsedialogview.cpp --- a/meetingrequest/mrgui/src/cmrresponsedialogview.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrgui/src/cmrresponsedialogview.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,39 +16,13 @@ */ #include "cmrresponsedialogview.h" // System includes -#include -#include +#include +#include #include -#include -#include -#include -#include - +#include // DEBUG #include "emailtrace.h" -// LOCAL DEFINITIONS -namespace // codescanner::namespace - { - #define KDefaultTextColor TRgb( 0x000000 ); - /// Get the text color from skin - TRgb TextColor( TInt aSkinColorId ) - { - TRgb bgColor; - TInt err; - - err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - bgColor, - KAknsIIDQsnTextColors, - aSkinColorId ); - if( err != KErrNone ) - { - bgColor = KDefaultTextColor; - } - return bgColor; - } - } - // --------------------------------------------------------------------------- // CESMRResponseDialogView::NewL // --------------------------------------------------------------------------- @@ -177,16 +151,11 @@ CCoeControl::SetContainerWindowL( aContainer ); iEditor = new (ELeave )CEikRichTextEditor(); iEditor->ConstructL( this, 0, 0, CEikEdwin::ENoAutoSelection, 0, 0 ); - iEditor->SetContainerWindowL(*this); - iEditor->SetSize(Rect().Size()); + iEditor->SetFocus( ETrue ); + iEditor->SetContainerWindowL( *this ); + iEditor->SetSize( Rect().Size() ); iEditor->SetSkinBackgroundControlContextL( iBgContext ); - iEditor->SetFocus( ETrue ); - - // Create vertical scrollbar for editor - iScrollBarFrame = iEditor->CreateScrollBarFrameL(); - iScrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn ); - - TRAP_IGNORE( SetFontColorL() ); + iEditor->EnableCcpuSupportL(ETrue); } // --------------------------------------------------------------------------- @@ -200,12 +169,7 @@ if ( aType == KEikDynamicLayoutVariantSwitch ) { - SizeChanged(); - } - else if ( aType == KAknsMessageSkinChange || - aType == KEikMessageColorSchemeChange ) - { - TRAP_IGNORE( SetFontColorL() ); + iEditor->SetRect( Rect() ); } } @@ -225,56 +189,8 @@ } if( iEditor ) { - // Reduce scrollbar width from the editor width - TRect rect = Rect(); - TInt scrollbarWidth = iEditor->ScrollBarFrame()->ScrollBarBreadth( CEikScrollBar::EVertical ); - TInt editorWidth = rect.Width() - scrollbarWidth; - if ( AknLayoutUtils::LayoutMirrored() ) - { - iEditor->SetExtent( TPoint( scrollbarWidth, 0 ), TSize( editorWidth, rect.Height() ) ); - } - else - { - iEditor->SetExtent( TPoint( 0, 0 ), TSize( editorWidth, rect.Height() ) ); - } + iEditor->SetRect( Rect() ); } } -// --------------------------------------------------------------------------- -// CESMRResponseDialogView::MinimumSize() -// --------------------------------------------------------------------------- -// -TSize CESMRResponseDialogView::MinimumSize() - { - FUNC_LOG; - TRect rect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); - return rect.Size(); - } - -// ----------------------------------------------------------------------------- -// CESMRResponseDialogView::SetFontColorL() -// ----------------------------------------------------------------------------- -// -void CESMRResponseDialogView::SetFontColorL() - { - const CFont* sysfont = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont, NULL ); - TFontSpec fontSpec = sysfont->FontSpecInTwips(); - TCharFormat charFormat; - TCharFormatMask formatMask; - charFormat.iFontSpec = fontSpec; - - formatMask.SetAttrib( EAttFontTypeface ); - formatMask.SetAttrib( EAttFontHeight ); - formatMask.SetAttrib( EAttFontPosture ); - - charFormat.iFontPresentation.iTextColor = TextColor( EAknsCIQsnTextColorsCG6 ); - formatMask.SetAttrib( EAttColor ); - - CCharFormatLayer* charFormatLayer = - CCharFormatLayer::NewL( charFormat, formatMask ); - - iEditor->SetCharFormatLayer( charFormatLayer ); - } - // end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrsystemnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrsystemnotifier.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Field event queue implementation +* +*/ + +#include "cmrsystemnotifier.h" +#include "cesmrfieldeventqueue.h" +#include "cesmrfieldcommandevent.h" +#include "esmrdef.h" +#include "emailtrace.h" + +#include + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +CMRSystemNotifier::CMRSystemNotifier( CESMRFieldEventQueue& aEventQueue ) +: iEventQueue( aEventQueue ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +CMRSystemNotifier::~CMRSystemNotifier() + { + FUNC_LOG; + delete iSystemNotifier; + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +CMRSystemNotifier* CMRSystemNotifier::NewL( + CESMRFieldEventQueue& aEventQueue ) + { + FUNC_LOG; + CMRSystemNotifier* self = new (ELeave) CMRSystemNotifier( aEventQueue ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +void CMRSystemNotifier::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +void CMRSystemNotifier::StartL() + { + FUNC_LOG; + + if ( !iSystemNotifier ) + { + TCallBack envCallback( EnvChangeCallbackL, this ); + + iSystemNotifier = + CEnvironmentChangeNotifier::NewL( + EPriorityNormal, + envCallback ); + + iSystemNotifier->Start(); + } + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +void CMRSystemNotifier::Stop() + { + FUNC_LOG; + delete iSystemNotifier; + iSystemNotifier = NULL; + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::CESMRFieldEventQueue +// --------------------------------------------------------------------------- +// +TInt CMRSystemNotifier::EnvChangeCallbackL( TAny* aThisPtr ) + { + CMRSystemNotifier* thisObject = static_cast(aThisPtr); + + ASSERT( thisObject ); + + thisObject->DoEnvChangeL(); + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CMRSystemNotifier::DoEnvChangeL +// --------------------------------------------------------------------------- +// +void CMRSystemNotifier::DoEnvChangeL() + { + FUNC_LOG; + + // EChangesLocale + TInt change( iSystemNotifier->Change() ); + + if ( EChangesLocale & change ) + { + // Broadcast MRUI event + iEventQueue.NotifyEventAsyncL( + CESMRFieldCommandEvent::NewL( NULL, EMRCmdDoEnvironmentChange) ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/cmrtoolbar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/cmrtoolbar.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Toolbar impl +* +*/ + +#include "cmrtoolbar.h" + +#include "esmrcommands.h" +#include "cmrasynchcmd.h" +#include +#include +#include +#include +#include + +// LOCAL DEFINITIONS +namespace // codescanner::namespace + { + const TInt KFirstItemIndex( 0 ); + const TInt KSecondItemIndex( 1 ); + const TInt KThirdItemIndex( 2 ); + } + +// CLASS MEMBERS DEFINITIONS +// --------------------------------------------------------------------------- +// CMRToolbar::CMRToolbar +// --------------------------------------------------------------------------- +// +CMRToolbar::CMRToolbar() + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRToolbar::NewL +// --------------------------------------------------------------------------- +// +CMRToolbar* CMRToolbar::NewL() + { + CMRToolbar* self = new ( ELeave ) CMRToolbar(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRToolbar::~CMRToolbar +// --------------------------------------------------------------------------- +// +CMRToolbar::~CMRToolbar() + { + if( iToolbar ) + { + RemovePreviousItems(); + delete iToolbar; + } + if( iPreviousToolbar ) + { + iPreviousToolbar->SetToolbarVisibility( iPreviousVisibility ); + static_cast( + CEikonEnv::Static()->AppUiFactory() )->SetViewFixedToolbar( iPreviousToolbar );// codescanner::eikonenvstatic + } + + iItemIdArray.Close(); + delete iAsyncCmd; + } + +// --------------------------------------------------------------------------- +// CMRToolbar::ConstructL +// --------------------------------------------------------------------------- +// +void CMRToolbar::ConstructL() + { + // This does not guarantee that the iPreviousToolbar is constructed + iPreviousToolbar = static_cast( + CEikonEnv::Static()->AppUiFactory() )->CurrentFixedToolbar();// codescanner::eikonenvstatic + if ( iPreviousToolbar ) + { + iPreviousVisibility = iPreviousToolbar->IsShown(); + iPreviousToolbar->SetToolbarVisibility( EFalse ); + } + } + +// --------------------------------------------------------------------------- +// CMRToolbar::InitializeToolbar +// --------------------------------------------------------------------------- +// +void CMRToolbar::InitializeToolbarL( + TToolbarContext aCntx, + CAknToolbar* aNativeToolbar ) + { + if( aNativeToolbar ) + { + iToolbar = aNativeToolbar; + } + else + { + iToolbar = CAknToolbar::NewL( R_GLOBAL_TOOLBAR ); + } + + iToolbar->SetToolbarObserver( this ); + static_cast( + CEikonEnv::Static()->AppUiFactory() )->SetViewFixedToolbar( iToolbar );// codescanner::eikonenvstatic + // Construct the correct toolbar for the context + TInt error( KErrNone ); + TRAP( error, ConstructToolbarL( aCntx ) ); + if ( error != KErrNone ) + { + CEikonEnv::Static()->HandleError( error );// codescanner::eikonenvstatic + } + } + +// --------------------------------------------------------------------------- +// CMRToolbar::SetObserver +// --------------------------------------------------------------------------- +// +void CMRToolbar::ShowToolbar( TBool aShowToolbar ) + { + if( iToolbar ) + { + iToolbar->SetToolbarVisibility( aShowToolbar ); + } + } + +// --------------------------------------------------------------------------- +// CMRToolbar::SetObserver +// --------------------------------------------------------------------------- +// +void CMRToolbar::SetObserver( MAknToolbarObserver* aObserver ) + { + iObserver = aObserver; + } + +// --------------------------------------------------------------------------- +// CMRToolbar::ConstructToolbarL +// --------------------------------------------------------------------------- +// +void CMRToolbar::ConstructToolbarL( TToolbarContext aCntx ) + { + RemovePreviousItems(); + + switch( aCntx ) + { + case EMRViewerFromMailApp: + case EMRViewerAttendee: + { + iItemIdArray.Append( EESMRCmdAcceptMR ); + iItemIdArray.Append( EESMRCmdTentativeMR ); + iItemIdArray.Append( EESMRCmdDeclineMR ); + + ConstructButtonL( + R_TOOLBAR_BUTTON_ACCEPT, + KFirstItemIndex ); + ConstructButtonL( + R_TOOLBAR_BUTTON_TENTATIVE, + KSecondItemIndex ); + ConstructButtonL( + R_TOOLBAR_BUTTON_DECLINE, + KThirdItemIndex ); + break; + } + default: + break; + } + } + +// --------------------------------------------------------------------------- +// CMRToolbar::ConstructButtonL +// --------------------------------------------------------------------------- +// +void CMRToolbar::ConstructButtonL( TInt aResId, TInt aIndex ) + { + TInt flags( 0 ); + CAknButton* newButton = + CAknButton::NewL( aResId ); + // Ownership of the button is taken right away, no need for CleanupStack + iToolbar->AddItemL( + newButton, EAknCtButton, iItemIdArray[aIndex], + flags, aIndex ); + } + +// --------------------------------------------------------------------------- +// CMRToolbar::DynInitToolbarL +// --------------------------------------------------------------------------- +// +void CMRToolbar::DynInitToolbarL ( TInt aResourceId, CAknToolbar *aToolbar ) + { + if( iObserver ) + { + iObserver->DynInitToolbarL( aResourceId, aToolbar ); + } + } + +// --------------------------------------------------------------------------- +// CMRToolbar::OfferToolbarEventL +// --------------------------------------------------------------------------- +// +void CMRToolbar::OfferToolbarEventL ( TInt aCommand ) + { + // Handle commands here + if( iObserver ) + { + // Lazy init + if( !iAsyncCmd ) + { + iAsyncCmd = CMRAsynchCmd::NewL(); + } + // This will notify observer asynchronously + iAsyncCmd->NotifyObserver( aCommand, iObserver ); + } + } + +// --------------------------------------------------------------------------- +// CMRToolbar::RemovePreviousItems +// --------------------------------------------------------------------------- +// +void CMRToolbar::RemovePreviousItems() + { + TInt count( iItemIdArray.Count() ); + for( TInt i = 0; i < count; ++i ) + { + iToolbar->RemoveItem( iItemIdArray[ i ] ); + } + iItemIdArray.Reset(); + } + +// --------------------------------------------------------------------------- +// CMRToolbar::Rect +// --------------------------------------------------------------------------- +// +TRect CMRToolbar::Rect() + { + TRect rect( 0, 0, 0, 0 ); + + if( iToolbar && iToolbar->IsShown() ) + { + rect = iToolbar->Rect(); + } + + return rect; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/esmrvcalexport.cpp --- a/meetingrequest/mrgui/src/esmrvcalexport.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: VCal exporter for send ui wrapper -* -*/ - - -//debug -// INCLUDE FILES -#include "emailtrace.h" -#include "esmrvcalexport.h" - -#include // r_qtn_meet_req_conflict_unnamed -#include -#include -#include // For FeatureIds -#include -#include -#include -#include -#include - -namespace { - -// LOCAL CONSTANTS AND MACROS -const TInt KDynBufExpandSize(100); - -// This flag definition should match EUTCTime flag -// in \s60\AgnVersit\inc\S60AgnVersit.h -#define S60AGNVERSIT_EUTCTIME 0x1000 -#define S60AGNVERSIT_EJAPAN 0x2000 - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// TESMRVCalExport::TESMRVCalExport() -// --------------------------------------------------------------------------- -// -TESMRVCalExport::TESMRVCalExport( - CCalSession& aCalSession, - RFs& aFileServerSession): - iSession(aCalSession), - iFs(aFileServerSession) - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// TESMRVCalExport::ExportVCalLC() -// --------------------------------------------------------------------------- -// -HBufC8* TESMRVCalExport::ExportVCalLC(CCalEntry& aEntry) - { - FUNC_LOG; - - const TDesC& subject=aEntry.SummaryL(); - - TBool emptySubject = subject.Length() ==0; - if (emptySubject) - { - // If subject is empty, we add text to it - HBufC* unnamed = - StringLoader::LoadLC( - R_QTN_MEET_REQ_CONFLICT_UNNAMED, - CEikonEnv::Static()); // codescanner::eikonenvstatic - - aEntry.SetSummaryL(*unnamed); - CleanupStack::PopAndDestroy(unnamed); - } - - CBufFlat* buf = CBufFlat::NewL( KDynBufExpandSize ); - CleanupStack::PushL(buf); - ConvertVCalL(buf, aEntry); - - HBufC8* result = HBufC8::NewL( buf->Size() ); - result->Des().Copy(buf->Ptr(0)); - CleanupStack::PopAndDestroy(buf); - CleanupStack::PushL(result); - - return result; - } - -// --------------------------------------------------------------------------- -// TESMRVCalExport::ConvertVCalL() -// --------------------------------------------------------------------------- -// -void TESMRVCalExport::ConvertVCalL(CBufFlat* aBuf, CCalEntry& aEntry) - { - FUNC_LOG; - - // CCalEntry is converted to VCal - RBufWriteStream writeStream; - writeStream.Open(*aBuf); - CleanupClosePushL(writeStream); - CCalenExporter* exporter=CCalenExporter::NewL(iSession); - CleanupStack::PushL(exporter); - exporter->ExportVCalL( aEntry, writeStream); - CleanupStack::PopAndDestroy(exporter); - CleanupStack::PopAndDestroy(&writeStream); - - } - -// --------------------------------------------------------------------------- -// TESMRVCalExport::ConvertICalL() -// --------------------------------------------------------------------------- -// -void TESMRVCalExport::ConvertICalL(CBufFlat* aBuf, CCalEntry& aEntry) - { - FUNC_LOG; - - // CCalEntry is converted to iCal - RBufWriteStream writeStream; - writeStream.Open(*aBuf); - CleanupClosePushL(writeStream); - CCalenExporter* exporter=CCalenExporter::NewL(iSession); - CleanupStack::PushL(exporter); - exporter->ExportICalL( aEntry, writeStream); - CleanupStack::PopAndDestroy(exporter); - CleanupStack::PopAndDestroy(&writeStream); - - } - - -// End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/nmrbitmapmanager.cpp --- a/meetingrequest/mrgui/src/nmrbitmapmanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,568 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Bitmap manager for MRGUI usage. -* -*/ - -#include "nmrbitmapmanager.h" -#include "esmrhelper.h" - -#include -#include -#include -#include -#include - -using namespace NMRBitmapManager; - -namespace { // codescanner::unnamednamespace - -// Icon mif file. -_LIT( KESMRMifFile, "esmrgui.mif"); - -#ifdef _DEBUG - -// Definition for panic text -_LIT( KNMRBitmapManager, "NMRBitmapManager" ); - -/** - * ES MR Entry panic codes - */ -enum TNMRBitmapManager - { - KUnhandledBitmapId = 1 - }; - -/** - * Raises panic. - * @param aPanic Panic code - */ -void Panic(TNMRBitmapManager aPanic) - { - User::Panic( KNMRBitmapManager, aPanic); - } - -#endif // _DEBUG - -} - -// --------------------------------------------------------------------------- -// NMRBitmapManager::GetBitmapStruct -// --------------------------------------------------------------------------- -// -EXPORT_C TMRBitmapStruct NMRBitmapManager::GetBitmapStruct( TMRBitmapId aBitmapId ) - { - TMRBitmapStruct bitmapStruct; - - switch ( aBitmapId ) - { - case EMRBitmapRightClickArrow: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowRight; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; - break; - } - case EMRBitmapTrackingAccept: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingAccept; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept_mask; - break; - } - case EMRBitmapTrackingReject: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingReject; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject_mask; - break; - } - case EMRBitmapTrackingTentative: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingTentative; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative_mask; - break; - } - case EMRBitmapTrackingNone: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingNone; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none_mask; - break; - } - case EMRBitmapPriorityHigh: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityHigh; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high_mask; - break; - } - case EMRBitmapPriorityLow: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityLow; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low_mask; - break; - } - case EMRBitmapPriorityNormal: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityNormal; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal_mask; - break; - } - case EMRBitmapSynchronization: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailSynchronisation; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation_mask; - break; - } - case EMRBitmapSubject: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarSubject; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject_mask; - break; - } - case EMRBitmapOccasion: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarOccasion; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion_mask; - break; - } - case EMRBitmapRecurrence: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarRecurrence; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence_mask; - break; - } - case EMRBitmapBrowser: - { - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_browserng; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_browserng_mask; - - bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; //KAknsIIDQgnMenuBrowserng - break; - } - case EMRBitmapIntranet: - { - bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_intranet; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_intranet_mask; - break; - } - case EMRBitmapBookmark: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailWmlBookmark; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark_mask; - break; - } - case EMRBitmapAlarm: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqAlarm; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; - break; - } - case EMRBitmapAlarmDate: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarAlarm; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_mask; - break; - } - case EMRBitmapAlarmTime: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarAlarm; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_alarm_mask; - break; - } - case EMRBitmapAlarmClock: - { - // bitmapStruct.iItemId = KAknsIIDQgnIndiCalendarClockAlarm; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; - break; - } - case EMRBitmapCheckBoxOn: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCheckboxOn; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_checkbox_on; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_checkbox_on_mask; - break; - } - case EMRBitmapCheckBoxOff: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCheckboxOff; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_checkbox_off; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_checkbox_off_mask; - break; - } - case EMRBitmapClock: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqClock; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock_mask; - break; - } - case EMRBitmapLocation: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqLocation; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location_mask; - break; - } - case EMRBitmapDateStart: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateStart; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start_mask; - break; - } - case EMRBitmapDateEnd: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateEnd; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end_mask; - break; - } - case EMRBitmapAttachment: - { - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailAttachment; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; - break; - } - case EMRBitmapCtrlBar: - { - bitmapStruct.iItemId = KAknsIIDQgnGrafCmailEmailCtrlbar; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar_mask; - break; - } - - case EMRBitmapListCenter: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListCenter; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; - break; - } - case EMRBitmapListTop: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListSideT; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; - break; - } - case EMRBitmapListBottom: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListSideB; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; - break; - } - case EMRBitmapListLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListSideL; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; - break; - } - case EMRBitmapListRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListSideR; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; - break; - } - case EMRBitmapListTopLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTl; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; - break; - } - case EMRBitmapListTopRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTr; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; - break; - } - case EMRBitmapListBottomLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBl; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; - break; - } - case EMRBitmapListBottomRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBr; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; - break; - } - - case EMRBitmapMailAttachment: - { - bitmapStruct.iItemId = KAknsIIDQgnFseMailAttachment; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; - break; - } - case EMRBitmapOpenAttachmentView: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentListOptionsViewAll; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all_mask; - break; - } - case EMRBitmapOpenAttachment: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentOpen; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open_mask; - break; - } - case EMRBitmapDownloadAttachment: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownload; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_mask; - break; - } - case EMRBitmapDownloadAllAttachments: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownloadAll; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all_mask; - break; - } - case EMRBitmapSaveAttachment: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSave; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_mask; - break; - } - case EMRBitmapSaveAllAttachments: - { - bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSaveAll; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all_mask; - break; - } - - case EMRBitmapInputCenter: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputCenter; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; - break; - } - case EMRBitmapInputTop: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputSideT; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; - break; - } - case EMRBitmapInputBottom: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputSideB; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; - break; - } - case EMRBitmapInputLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputSideL; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; - break; - } - case EMRBitmapInputRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputSideR; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; - break; - } - case EMRBitmapInputTopLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTl; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; - break; - } - case EMRBitmapInputTopRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTr; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; - break; - } - case EMRBitmapInputBottomLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBl; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; - break; - } - case EMRBitmapInputBottomRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBr; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; - break; - } - - case EMRBitmapSetOptCenter: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCenter; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; - break; - } - case EMRBitmapSetOptTop: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideT; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; - break; - } - case EMRBitmapSetOptBottom: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideB; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; - break; - } - case EMRBitmapSetOptLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideL; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; - break; - } - case EMRBitmapSetOptRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideR; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; - break; - } - case EMRBitmapSetOptTopLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTl; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; - break; - } - case EMRBitmapSetOptTopRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTr; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; - break; - } - case EMRBitmapSetOptBottomLeft: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBl; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; - break; - } - case EMRBitmapSetOptBottomRight: - { - bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBr; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; - break; - } - - default: - { - // We shouldn't end up here. - __ASSERT_DEBUG( EFalse, Panic( KUnhandledBitmapId ) ); - bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowRight; - bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right; - bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_right_mask; - break; - } - } - - return bitmapStruct; - } - -// --------------------------------------------------------------------------- -// NMRBitmapManager::GetSkinBasedBitmap -// --------------------------------------------------------------------------- -// -EXPORT_C TInt NMRBitmapManager::GetSkinBasedBitmap( - TMRBitmapId aBitmapId, - CFbsBitmap*& aBitmap, - CFbsBitmap*& aMask, - TSize aSize ) - { - TInt retValue = KErrNone; - if( aBitmap ) - { - delete aBitmap; - aBitmap = NULL; - } - if( aMask ) - { - delete aMask; - aMask = NULL; - } - - TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); - - TFileName bitmapFilePath; - ESMRHelper::LocateResourceFile( - KESMRMifFile, - KDC_APP_BITMAP_DIR, - bitmapFilePath ); - - TRAPD( error, AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - bitmapStruct.iItemId, - aBitmap, - aMask, - bitmapFilePath, - bitmapStruct.iFallbackIndex, - bitmapStruct.iFallbackMaskIndex ) ); - - if ( error != KErrNone ) - { - return error; - } - - AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); - - if( !aBitmap || !aMask ) - { - retValue = KErrNotFound; - } - return retValue; - } - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/nmrlayoutmanager.cpp --- a/meetingrequest/mrgui/src/nmrlayoutmanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,286 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Layout manager for MRGUI usage. -* -*/ - -#include "nmrlayoutmanager.h" - -#include -#include -#include - - -using namespace NMRLayoutManager; - - -// Unnamed namespace for local definitions -namespace { // codescanner::unnamednamespace - - const TInt KVarietyZero = 0; - - // Numerals for layout data usage. - const TInt KLayoutValueZero = 0; - const TInt KLayoutValueOne = 1; - const TInt KLayoutValueTwo = 2; - const TInt KLayoutValueThree = 3; - const TInt KLayoutValueFour = 4; - const TInt KLayoutValueFive = 5; - -#ifdef _DEBUG - _LIT( KNMRLayoutManagerPanicText, "NMRLayoutManager" ); - enum TNMRLayoutManagerPanic - { - ENMRLayoutManagerUnhandledCase = 1, - }; - void Panic( TNMRLayoutManagerPanic aPanic ) - { - User::Panic( KNMRLayoutManagerPanicText, aPanic ); - } -#endif - -} // Unnamed namespace - - -// --------------------------------------------------------------------------- -// NMRLayoutManager::GetWindowComponentLayout -// --------------------------------------------------------------------------- -// -EXPORT_C TAknWindowComponentLayout NMRLayoutManager::GetWindowComponentLayout( TMRLayout aLayout ) - { - TAknWindowComponentLayout layout; - switch ( aLayout ) - { - case EMRLayoutDialog: - { - layout = AknLayoutScalable_Apps::main_sp_fs_calendar_pane( KLayoutValueZero ); - break; - } - case EMRLayoutDialogBg: - { - layout = AknLayoutScalable_Apps::bg_main_sp_fs_cale_pane( KLayoutValueOne ); - break; - } - case EMRLayoutDialogBgGraphics: - { - layout = AknLayoutScalable_Apps::bgmain_sp_fs_calendar_pane_g1( KLayoutValueZero ); - break; - } - case EMRLayoutCtrlBar: - { - layout = AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_cp01( KLayoutValueOne ); - break; - } - case EMRLayoutCtrlBarGraphics: - { - layout = AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1( KLayoutValueOne ); - break; - } - case EMRLayoutContentArea: - { - layout = AknLayoutScalable_Apps::listscroll_cale_mrui_pane( KLayoutValueOne ); - break; - } - case EMRLayoutListArea: - { - layout = AknLayoutScalable_Avkon::list_gen_pane( KVarietyZero ).LayoutLine(); - break; - } - case EMRLayoutScrollBar: - { - layout = AknLayoutScalable_Avkon::scroll_pane( KVarietyZero ).LayoutLine(); - break; - } - case EMRLayoutTextEditorIcon: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueOne ); - break; - } - case EMRLayoutTextEditorBg: - { - layout = AknLayoutScalable_Apps::bg_main_sp_fs_cale_pane( KLayoutValueOne ); - //layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp01( KLayoutValueOne ); - break; - } - case EMRLayoutTimeEditorIcon: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueTwo ); - break; - } - case EMRLayoutTimeEditorStartBg: - { - layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp01( KLayoutValueTwo ); - break; - } - case EMRLayoutTimeEditorEndBg: - { - layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp02( KLayoutValueTwo ); - break; - } - case EMRLayoutDateEditorIcon: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueThree ); - break; - } - case EMRLayoutDateEditorBg: - { - layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp01( KLayoutValueThree ); - break; - } - case EMRLayoutCheckboxIcon: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueFive ); - break; - } - default: - { - __ASSERT_DEBUG( EFalse, Panic( ENMRLayoutManagerUnhandledCase ) ); - break; - } - } - return layout; - } - -// --------------------------------------------------------------------------- -// NMRLayoutManager::GetTextComponentLayout -// --------------------------------------------------------------------------- -// -EXPORT_C TAknTextComponentLayout NMRLayoutManager::GetTextComponentLayout( TMRTextLayout aLayout ) - { - TAknTextComponentLayout layout; - switch ( aLayout ) - { - case EMRTextLayoutText: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t1( KLayoutValueZero ); - break; - } - case EMRTextLayoutTextEditor: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueOne ); - break; - } - case EMRTextLayoutTimeEditorStart: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueTwo ); - break; - } - case EMRTextLayoutTimeEditorSeparator: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t3( KLayoutValueTwo ); - break; - } - case EMRTextLayoutTimeEditorEnd: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t4( KLayoutValueTwo ); - break; - } - case EMRTextLayoutDateEditor: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueThree ); - break; - } - case EMRTextLayoutMultiRowTextEditor: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueFour ); - break; - } - case EMRTextLayoutCheckboxEditor: - { - layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueFive ); - break; - } - case EMRLayoutCtrlBarTitle: - { - layout = AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1( KLayoutValueZero ); - break; - } - default: - { - __ASSERT_DEBUG( EFalse, Panic( ENMRLayoutManagerUnhandledCase ) ); - break; - } - } - return layout; - } - -// --------------------------------------------------------------------------- -// NMRLayoutManager::GetLayoutRect -// --------------------------------------------------------------------------- -// -EXPORT_C TAknLayoutRect NMRLayoutManager::GetLayoutRect( const TRect& aParentRect, TMRLayout aLayout ) - { - TAknLayoutRect layoutRect; - TAknWindowComponentLayout layout = GetWindowComponentLayout( aLayout ); - layoutRect.LayoutRect( aParentRect, layout ); - return layoutRect; - } - -// --------------------------------------------------------------------------- -// NMRLayoutManager::GetFieldLayoutRect -// --------------------------------------------------------------------------- -// -EXPORT_C TAknLayoutRect NMRLayoutManager::GetFieldLayoutRect( const TRect& aParentRect, TInt aRows ) - { - TAknWindowComponentLayout fieldLayout; - - TAknLayoutScalableParameterLimits limits = - AknLayoutScalable_Apps::list_single_cale_mrui_pane_ParamLimits( 0 ); - - // Map aRows to lower variety limit - TInt variety = limits.FirstVariety() + ( aRows - 1 ); - // Make sure min <= variety <= max - variety = Min( limits.LastVariety(), Max( limits.FirstVariety(), variety ) ); - - fieldLayout = AknLayoutScalable_Apps::list_single_cale_mrui_pane( variety ); - TAknLayoutRect layoutRect; - layoutRect.LayoutRect( aParentRect, fieldLayout ); - return layoutRect; - } - -// --------------------------------------------------------------------------- -// NMRLayoutManager::GetFieldRowLayoutRect -// --------------------------------------------------------------------------- -// -EXPORT_C TAknLayoutRect NMRLayoutManager::GetFieldRowLayoutRect( const TRect& aParentRect, TInt aRow ) - { - TAknWindowComponentLayout rowLayout; - - TAknLayoutScalableParameterLimits limits = - AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_ParamLimits( 0 ); - - // Map aRows to lower variety limit - TInt variety = limits.FirstVariety() + ( aRow - 1 ); - // Make sure min <= variety <= max - variety = Min( limits.LastVariety(), Max( limits.FirstVariety(), variety ) ); - - rowLayout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane( variety ); - TAknLayoutRect layoutRect; - layoutRect.LayoutRect( aParentRect, rowLayout ); - return layoutRect; - } - -// --------------------------------------------------------------------------- -// NMRLayoutManager::GetLayoutText -// --------------------------------------------------------------------------- -// -EXPORT_C TAknLayoutText NMRLayoutManager::GetLayoutText( const TRect& aParentRect, TMRTextLayout aLayout ) - { - TAknLayoutText layoutText; - TAknTextComponentLayout layout = GetTextComponentLayout( aLayout ); - layoutText.LayoutText( aParentRect, layout ); - return layoutText; - } - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/resmrstatic.cpp --- a/meetingrequest/mrgui/src/resmrstatic.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,329 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Static Tls data storage -* -*/ - - -#include "emailtrace.h" -#include "resmrstatic.h" - -#include "cesmrcontactmenuhandler.h" -#include "cesmrcontactmanagerhandler.h" -#include "cfsmailclient.h" -#include "cfsmailbox.h" -// Removed profiling - -/** - * Storage stuct for RESMRStatic. - */ -struct TESMRStaticData - { - TInt iInstanceCount; - TInt iContactManagerHandlerCount; - CESMRContactManagerHandler* iContactManagerHandler; - TInt iContactMenuHandlerCount; - CESMRContactMenuHandler* iContactMenuHandler; - CFSMailClient* iFSMailClient; - CFSMailBox* iFSMailBox; - - TInt iPbkxContactListingServiceCount; - TInt iCurrentFieldIndex; - TInt iFSMailBoxCount; - }; - -// --------------------------------------------------------------------------- -// Cleanup operation for RPointerArray. -// @param aArray Pointer to RPointerArray. -// --------------------------------------------------------------------------- -// -void MailboxPointerArrayCleanup( TAny* aArray ) - { - // just to avoid warnings when MR not supported - RPointerArray* entryArray = - static_cast*>( aArray ); - - entryArray->ResetAndDestroy(); - entryArray->Close(); - } - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// RESMRStatic::RESMRStatic -// --------------------------------------------------------------------------- -// -EXPORT_C RESMRStatic::RESMRStatic( ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// RESMRStatic::~RESMRStatic -// --------------------------------------------------------------------------- -// -EXPORT_C RESMRStatic::~RESMRStatic( ) - { - FUNC_LOG; - if ( iStaticData ) - { - delete iStaticData->iContactMenuHandler; - iStaticData->iContactMenuHandler = NULL; - - delete iStaticData->iContactManagerHandler; - iStaticData->iContactManagerHandler = NULL; - } - } - -// --------------------------------------------------------------------------- -// RESMRStatic::ConnectL -// --------------------------------------------------------------------------- -// -EXPORT_C void RESMRStatic::ConnectL( ) - { - FUNC_LOG; - if (iStaticData ) - { - // already connected - return; - } - - // Retrieve Tls pointer - iStaticData = (TESMRStaticData*) Dll::Tls(); - - // If Tls pointer was not set, create new static stuct - // with NULL values - if ( !iStaticData ) - { - iStaticData = new (ELeave) TESMRStaticData(); - memset ( iStaticData, 0, sizeof( TESMRStaticData) ); - Dll::SetTls ( iStaticData ); - } - ++iStaticData->iInstanceCount; - } - -// --------------------------------------------------------------------------- -// RESMRStatic::Close -// --------------------------------------------------------------------------- -// -EXPORT_C void RESMRStatic::Close( ) - { - FUNC_LOG; - if (iStaticData ) - { - if (iUsedTypes & EContactMenuHandler ) - { - --iStaticData->iContactMenuHandlerCount; - if (iStaticData->iContactMenuHandlerCount == 0 ) - { - if ( iStaticData->iContactManagerHandlerCount == 0 ) - { - // Delete both Handlers when both are ready to delete - // and Contact Manager Handler should be deleted last - // because the Menu Handler has dependency to it. - delete iStaticData->iContactMenuHandler; - iStaticData->iContactMenuHandler = NULL; - - delete iStaticData->iContactManagerHandler; - iStaticData->iContactManagerHandler = NULL; - } - } - } - - // If ContactManagerHandlerL was used - if (iUsedTypes & EContactManagerHandler ) - { - // Decrease counter - --iStaticData->iContactManagerHandlerCount; - - // If this was last instance using pointer - if ( iStaticData->iContactManagerHandlerCount == 0 ) - { - if ( iStaticData->iContactMenuHandlerCount == 0 ) - { - delete iStaticData->iContactMenuHandler; - iStaticData->iContactMenuHandler = NULL; - // Delete instance - delete iStaticData->iContactManagerHandler; - iStaticData->iContactManagerHandler = NULL; - } - } - } - - // If FSMailClientL or FSMailBox was used - if (iUsedTypes & EMailBoxHandler ) - { - // Decrease counter - --iStaticData->iFSMailBoxCount; - - // If this was last instance using pointer - if (iStaticData->iFSMailBoxCount == 0 ) - { - // Owned by CFSMailClient - delete iStaticData->iFSMailBox; - iStaticData->iFSMailBox = NULL; - - // Delete instance - if ( iStaticData->iFSMailClient ) - { - iStaticData->iFSMailClient->Close(); - iStaticData->iFSMailClient = NULL; - } - } - } - - // Decrease instance counter - --iStaticData->iInstanceCount; - - // If this was last instance using pointer - if (iStaticData->iInstanceCount == 0 ) - { - delete iStaticData; - Dll::FreeTls ( ); - } - iStaticData = NULL; - } - } - -// --------------------------------------------------------------------------- -// RESMRStatic::ContactManagerHandlerL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRContactManagerHandler& RESMRStatic::ContactManagerHandlerL( ) - { - FUNC_LOG; - if ( !iStaticData->iContactManagerHandler ) - { - iStaticData->iContactManagerHandler = - CESMRContactManagerHandler::NewL(); - } - - if (!(iUsedTypes & EContactManagerHandler) ) - { - ++iStaticData->iContactManagerHandlerCount; - iUsedTypes |= EContactManagerHandler; - } - return *iStaticData->iContactManagerHandler; - } - -// --------------------------------------------------------------------------- -// RESMRStatic::ContactMenuHandlerL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRContactMenuHandler& RESMRStatic::ContactMenuHandlerL( ) - { - FUNC_LOG; - if ( !iStaticData->iContactMenuHandler ) - { - iStaticData->iContactMenuHandler = - CESMRContactMenuHandler::NewL( ContactManagerHandlerL() ); - } - - if (!(iUsedTypes & EContactMenuHandler) ) - { - ++iStaticData->iContactMenuHandlerCount; - iUsedTypes |= EContactMenuHandler; - } - - return *iStaticData->iContactMenuHandler; - } - -// --------------------------------------------------------------------------- -// RESMRStatic::CurrentFieldIndex -// --------------------------------------------------------------------------- -// -EXPORT_C TInt RESMRStatic::CurrentFieldIndex() - { - FUNC_LOG; - return iStaticData->iCurrentFieldIndex; - } - -// --------------------------------------------------------------------------- -// RESMRStatic::SetCurrentFieldIndex -// --------------------------------------------------------------------------- -// -EXPORT_C void RESMRStatic::SetCurrentFieldIndex(TInt aFieldIndex) - { - FUNC_LOG; - iStaticData->iCurrentFieldIndex = aFieldIndex; - } - -// --------------------------------------------------------------------------- -// RESMRStatic::MailBoxL -// --------------------------------------------------------------------------- -// -EXPORT_C CFSMailBox& RESMRStatic::MailBoxL( const TDesC& aAddress ) - { - FUNC_LOG; - if ( !iStaticData->iFSMailBox ) - { - CFSMailClient& fsMailClient = FSMailClientL(); - - // Loop throug all mailboxes in this plug-in - RPointerArray mailboxes; // codescanner::resourcenotoncleanupstack - CleanupStack::PushL( - TCleanupItem( - MailboxPointerArrayCleanup, - &mailboxes ) ); - - // With null uid we get all mailboxes - TFSMailMsgId msgId; - fsMailClient.ListMailBoxes( - msgId, mailboxes ); - - TInt mailboxCount( mailboxes.Count() ); - for ( TInt j(0); - j < mailboxCount && !iStaticData->iFSMailBox; - ++j ) - { - TPtrC mailboxOwnerAddName( - mailboxes[j]->OwnMailAddress().GetEmailAddress() ); - if ( mailboxOwnerAddName.Compare( aAddress ) == 0 ) - { - // Correct mailbox is found - iStaticData->iFSMailBox = mailboxes[j]; - mailboxes.Remove(j); - } - } - CleanupStack::PopAndDestroy(); // mailboxes - - if ( !iStaticData->iFSMailBox ) - { - User::Leave( KErrAbort ); - } - } - - iUsedTypes |= EMailBoxHandler; - ++iStaticData->iFSMailBoxCount; - return *iStaticData->iFSMailBox; - } - -// --------------------------------------------------------------------------- -// RESMRStatic::FSMailClientL -// --------------------------------------------------------------------------- -// -CFSMailClient& RESMRStatic::FSMailClientL( ) - { - FUNC_LOG; - if (!iStaticData->iFSMailClient) - { - iStaticData->iFSMailClient = CFSMailClient::NewL ( ); - } - - return *iStaticData->iFSMailClient; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrgui/src/tnavipaneclearer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrgui/src/tnavipaneclearer.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR UI Container class +* +*/ +#include "tnavipaneclearer.h" + +#include // CEikonEnv +#include // CAknNavigationControlContainer +#include // EEikStatusPaneUidNavi +#include // CEikStatusPane + +// --------------------------------------------------------------------------- +// TNavipaneClearer::TNavipaneClearer() +// --------------------------------------------------------------------------- +// +TNavipaneClearer::TNavipaneClearer() +: iNaviContainer( NULL ), iFullyInitialized( EFalse ) + { + CEikStatusPane* sp = + CEikonEnv::Static()->AppUiFactory()->StatusPane();// codescanner::eikonenvstatic + // If this leaves we have to stick with the navi we have. + TRAP_IGNORE( + { + // Put default, empty Status Pane. + // Otherwise view's status pane with dates would be shown. + iNaviContainer = static_cast + ( sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); + iNaviContainer->PushDefaultL(); + // If PushDefaultL leaves we know that then we can Pop the container + iFullyInitialized = ETrue; + } ); + } + +// --------------------------------------------------------------------------- +// TNavipaneClearer::~TNavipaneClearer() +// --------------------------------------------------------------------------- +// +TNavipaneClearer::~TNavipaneClearer() + { + // Remove default status pane + if ( iNaviContainer && iFullyInitialized ) + { + iNaviContainer->Pop(); + } + iNaviContainer = NULL; // not owned + } + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/bwins/mrguicommonu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/bwins/mrguicommonu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,82 @@ +EXPORTS + ?Text@CESMRAlarm@@QAEPAVHBufC16@@XZ @ 1 NONAME ; class HBufC16 * CESMRAlarm::Text(void) + ?GetMaskIconBitmap@NMRBitmapManager@@YAHW4TMRBitmapId@1@AAPAVCFbsBitmap@@1HVTSize@@@Z @ 2 NONAME ; int NMRBitmapManager::GetMaskIconBitmap(enum NMRBitmapManager::TMRBitmapId, class CFbsBitmap * &, class CFbsBitmap * &, int, class TSize) + ?GetFieldRowLayoutRect@NMRLayoutManager@@YA?AVTAknLayoutRect@@ABVTRect@@H@Z @ 3 NONAME ; class TAknLayoutRect NMRLayoutManager::GetFieldRowLayoutRect(class TRect const &, int) + ?GetLayoutText@NMRLayoutManager@@YA?AVTAknLayoutText@@ABVTRect@@W4TMRTextLayout@1@@Z @ 4 NONAME ; class TAknLayoutText NMRLayoutManager::GetLayoutText(class TRect const &, enum NMRLayoutManager::TMRTextLayout) + ??0TMenuItem@CMRStylusPopupMenu@@QAE@XZ @ 5 NONAME ; CMRStylusPopupMenu::TMenuItem::TMenuItem(void) + ?GetContactManager@CESMRContactManagerHandler@@QAEAAVCVPbkContactManager@@XZ @ 6 NONAME ; class CVPbkContactManager & CESMRContactManagerHandler::GetContactManager(void) + ?SetCommandObserver@CESMRContactMenuHandler@@QAEXPAVMEikCommandObserver@@@Z @ 7 NONAME ; void CESMRContactMenuHandler::SetCommandObserver(class MEikCommandObserver *) + ?AddObserverL@CESMRContactManagerHandler@@QAEXPAVMESMRContactManagerObserver@@@Z @ 8 NONAME ; void CESMRContactManagerHandler::AddObserverL(class MESMRContactManagerObserver *) + ?SetColor@NMRColorManager@@YAXAAVCCoeControl@@W4TMRColorId@1@@Z @ 9 NONAME ; void NMRColorManager::SetColor(class CCoeControl &, enum NMRColorManager::TMRColorId) + ?Color@NMRColorManager@@YA?AVTRgb@@W4TMRColorId@1@@Z @ 10 NONAME ; class TRgb NMRColorManager::Color(enum NMRColorManager::TMRColorId) + ?OptionsMenuAvailable@CESMRContactMenuHandler@@QAEHXZ @ 11 NONAME ; int CESMRContactMenuHandler::OptionsMenuAvailable(void) + ?IsReady@CESMRContactManagerHandler@@QAEHXZ @ 12 NONAME ; int CESMRContactManagerHandler::IsReady(void) + ?SendAsVCalendarL@CESMRSendUI@@QAEXHAAVCCalEntry@@@Z @ 13 NONAME ; void CESMRSendUI::SendAsVCalendarL(int, class CCalEntry &) + ??0CESMRRecurrence@@QAE@XZ @ 14 NONAME ; CESMRRecurrence::CESMRRecurrence(void) + ?LoadTextL@CESMRAlarm@@QAEXPAVCCoeEnv@@@Z @ 15 NONAME ; void CESMRAlarm::LoadTextL(class CCoeEnv *) + ?GetSkinBasedBitmapLC@NMRBitmapManager@@YAXW4TMRBitmapId@1@AAPAVCFbsBitmap@@1VTSize@@@Z @ 16 NONAME ; void NMRBitmapManager::GetSkinBasedBitmapLC(enum NMRBitmapManager::TMRBitmapId, class CFbsBitmap * &, class CFbsBitmap * &, class TSize) + ??1RESMRStatic@@QAE@XZ @ 17 NONAME ; RESMRStatic::~RESMRStatic(void) + ??1CMRImage@@UAE@XZ @ 18 NONAME ; CMRImage::~CMRImage(void) + ?ExecuteL@CESMRGlobalNote@@SAXW4TESMGlobalNoteType@1@@Z @ 19 NONAME ; void CESMRGlobalNote::ExecuteL(enum CESMRGlobalNote::TESMGlobalNoteType) + ?ExecuteL@CESMRConfirmationQuery@@SAHW4TESMRConfirmationQueryType@1@@Z @ 20 NONAME ; int CESMRConfirmationQuery::ExecuteL(enum CESMRConfirmationQuery::TESMRConfirmationQueryType) + ?RecurrenceText@CESMRRecurrence@@QAEAAVHBufC16@@XZ @ 21 NONAME ; class HBufC16 & CESMRRecurrence::RecurrenceText(void) + ?NewL@CESMRGlobalNote@@SAPAV1@W4TESMGlobalNoteType@1@@Z @ 22 NONAME ; class CESMRGlobalNote * CESMRGlobalNote::NewL(enum CESMRGlobalNote::TESMGlobalNoteType) + ?ExecuteL@CESMRConfirmationQuery@@SAHABVTDesC16@@@Z @ 23 NONAME ; int CESMRConfirmationQuery::ExecuteL(class TDesC16 const &) + ?Id@CESMRAlarm@@QAEHXZ @ 24 NONAME ; int CESMRAlarm::Id(void) + ?ExecuteLD@CESMRGlobalNote@@QAEXXZ @ 25 NONAME ; void CESMRGlobalNote::ExecuteLD(void) + ?ExecuteLD@CESMRListQuery@@QAEHXZ @ 26 NONAME ; int CESMRListQuery::ExecuteLD(void) + ?GetFieldLayoutRect@NMRLayoutManager@@YA?AVTAknLayoutRect@@ABVTRect@@H@Z @ 27 NONAME ; class TAknLayoutRect NMRLayoutManager::GetFieldLayoutRect(class TRect const &, int) + ?SetValueL@CESMRContactMenuHandler@@QAEXABVTDesC16@@W4TValueType@1@@Z @ 28 NONAME ; void CESMRContactMenuHandler::SetValueL(class TDesC16 const &, enum CESMRContactMenuHandler::TValueType) + ?GetBitmapStruct@NMRBitmapManager@@YA?AVTMRBitmapStruct@1@W4TMRBitmapId@1@@Z @ 29 NONAME ; class NMRBitmapManager::TMRBitmapStruct NMRBitmapManager::GetBitmapStruct(enum NMRBitmapManager::TMRBitmapId) + ?ExecuteL@CESMRListQuery@@SAHW4TESMRListQueryType@1@@Z @ 30 NONAME ; int CESMRListQuery::ExecuteL(enum CESMRListQuery::TESMRListQueryType) + ?Close@RESMRStatic@@QAEXXZ @ 31 NONAME ; void RESMRStatic::Close(void) + ?LaunchPopupL@CMRStylusPopupMenu@@QAEXV?$TArray@VTMenuItem@CMRStylusPopupMenu@@@@ABVTPoint@@@Z @ 32 NONAME ; void CMRStylusPopupMenu::LaunchPopupL(class TArray, class TPoint const &) + ?NewL@CESMRListQuery@@SAPAV1@W4TESMRListQueryType@1@AAV?$RArray@H@@@Z @ 33 NONAME ; class CESMRListQuery * CESMRListQuery::NewL(enum CESMRListQuery::TESMRListQueryType, class RArray &) + ?ShowActionMenuL@CESMRContactMenuHandler@@QAEXXZ @ 34 NONAME ; void CESMRContactMenuHandler::ShowActionMenuL(void) + ?ContactMenuHandlerL@RESMRStatic@@QAEAAVCESMRContactMenuHandler@@XZ @ 35 NONAME ; class CESMRContactMenuHandler & RESMRStatic::ContactMenuHandlerL(void) + ??0TMenuItem@CMRStylusPopupMenu@@QAE@ABVTDesC16@@H@Z @ 36 NONAME ; CMRStylusPopupMenu::TMenuItem::TMenuItem(class TDesC16 const &, int) + ??1CESMRRecurrence@@UAE@XZ @ 37 NONAME ; CESMRRecurrence::~CESMRRecurrence(void) + ??0RESMRStatic@@QAE@XZ @ 38 NONAME ; RESMRStatic::RESMRStatic(void) + ?DisplaySendCascadeMenuL@CESMRSendUI@@QAEXAAVCEikMenuPane@@@Z @ 39 NONAME ; void CESMRSendUI::DisplaySendCascadeMenuL(class CEikMenuPane &) + ?ExecuteLD@CESMRListQuery@@QAEHAAV?$RArray@VTPtrC16@@@@@Z @ 40 NONAME ; int CESMRListQuery::ExecuteLD(class RArray &) + ?ExecuteOptionsMenuL@CESMRContactMenuHandler@@QAEXH@Z @ 41 NONAME ; void CESMRContactMenuHandler::ExecuteOptionsMenuL(int) + ?NewL@CESMRSendUI@@SAPAV1@H@Z @ 42 NONAME ; class CESMRSendUI * CESMRSendUI::NewL(int) + ??1CMRLabel@@UAE@XZ @ 43 NONAME ; CMRLabel::~CMRLabel(void) + ?CurrentFieldIndex@RESMRStatic@@QAEHXZ @ 44 NONAME ; int RESMRStatic::CurrentFieldIndex(void) + ?GetSkinBasedBitmap@NMRBitmapManager@@YAHW4TMRBitmapId@1@AAPAVCFbsBitmap@@1VTSize@@@Z @ 45 NONAME ; int NMRBitmapManager::GetSkinBasedBitmap(enum NMRBitmapManager::TMRBitmapId, class CFbsBitmap * &, class CFbsBitmap * &, class TSize) + ?RemoveObserver@CESMRContactManagerHandler@@QAEXPAVMESMRContactManagerObserver@@@Z @ 46 NONAME ; void CESMRContactManagerHandler::RemoveObserver(class MESMRContactManagerObserver *) + ?ConstructFromResourceL@CESMRAlarm@@QAEXAAVTResourceReader@@@Z @ 47 NONAME ; void CESMRAlarm::ConstructFromResourceL(class TResourceReader &) + ?RecurrenceValue@CESMRRecurrence@@QAE?AW4TESMRRecurrenceValue@@XZ @ 48 NONAME ; enum TESMRRecurrenceValue CESMRRecurrence::RecurrenceValue(void) + ?RelativeTimeInMinutes@CESMRAlarm@@QAE?AVTTimeIntervalMinutes@@XZ @ 49 NONAME ; class TTimeIntervalMinutes CESMRAlarm::RelativeTimeInMinutes(void) + ?CanSendL@CESMRSendUI@@QAEHH@Z @ 50 NONAME ; int CESMRSendUI::CanSendL(int) + ?DisplaySendMenuItemL@CESMRSendUI@@QAEXAAVCEikMenuPane@@H@Z @ 51 NONAME ; void CESMRSendUI::DisplaySendMenuItemL(class CEikMenuPane &, int) + ??1CMRButton@@UAE@XZ @ 52 NONAME ; CMRButton::~CMRButton(void) + ?SetColor@NMRColorManager@@YAXAAVCEikTTimeEditor@@W4TMRColorId@1@@Z @ 53 NONAME ; void NMRColorManager::SetColor(class CEikTTimeEditor &, enum NMRColorManager::TMRColorId) + ?ContactManagerHandlerL@RESMRStatic@@QAEAAVCESMRContactManagerHandler@@XZ @ 54 NONAME ; class CESMRContactManagerHandler & RESMRStatic::ContactManagerHandlerL(void) + ?ExecuteEditBeforeSendL@CESMRListQuery@@SAHW4TESMRAttendeeStatus@@@Z @ 55 NONAME ; int CESMRListQuery::ExecuteEditBeforeSendL(enum TESMRAttendeeStatus) + ?NewL@CMRButton@@SAPAV1@W4TMRBitmapId@NMRBitmapManager@@W4TScaleMode@@@Z @ 56 NONAME ; class CMRButton * CMRButton::NewL(enum NMRBitmapManager::TMRBitmapId, enum TScaleMode) + ?GetLayoutRect@NMRLayoutManager@@YA?AVTAknLayoutRect@@ABVTRect@@W4TMRLayout@1@@Z @ 57 NONAME ; class TAknLayoutRect NMRLayoutManager::GetLayoutRect(class TRect const &, enum NMRLayoutManager::TMRLayout) + ?Reset@CESMRContactMenuHandler@@QAEXXZ @ 58 NONAME ; void CESMRContactMenuHandler::Reset(void) + ?SetContactMenuObserver@CESMRContactMenuHandler@@QAEXPAVMMRContactMenuObserver@@@Z @ 59 NONAME ; void CESMRContactMenuHandler::SetContactMenuObserver(class MMRContactMenuObserver *) + ?ExecuteL@CESMRGUIListQuery@@SAHW4TESMRListQueryType@1@@Z @ 60 NONAME ; int CESMRGUIListQuery::ExecuteL(enum CESMRGUIListQuery::TESMRListQueryType) + ?ConnectL@RESMRStatic@@QAEXXZ @ 61 NONAME ; void RESMRStatic::ConnectL(void) + ?ExecuteEditBeforeSendWithSendOptOnlyL@CESMRListQuery@@SAHW4TESMRAttendeeStatus@@@Z @ 62 NONAME ; int CESMRListQuery::ExecuteEditBeforeSendWithSendOptOnlyL(enum TESMRAttendeeStatus) + ?ExecuteL@CESMRListQuery@@SAHW4TESMRListQueryType@1@AAV?$RArray@H@@@Z @ 63 NONAME ; int CESMRListQuery::ExecuteL(enum CESMRListQuery::TESMRListQueryType, class RArray &) + ?NewL@CESMRListQuery@@SAPAV1@W4TESMRListQueryType@1@@Z @ 64 NONAME ; class CESMRListQuery * CESMRListQuery::NewL(enum CESMRListQuery::TESMRListQueryType) + ?GetTextComponentLayout@NMRLayoutManager@@YA?AVTAknTextComponentLayout@@W4TMRTextLayout@1@@Z @ 65 NONAME ; class TAknTextComponentLayout NMRLayoutManager::GetTextComponentLayout(enum NMRLayoutManager::TMRTextLayout) + ?ConstructFromResourceL@CESMRRecurrence@@QAEXPAVCCoeEnv@@AAVTResourceReader@@@Z @ 66 NONAME ; void CESMRRecurrence::ConstructFromResourceL(class CCoeEnv *, class TResourceReader &) + ?GetWindowComponentLayout@NMRLayoutManager@@YA?AVTAknWindowComponentLayout@@W4TMRLayout@1@@Z @ 67 NONAME ; class TAknWindowComponentLayout NMRLayoutManager::GetWindowComponentLayout(enum NMRLayoutManager::TMRLayout) + ?InitOptionsMenuL@CESMRContactMenuHandler@@QAEXPAVCEikMenuPane@@@Z @ 68 NONAME ; void CESMRContactMenuHandler::InitOptionsMenuL(class CEikMenuPane *) + ?Relative@CESMRAlarm@@QAEHXZ @ 69 NONAME ; int CESMRAlarm::Relative(void) + ?ExecuteL@CESMRListQuery@@SAHW4TESMRListQueryType@1@AAV?$RArray@VTPtrC16@@@@@Z @ 70 NONAME ; int CESMRListQuery::ExecuteL(enum CESMRListQuery::TESMRListQueryType, class RArray &) + ??0CESMRAlarm@@QAE@XZ @ 71 NONAME ; CESMRAlarm::CESMRAlarm(void) + ?SetCurrentFieldIndex@RESMRStatic@@QAEXH@Z @ 72 NONAME ; void RESMRStatic::SetCurrentFieldIndex(int) + ?GetMaskIconBitmapLC@NMRBitmapManager@@YAXW4TMRBitmapId@1@AAPAVCFbsBitmap@@1HVTSize@@@Z @ 73 NONAME ; void NMRBitmapManager::GetMaskIconBitmapLC(enum NMRBitmapManager::TMRBitmapId, class CFbsBitmap * &, class CFbsBitmap * &, int, class TSize) + ??1CESMRSendUI@@UAE@XZ @ 74 NONAME ; CESMRSendUI::~CESMRSendUI(void) + ?NewL@CMRLabel@@SAPAV1@XZ @ 75 NONAME ; class CMRLabel * CMRLabel::NewL(void) + ??1CMRStylusPopupMenu@@UAE@XZ @ 76 NONAME ; CMRStylusPopupMenu::~CMRStylusPopupMenu(void) + ?NewL@CMRStylusPopupMenu@@SAPAV1@AAVMEikMenuObserver@@@Z @ 77 NONAME ; class CMRStylusPopupMenu * CMRStylusPopupMenu::NewL(class MEikMenuObserver &) + ??1CESMRAlarm@@UAE@XZ @ 78 NONAME ; CESMRAlarm::~CESMRAlarm(void) + ?NewL@CMRImage@@SAPAV1@W4TMRBitmapId@NMRBitmapManager@@HW4TScaleMode@@@Z @ 79 NONAME ; class CMRImage * CMRImage::NewL(enum NMRBitmapManager::TMRBitmapId, int, enum TScaleMode) + ?GetColorStruct@NMRColorManager@@YA?AVTMRColorStruct@1@W4TMRColorId@1@@Z @ 80 NONAME ; class NMRColorManager::TMRColorStruct NMRColorManager::GetColorStruct(enum NMRColorManager::TMRColorId) + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/eabi/mrguicommonu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/eabi/mrguicommonu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,104 @@ +EXPORTS + _ZN10CESMRAlarm21RelativeTimeInMinutesEv @ 1 NONAME + _ZN10CESMRAlarm22ConstructFromResourceLER15TResourceReader @ 2 NONAME + _ZN10CESMRAlarm2IdEv @ 3 NONAME + _ZN10CESMRAlarm4TextEv @ 4 NONAME + _ZN10CESMRAlarm8RelativeEv @ 5 NONAME + _ZN10CESMRAlarm9LoadTextLEP7CCoeEnv @ 6 NONAME + _ZN10CESMRAlarmC1Ev @ 7 NONAME + _ZN10CESMRAlarmC2Ev @ 8 NONAME + _ZN10CESMRAlarmD0Ev @ 9 NONAME + _ZN10CESMRAlarmD1Ev @ 10 NONAME + _ZN10CESMRAlarmD2Ev @ 11 NONAME + _ZN11CESMRSendUI16SendAsVCalendarLEiR9CCalEntry @ 12 NONAME + _ZN11CESMRSendUI20DisplaySendMenuItemLER12CEikMenuPanei @ 13 NONAME + _ZN11CESMRSendUI23DisplaySendCascadeMenuLER12CEikMenuPane @ 14 NONAME + _ZN11CESMRSendUI4NewLEi @ 15 NONAME + _ZN11CESMRSendUI8CanSendLEi @ 16 NONAME + _ZN11CESMRSendUID0Ev @ 17 NONAME + _ZN11CESMRSendUID1Ev @ 18 NONAME + _ZN11CESMRSendUID2Ev @ 19 NONAME + _ZN11RESMRStatic17CurrentFieldIndexEv @ 20 NONAME + _ZN11RESMRStatic19ContactMenuHandlerLEv @ 21 NONAME + _ZN11RESMRStatic20SetCurrentFieldIndexEi @ 22 NONAME + _ZN11RESMRStatic22ContactManagerHandlerLEv @ 23 NONAME + _ZN11RESMRStatic5CloseEv @ 24 NONAME + _ZN11RESMRStatic8ConnectLEv @ 25 NONAME + _ZN11RESMRStaticC1Ev @ 26 NONAME + _ZN11RESMRStaticC2Ev @ 27 NONAME + _ZN11RESMRStaticD1Ev @ 28 NONAME + _ZN11RESMRStaticD2Ev @ 29 NONAME + _ZN14CESMRListQuery22ExecuteEditBeforeSendLE19TESMRAttendeeStatus @ 30 NONAME + _ZN14CESMRListQuery37ExecuteEditBeforeSendWithSendOptOnlyLE19TESMRAttendeeStatus @ 31 NONAME + _ZN14CESMRListQuery4NewLENS_18TESMRListQueryTypeE @ 32 NONAME + _ZN14CESMRListQuery4NewLENS_18TESMRListQueryTypeER6RArrayIiE @ 33 NONAME + _ZN14CESMRListQuery8ExecuteLENS_18TESMRListQueryTypeE @ 34 NONAME + _ZN14CESMRListQuery8ExecuteLENS_18TESMRListQueryTypeER6RArrayI7TPtrC16E @ 35 NONAME + _ZN14CESMRListQuery8ExecuteLENS_18TESMRListQueryTypeER6RArrayIiE @ 36 NONAME + _ZN14CESMRListQuery9ExecuteLDER6RArrayI7TPtrC16E @ 37 NONAME + _ZN14CESMRListQuery9ExecuteLDEv @ 38 NONAME + _ZN15CESMRGlobalNote4NewLENS_18TESMGlobalNoteTypeE @ 39 NONAME + _ZN15CESMRGlobalNote8ExecuteLENS_18TESMGlobalNoteTypeE @ 40 NONAME + _ZN15CESMRGlobalNote9ExecuteLDEv @ 41 NONAME + _ZN15CESMRRecurrence14RecurrenceTextEv @ 42 NONAME + _ZN15CESMRRecurrence15RecurrenceValueEv @ 43 NONAME + _ZN15CESMRRecurrence22ConstructFromResourceLEP7CCoeEnvR15TResourceReader @ 44 NONAME + _ZN15CESMRRecurrenceC1Ev @ 45 NONAME + _ZN15CESMRRecurrenceC2Ev @ 46 NONAME + _ZN15CESMRRecurrenceD0Ev @ 47 NONAME + _ZN15CESMRRecurrenceD1Ev @ 48 NONAME + _ZN15CESMRRecurrenceD2Ev @ 49 NONAME + _ZN15NMRColorManager14GetColorStructENS_10TMRColorIdE @ 50 NONAME + _ZN15NMRColorManager5ColorENS_10TMRColorIdE @ 51 NONAME + _ZN15NMRColorManager8SetColorER11CCoeControlNS_10TMRColorIdE @ 52 NONAME + _ZN15NMRColorManager8SetColorER15CEikTTimeEditorNS_10TMRColorIdE @ 53 NONAME + _ZN16NMRBitmapManager15GetBitmapStructENS_11TMRBitmapIdE @ 54 NONAME + _ZN16NMRBitmapManager17GetMaskIconBitmapENS_11TMRBitmapIdERP10CFbsBitmapS3_i5TSize @ 55 NONAME + _ZN16NMRBitmapManager18GetSkinBasedBitmapENS_11TMRBitmapIdERP10CFbsBitmapS3_5TSize @ 56 NONAME + _ZN16NMRBitmapManager19GetMaskIconBitmapLCENS_11TMRBitmapIdERP10CFbsBitmapS3_i5TSize @ 57 NONAME + _ZN16NMRBitmapManager20GetSkinBasedBitmapLCENS_11TMRBitmapIdERP10CFbsBitmapS3_5TSize @ 58 NONAME + _ZN16NMRLayoutManager13GetLayoutRectERK5TRectNS_9TMRLayoutE @ 59 NONAME + _ZN16NMRLayoutManager13GetLayoutTextERK5TRectNS_13TMRTextLayoutE @ 60 NONAME + _ZN16NMRLayoutManager18GetFieldLayoutRectERK5TRecti @ 61 NONAME + _ZN16NMRLayoutManager21GetFieldRowLayoutRectERK5TRecti @ 62 NONAME + _ZN16NMRLayoutManager22GetTextComponentLayoutENS_13TMRTextLayoutE @ 63 NONAME + _ZN16NMRLayoutManager24GetWindowComponentLayoutENS_9TMRLayoutE @ 64 NONAME + _ZN17CESMRGUIListQuery8ExecuteLENS_18TESMRListQueryTypeE @ 65 NONAME + _ZN18CMRStylusPopupMenu12LaunchPopupLE6TArrayINS_9TMenuItemEERK6TPoint @ 66 NONAME + _ZN18CMRStylusPopupMenu4NewLER16MEikMenuObserver @ 67 NONAME + _ZN18CMRStylusPopupMenu9TMenuItemC1ERK7TDesC16i @ 68 NONAME + _ZN18CMRStylusPopupMenu9TMenuItemC1Ev @ 69 NONAME + _ZN18CMRStylusPopupMenu9TMenuItemC2ERK7TDesC16i @ 70 NONAME + _ZN18CMRStylusPopupMenu9TMenuItemC2Ev @ 71 NONAME + _ZN18CMRStylusPopupMenuD0Ev @ 72 NONAME + _ZN18CMRStylusPopupMenuD1Ev @ 73 NONAME + _ZN18CMRStylusPopupMenuD2Ev @ 74 NONAME + _ZN22CESMRConfirmationQuery8ExecuteLENS_26TESMRConfirmationQueryTypeE @ 75 NONAME + _ZN22CESMRConfirmationQuery8ExecuteLERK7TDesC16 @ 76 NONAME + _ZN23CESMRContactMenuHandler15ShowActionMenuLEv @ 77 NONAME + _ZN23CESMRContactMenuHandler16InitOptionsMenuLEP12CEikMenuPane @ 78 NONAME + _ZN23CESMRContactMenuHandler18SetCommandObserverEP19MEikCommandObserver @ 79 NONAME + _ZN23CESMRContactMenuHandler19ExecuteOptionsMenuLEi @ 80 NONAME + _ZN23CESMRContactMenuHandler20OptionsMenuAvailableEv @ 81 NONAME + _ZN23CESMRContactMenuHandler22SetContactMenuObserverEP22MMRContactMenuObserver @ 82 NONAME + _ZN23CESMRContactMenuHandler5ResetEv @ 83 NONAME + _ZN23CESMRContactMenuHandler9SetValueLERK7TDesC16NS_10TValueTypeE @ 84 NONAME + _ZN26CESMRContactManagerHandler12AddObserverLEP27MESMRContactManagerObserver @ 85 NONAME + _ZN26CESMRContactManagerHandler14RemoveObserverEP27MESMRContactManagerObserver @ 86 NONAME + _ZN26CESMRContactManagerHandler17GetContactManagerEv @ 87 NONAME + _ZN26CESMRContactManagerHandler7IsReadyEv @ 88 NONAME + _ZN8CMRImage4NewLEN16NMRBitmapManager11TMRBitmapIdEi10TScaleMode @ 89 NONAME + _ZN8CMRImageD0Ev @ 90 NONAME + _ZN8CMRImageD1Ev @ 91 NONAME + _ZN8CMRImageD2Ev @ 92 NONAME + _ZN8CMRLabel4NewLEv @ 93 NONAME + _ZN8CMRLabelD0Ev @ 94 NONAME + _ZN8CMRLabelD1Ev @ 95 NONAME + _ZN8CMRLabelD2Ev @ 96 NONAME + _ZN9CMRButton4NewLEN16NMRBitmapManager11TMRBitmapIdE10TScaleMode @ 97 NONAME + _ZN9CMRButtonD0Ev @ 98 NONAME + _ZN9CMRButtonD1Ev @ 99 NONAME + _ZN9CMRButtonD2Ev @ 100 NONAME + _ZTI8CMRLabel @ 101 NONAME + _ZTV8CMRLabel @ 102 NONAME + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project esmrgui +* +*/ + + +#include +#include + +PRJ_EXPORTS +../inc/cesmrconfirmationquery.h |../../inc/cesmrconfirmationquery.h +../inc/cesmrlistquery.h |../../inc/cesmrlistquery.h +../inc/cesmrguilistquery.h |../../inc/cesmrguilistquery.h +../inc/resmrstatic.h |../../inc/resmrstatic.h +../inc/nmrlayoutmanager.h |../../inc/nmrlayoutmanager.h +../inc/nmrcolormanager.h |../../inc/nmrcolormanager.h +../inc/cesmrglobalnote.h |../../inc/cesmrglobalnote.h +../inc/nmrbitmapmanager.h |../../inc/nmrbitmapmanager.h +../inc/cmrimage.h |../../inc/cmrimage.h +../inc/cmrlabel.h |../../inc/cmrlabel.h +../inc/cmrbutton.h |../../inc/cmrbutton.h +../inc/cesmrsendui.h |../../inc/cesmrsendui.h +../inc/cesmrcontactmanagerhandler.h |../../inc/cesmrcontactmanagerhandler.h +../inc/cesmrcontactmenuhandler.h |../../inc/cesmrcontactmenuhandler.h +../inc/cesmralarm.h |../../inc/cesmralarm.h +../inc/cesmrrecurrence.h |../../inc/cesmrrecurrence.h +../inc/cmrstyluspopupmenu.h |../../inc/cmrstyluspopupmenu.h +../inc/mmrcontactmenuobserver.h |../../inc/mmrcontactmenuobserver.h + +PRJ_MMPFILES +mrguicommon.mmp + +PRJ_EXTENSIONS + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/group/mrguicommon.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/group/mrguicommon.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project esmrgui +* +*/ + + +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" +#include +#include + + +// Target information +TARGET mrguicommon.dll +TARGETTYPE dll +UID KEPOCStaticDllUID2 KESMRDllUid3 +DEFFILE mrguicommon.def + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src + +//the following contain dll exports +SOURCE cesmrglobalnote.cpp +SOURCE cesmrconfirmationquery.cpp +SOURCE cesmrlistquery.cpp +SOURCE cesmrsendui.cpp +SOURCE esmrvcalexport.cpp +SOURCE cesmrguilistquery.cpp +SOURCE cmrimage.cpp +SOURCE cmrbutton.cpp +SOURCE cmrlabel.cpp +SOURCE cesmrrecurrence.cpp +SOURCE cesmralarm.cpp +SOURCE resmrstatic.cpp +SOURCE cesmrcontactmenuhandler.cpp +SOURCE nmrlayoutmanager.cpp +SOURCE nmrbitmapmanager.cpp +SOURCE nmrcolormanager.cpp +SOURCE cmrstyluspopupmenu.cpp + +SOURCE cesmrcontactlinkiterator.cpp +SOURCE cesmrcontactmenuurlhandler.cpp +SOURCE cesmrcontactmanagerhandler.cpp + +APP_LAYER_SYSTEMINCLUDE + +// Include paths +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +// Dependencies to esmrui libraries +LIBRARY esmrcommon.lib +LIBRARY esmrservices.lib + +// Dependencies to Symbian/S60 OS components +LIBRARY apparc.lib +LIBRARY ecom.lib +LIBRARY euser.lib +LIBRARY apgrfx.lib +LIBRARY apmime.lib +LIBRARY cone.lib +LIBRARY eikcoctl.lib +LIBRARY egul.lib +LIBRARY eikdlg.lib +LIBRARY estor.lib +LIBRARY eikctl.lib +LIBRARY bafl.lib +LIBRARY eikcore.lib +LIBRARY efsrv.lib +LIBRARY featmgr.lib +LIBRARY pbkeng.lib +LIBRARY vpbkeng.lib +LIBRARY sendui.lib +LIBRARY fontutils.lib +LIBRARY aknskins.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY centralrepository.lib +LIBRARY aknnotify.lib +LIBRARY favouritesengine.lib +LIBRARY aknicon.lib +LIBRARY sysutil.lib +LIBRARY etext.lib +LIBRARY calinterimapi.lib +LIBRARY hlplch.lib +LIBRARY commonengine.lib +LIBRARY fbscli.lib +LIBRARY avkon.lib +LIBRARY calenimp.lib +LIBRARY caleninterimutils2.lib +LIBRARY lmkcommonui.lib +LIBRARY eposlandmarks.lib +LIBRARY aknphysics.lib +LIBRARY touchfeedback.lib +LIBRARY commonui.lib +LIBRARY npdlib.lib +LIBRARY lbs.lib +LIBRARY platformenv.lib + + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +//needed by XML based LAF components +LIBRARY cdlengine.lib +LIBRARY aknlayout2.lib +LIBRARY aknlayout2scalable.lib + +// AIW +LIBRARY servicehandler.lib //__PRINTING_FRAMEWORK_CALENDAR_PLUGIN + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmralarm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmralarm.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR alarm implementation + * +*/ + + +#ifndef CESMRALARM_H +#define CESMRALARM_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CCoeEnv; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CESMRAlarm ): public CBase + { +public: + /** + * Constructor + */ + IMPORT_C CESMRAlarm(); + + /** + * Destructor + */ + IMPORT_C ~CESMRAlarm(); + +public: + /** + * Loads alarm valus from resources + */ + IMPORT_C void ConstructFromResourceL( TResourceReader& aReader ); + + /** + * Loads iText from resources + */ + IMPORT_C void LoadTextL( CCoeEnv* aCoeEnv ); + + /** + * Returns relative alarm time in minutes + * + * @return relative alarm time + */ + IMPORT_C TTimeIntervalMinutes RelativeTimeInMinutes(); + + /** + * Returns alarm text + * + * @return alarm text + */ + IMPORT_C HBufC* Text(); + + /** + * Returns alarm id + * + * @return alarm id + */ + IMPORT_C TInt Id(); + + /** + * Returns relative alarm time + * + * @returns relative alarm time + */ + IMPORT_C TInt Relative(); + +private: + /** + * Alarm id + */ + TInt iId; + + /** + * Alarm value + */ + TInt iValue; + + /** + * Relative alarm value + */ + TInt iRelative; + + /** + * Alarm text id + */ + TInt iTxtLink; + + /** + * Own: Alarm text + */ + HBufC* iText; + }; + +#endif // CESMRALARM_H + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrconfirmationquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrconfirmationquery.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class is responsible of showing confirmation queries +* +*/ + + +#ifndef CESMRCONFIRMATIONQUERY_H +#define CESMRCONFIRMATIONQUERY_H + +// +#include "esmrdef.h" +// +#include + +class CEikonEnv; +/** + * CESMRConfirmationQuery encapsulates Yes/No confirmation query + * query for ES MR Utils usage. + * + * @lib esmrgui.lib + */ +NONSHARABLE_CLASS( CESMRConfirmationQuery ) : public CBase + { +public: + /** + * Enumeration definition for different kind of + * confirmation queries + */ + enum TESMRConfirmationQueryType + { + EESMRDeleteMR = 0, + EESMRSendCancellationInfoToParticipants, + EESMRRemoveAppointment, + EESMRSaveChanges, + EESMRDeleteEntry, + EESMRSendDecline, + EESMRSaveAnnivChangedStartDay, + EESMRAttachments, + EESMRSaveMeetingChangedStartDay, + EESMRAssignUpdatedLocation, + EESMRAttachmentsNotSupported + }; +public: + /** + * C++ Destructor. + */ + ~CESMRConfirmationQuery(); + + /** + * Static version of ExecuteLD. + * @param aType The type of confirmation query. + * @return TBool ETrue if Yes, EFalse for no. + */ + IMPORT_C static TBool ExecuteL( TESMRConfirmationQueryType aType ); + + /** + * Static version of ExecuteLD, for location text overwrite queries. + * only used internally by esmrgui and doesn't need to be exported + * @param aLocation location text to be used and truncated to the query + * @return TBool ETrue if Yes, EFalse for no. + */ + static TBool ExecuteL( const TDesC& aLocation ); + +private: // Implementation + CESMRConfirmationQuery( TESMRConfirmationQueryType aType ); + void ConstructL(); + TBool ExecuteLD(); + HBufC* TruncateTextToLAFNoteL( const TDesC& aLocation ); + +private: // Data + /** + * Attendee status + */ + TESMRConfirmationQueryType iType; + + /** + * Resource offset + */ + TInt iResourceOffset; + + // Ref: + CEikonEnv* iEnv; + }; + +#endif // CESMRCONFIRMATIONQUERY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrcontactlinkiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrcontactlinkiterator.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of class CESMRContactLinkIterator. +* +*/ + + +#ifndef CESMRCONTACTLINKITERATOR_H +#define CESMRCONTACTLINKITERATOR_H + +#include +// +#include "mfsccontactlinkiterator.h" +// + +class MVPbkContactLinkArray; + +/** + * Vitual phonebooks's MVPbkContactLink implementation. + */ +NONSHARABLE_CLASS( CESMRContactLinkIterator ) : public CBase, + public MFscContactLinkIterator + { +public: + + /** + * Two-phase constructor. + * + * @return new instance of th class + */ + static CESMRContactLinkIterator* NewL( ); + + /** + * Destructor. + */ + ~CESMRContactLinkIterator( ); + + /** + * Sets link array for iterating. Ownership is transferred. + * + * @param aContactLinkArray contact link array + */ + void SetContactLinkArray( MVPbkContactLinkArray* aContactLinkArray ); + +public: // from MFscContactLinkIteratator + TInt ContactCount( ) const; + TBool HasNextContact( ) const; + MVPbkContactLink* NextContactL( ); + void SetToFirstContact( ); + TInt GroupCount( ) const; + TBool HasNextGroup( ) const; + MVPbkContactLink* NextGroupL( ); + void SetToFirstGroup( ); + +private: + /** + * Private constructor. + */ + CESMRContactLinkIterator( ); + +private: //Data + /// Own: Current link index. + TInt iContactLinkArrayIndex; + /// Own: Contact link array. + MVPbkContactLinkArray* iContactLinkArray; + }; + +#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrcontactmanagerhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrcontactmanagerhandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of class CESMRContactManagerHandler. +* +*/ + + +#ifndef CESMRCONTACTMANAGERHANDLER_H +#define CESMRCONTACTMANAGERHANDLER_H + +#include + +#include +#include + +class CVPbkContactManager; + +NONSHARABLE_CLASS( MESMRContactManagerObserver ) + { +public: + virtual void ContactManagerReady ( ) = 0; + }; + +NONSHARABLE_CLASS( CESMRContactManagerHandler ) : + public CBase, + public MVPbkContactStoreListObserver + { +public: + static CESMRContactManagerHandler* NewL ( ); + ~CESMRContactManagerHandler ( ); + + /** + * Is ready + * @return ETrue if is else EFalse + */ + IMPORT_C TBool IsReady ( ); + + /** + * Add observer + * @param aObserver + */ + IMPORT_C void AddObserverL (MESMRContactManagerObserver* aObserver ); + + /** + * Remove observer + * @param aObserver + */ + IMPORT_C void RemoveObserver (MESMRContactManagerObserver* aObserver ); + + /** + * Get contact manager + */ + IMPORT_C CVPbkContactManager& GetContactManager ( ); + +private: + CESMRContactManagerHandler ( ); + void ConstructL ( ); + + // from MVPbkContactStoreListObserver + void OpenComplete ( ); + // from MVPbkContactStoreObserver + void StoreReady (MVPbkContactStore& aContactStore ); + void StoreUnavailable (MVPbkContactStore& aContactStore, TInt aReason ); + void HandleStoreEventL (MVPbkContactStore& aContactStore, + TVPbkContactStoreEvent aStoreEvent ); + +private: //Data + /// Own: + TBool iContactManagerReady; + /// Own: + CVPbkContactManager* iContactManager; + /// Own: + RPointerArray iObservers; + }; + +#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrcontactmenuhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrcontactmenuhandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of class CESMRContactMenuHandler. +* +*/ + + +#ifndef CESMRCONTACTMENUHANDLER_H +#define CESMRCONTACTMENUHANDLER_H + +#include + +#include "cesmrcontactmanagerhandler.h" +#include +#include +// +#include "mfsccontactactionserviceobserver.h" +#include "fsccontactactionservicedefines.h" +// +#include + +class MVPbkContactOperationBase; +class MVPbkContactStore; +class MVPbkContactLinkArray; +class CFscContactActionService; +class CFscContactActionMenu; +class CEikMenuPane; +class CESMRContactMenuUrlHandler; +class MMRContactMenuObserver; + +NONSHARABLE_CLASS( CESMRContactMenuHandler ) : + public CBase, + public MVPbkContactFindObserver, + public MVPbkSingleContactOperationObserver, + public MFscContactActionServiceObserver, + public MESMRContactManagerObserver + { +public: + /* + * Enumeration for value types. + */ + enum TValueType + { + EValueTypeNone, + EValueTypeURL, + EValueTypeEmail, + EValueTypePhoneNumber + }; + +public: + /** + * Two-phase constructor + * + * @param aContactManagerHandler Handler to contact manager + * @return new instance of the class + */ + static CESMRContactMenuHandler* NewL( + CESMRContactManagerHandler& aContactManagerHandler ); + + /** + * Destructor. + */ + ~CESMRContactMenuHandler( ); + + /** + * Options menu available + * @return ETrue if options menu / actions is available. + */ + IMPORT_C TBool OptionsMenuAvailable( ); + + /** + * Initialises actions menu pane. + * + * @param aActionMenuPane actions menu pane + */ + void InitOptionsMenuL( CEikMenuPane* aActionMenuPane ); + + /** + * Executes options menu / actions command. + * + * @param aCommand command id + */ + void ExecuteOptionsMenuL( TInt aCommand ); + + /** + * Resets/disables contact menu handler. + */ + IMPORT_C void Reset( ); + + /** + * Sets new value for contact action menu. It might be of + * type URL, Email or phone number. + * + * @param aValue descriptor which contains value + * @param aValueType type of given value + */ + IMPORT_C void SetValueL( const TDesC& aValue, TValueType aValueType ); + + /** + * Shows/executes contact action menu. + */ + IMPORT_C void ShowActionMenuL( ); + + /** + * Sets command observer for field. Field can use command + * observer for triggering commands. + * @param aCommandObserver Reference to command observer + */ + IMPORT_C void SetCommandObserver( + MEikCommandObserver* aCommandObserver ); + + /** + * Sets contact menu observer. Only one observer is supported at any time. + * The observer will be notified when asynchronous contact action query + * has been completed. + */ + IMPORT_C void SetContactMenuObserver( MMRContactMenuObserver* aObserver ); + +private: + /** + * Private constructor. + */ + CESMRContactMenuHandler( + CESMRContactManagerHandler& aContactManagerHandler ); + + /** + * Second phase constructor. + */ + void ConstructL( ); + + void VerifyContactDetailsL(); + +private: // from MESMRContactManagerHandler + void ContactManagerReady( ); + +private: // from MVPbkSingleContactOperationObserver + void VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& aOperation, + MVPbkStoreContact* aContact ); + void VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& aOperation, + TInt aError ); + +private: // from MVPbkContactFindObserver + void FindCompleteL( MVPbkContactLinkArray* aResults ); + void FindFailed( TInt aError ); + + // from MFscContactActionServiceObserver + void QueryActionsComplete( ); + void QueryActionsFailed( TInt aError ); + void ExecuteComplete( ); + void ExecuteFailed( TInt aError ); + +private: + /** + * Searches selected richtext link from contact stores. + */ + void SearchContactL( ); + + /** + * Creates new temporary contact for richtext link. + */ + void CreateContactL( ); + + /** + * Searches for local contact store for temporary + * contact creation. Leaves if none is found. + * + * @return local contact store + */ + MVPbkContactStore& LocalContactStoreL( ); + +private: // Data + /// Ref: Contact manager handler + CESMRContactManagerHandler& iContactManagerHandler; + /// Own: Url contact menu handler. + CESMRContactMenuUrlHandler* iContactMenuUrlHandler; + /// Own: Contact search results. + MVPbkContactLinkArray* iFindResultsArray; + /// Own: Index for verifying search results. + TInt iFindResultsArrayIndex; + /// Own: Contact action service. + CFscContactActionService* iContactActionService; + /// Own: Contact action menu. + CFscContactActionMenu* iContactActionMenu; + /// Own: Contact operation base. + MVPbkContactOperationBase* iContactOperationBase; + /// Own: Current value for actions menu. + HBufC* iValue; + /// Own: Current value type. + TValueType iValueType; + /// Own: Contact list for temporary contact. + RFscStoreContactList iStoreContactList; + /// Own: Contact action list for selected richtext link. + CFscContactActionList iContactActionList; + /// Own: ETrue if contact manager is initialized. + TBool iContactManagerReady; + /// Own: ETrue if action menu is initialized. + TBool iActionMenuReady; + /// Own: ETrue if options menu is initialized. + TBool iOptionsMenuReady; + /// Ref: Pointer to command observer + MEikCommandObserver* iCommandObserver; + /// Ref: Contact menu observer + MMRContactMenuObserver* iContactMenuObserver; + }; + +#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrcontactmenuurlhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrcontactmenuurlhandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of class CESMRContactMenuUrlHandler. + * +*/ + + +#ifndef CESMRCONTACTMENUURLHANDLER_H +#define CESMRCONTACTMENUURLHANDLER_H + +#include + +class CEikMenuPane; +class CFscContactActionMenu; +class CGulIcon; +class CAiwServiceHandler; +class CEikonEnv; + +NONSHARABLE_CLASS( CESMRContactMenuUrlHandler ) : public CBase + { +public: + /** + * Two-phase constructor. + * + * @param aContactActionMenu contact action menu + * @return new instance of the class + */ + static CESMRContactMenuUrlHandler* NewL( + CFscContactActionMenu& aContactActionMenu ); + + /** + * Destructor. + */ + ~CESMRContactMenuUrlHandler( ); + + /** + * Resets/disables url contact menu handler. + */ + void Reset( ); + + /** + * Enables contact action menu and options menu for given link. + * + * @param aUrl selected url + */ + void SetUrlL( const TDesC& aUrl ); + + /** + * Returns true if options menu / actions is available. + * @return TBool + */ + TBool OptionsMenuAvailable( ); + + /** + * Initializes options menu / actions submenu. + * + * @param aActionMenuPane actions submenu + */ + void InitOptionsMenuL( CEikMenuPane* aActionMenuPane ); + + /** + * Executes actions submenu selection. + * + * @param aCommand selected command id + */ + void ExecuteOptionsMenuL( TInt aCommand ); + + /** + * Executes contact action menu. + */ + void ShowActionMenuL( ); + +private: + /** + * Private constructor. + * + * @param aContactActionMenu contact action menu + */ + CESMRContactMenuUrlHandler( CFscContactActionMenu& aContactActionMenu ); + + /** + * Opens selected richtext link in browser. + */ + void OpenUrlInBrowserL( ); + + /** + * Opens selected richtext link in intranet browser. + */ + void OpenUrlInIntranetL( ); + + /** + * Bookmarks selected richtext link. + */ + void BookmarkUrlL( ); + + /** + * Creates a single actionmenu item with selectable command + * @param aResourceId + * @param aCommandUid + */ + void CreateMenuItemL( TInt aResourceId, TUid aCommandUid ); + + /** + * create icons to actionmenu + */ + CGulIcon* CreateIconL(TUid aCommandUid); + + /** + * Is service vailable + * @param aResourceId resource id + * @return TBool + */ + TBool IsServiceAvailableL(TInt aResourceId); + + /** + * Service handler + * @return Reference to CAiwServiceHandler + */ + CAiwServiceHandler& ServiceHandlerL(); +private: //data + + ///Ref: Contact action menu + CFscContactActionMenu& iContactActionMenu; + + /// Own: Current Url. + HBufC* iUrl; + + /// Own: array of actionmenu icons + RPointerArray iIconArray; + + /// Own: instance of aiw servicehandler + CAiwServiceHandler* iServiceHandler; + }; + +#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrglobalnote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrglobalnote.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Edit before send list pop-up query +* +*/ + + +#ifndef CESMRGLOBALNOTE_H +#define CESMRGLOBALNOTE_H + +// INCLUDES +#include +#include +// +#include "esmrdef.h" +// + +// CLASS DECLARATION +class CEikonEnv; +/** + * CESMRGlobalNote encapsulates Yes/No confirmation query + * query for ES MR Utils usage. + */ +NONSHARABLE_CLASS( CESMRGlobalNote ) : public CBase + { + public: + enum TESMGlobalNoteType + { + EESMRCorruptedMR = 0, + EESMREndsBeforeStarts, + EESMRCalenLaterDate, + EESMREntryEndEarlierThanItStart, + EESMRAlarmAlreadyPassed, + EESMRDiffMoreThanMonth, + EESMRRepeatEndEarlierThanItStart, + EESMREntrySaved, + EESMRTodoEntrySaved, + EESMRRepeatDifferentStartAndEndDate, + EESMRRepeatReSchedule, + EESMRCannotDisplayMuchMore, + EESMRRepeatInstanceTooEarly, + EESMRUnableToEdit, + EESMROverlapsExistingInstance, + EESMRInstanceAlreadyExistsOnThisDay, + EESMRInstanceOutOfSequence + }; + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CESMRGlobalNote* NewL( + TESMGlobalNoteType aType); + + /** + * Destructor. + */ + ~CESMRGlobalNote(); + + private: // Constructors + + CESMRGlobalNote( TESMGlobalNoteType aType ); + void ConstructL(); + TAknGlobalNoteType NoteType(); + HBufC* NoteTextLC(); + + public: // Implementation + + /** + * Executes the dialog and destroys itself. + */ + IMPORT_C void ExecuteLD(); + + /** + * Static version of ExecuteLD. + * @param aType The type of confirmation query. + */ + IMPORT_C static void ExecuteL( + TESMGlobalNoteType aType ); + + private: // Data + /// Own: Attendee status + TESMGlobalNoteType iType; + /// Own: Resource offset; + TInt iResourceOffset; + /// Ref: + CEikonEnv* iEnv; + + }; + +#endif // CESMRGLOBALNOTE_H + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrguilistquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrguilistquery.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: esmrgui list queries +* +*/ + + +#ifndef CESMRGUILISTQUERY_H +#define CESMRGUILISTQUERY_H + +// +#include "esmrdef.h" +// +#include + +class CEikonEnv; +/** + * CESMRGuilistQuery encapsulates list queries + * + * @lib esmrgui.lib + */ +NONSHARABLE_CLASS( CESMRGUIListQuery ) : public CBase + { +public: + /** + * Enumeration definition for different kind of + * confirmation queries + */ + enum TESMRListQueryType + { + EESMRSendUpdateToAllQuery + }; +public: + /** + * C++ Destructor. + */ + ~CESMRGUIListQuery(); + + /** + * Static version of ExecuteLD. + * @param aType The type of confirmation query. + * @return TInt selected item or KErrCancel if no selection was made. + */ + IMPORT_C static TInt ExecuteL( TESMRListQueryType aType ); + +private: // Implementation + CESMRGUIListQuery( TESMRListQueryType aType ); + void ConstructL(); + TInt ExecuteLD(); + +private: // Data + /// Own: Attendee status + TESMRListQueryType iType; + + /// Own: Resource offset + TInt iResourceOffset; + + /// Ref: + CEikonEnv* iEnv; + }; + +#endif // CESMRGUILISTQUERY_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrlistquery.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrlistquery.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition for mrui list queries +* +*/ + + +#ifndef CESMRLISTQUERY_H +#define CESMRLISTQUERY_H + +// INCLUDES +#include +// +#include "esmrdef.h" +// + +// FORWARD DECLARATIONS: +class CDesC16ArrayFlat; +class CAknPopupList; +class CESMRAlarm; +class CESMRRecurrence; +class CAknSinglePopupMenuStyleListBox; + +// CLASS DECLARATION +class CEikonEnv; +/** + * CESMRListQuery encapsulates edit before send pop-up list + * query for ES MR Utils usage. + * + * Usage: + * + * TESMRResponseType resp = (TESMRResponseType) + * CESMRListQuery::ExecuteEditBeforeSendL(EESMRAttendeeStatusTentative); + * + * @lib esmrgui.lib + */ +NONSHARABLE_CLASS( CESMRListQuery ) : public CBase + { + public: + enum TESMRListQueryType + { + EESMREditBeforeSendQuery = 0, + EESMRSendUpdateToAllQuery, + EESMRRecurrenceQuery, + EESMRRelativeAlarmTimeQuery, + EESMROpenThisOccurenceOrSeriesQuery, + EESMRPriorityPopup, + EESMRTodoPriorityPopup, + EESMRSynchronizationPopup, + EESMRDeleteThisOccurenceOrSeriesQuery, + EESMREditBeforeSendQueryWithSendOptionsOnly, + EESMRUnifiedEditorPopup, + EESMRNormalResponseQuery, + EESMRRemoveResponseQuery, + EESMRMultiCalenQuery, + EESMRForwardThisOccurenceOrSeriesQuery + }; + + public: + /** + * Two-phased constructor. + */ + IMPORT_C static CESMRListQuery* NewL(TESMRListQueryType aType); + + /** + * Two-phased constructor. + */ + IMPORT_C static CESMRListQuery* NewL(TESMRListQueryType aType, + RArray& aFilter); + + /** + * Destructor. + */ + ~CESMRListQuery(); + + private: // Constructors + + CESMRListQuery( TESMRListQueryType aType ); + CESMRListQuery( TESMRListQueryType aType, RArray& aFilter ); + void ConstructL(); + + public: // Implementation + + /** + * Sets the attendee response status to Edit before send query's + * title. + * @param aStatus Response status + */ + void SetAttendeeStatus(TESMRAttendeeStatus aStatus); + + + /** + * Executes the dialog and destroys itself. + * @return TESMRResponseType, or KErrCancel if dialog has + * been cancelled. + */ + IMPORT_C TInt ExecuteLD(); + + /** + * Static version of ExecuteLD for edit before send dialog + * @param aStatus attendee status. + * @return TESMRResponseType, or KErrCancel if dialog has + * been cancelled. + */ + IMPORT_C static TInt ExecuteEditBeforeSendL( + TESMRAttendeeStatus aStatus); + + /** + * Static version of ExecuteLD for edit before send dialog + * @param aStatus attendee status. + * @return TESMRResponseType, or KErrCancel if dialog has + * been cancelled. + */ + IMPORT_C static TInt ExecuteEditBeforeSendWithSendOptOnlyL( + TESMRAttendeeStatus aStatus ); + + /** + * Static version of ExecuteLD for other list querys + * @param aStatus attendee status. + * @return + * TESMRSendUpdateQueryResponeStatus if the type is EESMRSendUpdateAll + * TESMRGUIAlarmValue if the type is EESMRRelativeAlarmTime + * TESMRGUIRecurrenceValue if the type is EESMRRecurrence + * TESMRThisOccurenceOrSeriesQuery if the type is + * EESMRThisOccurenceOrSeriesQuery + * or KErrCancel if dialog has + * been cancelled. + */ + IMPORT_C static TInt ExecuteL( + TESMRListQueryType aType); + + /** + * Static version of ExecuteLD for other list querys + * @param aStatus attendee status. + * @param aFilter contains information about items that should be + * excluded from popup list. + * @return + * TESMRSendUpdateQueryResponeStatus if the type is EESMRSendUpdateAll + * TESMRGUIAlarmValue if the type is EESMRRelativeAlarmTime + * TESMRGUIRecurrenceValue if the type is EESMRRecurrence + * TESMRThisOccurenceOrSeriesQuery if the type is + * EESMRThisOccurenceOrSeriesQuery + * or KErrCancel if dialog has + * been cancelled. + */ + IMPORT_C static TInt ExecuteL( + TESMRListQueryType aType, RArray& aFilter); + + /** + * For multi-calendar query + * @param aCalenNameList multi-calendar names for display + * @return index of user choose + */ + IMPORT_C TInt ExecuteLD( RArray& aCalenNameList ); + + /** + * Static version of ExecuteLD for multi-calendar querys + * @param aCalenNameList multi-calendar name list + * @return index of user choose + */ + IMPORT_C static TInt ExecuteL( + TESMRListQueryType aType, RArray& aCalenNameList ); + + private: // Implementation: + + void SetListQueryTextsL( + CDesC16ArrayFlat* aItemArray, + CAknPopupList* aPopupList); + TInt MapSelectedIndexToReturnValue(TInt aIndex); + TInt MapUnifiedEditorItemTextToIndexL( + CAknSinglePopupMenuStyleListBox& aList ); + void LoadTextsFromResourceL(); + + private: // Data + /// Own: Attendee status + TESMRAttendeeStatus iStatus; + /// Own: Resource offset; + TInt iResourceOffset; + /// Own: List query type + TESMRListQueryType iType; + /// Own: Array for Alarm items + RPointerArray< CESMRAlarm > iAlarmArray; + /// Own: Array for Recurrence items + RPointerArray< CESMRRecurrence > iRecurrenceArray; + /// Ref: + CEikonEnv* iEnv; + /// Own: Filter for dynamic popup, not showing all items + RArray iFilter; + }; + +#endif // CESMRLISTQUERY_H + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrrecurrence.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrrecurrence.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition for mrui list queries +* +*/ + +#ifndef CESMRRECURRENCE_H +#define CESMRRECURRENCE_H + +#include +#include // resource reader +// +#include "esmrdef.h" +// + +/** + * Helper class for recurrence texts + */ +NONSHARABLE_CLASS( CESMRRecurrence ) : public CBase + { +public: + /** + * Constructor. + */ + IMPORT_C CESMRRecurrence(); + + /** + * Destructor. + */ + IMPORT_C ~CESMRRecurrence(); + + /** + * Constructs the recurrence text from resource. + * + * @param aEnv - Control environment to be used + * @param aReader - resource reader for reading the correct text + */ + IMPORT_C void ConstructFromResourceL( + CCoeEnv* aEnv, TResourceReader& aReader ); + + /** + * Get the type of recurrence + * + * @return type of recurrence + */ + IMPORT_C TESMRRecurrenceValue RecurrenceValue(); + + /** + * Get the descriptor text for the type of recurrence + * + * @return descriptor text for the type of recurrence + */ + IMPORT_C HBufC& RecurrenceText(); + +private: + //Own: ID of the wanted recurrence text + TESMRRecurrenceValue iId; + //Own: Descriptor for the actual text + HBufC* iTxt; + }; +#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cesmrsendui.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cesmrsendui.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR send ui wrapper +* +*/ + + +#ifndef CESMRSENDUI_H +#define CESMRSENDUI_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CCalSession; +class CCalEntry; +class CEikMenuPane; +class CSendUi; +class TParse; +class RFile; +class CCalenGlobalData; + +/** +* SendUI wrapper class. Used to send entry information forward. CCalEntry +* is converted to VCalendar format before sending. +*/ +NONSHARABLE_CLASS( CESMRSendUI ) : public CBase + { +public: // Factory method and destructor + IMPORT_C static CESMRSendUI* NewL(TInt aMenuCommandId); + IMPORT_C virtual ~CESMRSendUI(); + +public: // API + /** + * Can entry be sent or not. + * + * @param aCommandId - NOT IN USE + * @return boolean ETrue/Efalse + */ + IMPORT_C TBool CanSendL(TInt aCommandId); + + /** + * Adds the send ui menu items into menu pane. + * + * @param aMenuPane - menu pane where items are added + * @param aIndex - index of the menu item + */ + IMPORT_C void DisplaySendMenuItemL(CEikMenuPane& aMenuPane, TInt aIndex); + + /** + * Displays the send ui sub menu + * + * @param aMenuPane - NOT IN USE + */ + IMPORT_C void DisplaySendCascadeMenuL(CEikMenuPane& aMenuPane); + + /** + * Sends the converted entry via selected protocol + * + * @param aCommand - information about how entry needs to be sent + * @param aEntry - entry to be sent. + */ + IMPORT_C void SendAsVCalendarL(TInt aCommand, CCalEntry& aEntry); + +private: // utility functions + void DoSendAsAttachmentFileL(TInt aCommand, TParse& aFilename); + + void DoSendAsAttachmentHandleL(const RFile& aHandle); + +private: // constrution + CESMRSendUI(); + void ConstructL(TInt aMenuCommandId); +private: // data + /// Own: + CSendUi* iSendUi; + /// Own: + TInt iSendAsCmdId; + /// Own: + TUid iSelectedMtmUid; + /// Own: + CArrayFixFlat* iSendMtmsToDim; + // Own: calendar session + CCalSession* iSession; + }; + +#endif // CESMRSENDUI_H + + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cmrbutton.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cmrbutton.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CMRButton_H +#define CMRButton_H + +#include +#include + +#include "esmrfieldbuilderdef.h" +#include "nmrbitmapmanager.h" + +/** + * CMRButton is graphical button component for fields + */ +NONSHARABLE_CLASS( CMRButton ) : public CAknButton + { +public: + /** + * Two-phased constructor. + * + * @param aBitmapId + * @param aScaleMode + * @return Pointer to created and initialized mr image object. + */ + IMPORT_C static CMRButton* NewL( + NMRBitmapManager::TMRBitmapId aBitmapId, + TScaleMode aScaleMode = EAspectRatioPreserved ); + + /** + * C++ Destructor + */ + IMPORT_C virtual ~CMRButton(); + + void SizeChanged(); + +private: + /** + * C++ default constructor + */ + CMRButton( TScaleMode aScaleMode ); + void ConstructL( NMRBitmapManager::TMRBitmapId aBitmapId ); + +private: + TScaleMode iScaleMode; + }; + +#endif //CMRButton_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cmrimage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cmrimage.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CMRIMAGE_H +#define CMRIMAGE_H + +//#include +#include +#include + +#include "esmrfieldbuilderdef.h" +#include "nmrbitmapmanager.h" + +/** + * CMRImage is icon component for fields + */ +NONSHARABLE_CLASS( CMRImage ) : public CEikImage + { +public: + /** + * Two-phased constructor. + * + * @param aBitmapId + * @param aScaleMode + * @return Pointer to created and initialized mr image object. + */ + IMPORT_C static CMRImage* NewL( + NMRBitmapManager::TMRBitmapId aBitmapId, + TBool aIsMaskIcon = EFalse, + TScaleMode aScaleMode = EAspectRatioPreserved + ); + + /** + * C++ Destructor + */ + IMPORT_C virtual ~CMRImage(); + + void SizeChanged(); + +private: + /** + * C++ default constructor + */ + CMRImage( TScaleMode aScaleMode ); + void ConstructL( NMRBitmapManager::TMRBitmapId aBitmapId, TBool aIsMaskIcon ); + void CreateIconL( NMRBitmapManager::TMRBitmapId aBitmapId ); + void CreateMaskIconL( NMRBitmapManager::TMRBitmapId aBitmapId ); + +private: + TScaleMode iScaleMode; + }; + +#endif //CMRIMAGE_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cmrlabel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cmrlabel.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for Location URL Parser plug-in +* +*/ + +#ifndef CMRLABEL_H +#define CMRLABEL_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS + +// CLASS DECLARATIONS + +class CMRLabel : public CEikLabel + { + public: + /** + * Static construtor + * @return New instance of this class + */ + IMPORT_C static CMRLabel* NewL(); + /** + * Destructor + */ + IMPORT_C ~CMRLabel(); + + public: // From base class + void FocusChanged(TDrawNow aDrawNow); + + private: // from CCoeControl + void SizeChanged(); + + private: // Implementation + CMRLabel(); + void ConstructL(); + + private: // Data + }; + +#endif // CMRLABEL_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/cmrstyluspopupmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/cmrstyluspopupmenu.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Meeting request stylus popup menu + * +*/ + +#ifndef CMRSTYLUSPOPUPMENU_H +#define CMRSTYLUSPOPUPMENU_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MEikMenuObserver; +class CAknStylusPopUpMenu; + +// CLASS DECLARATIONS +NONSHARABLE_CLASS( CMRStylusPopupMenu ): public CBase + { + public: // Types + /** + * Class for capsulating one menu item in popupmenu + */ + NONSHARABLE_CLASS( TMenuItem ) + { + public: + IMPORT_C TMenuItem(); + IMPORT_C TMenuItem( const TDesC& aTxt, TInt aCommandId ); + + public: // Data + /// Own: Text for the menu item + TPtrC iTxt; + /// Own: Command id for the menu item + TInt iCommandId; + }; + + public: // d'tor & c'tor + /** + * Static c'tor + */ + IMPORT_C static CMRStylusPopupMenu* NewL( MEikMenuObserver& aObserver ); + + /** + * D'tor + */ + IMPORT_C ~CMRStylusPopupMenu(); + + public: // Interface + /** + * Launch stylus popup with specified items + * @param aItems Array of menu items to be shown in popup menu + * @param aPosition Position for the popupmenu + */ + IMPORT_C void LaunchPopupL( TArray aItems, const TPoint &aPosition ); + + private: // Implementation + CMRStylusPopupMenu( MEikMenuObserver& aObserver ); + void ConstructL(); + + private: // Data + /// Own: Stylus popup menu + CAknStylusPopUpMenu* iPopup; + /// Ref: Menu observer + MEikMenuObserver& iObserver; + }; + +#endif // CMRSTYLUSPOPUPMENU_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/esmrvcalexport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/esmrvcalexport.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: VCal exporter for send ui wrapper +* +*/ + + +#ifndef TESMRVCALEXPORT_H +#define TESMRVCALEXPORT_H + +// INCLUDES +#include +#include // for TParse + +// FORWARD DECLARATIONS +class CCalSession; +class CCalEntry; + + +// CLASS DECLARATION + +/** + * Exports Agenda entry to VCalendar data + * + */ +NONSHARABLE_CLASS( TESMRVCalExport ) + { +public: // Constructors and destructor + /** + * C++ default constructor. + */ + TESMRVCalExport(CCalSession& aCalSession, RFs& aFileServerSession); + +public: // New functions + /** + * Exports CCalEntry into VCalendar format + * + * @param aEntry - entry to be exported + * @return Descriptor that points to the exported data + */ + HBufC8* ExportVCalLC(CCalEntry& aEntry); + +protected: // New functions + void ConvertVCalL(CBufFlat* aBuf, CCalEntry& aEntry); + void ConvertICalL(CBufFlat* aBuf, CCalEntry& aEntry); + +private: // Data + + // Ref: calendar session + CCalSession& iSession; + + // Ref: file server session + RFs& iFs; + }; + +#endif + + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/mmrcontactmenuobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/mmrcontactmenuobserver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contact menu handler observer interface definition. +* +*/ + +#ifndef MMRCONTACTMENUOBSERVER_H +#define MMRCONTACTMENUOBSERVER_H + +/** + * Observer interface for CESMRContactMenuHandler. + */ +class MMRContactMenuObserver + { +public: + + /** + * Called by CESMRContactMenuHandler when asynchronous + * contact action query has completed. + */ + virtual void ContactActionQueryComplete() = 0; + +protected: + + virtual ~MMRContactMenuObserver() {}; + + }; + +#endif MMRCONTACTMENUOBSERVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/nmrbitmapmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/nmrbitmapmanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Bitmap manager for MRGUI usage. +* +*/ + +#ifndef NMRBITMAPMANAGER_H +#define NMRBITMAPMANAGER_H + +#include +#include + +// FORWARD DECLARATIONS +class CFbsBitmap; + +namespace NMRBitmapManager + { + enum TMRBitmapId + { + EMRBitmapNotSet = 0x00, + EMRBitmapRightClickArrow = 0x01, + EMRBitmapTrackingAccept, + EMRBitmapTrackingReject, + EMRBitmapTrackingTentative, + EMRBitmapTrackingNone, + EMRBitmapPriorityHigh, + EMRBitmapPriorityLow, + EMRBitmapPriorityNormal, + EMRBitmapSynchronization, + EMRBitmapSubject, + EMRBitmapOccasion, + EMRBitmapRecurrence, + EMRBitmapBrowser, + EMRBitmapIntranet, + EMRBitmapBookmark, + EMRBitmapAlarm, + EMRBitmapAlarmClock, + EMRBitmapCheckBoxOn, + EMRBitmapCheckBoxOff, + EMRBitmapClock, + EMRBitmapLocation, + EMRBitmapLocationWaypoint, + EMRBitmapDateStart, + EMRBitmapDateEnd, + EMRBitmapAttachment, + EMRBitmapCtrlBar, + EMRBitmapSearchContacts, + EMRBitmapCalendarSelection, + EMRBitmapEventTypeMeeting, + EMRBitmapEventTypeMR, + EMRBitmapEventTypeMemo, + EMRBitmapEventTypeAnniversary, + EMRBitmapEventTypeTodo, + EMRBitmapLockField, + + // Attachment handling icons + EMRBitmapMailAttachment = 0x200, + EMRBitmapOpenAttachmentView, + EMRBitmapOpenAttachment, + EMRBitmapDownloadAttachment, + EMRBitmapDownloadAllAttachments, + EMRBitmapSaveAttachment, + EMRBitmapSaveAllAttachments, + + EMRBitmapListCenter, + EMRBitmapListTop, + EMRBitmapListBottom, + EMRBitmapListLeft, + EMRBitmapListRight, + EMRBitmapListTopLeft, + EMRBitmapListTopRight, + EMRBitmapListBottomLeft, + EMRBitmapListBottomRight, + + EMRBitmapInputCenter, + EMRBitmapInputTop, + EMRBitmapInputBottom, + EMRBitmapInputLeft, + EMRBitmapInputRight, + EMRBitmapInputTopLeft, + EMRBitmapInputTopRight, + EMRBitmapInputBottomLeft, + EMRBitmapInputBottomRight, + + EMRBitmapSetOptCenter, + EMRBitmapSetOptTop, + EMRBitmapSetOptBottom, + EMRBitmapSetOptLeft, + EMRBitmapSetOptRight, + EMRBitmapSetOptTopLeft, + EMRBitmapSetOptTopRight, + EMRBitmapSetOptBottomLeft, + EMRBitmapSetOptBottomRight, + + EMRBitmapMailPre, + EMRBitmapMailNext, + + // Attachment type selection + EMRBitmapAttachmentTypeImage, + EMRBitmapAttachmentTypeVideo, + EMRBitmapAttachmentTypeMusic, + EMRBitmapAttachmentTypeNote, + EMRBitmapAttachmentTypePresentations, + EMRBitmapAttachmentTypeOther + }; + + class TMRBitmapStruct + { + public: + TMRBitmapStruct() : + iFallbackIndex( 0 ), iFallbackMaskIndex( 0 ) + { iItemId.iMajor = 0; iItemId.iMinor = 0; } + + public: // Data + TAknsItemID iItemId; + TInt iFallbackIndex; + TInt iFallbackMaskIndex; + }; + + /** + * Converts logical TMRBitmapId to internal TMRBitmapStruct + * which contains skin id for bitmap and fallback ids. + * + * @param aBitmapId Logical bitmap id. + * @return TAknsItemID Skin graphics id. + */ + IMPORT_C TMRBitmapStruct GetBitmapStruct( TMRBitmapId aBitmapId ); + + /** + * Creates bitmap and bitmap mask. Bitmap is skin/theme based + * and it's retrived by the given ID.Bitmap is also resized to + * the given size. + * Ownership of these created bitmaps is transferred to the caller. + * + * @param aIconID - id of the wanted bitmap + * @param aBitmap - reference to the pointer where new bitmap is stored + * @param aMask - reference to the pointer where new bitmap mask is stored + * @param aSize - Desired size for the bitmap + * @return TInt - KErrNone if bitmap was constructed succesfully + * KErrNotFound if any problems occured + */ + IMPORT_C TInt GetSkinBasedBitmap( TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TSize aSize ); + + /** + * Creates bitmap and bitmap mask. Bitmap is skin/theme based + * and it's retrived by the given ID.Bitmap is also resized to + * the given size. Both bitmap and bitmap mask are left into the + * CleanupStack in undefined order and type. Function leaves in case + * of any error. + * + * @param aIconID - id of the wanted bitmap + * @param aBitmap - reference to the pointer where new bitmap is stored + * @param aMask - reference to the pointer where new bitmap mask is stored + * @param aSize - Desired size for the bitmap + */ + IMPORT_C void GetSkinBasedBitmapLC( TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TSize aSize ); + + /** + * Creates bitmap and bitmap mask. Bitmap is mask icon with color group + * customized and it's retrived by the given ID.Bitmap is also resized to + * the given size. + * Ownership of these created bitmaps is transferred to the caller. + * + * @param aIconID - id of the wanted bitmap + * @param aBitmap - reference to the pointer where new bitmap is stored + * @param aMask - reference to the pointer where new bitmap mask is stored + * @param aSize - Desired size for the bitmap + * @return TInt - KErrNone if bitmap was constructed succesfully + * KErrNotFound if any problems occured + */ + IMPORT_C TInt GetMaskIconBitmap( TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TInt aColorIndex, + TSize aSize ); + + /** + * Creates bitmap and bitmap mask. Bitmap is mask icon with color group + * customized and it's retrived by the given ID.Bitmap is also resized to + * the given size. Both bitmap and bitmap mask are left into the + * CleanupStack in undefined order and type. Function leaves in case + * of any error. + * + * @param aIconID - id of the wanted bitmap + * @param aBitmap - reference to the pointer where new bitmap is stored + * @param aMask - reference to the pointer where new bitmap mask is stored + * @param aSize - Desired size for the bitmap + */ + IMPORT_C void GetMaskIconBitmapLC( TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TInt aColorIndex, + TSize aSize ); + } + +#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/nmrcolormanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/nmrcolormanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Color manager for MRGUI usage. +* +*/ + +#ifndef NMRCOLORMANAGER_H +#define NMRCOLORMANAGER_H + +#include +#include +#include // TRgb + +// FORWARD DECLARATIONS +class CCoeControl; +class CEikTTimeEditor; +class CEikDateEditor; + +namespace NMRColorManager + { + enum TMRColorId + { + EMRColorNotSet = 0x00, + EMRMainAreaTextColor = 0x01, + EMRCutCopyPasteHighlightColor, + EMRCopiedTextColor, + EMRNaviPaneText, + EMRPredictiveSearchPopUpBgColor, + EMRMainAreaTextColorDimmed, + EMRLastColorItemId = 0x200 // Always last item in the list + }; + + class TMRColorStruct + { + public: + TMRColorStruct() : + iColorIndex( 0 ) + { iColorGroup.iMajor = 0; iColorGroup.iMinor = 0; } + + public: // Data + TAknsItemID iColorGroup; + TInt iColorIndex; + }; + + /** + * Converts logical TMRColorId to internal TMRColorStruct + * which contains the correct color group and color id + * + * @param aColorId Logical color id. + * @return TMRColorStruct Contains color group and color id. + */ + IMPORT_C TMRColorStruct GetColorStruct( TMRColorId aColorId ); + + /** + * Returns correct Rgb color based on the given color enumeration + * + * @param aColorId Logical color id. + * @return TRgb The Rgb color based on the logical color id + */ + IMPORT_C TRgb Color( TMRColorId aColorId ); + + /** + * Sets font color based on the given color id for the given coecontrol + * + * @param aControl The control for which the color is set to. + * @param aColorId Logical color id. + */ + IMPORT_C void SetColor( CCoeControl& aControl, TMRColorId aColorId ); + + /** + * Sets font color based on the given color id for the given CEikTTimeEditor + * + * @param aEditor The control for which the color is set to. + * @param aColorId Logical color id. + */ + IMPORT_C void SetColor( CEikTTimeEditor& aEditor, TMRColorId aColorId ); + } + +#endif // NMRCOLORMANAGER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/nmrlayoutmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/nmrlayoutmanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Layout manager for MRGUI usage. +* +*/ + +#ifndef NMRLAYOUTMANAGER_H +#define NMRLAYOUTMANAGER_H + +#include +#include +#include + + +namespace NMRLayoutManager + { + + /** + * Enumeration for getting window component sizes. + */ + enum TMRLayout { + // Table 1.1 + EMRLayoutDialog, + // Table 1.48 (Mrui) + EMRLayoutCtrlBar, + EMRLayoutContentArea, + EMRLayoutDialogBg, + // Table 1.49 + EMRLayoutDialogBgGraphics, + // Table 1.50 + EMRLayoutListArea, + EMRLayoutScrollBar, + + EMRLayoutStripe, + EMRLayoutMRNaviArrowLeft, + EMRLayoutMRNaviArrowRight, + + // Table 1.53 + // Option 0 + // Option 1 + EMRLayoutTextEditorIcon, + EMRLayoutTextEditorBg, + // Option 2 + EMRLayoutTimeEditorIcon, + EMRLayoutTimeEditorStartBg, + EMRLayoutTimeEditorEndBg, + // Option 3 + EMRLayoutDateEditorIcon, + EMRLayoutDateEditorBg, + // Option 4 + // Option 5 + EMRLayoutCheckboxIcon, + + // Option 6 + // TODO: 24h time editor + + // Option 7 + EMRLayoutSingleRowAColumnGraphic, + EMRLayoutSingleRowDColumnGraphic, + + // Table 1.67 + // Option 0 + // Option 1 + // Option 2 + EMRLayoutCtrlBarGraphics, + + // Attacment type selection + EMRLayoutAttachmentSelectionGrid, + EMRLayoutAttachmentSelectionGridCell, + EMRLayoutAttachmentSelectionGridCellGraphic + + }; + + /** + * Enumeration for getting text component sizes, fonts, etc. + */ + enum TMRTextLayout { + // Table 1.53 + // Option 0 + EMRTextLayoutText, + // Option 1 + EMRTextLayoutTextEditor, + // Option 2 + EMRTextLayoutTimeEditorStart, + EMRTextLayoutTimeEditorSeparator, + EMRTextLayoutTimeEditorEnd, + // Option 3 + EMRTextLayoutDateEditor, + // Option 4 + EMRTextLayoutMultiRowTextEditor, + // Option 5 + EMRTextLayoutCheckboxEditor, + + // Option 7 + EMRTextLayoutSingleRowEditorText, + + // Table 1.67 + // Option 0 + // Option 1 + // Option 2 + EMRLayoutCtrlBarTitle, + + // Attacment type selection + EMRTextLayoutAttachmentSelectionGridCellText + }; + + + /** + * Returns TAknWindowComponentLayout for logical TMRLayout from xml laf. + * + * @param aLayout logical mr component id + * @return layout struct from laf + */ + IMPORT_C TAknWindowComponentLayout GetWindowComponentLayout( TMRLayout aLayout ); + + /** + * Returns TAknTextComponentLayout for logical TMRTextLayout from xml laf. + * + * @param aLayout logical mr component id + * @return layout struct from laf + */ + IMPORT_C TAknTextComponentLayout GetTextComponentLayout( TMRTextLayout aLayout ); + + /** + * Returns window component's rect from layout data. + * + * @param aParentRect parent component's rect. + * @param aLayout component enumeration. + * @return layout rect of the component. + */ + IMPORT_C TAknLayoutRect GetLayoutRect( const TRect& aParentRect, TMRLayout aLayout ); + + /** + * Returns field's size from layout data. + * + * @param aParentRect parent component's rect. + * @param aRows field row count. + * @return layout rect of the field. + */ + IMPORT_C TAknLayoutRect GetFieldLayoutRect( const TRect& aParentRect, TInt aRows ); + + /** + * Returns rect for one field's row. + * + * @param aParentRect field's rect. + * @param aRow row which's rect to return. + * @return layout rect of field's row. + */ + IMPORT_C TAknLayoutRect GetFieldRowLayoutRect( const TRect& aParentRect, TInt aRow ); + + /** + * Returns text component's rect from layout data. + * + * @param aParentRect parent component's rect. + * @param aLayout text component enumeration. + * @return text layout rect of text component. + */ + IMPORT_C TAknLayoutText GetLayoutText( const TRect& aParentRect, TMRTextLayout aLayout ); + + } + +#endif // NMRLAYOUTMANAGER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/inc/resmrstatic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/inc/resmrstatic.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Static Tls data storage +* +*/ + + +#ifndef RESMRSTATIC_H +#define RESMRSTATIC_H + +#include + +class TESMRStaticData; +class CESMRContactMenuHandler; +class CESMRContactManagerHandler; + +/* + * Proxy class to access TLS stored data + */ +class RESMRStatic + { +public: + /** + * C++ constructor + */ + IMPORT_C RESMRStatic(); + + /** + * C++ destructor + */ + IMPORT_C ~RESMRStatic(); + +public: // interface + /* + * Retrieves stored data pointer from Tls, or creates new one + * if called first time. Must be called before using this class. + */ + IMPORT_C void ConnectL(); + + /* + * Closes this instance of static data handler. + */ + IMPORT_C void Close(); + + /* + * Returns global instance of CESMRContactManagerHandler + */ + IMPORT_C CESMRContactManagerHandler& ContactManagerHandlerL(); + + /* + * Returns global instance of CESMRContactMenuHandler + */ + IMPORT_C CESMRContactMenuHandler& ContactMenuHandlerL(); + + /* + * Returns the current index for tracking field + */ + IMPORT_C TInt CurrentFieldIndex(); + + /* + * Sets the current index for tracking field + */ + IMPORT_C void SetCurrentFieldIndex(TInt aFieldIndex); + +private: // Internal definitions + /** + * Enumeration for cached data types + */ + enum TUsedType + { + EContactManagerHandler = 0x01, + EContactMenuHandler = 0x04 + }; + +private: // Data + /* + * Own: Pointer to Tls stored data pointer + */ + TESMRStaticData* iStaticData; + + /* + * Own: Used pointer types + */ + TInt iUsedTypes; + }; + +#endif //RESMRSTATIC_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmralarm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmralarm.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR alarm implementation +* +*/ + +#include "cesmralarm.h" + +#include + +// DEBUG +#include "emailtrace.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRAlarm::CESMRAlarm +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRAlarm::CESMRAlarm( ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::~CESMRAlarm +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRAlarm::~CESMRAlarm( ) + { + FUNC_LOG; + delete iText; + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::ConstructFromResourceL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRAlarm::ConstructFromResourceL( TResourceReader& aReader ) + { + FUNC_LOG; + iId = aReader.ReadInt16(); + iValue = aReader.ReadInt16(); + iRelative = aReader.ReadInt16(); + iTxtLink = aReader.ReadInt32(); // link to TBUF + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::LoadTextL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRAlarm::LoadTextL( CCoeEnv* aEnv ) + { + FUNC_LOG; + delete iText; + iText = NULL; + + if ( iValue != KErrNotFound ) + { + iText = StringLoader::LoadL ( iTxtLink, iValue, aEnv ); + } + else + { + iText = StringLoader::LoadL ( iTxtLink, aEnv ); + } + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::RelativeTimeInMinutes +// --------------------------------------------------------------------------- +// +EXPORT_C TTimeIntervalMinutes CESMRAlarm::RelativeTimeInMinutes( ) + { + FUNC_LOG; + return TTimeIntervalMinutes ( iRelative ); + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::Text +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC* CESMRAlarm::Text( ) + { + FUNC_LOG; + return iText; + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::Id +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRAlarm::Id( ) + { + FUNC_LOG; + return iId; + } + +// --------------------------------------------------------------------------- +// CESMRAlarm::Relative +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRAlarm::Relative( ) + { + FUNC_LOG; + return iRelative; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrconfirmationquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrconfirmationquery.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,337 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class is responsible of showing confirmation queries +* +*/ + +// INCLUDE FILES +#include "emailtrace.h" +#include "cesmrconfirmationquery.h" + +// +#include "esmrdef.h" +// +#include +#include +#include +#include +#include +#include +#include +#include //line wrapping and mirroring +#include //xml layout data for applications +#include //xml layout data of avkon components +#include "esmrhelper.h"//locateresourcefile + +// Unnamed namespace for local definitions +namespace { + +#ifdef _DEBUG + +// Definition for panic text +_LIT( KESMRConfirmationQueryPanicTxt, "ESMRConfirmationQueryPanic" ); + +/** Panic code enumaration */ +enum TESMRConfirmationQueryPanic + { + EESMRInvalidIdentifier = 0 // Invalid identifier + }; + +void Panic( TESMRConfirmationQueryPanic aPanic ) + { + User::Panic( KESMRConfirmationQueryPanicTxt, aPanic ); + } + +#endif + +_LIT(KResourceFileName,"esmrgui.rsc"); + +const TInt KVariantIndex(2); //a LAF variant value required for pop up window +const TInt KRequiredLinesPlus(2); //minimum lines needed for aknbiditextutils API array set up +const TInt KActualLine(0); //minimum lines needed for aknbiditextutils API array set up +const TInt KDummyLineForcedByAPI(1); //minimum lines needed for aknbiditextutils API array set up +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::CESMRConfirmationQuery +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CESMRConfirmationQuery::CESMRConfirmationQuery( + TESMRConfirmationQueryType aType) : + iType(aType) + { + FUNC_LOG; + //do nothing + } + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::~CESMRConfirmationQuery +// ----------------------------------------------------------------------------- +// +CESMRConfirmationQuery::~CESMRConfirmationQuery() + { + FUNC_LOG; + iEnv->DeleteResourceFile(iResourceOffset); + } + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::ConstructL +// ----------------------------------------------------------------------------- +// +void CESMRConfirmationQuery::ConstructL() + { + FUNC_LOG; + TFileName filename; + + //cache the Eikon pointer, as Static() is slow + iEnv = CEikonEnv::Static(); // codescanner::eikonenvstatic + + ESMRHelper::LocateResourceFile( + KResourceFileName, + KDC_RESOURCE_FILES_DIR, + filename, + &iEnv->FsSession() ); + + //for localization + BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); + iResourceOffset = iEnv->AddResourceFileL(filename); + } + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::ExecuteLD +// ----------------------------------------------------------------------------- +// +TBool CESMRConfirmationQuery::ExecuteLD() + { + FUNC_LOG; + HBufC* noteText = NULL; + switch ( iType ) + { + case EESMRDeleteMR: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_DELETE_QUERY); + break; + } + case EESMRSendCancellationInfoToParticipants: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_CANCELLATION_QUERY); + break; + } + case EESMRRemoveAppointment: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_REMOVE_APPOINTMENT_QUERY); + break; + } + case EESMRSaveChanges: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_FORM_QUEST_SAVE_CHANGES); + break; + } + case EESMRDeleteEntry: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_CALENDAR_OPT_DELETE_ENTRY); + break; + } + case EESMRSendDecline: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_DECLINE_QUERY ); + } + break; + case EESMRSaveAnnivChangedStartDay: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_QUEST_CHANGE_START_DAY ); + } + break; + case EESMRAttachments: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_NOTE_ATTACHMENTS ); + } + break; + case EESMRSaveMeetingChangedStartDay: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_QUEST_CHANGE_START_DAY ); + } + break; + case EESMRAssignUpdatedLocation: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_ASSIGN_UPDATED_LOCATION ); + } + break; + case EESMRAttachmentsNotSupported: + { + noteText = + iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_NOTE_ATTACHMENTS_NOT_SUPPORTED ); + } + break; + default: + { + #ifdef _DEBUG + // Invalid identifier --> panic + Panic( EESMRInvalidIdentifier ); + #endif + } + break; + } + + TBool response(EFalse); + if ( noteText ) + { + CAknQueryDialog* dlg = CAknQueryDialog::NewL(); + if( dlg->ExecuteLD(R_MR_CONFIRMATION_QUERY, *noteText) ) + { + response = ETrue; + } + CleanupStack::PopAndDestroy(noteText); + } + + delete this; + return response; + } + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRConfirmationQuery::ExecuteL( TESMRConfirmationQueryType aType) + { + FUNC_LOG; + CESMRConfirmationQuery* query = new (ELeave) CESMRConfirmationQuery(aType); + CleanupStack::PushL( query ); + query->ConstructL( ); + TBool ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRConfirmationQuery::ExecuteL( const TDesC& aLocation ) + { + FUNC_LOG; + CESMRConfirmationQuery* query = new (ELeave) CESMRConfirmationQuery(EESMRDeleteMR); + CleanupStack::PushL( query ); + query->ConstructL( ); + + HBufC* location = NULL; + + if ( aLocation.Length() > 0 ) + { + location = query->TruncateTextToLAFNoteL( aLocation ); + CleanupDeletePushL( location ); + } + else + { + // Allocate dummy buffer for query. + location = aLocation.AllocLC(); + } + + HBufC* noteText = StringLoader::LoadLC( R_MEET_REQ_REPLACE_PREVIOUS_LOCATION, *location ); + + TBool response = EFalse; + + CAknQueryDialog* dlg = CAknQueryDialog::NewL(); + if( dlg->ExecuteLD( R_MR_CONFIRMATION_QUERY, *noteText) ) + { + response = ETrue; + } + + CleanupStack::PopAndDestroy( noteText ); + CleanupStack::PopAndDestroy( location ); + CleanupStack::Pop( query ); + return response; + } + +// ----------------------------------------------------------------------------- +// CESMRConfirmationQuery::TruncateTextToLAFNoteL +// ----------------------------------------------------------------------------- +// +HBufC* CESMRConfirmationQuery::TruncateTextToLAFNoteL( const TDesC& aLocation ) + { + FUNC_LOG; + //wrap long string into array of individual lines + CArrayFixFlat* textLines = new(ELeave)CArrayFixFlat( KRequiredLinesPlus ); + CleanupStack::PushL( textLines ); + + //layout stuff to fetch list font and list line width + TAknLayoutText fontType; + + TSize main_pane_Size; + AknLayoutUtils::LayoutMetricsSize( AknLayoutUtils::EMainPane, main_pane_Size ); + TRect main_pane( main_pane_Size ); + + fontType.LayoutText( main_pane, AknLayoutScalable_Avkon::popup_note_window_t4( KVariantIndex ).LayoutLine() ); + + TInt lineWidth = fontType.TextRect().Width(); + + //extra bidi space for the two lines. second line is not actually used in the query but is required by the API + HBufC* locationText = HBufC::NewLC( aLocation.Length() + KAknBidiExtraSpacePerLine + KAknBidiExtraSpacePerLine); + TPtr locationTextPtr = locationText->Des(); + locationTextPtr.Append(aLocation); + + // First wrap, then do formatting. + CArrayFixFlat* lineWidths = new( ELeave )CArrayFixFlat( KRequiredLinesPlus ); + CleanupStack::PushL( lineWidths ); + lineWidths->InsertL( KActualLine, lineWidth ); + lineWidths->InsertL( KDummyLineForcedByAPI, lineWidth ); + + TBool useEllipsis(ETrue); + + // measure, wrap and truncate location item. + AknBidiTextUtils::ConvertToVisualAndWrapToArrayL( + locationTextPtr, + *lineWidths, + *fontType.Font(), + *textLines, + useEllipsis ); + + //place result to new created target buffer + HBufC* target = HBufC::NewL( textLines->At(KActualLine).Length() ); + target->Des().Append(textLines->At( KActualLine )); + + CleanupStack::PopAndDestroy( lineWidths ); + CleanupStack::PopAndDestroy( locationText ); + CleanupStack::PopAndDestroy( textLines ); + delete this; + return target; + } + +// End of File + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrcontactlinkiterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrcontactlinkiterator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of class CESMRContactLinkIterator. +* +*/ + + +#include "emailtrace.h" +#include "cesmrcontactlinkiterator.h" +#include + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::NewL( ) +// --------------------------------------------------------------------------- +// +CESMRContactLinkIterator* CESMRContactLinkIterator::NewL( ) + { + FUNC_LOG; + CESMRContactLinkIterator* self = new (ELeave) CESMRContactLinkIterator(); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::~CESMRContactLinkIterator( ) +// --------------------------------------------------------------------------- +// +CESMRContactLinkIterator::~CESMRContactLinkIterator( ) + { + FUNC_LOG; + delete iContactLinkArray; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::SetContactLinkArray +// --------------------------------------------------------------------------- +// +void CESMRContactLinkIterator::SetContactLinkArray( + MVPbkContactLinkArray* aContactLinkArray ) + { + FUNC_LOG; + delete iContactLinkArray; + iContactLinkArray = aContactLinkArray; + iContactLinkArrayIndex = 0; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::ContactCount +// --------------------------------------------------------------------------- +// +TInt CESMRContactLinkIterator::ContactCount() const + { + FUNC_LOG; + TInt count( KErrNotFound ); + if ( iContactLinkArray ) + { + count = iContactLinkArray->Count(); + } + return count; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::HasNextContact +// --------------------------------------------------------------------------- +// +TBool CESMRContactLinkIterator::HasNextContact() const + { + FUNC_LOG; + return iContactLinkArrayIndex < ContactCount(); + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::NextContactL +// --------------------------------------------------------------------------- +// +MVPbkContactLink* CESMRContactLinkIterator::NextContactL() + { + FUNC_LOG; + MVPbkContactLink* link = NULL; + if ( iContactLinkArray ) + { + link = (MVPbkContactLink*) + &(iContactLinkArray->At( iContactLinkArrayIndex++ )); + } + + return link; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::SetToFirstContact( ) +// --------------------------------------------------------------------------- +// +void CESMRContactLinkIterator::SetToFirstContact( ) + { + FUNC_LOG; + iContactLinkArrayIndex = 0; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::GroupCount( ) +// --------------------------------------------------------------------------- +// +TInt CESMRContactLinkIterator::GroupCount( ) const + { + FUNC_LOG; + return 0; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::HasNextGroup( ) +// --------------------------------------------------------------------------- +// +TBool CESMRContactLinkIterator::HasNextGroup( ) const + { + FUNC_LOG; + return EFalse; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::NextGroupL( ) +// --------------------------------------------------------------------------- +// +MVPbkContactLink* CESMRContactLinkIterator::NextGroupL( ) + { + FUNC_LOG; + return NULL; + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::SetToFirstGroup( ) +// --------------------------------------------------------------------------- +// +void CESMRContactLinkIterator::SetToFirstGroup( ) + { + FUNC_LOG; + //Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactLinkIterator::CESMRContactLinkIterator( ) +// --------------------------------------------------------------------------- +// +CESMRContactLinkIterator::CESMRContactLinkIterator( ) + { + FUNC_LOG; + //Do nothing + } + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrcontactmanagerhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrcontactmanagerhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of class CESMRContactManagerHandler. +* +*/ + + +#include "emailtrace.h" +#include "cesmrcontactmanagerhandler.h" + +#include +#include +#include +#include +#include + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::CESMRContactManagerHandler +// --------------------------------------------------------------------------- +// +CESMRContactManagerHandler::CESMRContactManagerHandler() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::NewL +// --------------------------------------------------------------------------- +// +CESMRContactManagerHandler* CESMRContactManagerHandler::NewL() + { + FUNC_LOG; + CESMRContactManagerHandler* self = new (ELeave) CESMRContactManagerHandler(); + CleanupStack::PushL (self ); + self->ConstructL ( ); + CleanupStack::Pop (self ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRContactManagerHandler::ConstructL ( ) + { + FUNC_LOG; + CVPbkContactStoreUriArray* uriList = CVPbkContactStoreUriArray::NewLC(); + uriList->AppendL(VPbkContactStoreUris::DefaultCntDbUri() ); + iContactManager = CVPbkContactManager::NewL( *uriList ); + CleanupStack::PopAndDestroy(uriList); + + MVPbkContactStoreList& stores = iContactManager->ContactStoresL( ); + stores.OpenAllL( *this ); + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::~CESMRContactManagerHandler +// --------------------------------------------------------------------------- +// +CESMRContactManagerHandler::~CESMRContactManagerHandler() + { + FUNC_LOG; + delete iContactManager; + iObservers.Reset(); + iObservers.Close(); + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::IsReady +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRContactManagerHandler::IsReady() + { + FUNC_LOG; + return iContactManagerReady; + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::AddObserverL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactManagerHandler::AddObserverL( + MESMRContactManagerObserver* aObserver ) + { + FUNC_LOG; + if ( iObservers.Find(aObserver) == KErrNotFound ) + { + iObservers.AppendL(aObserver); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::RemoveObserver +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactManagerHandler::RemoveObserver( + MESMRContactManagerObserver* aObserver ) + { + FUNC_LOG; + TInt index = iObservers.Find(aObserver ); + if ( index != KErrNotFound ) + { + iObservers.Remove(index ); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::GetContactManager +// --------------------------------------------------------------------------- +// +EXPORT_C CVPbkContactManager& CESMRContactManagerHandler::GetContactManager() + { + FUNC_LOG; + return *iContactManager; + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::OpenComplete +// --------------------------------------------------------------------------- +// +void CESMRContactManagerHandler::OpenComplete ( ) + { + FUNC_LOG; + iContactManagerReady = ETrue; + const TInt count(iObservers.Count()); + for (TInt i=count-1; i>=0; --i ) + { + iObservers[i]->ContactManagerReady( ); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::StoreReady +// --------------------------------------------------------------------------- +// +void CESMRContactManagerHandler::StoreReady( + MVPbkContactStore& /*aContactStore*/ ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::StoreUnavailable +// --------------------------------------------------------------------------- +// +void CESMRContactManagerHandler::StoreUnavailable ( + MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactManagerHandler::HandleStoreEventL +// --------------------------------------------------------------------------- +// +void CESMRContactManagerHandler::HandleStoreEventL ( + MVPbkContactStore& /*aContactStore*/, + TVPbkContactStoreEvent /*aStoreEvent*/) + { + FUNC_LOG; + // Do nothing + } + +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrcontactmenuhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrcontactmenuhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,759 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of class CESMRContactMenuHandler. +* +*/ + + +#include "emailtrace.h" +#include "cesmrcontactmenuhandler.h" +#include "cesmrcontactmenuurlhandler.h" +#include "mmrcontactmenuobserver.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +#include "cfsccontactactionservice.h" +#include "cfsccontactactionmenu.h" +#include "tfsccontactactionqueryresult.h" +#include "tfsccontactactionvisibility.h" +#include "mfsccontactaction.h" +#include "mfsccontactactionmenumodel.h" + +#include +#include +#include + +#include +#include "esmrcommands.h" +// +#include +#include +#include +// Removed profiling. + +/// Unnamed namespace for local definitions +namespace{ // codescanner::namespace + +const TInt KGranularity( 8 ); + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::CESMRContactMenuHandler( ) +// --------------------------------------------------------------------------- +// +CESMRContactMenuHandler::CESMRContactMenuHandler( + CESMRContactManagerHandler& aContactManagerHandler ): + iContactManagerHandler( aContactManagerHandler ), + iContactActionList( KGranularity ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::NewL( ) +// --------------------------------------------------------------------------- +// +CESMRContactMenuHandler* CESMRContactMenuHandler::NewL( + CESMRContactManagerHandler& aContactManagerHandler ) + { + FUNC_LOG; + CESMRContactMenuHandler* self = new (ELeave) CESMRContactMenuHandler( + aContactManagerHandler ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::ConstructL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::ConstructL( ) + { + FUNC_LOG; + + CVPbkContactManager& contactManager = + iContactManagerHandler.GetContactManager(); + + iContactActionService = CFscContactActionService::NewL( contactManager ); + iContactActionMenu = CFscContactActionMenu::NewL( *iContactActionService ); + + iContactMenuUrlHandler + = CESMRContactMenuUrlHandler::NewL( *iContactActionMenu ); + + if ( iContactManagerHandler.IsReady() ) + { + iContactManagerReady = ETrue; + } + else + { + iContactManagerHandler.AddObserverL ( this ); + } + + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::~CESMRContactMenuHandler( ) +// --------------------------------------------------------------------------- +// +CESMRContactMenuHandler::~CESMRContactMenuHandler( ) + { + FUNC_LOG; + iStoreContactList.ResetAndDestroy(); + delete iFindResultsArray; + delete iContactMenuUrlHandler; + + delete iContactOperationBase; + delete iContactActionMenu; + delete iContactActionService; + delete iValue; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::OptionsMenuAvailable( ) +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRContactMenuHandler::OptionsMenuAvailable( ) + { + FUNC_LOG; + return iOptionsMenuReady || iContactMenuUrlHandler->OptionsMenuAvailable( ); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::InitOptionsMenuL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::InitOptionsMenuL( + CEikMenuPane* aActionMenuPane ) + { + FUNC_LOG; + switch ( iValueType ) + { + case EValueTypeEmail: // Fall through + case EValueTypePhoneNumber: + { + // Add actions to options / actions submenu + const TInt count(iContactActionList.Count()); + for ( TInt i = 0; i < count; ++i ) + { + CEikMenuPaneItem::SData data; + data.iFlags = 0; + data.iCascadeId = 0; + data.iCommandId = EESMRCmdActionMenuFirst + i; + data.iText = iContactActionList[i].iAction->ActionMenuText(); + aActionMenuPane->AddMenuItemL( data ); + + aActionMenuPane->SetItemDimmed( + data.iCommandId, + iContactActionList[i].iOptionsMenuVisibility.iVisibility + == TFscContactActionVisibility::EFscActionDimmed ); + } + break; + } + case EValueTypeURL: + { + iContactMenuUrlHandler->InitOptionsMenuL( aActionMenuPane ); + break; + } + default: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::ExecuteOptionsMenuL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::ExecuteOptionsMenuL( TInt aCommand ) + { + FUNC_LOG; + switch ( iValueType ) + { + case EValueTypeEmail: // Fall through + case EValueTypePhoneNumber: + { + TInt index = aCommand - EESMRCmdActionMenuFirst; + if ( index >= 0 && index < iContactActionList.Count() ) + { + TUid uid = iContactActionList[index].iAction->Uid(); + iContactActionService->ExecuteL( uid, this ); + } + break; + } + case EValueTypeURL: + { + iContactMenuUrlHandler->ExecuteOptionsMenuL( aCommand ); + break; + } + default: + { + break; + } + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::Reset( ) +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::Reset( ) + { + FUNC_LOG; + delete iContactOperationBase; + iContactOperationBase = NULL; + + delete iFindResultsArray; + iFindResultsArray = NULL; + + iContactMenuUrlHandler->Reset(); + + iContactActionMenu->Model().RemoveAll(); + + delete iValue; + iValue = NULL; + iValueType = EValueTypeNone; + + iContactActionList.Reset(); + iStoreContactList.ResetAndDestroy(); + iActionMenuReady = EFalse; + iOptionsMenuReady = EFalse; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::SetValueL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::SetValueL( + const TDesC& aValue, TValueType aValueType ) + { + FUNC_LOG; + Reset(); + + if ( aValueType == EValueTypeURL ) + { + iContactMenuUrlHandler->SetUrlL( aValue ); + iValueType = aValueType; + } + else if ( aValueType != EValueTypeNone ) + { + iValue = aValue.AllocL(); + iValueType = aValueType; + if ( iContactManagerReady ) + { + SearchContactL(); + } + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::SetContactMenuObserver() +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::SetContactMenuObserver( + MMRContactMenuObserver* aObserver ) + { + iContactMenuObserver = aObserver; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::SetCommandObserver() +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::SetCommandObserver( + MEikCommandObserver* aCommandObserver ) + { + FUNC_LOG; + iCommandObserver = aCommandObserver; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::ShowActionMenuL( ) +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRContactMenuHandler::ShowActionMenuL( ) + { + FUNC_LOG; + if ( iValueType == EValueTypeURL ) + { + iContactMenuUrlHandler->ShowActionMenuL(); + } + else if ( iActionMenuReady ) + { + iContactActionMenu->ExecuteL( ); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::VerifyContactDetailsL +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::VerifyContactDetailsL() + { + FUNC_LOG; + if ( iFindResultsArrayIndex < iFindResultsArray->Count() ) + { + CVPbkContactManager& contactManager = + iContactManagerHandler.GetContactManager(); + + iContactOperationBase = + contactManager.RetrieveContactL( + iFindResultsArray->At( iFindResultsArrayIndex ), + *this ); + } + else + { + delete iFindResultsArray; + iFindResultsArray = NULL; + + if ( iStoreContactList.Count() > 0 ) + { + iContactActionService->SetContactSetL( iStoreContactList ); + iContactActionService->QueryActionsL( this ); + } + else + { + CreateContactL ( ); + } + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::ContactManagerReady( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::ContactManagerReady( ) + { + FUNC_LOG; + iContactManagerReady = ETrue; + iContactManagerHandler.RemoveObserver( this ); + if ( iValue ) + { + TRAP_IGNORE( SearchContactL() ); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::VPbkSingleContactOperationComplete +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& /*aOperation*/, + MVPbkStoreContact* aContact ) + { + FUNC_LOG; + delete iContactOperationBase; + iContactOperationBase = NULL; + + MVPbkStoreContactFieldCollection& fieldCollection = + aContact->Fields(); + + TBool valueMatchFound = EFalse; + const TInt count(fieldCollection.FieldCount()); + for ( TInt i = 0; valueMatchFound == EFalse && i < count; ++i ) + { + MVPbkStoreContactField& contactField = fieldCollection.FieldAt( i ); + MVPbkContactFieldData& fieldData = contactField.FieldData(); + if ( fieldData.DataType() == EVPbkFieldStorageTypeText ) + { + MVPbkContactFieldTextData& fieldTextData = + MVPbkContactFieldTextData::Cast( fieldData ); + + if ( fieldTextData.Text().CompareF( *iValue ) == 0 ) + { + valueMatchFound = ETrue; + } + } + } + + if ( valueMatchFound ) + { + TRAP_IGNORE( iStoreContactList.AppendL( aContact ) ); + } + else + { + delete aContact; + } + + ++iFindResultsArrayIndex; + TRAPD( err, VerifyContactDetailsL() ); + if ( err != KErrNone ) + { + Reset(); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::VPbkSingleContactOperationFailed +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& /*aOperation*/, + TInt /*aError*/ ) + { + FUNC_LOG; + delete iContactOperationBase; + iContactOperationBase = NULL; + + ++iFindResultsArrayIndex; + TRAPD( err, VerifyContactDetailsL() ); + if ( err != KErrNone ) + { + Reset(); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::FindCompleteL +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::FindCompleteL( MVPbkContactLinkArray* aResults ) + { + FUNC_LOG; + delete iContactOperationBase; + iContactOperationBase = NULL; + + iStoreContactList.ResetAndDestroy(); + iFindResultsArray = aResults; + iFindResultsArrayIndex = 0; + + VerifyContactDetailsL(); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::FindFailed +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::FindFailed( TInt /*aError*/) + { + FUNC_LOG; + delete iContactOperationBase; + iContactOperationBase = NULL; + + Reset ( ); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::QueryActionsComplete( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::QueryActionsComplete( ) + { + FUNC_LOG; + const CFscContactActionList& actionList = + iContactActionService->QueryResults(); + + // Add visible actions to local contact action list for + // options menu / actions. + const TInt count(actionList.Count()); + for ( TInt i = 0; i < count; ++i ) + { + TFscContactActionVisibility::TVisibility visibility = + actionList[i].iOptionsMenuVisibility.iVisibility; + if ( visibility == TFscContactActionVisibility::EFscActionVisible || + visibility == TFscContactActionVisibility::EFscActionDimmed ) + { + TRAP_IGNORE( iContactActionList.AppendL( actionList.At(i) ) ); + } + } + + const TInt count2(iContactActionList.Count()); + for ( TInt i = 0; i < count2; ++i ) + { + iContactActionList[i].iPriority = -iContactActionList[i].iPriority; + } + + // Sort local list of actions by priority. + TKeyArrayFix sortKey( _FOFF( TFscContactActionQueryResult, // codescanner::foff + iPriority ), + ECmpTInt); + iContactActionList.Sort( sortKey ); + + // Enable options menu / actions if there are actions available. + iOptionsMenuReady = iContactActionList.Count() > 0; + + // Initialize contact action menu and enable it. + TRAPD( error, iContactActionMenu->Model().AddPreQueriedCasItemsL ( ) ); + if ( error != KErrNone ) + { + iActionMenuReady = EFalse; + } + else + { + iActionMenuReady = ETrue; + } + + if ( iContactMenuObserver ) + { + iContactMenuObserver->ContactActionQueryComplete(); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::QueryActionsFailed +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::QueryActionsFailed( TInt /*aError*/) + { + FUNC_LOG; + Reset(); + + if ( iContactMenuObserver ) + { + iContactMenuObserver->ContactActionQueryComplete(); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::ExecuteComplete( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::ExecuteComplete( ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::ExecuteFailed +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::ExecuteFailed( TInt /*aError*/) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::SearchContactL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::SearchContactL( ) + { + FUNC_LOG; + // Cancel ongoing search if one exists. + if ( iContactOperationBase ) + { + delete iContactOperationBase; + iContactOperationBase = NULL; + } + + CVPbkContactManager& contactManager = + iContactManagerHandler.GetContactManager(); + + switch ( iValueType ) + { + case EValueTypeEmail: + { + const MVPbkFieldTypeList& fieldTypeList = + contactManager.FieldTypes(); + + CVPbkFieldTypeRefsList* fieldTypeRefsList = + CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( fieldTypeRefsList ); + + // Search for all email fields. + const TInt count(fieldTypeList.FieldTypeCount()); + for ( TInt i = 0; i < count; ++i ) + { + const MVPbkFieldType& fieldType = + fieldTypeList.FieldTypeAt( i ); + TArray versitProperties = + fieldType.VersitProperties(); + + const TInt count2(versitProperties.Count()); + for ( TInt ii=0; ii < count2; ++ii ) + { + if ( versitProperties[ii].Name() == EVPbkVersitNameEMAIL ) + { + fieldTypeRefsList->AppendL( fieldType ); + break; + } + } + } + + // Initiate find operation, returns to FindCompleteL. + iContactOperationBase = contactManager.FindL( *iValue, + *fieldTypeRefsList, *this ); + + CleanupStack::PopAndDestroy ( fieldTypeRefsList ); + break; + } + case EValueTypePhoneNumber: + { + if ( CommonPhoneParser::IsValidPhoneNumber( *iValue, + CommonPhoneParser::EPlainPhoneNumber ) ) + { + // Initiate find operation, returns to FindCompleteL. + const MVPbkFieldTypeList& fieldTypeList = + contactManager.FieldTypes(); + + CVPbkFieldTypeRefsList* fieldTypeRefsList = + CVPbkFieldTypeRefsList::NewL(); + CleanupStack::PushL( fieldTypeRefsList ); + + // Search for all email fields. + const TInt count(fieldTypeList.FieldTypeCount()); + for ( TInt i = 0; i < count; ++i ) + { + const MVPbkFieldType& fieldType = + fieldTypeList.FieldTypeAt( i ); + TArray versitProperties = + fieldType.VersitProperties(); + + const TInt count2(versitProperties.Count()); + for ( TInt ii=0; ii < count2; ++ii ) + { + if ( versitProperties[ii].Name() == EVPbkVersitNameTEL ) + { + fieldTypeRefsList->AppendL( fieldType ); + break; + } + } + } + // Initiate find operation, returns to FindCompleteL. + iContactOperationBase = contactManager.FindL( *iValue, + *fieldTypeRefsList, *this ); + + CleanupStack::PopAndDestroy ( fieldTypeRefsList ); + } + else + { + CreateContactL(); + } + break; + } + default: + { + // Disable contact action handler. + Reset(); + break; + } + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::CreateContactL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuHandler::CreateContactL( ) + { + FUNC_LOG; + CVPbkContactManager& contactManager = + iContactManagerHandler.GetContactManager(); + + const MVPbkFieldTypeList& fieldTypeList = contactManager.FieldTypes(); + const MVPbkFieldType* fieldType= NULL; + + // Try to find appropriate field type. + switch ( iValueType ) + { + case EValueTypeEmail: + { + fieldType = fieldTypeList.Find ( R_VPBK_FIELD_TYPE_EMAILGEN ); + break; + } + case EValueTypePhoneNumber: + { + fieldType = fieldTypeList.Find ( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); + break; + } + default: + { + break; + } + } + + // If field type was found. + if ( fieldType ) + { + // Create temporary store contact. + MVPbkContactStore& store = LocalContactStoreL(); + MVPbkStoreContact* storeContact = store.CreateNewContactLC(); + iStoreContactList.AppendL( storeContact ); + CleanupStack::Pop(); // codescanner::cleanup + + // Add link value to field. + MVPbkStoreContactField* field = + storeContact->CreateFieldLC ( *fieldType ); + MVPbkContactFieldTextData::Cast(field->FieldData()).SetTextL(*iValue); + storeContact->AddFieldL( field ); + CleanupStack::Pop( field ); + + // Add link value to first name too. + // Otherwise t.ex send multimedia shows contact as 'unnamed'. + fieldType = fieldTypeList.Find( R_VPBK_FIELD_TYPE_FIRSTNAME ); + if ( fieldType ) + { + field = storeContact->CreateFieldLC( *fieldType ); + MVPbkContactFieldTextData::Cast( + field->FieldData() ).SetTextL( *iValue ); + storeContact->AddFieldL( field ); + CleanupStack::Pop( field ); + } + + // Set contact set for contact action service. + iContactActionService->SetContactSetL( iStoreContactList ); + // Initiate query actions, returns to QueryActionsComplete. + iContactActionService->QueryActionsL( this ); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuHandler::LocalContactStoreL( ) +// --------------------------------------------------------------------------- +// +MVPbkContactStore& CESMRContactMenuHandler::LocalContactStoreL( ) + { + FUNC_LOG; + CVPbkContactManager& contactManager = + iContactManagerHandler.GetContactManager(); + + // Search for local contact store. + MVPbkContactStoreList& storeList = contactManager.ContactStoresL(); + const TInt count(storeList.Count()); + for ( TInt i = 0; i< count; ++i ) + { + MVPbkContactStore& store = storeList.At( i ); + if ( store.StoreProperties().Local() ) + { + return store; + } + } + // Leave if not found. + User::Leave ( KErrNotFound ); + // Disables warning. + MVPbkContactStore* null = NULL; + return *null; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrcontactmenuurlhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrcontactmenuurlhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,473 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of class CESMRContactMenuUrlHandler. +* +*/ + + +#include "cesmrcontactmenuurlhandler.h" +#include "esmrhelper.h" +//#include "cesmriconfield.h" +#include "nmrbitmapmanager.h" +// +#include "cfsccontactactionmenu.h" +#include "cfsccontactactionmenuitem.h" +#include "mfsccontactaction.h" +#include "mfsccontactactionmenumodel.h" +#include "esmrcommands.h" +#include +// +#include +#include +#include +#include +#include +#include +#include +#include +#include +// for intranet application opening +#include +#include +#include + +// DEBUG +#include "emailtrace.h" + +/// Unnamed namespace for local definitions +namespace // codescanner::namespace + { +// URL actionmenu uids +const TUid KUidOpenInBrowser = + { + 1 + }; + +const TUid KUidOpenInIntranet = + { + 2 + }; + +const TUid KUidBookmark = + { + 3 // codescanner::magicnumbers + }; + +// Browser app uid +const TUid KUidBrowser = + { + 0x10008D39 + }; + +// Maximum length of Browser bookmark +const TInt KMaxBookmarkNameLength = 50; +// Browser protocol +// 4 is number used for opening the browser +_LIT( KBrowserProtocol, "4 " ); + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::CESMRContactMenuUrlHandler +// --------------------------------------------------------------------------- +// +CESMRContactMenuUrlHandler::CESMRContactMenuUrlHandler( + CFscContactActionMenu& aContactActionMenu ) : + iContactActionMenu( aContactActionMenu ) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::NewL +// --------------------------------------------------------------------------- +// +CESMRContactMenuUrlHandler* CESMRContactMenuUrlHandler::NewL( + CFscContactActionMenu& aContactActionMenu ) + { + FUNC_LOG; + CESMRContactMenuUrlHandler* self = + new (ELeave) CESMRContactMenuUrlHandler( aContactActionMenu ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::~CESMRContactMenuUrlHandler( ) +// --------------------------------------------------------------------------- +// +CESMRContactMenuUrlHandler::~CESMRContactMenuUrlHandler( ) + { + FUNC_LOG; + delete iUrl; + delete iServiceHandler; + iIconArray.ResetAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::Reset( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::Reset( ) + { + FUNC_LOG; + delete iUrl; + iUrl = NULL; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::SetUrlL +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::SetUrlL( const TDesC& aUrl ) + { + FUNC_LOG; + HBufC* temp = aUrl.AllocL(); + delete iUrl; + iUrl = temp; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::CreateMenuItemL +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::CreateMenuItemL( + TInt aResourceId, + TUid aCommandUid ) + { + FUNC_LOG; + CGulIcon* itemIcon = CreateIconL(aCommandUid); + //ownership transferred + CleanupStack::PushL( itemIcon ); + iIconArray.AppendL( itemIcon ); + CleanupStack::Pop( itemIcon ); + + HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aResourceId ); + CFscContactActionMenuItem* newItem = + iContactActionMenu.Model().NewMenuItemL( *text, + itemIcon, + 1, + EFalse, + aCommandUid ); + + CleanupStack::PopAndDestroy( text ); + CleanupStack::PushL( newItem ); + iContactActionMenu.Model().AddItemL( newItem ); + CleanupStack::Pop( newItem ); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::CreateActionMenuIconL +// --------------------------------------------------------------------------- +// +CGulIcon* CESMRContactMenuUrlHandler::CreateIconL(TUid aCommandUid) + { + FUNC_LOG; + // Define default icon object + CFbsBitmap* iconBitmap( NULL ); + CFbsBitmap* iconMaskBitmap( NULL ); + NMRBitmapManager::TMRBitmapId iconID( NMRBitmapManager::EMRBitmapNotSet ); + + //select correct icon for item + if( aCommandUid == KUidOpenInBrowser ) + { + // icon is not available in Cmail + iconID = NMRBitmapManager::EMRBitmapBrowser; + // + } + else if( aCommandUid == KUidOpenInIntranet) + { + // icon is not available in Cmail + iconID = NMRBitmapManager::EMRBitmapIntranet; + // + } + else + { + // icon is not available in Cmail + iconID = NMRBitmapManager::EMRBitmapBookmark; + // + } + + // TODO: correct to use XML layout + NMRBitmapManager::GetSkinBasedBitmapLC( + iconID, iconBitmap, iconMaskBitmap, TSize(20,20) ); + + CGulIcon* icon = CGulIcon::NewL(iconBitmap, iconMaskBitmap); + + CleanupStack::Pop( 2 ); // iconBitmap, iconMaskBitmap + + return icon; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::OptionsMenuAvailable( ) +// --------------------------------------------------------------------------- +// +TBool CESMRContactMenuUrlHandler::OptionsMenuAvailable( ) + { + FUNC_LOG; + return iUrl != NULL; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::InitOptionsMenuL +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::InitOptionsMenuL( + CEikMenuPane* aActionMenuPane ) + { + FUNC_LOG; + CEikMenuPaneItem::SData data; + data.iFlags = 0; + data.iCascadeId = 0; + + //action menu is dynamic so commands are assigned dynamically here + TInt command = EESMRCmdActionMenuFirst; + + data.iCommandId = command; + command++;//dynamic command ids + CCoeEnv::Static()->ReadResourceL( + data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB ); + aActionMenuPane->AddMenuItemL( data ); + + if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST)) + { + data.iCommandId = command; + command++;//dynamic command ids + CCoeEnv::Static()->ReadResourceL( + data.iText, R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA ); + aActionMenuPane->AddMenuItemL( data ); + } + + data.iCommandId = command; + CCoeEnv::Static()->ReadResourceL( + data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK ); + aActionMenuPane->AddMenuItemL( data ); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::IsServiceAvailableL +// --------------------------------------------------------------------------- +// +TBool CESMRContactMenuUrlHandler::IsServiceAvailableL(TInt aResourceId) + { + FUNC_LOG; + //read resource and check if that service is available + TResourceReader reader; + CCoeEnv::Static()->CreateResourceReaderLC( reader, aResourceId ); + // Read first the count of the Criteria Items in resource. + // After this the reader is in correct position at the start + // of the first criteria. + const TInt count = reader.ReadInt16(); + CAiwCriteriaItem* criteriaItem = CAiwCriteriaItem::NewLC(); + criteriaItem->ReadFromResoureL( reader ); + TInt serviceAvailable = ServiceHandlerL().NbrOfProviders(criteriaItem); + CleanupStack::PopAndDestroy( criteriaItem ); + // destroy -> resource reader + CleanupStack::PopAndDestroy( ); // codescanner::cleanup + return serviceAvailable; + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::ExecuteOptionsMenuL +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::ExecuteOptionsMenuL( TInt aCommand ) + { + FUNC_LOG; + TInt command = EESMRCmdActionMenuFirst; + + if( (aCommand == KUidOpenInBrowser.iUid) || (aCommand == command) ) + { + OpenUrlInBrowserL(); + return; + } + command++;//next item in the dynamic list + + if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST)) + { + if( (aCommand == KUidOpenInIntranet.iUid) || (aCommand == command)) + { + OpenUrlInIntranetL(); + } + command++;//next item in the dynamic list + } + + if( (aCommand == KUidBookmark.iUid) || (aCommand == command) ) + { + BookmarkUrlL(); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::ShowActionMenuL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::ShowActionMenuL( ) + { + FUNC_LOG; + //reset + iIconArray.ResetAndDestroy(); + iContactActionMenu.Model().RemoveAll(); + + //fill list + CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB, + KUidOpenInBrowser); + + if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST)) + { + CreateMenuItemL( R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA, + KUidOpenInIntranet); + } + + CreateMenuItemL(R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK, KUidBookmark); + + //show list + if ( iContactActionMenu.ExecuteL() == EFscCustomItemSelected ) + { + TUid uid = iContactActionMenu.FocusedItem().ImplementationUid(); + + //handle command + ExecuteOptionsMenuL(uid.iUid); + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::OpenUrlInBrowserL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::OpenUrlInBrowserL( ) + { + FUNC_LOG; + HBufC* param = HBufC::NewLC( KFavouritesMaxUrl ); + param->Des().Copy( KBrowserProtocol() ); + param->Des().Append( *iUrl ); + TApaTaskList taskList( + CEikonEnv::Static()->WsSession() ); // codescanner::eikonenvstatic + TApaTask task = taskList.FindApp( KUidBrowser ); + if ( task.Exists() ) + { + HBufC8* param8 = HBufC8::NewLC( param->Length() ); + param8->Des().Append( *param ); + task.SendMessage( TUid::Uid ( 0 ), *param8 ); // Uid is not used + CleanupStack::PopAndDestroy( param8 ); + } + else + { + RApaLsSession appArcSession; + CleanupClosePushL( appArcSession ); + // connect to AppArc server + User::LeaveIfError( appArcSession.Connect() ); + TThreadId id; + User::LeaveIfError( appArcSession.StartDocument ( + *param, KUidBrowser, id ) ); + CleanupStack::PopAndDestroy( &appArcSession ); + } + CleanupStack::PopAndDestroy( param ); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::OpenUrlInIntranetL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::OpenUrlInIntranetL( ) + { + FUNC_LOG; + HBufC8* eightBitUrl = HBufC8::NewLC( iUrl->Length() ); + eightBitUrl->Des().Copy( *iUrl ); + + TAiwGenericParam inParam(EGenericParamURL, TAiwVariant(*eightBitUrl)); + CAiwGenericParamList& inParamList = ServiceHandlerL().InParamListL(); + inParamList.AppendL( inParam ); + + ServiceHandlerL().ExecuteServiceCmdL( + KAiwCmdView, + inParamList, + ServiceHandlerL().OutParamListL() ); + CleanupStack::PopAndDestroy( eightBitUrl ); + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::BookmarkUrlL( ) +// --------------------------------------------------------------------------- +// +void CESMRContactMenuUrlHandler::BookmarkUrlL( ) + { + FUNC_LOG; + // Create an item + CFavouritesItem* item = CFavouritesItem::NewLC(); + item->SetParentFolder( KFavouritesRootUid ); + item->SetType( CFavouritesItem::EItem ); + + // Read default name from resources + HBufC* defaultName =CCoeEnv::Static()->AllocReadResourceLC ( + R_QTN_CALENDAR_DEFAULT_BOOKMARK ); + + TBuf retName; + retName.Copy( defaultName->Des() ); + + // Query bookmark name from user + CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( retName ); + dlg->SetMaxLength( KMaxBookmarkNameLength ); + if ( !dlg->ExecuteLD( R_ADD_BOOKMARK_QUERY_DIALOG ) ) + { + // User press cancel - do not add bookmark + CleanupStack::PopAndDestroy ( 2, item ); // item, defaultName + } + else + { + item->SetNameL( retName ); + item->SetUrlL( *iUrl ); + + RFavouritesSession sess; // codescanner::resourcenotoncleanupstack + RFavouritesDb db; // codescanner::resourcenotoncleanupstack + + User::LeaveIfError( sess.Connect() ); + CleanupClosePushL ( sess ); + User::LeaveIfError( db.Open( sess, KBrowserBookmarks ) ); + CleanupClosePushL ( db ); + + // add item + db.Add( *item, ETrue ); + // Close the database. + db.Close(); + + HBufC * msgBuffer = CCoeEnv::Static()->AllocReadResourceLC( + R_QTN_CALENDAR_BOOKMARK_SAVED ); + CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote( ETrue ); + note->ExecuteLD ( *msgBuffer ); + + // item, db, sess, defaultName, msgBuffer + CleanupStack::PopAndDestroy ( 5, item ); // codescanner::magicnumbers + } + } + +// --------------------------------------------------------------------------- +// CESMRContactMenuUrlHandler::ServiceHandlerL +// --------------------------------------------------------------------------- +// +CAiwServiceHandler& CESMRContactMenuUrlHandler::ServiceHandlerL() + { + FUNC_LOG; + if ( !iServiceHandler ) + { + iServiceHandler = CAiwServiceHandler::NewL(); + iServiceHandler->AttachL( R_INTRANET_AIW_INTEREST ); + } + return *iServiceHandler; + } +// End of file + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrglobalnote.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrglobalnote.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,327 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Edit before send list pop-up query +* +*/ + + +// INCLUDE FILES +#include "emailtrace.h" +#include "cesmrglobalnote.h" +#include "esmrhelper.h"//locateresourcefile +// +#include "esmrdef.h" +// +#include +#include +#include +#include +#include +#include + +// CONSTANTS +// Unnamed namespace for local definitions +namespace { + +_LIT(KResourceFileName,"esmrgui.rsc"); + +#ifdef _DEBUG + +// Panic literal +_LIT( KESMRGlobalNote, "ESMRGlobalNote" ); + +/** + * Panic codes + */ +enum TESMRGlobalNotePanic + { + ENoteStringNotFound // Note string not found + }; + +/** + * Raises system panic + */ +void Panic( TESMRGlobalNotePanic aPanic ) + { + User::Panic( KESMRGlobalNote, aPanic ); + } + +#endif // _DEBUG + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::CESMRGlobalNote +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CESMRGlobalNote::CESMRGlobalNote( + TESMGlobalNoteType aType) +: iType(aType) + { + FUNC_LOG; + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::~CESMRGlobalNote +// ----------------------------------------------------------------------------- +// +CESMRGlobalNote::~CESMRGlobalNote() + { + FUNC_LOG; + iEnv->DeleteResourceFile(iResourceOffset); + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CESMRGlobalNote* CESMRGlobalNote::NewL( + TESMGlobalNoteType aType) + { + FUNC_LOG; + CESMRGlobalNote* self = + new (ELeave) CESMRGlobalNote(aType); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::ConstructL +// ----------------------------------------------------------------------------- +// +void CESMRGlobalNote::ConstructL() + { + FUNC_LOG; + TFileName filename; + iEnv = CEikonEnv::Static();// codescanner::eikonenvstatic + + ESMRHelper::LocateResourceFile( + KResourceFileName, + KDC_RESOURCE_FILES_DIR, + filename, + &iEnv->FsSession() ); + + + //for localization + BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); + iResourceOffset = iEnv->AddResourceFileL(filename); + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRGlobalNote::ExecuteL(TESMGlobalNoteType aType) + { + FUNC_LOG; + CESMRGlobalNote* query = CESMRGlobalNote::NewL( aType ); + CleanupStack::PushL(query); + query->ExecuteLD(); + CleanupStack::Pop(query); + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::NoteType +// ----------------------------------------------------------------------------- +// +TAknGlobalNoteType CESMRGlobalNote::NoteType() + { + FUNC_LOG; + TAknGlobalNoteType type(EAknGlobalInformationNote); + switch ( iType ) + { + case EESMRCorruptedMR: + { + type = EAknGlobalErrorNote; + break; + } + case EESMRCalenLaterDate: // FALLTHROUGH + case EESMREndsBeforeStarts: // FALLTHROUGH + case EESMREntryEndEarlierThanItStart: // FALLTHROUGH + case EESMRRepeatEndEarlierThanItStart: // FALLTHROUGH + case EESMRAlarmAlreadyPassed: // FALLTHROUGH + case EESMRDiffMoreThanMonth: // FALLTHROUGH + case EESMREntrySaved: // FALLTHROUGH + case EESMRTodoEntrySaved: // FALLTHROUGH + case EESMRRepeatDifferentStartAndEndDate: + case EESMRRepeatReSchedule: + case EESMRCannotDisplayMuchMore: + case EESMRRepeatInstanceTooEarly: + { + type = EAknGlobalInformationNote; + break; + } + default: + { + break; + } + } + return type; + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::NoteTextLC +// ----------------------------------------------------------------------------- +// +HBufC* CESMRGlobalNote::NoteTextLC() + { + FUNC_LOG; + HBufC* noteText = NULL; + switch ( iType ) + { + case EESMRCorruptedMR: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_CORRUPTED_NOTE); + break; + } + case EESMREndsBeforeStarts: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_INFO_NOTE_ENDS_BEFORE); + break; + } + case EESMRCalenLaterDate: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_LATER_DATE); + break; + } + case EESMREntryEndEarlierThanItStart: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_INFO_NOTE_ENDS_BEFORE ); + break; + } + case EESMRRepeatEndEarlierThanItStart: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_CALENDAR_INFO_REPEAT_INVALID ); + break; + } + case EESMRAlarmAlreadyPassed: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_CALENDAR_ALARM_PASSED ); + break; + } + case EESMRDiffMoreThanMonth: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_CALENDAR_ALARM_DIFFERENCE ); + break; + } + case EESMREntrySaved: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_NOTE_SAVED ); + break; + } + case EESMRTodoEntrySaved: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_TODO_SAVED ); + break; + } + case EESMRRepeatDifferentStartAndEndDate: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_INFO_START_END_DATE ); + } + break; + case EESMRRepeatReSchedule: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_MEET_REQ_RESCHEDULE_INSTANCE ); + } + break; + case EESMRCannotDisplayMuchMore: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_LONG_DESCRIPTION ); + } + break; + case EESMRRepeatInstanceTooEarly: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_MEET_REQ_INSTANCE_STARTS_EARLIER_THAN_SERIES ); + } + break; + case EESMRUnableToEdit: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_INFO_FIELD_LOCKED ); + } + break; + case EESMROverlapsExistingInstance: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_MEET_REQ_INSTANCE_OVERLAPS_EXISTING_INSTANCE ); + } + break; + case EESMRInstanceAlreadyExistsOnThisDay: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_MEET_REQ_INSTANCE_ALREADY_EXISTS_ON_THIS_DAY ); + } + break; + case EESMRInstanceOutOfSequence: + { + noteText = iEnv->AllocReadResourceAsDes16LC( + R_MEET_REQ_INSTANCE_OUT_OF_SEQUENCE ); + } + break; + default: + { + break; + } + } + + __ASSERT_DEBUG( noteText, Panic( ENoteStringNotFound) ); + return noteText; + } + +// ----------------------------------------------------------------------------- +// CESMRGlobalNote::ExecuteLD +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRGlobalNote::ExecuteLD() + { + FUNC_LOG; + CAknGlobalNote* note = CAknGlobalNote::NewLC(); + HBufC* noteText = NoteTextLC(); + + note->ShowNoteL( + NoteType(), + *noteText ); + + CleanupStack::PopAndDestroy( noteText ); + noteText = NULL; + + CleanupStack::PopAndDestroy( note ); + note = NULL; + + // Deleting 'this' object because this id D-method. + delete this; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrguilistquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrguilistquery.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class is responsible of showing list queries +* +*/ + +// INCLUDE FILES +#include "emailtrace.h" +#include "cesmrguilistquery.h" +#include "esmrhelper.h" + +#include +#include +#include +#include +#include +#include + +// Unnamed namespace for local definitions +namespace { + +// Resource file definitions +_LIT(KResourceFileName,"esmrgui.rsc"); + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CESMRGUIListQuery::CESMRConfirmationQuery +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +inline CESMRGUIListQuery::CESMRGUIListQuery( + TESMRListQueryType aType) : + iType(aType) + { + FUNC_LOG; + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CESMRGUIListQuery::~CESMRConfirmationQuery +// ----------------------------------------------------------------------------- +// +CESMRGUIListQuery::~CESMRGUIListQuery() + { + FUNC_LOG; + iEnv->DeleteResourceFile(iResourceOffset); + } + +// ----------------------------------------------------------------------------- +// CESMRGUIListQuery::ConstructL +// ----------------------------------------------------------------------------- +// +void CESMRGUIListQuery::ConstructL() + { + FUNC_LOG; + TFileName filename; + + iEnv = CEikonEnv::Static(); // codescanner::eikonenvstatic + + ESMRHelper::LocateResourceFile( + KResourceFileName, + KDC_RESOURCE_FILES_DIR, + filename, + &iEnv->FsSession() ); + + //for localization + BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); + iResourceOffset = iEnv->AddResourceFileL(filename); + } + +// ----------------------------------------------------------------------------- +// CESMRGUIListQuery::ExecuteLD +// ----------------------------------------------------------------------------- +// +TInt CESMRGUIListQuery::ExecuteLD() + { + FUNC_LOG; + TInt resourceId( KErrNotFound ); + + switch ( iType ) + { + case EESMRSendUpdateToAllQuery: + { + resourceId = R_MEET_REQ_SEND_UPDATE_QUERY; + break; + } + default: + { + User::Leave( KErrArgument ); + break; + } + } + + TInt response( KErrCancel ); + CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog( &response ); + if( !dlg->ExecuteLD(resourceId ) ) + { + response = KErrCancel; + } + dlg = NULL; + + delete this; + return response; + } + +// ----------------------------------------------------------------------------- +// CESMRGUIListQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRGUIListQuery::ExecuteL( + TESMRListQueryType aType) + { + FUNC_LOG; + CESMRGUIListQuery* query = + new (ELeave) CESMRGUIListQuery(aType); + + CleanupStack::PushL( query ); + query->ConstructL( ); + + TInt ret = query->ExecuteLD(); + + CleanupStack::Pop( query ); + + return ret; + } + +// End of File + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrlistquery.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrlistquery.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,884 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for mrui list queries +* +*/ + + +// INCLUDE FILES +#include "emailtrace.h" +#include "cesmrlistquery.h" + +#include +// +#include "esmrdef.h" +// +#include +#include +#include +#include +#include + +#include "esmrgui.hrh" +#include "cesmralarm.h" +#include "cesmrrecurrence.h" +#include "esmrhelper.h"//locateresourcefile + +// CONSTANTS +// Unnamed namespace for local definitions +namespace { + +// resource file: +_LIT( KResourceFileName, "esmrgui.rsc"); + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// ----------------------------------------------------------------------------- +// CESMRListQuery::CESMRListQuery +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +inline CESMRListQuery::CESMRListQuery( TESMRListQueryType aType ) + : iType( aType ) + { + FUNC_LOG; + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::CESMRListQuery +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +inline CESMRListQuery::CESMRListQuery( + TESMRListQueryType aType, + RArray& aFilter ) + : iType( aType ), iFilter( aFilter ) + { + FUNC_LOG; + // Do nothing + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::~CESMRListQuery +// ----------------------------------------------------------------------------- +// +CESMRListQuery::~CESMRListQuery() + { + FUNC_LOG; + iAlarmArray.ResetAndDestroy(); + iRecurrenceArray.ResetAndDestroy(); + iEnv->DeleteResourceFile(iResourceOffset); + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CESMRListQuery* + CESMRListQuery::NewL( TESMRListQueryType aType ) + { + CESMRListQuery* self = new (ELeave) CESMRListQuery(aType); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::NewL +// ----------------------------------------------------------------------------- +// +EXPORT_C CESMRListQuery* + CESMRListQuery::NewL( TESMRListQueryType aType, RArray& aFilter ) + { + CESMRListQuery* self = new (ELeave) CESMRListQuery(aType, aFilter); + CleanupStack::PushL( self ); + self->ConstructL( ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ConstructL +// ----------------------------------------------------------------------------- +// +void CESMRListQuery::ConstructL() + { + FUNC_LOG; + TFileName filename; + + iEnv = CEikonEnv::Static(); // codescanner::eikonenvstatic + + ESMRHelper::LocateResourceFile( + KResourceFileName, + KDC_RESOURCE_FILES_DIR, + filename, + &iEnv->FsSession() ); + + //for localization + BaflUtils::NearestLanguageFile(iEnv->FsSession(),filename); + iResourceOffset = iEnv->AddResourceFileL(filename); + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::SetAttendeeStatus +// ----------------------------------------------------------------------------- +// +void CESMRListQuery::SetAttendeeStatus(TESMRAttendeeStatus aStatus) + { + FUNC_LOG; + iStatus = aStatus; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteEditBeforeSendL( + TESMRAttendeeStatus aStatus) + { + FUNC_LOG; + CESMRListQuery* query = + CESMRListQuery::NewL( EESMREditBeforeSendQuery ); + CleanupStack::PushL(query); + query->SetAttendeeStatus(aStatus); + TInt ret = query->ExecuteLD(); + CleanupStack::Pop(query); + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteEditBeforeSendWithSendOptOnlyL( + TESMRAttendeeStatus aStatus ) + { + FUNC_LOG; + CESMRListQuery* query = + CESMRListQuery::NewL( + EESMREditBeforeSendQueryWithSendOptionsOnly ); + CleanupStack::PushL(query); + query->SetAttendeeStatus(aStatus); + TInt ret = query->ExecuteLD(); + CleanupStack::Pop(query); + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteL( TESMRListQueryType aType ) + { + FUNC_LOG; + CESMRListQuery* query = CESMRListQuery::NewL( aType ); + CleanupStack::PushL( query ); + TInt ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteL( TESMRListQueryType aType, + RArray& aFilter ) + { + FUNC_LOG; + CESMRListQuery* query = CESMRListQuery::NewL( aType, aFilter ); + CleanupStack::PushL( query ); + TInt ret = query->ExecuteLD(); + CleanupStack::Pop( query ); + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::SetListQueryTextsL +// ----------------------------------------------------------------------------- +// +void CESMRListQuery::SetListQueryTextsL( + CDesCArrayFlat* aItemArray, + CAknPopupList* aPopupList) + { + FUNC_LOG; + if ( iType == EESMREditBeforeSendQuery || + iType == EESMREditBeforeSendQueryWithSendOptionsOnly) + { + // Set title: + if (iStatus == EESMRAttendeeStatusAccept) + { + aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_QUERY_ACCEPTED)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if (iStatus == EESMRAttendeeStatusTentative) + { + aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_QUERY_TENTATIVE)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if (iStatus == EESMRAttendeeStatusDecline) + { + aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_QUERY_DECLINED)); + CleanupStack::PopAndDestroy(); // Resource string + } + + // Set list items: + aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_NOW)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_EDIT_BEFORE_SEND)); + CleanupStack::PopAndDestroy(); // Resource string + + if ( iType == EESMREditBeforeSendQuery ) + { + aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_DONT_SEND_RESPONSE)); + CleanupStack::PopAndDestroy(); // Resource string + } + } + + else if ( iType == EESMRSendUpdateToAllQuery ) + { + // Set title: + aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_UPDATE_QUERY)); + CleanupStack::PopAndDestroy(); // Resource string + + // Set list items: + aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_UPDATE_ALL_QUERY)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SEND_UPDATE_UPDATED_QUERY)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRRecurrenceQuery ) + { + // Set title: + aPopupList->SetTitleL(*iEnv->AllocReadResourceAsDes16LC( + R_QTN_MEET_REQ_SET_RECURRENCE_HEADER)); + CleanupStack::PopAndDestroy(); // Resource string + const TInt count(iRecurrenceArray.Count()); + for ( TInt i=0; iAppendL(iRecurrenceArray[i]->RecurrenceText()); + } + } + else if ( iType == EESMRRelativeAlarmTimeQuery ) + { + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_SET_ALARM_HEADER)); + CleanupStack::PopAndDestroy(); // Resource string + + const TInt count(iAlarmArray.Count()); + for ( TInt i=0; iAppendL(*iAlarmArray[i]->Text()); + } + } + else if ( iType == EESMROpenThisOccurenceOrSeriesQuery ) + { + // Set title: + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_HEADING_OPEN)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_THIS_OCCURRENCE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_SERIES)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if (iType == EESMRDeleteThisOccurenceOrSeriesQuery ) + { + // Deleting recurrent event + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_HEADING_DELETE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_THIS_OCCURRENCE_DELETE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_SERIES_DELETE)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRForwardThisOccurenceOrSeriesQuery ) + { + // Set title: + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_HEADING_FORWARD)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RECURRENT_FW_THIS_OCCURRENCE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_FW_RECURRENT_SERIES)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRPriorityPopup || iType == EESMRTodoPriorityPopup) + { + // Set title: + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_OPT_PRIORITY)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_PRIORITY_HIGH)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_PRIORITY_NORMAL)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_PRIORITY_LOW)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRSynchronizationPopup ) + { + // Set title: + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_SYNC_TITLE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_SYNC_PRIVATE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_SYNC_PUBLIC)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_SYNC_NONE)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRUnifiedEditorPopup ) + { + // Set title: + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_UNIFIED_TITLE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_TITLE_MEETING)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TITLE_MEETING)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TITLE_MEMO)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TITLE_ANNIVERSARY)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TITLE_TODO)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRNormalResponseQuery) + { + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_PLEASE_RESPOND)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_ACCEPT)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_TENTATIVE)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_DECLINE)); + CleanupStack::PopAndDestroy(); // Resource string + } + else if ( iType == EESMRRemoveResponseQuery) + { + aPopupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_RESPONSE_PLEASE_RESPOND)); + CleanupStack::PopAndDestroy(); // Resource string + aItemArray->AppendL(*StringLoader::LoadLC( + R_QTN_MEET_REQ_OPTIONS_REMOVE_FROM_CAL)); + CleanupStack::PopAndDestroy(); // Resource string + } + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::MapSelectedIndexToReturnValue +// ----------------------------------------------------------------------------- +// +TInt CESMRListQuery::MapSelectedIndexToReturnValue(TInt aIndex) + { + FUNC_LOG; + TInt response (KErrCancel); + + if (iType == EESMREditBeforeSendQuery || + iType == EESMREditBeforeSendQueryWithSendOptionsOnly ) + { + switch( aIndex ) + { + case 0: + { + response = EESMRResponsePlain; + break; + } + case 1: + { + response = EESMRResponseMessage; + break; + } + case 2: + { + response = EESMRResponseDontSend; + break; + } + default: + { + break; + } + } + } + else if (iType == EESMRSendUpdateToAllQuery ) + { + switch( aIndex ) + { + case 0: + { + response = EESMRSendToAllParticipants; + break; + } + case 1: + { + response = EESMRSendToAddedOrRemovedParticipants; + break; + } + default: + { + break; + } + } + } + else if ( iType == EESMRRecurrenceQuery ) + { + return iRecurrenceArray[aIndex]->RecurrenceValue(); + } + else if ( iType == EESMRRelativeAlarmTimeQuery ) + { + return iAlarmArray[aIndex]->Id(); + } + else if ( iType == EESMROpenThisOccurenceOrSeriesQuery || + iType == EESMRDeleteThisOccurenceOrSeriesQuery || + iType == EESMRForwardThisOccurenceOrSeriesQuery ) + { + switch ( aIndex ) + { + case 0: + { + response = EESMRThisOccurence; + break; + } + case 1: + { + response = EESMRSeries; + break; + } + default: + break; + } + } + else if ( iType == EESMRPriorityPopup ) + { + switch ( aIndex ) + { + case 0: + { + response = EFSCalenMRPriorityHigh; + break; + } + case 1: + { + response = EFSCalenMRPriorityNormal; + break; + } + case 2: + { + response = EFSCalenMRPriorityLow; + break; + } + default: + break; + } + } + else if ( iType == EESMRTodoPriorityPopup ) + { + switch ( aIndex ) + { + case 0: + { + response = EFSCalenTodoPriorityHigh; + break; + } + case 1: + { + response = EFSCalenTodoPriorityNormal; + break; + } + case 2: + { + response = EFSCalenTodoPriorityLow; + break; + } + default: + break; + } + + } + else if ( iType == EESMRSynchronizationPopup ) + { + switch ( aIndex ) + { + case 0: + { + response = ESyncPublic; + break; + } + case 1: + { + response = ESyncPrivate; + break; + } + case 2: + { + response = ESyncNone; + break; + } + default: + break; + } + } + else if ( iType == EESMRUnifiedEditorPopup ) + { + switch ( aIndex ) + { + case 0: + { + response = EMRTypeMeetingRequest; + break; + } + case 1: + { + response = EMRTypeMeeting; + break; + } + case 2: + { + response = EMRTypeMemo; + break; + } + case 3: + { + response = EMRTypeAnniversary; + break; + } + case 4: + { + response = EMRTypeToDo; + break; + } + default: + break; + } + } + else if( iType == EESMRNormalResponseQuery ) + { + switch ( aIndex ) + { + case 0: + { + response = EESMRCmdAcceptMR; + break; + } + case 1: + { + response = EESMRCmdTentativeMR; + break; + } + case 2: + { + response = EESMRCmdDeclineMR; + break; + } + default: + break; + } + } + else if( iType == EESMRRemoveResponseQuery ) + { + switch ( aIndex ) + { + case 0: + { + response = EESMRCmdRemoveFromCalendar; + break; + } + default: + break; + } + } + + return response; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteLD +// ----------------------------------------------------------------------------- +// +void CESMRListQuery::LoadTextsFromResourceL() + { + FUNC_LOG; + if ( iType == EESMRRelativeAlarmTimeQuery ) + { + TResourceReader reader; + iEnv->CreateResourceReaderLC( reader, R_ESMREDITOR_ALARMS ); + + // Read alarm items to array + iAlarmArray.Reset(); + TInt count = reader.ReadInt16(); + for ( TInt i(0); i < count; i++ ) + { + CESMRAlarm* alarm = new (ELeave) CESMRAlarm; + CleanupStack::PushL( alarm ); + alarm->ConstructFromResourceL( reader ); + alarm->LoadTextL( iEnv ); + CleanupStack::Pop( alarm ); + iAlarmArray.Append( alarm ); + } + CleanupStack::PopAndDestroy(); // resource reader + } + else if ( iType == EESMRRecurrenceQuery ) + { + TResourceReader reader; + iEnv->CreateResourceReaderLC( reader, R_ESMREDITOR_RECURRENCE ); + + // Read alarm items to array + iRecurrenceArray.Reset(); + TInt count = reader.ReadInt16(); + for ( TInt i(0); i < count; i++ ) + { + CESMRRecurrence* recurrence = new (ELeave) CESMRRecurrence; + CleanupStack::PushL( recurrence ); + recurrence->ConstructFromResourceL( iEnv, reader ); + CleanupStack::Pop( recurrence ); + iRecurrenceArray.Append( recurrence ); + } + CleanupStack::PopAndDestroy(); // resource reader + } + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteLD +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteLD() + { + FUNC_LOG; + TInt response(KErrCancel); + + CAknSinglePopupMenuStyleListBox* list = + new(ELeave)CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL(list); + + CAknPopupList* popupList = CAknPopupList::NewL(list, + R_AVKON_SOFTKEYS_OK_CANCEL, + AknPopupLayouts::EMenuGraphicHeadingWindow); + CleanupStack::PushL(popupList); + + list->ConstructL(popupList, 0); + list->CreateScrollBarFrameL(ETrue); + list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOn); + + CDesCArrayFlat* itemArray = new(ELeave)CDesCArrayFlat(2); + CleanupStack::PushL(itemArray); + + LoadTextsFromResourceL(); + + SetListQueryTextsL(itemArray, popupList); + + CleanupStack::Pop(itemArray); + + // Dynamic popup for Unified Editor does not include every item + if ( iType == EESMRUnifiedEditorPopup ) + { + // Looped backwards. When removing multiple indexes from array, + // incorrect items would otherwise be removed. + for ( TInt index( iFilter.Count() - 1 ); index >= 0; --index ) + { + itemArray->Delete( ( TInt )iFilter[index] ); + } + } + + list->Model()->SetItemTextArray(itemArray); + list->Model()->SetOwnershipType(ELbmOwnsItemArray); + + // Show popup list and then show return value. + TInt popupOk = popupList->ExecuteLD(); + + if (popupOk) + { + if ( iType == EESMRUnifiedEditorPopup ) + { + response = MapUnifiedEditorItemTextToIndexL( *list ); + ASSERT( KErrNotFound != response ); + } + else + { + response = MapSelectedIndexToReturnValue( + list->CurrentItemIndex() ); + } + } + + CleanupStack::Pop(popupList); + CleanupStack::PopAndDestroy(list); + delete this; // red key works correctly and no double destruction possible + + return response; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteLD +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteLD( RArray& aCalenNameList ) + { + TInt response(KErrCancel); + + CAknSinglePopupMenuStyleListBox* list = + new(ELeave)CAknSinglePopupMenuStyleListBox; + CleanupStack::PushL(list); + + CAknPopupList* popupList = CAknPopupList::NewL(list, + R_AVKON_SOFTKEYS_OK_CANCEL, + AknPopupLayouts::EMenuGraphicHeadingWindow); + CleanupStack::PushL(popupList); + + list->ConstructL(popupList, 0); + list->CreateScrollBarFrameL(ETrue); + list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EOn); + + CDesCArrayFlat* itemArray = new(ELeave)CDesCArrayFlat(2); + CleanupStack::PushL(itemArray); + + // Set title: TODO: Change title + popupList->SetTitleL(*StringLoader::LoadLC( + R_QTN_CALENDAR_TASK_CALENDAR_TITLE)); + CleanupStack::PopAndDestroy(); // Resource string + + TInt count = aCalenNameList.Count(); + + for ( TInt i(0); i < count; i++ ) + { + itemArray->AppendL( aCalenNameList[i] ); + } + + CleanupStack::Pop(itemArray); + list->Model()->SetItemTextArray(itemArray); + list->Model()->SetOwnershipType(ELbmOwnsItemArray); + + // Show popup list and then show return value. + TInt popupOk = popupList->ExecuteLD(); + + if (popupOk) + { + response = list->CurrentItemIndex(); + } + + CleanupStack::Pop(popupList); + CleanupStack::PopAndDestroy(list); + delete this; // red key works correctly and no double destruction possible + + return response; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::ExecuteL +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CESMRListQuery::ExecuteL( + TESMRListQueryType aType, RArray& aCalenNameList ) + { + CESMRListQuery* query = CESMRListQuery::NewL(aType); + CleanupStack::PushL(query); + TInt ret = query->ExecuteLD( aCalenNameList ); + CleanupStack::Pop(query); + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRListQuery::MapUnifiedEditorItemTextToIndexL +// ----------------------------------------------------------------------------- +// +TInt CESMRListQuery::MapUnifiedEditorItemTextToIndexL( + CAknSinglePopupMenuStyleListBox& aList ) + { + FUNC_LOG; + + TInt index( KErrNotFound ); + + TInt itemIndex( aList.CurrentItemIndex() ); + TPtrC selItemText( + aList.Model()->ItemText( itemIndex ) ); + + // Meeting Request + HBufC* mrText = StringLoader::LoadLC( R_QTN_MEET_REQ_TITLE_MEETING ); + HBufC* meetingText = StringLoader::LoadLC( R_QTN_CALENDAR_TITLE_MEETING ); + HBufC* memoText = StringLoader::LoadLC( R_QTN_CALENDAR_TITLE_MEMO ); + HBufC* annivText = StringLoader::LoadLC( R_QTN_CALENDAR_TITLE_ANNIVERSARY ); + HBufC* todoText = StringLoader::LoadLC( R_QTN_CALENDAR_TITLE_TODO ); + + if ( !selItemText.Compare( *mrText ) ) + { + index = EESMREventTypeMeetingRequest; + } + else if ( !selItemText.Compare( *meetingText ) ) + { + index = EESMREventTypeAppt; + } + else if ( !selItemText.Compare( *memoText ) ) + { + index = EESMREventTypeEEvent; + } + else if ( !selItemText.Compare( *annivText ) ) + { + index = EESMREventTypeEAnniv; + } + else if ( !selItemText.Compare( *todoText ) ) + { + index = EESMREventTypeETodo; + } + + CleanupStack::PopAndDestroy( todoText ); + CleanupStack::PopAndDestroy( annivText ); + CleanupStack::PopAndDestroy( memoText ); + CleanupStack::PopAndDestroy( meetingText ); + CleanupStack::PopAndDestroy( mrText ); + + return index; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrrecurrence.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrrecurrence.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper class for recurrence text +* +*/ + +#include "emailtrace.h" +#include +#include "cesmrrecurrence.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRRecurrence::CESMRRecurrence() +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRRecurrence::CESMRRecurrence() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRRecurrence::~CESMRRecurrence() +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRRecurrence::~CESMRRecurrence() + { + FUNC_LOG; + delete iTxt; + } + +// --------------------------------------------------------------------------- +// CESMRRecurrence::ConstructFromResourceL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRRecurrence::ConstructFromResourceL( + CCoeEnv* aEnv, + TResourceReader& aReader ) + { + FUNC_LOG; + iId = static_cast(aReader.ReadInt16()); // WORD + TInt llink = aReader.ReadInt32(); // LLINK + iTxt = StringLoader::LoadL( llink, aEnv ); // load text from TBUF llink + } + +// --------------------------------------------------------------------------- +// CESMRRecurrence::RecurrenceValue() +// --------------------------------------------------------------------------- +// +EXPORT_C TESMRRecurrenceValue CESMRRecurrence::RecurrenceValue() + { + FUNC_LOG; + return iId; + } + +// --------------------------------------------------------------------------- +// CESMRRecurrence::RecurrenceText() +// --------------------------------------------------------------------------- +// +EXPORT_C HBufC& CESMRRecurrence::RecurrenceText() + { + FUNC_LOG; + return *iTxt; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cesmrsendui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cesmrsendui.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,271 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR send ui wrapper +* +*/ + +#include "emailtrace.h" +#include "cesmrsendui.h" +#include "esmrvcalexport.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// hardcoded paths removal +#include +// + +// Unnamed namespace for local definitions +namespace { +// hardcoded paths removal from cmail +_LIT( KVCalAttachmentFile, + "\\private\\10005901\\Calendar.vcs" ); +// + +_LIT( KCalendarDatabaseFilePath, "c:Calendar" ); + +const TInt KNumMtmsToDim =6; + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRSendUI::NewL() +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRSendUI* CESMRSendUI::NewL(TInt aMenuCommandId) + { + FUNC_LOG; + CESMRSendUI* self = new (ELeave) CESMRSendUI(); + CleanupStack::PushL(self); + self->ConstructL(aMenuCommandId); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::CESMRSendUI() +// --------------------------------------------------------------------------- +// +CESMRSendUI::CESMRSendUI() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::ConstructL() +// --------------------------------------------------------------------------- +// +void CESMRSendUI::ConstructL(TInt aMenuCommandId) + { + FUNC_LOG; + iSession = CCalSession::NewL(); + iSession->OpenL( KCalendarDatabaseFilePath ); + iSendUi = CSendUi::NewL(); + iSendAsCmdId=aMenuCommandId; + iSendMtmsToDim = new (ELeave) CArrayFixFlat(2); + + iSendMtmsToDim->SetReserveL( KNumMtmsToDim ); + // Always disable sending via Audio message + iSendMtmsToDim->AppendL( KSenduiMtmAudioMessageUid ); + iSendMtmsToDim->AppendL( KSenduiMtmPostcardUid ); + iSendMtmsToDim->AppendL( KMmsDirectUpload ); + iSendMtmsToDim->AppendL( KMmsIndirectUpload ); + iSendMtmsToDim->AppendL( KSenduiMtmOnlineAlbumUid ); + + if( ! iSendUi->CanSendBioMessage( KMsgBioUidVCalendar ) ) + { + // This disables sending of vCalendars via SMS + iSendMtmsToDim->AppendL(KSenduiMtmSmsUid); + } + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::~CESMRSendUI() +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRSendUI::~CESMRSendUI() + { + FUNC_LOG; + delete iSession; + delete iSendUi; + delete iSendMtmsToDim; + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::CanSendL() +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRSendUI::CanSendL(TInt /*aCommandId*/) + { + FUNC_LOG; + + if( iSelectedMtmUid != KNullUid ) + { + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::DisplaySendMenuItemL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRSendUI::DisplaySendMenuItemL(CEikMenuPane& aMenuPane, + TInt aIndex) + { + FUNC_LOG; + iSendUi->AddSendMenuItemL( + aMenuPane, aIndex, iSendAsCmdId, TSendingCapabilities() ); + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::DisplaySendCascadeMenuL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRSendUI::DisplaySendCascadeMenuL(CEikMenuPane& /*aMenuPane*/) + { + FUNC_LOG; + iSelectedMtmUid = iSendUi->ShowSendQueryL( + NULL, KCapabilitiesForAllServices, iSendMtmsToDim, KNullDesC ); + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::SendAsVCalendarL() +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRSendUI::SendAsVCalendarL( + TInt /*aCommand*/, + CCalEntry& aEntry) + { + FUNC_LOG; + + // If the user selected email as their protocol, + // and the entry is a MR, send using MR utils. + + CEikonEnv* eikonEnv = CEikonEnv::Static();// codescanner::eikonenvstatic + CRichText* text = CRichText::NewL( + eikonEnv->SystemParaFormatLayerL(), + eikonEnv->SystemCharFormatLayerL()); + CleanupStack::PushL(text); + + TESMRVCalExport exporter(*iSession, eikonEnv->FsSession()); + HBufC8* vcal = exporter.ExportVCalLC(aEntry); + + TUid mtmUid = iSelectedMtmUid; + TSendingCapabilities capabilities; + iSendUi->ServiceCapabilitiesL( mtmUid, capabilities ); + + if (capabilities.iFlags & TSendingCapabilities::ESupportsAttachments) + { + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + // must share the handle between processes + User::LeaveIfError( fs.ShareProtected() ); + // hardcoded paths removal from cmail + TFileName fileName(PathInfo::PhoneMemoryRootPath().Left(2)); + fileName.Append(KVCalAttachmentFile); + fs.MkDirAll(fileName); + // + RFile file; + User::LeaveIfError(file.Replace(// + fs,fileName,EFileWrite | EFileShareAny ));// + CleanupClosePushL(file); + TInt spaceNeeded = vcal->Size(); + if ( SysUtil::FFSSpaceBelowCriticalLevelL( &fs, spaceNeeded ) ) + { + // don't show any own notes here + User::Leave( KErrDiskFull ); + } + + User::LeaveIfError(file.Write(*vcal)); + + TParse parse;// + User::LeaveIfError(parse.SetNoWild(fileName,// + NULL, NULL)); + + TRAPD(err, DoSendAsAttachmentHandleL(file)); + + CleanupStack::PopAndDestroy(&file); + fs.Delete(parse.FullName()); + CleanupStack::PopAndDestroy( &fs ); + User::LeaveIfError(err); + } + else + { + TPtrC8 p8(*vcal); + HBufC* bufCnv = HBufC::NewLC(p8.Length()); + TPtr16 des(bufCnv->Des()); + des.Copy(p8); + text->InsertL(0, des); + + CMessageData* messageData = CMessageData::NewL(); + CleanupStack::PushL( messageData ); + messageData->SetBodyTextL( text ); + iSendUi->CreateAndSendMessageL( + iSelectedMtmUid, messageData, KMsgBioUidVCalendar, ETrue ); + CleanupStack::PopAndDestroy(); // messagedata + CleanupStack::PopAndDestroy(bufCnv); + } + CleanupStack::PopAndDestroy(vcal); + CleanupStack::PopAndDestroy(text); + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::DoSendAsAttachmentFileL() +// --------------------------------------------------------------------------- +// +void CESMRSendUI::DoSendAsAttachmentFileL(TInt /*aCommand*/, TParse& aFilename) + { + FUNC_LOG; + CMessageData* messageData = CMessageData::NewL(); + CleanupStack::PushL( messageData ); + messageData->AppendAttachmentL( aFilename.FullName() ); + iSendUi->CreateAndSendMessageL( + iSelectedMtmUid, messageData, KMsgBioUidVCalendar, ETrue ); + CleanupStack::PopAndDestroy(); // messagedata + } + +// --------------------------------------------------------------------------- +// CESMRSendUI::DoSendAsAttachmentHandleL() +// --------------------------------------------------------------------------- +// +void CESMRSendUI::DoSendAsAttachmentHandleL(const RFile& aHandle) + { + FUNC_LOG; + CMessageData* messageData = CMessageData::NewL(); + CleanupStack::PushL( messageData ); + messageData->AppendAttachmentHandleL(aHandle); + iSendUi->CreateAndSendMessageL( + iSelectedMtmUid, messageData, KMsgBioUidVCalendar, ETrue ); + CleanupStack::PopAndDestroy( messageData ); + } + + +// End of File + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cmrbutton.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cmrbutton.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cmrbutton.h" +#include "esmrhelper.h" + +#include +#include +#include + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRButton::~CMRButton +// --------------------------------------------------------------------------- +// +EXPORT_C CMRButton* CMRButton::NewL( + NMRBitmapManager::TMRBitmapId aBitmapId, TScaleMode aScaleMode ) + { + CMRButton* self = new (ELeave) CMRButton( aScaleMode ); + CleanupStack::PushL( self ); + self->ConstructL( aBitmapId ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRButton::~CMRButton +// --------------------------------------------------------------------------- +// +EXPORT_C CMRButton::~CMRButton() + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRButton::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRButton::SizeChanged() + { + TSize sz = Rect().Size(); + const CFbsBitmap* bitmap = GetCurrentIcon()->Bitmap(); + AknIconUtils::SetSize( const_cast< CFbsBitmap* >( bitmap ), sz, iScaleMode ); + } + +// --------------------------------------------------------------------------- +// CMRButton::CMRButton +// --------------------------------------------------------------------------- +// +CMRButton::CMRButton( TScaleMode aScaleMode ) + : CAknButton( KAknButtonNoFrame | KAknButtonPressedDownFrame ), + iScaleMode( aScaleMode ) + { + // No implementation + } + +// --------------------------------------------------------------------------- +// CMRButton::ConstructL +// --------------------------------------------------------------------------- +// +void CMRButton::ConstructL( NMRBitmapManager::TMRBitmapId aBitmapId ) + { + CFbsBitmap* bitMap( NULL ); + CFbsBitmap* bitMapMask( NULL ); + TSize sz( Rect().Size() ); + User::LeaveIfError( NMRBitmapManager::GetSkinBasedBitmap( + aBitmapId, + bitMap, bitMapMask, sz ) ); + + CGulIcon* icon = CGulIcon::NewL( bitMap, bitMapMask ); + + CAknButton::ConstructL( + icon, + NULL, + NULL, + NULL, + KNullDesC(), + KNullDesC(), + KAknButtonNoFrame | KAknButtonPressedDownFrame ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cmrimage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cmrimage.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "cmrimage.h" +#include "esmrhelper.h" +#include +#include +#include + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRImage::~CMRImage +// --------------------------------------------------------------------------- +// +EXPORT_C CMRImage* CMRImage::NewL( + NMRBitmapManager::TMRBitmapId aBitmapId, + TBool aIsMaskIcon, + TScaleMode aScaleMode ) + { + CMRImage* self = new (ELeave) CMRImage( aScaleMode ); + CleanupStack::PushL( self ); + self->ConstructL( aBitmapId, aIsMaskIcon ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRImage::~CMRImage +// --------------------------------------------------------------------------- +// +EXPORT_C CMRImage::~CMRImage() + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRImage::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRImage::SizeChanged() + { + TSize sz = Rect().Size(); + const CFbsBitmap* bitmap = Bitmap(); + AknIconUtils::SetSize( const_cast< CFbsBitmap* >( bitmap ), sz, iScaleMode ); + } + +// --------------------------------------------------------------------------- +// CMRImage::CMRImage +// --------------------------------------------------------------------------- +// +CMRImage::CMRImage( TScaleMode aScaleMode ) + : iScaleMode( aScaleMode ) + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRImage::ConstructL +// --------------------------------------------------------------------------- +// +void CMRImage::ConstructL( NMRBitmapManager::TMRBitmapId aBitmapId, + TBool aIsMaskIcon ) + { + if( aIsMaskIcon ) + { + CreateMaskIconL( aBitmapId ); + } + else + { + CreateIconL( aBitmapId ); + } + } + +// --------------------------------------------------------------------------- +// CMRImage::CreateIconL +// --------------------------------------------------------------------------- +// +void CMRImage::CreateIconL( NMRBitmapManager::TMRBitmapId aBitmapId ) + { + CFbsBitmap* bitMap( NULL ); + CFbsBitmap* bitMapMask( NULL ); + TSize sz( Rect().Size() ); + User::LeaveIfError( + NMRBitmapManager::GetSkinBasedBitmap( + aBitmapId, + bitMap, bitMapMask, sz ) ); + + if( bitMap && bitMapMask ) + { + SetPictureOwnedExternally( EFalse ); + SetBrushStyle( CWindowGc::ENullBrush ); + SetPicture( bitMap, bitMapMask ); + } + } + +// --------------------------------------------------------------------------- +// CMRImage::CreateMaskIconL +// --------------------------------------------------------------------------- +// +void CMRImage::CreateMaskIconL( NMRBitmapManager::TMRBitmapId aBitmapId ) + { + CFbsBitmap* bitMap( NULL ); + CFbsBitmap* bitMapMask( NULL ); + TSize sz( Rect().Size() ); + User::LeaveIfError( + NMRBitmapManager::GetMaskIconBitmap( + aBitmapId, + bitMap, bitMapMask, + EAknsCIQsnIconColorsCG13, + sz ) ); + + if( bitMap && bitMapMask ) + { + SetPictureOwnedExternally( EFalse ); + SetBrushStyle( CWindowGc::ENullBrush ); + SetPicture( bitMap, bitMapMask ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cmrlabel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cmrlabel.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: URL Parser ECom plugin entry point +* +*/ +#include "cmrlabel.h" +#include "nmrcolormanager.h" + +#include +#include +#include +#include +#include + +#include "emailtrace.h" + +// --------------------------------------------------------------------------- +// CMRLabel::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CMRLabel* CMRLabel::NewL() + { + FUNC_LOG; + + CMRLabel* self = new (ELeave) CMRLabel(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRLabel::ConstructL +// --------------------------------------------------------------------------- +// +void CMRLabel::ConstructL() + { + FUNC_LOG; + + NMRColorManager::SetColor( *this, + NMRColorManager::EMRMainAreaTextColor ); + } + +// --------------------------------------------------------------------------- +// CMRLabel::CMRLabel +// --------------------------------------------------------------------------- +// +CMRLabel::CMRLabel() + { + FUNC_LOG; + + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRLabel::~CMRLabel +// --------------------------------------------------------------------------- +// +EXPORT_C CMRLabel::~CMRLabel() + { + FUNC_LOG; + + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRLabel::FocusChanged +// --------------------------------------------------------------------------- +// +void CMRLabel::FocusChanged( TDrawNow aDrawNow ) + { + FUNC_LOG; + + CEikLabel::FocusChanged( aDrawNow ); + } + +// --------------------------------------------------------------------------- +// CMRLabel::SizeChanged +// --------------------------------------------------------------------------- +// +void CMRLabel::SizeChanged() + { + FUNC_LOG; + + CEikLabel::SizeChanged(); + + NMRColorManager::SetColor( + *this, + NMRColorManager::EMRMainAreaTextColor ); + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/cmrstyluspopupmenu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/cmrstyluspopupmenu.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment progress info +* +*/ + +#include "cmrstyluspopupmenu.h" + +#include + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::TMenuItem::TMenuItem +// --------------------------------------------------------------------------- +// +EXPORT_C CMRStylusPopupMenu::TMenuItem::TMenuItem() +: iTxt( KNullDesC() ), iCommandId( 0 ) + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::TMenuItem::TMenuItem +// --------------------------------------------------------------------------- +// +EXPORT_C CMRStylusPopupMenu::TMenuItem::TMenuItem( + const TDesC& aTxt, TInt aCommandId ) +: iTxt( aTxt ), iCommandId( aCommandId ) + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::CMRStylusPopupMenu +// --------------------------------------------------------------------------- +// +CMRStylusPopupMenu::CMRStylusPopupMenu( MEikMenuObserver& aObserver ) +: iObserver( aObserver ) + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::ConstructL +// --------------------------------------------------------------------------- +// +void CMRStylusPopupMenu::ConstructL() + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CMRStylusPopupMenu* CMRStylusPopupMenu::NewL( MEikMenuObserver& aObserver ) + { + CMRStylusPopupMenu* self = new (ELeave) CMRStylusPopupMenu( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::~CMRStylusPopupMenu +// --------------------------------------------------------------------------- +// +EXPORT_C CMRStylusPopupMenu::~CMRStylusPopupMenu() + { + delete iPopup; + } + +// --------------------------------------------------------------------------- +// CMRStylusPopupMenu::LaunchPopupL +// --------------------------------------------------------------------------- +// +EXPORT_C void CMRStylusPopupMenu::LaunchPopupL( + TArray aItems, const TPoint &aPosition ) + { + if( iPopup ) + { + delete iPopup; + iPopup = NULL; + } + iPopup = CAknStylusPopUpMenu::NewL( &iObserver, aPosition ); + TInt count( aItems.Count() ); + for( TInt i = 0; i < count; ++i ) + { + TMenuItem item = aItems[ i ]; + iPopup->AddMenuItemL( item.iTxt, item.iCommandId ); + } + iPopup->SetPosition( aPosition ); + iPopup->ShowMenu(); + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/esmrvcalexport.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/esmrvcalexport.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: VCal exporter for send ui wrapper +* +*/ + + +//debug +// INCLUDE FILES +#include "emailtrace.h" +#include "esmrvcalexport.h" + +#include // r_qtn_meet_req_conflict_unnamed +#include +#include +#include // For FeatureIds +#include +#include +#include +#include +#include + +namespace { + +// LOCAL CONSTANTS AND MACROS +const TInt KDynBufExpandSize(100); + +// This flag definition should match EUTCTime flag +// in \s60\AgnVersit\inc\S60AgnVersit.h +#define S60AGNVERSIT_EUTCTIME 0x1000 +#define S60AGNVERSIT_EJAPAN 0x2000 + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// TESMRVCalExport::TESMRVCalExport() +// --------------------------------------------------------------------------- +// +TESMRVCalExport::TESMRVCalExport( + CCalSession& aCalSession, + RFs& aFileServerSession): + iSession(aCalSession), + iFs(aFileServerSession) + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// TESMRVCalExport::ExportVCalLC() +// --------------------------------------------------------------------------- +// +HBufC8* TESMRVCalExport::ExportVCalLC(CCalEntry& aEntry) + { + FUNC_LOG; + + const TDesC& subject=aEntry.SummaryL(); + + TBool emptySubject = subject.Length() ==0; + if (emptySubject) + { + // If subject is empty, we add text to it + HBufC* unnamed = + StringLoader::LoadLC( + R_QTN_MEET_REQ_CONFLICT_UNNAMED, + CEikonEnv::Static()); // codescanner::eikonenvstatic + + aEntry.SetSummaryL(*unnamed); + CleanupStack::PopAndDestroy(unnamed); + } + + CBufFlat* buf = CBufFlat::NewL( KDynBufExpandSize ); + CleanupStack::PushL(buf); + ConvertVCalL(buf, aEntry); + + HBufC8* result = HBufC8::NewL( buf->Size() ); + result->Des().Copy(buf->Ptr(0)); + CleanupStack::PopAndDestroy(buf); + CleanupStack::PushL(result); + + return result; + } + +// --------------------------------------------------------------------------- +// TESMRVCalExport::ConvertVCalL() +// --------------------------------------------------------------------------- +// +void TESMRVCalExport::ConvertVCalL(CBufFlat* aBuf, CCalEntry& aEntry) + { + FUNC_LOG; + + // CCalEntry is converted to VCal + RBufWriteStream writeStream; + writeStream.Open(*aBuf); + CleanupClosePushL(writeStream); + CCalenExporter* exporter=CCalenExporter::NewL(iSession); + CleanupStack::PushL(exporter); + exporter->ExportVCalL( aEntry, writeStream); + CleanupStack::PopAndDestroy(exporter); + CleanupStack::PopAndDestroy(&writeStream); + + } + +// --------------------------------------------------------------------------- +// TESMRVCalExport::ConvertICalL() +// --------------------------------------------------------------------------- +// +void TESMRVCalExport::ConvertICalL(CBufFlat* aBuf, CCalEntry& aEntry) + { + FUNC_LOG; + + // CCalEntry is converted to iCal + RBufWriteStream writeStream; + writeStream.Open(*aBuf); + CleanupClosePushL(writeStream); + CCalenExporter* exporter=CCalenExporter::NewL(iSession); + CleanupStack::PushL(exporter); + exporter->ExportICalL( aEntry, writeStream); + CleanupStack::PopAndDestroy(exporter); + CleanupStack::PopAndDestroy(&writeStream); + + } + + +// End of File + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/nmrbitmapmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/nmrbitmapmanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,808 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Bitmap manager for MRGUI usage. +* +*/ + +#include "nmrbitmapmanager.h" +#include "esmrhelper.h" + +#include +#include +#include +#include +#include + +using namespace NMRBitmapManager; + +namespace { // codescanner::unnamednamespace + +// Icon mif file. +_LIT( KESMRMifFile, "esmrgui.mif"); + +#ifdef _DEBUG + +// Definition for panic text +_LIT( KNMRBitmapManager, "NMRBitmapManager" ); + +/** + * ES MR Entry panic codes + */ +enum TNMRBitmapManager + { + KUnhandledBitmapId = 1 + }; + +/** + * Raises panic. + * @param aPanic Panic code + */ +void Panic(TNMRBitmapManager aPanic) + { + User::Panic( KNMRBitmapManager, aPanic); + } + +#endif // _DEBUG + +} + +// --------------------------------------------------------------------------- +// NMRBitmapManager::GetSkinBasedBitmap +// --------------------------------------------------------------------------- +// +EXPORT_C TMRBitmapStruct NMRBitmapManager::GetBitmapStruct( TMRBitmapId aBitmapId ) + { + TMRBitmapStruct bitmapStruct; + + switch ( aBitmapId ) + { + case EMRBitmapRightClickArrow: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailActionArrowRight; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right_mask; + break; + } + case EMRBitmapTrackingAccept: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingAccept; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_accept_mask; + break; + } + case EMRBitmapTrackingReject: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingReject; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_reject_mask; + break; + } + case EMRBitmapTrackingTentative: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingTentative; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_tentative_mask; + break; + } + case EMRBitmapTrackingNone: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarTrackingNone; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_tracking_none_mask; + break; + } + case EMRBitmapPriorityHigh: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityHigh; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_high_mask; + break; + } + case EMRBitmapPriorityLow: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityLow; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_low_mask; + break; + } + case EMRBitmapPriorityNormal: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarPriorityNormal; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_priority_normal_mask; + break; + } + case EMRBitmapSynchronization: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailSynchronisation; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_synchronisation_mask; + break; + } + case EMRBitmapSubject: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarSubject; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_subject_mask; + break; + } + case EMRBitmapOccasion: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarOccasion; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_occasion_mask; + break; + } + case EMRBitmapRecurrence: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailCalendarRecurrence; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_calendar_recurrence_mask; + break; + } + case EMRBitmapBrowser: + { + // TODO: not available + // bitmapStruct.iItemId = KAknsIIDQgnMenuBrowserng; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_browserng; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_browserng_mask; + + // TODO: remove me asap + bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; + break; + } + case EMRBitmapIntranet: + { + bitmapStruct.iItemId = KAknsIIDQgnMenuIntranet; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_menu_intranet; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_menu_intranet_mask; + break; + } + case EMRBitmapBookmark: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailWmlBookmark; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_wml_bookmark_mask; + break; + } + case EMRBitmapAlarm: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqAlarm; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; + break; + } + case EMRBitmapAlarmClock: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCalendarClockAlarm; + // TODO: use new icon + //bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_calendar_clock_alarm; + //bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_calendar_clock_alarm_mask; + + // TODO: remove me asap, not in platform atm. + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_alarm_mask; + break; + } + case EMRBitmapCheckBoxOn: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqCheckboxOn; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_on_mask; + break; + } + case EMRBitmapCheckBoxOff: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqCheckboxOff; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_checkbox_off_mask; + break; + } + case EMRBitmapClock: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqClock; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_clock_mask; + break; + } + case EMRBitmapLocation: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqLocation; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_location_mask; + break; + } + case EMRBitmapLocationWaypoint: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCalLocatEventAdd; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cal_locat_event_add; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cal_locat_event_add_mask; + break; + } + case EMRBitmapDateStart: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateStart; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_start_mask; + break; + } + case EMRBitmapDateEnd: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailMeetReqDateEnd; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_meet_req_date_end_mask; + break; + } + case EMRBitmapAttachment: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailAttachment; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; + break; + } + case EMRBitmapCtrlBar: + { + bitmapStruct.iItemId = KAknsIIDQgnGrafCmailEmailCtrlbar; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_graf_cmail_email_ctrlbar_mask; + break; + } + case EMRBitmapSearchContacts: + { + bitmapStruct.iItemId = KAknsIIDQgnPropSearchContacts; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_search_contacts; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_search_contacts_mask; + break; + } + case EMRBitmapCalendarSelection: + { + bitmapStruct.iItemId = KAknsIIDQgnPropNrtypDate; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_nrtyp_date; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_nrtyp_date_mask; + break; + } + case EMRBitmapEventTypeMeeting: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCdrMeeting; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_meeting; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_meeting_mask; + break; + } + case EMRBitmapEventTypeMR: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCdrInvitation; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_invitation; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_invitation_mask; + break; + } + case EMRBitmapEventTypeMemo: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCdrReminder; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_reminder; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_reminder_mask; + break; + } + case EMRBitmapEventTypeAnniversary: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCdrBirthday; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_birthday; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_birthday_mask; + break; + } + case EMRBitmapEventTypeTodo: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCdrTodo; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cdr_todo; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cdr_todo_mask; + break; + } + case EMRBitmapListCenter: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListCenter; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; + break; + } + case EMRBitmapListTop: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListSideT; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; + break; + } + case EMRBitmapListBottom: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListSideB; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; + break; + } + case EMRBitmapListLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListSideL; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; + break; + } + case EMRBitmapListRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListSideR; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; + break; + } + case EMRBitmapListTopLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTl; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; + break; + } + case EMRBitmapListTopRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListCornerTr; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; + break; + } + case EMRBitmapListBottomLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBl; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; + break; + } + case EMRBitmapListBottomRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrListCornerBr; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; + break; + } + + case EMRBitmapMailAttachment: + { + bitmapStruct.iItemId = KAknsIIDQgnFseMailAttachment; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_attachment; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_attachment_mask; + break; + } + case EMRBitmapOpenAttachmentView: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentListOptionsViewAll; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_list_options_view_all_mask; + break; + } + case EMRBitmapOpenAttachment: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentOpen; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_open_mask; + break; + } + case EMRBitmapDownloadAttachment: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownload; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_mask; + break; + } + case EMRBitmapDownloadAllAttachments: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentDownloadAll; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_download_all_mask; + break; + } + case EMRBitmapSaveAttachment: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSave; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_mask; + break; + } + case EMRBitmapSaveAllAttachments: + { + bitmapStruct.iItemId = KAknsIIDQgnPropCmailActionAttachmentSaveAll; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_prop_cmail_action_attachment_save_all_mask; + break; + } + + // TODO: Needs correct fallbacks + case EMRBitmapInputCenter: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputCenter; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; + break; + } + case EMRBitmapInputTop: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputSideT; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; + break; + } + case EMRBitmapInputBottom: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputSideB; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; + break; + } + case EMRBitmapInputLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputSideL; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; + break; + } + case EMRBitmapInputRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputSideR; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; + break; + } + case EMRBitmapInputTopLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTl; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; + break; + } + case EMRBitmapInputTopRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerTr; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; + break; + } + case EMRBitmapInputBottomLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBl; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; + break; + } + case EMRBitmapInputBottomRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrInputCornerBr; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; + break; + } + + // TODO: Needs correct fallbacks + case EMRBitmapSetOptCenter: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCenter; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_center; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_center_mask; + break; + } + case EMRBitmapSetOptTop: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideT; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_t; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_t_mask; + break; + } + case EMRBitmapSetOptBottom: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideB; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_b; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_b_mask; + break; + } + case EMRBitmapSetOptLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideL; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_l; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_l_mask; + break; + } + case EMRBitmapSetOptRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptSideR; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_side_r; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_side_r_mask; + break; + } + case EMRBitmapSetOptTopLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTl; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tl; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tl_mask; + break; + } + case EMRBitmapSetOptTopRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerTr; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_tr; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_tr_mask; + break; + } + case EMRBitmapSetOptBottomLeft: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBl; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_bl; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_bl_mask; + break; + } + case EMRBitmapSetOptBottomRight: + { + bitmapStruct.iItemId = KAknsIIDQsnFrSetOptCornerBr; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQsn_fr_list_corner_br; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQsn_fr_list_corner_br_mask; + break; + } + case EMRBitmapMailPre: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowPrevious; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_previous; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_previous_mask; + break; + } + case EMRBitmapMailNext: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailArrowNext; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_arrow_next; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_arrow_next_mask; + break; + } + case EMRBitmapAttachmentTypeImage: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbImage; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_image; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_image_mask; + break; + } + case EMRBitmapAttachmentTypeVideo: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbVideo; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_video; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_video_mask; + break; + } + case EMRBitmapAttachmentTypeMusic: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbAudio; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_audio; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_audio_mask; + break; + } + + case EMRBitmapAttachmentTypeNote: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiTbNote; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_tb_note; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_tb_note_mask; + break; + } + + case EMRBitmapAttachmentTypePresentations: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbPres; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_pres; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_pres_mask; + break; + } + case EMRBitmapAttachmentTypeOther: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiMceTbOther; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_mce_tb_other; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_mce_tb_other_mask; + break; + } + case EMRBitmapLockField: + { + bitmapStruct.iItemId = KAknsIIDQgnIndiSettProtectedAdd; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_sett_protected_add; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_sett_protected_add_mask; + break; + } + default: + { + // We shouldn't end up here. + __ASSERT_DEBUG( EFalse, Panic( KUnhandledBitmapId ) ); + bitmapStruct.iItemId = KAknsIIDQgnIndiCmailActionArrowRight; + bitmapStruct.iFallbackIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right; + bitmapStruct.iFallbackMaskIndex = EMbmEsmrguiQgn_indi_cmail_action_arrow_right_mask; + break; + } + } + + return bitmapStruct; + } + +// --------------------------------------------------------------------------- +// NMRBitmapManager::GetSkinBasedBitmap +// --------------------------------------------------------------------------- +// +EXPORT_C TInt NMRBitmapManager::GetSkinBasedBitmap( + TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TSize aSize ) + { + TInt retValue = KErrNone; + delete aBitmap; + aBitmap = NULL; + delete aMask; + aMask = NULL; + + TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); + + TFileName bitmapFilePath; + ESMRHelper::LocateResourceFile( + KESMRMifFile, + KDC_APP_BITMAP_DIR, + bitmapFilePath ); + + TRAPD( error, AknsUtils::CreateIconL( AknsUtils::SkinInstance(), + bitmapStruct.iItemId, + aBitmap, + aMask, + bitmapFilePath, + bitmapStruct.iFallbackIndex, + bitmapStruct.iFallbackMaskIndex ) ); + + if ( error != KErrNone ) + { + return error; + } + + AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); + + if( !aBitmap || !aMask ) + { + retValue = KErrNotFound; + } + return retValue; + } + +// --------------------------------------------------------------------------- +// NMRBitmapManager::GetSkinBasedBitmapLC +// --------------------------------------------------------------------------- +// +EXPORT_C void NMRBitmapManager::GetSkinBasedBitmapLC( + TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TSize aSize ) + { + delete aBitmap; + aBitmap = NULL; + delete aMask; + aMask = NULL; + + TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); + + TFileName bitmapFilePath; + ESMRHelper::LocateResourceFile( + KESMRMifFile, + KDC_APP_BITMAP_DIR, + bitmapFilePath ); + + AknsUtils::CreateIconLC( AknsUtils::SkinInstance(), + bitmapStruct.iItemId, + aBitmap, + aMask, + bitmapFilePath, + bitmapStruct.iFallbackIndex, + bitmapStruct.iFallbackMaskIndex ); + + AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); + } + +// --------------------------------------------------------------------------- +// NMRBitmapManager::GetMaskIconBitmap +// --------------------------------------------------------------------------- +// +EXPORT_C TInt NMRBitmapManager::GetMaskIconBitmap( TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TInt aColorIndex, + TSize aSize ) + { + TInt retValue = KErrNone; + delete aBitmap; + aBitmap = NULL; + delete aMask; + aMask = NULL; + + TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); + + TFileName bitmapFilePath; + ESMRHelper::LocateResourceFile( + KESMRMifFile, + KDC_APP_BITMAP_DIR, + bitmapFilePath ); + + TRgb defaultColour( KRgbBlack ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, defaultColour, + KAknsIIDQsnIconColors, aColorIndex ); + + TRAPD(error, AknsUtils::CreateColorIconL( skin, + bitmapStruct.iItemId, + KAknsIIDQsnIconColors, + aColorIndex, + aBitmap, + aMask, + bitmapFilePath, + bitmapStruct.iFallbackIndex, + bitmapStruct.iFallbackMaskIndex, + defaultColour ) ); + + if ( error != KErrNone ) + { + return error; + } + + AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); + + if( !aBitmap || !aMask ) + { + retValue = KErrNotFound; + } + return retValue; + } + +// --------------------------------------------------------------------------- +// NMRBitmapManager::GetMaskIconBitmap +// --------------------------------------------------------------------------- +// +EXPORT_C void NMRBitmapManager::GetMaskIconBitmapLC( TMRBitmapId aBitmapId, + CFbsBitmap*& aBitmap, + CFbsBitmap*& aMask, + TInt aColorIndex, + TSize aSize ) + { + delete aBitmap; + aBitmap = NULL; + delete aMask; + aMask = NULL; + + TMRBitmapStruct bitmapStruct = GetBitmapStruct( aBitmapId ); + + TFileName bitmapFilePath; + ESMRHelper::LocateResourceFile( + KESMRMifFile, + KDC_APP_BITMAP_DIR, + bitmapFilePath ); + + TRgb defaultColour( KRgbBlack ); + + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor( skin, defaultColour, + KAknsIIDQsnIconColors, aColorIndex ); + + AknsUtils::CreateColorIconLC( skin, + bitmapStruct.iItemId, + KAknsIIDQsnIconColors, + aColorIndex, + aBitmap, + aMask, + bitmapFilePath, + bitmapStruct.iFallbackIndex, + bitmapStruct.iFallbackMaskIndex, + defaultColour ); + + AknIconUtils::SetSize( aBitmap, aSize, EAspectRatioNotPreserved ); + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/nmrcolormanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/nmrcolormanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Color manager for MRGUI usage. +* +*/ + +#include "nmrcolormanager.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace NMRColorManager; + +namespace { // codescanner::unnamednamespace + +#ifdef _DEBUG + +// Definition for panic text +_LIT( KNMRColorManager, "NMRColorManager" ); + +/** + * ES MR Entry panic codes + */ +enum TNMRColorManager + { + KUnhandledColorId = 1 + }; + +/** + * Raises panic. + * @param aPanic Panic code + */ +void Panic( TNMRColorManager aPanic ) + { + User::Panic( KNMRColorManager, aPanic); + } + +#endif // _DEBUG + +} + +// --------------------------------------------------------------------------- +// NMRColorManager::GetColorStruct +// --------------------------------------------------------------------------- +// +EXPORT_C TMRColorStruct NMRColorManager::GetColorStruct( TMRColorId aColorId ) + { + TMRColorStruct colorStruct; + + switch ( aColorId ) + { + case EMRMainAreaTextColor: + { + colorStruct.iColorGroup = KAknsIIDQsnTextColors; + colorStruct.iColorIndex = EAknsCIQsnTextColorsCG6; + break; + } + case EMRCutCopyPasteHighlightColor: + { + colorStruct.iColorGroup = KAknsIIDQsnHighlightColors; + colorStruct.iColorIndex = EAknsCIQsnHighlightColorsCG2; + break; + } + case EMRCopiedTextColor: + { + colorStruct.iColorGroup = KAknsIIDQsnTextColors; + colorStruct.iColorIndex = EAknsCIQsnTextColorsCG24; + break; + } + case EMRNaviPaneText: + { + colorStruct.iColorGroup = KAknsIIDQsnTextColors; + colorStruct.iColorIndex = EAknsCIQsnTextColorsCG2; + break; + } + case EMRPredictiveSearchPopUpBgColor: + { + colorStruct.iColorGroup = KAknsIIDFsOtherColors; + colorStruct.iColorIndex = EAknsCIFsOtherColorsCG13; + break; + } + case EMRMainAreaTextColorDimmed: + { + colorStruct.iColorGroup = KAknsIIDFsOtherColors; + colorStruct.iColorIndex = EAknsCIFsOtherColorsCG1; + // TODO: Once feature confirmed by UI specifier, confirm the + // correct color + } + // TODO: For testing purposes only; keep as last item during development + case EMRLastColorItemId: + { + colorStruct.iColorGroup = KAknsIIDQsnTextColors; + colorStruct.iColorIndex = EAknsCIQsnTextColorsCG74; + break; + } + default: + { + __ASSERT_DEBUG( EFalse, Panic( KUnhandledColorId ) ); + break; + } + } + return colorStruct; + } + +// --------------------------------------------------------------------------- +// NMRColorManager::Color +// --------------------------------------------------------------------------- +// +EXPORT_C TRgb NMRColorManager::Color( TMRColorId aColorId ) + { + TRgb color; + TMRColorStruct colorStruct = GetColorStruct( aColorId ); + + AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), + color, + colorStruct.iColorGroup, + colorStruct.iColorIndex ); + return color; + } + +// --------------------------------------------------------------------------- +// NMRColorManager::SetColor +// --------------------------------------------------------------------------- +// +EXPORT_C void NMRColorManager::SetColor( CCoeControl& aControl, + TMRColorId aColorId ) + { + // If color setting fails, we just don't set it + TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( + aControl, + EColorLabelText, + Color( aColorId ) ) ); + } + +// --------------------------------------------------------------------------- +// NMRColorManager::SetColor +// --------------------------------------------------------------------------- +// +EXPORT_C void NMRColorManager::SetColor( CEikTTimeEditor& aEditor, + TMRColorId aColorId ) + { + TMRColorStruct colorStruct = GetColorStruct( aColorId ); + + // If color setting fails, we just don't set it + TRAP_IGNORE( aEditor.SetSkinTextColorL( colorStruct.iColorIndex ) ); + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/nmrlayoutmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/nmrlayoutmanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,338 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Layout manager for MRGUI usage. +* +*/ + +#include "nmrlayoutmanager.h" + +#include +#include +#include + + +using namespace NMRLayoutManager; + + +// Unnamed namespace for local definitions +namespace { // codescanner::unnamednamespace + + // Numerals for layout data usage. + const TInt KLayoutValueZero = 0; + const TInt KLayoutValueOne = 1; + const TInt KLayoutValueTwo = 2; + const TInt KLayoutValueThree = 3; + const TInt KLayoutValueFour = 4; + const TInt KLayoutValueFive = 5; + const TInt KLayoutValueSeven = 7; + +#ifdef _DEBUG + _LIT( KNMRLayoutManagerPanicText, "NMRLayoutManager" ); + enum TNMRLayoutManagerPanic + { + ENMRLayoutManagerUnhandledCase = 1, + }; + void Panic( TNMRLayoutManagerPanic aPanic ) + { + User::Panic( KNMRLayoutManagerPanicText, aPanic ); + } +#endif + +} // Unnamed namespace + + +// --------------------------------------------------------------------------- +// NMRLayoutManager::GetWindowComponentLayout +// --------------------------------------------------------------------------- +// +EXPORT_C TAknWindowComponentLayout NMRLayoutManager::GetWindowComponentLayout( TMRLayout aLayout ) + { + TAknWindowComponentLayout layout; + switch ( aLayout ) + { + case EMRLayoutDialog: + { + layout = AknLayoutScalable_Apps::main_sp_fs_calendar_pane( KLayoutValueZero ); + break; + } + case EMRLayoutDialogBg: + { + layout = AknLayoutScalable_Apps::bg_main_sp_fs_cale_pane( KLayoutValueOne ); + break; + } + case EMRLayoutDialogBgGraphics: + { + layout = AknLayoutScalable_Apps::bgmain_sp_fs_calendar_pane_g1( KLayoutValueZero ); + break; + } + case EMRLayoutCtrlBar: + { + layout = AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_cp01( KLayoutValueOne ); + break; + } + case EMRLayoutCtrlBarGraphics: + { + layout = AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1( KLayoutValueOne ); + break; + } + case EMRLayoutContentArea: + { + layout = AknLayoutScalable_Apps::listscroll_cale_mrui_pane( KLayoutValueOne ); + break; + } + case EMRLayoutListArea: + { + layout = AknLayoutScalable_Apps::list_cale_mrui_pane( KLayoutValueZero ); + break; + } + case EMRLayoutScrollBar: + { + layout = AknLayoutScalable_Apps::sp_fs_scroll_pane_cp07( KLayoutValueOne ); + break; + } + + case EMRLayoutStripe: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g3( KLayoutValueZero ); + break; + } + case EMRLayoutMRNaviArrowLeft: + { + layout = AknLayoutScalable_Apps::main_sp_fs_email_pane_g1( KLayoutValueOne ); + break; + } + case EMRLayoutMRNaviArrowRight: + { + layout = AknLayoutScalable_Apps::main_sp_fs_email_pane_g2( KLayoutValueOne ); + break; + } + case EMRLayoutTextEditorIcon: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueOne ); + break; + } + case EMRLayoutTextEditorBg: + { + layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp01( KLayoutValueOne ); + break; + } + case EMRLayoutTimeEditorIcon: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueTwo ); + break; + } + case EMRLayoutTimeEditorStartBg: + { + layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp01( KLayoutValueTwo ); + break; + } + case EMRLayoutTimeEditorEndBg: + { + layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp02( KLayoutValueTwo ); + break; + } + case EMRLayoutDateEditorIcon: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueThree ); + break; + } + case EMRLayoutDateEditorBg: + { + layout = AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg_cp01( KLayoutValueThree ); + break; + } + case EMRLayoutCheckboxIcon: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueFive ); + break; + } + + case EMRLayoutSingleRowAColumnGraphic: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g1( KLayoutValueSeven ); + break; + } + case EMRLayoutSingleRowDColumnGraphic: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_g2( KLayoutValueZero ); + break; + } + case EMRLayoutAttachmentSelectionGrid: + { + layout = AknLayoutScalable_Avkon::grid_tb_ext_pane( KLayoutValueZero ); + break; + } + case EMRLayoutAttachmentSelectionGridCell: + { + layout = AknLayoutScalable_Avkon::cell_tb_ext_pane( KLayoutValueZero, 0, 0 ); + break; + } + case EMRLayoutAttachmentSelectionGridCellGraphic: + { + layout = AknLayoutScalable_Avkon::cell_tb_ext_pane_g1( KLayoutValueTwo ); + break; + } + default: + { + __ASSERT_DEBUG( EFalse, Panic( ENMRLayoutManagerUnhandledCase ) ); + break; + } + } + return layout; + } + +// --------------------------------------------------------------------------- +// NMRLayoutManager::GetTextComponentLayout +// --------------------------------------------------------------------------- +// +EXPORT_C TAknTextComponentLayout NMRLayoutManager::GetTextComponentLayout( TMRTextLayout aLayout ) + { + TAknTextComponentLayout layout; + switch ( aLayout ) + { + case EMRTextLayoutText: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t1( KLayoutValueZero ); + break; + } + case EMRTextLayoutTextEditor: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueOne ); + break; + } + case EMRTextLayoutTimeEditorStart: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueTwo ); + break; + } + case EMRTextLayoutTimeEditorSeparator: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t3( KLayoutValueTwo ); + break; + } + case EMRTextLayoutTimeEditorEnd: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t4( KLayoutValueTwo ); + break; + } + case EMRTextLayoutDateEditor: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueThree ); + break; + } + case EMRTextLayoutMultiRowTextEditor: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueFour ); + break; + } + case EMRTextLayoutCheckboxEditor: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueFive ); + break; + } + case EMRLayoutCtrlBarTitle: + { + layout = AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1( KLayoutValueOne ); + break; + } + + case EMRTextLayoutSingleRowEditorText: + { + layout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_t2( KLayoutValueSeven ); + break; + } + case EMRTextLayoutAttachmentSelectionGridCellText: + { + layout = AknLayoutScalable_Avkon::cell_tb_ext_pane_t1( KLayoutValueOne ); + break; + } + + default: + { + __ASSERT_DEBUG( EFalse, Panic( ENMRLayoutManagerUnhandledCase ) ); + break; + } + } + return layout; + } + +// --------------------------------------------------------------------------- +// NMRLayoutManager::GetLayoutRect +// --------------------------------------------------------------------------- +// +EXPORT_C TAknLayoutRect NMRLayoutManager::GetLayoutRect( const TRect& aParentRect, TMRLayout aLayout ) + { + TAknLayoutRect layoutRect; + TAknWindowComponentLayout layout = GetWindowComponentLayout( aLayout ); + layoutRect.LayoutRect( aParentRect, layout ); + return layoutRect; + } + +// --------------------------------------------------------------------------- +// NMRLayoutManager::GetFieldLayoutRect +// --------------------------------------------------------------------------- +// +EXPORT_C TAknLayoutRect NMRLayoutManager::GetFieldLayoutRect( const TRect& aParentRect, TInt aRows ) + { + TAknWindowComponentLayout fieldLayout; + + TAknLayoutScalableParameterLimits limits = + AknLayoutScalable_Apps::list_single_cale_mrui_pane_ParamLimits( 0 ); + + // Map aRows to lower variety limit + TInt variety = limits.FirstVariety() + ( aRows - 1 ); + // Make sure min <= variety <= max + variety = Min( limits.LastVariety(), Max( limits.FirstVariety(), variety ) ); + + fieldLayout = AknLayoutScalable_Apps::list_single_cale_mrui_pane( variety ); + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( aParentRect, fieldLayout ); + return layoutRect; + } + +// --------------------------------------------------------------------------- +// NMRLayoutManager::GetFieldRowLayoutRect +// --------------------------------------------------------------------------- +// +EXPORT_C TAknLayoutRect NMRLayoutManager::GetFieldRowLayoutRect( const TRect& aParentRect, TInt aRow ) + { + TAknWindowComponentLayout rowLayout; + + TAknLayoutScalableParameterLimits limits = + AknLayoutScalable_Apps::list_single_cale_mrui_row_pane_ParamLimits( 0 ); + + // Map aRows to lower variety limit + TInt variety = limits.FirstVariety() + ( aRow - 1 ); + // Make sure min <= variety <= max + variety = Min( limits.LastVariety(), Max( limits.FirstVariety(), variety ) ); + + rowLayout = AknLayoutScalable_Apps::list_single_cale_mrui_row_pane( variety ); + TAknLayoutRect layoutRect; + layoutRect.LayoutRect( aParentRect, rowLayout ); + return layoutRect; + } + +// --------------------------------------------------------------------------- +// NMRLayoutManager::GetLayoutText +// --------------------------------------------------------------------------- +// +EXPORT_C TAknLayoutText NMRLayoutManager::GetLayoutText( const TRect& aParentRect, TMRTextLayout aLayout ) + { + TAknLayoutText layoutText; + TAknTextComponentLayout layout = GetTextComponentLayout( aLayout ); + layoutText.LayoutText( aParentRect, layout ); + return layoutText; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrguicommon/src/resmrstatic.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrguicommon/src/resmrstatic.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,223 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Static Tls data storage +* +*/ + + +#include "resmrstatic.h" + +#include "cesmrcontactmenuhandler.h" +#include "cesmrcontactmanagerhandler.h" + +// DEBUG +#include "emailtrace.h" + +/** + * Storage stuct for RESMRStatic. + */ +struct TESMRStaticData + { + TInt iInstanceCount; + TInt iContactManagerHandlerCount; + CESMRContactManagerHandler* iContactManagerHandler; + TInt iContactMenuHandlerCount; + CESMRContactMenuHandler* iContactMenuHandler; + + TInt iPbkxContactListingServiceCount; + TInt iCurrentFieldIndex; + }; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// RESMRStatic::RESMRStatic +// --------------------------------------------------------------------------- +// +EXPORT_C RESMRStatic::RESMRStatic( ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// RESMRStatic::~RESMRStatic +// --------------------------------------------------------------------------- +// +EXPORT_C RESMRStatic::~RESMRStatic( ) + { + FUNC_LOG; + if ( iStaticData ) + { + delete iStaticData->iContactMenuHandler; + iStaticData->iContactMenuHandler = NULL; + + delete iStaticData->iContactManagerHandler; + iStaticData->iContactManagerHandler = NULL; + } + } + +// --------------------------------------------------------------------------- +// RESMRStatic::ConnectL +// --------------------------------------------------------------------------- +// +EXPORT_C void RESMRStatic::ConnectL( ) + { + FUNC_LOG; + if (iStaticData ) + { + // already connected + return; + } + + // Retrieve Tls pointer + iStaticData = (TESMRStaticData*) Dll::Tls(); + + // If Tls pointer was not set, create new static stuct + // with NULL values + if ( !iStaticData ) + { + iStaticData = new (ELeave) TESMRStaticData(); + memset ( iStaticData, 0, sizeof( TESMRStaticData) ); + Dll::SetTls ( iStaticData ); + } + ++iStaticData->iInstanceCount; + } + +// --------------------------------------------------------------------------- +// RESMRStatic::Close +// --------------------------------------------------------------------------- +// +EXPORT_C void RESMRStatic::Close( ) + { + FUNC_LOG; + if (iStaticData ) + { + if (iUsedTypes & EContactMenuHandler ) + { + --iStaticData->iContactMenuHandlerCount; + if (iStaticData->iContactMenuHandlerCount == 0 ) + { + if ( iStaticData->iContactManagerHandlerCount == 0 ) + { + // Delete both Handlers when both are ready to delete + // and Contact Manager Handler should be deleted last + // because the Menu Handler has dependency to it. + delete iStaticData->iContactMenuHandler; + iStaticData->iContactMenuHandler = NULL; + + delete iStaticData->iContactManagerHandler; + iStaticData->iContactManagerHandler = NULL; + } + } + } + + // If ContactManagerHandlerL was used + if (iUsedTypes & EContactManagerHandler ) + { + // Decrease counter + --iStaticData->iContactManagerHandlerCount; + + // If this was last instance using pointer + if ( iStaticData->iContactManagerHandlerCount == 0 ) + { + if ( iStaticData->iContactMenuHandlerCount == 0 ) + { + delete iStaticData->iContactMenuHandler; + iStaticData->iContactMenuHandler = NULL; + // Delete instance + delete iStaticData->iContactManagerHandler; + iStaticData->iContactManagerHandler = NULL; + } + } + } + + // Decrease instance counter + --iStaticData->iInstanceCount; + + // If this was last instance using pointer + if (iStaticData->iInstanceCount == 0 ) + { + delete iStaticData; + Dll::FreeTls ( ); + } + iStaticData = NULL; + } + } + +// --------------------------------------------------------------------------- +// RESMRStatic::ContactManagerHandlerL +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRContactManagerHandler& RESMRStatic::ContactManagerHandlerL( ) + { + FUNC_LOG; + if ( !iStaticData->iContactManagerHandler ) + { + iStaticData->iContactManagerHandler = + CESMRContactManagerHandler::NewL(); + } + + if (!(iUsedTypes & EContactManagerHandler) ) + { + ++iStaticData->iContactManagerHandlerCount; + iUsedTypes |= EContactManagerHandler; + } + return *iStaticData->iContactManagerHandler; + } + +// --------------------------------------------------------------------------- +// RESMRStatic::ContactMenuHandlerL +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRContactMenuHandler& RESMRStatic::ContactMenuHandlerL( ) + { + FUNC_LOG; + if ( !iStaticData->iContactMenuHandler ) + { + iStaticData->iContactMenuHandler = + CESMRContactMenuHandler::NewL( ContactManagerHandlerL() ); + } + + if (!(iUsedTypes & EContactMenuHandler) ) + { + ++iStaticData->iContactMenuHandlerCount; + iUsedTypes |= EContactMenuHandler; + } + + return *iStaticData->iContactMenuHandler; + } + +// --------------------------------------------------------------------------- +// RESMRStatic::CurrentFieldIndex +// --------------------------------------------------------------------------- +// +EXPORT_C TInt RESMRStatic::CurrentFieldIndex() + { + FUNC_LOG; + return iStaticData->iCurrentFieldIndex; + } + +// --------------------------------------------------------------------------- +// RESMRStatic::SetCurrentFieldIndex +// --------------------------------------------------------------------------- +// +EXPORT_C void RESMRStatic::SetCurrentFieldIndex(TInt aFieldIndex) + { + FUNC_LOG; + iStaticData->iCurrentFieldIndex = aFieldIndex; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/data/2001846B.rss --- a/meetingrequest/mricalviewer/data/2001846B.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/data/2001846B.rss Wed Mar 31 21:08:33 2010 +0300 @@ -18,8 +18,7 @@ // INCLUDES #include -#include -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber +#include #include "esmrinternaluid.h" // RESOURCE DEFINITIONS @@ -42,7 +41,7 @@ IMPLEMENTATION_INFO { implementation_uid = KESMRIcalViewerImplementationUid; - version_no = KEmailEcomVersionNumber; + version_no = 1; display_name = "MRUI 2.0 ESMRIcalViewer"; default_data = ""; opaque_data = ""; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/group/esmricalviewer.mmp --- a/meetingrequest/mricalviewer/group/esmricalviewer.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/group/esmricalviewer.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -29,11 +28,8 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../data -START RESOURCE 2001846B.rss // +START RESOURCE 2001846B.rss TARGET esmricalviewer.rsc END @@ -58,15 +54,15 @@ SOURCE cesmricalvieweremailasynccmd.cpp SOURCE cesmricalvieweremailsynccmd.cpp SOURCE esmricalviewerutils.cpp +SOURCE cmrattachmentinfofetcher.cpp USERINCLUDE . USERINCLUDE ../inc USERINCLUDE ../../inc +USERINCLUDE ../../../inc APP_LAYER_SYSTEMINCLUDE -USERINCLUDE ../../../inc - LIBRARY euser.lib LIBRARY fsmailframework.lib LIBRARY fsfwcommonlib.lib @@ -81,11 +77,10 @@ LIBRARY charconv.lib LIBRARY estor.lib LIBRARY efsrv.lib -LIBRARY esmrcommon.lib -LIBRARY cmaillogger.lib +LIBRARY esmrcommon.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cesmricalvieweropenmrcmd.h --- a/meetingrequest/mricalviewer/inc/cesmricalvieweropenmrcmd.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmricalvieweropenmrcmd.h Wed Mar 31 21:08:33 2010 +0300 @@ -32,6 +32,7 @@ class CFSMailClient; class CESMRIcalViewerLoadMRDataCmd; class MESMRIcalViewerCommand; +class CMRAttachmentInfoFetcher; /** * Command for opening meeting request @@ -83,6 +84,7 @@ MESMRIcalViewerObserver::TIcalViewerOperationResult aResult ); void HandleError( TInt aError ); void LaunchUIL(); + void FillAttachmentInfoL(); private: // Data /// Ref: Reference to ESMRICalViewer callback @@ -93,6 +95,8 @@ CFSMailClient& iMailClient; /// Own: Load MR Data command CESMRIcalViewerLoadMRDataCmd* iLoadMRDataCmd; + /// Own: Attachment information fetcher + CMRAttachmentInfoFetcher* iAttachmentInfoFetcher; /// Own: UI launcher CESMRUiLauncher* iUILauncher; /// Own: Operation result diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cesmricalviewerremovemrfromcalcmd.h --- a/meetingrequest/mricalviewer/inc/cesmricalviewerremovemrfromcalcmd.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmricalviewerremovemrfromcalcmd.h Wed Mar 31 21:08:33 2010 +0300 @@ -25,7 +25,7 @@ #include "mesmricalviewerobserver.h" #include "esmricalviewerdefs.hrh" // -#include +#include class CFSMailClient; class CESMRUiLauncher; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cesmricalviewerresponsetomrcmd.h --- a/meetingrequest/mricalviewer/inc/cesmricalviewerresponsetomrcmd.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmricalviewerresponsetomrcmd.h Wed Mar 31 21:08:33 2010 +0300 @@ -26,7 +26,7 @@ #include "mesmricalviewercallback.h" #include "esmricalviewerdefs.hrh" //
-#include +#include class CFSMailClient; class CESMRUiLauncher; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h --- a/meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -87,8 +87,6 @@ void CreateEntryL( CFSMailMessagePart& aMessagePart, CFSMailMessage& aMsg); - void CheckAttachmentDataL( - CFSMailMessage& message ); void HandleMailContentL(); private: // Data @@ -108,8 +106,6 @@ HBufC* iIcsFilename; /// Own: Calendar part message id TFSMailMsgId iCalendarPartId; - /// Own - CESMRAttachmentInfo* iAttachmentInfo; }; #endif // CESMRIMAPICALRETRIEVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h --- a/meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cesmrmrinfoicalretriever.h --- a/meetingrequest/mricalviewer/inc/cesmrmrinfoicalretriever.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmrmrinfoicalretriever.h Wed Mar 31 21:08:33 2010 +0300 @@ -69,8 +69,7 @@ void CreateEntryL(); void FillCommonFieldsL(); void FillRecurrenceL(); - void FillAttachmentInfoL(); - + private: // Data // Own: Supported fields array RArray iSupportedFields; @@ -82,8 +81,6 @@ TESMRInputParams& iInputParameters; /// Own: Result structure MESMRIcalViewerObserver::TIcalViewerOperationResult iResult; - // Own - CESMRAttachmentInfo* iAttachmentInfo; }; #endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/cmrattachmentinfofetcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mricalviewer/inc/cmrattachmentinfofetcher.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR attachment informatio fetcher definition +* +*/ + +#ifndef CMRATTACHMENTINFOFETCHER_H +#define CMRATTACHMENTINFOFETCHER_H + +#include +#include "mfsmailrequestobserver.h" +#include "mesmricalviewerobserver.h" +#include "cesmricalviewerasynccommand.h" + +class CFSMailMessage; +class CFSMailClient; +class CCalEntry; + +/** + * CMRAttachmentInfoFetcher is responsible for fetching attachment + * information and storing URI attachment information to + * calendar entry. + */ +NONSHARABLE_CLASS( CMRAttachmentInfoFetcher ) : + public CESMRIcalViewerAsyncCommand, + public MFSMailRequestObserver + { +public: +public: // Construction and destruction + /** + * Creates and initializes new CMRAttachmentInfoFetcher object. + * Ownership is transferred to caller. + * + * @param aMailClient Reference to mail client + * @param aCalSession Reference to calendar session + * @return Pointer to CESMRImapMailFetcher object. + */ + static CMRAttachmentInfoFetcher* NewL( + CFSMailClient& aMailClient, + CCalSession& aCalSession, + CCalEntry& aCalEntry ); + + /** + * C++ destructor. + */ + ~CMRAttachmentInfoFetcher(); + +private: // From MFSMailRequestObserver + void RequestResponseL( + TFSProgress aEvent, + TInt aRequestId ); + +private: // From MESMRIcalViewerAsyncCommand + void ExecuteAsyncCommandL(); + void CancelAsyncCommand(); + +private: // Implementation + CMRAttachmentInfoFetcher( + CFSMailClient& aMailClient, + CCalSession& aCalSession, + CCalEntry& aCalEntry ); + void ConstructL(); + void FetchMessageStructureL(); + TBool ConstructAttachmentInformationL(); + void HandleRequestResponseL( + TFSProgress aEvent, + TInt aRequestId ); + void NotifyCompletion(); + +private: + /** Enumeration for object internal state */ + enum TMRAttachmentFetcherState + { + // Idle + EIdle, + // Fetching message structure + EFetchingStructure, + // Fetching message contents + EFetchingContents + }; + +private: // Data + /// Own: Fetch operation request id + TInt iStructureRequestId; + /// Own: Fetch operation request id + TInt iMessagePartRequestId; + // Own: Current state + TMRAttachmentFetcherState iState; + /// Ref: Reference to mail client object + CFSMailClient& iMailClient; + /// Ref: Reference to messageobject + CFSMailMessage* iMailMessage; + /// Own: Operation result + MESMRIcalViewerObserver::TIcalViewerOperationResult iResult; + /// Ref: Reference to calendar entry + CCalEntry& iCalEntry; + }; + +#endif // CMRATTACHMENTINFOFETCHER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/inc/esmricalvieweropcodes.hrh --- a/meetingrequest/mricalviewer/inc/esmricalvieweropcodes.hrh Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/esmricalvieweropcodes.hrh Wed Mar 31 21:08:33 2010 +0300 @@ -44,13 +44,14 @@ // ESMRIcalViewer command ids // Loads meeting request data - EESMRLoadMRData = 100, - EESMRLoadMRInfoData = 101, - EESMRLoadImapData = 102, - EESMRFetchMailContent = 103, - EESMRLoadMRIcalData = 104, - EESMREmailCommand = 105, - EESMRLaunchUI = 106, + EESMRLoadMRData = 100, + EESMRLoadMRInfoData = 101, + EESMRLoadImapData = 102, + EESMRFetchMailContent = 103, + EESMRLoadMRIcalData = 104, + EESMREmailCommand = 105, + EESMRLaunchUI = 106, + EESMRFetchAttachmentInfo = 107, /** * FS Email specific commands @@ -68,8 +69,6 @@ // Save attachments EESMRCmdSaveAttachment, EESMRCmdSaveAllAttachments, - // Email 'More' submenu - EESMRCmdMailEmailMoreMenu, // MR messsage is marked unread, sync EESMRCmdMailMarkUnread, // MR message is marked read, sync diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -21,8 +21,8 @@ #include "cesmricalviewercanviewmr.h" // #include "esmricalvieweropcodes.hrh" -#include "cfsmailcommon.h" -#include "cfsmailmessage.h" +#include "CFSMailCommon.h" +#include "CFSMailMessage.h" // // ======== MEMBER FUNCTIONS ======== diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -29,7 +29,7 @@ #include // -#include "cfsmailclient.h" +#include "CFSMailClient.h" #include "esmricalvieweropcodes.hrh" #include "esmricalviewerdefs.hrh" // @@ -38,8 +38,6 @@ /// Unnamed namespace for local definitions namespace { -#ifdef _DEBUG - // Panic literal _LIT( KESMRIcalViewerCmdHandler, "ESMRIcalViewerCmdHandler" ); @@ -54,8 +52,6 @@ User::Panic( KESMRIcalViewerCmdHandler, aPanic ); } -#endif // _DEBUG - } // namespace // ======== MEMBER FUNCTIONS ======== @@ -315,7 +311,7 @@ break; } - __ASSERT_DEBUG( iCommand, Panic( EInvalidCommand) ); + __ASSERT_ALWAYS( iCommand, Panic( EInvalidCommand) ); iCommand->ExecuteCommandL( *iMessage, *this ); } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -23,7 +23,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "cfsmailclient.h" +#include "CFSMailClient.h" // #include diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -22,7 +22,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "cfsmailclient.h" +#include "CFSMailClient.h" // #include "cesmrmrinfoicalretriever.h" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalvieweropenmrcmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalvieweropenmrcmd.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalvieweropenmrcmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -23,7 +23,7 @@ #include "cesmricalvieweremailasynccmd.h" #include "cesmricalvieweremailsynccmd.h" #include "cesmruilauncher.h" -#include "cesmrattachmentinfo.h" +#include "cmrattachmentinfofetcher.h" #include "esmricalviewerutils.h" // @@ -60,14 +60,13 @@ CancelCommand(); delete iLoadMRDataCmd; delete iUILauncher; - - // + delete iAttachmentInfoFetcher; + if( iEmailCommand ) { delete iEmailCommand; iEmailCommand = NULL; } - // } // ----------------------------------------------------------------------------- @@ -216,13 +215,11 @@ TBool asyncCommand( ESMRIcalViewerUtils::IsAsyncEmailCommand( iCurrentCbCommand ) ); -// if( iEmailCommand ) { delete iEmailCommand; iEmailCommand = NULL; } -// if ( asyncCommand ) { @@ -287,6 +284,11 @@ else if ( aResult.iOpType == EESMRLoadMRData ) { // MR data is loaded + FillAttachmentInfoL(); + } + else if( aResult.iOpType == EESMRFetchAttachmentInfo ) + { + // Attachment information is loaded iInputParameters.iMailClient = &iMailClient; iInputParameters.iMailMessage = Message(); iInputParameters.iCommand = EESMRCmdUndefined; @@ -301,12 +303,10 @@ { case EESMRCmdOpenAttachment://fallthrough case EESMRCmdOpenAttachmentView://fallthrough -// case EESMRCmdDownloadAttachment://fallthrough case EESMRCmdDownloadAllAttachments://fallthrough case EESMRCmdSaveAttachment://fallthrough case EESMRCmdSaveAllAttachments://fallthrough -// { if ( ESMRIcalViewerUtils::ContainsAttachments(iInputParameters) && iMRViewerCommand != iCurrentCbCommand ) @@ -316,7 +316,7 @@ iMRViewerCommand); } iCurrentCbCommand = EESMREmailCommand; - //LaunchUIL(); + LaunchUIL(); } break; @@ -359,7 +359,8 @@ } if ( !iUILauncher && - EESMREmailCommand == iCurrentCbCommand ) + EESMREmailCommand == iCurrentCbCommand && + aResult.iOpType != EESMRLoadMRData) { iResult.iAttendeeStatus = ESMRIcalViewerUtils::UserResponsedToMRL( @@ -400,5 +401,26 @@ iUILauncher->ExecuteCommandL( *Message(), *this ); } +// --------------------------------------------------------------------------- +// CESMRIcalViewerOpenMRCmd::FillAttachmentInfoL +// --------------------------------------------------------------------------- +// +void CESMRIcalViewerOpenMRCmd::FillAttachmentInfoL() + { + FUNC_LOG; + + if ( !iAttachmentInfoFetcher ) + { + iAttachmentInfoFetcher = + CMRAttachmentInfoFetcher::NewL( + iMailClient, + CalSession(), + *(iInputParameters.iCalEntry) ); + } + + iAttachmentInfoFetcher->ExecuteCommandL( *Message(), *this ); + } + // EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -24,7 +24,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "cfsmailclient.h" +#include "CFSMailClient.h" // #include diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -23,7 +23,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "cfsmailclient.h" +#include "CFSMailClient.h" // #include diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -23,12 +23,11 @@ #include "cesmricalvieweremailasynccmd.h" #include "cesmricalvieweremailsynccmd.h" #include "esmricalviewerutils.h" -#include "cesmrattachmentinfo.h" // #include "esmricalvieweropcodes.hrh" #include -#include "cfsmailclient.h" +#include "CFSMailClient.h" // #include diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp --- a/meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,7 +19,6 @@ #include "emailtrace.h" #include "cesmrimapicalretriever.h" #include "cesmrimapmailfetcher.h" -#include "cesmrattachmentinfo.h" #include "tesmrinputparams.h" #include "esmricalviewerutils.h" #include "esmrconfig.hrh" @@ -40,7 +39,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +51,7 @@ // Literal for received ics filename // hard coded path removal, store goes to process's own private directory -//_LIT( KTempReceivedIcsFile, +//_LIT( KTempReceivedIcsFile, // "c:\\temp\\tempreceived.ics" ); //codescanner::driveletters _LIT( KTempReceivedIcsFileName, "temp\\tempreceived.ics" ); // @@ -70,20 +69,6 @@ * * @param aArray Pointer to RPointerArray. */ -void MessagePartPointerArrayCleanup( TAny* aArray ) - { - RPointerArray* messagePartArray = - static_cast*>( aArray ); - - messagePartArray->ResetAndDestroy(); - messagePartArray->Close(); - } - -/** - * Cleanup operations for RPointerArray. - * - * @param aArray Pointer to RPointerArray. - */ void CalEntryPointerArrayCleanup( TAny* aArray ) { RPointerArray* entryArray = @@ -126,7 +111,6 @@ delete iMailFetcher; delete iConvertedEntry; delete iIcsFilename; - delete iAttachmentInfo; } // --------------------------------------------------------------------------- @@ -275,13 +259,11 @@ User::Leave( KErrNotFound ); } CleanupStack::PushL( calendarPart ); - + CreateEntryL( *calendarPart, *msg ); iInputParameters.iCalEntry = iConvertedEntry; iCalendarPartId = calendarPart->GetPartId(); - CheckAttachmentDataL( *message ); - CleanupStack::PopAndDestroy( calendarPart ); CleanupStack::PopAndDestroy( message ); } @@ -367,76 +349,5 @@ } } -// --------------------------------------------------------------------------- -// CESMRImapIcalRetriever::CheckAttachmentDataL -// --------------------------------------------------------------------------- -// -void CESMRImapIcalRetrieverCmd::CheckAttachmentDataL( - CFSMailMessage& aMessage ) - { - FUNC_LOG; - if ( aMessage.IsFlagSet( EFSMsgFlag_Attachments ) ) - { - RPointerArray attachmentParts; - CleanupStack::PushL( - TCleanupItem( - MessagePartPointerArrayCleanup, - &attachmentParts ) ); - - aMessage.AttachmentListL( attachmentParts ); - - TInt attachmentCount( attachmentParts.Count() ); - if ( attachmentCount > 0 ) - { - delete iAttachmentInfo; - iAttachmentInfo = NULL; - - iInputParameters.iAttachmentInfo = NULL; - - CESMRAttachmentInfo* attachmentInfo = CESMRAttachmentInfo::NewL(); - CleanupStack::PushL( attachmentInfo ); - - for( TInt i(0); i < attachmentCount; ++i ) - { - CESMRAttachment::TESMRAttachmentState state( - CESMRAttachment::EAttachmentStateDownloaded ); - - if ( EFSFull != attachmentParts[i]->FetchLoadState() ) - { - state = CESMRAttachment::EAttachmentStateNotDownloaded; - } - - TInt contentSize( attachmentParts[i]->ContentSize() ); - TPtrC attachmentName( attachmentParts[i]->AttachmentNameL() ); - - if ( contentSize >= 0 && attachmentName.Length() && - iCalendarPartId != attachmentParts[i]->GetPartId() ) - { - attachmentInfo->AddAttachmentInfoL( - attachmentName, - contentSize, - state ); - } - } - - if ( attachmentInfo->AttachmentCount() ) - { - iAttachmentInfo = attachmentInfo; - CleanupStack::Pop( attachmentInfo ); - // ownership does not change - iInputParameters.iAttachmentInfo = iAttachmentInfo; - } - else - { - CleanupStack::PopAndDestroy( attachmentInfo ); - } - - attachmentInfo = NULL; - - } - CleanupStack::PopAndDestroy(); // attachmentparts - } - } - // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp --- a/meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -20,10 +20,10 @@ #include "cesmrimapmailfetcher.h" #include "esmricalviewerutils.h" // -#include "cfsmailclient.h" -#include "cfsmailfolder.h" -#include "cfsmailmessagepart.h" -#include "cfsmailcommon.h" +#include "CFSMailClient.h" +#include "CFSMailFolder.h" +#include "CFSMailMessagePart.h" +#include "CFSMailCommon.h" #include "esmricalvieweropcodes.hrh" // diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp --- a/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,7 +19,6 @@ #include "emailtrace.h" #include "cesmrmrinfoicalretriever.h" #include "cesmrinforecurrencehandler.h" -#include "cesmrattachmentinfo.h" #include "mesmricalviewerobserver.h" #include "tesmrinputparams.h" #include "esmricalviewerutils.h" @@ -40,7 +39,7 @@ #include #include #include -#include +#include #include // Unnamed namespace for local definitions and functions @@ -327,7 +326,6 @@ FUNC_LOG; iSupportedFields.Reset(); iSupportedFields.Close(); - delete iAttachmentInfo; delete iConvertedEntry; } @@ -392,8 +390,6 @@ FillRecurrenceL(); } - FillAttachmentInfoL(); - // Fill input parameters // Ownership is not trasferred iInputParameters.iCalEntry = iConvertedEntry; @@ -586,7 +582,7 @@ if ( KErrNone == err && minutesBetween.Int() > 0 ) { alarm->SetTimeOffset( minutesBetween ); - // this method copies alarm details and does not take ownership + // this method copies alarm details and does not take ownership iConvertedEntry->SetAlarmL( alarm ); } // that's why we can destroy it here @@ -633,74 +629,5 @@ } } -// --------------------------------------------------------------------------- -// CESMRInfoIcalRetrieverCmd::FillAttachmentInfoL -// --------------------------------------------------------------------------- -// -void CESMRInfoIcalRetrieverCmd::FillAttachmentInfoL() - { - FUNC_LOG; - CFSMailMessage* msg = Message(); - - if ( msg->IsFlagSet( EFSMsgFlag_Attachments ) ) - { - RPointerArray attachmentParts; - CleanupStack::PushL( - TCleanupItem( - ESMRIcalViewerUtils::MessagePartPointerArrayCleanup, - &attachmentParts ) ); - - msg->AttachmentListL( attachmentParts ); - - TInt attachmentCount( attachmentParts.Count() ); - if ( attachmentCount > 0 ) - { - delete iAttachmentInfo; - iAttachmentInfo = NULL; - - iInputParameters.iAttachmentInfo = NULL; - - CESMRAttachmentInfo* attachmentInfo = CESMRAttachmentInfo::NewL(); - CleanupStack::PushL( attachmentInfo ); - - for( TInt i(0); i < attachmentCount; ++i ) - { - CESMRAttachment::TESMRAttachmentState state( - CESMRAttachment::EAttachmentStateDownloaded ); - - if ( EFSFull != attachmentParts[i]->FetchLoadState() ) - { - state = CESMRAttachment::EAttachmentStateNotDownloaded; - } - - TInt contentSize( attachmentParts[i]->ContentSize() ); - TPtrC attachmentName( attachmentParts[i]->AttachmentNameL() ); - if ( contentSize >= 0 && attachmentName.Length() ) - { - attachmentInfo->AddAttachmentInfoL( - attachmentName, - contentSize, - state ); - } - } - - if ( attachmentInfo->AttachmentCount() ) - { - iAttachmentInfo = attachmentInfo; - CleanupStack::Pop( attachmentInfo ); - // ownership does not change - iInputParameters.iAttachmentInfo = iAttachmentInfo; - } - else - { - CleanupStack::PopAndDestroy( attachmentInfo ); - } - - attachmentInfo = NULL; - } - CleanupStack::PopAndDestroy(); // attachmentparts - } - } - // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cesmruilauncher.cpp --- a/meetingrequest/mricalviewer/src/cesmruilauncher.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmruilauncher.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -27,7 +27,7 @@ #include // #include "FreestyleEmailUiConstants.h" -#include "cfsmailmessage.h" +#include "CFSMailMessage.h" #include "fsmtmsuids.h" #include #include @@ -50,7 +50,6 @@ CCalEntry::TMethod method( aEntry.MethodL() ); if ( CCalEntry::EMethodRequest == method || - CCalEntry::EMethodReply == method || CCalEntry::EMethodCancel == method ) { retValue = ETrue; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/cmrattachmentinfofetcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mricalviewer/src/cmrattachmentinfofetcher.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for MR attachment fetcher +* +*/ + +#include "emailtrace.h" +#include "cmrattachmentinfofetcher.h" +#include "esmricalviewerutils.h" + +#include "cfsmailclient.h" +#include "cfsmailfolder.h" +#include "cfsmailmessagepart.h" +#include "cfsmailcommon.h" +#include "esmricalvieweropcodes.hrh" + +#include +#include +#include + +// Unnamed namespace for local definitions +namespace { // codescanner::namespace + +// Maximum URI length +const TInt KMaxUriLength( 256 ); + +// CMail attachment URI +_LIT8( KCMailUri, "cmail://"); + +// Literal for URI UID format +_LIT8( KUriUIDFormat, "%d.%d/"); + +/** + * Appends attachment information to URI. + * @param aUri Reference to URI + * @param aId Id to be added + */ +void AppendMailIdToUri( + TDes8& aUri, + TFSMailMsgId aId ) + { + aUri.AppendFormat( KUriUIDFormat, + aId.PluginId().iUid, + aId.Id() ); + } +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::CMRAttachmentInfoFetcher +// --------------------------------------------------------------------------- +// +CMRAttachmentInfoFetcher::CMRAttachmentInfoFetcher( + CFSMailClient& aMailClient, + CCalSession& aCalSession, + CCalEntry& aCalEntry ) +: CESMRIcalViewerAsyncCommand( + EESMRFetchAttachmentInfo, + aCalSession ), + iMailClient( aMailClient ), + iCalEntry( aCalEntry ) + { + FUNC_LOG; + iResult.iOpType = OperationType(); + iResult.iResultCode = KErrNone; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::~CMRAttachmentInfoFetcher +// --------------------------------------------------------------------------- +// +CMRAttachmentInfoFetcher::~CMRAttachmentInfoFetcher() + { + FUNC_LOG; + CancelCommand(); + } + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::NewL +// --------------------------------------------------------------------------- +// +CMRAttachmentInfoFetcher* CMRAttachmentInfoFetcher::NewL( + CFSMailClient& aMailClient, + CCalSession& aCalSession, + CCalEntry& aCalEntry ) + { + FUNC_LOG; + + CMRAttachmentInfoFetcher* self = + new (ELeave) CMRAttachmentInfoFetcher( + aMailClient, aCalSession, aCalEntry ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::ConstructL +// --------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::ConstructL() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::FetchMailL +// --------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::ExecuteAsyncCommandL() + { + FUNC_LOG; + + iResult.iMessage = Message(); + iResult.iOpType = OperationType(); + iResult.iResultCode = KErrNone; + + iMailMessage = Message(); + iResult.iMessage = iMailMessage; + TBool operationStarted( ETrue ); + + TFSPartFetchState messageLoadState( iMailMessage->FetchLoadState() ); + if( !iMailMessage->IsFlagSet( EFSMsgFlag_Attachments ) ) + { + operationStarted = EFalse; + } + else if ( EFSEmailStructureUnknown == messageLoadState ) + { + // Message structure needs to be fetched first + // After structure is fetched, then message parts can be fetched + // When structure fetching is completed, part fetching is triggered + // automatically + FetchMessageStructureL(); + } + else + { + // Message structure is already known --> Part can be fetched + // Wait operation is started if part needs to fetched. + operationStarted = ConstructAttachmentInformationL(); + } + + if ( !operationStarted ) + { + NotifyCompletion(); + } + + } + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::CancelAsyncCommand +// --------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::CancelAsyncCommand() + { + FUNC_LOG; + + if ( EIdle != iState ) + { + TRAP_IGNORE( iMailClient.CancelAllL() ); + + iResult.iResultCode = KErrCancel; + Observer()->OperationError( iResult ); + } + + } + +// --------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::RequestResponseL +// --------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::RequestResponseL( + TFSProgress aEvent, + TInt aRequestId ) + { + FUNC_LOG; + TRAPD( err, HandleRequestResponseL(aEvent, aRequestId) ); + + if ( KErrNone != err ) + { + // Error occured --> Cancel operations + iResult.iResultCode = err; + NotifyCompletion(); + } + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::FetchMessageStructureL +// ----------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::FetchMessageStructureL() + { + FUNC_LOG; + + TFSMailMsgId currentMailboxId = + iMailMessage->GetMailBoxId(); + + TFSMailMsgId currentMessageFolderId = + iMailMessage->GetFolderId(); + + CFSMailFolder* currentFolder = + iMailClient.GetFolderByUidL( + currentMailboxId, + currentMessageFolderId ); + + CleanupStack::PushL( currentFolder ); + + iState = EFetchingStructure; + RArray messageIds; + CleanupClosePushL( messageIds ); + messageIds.Append( iMailMessage->GetMessageId() ); + iStructureRequestId = + currentFolder->FetchMessagesL( + messageIds, + EFSMsgDataStructure, + *this ); + + CleanupStack::PopAndDestroy();//messageIds + CleanupStack::PopAndDestroy( currentFolder ); + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::ConstructAttachmentInformationL +// ----------------------------------------------------------------------------- +// +TBool CMRAttachmentInfoFetcher::ConstructAttachmentInformationL() + { + FUNC_LOG; + + TBool operationStarted( EFalse ); + + TFSMailMsgId calpartId; + calpartId.SetNullId(); + + CFSMailMessage* msg = Message(); + + // Fetch own pointer email message, because message structure is + // not necessarily up to date + CFSMailMessage* message = + iMailClient.GetMessageByUidL( + msg->GetMailBoxId(), + msg->GetFolderId(), + msg->GetMessageId(), + EFSMsgDataStructure ); + CleanupStack::PushL( message ); + + CFSMailMessagePart* calendarPart = + ESMRIcalViewerUtils::LocateCalendarPartL( *message ); + + if ( !calendarPart && !message->IsMRInfoSet() ) + { + // message does not contain calendar part at all + iResult.iResultCode = KErrNotFound; + User::Leave( KErrNotFound ); + } + + CleanupStack::PushL( calendarPart ); + + if ( calendarPart ) + { + calpartId = calendarPart->GetPartId(); + } + + RCPointerArray attachments; + CleanupClosePushL( attachments ); + + message->AttachmentListL( attachments ); + + TInt attachmentCount( attachments.Count() ); + for( TInt i(0); i < attachmentCount; i++ ) + { + TInt contentSize( attachments[i]->ContentSize() ); + TPtrC attachmentName( attachments[i]->AttachmentNameL() ); + + if ( contentSize >= 0 && attachmentName.Length() && + calpartId != attachments[i]->GetPartId() ) + { + HBufC8* uriBuf = HBufC8::NewLC( KMaxUriLength ); + TPtr8 uri( uriBuf->Des() ); + + uri.Append( KCMailUri ); + + // Setting attachment URI + AppendMailIdToUri( uri, message->GetMailBoxId() ); + AppendMailIdToUri( uri, message->GetFolderId() ); + AppendMailIdToUri( uri, message->GetMessageId() ); + AppendMailIdToUri( uri, attachments[i]->GetPartId() ); + + CCalAttachment* attachment = CCalAttachment::NewUriL( uri ); + CleanupStack::PushL( attachment ); + + // Setting attachment label + attachment->SetLabelL( + attachments[i]->AttachmentNameL() ); + + iCalEntry.AddAttachmentL( *attachment ); + CleanupStack::Pop( attachment ); + CleanupStack::PopAndDestroy( uriBuf ); + } + } + + CleanupStack::PopAndDestroy( &attachments ); + CleanupStack::PopAndDestroy( calendarPart ); + CleanupStack::PopAndDestroy( message ); + + return operationStarted; + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::FetchMessageContentsL +// ----------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::HandleRequestResponseL( + TFSProgress aEvent, + TInt /*aRequestId*/ ) + { + FUNC_LOG; + + TBool operationStarted( EFalse ); + + if ( /*aRequestId == iStructureRequestId && */ + EFetchingStructure == iState ) + { + // Fetching message structure + switch ( aEvent.iProgressStatus ) + { + case TFSProgress::EFSStatus_RequestComplete: + { + // Starting part fetching + operationStarted = ConstructAttachmentInformationL(); + iResult.iResultCode = aEvent.iError; + } + break; + case TFSProgress::EFSStatus_RequestCancelled: + { + // Error occured during fetch operation + iResult.iResultCode = KErrCancel; + } + break; + default: + break; + } + } + + if ( !operationStarted ) + { + NotifyCompletion(); + } + + } + +// ----------------------------------------------------------------------------- +// CMRAttachmentInfoFetcher::NotifyCompletion +// ----------------------------------------------------------------------------- +// +void CMRAttachmentInfoFetcher::NotifyCompletion() + { + FUNC_LOG; + if ( KErrNone == iResult.iResultCode ) + { + Observer()->OperationCompleted( iResult ); + } + else + { + Observer()->OperationError( iResult ); + } + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mricalviewer/src/esmricalviewerutils.cpp --- a/meetingrequest/mricalviewer/src/esmricalviewerutils.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mricalviewer/src/esmricalviewerutils.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,13 +18,10 @@ #include "emailtrace.h" #include "esmricalviewerutils.h" -#include "cesmrattachmentinfo.h" -// #include "cfsmailmessagepart.h" #include "cfsmailclient.h" #include "cfsmailmessage.h" #include "cfsmailbox.h" -// #include #include @@ -72,16 +69,17 @@ // --------------------------------------------------------------------------- // TBool ESMRIcalViewerUtils::ContainsAttachments( - TESMRInputParams& aParams ) + TESMRInputParams& /*aParams*/ ) { FUNC_LOG; TBool retValue( EFalse ); - if ( aParams.iAttachmentInfo && + // TODO: This needs to be updated + /*if ( aParams.iAttachmentInfo && aParams.iAttachmentInfo->AttachmentCount() ) { retValue = ETrue; - } + } */ return retValue; } @@ -194,10 +192,10 @@ CFSMailMessagePart* ESMRIcalViewerUtils::LocateCalendarPartL( CFSMailMessage& aMessage ) { FUNC_LOG; - + CFSMailMessagePart* calendarPart( NULL ); CFSMailMessagePart* multipart( NULL ); - + // 1st, try to find 'TEXT/CALENDAR' part from 'MULTIPART/ALTERNATIVE' part of message multipart = ESMRIcalViewerUtils::LocateChildPartLC( aMessage, @@ -226,7 +224,7 @@ { CleanupStack::PopAndDestroy( multipart ); } - + if ( !calendarPart ) { // If there's no 'MULTIPART/ALTERNATIVE' or it doesn't have diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/conf/mrmbutilsextension.confml Binary file meetingrequest/mrmbutilsextension/conf/mrmbutilsextension.confml has changed diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/conf/mrmbutilsextension_2002137C.crml Binary file meetingrequest/mrmbutilsextension/conf/mrmbutilsextension_2002137C.crml has changed diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/data/2002137D.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/data/2002137D.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include "esmrinternaluid.h" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// theInfo +// ECOM registry information for ESMRVIEWER ECOM implementation +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KESMRMButilsExtensionDllUid; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMRMailboxUtilsExtensionIFUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KESMRMButilsExtensionImplementationUid; + version_no = 1; + display_name = ""; + default_data = "CMAIL"; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project esmrservices +* +*/ + +#include +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../conf/mrmbutilsextension.confml APP_LAYER_CONFML(mrmbutilsextension.confml) +../conf/mrmbutilsextension_2002137C.crml APP_LAYER_CRML(mrmbutilsextension_2002137C.crml) + +PRJ_MMPFILES +mrmbutilsextension.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/group/mrmbutilsextension.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/group/mrmbutilsextension.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for mrmbutilsextension project +* +*/ + +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrmbutilsextension.dll +TARGETTYPE PLUGIN + +UID KEComRecognitionUID2 KESMRMButilsExtensionDllUid +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE esmrmbutilsextension.cpp +SOURCE cmrmbutilsextensionimpl.cpp +SOURCE cmrmbutilsmailboxlistener.cpp +SOURCE cmrmbutilssettings.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../emailuis/emailui/inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE 2002137D.rss +TARGET mrmbutilsextension.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY fsfwcommonlib.lib +LIBRARY fsmailframework.lib +LIBRARY mrmailbox.lib +LIBRARY centralrepository.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// End of file + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/inc/cmrmbutilsextensionimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/inc/cmrmbutilsextensionimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRMBUTILSEXTENSION_H +#define C_MRMBUTILSEXTENSION_H + +class CFSMailClient; +class MMRMBUtilsSettings; +class CMRMBUtilsSettings; +class CMRMBUtilsMailboxListener; + +#include + +/** + * CMRMbUtilsExtensionImpl implements CMRMBUtilsMBInfoHandler / + * MMRMBUtilsMBInfoHandler ECOM interface. + */ +class CMRMbUtilsExtensionImpl : + public CMRMBUtilsMBInfoHandler + { +public: + /** + * Creates and initializes new CMRMbUtilsExtensionImpl object. + * Ownership is transferred to caller. + * Passed parameter is assumed to be reference to MMRMailboxUtilsObserver + * object, + * @param aMRMailboxObserver Reference to aMRMailboxObserver object + */ + static CMRMbUtilsExtensionImpl* NewL( + TAny* aMRMailboxObserver ); + + /** + * C++ destructor + */ + ~CMRMbUtilsExtensionImpl(); + +public: // From MMRMBUtilsMBInfoHandler + MMRMBUtilsSettings* SettingsMgr(); + const RPointerArray& MRMailBoxes() const; + const CMRMailBoxInfo* MRMailBoxInfoL( + TInt aEntryId ) const; + void ListMRMailBoxesL( + RArray& aMailBoxes ); + TAny* ExtensionL( TUid aExtensionUid ); + +private: // Implementation + CMRMbUtilsExtensionImpl( + MMRMailboxUtilsObserver& aObserver ); + void ConstructL(); + +private: + /// Own: Pointer to mailclient object + CFSMailClient* iMailClient; + /// Own: List of MR capable CMail mailboxes + RPointerArray iMailboxes; + /// Own: Pointer to mailbox listener object + CMRMBUtilsMailboxListener* iMailboxListener; + /// Own: Pointer to settings item + CMRMBUtilsSettings* iSettings; + /// Ref: Reference to mailbox utilities observer + MMRMailboxUtilsObserver& iMRMailboxObserver; + }; + +#endif // C_MRMBUTILSEXTENSION_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/inc/cmrmbutilsmailboxlistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/inc/cmrmbutilsmailboxlistener.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils settings definition +* +*/ + +#ifndef C_MRMBUTILSMAILBOXLISTENER_H +#define C_MRMBUTILSMAILBOXLISTENER_H + +#include "MFSMailEventObserver.h" +#include "CFSMailCommon.h" + +#include + +class CMRMailBoxInfo; +class CFSMailClient; +class MMRMailboxUtilsObserver; + +/** + * CMRMBUtilsMailboxListener is responsible for listening CMAIL mailbox + * events and maintaining the extension's mailbox list. + * CMRMBUtilsMailboxListener also sends notifications via + * MMRMailboxUtilsObserver interface. + * + * @see MFSMailEventObserver + */ +NONSHARABLE_CLASS( CMRMBUtilsMailboxListener ) : + public CBase, + public MFSMailEventObserver + { +public: + /** + * Creates and initializes new CMRMBUtilsMailboxListener object. + * Ownership is transfered to caller. + * @param aMailboxes Reference to mailbox array + * @param aMailClient Reference to CMAIL mail client object + * @param aMRMailboxObserver Reference to MMRMailboxUtilsObserver + */ + static CMRMBUtilsMailboxListener* NewL( + RPointerArray& aMailboxes, + CFSMailClient& aMailClient, + MMRMailboxUtilsObserver& aMRMailboxObserver ); + + /** + * C++ destructor + */ + ~CMRMBUtilsMailboxListener(); + +private: // From MFSMailEventObserver + void EventL( + TFSMailEvent aEvent, + TFSMailMsgId aMailbox, + TAny* aParam1, + TAny* aParam2, + TAny* aParam3); + +private: // Implementation + CMRMBUtilsMailboxListener( + RPointerArray& aMailboxes, + CFSMailClient& aMailClient, + MMRMailboxUtilsObserver& aMRMailboxObserver ); + void ConstructL(); + void ListMailboxesL(); + +private: // Data + /// Ref: Reference to mailbox mailboxes + RPointerArray& iMailboxes; + /// Ref: Reference to CMail mail client object + CFSMailClient& iMailClient; + /// Ref: Reference to mailbox observer + MMRMailboxUtilsObserver& iMRMailboxObserver; + }; + +#endif // C_MRMBUTILSMAILBOXLISTENER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/inc/cmrmbutilssettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/inc/cmrmbutilssettings.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils settings definition +* +*/ + +#ifndef C_MRMBUTILSSETTINGS_H +#define C_MRMBUTILSSETTINGS_H + +#include +#include + +class CFSMailClient; +class MMRMailboxUtilsObserver; + +/** + * CMRMBUtilsSettings is class accessing CMAIL specific + * mailboxutils settins. + * + * Settings include: + * - key to S60 MR Enabler framework settings + * - CMAIL mailbox plug-in UID + * - CMAIL mailbox ID + * + * @see MMRMBUtilsSettings + */ +NONSHARABLE_CLASS( CMRMBUtilsSettings ) : + public CBase, + public MMRMBUtilsSettings + { +public: // Constructors and destructors + + /** + * Symbian two-phased constructor. + * @param aMailClient Reference to mail client object + * @return instantiated object + */ + static CMRMBUtilsSettings* NewL( + CFSMailClient& aMailClient ); + + /** + * Destructor. + */ + ~CMRMBUtilsSettings(); + +public: // From MMRMBUtilsSettings + void SetDefaultMailboxSettingL( + TInt aId ); + void GetDefaultMailboxSettingsL( TInt& aId ); + +public: // New functions + + /** + * Gets the default CMAIL information from central repository. + * @param aDefaultMailbox Link to S60 MR framework setting + * @param aMailboxPluginUID CMAIL Mailbox plugin ID + * @param aMailboxId CMAIL mailbox ID + */ + TInt GetDefaultCMailMRMailBoxL( + TInt& aDefaultBox, + TUid& aMailboxPluginUID, + TInt& aMailboxId ); + + /** + * Sets the default CMAIL information into central repository. + * @param aDefaultMailbox Link to S60 MR framework setting + * @param aMailboxPluginUID CMAIL Mailbox plugin ID + * @param aMailboxId CMAIL mailbox ID + */ + TInt SetDefaultCMailMRMailBoxL( + TInt aDefaultBox, + TUid aMailboxPluginUID, + TInt aMailboxId ); + +private: // Constructors and destructors + CMRMBUtilsSettings( + CFSMailClient& aMailClient ); + void ConstructL(); + +private: + /// Ref: Reference to mail client object + CFSMailClient& iMailClient; + }; + +#endif // C_MRMBUTILSSETTINGS_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/inc/mrmbutilsextensioncrkeys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/inc/mrmbutilsextensioncrkeys.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef MRMBUTILSCRKEYS_H +#define MRMBUTILSCRKEYS_H + +#include "esmrinternaluid.h" + +/** + * MRUI Feature local variation repository uid. + * The repository contains read-only keys for supported features. + * Values are on/off settings stored as integer data. + */ +const TUid KCRUidMRDefaultCMailMRMailbox = { KMRDefaultCMailMRMailbox }; + +/** + * Link to S60 MR Framework Default mailbox setting. + * + * Default value: 0 (invalid) + */ +const TUint32 KMRUIS60DefMailbox = 0x1; + +/** + * Defines the selected CMAIL mailboxes plug-in UID. + * + * Default value: 0 (invalid) + */ +const TUint32 KMRUICMailMailboxUID = 0x2; + +/** + * Defines the selected CMAIL's mailboxes ID. + * + * Default value: 0 (invalid) + */ +const TUint32 KMRUICMailMailboxID = 0x3; + +const TInt KMRUICMailInvalidIntValue( 0 ); + +#endif // MRMBUTILSCRKEYS_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/src/cmrmbutilsextensionimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/src/cmrmbutilsextensionimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM implementation +* +*/ + +//INCLUDE FILES +#include "cmrmbutilsextensionimpl.h" +#include "cmrmbutilsmailboxlistener.h" +#include "cmrmbutilssettings.h" +#include "CFSMailClient.h" + +#include "emailtrace.h" + +#include +#include + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::CMRMbUtilsExtensionImpl +// +// Constructor. +// ---------------------------------------------------------------------------- +// +CMRMbUtilsExtensionImpl::CMRMbUtilsExtensionImpl( + MMRMailboxUtilsObserver& aObserver ) +: iMRMailboxObserver( aObserver ) + { + // No implementation + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::~CMRMbUtilsExtensionImpl +// +// Destructor. +// ---------------------------------------------------------------------------- +// +CMRMbUtilsExtensionImpl::~CMRMbUtilsExtensionImpl() + { + FUNC_LOG; + + iMailboxes.ResetAndDestroy(); + + if ( iMailClient ) + { + iMailClient->RemoveObserver( *iMailboxListener ); + iMailClient->Close(); + } + + delete iSettings; + delete iMailboxListener; + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::NewL +// ---------------------------------------------------------------------------- +// +CMRMbUtilsExtensionImpl* CMRMbUtilsExtensionImpl::NewL( + TAny* aMRMailboxObserver ) + { + FUNC_LOG; + + MMRMailboxUtilsObserver* mrMailboxObserver = + static_cast( aMRMailboxObserver ); + + CMRMbUtilsExtensionImpl* self = + new (ELeave) CMRMbUtilsExtensionImpl( *mrMailboxObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::ConstructL +// ---------------------------------------------------------------------------- +// +void CMRMbUtilsExtensionImpl::ConstructL() + { + FUNC_LOG; + + iMailClient = CFSMailClient::NewL(); + + iMailboxListener = + CMRMBUtilsMailboxListener::NewL( + iMailboxes, + *iMailClient, + iMRMailboxObserver ); + + iSettings = CMRMBUtilsSettings::NewL( *iMailClient ); + + iMailClient->AddObserverL( *iMailboxListener ); + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::SettingsMgr +// ---------------------------------------------------------------------------- +// +MMRMBUtilsSettings* CMRMbUtilsExtensionImpl::SettingsMgr() + { + return iSettings; + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::MRMailBoxes +// ---------------------------------------------------------------------------- +// +const RPointerArray& + CMRMbUtilsExtensionImpl::MRMailBoxes() const + { + FUNC_LOG; + + return iMailboxes; + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::NewL +// ---------------------------------------------------------------------------- +// +const CMRMailBoxInfo* CMRMbUtilsExtensionImpl::MRMailBoxInfoL( + TInt aEntryId ) const + { + FUNC_LOG; + + const CMRMailBoxInfo* KInfo = NULL; + + TInt mailboxCount( iMailboxes.Count() ); + for ( TInt i(0); i < mailboxCount && !KInfo; ++i ) + { + if ( aEntryId == iMailboxes[i]->EntryId() ) + { + KInfo = iMailboxes[i]; + } + } + return KInfo; + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::ListMRMailBoxesL +// ---------------------------------------------------------------------------- +// +void CMRMbUtilsExtensionImpl::ListMRMailBoxesL( + RArray& aMailBoxes ) + { + FUNC_LOG; + + TInt mailboxCount( iMailboxes.Count() ); + for ( TInt i(0); i < mailboxCount; ++i ) + { + CMRMailboxUtils::TMailboxInfo info; + info.iName.Set( iMailboxes[i]->Name() ); + info.iEmailAddress.Set( iMailboxes[i]->Address() ); + info.iMtmUid = iMailboxes[i]->MtmUid(); + info.iEntryId = iMailboxes[i]->EntryId(); + + aMailBoxes.Append( info ); + } + } + +// ---------------------------------------------------------------------------- +// CMRMbUtilsExtensionImpl::ExtensionL +// ---------------------------------------------------------------------------- +// +TAny* CMRMbUtilsExtensionImpl::ExtensionL( TUid /*aExtensionUid*/ ) + { + return NULL; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/src/cmrmbutilsmailboxlistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/src/cmrmbutilsmailboxlistener.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils settings implementation +* +*/ + +//INCLUDE FILES +#include "cmrmbutilsmailboxlistener.h" +#include "CFSMailCommon.h" +#include "CFSMailClient.h" +#include "CFSMailBox.h" +#include "fsmtmsuids.h" +#include "emailtrace.h" + +#include +#include +#include + +// CONSTANTS + +// Unnamed namespace for local definitions +namespace { // codescanner::namespace +// Length for CRC buffer +const TInt KCRCBufferLen(32); +} + +// ======== MEMBER FUNCTIONS ======== + + +// ---------------------------------------------------------------------------- +// CMRMBUtilsMailboxListener::CMRMBUtilsMailboxListener +// ---------------------------------------------------------------------------- +// +CMRMBUtilsMailboxListener::CMRMBUtilsMailboxListener( + RPointerArray& aMailboxes, + CFSMailClient& aMailClient, + MMRMailboxUtilsObserver& aMRMailboxObserver ) +: iMailboxes( aMailboxes ), + iMailClient( aMailClient ), + iMRMailboxObserver( aMRMailboxObserver ) + { + // No implementation + } + +// ---------------------------------------------------------------------------- +// CMRMBUtilsMailboxListener::~CMRMBUtilsMailboxListener +// ---------------------------------------------------------------------------- +// +CMRMBUtilsMailboxListener::~CMRMBUtilsMailboxListener() + { + // No implementation + } + +// ---------------------------------------------------------------------------- +// CMRMBUtilsMailboxListener::NewL +// ---------------------------------------------------------------------------- +// +CMRMBUtilsMailboxListener* CMRMBUtilsMailboxListener::NewL( + RPointerArray& aMailboxes, + CFSMailClient& aMailClient, + MMRMailboxUtilsObserver& aMRMailboxObserver ) + { + FUNC_LOG; + + CMRMBUtilsMailboxListener* self = + new (ELeave) CMRMBUtilsMailboxListener( + aMailboxes, + aMailClient, + aMRMailboxObserver ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CMRMBUtilsMailboxListener::ConstructL +// ---------------------------------------------------------------------------- +// +void CMRMBUtilsMailboxListener::ConstructL() + { + FUNC_LOG; + + ListMailboxesL(); + } + +// ---------------------------------------------------------------------------- +// CMRMBUtilsMailboxListener::EventL +// ---------------------------------------------------------------------------- +// +void CMRMBUtilsMailboxListener::EventL( + TFSMailEvent aEvent, + TFSMailMsgId /*aMailbox*/, + TAny* /*aParam1*/, + TAny* /*aParam2*/, + TAny* /*aParam3*/ ) + { + FUNC_LOG; + + MMRMailboxUtilsObserver::TEventType event( + MMRMailboxUtilsObserver::EMRNullEvent); + + switch ( aEvent ) + { + case TFSEventNewMailbox: + { + event = MMRMailboxUtilsObserver::EMRMailboxCreated; + } + break; + + case TFSEventMailboxRenamed: + case TFSEventMailboxCapabilityChanged: + case TFSEventMailboxSettingsChanged: + { + event = MMRMailboxUtilsObserver::EMRMailboxCreated; + } + break; + + case TFSEventMailboxDeleted: + { + event = MMRMailboxUtilsObserver::EMRMailboxDeleted; + } + break; + + default: + { + // No actions for rest of the events + } + break; + } + + if ( MMRMailboxUtilsObserver::EMRNullEvent != event) + { + ListMailboxesL(); + iMRMailboxObserver.HandleMRMailboxEventL( event ); + } + } + +// ---------------------------------------------------------------------------- +// CMRMBUtilsMailboxListener::ListMailboxesL +// ---------------------------------------------------------------------------- +// +void CMRMBUtilsMailboxListener::ListMailboxesL() + { + FUNC_LOG; + + RCPointerArray mailBoxes; + CleanupClosePushL( mailBoxes ); + + TFSMailMsgId msgId; + iMailClient.ListMailBoxes( msgId, mailBoxes ); + + iMailboxes.ResetAndDestroy(); + TInt mailboxCount( mailBoxes.Count() ); + for (TInt i(0); i < mailboxCount; ++i ) + { + CFSMailBox* mailbox = mailBoxes[i]; + + TBool supportRespond( + mailbox->HasCapability( EFSMBoxCapaMeetingRequestRespond ) ); + + TBool supportCreate( + mailbox->HasCapability( EFSMBoxCapaMeetingRequestCreate ) ); + + TBool supportUpdate( + mailbox->HasCapability( EFSMBoxCapaCanUpdateMeetingRequest ) ); + + TBool supportsMeetingRequest( + supportRespond && + supportCreate && + supportUpdate ); + + if ( supportsMeetingRequest ) + { + // Mailbox supports meeting request creation + TFSMailMsgId mailboxId( mailbox->GetId() ); + + TBuf crcBuffer; + crcBuffer.AppendNum( mailboxId.PluginId().iUid ); + crcBuffer.AppendNum( mailboxId.Id() ); + + TUint32 cmailMailboxCrc( 0 ); + Mem::Crc32( cmailMailboxCrc, + crcBuffer.Ptr(), + crcBuffer.Size() ); + + TPtrC mailboxName( mailbox->GetName() ); + TPtrC mailboxUser( mailbox->OwnMailAddress().GetEmailAddress() ); + + CMRMailBoxInfo* info = CMRMailBoxInfo::NewL( + mailboxName, + mailboxUser, + TUid::Uid( KUidMsgTypeFsMtmVal), + cmailMailboxCrc ); + + CleanupStack::PushL( info ); + User::LeaveIfError( iMailboxes.Append( info ) ); + CleanupStack::Pop( info ); + } + } + + // mailBoxes + CleanupStack::PopAndDestroy(); // codescanner::cleanup + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/src/cmrmbutilssettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/src/cmrmbutilssettings.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,291 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils settings implementation +* +*/ + +// ---------------------------------------------------------------------------- +// INCLUDE FILES +// ---------------------------------------------------------------------------- +// +#include "cmrmbutilssettings.h" +#include "mrmbutilsextensioncrkeys.h" +#include "CFSMailBox.h" +#include "CFSMailClient.h" +#include "emailtrace.h" + +#include +#include +#include + +namespace { // codescanner::namespace +// Length for CRC buffer +const TInt KCRCBufferLen(32); +} + +// ---------------------------------------------------------------------------- +// MEMBER FUNCTIONS +// ---------------------------------------------------------------------------- +// + +// ---------------------------------------------------------------------------- +// CMRMBUtilsSettings::CMRUtilsSettingsMgr +// +// Constructor. +// ---------------------------------------------------------------------------- +// +CMRMBUtilsSettings::CMRMBUtilsSettings( + CFSMailClient& aMailClient ) +: iMailClient( aMailClient ) + { + // No implementation + } + +// ---------------------------------------------------------------------------- +// CMRUtilsSettingsMgr::~CMRUtilsSettingsMgr +// +// Destructor. +// ---------------------------------------------------------------------------- +// +CMRMBUtilsSettings::~CMRMBUtilsSettings() + { + // No implementation + } + +// ---------------------------------------------------------------------------- +// CMRMBUtilsSettings::NewL +// ---------------------------------------------------------------------------- +// +CMRMBUtilsSettings* CMRMBUtilsSettings::NewL( + CFSMailClient& aMailClient ) + { + FUNC_LOG; + + CMRMBUtilsSettings* self = + new( ELeave ) CMRMBUtilsSettings( aMailClient ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CMRUtilsSettingsMgr::ConstructL +// ---------------------------------------------------------------------------- +// +void CMRMBUtilsSettings::ConstructL() + { + FUNC_LOG; + + // Not yet implementation + } + +// ---------------------------------------------------------------------------- +// CMRUtilsSettingsMgr::ConstructL +// ---------------------------------------------------------------------------- +// +void CMRMBUtilsSettings::SetDefaultMailboxSettingL( + TInt aId ) + { + FUNC_LOG; + + RCPointerArray mailBoxes; + CleanupClosePushL( mailBoxes ); + + TFSMailMsgId msgId; + iMailClient.ListMailBoxes( msgId, mailBoxes ); + + TBool mailboxFound( EFalse ); + TInt mailboxCount( mailBoxes.Count() ); + for (TInt i(0); i < mailboxCount && !mailboxFound; ++i ) + { + CFSMailBox* mailbox( mailBoxes[i] ); + TFSMailMsgId mailboxId( mailbox->GetId() ); + + TBuf crcBuffer; + crcBuffer.AppendNum( mailboxId.PluginId().iUid ); + crcBuffer.AppendNum( mailboxId.Id() ); + + TUint32 cmailMailboxCrc( 0 ); + Mem::Crc32( cmailMailboxCrc, + crcBuffer.Ptr(), + crcBuffer.Size() ); + + if ( cmailMailboxCrc == aId ) + { + SetDefaultCMailMRMailBoxL( + aId, + mailboxId.PluginId(), + mailboxId.Id() ); + + mailboxFound = ETrue; + } + } + + if ( !mailboxFound ) + { + // CMAIL mailbox not found --> Reset the setting + SetDefaultCMailMRMailBoxL( + KMRUICMailInvalidIntValue, + TUid::Uid( KMRUICMailInvalidIntValue ), + KMRUICMailInvalidIntValue ); + } + + // mailBoxes + CleanupStack::PopAndDestroy(); // codescanner::cleanup + } + +// ---------------------------------------------------------------------------- +// CMRUtilsSettingsMgr::ConstructL +// ---------------------------------------------------------------------------- +// +void CMRMBUtilsSettings::GetDefaultMailboxSettingsL( TInt& aId ) + { + FUNC_LOG; + + TUid mailboxUID; + TInt mailboxId; + + GetDefaultCMailMRMailBoxL( + aId, + mailboxUID, + mailboxId ); + + RCPointerArray mailBoxes; + CleanupClosePushL( mailBoxes ); + + TFSMailMsgId msgId; + iMailClient.ListMailBoxes( msgId, mailBoxes ); + + TBool mailboxFound( EFalse ); + TInt mailboxCount( mailBoxes.Count() ); + for (TInt i(0); i < mailboxCount && !mailboxFound; ++i ) + { + CFSMailBox* mailbox( mailBoxes[i] ); + TFSMailMsgId mailboxId( mailbox->GetId() ); + + TBuf crcBuffer; + crcBuffer.AppendNum( mailboxId.PluginId().iUid ); + crcBuffer.AppendNum( mailboxId.Id() ); + + TUint32 cmailMailboxCrc( 0 ); + Mem::Crc32( cmailMailboxCrc, + crcBuffer.Ptr(), + crcBuffer.Size() ); + + if ( cmailMailboxCrc == aId ) + { + mailboxFound = ETrue; + } + } + + if ( !mailboxFound ) + { + aId = KMRUICMailInvalidIntValue; + } + + // mailBoxes + CleanupStack::PopAndDestroy(); // codescanner::cleanup + } + +// ---------------------------------------------------------------------------- +// CMRUtilsSettingsMgr::GetDefaultCMailMRMailBoxL +// ---------------------------------------------------------------------------- +// +TInt CMRMBUtilsSettings::GetDefaultCMailMRMailBoxL( + TInt& aDefaultBox, + TUid& aMailboxPluginUID, + TInt& aMailboxId ) + { + FUNC_LOG; + + TInt retValue( KErrNotFound ); + + TInt defaultBox( KMRUICMailInvalidIntValue ); + TInt mailboxPluginUID( KMRUICMailInvalidIntValue ); + TInt mailboxId( KMRUICMailInvalidIntValue ); + + aDefaultBox = defaultBox; + aMailboxPluginUID = TUid::Uid( mailboxPluginUID ); + aMailboxId = mailboxId; + + // Create central repository + CRepository* cenRep = + CRepository::NewLC( KCRUidMRDefaultCMailMRMailbox ); + + // Get default meeting request mailbox id from CentRep + TInt err = cenRep->Get( KMRUIS60DefMailbox, defaultBox ); + if ( KErrNone == err ) + { + err = cenRep->Get( KMRUICMailMailboxUID, mailboxPluginUID ); + if ( KErrNone == err ) + { + err = cenRep->Get( KMRUICMailMailboxID, mailboxId ); + } + } + + // If some other error than KErrNotFound Leave + if ( err != KErrNotFound ) + { + // KErrNone won't leave + User::LeaveIfError( err ); + } + + CleanupStack::PopAndDestroy( cenRep ); + + if ( KErrNone == err ) + { + aDefaultBox = defaultBox; + aMailboxPluginUID = TUid::Uid( mailboxPluginUID ); + aMailboxId = mailboxId; + } + + return retValue; + } + +// ---------------------------------------------------------------------------- +// CMRUtilsSettingsMgr::SetDefaultCMailMRMailBoxL +// ---------------------------------------------------------------------------- +// +TInt CMRMBUtilsSettings::SetDefaultCMailMRMailBoxL( + TInt aDefaultBox, + TUid aMailboxPluginUID, + TInt aMailboxId ) + { + FUNC_LOG; + + // Create central repository + CRepository* cenRep = + CRepository::NewLC( KCRUidMRDefaultCMailMRMailbox ); + + TInt err = cenRep->Set( KMRUIS60DefMailbox, aDefaultBox ); + + if ( err == KErrNone ) + { + TInt uid( static_cast(aMailboxPluginUID.iUid ) ); + err = cenRep->Set( KMRUICMailMailboxUID, uid ); + if ( err == KErrNone ) + { + err = cenRep->Set( KMRUICMailMailboxID, aMailboxId ); + } + } + + CleanupStack::PopAndDestroy( cenRep ); + + User::LeaveIfError( err ); + + return err; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/src/esmrmbutilsextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/src/esmrmbutilsextension.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MRMBUTILSEXTENSION ECOM definition implementation +* +*/ + +// ---------------------------------------------------------------------------- +// INCLUDE FILES +// ---------------------------------------------------------------------------- +// +// From ESMRVIEWER +#include "cmrmbutilsextensionimpl.h" +#include "esmrinternaluid.h" + +// From System +#include +#include + +// ==================== LOCAL FUNCTIONS ==================== + +// ---------------------------------------------------------------------------- +// ImplementationTable +// Definition for ESMRVIEWER constructor methods +// ---------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KESMRMButilsExtensionImplementationUid, + CMRMbUtilsExtensionImpl::NewL ) + }; + +/** +* ImplementationGroupProxy +* @param aTableCount +* @returns "TImplementationProxy*" +*/ +// ---------------------------------------------------------------------------- +// ImplementationGroupProxy +// Fetches ESMRVIEWER constructor methods. +// +// @param aTableCount On returns contains the number of constructor methods. +// ---------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = + sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); + return ImplementationTable; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mrui +* +*/ + +#include +#include + +#include "../unit/mrmbutilsextension/group/bld.inf" +#include "../module/mrmbutilsextension/group/bld.inf" + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES + +PRJ_EXPORTS + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/bwins/MT_mrmbutilsextensionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/bwins/MT_mrmbutilsextensionu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/eabi/MT_mrmbutilsextensionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/eabi/MT_mrmbutilsextensionu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/group/MT_mrmbutilsextension.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/group/MT_mrmbutilsextension.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// DEFINES +#define KMyUniqueUid3 0x01700001 +#define KEUnitTestDllUid2 0x1000af5a + +// Build target +TARGET MT_mrmbutilsextension.dll +TARGETTYPE dll +UID KEUnitTestDllUid2 KMyUniqueUid3 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +// Source files +SOURCEPATH ..\src +SOURCE DllMain.cpp // Test code +SOURCE MT_mrmbutilsextension.cpp + +// Include paths +USERINCLUDE ../inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/digia/eunit + +// Dependencies to system components +LIBRARY euser.lib +LIBRARY eunit.lib +LIBRARY ecom.lib +LIBRARY fsfwcommonlib.lib +LIBRARY fsmailframework.lib +LIBRARY mrmailbox.lib + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +MT_mrmbutilsextension.mmp + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/inc/MT_mrmbutilsextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/inc/MT_mrmbutilsextension.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __MRMBUTILSEXTENSION_H__ +#define __MRMBUTILSEXTENSION_H__ + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CMRMBUtilsMBInfoHandler; +class CFSMailClient; +class CFSMailBox; + +// CLASS DEFINITION +/** + * Generated EUnit test suite class. + */ +NONSHARABLE_CLASS( MT_MRMbUtilsExtension ) : + public CEUnitTestSuiteClass, + public MMRMailboxUtilsObserver + { +public: // Constructors and destructor + + static MT_MRMbUtilsExtension* NewL(); + static MT_MRMbUtilsExtension* NewLC(); + ~MT_MRMbUtilsExtension(); + +private: + void HandleMRMailboxEventL( + MMRMailboxUtilsObserver::TEventType aType ); + +private: // Constructors + + MT_MRMbUtilsExtension(); + void ConstructL(); + +private: // New methods + + void SetupL(); + void SetupWithAllMailboxesL(); + void SetupWithMRMailboxesL(); + + void Teardown(); + + void T_MRECOMExtensionFoundL(); + + void T_MRCreateCMailExtensionL(); + + void T_CheckECOMDataL(); + + void T_FindMRMailboxesL(); + + void T_FilterNonMRMailboxesL(); + + void T_FetchSpecificMailboxInformationL(); + + void T_FetchInvalidMailboxInformationL(); + +private: // Data + + CFSMailClient* iMailClient; + + RPointerArray iMailboxes; + + CMRMBUtilsMBInfoHandler* iCmailHandler; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __MRMBUTILSEXTENSION_H__ + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/src/DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/src/DllMain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include +#include "MT_mrmbutilsextension.h" + +/** +* T_HelloWorld.dll test suite factory function. +*/ +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + _LIT( KMRMbUtilsExtensionTest, "MRMBUtils extension test" ); + + CEUnitTestSuite* rootSuite = + CEUnitTestSuite::NewLC( KMRMbUtilsExtensionTest ); + + // Note that NewLC leaves the object in the cleanupstack. + MT_MRMbUtilsExtension* moduleTest = + MT_MRMbUtilsExtension::NewLC(); + + rootSuite->AddL( moduleTest ); + + CleanupStack::Pop( moduleTest ); + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/src/MT_mrmbutilsextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/module/mrmbutilsextension/src/MT_mrmbutilsextension.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,414 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "MT_mrmbutilsextension.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "esmrinternaluid.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace { // codescanner::namespace + +// CMail literal +_LIT8( KCMail, "CMAIL" ); + +// CMAIL extension ECOM version +const TInt KCMailExtensionVersion( 1 ); + +// Constant for equal string +const TInt KEqualString( 0 ); + +TInt FindMailboxByName( + const TDesC& aName, + RPointerArray& aMailboxes ) + { + TInt index( KErrNotFound ); + + TInt mailboxCount( aMailboxes.Count() ); + for ( TInt i(0); + i < mailboxCount && KErrNotFound == index; + ++i ) + { + TPtrC name( aMailboxes[i]->GetName() ); + if ( KEqualString == name.CompareF( aName ) ) + { + index = i; + } + } + + return index; + } + +} + +// - Construction ----------------------------------------------------------- + +MT_MRMbUtilsExtension* MT_MRMbUtilsExtension::NewL() + { + MT_MRMbUtilsExtension* self = MT_MRMbUtilsExtension::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +MT_MRMbUtilsExtension* MT_MRMbUtilsExtension::NewLC() + { + MT_MRMbUtilsExtension* self = new( ELeave ) MT_MRMbUtilsExtension(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +MT_MRMbUtilsExtension::~MT_MRMbUtilsExtension() + { + } + +MT_MRMbUtilsExtension::MT_MRMbUtilsExtension() + { + } + +void MT_MRMbUtilsExtension::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + +void MT_MRMbUtilsExtension::HandleMRMailboxEventL( + MMRMailboxUtilsObserver::TEventType /*aType*/ ) + { + + } + +// - Test methods ----------------------------------------------------------- + + + +void MT_MRMbUtilsExtension::SetupL( ) + { + iMailClient = CFSMailClient::NewL(); + iCmailHandler = CMRMBUtilsMBInfoHandler::NewL( KCMail(), *this ); + } + +void MT_MRMbUtilsExtension::SetupWithAllMailboxesL() + { + SetupL(); + + TFSMailMsgId id; + iMailClient->ListMailBoxes( id, iMailboxes ); + } + +void MT_MRMbUtilsExtension::SetupWithMRMailboxesL() + { + SetupWithAllMailboxesL(); + + TInt index( 0 ); + while ( index < iMailboxes.Count() ) + { + CFSMailBox* mailbox( iMailboxes[index] ); + + TBool supportsMeetingRequest( + mailbox->HasCapability(EFSMBoxCapaMeetingRequestRespond) && + mailbox->HasCapability(EFSMBoxCapaMeetingRequestCreate) && + mailbox->HasCapability(EFSMBoxCapaCanUpdateMeetingRequest) ); + + if ( !supportsMeetingRequest ) + { + delete mailbox; + iMailboxes.Remove( index ); + } + else + { + ++index; + } + } + } + +void MT_MRMbUtilsExtension::Teardown() + { + if ( iCmailHandler ) + { + delete iCmailHandler; + iCmailHandler = NULL; + } + + iMailboxes.ResetAndDestroy(); + iMailboxes.Close(); + iMailClient->Close(); + } + +void MT_MRMbUtilsExtension::T_MRECOMExtensionFoundL( ) + { + RCPointerArray implementations; + CleanupClosePushL( implementations ); + + const TUid mrmailboxUtilsExt = + { KMRMailboxUtilsExtensionIFUID }; + + REComSession::ListImplementationsL( + mrmailboxUtilsExt, + implementations ); + + TBool cmailExtFound( EFalse ); + TInt implCount( implementations.Count() ); + + EUNIT_ASSERT_DESC( + implCount, + "No implementations found for KMRMailboxUtilsExtensionIFUID" ); + + for (TInt i(0); i < implCount && !cmailExtFound; ++i ) + { + CImplementationInformation* implInfo = implementations[i]; + TUid implUid( implInfo->ImplementationUid() ); + + if ( KESMRMButilsExtensionImplementationUid == implUid.iUid ) + { + cmailExtFound = ETrue; + } + } + + EUNIT_ASSERT_DESC( + cmailExtFound, + "No CMail extension found" ); + + CleanupStack::PopAndDestroy(); // implementations + } + +void MT_MRMbUtilsExtension::T_MRCreateCMailExtensionL() + { + CMRMBUtilsMBInfoHandler* cmailHandler = NULL; + + cmailHandler = CMRMBUtilsMBInfoHandler::NewL( KCMail(), *this ); + + EUNIT_ASSERT_DESC( + cmailHandler, + "CMAIL extension cannot be created "); + + delete cmailHandler; + cmailHandler = NULL; + } + +void MT_MRMbUtilsExtension::T_CheckECOMDataL() + { + RCPointerArray implementations; + CleanupClosePushL( implementations ); + + const TUid mrmailboxUtilsExt = + { KMRMailboxUtilsExtensionIFUID }; + + REComSession::ListImplementationsL( + mrmailboxUtilsExt, + implementations ); + + TBool cmailExtFound( EFalse ); + TInt implCount( implementations.Count() ); + + EUNIT_ASSERT_DESC( + implCount, + "No implementations found for KMRMailboxUtilsExtensionIFUID" ); + + for (TInt i(0); i < implCount && !cmailExtFound; ++i ) + { + CImplementationInformation* implInfo = implementations[i]; + TUid implUid( implInfo->ImplementationUid() ); + + if ( KESMRMButilsExtensionImplementationUid == implUid.iUid ) + { + cmailExtFound = ETrue; + + EUNIT_ASSERT_EQUALS_DESC( + KCMailExtensionVersion, + implInfo->Version(), + "CMail extension ECOM VERSION mismatch" ); + + EUNIT_ASSERT_EQUALS_DESC( + KEqualString, + implInfo->DataType().CompareF( KCMail), + "CMail extension datatype mismatch" ); + } + } + + EUNIT_ASSERT_DESC( + cmailExtFound, + "No CMail extension found" ); + + CleanupStack::PopAndDestroy(); // implementations + } + +void MT_MRMbUtilsExtension::T_FindMRMailboxesL() + { + const RPointerArray& mailboxes = + iCmailHandler->MRMailBoxes(); + + EUNIT_ASSERT_EQUALS_DESC( + iMailboxes.Count(), + mailboxes.Count(), + "Mailbox count mismatch" ); + } + +void MT_MRMbUtilsExtension::T_FilterNonMRMailboxesL() + { + const RPointerArray& mailboxes = + iCmailHandler->MRMailBoxes(); + + TInt mailBoxCount( iMailboxes.Count() ); + TInt mrMailboxCount( mailboxes.Count() ); + + EUNIT_ASSERT_DESC( + mailBoxCount >= mrMailboxCount, + "Too many MR mailboxes" ); + + // Remove MR mailboxes from all mailboxes + for ( TInt i(0); i < mrMailboxCount; ++i ) + { + TPtrC mrMailboxName( mailboxes[i]->Name() ); + TInt mailboxIndex( + FindMailboxByName(mrMailboxName, iMailboxes) ); + + if( KErrNotFound != mailboxIndex ) + { + // MR mailbox was found --> Remove it from list + CFSMailBox* mailbox = iMailboxes[ mailboxIndex ]; + delete mailbox; + iMailboxes.Remove( mailboxIndex ); + } + } + + mailBoxCount = iMailboxes.Count(); + for ( TInt i(0); i < mailBoxCount; i++ ) + { + CFSMailBox* mailbox = iMailboxes[i]; + + TBool supportsMeetingRequest( + mailbox->HasCapability(EFSMBoxCapaMeetingRequestRespond) && + mailbox->HasCapability(EFSMBoxCapaMeetingRequestCreate) && + mailbox->HasCapability(EFSMBoxCapaCanUpdateMeetingRequest) ); + + EUNIT_ASSERT_DESC( + !supportsMeetingRequest, + "MR capable mailbox was not included in MR mailbox list" ); + } + } + +void MT_MRMbUtilsExtension::T_FetchSpecificMailboxInformationL() + { + const RPointerArray& mailboxes = + iCmailHandler->MRMailBoxes(); + + TInt mailboxCount( mailboxes.Count() ); + + EUNIT_ASSERT_DESC( + mailboxCount, + "No any mailboxes found" ); + + for ( TInt i(0); i < mailboxCount; ++i ) + { + TInt mailboxId( mailboxes[i]->EntryId() ); + + const CMRMailBoxInfo* mbInfo = + iCmailHandler->MRMailBoxInfoL( mailboxId ); + + EUNIT_ASSERT_DESC( + mbInfo, + "Mailbox not found with known ID" ); + } + } + +void MT_MRMbUtilsExtension::T_FetchInvalidMailboxInformationL() + { + const RPointerArray& mailboxes = + iCmailHandler->MRMailBoxes(); + + TInt mailboxCount( mailboxes.Count() ); + + EUNIT_ASSERT_DESC( + mailboxCount, + "No any mailboxes found" ); + + TInt invalidId( 0x43219862 ); + + const CMRMailBoxInfo* mbInfo = + iCmailHandler->MRMailBoxInfoL( invalidId ); + + EUNIT_ASSERT_DESC( + !mbInfo, + "Mailbox not found with known ID" ); + } + +// - EUnit test table ------------------------------------------------------- + +EUNIT_BEGIN_TEST_TABLE( + MT_MRMbUtilsExtension, + "Module test: mrmbutilsextension", + "MODULE" ) + +EUNIT_TEST( + "Test ECOM implementation existence", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupL, T_MRECOMExtensionFoundL, Teardown) + +EUNIT_TEST( + "Test CMail extension creation", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupL, T_MRCreateCMailExtensionL, Teardown) + +EUNIT_TEST( + "Test ECOM resource data", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupL, T_CheckECOMDataL, Teardown) + +EUNIT_TEST( + "Fetching MR mailboxes", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupWithMRMailboxesL, T_FindMRMailboxesL, Teardown) + +EUNIT_TEST( + "Testing mailbox filtering", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupWithAllMailboxesL, T_FilterNonMRMailboxesL, Teardown) + +EUNIT_TEST( + "Testing mailbox information fetching", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupWithMRMailboxesL, T_FetchSpecificMailboxInformationL, Teardown) + +EUNIT_TEST( + "Testing invalid mailbox information fetching", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupWithAllMailboxesL, T_FetchInvalidMailboxInformationL, Teardown) + +EUNIT_END_TEST_TABLE diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/bwins/UT_mrmbutilsextensionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/bwins/UT_mrmbutilsextensionu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?CreateTestSuiteL@@YAPAVMEUnitTest@@XZ @ 1 NONAME ; class MEUnitTest * CreateTestSuiteL(void) + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/eabi/UT_mrmbutilsextensionu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/eabi/UT_mrmbutilsextensionu.def Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z16CreateTestSuiteLv @ 1 NONAME + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/group/UT_mrmbutilsextension.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/group/UT_mrmbutilsextension.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include +#include +#include + +// DEFINES +#define KMyUniqueUid3 0x01700002 +#define KEUnitTestDllUid2 0x1000af5a + +// Build target +TARGET UT_mrmbutilsextension.dll +TARGETTYPE dll +UID KEUnitTestDllUid2 KMyUniqueUid3 + +CAPABILITY EUNIT_CAPS +VENDORID VID_DEFAULT + +// Source files +SOURCEPATH ../src +SOURCE DllMain.cpp // Test code +SOURCE UT_cmrmbutilssettings.cpp + +SOURCEPATH ../../../../../mrmbutilsextension/src +SOURCE cmrmbutilssettings.cpp + +// Include paths +USERINCLUDE ../inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/digia/eunit + +// Dependencies to system components +LIBRARY euser.lib +LIBRARY eunit.lib +LIBRARY ecom.lib +LIBRARY fsfwcommonlib.lib +LIBRARY fsmailframework.lib +LIBRARY mrmailbox.lib +LIBRARY centralrepository.lib + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,23 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +UT_mrmbutilsextension.mmp + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/inc/UT_cmrmbutilssettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/inc/UT_cmrmbutilssettings.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef UT_CMRMBUTILSSETTINGS_H +#define UT_CMRMBUTILSSETTINGS_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CFSMailClient; +class CRepository; +class CMRMBUtilsSettings; +class CFSMailBox; + +// CLASS DEFINITION +/** + * Generated EUnit test suite class. + */ +NONSHARABLE_CLASS( UT_CMRMBUtilsSettings ) : + public CEUnitTestSuiteClass + { +public: // Constructors and destructor + + static UT_CMRMBUtilsSettings* NewL(); + static UT_CMRMBUtilsSettings* NewLC(); + ~UT_CMRMBUtilsSettings(); + +private: // Constructors + + UT_CMRMBUtilsSettings(); + void ConstructL(); + +private: // New methods + + void SetupL(); + void SetupWithMailboxesL(); + void ResetcenRep(); + void Teardown(); + + void T_SetDefaultMailboxSettingL(); + void T_GetDefaultMailboxSettingsL(); + + void T_CenRepSetDefaultMailboxSettingL(); + void T_CenRepGetDefaultMailboxSettingsL(); + +private: // Data + + CFSMailClient* iMailClient; + CMRMBUtilsSettings* iSettings; + CRepository* iCenRep; + RPointerArray iMailboxes; + + EUNIT_DECLARE_TEST_TABLE; + }; + +#endif // __MRMBUTILSEXTENSION_H__ + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/src/DllMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/src/DllMain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include "UT_cmrmbutilssettings.h" + +EXPORT_C MEUnitTest* CreateTestSuiteL() + { + _LIT( KMRMBUtilsSettings, "CMRMBUtilsSettings test" ); + + CEUnitTestSuite* rootSuite = + CEUnitTestSuite::NewLC( KMRMBUtilsSettings ); + + // Note that NewLC leaves the object in the cleanupstack. + UT_CMRMBUtilsSettings* unitTest = UT_CMRMBUtilsSettings::NewLC(); + rootSuite->AddL( unitTest ); + CleanupStack::Pop( unitTest ); + + CleanupStack::Pop( rootSuite ); + + return rootSuite; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/src/UT_cmrmbutilssettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrmbutilsextension/tsrc/unit/mrmbutilsextension/src/UT_cmrmbutilssettings.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "UT_cmrmbutilssettings.h" +#include "mrmbutilsextensioncrkeys.h" +#include "cmrmbutilssettings.h" +#include "cfsmailclient.h" + +#include +#include +#include + +namespace { // codescanner::namespace + + +// Initial cenrep value +const TInt KCenRepInitValue( 0 ); + +// Dummy cenrep value used in tests +const TInt KDummyCenRepValue( 1000 ); + +// Length for CRC buffer +const TInt KCRCBufferLen(32); + +} + +// - Construction ----------------------------------------------------------- + +UT_CMRMBUtilsSettings::UT_CMRMBUtilsSettings() + { + } + +UT_CMRMBUtilsSettings::~UT_CMRMBUtilsSettings() + { + } + +UT_CMRMBUtilsSettings* UT_CMRMBUtilsSettings::NewL() + { + UT_CMRMBUtilsSettings* self = UT_CMRMBUtilsSettings::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +UT_CMRMBUtilsSettings* UT_CMRMBUtilsSettings::NewLC() + { + UT_CMRMBUtilsSettings* self = new( ELeave ) UT_CMRMBUtilsSettings(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +void UT_CMRMBUtilsSettings::ConstructL() + { + CEUnitTestSuiteClass::ConstructL(); + } + +// - Test methods ----------------------------------------------------------- + +void UT_CMRMBUtilsSettings::SetupL( ) + { + iMailClient = CFSMailClient::NewL(); + iSettings = CMRMBUtilsSettings::NewL( *iMailClient ); + iCenRep = CRepository::NewL( KCRUidMRDefaultCMailMRMailbox ); + + ResetcenRep(); + } + +void UT_CMRMBUtilsSettings::SetupWithMailboxesL() + { + SetupL(); + + TFSMailMsgId msgId; + iMailClient->ListMailBoxes( msgId, iMailboxes ); + } + +void UT_CMRMBUtilsSettings::ResetcenRep() + { + iCenRep->Set( KMRUIS60DefMailbox, KCenRepInitValue ); + iCenRep->Set( KMRUICMailMailboxUID, KCenRepInitValue ); + iCenRep->Set( KMRUICMailMailboxID, KCenRepInitValue ); + } + +void UT_CMRMBUtilsSettings::Teardown() + { + ResetcenRep(); + + iMailboxes.ResetAndDestroy(); + iMailClient->Close(); + + if ( iCenRep ) + { + delete iCenRep; + iCenRep = NULL; + } + + if ( iSettings ) + { + delete iSettings; + iSettings = NULL; + } + } + +void UT_CMRMBUtilsSettings::T_SetDefaultMailboxSettingL() + { + TInt mailboxCount( iMailboxes.Count() ); + + EUNIT_ASSERT_DESC( + iMailboxes.Count(), + "No any mailboxes defined in the system" ); + + for (TInt i(0); i < mailboxCount; ++i ) + { + CFSMailBox* mailbox( iMailboxes[i] ); + TFSMailMsgId mailboxId( mailbox->GetId() ); + + TBuf crcBuffer; + crcBuffer.AppendNum( mailboxId.PluginId().iUid ); + crcBuffer.AppendNum( mailboxId.Id() ); + + TUint32 cmailMailboxCrc( 0 ); + Mem::Crc32( cmailMailboxCrc, + crcBuffer.Ptr(), + crcBuffer.Size() ); + + iSettings->SetDefaultMailboxSettingL( cmailMailboxCrc ); + + TInt cenRepValue( KCenRepInitValue ); + TInt err = iCenRep->Get( KMRUIS60DefMailbox, cenRepValue ); + + EUNIT_ASSERT_DESC( + KErrNone == err, + "Error reading cenrep "); + + EUNIT_ASSERT_EQUALS_DESC( + cenRepValue, + cmailMailboxCrc, + "KMRUIS60DefMailbox mismatch" ); + + cenRepValue = KCenRepInitValue; + err = iCenRep->Get( KMRUICMailMailboxUID, cenRepValue ); + + EUNIT_ASSERT_DESC( + KErrNone == err, + "Error reading cenrep "); + + EUNIT_ASSERT_EQUALS_DESC( + cenRepValue, + mailboxId.PluginId().iUid, + "KMRUICMailMailboxUID mismatch" ); + + cenRepValue = KCenRepInitValue; + err = iCenRep->Get( KMRUICMailMailboxID, cenRepValue ); + + EUNIT_ASSERT_DESC( + KErrNone == err, + "Error reading cenrep "); + + EUNIT_ASSERT_EQUALS_DESC( + cenRepValue, + mailboxId.Id(), + "KMRUICMailMailboxID mismatch" ); + } + } + +void UT_CMRMBUtilsSettings::T_GetDefaultMailboxSettingsL() + { + TInt mailboxCount( iMailboxes.Count() ); + + EUNIT_ASSERT_DESC( + iMailboxes.Count(), + "No any mailboxes defined in the system" ); + + for (TInt i(0); i < mailboxCount; ++i ) + { + CFSMailBox* mailbox( iMailboxes[i] ); + TFSMailMsgId mailboxId( mailbox->GetId() ); + + TBuf crcBuffer; + crcBuffer.AppendNum( mailboxId.PluginId().iUid ); + crcBuffer.AppendNum( mailboxId.Id() ); + + TUint32 cmailMailboxCrc( 0 ); + Mem::Crc32( cmailMailboxCrc, + crcBuffer.Ptr(), + crcBuffer.Size() ); + + TInt S60mailboxId( cmailMailboxCrc ); + TInt cmailMailboxUID( mailboxId.PluginId().iUid ); + TInt cmailMailboxId( mailboxId.Id() ); + + iCenRep->Set( KMRUIS60DefMailbox, S60mailboxId ); + iCenRep->Set( KMRUICMailMailboxUID, cmailMailboxUID ); + iCenRep->Set( KMRUICMailMailboxID, cmailMailboxId ); + + S60mailboxId = KCenRepInitValue; + iSettings->GetDefaultMailboxSettingsL( S60mailboxId ); + + EUNIT_ASSERT_EQUALS_DESC( + S60mailboxId, + cmailMailboxCrc, + "GetDefaultMailboxSettingsL mismatch" ); + } + } + +void UT_CMRMBUtilsSettings::T_CenRepSetDefaultMailboxSettingL() + { + iSettings->SetDefaultCMailMRMailBoxL( + KDummyCenRepValue, + TUid::Uid( KDummyCenRepValue ), + KDummyCenRepValue ); + + TInt cenRepValue( KCenRepInitValue ); + TInt err = iCenRep->Get( KMRUIS60DefMailbox, cenRepValue ); + + EUNIT_ASSERT_DESC( + KErrNone == err, + "Error reading cenrep "); + + EUNIT_ASSERT_EQUALS_DESC( + cenRepValue, + KDummyCenRepValue, + "KMRUIS60DefMailbox mismatch" ); + + cenRepValue = KCenRepInitValue; + err = iCenRep->Get( KMRUICMailMailboxUID, cenRepValue ); + + EUNIT_ASSERT_DESC( + KErrNone == err, + "Error reading cenrep "); + + EUNIT_ASSERT_EQUALS_DESC( + cenRepValue, + KDummyCenRepValue, + "KMRUICMailMailboxUID mismatch" ); + + cenRepValue = KCenRepInitValue; + err = iCenRep->Get( KMRUICMailMailboxID, cenRepValue ); + + EUNIT_ASSERT_DESC( + KErrNone == err, + "Error reading cenrep "); + + EUNIT_ASSERT_EQUALS_DESC( + cenRepValue, + KDummyCenRepValue, + "KMRUICMailMailboxID mismatch" ); + } + +void UT_CMRMBUtilsSettings::T_CenRepGetDefaultMailboxSettingsL() + { + iCenRep->Set( KMRUIS60DefMailbox, KDummyCenRepValue ); + iCenRep->Set( KMRUICMailMailboxUID, KDummyCenRepValue ); + iCenRep->Set( KMRUICMailMailboxID, KDummyCenRepValue ); + + TInt defaultBox( KCenRepInitValue ); + TUid mailboxPluginUID = TUid::Uid( KCenRepInitValue ); + TInt mailboxId = KCenRepInitValue; + + iSettings->GetDefaultCMailMRMailBoxL( + defaultBox, + mailboxPluginUID, + mailboxId ); + + EUNIT_ASSERT_EQUALS_DESC( + defaultBox, + KDummyCenRepValue, + "KMRUIS60DefMailbox mismatch" ); + + EUNIT_ASSERT_EQUALS_DESC( + mailboxPluginUID.iUid, + KDummyCenRepValue, + "KMRUICMailMailboxUID mismatch" ); + + EUNIT_ASSERT_EQUALS_DESC( + mailboxId, + KDummyCenRepValue, + "KMRUICMailMailboxID mismatch" ); + } + +// - EUnit test table ------------------------------------------------------- + +EUNIT_BEGIN_TEST_TABLE( + UT_CMRMBUtilsSettings, + "Unit test: mrmbutilsextension", + "UNIT" ) + +EUNIT_TEST( + "Testing setting default mailbox", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupWithMailboxesL, T_SetDefaultMailboxSettingL, Teardown) + +EUNIT_TEST( + "Testing getting default mailbox", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupWithMailboxesL, T_GetDefaultMailboxSettingsL, Teardown) + +EUNIT_TEST( + "Testing setting default mailbox to cenrep", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupL, T_CenRepSetDefaultMailboxSettingL, Teardown) + +EUNIT_TEST( + "Testing getting default mailbox from cenrep", + "CMRMbUtilsExtensionImpl", + "NewL", + "FUNCTIONALITY", + SetupL, T_CenRepGetDefaultMailboxSettingsL, Teardown) + +EUNIT_END_TEST_TABLE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/bwins/ESMRPolicyu.def --- a/meetingrequest/mrpolicy/bwins/ESMRPolicyu.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/bwins/ESMRPolicyu.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,19 +1,28 @@ EXPORTS - ?NewL@CESMRPolicy@@SAPAV1@AAVRResourceFile@@AAVTResourceReader@@@Z @ 1 NONAME ; class CESMRPolicy * CESMRPolicy::NewL(class RResourceFile &, class TResourceReader &) - ?IsRoleIncluded@CESMRPolicy@@QBEHW4TESMRRole@@@Z @ 2 NONAME ; int CESMRPolicy::IsRoleIncluded(enum TESMRRole) const - ??1CESMRPolicyManager@@UAE@XZ @ 3 NONAME ; CESMRPolicyManager::~CESMRPolicyManager(void) - ?ReadPolicyFromResourceL@CESMRPolicyManager@@QAEXABVTDesC16@@H@Z @ 4 NONAME ; void CESMRPolicyManager::ReadPolicyFromResourceL(class TDesC16 const &, int) - ?EventType@CESMRPolicy@@QBE?AW4TESMRCalendarEventType@@XZ @ 5 NONAME ; enum TESMRCalendarEventType CESMRPolicy::EventType(void) const - ?ResolvePolicyL@CESMRPolicyManager@@QAEXABVTESMRScenarioData@@AAVMESMRCalEntry@@PAVMESMRPolicyChecker@@@Z @ 6 NONAME ; void CESMRPolicyManager::ResolvePolicyL(class TESMRScenarioData const &, class MESMRCalEntry &, class MESMRPolicyChecker *) - ?IsFieldIncluded@CESMRPolicy@@QBEHW4TESMREntryFieldId@@@Z @ 7 NONAME ; int CESMRPolicy::IsFieldIncluded(enum TESMREntryFieldId) const - ?FieldL@CESMRPolicy@@QBEABVTESMREntryField@@W4TESMREntryFieldId@@@Z @ 8 NONAME ; class TESMREntryField const & CESMRPolicy::FieldL(enum TESMREntryFieldId) const - ?PushPolicyL@CESMRPolicyManager@@QAEXXZ @ 9 NONAME ; void CESMRPolicyManager::PushPolicyL(void) - ?PopPolicy@CESMRPolicyManager@@QAEPAVCESMRPolicy@@XZ @ 10 NONAME ; class CESMRPolicy * CESMRPolicyManager::PopPolicy(void) - ?ExtensionUid@CESMRPolicyManager@@SA?AVTUid@@XZ @ 11 NONAME ; class TUid CESMRPolicyManager::ExtensionUid(void) - ?NewL@CESMRPolicyManager@@SAPAV1@XZ @ 12 NONAME ; class CESMRPolicyManager * CESMRPolicyManager::NewL(void) - ??1CESMRPolicy@@UAE@XZ @ 13 NONAME ; CESMRPolicy::~CESMRPolicy(void) - ?IsAdditionalCommand@CESMRPolicy@@QBEHH@Z @ 14 NONAME ; int CESMRPolicy::IsAdditionalCommand(int) const - ?IsDefaultCommand@CESMRPolicy@@QBEHH@Z @ 15 NONAME ; int CESMRPolicy::IsDefaultCommand(int) const - ?ReadFromResourceL@CESMRPolicy@@QAEXAAVRResourceFile@@AAVTResourceReader@@@Z @ 16 NONAME ; void CESMRPolicy::ReadFromResourceL(class RResourceFile &, class TResourceReader &) - ?NewL@CESMRPolicy@@SAPAV1@XZ @ 17 NONAME ; class CESMRPolicy * CESMRPolicy::NewL(void) + ?Reset@CMRPolicyResourceIterator@@QAEXXZ @ 1 NONAME ; void CMRPolicyResourceIterator::Reset(void) + ?PopPolicy@CESMRPolicyManager@@QAEPAVCESMRPolicy@@XZ @ 2 NONAME ; class CESMRPolicy * CESMRPolicyManager::PopPolicy(void) + ?IsDefaultCommand@CESMRPolicy@@QBEHH@Z @ 3 NONAME ; int CESMRPolicy::IsDefaultCommand(int) const + ?ViewMode@CESMRPolicy@@QBE?AW4TESMRViewMode@@XZ @ 4 NONAME ; enum TESMRViewMode CESMRPolicy::ViewMode(void) const + ?Fields@CESMRPolicy@@QBEABV?$RArray@VTESMREntryField@@@@XZ @ 5 NONAME ; class RArray const & CESMRPolicy::Fields(void) const + ??1CESMRPolicyManager@@UAE@XZ @ 6 NONAME ; CESMRPolicyManager::~CESMRPolicyManager(void) + ?NewL@CESMRPolicy@@SAPAV1@AAVRResourceFile@@AAVTResourceReader@@@Z @ 7 NONAME ; class CESMRPolicy * CESMRPolicy::NewL(class RResourceFile &, class TResourceReader &) + ?NewL@CESMRPolicyManager@@SAPAV1@XZ @ 8 NONAME ; class CESMRPolicyManager * CESMRPolicyManager::NewL(void) + ?IsRoleIncluded@CESMRPolicy@@QBEHW4TESMRRole@@@Z @ 9 NONAME ; int CESMRPolicy::IsRoleIncluded(enum TESMRRole) const + ??1CESMRPolicy@@UAE@XZ @ 10 NONAME ; CESMRPolicy::~CESMRPolicy(void) + ?IsAdditionalCommand@CESMRPolicy@@QBEHH@Z @ 11 NONAME ; int CESMRPolicy::IsAdditionalCommand(int) const + ?NextPolicyLC@CMRPolicyResourceIterator@@QAEPAVCESMRPolicy@@XZ @ 12 NONAME ; class CESMRPolicy * CMRPolicyResourceIterator::NextPolicyLC(void) + ?HasNext@CMRPolicyResourceIterator@@QBEHXZ @ 13 NONAME ; int CMRPolicyResourceIterator::HasNext(void) const + ?PushPolicyL@CESMRPolicyManager@@QAEXXZ @ 14 NONAME ; void CESMRPolicyManager::PushPolicyL(void) + ?NewL@CESMRPolicy@@SAPAV1@XZ @ 15 NONAME ; class CESMRPolicy * CESMRPolicy::NewL(void) + ?CurrentPolicy@CESMRPolicyManager@@QAEAAVCESMRPolicy@@XZ @ 16 NONAME ; class CESMRPolicy & CESMRPolicyManager::CurrentPolicy(void) + ?ResolvePolicyL@CESMRPolicyManager@@QAEXABVTESMRScenarioData@@AAVMESMRCalEntry@@PAVMMRPolicyResolver@@@Z @ 17 NONAME ; void CESMRPolicyManager::ResolvePolicyL(class TESMRScenarioData const &, class MESMRCalEntry &, class MMRPolicyResolver *) + ?FieldL@CESMRPolicy@@QBEABVTESMREntryField@@W4TESMREntryFieldId@@@Z @ 18 NONAME ; class TESMREntryField const & CESMRPolicy::FieldL(enum TESMREntryFieldId) const + ?ReadFromResourceL@CESMRPolicy@@QAEXAAVRResourceFile@@AAVTResourceReader@@@Z @ 19 NONAME ; void CESMRPolicy::ReadFromResourceL(class RResourceFile &, class TResourceReader &) + ?IsFieldIncluded@CESMRPolicy@@QBEHW4TESMREntryFieldId@@@Z @ 20 NONAME ; int CESMRPolicy::IsFieldIncluded(enum TESMREntryFieldId) const + ?NextPolicyL@CMRPolicyResourceIterator@@QAEPAVCESMRPolicy@@XZ @ 21 NONAME ; class CESMRPolicy * CMRPolicyResourceIterator::NextPolicyL(void) + ?AllowedApp@CESMRPolicy@@QBE?AW4TESMRUsingApp@@XZ @ 22 NONAME ; enum TESMRUsingApp CESMRPolicy::AllowedApp(void) const + ??1CMRPolicyResourceIterator@@UAE@XZ @ 23 NONAME ; CMRPolicyResourceIterator::~CMRPolicyResourceIterator(void) + ?EventType@CESMRPolicy@@QBE?AW4TESMRCalendarEventType@@XZ @ 24 NONAME ; enum TESMRCalendarEventType CESMRPolicy::EventType(void) const + ?PolicyId@CESMRPolicy@@QBE?AW4TESMRPolicyID@@XZ @ 25 NONAME ; enum TESMRPolicyID CESMRPolicy::PolicyId(void) const + ?NewL@CMRPolicyResourceIterator@@SAPAV1@ABVTDesC16@@H@Z @ 26 NONAME ; class CMRPolicyResourceIterator * CMRPolicyResourceIterator::NewL(class TDesC16 const &, int) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrattendeeviewalldayeventfromcalendarpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrattendeeviewalldayeventfromcalendarpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from mail policy -* -*/ - -#ifndef ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY -#define ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_allday_event_from_calendar -// ES MR Policy forviewing MR from Calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_attd_view_allday_event_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyAttendeeViewAllDayEventMRFromCal; - policy_mode = EESMRViewAllDayMR; - role_flags = KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_attd_view_allday_event_from_calendar_fields; - default_commands = r_esmr_attd_view_allday_event_from_calendar_def_commands; - additional_commands = 0; // No additional commands - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_allday_event_from_calendar_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldResponseReadyArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldResponseArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOrganizer; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAllDayEvent; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttachments; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_allday_event_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdAcceptMR; }, - ESMR_ID { id = EESMRCmdTentativeMR; }, - ESMR_ID { id = EESMRCmdDeclineMR; }, - ESMR_ID { id = EESMRCmdEditLocal; }, - ESMR_ID { id = EESMRCmdReply; }, - ESMR_ID { id = EESMRCmdReplyAll; }, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdDeleteMR; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrattendeeviewalldayeventfromemailpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrattendeeviewalldayeventfromemailpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from mail policy -* -*/ - -#ifndef ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMMAILPOLICY -#define ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMMAILPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_allday_event_from_email -// ES MR Policy forviewing MR from Calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_attd_view_allday_event_from_email - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyAttendeeViewAllDayEventMRFromEmail; - policy_mode = EESMRViewAllDayMR; - role_flags = KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant; - allowed_app = KEESMRFlagAppEsEmail; - field_ids = r_esmr_attd_view_allday_event_from_email_fields; - default_commands = r_esmr_attd_view_allday_event_from_email_def_commands; - additional_commands = 0; // No additional commands - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_allday_event_from_email_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_email_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldResponseReadyArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldResponseArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOrganizer; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAllDayEvent; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttachments; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_allday_event_from_email_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_email_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdAcceptMR; }, - ESMR_ID { id = EESMRCmdTentativeMR; }, - ESMR_ID { id = EESMRCmdDeclineMR; }, - ESMR_ID { id = EESMRCmdRemoveFromCalendar; }, - ESMR_ID { id = EESMRCmdViewCalendar; }, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdReply; }, - ESMR_ID { id = EESMRCmdReplyAll; }, - ESMR_ID { id = EESMRCmdMailMarkUnread; }, - ESMR_ID { id = EESMRCmdMailDelete; }, - ESMR_ID { id = EESMRCmdMailForwardAsMessage; }, - ESMR_ID { id = EESMRCmdMailMoveMessage; }, - ESMR_ID { id = EESMRCmdMailCopyMessage; }, - ESMR_ID { id = EESMRCmdMailMessageDetails; }, - ESMR_ID { id = EESMRCmdDownloadManager; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EESMRCmdMailPreviousMessage; }, - ESMR_ID { id = EESMRCmdMailNextMessage; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMMAILPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrorganizerviewalldayeventfromcalendarpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrorganizerviewalldayeventfromcalendarpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from mail policy -* -*/ - -#ifndef ESMRSRV_VIEWALLDAYEVENTFROMCALENDARPOLICY -#define ESMRSRV_VIEWALLDAYEVENTFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_allday_event_from_calendar -// ES MR Policy forviewing MR from Calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_organizer_view_allday_event_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyOrganizerViewAllDayEventMRFromCal; - policy_mode = EESMRViewAllDayMR; - role_flags = KEESMRFlagOrganizer; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_organizer_view_allday_event_from_calendar_fields; - default_commands = r_esmr_organizer_view_allday_event_from_calendar_def_commands; - additional_commands = 0; // No additional commands - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_allday_event_from_calendar_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAllDayEvent; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_allday_event_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdEdit;}, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdViewTrack; }, - ESMR_ID { id = EESMRCmdDeleteMR;}, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp;}, - ESMR_ID { id = EAknCmdExit;} - }; - } - -#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrorganizerviewalldayeventfromemailpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrorganizerviewalldayeventfromemailpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from mail policy - * -*/ - -#ifndef ESMRSRV_VIEWALLDAYEVENTFROMMAILPOLICY -#define ESMRSRV_VIEWALLDAYEVENTFROMMAILPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_allday_event_from_email -// ES MR Policy forviewing MR from Calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_organizer_view_allday_event_from_email - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyOrganizerViewAllDayEventMRFromEmail; - policy_mode = EESMRViewAllDayMR; - role_flags = KEESMRFlagOrganizer; - allowed_app = KEESMRFlagAppEsEmail; - field_ids = r_esmr_organizer_view_allday_event_from_email_fields; - default_commands = r_esmr_organizer_view_allday_event_from_email_def_commands; - additional_commands = 0; // No additional commands - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_allday_event_from_email_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_email_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAllDayEvent; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_allday_event_from_email_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_email_def_commands - { - id_table = - { - ESMR_ID - { id = EESMRCmdViewCalendar; }, - ESMR_ID - {id = EESMRCmdForward;}, - ESMR_ID - {id = EESMRCmdPrint;}, - ESMR_ID - {id = EAknCmdHelp;}, - ESMR_ID - {id = EAknCmdExit;} - }; - } - -#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrpolicies.rss --- a/meetingrequest/mrpolicy/data/policies/esmrpolicies.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project esmrservices -* -*/ - - -NAME ESMR - -#include - -RESOURCE RSS_SIGNATURE { } - -// -#include "esmrservices.rh" -#include "esmrdef.h" -// -#include - -#include "esmrsrattendeeviewfrommailpolicy.rss" -#include "esmrsrattendeeviewfromcalendarpolicy.rss" -#include "esmrsrorganizerviewmrfromcalendar.rss" -#include "esmrsrorganizereditmrfromcalendar.rss" -#include "esmrsrforwardasmeetingrequestfrommail.rss" -#include "esmrsrforwardasmeetingrequestfromcalendar.rss" -#include "esmrsrattendeeeditmrfromcalendar.rss" -#include "esmrattendeeviewalldayeventfromcalendarpolicy.rss" -#include "esmrattendeeviewalldayeventfromemailpolicy.rss" -#include "esmrorganizerviewalldayeventfromcalendarpolicy.rss" -#include "esmrorganizerviewalldayeventfromemailpolicy.rss" -#include "esmrsrorganizerviewmrfromemail.rss" -#include "esmrtrackingviewpolicy.rss" - -// --------------------------------------------------------------------------- -// r_esmr_policies -// ES MR UI policies -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY_TABLE r_esmr_policies - { - policies = - { - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_from_mail; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_edit_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attendee_edit_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_forward_as_meeting_request_from_mail; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_forward_as_meeting_request_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_allday_event_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_allday_event_from_email; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_allday_event_from_calendar; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_allday_event_from_email; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_from_email; }, - ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_tracking_view; } - }; - } - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrattendeeeditmrfromcalendar.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrattendeeeditmrfromcalendar.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for editing MR from calendar -* -*/ - -#ifndef ESMRSRV_ATTENDEEEDITFROMCALENDARPOLICY -#define ESMRSRV_ATTENDEEEDITFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_attendee_edit_from_calendar -// ES MR Policy for editing MR from calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_attendee_edit_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyAttendeeEditMRFromCal; - policy_mode = EESMREditMR; - role_flags = KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant ; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_attendee_edit_from_calendar_fields; - default_commands = r_esmr_attendee_edit_from_calendar_def_commands; - additional_commands = 0; - } - -// --------------------------------------------------------------------------- -// r_esmr_attendee_edit_from_calendar_def_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attendee_edit_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAllDayEvent; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmOnOff; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmTime; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmDate; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_attendee_edit_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attendee_edit_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdSaveMR; }, - ESMR_ID { id = EESMRCmdDeleteMR; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EESMRCmdAddLocation; }, - ESMR_ID { id = EESMRCmdAssignFromMap; }, - ESMR_ID { id = EESMRCmdSearchFromContacts; }, - ESMR_ID { id = EESMRCmdPreviousLocations; }, - ESMR_ID { id = EESMRCmdLandmarks; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_ATTENDEEEDITFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrattendeeviewfromcalendarpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrattendeeviewfromcalendarpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from mail policy -* -*/ - -#ifndef ESMRSRV_ATTENDEEVIEWFROMCALENDARPOLICY -#define ESMRSRV_ATTENDEEVIEWFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_from_calendar -// ES MR Policy forviewing MR from Calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_attd_view_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyAttendeeViewMRFromCal; - policy_mode = EESMRViewMR; - role_flags = KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_attd_view_from_calendar_fields; - default_commands = r_esmr_attd_view_from_calendar_def_commands; - additional_commands = 0; // No additional commands - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_from_calendar_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldResponseReadyArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldResponseArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOrganizer; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttachments; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdAcceptMR; }, - ESMR_ID { id = EESMRCmdTentativeMR; }, - ESMR_ID { id = EESMRCmdDeclineMR; }, - ESMR_ID { id = EESMRCmdEditLocal; }, - ESMR_ID { id = EESMRCmdReply; }, - ESMR_ID { id = EESMRCmdReplyAll; }, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdDeleteMR; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_ATTENDEEVIEWFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrattendeeviewfrommailpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrattendeeviewfrommailpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from mail policy -* -*/ - -#ifndef ESMRSRV_ATTENDEEVIEWFROMMAILPOLICY -#define ESMRSRV_ATTENDEEVIEWFROMMAILPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_from_mail -// ES MR Policy forviewing MR from Email application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_attd_view_from_mail - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyReceiveMRFromEmail; - policy_mode = EESMRViewMR; - role_flags = KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant; - allowed_app = KEESMRFlagAppEsEmail; - field_ids = r_esmr_attd_view_mail_fields; - default_commands = r_esmr_attd_view_from_mail_def_commands; - additional_commands = 0; // No additional commands - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_mail_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_mail_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldResponseReadyArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldResponseArea; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOrganizer; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttachments; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_attd_view_from_mail_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_attd_view_from_mail_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdAcceptMR; }, - ESMR_ID { id = EESMRCmdTentativeMR; }, - ESMR_ID { id = EESMRCmdDeclineMR; }, - ESMR_ID { id = EESMRCmdRemoveFromCalendar; }, - ESMR_ID { id = EESMRCmdViewCalendar; }, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdReply; }, - ESMR_ID { id = EESMRCmdReplyAll; }, - ESMR_ID { id = EESMRCmdMailMarkUnread; }, - ESMR_ID { id = EESMRCmdMailDelete; }, - ESMR_ID { id = EESMRCmdClipboardCopy; }, - ESMR_ID { id = EESMRCmdMailForwardAsMessage; }, - ESMR_ID { id = EESMRCmdMailMoveMessage; }, - ESMR_ID { id = EESMRCmdMailCopyMessage; }, - ESMR_ID { id = EESMRCmdMailMessageDetails; }, - ESMR_ID { id = EESMRCmdDownloadManager; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EESMRCmdMailPreviousMessage; }, - ESMR_ID { id = EESMRCmdMailNextMessage; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_ATTENDEEVIEWFROMMAILPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrforwardasmeetingrequestfromcalendar.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrforwardasmeetingrequestfromcalendar.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for forwarding meeting request -* -*/ - -#ifndef ESMRSRV_FORWARDASMEETINGREQUESTFROMCALENDARPOLICY -#define ESMRSRV_FORWARDASMEETINGREQUESTFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_forward_as_meeting_request_from_calendar -// ES MR Policy for forwarding meeting request -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_forward_as_meeting_request_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyForwardAsMeetingRequestFromCal; - policy_mode = EESMRForwardMR; - role_flags = KEESMRFlagOrganizer | - KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_forward_as_meeting_request_from_calendar_fields; - default_commands = r_esmr_forward_as_meeting_request_from_calendar_def_commands; - additional_commands = 0; - } - -// --------------------------------------------------------------------------- -// r_esmr_forward_as_meeting_request_from_calendar_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttachments; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_forward_as_meeting_request_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdSendMR; }, - ESMR_ID { id = EESMRCmdAddOptAttendee; }, - ESMR_ID { id = EESMRCmdViewCalendar; }, -// ESMR_ID { id = EESMRCmdCopy; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_FORWARDASMEETINGREQUESTFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrforwardasmeetingrequestfrommail.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrforwardasmeetingrequestfrommail.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for forwarding meeting request -* -*/ - -#ifndef ESMRSRV_FORWARDASMEETINGREQUESTFROMMAILPOLICY -#define ESMRSRV_FORWARDASMEETINGREQUESTFROMMAILPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_forward_as_meeting_request_from_mail -// ES MR Policy for forwarding meeting request -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_forward_as_meeting_request_from_mail - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyForwardAsMeetingRequestFromMail; - policy_mode = EESMRForwardMR; - role_flags = KEESMRFlagOrganizer | - KEESMRFlagRequiredAttendee | - KEESMRFlagOptionalAttendee | - KEESMRFlagNonParticipant; - allowed_app = KEESMRFlagAppEsEmail; - field_ids = r_esmr_forward_as_meeting_request_from_mail_fields; - default_commands = r_esmr_forward_as_meeting_request_from_mail_def_commands; - additional_commands = 0; - } - -// --------------------------------------------------------------------------- -// r_esmr_forward_as_meeting_request_from_mail_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_mail_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAttachments; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_forward_as_meeting_request_from_mail_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_mail_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdSendMR; }, - ESMR_ID { id = EESMRCmdAddOptAttendee; }, - ESMR_ID { id = EESMRCmdViewCalendar; }, -// ESMR_ID { id = EESMRCmdCopy; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_FORWARDASMEETINGREQUESTFROMMAILPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrorganizereditmrfromcalendar.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrorganizereditmrfromcalendar.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for editing MR from calendar -* -*/ - -#ifndef ESMRSRV_ORGANIZEREDITFROMCALENDARPOLICY -#define ESMRSRV_ORGANIZEREDITFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_organizer_edit_from_calendar -// ES MR Policy for editing MR from calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_organizer_edit_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyOrganizerEditMRFromCal; - policy_mode = EESMREditMR; - role_flags = KEESMRFlagOrganizer; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_organizer_edit_from_calendar_fields; - default_commands = r_esmr_organizer_edit_from_calendar_def_commands; - additional_commands = 0; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_edit_from_calendar_def_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_edit_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAllDayEvent; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmOnOff; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmTime; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarmDate; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeEdit; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_edit_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_edit_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdSendMR; }, - ESMR_ID { id = EESMRCmdSendMRUpdate; }, - ESMR_ID { id = EESMRCmdAddOptAttendee; }, - ESMR_ID { id = EESMRCmdSaveMR; }, - ESMR_ID { id = EESMRCmdDeleteMR; }, - ESMR_ID { id = EESMRCmdPriorityOptions; }, - ESMR_ID { id = EESMRCmdPriorityHigh; }, - ESMR_ID { id = EESMRCmdPriorityNormal; }, - ESMR_ID { id = EESMRCmdPriorityLow; }, - ESMR_ID { id = EESMRCmdViewTrack; }, -// ESMR_ID { id = EESMRCmdEditingOptions; }, -// ESMR_ID { id = EESMRCmdCopy; }, -// ESMR_ID { id = EESMRCmdCut; }, -// ESMR_ID { id = EESMRCmdPaste; }, -// ESMR_ID { id = EESMRCmdWritingLanguage; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EESMRCmdAddLocation; }, - ESMR_ID { id = EESMRCmdAssignFromMap; }, - ESMR_ID { id = EESMRCmdSearchFromContacts; }, - ESMR_ID { id = EESMRCmdPreviousLocations; }, - ESMR_ID { id = EESMRCmdLandmarks; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_ORGANIZEREDITFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrorganizerviewmrfromcalendar.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrorganizerviewmrfromcalendar.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for editing MR from calendar -* -*/ - -#ifndef ESMRSRV_ORGANIZERVIEWFROMCALENDARPOLICY -#define ESMRSRV_ORGANIZERVIEWFROMCALENDARPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_from_calendar -// ES MR Policy for viewing MR from calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_organizer_view_from_calendar - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyOrganizerViewMRFromCal; - policy_mode = EESMRViewMR; - role_flags = KEESMRFlagOrganizer; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_organizer_view_from_calendar_fields; - default_commands = r_esmr_organizer_view_from_calendar_def_commands; - additional_commands = 0; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_from_calendar_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_calendar_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_from_calendar_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_calendar_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdEdit;}, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdViewTrack; }, - ESMR_ID { id = EESMRCmdDeleteMR;}, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp;}, - ESMR_ID { id = EAknCmdExit;} - }; - } - -#endif // ESMRSRV_ORGANIZERVIEWFROMCALENDARPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrsrorganizerviewmrfromemail.rss --- a/meetingrequest/mrpolicy/data/policies/esmrsrorganizerviewmrfromemail.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for viewing MR from email -* -*/ - -#ifndef ESMRSRV_ORGANIZERVIEWFROMEMAILPOLICY -#define ESMRSRV_ORGANIZERVIEWFROMEMAILPOLICY - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_from_email -// ES MR Policy for viewing MR from calendar application -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_POLICY r_esmr_organizer_view_from_email - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyOrganizerViewMREmail; - policy_mode = EESMRViewMR; - role_flags = KEESMRFlagOrganizer; - allowed_app = KEESMRFlagAppEsEmail; - field_ids = r_esmr_organizer_view_from_email_fields; - default_commands = r_esmr_organizer_view_from_email_def_commands; - additional_commands = 0; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_from_email_fields -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_email_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptAttendee; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDetailedSubject; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldMeetingTime; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStartDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldStopDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldLocation; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldAlarm; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrence; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldRecurrenceDate; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldSync; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldDescription; - field_type = EESMRFieldTypeDefault; - field_mode = EESMRFieldModeView; - } - }; - } - -// --------------------------------------------------------------------------- -// r_esmr_organizer_view_from_email_def_commands -// -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_email_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdViewCalendar; }, - ESMR_ID { id = EESMRCmdForward; }, - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp;}, - ESMR_ID { id = EAknCmdExit;} - }; - } - -#endif // ESMRSRV_ORGANIZERVIEWFROMEMAILPOLICY - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/data/policies/esmrtrackingviewpolicy.rss --- a/meetingrequest/mrpolicy/data/policies/esmrtrackingviewpolicy.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for tracking MR from calendar -* -*/ - - - -#ifndef ESMRSRV_TRACKINGVIEWPOLICY_FROM_CALENDAR -#define ESMRSRV_TRACKINGVIEWPOLICY_FROM_CALENDAR - -// --------------------------------------------------------------------------- -// r_esmr_tracking_view_from_calendar -// ES Tracking view for MR from calendar application -// --------------------------------------------------------------------------- -// - -RESOURCE ESMR_POLICY r_esmr_tracking_view - { - event_type = EESMREventTypeAppt; - policy_id = EESMRPolicyTrackingView; - policy_mode = EESMRTrackingViewMR; - role_flags = KEESMRFlagOrganizer; - allowed_app = KEESMRFlagAppEsCalendar; - field_ids = r_esmr_tracking_view_fields; - default_commands = r_mrui_tracking_view_def_commands; - additional_commands = 0; - } - - - -// --------------------------------------------------------------------------- -// r_esmr_tracking_view_fields -// Default field set for tracking view -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_esmr_tracking_view_fields - { - id_table = - { - ESMR_FIELD - { - field_id = EESMRFieldReqTrack; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRTrackStatus; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - }, - ESMR_FIELD - { - field_id = EESMRFieldOptTrack; - field_type = EESMRFieldTypeAdditional; - field_mode = EESMRFieldModeView; - } - // Add other fields here - }; - } - -// --------------------------------------------------------------------------- -// r_mrui_tracking_view_def_commands -// Default options menu items -// --------------------------------------------------------------------------- -// -RESOURCE ESMR_ID_TABLE r_mrui_tracking_view_def_commands - { - id_table = - { - ESMR_ID { id = EESMRCmdPrint; }, - ESMR_ID { id = EAknCmdHelp; }, - ESMR_ID { id = EAknCmdExit; } - }; - } - -#endif // ESMRSRV_TRACKINGVIEWPOLICY_FROM_CALENDAR - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/eabi/ESMRPolicyu.def --- a/meetingrequest/mrpolicy/eabi/ESMRPolicyu.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/eabi/ESMRPolicyu.def Wed Mar 31 21:08:33 2010 +0300 @@ -5,18 +5,31 @@ _ZN11CESMRPolicyD1Ev @ 4 NONAME _ZN11CESMRPolicyD2Ev @ 5 NONAME _ZN18CESMRPolicyManager11PushPolicyLEv @ 6 NONAME - _ZN18CESMRPolicyManager12ExtensionUidEv @ 7 NONAME - _ZN18CESMRPolicyManager14ResolvePolicyLERK17TESMRScenarioDataR13MESMRCalEntryP18MESMRPolicyChecker @ 8 NONAME - _ZN18CESMRPolicyManager23ReadPolicyFromResourceLERK7TDesC16i @ 9 NONAME - _ZN18CESMRPolicyManager4NewLEv @ 10 NONAME - _ZN18CESMRPolicyManager9PopPolicyEv @ 11 NONAME - _ZN18CESMRPolicyManagerD0Ev @ 12 NONAME - _ZN18CESMRPolicyManagerD1Ev @ 13 NONAME - _ZN18CESMRPolicyManagerD2Ev @ 14 NONAME - _ZNK11CESMRPolicy14IsRoleIncludedE9TESMRRole @ 15 NONAME - _ZNK11CESMRPolicy15IsFieldIncludedE17TESMREntryFieldId @ 16 NONAME - _ZNK11CESMRPolicy16IsDefaultCommandEi @ 17 NONAME - _ZNK11CESMRPolicy19IsAdditionalCommandEi @ 18 NONAME - _ZNK11CESMRPolicy6FieldLE17TESMREntryFieldId @ 19 NONAME - _ZNK11CESMRPolicy9EventTypeEv @ 20 NONAME + _ZN18CESMRPolicyManager13CurrentPolicyEv @ 7 NONAME + _ZN18CESMRPolicyManager14ResolvePolicyLERK17TESMRScenarioDataR13MESMRCalEntryP17MMRPolicyResolver @ 8 NONAME + _ZN18CESMRPolicyManager4NewLEv @ 9 NONAME + _ZN18CESMRPolicyManager9PopPolicyEv @ 10 NONAME + _ZN18CESMRPolicyManagerD0Ev @ 11 NONAME + _ZN18CESMRPolicyManagerD1Ev @ 12 NONAME + _ZN18CESMRPolicyManagerD2Ev @ 13 NONAME + _ZN25CMRPolicyResourceIterator11NextPolicyLEv @ 14 NONAME + _ZN25CMRPolicyResourceIterator12NextPolicyLCEv @ 15 NONAME + _ZN25CMRPolicyResourceIterator4NewLERK7TDesC16i @ 16 NONAME + _ZN25CMRPolicyResourceIterator5ResetEv @ 17 NONAME + _ZN25CMRPolicyResourceIteratorD0Ev @ 18 NONAME + _ZN25CMRPolicyResourceIteratorD1Ev @ 19 NONAME + _ZN25CMRPolicyResourceIteratorD2Ev @ 20 NONAME + _ZNK11CESMRPolicy10AllowedAppEv @ 21 NONAME + _ZNK11CESMRPolicy14IsRoleIncludedE9TESMRRole @ 22 NONAME + _ZNK11CESMRPolicy15IsFieldIncludedE17TESMREntryFieldId @ 23 NONAME + _ZNK11CESMRPolicy16IsDefaultCommandEi @ 24 NONAME + _ZNK11CESMRPolicy19IsAdditionalCommandEi @ 25 NONAME + _ZNK11CESMRPolicy6FieldLE17TESMREntryFieldId @ 26 NONAME + _ZNK11CESMRPolicy6FieldsEv @ 27 NONAME + _ZNK11CESMRPolicy8PolicyIdEv @ 28 NONAME + _ZNK11CESMRPolicy8ViewModeEv @ 29 NONAME + _ZNK11CESMRPolicy9EventTypeEv @ 30 NONAME + _ZNK25CMRPolicyResourceIterator7HasNextEv @ 31 NONAME + _ZThn4_N18CESMRPolicyManagerD0Ev @ 32 NONAME + _ZThn4_N18CESMRPolicyManagerD1Ev @ 33 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/group/bld.inf --- a/meetingrequest/mrpolicy/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -23,12 +23,13 @@ PRJ_EXPORTS ../inc/cesmrpolicy.h |../../inc/cesmrpolicy.h -../inc/cesmrpolicy.inl |../../inc/cesmrpolicy.inl ../inc/cesmrpolicymanager.h |../../inc/cesmrpolicymanager.h -../inc/cesmrpolicymanager.inl |../../inc/cesmrpolicymanager.inl -//../inc/mesmrpolicychecker.h |../../inc/mesmrpolicychecker.h +../inc/mmrpolicyprovider.h |../../inc/mmrpolicyprovider.h PRJ_MMPFILES esmrpolicy.mmp +../mrentryresolver/group/mrentryresolver.mmp +../mrcalentryresolver/group/mrcalentryresolver.mmp + // EOF \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/group/esmrpolicy.mmp --- a/meetingrequest/mrpolicy/group/esmrpolicy.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/group/esmrpolicy.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,29 +29,18 @@ VENDORID VID_DEFAULT DEFFILE ESMRPolicy.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrpolicy.cpp SOURCE cesmrpolicymanager.cpp -SOURCE cesmrpolicychecker.cpp -SOURCE cesmrpolicyextensionmanager.cpp +SOURCE cmrpolicyresourceiterator.cpp USERINCLUDE . USERINCLUDE ../inc -USERINCLUDE ../data USERINCLUDE ../../inc USERINCLUDE ../../../inc APP_LAYER_SYSTEMINCLUDE -START RESOURCE ../data/policies/esmrpolicies.rss -HEADER -TARGET esmrpolicies -TARGETPATH RESOURCE_FILES_DIR -END - // ESMR libraries LIBRARY esmrcommon.lib LIBRARY esmrdb.lib @@ -61,16 +49,10 @@ LIBRARY bafl.lib LIBRARY cone.lib LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY estor.lib LIBRARY ecom.lib -LIBRARY calinterimapi.lib -LIBRARY caleninterimutils2.lib -LIBRARY charconv.lib -LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cesmrpolicy.h --- a/meetingrequest/mrpolicy/inc/cesmrpolicy.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/inc/cesmrpolicy.h Wed Mar 31 21:08:33 2010 +0300 @@ -21,7 +21,6 @@ #include #include -// #include "esmrdef.h" class RResourceFile; @@ -134,26 +133,26 @@ * @return policy id. * @see TESMRPolicyID */ - inline TESMRPolicyID PolicyId() const; + IMPORT_C TESMRPolicyID PolicyId() const; /** * Fetches policy view mode. * @return policy view mode. * @see TESMRViewMode */ - inline TESMRViewMode ViewMode() const; + IMPORT_C TESMRViewMode ViewMode() const; /** * Fetches default fields. * @return Default fields */ - inline const RArray& Fields() const; + IMPORT_C const RArray& Fields() const; /** * Fetches the allowed applicatio for this policy * @return TESMRUsingApp Parent application */ - inline TESMRUsingApp AllowedApp() const; + IMPORT_C TESMRUsingApp AllowedApp() const; private: // Implementation CESMRPolicy(); @@ -180,9 +179,6 @@ RArray iAdditionalCommands; }; -#include "cesmrpolicy.inl" -// - #endif // CESMRPOLICY_H // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cesmrpolicy.inl --- a/meetingrequest/mrpolicy/inc/cesmrpolicy.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR policy inline methods -* -*/ - - -// ----------------------------------------------------------------------------- -// CESMRPolicy::PolicyId -// ----------------------------------------------------------------------------- -// -inline TESMRPolicyID CESMRPolicy::PolicyId() const - { - return iPolicyId; - } - -// ----------------------------------------------------------------------------- -// CESMRPolicy::ViewMode -// ----------------------------------------------------------------------------- -// -inline TESMRViewMode CESMRPolicy::ViewMode() const - { - return iViewMode; - } - -// ----------------------------------------------------------------------------- -// CESMRPolicy::Fields -// ----------------------------------------------------------------------------- -// -inline const RArray& CESMRPolicy::Fields() const - { - return iMRFields; - } - -// ----------------------------------------------------------------------------- -// CESMRPolicy::AllowedApp -// ----------------------------------------------------------------------------- -// -inline TESMRUsingApp CESMRPolicy::AllowedApp() const - { - return iAllowedApp; - } - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cesmrpolicychecker.h --- a/meetingrequest/mrpolicy/inc/cesmrpolicychecker.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR service policy checker definition -* -*/ - - -#ifndef CESMRPOLICYCHECKER_H -#define CESMRPOLICYCHECKER_H - -#include -// -#include "mesmrpolicychecker.h" -// - -/** - * CESMRPolicyChecker is responsible for matching policy - * against scenario data. This utility class encapsulates - * matching policies with TESMRScenarioData - * - * @lib esmrpolicy.lib - */ -NONSHARABLE_CLASS(CESMRPolicyChecker) : - public CBase, - public MESMRPolicyChecker - { -public: // Construction and destruction - /** - * Two-phased constructor. Creates and initializes - * CESMRPolicyChecker object. - * @return Pointer to esmr policy checker object. - */ - static CESMRPolicyChecker* NewL(); - - /** - * C++ Destructor. - */ - ~CESMRPolicyChecker(); - -public: // Interface - /** - * Tests, whether policy matches against scenario data. - * @param aPolicy Reference to policy to be tested. - * @param aScenData Reference to scenario data. - */ - TBool MatchesL( - const CESMRPolicy& aPolicy, - const TESMRScenarioData& aScenData ); - -private: // Implementation - CESMRPolicyChecker(); - void ConstructL(); - }; - -#endif // CESMRPOLICYCHECKER_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cesmrpolicyextensionmanager.h --- a/meetingrequest/mrpolicy/inc/cesmrpolicyextensionmanager.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Manager class for policy extensions - -* -*/ - - -#ifndef CESMRPOLICYEXTENSIONMANAGER_H - -#define CESMRPOLICYEXTENSIONMANAGER_H - - - -#include - -#include // RResourceFile - - - -class CCoeEnv; - - - -/** - - * Utility class for holding extension resource info - - */ - -NONSHARABLE_CLASS( CESMRExtensionResourceFile ): public CBase - - { - - public: - - static CESMRExtensionResourceFile* NewL( const TDesC& aPath, RFs& aFs ); - - ~CESMRExtensionResourceFile(); - - - - public: // interface - - TInt ResId() const; - - RResourceFile& ResFile(); - - - - private: // implementation - - CESMRExtensionResourceFile(RFs& aFs); - - void ConstructL( const TDesC& aPath ); - - - - private: // data - - RFs& iFsSession; - - RResourceFile iResFile; - - TInt iResId; - - }; - - - -/** - - * Utility class to manage policy extension's information - - */ - -NONSHARABLE_CLASS( CESMRPolicyExtensionManager ): public CBase - - { - - public: // C'tor and d'tor - - static CESMRPolicyExtensionManager* NewL( CCoeEnv& aCoeEnv ); - - ~CESMRPolicyExtensionManager(); - - - - public: // Interface - - /** - - * Resolves all extension policy files and opens those - - * files. Reads the id of the policy. - - */ - - void ReadResourcesFromExtensionsL(); - - /** - - * If resource with aResourceId not found, return NULL. - - * ReadResourcesFromExtensionsL() should have been called before - - * this. Otherwise resources are not loaded. - - */ - - HBufC8* ReadBufferL( TInt aResourceId ); - - - - CESMRExtensionResourceFile* ExtensionResourceFile( TInt aResourceId ); - - - - private: // implementation - - CESMRPolicyExtensionManager( CCoeEnv& aCoeEnv ); - - void ConstructL(); - - - - private: // data - - // Ref: - - CCoeEnv& iCoeEnv; - - // Own: array for the opened resource files - - RPointerArray iResourceFiles; - - }; - - - -#endif // CESMRPOLICYEXTENSIONMANAGER_H - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cesmrpolicymanager.h --- a/meetingrequest/mrpolicy/inc/cesmrpolicymanager.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/inc/cesmrpolicymanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -20,18 +20,19 @@ #define CESMRPOLICYMANAGER_H #include -// + #include "esmrutilsapiext.h" -#include #include "esmrdef.h" #include "tesmrscenariodata.h" +#include "mmrpolicyprovider.h" + +#include + class CESMRPolicy; class MESMRCalEntry; -class MESMRPolicyChecker; -class CESMRPolicyChecker; -class CESMRPolicyExtensionManager; -class CCoeEnv; +class MMRPolicyResolver; +class CMRPolicyResolver; /** * CESMRPolicyManager defines ESMR policymanager. @@ -43,8 +44,8 @@ * @see CESMRPolicy * @lib esmrpolicy.lib */ -NONSHARABLE_CLASS(CESMRPolicyManager) : - public CBase +NONSHARABLE_CLASS(CESMRPolicyManager) : public CBase, + public MMRPolicyProvider { public: // Construction and destruction /** @@ -65,33 +66,19 @@ * Fetches current policy object. * @return Current policy object */ - inline CESMRPolicy& CurrentPolicy(); - - /** - * Fetches the extension UID for ES MR policy manager - * @return Uid of extension - */ - IMPORT_C static TUid ExtensionUid(); + IMPORT_C CESMRPolicy& CurrentPolicy(); /** * Resolves policy to be used. * @param aScenarioData Scenario Data for resolving correct policy * @param aESMREntry Reference to ES MR Entry. - * @param aPolicyChecker to be used. If NULL, default checker is used + * @param aCustomResolver to be used. If NULL, resolver is determined by + * policy manager */ IMPORT_C void ResolvePolicyL( const TESMRScenarioData& aScenarioData, MESMRCalEntry& aESMREntry, - MESMRPolicyChecker* aPolicyChecker ); - - /** - * Reads policy from resource file. Policies are appended - * @param aPolicyFile Policy resource filename. - * @param aPolicyArrayResourceId Policy array resource id - */ - IMPORT_C void ReadPolicyFromResourceL( - const TDesC& aPolicyFile, - TInt aPolicyArrayResourceId ); + MMRPolicyResolver* aCustomResolver = NULL ); /** * Adds the current policy on stack for preserving it if a new policy @@ -104,54 +91,34 @@ * @return the policy from stack or NULL if stack is empty. */ IMPORT_C CESMRPolicy* PopPolicy(); + +public: // from MMRPolicyProvider + + const CESMRPolicy& CurrentPolicy() const; private: // Implementation CESMRPolicyManager(); void ConstructL(); - void ReadPolicyL( - TInt aResourceId, - MESMRCalEntry& aESMREntry ); - + private: // data /** + * Current policy resolver. + * Own. + */ + MMRPolicyResolver* iResolverPlugin; + + /** * Current policy object * Own. */ CESMRPolicy* iCurrentPolicy; /** - * Policy resource file - * Own - */ - RResourceFile iPolicyResourceFile; - - /** - * ESMR policy resource ids - * Own. - */ - RArray iPolicyResourceIds; - - /** - * Default ESMR policy checker. - * Own. - */ - CESMRPolicyChecker* iDefaultPolicyChecker; - - // Own: Extension resource manager - CESMRPolicyExtensionManager* iExtension; - - // Ref: Coe Env - CCoeEnv* iCoeEnv; - - /** * Array for preserving policies */ RPointerArray< CESMRPolicy > iPolicyStack; }; -#include "cesmrpolicymanager.inl" -// - #endif // CESMRPOLICYMANAGER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cesmrpolicymanager.inl --- a/meetingrequest/mrpolicy/inc/cesmrpolicymanager.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR policy manager inline methods -* -*/ - - -// ----------------------------------------------------------------------------- -// CESMRPolicyManager::CurrentPolicy -// ----------------------------------------------------------------------------- -// -inline CESMRPolicy& CESMRPolicyManager::CurrentPolicy() - { - CESMRPolicy* currentPolicy = iCurrentPolicy; - if ( !currentPolicy && iPolicyStack.Count() ) - { - currentPolicy = iPolicyStack[ iPolicyStack.Count() - 1 ]; - } - - ASSERT( currentPolicy ); - return *currentPolicy; - } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cmrpolicyresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/inc/cmrpolicyresolver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for MR policy resolver ECom interface +* +*/ + + +#ifndef CMRPOLICYRESOLVER_H +#define CMRPOLICYRESOLVER_H + +#include +#include "mmrpolicyresolver.h" +#include "mesmrpolicychecker.h" + +#include "esmrdef.h" + +/** + * CMRPolicyResolver defines ECom plugin interface for policy resolving . + * @see MESMRTaskFactory + * + * @lib esmrtasks.lib + */ +class CMRPolicyResolver : public CBase, + public MMRPolicyResolver, + public MESMRPolicyChecker + { +public: // Construction and destruction + /** + * Creates and initialzes new ES MR task factory. + * @param aCalDbMgr Reference to cal db manager. + */ + inline static CMRPolicyResolver* NewL( TESMRCalendarEventType aType ); + + /** + * C++ destructor. + */ + inline ~CMRPolicyResolver(); + +public: // From MMRPolicyResolver + + CESMRPolicy* ResolveL( const TESMRScenarioData& aScenData ) = 0; + + TBool SupportsTypeL( TESMRCalendarEventType aType ) = 0; + +public: // From MESMRPolicyChecker + TBool MatchesL( + const CESMRPolicy& aPolicy, + const TESMRScenarioData& aScenData ) = 0; + +private: // Data + + /** + * iDtor_ID_Key Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + }; + +#include "cmrpolicyresolver.inl" + +#endif // C_ESMRTASKFACTORY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cmrpolicyresolver.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/inc/cmrpolicyresolver.inl Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for MR policy resolver ECom interface +* +*/ + +#include +#include +#include "esmrinternaluid.h" + +inline CMRPolicyResolver* CMRPolicyResolver::NewL( TESMRCalendarEventType aType ) + { + TAny* impl = NULL; + + switch ( aType ) + { + case EESMREventTypeAppt: + case EESMREventTypeETodo: + case EESMREventTypeEEvent: + case EESMREventTypeEReminder: + case EESMREventTypeEAnniv: + { + impl = REComSession::CreateImplementationL( + TUid::Uid( KMRCalEntryPolicyImplementationUID ), + _FOFF( CMRPolicyResolver, iDtor_ID_Key ) ); + break; + } + case EESMREventTypeMeetingRequest: + { + impl = REComSession::CreateImplementationL( + TUid::Uid( KMREntryPolicyImplementationUID ), + _FOFF( CMRPolicyResolver, iDtor_ID_Key ) ); + break; + } + default: + { + ASSERT( EFalse ); // ASSERT for debug builds + User::Leave( KErrNotSupported ); + } + } + + return static_cast< CMRPolicyResolver* >( impl ); + } + +inline CMRPolicyResolver::~CMRPolicyResolver() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/cmrpolicyresourceiterator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/inc/cmrpolicyresourceiterator.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for MR policy resolver ECom interface +* +*/ + + +#ifndef CMRPOLICYRESOURCEITERATOR_H +#define CMRPOLICYRESOURCEITERATOR_H + +#include +#include + +class CESMRPolicy; + +/** + * CMRPolicyResolver defines ECom plugin interface for policy resolving . + * @see MESMRTaskFactory + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CMRPolicyResourceIterator ) : public CBase + { +public: // Construction and destruction + /** + * Creates and initialzes new ES MR task factory. + * @param aCalDbMgr Reference to cal db manager. + */ + IMPORT_C static CMRPolicyResourceIterator* NewL( const TDesC& aResourceFile, + TInt aResourceId ); + + /** + * C++ destructor. + */ + IMPORT_C ~CMRPolicyResourceIterator(); + +public: + + /** + * Tests if iterator has more policies available. + * + * @return ETrue if iterator has policy + */ + IMPORT_C TBool HasNext() const; + + /** + * Loads and instantiates next policy from resource. + * Ownership of policy is transferred to caller. + * + * @return next policy + */ + IMPORT_C CESMRPolicy* NextPolicyL(); + + /** + * Loads and instantiates next policy from resource. + * Policy is left into CleanupStack. + * + * @return next policy + */ + IMPORT_C CESMRPolicy* NextPolicyLC(); + + /** + * Resets iterator. + */ + IMPORT_C void Reset(); + +private: // Implementation + + CMRPolicyResourceIterator(); + + void ConstructL( + const TDesC& aResourceFile, + TInt aResourceId ); + + void ReadPolicyFromResourceL( + const TDesC& aPolicyFile, + TInt aPolicyArrayResourceId ); + + CESMRPolicy* ReadPolicyLC( TInt aResourceId ); + +private: // Data + + /** + * Policy resource file. + * Own. + */ + RResourceFile iPolicyResourceFile; + + /** + * Array of policy resource ids + * Own. + */ + RArray< TInt > iPolicyResourceIds; + + /** + * Array index (iterator) + */ + TInt iArrayIndex; + + }; + +#endif // CMRPOLICYRESOURCEITERATOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/mmrpolicyprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/inc/mmrpolicyprovider.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for policy checker +* +*/ + + +#ifndef MMRPOLICYPROVIDER_H +#define MMRPOLICYPROVIDER_H + +class CESMRPolicy; + +/** + * MMRPolicyProvider defines interface for accessing policy from CESMRPolicyManager. + */ +class MMRPolicyProvider + { +public: // Interface + + /** + * Gets the current policy resolved by the policy provider implementation + * + * @return reference to the current policy instance. + */ + virtual const CESMRPolicy& CurrentPolicy() const = 0; + +protected: + /** + * Virtual destructor + */ + virtual ~MMRPolicyProvider() {} + + + + }; + +#endif // MMRPOLICYPROVIDER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/inc/mmrpolicyresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/inc/mmrpolicyresolver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for MR policy resolver ECom interface +* +*/ + + +#ifndef MMRPOLICYRESOLVER_H +#define MMRPOLICYRESOLVER_H + +#include "esmrdef.h" + +class CESMRPolicy; +class TESMRScenarioData; + +/** + * MMRPolicyResolver defines interface for policy resolving . + */ +class MMRPolicyResolver + { +public: + + virtual ~MMRPolicyResolver() {} + + +public: + + /** + * Resolves policy based on given scenario data. + * Ownership of the resolved policy is transferred to caller. + * + * @param aScenData scenario data. + * @return resolved policy instance. + */ + virtual CESMRPolicy* ResolveL( const TESMRScenarioData& aScenData ) = 0; + + /** + * Returns ETrue if resolver is capable of resolving specified entry type + * + * @param aType Entry type to test + */ + virtual TBool SupportsTypeL( TESMRCalendarEventType aType ) = 0; + + /** + * Accessor for interface extensions. + * + * @param aExtensionUid the extension interface UID + * @return pointer to extension interface or NULL + */ + virtual TAny* Extension( TUid /*aExtensionUid*/ ) { return NULL; } + + }; + +#endif // MMRPOLICYRESOLVER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/mrcalentryresolver.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/mrcalentryresolver.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECom registration resource for MR Cal Entry policy resolver +* +*/ + + + +#include +#include "esmrinternaluid.h" + + +// --------------------------------------------------------------------------- +// r_registry +// ECOM plugin registry info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO r_registry + { + // Resource format version 2 for ROM-only plugins + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRCalEntryPolicyImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMRPolicyResolverInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRCalEntryPolicyImplementationUID; + version_no = 1; + display_name = + "MR Cal Entry Policy Resolver";// codescanner::codereview + default_data = ""; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalanniversaryeditor.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalanniversaryeditor.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for anniversary editor policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_anniversary_editor +// CalentryUI Policy for editing anniversary from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_anniversary_editor + { + event_type = EESMREventTypeEAnniv; + policy_id = EESMRPolicyAnniversaryEditor; + policy_mode = EESMREditMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; // TODO: Should there be defined a new value for this? + field_ids = r_bccal_anniversary_editor_fields; + default_commands = r_bccal_anniversary_editor_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_anniversary_editor_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_anniversary_editor_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldUnifiedEditor; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldOccasion; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmOnOff; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_anniversary_editor_def_commands +// Default options menu command for anniversary editor +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_anniversary_editor_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EESMRCmdSaveMR; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalanniversaryviewer.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalanniversaryviewer.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for anniversary viewer policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_anniversary_viewer +// Calendar Entry UI Policy for viewing anniversary from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_anniversary_viewer + { + event_type = EESMREventTypeEAnniv; + policy_id = EESMRPolicyAnniversaryViewer; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_anniversary_viewer_fields; + default_commands = r_bccal_anniversary_viewer_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_anniversary_viewer_fields +// Default field set for anniversary viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_anniversary_viewer_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_anniversary_viewer_def_commands +// Default options menu items for anniversary viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_anniversary_viewer_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIEdit; }, + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccaleventpolicies.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccaleventpolicies.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Policy definitions for BC Cal event plugin +* +*/ + +#include +#include +#include "esmrservices.rh" +#include "esmrdef.h" + +NAME CALP + +RESOURCE RSS_SIGNATURE { } + +#include "bccalmeetingeditor.rss" +#include "bccalmeetingviewer.rss" +#include "bccaltodoeditor.rss" +#include "bccaltodoviewer.rss" +#include "bccalmemoeditor.rss" +#include "bccalmemoviewer.rss" +#include "bccalanniversaryeditor.rss" +#include "bccalanniversaryviewer.rss" + +// --------------------------------------------------------------------------- +// r_bccalevent_policies +// Business Calendar Event plugin policies +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY_TABLE r_bccalevent_policies + { + policies = + { + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_meeting_editor; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_meeting_viewer; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_todo_editor; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_todo_viewer; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_memo_editor; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_memo_viewer; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_anniversary_editor; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_bccal_anniversary_viewer; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmeetingeditor.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmeetingeditor.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for meeting editor policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_esmr_organizer_edit_from_calendar +// BC Cal Event plugin Policy for editing meeting from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_meeting_editor + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyMeetingEditor; + policy_mode = EESMREditMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_meeting_editor_fields; + default_commands = r_bccal_meeting_editor_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_meeting_editor_fields +// Default field set for meeting editor +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_meeting_editor_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldUnifiedEditor; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmOnOff; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_meeting_editor_def_commands +// Default options menu items +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_meeting_editor_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EESMRCmdCalEntryUIAddParticipants; }, + ESMR_ID { id = EESMRCmdSaveMR; }, + ESMR_ID { id = EESMRCmdPriorityOptions; }, + ESMR_ID { id = EESMRCmdPriorityLow; }, + ESMR_ID { id = EESMRCmdPriorityHigh; }, + ESMR_ID { id = EESMRCmdPriorityNormal; }, + ESMR_ID { id = EESMRCmdPriorityLow; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmeetingviewer.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmeetingviewer.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for meeting viewer policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_meeting_viewer +// BC Cal Event plugin Policy for viewing meeting from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_meeting_viewer + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyMeetingViewer; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_meeting_viewer_fields; + default_commands = r_bccal_meeting_viewer_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_meeting_viewer_fields +// Default field set for meeting viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_meeting_viewer_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_meeting_viewer_def_commands +// Default options menu items for meeting viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_meeting_viewer_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIEdit; }, + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmemoeditor.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmemoeditor.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for memo editor policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_memo_editor +// BC Cal Event plugin policy for editing memo from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_memo_editor + { + event_type = EESMREventTypeEEvent; + policy_id = EESMRPolicyMemoEditor; + policy_mode = EESMREditMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_memo_editor_fields; + default_commands = r_bccal_memo_editor_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_memo_editor_fields +// Default field set for memo editor +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_memo_editor_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldUnifiedEditor; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_memo_editor_def_commands +// Default options menu items for memo editor +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_memo_editor_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EESMRCmdSaveMR; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmemoviewer.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccalmemoviewer.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for memo viewer policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_memo_viewer +// BC Cal Event plugin policy for viewing memo from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_memo_viewer + { + event_type = EESMREventTypeEEvent; + policy_id = EESMRPolicyMemoViewer; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_memo_viewer_fields; + default_commands = r_bccal_memo_viewer_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_memo_viewer_fields +// Default field set for memo viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_memo_viewer_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_memo_viewer_def_commands +// Default options menu items for memo viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_memo_viewer_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIEdit; }, + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccaltodoeditor.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccaltodoeditor.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for todo editor policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_todo_editor +// BC Cal Event plugin Policy for editing todo from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_todo_editor + { + event_type = EESMREventTypeETodo; + policy_id = EESMRPolicyTodoEditor; + policy_mode = EESMREditMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_todo_editor_fields; + default_commands = r_bccal_todo_editor_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_todo_editor_fields +// Default field set for todo editor +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_todo_editor_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldUnifiedEditor; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmOnOff; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldPriority; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_todo_editor_def_commands +// Default options menu items for todo editor +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_todo_editor_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EESMRCmdSaveMR; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccaltodoviewer.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/data/policies/bccaltodoviewer.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: resource definition for todo viewer policy +* +*/ + + +// --------------------------------------------------------------------------- +// r_bccal_todo_viewer +// BC Cal Event plugin Policy for viewing todo from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_bccal_todo_viewer + { + event_type = EESMREventTypeETodo; + policy_id = EESMRPolicyTodoViewer; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_bccal_todo_viewer_fields; + default_commands = r_bccal_todo_viewer_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_bccal_todo_viewer_fields +// Default field set for todo viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_todo_viewer_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldPriority; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_bccal_todo_viewer_def_commands +// Default options menu items for todo viewer +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_bccal_todo_viewer_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdCalEntryUIEdit; }, + ESMR_ID { id = EESMRCmdTodoMarkAsDone; }, + ESMR_ID { id = EESMRCmdTodoMarkAsNotDone; }, + ESMR_ID { id = EESMRCmdCalEntryUIDelete; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mrentryresolver +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +mrcalentryresolver.mmp + +// EOF \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/group/mrcalentryresolver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/group/mrcalentryresolver.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project esmrpolicy +* +*/ + + +#include "../../../inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrcalentryresolver.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRCalEntryPolicyImplementationUID + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmrcalentrypolicyresolver.cpp +SOURCE dllmain.cpp + +USERINCLUDE . +USERINCLUDE ../data/policies +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +START RESOURCE ../data/mrcalentryresolver.rss +TARGET mrcalentryresolver.rsc +END + +START RESOURCE ../data/policies/bccaleventpolicies.rss +HEADER +TARGET bccaleventpolicies +TARGETPATH RESOURCE_FILES_DIR +END + +// ESMR libraries +LIBRARY esmrcommon.lib +LIBRARY esmrpolicy.lib + +// System and S60 libraries +LIBRARY euser.lib +LIBRARY ecom.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/inc/cmrcalentrypolicyresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/inc/cmrcalentrypolicyresolver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Cal Entry policy resolver ECom plugin definition +* +*/ + + +#ifndef CMRCALENTRYPOLICYRESOLVER_H +#define CMRCALENTRYPOLICYRESOLVER_H + +#include "cmrpolicyresolver.h" + +class CMRPolicyResourceIterator; + +/** + * CMRCalEntryPolicyResolver is responsible for resolving policy + * against scenario data. This utility class encapsulates + * matching policies with TESMRScenarioData + * + */ +NONSHARABLE_CLASS( CMRCalEntryPolicyResolver ) : + public CMRPolicyResolver + { +public: // Construction and destruction + /** + * Two-phased constructor. Creates and initializes + * CMRCalEntryPolicyResolver object. + * @return Pointer to esmr policy checker object. + */ + static CMRCalEntryPolicyResolver* NewL(); + + /** + * C++ Destructor. + */ + ~CMRCalEntryPolicyResolver(); + +protected: // Interface + + CESMRPolicy* ResolveL( const TESMRScenarioData& aScenData ); + + TBool SupportsTypeL( TESMRCalendarEventType aType ); + + TBool MatchesL( + const CESMRPolicy& aPolicy, + const TESMRScenarioData& aScenData ); + +private: // Implementation + CMRCalEntryPolicyResolver(); + + void ConstructL(); + +private: // Data + + CMRPolicyResourceIterator* iIterator; + }; + +#endif // CMRCALENTRYPOLICYRESOLVER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/src/cmrcalentrypolicyresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/src/cmrcalentrypolicyresolver.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,170 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Cal Entry policy resolver ECom plugin implementation +* +*/ + + +#include "cmrcalentrypolicyresolver.h" +#include "cmrpolicyresourceiterator.h" +#include "cesmrpolicy.h" +#include "esmrhelper.h" +#include "tesmrscenariodata.h" + +#include +#include + +#include "emailtrace.h" + +namespace // codescanner::namespace + { + _LIT( KPolicyResourceFile, "bccaleventpolicies.rsc" ); + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::CMRCalEntryPolicyResolver +// --------------------------------------------------------------------------- +// +CMRCalEntryPolicyResolver::CMRCalEntryPolicyResolver() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::~CMRCalEntryPolicyResolver +// --------------------------------------------------------------------------- +// +CMRCalEntryPolicyResolver::~CMRCalEntryPolicyResolver() + { + FUNC_LOG; + + delete iIterator; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::NewL +// --------------------------------------------------------------------------- +// +CMRCalEntryPolicyResolver* CMRCalEntryPolicyResolver::NewL() + { + FUNC_LOG; + CMRCalEntryPolicyResolver* self = new (ELeave) CMRCalEntryPolicyResolver; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::ResolveL +// --------------------------------------------------------------------------- +// +CESMRPolicy* CMRCalEntryPolicyResolver::ResolveL( const TESMRScenarioData& aScenData ) + { + iIterator->Reset(); + + CESMRPolicy* policy = NULL; + + while ( !policy && iIterator->HasNext() ) + { + policy = iIterator->NextPolicyLC(); + + if ( MatchesL( *policy, aScenData ) ) + { + CleanupStack::Pop( policy ); + } + else + { + CleanupStack::PopAndDestroy( policy ); + policy = NULL; + } + } + + if ( !policy ) + { + User::Leave( KErrNotFound ); + } + + return policy; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::SupportsTypeL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntryPolicyResolver::SupportsTypeL( TESMRCalendarEventType aType ) + { + switch ( aType ) + { + case EESMREventTypeAppt: + case EESMREventTypeETodo: + case EESMREventTypeEEvent: + case EESMREventTypeEReminder: + case EESMREventTypeEAnniv: + { + return ETrue; + } + default: + { + return EFalse; + } + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::MatchesL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntryPolicyResolver::MatchesL( + const CESMRPolicy& aPolicy, + const TESMRScenarioData& aScenData ) + { + FUNC_LOG; + TBool matches( ETrue ); + + if ( aPolicy.ViewMode() != aScenData.iViewMode + || aPolicy.EventType() != aScenData.iEntryType + || aPolicy.AllowedApp() != aScenData.iCallingApp ) + { + matches = EFalse; + } + + return matches; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryPolicyResolver::ConstructL +// --------------------------------------------------------------------------- +// +void CMRCalEntryPolicyResolver::ConstructL() + { + FUNC_LOG; + + TFileName resource; + User::LeaveIfError( ESMRHelper::LocateResourceFile( + KPolicyResourceFile, + KDC_RESOURCE_FILES_DIR, + resource, + NULL ) ); + + iIterator = CMRPolicyResourceIterator::NewL( + resource, + R_BCCALEVENT_POLICIES ); + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrcalentryresolver/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrcalentryresolver/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Standard Symbian OS DLL entry point function. +* +*/ + + +// Internal includes +#include "cmrcalentrypolicyresolver.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( + KMRCalEntryPolicyImplementationUID, + CMRCalEntryPolicyResolver::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/mrentryresolver.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/mrentryresolver.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECom registration resource for MR Entry policy resolver Plugin +* +*/ + + + +#include +#include "esmrinternaluid.h" + + +// --------------------------------------------------------------------------- +// r_registry +// ECOM plugin registry info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO r_registry + { + // Resource format version 2 for ROM-only plugins + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMREntryPolicyImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMRPolicyResolverInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMREntryPolicyImplementationUID; + version_no = 1; + display_name = + "MR Entry Policy Resolver";// codescanner::codereview + default_data = ""; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrattendeeviewalldayeventfromcalendarpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrattendeeviewalldayeventfromcalendarpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from mail policy +* +*/ + +#ifndef ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY +#define ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_allday_event_from_calendar +// ES MR Policy forviewing MR from Calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_attd_view_allday_event_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyAttendeeViewAllDayEventMRFromCal; + policy_mode = EESMRViewAllDayMR; + role_flags = KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_attd_view_allday_event_from_calendar_fields; + default_commands = r_esmr_attd_view_allday_event_from_calendar_def_commands; + additional_commands = 0; // No additional commands + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_allday_event_from_calendar_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldOrganizer; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldResponseArea; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_allday_event_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdAcceptMR; }, + ESMR_ID { id = EESMRCmdTentativeMR; }, + ESMR_ID { id = EESMRCmdDeclineMR; }, + ESMR_ID { id = EESMRCmdEditLocal; }, + ESMR_ID { id = EESMRCmdReply; }, + ESMR_ID { id = EESMRCmdReplyAll; }, + ESMR_ID { id = EESMRCmdForwardOptions; }, + ESMR_ID { id = EESMRCmdForwardAsMeeting; }, + ESMR_ID { id = EESMRCmdForwardAsMail; }, + ESMR_ID { id = EESMRCmdViewCalendar; }, + ESMR_ID { id = EESMRCmdDeleteMR; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrattendeeviewalldayeventfromemailpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrattendeeviewalldayeventfromemailpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from mail policy +* +*/ + +#ifndef ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMMAILPOLICY +#define ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMMAILPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_allday_event_from_email +// ES MR Policy forviewing MR from Calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_attd_view_allday_event_from_email + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyAttendeeViewAllDayEventMRFromEmail; + policy_mode = EESMRViewAllDayMR; + role_flags = KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant; + allowed_app = KEESMRFlagAppEsEmail; + field_ids = r_esmr_attd_view_allday_event_from_email_fields; + default_commands = r_esmr_attd_view_allday_event_from_email_def_commands; + additional_commands = 0; // No additional commands + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_allday_event_from_email_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_email_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldOrganizer; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldResponseArea; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_allday_event_from_email_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_allday_event_from_email_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdAcceptMR; }, + ESMR_ID { id = EESMRCmdTentativeMR; }, + ESMR_ID { id = EESMRCmdDeclineMR; }, + ESMR_ID { id = EESMRCmdRemoveFromCalendar; }, + ESMR_ID { id = EESMRCmdViewCalendar; }, + ESMR_ID { id = EESMRCmdForwardOptions; }, + ESMR_ID { id = EESMRCmdForwardAsMeeting; }, + ESMR_ID { id = EESMRCmdReply; }, + ESMR_ID { id = EESMRCmdReplyAll; }, + ESMR_ID { id = EESMRCmdMailMarkUnread; }, + ESMR_ID { id = EESMRCmdMailDelete; }, + ESMR_ID { id = EESMRCmdMailForwardAsMessage; }, + ESMR_ID { id = EESMRCmdMailMoveMessage; }, + ESMR_ID { id = EESMRCmdMailCopyMessage; }, + ESMR_ID { id = EESMRCmdMailMessageDetails; }, + ESMR_ID { id = EESMRCmdDownloadManager; }, + ESMR_ID { id = EESMRCmdMailPreviousMessage; }, + ESMR_ID { id = EESMRCmdMailNextMessage; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMMAILPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrorganizerviewalldayeventfromcalendarpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrorganizerviewalldayeventfromcalendarpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from mail policy +* +*/ + +#ifndef ESMRSRV_VIEWALLDAYEVENTFROMCALENDARPOLICY +#define ESMRSRV_VIEWALLDAYEVENTFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_allday_event_from_calendar +// ES MR Policy forviewing MR from Calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_organizer_view_allday_event_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyOrganizerViewAllDayEventMRFromCal; + policy_mode = EESMRViewAllDayMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_organizer_view_allday_event_from_calendar_fields; + default_commands = r_esmr_organizer_view_allday_event_from_calendar_def_commands; + additional_commands = 0; // No additional commands + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_allday_event_from_calendar_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_allday_event_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdEdit;}, + ESMR_ID { id = EESMRCmdForwardOptions;}, + ESMR_ID { id = EESMRCmdForwardAsMeeting;}, + ESMR_ID { id = EESMRCmdForwardAsMail;}, + ESMR_ID { id = EESMRCmdViewTrack; }, + ESMR_ID { id = EESMRCmdDeleteMR;}, + ESMR_ID { id = EAknCmdHelp;}, + ESMR_ID { id = EAknCmdExit;} + }; + } + +#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrorganizerviewalldayeventfromemailpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrorganizerviewalldayeventfromemailpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from mail policy + * +*/ + +#ifndef ESMRSRV_VIEWALLDAYEVENTFROMMAILPOLICY +#define ESMRSRV_VIEWALLDAYEVENTFROMMAILPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_allday_event_from_email +// ES MR Policy forviewing MR from Calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_organizer_view_allday_event_from_email + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyOrganizerViewAllDayEventMRFromEmail; + policy_mode = EESMRViewAllDayMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsEmail; + field_ids = r_esmr_organizer_view_allday_event_from_email_fields; + default_commands = r_esmr_organizer_view_allday_event_from_email_def_commands; + additional_commands = 0; // No additional commands + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_allday_event_from_email_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_email_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_allday_event_from_email_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_allday_event_from_email_def_commands + { + id_table = + { + ESMR_ID + { id = EESMRCmdViewCalendar; }, + ESMR_ID + {id = EESMRCmdForwardOptions;}, + ESMR_ID + {id = EESMRCmdForwardAsMeeting;}, + ESMR_ID + {id = EESMRCmdForwardAsMail;}, + ESMR_ID + {id = EAknCmdHelp;}, + ESMR_ID + {id = EAknCmdExit;} + }; + } + +#endif // ESMRSRV_ATTENDEEVIEWALLDAYEVENTFROMCALENDARPOLICY +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrpolicies.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrpolicies.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for project esmrservices +* +*/ + + +NAME ESMR + +#include + +RESOURCE RSS_SIGNATURE { } + +// +#include "esmrservices.rh" +#include "esmrdef.h" +// +#include + +#include "esmrsrattendeeviewfrommailpolicy.rss" +#include "esmrsrattendeeviewfromcalendarpolicy.rss" +#include "esmrsrorganizerviewmrfromcalendar.rss" +#include "esmrsrorganizereditmrfromcalendar.rss" +#include "esmrsrforwardasmeetingrequestfrommail.rss" +#include "esmrsrforwardasmeetingrequestfromcalendar.rss" +#include "esmrsrattendeeeditmrfromcalendar.rss" +#include "esmrattendeeviewalldayeventfromcalendarpolicy.rss" +#include "esmrattendeeviewalldayeventfromemailpolicy.rss" +#include "esmrorganizerviewalldayeventfromcalendarpolicy.rss" +#include "esmrorganizerviewalldayeventfromemailpolicy.rss" +#include "esmrsrorganizerviewmrfromemail.rss" +#include "esmrtrackingviewpolicy.rss" + +// --------------------------------------------------------------------------- +// r_esmr_policies +// ES MR UI policies +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY_TABLE r_esmr_policies + { + policies = + { + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_from_mail; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_edit_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attendee_edit_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_forward_as_meeting_request_from_mail; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_forward_as_meeting_request_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_allday_event_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_attd_view_allday_event_from_email; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_allday_event_from_calendar; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_allday_event_from_email; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_organizer_view_from_email; }, + ESMR_POLICY_TABLE_ITEM { esmr_policy = r_esmr_tracking_view; } + }; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrattendeeeditmrfromcalendar.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrattendeeeditmrfromcalendar.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for editing MR from calendar +* +*/ + +#ifndef ESMRSRV_ATTENDEEEDITFROMCALENDARPOLICY +#define ESMRSRV_ATTENDEEEDITFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_attendee_edit_from_calendar +// ES MR Policy for editing MR from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_attendee_edit_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyAttendeeEditMRFromCal; + policy_mode = EESMREditMR; + role_flags = KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant ; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_attendee_edit_from_calendar_fields; + default_commands = r_esmr_attendee_edit_from_calendar_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_esmr_attendee_edit_from_calendar_def_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attendee_edit_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + + ESMR_FIELD + { + field_id = EESMRFieldAlarmOnOff; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_attendee_edit_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attendee_edit_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdSaveCloseMR; }, + ESMR_ID { id = EESMRCmdDeleteMR; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_ATTENDEEEDITFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrattendeeviewfromcalendarpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrattendeeviewfromcalendarpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,174 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from mail policy +* +*/ + +#ifndef ESMRSRV_ATTENDEEVIEWFROMCALENDARPOLICY +#define ESMRSRV_ATTENDEEVIEWFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_from_calendar +// ES MR Policy forviewing MR from Calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_attd_view_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyAttendeeViewMRFromCal; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_attd_view_from_calendar_fields; + default_commands = r_esmr_attd_view_from_calendar_def_commands; + additional_commands = 0; // No additional commands + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_from_calendar_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldOrganizer; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldResponseArea; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdAcceptMR; }, + ESMR_ID { id = EESMRCmdTentativeMR; }, + ESMR_ID { id = EESMRCmdDeclineMR; }, + ESMR_ID { id = EESMRCmdEditLocal; }, + ESMR_ID { id = EESMRCmdReply; }, + ESMR_ID { id = EESMRCmdReplyAll; }, + ESMR_ID { id = EESMRCmdForwardOptions; }, + ESMR_ID { id = EESMRCmdForwardAsMeeting; }, + ESMR_ID { id = EESMRCmdForwardAsMail; }, + ESMR_ID { id = EESMRCmdDeleteMR; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_ATTENDEEVIEWFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrattendeeviewfrommailpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrattendeeviewfrommailpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,183 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from mail policy +* +*/ + +#ifndef ESMRSRV_ATTENDEEVIEWFROMMAILPOLICY +#define ESMRSRV_ATTENDEEVIEWFROMMAILPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_from_mail +// ES MR Policy forviewing MR from Email application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_attd_view_from_mail + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyReceiveMRFromEmail; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant; + allowed_app = KEESMRFlagAppEsEmail; + field_ids = r_esmr_attd_view_mail_fields; + default_commands = r_esmr_attd_view_from_mail_def_commands; + additional_commands = 0; // No additional commands + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_mail_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_mail_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldOrganizer; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldResponseArea; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_attd_view_from_mail_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_attd_view_from_mail_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdAcceptMR; }, + ESMR_ID { id = EESMRCmdTentativeMR; }, + ESMR_ID { id = EESMRCmdDeclineMR; }, + ESMR_ID { id = EESMRCmdRemoveFromCalendar; }, + ESMR_ID { id = EESMRCmdViewCalendar; }, + ESMR_ID { id = EESMRCmdForwardOptions; }, + ESMR_ID { id = EESMRCmdForwardAsMeeting; }, + ESMR_ID { id = EESMRCmdReply; }, + ESMR_ID { id = EESMRCmdReplyAll; }, + ESMR_ID { id = EESMRCmdMailMarkUnread; }, + ESMR_ID { id = EESMRCmdMailDelete; }, + ESMR_ID { id = EESMRCmdClipboardCopy; }, + ESMR_ID { id = EESMRCmdMailForwardAsMessage; }, + ESMR_ID { id = EESMRCmdMailMoveMessage; }, + ESMR_ID { id = EESMRCmdMailCopyMessage; }, + ESMR_ID { id = EESMRCmdMailMessageDetails; }, + ESMR_ID { id = EESMRCmdDownloadManager; }, + ESMR_ID { id = EESMRCmdMailPreviousMessage; }, + ESMR_ID { id = EESMRCmdMailNextMessage; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_ATTENDEEVIEWFROMMAILPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfromcalendar.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfromcalendar.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,144 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for forwarding meeting request +* +*/ + +#ifndef ESMRSRV_FORWARDASMEETINGREQUESTFROMCALENDARPOLICY +#define ESMRSRV_FORWARDASMEETINGREQUESTFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_forward_as_meeting_request_from_calendar +// ES MR Policy for forwarding meeting request +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_forward_as_meeting_request_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyForwardAsMeetingRequestFromCal; + policy_mode = EESMRForwardMR; + role_flags = KEESMRFlagOrganizer | + KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_forward_as_meeting_request_from_calendar_fields; + default_commands = r_esmr_forward_as_meeting_request_from_calendar_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_esmr_forward_as_meeting_request_from_calendar_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_forward_as_meeting_request_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdSendMR; }, + ESMR_ID { id = EESMRCmdAddOptAttendee; }, + ESMR_ID { id = EESMRCmdViewCalendar; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_FORWARDASMEETINGREQUESTFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfrommail.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfrommail.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,144 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for forwarding meeting request +* +*/ + +#ifndef ESMRSRV_FORWARDASMEETINGREQUESTFROMMAILPOLICY +#define ESMRSRV_FORWARDASMEETINGREQUESTFROMMAILPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_forward_as_meeting_request_from_mail +// ES MR Policy for forwarding meeting request +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_forward_as_meeting_request_from_mail + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyForwardAsMeetingRequestFromMail; + policy_mode = EESMRForwardMR; + role_flags = KEESMRFlagOrganizer | + KEESMRFlagRequiredAttendee | + KEESMRFlagOptionalAttendee | + KEESMRFlagNonParticipant; + allowed_app = KEESMRFlagAppEsEmail; + field_ids = r_esmr_forward_as_meeting_request_from_mail_fields; + default_commands = r_esmr_forward_as_meeting_request_from_mail_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_esmr_forward_as_meeting_request_from_mail_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_mail_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_forward_as_meeting_request_from_mail_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_forward_as_meeting_request_from_mail_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdSendMR; }, + ESMR_ID { id = EESMRCmdAddOptAttendee; }, + ESMR_ID { id = EESMRCmdViewCalendar; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_FORWARDASMEETINGREQUESTFROMMAILPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrorganizereditmrfromcalendar.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrorganizereditmrfromcalendar.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for editing MR from calendar +* +*/ + +#ifndef ESMRSRV_ORGANIZEREDITFROMCALENDARPOLICY +#define ESMRSRV_ORGANIZEREDITFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_organizer_edit_from_calendar +// ES MR Policy for editing MR from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_organizer_edit_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyOrganizerEditMRFromCal; + policy_mode = EESMREditMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_organizer_edit_from_calendar_fields; + default_commands = r_esmr_organizer_edit_from_calendar_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_edit_from_calendar_def_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_edit_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldUnifiedEditor; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmOnOff; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_edit_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_edit_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdSendMR; }, + ESMR_ID { id = EESMRCmdSendMRUpdate; }, + ESMR_ID { id = EESMRCmdAddOptAttendee; }, + ESMR_ID { id = EESMRCmdSaveCloseMR; }, + ESMR_ID { id = EESMRCmdDeleteMR; }, + ESMR_ID { id = EESMRCmdPriorityOptions; }, + ESMR_ID { id = EESMRCmdPriorityHigh; }, + ESMR_ID { id = EESMRCmdPriorityNormal; }, + ESMR_ID { id = EESMRCmdPriorityLow; }, + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_ORGANIZEREDITFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrorganizerviewmrfromcalendar.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrorganizerviewmrfromcalendar.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,156 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for editing MR from calendar +* +*/ + +#ifndef ESMRSRV_ORGANIZERVIEWFROMCALENDARPOLICY +#define ESMRSRV_ORGANIZERVIEWFROMCALENDARPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_from_calendar +// ES MR Policy for viewing MR from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_organizer_view_from_calendar + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyOrganizerViewMRFromCal; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_organizer_view_from_calendar_fields; + default_commands = r_esmr_organizer_view_from_calendar_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_from_calendar_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_calendar_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldCalendarName; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_from_calendar_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_calendar_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdEdit;}, + ESMR_ID { id = EESMRCmdForwardOptions;}, + ESMR_ID { id = EESMRCmdForwardAsMeeting;}, + ESMR_ID { id = EESMRCmdForwardAsMail;}, + ESMR_ID { id = EESMRCmdViewTrack; }, + ESMR_ID { id = EESMRCmdDeleteMR;}, + ESMR_ID { id = EAknCmdHelp;}, + ESMR_ID { id = EAknCmdExit;} + }; + } + +#endif // ESMRSRV_ORGANIZERVIEWFROMCALENDARPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrorganizerviewmrfromemail.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrorganizerviewmrfromemail.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for viewing MR from email +* +*/ + +#ifndef ESMRSRV_ORGANIZERVIEWFROMEMAILPOLICY +#define ESMRSRV_ORGANIZERVIEWFROMEMAILPOLICY + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_from_email +// ES MR Policy for viewing MR from calendar application +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_POLICY r_esmr_organizer_view_from_email + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyOrganizerViewMREmail; + policy_mode = EESMRViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsEmail; + field_ids = r_esmr_organizer_view_from_email_fields; + default_commands = r_esmr_organizer_view_from_email_def_commands; + additional_commands = 0; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_from_email_fields +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_email_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptAttendee; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDetailedSubject; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldMeetingTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStartDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldStopDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldLocation; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarm; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrence; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldRecurrenceDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldSync; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldViewerAttachments; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldDescription; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + } + }; + } + +// --------------------------------------------------------------------------- +// r_esmr_organizer_view_from_email_def_commands +// +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_organizer_view_from_email_def_commands + { + id_table = + { + ESMR_ID { id = EESMRCmdViewCalendar; }, + ESMR_ID { id = EESMRCmdForwardOptions;}, + ESMR_ID { id = EESMRCmdForwardAsMeeting;}, + ESMR_ID { id = EESMRCmdForwardAsMail;}, + ESMR_ID { id = EAknCmdHelp;}, + ESMR_ID { id = EAknCmdExit;} + }; + } + +#endif // ESMRSRV_ORGANIZERVIEWFROMEMAILPOLICY + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrtrackingviewpolicy.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrtrackingviewpolicy.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for tracking MR from calendar +* +*/ + + + +#ifndef ESMRSRV_TRACKINGVIEWPOLICY_FROM_CALENDAR +#define ESMRSRV_TRACKINGVIEWPOLICY_FROM_CALENDAR + +// --------------------------------------------------------------------------- +// r_esmr_tracking_view_from_calendar +// ES Tracking view for MR from calendar application +// --------------------------------------------------------------------------- +// + +RESOURCE ESMR_POLICY r_esmr_tracking_view + { + event_type = EESMREventTypeAppt; + policy_id = EESMRPolicyTrackingView; + policy_mode = EESMRTrackingViewMR; + role_flags = KEESMRFlagOrganizer; + allowed_app = KEESMRFlagAppEsCalendar; + field_ids = r_esmr_tracking_view_fields; + default_commands = r_mrui_tracking_view_def_commands; + additional_commands = 0; + } + + + +// --------------------------------------------------------------------------- +// r_esmr_tracking_view_fields +// Default field set for tracking view +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_esmr_tracking_view_fields + { + id_table = + { + ESMR_FIELD + { + field_id = EESMRFieldReqTrack; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRTrackStatus; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldOptTrack; + field_type = EESMRFieldTypeAdditional; + field_mode = EESMRFieldModeView; + } + // Add other fields here + }; + } + +// --------------------------------------------------------------------------- +// r_mrui_tracking_view_def_commands +// Default options menu items +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ID_TABLE r_mrui_tracking_view_def_commands + { + id_table = + { + ESMR_ID { id = EAknCmdHelp; }, + ESMR_ID { id = EAknCmdExit; } + }; + } + +#endif // ESMRSRV_TRACKINGVIEWPOLICY_FROM_CALENDAR + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project mrentryresolver +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +mrentryresolver.mmp + +// EOF \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/group/mrentryresolver.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/group/mrentryresolver.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project esmrpolicy +* +*/ + + +#include "../../../inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrentryresolver.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMREntryPolicyImplementationUID + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmrentrypolicyresolver.cpp +SOURCE dllmain.cpp + +USERINCLUDE . +USERINCLUDE ../data/policies +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +START RESOURCE ../data/mrentryresolver.rss +TARGET mrentryresolver.rsc +END + +START RESOURCE ../data/policies/esmrpolicies.rss +HEADER +TARGET esmrpolicies +TARGETPATH RESOURCE_FILES_DIR +END + +// ESMR libraries +LIBRARY esmrcommon.lib +LIBRARY esmrpolicy.lib + +// System and S60 libraries +LIBRARY euser.lib +LIBRARY ecom.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/inc/cmrentrypolicyresolver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/inc/cmrentrypolicyresolver.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR service policy checker definition +* +*/ + + +#ifndef CMRENTRYPOLICYRESOLVER_H +#define CMRENTRYPOLICYRESOLVER_H + +#include "cmrpolicyresolver.h" + +class CMRPolicyResourceIterator; + +/** + * CESMRPolicyChecker is responsible for matching policy + * against scenario data. This utility class encapsulates + * matching policies with TESMRScenarioData + * + * @lib esmrpolicy.lib + */ +NONSHARABLE_CLASS( CMREntryPolicyResolver ) : + public CMRPolicyResolver + { +public: // Construction and destruction + /** + * Two-phased constructor. Creates and initializes + * CESMRPolicyChecker object. + * @return Pointer to esmr policy checker object. + */ + static CMREntryPolicyResolver* NewL(); + + /** + * C++ Destructor. + */ + ~CMREntryPolicyResolver(); + +protected: // Interface + + CESMRPolicy* ResolveL( const TESMRScenarioData& aScenData ); + + TBool SupportsTypeL( TESMRCalendarEventType aType ); + + TBool MatchesL( + const CESMRPolicy& aPolicy, + const TESMRScenarioData& aScenData ); + +private: // Implementation + CMREntryPolicyResolver(); + + void ConstructL(); + +private: // Data + + CMRPolicyResourceIterator* iIterator; + }; + +#endif // CMRENTRYPOLICYRESOLVER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/src/cmrentrypolicyresolver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/src/cmrentrypolicyresolver.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR service policy checker implementation +* +*/ + + +#include "cmrentrypolicyresolver.h" +#include "cmrpolicyresourceiterator.h" +#include "cesmrpolicy.h" +#include "esmrhelper.h" +#include "tesmrscenariodata.h" + +#include +#include + +#include "emailtrace.h" + +namespace // codescanner::namespace + { + _LIT( KPolicyResourceFile, "esmrpolicies.rsc" ); + } + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::CMREntryPolicyResolver +// --------------------------------------------------------------------------- +// +CMREntryPolicyResolver::CMREntryPolicyResolver() + { + FUNC_LOG; + // Do nothing + } + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::~CMREntryPolicyResolver +// --------------------------------------------------------------------------- +// +CMREntryPolicyResolver::~CMREntryPolicyResolver() + { + FUNC_LOG; + + delete iIterator; + } + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::NewL +// --------------------------------------------------------------------------- +// +CMREntryPolicyResolver* CMREntryPolicyResolver::NewL() + { + FUNC_LOG; + CMREntryPolicyResolver* self = new (ELeave) CMREntryPolicyResolver; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::ResolveL +// --------------------------------------------------------------------------- +// +CESMRPolicy* CMREntryPolicyResolver::ResolveL( const TESMRScenarioData& aScenData ) + { + iIterator->Reset(); + + CESMRPolicy* policy = NULL; + + while ( !policy && iIterator->HasNext() ) + { + policy = iIterator->NextPolicyLC(); + + if ( MatchesL( *policy, aScenData ) ) + { + CleanupStack::Pop( policy ); + } + else + { + CleanupStack::PopAndDestroy( policy ); + policy = NULL; + } + } + + if ( !policy ) + { + User::Leave( KErrNotFound ); + } + + return policy; + } + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::SupportsTypeL +// --------------------------------------------------------------------------- +// +TBool CMREntryPolicyResolver::SupportsTypeL( TESMRCalendarEventType aType ) + { + return ( EESMREventTypeMeetingRequest == aType ); + } + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::MatchesL +// --------------------------------------------------------------------------- +// +TBool CMREntryPolicyResolver::MatchesL( + const CESMRPolicy& aPolicy, + const TESMRScenarioData& aScenData ) + { + FUNC_LOG; + TBool matches( ETrue ); + + if ( aPolicy.ViewMode() != aScenData.iViewMode || + !aPolicy.IsRoleIncluded( aScenData.iRole ) || + aPolicy.AllowedApp() != aScenData.iCallingApp ) + { + matches = EFalse; + } + + return matches; + } + +// --------------------------------------------------------------------------- +// CMREntryPolicyResolver::ConstructL +// --------------------------------------------------------------------------- +// +void CMREntryPolicyResolver::ConstructL() + { + FUNC_LOG; + + TFileName resource; + User::LeaveIfError( ESMRHelper::LocateResourceFile( + KPolicyResourceFile, + KDC_RESOURCE_FILES_DIR, + resource, + NULL ) ); + + iIterator = CMRPolicyResourceIterator::NewL( + resource, + R_ESMR_POLICIES ); + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/mrentryresolver/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/mrentryresolver/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Standard Symbian OS DLL entry point function. +* +*/ + + +// Internal includes +#include "cmrentrypolicyresolver.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( + KMREntryPolicyImplementationUID, + CMREntryPolicyResolver::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/src/cesmrpolicy.cpp --- a/meetingrequest/mrpolicy/src/cesmrpolicy.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/src/cesmrpolicy.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -363,5 +363,41 @@ return iEventType; } +// ----------------------------------------------------------------------------- +// CESMRPolicy::PolicyId +// ----------------------------------------------------------------------------- +// +EXPORT_C TESMRPolicyID CESMRPolicy::PolicyId() const + { + return iPolicyId; + } + +// ----------------------------------------------------------------------------- +// CESMRPolicy::ViewMode +// ----------------------------------------------------------------------------- +// +EXPORT_C TESMRViewMode CESMRPolicy::ViewMode() const + { + return iViewMode; + } + +// ----------------------------------------------------------------------------- +// CESMRPolicy::Fields +// ----------------------------------------------------------------------------- +// +EXPORT_C const RArray& CESMRPolicy::Fields() const + { + return iMRFields; + } + +// ----------------------------------------------------------------------------- +// CESMRPolicy::AllowedApp +// ----------------------------------------------------------------------------- +// +EXPORT_C TESMRUsingApp CESMRPolicy::AllowedApp() const + { + return iAllowedApp; + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/src/cesmrpolicychecker.cpp --- a/meetingrequest/mrpolicy/src/cesmrpolicychecker.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR service policy checker implementation -* -*/ - - -#include "emailtrace.h" -#include "cesmrpolicychecker.h" -// -#include "cesmrpolicy.h" -#include "tesmrscenariodata.h" -// - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRPolicyChecker::CESMRPolicyChecker -// --------------------------------------------------------------------------- -// -inline CESMRPolicyChecker::CESMRPolicyChecker() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRPolicyChecker::~CESMRPolicyChecker -// --------------------------------------------------------------------------- -// -CESMRPolicyChecker::~CESMRPolicyChecker() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRPolicyChecker::NewL -// --------------------------------------------------------------------------- -// -CESMRPolicyChecker* CESMRPolicyChecker::NewL() - { - FUNC_LOG; - CESMRPolicyChecker* self = new (ELeave) CESMRPolicyChecker; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRPolicyChecker::MatchesL -// --------------------------------------------------------------------------- -// -TBool CESMRPolicyChecker::MatchesL( - const CESMRPolicy& aPolicy, - const TESMRScenarioData& aScenData ) - { - FUNC_LOG; - TBool matches( ETrue ); - - if ( aPolicy.ViewMode() != aScenData.iViewMode || - !aPolicy.IsRoleIncluded( aScenData.iRole ) || - aPolicy.AllowedApp() != aScenData.iCallingApp ) - { - matches = EFalse; - } - - return matches; - } - -// --------------------------------------------------------------------------- -// CESMRPolicyChecker::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRPolicyChecker::ConstructL() - { - FUNC_LOG; - // Do nothing - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/src/cesmrpolicyextensionmanager.cpp --- a/meetingrequest/mrpolicy/src/cesmrpolicyextensionmanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,265 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR policy extension manager implementation -* -*/ - -#include "emailtrace.h" -#include "cesmrpolicyextensionmanager.h" - -#include "esmrinternaluid.h" - -// System includes -#include // BaflUtils -#include // CCoeEnv -#include // RImplInfoPtrArray -#include // REComSession - -/// Unnamed namespace for local definitions -namespace { -const TInt KESMRExtensionResourceFileOffset ( 2 ); - -/** - * Custom cleanup function. - * @param aObj Object to clean. - */ -void CleanupResetAndDestroy( TAny* aObj ) - { - if ( aObj ) - { - static_cast( aObj )->ResetAndDestroy(); - } - } - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRExtensionResourceFile::CESMRExtensionResourceFile -// --------------------------------------------------------------------------- -// -CESMRExtensionResourceFile::CESMRExtensionResourceFile( RFs& aFs ) -: iFsSession( aFs ) - { - FUNC_LOG; - // do nothing - } - -// --------------------------------------------------------------------------- -// CESMRExtensionResourceFile::NewL -// --------------------------------------------------------------------------- -// -CESMRExtensionResourceFile* -CESMRExtensionResourceFile::NewL( const TDesC& aPath, RFs& aFs ) - { - CESMRExtensionResourceFile* self = - new (ELeave) CESMRExtensionResourceFile( aFs ); - CleanupStack::PushL( self ); - self->ConstructL( aPath ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRExtensionResourceFile::~CESMRExtensionResourceFile -// --------------------------------------------------------------------------- -// -CESMRExtensionResourceFile::~CESMRExtensionResourceFile() - { - FUNC_LOG; - iResFile.Close(); - // Don't close the fssession, we have only reference to CCoeEnv's RFs - } - -// --------------------------------------------------------------------------- -// CESMRExtensionResourceFile::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRExtensionResourceFile::ConstructL( const TDesC& aPath ) - { - FUNC_LOG; - TFindFile findFile( iFsSession ); - TInt error = findFile.FindByDir( aPath, KNullDesC() ); - if ( error == KErrNone ) - { - TFileName fileName; - fileName.Append( findFile.File() ); - // Solve the FullPath - BaflUtils::NearestLanguageFile(iFsSession, fileName); - iResFile.OpenL(iFsSession, fileName); - iResFile.ConfirmSignatureL(); - - // Extension resource should be always the first resource in the - // rss file. - iResId = iResFile.Offset() + KESMRExtensionResourceFileOffset; - } - } - -// --------------------------------------------------------------------------- -// CESMRExtensionResourceFile::ResId -// --------------------------------------------------------------------------- -// -TInt CESMRExtensionResourceFile::ResId() const - { - FUNC_LOG; - return iResId; - } - -// --------------------------------------------------------------------------- -// CESMRExtensionResourceFile::ResFile -// --------------------------------------------------------------------------- -// -RResourceFile& CESMRExtensionResourceFile::ResFile() - { - FUNC_LOG; - return iResFile; - } - - - -/////////////////////////////////////////////////////////////////////////////// -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::CESMRPolicyExtensionManager -// --------------------------------------------------------------------------- -// -CESMRPolicyExtensionManager::CESMRPolicyExtensionManager( CCoeEnv& aCoeEnv ) -: iCoeEnv( aCoeEnv ) - { - FUNC_LOG; - // do nothing - } - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::NewL -// --------------------------------------------------------------------------- -// -CESMRPolicyExtensionManager* CESMRPolicyExtensionManager::NewL( - CCoeEnv& aCoeEnv ) - { - FUNC_LOG; - CESMRPolicyExtensionManager* self = - new (ELeave) CESMRPolicyExtensionManager( aCoeEnv ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::~CESMRPolicyExtensionManager -// --------------------------------------------------------------------------- -// -CESMRPolicyExtensionManager::~CESMRPolicyExtensionManager() - { - FUNC_LOG; - iResourceFiles.ResetAndDestroy(); - } - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRPolicyExtensionManager::ConstructL() - { - FUNC_LOG; - // do nothing - } - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::ReadResourcesFromExtensionsL -// --------------------------------------------------------------------------- -// -void CESMRPolicyExtensionManager::ReadResourcesFromExtensionsL() - { - FUNC_LOG; - RImplInfoPtrArray implementations; - REComSession::ListImplementationsL(TUid::Uid( - KESMRSchedulingviewInterfaceUid), implementations); - CleanupStack::PushL(TCleanupItem( - CleanupResetAndDestroy, &implementations)); - - // loop through UI extensions in reverse order - const TInt count = implementations.Count(); - for (TInt i = count - 1; i >= 0; --i) - { - CImplementationInformation* implInfo = implementations[i]; - CleanupStack::PushL(implInfo); - implementations.Remove(i); - - TFileName resourceFileName; - resourceFileName.Copy(implInfo->OpaqueData()); - if ( resourceFileName != KNullDesC() && resourceFileName.Length() != 0 ) - { - CESMRExtensionResourceFile* resFile = NULL; - TRAPD( err, resFile = CESMRExtensionResourceFile::NewL( - resourceFileName, iCoeEnv.FsSession() ) ); - if ( err == KErrNone && resFile ) - { - iResourceFiles.AppendL( resFile ); - } - } - CleanupStack::PopAndDestroy( implInfo ); - } - CleanupStack::PopAndDestroy(); // implementations - } - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::ReadBufferL -// --------------------------------------------------------------------------- -// -HBufC8* CESMRPolicyExtensionManager::ReadBufferL( TInt aResourceId ) - { - FUNC_LOG; - HBufC8* buffer = NULL; - TInt count( iResourceFiles.Count() ); - for ( TInt i = 0; i < count; ++i ) - { - CESMRExtensionResourceFile* resFile = iResourceFiles[i]; - if ( resFile->ResId() == aResourceId ) - { - buffer = resFile->ResFile().AllocReadL(aResourceId); - } - } - - return buffer; - } - -// --------------------------------------------------------------------------- -// CESMRPolicyExtensionManager::ExtensionResourceFile -// --------------------------------------------------------------------------- -// -CESMRExtensionResourceFile* CESMRPolicyExtensionManager::ExtensionResourceFile( - TInt aResourceId ) - { - FUNC_LOG; - CESMRExtensionResourceFile* file = NULL; - TInt count( iResourceFiles.Count() ); - for ( TInt i = 0; i < count; ++i ) - { - CESMRExtensionResourceFile* resFile = iResourceFiles[i]; - if ( resFile->ResId() == aResourceId ) - { - file = resFile; - break; - } - } - - return file; - } - -//EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/src/cesmrpolicymanager.cpp --- a/meetingrequest/mrpolicy/src/cesmrpolicymanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrpolicy/src/cesmrpolicymanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -16,48 +16,24 @@ */ -#include "emailtrace.h" #include "cesmrpolicymanager.h" -// #include "cesmrpolicy.h" -#include #include "esmrdef.h" -// #include "esmrinternaluid.h" #include "cesmrcalimportexporter.h" #include "tesmrentryfield.h" -#include "cesmrpolicychecker.h" -#include "cesmrpolicyextensionmanager.h" +#include "cmrpolicyresolver.h" +#include "esmrentryhelper.h" +#include "mesmrcalentry.h" -#include // CCoeEnv -#include +#include "emailtrace.h" + +#include /// Unnamed namespace for local definitions namespace { -// Definition for resource id array granularity -const TInt KESMRPolicyIdArrayGranularity = 4; - -/** - * Reads ESMR policy resource id table from resource. - * - * @param aReader Reference to resource reader. - * @param aResourceIdTable Reference to resource id table. - */ -void ReadResourceIdArrayL( - TResourceReader& aReader, - RArray& aResourceIdTable ) - { - TInt numOfFields = aReader.ReadInt16(); - for (TInt i(0); i < numOfFields; i++ ) - { - TInt resourceId= aReader.ReadInt32(); - aResourceIdTable.AppendL(resourceId); - } - } - - #ifdef _DEBUG _LIT( KESMRPolicyMgrPanic, "ESMRPolicyManager" ); @@ -114,7 +90,6 @@ // --------------------------------------------------------------------------- // inline CESMRPolicyManager::CESMRPolicyManager() -: iPolicyResourceIds( KESMRPolicyIdArrayGranularity ) { FUNC_LOG; //do nothing @@ -127,11 +102,8 @@ EXPORT_C CESMRPolicyManager::~CESMRPolicyManager() { FUNC_LOG; - delete iDefaultPolicyChecker; + delete iResolverPlugin; delete iCurrentPolicy; - delete iExtension; - iPolicyResourceFile.Close(); - iPolicyResourceIds.Close(); iPolicyStack.ResetAndDestroy(); } @@ -158,19 +130,23 @@ void CESMRPolicyManager::ConstructL() { FUNC_LOG; - iDefaultPolicyChecker = CESMRPolicyChecker::NewL(); - iCoeEnv = CCoeEnv::Static(); - iExtension = CESMRPolicyExtensionManager::NewL( *iCoeEnv ); + } -// --------------------------------------------------------------------------- -// CESMRPolicyManager::ExtensionUid -// --------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CESMRPolicyManager::CurrentPolicy +// ----------------------------------------------------------------------------- // -EXPORT_C TUid CESMRPolicyManager::ExtensionUid() +EXPORT_C CESMRPolicy& CESMRPolicyManager::CurrentPolicy() { - FUNC_LOG; - return TUid::Uid( KESMRPolicyMgrUid ); + CESMRPolicy* currentPolicy = iCurrentPolicy; + if ( !currentPolicy && iPolicyStack.Count() ) + { + currentPolicy = iPolicyStack[ iPolicyStack.Count() - 1 ]; + } + + ASSERT( currentPolicy ); + return *currentPolicy; } // --------------------------------------------------------------------------- @@ -180,32 +156,39 @@ EXPORT_C void CESMRPolicyManager::ResolvePolicyL( const TESMRScenarioData& aScenarioData, MESMRCalEntry& aESMREntry, - MESMRPolicyChecker* aPolicyChecker ) + MMRPolicyResolver* aPolicyResolver ) { FUNC_LOG; - MESMRPolicyChecker* policyChecker = iDefaultPolicyChecker; - if ( aPolicyChecker ) + MMRPolicyResolver* policyResolver = NULL; + + if ( aPolicyResolver ) + { + policyResolver = aPolicyResolver; + } + else { - policyChecker = aPolicyChecker; + TESMRCalendarEventType type = + ESMREntryHelper::EventTypeL( aESMREntry.Entry() ); + + if ( !iResolverPlugin || !iResolverPlugin->SupportsTypeL( type ) ) + { + // Instantiate correct resolver + policyResolver = CMRPolicyResolver::NewL( type ); + delete iResolverPlugin; + iResolverPlugin = policyResolver; + } + else + { + // Use default resolver + policyResolver = iResolverPlugin; + } } delete iCurrentPolicy; iCurrentPolicy = NULL; - - TInt policyCount( iPolicyResourceIds.Count() ); - for ( TInt i( 0 ); - ( i < policyCount) && !iCurrentPolicy; - ++i ) - { - ReadPolicyL( iPolicyResourceIds[i], aESMREntry ); - if ( !policyChecker->MatchesL( *iCurrentPolicy, aScenarioData ) ) - { - // Policy did not match --> Reading next - delete iCurrentPolicy; - iCurrentPolicy = NULL; - } - } + + iCurrentPolicy = policyResolver->ResolveL( aScenarioData ); // Matching policy not found --> Panic __ASSERT_DEBUG( iCurrentPolicy, Panic(EESMRPolicyMgrNoPolicyFound) ); @@ -254,93 +237,15 @@ } // --------------------------------------------------------------------------- -// CESMRPolicyManager::ReadPolicyFromResourceL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRPolicyManager::ReadPolicyFromResourceL( - const TDesC& aPolicyFile, - TInt aPolicyArrayResourceId ) - { - FUNC_LOG; - - - iPolicyResourceFile.Close(); - iPolicyResourceFile.OpenL( iCoeEnv->FsSession(), aPolicyFile ); - iPolicyResourceFile.ConfirmSignatureL(); - - // R_ESMR_POLICIES - HBufC8* resourceIdBuffer = - iPolicyResourceFile.AllocReadLC( aPolicyArrayResourceId ); - - // Construct resource reader - TResourceReader reader; - reader.SetBuffer(resourceIdBuffer); - - // Read policy resource ids - iPolicyResourceIds.Reset(); - ReadResourceIdArrayL(reader, iPolicyResourceIds ); - - CleanupStack::PopAndDestroy( resourceIdBuffer ); - - // Load extension resources - iExtension->ReadResourcesFromExtensionsL(); - - } - - -// --------------------------------------------------------------------------- -// CESMRPolicyManager::ReadPolicyL +// CESMRPolicyManager::CurrentPolicy // --------------------------------------------------------------------------- // -void CESMRPolicyManager::ReadPolicyL( - TInt aResourceId, - MESMRCalEntry& /*aESMREntry */) +const CESMRPolicy& CESMRPolicyManager::CurrentPolicy() const { - FUNC_LOG; - - HBufC8* resourceBuffer = NULL; - // First try to find policy from static policies and then from extensions - TRAPD( error, resourceBuffer = iPolicyResourceFile.AllocReadL( aResourceId ) ); - if ( resourceBuffer ) - { - CleanupStack::PushL( resourceBuffer ); - } - - TResourceReader reader; - CESMRPolicy* policy = NULL; - if ( error == KErrNone && resourceBuffer ) - { - reader.SetBuffer(resourceBuffer); - policy = CESMRPolicy::NewL( iPolicyResourceFile, reader ); - } - else - { - resourceBuffer = iExtension->ReadBufferL( aResourceId ); - CESMRExtensionResourceFile* file = NULL; - if ( resourceBuffer ) - { - CleanupStack::PushL( resourceBuffer ); - file = iExtension->ExtensionResourceFile( aResourceId ); - } - - if ( resourceBuffer && file ) - { - reader.SetBuffer(resourceBuffer); - policy = CESMRPolicy::NewL( file->ResFile(), reader ); - } - } - - // Logging read policy - LOG_POLICY( *policy ) - - delete iCurrentPolicy; - iCurrentPolicy = policy; - - if ( resourceBuffer ) - { - CleanupStack::PopAndDestroy( resourceBuffer ); - } - + CESMRPolicy& policy = + const_cast< CESMRPolicyManager* >( this )->CurrentPolicy(); + + return policy; } // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrpolicy/src/cmrpolicyresourceiterator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrpolicy/src/cmrpolicyresourceiterator.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,235 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR policymmanager implementation +* +*/ + + +#include "emailtrace.h" +#include "cmrpolicyresourceiterator.h" +// +#include "cesmrpolicy.h" +#include +#include "esmrdef.h" +// +#include "esmrinternaluid.h" +#include "cesmrcalimportexporter.h" +#include "tesmrentryfield.h" + +#include // CCoeEnv +#include + + +/// Unnamed namespace for local definitions +namespace { + +// Definition for resource id array granularity +const TInt KMRPolicyIdArrayGranularity = 4; + +/** + * Reads ESMR policy resource id table from resource. + * + * @param aReader Reference to resource reader. + * @param aResourceIdTable Reference to resource id table. + */ +void ReadResourceIdArrayL( + TResourceReader& aReader, + RArray& aResourceIdTable ) + { + TInt numOfFields = aReader.ReadInt16(); + aResourceIdTable.ReserveL( numOfFields ); + + for (TInt i = 0; i < numOfFields; ++i ) + { + TInt resourceId= aReader.ReadInt32(); + aResourceIdTable.AppendL(resourceId); + } + } + +#ifdef _DEBUG + +_LIT( KPanicCategory, "MR Policy Resource Iterator" ); + +enum TMRPolicyResourceIteratorPanic + { + EMRPolicyIteratorExhausted = 0 + }; + +void Panic( TMRPolicyResourceIteratorPanic aPanic ) + { + User::Panic( KPanicCategory, aPanic ); + } + +#endif +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::CMRPolicyResourceIterator +// --------------------------------------------------------------------------- +// +inline CMRPolicyResourceIterator::CMRPolicyResourceIterator() + : iPolicyResourceIds( KMRPolicyIdArrayGranularity ), + iArrayIndex( KErrNotFound ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::~CMRPolicyResourceIterator +// --------------------------------------------------------------------------- +// +EXPORT_C CMRPolicyResourceIterator::~CMRPolicyResourceIterator() + { + FUNC_LOG; + iPolicyResourceFile.Close(); + iPolicyResourceIds.Close(); + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CMRPolicyResourceIterator* CMRPolicyResourceIterator::NewL( + const TDesC& aResourceFile, + TInt aResourceId ) + { + FUNC_LOG; + + CMRPolicyResourceIterator* self = new (ELeave) CMRPolicyResourceIterator; + CleanupStack::PushL( self ); + self->ConstructL( aResourceFile, + aResourceId ); + CleanupStack::Pop(self); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::ConstructL +// --------------------------------------------------------------------------- +// +void CMRPolicyResourceIterator::ConstructL( + const TDesC& aResourceFile, + TInt aResourceId) + { + FUNC_LOG; + ReadPolicyFromResourceL( aResourceFile, aResourceId ); + } + +// ----------------------------------------------------------------------------- +// CMRPolicyResourceIterator::HasNext +// ----------------------------------------------------------------------------- +// +EXPORT_C TBool CMRPolicyResourceIterator::HasNext() const + { + return ( iArrayIndex < iPolicyResourceIds.Count() - 1 ); + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::NextPolicyL +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRPolicy* CMRPolicyResourceIterator::NextPolicyL() + { + FUNC_LOG; + + CESMRPolicy* policy = NextPolicyLC(); + CleanupStack::Pop( policy ); + + return policy; + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::NextPolicyLC +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRPolicy* CMRPolicyResourceIterator::NextPolicyLC() + { + FUNC_LOG; + + __ASSERT_DEBUG( HasNext(), Panic( EMRPolicyIteratorExhausted ) ); + + CESMRPolicy* policy = ReadPolicyLC( iPolicyResourceIds[ ++iArrayIndex ] ); + + return policy; + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::Reset +// --------------------------------------------------------------------------- +// +EXPORT_C void CMRPolicyResourceIterator::Reset() + { + FUNC_LOG; + + iArrayIndex = KErrNotFound; + } + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::ReadPolicyFromResourceL +// --------------------------------------------------------------------------- +// +void CMRPolicyResourceIterator::ReadPolicyFromResourceL( + const TDesC& aPolicyFile, + TInt aPolicyArrayResourceId ) + { + FUNC_LOG; + + iPolicyResourceFile.Close(); + iPolicyResourceFile.OpenL( CCoeEnv::Static()->FsSession(), aPolicyFile ); + iPolicyResourceFile.ConfirmSignatureL(); + + // R_ESMR_POLICIES + HBufC8* resourceIdBuffer = + iPolicyResourceFile.AllocReadLC( aPolicyArrayResourceId ); + + // Construct resource reader + TResourceReader reader; + reader.SetBuffer(resourceIdBuffer); + + // Read policy resource ids + iPolicyResourceIds.Reset(); + ReadResourceIdArrayL(reader, iPolicyResourceIds ); + + CleanupStack::PopAndDestroy( resourceIdBuffer ); + + } + + +// --------------------------------------------------------------------------- +// CMRPolicyResourceIterator::ReadPolicyL +// --------------------------------------------------------------------------- +// +CESMRPolicy* CMRPolicyResourceIterator::ReadPolicyLC( TInt aResourceId ) + { + FUNC_LOG; + + HBufC8* resourceBuffer = iPolicyResourceFile.AllocReadLC( aResourceId ); + + TResourceReader reader; + reader.SetBuffer(resourceBuffer); + + CESMRPolicy* policy = CESMRPolicy::NewL( iPolicyResourceFile, reader ); + + CleanupStack::PopAndDestroy( resourceBuffer ); + CleanupStack::PushL( policy ); + + return policy; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build definition file. +* +* +*/ + + +#include + +PRJ_EXPORTS +../inc/mmrentryprocessor.h |../../inc/mmrentryprocessor.h +../inc/cmrentryprocessor.h |../../inc/cmrentryprocessor.h +../inc/cmrentryprocessor.inl |../../inc/cmrentryprocessor.inl + +PRJ_MMPFILES + +#include "../mrcaleventplugin/group/bld.inf" +#include "../mrprocessorplugin/group/bld.inf" + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/inc/cmrentryprocessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/inc/cmrentryprocessor.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef C_MRENTRYPROCESSOR_H +#define C_MRENTRYPROCESSOR_H + +#include "mmrentryprocessor.h" +#include "esmrdef.h" +#include + +class MESMRCalDbMgr; + +class CMREntryProcessor : + public CBase, + public MESMREntryProcessor + { +public: + static CMREntryProcessor* NewL( + TESMRCalendarEventType aEventType, + MESMRCalDbMgr& aCalDb ); + + ~CMREntryProcessor(); + +private: + /** iDtor_ID_Key Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; + }; + +#include "cmrentryprocessor.inl" + +#endif // C_MRENTRYPROCESSOR_H + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/inc/cmrentryprocessor.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/inc/cmrentryprocessor.inl Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: esmricalviewer inline methods +* +*/ + +#include +#include "esmrinternaluid.h" +// ----------------------------------------------------------------------------- +// CMREntryProcessor::NewL +// ----------------------------------------------------------------------------- +// +inline CMREntryProcessor* CMREntryProcessor::NewL( + TESMRCalendarEventType aEventType, + MESMRCalDbMgr& aCalDb ) + { + TAny* param = static_cast( &aCalDb ); + + TAny* ptr = NULL; + + switch (aEventType ) + { + case EESMREventTypeMeetingRequest: + { + TUid uid = TUid::Uid( KMRMeetingRequestProcessorImplementationUID ); + ptr = REComSession::CreateImplementationL( + uid, + _FOFF(CMREntryProcessor, iDtor_ID_Key ), + param ); + } + break; + + case EESMREventTypeAppt: + case EESMREventTypeETodo: + case EESMREventTypeEEvent: + case EESMREventTypeEReminder: + case EESMREventTypeEAnniv: + { + TUid uid = TUid::Uid( KMRCalEventProcessorImplementationUID ); + ptr = REComSession::CreateImplementationL( + uid, + _FOFF(CMREntryProcessor, iDtor_ID_Key ), + param ); + } + break; + } + + ASSERT( ptr ); + + return reinterpret_cast(ptr); + } + +// ----------------------------------------------------------------------------- +// CMRBCEventPlugin::~CMRBCEventPlugin +// ----------------------------------------------------------------------------- +// +inline CMREntryProcessor::~CMREntryProcessor() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/inc/mmrentryprocessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/inc/mmrentryprocessor.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MBUtils ECOM definition +* +*/ +#ifndef M_MRENTRYPROCESSOR_H +#define M_MRENTRYPROCESSOR_H + +#include +#include +#include "esmrdef.h" +#include "tesmrscenariodata.h" + +class MESMRCalEntry; +class CCalEntry; +class CCalInstance; + +/** + * MESMREntryProcessor defines interface for entry processing + */ +class MESMREntryProcessor + { +public: + virtual ~MESMREntryProcessor() {} + +public: // Interface + /** + * Fetches scenario data. + * + * @return scenario data. + */ + virtual const TESMRScenarioData& ScenarioData() const = 0; + + /** + * Tests, whether processor contains entry, which it has processed + * or not. + * + * @return ETrue, if contains processed entry. + */ + virtual TBool ContainsProcessedEntry() const = 0; + + /** + * Process entries and constructs scenario data. + * + * @param aParam AGN Entry UI input parameters. + * @param aEntries Calendar entries to be processed. + * Ownership is not transferred. + */ + virtual void ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + RPointerArray* aEntries ) = 0; + + /** + * Process entry and constructs scenario data. + * + * @param aParam AGN Entry UI input parameters. + * @param aEntry Calendar entry to be processed. + * @param aSetDefaultValuesToEntry, ETrue is default values + * should be set to entry, EFalse otherwise + * @param aTypeChanging entry type is changing + */ + virtual void ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry, + const TBool aTypeChanging = EFalse ) = 0; + + /** + * Process entries. Scenario data is not constructed. + * + * @param aEntries Calendar entries to be processed. + * Ownership is not transferred. + */ + virtual void ProcessL( + RPointerArray* aEntries ) = 0; + + /** + * Processes calendar instance. All operations affects only the + * processed instance. + * + * @param aInstance Reference to calendar instance. + */ + virtual void ProcessL( + CCalInstance& aInstance ) = 0; + + /** + * Switches processor for specified mode mode. + * @error KErrNotReady no entries has been processed yet. + * @error KErrArgument Unknown mode + */ + virtual void SwitchProcessorToModeL( + TMRProcessorMode aMode ) = 0; + + /** + * Fetches ES MR Entry. Methods panics, if entries has not + * been processed before calling this method. + * + * @return Reference to CESMRMeetingRequestEntry object. + */ + virtual MESMRCalEntry& ESMREntryL() = 0; + + /** + * Resets the entry processor. After calling this method the + * processor is in the same state than after creation. + */ + virtual void ResetL() = 0; + + /** + * Process output parameters. Processing is done according to command + * passed as parameter. + * + * @param aOutputParams Reference to output parameters. + * @param aCommand Command for which output parameters are processed. + */ + virtual void ProcessOutputParametersL( + MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, + TESMRCommand aCommand ) = 0; + + /** + * Returns extension interface. + * @param aExtensionUid Extension identifier + */ + virtual TAny* Extension( TUid /* aExtensionUid */ ) { return NULL; } + }; + +#endif // M_MRENTRYPROCESSOR_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/data/mrcaleventdata.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/data/mrcaleventdata.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for project bccalevent +* +*/ + + +#include +#include "esmralarminfo.rh" +#include "esmrdef.h" + +NAME CALD + +RESOURCE RSS_SIGNATURE { } + +// --------------------------------------------------------------------------- +// bccalevent_alarm_info_table +// Business Calendar event relative alarm definitions +// --------------------------------------------------------------------------- +// +RESOURCE ESMR_ALARM_INFO_TABLE mrcalevent_alarm_info_table + { + alarm_infos = + { + ESMR_ALARM_INFO + { + alarm_id = EAlarmOff; + relatime_alarm_in_minutes = -1; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmZeroMinutes; + relatime_alarm_in_minutes = 0; + }, + ESMR_ALARM_INFO { + alarm_id = EAlarmFiveMinutes; + relatime_alarm_in_minutes = 5; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmFifteenMinutes; + relatime_alarm_in_minutes = 15; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmThirtyMinutes; + relatime_alarm_in_minutes = 30; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmOneHour; + relatime_alarm_in_minutes = 60; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmTwoHours; + relatime_alarm_in_minutes = 120; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmThreeHours; + relatime_alarm_in_minutes = 180; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmFourHours; + relatime_alarm_in_minutes = 240; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmFiveHours; + relatime_alarm_in_minutes = 300; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmSixHours; + relatime_alarm_in_minutes = 360; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmSevenHours; + relatime_alarm_in_minutes = 420; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmEightHours; + relatime_alarm_in_minutes = 480; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmTwelveHours; + relatime_alarm_in_minutes = 720; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmOneDay; + relatime_alarm_in_minutes = 1440; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmTwoDays; + relatime_alarm_in_minutes = 2880; + }, + ESMR_ALARM_INFO + { + alarm_id = EAlarmOneWeek; + relatime_alarm_in_minutes = 10080; + } + }; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/data/mrcaleventplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/data/mrcaleventplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for ECOM registry. +* +*/ + + +// INCLUDES +#include +#include "esmrinternaluid.h" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// theInfo +// ECOM registry information for ESMRVIEWER ECOM implementation +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRCalEventProcessorImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMREntryProcessorInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRCalEventProcessorImplementationUID; + version_no = 1; + display_name = ""; + default_data = ""; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build definition file. +* +* +*/ + + +#include + +PRJ_EXPORTS + +PRJ_MMPFILES +mrcaleventplugin.mmp + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/group/mrcaleventplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/group/mrcaleventplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +#include "../../../mrcommon/inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrcaleventplugin.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRCalEventProcessorImplementationUID + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmrcaleventprocessor.cpp +SOURCE cmrcalentry.cpp +SOURCE dllmain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../mrcommon/inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data/ +START RESOURCE mrcaleventplugin.rss +TARGET mrcaleventplugin.rsc +END + +SOURCEPATH ../data/ +START RESOURCE mrcaleventdata.rss +HEADER +TARGET mrcaleventdata +TARGETPATH RESOURCE_FILES_DIR +END + +LIBRARY esmrcommon.lib +LIBRARY esmrentry.lib +LIBRARY esmrservices.lib + +LIBRARY ecom.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY euser.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY charconv.lib +LIBRARY eikcoctl.lib +LIBRARY calinterimapi.lib +LIBRARY caleninterimutils2.lib +LIBRARY centralrepository.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/inc/cmrcalentry.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/inc/cmrcalentry.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: CCalEntry wrapper class +* +*/ + + +#ifndef C_MRCALENTRY_H +#define C_MRCALENTRY_H + +#include +#include +#include +#include +#include "mesmrcalentry.h" + +class CCalEntry; +class MESMRCalDbMgr; + + /** + * Provides utility functions for handling calendar entry. + */ +NONSHARABLE_CLASS( CMRCalEntry ) : + public CBase, + public MESMRCalEntry + { +public: + /** + * Two-phased constructor. + * @param aEntry Calendar Entry . + * @param aGlobalData Calendar Global data instace. + * @param aInstanceTime Entry instance time. + * @param aEditorMode Defines: creating new / editing existing / viewing entry + */ + /*static CMRCalEntry* NewL( + CCalEntry& aEntry, + MCalenServices& aServices, + const TCalTime& aInstanceTime, + MAgnEntryUi::TAgnEntryUiEditorMode aEditorMode );*/ + + static CMRCalEntry* NewL( + CCalEntry& aEntry, + MESMRCalDbMgr& aCalDb ); + + /** + * C++ destructor. + */ + ~CMRCalEntry(); + + /** + * Updates the original entry. This is used when user store the entry + * without exiting the editor. + */ + void UpdateComparativeEntryL(); + +// From MESMRCalEntry + + TESMRCalEntryType Type() const; + MESMRCalEntry& MESMRCalEntryRef(); + const MESMRCalEntry& MESMRCalEntryRef() const; + const CCalEntry& Entry() const; + CCalEntry& Entry(); + CCalInstance* InstanceL() const; + TBool CanSetRecurrenceL() const; + void GetRecurrenceL( TESMRRecurrenceValue& aRecurrence, + TTime& aUntil ) const; + TBool IsAllDayEventL() const; + void SetRecurrenceL( TESMRRecurrenceValue aRecurrence, + TTime aUntil = Time::NullTTime() ); + void SetAllDayEventL( TTime aStartDate, + TTime aEndDate ); + TBool IsStoredL() const; + TBool IsEntryEditedL() const; + TBool IsRecurrentEventL() const; + TBool IsEntryTypeChangedL() const; + TESMRRecurrenceModifyingRule RecurrenceModRule() const; + void SetModifyingRuleL( TESMRRecurrenceModifyingRule aRule, + const TBool aTypeChanging = EFalse ); + void SetPriorityL( + TUint aPriority ); + TUint GetPriorityL() const; + void GetAlarmL( TESMRAlarmType& aAlarmType, + TTime &aAlarmTime ); + const CCalEntry& OriginalEntry(); + void UpdateEntryAfterStoringL(); + void UpdateComparativeEntry( CCalEntry* aNewComparativeEntry ); + void SetDefaultValuesToEntryL(); + void UpdateTimeStampL(); + CCalEntry* CloneEntryLC( TESMRCalEntryType aType ) const; + CCalEntry* ValidateEntryL(); + CCalEntry* RemoveInstanceFromSeriesL(); + MESMRCalDbMgr& GetDBMgr(); + TBool SupportsCapabilityL( + MESMRCalEntry::TMREntryCapability aCapability ) const; + TBool ContainsRemoteAttachmentsL(); + void SetTypeChanged( TBool aTypeChanged ); + TBool AnyInstancesBetweenTimePeriodL( + TTime& aStart, + TTime& aEnd ); + void GetFirstInstanceStartAndEndTimeL( + TTime& aStart, + TTime& aEnd ); + TBool IsRepeatingMeetingL( + const CCalEntry& aEntry) const; + +private: // Implementation + CMRCalEntry( MESMRCalDbMgr& aCalDb ); + void ConstructL( + CCalEntry& aEntry ); + + CCalEntry* CreateCopyL( CCalEntry& aSourceEntry ); + + + void CreateInternalEntryL(); + void SetDefaultValuesForTodoL(); + void SetDefaultValuesForMemoL(); + void SetDefaultValuesForMeetingL(); + void SetDefaultValuesForAnniversaryL(); + inline CCalEntry* DoGetEntry() const; + CCalEntry* ValidateMeetingL(); + +private: // Data + /// Ref: Caledar global data utility class + // MCalenServices& iServices; // Not owned, don't release here. + /// Own: Calendar entry + CCalEntry* iEntry; + /// Own: Copy of calendar entry instance + CCalEntry* iComparativeEntry; + /// Own: Copy from client. + CCalEntry* iOriginalEntry; + /// Own: Entry modifying rule + TESMRRecurrenceModifyingRule iRecurrenceModRule; + /// Own: Instance time + TCalTime iInstanceTime; + /// Cal DB Manager mode: + MESMRCalDbMgr& iCalDb; + // Own: Indicates if the entry is type changed or not + TBool iTypeChanged; + }; + +#endif // CBCCALENTRY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/inc/cmrcaleventprocessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/inc/cmrcaleventprocessor.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR mr entry processor +* +*/ + +#ifndef C_MRCALENTRYPROCESSOR_H +#define C_MRCALENTRYPROCESSOR_H + +#include +#include "cmrentryprocessor.h" + +class MESMRCalDbMgr; +class CMRCalEntry; + +/** +* CESMREntryProcessor's main responsibility is to +* perform entry processing and evaluation in initialization phase. +* +* @lib esmrentry.lib +*/ +NONSHARABLE_CLASS(CMRCalEntryProcessor) : + public CMREntryProcessor + { +public: // Construction and destruction + /** + * Creates new CESMREntryProcessor object. Ownership + * is transferred to caller. + * @param aDbMgr Reference to calendar DB manager. + * @return Pointer to created CESMREntryProcessor object, + */ + static CMRCalEntryProcessor* NewL( + TAny* aDbMgr ); + + /** + * C++ destructor + */ + ~CMRCalEntryProcessor(); + +public: // From MESMREntryProcessor + const TESMRScenarioData& ScenarioData() const; + TBool ContainsProcessedEntry() const; + void ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + RPointerArray* aEntries ); + void ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry, + const TBool aTypeChanging = EFalse ); + void ProcessL( + RPointerArray* aEntries ); + void ProcessL( + CCalInstance& aInstance ); + void SwitchProcessorToModeL( + TMRProcessorMode aMode ); + MESMRCalEntry& ESMREntryL(); + void ResetL(); + void ProcessOutputParametersL( + MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, + TESMRCommand aCommand ); + +private: // Implementaton + + static CMRCalEntryProcessor* CreateL( + MESMRCalDbMgr& aDbMgr ); + + CMRCalEntryProcessor( + MESMRCalDbMgr& aDbMgr); + void ConstructL(); + TBool IsDataOk() const; + void CreateEntryL( CCalEntry& aEntry, TBool aSetDefaultValuesToEntry ); + void ConvertTextFieldLineFeedsL(); + void ConvertTextFieldLineFeedsL( CCalEntry& aEntry ); + +private: // Data + /** + * Scenario data + * Own. + */ + TESMRScenarioData iScenData; + + /** + * Reference to calendar DB manager + * Not own. + */ + MESMRCalDbMgr& iDbMgr; + + /** + * Calendar entry + * Own. + */ + CMRCalEntry* iCalEntry; + + /** + * Input parameters from calling application + * Not own. + */ + const MAgnEntryUi::TAgnEntryUiInParams* iParams; + + /** + * Entries to be processed + * Not own. + */ + RPointerArray* iCalEntries; + }; + +#endif // C_MRCALENTRYPROCESSOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/src/cmrcalentry.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/src/cmrcalentry.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,1534 @@ +/* +* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Calendar Entry wrapper implementation +* +*/ + + +// INCLUDE FILES + +#include "cmrcalentry.h" +#include "esmrhelper.h" + +#include "cesmrrecurrenceinfohandler.h" +#include "cesmralarminfohandler.h" +#include "tesmralarminfo.h" +#include "cesmrcaluserutil.h" +#include "cesmrcaldbmgr.h" +#include "esmrentryhelper.h" +#include "cesmrconflictchecker.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +const TInt KHoursInDay( 24 ); +const TInt KDefaultTodoAlarmHours( 12 ); +const TInt KDefaultAnniversaryAlarmHours( 12 ); + +// Definition for max hours, minutes, seconds in day for To-Do +const TInt KMaxHoursForTodo( 23 ); +const TInt KMaxMinutesForTodo( 59 ); +const TInt KMaxSecondsForTodo( 00 ); + +// Definition for max hours, minutes, seconds in day for Memo +const TInt KMaxHoursForMemo( 23 ); +const TInt KMaxMinutesForMemo( 59 ); +const TInt KMaxSecondsForMemo( 59 ); + +// Definition for default alarm time for meeting +const TInt KDefaultMeetingAlarmMinutes( 15 ); + +// Definitions for alarm information resource file +_LIT( KAlarmInfoResource, "mrcaleventdata.rsc" ); + +#ifdef _DEBUG + +// Definition for panic text +_LIT( KBCCalEntryPanicTxt, "MRCalEntry" ); + +enum TBCCalEntryPanic + { + EBCCalEntryNotExist = 1, // Entry does not exist + }; + +// --------------------------------------------------------------------------- +// Raises panic. +// --------------------------------------------------------------------------- +// +void Panic(TBCCalEntryPanic aPanic) + { + User::Panic( KBCCalEntryPanicTxt, aPanic); + } + +#endif // _DEBUG + +} // namespace + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRCalEntry::CMRCalEntry +// --------------------------------------------------------------------------- +// +CMRCalEntry::CMRCalEntry( + MESMRCalDbMgr& aCalDb ) +: iCalDb( aCalDb ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::~CMRCalEntry +// --------------------------------------------------------------------------- +// +CMRCalEntry::~CMRCalEntry() + { + FUNC_LOG; + delete iEntry; + delete iOriginalEntry; + delete iComparativeEntry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::NewL +// --------------------------------------------------------------------------- +// +CMRCalEntry* CMRCalEntry::NewL( + CCalEntry& aEntry, + MESMRCalDbMgr& aCalDb ) + { + FUNC_LOG; + + CMRCalEntry* self = new (ELeave) CMRCalEntry( aCalDb ); + CleanupStack::PushL( self ); + self->ConstructL( aEntry ); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::ConstructL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::ConstructL( + CCalEntry& aEntry ) + { + FUNC_LOG; + iOriginalEntry = CreateCopyL( aEntry ); + + // Create the entry for editing: + iEntry = CreateCopyL( *iOriginalEntry ); + + // Create copy of initialized entry for + // comparing purposes e.g. IsEntryEdited. + iComparativeEntry = CreateCopyL( *iEntry ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::CreateCopyL +// +CCalEntry* CMRCalEntry::CreateCopyL( CCalEntry& aSourceEntry ) + { + FUNC_LOG; + CCalEntry* entry = + ESMRHelper::CopyEntryL( + aSourceEntry, + aSourceEntry.MethodL(), + ESMRHelper::ECopyFull ); + + return entry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::Type +// --------------------------------------------------------------------------- +// +MESMRCalEntry::TESMRCalEntryType CMRCalEntry::Type() const + { + FUNC_LOG; + + MESMRCalEntry::TESMRCalEntryType type( EESMRCalEntryNotSupported ); + + CCalEntry::TType entryType( CCalEntry::EAppt ); + + TRAP_IGNORE( { + entryType = DoGetEntry()->EntryTypeL(); + } ); + + switch ( entryType ) + { + case CCalEntry::EAppt: + { + type = EESMRCalEntryMeeting; + break; + } + case CCalEntry::ETodo: + { + type = EESMRCalEntryTodo; + break; + } + case CCalEntry::EEvent: + { + type = EESMRCalEntryMemo; + break; + } + case CCalEntry::EReminder: + { + type = EESMRCalEntryReminder; + break; + } + case CCalEntry::EAnniv: + { + type = EESMRCalEntryAnniversary; + break; + } + default: + break; + } + + return type; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::MESMRCalEntryRef +// --------------------------------------------------------------------------- +// +MESMRCalEntry& CMRCalEntry::MESMRCalEntryRef() + { + FUNC_LOG; + return *this; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::MESMRCalEntryRef +// --------------------------------------------------------------------------- +// +const MESMRCalEntry& CMRCalEntry::MESMRCalEntryRef() const + { + FUNC_LOG; + return *this; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::Entry +// --------------------------------------------------------------------------- +// +const CCalEntry& CMRCalEntry::Entry() const + { + FUNC_LOG; + return *DoGetEntry(); + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::Entry +// --------------------------------------------------------------------------- +// +CCalEntry& CMRCalEntry::Entry() + { + FUNC_LOG; + return *DoGetEntry(); + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::InstanceL +// --------------------------------------------------------------------------- +// +CCalInstance* CMRCalEntry::InstanceL() const + { + FUNC_LOG; + + CCalInstance* instance = NULL; + + instance = iCalDb.FindInstanceL( *DoGetEntry() ); + if ( !instance ) + { + // Instance not found by using the edited entry + // Trying with orginal. + instance = iCalDb.FindInstanceL( *iComparativeEntry ); + } + + if ( !instance ) + { + // Instance not found by using edited or orginal entry. + // --> Leave + User::Leave( KErrNotFound ); + } + + return instance; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::CanSetRecurrenceL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::CanSetRecurrenceL() const + { + FUNC_LOG; + + TBool canSetRecurrence( ETrue ); + + if ( DoGetEntry()->EntryTypeL() == CCalEntry::EAppt && + IsRepeatingMeetingL(*iEntry) && + (!ESMREntryHelper::IsModifyingEntryL(*iEntry) && + MESMRCalEntry::EESMRThisOnly == iRecurrenceModRule )) + { + canSetRecurrence = EFalse; + } + + return canSetRecurrence; + } + + +// --------------------------------------------------------------------------- +// CMRCalEntry::GetRecurrenceL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::GetRecurrenceL( + TESMRRecurrenceValue& aRecurrence, + TTime& aUntil ) const + { + FUNC_LOG; + + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( *DoGetEntry() ); + + recurrenceHandler->GetRecurrenceL( aRecurrence, aUntil ); + CleanupStack::PopAndDestroy( recurrenceHandler ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::IsAllDayEventL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::IsAllDayEventL() const + { + FUNC_LOG; + + TBool allDayEvent(EFalse); + + CCalEntry::TType entryType = DoGetEntry()->EntryTypeL(); + + if ( (CCalEntry::EAppt == entryType) || + (CCalEntry::EEvent == entryType) ) + { + TCalTime startTime = iEntry->StartTimeL(); + TCalTime stopTime = iEntry->EndTimeL(); + + TTimeIntervalHours hoursBetweenStartAndEnd; + stopTime.TimeLocalL().HoursFrom( + startTime.TimeLocalL(), + hoursBetweenStartAndEnd ); + + TCalTime::TTimeMode mode = startTime.TimeMode(); + + TInt hoursBetweenStartAndEndAsInt( hoursBetweenStartAndEnd.Int() ); + TInt alldayDivident( hoursBetweenStartAndEndAsInt % KHoursInDay ); + + if ( hoursBetweenStartAndEndAsInt && 0 == alldayDivident ) + { + TDateTime startTimeLocal = startTime.TimeLocalL().DateTime(); + TDateTime stopTimeLocal = stopTime.TimeLocalL().DateTime(); + + if ( startTimeLocal.Hour() == 0 && + startTimeLocal.Minute() == 0 && + startTimeLocal.Minute() == stopTimeLocal.Minute() && + startTimeLocal.Second() == 0 && + startTimeLocal.Second() == stopTimeLocal.Second() ) + { + allDayEvent = ETrue; + } + } + } + + return allDayEvent; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::SetRecurrenceL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::SetRecurrenceL( + TESMRRecurrenceValue aRecurrence, + TTime aUntil ) + { + FUNC_LOG; + // Check if this entry's recurrence can be edited + + if ( !CanSetRecurrenceL() ) + { + User::Leave( KErrNotSupported ); + } + + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( *DoGetEntry() ); + + recurrenceHandler->SetRecurrenceL( aRecurrence, aUntil ); + CleanupStack::PopAndDestroy( recurrenceHandler ); + + iRecurrenceModRule = MESMRCalEntry::EESMRAllInSeries; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::SetAllDayEventL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::SetAllDayEventL( TTime aStartDate, TTime aEndDate) + { + FUNC_LOG; + TCalTime startTime; + TCalTime stopTime; + + TDateTime start; + TDateTime end; + + // set the start time to 0:00 + start.Set( aStartDate.DateTime().Year(), + aStartDate.DateTime().Month(), + aStartDate.DateTime().Day(), + 0, + 0, + 0, + 0); + + // set the end date to next day from given end date since + // all day event should last 24 hours. + aEndDate += TTimeIntervalDays( 1 ); + + end.Set( aEndDate.DateTime().Year(), + aEndDate.DateTime().Month(), + aEndDate.DateTime().Day(), + 0, + 0, + 0, + 0); + + startTime.SetTimeLocalL( start ); + stopTime.SetTimeLocalL( end ); + + DoGetEntry()->SetStartAndEndTimeL( startTime, stopTime ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::IsStoredL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::IsStoredL() const + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic(EBCCalEntryNotExist ) ); + + TBool ret(EFalse); + CCalEntry* dbEntry = NULL; + + TRAPD( err, dbEntry = iCalDb.FetchEntryL( + iEntry->UidL(), + iEntry->RecurrenceIdL() ) ); + + if ( KErrNotFound == err ) + { + // Error has occured while retrieving an entry + ret = EFalse; + } + else if ( dbEntry) + { + // Entry was found from the calendar db --> it is stored for sure. + ret = ETrue; + } + + delete dbEntry; + + return ret; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::IsEntryEditedL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::IsEntryEditedL() const + { + FUNC_LOG; + + TBool isSame(ETrue); + + // The compare entry has not been created yet; so + // entry has not changed. + if ( iComparativeEntry ) + { + isSame = iComparativeEntry->CompareL( *DoGetEntry() ); + + // CCalEntry's CompareL doesn't check the priority value: + if ( isSame && iEntry->PriorityL() != iComparativeEntry->PriorityL() ) + { + isSame = EFalse; + } + else if ( iEntry->DescriptionL() != iComparativeEntry->DescriptionL() ) + { + isSame = EFalse; + } + else if ( iEntry->LocationL() != iComparativeEntry->LocationL() ) + { + isSame = EFalse; + } + else if ( iEntry->ReplicationStatusL() != iComparativeEntry->ReplicationStatusL() ) + { + isSame = EFalse; + } + + if ( IsStoredL() ) + if ( iCalDb.EntryViewL( *iEntry ) != iCalDb.EntryView() ) + { + isSame = EFalse; + } + } + + + + return !isSame; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::IsRecurrentEventL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::IsRecurrentEventL() const + { + FUNC_LOG; + if ( DoGetEntry()->EntryTypeL() != CCalEntry::EAppt ) + { + return EFalse; + } + + TBool recurrenceEvent( EFalse ); + if ( IsStoredL() ) + { + // Entry is stored in calendar db + // Lets look recurrence using instance + + // Ownership is transferred + CCalInstance* instance = NULL; + TRAPD(err, instance = InstanceL() ); + if ( KErrNotFound != err ) + { + User::LeaveIfError( err ); + } + + if ( instance ) + { + CleanupStack::PushL( instance ); + + CCalEntry& instanceParentEntry = instance->Entry(); + + if ( IsRepeatingMeetingL( instanceParentEntry ) ) + { + recurrenceEvent = ETrue; + } + CleanupStack::PopAndDestroy( instance ); + } + else + { + if ( IsRepeatingMeetingL( *iEntry ) ) + { + recurrenceEvent = ETrue; + } + } + } + else + { + // Entry is not stored in calendar db + if ( IsRepeatingMeetingL( *iEntry ) ) + { + // This is repeating meeting + recurrenceEvent = ETrue; + } + } + + return recurrenceEvent; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::IsEntryTypeChangedL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::IsEntryTypeChangedL() const + { + FUNC_LOG; + + return iTypeChanged; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::SetModifyingRuleL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::SetModifyingRuleL( TESMRRecurrenceModifyingRule aRule, + const TBool aTypeChanging ) + { + FUNC_LOG; + + CESMRRecurrenceInfoHandler* recHandler = + CESMRRecurrenceInfoHandler::NewL( *iComparativeEntry ); + CleanupStack::PushL( recHandler ); + + TESMRRecurrenceValue orginalRecurrence; + TTime orginalUntil; + + recHandler->GetRecurrenceL( + orginalRecurrence, + orginalUntil); + CleanupStack::PopAndDestroy( recHandler ); + recHandler = NULL; + + TBool modifyingEntry( ESMREntryHelper::IsModifyingEntryL( *DoGetEntry() ) ); + + if ( MESMRCalEntry::EESMRAllInSeries == aRule && IsStoredL() && !aTypeChanging) + { + // When we want to modify series of recurrence entries --> + // Parent entry is modified + if ( ERecurrenceNot == orginalRecurrence && !modifyingEntry ) + { + // Orginal entry was not recurrent event + // No need to fect instance at all + // For modifying entries we need to fetch the original parent entry + iRecurrenceModRule = aRule; + return; + } + + CCalInstance* instance = NULL; + TRAPD(err, instance = InstanceL() ); + if( KErrNotFound != err ) + { + User::LeaveIfError( err ); + } + + if ( instance ) + { + CleanupStack::PushL( instance ); + + CCalEntry::TMethod entryMethod( iEntry->MethodL() ); + + delete iEntry; + iEntry = NULL; + + delete iComparativeEntry; + iComparativeEntry = NULL; + + RCPointerArray entries; + CleanupClosePushL( entries ); + + iCalDb.EntryViewL( instance->Entry() )->FetchL( + instance->Entry().UidL(), entries ); + + TInt parentIndex( KErrNotFound ); + TInt entryCount( entries.Count() ); + for ( TInt i(0); i < entryCount && KErrNotFound == parentIndex; ++i ) + { + TBool modifyingEntry( ESMREntryHelper::IsModifyingEntryL( *entries[i]) ); + if ( !modifyingEntry ) + { + parentIndex = i; + } + } + + CCalEntry& parent = *entries[parentIndex]; + + TPtrC description( parent.DescriptionL() ); + + iEntry = CreateCopyL( parent ); + + // Adjust parent entry's start and end time to entry + TCalTime start; + TCalTime end; + + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( parent ); + + recurrenceHandler->GetFirstInstanceTimeL( start, end ); + CleanupStack::PopAndDestroy( recurrenceHandler ); + recurrenceHandler = NULL; + + iEntry->SetStartAndEndTimeL( start, end ); + + iComparativeEntry = CreateCopyL( *iEntry ); + + iEntry->SetDescriptionL( description ); + iComparativeEntry->SetDescriptionL( description ); + + CleanupStack::PopAndDestroy(); // entries + CleanupStack::PopAndDestroy( instance ); + } + } + else if ( ERecurrenceNot != orginalRecurrence && + aTypeChanging && !modifyingEntry ) + { + // if entry( in the memory) is a recurrent event + // ,and if entry type is changing, and not in modifying status then EESMRAllInSeries + iRecurrenceModRule = EESMRAllInSeries ; + return; + } + + + iRecurrenceModRule = aRule; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::RecurrenceModRule +// --------------------------------------------------------------------------- +// +MESMRCalEntry::TESMRRecurrenceModifyingRule + CMRCalEntry::RecurrenceModRule() const + { + FUNC_LOG; + return iRecurrenceModRule; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::GetAlarmL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::GetAlarmL(TESMRAlarmType& aAlarmType, TTime &aAlarmTime ) + { + FUNC_LOG; + + aAlarmType = MESMRCalEntry::EESMRAlarmNotFound; + aAlarmTime = Time::NullTTime(); + + TFileName alarmInfoResource; + ESMRHelper::LocateResourceFile( + KAlarmInfoResource, + KDC_RESOURCE_FILES_DIR, + alarmInfoResource); + + CESMRAlarmInfoHandler* alarmInfoHandler = + CESMRAlarmInfoHandler::NewLC(); + + alarmInfoHandler->ReadFromResourceL( + alarmInfoResource, + MRCALEVENT_ALARM_INFO_TABLE ); + + TRAPD( err, + alarmInfoHandler->GetAbsoluteAlarmTimeL(*DoGetEntry(), aAlarmTime) ); + + if ( KErrNone == err ) + { + aAlarmType = MESMRCalEntry::EESMRAlarmAbsolute; + + // only meeting that is not allday event can have relative alarm: + if ( Type() == EESMRCalEntryMeeting && !IsAllDayEventL() ) + { + TESMRAlarmInfo alarmInfo; + TRAP( err, + alarmInfoHandler->GetAlarmInfoObjectL(*iEntry, alarmInfo) ); + + if ( KErrNone == err ) + { + aAlarmType = MESMRCalEntry::EESMRAlarmRelative; + if( alarmInfo.iRelativeAlarmInSeconds < 0 ) + { + aAlarmType = MESMRCalEntry::EESMRAlarmNotFound; + } + } + } + } + + CleanupStack::PopAndDestroy( alarmInfoHandler ); + alarmInfoHandler = NULL; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::OriginalEntry +// --------------------------------------------------------------------------- +// +const CCalEntry& CMRCalEntry::OriginalEntry() + { + FUNC_LOG; + return *iComparativeEntry; + } + + + +// ---------------------------------------------------------------------------- +// CMRCalEntry::IsRepeatingMeetingL +// ---------------------------------------------------------------------------- +// +TBool CMRCalEntry::IsRepeatingMeetingL(const CCalEntry& aEntry) const + { + FUNC_LOG; + TBool retVal( EFalse ); + + if ( ESMREntryHelper::IsModifyingEntryL(aEntry) ) + { + retVal = ETrue; + } + else + { + TCalRRule dummyRule; + if ( aEntry.GetRRuleL( dummyRule ) ) + { + retVal = ETrue; + } + else + { + RArray dummyRDateList; + CleanupClosePushL( dummyRDateList ); + aEntry.GetRDatesL( dummyRDateList ); + if ( dummyRDateList.Count() > 0 ) + { + retVal = ETrue; + } + CleanupStack::PopAndDestroy(); // dummyRDateList + } + } + + return retVal; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::SetPriorityL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::SetPriorityL ( TUint aPriority ) + { + FUNC_LOG; + DoGetEntry()->SetPriorityL( aPriority ); + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestEntry::GetPriorityL +// --------------------------------------------------------------------------- +// +TUint CMRCalEntry::GetPriorityL() const + { + FUNC_LOG; + TUint entryPriority = DoGetEntry()->PriorityL(); + + if ( iEntry->EntryTypeL() == CCalEntry::ETodo ) + { + if ( entryPriority != EFSCalenTodoPriorityLow && + entryPriority != EFSCalenTodoPriorityNormal && + entryPriority != EFSCalenTodoPriorityHigh ) + { + entryPriority = EFSCalenTodoPriorityNormal; + } + } + else + { + if ( entryPriority != EFSCalenMRPriorityLow && + entryPriority != EFSCalenMRPriorityNormal && + entryPriority != EFSCalenMRPriorityHigh ) + { + entryPriority = EFSCalenMRPriorityNormal; + } + } + + return entryPriority; + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::UpdateEntryAfterStoringL +// ---------------------------------------------------------------------------- +// +void CMRCalEntry::UpdateEntryAfterStoringL() + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic( EBCCalEntryNotExist ) ); + + CCalEntry* storedEntry = NULL; + + if ( IsRecurrentEventL() && + EESMRThisOnly == iRecurrenceModRule && + IsStoredL() && !ESMREntryHelper::IsModifyingEntryL(*iEntry) ) + { + // We have stored one instance of series. + storedEntry = iCalDb.FetchEntryL( + iEntry->UidL(), + iComparativeEntry->StartTimeL() ); + } + else + { + // We are dealing with single instance or with the series + storedEntry = iCalDb.FetchEntryL( + iEntry->UidL(), + iEntry->RecurrenceIdL() ); + } + + __ASSERT_DEBUG( storedEntry, Panic( EBCCalEntryNotExist ) ); + CleanupStack::PushL( storedEntry ); + + // Description needs to be fecthed explicitly into memory + TPtrC description( storedEntry->DescriptionL() ); + + delete iEntry; + iEntry = NULL; + iEntry = CreateCopyL(*storedEntry); + + if ( MESMRCalEntry::EESMRAllInSeries == iRecurrenceModRule && + IsRecurrentEventL() ) + { + // Adjust parent entry's start and end time to entry + TCalTime start; + TCalTime end; + + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( *iEntry ); + + recurrenceHandler->GetFirstInstanceTimeL( start, end ); + CleanupStack::PopAndDestroy( recurrenceHandler ); + recurrenceHandler = NULL; + + iEntry->SetStartAndEndTimeL( start, end ); + iEntry->SetDescriptionL( description ); + } + + CCalEntry* temp = CreateCopyL( *iEntry ); + + delete iComparativeEntry; + iComparativeEntry = temp; + + CleanupStack::PopAndDestroy( storedEntry ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::SetDefaultValuesToEntryL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::SetDefaultValuesToEntryL() + { + FUNC_LOG; + + if ( !IsStoredL() ) + { + // by default when creating a meeting the priority + // value is normal + switch ( DoGetEntry()->EntryTypeL() ) + { + case CCalEntry::ETodo: + { + SetDefaultValuesForTodoL(); + } + break; + case CCalEntry::EEvent: // Memo + { + SetDefaultValuesForMemoL(); + } + break; + case CCalEntry::EAppt: + { + SetDefaultValuesForMeetingL(); + } + break; + case CCalEntry::EAnniv: + default: + { + SetDefaultValuesForAnniversaryL(); + } + break; + } + iEntry->SetReplicationStatusL( CCalEntry::EOpen ); + + // Entry has now been set up with default values; + // Let's update comparative entry + delete iComparativeEntry; + iComparativeEntry = NULL; + + iComparativeEntry = CreateCopyL( *iEntry ); + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::UpdateTimeStampL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::UpdateTimeStampL() + { + FUNC_LOG; + + ASSERT( iEntry ); + + TTime currentUTCTime; + currentUTCTime.UniversalTime(); + + TCalTime currentTime; + currentTime.SetTimeUtcL( currentUTCTime ); + + iEntry->SetDTStampL( currentTime ); + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::CloneEntryLC +// ---------------------------------------------------------------------------- +// +CCalEntry* CMRCalEntry::CloneEntryLC( TESMRCalEntryType aType ) const + { + CCalEntry* entry = ESMRHelper::CopyEntryLC( + *DoGetEntry(), + iEntry->MethodL(), + ESMRHelper::ECopyFull, + TESMRCalendarEventType( aType ) ); + + return entry; + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::UpdateComparativeEntry +// ---------------------------------------------------------------------------- +// +void CMRCalEntry::UpdateComparativeEntry( CCalEntry* aNewComparativeEntry ) + { + FUNC_LOG; + if( iComparativeEntry ) + { + delete iComparativeEntry; + iComparativeEntry = NULL; + + iComparativeEntry = aNewComparativeEntry; + } + + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::SetDefaultValuesForTodoL +// ---------------------------------------------------------------------------- +// +void CMRCalEntry::SetDefaultValuesForTodoL() + { + FUNC_LOG; + + SetPriorityL( EFSCalenTodoPriorityNormal ); + + // Update event time + TDateTime start = iEntry->StartTimeL().TimeLocalL().DateTime(); + start.SetHour( KMaxHoursForTodo ); + start.SetMinute( KMaxMinutesForTodo ); + start.SetSecond( KMaxSecondsForTodo ); + + TCalTime dueTime; + dueTime.SetTimeLocalL( start ); + iEntry->SetStartAndEndTimeL( dueTime, dueTime ); + + // Create default alarm + TTime eventTime = iEntry->EndTimeL().TimeLocalL(); + + // Calculate alarm time (due date at 12:00am) + TTime alarmTime = eventTime; + TDateTime alarmDateTime = alarmTime.DateTime(); + alarmDateTime.SetHour( KDefaultTodoAlarmHours ); + alarmDateTime.SetMinute( 0 ); + alarmDateTime.SetSecond( 0 ); + alarmDateTime.SetMicroSecond( 0 ); + alarmTime = alarmDateTime; + + TTime currentTime; + currentTime.HomeTime(); + + if ( alarmTime > currentTime ) + { + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + TTimeIntervalMinutes alarmOffset( 0 ); + eventTime.MinutesFrom( alarmTime, alarmOffset ); + alarm->SetTimeOffset( alarmOffset ); + iEntry->SetAlarmL( alarm ); + CleanupStack::PopAndDestroy( alarm ); + } + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::SetDefaultValuesForMemoL +// ---------------------------------------------------------------------------- +// +void CMRCalEntry::SetDefaultValuesForMemoL() + { + FUNC_LOG; + + SetPriorityL( EFSCalenMRPriorityNormal ); + + // Update event time + TDateTime start = iEntry->StartTimeL().TimeLocalL().DateTime(); + start.SetHour( 0 ); + start.SetMinute( 0 ); + start.SetSecond( 0 ); + + TDateTime end = iEntry->EndTimeL().TimeLocalL().DateTime(); + end.SetHour( KMaxHoursForMemo ); + end.SetMinute( KMaxMinutesForMemo ); + end.SetSecond( KMaxSecondsForMemo ); + + TCalTime startTime; + startTime.SetTimeLocalL( start ); + TCalTime endTime; + endTime.SetTimeLocalL( end ); + + iEntry->SetStartAndEndTimeL( startTime, endTime ); + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::SetDefaultValuesForMeetingL +// ---------------------------------------------------------------------------- +// +void CMRCalEntry::SetDefaultValuesForMeetingL() + { + FUNC_LOG; + + SetPriorityL( EFSCalenMRPriorityNormal ); + + // Get default alarm time from central repository + TInt defaultAlarmTime; + CRepository* repository = CRepository::NewLC( TUid::Uid(0x101F874B) /*KCRUidCalendar*/ ); + TInt err = repository->Get( KCalendarDefaultAlarmTime, defaultAlarmTime ); + CleanupStack::PopAndDestroy( repository ); + + if ( err != KErrNone ) + { + defaultAlarmTime = KDefaultMeetingAlarmMinutes; + } + + // Getting current time + TTime currentTime; + currentTime.HomeTime(); + + // Getting meeting start time + TTime start = iEntry->StartTimeL().TimeLocalL(); + + // Create default alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + + TTimeIntervalMinutes alarmOffset( defaultAlarmTime ); + + // If alarm time is in past + if ( ( start - alarmOffset ) < currentTime ) + { + // Setting alarm off + iEntry->SetAlarmL( NULL ); + } + else + { + // Set default alarm time + alarm->SetTimeOffset( alarmOffset ); + iEntry->SetAlarmL( alarm ); + } + CleanupStack::PopAndDestroy( alarm ); + + if ( iEntry->StartTimeL().TimeUtcL() == iEntry->EndTimeL().TimeUtcL() ) + { + // Should this value be read from cenrep? + TTimeIntervalHours KDefaultMeetingDuration(1); + + TCalTime newEndTime; + newEndTime.SetTimeUtcL( + iEntry->StartTimeL().TimeUtcL() + KDefaultMeetingDuration ); + iEntry->SetStartAndEndTimeL(iEntry->StartTimeL(), newEndTime); + } + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::SetDefaultValuesForAnniversaryL +// ---------------------------------------------------------------------------- +// +void CMRCalEntry::SetDefaultValuesForAnniversaryL() + { + FUNC_LOG; + + SetPriorityL( EFSCalenMRPriorityNormal ); + + // Getting event time + TTime eventTime = iEntry->StartTimeL().TimeLocalL(); + + // Setting default alarm parameters to previous day at noon + TTime alarmTime = eventTime - TTimeIntervalDays( 1 ); + TDateTime alarmDateTime = alarmTime.DateTime(); + alarmDateTime.SetHour( KDefaultAnniversaryAlarmHours ); + alarmDateTime.SetMinute( 0 ); + alarmDateTime.SetSecond( 0 ); + alarmDateTime.SetMicroSecond( 0 ); + alarmTime = alarmDateTime; + + // Calculating alarm offset + TTimeIntervalMinutes alarmOffset( 0 ); + eventTime.MinutesFrom( alarmTime, alarmOffset ); + + // Creating alarm + CCalAlarm* alarm = CCalAlarm::NewL(); + CleanupStack::PushL( alarm ); + alarm->SetTimeOffset( alarmOffset ); + + // Setting alarm + iEntry->SetAlarmL( alarm ); + CleanupStack::PopAndDestroy( alarm ); + alarm = NULL; + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::DoGetEntry +// ---------------------------------------------------------------------------- +// +CCalEntry* CMRCalEntry::DoGetEntry() const + { + __ASSERT_DEBUG( iEntry, Panic( EBCCalEntryNotExist ) ); + + return iEntry; + } + +// ---------------------------------------------------------------------------- +// CMRCalEntry::ValidateEntryL +// ---------------------------------------------------------------------------- +// +CCalEntry* CMRCalEntry::ValidateEntryL() + { + FUNC_LOG; + + CCalEntry* entry = NULL; + + MESMRCalEntry::TESMRCalEntryType entryType = Type(); + switch ( entryType ) + { + case EESMRCalEntryMeeting: + { + entry = ValidateMeetingL(); + } + break; + + case EESMRCalEntryAnniversary: + { + entry = CreateCopyL( *iEntry ); + CleanupStack::PushL( entry ); + + // Special check for anniversary: Occurancy must be set to yearly + // for new entries + if ( ( entry->EntryTypeL() == CCalEntry::EAnniv ) && + !IsStoredL() && + !IsRecurrentEventL() ) + { + TCalRRule rrule( TCalRRule::EYearly ); + rrule.SetDtStart( Entry().StartTimeL() ); + rrule.SetInterval( 1 ); + rrule.SetCount( 0 ); + entry->SetRRuleL( rrule ); + } + + CleanupStack::Pop( entry ); //Ownership given to caller + } + break; + + case EESMRCalEntryTodo: // flow through + case EESMRCalEntryMemo: // flow through + case EESMRCalEntryReminder: + { + entry = CreateCopyL( *iEntry ); + } + break; + default: + // This should not occur + User::Leave( KErrArgument ); + break; + } + + return entry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::RemoveInstanceFromSeriesL +// --------------------------------------------------------------------------- +// +CCalEntry* CMRCalEntry::RemoveInstanceFromSeriesL() + { + FUNC_LOG; + + CCalEntry* retEntry = NULL; + + if ( IsRecurrentEventL() && + EESMRThisOnly == iRecurrenceModRule ) + { + CCalInstance* instance = NULL; + TRAPD( err, instance = InstanceL() ); + if( KErrNotFound != err ) + { + User::LeaveIfError( err ); + } + + if ( instance ) + { + CleanupStack::PushL( instance ); + + CCalEntry& parentEntry = instance->Entry(); + retEntry = ESMRHelper::CopyEntryL( + parentEntry, + parentEntry.MethodL(), + ESMRHelper::ECopyFull ); + + CleanupStack::PopAndDestroy( instance ); + instance = NULL; + + CleanupStack::PushL( retEntry ); + + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( *retEntry ); + + TCalTime orginalInstanceTime; + orginalInstanceTime.SetTimeUtcL( + iEntry->StartTimeL().TimeUtcL() ); + + recurrenceHandler->RemoveInstanceL( orginalInstanceTime ); + + CleanupStack::PopAndDestroy( recurrenceHandler ); + CleanupStack::Pop( retEntry ); + } + } + else + { + User::Leave( KErrNotSupported ); + } + + return retEntry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::GetDBMgr +// --------------------------------------------------------------------------- +// +MESMRCalDbMgr& CMRCalEntry::GetDBMgr() + { + return iCalDb; + } + + +// --------------------------------------------------------------------------- +// CMRCalEntry::SupportsCapabilityL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::SupportsCapabilityL( + MESMRCalEntry::TMREntryCapability aCapability ) const + { + FUNC_LOG; + + TBool retValue( EFalse ); + + if ( aCapability == MESMRCalEntry::EMRCapabilityAttachments ) + { + retValue = ETrue; + } + + return retValue; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::ContainsRemoteAttachmentsL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::ContainsRemoteAttachmentsL() + { + FUNC_LOG; + + TBool retValue( EFalse ); + + TInt attachmentCount( iEntry->AttachmentCountL() ); + + for ( TInt i(0); i < attachmentCount && !retValue; ++i ) + { + CCalAttachment* attachment = iEntry->AttachmentL(i); + CCalAttachment::TType type( attachment->Type() ); + + if ( CCalAttachment::EFile != type ) + { + retValue = ETrue; + } + } + + return retValue; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::ValidateMeetingL +// --------------------------------------------------------------------------- +// +CCalEntry* CMRCalEntry::ValidateMeetingL() + { + FUNC_LOG; + + CCalEntry* entry = NULL; + + if ( IsRecurrentEventL() && + EESMRThisOnly == iRecurrenceModRule && + IsStoredL() && + !ESMREntryHelper::IsModifyingEntryL( *iEntry ) ) + { + CCalInstance* instance = NULL; + TRAPD( err, instance = InstanceL() ); + if( KErrNotFound != err ) + { + User::LeaveIfError( err ); + } + + if ( instance ) + { + + CleanupStack::PushL( instance ); + CCalEntry& parent = instance->Entry(); + + entry = iCalDb.FetchEntryL( + parent.UidL(), + iComparativeEntry->StartTimeL() ); + + if ( !entry ) + { + + // copy global UID from the original entry + HBufC8* guid = parent.UidL().AllocLC(); + + // create new (child) entry + entry = CCalEntry::NewL( + parent.EntryTypeL(), + guid, + parent.MethodL(), + 0, + iComparativeEntry->StartTimeL(), + CalCommon::EThisOnly ); + + CleanupStack::Pop( guid ); + guid = NULL; // ownership transferred + } + + CleanupStack::PopAndDestroy( instance ); + instance = NULL; // instance + CleanupStack::PushL( entry ); + + + CCalEntry::TMethod method( iEntry->MethodL() ); + + entry->CopyFromL( *iEntry, CCalEntry::EDontCopyId ); + entry->SetSequenceNumberL( 0 ); + entry->SetMethodL( method ); + entry->SetSummaryL( iEntry->SummaryL() ); + entry->SetLocalUidL( TCalLocalUid( 0 ) ); + entry->ClearRepeatingPropertiesL(); + + CleanupStack::Pop( entry ); + } + } + + if ( !entry ) + { + entry = CreateCopyL( *iEntry ); + } + + return entry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::SetTypeChanged +// --------------------------------------------------------------------------- +// +void CMRCalEntry::SetTypeChanged( TBool aTypeChanged ) + { + FUNC_LOG; + + iTypeChanged = aTypeChanged; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::AnyInstancesBetweenTimePeriodL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntry::AnyInstancesBetweenTimePeriodL( + TTime& aStart, + TTime& aEnd ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic( EBCCalEntryNotExist ) ); + + TBool retValue( EFalse ); + + RCPointerArray entries; + CleanupClosePushL( entries ); + + CESMRConflictChecker* conflictCheckker = + CESMRConflictChecker::NewL( iCalDb ); + CleanupStack::PushL( conflictCheckker ); + + CCalInstance* instance = InstanceL(); + CleanupStack::PushL( instance ); + + TCalCollectionId colId = instance->InstanceIdL().iCollectionId; + CleanupStack::PopAndDestroy( instance ); + + conflictCheckker->FindInstancesForEntryL( aStart, + aEnd, + *iEntry, + colId, + entries ); + + if ( entries.Count() ) + { + retValue = ETrue; + } + + CleanupStack::PopAndDestroy( conflictCheckker ); + CleanupStack::PopAndDestroy(); // entries + + return retValue; + } + +// --------------------------------------------------------------------------- +// CMRCalEntry::GetFirstInstanceStartAndEndTimeL +// --------------------------------------------------------------------------- +// +void CMRCalEntry::GetFirstInstanceStartAndEndTimeL( + TTime& aStart, + TTime& aEnd ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iEntry, Panic( EBCCalEntryNotExist ) ); + + // This fetches the parent entry + TCalTime recurrenceId; + recurrenceId.SetTimeLocalL( Time::NullTTime() ); + CCalEntry* parent = iCalDb.FetchEntryL( + iEntry->UidL(), + recurrenceId ); + + CleanupStack::PushL( parent ); + + aStart = parent->StartTimeL().TimeLocalL(); + aEnd = parent->EndTimeL().TimeLocalL(); + + CleanupStack::PopAndDestroy( parent ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/src/cmrcaleventprocessor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/src/cmrcaleventprocessor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,615 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description : ESMR entry processor implementation +* Version : %version: e002sa33#11 % +* +*/ + + +// INCLUDE FILES + +#include "cmrcaleventprocessor.h" +#include "esmrinternaluid.h" +#include "mesmrcalentry.h" +#include "esmrhelper.h" +#include "esmrentryhelper.h" +#include "cmrcalentry.h" +#include "cesmrrecurrenceinfohandler.h" +#include "emailtrace.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/// Unnamed namespace for local definitions +namespace { + +_LIT( KReplaceLineFeedChars, "\r\n" ); +_LIT( KLineFeed, " \x2029"); + +#ifdef _DEBUG + +// Definition for module panic text +_LIT( KMRCalEntryProcessor, "MRCalEntryProcessor" ); + +/** + * ESMREntryProcessor panic codes + */ +enum TMRCalEntryProcessorPanic + { + // Empty input array + EMRCalEventProcessorEmptyEntryArray, + // Invalid processor mode + EMRCalEventProcessorInvalidType, + // Invalid processor mode + EMRCalEventProcessorInvalidMode, + // Non-supported method called + EMRCalEventProcessorNotSupported + }; + +/** + * Raises panic. + * @param aPanic Panic code + */ +void Panic(TMRCalEntryProcessorPanic aPanic) + { + User::Panic( KMRCalEntryProcessor(), aPanic); + } + +#endif // _DEBUG + +/** + * Maps CCalEntry defined entry type to ESMR entry type. + * + * @param aType Calendar entry type + * @return TESMRCalendarEventType Entry type + */ +TESMRCalendarEventType MapCalEntryTypeToMRType( + CCalEntry::TType aType ) + { + TESMRCalendarEventType returnType(EESMREventTypeAppt); + + switch(aType) + { + case CCalEntry::EAppt: + { + returnType = EESMREventTypeAppt; + break; + } + case CCalEntry::ETodo: + { + returnType = EESMREventTypeETodo; + break; + } + case CCalEntry::EEvent: + { + returnType = EESMREventTypeEEvent; + break; + } + case CCalEntry::EReminder: + { + returnType = EESMREventTypeEReminder; + break; + } + case CCalEntry::EAnniv: + { + returnType = EESMREventTypeEAnniv; + break; + } + default: + // This should not happen + __ASSERT_DEBUG( + EFalse, + Panic( EMRCalEventProcessorInvalidType ) ); + User::Leave( KErrArgument ); + break; + } + + return returnType; + } + +HBufC* ReplaceCharactersFromBufferLC( const TDesC& aTarget, + const TDesC& aFindString, + const TDesC& aReplacement ) + { + HBufC* newBuffer = aTarget.AllocLC(); + TPtr16 ptr = newBuffer->Des(); + + // find next occurance: + TInt offset = ptr.Find(aFindString); + while ( offset != KErrNotFound ) + { + // replace the data: + ptr.Replace( offset, aFindString.Length(), aReplacement); + + // find next occurance: + offset = ptr.Find(aFindString); + } + + return newBuffer; + } + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::CMRCalEntryProcessor +// --------------------------------------------------------------------------- +// +CMRCalEntryProcessor::CMRCalEntryProcessor( + MESMRCalDbMgr& aDbMgr ) +: iDbMgr( aDbMgr ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::~CMRCalEntryProcessor +// --------------------------------------------------------------------------- +// +CMRCalEntryProcessor::~CMRCalEntryProcessor() + { + FUNC_LOG; + + delete iCalEntry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ConstructL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::NewL +// --------------------------------------------------------------------------- +// +CMRCalEntryProcessor* CMRCalEntryProcessor::NewL( + TAny* aDbMgr ) + { + FUNC_LOG; + + MESMRCalDbMgr* dbMgr = static_cast(aDbMgr); + return CreateL( *dbMgr ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::CreateL +// --------------------------------------------------------------------------- +// +CMRCalEntryProcessor* CMRCalEntryProcessor::CreateL( + MESMRCalDbMgr& aDbMgr ) + { + FUNC_LOG; + + CMRCalEntryProcessor* self = new (ELeave) CMRCalEntryProcessor( aDbMgr ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ScenarioData +// --------------------------------------------------------------------------- +// +const TESMRScenarioData& CMRCalEntryProcessor::ScenarioData() const + { + FUNC_LOG; + return iScenData; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ContainsProcessedEntry +// --------------------------------------------------------------------------- +// +TBool CMRCalEntryProcessor::ContainsProcessedEntry() const + { + FUNC_LOG; + return (iCalEntry != NULL); + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + RPointerArray* aEntries ) + { + FUNC_LOG; + + iParams = aParams; + ProcessL( aEntries ); + + if ( MAgnEntryUi::EViewEntry != iParams->iEditorMode ) + { + iScenData.iViewMode = EESMREditMR; + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ProcessL( + RPointerArray* aEntries ) + { + FUNC_LOG; + + __ASSERT_DEBUG( aEntries->Count() > 0, + Panic( EMRCalEventProcessorEmptyEntryArray ) ); + + iCalEntries = aEntries; + + CCalEntry& entry = *( (*iCalEntries)[ 0 ] ); + ProcessL( iParams, entry, ETrue ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry, + const TBool aTypeChanging ) + { + FUNC_LOG; + iParams = aParams; + + // Plain calendar entries are always used from calendar application + iScenData.iCallingApp = EESMRAppCalendar; + iScenData.iEntryType = MapCalEntryTypeToMRType( aEntry.EntryTypeL() ); + + if ( aParams->iEditorMode == MAgnEntryUi::EViewEntry ) + { + iScenData.iViewMode = EESMRViewMR; + } + else + { + iScenData.iViewMode = EESMREditMR; + } + + ConvertTextFieldLineFeedsL( aEntry ); + + CreateEntryL( aEntry, aSetDefaultValuesToEntry ); + + // When creating a new repeating meeting and adding participants, + // meeting request editor is opened and all occurences should be edited + if ( ( iCalEntry->IsRecurrentEventL() && + MAgnEntryUi::ECreateNewEntry == iParams->iEditorMode ) || + ( iCalEntry->IsRepeatingMeetingL( aEntry ) && aTypeChanging ) ) + { + iCalEntry->SetModifyingRuleL( + MESMRCalEntry::EESMRAllInSeries, aTypeChanging ); + } + else //Default case + { + iCalEntry->SetModifyingRuleL( + MESMRCalEntry::EESMRThisOnly, aTypeChanging ); + } + + // If entry is new entry, we want to set default values to it. + // On the other hand, when changing entry type from one type to another, + // we do not want to set default values + if ( iParams && MAgnEntryUi::ECreateNewEntry == + iParams->iEditorMode && + aSetDefaultValuesToEntry ) + { + iCalEntry->SetDefaultValuesToEntryL(); + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ProcessL( + CCalInstance& /*aInstance*/ ) + { + FUNC_LOG; + + __ASSERT_DEBUG( EFalse, Panic(EMRCalEventProcessorNotSupported) ); + + User::Leave( KErrNotSupported ); + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::SwitchProcessorToModeL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::SwitchProcessorToModeL( + TMRProcessorMode aMode ) + { + FUNC_LOG; + + if ( EMRProcessorModeView == aMode ) + { + iScenData.iViewMode = EESMRViewMR; + } + else if ( EMRProcessorModeEdit == aMode ) + { + iScenData.iViewMode = EESMREditMR; + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ESMREntryL +// --------------------------------------------------------------------------- +// +MESMRCalEntry& CMRCalEntryProcessor::ESMREntryL() + { + FUNC_LOG; + + if ( !iCalEntry ) + { + CreateEntryL( *(*iCalEntries)[ 0 ], ETrue ); + } + + return *iCalEntry; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ResetL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ResetL() + { + FUNC_LOG; + + iScenData.iViewMode = EESMRViewUndef; + iScenData.iCallingApp = EESMRAppCalendar; + + delete iCalEntry; + iCalEntry = NULL; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ProcessOutputParametersL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ProcessOutputParametersL( + MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, + TESMRCommand aCommand ) + { + FUNC_LOG; + + ASSERT( iCalEntry ); + + TBool handlingInstanceOnly( + MESMRCalEntry::EESMRCalEntryMeeting == iCalEntry->Type() && + iCalEntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == iCalEntry->RecurrenceModRule() ); + + switch ( aCommand ) + { + case EESMRCmdSaveMR: + case EESMRCmdTodoMarkAsDone: + case EESMRCmdTodoMarkAsNotDone: + { + aOutParams.iAction = MAgnEntryUi::EMeetingSaved; + if ( handlingInstanceOnly ) + { + aOutParams.iAction = MAgnEntryUi::EInstanceRescheduled; + } + } + break; + + case EESMRCmdCalEntryUIDelete: + case EESMRCmdDeleteMR: + { + aOutParams.iAction = MAgnEntryUi::EMeetingDeleted; + if ( handlingInstanceOnly ) + { + aOutParams.iAction = MAgnEntryUi::EInstanceDeleted; + } + } + break; + + default: + { + aOutParams.iAction = MAgnEntryUi::ENoAction; + } + break; + } + + if ( handlingInstanceOnly ) + { + aOutParams.iNewInstanceDate = + iCalEntry->Entry().StartTimeL(); + } + else if ( MAgnEntryUi::ENoAction != aOutParams.iAction ) + { + TCalTime instanceTime = iCalEntry->Entry().StartTimeL(); + + if ( MESMRCalEntry::EESMRAllInSeries == iCalEntry->RecurrenceModRule() ) + { + // For recurrent event there might be exceptions + // and therefore the first possible start time + // is set to putput params + TCalTime end; + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( iCalEntry->Entry() ); + + recurrenceHandler->GetFirstInstanceTimeL( + instanceTime, + end ); + + CleanupStack::PopAndDestroy( recurrenceHandler ); + recurrenceHandler = NULL; + aOutParams.iNewInstanceDate = instanceTime; + } + else + { + aOutParams.iNewInstanceDate.SetTimeLocalL( + iCalEntry->Entry().StartTimeL().TimeLocalL() ); + } + } + else + { + aOutParams.iNewInstanceDate.SetTimeLocalL( Time::NullTTime() ); + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::SetPhoneOwnerL +// --------------------------------------------------------------------------- +// +TBool CMRCalEntryProcessor::IsDataOk() const + { + FUNC_LOG; + + TBool retVal( ETrue ); + + // Check that all values has been set and there is no + // undefined values. Policies cannot be resolved, if + // scenario data is undefined. + if ( EESMRRoleUndef == iScenData.iRole || + EESMRViewUndef == iScenData.iViewMode || + EESMRAppUndef == iScenData.iCallingApp ) + { + retVal = EFalse; + } + + return retVal; + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::CreateEntryL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::CreateEntryL( CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry ) + { + FUNC_LOG; + if ( !iCalEntry ) + { + if ( iParams && aSetDefaultValuesToEntry ) + { + CCalEntry::TType entryType( aEntry.EntryTypeL() ); + if ( CCalEntry::EAppt == entryType || + CCalEntry::EAnniv == entryType ) + { + // Setting start and end time for child entry + ESMREntryHelper::CheckRepeatUntilValidityL( + aEntry, + iParams->iInstanceDate ); + + ESMREntryHelper::SetInstanceStartAndEndL( + aEntry, + aEntry, + iParams->iInstanceDate ); + } + else if ( CCalEntry::ETodo == entryType ) + { + TTime start = aEntry.StartTimeL().TimeLocalL(); + TTime end = aEntry.EndTimeL().TimeLocalL(); + + if ( Time::NullTTime() == start && + Time::NullTTime() == end ) + { + start.HomeTime(); + end.HomeTime(); + + TCalTime startCalTime; + TCalTime endCalTime; + + startCalTime.SetTimeLocalL( start ); + endCalTime.SetTimeLocalL( end ); + + aEntry.SetStartAndEndTimeL( startCalTime, endCalTime ); + } + } + } + + iCalEntry = CMRCalEntry::NewL( aEntry, iDbMgr ); + } + } + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ConvertTextFieldLineFeedsL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ConvertTextFieldLineFeedsL() + { + FUNC_LOG; + + TInt entryCount( iCalEntries->Count() ); + for (TInt i(0); i < entryCount; ++i ) + { + ConvertTextFieldLineFeedsL( *(*iCalEntries)[ i ] ); + } + } + + +// --------------------------------------------------------------------------- +// CMRCalEntryProcessor::ConvertTextFieldLineFeedsL +// --------------------------------------------------------------------------- +// +void CMRCalEntryProcessor::ConvertTextFieldLineFeedsL( CCalEntry& aEntry ) + { + TInt ret = aEntry.DescriptionL().Find(KReplaceLineFeedChars); + if ( ret != KErrNotFound ) + { + HBufC* newDescription = + ReplaceCharactersFromBufferLC( + aEntry.DescriptionL(), + KReplaceLineFeedChars(), + KLineFeed() ); + aEntry.SetDescriptionL( *newDescription ); + CleanupStack::PopAndDestroy( newDescription ); + } + + // Location field: + ret = aEntry.LocationL().Find(KReplaceLineFeedChars); + if ( ret != KErrNotFound ) + { + HBufC* newLocation = + ReplaceCharactersFromBufferLC( + aEntry.DescriptionL(), + KReplaceLineFeedChars(), + KLineFeed() ); + aEntry.SetDescriptionL( *newLocation ); + CleanupStack::PopAndDestroy( newLocation ); + } + + // Subject field: + ret = aEntry.SummaryL().Find(KReplaceLineFeedChars); + if ( ret != KErrNotFound ) + { + HBufC* newSubject = + ReplaceCharactersFromBufferLC( + aEntry.DescriptionL(), + KReplaceLineFeedChars(), + KLineFeed() ); + aEntry.SetDescriptionL( *newSubject ); + CleanupStack::PopAndDestroy( newSubject ); + } + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrcaleventplugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrcaleventplugin/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +// Internal includes +#include "cmrcaleventprocessor.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KMRCalEventProcessorImplementationUID, + CMRCalEntryProcessor::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrprocessorplugin/data/mrprocessorplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrprocessorplugin/data/mrprocessorplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource file for ECOM registry. +* +*/ + + +// INCLUDES +#include +#include "esmrinternaluid.h" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// theInfo +// ECOM registry information for ESMRVIEWER ECOM implementation +// ----------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO theInfo + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRMeetingRequestProcessorImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMREntryProcessorInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRMeetingRequestProcessorImplementationUID; + version_no = 1; + display_name = ""; + default_data = ""; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrprocessorplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrprocessorplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build definition file. +* +* +*/ + + +#include + +PRJ_EXPORTS + +PRJ_MMPFILES +mrprocessorplugin.mmp + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrprocessorplugin/group/mrprocessorplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrprocessorplugin/group/mrprocessorplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +#include "../../../mrcommon/inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrprocessorplugin.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRMeetingRequestProcessorImplementationUID + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cesmrentryprocessor.cpp +SOURCE dllmain.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../mrcommon/inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data/ +START RESOURCE mrprocessorplugin.rss +TARGET mrprocessorplugin.rsc +END + +LIBRARY esmrcommon.lib +LIBRARY esmrentry.lib +LIBRARY esmrservices.lib + +LIBRARY ecom.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY euser.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY charconv.lib +LIBRARY eikcoctl.lib +LIBRARY calinterimapi.lib +LIBRARY caleninterimutils2.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrprocessorplugin/inc/cesmrentryprocessor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrprocessorplugin/inc/cesmrentryprocessor.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR mr entry processor +* +*/ + +#ifndef C_ESMRENTRYPROCESSOR_H +#define C_ESMRENTRYPROCESSOR_H + +#include +#include "cmrentryprocessor.h" + +class MESMRCalDbMgr; +class CMRMailboxUtils; +class CESMRFsMailboxUtils; +class CESMRMeetingRequestEntry; + +/** +* CESMREntryProcessor's main responsibility is to +* perform entry processing and evaluation in initialization phase. +* +* @lib esmrentry.lib +*/ +NONSHARABLE_CLASS(CESMREntryProcessor) : + public CMREntryProcessor + { +public: // Construction and destruction + /** + * Creates new CESMREntryProcessor object. Ownership + * is transferred to caller. + * @param aDbMgr Reference to calendar DB manager. + * @return Pointer to created CESMREntryProcessor object, + */ + static CESMREntryProcessor* NewL( + TAny* aDbMgr ); + + /** + * C++ destructor + */ + ~CESMREntryProcessor(); + +public: // From MESMREntryProcessor + const TESMRScenarioData& ScenarioData() const; + TBool ContainsProcessedEntry() const; + void ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + RPointerArray* aEntries ); + void ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry, + const TBool aTypeChanging = EFalse ); + void ProcessL( + RPointerArray* aEntries ); + void ProcessL( + CCalInstance& aInstance ); + void SwitchProcessorToModeL( + TMRProcessorMode aMode ); + MESMRCalEntry& ESMREntryL(); + void ResetL(); + void ProcessOutputParametersL( + MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, + TESMRCommand aCommand ); + +private: // Implementaton + + static CESMREntryProcessor* CreateL( + MESMRCalDbMgr& aDbMgr ); + + CESMREntryProcessor( + MESMRCalDbMgr& aDbMgr); + void ConstructL(); + void SetPhoneOwnerL( CCalEntry& aEntry, + CCalEntry& aBaseEntry ); + void CheckViewModeL(); + TBool IsDataOk() const; + void CreateESMREntryL( CCalEntry& aEntry, TBool aSetDefaultValuesToEntry ); + void CheckOrganizerL( CCalEntry& aEntry ); + void SetPhoneOwnerToOwnEntryL(); + void SwitchToForwardL(); + void SwitchToEditL(); + void SwitchToViewL(); + void SwitchToTrackL(); + +private: // Data + /** + * Scenario data + * Own. + */ + TESMRScenarioData iScenData; + + /** + * ES MR Entry + * Own. + */ + CESMRMeetingRequestEntry* iESMREntry; + + /** + * Reference to MR Mailbox Utilities API + * Own. + */ + CMRMailboxUtils* iMRMailboxUtils; + + /** + * Reference to calendar DB manager + * Not own. + */ + MESMRCalDbMgr& iDbMgr; + + /** + * Entries to be processed + * Not own. + */ + RPointerArray* iMREntries; + + /** + * Entry to be processed + * Not own. + */ + CCalEntry* iCalEntry; + + /** + * Input parameters from calling application + * Not own. + */ + const MAgnEntryUi::TAgnEntryUiInParams* iParams; + + /** + * Own: Mailbox utils class. + */ + CESMRFsMailboxUtils* iMbUtils; + }; + +#endif // CESMRENTRYPROCESSOR_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrprocessorplugin/src/cesmrentryprocessor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrprocessorplugin/src/cesmrentryprocessor.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,950 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description : ESMR entry processor implementation +* Version : %version: e002sa33#14 % +* +*/ + + +// INCLUDE FILES + +#include "cesmrentryprocessor.h" +#include "esmrinternaluid.h" +#include "mesmrcalentry.h" +#include "esmrhelper.h" +#include "esmrentryhelper.h" +#include "cesmrfsmailboxutils.h" +#include "cesmrmeetingrequestentry.h" +#include "cesmrconflictchecker.h" +#include "FreestyleEmailUiConstants.h" +#include "cesmrrecurrenceinfohandler.h" +#include "emailtrace.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/// Unnamed namespace for local definitions +namespace { + +#ifdef _DEBUG + +// Definition for module panic text +_LIT( KESMRProcessorPanicTxt, "ESMREntryProcessor" ); + +/** + * ESMREntryProcessor panic codes + */ +enum TESMREntryProcessorPanic + { + // Input entry array is empty + EESMRProcessorEmptyEntryArray = 1, + // Too many input entries + EESMRProcessorTooManyEntries = 2, + // entries are not processed + EESMRProcessorEntriesNotProcessed, + // View mode for policy resolving + // cannot be check. + EESMRProcessorCannotCheckViewMode, + // Invalid processor mode + EESMRProcessorInvalidMode + }; + +/** + * Raises panic. + * @param aPanic Panic code + */ +void Panic(TESMREntryProcessorPanic aPanic) + { + User::Panic( KESMRProcessorPanicTxt(), aPanic); + } + +#endif // _DEBUG + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::CESMREntryProcessor +// --------------------------------------------------------------------------- +// +CESMREntryProcessor::CESMREntryProcessor( + MESMRCalDbMgr& aDbMgr ) +: iDbMgr( aDbMgr ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::~CESMREntryProcessor +// --------------------------------------------------------------------------- +// +CESMREntryProcessor::~CESMREntryProcessor() + { + FUNC_LOG; + delete iMRMailboxUtils; + delete iESMREntry; + delete iMbUtils; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ConstructL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ConstructL() + { + FUNC_LOG; + iMRMailboxUtils = CMRMailboxUtils::NewL(); + iMbUtils = CESMRFsMailboxUtils::NewL( *iMRMailboxUtils ); + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::NewL +// --------------------------------------------------------------------------- +// +CESMREntryProcessor* CESMREntryProcessor::NewL( + TAny* aDbMgr ) + { + FUNC_LOG; + + MESMRCalDbMgr* dbMgr = static_cast(aDbMgr); + return CreateL( *dbMgr ); + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::CreateL +// --------------------------------------------------------------------------- +// +CESMREntryProcessor* CESMREntryProcessor::CreateL( + MESMRCalDbMgr& aDbMgr ) + { + FUNC_LOG; + + CESMREntryProcessor* self = new (ELeave) CESMREntryProcessor( aDbMgr ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ScenarioData +// --------------------------------------------------------------------------- +// +const TESMRScenarioData& CESMREntryProcessor::ScenarioData() const + { + FUNC_LOG; + return iScenData; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ContainsProcessedEntry +// --------------------------------------------------------------------------- +// +TBool CESMREntryProcessor::ContainsProcessedEntry() const + { + FUNC_LOG; + return (iESMREntry != NULL); + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + RPointerArray* aEntries ) + { + FUNC_LOG; + + iParams = aParams; + ProcessL( aEntries ); + CheckViewModeL(); + + if ( !IsDataOk() ) + { + // Data is not ok --> Leave + User::Leave( KErrArgument ); + } + + // Check mail parameters + if ( iParams && iParams->iSpare ) + { + CCalEntry* entry = &iESMREntry->Entry(); + if(entry) + { + TBool recurrent(EFalse); + recurrent = iESMREntry->IsRecurrentEventL(); + + if(recurrent) + { + if ( !ESMREntryHelper::IsModifyingEntryL(*entry) ) + { + iESMREntry->SetModifyingRuleL( MESMRMeetingRequestEntry::EESMRAllInSeries ); + + SetPhoneOwnerToOwnEntryL(); + } + } + } + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ProcessL( + const MAgnEntryUi::TAgnEntryUiInParams* aParams, + CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry, + const TBool aTypeChanging) + { + FUNC_LOG + + iParams = aParams; + iMREntries = NULL; + iCalEntry = &aEntry; + + // Set initial values to scenario data + iScenData.iRole = EESMRRoleUndef; + iScenData.iViewMode = EESMRViewUndef; + iScenData.iCallingApp = EESMRAppUndef; + + SetPhoneOwnerL( aEntry, aEntry ); + + CreateESMREntryL( aEntry, aSetDefaultValuesToEntry ); + CheckOrganizerL( aEntry ); + + // When creating a new repeating meeting and adding participants, + // meeting request editor is opened and all occurences should be edited + if ( ( iESMREntry->IsRecurrentEventL() && + MAgnEntryUi::ECreateNewEntry == iParams->iEditorMode ) || + ( ESMREntryHelper::IsRepeatingMeetingL( aEntry ) && aTypeChanging ) ) + { + iESMREntry->SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRAllInSeries, aTypeChanging ); + } + else //Default case + { + iESMREntry->SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRThisOnly, aTypeChanging ); + } + + if ( iParams && MAgnEntryUi::ECreateNewEntry == + iParams->iEditorMode && + aSetDefaultValuesToEntry ) + { + iESMREntry->SetDefaultValuesToEntryL(); + } + + + CheckViewModeL(); + + if ( !IsDataOk() ) + { + // Data is not ok --> Leave + User::Leave( KErrArgument ); + } + + // Check mail parameters + if ( iParams && iParams->iSpare ) + { + CCalEntry* entry = &iESMREntry->Entry(); + if(entry) + { + TBool recurrent(EFalse); + recurrent = iESMREntry->IsRecurrentEventL(); + + if(recurrent) + { + if ( !ESMREntryHelper::IsModifyingEntryL(*entry) ) + { + iESMREntry->SetModifyingRuleL( MESMRMeetingRequestEntry::EESMRAllInSeries ); + + SetPhoneOwnerToOwnEntryL(); + } + } + } + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ProcessL( + RPointerArray* aEntries ) + { + FUNC_LOG; + + __ASSERT_DEBUG( aEntries->Count() > 0, + Panic( EESMRProcessorEmptyEntryArray ) ); + + iMREntries = aEntries; + iCalEntry = (*iMREntries)[ 0 ]; + + // Set initial values to scenario data + iScenData.iRole = EESMRRoleUndef; + iScenData.iViewMode = EESMRViewUndef; + iScenData.iCallingApp = EESMRAppUndef; + + for ( TInt i = 0; i < iMREntries->Count(); ++i ) + { + SetPhoneOwnerL( *(*iMREntries)[ i ], *iCalEntry ); + } + + CreateESMREntryL( *iCalEntry, ETrue ); + CheckOrganizerL( *iCalEntry ); + + // When creating a new repeating meeting and adding participants, + // meeting request editor is opened and all occurences should be edited + if ( iESMREntry->IsRecurrentEventL() + && iParams + && MAgnEntryUi::ECreateNewEntry == iParams->iEditorMode ) + { + iESMREntry->SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRAllInSeries ); + } + else //Default case + { + iESMREntry->SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRThisOnly ); + } + + if ( iParams && MAgnEntryUi::ECreateNewEntry == iParams->iEditorMode ) + { + iESMREntry->SetDefaultValuesToEntryL(); + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ProcessL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ProcessL( + CCalInstance& aInstance ) + { + FUNC_LOG; + + RCPointerArray entries; + CleanupClosePushL( entries ); + + // Fetches parent entry. We need to construct entry with + // correct time. + CCalEntry &entry = aInstance.Entry(); + CCalEntry* instanceEntry = ESMRHelper::CopyEntryL( + entry, + entry.MethodL(), + ESMRHelper::ECopyFull ); + + entries.Append(instanceEntry); + + // Setting start and end time for child entry + ESMREntryHelper::CheckRepeatUntilValidityL( + *instanceEntry, + aInstance.StartTimeL() ); + + ESMREntryHelper::SetInstanceStartAndEndL( + *instanceEntry, + entry, + aInstance.StartTimeL() ); + + // Filling child with correct data + // This can be replaced withCCalenInterimUtils2::PopulateChildFromParentL + // after its memory leak has been fixed. + ESMRHelper::PopulateChildFromParentL( + *instanceEntry, + entry ); + + ProcessL( &entries ); + + if ( !iESMREntry ) + { + User::Leave( KErrArgument ); + } + + // Mark only this entry to be affected. + iESMREntry->SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRThisOnly ); + + // entries + CleanupStack::PopAndDestroy(); + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SwitchProcessorToModeL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SwitchProcessorToModeL( + TMRProcessorMode aMode ) + { + FUNC_LOG; + + switch ( aMode ) + { + case EMRProcessorModeView: + SwitchToViewL(); + break; + case EMRProcessorModeEdit: + SwitchToEditL(); + break; + case EMRProcessorModeForward: + SwitchToForwardL(); + break; + case EMRProcessorModeTrack: + SwitchToTrackL(); + break; + default: + __ASSERT_DEBUG( EFalse, Panic( EESMRProcessorInvalidMode) ); + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ESMREntryL +// --------------------------------------------------------------------------- +// +MESMRCalEntry& CESMREntryProcessor::ESMREntryL() + { + FUNC_LOG; + + CreateESMREntryL( *iCalEntry, ETrue ); + return *iESMREntry; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ResetL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ResetL() + { + FUNC_LOG; + + iScenData.iRole = EESMRRoleUndef; + iScenData.iViewMode = EESMRViewUndef; + iScenData.iCallingApp = EESMRAppUndef; + + delete iESMREntry; + iESMREntry = NULL; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::ProcessOutputParametersL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::ProcessOutputParametersL( + MAgnEntryUi::TAgnEntryUiOutParams& aOutParams, + TESMRCommand aCommand ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iESMREntry, Panic(EESMRProcessorEntriesNotProcessed) ); + + if ( !iParams || + EESMRForwardMR == iScenData.iViewMode || + EESMRViewUndef == iScenData.iViewMode ) + { + // No input parameters supplied --> Output parameters cannot be set + return; + } + + TBool handlingInstanceOnly( + iESMREntry->IsRecurrentEventL() && + MESMRCalEntry::EESMRThisOnly == iESMREntry->RecurrenceModRule() ); + + switch ( aCommand ) + { + case EESMRCmdSendMR: + case EESMRCmdSendMRUpdate: + case EESMRCmdSaveMR: + case EESMRCmdAcceptMR: + case EESMRCmdTentativeMR: + { + aOutParams.iAction = MAgnEntryUi::EMeetingSaved; + if ( handlingInstanceOnly ) + { + aOutParams.iAction = MAgnEntryUi::EInstanceRescheduled; + } + } + break; + + case EESMRCmdDeclineMR: + case EESMRCmdDeleteMR: + { + aOutParams.iAction = MAgnEntryUi::EMeetingDeleted; + if ( handlingInstanceOnly ) + { + aOutParams.iAction = MAgnEntryUi::EInstanceDeleted; + } + } + break; + + default: + { + aOutParams.iAction = MAgnEntryUi::ENoAction; + } + break; + } + + if ( handlingInstanceOnly ) + { + aOutParams.iNewInstanceDate = + iESMREntry->Entry().StartTimeL(); + } + else if ( MAgnEntryUi::ENoAction != aOutParams.iAction ) + { + //Copy entry LocalUid to input entry + iCalEntry->SetLocalUidL( iESMREntry->Entry().LocalUidL() ); + + TCalTime instanceTime = iESMREntry->Entry().StartTimeL(); + + if ( MESMRCalEntry::EESMRAllInSeries == iESMREntry->RecurrenceModRule() ) + { + // For recurrent event there might be exceptions + // and therefore the first possible start time + // is set to putput params + TCalTime end; + CESMRRecurrenceInfoHandler* recurrenceHandler = + CESMRRecurrenceInfoHandler::NewLC( iESMREntry->Entry() ); + + recurrenceHandler->GetFirstInstanceTimeL( + instanceTime, + end ); + + CleanupStack::PopAndDestroy( recurrenceHandler ); + recurrenceHandler = NULL; + aOutParams.iNewInstanceDate = instanceTime; + } + else + { + aOutParams.iNewInstanceDate.SetTimeLocalL( + iESMREntry->Entry().StartTimeL().TimeLocalL() ); + } + } + else + { + aOutParams.iNewInstanceDate.SetTimeLocalL( Time::NullTTime() ); + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SetPhoneOwnerL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SetPhoneOwnerL( CCalEntry& aEntry, + CCalEntry& aBaseEntry ) + { + FUNC_LOG; + + TESMRInputParams* inputParams = NULL; + if ( iParams ) + { + inputParams = (TESMRInputParams*)(iParams->iSpare); + } + + TInt err(KErrNone); + if ( inputParams && + inputParams->iMailClient && + inputParams->iMailMessage ) + { + err = iMbUtils->SetPhoneOwnerL( + aEntry, + *(inputParams->iMailClient), + *(inputParams->iMailMessage) ); + } + else if ( iParams ) + { + err = iMbUtils->SetPhoneOwnerL( + aEntry, + iParams->iMailBoxId ); + } + else + { + err = iMbUtils->SetPhoneOwnerL( aEntry ); + } + + if ( KErrNone != err ) + { + User::Leave( KErrArgument ); + } + + // set iOwnerRole, use entry at index zero: + if ( iMRMailboxUtils->IsOrganizerL( aBaseEntry ) ) + { + iScenData.iRole = EESMRRoleOrganizer; + } + else + { + // We are not organizer. Let's see if we are in attendee list + // or not. + CCalAttendee* thisAttendee = + iMRMailboxUtils->ThisAttendeeL( aBaseEntry ); + if ( thisAttendee ) + { + switch ( thisAttendee->RoleL() ) + { + case CCalAttendee::EOptParticipant: + { + iScenData.iRole = EESMRRoleOptionalAttendee; + break; + } + case CCalAttendee::ENonParticipant: + { + iScenData.iRole = EESMRRoleNonParticipant; + break; + } + case CCalAttendee::EReqParticipant: // fall through + case CCalAttendee::EChair: // fall through + default: + { // Note: chair MUST NOT be interpreted as organizer + // Req.participant is not correct either but has less + // side effects. + iScenData.iRole = EESMRRoleRequiredAttendee; + break; + } + } + } + else + { + // Phone owner cannot be set --> Leave + User::Leave( KErrCorrupt ); + } + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::CheckViewModeL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::CheckViewModeL() + { + FUNC_LOG; + + // View mode cannot be checked + __ASSERT_DEBUG( + iESMREntry, + Panic(EESMRProcessorCannotCheckViewMode) ); + + TInt32 callingAppUid = 0; + if( iParams ) + { + callingAppUid = iParams->iCallingApp.iUid; + } + + switch ( callingAppUid ) + { + case KUidCalendarApplication: + { + iScenData.iCallingApp = EESMRAppCalendar; + iScenData.iViewMode = EESMRViewMR; + if ( iParams && ( MAgnEntryUi::EViewEntry == iParams->iEditorMode )) + { + if ( iESMREntry->IsAllDayEventL() ) + { + iScenData.iViewMode = EESMRViewAllDayMR; + } + } + else + { + iScenData.iViewMode = EESMREditMR; + } + break; + } + case KUidMceMailApplication: + case KUidEsMailApplication: + case KUidBVAApplication: + { + iScenData.iCallingApp = EESMRAppESEmail; + iScenData.iViewMode = EESMRViewMR; + + if ( iESMREntry->IsAllDayEventL() ) + { + iScenData.iViewMode = EESMRViewAllDayMR; + } + break; + } + default: + { + //error situation, should never come here + // Setting data to undef --> will leave later on. + iScenData.iViewMode = EESMRViewUndef; + break; + } + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SetPhoneOwnerL +// --------------------------------------------------------------------------- +// +TBool CESMREntryProcessor::IsDataOk() const + { + FUNC_LOG; + + TBool retVal(ETrue); + + // Check that all values has been set and there is no + // undefined values. Policies cannot be resolved, if + // scenario data is undefined. + if ( EESMRRoleUndef == iScenData.iRole || + EESMRViewUndef == iScenData.iViewMode || + EESMRAppUndef == iScenData.iCallingApp ) + { + retVal = EFalse; + } + + return retVal; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::CreateESMREntryL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::CreateESMREntryL( CCalEntry& aEntry, + TBool aSetDefaultValuesToEntry ) + { + FUNC_LOG; + + if ( !iESMREntry ) + { + // ES MR Entry is created + //CCalEntry& base = *((*iMREntries)[KFirstEntryIndex]); + HBufC* description = NULL; + TRAPD( err, description = aEntry.DescriptionL().AllocL() ); + CleanupStack::PushL( description ); + if ( KErrNone != err ) + { + User::Leave( KErrCorrupt ); + } + CleanupStack::PopAndDestroy( description ); + description = NULL; + + CCalEntry* entry = + ESMRHelper::CopyEntryLC( + aEntry, + aEntry.MethodL(), + ESMRHelper::ECopyFull ); + + CESMRConflictChecker* conflictChecker = + CESMRConflictChecker::NewL(iDbMgr); + CleanupStack::PushL( conflictChecker ); + + RCPointerArray conflicts; + CleanupClosePushL( conflicts ); + + conflictChecker->FindConflictsL( *entry, conflicts ); + TBool conflictsExists( conflicts.Count() ); + + if ( iParams && + KUidCalendarApplication == iParams->iCallingApp.iUid + && aSetDefaultValuesToEntry ) + { + // Setting start and end time for child entry + ESMREntryHelper::CheckRepeatUntilValidityL( + *entry, + iParams->iInstanceDate ); + + ESMREntryHelper::SetInstanceStartAndEndL( + *entry, + aEntry, + iParams->iInstanceDate ); + } + + TESMRInputParams* inputParams = NULL; + if ( iParams ) + { + inputParams = (TESMRInputParams*)(iParams->iSpare); + } + + iESMREntry = + CESMRMeetingRequestEntry::NewL( + *entry, + *iMRMailboxUtils, + iDbMgr, + conflictsExists, + inputParams ); + + // conflicts + CleanupStack::PopAndDestroy(); + CleanupStack::PopAndDestroy( conflictChecker ); + CleanupStack::PopAndDestroy( entry ); + + SetPhoneOwnerToOwnEntryL(); + } + + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::CheckOrganizerL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::CheckOrganizerL( CCalEntry& aEntry ) + { + FUNC_LOG; + + if ( EESMRRoleOrganizer == iScenData.iRole ) + { + CCalUser *phoneOwner = aEntry.PhoneOwnerL(); + + if ( !phoneOwner ) + { + User::Leave( KErrCorrupt ); + } + + CCalUser* organizer = ESMRHelper::CopyUserLC( *phoneOwner ); + + // Ownership is transferred + aEntry.SetOrganizerL( organizer ); + CleanupStack::Pop( organizer ); + } + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SetPhoneOwnerToOwnEntryL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SetPhoneOwnerToOwnEntryL() + { + FUNC_LOG; + + // Phone owner cannot be checked + __ASSERT_DEBUG( + iESMREntry, + Panic(EESMRProcessorEntriesNotProcessed) ); + + TESMRInputParams* inputParams = NULL; + if ( iParams ) + { + inputParams = (TESMRInputParams*)(iParams->iSpare); + } + + TInt err(KErrNone); + if ( inputParams && + inputParams->iMailClient && + inputParams->iMailMessage ) + { + err = iMbUtils->SetPhoneOwnerL( + iESMREntry->Entry(), + *(inputParams->iMailClient), + *(inputParams->iMailMessage) ); + } + else if ( iParams ) + { + err = iMbUtils->SetPhoneOwnerL( + iESMREntry->Entry(), + iParams->iMailBoxId ); + } + else + { + err = iMbUtils->SetPhoneOwnerL( iESMREntry->Entry() ); + } + + User::LeaveIfError( err ); + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SwitchToForwardL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SwitchToForwardL() + { + FUNC_LOG; + + if ( !iESMREntry ) + { + // No entries has been processed yet. + User::Leave( KErrNotReady ); + } + + iESMREntry->SwitchToForwardL(); + + // Rest of the scenario data remains as it is + iScenData.iViewMode = EESMRForwardMR; + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SwitchToViewL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SwitchToEditL() + { + FUNC_LOG; + + if ( !iESMREntry ) + { + // No entries has been processed yet. + User::Leave( KErrNotReady ); + } + + iESMREntry->SwitchToOrginalL(); + + // Rest of the scenario data remains as it is + iScenData.iViewMode = EESMREditMR; + + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SwitchToViewL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SwitchToViewL() + { + FUNC_LOG; + + if ( !iESMREntry ) + { + // No entries has been processed yet. + User::Leave( KErrNotReady ); + } + + iESMREntry->SwitchToOrginalL(); + + // Rest of the scenario data remains as it is + iScenData.iViewMode = EESMRViewMR; + + } + +// --------------------------------------------------------------------------- +// CESMREntryProcessor::SwitchToTrackL +// --------------------------------------------------------------------------- +// +void CESMREntryProcessor::SwitchToTrackL() + { + FUNC_LOG; + + if ( !iESMREntry ) + { + // No entries has been processed yet. + User::Leave( KErrNotReady ); + } + + iESMREntry->SwitchToOrginalL(); + + // Rest of the scenario data remains as it is + iScenData.iViewMode = EESMRTrackingViewMR; + iScenData.iRole = EESMRRoleOrganizer; + iScenData.iEntryType = EESMREventTypeAppt; + + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrprocessor/mrprocessorplugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrprocessor/mrprocessorplugin/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +// Internal includes +#include "cesmrentryprocessor.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KMRMeetingRequestProcessorImplementationUID, + CESMREntryProcessor::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/BWINS/ESMRServicesU.def --- a/meetingrequest/mrservices/BWINS/ESMRServicesU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/BWINS/ESMRServicesU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,42 +1,35 @@ EXPORTS - ??1CESMRAlarmInfoHandler@@UAE@XZ @ 1 NONAME ; CESMRAlarmInfoHandler::~CESMRAlarmInfoHandler(void) - ??1CESMRAttachment@@UAE@XZ @ 2 NONAME ; CESMRAttachment::~CESMRAttachment(void) - ??1CESMRAttachmentInfo@@UAE@XZ @ 3 NONAME ; CESMRAttachmentInfo::~CESMRAttachmentInfo(void) - ??1CESMRCalImportExporter@@UAE@XZ @ 4 NONAME ; CESMRCalImportExporter::~CESMRCalImportExporter(void) - ??1CESMRCalUserUtil@@UAE@XZ @ 5 NONAME ; CESMRCalUserUtil::~CESMRCalUserUtil(void) - ??1CESMRRecurrenceInfoHandler@@UAE@XZ @ 6 NONAME ; CESMRRecurrenceInfoHandler::~CESMRRecurrenceInfoHandler(void) - ?AddAttachmentInfoL@CESMRAttachmentInfo@@QAEXABVTDesC16@@HW4TESMRAttachmentState@CESMRAttachment@@@Z @ 7 NONAME ; void CESMRAttachmentInfo::AddAttachmentInfoL(class TDesC16 const &, int, enum CESMRAttachment::TESMRAttachmentState) - ?AddAttachmentInfoL@CESMRAttachmentInfo@@QAEXPAVCESMRAttachment@@@Z @ 8 NONAME ; void CESMRAttachmentInfo::AddAttachmentInfoL(class CESMRAttachment *) + ?GetFirstInstanceTimeL@CESMRRecurrenceInfoHandler@@QAEXAAVTCalTime@@0@Z @ 1 NONAME ; void CESMRRecurrenceInfoHandler::GetFirstInstanceTimeL(class TCalTime &, class TCalTime &) + ??1CESMRCalImportExporter@@UAE@XZ @ 2 NONAME ; CESMRCalImportExporter::~CESMRCalImportExporter(void) + ??1CESMRCalUserUtil@@UAE@XZ @ 3 NONAME ; CESMRCalUserUtil::~CESMRCalUserUtil(void) + ?SetRecurrenceL@CESMRRecurrenceInfoHandler@@QAEXW4TESMRRecurrenceValue@@VTTime@@@Z @ 4 NONAME ; void CESMRRecurrenceInfoHandler::SetRecurrenceL(enum TESMRRecurrenceValue, class TTime) + ?IsAlldayEventL@CESMRCalUserUtil@@QBEHXZ @ 5 NONAME ; int CESMRCalUserUtil::IsAlldayEventL(void) const + ?NewLC@CESMRAlarmInfoHandler@@SAPAV1@XZ @ 6 NONAME ; class CESMRAlarmInfoHandler * CESMRAlarmInfoHandler::NewLC(void) + ?GetAbsoluteAlarmTimeL@CESMRAlarmInfoHandler@@QAEXAAVCCalEntry@@AAVTTime@@@Z @ 7 NONAME ; void CESMRAlarmInfoHandler::GetAbsoluteAlarmTimeL(class CCalEntry &, class TTime &) + ?FindInstancesForEntryL@CESMRConflictChecker@@QAEXVTTime@@0ABVCCalEntry@@EAAV?$RPointerArray@VCCalEntry@@@@@Z @ 8 NONAME ; void CESMRConflictChecker::FindInstancesForEntryL(class TTime, class TTime, class CCalEntry const &, unsigned char, class RPointerArray &) ?AddExceptionL@CESMRRecurrenceInfoHandler@@QAEXVTCalTime@@0@Z @ 9 NONAME ; void CESMRRecurrenceInfoHandler::AddExceptionL(class TCalTime, class TCalTime) - ?AttachmenState@CESMRAttachment@@QBE?AW4TESMRAttachmentState@1@XZ @ 10 NONAME ; enum CESMRAttachment::TESMRAttachmentState CESMRAttachment::AttachmenState(void) const - ?AttachmentCount@CESMRAttachmentInfo@@QBEHXZ @ 11 NONAME ; int CESMRAttachmentInfo::AttachmentCount(void) const - ?AttachmentL@CESMRAttachmentInfo@@QBEABVCESMRAttachment@@H@Z @ 12 NONAME ; class CESMRAttachment const & CESMRAttachmentInfo::AttachmentL(int) const - ?AttachmentName@CESMRAttachment@@QBEABVTDesC16@@XZ @ 13 NONAME ; class TDesC16 const & CESMRAttachment::AttachmentName(void) const - ?AttachmentSizeInBytes@CESMRAttachment@@QBEHXZ @ 14 NONAME ; int CESMRAttachment::AttachmentSizeInBytes(void) const - ?CopyRecurrenceInformationFromL@CESMRRecurrenceInfoHandler@@QAEXABVCCalEntry@@@Z @ 15 NONAME ; void CESMRRecurrenceInfoHandler::CopyRecurrenceInformationFromL(class CCalEntry const &) + ?NewLC@CESMRCalImportExporter@@SAPAV1@XZ @ 10 NONAME ; class CESMRCalImportExporter * CESMRCalImportExporter::NewLC(void) + ?NewL@CESMRCalImportExporter@@SAPAV1@XZ @ 11 NONAME ; class CESMRCalImportExporter * CESMRCalImportExporter::NewL(void) + ?NewL@CESMRAlarmInfoHandler@@SAPAV1@XZ @ 12 NONAME ; class CESMRAlarmInfoHandler * CESMRAlarmInfoHandler::NewL(void) + ?ReadFromResourceL@CESMRAlarmInfoHandler@@QAEXABVTDesC16@@H@Z @ 13 NONAME ; void CESMRAlarmInfoHandler::ReadFromResourceL(class TDesC16 const &, int) + ?RemoveInstanceL@CESMRRecurrenceInfoHandler@@QAEXVTCalTime@@@Z @ 14 NONAME ; void CESMRRecurrenceInfoHandler::RemoveInstanceL(class TCalTime) + ?GetAttendeesL@CESMRCalUserUtil@@QBEXAAV?$RArray@PAVCCalAttendee@@@@I@Z @ 15 NONAME ; void CESMRCalUserUtil::GetAttendeesL(class RArray &, unsigned int) const ?CopyRecurrenceInformationToL@CESMRRecurrenceInfoHandler@@QAEXAAVCCalEntry@@@Z @ 16 NONAME ; void CESMRRecurrenceInfoHandler::CopyRecurrenceInformationToL(class CCalEntry &) - ?GetAbsoluteAlarmTimeL@CESMRAlarmInfoHandler@@QAEXAAVCCalEntry@@AAVTTime@@@Z @ 17 NONAME ; void CESMRAlarmInfoHandler::GetAbsoluteAlarmTimeL(class CCalEntry &, class TTime &) - ?GetAlarmInfoObjectL@CESMRAlarmInfoHandler@@QAEXABVCCalEntry@@AAVTESMRAlarmInfo@@@Z @ 18 NONAME ; void CESMRAlarmInfoHandler::GetAlarmInfoObjectL(class CCalEntry const &, class TESMRAlarmInfo &) - ?GetAttendeesL@CESMRCalUserUtil@@QBEXAAV?$RArray@PAVCCalAttendee@@@@I@Z @ 19 NONAME ; void CESMRCalUserUtil::GetAttendeesL(class RArray &, unsigned int) const - ?GetFirstInstanceTimeL@CESMRRecurrenceInfoHandler@@QAEXAAVTCalTime@@0@Z @ 20 NONAME ; void CESMRRecurrenceInfoHandler::GetFirstInstanceTimeL(class TCalTime &, class TCalTime &) - ?GetRecurrenceL@CESMRRecurrenceInfoHandler@@QBEXAAW4TESMRRecurrenceValue@@AAVTTime@@@Z @ 21 NONAME ; void CESMRRecurrenceInfoHandler::GetRecurrenceL(enum TESMRRecurrenceValue &, class TTime &) const - ?NewL@CESMRAlarmInfoHandler@@SAPAV1@XZ @ 22 NONAME ; class CESMRAlarmInfoHandler * CESMRAlarmInfoHandler::NewL(void) - ?NewL@CESMRAttachment@@SAPAV1@ABVTDesC16@@HW4TESMRAttachmentState@1@@Z @ 23 NONAME ; class CESMRAttachment * CESMRAttachment::NewL(class TDesC16 const &, int, enum CESMRAttachment::TESMRAttachmentState) - ?NewL@CESMRAttachment@@SAPAV1@XZ @ 24 NONAME ; class CESMRAttachment * CESMRAttachment::NewL(void) - ?NewL@CESMRAttachmentInfo@@SAPAV1@XZ @ 25 NONAME ; class CESMRAttachmentInfo * CESMRAttachmentInfo::NewL(void) - ?NewL@CESMRCalImportExporter@@SAPAV1@XZ @ 26 NONAME ; class CESMRCalImportExporter * CESMRCalImportExporter::NewL(void) - ?NewL@CESMRCalUserUtil@@SAPAV1@AAVCCalEntry@@@Z @ 27 NONAME ; class CESMRCalUserUtil * CESMRCalUserUtil::NewL(class CCalEntry &) - ?NewL@CESMRRecurrenceInfoHandler@@SAPAV1@AAVCCalEntry@@@Z @ 28 NONAME ; class CESMRRecurrenceInfoHandler * CESMRRecurrenceInfoHandler::NewL(class CCalEntry &) - ?NewLC@CESMRAlarmInfoHandler@@SAPAV1@XZ @ 29 NONAME ; class CESMRAlarmInfoHandler * CESMRAlarmInfoHandler::NewLC(void) - ?NewLC@CESMRCalImportExporter@@SAPAV1@XZ @ 30 NONAME ; class CESMRCalImportExporter * CESMRCalImportExporter::NewLC(void) - ?NewLC@CESMRCalUserUtil@@SAPAV1@AAVCCalEntry@@@Z @ 31 NONAME ; class CESMRCalUserUtil * CESMRCalUserUtil::NewLC(class CCalEntry &) - ?NewLC@CESMRRecurrenceInfoHandler@@SAPAV1@AAVCCalEntry@@@Z @ 32 NONAME ; class CESMRRecurrenceInfoHandler * CESMRRecurrenceInfoHandler::NewLC(class CCalEntry &) - ?PhoneOwnerRoleL@CESMRCalUserUtil@@QBE?AW4TESMRRole@@XZ @ 33 NONAME ; enum TESMRRole CESMRCalUserUtil::PhoneOwnerRoleL(void) const - ?ReadFromResourceL@CESMRAlarmInfoHandler@@QAEXABVTDesC16@@H@Z @ 34 NONAME ; void CESMRAlarmInfoHandler::ReadFromResourceL(class TDesC16 const &, int) - ?RemoveAttachmentAtL@CESMRAttachmentInfo@@QAEXH@Z @ 35 NONAME ; void CESMRAttachmentInfo::RemoveAttachmentAtL(int) - ?RemoveInstanceL@CESMRRecurrenceInfoHandler@@QAEXVTCalTime@@@Z @ 36 NONAME ; void CESMRRecurrenceInfoHandler::RemoveInstanceL(class TCalTime) - ?SetAttachmentNameL@CESMRAttachment@@QAEXABVTDes16@@@Z @ 37 NONAME ; void CESMRAttachment::SetAttachmentNameL(class TDes16 const &) - ?SetAttachmentSize@CESMRAttachment@@QAEXH@Z @ 38 NONAME ; void CESMRAttachment::SetAttachmentSize(int) - ?SetAttachmentState@CESMRAttachment@@QAEXW4TESMRAttachmentState@1@@Z @ 39 NONAME ; void CESMRAttachment::SetAttachmentState(enum CESMRAttachment::TESMRAttachmentState) - ?SetRecurrenceL@CESMRRecurrenceInfoHandler@@QAEXW4TESMRRecurrenceValue@@VTTime@@@Z @ 40 NONAME ; void CESMRRecurrenceInfoHandler::SetRecurrenceL(enum TESMRRecurrenceValue, class TTime) + ?GetAlarmInfoObjectL@CESMRAlarmInfoHandler@@QAEXABVCCalEntry@@AAVTESMRAlarmInfo@@@Z @ 17 NONAME ; void CESMRAlarmInfoHandler::GetAlarmInfoObjectL(class CCalEntry const &, class TESMRAlarmInfo &) + ??1CESMRAlarmInfoHandler@@UAE@XZ @ 18 NONAME ; CESMRAlarmInfoHandler::~CESMRAlarmInfoHandler(void) + ?NewL@CESMRRecurrenceInfoHandler@@SAPAV1@AAVCCalEntry@@PAVMESMRCalDbMgr@@@Z @ 19 NONAME ; class CESMRRecurrenceInfoHandler * CESMRRecurrenceInfoHandler::NewL(class CCalEntry &, class MESMRCalDbMgr *) + ?PhoneOwnerRoleL@CESMRCalUserUtil@@QBE?AW4TESMRRole@@XZ @ 20 NONAME ; enum TESMRRole CESMRCalUserUtil::PhoneOwnerRoleL(void) const + ?NewLC@CESMRCalUserUtil@@SAPAV1@AAVCCalEntry@@@Z @ 21 NONAME ; class CESMRCalUserUtil * CESMRCalUserUtil::NewLC(class CCalEntry &) + ??1CESMRRecurrenceInfoHandler@@UAE@XZ @ 22 NONAME ; CESMRRecurrenceInfoHandler::~CESMRRecurrenceInfoHandler(void) + ?FindConflictsL@CESMRConflictChecker@@QAEXABVCCalEntry@@AAV?$RPointerArray@VCCalEntry@@@@@Z @ 23 NONAME ; void CESMRConflictChecker::FindConflictsL(class CCalEntry const &, class RPointerArray &) + ?NewL@CESMRConflictChecker@@SAPAV1@AAVMESMRCalDbMgr@@@Z @ 24 NONAME ; class CESMRConflictChecker * CESMRConflictChecker::NewL(class MESMRCalDbMgr &) + ?CopyRecurrenceInformationFromL@CESMRRecurrenceInfoHandler@@QAEXABVCCalEntry@@@Z @ 25 NONAME ; void CESMRRecurrenceInfoHandler::CopyRecurrenceInformationFromL(class CCalEntry const &) + ?NewLC@CESMRRecurrenceInfoHandler@@SAPAV1@AAVCCalEntry@@@Z @ 26 NONAME ; class CESMRRecurrenceInfoHandler * CESMRRecurrenceInfoHandler::NewLC(class CCalEntry &) + ?GetRecurrenceL@CESMRRecurrenceInfoHandler@@QBEXAAW4TESMRRecurrenceValue@@AAVTTime@@@Z @ 27 NONAME ; void CESMRRecurrenceInfoHandler::GetRecurrenceL(enum TESMRRecurrenceValue &, class TTime &) const + ??1CESMRConflictChecker@@UAE@XZ @ 28 NONAME ; CESMRConflictChecker::~CESMRConflictChecker(void) + ?NewL@CESMRCalUserUtil@@SAPAV1@AAVCCalEntry@@@Z @ 29 NONAME ; class CESMRCalUserUtil * CESMRCalUserUtil::NewL(class CCalEntry &) + ?NewLC@CESMRRecurrenceInfoHandler@@SAPAV1@AAVCCalEntry@@PAVMESMRCalDbMgr@@@Z @ 30 NONAME ; class CESMRRecurrenceInfoHandler * CESMRRecurrenceInfoHandler::NewLC(class CCalEntry &, class MESMRCalDbMgr *) + ?NewL@CESMRRecurrenceInfoHandler@@SAPAV1@AAVCCalEntry@@@Z @ 31 NONAME ; class CESMRRecurrenceInfoHandler * CESMRRecurrenceInfoHandler::NewL(class CCalEntry &) + ?GetNextInstanceTimeL@CESMRRecurrenceInfoHandler@@QAEXAAVTCalTime@@0VTTime@@@Z @ 32 NONAME ; void CESMRRecurrenceInfoHandler::GetNextInstanceTimeL(class TCalTime &, class TCalTime &, class TTime) + ?GetPreviousInstanceTimeL@CESMRRecurrenceInfoHandler@@QAEXAAVTCalTime@@0VTTime@@@Z @ 33 NONAME ; void CESMRRecurrenceInfoHandler::GetPreviousInstanceTimeL(class TCalTime &, class TCalTime &, class TTime) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/EABI/ESMRServicesU.def --- a/meetingrequest/mrservices/EABI/ESMRServicesU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/EABI/ESMRServicesU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,56 +1,47 @@ EXPORTS - _ZN15CESMRAttachment17SetAttachmentSizeEi @ 1 NONAME - _ZN15CESMRAttachment18SetAttachmentNameLERK6TDes16 @ 2 NONAME - _ZN15CESMRAttachment18SetAttachmentStateENS_20TESMRAttachmentStateE @ 3 NONAME - _ZN15CESMRAttachment4NewLERK7TDesC16iNS_20TESMRAttachmentStateE @ 4 NONAME - _ZN15CESMRAttachment4NewLEv @ 5 NONAME - _ZN15CESMRAttachmentD0Ev @ 6 NONAME - _ZN15CESMRAttachmentD1Ev @ 7 NONAME - _ZN15CESMRAttachmentD2Ev @ 8 NONAME - _ZN16CESMRCalUserUtil4NewLER9CCalEntry @ 9 NONAME - _ZN16CESMRCalUserUtil5NewLCER9CCalEntry @ 10 NONAME - _ZN16CESMRCalUserUtilD0Ev @ 11 NONAME - _ZN16CESMRCalUserUtilD1Ev @ 12 NONAME - _ZN16CESMRCalUserUtilD2Ev @ 13 NONAME - _ZN19CESMRAttachmentInfo18AddAttachmentInfoLEP15CESMRAttachment @ 14 NONAME - _ZN19CESMRAttachmentInfo18AddAttachmentInfoLERK7TDesC16iN15CESMRAttachment20TESMRAttachmentStateE @ 15 NONAME - _ZN19CESMRAttachmentInfo19RemoveAttachmentAtLEi @ 16 NONAME - _ZN19CESMRAttachmentInfo4NewLEv @ 17 NONAME - _ZN19CESMRAttachmentInfoD0Ev @ 18 NONAME - _ZN19CESMRAttachmentInfoD1Ev @ 19 NONAME - _ZN19CESMRAttachmentInfoD2Ev @ 20 NONAME - _ZN21CESMRAlarmInfoHandler17ReadFromResourceLERK7TDesC16i @ 21 NONAME - _ZN21CESMRAlarmInfoHandler19GetAlarmInfoObjectLERK9CCalEntryR14TESMRAlarmInfo @ 22 NONAME - _ZN21CESMRAlarmInfoHandler21GetAbsoluteAlarmTimeLER9CCalEntryR5TTime @ 23 NONAME - _ZN21CESMRAlarmInfoHandler4NewLEv @ 24 NONAME - _ZN21CESMRAlarmInfoHandler5NewLCEv @ 25 NONAME - _ZN21CESMRAlarmInfoHandlerD0Ev @ 26 NONAME - _ZN21CESMRAlarmInfoHandlerD1Ev @ 27 NONAME - _ZN21CESMRAlarmInfoHandlerD2Ev @ 28 NONAME - _ZN22CESMRCalImportExporter4NewLEv @ 29 NONAME - _ZN22CESMRCalImportExporter5NewLCEv @ 30 NONAME - _ZN22CESMRCalImportExporterD0Ev @ 31 NONAME - _ZN22CESMRCalImportExporterD1Ev @ 32 NONAME - _ZN22CESMRCalImportExporterD2Ev @ 33 NONAME - _ZN26CESMRRecurrenceInfoHandler13AddExceptionLE8TCalTimeS0_ @ 34 NONAME - _ZN26CESMRRecurrenceInfoHandler14SetRecurrenceLE20TESMRRecurrenceValue5TTime @ 35 NONAME - _ZN26CESMRRecurrenceInfoHandler15RemoveInstanceLE8TCalTime @ 36 NONAME - _ZN26CESMRRecurrenceInfoHandler21GetFirstInstanceTimeLER8TCalTimeS1_ @ 37 NONAME - _ZN26CESMRRecurrenceInfoHandler28CopyRecurrenceInformationToLER9CCalEntry @ 38 NONAME - _ZN26CESMRRecurrenceInfoHandler30CopyRecurrenceInformationFromLERK9CCalEntry @ 39 NONAME - _ZN26CESMRRecurrenceInfoHandler4NewLER9CCalEntry @ 40 NONAME - _ZN26CESMRRecurrenceInfoHandler5NewLCER9CCalEntry @ 41 NONAME - _ZN26CESMRRecurrenceInfoHandlerD0Ev @ 42 NONAME - _ZN26CESMRRecurrenceInfoHandlerD1Ev @ 43 NONAME - _ZN26CESMRRecurrenceInfoHandlerD2Ev @ 44 NONAME - _ZNK15CESMRAttachment14AttachmenStateEv @ 45 NONAME - _ZNK15CESMRAttachment14AttachmentNameEv @ 46 NONAME - _ZNK15CESMRAttachment21AttachmentSizeInBytesEv @ 47 NONAME - _ZNK16CESMRCalUserUtil13GetAttendeesLER6RArrayIP12CCalAttendeeEj @ 48 NONAME - _ZNK16CESMRCalUserUtil15PhoneOwnerRoleLEv @ 49 NONAME - _ZNK19CESMRAttachmentInfo11AttachmentLEi @ 50 NONAME - _ZNK19CESMRAttachmentInfo15AttachmentCountEv @ 51 NONAME - _ZNK26CESMRRecurrenceInfoHandler14GetRecurrenceLER20TESMRRecurrenceValueR5TTime @ 52 NONAME - _ZThn4_N22CESMRCalImportExporterD0Ev @ 53 NONAME ; ## - _ZThn4_N22CESMRCalImportExporterD1Ev @ 54 NONAME ; ## + _ZN16CESMRCalUserUtil4NewLER9CCalEntry @ 1 NONAME + _ZN16CESMRCalUserUtil5NewLCER9CCalEntry @ 2 NONAME + _ZN16CESMRCalUserUtilD0Ev @ 3 NONAME + _ZN16CESMRCalUserUtilD1Ev @ 4 NONAME + _ZN16CESMRCalUserUtilD2Ev @ 5 NONAME + _ZN20CESMRConflictChecker14FindConflictsLERK9CCalEntryR13RPointerArrayIS0_E @ 6 NONAME + _ZN20CESMRConflictChecker22FindInstancesForEntryLE5TTimeS0_RK9CCalEntryhR13RPointerArrayIS1_E @ 7 NONAME + _ZN20CESMRConflictChecker4NewLER13MESMRCalDbMgr @ 8 NONAME + _ZN20CESMRConflictCheckerD0Ev @ 9 NONAME + _ZN20CESMRConflictCheckerD1Ev @ 10 NONAME + _ZN20CESMRConflictCheckerD2Ev @ 11 NONAME + _ZN21CESMRAlarmInfoHandler17ReadFromResourceLERK7TDesC16i @ 12 NONAME + _ZN21CESMRAlarmInfoHandler19GetAlarmInfoObjectLERK9CCalEntryR14TESMRAlarmInfo @ 13 NONAME + _ZN21CESMRAlarmInfoHandler21GetAbsoluteAlarmTimeLER9CCalEntryR5TTime @ 14 NONAME + _ZN21CESMRAlarmInfoHandler4NewLEv @ 15 NONAME + _ZN21CESMRAlarmInfoHandler5NewLCEv @ 16 NONAME + _ZN21CESMRAlarmInfoHandlerD0Ev @ 17 NONAME + _ZN21CESMRAlarmInfoHandlerD1Ev @ 18 NONAME + _ZN21CESMRAlarmInfoHandlerD2Ev @ 19 NONAME + _ZN22CESMRCalImportExporter4NewLEv @ 20 NONAME + _ZN22CESMRCalImportExporter5NewLCEv @ 21 NONAME + _ZN22CESMRCalImportExporterD0Ev @ 22 NONAME + _ZN22CESMRCalImportExporterD1Ev @ 23 NONAME + _ZN22CESMRCalImportExporterD2Ev @ 24 NONAME + _ZN26CESMRRecurrenceInfoHandler13AddExceptionLE8TCalTimeS0_ @ 25 NONAME + _ZN26CESMRRecurrenceInfoHandler14SetRecurrenceLE20TESMRRecurrenceValue5TTime @ 26 NONAME + _ZN26CESMRRecurrenceInfoHandler15RemoveInstanceLE8TCalTime @ 27 NONAME + _ZN26CESMRRecurrenceInfoHandler20GetNextInstanceTimeLER8TCalTimeS1_5TTime @ 28 NONAME + _ZN26CESMRRecurrenceInfoHandler21GetFirstInstanceTimeLER8TCalTimeS1_ @ 29 NONAME + _ZN26CESMRRecurrenceInfoHandler24GetPreviousInstanceTimeLER8TCalTimeS1_5TTime @ 30 NONAME + _ZN26CESMRRecurrenceInfoHandler28CopyRecurrenceInformationToLER9CCalEntry @ 31 NONAME + _ZN26CESMRRecurrenceInfoHandler30CopyRecurrenceInformationFromLERK9CCalEntry @ 32 NONAME + _ZN26CESMRRecurrenceInfoHandler4NewLER9CCalEntry @ 33 NONAME + _ZN26CESMRRecurrenceInfoHandler4NewLER9CCalEntryP13MESMRCalDbMgr @ 34 NONAME + _ZN26CESMRRecurrenceInfoHandler5NewLCER9CCalEntry @ 35 NONAME + _ZN26CESMRRecurrenceInfoHandler5NewLCER9CCalEntryP13MESMRCalDbMgr @ 36 NONAME + _ZN26CESMRRecurrenceInfoHandlerD0Ev @ 37 NONAME + _ZN26CESMRRecurrenceInfoHandlerD1Ev @ 38 NONAME + _ZN26CESMRRecurrenceInfoHandlerD2Ev @ 39 NONAME + _ZNK16CESMRCalUserUtil13GetAttendeesLER6RArrayIP12CCalAttendeeEj @ 40 NONAME + _ZNK16CESMRCalUserUtil14IsAlldayEventLEv @ 41 NONAME + _ZNK16CESMRCalUserUtil15PhoneOwnerRoleLEv @ 42 NONAME + _ZNK26CESMRRecurrenceInfoHandler14GetRecurrenceLER20TESMRRecurrenceValueR5TTime @ 43 NONAME + _ZThn4_N22CESMRCalImportExporterD0Ev @ 44 NONAME + _ZThn4_N22CESMRCalImportExporterD1Ev @ 45 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/group/bld.inf --- a/meetingrequest/mrservices/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -27,11 +27,10 @@ ../inc/tesmralarminfo.h |../../inc/tesmralarminfo.h ../inc/esmralarminfo.rh |../../inc/esmralarminfo.rh ../inc/cesmrrecurrenceinfohandler.h |../../inc/cesmrrecurrenceinfohandler.h -../inc/cesmrcaluserutil.h |../../inc/cesmrcaluserutil.h -../inc/cesmrattachment.h |../../inc/cesmrattachment.h -../inc/cesmrattachmentinfo.h |../../inc/cesmrattachmentinfo.h -../inc/cesmrcalimportexporter.h |../../inc/cesmrcalimportexporter.h -../inc/mesmrcalimportexporter.h |../../inc/mesmrcalimportexporter.h +../inc/cesmrcaluserutil.h |../../inc/cesmrcaluserutil.h +../inc/cesmrconflictchecker.h |../../inc/cesmrconflictchecker.h +../inc/cesmrcalimportexporter.h |../../inc/cesmrcalimportexporter.h +../inc/mesmrcalimportexporter.h |../../inc/mesmrcalimportexporter.h // PRJ_MMPFILES diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/group/esmrservices.mmp --- a/meetingrequest/mrservices/group/esmrservices.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/group/esmrservices.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,16 +29,12 @@ VENDORID VID_DEFAULT DEFFILE ESMRServices.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrrecurrenceinfohandler.cpp SOURCE cesmrcalimportexporter.cpp SOURCE cesmralarminfohandler.cpp SOURCE cesmrcaluserutil.cpp -SOURCE cesmrattachment.cpp -SOURCE cesmrattachmentinfo.cpp +SOURCE cesmrconflictchecker.cpp USERINCLUDE . USERINCLUDE ../inc @@ -48,7 +43,11 @@ APP_LAYER_SYSTEMINCLUDE +// +// USERINCLUDE ../../../inc +// +// START RESOURCE ../data/alarminfo/esmralarminfo.rss HEADER @@ -71,10 +70,9 @@ LIBRARY calinterimapi.lib LIBRARY caleninterimutils2.lib LIBRARY charconv.lib -LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/inc/cesmrattachment.h --- a/meetingrequest/mrservices/inc/cesmrattachment.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MRUI attachmen definition -* -*/ - - -#ifndef CESMRATTACHMENT_H -#define CESMRATTACHMENT_H - -#include - -/** - * CESMRAttachment encapsulates MR attachment. - * - * @lib esmrservices.lib - */ -NONSHARABLE_CLASS( CESMRAttachment ) : public CBase - { -public: - /** - * Attachment state information - */ - enum TESMRAttachmentState - { - /** Unknown attachment state */ - EAttachmentStateUnknown, - /** Attachment is now downlaoded to device */ - EAttachmentStateNotDownloaded, - /** Attachment is downloaded to device */ - EAttachmentStateDownloaded - }; - -public: // Construction and destruction - /** - * Two-phased constructor. Creates and initializes - * CESMRAttachment object. Ownership transferred to caller. - * - * @return Pointer to esmr CESMRAttachment handler object. - */ - IMPORT_C static CESMRAttachment* NewL(); - - /** - * Two-phased constructor. Creates and initializes - * CESMRAttachment object. Ownership transferred to caller and - * created object is left to cleanup stack. - * - * @param aAttachmentName File name of attachment - * @param aSizeInBytes size of attachment - * @param aAttachmentState state of attachment download - * @return Pointer to esmr CESMRAttachment handler object. - */ - IMPORT_C static CESMRAttachment* NewL( - const TDesC& aAttachmentName, - TInt aSizeInBytes, - TESMRAttachmentState aAttachmentState ); - - /** - * C++ Destructor. - */ - IMPORT_C ~CESMRAttachment(); - -public: // Interface - /** - * Sets name of attachment - * - * @param aAttachmentName File name of attachment - */ - IMPORT_C void SetAttachmentNameL( - const TDes& aAttachmentName ); - - /** - * Gets name of attachment - * - * @return File name of attachment - */ - IMPORT_C const TDesC& AttachmentName() const; - - /** - * Sets size of attachment - * - * @param aAttachmentSizeInBytes size of attachment in bytes - */ - IMPORT_C void SetAttachmentSize( - TInt aAttachmentSizeInBytes ); - - /** - * return size of attachment in bytes - * - * @return size of attachment - */ - IMPORT_C TInt AttachmentSizeInBytes() const; - - /** - * Sets download state of attachment - * - * @param aAttachmentState download state of attachment - */ - IMPORT_C void SetAttachmentState( - TESMRAttachmentState aAttachmentState ); - - /** - * Gets download state of attachment - * - * @return download state of attachment - */ - IMPORT_C TESMRAttachmentState AttachmenState() const; - - -private: // Implementation - CESMRAttachment( - TInt aSizeInBytes, - TESMRAttachmentState aAttachmentState ); - void ConstructL( - const TDesC& aAttachmentName ); - -private: // data - /// Own: Attachment name - HBufC* iAttachmentName; - /// Own: Attachment size in bytes. - TInt iSizeInBytes; - /// Own: AttachmenSize - TESMRAttachmentState iState; - }; - -#endif // CESMRATTACHMENT_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/inc/cesmrattachmentinfo.h --- a/meetingrequest/mrservices/inc/cesmrattachmentinfo.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MRUI attachmentinfo definition -* -*/ - - -#ifndef CESMRATTACHMENTINFO_H -#define CESMRATTACHMENTINFO_H - -#include -#include "cesmrattachment.h" - -/** - * CESMRAttachmentInfo encapsulates MR attachment information - * and handling of CESMRAttachment objects in own RPointerArray - * - * @lib esmrservices.lib - */ -NONSHARABLE_CLASS( CESMRAttachmentInfo ) : public CBase - { -public: // Construction and destruction - /** - * Two-phased constructor. Creates and initializes - * CESMRAttachmentInfo object. Ownership transferred to caller. - * - * @return Pointer to esmr CESMRAttachmentInfo handler object. - */ - IMPORT_C static CESMRAttachmentInfo* NewL(); - - /** - * C++ Destructor - */ - IMPORT_C ~CESMRAttachmentInfo(); - -public: - /** - * Creates new CESMRAttachment object and - * adds it to the array owned by this class - * - * @param aAttachmentName File name of attachment - * @param size of attachment - * @param aState state of attachment download - */ - IMPORT_C void AddAttachmentInfoL( - const TDesC& aAttachmentName, - TInt aAttachntSizeInBytes, - CESMRAttachment::TESMRAttachmentState aState ); - - /** - * adds CESMRAttachment to the array owned by this class - * - * @param aAttachment object to be added to the array - */ - IMPORT_C void AddAttachmentInfoL( - CESMRAttachment* aAttachment ); - - /** - * Counts number of CESMRAttachment objects in array - * @return number of objects in array - */ - IMPORT_C TInt AttachmentCount() const; - - /** - * Returns CESMRAttachment from array index - * - *@param aIndex index of CESMRAttachment to be returned - *@return object in the index - */ - IMPORT_C const CESMRAttachment& AttachmentL( - TInt aIndex ) const; - - /** - * Removes CESMRAttachment from array index - * - *@param aIndex index of CESMRAttachment to be removed from array - */ - IMPORT_C void RemoveAttachmentAtL( - TInt aIndex ); - -private: // Implementation - - CESMRAttachmentInfo(); - void ConstructL(); - -private: // Data - /// Own: Attachment objects - RPointerArray iAttachments; - }; - -#endif // CESMRATTACHMENTINFO_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/inc/cesmrcaluserutil.h --- a/meetingrequest/mrservices/inc/cesmrcaluserutil.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/inc/cesmrcaluserutil.h Wed Mar 31 21:08:33 2010 +0300 @@ -80,6 +80,12 @@ */ IMPORT_C TESMRRole PhoneOwnerRoleL() const; + /** + * Checks if entry is allday event. + * @return ETrue if entry is allday event. + */ + IMPORT_C TBool IsAlldayEventL() const; + private: // Implementation CESMRCalUserUtil( CCalEntry& aEntry ); void ConstructL(); diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/inc/cesmrconflictchecker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrservices/inc/cesmrconflictchecker.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR calendar entry conflict checker +* +*/ + + +#ifndef CESMRCONFLICTCHECKER_H +#define CESMRCONFLICTCHECKER_H + +#include +#include + +class CCalEntry; +class MESMRCalDbMgr; + +/** + * CESMRConflictChecker is responsible for finding + * conflicting entries from symbian calendar database. + * + * @lib esmrentry.lib + */ +NONSHARABLE_CLASS(CESMRConflictChecker) : + public CBase + { +public: // Construction and destruction + /** + * Two-phased constructor. Creates and initializes + * CESMRConflictChecker object. + * @param aDbMgr Reference to cal db manager. + * @return Pointer to esmr policy checker object. + */ + IMPORT_C static CESMRConflictChecker* NewL( + MESMRCalDbMgr& aDbMgr ); + + /** + * C++ destructor. + */ + IMPORT_C ~CESMRConflictChecker(); + +public: // Interface + /** + * Finds conflicting entries. Conflicting entries are + * stored to table given as parameter. Ownership of the + * conflicting entries are transferred to caller. + * + * @param aEntry Reference to calendar entry + * @param aConflicts Reference to calendar entry table + */ + IMPORT_C void FindConflictsL( + const CCalEntry& aEntry, + RPointerArray& aConflicts ); + + /** + * Finds instances for this entry occuring between specified + * time range, that are in conflict with given entry. + * Ownership of the conflicting entries are transferred to caller. + * @param aStart Start time + * @param aEnd End time + * @param aEntry Reference to entry + * @param aColId Collection id of the entry + * @param aInstances On return contains the conflicting instances + * + */ + IMPORT_C void FindInstancesForEntryL( + TTime aStart, + TTime aEnd, + const CCalEntry& aEntry, + TCalCollectionId aColId, + RPointerArray& aInstances ); + +private: // Implementation + CESMRConflictChecker( + MESMRCalDbMgr& aDbMgr ); + +private: // Data + /// Ref: Reference to cal db manager + MESMRCalDbMgr& iDbMgr; + }; + +#endif // CESMRCONFLICTCHECKER_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/inc/cesmrrecurrenceinfohandler.h --- a/meetingrequest/mrservices/inc/cesmrrecurrenceinfohandler.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/inc/cesmrrecurrenceinfohandler.h Wed Mar 31 21:08:33 2010 +0300 @@ -24,9 +24,11 @@ #include "esmrdef.h" // #include +#include class CCalEntry; class TCalRRule; +class MESMRCalDbMgr; /** * CESMRRecurrenceInfoHandler is responsible for handling recurrence related @@ -43,6 +45,7 @@ * CESMRRecurrenceInfoHandler object. Ownership transferred to caller. * * @param aEntry Reference to calendar entry. + * @param aCalDb Reference to caldb manager * @return Pointer to esmr recurrence handler object. */ IMPORT_C static CESMRRecurrenceInfoHandler* NewL( @@ -54,12 +57,38 @@ * Created object is left to cleanup stack. * * @param aEntry Reference to calendar entry. + * @param aCalDb Pointer to caldb manager. Ownership not transferred. + * @return Pointer to esmr recurrence handler object. + */ + IMPORT_C static CESMRRecurrenceInfoHandler* NewL( + CCalEntry& aEntry, + MESMRCalDbMgr* aCalDb ); + + /** + * Two-phased constructor. Creates and initializes + * CESMRRecurrenceInfoHandler object. Ownership transferred to caller. + * + * @param aEntry Reference to calendar entry. + * @param aCalDb Reference to caldb manager * @return Pointer to esmr recurrence handler object. */ IMPORT_C static CESMRRecurrenceInfoHandler* NewLC( CCalEntry& aEntry ); /** + * Two-phased constructor. Creates and initializes + * CESMRRecurrenceInfoHandler object. Ownership transferred to caller. + * Created object is left to cleanup stack. + * + * @param aEntry Reference to calendar entry. + * @param aCalDb Reference to caldb manager + * @return Pointer to esmr recurrence handler object. + */ + IMPORT_C static CESMRRecurrenceInfoHandler* NewLC( + CCalEntry& aEntry, + MESMRCalDbMgr* aCalDb ); + + /** * C++ Destructor. */ IMPORT_C ~CESMRRecurrenceInfoHandler(); @@ -129,10 +158,29 @@ IMPORT_C void GetFirstInstanceTimeL( TCalTime& aStart, TCalTime& aEnd ); + + /** + * Gets the start and end times of the previous instance. + * @param aStart Reference to start time. + * @param aEnd Reference to end time. + */ + IMPORT_C void GetPreviousInstanceTimeL( TCalTime& aPreviousStartTime, + TCalTime& aPreviousEndTime, + TTime aInstanceDateTime ); + + /** + * Gets the start and end times of the next instance. + * @param aStart Reference to start time. + * @param aEnd Reference to end time. + */ + IMPORT_C void GetNextInstanceTimeL( TCalTime& aNextStartTime, + TCalTime& aNextEndTime, + TTime aInstanceDateTime ); private: // Implementation CESMRRecurrenceInfoHandler( - CCalEntry& aEntry ); + CCalEntry& aEntry, + MESMRCalDbMgr* aCalDb ); void ConstructL(); void CalculateRecurrenceUntilDateL( @@ -160,11 +208,24 @@ TBool NeedToSetRecurrenceL( TESMRRecurrenceValue aRecurrence, TTime aUntil ) const; + + TTime GetPreviousInstanceForRepeatOtherL( + CCalEntry& aEntry, + const CalCommon::TCalTimeRange& timeRange ); + + TTime GetNextInstanceForRepeatOtherL( + CCalEntry& aEntry, + const CalCommon::TCalTimeRange& timeRange ); + + TESMRRecurrenceValue RepeatIndexL( const CCalEntry& aEntry ); + private: /// Ref: Reference to meeting request entry CCalEntry& iEntry; + /// Ref: Reference to caldb manager + MESMRCalDbMgr* iCalDb; }; #endif // CESMRRECURRENCEINFOHANDLER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/src/cesmrattachment.cpp --- a/meetingrequest/mrservices/src/cesmrattachment.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -/* -* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MRUI attachmen definition -* -*/ - - -#include "emailtrace.h" -#include "cesmrattachment.h" - -// unnamed namespace for local definitions -namespace { - -// Unnamed attachment -_LIT( KESMRUnnamedAttachment, "" ); - -// Zero length attachment -const TInt KZeroLengthAttachment( 0 ); - -} - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRAttachment::CESMRAttachment -// --------------------------------------------------------------------------- -// -CESMRAttachment::CESMRAttachment( - TInt aSizeInBytes, - TESMRAttachmentState aAttachmentState ) -: iSizeInBytes( aSizeInBytes ), - iState( aAttachmentState ) - { - FUNC_LOG; - // No implementation - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::~CESMRAttachment -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAttachment::~CESMRAttachment() - { - FUNC_LOG; - delete iAttachmentName; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAttachment* CESMRAttachment::NewL() - { - FUNC_LOG; - CESMRAttachment* self = NewL( - KESMRUnnamedAttachment, - KZeroLengthAttachment, - EAttachmentStateUnknown ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAttachment* CESMRAttachment::NewL( - const TDesC& aAttachmentName, - TInt aSizeInBytes, - TESMRAttachmentState aAttachmentState ) - { - FUNC_LOG; - CESMRAttachment* self = - new (ELeave) CESMRAttachment( aSizeInBytes, aAttachmentState ); - CleanupStack::PushL( self ); - self->ConstructL( aAttachmentName ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRAttachment::ConstructL( - const TDesC& aAttachmentName ) - { - FUNC_LOG; - iAttachmentName = aAttachmentName.AllocL(); - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::SetAttachmentNameL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAttachment::SetAttachmentNameL( - const TDes& aAttachmentName ) - { - FUNC_LOG; - delete iAttachmentName; - iAttachmentName = NULL; - iAttachmentName = aAttachmentName.AllocL(); - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::AttachmentName -// --------------------------------------------------------------------------- -// -EXPORT_C const TDesC& CESMRAttachment::AttachmentName() const - { - FUNC_LOG; - return *iAttachmentName; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::SetAttachmentSize -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAttachment::SetAttachmentSize( - TInt aAttachmentSizeInBytes ) - { - FUNC_LOG; - iSizeInBytes = aAttachmentSizeInBytes; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::AttachmentSizeInBytes -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRAttachment::AttachmentSizeInBytes() const - { - FUNC_LOG; - return iSizeInBytes; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::SetAttachmentState -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAttachment::SetAttachmentState( - TESMRAttachmentState aAttachmentState ) - { - FUNC_LOG; - iState = aAttachmentState; - } - -// --------------------------------------------------------------------------- -// CESMRAttachment::AttachmenState -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAttachment::TESMRAttachmentState - CESMRAttachment::AttachmenState() const - { - FUNC_LOG; - return iState; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/src/cesmrattachmentinfo.cpp --- a/meetingrequest/mrservices/src/cesmrattachmentinfo.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: MRUI attachmentinfo definition -* -*/ - -#include "emailtrace.h" -#include "cesmrattachmentinfo.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::CESMRAttachmentInfo -// --------------------------------------------------------------------------- -// -inline CESMRAttachmentInfo::CESMRAttachmentInfo() - { - FUNC_LOG; - } -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::~CESMRAttachmentInfo -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAttachmentInfo::~CESMRAttachmentInfo() - { - FUNC_LOG; - iAttachments.ResetAndDestroy(); - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRAttachmentInfo* CESMRAttachmentInfo::NewL() - { - FUNC_LOG; - CESMRAttachmentInfo* self = new (ELeave) CESMRAttachmentInfo; - return self; - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRAttachmentInfo::ConstructL() - { - FUNC_LOG; - // Do nothing - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::AddAttachmentInfoL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAttachmentInfo::AddAttachmentInfoL( - const TDesC& aAttachmentName, - TInt aAttachntSizeInBytes, - CESMRAttachment::TESMRAttachmentState aState ) - { - FUNC_LOG; - CESMRAttachment* attachment = - CESMRAttachment::NewL( - aAttachmentName, - aAttachntSizeInBytes, - aState ); - - // Ownership of 'attachment' is transferred - AddAttachmentInfoL( attachment ); - attachment = NULL; - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::AddAttachmentInfoL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAttachmentInfo::AddAttachmentInfoL( - CESMRAttachment* aAttachment ) - { - FUNC_LOG; - // Ownership of 'aAttachment' is transferred to pointer array on the stack - User::LeaveIfError( iAttachments.Append(aAttachment) ); - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::AttachmentCount -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CESMRAttachmentInfo::AttachmentCount() const - { - FUNC_LOG; - return iAttachments.Count(); - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::Attachment -// --------------------------------------------------------------------------- -// -EXPORT_C const CESMRAttachment& CESMRAttachmentInfo::AttachmentL( - TInt aIndex ) const - { - FUNC_LOG; - if ( aIndex < 0 || aIndex >= iAttachments.Count() ) - { - User::Leave( KErrArgument ); - } - - return *(iAttachments[ aIndex ]); - } - -// --------------------------------------------------------------------------- -// CESMRAttachmentInfo::RemoveAttachmentAtL -// --------------------------------------------------------------------------- -// -EXPORT_C void CESMRAttachmentInfo::RemoveAttachmentAtL( - TInt aIndex ) - { - FUNC_LOG; - CESMRAttachment* attachment = iAttachments[ aIndex ]; - iAttachments.Remove( aIndex ); - delete attachment; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/src/cesmrcaluserutil.cpp --- a/meetingrequest/mrservices/src/cesmrcaluserutil.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/src/cesmrcaluserutil.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -24,6 +24,16 @@ #include #include +namespace { // codescanner::namespace + +// Definition for 0 +const TInt KZero = 0; + +// Definition for number of hours within day +const TInt KHoursInDay = 24; + +} // namespace + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -195,5 +205,44 @@ return role; } +// --------------------------------------------------------------------------- +// CESMRCalUserUtil::IsAlldayEventL +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CESMRCalUserUtil::IsAlldayEventL() const + { + FUNC_LOG; + + TBool allDayEvent(EFalse); + + TCalTime startTime = iEntry.StartTimeL(); + TCalTime stopTime = iEntry.EndTimeL(); + + TTimeIntervalHours hoursBetweenStartAndEnd; + stopTime.TimeLocalL().HoursFrom( + startTime.TimeLocalL(), + hoursBetweenStartAndEnd ); + + TCalTime::TTimeMode mode = startTime.TimeMode(); + + TInt hoursBetweenStartAndEndAsInt( hoursBetweenStartAndEnd.Int() ); + TInt alldayDivident( hoursBetweenStartAndEndAsInt % KHoursInDay ); + + TDateTime startTimeLocal = startTime.TimeLocalL().DateTime(); + TDateTime stopTimeLocal = stopTime.TimeLocalL().DateTime(); + + if ( hoursBetweenStartAndEndAsInt && KZero == alldayDivident ) + { + if ( startTimeLocal.Hour() == stopTimeLocal.Hour() && + startTimeLocal.Minute() == stopTimeLocal.Minute() && + startTimeLocal.Second() == stopTimeLocal.Second() ) + { + allDayEvent = ETrue; + } + } + + return allDayEvent; + } + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/src/cesmrconflictchecker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrservices/src/cesmrconflictchecker.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,444 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description : ESMR conflict checker implementation +* Version : %version: e002sa33#7 % +* +*/ + +#include "emailtrace.h" +#include "cesmrconflictchecker.h" +#include "cesmrcaldbmgr.h" +#include "esmrhelper.h" +#include "esmrentryhelper.h" +#include "esmrinternaluid.h" + +#include +#include +#include +#include +#include +#include + +/// Unnamed namespace for local definitions +namespace { // codescanner::namespace + +// Definition for zero +const TInt KZero(0); + +/** Defines instace filter type */ +enum TInstanceFilter + { + EIncludeSameUID, + ERemoveSameUID + }; + +#ifdef _DEBUG + +// Literal for panic texts +_LIT( KESMRConflictCheckerTxt, "ESMRConflictChecker" ); + +/** Enumeration for panic codes */ +enum TESMRConflictCheckerPanic + { + // Input entry is not appointment + EESMRConflictCheckerInvalidEntryType + }; + +/** + * Thows system wide panic. + * @param aPanic Panic code. + */ +void Panic( TESMRConflictCheckerPanic aPanic ) + { + + User::Panic( KESMRConflictCheckerTxt, aPanic ); + } + +#else + +/** + * Thows system wide leave. + * @param aError Leave code. + */ +void Leave( TInt aError ) + { + + User::Leave( aError ); + } + +#endif + +/** + * Resolves time range for possible conflicting entries. Instance view + * is used for resolving the time range. + * + * @param aStart Start time + * @param aEnd End time + * @param aInstanceView Pointer to calendar db instance view + * @return Time range for possible conflicting entries + */ +CalCommon::TCalTimeRange ResolveFetchTimeRangeL( + TTime aStart, + TTime aEnd, + CCalInstanceView* aInstanceView ) + { + FUNC_LOG; + const CalCommon::TCalViewFilter instanceFilter = + CalCommon::EIncludeAppts; + + TDateTime start = aStart.DateTime(); + TDateTime end = aEnd.DateTime(); + + start.SetHour( KZero ); + start.SetMinute( KZero ); + start.SetSecond( KZero ); + start.SetMicroSecond( KZero ); + + end.SetHour( KZero ); + end.SetMinute( KZero ); + end.SetSecond( KZero ); + end.SetMicroSecond( KZero ); + TTime endTime = end; + + if ( TTime(start) == endTime || + endTime < aEnd ) + { + + endTime += TTimeIntervalDays(1); + end = endTime.DateTime(); + } + + TCalTime rangeStart; + rangeStart.SetTimeLocalL( start ); + + TCalTime instanceTime = aInstanceView->PreviousInstanceL( + instanceFilter, + rangeStart ); + + if ( Time::NullTTime() != instanceTime.TimeUtcL() ) + { + rangeStart = instanceTime; + } + + TCalTime rangeEnd; + rangeEnd.SetTimeLocalL( end ); + + instanceTime = aInstanceView->NextInstanceL( + instanceFilter, + rangeEnd ); + + if ( instanceTime.TimeLocalL() != Time::NullTTime() ) + { + rangeEnd = instanceTime; + } + + return CalCommon::TCalTimeRange( rangeStart, rangeEnd ); + } + +/** + * Removes and deletes the entries, which do not conflict with + * entry. Entry is considered to be conflicting entry if starts or + * ends between aEntry's start and end time. + * + * @param aEntries Reference to entries, which may conflict + * @param aEntry Reference to entry, which confilcts are resolved. + */ +void RemoveAndDeleteNonConflictingInstancesL( + RPointerArray& instanceArray, + TCalTime aStartTime, + TCalTime aEndTime, + const TDesC8& aUid, + TInstanceFilter aFilterType ) + { + FUNC_LOG; + TInt index(0); + + TTime startTimeLocal = aStartTime.TimeLocalL(); + TTime endTimeLocal = aEndTime.TimeLocalL(); + + while( index < instanceArray.Count() ) + { + TBool conflictingInstance( ETrue ); + CCalInstance* instance = instanceArray[index]; + + TTime entryStartTimeLocal = instance->StartTimeL().TimeLocalL(); + TTime entryEndTimeLocal = instance->EndTimeL().TimeLocalL(); + + TPtrC8 uid( instance->Entry().UidL() ); + if ( ERemoveSameUID == aFilterType && + 0 == aUid.CompareF(uid) ) + { + conflictingInstance = EFalse; + } + else if ( entryStartTimeLocal >= startTimeLocal && + entryStartTimeLocal < endTimeLocal ) + { + // Entry starts during another entry + index++; + } + else if ( entryEndTimeLocal > startTimeLocal && + entryEndTimeLocal <= endTimeLocal ) + { + // Entry ends during another entry + index++; + } + else if ( entryStartTimeLocal < startTimeLocal && + entryEndTimeLocal > endTimeLocal ) + { + // Antry starts and ends during another entry + index++; + } + else + { + conflictingInstance = EFalse; + } + + // Remove non-conflicting instance from instance array + if ( !conflictingInstance ) + { + instanceArray.Remove(index); + delete instance; + instance = NULL; + } + } + } + +/** + * Creates calendar entries from the conflicting instances + * and stores the created entries into entry array. + * Ownership of the created entries is transferred to caller. + * @param aInstanceArray Reference to instance array + * @param aConflictingEntries Reference to entry array. + */ +void CreateEntriesFromInstancesL( + RPointerArray& instanceArray, + RPointerArray& aConflictingEntries ) + { + FUNC_LOG; + TInt instanceCount( instanceArray.Count() ); + for ( TInt i(0); i < instanceCount; ++i ) + { + CCalEntry& parent( instanceArray[i]->Entry() ); + CCalEntry* entry = ESMRHelper::CopyEntryLC( parent, + parent.MethodL(), + ESMRHelper::ECopyFull ); + + entry->SetStartAndEndTimeL( instanceArray[i]->StartTimeL(), + instanceArray[i]->EndTimeL() ); + + User::LeaveIfError( aConflictingEntries.Append( entry ) ); + CleanupStack::Pop( entry ); + } + } + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRConflictChecker::CESMRConflictChecker +// --------------------------------------------------------------------------- +// +inline CESMRConflictChecker::CESMRConflictChecker( + MESMRCalDbMgr& aDbMgr ) : + iDbMgr( aDbMgr ) + { + FUNC_LOG; + // Not implementation yet + } + +// --------------------------------------------------------------------------- +// CESMRConflictChecker::~CESMRConflictChecker +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRConflictChecker::~CESMRConflictChecker() + { + FUNC_LOG; + // Not implementation yet + } + +// --------------------------------------------------------------------------- +// CESMRConflictChecker::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRConflictChecker* CESMRConflictChecker::NewL( + MESMRCalDbMgr& aDbMgr ) + { + FUNC_LOG; + CESMRConflictChecker* self = + new (ELeave) CESMRConflictChecker(aDbMgr); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRConflictChecker::FindConflictsL +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRConflictChecker::FindConflictsL( + const CCalEntry& aEntry, + RPointerArray& aConflicts ) + { + FUNC_LOG; + + // Checking input parameters +#ifdef _DEBUG + + __ASSERT_DEBUG( + CCalEntry::EAppt == aEntry.EntryTypeL(), + Panic(EESMRConflictCheckerInvalidEntryType) ); + +#else + + if ( CCalEntry::EAppt != aEntry.EntryTypeL() ) + { + Leave( KErrArgument ); + } + +#endif + + // Get instance views of all calendar + RPointerArray allCalenInstanceView = + iDbMgr.NormalDbAllCalenInstanceView(); + + RCPointerArray instanceArray; + CleanupClosePushL( instanceArray ); + + // Check if there is any conflict in each calendar + for( TInt i = 0; i < allCalenInstanceView.Count(); i++ ) + { + CalCommon::TCalTimeRange timeRange = + ResolveFetchTimeRangeL( + aEntry.StartTimeL().TimeUtcL(), + aEntry.EndTimeL().TimeUtcL(), + allCalenInstanceView[i] ); + + allCalenInstanceView[i]->FindInstanceL( instanceArray, + CalCommon::EIncludeAppts, + timeRange ); + + + } + + RemoveAndDeleteNonConflictingInstancesL( + instanceArray, + aEntry.StartTimeL(), + aEntry.EndTimeL(), + aEntry.UidL(), + ERemoveSameUID ); + + CreateEntriesFromInstancesL( instanceArray, aConflicts ); + CleanupStack::PopAndDestroy(); // instanceArray + } + +// --------------------------------------------------------------------------- +// CESMRConflictChecker::FindInstancesForEntry +// --------------------------------------------------------------------------- +// +EXPORT_C void CESMRConflictChecker::FindInstancesForEntryL( + TTime aStart, + TTime aEnd, + const CCalEntry& aEntry, + TCalCollectionId aColId, + RPointerArray& aInstances ) + { + FUNC_LOG; + CCalInstanceView* instanceView = iDbMgr.InstanceViewL( aEntry ); + + RCPointerArray instanceArray; + CleanupClosePushL( instanceArray ); + + // First we need the parent entry of the series ... + CCalInstance* entryInstance = instanceView->FindInstanceL( + aEntry.LocalUidL(), + aEntry.StartTimeL() ); //Ownership gained + CleanupStack::PushL( entryInstance ); + + CCalInstance* parentEntryInstance = instanceView->FindInstanceL( + aEntry.LocalUidL(), + entryInstance->Entry().StartTimeL() ); + CleanupStack::PopAndDestroy( entryInstance ); + CleanupStack::PushL( parentEntryInstance ); + + // ... And the parent entry instances start time + TCalTime firstIntanceStartTime( parentEntryInstance->StartTimeL() ); + + CleanupStack::Pop( parentEntryInstance ); // ownership given to instanceArray + instanceArray.Append( parentEntryInstance ); + + // Let's get all instances which have same uid and collection id + // as the aEntry to an iterator. + CCalInstanceIterator* instanceIterator = instanceView->FindInstanceByUidL( + aColId, + aEntry.UidL(), + firstIntanceStartTime ); + CleanupStack::PushL( instanceIterator ); + + TInt count( instanceIterator->Count() ); + + for( TInt i = 0; i < count; ++i ) + { + CCalInstance* instance = NULL; + TRAPD( err, instance = instanceIterator->NextL() ); //Ownership gained + if( !err && instance ) + { + instanceArray.Append( instance ); + } + } + + CleanupStack::PopAndDestroy( instanceIterator ); + + // Now the instanceArray has all instances of the aEntry, + // let's remove this instance == instance of aEntry, from the array + TInt i( 0 ); + while( i < instanceArray.Count() ) + { + CCalInstance* instance = instanceArray[i]; + + TBool thisInstance( + instance->StartTimeL().TimeLocalL() == + aEntry.StartTimeL().TimeLocalL() && + instance->EndTimeL().TimeLocalL() == + aEntry.EndTimeL().TimeLocalL() ); + + if( thisInstance ) + { + delete instance; + instanceArray.Remove( i ); + } + else + { + ++i; + } + } + + TCalTime start; + start.SetTimeLocalL( aStart ); + + TCalTime end; + end.SetTimeLocalL( aEnd ); + + RemoveAndDeleteNonConflictingInstancesL( + instanceArray, + start, + end, + aEntry.UidL(), + EIncludeSameUID ); + + CreateEntriesFromInstancesL( instanceArray, aInstances ); + + CleanupStack::PopAndDestroy(); // instanceArray + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrservices/src/cesmrrecurrenceinfohandler.cpp --- a/meetingrequest/mrservices/src/cesmrrecurrenceinfohandler.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrservices/src/cesmrrecurrenceinfohandler.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -15,18 +15,21 @@ * */ - -// -#include "emailtrace.h" #include "cesmrrecurrenceinfohandler.h" +#include "cesmrcaluserutil.h" #include "esmrdef.h" -// - #include "mesmrmeetingrequestentry.h" +#include "cesmrcaldbmgr.h" #include #include -#include +#include +#include +#include + +#include + +#include "emailtrace.h" /// Unnamed namespace for local definitions namespace { @@ -183,6 +186,94 @@ } } +/** + * Checks if entry's recurrence end time is being adjusted + * @param aEntry Reference to entry + */ +TBool RecurrenceEndtimeAdjustedL( + const CCalEntry& aEntry, + MESMRCalDbMgr& aCalDb ) + { + TBool retValue( EFalse ); + + TCalRRule rRule; + if ( aEntry.GetRRuleL( rRule) ) + { + TCalTime recurrenceId; + recurrenceId.SetTimeUtcL( Time::NullTTime() ); + CCalEntry* entry = aCalDb.FetchEntryL( aEntry.UidL(), recurrenceId ); + CleanupStack::PushL( entry ); + + if ( entry ) + { + TCalRRule entryRRule; + if ( entry->GetRRuleL( entryRRule ) ) + { + TTime until1 = entryRRule.Until().TimeLocalL(); + TTime until2 = rRule.Until().TimeLocalL(); + + if ( until1 != until2 ) + { + retValue = ETrue; + } + } + } + + CleanupStack::PopAndDestroy( entry ); + } + + return retValue; + } + +/** + * Get the beginning of current param time + * @param aStartTime Reference to time + */ +TTime BeginningOfDay( const TTime& aStartTime ) + { + TTime zero(TInt64(0)); + return zero + aStartTime.DaysFrom( zero ); + } + +/** + * Get the Time, hour, minute, sec, micsec of current param time + * @param aStartTime Reference to time + */ +TTimeIntervalMinutes TimeOfDay( const TTime& aDateTime ) + { + TTime midnight = BeginningOfDay( aDateTime ); + TTimeIntervalMinutes result; + aDateTime.MinutesFrom( midnight, result ); + + return result; + } + +template class CleanupResetAndDestroyClose + { + public: + inline static void PushL( T& aRef ); + private: + static void Close( TAny *aPtr ); + }; + +template inline void CleanupResetAndDestroyClosePushL( T& aRef ); + +template inline void CleanupResetAndDestroyClose::PushL( T& aRef ) + { + CleanupStack::PushL( TCleanupItem( &Close, &aRef ) ); + } + +template void CleanupResetAndDestroyClose::Close( TAny *aPtr ) + { + static_cast(aPtr)->ResetAndDestroy(); + static_cast(aPtr)->Close(); + } + +template inline void CleanupResetAndDestroyClosePushL( T& aRef ) + { + CleanupResetAndDestroyClose::PushL( aRef ); + } + } // namespace // ======== MEMBER FUNCTIONS ======== @@ -192,8 +283,10 @@ // --------------------------------------------------------------------------- // inline CESMRRecurrenceInfoHandler::CESMRRecurrenceInfoHandler( - CCalEntry& aEntry ) : - iEntry( aEntry ) + CCalEntry& aEntry, + MESMRCalDbMgr* aCalDb ) : + iEntry( aEntry ), + iCalDb( aCalDb ) { FUNC_LOG; // Not implementation yet @@ -218,7 +311,24 @@ { FUNC_LOG; - CESMRRecurrenceInfoHandler* self = NewLC( aEntry ); + CESMRRecurrenceInfoHandler* self = NewLC( aEntry, NULL ); + CleanupStack::Pop( self ); + + + return self; + } + +// --------------------------------------------------------------------------- +// CESMRRecurrenceInfoHandler::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRRecurrenceInfoHandler* CESMRRecurrenceInfoHandler::NewL( + CCalEntry& aEntry, + MESMRCalDbMgr* aCalDb ) + { + FUNC_LOG; + + CESMRRecurrenceInfoHandler* self = NewLC( aEntry, aCalDb ); CleanupStack::Pop( self ); @@ -235,7 +345,26 @@ FUNC_LOG; CESMRRecurrenceInfoHandler* self = - new (ELeave) CESMRRecurrenceInfoHandler(aEntry); + new (ELeave) CESMRRecurrenceInfoHandler( aEntry, NULL ); + CleanupStack::PushL( self ); + self->ConstructL(); + + + return self; + } + +// --------------------------------------------------------------------------- +// CESMRRecurrenceInfoHandler::NewLC +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRRecurrenceInfoHandler* CESMRRecurrenceInfoHandler::NewLC( + CCalEntry& aEntry, + MESMRCalDbMgr* aCalDb ) + { + FUNC_LOG; + + CESMRRecurrenceInfoHandler* self = + new (ELeave) CESMRRecurrenceInfoHandler( aEntry, aCalDb ); CleanupStack::PushL( self ); self->ConstructL(); @@ -499,7 +628,6 @@ CleanupStack::PopAndDestroy( &rdates ); aRecurrence = recurrenceValue; - } @@ -711,6 +839,657 @@ } +// ----------------------------------------------------------------------------- +// CCalenEditorDataHandler::GetPreviousInstanceTimeL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRRecurrenceInfoHandler::GetPreviousInstanceTimeL( TCalTime& aPreviousStartTime, + TCalTime& aPreviousEndTime, + TTime aInstanceDateTime ) + { + FUNC_LOG; + + aPreviousStartTime.SetTimeLocalL( Time::NullTTime() ); + aPreviousEndTime.SetTimeLocalL( Time::NullTTime() ); + + RPointerArray entries; + CleanupResetAndDestroyClosePushL( entries ); + + iCalDb->EntryViewL( iEntry )->FetchL( iEntry.UidL(), entries ); + + TCalTime currentInstanceDate = iEntry.RecurrenceIdL(); + if( currentInstanceDate.TimeUtcL() == Time::NullTTime() ) + { + // We must be creating a new exception. Calculate the recurrence id. + TTimeIntervalMinutes timeOfDay = TimeOfDay( entries[0]->StartTimeL().TimeLocalL() ); + TTime beginningOfDay = BeginningOfDay( aInstanceDateTime ); + currentInstanceDate.SetTimeLocalL( beginningOfDay + timeOfDay ); + } + + TCalRRule rrule; + if( entries[0]->GetRRuleL(rrule) ) + { + TESMRRecurrenceValue repeatIndex = RepeatIndexL( *entries[0] ); + + TBool keepLooking = ETrue; + RArray exdates; + CleanupClosePushL( exdates ); + entries[0]->GetExceptionDatesL(exdates); + + // Needed for case ERepeatOther + TCalRRule::TType type( rrule.Type() ); + TInt repeatInterval( rrule.Interval() ); + TCalTime start, end; + TTime previousInstanceTime = Time::NullTTime(); + + while( keepLooking ) + { + // Subtract the repeat interval of the parent. + switch( repeatIndex ) + { + case ERecurrenceDaily: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()-TTimeIntervalDays(1) ); + break; + } + + case ERecurrenceWeekly: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()-TTimeIntervalDays(7) ); + break; + } + + case ERecurrenceEverySecondWeek: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()-TTimeIntervalDays(14) ); + break; + } + + case ERecurrenceMonthly: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()-TTimeIntervalMonths(1) ); + break; + } + + case ERecurrenceYearly: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()-TTimeIntervalYears(1) ); + break; + } + + case ERecurrenceUnknown: + { + // Check if the current entry being edited is child entry + // If yes, then put back the child entry time to currentInstanceDate + if( iEntry.RecurrenceIdL().TimeUtcL() != Time::NullTTime() ) + { + TTimeIntervalMinutes timeOfDay = TimeOfDay( iEntry.StartTimeL().TimeLocalL() ); + TTime beginningOfDay = BeginningOfDay( aInstanceDateTime ); + currentInstanceDate.SetTimeLocalL( beginningOfDay + timeOfDay ); + } + + switch( type ) + { + case TCalRRule::EDaily: + { + start.SetTimeLocalL( currentInstanceDate.TimeLocalL() - + TTimeIntervalDays( 1 * repeatInterval ) ); + break; + } + + case TCalRRule::EWeekly: + { + start.SetTimeLocalL( currentInstanceDate.TimeLocalL() - + TTimeIntervalDays(7 * repeatInterval) ); + break; + } + + case TCalRRule::EMonthly: + { + // Add 7 days of buffer to cover the cases were gap b/w two instances of the event + // can go beuong 30 days. Ex: Every third wednesday of every month + start.SetTimeLocalL( currentInstanceDate.TimeLocalL() - + TTimeIntervalMonths(repeatInterval)-TTimeIntervalDays(7 * repeatInterval) ); + break; + } + + case TCalRRule::EYearly: + { + // Add 7 days of buffer to cover the cases were gap b/w two instances of the event + // can go beuong 365 days. Ex: Every third wednesday of September of every year + start.SetTimeLocalL( currentInstanceDate.TimeLocalL() - + TTimeIntervalYears(repeatInterval)-TTimeIntervalDays(7 * repeatInterval) ); + break; + } + } + + end.SetTimeLocalL( BeginningOfDay( currentInstanceDate.TimeLocalL() ) ); + previousInstanceTime = GetPreviousInstanceForRepeatOtherL( *entries[0], + CalCommon::TCalTimeRange(start, end) ); + currentInstanceDate.SetTimeLocalL( previousInstanceTime ); + break; + } + + case ERecurrenceNot: + default: + { + keepLooking = EFalse; + break; + } + } + + // Is currentInstanceDate before parent dt start? + if( currentInstanceDate.TimeLocalL() < entries[0]->StartTimeL().TimeLocalL() ) + { + // There are no instances before the exception + keepLooking = EFalse; + } + else + { + // Is there an exdate on currentInstanceDate? + TBool isExdateOnDay = EFalse; + for(TInt i=0; iRecurrenceIdL().TimeLocalL() == currentInstanceDate.TimeLocalL() ) + { + // This child is the previous instance. + aPreviousStartTime = entries[j]->StartTimeL(); + aPreviousEndTime = entries[j]->EndTimeL(); + keepLooking = EFalse; + } + } + break; + } + } + + if( !isExdateOnDay ) + { + // The instance exists and hasn't been deleted or made into an exception. + // Use information from the parent to set the start/end times. + aPreviousStartTime = currentInstanceDate; + + TTimeIntervalMinutes duration; + TTime start = entries[0]->StartTimeL().TimeLocalL(); + TTime end = entries[0]->EndTimeL().TimeLocalL(); + end.MinutesFrom( start, duration ); + aPreviousEndTime.SetTimeLocalL( currentInstanceDate.TimeLocalL() + duration ); + keepLooking = EFalse; + } + } + } + CleanupStack::PopAndDestroy( &exdates ); + } + + CleanupStack::PopAndDestroy(&entries); + } + +// ----------------------------------------------------------------------------- +// CESMRRecurrenceInfoHandler::GetNextInstanceTimeL +// +// ----------------------------------------------------------------------------- +// +EXPORT_C void CESMRRecurrenceInfoHandler::GetNextInstanceTimeL( TCalTime& aNextStartTime, + TCalTime& aNextEndTime, + TTime aInstanceDateTime ) + { + FUNC_LOG; + aNextStartTime.SetTimeLocalL( Time::NullTTime() ); + aNextEndTime.SetTimeLocalL( Time::NullTTime() ); + + RPointerArray entries; + CleanupResetAndDestroyClosePushL(entries); + + iCalDb->EntryViewL(iEntry)->FetchL( iEntry.UidL(), entries ); + TCalTime currentInstanceDate = iEntry.RecurrenceIdL(); + + if( currentInstanceDate.TimeUtcL() == Time::NullTTime() ) + { + // We must be creating a new exception. Calculate the recurrence id. + TTimeIntervalMinutes timeOfDay = TimeOfDay( entries[0]->StartTimeL().TimeLocalL() ); + TTime beginningOfDay = BeginningOfDay( aInstanceDateTime ); + currentInstanceDate.SetTimeLocalL( beginningOfDay + timeOfDay ); + } + + TCalRRule rrule; + if( entries[0]->GetRRuleL(rrule) ) + { + TESMRRecurrenceValue repeatIndex = RepeatIndexL( *entries[0] ); + + TBool keepLooking = ETrue; + RArray exdates; + CleanupClosePushL( exdates ); + entries[0]->GetExceptionDatesL( exdates ); + + // Needed for case ERepeatOther + TCalRRule::TType type( rrule.Type() ); + TInt repeatInterval( rrule.Interval() ); + TCalTime start, end; + TTime nextInstanceTime = Time::NullTTime(); + + while( keepLooking ) + { + // Subtract the repeat interval of the parent. + switch( repeatIndex ) + { + case ERecurrenceDaily: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()+TTimeIntervalDays(1) ); + break; + } + + case ERecurrenceWeekly: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()+TTimeIntervalDays(7) ); + break; + } + + case ERecurrenceEverySecondWeek: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()+TTimeIntervalDays(14) ); + break; + } + + case ERecurrenceMonthly: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()+TTimeIntervalMonths(1) ); + break; + } + + case ERecurrenceYearly: + { + currentInstanceDate.SetTimeLocalL( currentInstanceDate.TimeLocalL()+TTimeIntervalYears(1) ); + break; + } + + case ERecurrenceUnknown: + { + // Check if the current entry being edited is child entry + // If yes, then put back the child entry time to currentInstanceDate + if(iEntry.RecurrenceIdL().TimeUtcL() != Time::NullTTime()) + { + TTimeIntervalMinutes timeOfDay = TimeOfDay( iEntry.StartTimeL().TimeLocalL() ); + TTime beginningOfDay = BeginningOfDay( aInstanceDateTime ); + currentInstanceDate.SetTimeLocalL( beginningOfDay + timeOfDay ); + } + + switch( type ) + { + case TCalRRule::EDaily: + { + end.SetTimeLocalL( currentInstanceDate.TimeLocalL() + + TTimeIntervalDays(1*repeatInterval) ); + break; + } + + case TCalRRule::EWeekly: + { + end.SetTimeLocalL( currentInstanceDate.TimeLocalL() + + TTimeIntervalDays(7 *repeatInterval) ); + break; + } + + case TCalRRule::EMonthly: + { + // Add 7 days of buffer to cover the cases were gap b/w two instances of the event + // can go beuong 30 days. Ex: Every third wednesday of every month + end.SetTimeLocalL( currentInstanceDate.TimeLocalL() + + TTimeIntervalMonths(repeatInterval) + TTimeIntervalDays(7 * repeatInterval) ); + break; + } + + case TCalRRule::EYearly: + { + // Add 7 days of buffer to cover the cases were gap b/w two instances of the event + // can go beuong 365 days. Ex: Every third wednesday of September of every year + end.SetTimeLocalL( currentInstanceDate.TimeLocalL() + + TTimeIntervalYears(repeatInterval) + TTimeIntervalDays(7 * repeatInterval) ); + break; + } + } + + start.SetTimeLocalL(BeginningOfDay(currentInstanceDate.TimeLocalL()+TTimeIntervalDays(1))); + nextInstanceTime = GetNextInstanceForRepeatOtherL(*entries[0], CalCommon::TCalTimeRange( start, end)); + currentInstanceDate.SetTimeLocalL( nextInstanceTime); + break; + } + case ERecurrenceNot: + { + keepLooking = EFalse; + break; + } + + default: + { + break; + } + } + + // Is currentInstanceDate after parent dt end? + if( currentInstanceDate.TimeLocalL() > rrule.Until().TimeLocalL() ) + { + // There are no instances before the exception + keepLooking = EFalse; + } + else + { + // Is there an exdate on currentInstanceDate? + TBool isExdateOnDay = EFalse; + for(TInt i=0; iRecurrenceIdL().TimeLocalL() == currentInstanceDate.TimeLocalL() ) + { + // This child is the previous instance. + aNextStartTime = entries[j]->StartTimeL(); + aNextEndTime = entries[j]->EndTimeL(); + keepLooking = EFalse; + } + } + break; + } + } + + if( !isExdateOnDay ) + { + // The instance exists and hasn't been deleted or made into an exception. + // Use information from the parent to set the start/end times. + aNextStartTime = currentInstanceDate; + + TTimeIntervalMinutes duration; + TTime start = entries[0]->StartTimeL().TimeLocalL(); + TTime end = entries[0]->EndTimeL().TimeLocalL(); + end.MinutesFrom( start, duration ); + aNextEndTime.SetTimeLocalL( currentInstanceDate.TimeLocalL() + duration ); + keepLooking = EFalse; + } + } + } + CleanupStack::PopAndDestroy( &exdates ); + } + + CleanupStack::PopAndDestroy(&entries); + } + + +// ----------------------------------------------------------------------------- +// CESMRRecurrenceInfoHandler::GetPreviousInstanceForRepeatOtherL() +// +// ----------------------------------------------------------------------------- +// +TTime CESMRRecurrenceInfoHandler::GetPreviousInstanceForRepeatOtherL( + CCalEntry& aEntry, const CalCommon::TCalTimeRange& timeRange) + { + RPointerArray allInstances; + CleanupResetAndDestroyClosePushL( allInstances ); + + TInt filter; + // Get the entry type to be filtered + switch(aEntry.EntryTypeL()) + { + case CCalEntry::EAppt: + { + filter = CalCommon::EIncludeAppts; + break; + } + + case CCalEntry::ETodo: + { + filter = CalCommon::EIncludeCompletedTodos | CalCommon::EIncludeIncompletedTodos; + break; + } + + case CCalEntry::EEvent: + { + filter = CalCommon::EIncludeEvents; + break; + } + + case CCalEntry::EReminder: + { + filter = CalCommon::EIncludeReminder; + break; + } + + case CCalEntry::EAnniv: + { + filter = CalCommon::EIncludeAnnivs; + break; + } + + default: + { + filter = CalCommon::EIncludeAll; + break; + } + + }; + + iCalDb->InstanceViewL(iEntry)->FindInstanceL( allInstances, + (CalCommon::TCalViewFilterFlags)filter, + timeRange); + + TTime previousTime = Time::NullTTime(); + + for( TInt i = allInstances.Count() - 1; i >= 0; i-- ) + { + if( allInstances[i]->Entry().UidL() == aEntry.UidL() ) + { + previousTime = allInstances[i]->Time().TimeLocalL(); + break; + } + } + + CleanupStack::PopAndDestroy( &allInstances ); + return previousTime; + } + +// ----------------------------------------------------------------------------- +// CESMRRecurrenceInfoHandler::GetNextInstanceForRepeatOtherL() +// +// ----------------------------------------------------------------------------- +// +TTime CESMRRecurrenceInfoHandler::GetNextInstanceForRepeatOtherL( + CCalEntry& aEntry, const CalCommon::TCalTimeRange& timeRange ) + { + RPointerArray allInstances; + CleanupResetAndDestroyClosePushL( allInstances ); + + TInt filter; + // Get the entry type to be filtered + switch( aEntry.EntryTypeL() ) + { + case CCalEntry::EAppt: + { + filter = CalCommon::EIncludeAppts; + break; + } + case CCalEntry::ETodo: + { + filter = CalCommon::EIncludeCompletedTodos | CalCommon::EIncludeIncompletedTodos; + break; + } + case CCalEntry::EEvent: + { + filter = CalCommon::EIncludeEvents; + break; + } + case CCalEntry::EReminder: + { + filter = CalCommon::EIncludeReminder; + break; + } + case CCalEntry::EAnniv: + { + filter = CalCommon::EIncludeAnnivs; + break; + } + default: + { + filter = CalCommon::EIncludeAll; + break; + } + }; + + iCalDb->InstanceViewL(iEntry)->FindInstanceL( allInstances, + ( CalCommon::TCalViewFilterFlags )filter, + timeRange); + + TTime nextTime = Time::NullTTime(); + + TInt i( 0 ); + for( ; i < allInstances.Count(); i++ ) + { + if( allInstances[i]->Entry().UidL() == aEntry.UidL() ) + { + nextTime = allInstances[i]->Time().TimeLocalL(); + break; + } + } + + CleanupStack::PopAndDestroy( &allInstances ); + return nextTime; + } + +// --------------------------------------------------------------------------- +// CESMRRecurrenceInfoHandler::RepeatIndexL +// +// --------------------------------------------------------------------------- +// +TESMRRecurrenceValue CESMRRecurrenceInfoHandler::RepeatIndexL( const CCalEntry& aEntry ) + { + FUNC_LOG; + + TESMRRecurrenceValue repeatIndex( ERecurrenceNot ); + + TCalRRule rrule; + + if( aEntry.GetRRuleL( rrule) ) + { + TCalRRule::TType type( rrule.Type() ); + TInt repeatInterval( rrule.Interval() ); + + // If repeat type of current note is not supported in Calendar, + // default repeat value is "Other". + repeatIndex = ERecurrenceUnknown; + + switch( type ) + { + case TCalRRule::EDaily: + { + switch (repeatInterval) + { + case 1: + { + repeatIndex = ERecurrenceDaily; + break; + } + case 7: + { + repeatIndex = ERecurrenceWeekly; + break; + } + case 14: + { + repeatIndex = ERecurrenceEverySecondWeek; + break; + } + default: + { + break; + } + } + break; + } + + case TCalRRule::EWeekly: + { + switch( repeatInterval ) + { + case 1: + { + repeatIndex = ERecurrenceWeekly; + break; + } + case 2: + { + repeatIndex = ERecurrenceEverySecondWeek; + break; + } + default: + { + break; + } + } + break; + } + + case TCalRRule::EMonthly: + { + RArray monthDays(31); + rrule.GetByMonthDayL ( monthDays ); + + if( monthDays.Count() == 1) + { + switch( repeatInterval ) + { + case 1: + { + repeatIndex = ERecurrenceMonthly; + break; + } + // If interval of repeat is 12 months, + // every year is shown in Note Editor, + // because it means yearly repeat. + case 12: + { + repeatIndex = ERecurrenceYearly; + break; + } + default: + { + break; + } + } + } + + monthDays.Close(); + break; + } + + case TCalRRule::EYearly: + { + if( repeatInterval == 1 ) + { + repeatIndex = ERecurrenceYearly; + } + break; + } + + default: + { + // If repeat type of current note is not supported in Calendar, + // default repeat value is "Other". + repeatIndex = ERecurrenceUnknown; + break; + } + } + } + + return repeatIndex; + } + // --------------------------------------------------------------------------- // CESMRRecurrenceInfoHandler::CalculateRecurrenceUntilDateL // @@ -723,10 +1502,11 @@ const CCalEntry& aEntry ) const { FUNC_LOG; + TCalRRule::TType rType = aRule.Type(); TInt count = aRule.Count(); TCalTime until = aRule.Until(); - + if ( count == KZero && until.TimeUtcL() == Time::NullTTime() ) { @@ -746,6 +1526,18 @@ { --count; aUntil += TTimeIntervalDays(count); + + CESMRCalUserUtil* entryUtil = + CESMRCalUserUtil::NewLC( const_cast(aEntry) ); + + if ( iCalDb && entryUtil->IsAlldayEventL() && + RecurrenceEndtimeAdjustedL( aEntry, *iCalDb ) ) + { + // If until is adjusted for allday entries + // we wound return until day one day too long + aUntil -= TTimeIntervalDays( KOne ); + } + CleanupStack::PopAndDestroy( entryUtil ); break; } case ERecurrenceWeekly: diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/BWINS/ESMRTasksU.def --- a/meetingrequest/mrtasks/BWINS/ESMRTasksU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/BWINS/ESMRTasksU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,9 @@ EXPORTS - ??1CESMRTaskExtenstionImpl@@UAE@XZ @ 1 NONAME ; CESMRTaskExtenstionImpl::~CESMRTaskExtenstionImpl(void) - ?NewL@CESMRTaskExtenstionImpl@@SAPAV1@AAVMESMRCalDbMgr@@AAVCMRMailboxUtils@@AAVCESMRPolicyManager@@AAVCESMREntryProcessor@@AAVMESMRTaskFactory@@@Z @ 2 NONAME ; class CESMRTaskExtenstionImpl * CESMRTaskExtenstionImpl::NewL(class MESMRCalDbMgr &, class CMRMailboxUtils &, class CESMRPolicyManager &, class CESMREntryProcessor &, class MESMRTaskFactory &) - ?NewL@CESMRTaskFactory@@SAPAV1@AAVMESMRCalDbMgr@@AAVCMRMailboxUtils@@@Z @ 3 NONAME ; class CESMRTaskFactory * CESMRTaskFactory::NewL(class MESMRCalDbMgr &, class CMRMailboxUtils &) + ?NewL@CESMRTaskExtenstionImpl@@SAPAV1@AAVMESMRTaskFactory@@@Z @ 1 NONAME ; class CESMRTaskExtenstionImpl * CESMRTaskExtenstionImpl::NewL(class MESMRTaskFactory &) + ??1CESMRTaskExtenstionImpl@@UAE@XZ @ 2 NONAME ; CESMRTaskExtenstionImpl::~CESMRTaskExtenstionImpl(void) + ?RemoveTaskL@CESMRCombinedTask@@QAEPAVMESMRTask@@PAV2@@Z @ 3 NONAME ; class MESMRTask * CESMRCombinedTask::RemoveTaskL(class MESMRTask *) + ?NewL@CESMRCombinedTask@@SAPAV1@AAVMESMRCalEntry@@W4TESMRExecutionRule@1@@Z @ 4 NONAME ; class CESMRCombinedTask * CESMRCombinedTask::NewL(class MESMRCalEntry &, enum CESMRCombinedTask::TESMRExecutionRule) + ?AppendTaskL@CESMRCombinedTask@@QAEXPAVMESMRTask@@@Z @ 5 NONAME ; void CESMRCombinedTask::AppendTaskL(class MESMRTask *) + ??1CESMRCombinedTask@@UAE@XZ @ 6 NONAME ; CESMRCombinedTask::~CESMRCombinedTask(void) + ?AppendTaskL@@YAXAAVCESMRCombinedTask@@PAVMESMRTask@@@Z @ 7 NONAME ; void AppendTaskL(class CESMRCombinedTask &, class MESMRTask *) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/EABI/ESMRTasksU.def --- a/meetingrequest/mrtasks/EABI/ESMRTasksU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/EABI/ESMRTasksU.def Wed Mar 31 21:08:33 2010 +0300 @@ -1,11 +1,17 @@ EXPORTS - _ZN16CESMRTaskFactory4NewLER13MESMRCalDbMgrR15CMRMailboxUtils @ 1 NONAME - _ZN23CESMRTaskExtenstionImpl4NewLER13MESMRCalDbMgrR15CMRMailboxUtilsR18CESMRPolicyManagerR19CESMREntryProcessorR16MESMRTaskFactory @ 2 NONAME - _ZN23CESMRTaskExtenstionImplD0Ev @ 3 NONAME - _ZN23CESMRTaskExtenstionImplD1Ev @ 4 NONAME - _ZN23CESMRTaskExtenstionImplD2Ev @ 5 NONAME - _ZTI13CESMRTaskBase @ 6 NONAME ; ## - _ZTV13CESMRTaskBase @ 7 NONAME ; ## - _ZThn4_N23CESMRTaskExtenstionImplD0Ev @ 8 NONAME ; ## - _ZThn4_N23CESMRTaskExtenstionImplD1Ev @ 9 NONAME ; ## + _Z11AppendTaskLR17CESMRCombinedTaskP9MESMRTask @ 1 NONAME + _ZN17CESMRCombinedTask11AppendTaskLEP9MESMRTask @ 2 NONAME + _ZN17CESMRCombinedTask11RemoveTaskLEP9MESMRTask @ 3 NONAME + _ZN17CESMRCombinedTask4NewLER13MESMRCalEntryNS_18TESMRExecutionRuleE @ 4 NONAME + _ZN17CESMRCombinedTaskD0Ev @ 5 NONAME + _ZN17CESMRCombinedTaskD1Ev @ 6 NONAME + _ZN17CESMRCombinedTaskD2Ev @ 7 NONAME + _ZN23CESMRTaskExtenstionImpl4NewLER16MESMRTaskFactory @ 8 NONAME + _ZN23CESMRTaskExtenstionImplD0Ev @ 9 NONAME + _ZN23CESMRTaskExtenstionImplD1Ev @ 10 NONAME + _ZN23CESMRTaskExtenstionImplD2Ev @ 11 NONAME + _ZThn4_N17CESMRCombinedTaskD0Ev @ 12 NONAME + _ZThn4_N17CESMRCombinedTaskD1Ev @ 13 NONAME + _ZThn4_N23CESMRTaskExtenstionImplD0Ev @ 14 NONAME + _ZThn4_N23CESMRTaskExtenstionImplD1Ev @ 15 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/data/esmrtasks.rss --- a/meetingrequest/mrtasks/data/esmrtasks.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for project esmrtasks -* -*/ - - -NAME ESTA - -#include -// -#include -// - -RESOURCE RSS_SIGNATURE { } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_subject -// Plain text subject description line heading -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_subject - { - buf = qtn_meet_req_plain_text_subject; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_location -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_location - { - buf = qtn_meet_req_plain_text_location; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_start_time -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_start_time - { - buf = qtn_meet_req_plain_text_start_time; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_end_time -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_end_time - { - buf = qtn_meet_req_plain_text_end_time; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_description -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_description - { - buf = qtn_meet_req_plain_text_description; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_update -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_update - { - buf = qtn_meet_req_plain_text_update; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_cancelled -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_cancelled - { - buf = qtn_meet_req_plain_text_cancelled; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_forwarded -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_forwarded - { - buf = qtn_meet_req_plain_text_forwarded; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_accepted -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_accepted - { - buf = qtn_meet_req_plain_text_accepted; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_tentative -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_tentative - { - buf = qtn_meet_req_plain_text_tentative; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_plain_text_declined -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_plain_text_declined - { - buf = qtn_meet_req_plain_text_declined; - } - -// --------------------------------------------------------------------------- -// r_qtn_meet_req_viewer_subject_prefix_repl -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_qtn_meet_req_viewer_subject_prefix_repl - { - buf = qtn_meet_req_viewer_subject_prefix_repl; - } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/group/bld.inf --- a/meetingrequest/mrtasks/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -24,6 +24,7 @@ PRJ_EXPORTS ../inc/mesmrtaskfactory.h |../../inc/mesmrtaskfactory.h ../inc/cesmrtaskfactory.h |../../inc/cesmrtaskfactory.h +../inc/cesmrtaskfactory.inl |../../inc/cesmrtaskfactory.inl ../inc/mesmrtask.h |../../inc/mesmrtask.h ../inc/mesmrtaskextension.h |../../inc/mesmrtaskextension.h ../inc/mesmrtaskextension.inl |../../inc/mesmrtaskextension.inl @@ -32,4 +33,7 @@ PRJ_MMPFILES esmrtasks.mmp +#include "../mrtaskplugin/group/bld.inf" +#include "../mrcaleventtaskplugin/group/bld.inf" + // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/group/esmrtasks.mmp --- a/meetingrequest/mrtasks/group/esmrtasks.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/group/esmrtasks.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,14 +16,11 @@ */ +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" #include #include -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" -#include "../../inc/esmrconfig.hrh" - TARGET esmrtasks.dll TARGETTYPE dll UID KEPOCStaticDllUID2 KESMRDllUid3 @@ -32,55 +29,21 @@ VENDORID VID_DEFAULT DEFFILE ESMRTasks.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrtaskextensionimpl.cpp -SOURCE cesmrtaskfactory.cpp -SOURCE cesmrtaskbase.cpp -SOURCE cesmrstoremrtask.cpp -SOURCE cesmrdeletefromdbmrtask.cpp SOURCE cesmrcombinedtask.cpp -SOURCE cesmrmailplaitextformatter.cpp -SOURCE cesmrsendmrfsmailreplytask.cpp -SOURCE cesmrforwardasfsmailtask.cpp -SOURCE cesmrfsemailmanager.cpp -SOURCE cesmrsendmrfsmailtask.cpp -SOURCE cesmrsendmrrespfsmailtask.cpp - -START RESOURCE ../data/esmrtasks.rss -HEADER -TARGET esmrtasks -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END USERINCLUDE ../inc USERINCLUDE ../../inc +USERINCLUDE ../../../inc APP_LAYER_SYSTEMINCLUDE -USERINCLUDE ../../../inc +LIBRARY euser.lib +LIBRARY ecom.lib -LIBRARY esmrcommon.lib -LIBRARY esmrservices.lib -LIBRARY esmrgui.lib -LIBRARY euser.lib -LIBRARY calinterimapi.lib -LIBRARY sendui.lib -LIBRARY etext.lib -LIBRARY cone.lib -LIBRARY efsrv.lib -LIBRARY commonengine.lib -LIBRARY charconv.lib -LIBRARY bafl.lib -LIBRARY fsmailframework.lib -LIBRARY fsfwcommonlib.lib -LIBRARY cmaillogger.lib - -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE //End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrcombinedtask.h --- a/meetingrequest/mrtasks/inc/cesmrcombinedtask.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/inc/cesmrcombinedtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -19,7 +19,10 @@ #ifndef C_ESMRCOMBINEDTASK_H #define C_ESMRCOMBINEDTASK_H -#include "cesmrtaskbase.h" +#include "mesmrtask.h" +#include + +class MESMRCalEntry; /** * CESMRCombinedTask is responsibe for executing multiple tasks. @@ -44,7 +47,8 @@ * * @lib esmrtasks.lib */ -NONSHARABLE_CLASS( CESMRCombinedTask ) : public CESMRTaskBase +NONSHARABLE_CLASS( CESMRCombinedTask ) : public CBase, + public MESMRTask { public: @@ -70,23 +74,21 @@ * @param aMRMailboxUtils Reference mr mailbox utilities. * @param aRule Exection rule */ - static CESMRCombinedTask* NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, + IMPORT_C static CESMRCombinedTask* NewL( + MESMRCalEntry& aEntry, TESMRExecutionRule aRule = CESMRCombinedTask::EESMRLeave ); /** * C++ destructor. */ - ~CESMRCombinedTask(); + IMPORT_C ~CESMRCombinedTask(); /** * Appends task to be executed. Ownership of appended task * is transferred. * @param aTask Pointer to task to be executed. */ - void AppendTaskL( MESMRTask* aTask ); + IMPORT_C void AppendTaskL( MESMRTask* aTask ); /** * Removes the task from task list. Method returns the pointer to @@ -95,16 +97,14 @@ * @param aTask Pointer to task to be removed. * @return Pointer to removed task. */ - MESMRTask* RemoveTaskL( MESMRTask* aTask ); + IMPORT_C MESMRTask* RemoveTaskL( MESMRTask* aTask ); public:// From MESMRTask void ExecuteTaskL(); private: // Implementation CESMRCombinedTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, + MESMRCalEntry& aEntry, TESMRExecutionRule aRule ); void ConstructL(); @@ -117,9 +117,24 @@ RPointerArray iTasks; /** + * Reference to entry. + */ + MESMRCalEntry& iEntry; + + /** * Task execution rule */ TESMRExecutionRule iExecutionRule; }; +/** + * Helper function to append task into a combined task. + * Takes ownership of aTask at calling time and delegates it to the combined task. + * aTask must not be into CleanupStack at calling time. + * + * @param aContainer combined task + * @param aTask a task to append into container + */ +IMPORT_C void AppendTaskL( CESMRCombinedTask& aContainer, MESMRTask* aTask ); + #endif // C_ESMRCOMBINEDTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrdeletefromdbmrtask.h --- a/meetingrequest/mrtasks/inc/cesmrdeletefromdbmrtask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface definition for ESMR send mr response via mail task -* -*/ - - -#ifndef C_ESMRDELETEMRDROMDBTASK_H -#define C_ESMRDELETEMRDROMDBTASK_H - -#include "cesmrtaskbase.h" - -/** - * CESMRDeleteMRFromDbTask is responsibe for deleting MR from calendar DB. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRDeleteMRFromDbTask ) : public CESMRTaskBase - { -public: - /** - * Creates and initializes new CESMRDeleteMRFromDbTask object. - * Ownership is transferred to caller. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - */ - static CESMRDeleteMRFromDbTask* NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ); - - /** - * C++ destructor. - */ - ~CESMRDeleteMRFromDbTask(); - -public: // From MESMRTask - void ExecuteTaskL(); - -private: - CESMRDeleteMRFromDbTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ); - - void ConstructL(); - - void DeleteEntryFromDbL(); - }; - -#endif // C_ESMRDELETEMRDROMDBTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrforwardasfsmailtask.h --- a/meetingrequest/mrtasks/inc/cesmrforwardasfsmailtask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class definition for forwarding meeting request via FS EMail -* -*/ - - -#ifndef C_ESMRFORWARDMRFSEMAILTASK_H -#define C_ESMRFORWARDMRFSEMAILTASK_H - -// INCLUDES: -#include "cesmrtaskbase.h" - -// FORWARD DECLARATIONS: -class MESMRCalDbMgr; -class MESMRMeetingRequestEntry; -class CMRMailboxUtils; -class CESMRFSEMailManager; -class CESMRCalUserUtil; -class CCalEntry; - -/** - * Class definition for forwarding meeting request as attachment - * of email message via FS EMail. Class creates temporary file into - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRForwardAsFSMailTask ) : public CESMRTaskBase - { - -public: // Construction and destruction - /** - * Creates and initializes new CESMRCancelMRFSEmailTask object. - * Ownership is transferred to caller. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - */ - static CESMRForwardAsFSMailTask* NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ); - - /** - * C++ constructor. - */ - CESMRForwardAsFSMailTask(MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils); - - /** - * C++ Destructor. - */ - ~CESMRForwardAsFSMailTask(); - -public:// From MESMRTask - - void ExecuteTaskL(); - -private: - void ConstructL(); - void ConstructMailL(); - void CreateTemporaryMeetingFileL(); - TInt LaunchFSEmailEditorL(); - -private: // Data - /// Own: FS Email manager - CESMRFSEMailManager* iEmailMgr; - /// Own: Pointer to calendar entry to be sent - CCalEntry* iEntryToSend; - /// Own: Caluser utility object - CESMRCalUserUtil* iCaluserUtil; - }; - -#endif // C_ESMRFORWARDMRFSEMAILTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrfsemailmanager.h --- a/meetingrequest/mrtasks/inc/cesmrfsemailmanager.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class encapsulating FS email sending -* -*/ - - -#ifndef C_ESMRFSEMAILMANAGER_H -#define C_ESMRFSEMAILMANAGER_H - -#include -// -#include "cfsmailcommon.h" -#include "mmrinfoprocessor.h" -#include "esmrdef.h" -// - -class CFSMailBox; -class CFSMailMessage; -class CFSMailMessagePart; -class CFSMailClient; -class CMRMailboxUtils; -class TESMRInputParams; - -/** - * Class definition for FS Email manager class. This class encapsulates - * all mail sending acitivities with FS EMail framework. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRFSEMailManager ) : public CBase - { -public: - /** Enumeration for text/calendar part */ - enum TESMRMethod - { - EESMRMethodRequest, // Request - EESMRMethodResponse, // response - EESMRMethodCancel // cancellation - }; - -public: // Construction and destruction - /** - * Creates and initializes new CESMRSendMRRespFSEmailTask object. - * Ownership is transferred to caller. - * @param aMRMailboxUtils Reference to mailbox utilities - */ - static CESMRFSEMailManager* NewL( - CMRMailboxUtils& aMRMailboxUtils ); - - /** - * C++ destructor. - */ - ~CESMRFSEMailManager(); - - /** - * Prepares email manager to be used for sending meeting - * request. - * - * @param aMailboxOwnerAddr mailbox owner's email address - */ - void PrepareForSendingL( - const TDesC& aMailboxOwnerAddr ); - - /** - * Prepares email manager to be used for sending reply - * message. - * - * @param aMailboxOwnerAddr mailbox owner's email address - * @param aMsgId original message's id - * @param aReplyAll is this reply for all participants - */ - void PrepareForSendingReplyL( - const TDesC& aMailboxOwnerAddr, - const TFSMailMsgId& aMsgId, - TBool aReplyAll ); - - /** - * Sets sender to email message - * @param aAddress Sender's email address - * @param aCommonName Sender's common name - */ - void SetSenderL( - const TDesC& aAddress, - const TDesC& aCommonName ); - - /** - * Sets reply to address to email message - * @param aAddress Email address - * @param aCommonName Common name - */ - void SetReplyToAddressL( - const TDesC& aAddress, - const TDesC& aCommonName ); - - /** - * Sets recipient to field - * @param aAddress Recipient's email address - * @param aCommonName Recipient's common name - */ - void AppendToRecipientL( - const TDesC& aAddress, - const TDesC& aCommonName ); - - /** - * Sets recipient to field - * @param aAddress Recipient's email address - * @param aCommonName Recipient's common name - */ - void AppendCCRecipientL( - const TDesC& aAddress, - const TDesC& aCommonName ); - - /** - * Sets subject to email message - * @param aSubject Email message's subject. - */ - void SetSubjectL( - const TDesC& aSubject); - - /** - * Sets plain text part to email message. - * @param aPlainText Plain text context - */ - void CreateTextPlainPartL( - const TDesC& aPlainText); - - /** - * Sets calendar part to email message. - * @param aCalendarMethod Calendar entry method. - */ - void CreateTextCalendarPartL( - TESMRMethod aCalendarMethod ); - - /** - * Sets calendar part to email message. - * @param aCalendarMethod Calendar entry method. - * @param aFilename File containing calendar part - */ - void CreateTextCalendarPartL( - TESMRMethod aCalendarMethod, - const TDesC& aFilename ); - - /** - * Adds attachment to email message. - * @param aAttachmentFile attachment filename. - */ - void SetAttachmentL( - const TDesC& aAttachmentFile ); - - /** - * Stores message to drafts folder. - */ - TInt StoreMessageToDraftsFolderL(); - - /** - * Sends message. - */ - TInt SendMessageL(); - - /** - * Fetches mailbox id. - * @return Mailbox id - */ - TFSMailMsgId MailboxId() const; - - /** - * Send MRINFO object via mail framework - * @param aParam Reference to ESMR input parameters - * @param aInfoObject Reference to MRINFO object - * @param aResponseMode Response mode definition. - * @param aFreeResponseText Free response text - */ - void SendMailViaSyncL( - TESMRInputParams& aParams, - MMRInfoObject& aInfoObject, - MMRInfoProcessor::TMRInfoResponseMode aResponseMode, - const TDesC& aFreeResponseText ); - - /** - * Fetches message id. - * @return Message id - */ - TFSMailMsgId MessageId() const; - - /** - * Fetches message folder id. - * @return Message folder id - */ - TFSMailMsgId MessageFolderId() const; - -private: - CESMRFSEMailManager( - CMRMailboxUtils& aMRMailboxUtils ); - - void ConstructL(); - - CFSMailBox* SelectMailBoxL( - const TDesC& aMailboxOwnerAddr ); - - CFSMailMessage* CreateMessageL(); - - CFSMailMessagePart* CreateParentPartL(); - - void AddPlainTextPartL( - const TDesC& aContent ); - - void AddMessagePartFromFileL( - const TDesC& aContentType, - const TDesC& aContentClass, - const TDesC& aContentDescription, - const TDesC& aContentDisposition, - const TDesC& aFileAndPath ); - -private: // Data - /** - * Reference to mailbox utilites - * Not own. - */ - CMRMailboxUtils& iMRMailboxUtils; - - /** - * FS EMail client - * Own. - */ - CFSMailClient* iMailClient; - - /** - * FS EMailBox - * Own. - */ - CFSMailBox* iMailBox; - - /** - * FS Mail message - * Own. - */ - CFSMailMessage* iMessage; - - /** - * Parent message part - * Not own. - */ - CFSMailMessagePart* iParentPart; - }; - -#endif // C_ESMRFSEMAILMANAGER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrmailplaitextformatter.h --- a/meetingrequest/mrtasks/inc/cesmrmailplaitextformatter.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Plain text formatter for ES MR entries -* -*/ - - -#ifndef C_ESMRMAILPLAINTEXTFORMATTER_H -#define C_ESMRMAILPLAINTEXTFORMATTER_H - -#include - -class CCalEntry; -class CMRMailboxUtils; - -/** - * CESMRMailPlainTextFormatter is responsible for constructing - * plain text part for meeting request email messages. - * - * CESMRMailPlainTextFormatter is ised internally by esmrtasks - * module. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS(CESMRMailPlainTextFormatter) : public CBase - { -public: // Construction and destruction - - /** - * Creates and initialzes new CESMRMailPlainTextFormatter object. - * Ownership is transferred to caller. - * @param aMailboxUtils Reference to MR mailbox utilities. - * @return Pointer to CESMRMailPlainTextFormatter object. - */ - static CESMRMailPlainTextFormatter* NewL( - CMRMailboxUtils& aMailboxUtils ); - - /** - * Creates and initialzes new CESMRMailPlainTextFormatter object. - * Ownership is transferred to caller. Created object is left to - * cleanup stack. - * @param aMailboxUtils Reference to MR mailbox utilities. - * @return Pointer to CESMRMailPlainTextFormatter object. - */ - static CESMRMailPlainTextFormatter* NewLC( - CMRMailboxUtils& aMailboxUtils ); - - /** - * C++ destructor - */ - ~CESMRMailPlainTextFormatter(); - - /** - * Formats plain text part body from ES calendar entry. Ownership of the - * created descriptor is transferred to caller. Created object is also - * left to cleanup stack. - * @param aEntry Reference to calendar entry. - * @return Plain text buffer. - */ - HBufC* Body16LC( - CCalEntry& aEntry ); - - /** - * Formats plain text body part from ES calendar entry. Ownership of the - * created descriptor is transferred to caller. Created object is also - * left to cleanup stack. - * @param aEntry Reference to calendar entry. - * @return Plain text buffer. - */ - HBufC8* Body8LC( - CCalEntry& aEntry ); - - /** - * Formats the subject line for meeting request email.O wnership of the - * created descriptor is transferred to caller. Created object is also - * left to cleanup stack. - * @param aEntry Reference to calendar entry. - * @param aIsForwarded ETrue if entry is forwarded - * @param aIsUpdate ETrue if entry is update to existing entry - * @return Subject line buffer. - */ - HBufC* Subject16LC( - CCalEntry& aEntry, - TBool aIsForwarded, - TBool aIsUpdate ); - - /** - * Formats the subject line for meeting request email.O wnership of the - * created descriptor is transferred to caller. Created object is also - * left to cleanup stack. - * @param aEntry Reference to calendar entry. - * @param aIsForwarded ETrue if entry is forwarded - * @param aIsUpdate ETrue if entry is update to existing entry - * @return Subject line buffer. - */ - HBufC8* Subject8LC( - CCalEntry& aEntry, - TBool aIsForwarded, - TBool aIsUpdate ); - - /** - * Fetches the localized updated string for entry - * @rerurn Localized updated string - */ - HBufC* UpdatedStringLC(); - - /** - * Fetches the localized canceled string for entry - * @rerurn Localized updated string - */ - HBufC* CanceledStringLC(); - - /** - * Fetches the localized Reply string for entry - * @param aEntry Reference to entry - * @rerurn Localized reply string - */ - HBufC* ReplyStringLC( CCalEntry& aEntry ); - -private: // Implementation - - CESMRMailPlainTextFormatter( - CMRMailboxUtils& aMailboxUtils ); - void ConstructL(); - - HBufC* SubjectLinePrefix16LC( - CCalEntry& aEntry, - TBool aIsForwarded, - TBool aIsSToredToDB ); - -private: // data - /** - * Reference to MR mailbox utilities. - * Not own. - */ - CMRMailboxUtils& iMailboxUtils; - - /** - * Resource file offset - */ - TInt iResourceOffset; - }; - -#endif // C_ESMRMAILPLAINTEXTFORMATTER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrmeetingrequestsender.h --- a/meetingrequest/mrtasks/inc/cesmrmeetingrequestsender.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR meeting request sender -* -*/ - - -#ifndef C_ESMRPOLICYCHECKER_H -#define C_ESMRPOLICYCHECKER_H - -#include -#include "mesmrmeetingrequestsender.h" - -class CMRMailboxUtils; - -/** - * Implements interface for constructing and sending meeting requests - * over email. - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS(CESMRMeetingRequestSender) : - public CBase, - public MESMRMeetingRequestSender - { -public: // Construction and destruction - - /** - * Two-phased constructor. Creates and initializes - * CESMRMeetingRequestSender object. - * @return Pointer to esmr policy checker object. - */ - IMPORT_C static CESMRMeetingRequestSender* NewL( - CMRMailboxUtils& aMailboxUtils ); - - /** - * Destructor. - */ - IMPORT_C ~CESMRMeetingRequestSender(); - -public:// From MESMRMeetingRequestSender - - void CreateAndSendMeetingRequestL( MESMRMeetingRequestEntry& aEntry ); - - void CreateAndSendMeetingRequestL( MESMRMeetingRequestEntry& aEntry, - const TDesC& aFreePlainText ); - -private: - CESMRMeetingRequestSender( CMRMailboxUtils& aMailboxUtils ); - - void ConstructL(); - -private: - /** - * Mailbox utilities - * Not Own. - */ - CMRMailboxUtils& iMailboxUtils; - }; - -#endif // C_ESMRPOLICYCHECKER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrsendmrfsmailreplytask.h --- a/meetingrequest/mrtasks/inc/cesmrsendmrfsmailreplytask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class definition for sending meeting request via FS EMail -* -*/ - - -#ifndef C_ESMRSENDMRFSMAILREPLYTASK_H -#define C_ESMRSENDMRFSMAILREPLYTASK_H - -#include "cesmrtaskbase.h" - -//Forward declarations -class MESMRCalDbMgr; -class MESMRMeetingRequestEntry; -class CMRMailboxUtils; -class CESMRFSEMailManager; -class CESMRCalUserUtil; -class CCalEntry; - -/** - * Class definition for sending meeting request via FS EMail. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRSendMRFSMailReplyTask ) : - public CESMRTaskBase - { -public: // Construction and destruction - - /** - * Creates and initializes new CESMRCancelMRFSEmailTask object. - * Ownership is transferred to caller. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - */ - static CESMRSendMRFSMailReplyTask* NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TBool aReplyAll); - - /** - * C++ destructor. - */ - ~CESMRSendMRFSMailReplyTask(); - -public:// From MESMRTask - void ExecuteTaskL(); - -private: - CESMRSendMRFSMailReplyTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TBool aReplyAll); - - void ConstructL(); - void ConstructMailL(); - void AddAttendeesL(); - HBufC* ResolveUsedMailboxUserAddressLC(); - TInt LaunchFSEmailEditorL(TBool aReplAll); - -private: // Data - /// Own: FS email manager - CESMRFSEMailManager* iEmailMgr; - /// Own: Pointer to calendar entry to be sent - CCalEntry* iEntryToSend; - /// Own: Caluser utility object - CESMRCalUserUtil* iCaluserUtil; - - TBool iReplyAll; - }; - -#endif // C_ESMRSENDMRFSMAILREPLYTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrsendmrfsmailtask.h --- a/meetingrequest/mrtasks/inc/cesmrsendmrfsmailtask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class definition for sending meeting request via FS EMail -* -*/ - - -#ifndef C_ESMRSENDMRFFSEMAILTASK_H -#define C_ESMRSENDMRFFSEMAILTASK_H - -#include "cesmrtaskbase.h" -// -#include "esmrcommands.h" -// - -class CCalEntry; -class MESMRCalDbMgr; -class MESMRMeetingRequestEntry; -class CMRMailboxUtils; -class CESMRFSEMailManager; -class CESMRCalUserUtil; -class CCalAttendee; - -/** - * Class definition for sending meeting request via FS EMail. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRSendMRFSMailTask ) : - public CESMRTaskBase - { -public: // Construction and destruction - - /** - * Creates and initializes new CESMRCancelMRFSEmailTask object. - * Ownership is transferred to caller. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - * @param aCommand Command to be executed - */ - static CESMRSendMRFSMailTask* NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRCommand aCommand ); - - /** - * C++ destructor. - */ - ~CESMRSendMRFSMailTask(); - -public: // From MESMRTask - void ExecuteTaskL(); - -private: // Definitios - /** Enumeration for update sending type */ - enum TESMRSendType - { - // MR is sent to all - ESendToAll, - // MR is sent to added and removed - ESentToAddedAndRemoved - }; - -private: // Implementation - CESMRSendMRFSMailTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRCommand aCommand ); - void ConstructL(); - - void ConstructMailL(); - void AddAttendeesL(); - TInt SaveICalToFileL( - const TDesC& aICal, - const TDesC& aFilename ); - HBufC* ResolveUsedMailboxUserAddressLC(); - void ResolveSendTypeL(); - TBool NeedToSendInvitationL(); - TBool NeedToSendCancellationL(); - void SetCorrectAttendeesToEntryL(); - void GetAttendeesToBeSentL( - RArray& aRequiredAttendees, - RArray& aOptionalAttendees ); - void GetEntriesToBeSentL(); - -private: // Data - /// Own: FS email manager - CESMRFSEMailManager* iEmailMgr; - /// Ref: Pointer to calendar entry to be sent - CCalEntry* iEntryToSend; - /// Own: Pointer to calendar entries to be sent - RPointerArray iEntriesToSend; - /// Own: Caluser utility object - CESMRCalUserUtil* iCaluserUtil; - /// Own: Send type definition - TESMRSendType iSendType; - /// Own: Command to be executed - TESMRCommand iCommand; - }; - -#endif // C_ESMRSENDMRFFSEMAILTASK_H - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrsendmrrespfsmailtask.h --- a/meetingrequest/mrtasks/inc/cesmrsendmrrespfsmailtask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class definition for sending meeting request via FS EMail -* -*/ - -#ifndef C_ESMRSENDMRRESPFSEMAILTASK_H -#define C_ESMRSENDMRRESPFSEMAILTASK_H - -// -#include "esmrdef.h" -// -#include "cesmrtaskbase.h" - -class MESMRCalDbMgr; -class MESMRMeetingRequestEntry; -class CMRMailboxUtils; -class CCalEntry; -class CESMRFSEMailManager; -class CESMRMailPlainTextFormatter; -class CESMRCalUserUtil; - -/** - * Class definition for sending meeting request via FS EMail. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRSendMRRespFSMailTask ) : public CESMRTaskBase - { -public: // Construction and destruction - /** - * Creates and initializes new CESMRSendMRRespFSMailTask object. - * Ownership is transferred to caller. - * - * @param aCommand Response command. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR meeting request calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - * @param aResponseType Response type - * @param aResponseMessage Pointer to response message buffer. - */ - static CESMRSendMRRespFSMailTask* NewL( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType, - const TDesC& aResponseMessage ); - - /** - * C++ destructor. - */ - ~CESMRSendMRRespFSMailTask(); - -public:// From MESMRTask - void ExecuteTaskL(); - -private: - CESMRSendMRRespFSMailTask( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType ); - - void ConstructL( const TDesC& aResponseMessage ); - void ConstructMailL(); - void AddPlainTextPartL(); - void AddCalendarPartL(); - void SendMailViaSyncL(); - TInt SaveICalToFileL( const TDesC& aICal, const TDesC& aFilename ); - void SetAttendeesL(); - -private: // Data - /** - * Response command - */ - TESMRCommand iCommand; - - /** - * FS Email manager - * Own. - */ - CESMRFSEMailManager* iEmailMgr; - - /** - * Plain text formatter - * Own. - */ - CESMRMailPlainTextFormatter* iTextFormatter; - - /** - * Response type - */ - TESMRResponseType iResponseType; - /** - * Response message - * Own. - */ - HBufC* iResponseMessage; - - /** - * Pointer to calendar entry to be sent - * Own. - */ - CCalEntry* iEntryToSend; - - /** - * Caluser utility object - * Own. - */ - CESMRCalUserUtil* iCaluserUtil; - }; - -#endif // C_ESMRSENDMRRESPFSEMAILTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrsendmrrespmailtask.h --- a/meetingrequest/mrtasks/inc/cesmrsendmrrespmailtask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface definition for ESMR send mr response via mail task -* -*/ - - -#ifndef C_ESMRSENDMRRESPMAILTASK_H -#define C_ESMRSENDMRRESPMAILTASK_H - -// -#include "esmrdef.h" -// -#include "cesmrtaskbase.h" - -class CCalEntry; - -/** - * Implementation for sending meeting request response over MTM based - * mail box. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRSendMRRespMailTask ) : public CESMRTaskBase - { -public: // Construction and destruction - - /** - * Creates and initializes new CESMRSendMRRespMailTask object. - * Ownership is transferred to caller. - * @param aCommand Response command. - * @param aResponseType Response message type. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - */ - static CESMRSendMRRespMailTask* NewL( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType, - const TDesC& aResponseMessage ); - - /** - * C++ destructor. - */ - ~CESMRSendMRRespMailTask(); - -public:// From MESMRTask - void ExecuteTaskL(); - -private: - CESMRSendMRRespMailTask( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType ); - - void ConstructL( - const TDesC& aResponseMessage ); - - void SendResponseMessageL(); - -private: // Data - /** - * Response command - */ - TESMRCommand iCommand; - - /** - * Response message type - */ - TESMRResponseType iResponseType; - - /** - * Response message text - * Own. - */ - HBufC* iResponseMessage; - - /** - * Response entry - * Own. - */ - CCalEntry* iResponseEntry; - }; - -#endif // C_ESMRSENDMRRESPMAILTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrstoremrtask.h --- a/meetingrequest/mrtasks/inc/cesmrstoremrtask.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface definition for ESMR send mr response via mail task -* -*/ - - -#ifndef C_ESMRSTOREMRTASK_H -#define C_ESMRSTOREMRTASK_H - -#include "cesmrtaskbase.h" - -/** - * CESMRStoreMRTask is responsibe for storing MR to calendar DB. - * - * @lib esmrtasks.lib - */ -NONSHARABLE_CLASS( CESMRStoreMRTask ) : public CESMRTaskBase - { -public: - /** - * Creates and initializes new CESMRStoreMRTask object. - * Ownership is transferred to caller. - * @param aCalDbMgr Reference to cal db manager. - * @param aEntry Reference to ES MR calendar entry. - * @param aMRMailboxUtils Reference mr mailbox utilities. - */ - static CESMRStoreMRTask* NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ); - - /** - * C++ destructor. - */ - ~CESMRStoreMRTask(); - -public:// From MESMRTask - void ExecuteTaskL(); - -private: - CESMRStoreMRTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ); - - void ConstructL(); - void StoreEntryToDbL(); - }; - -#endif // C_ESMRSTOREMRTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrtaskbase.h --- a/meetingrequest/mrtasks/inc/cesmrtaskbase.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface definition for ESMR task factory implementation -* -*/ - - -#ifndef C_ESMRTASKBASE_H -#define C_ESMRTASKBASE_H - -#include -#include "mesmrtask.h" - -class MESMRCalDbMgr; -class MESMRMeetingRequestEntry; -class CMRMailboxUtils; - -/** - * CESMRTaskBase is base class for ES MR tasks - * - * @lib esmrtasks.lib - */ -class CESMRTaskBase : public CBase, - public MESMRTask - { -public: - - /** - * C++ destructor. - */ - virtual ~CESMRTaskBase(); - -protected:// Implementation - - /** - * C++ constructor - * @param aCalDbMgr Reference to cal db manager. - */ - CESMRTaskBase( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ); - - /** - * Stores entry to calendar DB - */ - void StoreEntryToDbL(); - - /** - * Base class's EPOC 2nd phase constructor. - */ - void BaseConstructL(); - - /** - * Fetches reference to cal db manager. - * @return Reference to cal db manager. - */ - inline MESMRCalDbMgr& CalDbMgr(); - - /** - * Fetches reference to es mr calendar entry. - * @return Reference to es mr calendar entry. - */ - inline MESMRMeetingRequestEntry& ESMREntry(); - - /** - * Fetches the reference to mr mailbox utilities. - * @return reference to mr mailbox utilities. - */ - inline CMRMailboxUtils& MailboxUtils(); - -private: // Data - - /** - * Reference to cal db manager - * Not own. - */ - MESMRCalDbMgr& iCalDbMgr; - - /** - * Reference to ES MR calendar entry - * Not Own. - */ - MESMRMeetingRequestEntry& iEntry; - /** - * Reference to mr mailbox utilities - * Not own. - */ - CMRMailboxUtils& iMRMailboxUtils; - }; - -#include "cesmrtaskbase.inl" - -#endif // C_ESMRTASKBASE_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrtaskbase.inl --- a/meetingrequest/mrtasks/inc/cesmrtaskbase.inl Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Inline implementation for esmr base tasks -* -*/ - - -// --------------------------------------------------------------------------- -// CESMRTaskBase::CalDbMgr -// --------------------------------------------------------------------------- -// -inline MESMRCalDbMgr& CESMRTaskBase::CalDbMgr() - { - return iCalDbMgr; - } - -// --------------------------------------------------------------------------- -// CESMRTaskBase::ESMREntry -// --------------------------------------------------------------------------- -// -inline MESMRMeetingRequestEntry& CESMRTaskBase::ESMREntry() - { - return iEntry; - } - -// --------------------------------------------------------------------------- -// CESMRTaskBase::MailboxUtils -// --------------------------------------------------------------------------- -// -inline CMRMailboxUtils& CESMRTaskBase::MailboxUtils() - { - return iMRMailboxUtils; - } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrtaskextensionimpl.h --- a/meetingrequest/mrtasks/inc/cesmrtaskextensionimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/inc/cesmrtaskextensionimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -46,18 +46,10 @@ /** * Creates and initialzes new CESMRTaskExtenstionImpl object * Ownership is trasferred to caller. - * @param aCalDbMgr Reference to cal db manager. - * @param aMRMailboxUtils Reference to mailbox utilities. - * @param aPolicyManager Reference to policy manager. - * @param aEntryProcessor Reference to entry processor. + * * @param aTaskFactory Reference to task factory. */ - IMPORT_C static CESMRTaskExtenstionImpl* NewL( - MESMRCalDbMgr& aCalDBMgr, - CMRMailboxUtils& aMRMailboxUtils, - CESMRPolicyManager& aPolicyManager, - CESMREntryProcessor& aEntryProcessor, - MESMRTaskFactory& aTaskFactory ); + IMPORT_C static CESMRTaskExtenstionImpl* NewL( MESMRTaskFactory& aTaskFactory ); /** * C++ destructor. @@ -67,64 +59,44 @@ public: // From MESMRTaskExtension void SendAndStoreResponseL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); + MESMRCalEntry& aEntry ); void SendAndStoreMRL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - void DeleteMRFromLocalDBL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); + MESMRCalEntry& aEntry ); void DeleteAndSendMRL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - void StoreMRToLocalDBL( + MESMRCalEntry& aEntry ); + void StoreEntryToLocalDBL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); + MESMRCalEntry& aEntry ); void ForwardMRAsEmailL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); + MESMRCalEntry& aEntry ); void ReplyAsEmailL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); + MESMRCalEntry& aEntry ); + void DeleteEntryFromLocalDBL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ); + void MarkTodoAsDoneL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ); + void MarkTodoAsNotDoneL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ); + void MoveEntryToCurrentDBL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ); private: // Implementation - CESMRTaskExtenstionImpl( - MESMRCalDbMgr& aCalDBMgr, - CMRMailboxUtils& aMRMailboxUtils, - CESMRPolicyManager& aPolicyManager, - CESMREntryProcessor& aEntryProcessor, - MESMRTaskFactory& aTaskFactory ); + CESMRTaskExtenstionImpl( MESMRTaskFactory& aTaskFactory ); void ConstructL(); void CreateAndExecuteTaskL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); + MESMRCalEntry& aEntry ); private: // Data /** - * Cal DB manager - * Not own. - */ - MESMRCalDbMgr& iCalDBMgr; - - /** - * Meeting request mailbox utils - * Not own. - */ - CMRMailboxUtils& iMRMailboxUtils; - - /** - * ESMR policy manager - * Not own. - */ - CESMRPolicyManager& iPolicyManager; - - /** - * MR Entry processor - * Not own. - */ - CESMREntryProcessor& iEntryProcessor; - - /** * ES MR Task factory * Not own. */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrtaskfactory.h --- a/meetingrequest/mrtasks/inc/cesmrtaskfactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/inc/cesmrtaskfactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -23,80 +23,47 @@ #include "mesmrtaskfactory.h" class MESMRCalDbMgr; -class CMRMailboxUtils; /** - * CESMRTaskFactory implements interface for creating ES MR tasks. + * CESMRTaskFactory defines ECom plugin interface for creating ES MR tasks. * @see MESMRTaskFactory * * @lib esmrtasks.lib */ -NONSHARABLE_CLASS(CESMRTaskFactory) : public CBase, - public MESMRTaskFactory +class CESMRTaskFactory : public CBase, + public MESMRTaskFactory { public: // Construction and destruction /** * Creates and initialzes new ES MR task factory. * @param aCalDbMgr Reference to cal db manager. - * @param aMRMailboxUtils Reference to mailbox utilities. */ - IMPORT_C static CESMRTaskFactory* NewL( - MESMRCalDbMgr& aCalDbMgr, - CMRMailboxUtils& aMRMailboxUtils ); + inline static CESMRTaskFactory* NewL( + TESMRCalendarEventType aType, + MESMRCalDbMgr& aCalDbMgr ); /** * C++ destructor. */ - ~CESMRTaskFactory(); + inline ~CESMRTaskFactory(); public: // From MESMRTaskFactory MESMRTask* CreateTaskL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - -private: // Implementation - CESMRTaskFactory( - MESMRCalDbMgr& aCalDbMgr, - CMRMailboxUtils& aMRMailboxUtils ); - MESMRTask* CreateSendMRResponseViaMailTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateSendMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateDeleteMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateStoreMRToLocalDBTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateForwardAsMeetingTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateForwardAsMailTaskL( - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateOrganizerDeleteMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateAttendeeDeleteMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ); - MESMRTask* CreateReplyAsMailTaskL( - MESMRMeetingRequestEntry& aEntry, - TBool aReplyAll); + MESMRCalEntry& aEntry ) = 0; private: // Data - /* - * Reference to cal db manager - * Not own. - */ - MESMRCalDbMgr& iCalDbMgr; - + /** - * Reference to mr mailbox utilities - * Not own. - */ - CMRMailboxUtils& iMRMailboxUtils; + * iDtor_ID_Key Instance identifier key. When instance of an + * implementation is created by ECOM framework, the + * framework will assign UID for it. The UID is used in + * destructor to notify framework that this instance is + * being destroyed and resources can be released. + */ + TUid iDtor_ID_Key; }; +#include "cesmrtaskfactory.inl" + #endif // C_ESMRTASKFACTORY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/cesmrtaskfactory.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/inc/cesmrtaskfactory.inl Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR task factory implementation +* +*/ + +#include +#include "esmrinternaluid.h" + +inline CESMRTaskFactory* CESMRTaskFactory::NewL( + TESMRCalendarEventType aType, + MESMRCalDbMgr& aCalDbMgr ) + { + CESMRTaskFactory* impl = NULL; + + switch ( aType ) + { + case EESMREventTypeMeetingRequest: + { + impl = static_cast< CESMRTaskFactory* >( + REComSession::CreateImplementationL( + TUid::Uid( KMRTaskPluginImplementationUID ), + _FOFF( CESMRTaskFactory, iDtor_ID_Key ), + &aCalDbMgr ) ); + break; + } + case EESMREventTypeAppt: + case EESMREventTypeETodo: + case EESMREventTypeEEvent: + case EESMREventTypeEReminder: + case EESMREventTypeEAnniv: + { + impl = static_cast< CESMRTaskFactory* >( + REComSession::CreateImplementationL( + TUid::Uid( KMRCalEventTaskPluginImplementationUID ), + _FOFF( CESMRTaskFactory, iDtor_ID_Key ), + &aCalDbMgr ) ); + break; + } + default: + { + // never should come here. + User::Leave( KErrGeneral ); + break; + } + } + + return impl; + } + +inline CESMRTaskFactory::~CESMRTaskFactory() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/mesmrmeetingrequestsender.h --- a/meetingrequest/mrtasks/inc/mesmrmeetingrequestsender.h Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface definition for ESMR meeting request sender -* -*/ - - -#ifndef MESMRMEETINGREQUESTSENDER_H -#define MESMRMEETINGREQUESTSENDER_H - -class MESMRMeetingRequestEntry; - -/** - * Defines interface for constructing and sending meeting requests - * over email. - * - * @lib esmrtasks.lib - */ -class MESMRMeetingRequestSender - { -public: - /** - * Virtual destructor. - */ - virtual ~MESMRMeetingRequestSender() { } - -public: // Interface - /** - * Creates email from the meeting request and sends it. - * @param aEntry reference to ES meeting request ebject. - * @see MESMRMeetingRequestEntry - */ - virtual void CreateAndSendMeetingRequestL( - MESMRMeetingRequestEntry& aEntry ) = 0; - - /** - * Creates email from the meeting request and sends it. - * @param aEntry reference to ES meeting request ebject. - * @param aFreePlainText Free plain text to message plain text part. - * @see MESMRMeetingRequestEntry - */ - virtual void CreateAndSendMeetingRequestL( - MESMRMeetingRequestEntry& aEntry, - const TDesC& aFreePlainText ) = 0; - }; - -#endif diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/mesmrtaskextension.h --- a/meetingrequest/mrtasks/inc/mesmrtaskextension.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/inc/mesmrtaskextension.h Wed Mar 31 21:08:33 2010 +0300 @@ -24,7 +24,7 @@ #include "esmrdef.h" //
-class MESMRMeetingRequestEntry; +class MESMRCalEntry; /** * MESMRTaskExtension is extension API for CMRUtils. @@ -67,7 +67,7 @@ */ virtual void SendAndStoreResponseL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; + MESMRCalEntry& aEntry ) = 0; /** * Sends and stores MR . Command needs to be one of the @@ -83,20 +83,7 @@ */ virtual void SendAndStoreMRL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; - - /** - * Delete MR from local calendar DB. Command needs to be one of the - * following: - * - EESMRCmdDeleteMR - * - * @param aCommand Command to be executed - * @param aEntry Reference to entry - * @see TESMRCommand - */ - virtual void DeleteMRFromLocalDBL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; + MESMRCalEntry& aEntry ) = 0; /** * Deletes MR from local calendar DB. Method also sends either cancellation @@ -111,10 +98,10 @@ */ virtual void DeleteAndSendMRL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; + MESMRCalEntry& aEntry ) = 0; /** - * Stores MR to local calendar DB. + * Stores Cal Event to local calendar DB. * * Command needs to be one of the following: * - EESMRCmdSaveMR @@ -123,10 +110,10 @@ * @param aEntry Reference to entry * @see TESMRCommand */ - virtual void StoreMRToLocalDBL( + virtual void StoreEntryToLocalDBL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; - + MESMRCalEntry& aEntry ) = 0; + /** * Forwards MR as email. Email editor is launched with pre-filled * email message. @@ -140,7 +127,7 @@ */ virtual void ForwardMRAsEmailL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; + MESMRCalEntry& aEntry ) = 0; /** * Creates email reply for meeting request. @@ -156,7 +143,64 @@ */ virtual void ReplyAsEmailL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; + MESMRCalEntry& aEntry ) = 0; + + /** + * Deletes calendar event from local calendar DB. + * + * Command needs to be one of the following: + * - EESMRCmdCalEntryUIDelete + * - EESMRCmdDeleteMR + * + * @param aCommand Command to be executed + * @param aEntry Reference to entry + * @see TESMRCommand + */ + virtual void DeleteEntryFromLocalDBL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) = 0; + + /** + * Marks to-do event as done. + * + * Command needs to be one of the following: + * - EESMRCmdTodoMarkAsDone + * + * @param aCommand Command to be executed + * @param aEntry Reference to entry + * @see TESMRCommand + */ + virtual void MarkTodoAsDoneL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) = 0; + + /** + * Marks to-do event as not done. + * + * Command needs to be one of the following: + * - EESMRCmdTodoMarkAsNotDone + * + * @param aCommand Command to be executed + * @param aEntry Reference to entry + * @see TESMRCommand + */ + virtual void MarkTodoAsNotDoneL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) = 0 ; + + /** + * Moves entry to current database + * + * Command needs to be one of following: + * - EESMRCmdSaveMR + * - EESMRCmdCalEntryUISave + * @param aCommand Command to be executed + * @param aEntry Reference to entry + * @see TESMRCommand + */ + virtual void MoveEntryToCurrentDBL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) = 0 ; }; #include "mesmrtaskextension.inl" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/inc/mesmrtaskfactory.h --- a/meetingrequest/mrtasks/inc/mesmrtaskfactory.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/inc/mesmrtaskfactory.h Wed Mar 31 21:08:33 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: Interface definition for ESMR task factory +* Description: Interface definition for MR task factory * */ @@ -24,7 +24,7 @@ //
class MESMRTask; -class MESMRMeetingRequestEntry; +class MESMRCalEntry; /** * MESMRTaskFactory defines interface for creating ES MR tasks. @@ -52,7 +52,7 @@ */ virtual MESMRTask* CreateTaskL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) = 0; + MESMRCalEntry& aEntry ) = 0; }; #endif // MESMRTASKFACTORY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/data/mrcaleventtaskplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/data/mrcaleventtaskplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECom registration resource for MR calendar event task plugin +* +*/ + + + +#include +#include "esmrinternaluid.h" + + +// --------------------------------------------------------------------------- +// r_registry +// ECOM plugin registry info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO r_registry + { + // Resource format version 2 for ROM-only plugins + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRCalEventTaskPluginImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMRTaskInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRCalEventTaskPluginImplementationUID; + version_no = 1; + display_name = + "MR Cal Event Task Plugin";// codescanner::codereview + default_data = "language(*)"; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build definition file. +* +* +*/ + + +#include + +PRJ_EXPORTS + +PRJ_MMPFILES +mrcaleventtaskplugin.mmp diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/group/mrcaleventtaskplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/group/mrcaleventtaskplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ESMR URL Parser +* +*/ + +#include "../../../inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrcaleventtaskplugin.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRCalEventTaskPluginImplementationUID +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE dllmain.cpp +SOURCE cmrcaleventtaskplugin.cpp +SOURCE cmrstorecaleventtask.cpp +SOURCE cmrcalentryuideletetask.cpp +SOURCE cmrcalentryuiedittask.cpp +SOURCE cmrtodomarkasdonetask.cpp +SOURCE cmrtodomarkasnotdonetask.cpp + + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data/ +START RESOURCE mrcaleventtaskplugin.rss +TARGET mrcaleventtaskplugin.rsc +END + +LIBRARY esmrtasks.lib +LIBRARY esmrcommon.lib +LIBRARY esmrdb.lib + +LIBRARY ecom.lib +LIBRARY bafl.lib +LIBRARY cone.lib +LIBRARY euser.lib +LIBRARY avkon.lib +LIBRARY eikcore.lib +LIBRARY charconv.lib +LIBRARY eikcoctl.lib +LIBRARY calinterimapi.lib +LIBRARY caleninterimutils2.lib + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// EOF \ No newline at end of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrcalentryuideletetask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrcalentryuideletetask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR delete calendar event from db task +* +*/ + + +#ifndef C_ESMRCALENTRYUIDELETETASK_H +#define C_ESMRCALENTRYUIDELETETASK_H + +#include + +#include "mesmrtask.h" + +// Forward declarations +class MESMRCalEntry; +class MESMRCalDbMgr; + +/** + * CESMRCalEntryUiDeleteTask is responsibe for deleting cal event from calendar DB. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRCalEntryUiDeleteTask ) : public CBase, + public MESMRTask + { +public: + /** + * Creates and initializes new CESMRCalEntryUiDeleteTask object. + * Ownership is transferred to caller. + */ + static CESMRCalEntryUiDeleteTask* NewL( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ); + + /** + * C++ destructor. + */ + ~CESMRCalEntryUiDeleteTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRCalEntryUiDeleteTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr); + + void ConstructL(); + void DeleteEntryFromDbL(); + +private: // Data + /** + * Reference to ES MR calendar entry + * Not Own. + */ + MESMRCalEntry& iEntry; + /** + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + }; + +#endif // C_ESMRCALENTRYUIDELETETASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrcalentryuiedittask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrcalentryuiedittask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR cal entry edit task +* +*/ + + +#ifndef C_ESMRCALENTRYUIEDITTASK_H +#define C_ESMRCALENTRYUIEDITTASK_H + +#include + +#include "mesmrtask.h" + +// Forward declarations +class MESMRCalEntry; + +/** + * CESMRCalEntryUiEditTask is responsibe for creating entry edit task + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRCalEntryUiEditTask ) : public CBase, + public MESMRTask + { +public: + /** + * Creates and initializes new CESMRCalEntryUiEditTask object. + * Ownership is transferred to caller. + */ + static CESMRCalEntryUiEditTask* NewL( MESMRCalEntry& aEntry ); + + /** + * C++ destructor. + */ + ~CESMRCalEntryUiEditTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRCalEntryUiEditTask(); + + void ConstructL(); + void EditCalEventL(); + }; + +#endif // C_ESMRSTORECALEVENTTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrcaleventtaskplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrcaleventtaskplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class implementing the MR Cal Event Task Plugin interface +* +*/ + +#ifndef CMRCALEVENTTASKPLUGIN_H +#define CMRCALEVENTTASKPLUGIN_H + +// INCLUDES +#include + +#include "cesmrtaskfactory.h" + +// FORWARD DECLARATIONS + + +// CLASS DECLARATIONS +/** + * This class is used for creating implement of view through ECom framework. + */ +NONSHARABLE_CLASS( CMRCalEventTaskPlugin ) : public CESMRTaskFactory + { +public: + /** + * Creates new CMRCalEventTaskPlugin object. + * @return New CMRCalEventTaskPlugin object + */ + static CMRCalEventTaskPlugin* NewL( TAny* aCalDbMgr ); + + /** + * Destructor + */ + ~CMRCalEventTaskPlugin(); + +public: // From MESMRTaskFactory + MESMRTask* CreateTaskL( TESMRCommand aCommand, MESMRCalEntry& aEntry ); + +private: // Implementation + + CMRCalEventTaskPlugin( MESMRCalDbMgr& aCalDbMgr ); + + MESMRTask* CreateStoreCalEventToDBTaskL( + MESMRCalEntry& aEntry ); + MESMRTask* CreateCalEntryUiDeleteTaskL( + MESMRCalEntry& aEntry ); + MESMRTask* CreateCalEntryUiEditTaskL( + MESMRCalEntry& aEntry ); + MESMRTask* CreateTodoMarkAsDoneTaskL( + MESMRCalEntry& aEntry ); + MESMRTask* CreateTodoMarkAsNotDoneTaskL( + MESMRCalEntry& aEntry ); + MESMRTask* CreateMoveCalEntryToCurrentDBTaskL( + MESMRCalEntry& aEntry ); + +private: // Data + /* + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + }; + +#endif // CMRCALEVENTTASKPLUGIN_H + +// End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrstorecaleventtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrstorecaleventtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR store calendar event to db task +* +*/ + + +#ifndef C_ESMRSTORECALEVENTTASK_H +#define C_ESMRSTORECALEVENTTASK_H + +#include + +#include "mesmrtask.h" + + +// Forward declarations +class MESMRCalEntry; +class MESMRCalDbMgr; + +/** + * CESMRStoreCalEventTask is responsibe for storing cal event to calendar DB. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRStoreCalEventTask ) : public CBase, + public MESMRTask + { +public: + /** + * Creates and initializes new CESMRStoreCalEventTask object. + * Ownership is transferred to caller. + */ + static CESMRStoreCalEventTask* NewL( + MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ); + + /** + * C++ destructor. + */ + ~CESMRStoreCalEventTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: // Implementation + + CESMRStoreCalEventTask( + MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ); + void ConstructL(); + + void StoreCalEventToDbL(); + +private: // Data + /** + * Reference to ES MR calendar entry + * Not Own. + */ + MESMRCalEntry& iEntry; + /** + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + }; + +#endif // C_ESMRSTORECALEVENTTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrtodomarkasdonetask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrtodomarkasdonetask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR todo mark as done task +* +*/ + + +#ifndef C_ESMRTODOMARKASDONETASK_H +#define C_ESMRTODOMARKASDONETASK_H + +#include + +#include "mesmrtask.h" + +// Forward declarations +class MESMRCalEntry; +class MESMRCalDbMgr; + +/** + * CESMRTodoMarkAsDoneTask is responsibe for marking todo as done + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRTodoMarkAsDoneTask ) : public CBase, + public MESMRTask + { +public: + /** + * Creates and initializes new CESMRTodoMarkAsDoneTask object. + * Ownership is transferred to caller. + */ + static CESMRTodoMarkAsDoneTask* NewL( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ); + + /** + * C++ destructor. + */ + ~CESMRTodoMarkAsDoneTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRTodoMarkAsDoneTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ); + void ConstructL(); + void MarkTodoAsDoneL(); + +private: // Data + /** + * Reference to ES MR calendar entry + * Not Own. + */ + MESMRCalEntry& iEntry; + /** + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + }; + +#endif // C_ESMRTODOMARKASDONETASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrtodomarkasnotdonetask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/inc/cmrtodomarkasnotdonetask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR marking to-do as not done +* +*/ + + +#ifndef C_ESMRTODOMARKASNOTDONETASK_H +#define C_ESMRTODOMARKASNOTDONETASK_H + +#include + +#include "mesmrtask.h" + +// Forward declarations +class MESMRCalEntry; +class MESMRCalDbMgr; + +/** + * CESMRTodoMarkAsNotDoneTask is responsibe marking to-do as not done. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRTodoMarkAsNotDoneTask ) : public CBase, + public MESMRTask + { +public: + /** + * Creates and initializes new CESMRTodoMarkAsNotDoneTask object. + * Ownership is transferred to caller. + */ + static CESMRTodoMarkAsNotDoneTask* NewL( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ); + + /** + * C++ destructor. + */ + ~CESMRTodoMarkAsNotDoneTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRTodoMarkAsNotDoneTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr); + + void ConstructL(); + void MarkTodoAsNotDoneL(); + +private: // Data + /** + * Reference to ES MR calendar entry + * Not Own. + */ + MESMRCalEntry& iEntry; + /** + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + }; + +#endif // C_ESMRTODOMARKASNOTDONETASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrcalentryuideletetask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrcalentryuideletetask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR calendar event task +* +*/ + +#include "cmrcalentryuideletetask.h" +#include "cesmrcaldbmgr.h" +#include "mesmrcalentry.h" + +#include "emailtrace.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiDeleteTask::CESMRCalEntryUiDeleteTask +// --------------------------------------------------------------------------- +// +CESMRCalEntryUiDeleteTask::CESMRCalEntryUiDeleteTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) +: iEntry( aEntry ), + iCalDbMgr( aCalDbMgr ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiDeleteTask::~CESMRCalEntryUiDeleteTask +// --------------------------------------------------------------------------- +// +CESMRCalEntryUiDeleteTask::~CESMRCalEntryUiDeleteTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiDeleteTask::NewL +// --------------------------------------------------------------------------- +// +CESMRCalEntryUiDeleteTask* CESMRCalEntryUiDeleteTask::NewL( + MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) + { + FUNC_LOG; + CESMRCalEntryUiDeleteTask* self = + new (ELeave) CESMRCalEntryUiDeleteTask( aEntry, aCalDbMgr ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiDeleteTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRCalEntryUiDeleteTask::ConstructL() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiDeleteTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRCalEntryUiDeleteTask::ExecuteTaskL() + { + FUNC_LOG; + + // Delete from calendar DB + DeleteEntryFromDbL(); + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiDeleteTask::DeleteEntryFromDbL +// --------------------------------------------------------------------------- +// +void CESMRCalEntryUiDeleteTask::DeleteEntryFromDbL() + { + FUNC_LOG; + CCalEntry* entryToBeDeleted = iEntry.ValidateEntryL(); + CleanupStack::PushL( entryToBeDeleted ); + + TRAPD( err, iCalDbMgr.DeleteEntryCondL( *entryToBeDeleted ) ); + if ( err != KErrNone ) + { + #ifdef _DEBUG + User::LeaveIfError( err ); + #endif // _DEBUG + } + + CleanupStack::PopAndDestroy( entryToBeDeleted ); + entryToBeDeleted = NULL; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrcalentryuiedittask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrcalentryuiedittask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR calendar event task +* +*/ + +#include "cmrcalentryuiedittask.h" + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiEditTask::CESMRCalEntryUiEditTask +// --------------------------------------------------------------------------- +// +CESMRCalEntryUiEditTask::CESMRCalEntryUiEditTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiEditTask::~CESMRCalEntryUiEditTask +// --------------------------------------------------------------------------- +// +CESMRCalEntryUiEditTask::~CESMRCalEntryUiEditTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiEditTask::NewL +// --------------------------------------------------------------------------- +// +CESMRCalEntryUiEditTask* CESMRCalEntryUiEditTask::NewL( MESMRCalEntry& /*aEntry*/ ) + { + FUNC_LOG; + CESMRCalEntryUiEditTask* self = new (ELeave) CESMRCalEntryUiEditTask(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiEditTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRCalEntryUiEditTask::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiEditTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRCalEntryUiEditTask::ExecuteTaskL() + { + FUNC_LOG; + + // Edit calendar event + EditCalEventL(); + } + +// --------------------------------------------------------------------------- +// CESMRCalEntryUiEditTask::EditCalEventL +// --------------------------------------------------------------------------- +// +void CESMRCalEntryUiEditTask::EditCalEventL() + { + FUNC_LOG; + + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrcaleventtaskplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrcaleventtaskplugin.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Cal Event Task Plugin implementation +* +*/ +#include "cmrcaleventtaskplugin.h" + +#include "cmrstorecaleventtask.h" +#include "cmrcalentryuideletetask.h" +#include "cmrcalentryuiedittask.h" +#include "cmrtodomarkasdonetask.h" +#include "cmrtodomarkasnotdonetask.h" +#include "cesmrcombinedtask.h" + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +#ifdef _DEBUG + +// Panic literal for ESMRTaskFactory +_LIT( KESMRTaskFactoryPanicTxt, "MRCalEventTaskPlugin" ); + +/** Panic code definitions */ +enum TESMRTaskFactoryPanic + { + EESMRTaskFactoryInvalidTask // Trying to create invalid task + }; + + +// --------------------------------------------------------------------------- +// Panic wrapper method +// --------------------------------------------------------------------------- +// +void Panic( TESMRTaskFactoryPanic aPanic ) + { + + User::Panic( KESMRTaskFactoryPanicTxt, aPanic ); + } + +#endif // _DEBUG + +} // namespace + +// ----------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CMRCalEventTaskPlugin +// ----------------------------------------------------------------------------- +// +CMRCalEventTaskPlugin::CMRCalEventTaskPlugin( MESMRCalDbMgr& aCalDbMgr ) + : iCalDbMgr( aCalDbMgr ) + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::~CMRCalEventTaskPlugin +// ----------------------------------------------------------------------------- +// +CMRCalEventTaskPlugin::~CMRCalEventTaskPlugin() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::NewL +// ----------------------------------------------------------------------------- +// +CMRCalEventTaskPlugin* CMRCalEventTaskPlugin::NewL( TAny* aCalDbMgr ) + { + FUNC_LOG; + MESMRCalDbMgr* calDbMgr = static_cast< MESMRCalDbMgr* >( aCalDbMgr ); + + CMRCalEventTaskPlugin* self = + new( ELeave )CMRCalEventTaskPlugin( *calDbMgr ); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateTaskL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + MESMRTask* task = NULL; + + switch( aCommand ) + { + case EESMRCmdSaveMR: + case EESMRCmdCalEntryUISave: + { + task = CreateStoreCalEventToDBTaskL( aEntry ); + } + break; + + case EESMRCmdCalEntryUIDelete: + { + task = CreateCalEntryUiDeleteTaskL( aEntry ); + } + break; + + case EESMRCmdTodoMarkAsDone: + { + task = CreateTodoMarkAsDoneTaskL( aEntry ); + } + break; + + case EESMRCmdTodoMarkAsNotDone: + { + task = CreateTodoMarkAsNotDoneTaskL( aEntry ); + } + break; + + case EESMRCmdCalendarChange: + { + task = CreateMoveCalEntryToCurrentDBTaskL( aEntry ); + } + break; + + default: + __ASSERT_DEBUG( EFalse, Panic( EESMRTaskFactoryInvalidTask ) ); + User::Leave( KErrNotSupported ); + break; + } + + return task; + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateStoreCalEventToDBTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateStoreCalEventToDBTaskL( + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Store calendar event to calendar database task + return CESMRStoreCalEventTask::NewL( aEntry, iCalDbMgr ); + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateCalEntryUiDeleteTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateCalEntryUiDeleteTaskL( + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Delete calendar event from calendar database task + return CESMRCalEntryUiDeleteTask::NewL( aEntry, iCalDbMgr ); + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateCalEntryUiEditTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateCalEntryUiEditTaskL( + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Edit calendar event task + return CESMRCalEntryUiEditTask::NewL( aEntry ); + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateTodoMarkAsDoneTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateTodoMarkAsDoneTaskL( + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Mark to-do as done task + return CESMRTodoMarkAsDoneTask::NewL( aEntry, iCalDbMgr ); + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateTodoMarkAsNotDoneTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateTodoMarkAsNotDoneTaskL( + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Mark to-do as not done task + return CESMRTodoMarkAsNotDoneTask::NewL( aEntry, iCalDbMgr ); + } + +// --------------------------------------------------------------------------- +// CMRCalEventTaskPlugin::CreateMoveCalEntryToCurrentDBTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRCalEventTaskPlugin::CreateMoveCalEntryToCurrentDBTaskL( + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + CESMRCombinedTask* task = CESMRCombinedTask::NewL( + aEntry, + CESMRCombinedTask::EESMRTrap ); + CleanupStack::PushL( task ); + + AppendTaskL( *task, CreateCalEntryUiDeleteTaskL( aEntry ) ); + AppendTaskL( *task, CreateStoreCalEventToDBTaskL( aEntry ) ); + + CleanupStack::Pop( task ); + return task; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrstorecaleventtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrstorecaleventtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR calendar event task +* +*/ + +#include "cmrstorecaleventtask.h" +#include "cesmrcaldbmgr.h" +#include "mesmrcalentry.h" + +#include + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRStoreCalEventTask::CESMRStoreCalEventTask +// --------------------------------------------------------------------------- +// +CESMRStoreCalEventTask::CESMRStoreCalEventTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) +: iEntry( aEntry ), + iCalDbMgr( aCalDbMgr ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRStoreCalEventTask::~CESMRStoreCalEventTask +// --------------------------------------------------------------------------- +// +CESMRStoreCalEventTask::~CESMRStoreCalEventTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRStoreCalEventTask::NewL +// --------------------------------------------------------------------------- +// +CESMRStoreCalEventTask* CESMRStoreCalEventTask::NewL( + MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) + { + FUNC_LOG; + CESMRStoreCalEventTask* self = + new (ELeave) CESMRStoreCalEventTask( aEntry, aCalDbMgr ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRStoreCalEventTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRStoreCalEventTask::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRStoreCalEventTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRStoreCalEventTask::ExecuteTaskL() + { + FUNC_LOG; + + // Store to calendar DB + StoreCalEventToDbL(); + } + +// --------------------------------------------------------------------------- +// CESMRStoreCalEventTask::StoreEntryToDbL +// --------------------------------------------------------------------------- +// +void CESMRStoreCalEventTask::StoreCalEventToDbL() + { + FUNC_LOG; + + // Update entry time stamp before storing + iEntry.UpdateTimeStampL(); + + // Check storing result + MESMRUtilsTombsExt::TESMRUtilsDbResult res = + iCalDbMgr.StoreEntryCondL( iEntry.Entry(), EFalse, ETrue ); + + // Check that entry can be saved + if ( MESMRUtilsTombsExt::ECheckedValidNew == res || + MESMRUtilsTombsExt::ECheckedValidUpdate == res || + iEntry.IsEntryEditedL() ) + { + // Validate entry before storing it to calendar db + CCalEntry* validatedEntry = iEntry.ValidateEntryL(); + CleanupStack::PushL( validatedEntry ); + + iCalDbMgr.StoreEntryCondL( *validatedEntry, EFalse ); + + CleanupStack::PopAndDestroy( validatedEntry ); + + iEntry.UpdateEntryAfterStoringL(); + } + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrtodomarkasdonetask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrtodomarkasdonetask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR calendar event task +* +*/ + +#include "cmrtodomarkasdonetask.h" +#include "cesmrcaldbmgr.h" +#include "mesmrcalentry.h" + +#include +#include + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsDoneTask::CESMRTodoMarkAsDoneTask +// --------------------------------------------------------------------------- +// +CESMRTodoMarkAsDoneTask::CESMRTodoMarkAsDoneTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) +: iEntry( aEntry ), + iCalDbMgr( aCalDbMgr ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsDoneTask::~CESMRTodoMarkAsDoneTask +// --------------------------------------------------------------------------- +// +CESMRTodoMarkAsDoneTask::~CESMRTodoMarkAsDoneTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsDoneTask::NewL +// --------------------------------------------------------------------------- +// +CESMRTodoMarkAsDoneTask* CESMRTodoMarkAsDoneTask::NewL( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) + { + FUNC_LOG; + CESMRTodoMarkAsDoneTask* self = + new( ELeave )CESMRTodoMarkAsDoneTask( aEntry, aCalDbMgr ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsDoneTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRTodoMarkAsDoneTask::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsDoneTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRTodoMarkAsDoneTask::ExecuteTaskL() + { + FUNC_LOG; + + // Mark to-do as done + MarkTodoAsDoneL(); + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsDoneTask::MarkTodoAsDoneL +// --------------------------------------------------------------------------- +// +void CESMRTodoMarkAsDoneTask::MarkTodoAsDoneL() + { + FUNC_LOG; + + TTime now; + now.HomeTime(); + TCalTime caltime; + caltime.SetTimeLocalL( now ); + + // Set to-do as completed + TRAPD( err, iEntry.Entry().SetCompletedL( ETrue, caltime ) ); + + // Update entry time stamp before storing + iEntry.UpdateTimeStampL(); + + if( err == KErrNone ) + { + // Check storing result + MESMRUtilsTombsExt::TESMRUtilsDbResult res = + iCalDbMgr.StoreEntryCondL( iEntry.Entry(), EFalse, ETrue ); + + // Check that entry can be saved + if ( MESMRUtilsTombsExt::ECheckedValidNew == res || + MESMRUtilsTombsExt::ECheckedValidUpdate == res || + iEntry.IsEntryEditedL() ) + { + // Validate entry before storing it to calendar db + CCalEntry* validatedEntry = iEntry.ValidateEntryL(); + CleanupStack::PushL( validatedEntry ); + + iCalDbMgr.StoreEntryCondL( *validatedEntry, EFalse ); + + CleanupStack::PopAndDestroy( validatedEntry ); + + iEntry.UpdateEntryAfterStoringL(); + } + } + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrtodomarkasnotdonetask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/cmrtodomarkasnotdonetask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR calendar event task +* +*/ + +#include "cmrtodomarkasnotdonetask.h" +#include "cesmrcaldbmgr.h" +#include "mesmrcalentry.h" + +#include +#include + +#include "emailtrace.h" + +namespace { // codescanner::namespace + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsNotDoneTask::CESMRTodoMarkAsNotDoneTask +// --------------------------------------------------------------------------- +// +CESMRTodoMarkAsNotDoneTask::CESMRTodoMarkAsNotDoneTask( MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) +: iEntry( aEntry ), + iCalDbMgr( aCalDbMgr ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsNotDoneTask::~CESMRTodoMarkAsNotDoneTask +// --------------------------------------------------------------------------- +// +CESMRTodoMarkAsNotDoneTask::~CESMRTodoMarkAsNotDoneTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsNotDoneTask::NewL +// --------------------------------------------------------------------------- +// +CESMRTodoMarkAsNotDoneTask* CESMRTodoMarkAsNotDoneTask::NewL( + MESMRCalEntry& aEntry, + MESMRCalDbMgr& aCalDbMgr ) + { + FUNC_LOG; + CESMRTodoMarkAsNotDoneTask* self = + new (ELeave) CESMRTodoMarkAsNotDoneTask( aEntry, aCalDbMgr ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsNotDoneTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRTodoMarkAsNotDoneTask::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsNotDoneTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRTodoMarkAsNotDoneTask::ExecuteTaskL() + { + FUNC_LOG; + + // Mark to-do as not done + MarkTodoAsNotDoneL(); + } + +// --------------------------------------------------------------------------- +// CESMRTodoMarkAsNotDoneTask::MarkTodoAsNotDoneL +// --------------------------------------------------------------------------- +// +void CESMRTodoMarkAsNotDoneTask::MarkTodoAsNotDoneL() + { + FUNC_LOG; + + TTime now; + now.HomeTime(); + TCalTime caltime; + caltime.SetTimeLocalL( now ); + + // Set to-do as completed + TRAPD( err, iEntry.Entry().SetCompletedL( EFalse, caltime ) ); + + // Update entry time stamp before storing + iEntry.UpdateTimeStampL(); + + if( err == KErrNone ) + { + // Check storing result + MESMRUtilsTombsExt::TESMRUtilsDbResult res = + iCalDbMgr.StoreEntryCondL( iEntry.Entry(), EFalse, ETrue ); + + // Check that entry can be saved + if ( MESMRUtilsTombsExt::ECheckedValidNew == res || + MESMRUtilsTombsExt::ECheckedValidUpdate == res || + iEntry.IsEntryEditedL() ) + { + // Validate entry before storing it to calendar db + CCalEntry* validatedEntry = iEntry.ValidateEntryL(); + CleanupStack::PushL( validatedEntry ); + + iCalDbMgr.StoreEntryCondL( *validatedEntry, EFalse ); + + CleanupStack::PopAndDestroy( validatedEntry ); + + iEntry.UpdateEntryAfterStoringL(); + } + } + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrcaleventtaskplugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrcaleventtaskplugin/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Standard Symbian OS DLL entry point function. +* +*/ + + +// Internal includes +#include "cmrcaleventtaskplugin.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( KMRCalEventTaskPluginImplementationUID, + CMRCalEventTaskPlugin::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/data/esmrtasks.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/data/esmrtasks.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Resource definitions for project esmrtasks +* +*/ + + +NAME ESTA + +#include +// +#include +// + +RESOURCE RSS_SIGNATURE { } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_plain_text_update +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_plain_text_update + { + buf = qtn_meet_req_plain_text_update; + } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_plain_text_cancelled +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_plain_text_cancelled + { + buf = qtn_meet_req_plain_text_cancelled; + } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_plain_text_forwarded +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_plain_text_forwarded + { + buf = qtn_meet_req_plain_text_forwarded; + } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_plain_text_accepted +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_plain_text_accepted + { + buf = qtn_meet_req_plain_text_accepted; + } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_plain_text_tentative +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_plain_text_tentative + { + buf = qtn_meet_req_plain_text_tentative; + } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_plain_text_declined +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_plain_text_declined + { + buf = qtn_meet_req_plain_text_declined; + } + +// --------------------------------------------------------------------------- +// r_qtn_meet_req_viewer_subject_prefix_repl +// +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_qtn_meet_req_viewer_subject_prefix_repl + { + buf = qtn_meet_req_viewer_subject_prefix_repl; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/data/mrtaskplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/data/mrtaskplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ECom registration resource for MR Task Plugin +* +*/ + + + +#include +#include "esmrinternaluid.h" + + +// --------------------------------------------------------------------------- +// r_registry +// ECOM plugin registry info +// --------------------------------------------------------------------------- +// +RESOURCE REGISTRY_INFO r_registry + { + // Resource format version 2 for ROM-only plugins + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = KMRTaskPluginImplementationUID; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMRTaskInterfaceUID; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KMRTaskPluginImplementationUID; + version_no = 1; + display_name = + "MR Task Plugin";// codescanner::codereview + default_data = ""; + opaque_data = ""; + rom_only = 0; + } + }; + } + }; + } + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for project esmrtasks +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +mrtaskplugin.mmp + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/group/mrtaskplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/group/mrtaskplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project mrtaskplugin +* +*/ + + +#include "../../../inc/esmrinternaluid.h" +#include "../../../../inc/emailtraceconfig.hrh" +#include +#include + +TARGET mrtaskplugin.dll +TARGETTYPE PLUGIN +UID KEComRecognitionUID2 KMRTaskPluginImplementationUID + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +SOURCEPATH ../src +SOURCE cmrtaskplugin.cpp +SOURCE cesmrtaskbase.cpp +SOURCE cesmrstoremrtask.cpp +SOURCE cesmrdeletefromdbmrtask.cpp +SOURCE cesmrmailplaitextformatter.cpp +SOURCE cesmrsendmrfsmailreplytask.cpp +SOURCE cesmrforwardasfsmailtask.cpp +SOURCE cesmrfsemailmanager.cpp +SOURCE cesmrsendmrfsmailtask.cpp +SOURCE cesmrsendmrrespfsmailtask.cpp +SOURCE dllmain.cpp + +START RESOURCE ../data/mrtaskplugin.rss +TARGET mrtaskplugin.rsc +END + +START RESOURCE ../data/esmrtasks.rss +HEADER +TARGET esmrtasks +TARGETPATH RESOURCE_FILES_DIR +LANGUAGE_IDS +END + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /epoc32/include/ecom //TODO: Remove when Cmail headers are fixed + +LIBRARY esmrcommon.lib +LIBRARY esmrservices.lib +LIBRARY mrguicommon.lib +LIBRARY esmrgui.lib +LIBRARY esmrtasks.lib +LIBRARY esmrentry.lib + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY calinterimapi.lib +LIBRARY sendui.lib +LIBRARY etext.lib +LIBRARY cone.lib +LIBRARY efsrv.lib +LIBRARY commonengine.lib +LIBRARY charconv.lib +LIBRARY bafl.lib +LIBRARY fsmailframework.lib +LIBRARY fsfwcommonlib.lib +LIBRARY apgrfx.lib +LIBRARY apmime.lib +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +//End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrdeletefromdbmrtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrdeletefromdbmrtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR send mr response via mail task +* +*/ + + +#ifndef C_ESMRDELETEMRDROMDBTASK_H +#define C_ESMRDELETEMRDROMDBTASK_H + +#include "cesmrtaskbase.h" + +/** + * CESMRDeleteMRFromDbTask is responsibe for deleting MR from calendar DB. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRDeleteMRFromDbTask ) : public CESMRTaskBase + { +public: + /** + * Creates and initializes new CESMRDeleteMRFromDbTask object. + * Ownership is transferred to caller. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + */ + static CESMRDeleteMRFromDbTask* NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ); + + /** + * C++ destructor. + */ + ~CESMRDeleteMRFromDbTask(); + +public: // From MESMRTask + void ExecuteTaskL(); + +private: + CESMRDeleteMRFromDbTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ); + + void ConstructL(); + + void DeleteEntryFromDbL(); + }; + +#endif // C_ESMRDELETEMRDROMDBTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrforwardasfsmailtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrforwardasfsmailtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition for forwarding meeting request via FS EMail +* +*/ + + +#ifndef C_ESMRFORWARDMRFSEMAILTASK_H +#define C_ESMRFORWARDMRFSEMAILTASK_H + +// INCLUDES: +#include "cesmrtaskbase.h" + +// FORWARD DECLARATIONS: +class MESMRCalDbMgr; +class MESMRMeetingRequestEntry; +class CMRMailboxUtils; +class CESMRFSEMailManager; +class CESMRCalUserUtil; +class CCalEntry; + +/** + * Class definition for forwarding meeting request as attachment + * of email message via FS EMail. Class creates temporary file into + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRForwardAsFSMailTask ) : public CESMRTaskBase + { + +public: // Construction and destruction + /** + * Creates and initializes new CESMRCancelMRFSEmailTask object. + * Ownership is transferred to caller. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + */ + static CESMRForwardAsFSMailTask* NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ); + + /** + * C++ constructor. + */ + CESMRForwardAsFSMailTask(MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils); + + /** + * C++ Destructor. + */ + ~CESMRForwardAsFSMailTask(); + +public:// From MESMRTask + + void ExecuteTaskL(); + +private: + void ConstructL(); + void ConstructMailL(); + void CreateTemporaryMeetingFileL(); + TInt LaunchFSEmailEditorL(); + +private: // Data + /// Own: FS Email manager + CESMRFSEMailManager* iEmailMgr; + /// Own: Pointer to calendar entry to be sent + CCalEntry* iEntryToSend; + /// Own: Caluser utility object + CESMRCalUserUtil* iCaluserUtil; + }; + +#endif // C_ESMRFORWARDMRFSEMAILTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrfsemailmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrfsemailmanager.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,270 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class encapsulating FS email sending +* +*/ + + +#ifndef C_ESMRFSEMAILMANAGER_H +#define C_ESMRFSEMAILMANAGER_H + +#include +// +#include "CFSMailCommon.h" +#include "mmrinfoprocessor.h" +#include "esmrdef.h" +// + +class CFSMailBox; +class CFSMailMessage; +class CFSMailMessagePart; +class CFSMailClient; +class CMRMailboxUtils; +class TESMRInputParams; +class RFile; + +/** + * Class definition for FS Email manager class. This class encapsulates + * all mail sending acitivities with FS EMail framework. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRFSEMailManager ) : public CBase + { +public: + /** Enumeration for text/calendar part */ + enum TESMRMethod + { + EESMRMethodRequest, // Request + EESMRMethodResponse, // response + EESMRMethodCancel // cancellation + }; + +public: // Construction and destruction + /** + * Creates and initializes new CESMRSendMRRespFSEmailTask object. + * Ownership is transferred to caller. + * @param aMRMailboxUtils Reference to mailbox utilities + */ + static CESMRFSEMailManager* NewL( + CMRMailboxUtils& aMRMailboxUtils ); + + /** + * C++ destructor. + */ + ~CESMRFSEMailManager(); + + /** + * Prepares email manager to be used for sending meeting + * request. + * + * @param aMailboxOwnerAddr mailbox owner's email address + */ + void PrepareForSendingL( + const TDesC& aMailboxOwnerAddr ); + + /** + * Prepares email manager to be used for sending reply + * message. + * + * @param aMailboxOwnerAddr mailbox owner's email address + * @param aMsgId original message's id + * @param aReplyAll is this reply for all participants + */ + void PrepareForSendingReplyL( + const TDesC& aMailboxOwnerAddr, + const TFSMailMsgId& aMsgId, + TBool aReplyAll ); + + /** + * Sets sender to email message + * @param aAddress Sender's email address + * @param aCommonName Sender's common name + */ + void SetSenderL( + const TDesC& aAddress, + const TDesC& aCommonName ); + + /** + * Sets reply to address to email message + * @param aAddress Email address + * @param aCommonName Common name + */ + void SetReplyToAddressL( + const TDesC& aAddress, + const TDesC& aCommonName ); + + /** + * Sets recipient to field + * @param aAddress Recipient's email address + * @param aCommonName Recipient's common name + */ + void AppendToRecipientL( + const TDesC& aAddress, + const TDesC& aCommonName ); + + /** + * Sets recipient to field + * @param aAddress Recipient's email address + * @param aCommonName Recipient's common name + */ + void AppendCCRecipientL( + const TDesC& aAddress, + const TDesC& aCommonName ); + + /** + * Sets subject to email message + * @param aSubject Email message's subject. + */ + void SetSubjectL( + const TDesC& aSubject); + + /** + * Sets plain text part to email message. + * @param aPlainText Plain text context + */ + void CreateTextPlainPartL( + const TDesC& aPlainText); + + /** + * Sets calendar part to email message. + * @param aCalendarMethod Calendar entry method. + */ + void CreateTextCalendarPartL( + TESMRMethod aCalendarMethod ); + + /** + * Sets calendar part to email message. + * @param aCalendarMethod Calendar entry method. + * @param aFilename File containing calendar part + */ + void CreateTextCalendarPartL( + TESMRMethod aCalendarMethod, + const TDesC& aFilename ); + + /** + * Adds attachment to email message. + * @param aAttachmentFile attachment filename. + */ + void SetAttachmentL( + const TDesC& aAttachmentFile ); + + /** + * Adds attachment to email message. + * @param aFile Reference to attachment file + * @param aMimeType attachment mimetype + */ + void SetAttachmentL( + RFile& aFile, + const TDesC8& aMimeType ); + + /** + * Stores message to drafts folder. + */ + TInt StoreMessageToDraftsFolderL(); + + /** + * Sends message. + */ + TInt SendMessageL(); + + /** + * Fetches mailbox id. + * @return Mailbox id + */ + TFSMailMsgId MailboxId() const; + + /** + * Send MRINFO object via mail framework + * @param aParam Reference to ESMR input parameters + * @param aInfoObject Reference to MRINFO object + * @param aResponseMode Response mode definition. + * @param aFreeResponseText Free response text + */ + void SendMailViaSyncL( + TESMRInputParams& aParams, + MMRInfoObject& aInfoObject, + MMRInfoProcessor::TMRInfoResponseMode aResponseMode, + const TDesC& aFreeResponseText ); + + /** + * Fetches message id. + * @return Message id + */ + TFSMailMsgId MessageId() const; + + /** + * Fetches message folder id. + * @return Message folder id + */ + TFSMailMsgId MessageFolderId() const; + +private: + CESMRFSEMailManager( + CMRMailboxUtils& aMRMailboxUtils ); + + void ConstructL(); + + CFSMailBox* SelectMailBoxL( + const TDesC& aMailboxOwnerAddr ); + + CFSMailMessage* CreateMessageL(); + + + + CFSMailMessagePart* CreateParentPartL(); + + void AddPlainTextPartL( + const TDesC& aContent ); + + void AddMessagePartFromFileL( + const TDesC& aContentType, + const TDesC& aContentClass, + const TDesC& aContentDescription, + const TDesC& aContentDisposition, + const TDesC& aFileAndPath ); + +private: // Data + /** + * Reference to mailbox utilites + * Not own. + */ + CMRMailboxUtils& iMRMailboxUtils; + + /** + * FS EMail client + * Own. + */ + CFSMailClient* iMailClient; + + /** + * FS EMailBox + * Own. + */ + CFSMailBox* iMailBox; + + /** + * FS Mail message + * Own. + */ + CFSMailMessage* iMessage; + + /** + * Parent message part + * Own. + */ + CFSMailMessagePart* iParentPart; + }; + +#endif // C_ESMRFSEMAILMANAGER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrmailplaitextformatter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrmailplaitextformatter.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,155 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Plain text formatter for ES MR entries +* +*/ + + +#ifndef C_ESMRMAILPLAINTEXTFORMATTER_H +#define C_ESMRMAILPLAINTEXTFORMATTER_H + +#include + +class CCalEntry; +class CMRMailboxUtils; + +/** + * CESMRMailPlainTextFormatter is responsible for constructing + * plain text part for meeting request email messages. + * + * CESMRMailPlainTextFormatter is ised internally by esmrtasks + * module. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS(CESMRMailPlainTextFormatter) : public CBase + { +public: // Construction and destruction + + /** + * Creates and initialzes new CESMRMailPlainTextFormatter object. + * Ownership is transferred to caller. + * @param aMailboxUtils Reference to MR mailbox utilities. + * @return Pointer to CESMRMailPlainTextFormatter object. + */ + static CESMRMailPlainTextFormatter* NewL( + CMRMailboxUtils& aMailboxUtils ); + + /** + * Creates and initialzes new CESMRMailPlainTextFormatter object. + * Ownership is transferred to caller. Created object is left to + * cleanup stack. + * @param aMailboxUtils Reference to MR mailbox utilities. + * @return Pointer to CESMRMailPlainTextFormatter object. + */ + static CESMRMailPlainTextFormatter* NewLC( + CMRMailboxUtils& aMailboxUtils ); + + /** + * C++ destructor + */ + ~CESMRMailPlainTextFormatter(); + + /** + * Formats plain text part body from ES calendar entry. Ownership of the + * created descriptor is transferred to caller. Created object is also + * left to cleanup stack. + * @param aEntry Reference to calendar entry. + * @return Plain text buffer. + */ + HBufC* Body16LC( + CCalEntry& aEntry ); + + /** + * Formats plain text body part from ES calendar entry. Ownership of the + * created descriptor is transferred to caller. Created object is also + * left to cleanup stack. + * @param aEntry Reference to calendar entry. + * @return Plain text buffer. + */ + HBufC8* Body8LC( + CCalEntry& aEntry ); + + /** + * Formats the subject line for meeting request email.O wnership of the + * created descriptor is transferred to caller. Created object is also + * left to cleanup stack. + * @param aEntry Reference to calendar entry. + * @param aIsForwarded ETrue if entry is forwarded + * @param aIsUpdate ETrue if entry is update to existing entry + * @return Subject line buffer. + */ + HBufC* Subject16LC( + CCalEntry& aEntry, + TBool aIsForwarded, + TBool aIsUpdate ); + + /** + * Formats the subject line for meeting request email.O wnership of the + * created descriptor is transferred to caller. Created object is also + * left to cleanup stack. + * @param aEntry Reference to calendar entry. + * @param aIsForwarded ETrue if entry is forwarded + * @param aIsUpdate ETrue if entry is update to existing entry + * @return Subject line buffer. + */ + HBufC8* Subject8LC( + CCalEntry& aEntry, + TBool aIsForwarded, + TBool aIsUpdate ); + + /** + * Fetches the localized updated string for entry + * @rerurn Localized updated string + */ + HBufC* UpdatedStringLC(); + + /** + * Fetches the localized canceled string for entry + * @rerurn Localized updated string + */ + HBufC* CanceledStringLC(); + + /** + * Fetches the localized Reply string for entry + * @param aEntry Reference to entry + * @rerurn Localized reply string + */ + HBufC* ReplyStringLC( CCalEntry& aEntry ); + +private: // Implementation + + CESMRMailPlainTextFormatter( + CMRMailboxUtils& aMailboxUtils ); + void ConstructL(); + + HBufC* SubjectLinePrefix16LC( + CCalEntry& aEntry, + TBool aIsForwarded, + TBool aIsSToredToDB ); + +private: // data + /** + * Reference to MR mailbox utilities. + * Not own. + */ + CMRMailboxUtils& iMailboxUtils; + + /** + * Resource file offset + */ + TInt iResourceOffset; + }; + +#endif // C_ESMRMAILPLAINTEXTFORMATTER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrmeetingrequestsender.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrmeetingrequestsender.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR meeting request sender +* +*/ + + +#ifndef C_ESMRPOLICYCHECKER_H +#define C_ESMRPOLICYCHECKER_H + +#include +#include "mesmrmeetingrequestsender.h" + +class CMRMailboxUtils; + +/** + * Implements interface for constructing and sending meeting requests + * over email. + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS(CESMRMeetingRequestSender) : + public CBase, + public MESMRMeetingRequestSender + { +public: // Construction and destruction + + /** + * Two-phased constructor. Creates and initializes + * CESMRMeetingRequestSender object. + * @return Pointer to esmr policy checker object. + */ + IMPORT_C static CESMRMeetingRequestSender* NewL( + CMRMailboxUtils& aMailboxUtils ); + + /** + * Destructor. + */ + IMPORT_C ~CESMRMeetingRequestSender(); + +public:// From MESMRMeetingRequestSender + + void CreateAndSendMeetingRequestL( MESMRMeetingRequestEntry& aEntry ); + + void CreateAndSendMeetingRequestL( MESMRMeetingRequestEntry& aEntry, + const TDesC& aFreePlainText ); + +private: + CESMRMeetingRequestSender( CMRMailboxUtils& aMailboxUtils ); + + void ConstructL(); + +private: + /** + * Mailbox utilities + * Not Own. + */ + CMRMailboxUtils& iMailboxUtils; + }; + +#endif // C_ESMRPOLICYCHECKER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrfsmailreplytask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrfsmailreplytask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition for sending meeting request via FS EMail +* +*/ + + +#ifndef C_ESMRSENDMRFSMAILREPLYTASK_H +#define C_ESMRSENDMRFSMAILREPLYTASK_H + +#include "cesmrtaskbase.h" + +//Forward declarations +class MESMRCalDbMgr; +class MESMRMeetingRequestEntry; +class CMRMailboxUtils; +class CESMRFSEMailManager; +class CESMRCalUserUtil; +class CCalEntry; + +/** + * Class definition for sending meeting request via FS EMail. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRSendMRFSMailReplyTask ) : + public CESMRTaskBase + { +public: // Construction and destruction + + /** + * Creates and initializes new CESMRCancelMRFSEmailTask object. + * Ownership is transferred to caller. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + */ + static CESMRSendMRFSMailReplyTask* NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TBool aReplyAll); + + /** + * C++ destructor. + */ + ~CESMRSendMRFSMailReplyTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRSendMRFSMailReplyTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TBool aReplyAll); + + void ConstructL(); + void ConstructMailL(); + void AddAttendeesL(); + HBufC* ResolveUsedMailboxUserAddressLC(); + TInt LaunchFSEmailEditorL(TBool aReplAll); + +private: // Data + /// Own: FS email manager + CESMRFSEMailManager* iEmailMgr; + /// Own: Pointer to calendar entry to be sent + CCalEntry* iEntryToSend; + /// Own: Caluser utility object + CESMRCalUserUtil* iCaluserUtil; + + TBool iReplyAll; + }; + +#endif // C_ESMRSENDMRFSMAILREPLYTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrfsmailtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrfsmailtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition for sending meeting request via FS EMail +* +*/ + + +#ifndef C_ESMRSENDMRFFSEMAILTASK_H +#define C_ESMRSENDMRFFSEMAILTASK_H + +#include "cesmrtaskbase.h" +// +#include "esmrcommands.h" +// + +class CCalEntry; +class MESMRCalDbMgr; +class MESMRMeetingRequestEntry; +class CMRMailboxUtils; +class CESMRFSEMailManager; +class CESMRCalUserUtil; +class CCalAttendee; + +/** + * Class definition for sending meeting request via FS EMail. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRSendMRFSMailTask ) : + public CESMRTaskBase + { +public: // Construction and destruction + + /** + * Creates and initializes new CESMRCancelMRFSEmailTask object. + * Ownership is transferred to caller. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + * @param aCommand Command to be executed + */ + static CESMRSendMRFSMailTask* NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRCommand aCommand ); + + /** + * C++ destructor. + */ + ~CESMRSendMRFSMailTask(); + +public: // From MESMRTask + void ExecuteTaskL(); + +private: // Definitios + /** Enumeration for update sending type */ + enum TESMRSendType + { + // MR is sent to all + ESendToAll, + // MR is sent to added and removed + ESentToAddedAndRemoved + }; + +private: // Implementation + CESMRSendMRFSMailTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRCommand aCommand ); + void ConstructL(); + + void ConstructMailL(); + void AddAttendeesL(); + TInt SaveICalToFileL( + const TDesC& aICal, + const TDesC& aFilename ); + HBufC* ResolveUsedMailboxUserAddressLC(); + void ResolveSendTypeL(); + TBool NeedToSendInvitationL(); + TBool NeedToSendCancellationL(); + void SetCorrectAttendeesToEntryL(); + void GetAttendeesToBeSentL( + RArray& aRequiredAttendees, + RArray& aOptionalAttendees ); + void GetEntriesToBeSentL(); + void AddAttachmentsL(); + +private: // Data + /// Own: FS email manager + CESMRFSEMailManager* iEmailMgr; + /// Ref: Pointer to calendar entry to be sent + CCalEntry* iEntryToSend; + /// Own: Pointer to calendar entries to be sent + RPointerArray iEntriesToSend; + /// Own: Caluser utility object + CESMRCalUserUtil* iCaluserUtil; + /// Own: Send type definition + TESMRSendType iSendType; + /// Own: Command to be executed + TESMRCommand iCommand; + }; + +#endif // C_ESMRSENDMRFFSEMAILTASK_H + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrrespfsmailtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrrespfsmailtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition for sending meeting request via FS EMail +* +*/ + +#ifndef C_ESMRSENDMRRESPFSEMAILTASK_H +#define C_ESMRSENDMRRESPFSEMAILTASK_H + +// +#include "esmrdef.h" +// +#include "cesmrtaskbase.h" + +class MESMRCalDbMgr; +class MESMRMeetingRequestEntry; +class CMRMailboxUtils; +class CCalEntry; +class CESMRFSEMailManager; +class CESMRMailPlainTextFormatter; +class CESMRCalUserUtil; + +/** + * Class definition for sending meeting request via FS EMail. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRSendMRRespFSMailTask ) : public CESMRTaskBase + { +public: // Construction and destruction + /** + * Creates and initializes new CESMRSendMRRespFSMailTask object. + * Ownership is transferred to caller. + * + * @param aCommand Response command. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR meeting request calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + * @param aResponseType Response type + * @param aResponseMessage Pointer to response message buffer. + */ + static CESMRSendMRRespFSMailTask* NewL( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType, + const TDesC& aResponseMessage ); + + /** + * C++ destructor. + */ + ~CESMRSendMRRespFSMailTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRSendMRRespFSMailTask( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType ); + + void ConstructL( const TDesC& aResponseMessage ); + void ConstructMailL(); + void AddPlainTextPartL(); + void AddCalendarPartL(); + void SendMailViaSyncL(); + TInt SaveICalToFileL( const TDesC& aICal, const TDesC& aFilename ); + void SetAttendeesL(); + +private: // Data + /** + * Response command + */ + TESMRCommand iCommand; + + /** + * FS Email manager + * Own. + */ + CESMRFSEMailManager* iEmailMgr; + + /** + * Plain text formatter + * Own. + */ + CESMRMailPlainTextFormatter* iTextFormatter; + + /** + * Response type + */ + TESMRResponseType iResponseType; + /** + * Response message + * Own. + */ + HBufC* iResponseMessage; + + /** + * Pointer to calendar entry to be sent + * Own. + */ + CCalEntry* iEntryToSend; + + /** + * Caluser utility object + * Own. + */ + CESMRCalUserUtil* iCaluserUtil; + }; + +#endif // C_ESMRSENDMRRESPFSEMAILTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrrespmailtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrsendmrrespmailtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR send mr response via mail task +* +*/ + + +#ifndef C_ESMRSENDMRRESPMAILTASK_H +#define C_ESMRSENDMRRESPMAILTASK_H + +// +#include "esmrdef.h" +// +#include "cesmrtaskbase.h" + +class CCalEntry; + +/** + * Implementation for sending meeting request response over MTM based + * mail box. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRSendMRRespMailTask ) : public CESMRTaskBase + { +public: // Construction and destruction + + /** + * Creates and initializes new CESMRSendMRRespMailTask object. + * Ownership is transferred to caller. + * @param aCommand Response command. + * @param aResponseType Response message type. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + */ + static CESMRSendMRRespMailTask* NewL( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType, + const TDesC& aResponseMessage ); + + /** + * C++ destructor. + */ + ~CESMRSendMRRespMailTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRSendMRRespMailTask( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType ); + + void ConstructL( + const TDesC& aResponseMessage ); + + void SendResponseMessageL(); + +private: // Data + /** + * Response command + */ + TESMRCommand iCommand; + + /** + * Response message type + */ + TESMRResponseType iResponseType; + + /** + * Response message text + * Own. + */ + HBufC* iResponseMessage; + + /** + * Response entry + * Own. + */ + CCalEntry* iResponseEntry; + }; + +#endif // C_ESMRSENDMRRESPMAILTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrstoremrtask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrstoremrtask.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR send mr response via mail task +* +*/ + + +#ifndef C_ESMRSTOREMRTASK_H +#define C_ESMRSTOREMRTASK_H + +#include "cesmrtaskbase.h" + +/** + * CESMRStoreMRTask is responsibe for storing MR to calendar DB. + * + * @lib esmrtasks.lib + */ +NONSHARABLE_CLASS( CESMRStoreMRTask ) : public CESMRTaskBase + { +public: + /** + * Creates and initializes new CESMRStoreMRTask object. + * Ownership is transferred to caller. + * @param aCalDbMgr Reference to cal db manager. + * @param aEntry Reference to ES MR calendar entry. + * @param aMRMailboxUtils Reference mr mailbox utilities. + */ + static CESMRStoreMRTask* NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ); + + /** + * C++ destructor. + */ + ~CESMRStoreMRTask(); + +public:// From MESMRTask + void ExecuteTaskL(); + +private: + CESMRStoreMRTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ); + + void ConstructL(); + void StoreEntryToDbL(); + }; + +#endif // C_ESMRSTOREMRTASK_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrtaskbase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrtaskbase.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,105 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for ESMR task factory implementation +* +*/ + + +#ifndef C_ESMRTASKBASE_H +#define C_ESMRTASKBASE_H + +#include +#include "mesmrtask.h" + +class MESMRCalDbMgr; +class MESMRMeetingRequestEntry; +class CMRMailboxUtils; + +/** + * CESMRTaskBase is base class for ES MR tasks + * + * @lib esmrtasks.lib + */ +class CESMRTaskBase : public CBase, + public MESMRTask + { +public: + + /** + * C++ destructor. + */ + virtual ~CESMRTaskBase(); + +protected:// Implementation + + /** + * C++ constructor + * @param aCalDbMgr Reference to cal db manager. + */ + CESMRTaskBase( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ); + + /** + * Stores entry to calendar DB + */ + void StoreEntryToDbL(); + + /** + * Base class's EPOC 2nd phase constructor. + */ + void BaseConstructL(); + + /** + * Fetches reference to cal db manager. + * @return Reference to cal db manager. + */ + inline MESMRCalDbMgr& CalDbMgr(); + + /** + * Fetches reference to es mr calendar entry. + * @return Reference to es mr calendar entry. + */ + inline MESMRMeetingRequestEntry& ESMREntry(); + + /** + * Fetches the reference to mr mailbox utilities. + * @return reference to mr mailbox utilities. + */ + inline CMRMailboxUtils& MailboxUtils(); + +private: // Data + + /** + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + + /** + * Reference to ES MR calendar entry + * Not Own. + */ + MESMRMeetingRequestEntry& iEntry; + /** + * Reference to mr mailbox utilities + * Not own. + */ + CMRMailboxUtils& iMRMailboxUtils; + }; + +#include "cesmrtaskbase.inl" + +#endif // C_ESMRTASKBASE_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cesmrtaskbase.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cesmrtaskbase.inl Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Inline implementation for esmr base tasks +* +*/ + + +// --------------------------------------------------------------------------- +// CESMRTaskBase::CalDbMgr +// --------------------------------------------------------------------------- +// +inline MESMRCalDbMgr& CESMRTaskBase::CalDbMgr() + { + return iCalDbMgr; + } + +// --------------------------------------------------------------------------- +// CESMRTaskBase::ESMREntry +// --------------------------------------------------------------------------- +// +inline MESMRMeetingRequestEntry& CESMRTaskBase::ESMREntry() + { + return iEntry; + } + +// --------------------------------------------------------------------------- +// CESMRTaskBase::MailboxUtils +// --------------------------------------------------------------------------- +// +inline CMRMailboxUtils& CESMRTaskBase::MailboxUtils() + { + return iMRMailboxUtils; + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/inc/cmrtaskplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/inc/cmrtaskplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface definition for Meeting request task factory implementation +* +*/ + + +#ifndef CMRRTASKPLUGIN_H +#define CMRRTASKPLUGIN_H + +#include +#include "cesmrtaskfactory.h" + +class MESMRCalDbMgr; +class MESMRMeetingRequestEntry; + +/** + * CESMRTaskFactory implements interface for creating ES MR tasks. + * @see MESMRTaskFactory + * + * @lib esmrtaskplugin.lib + */ +NONSHARABLE_CLASS(CMRTaskPlugin) : public CESMRTaskFactory + { +public: // Construction and destruction + /** + * Creates and initialzes new MR task factory. + * @param aCalDbMgr Pointer to cal db manager. + */ + static CMRTaskPlugin* NewL( TAny* aCalDbMgr ); + + /** + * C++ destructor. + */ + ~CMRTaskPlugin(); + +public: // From MESMRTaskFactory + MESMRTask* CreateTaskL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ); + +private: // Implementation + CMRTaskPlugin( MESMRCalDbMgr& aCalDbMgr ); + MESMRTask* CreateSendMRResponseViaMailTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateSendMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateDeleteMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateStoreMRToLocalDBTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateForwardAsMeetingTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateForwardAsMailTaskL( + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateOrganizerDeleteMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateAttendeeDeleteMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ); + MESMRTask* CreateReplyAsMailTaskL( + MESMRMeetingRequestEntry& aEntry, + TBool aReplyAll); + MESMRTask* CreateMoveMRToCurrentDBTaskL( + MESMRMeetingRequestEntry& aEntry ); + +private: // Data + /* + * Reference to cal db manager + * Not own. + */ + MESMRCalDbMgr& iCalDbMgr; + + }; + +#endif // C_ESMRTASKFACTORY_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrdeletefromdbmrtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrdeletefromdbmrtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR base task +* +*/ + +#include "emailtrace.h" +#include "cesmrdeletefromdbmrtask.h" + +#include +#include +#include +// +#include "mesmrutilstombsext.h" +// +#include "cesmrcaldbmgr.h" +#include "mesmrmeetingrequestentry.h" +#include "esmrentryhelper.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRDeleteMRFromDbTask::CESMRDeleteMRFromDbTask +// --------------------------------------------------------------------------- +// +CESMRDeleteMRFromDbTask::CESMRDeleteMRFromDbTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRDeleteMRFromDbTask::~CESMRDeleteMRFromDbTask +// --------------------------------------------------------------------------- +// +CESMRDeleteMRFromDbTask::~CESMRDeleteMRFromDbTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRDeleteMRFromDbTask::NewL +// --------------------------------------------------------------------------- +// +CESMRDeleteMRFromDbTask* CESMRDeleteMRFromDbTask::NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) + { + FUNC_LOG; + CESMRDeleteMRFromDbTask* self = + new (ELeave) CESMRDeleteMRFromDbTask( + aCalDbMgr, + aEntry, + aMRMailboxUtils ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRDeleteMRFromDbTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRDeleteMRFromDbTask::ConstructL() + { + FUNC_LOG; + BaseConstructL(); + } + +// --------------------------------------------------------------------------- +// CESMRDeleteMRFromDbTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRDeleteMRFromDbTask::ExecuteTaskL() + { + FUNC_LOG; + // Store to calendar DB + DeleteEntryFromDbL(); + } + +// --------------------------------------------------------------------------- +// CESMRDeleteMRFromDbTask::DeleteEntryFromDbL +// --------------------------------------------------------------------------- +// +void CESMRDeleteMRFromDbTask::DeleteEntryFromDbL() + { + FUNC_LOG; + + MESMRCalDbMgr& calDb = CalDbMgr(); + MESMRMeetingRequestEntry& mrEntry = ESMREntry(); + CCalEntry& entry = mrEntry.Entry(); + + if ( mrEntry.IsSyncObjectPresent() ) + { + } + else + { + CCalEntry* entryToDeleted = NULL; + + + if ( mrEntry.IsRecurrentEventL() && + (MESMRCalEntry::EESMRThisOnly == mrEntry.RecurrenceModRule()) && + mrEntry.IsOpenedFromMail() ) + { + entryToDeleted = mrEntry.RemoveInstanceFromSeriesL(); + CleanupStack::PushL( entryToDeleted ); + calDb.StoreEntryL( *entryToDeleted, ETrue ); + + } + else + { + entryToDeleted = mrEntry.ValidateEntryL(); + CleanupStack::PushL( entryToDeleted ); + // + TRAPD(err, calDb.DeleteEntryCondL( *entryToDeleted ) ); + if ( err == KErrNotFound ) + { + // If meeting request to be deleted is not found from the calendar + // Do not care about error. This is just for avoiding leave + } + // + } + + CleanupStack::PopAndDestroy( entryToDeleted ); + entryToDeleted = NULL; + } + + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrforwardasfsmailtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrforwardasfsmailtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for forwarding mr as email +* +*/ + +#include "emailtrace.h" +#include "cesmrforwardasfsmailtask.h" + +#include +#include +#include +#include +#include +#include +// +#include "FreestyleEmailUiConstants.h" +// +#include "tesmrinputparams.h" + +#include "cesmrcaldbmgr.h" +#include "mesmrmeetingrequestentry.h" +#include "cesmrmailplaitextformatter.h" +#include "cesmrcalimportexporter.h" +#include "cesmrfsemailmanager.h" +#include "cesmrcaluserutil.h" +#include "esmrinternaluid.h" +#include "esmrhelper.h" + +// Unnamed namespace for local definitions +namespace { + +// remove hardcoded paths +// Literal for temporary iCal meeting path +//_LIT( KTemporaryIcsPath, "c:\\temp\\" ); //codescanner::driveletters +// + +// Literal for temporary iCal meeting file +// remove hardcoded paths +//_LIT( KTemporaryIcsFullName, +// "c:\\temp\\meeting.ics" ); //codescanner::driveletters +_LIT( KTemporaryIcsName, "temp\\meeting.ics" ); +// + +#ifdef _DEBUG + +// Literal for panics +_LIT( KESMRForwardAsFSMail, "ESMRForwardAsFSMail" ); + +// Panic codes +enum TESMRForwardAsFSMailPanic + { + EESMRForwardAsFSMailCoeNull, + EESMRForwardAsFSMailAppUiNull, + EESMRForwardCannotBeTriggeredFromMail + }; + +// --------------------------------------------------------------------------- +// Raises system panic. +// --------------------------------------------------------------------------- +// +void Panic( TESMRForwardAsFSMailPanic aPanic ) + { + User::Panic( KESMRForwardAsFSMail, aPanic ); + } + +#endif // _DEBUG + +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRForwardAsFSMailTask::CESMRForwardAsFSMailTask +// --------------------------------------------------------------------------- +// +CESMRForwardAsFSMailTask::CESMRForwardAsFSMailTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRForwardAsFSMailTask::~CESMRForwardAsFSMailTask +// --------------------------------------------------------------------------- +// +CESMRForwardAsFSMailTask::~CESMRForwardAsFSMailTask() + { + FUNC_LOG; + delete iEntryToSend; + delete iCaluserUtil; + delete iEmailMgr; + } + +// --------------------------------------------------------------------------- +// CESMRForwardAsFSMailTask::NewL +// --------------------------------------------------------------------------- +// +CESMRForwardAsFSMailTask* CESMRForwardAsFSMailTask::NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) + { + FUNC_LOG; + CESMRForwardAsFSMailTask* self = + new (ELeave) CESMRForwardAsFSMailTask( + aCalDbMgr, + aEntry, + aMRMailboxUtils ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRForwardAsFSMailTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRForwardAsFSMailTask::ConstructL() + { + FUNC_LOG; + BaseConstructL(); + iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); + } + +// --------------------------------------------------------------------------- +// CESMRForwardAsFSMailTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRForwardAsFSMailTask::ExecuteTaskL() + { + FUNC_LOG; + iEntryToSend = ESMREntry().ValidateEntryL(); + iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); + + TESMRInputParams startupparams; + TBool isEmail = ESMREntry().StartupParameters(startupparams); + + // This command cannot be triggered from email + __ASSERT_DEBUG( !isEmail, Panic(EESMRForwardCannotBeTriggeredFromMail) ); + + if(isEmail) + { + // This command cannot be triggered from email + User::Leave( KErrNotSupported ); + } + + // Create mail message: + ConstructMailL(); + + // Save the message to drafts folder: + iEmailMgr->StoreMessageToDraftsFolderL(); + + // Launch FS EMail Editor: + LaunchFSEmailEditorL(); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::ConstructMailL +// --------------------------------------------------------------------------- +// +void CESMRForwardAsFSMailTask::ConstructMailL() + { + FUNC_LOG; + // create text formatter: + CESMRMailPlainTextFormatter* textFormatter = + CESMRMailPlainTextFormatter::NewLC(MailboxUtils()); + + // Prepare email manager for sending + CCalUser *mailboxUser = iEntryToSend->PhoneOwnerL(); + iEmailMgr->PrepareForSendingL( + ESMRHelper::AddressWithoutMailtoPrefix(mailboxUser->Address() ) ); + + // set the email subject: + HBufC* subject = + textFormatter->Subject16LC( + *iEntryToSend, + ETrue, + EFalse ); + iEmailMgr->SetSubjectL(*subject); + CleanupStack::PopAndDestroy(subject); + subject = NULL; + + iEmailMgr->CreateTextPlainPartL( KNullDesC() ); + + CreateTemporaryMeetingFileL(); + iEmailMgr->StoreMessageToDraftsFolderL(); + + CleanupStack::PopAndDestroy( textFormatter ); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::CreateTemporaryMeetingFileL +// --------------------------------------------------------------------------- +// +void CESMRForwardAsFSMailTask::CreateTemporaryMeetingFileL() + { + FUNC_LOG; + CCoeEnv* coe = CCoeEnv::Static(); + + __ASSERT_DEBUG( coe, Panic(EESMRForwardAsFSMailCoeNull) ); + + if ( !coe ) + { + User::Leave( KErrNotSupported ); + } + + RFs& fs = coe->FsSession(); + + // Ensure that path exists + // hardcoded paths removal + /*TInt err = fs.MkDirAll( KTemporaryIcsPath ); + if ( KErrAlreadyExists != err ) + { + User::LeaveIfError( err ); + }*/ + // + + RFile calendarFile; + //hard coded paths removal + TFileName fileName(KTemporaryIcsName); + User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); + TInt err = calendarFile.Replace( + fs, + fileName, + EFileWrite ); + // + if ( KErrNone != err ) + User::LeaveIfError( err ); + + CleanupClosePushL( calendarFile ); + + CESMRCalImportExporter* calExporter = CESMRCalImportExporter::NewLC(); + HBufC8* calendarText = calExporter->ExportToICal8LC( *iEntryToSend ); + + calendarFile.Write( *calendarText ); + calendarFile.Flush(); + + // calendarText, calExporter and calendarFile + CleanupStack::PopAndDestroy( 3, & calendarFile); + iEmailMgr->SetAttachmentL( fileName );// + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::LaunchFSEmailEditorL +// --------------------------------------------------------------------------- +// +TInt CESMRForwardAsFSMailTask::LaunchFSEmailEditorL() + { + FUNC_LOG; + CCoeEnv* coe = CCoeEnv::Static(); + __ASSERT_DEBUG( coe, Panic(EESMRForwardAsFSMailCoeNull) ); + + CCoeAppUi* appui = coe->AppUi(); + __ASSERT_DEBUG( appui, Panic(EESMRForwardAsFSMailAppUiNull) ); + + // fill params + TEditorLaunchParams params; + params.iActivatedExternally = ETrue; + params.iMailboxId = iEmailMgr->MailboxId(); + params.iFolderId = iEmailMgr->MessageFolderId(); + params.iMsgId = iEmailMgr->MessageId(); + + TVwsViewId viewId( + KFSEmailUiUid, + MailEditorId ); + TUid editorCommand = TUid::Uid( KEditorCmdOpen ); + TPckgC buf( params ); + + appui->ActivateViewL( + viewId, + editorCommand, + buf ); + + return KErrNone; + } + +//EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrfsemailmanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrfsemailmanager.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,776 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR Email Manager +* +*/ + +#include "emailtrace.h" +#include "cesmrfsemailmanager.h" + +#include +#include +#include +// +#include "CFSMailClient.h" +#include "CFSMailBox.h" +#include "CFSMailMessage.h" +#include "CFSMailMessagePart.h" +#include "mmrinfoprocessor.h" +#include "CFSMailCommon.h" +#include "CFSMailPlugin.h" +// +#include +#include "tesmrinputparams.h" +#include "esmrconfig.hrh" +#include "esmrhelper.h" +#include "esmrinternaluid.h" + +// Unnamed namespace for local definitions +namespace { + +// Definition for mime types +_LIT(KMimeTextCalRequest, "text/calendar; method=REQUEST; name=\"meeting.ics\""); +_LIT(KMimeTextCalResponse, "text/calendar; method=RESPONSE; name=\"response.ics\""); +_LIT(KMimeTextCalCancel, "text/calendar; method=CANCEL; name=\"cancel.ics\""); +_LIT(KMimeTextCalContentClass, "urn:content-classes:calendarmessage" ); + +// Definition for temporary calendar file +// hardcoded paths removal +//_LIT(KFileAndPath, "c:\\temp\\temp.ics"); //codescanner::driveletters +_LIT(KTempFileName, "temp\\temp.ics"); +// + +// Definition for email address comparison +const TInt KEqualEmailAddress(0); + +// Definition for first index +const TInt KFirstIndex(0); + +/** + * Cleanup operations for RPointerArray. + * + * @param aArray Pointer to RPointerArray. + */ +void MessagePartPointerArrayCleanup( TAny* aArray ) + { + RPointerArray* messagePartArray = + static_cast*>( aArray ); + + messagePartArray->ResetAndDestroy(); + messagePartArray->Close(); + } + +#ifdef _DEBUG + +// Definition for panic text +_LIT( KEMailManagerPanicTxt, "EMailManager" ); + +/** Enumeration for email manager panic codes */ +enum TESMREMailManagerPanic + { + EESMRMailboxNotFound = 0, + EESMRMailClientNotExist, + EESMRMessageNotExist, + EESMRInvalidCalMethod + }; + +// --------------------------------------------------------------------------- +// Panic wrapper method +// --------------------------------------------------------------------------- +// +void Panic( TESMREMailManagerPanic aPanic ) + { + + User::Panic( KEMailManagerPanicTxt, aPanic ); + } + +#endif // _DEBUG + +// --------------------------------------------------------------------------- +// Leave wrapper method +// --------------------------------------------------------------------------- +// +inline void DoLeaveIfErrorL( TInt aLeaveCode ) + { + if ( KErrNone != aLeaveCode ) + { + + User::Leave( aLeaveCode ); + } + } + +// --------------------------------------------------------------------------- +// Cleanup operation for RPointerArray. +// @param aArray Pointer to RPointerArray. +// --------------------------------------------------------------------------- +// +void MailboxPointerArrayCleanup( TAny* aArray ) + { + RPointerArray* entryArray = + static_cast*>( aArray ); + + entryArray->ResetAndDestroy(); + entryArray->Close(); + } +} // namespace + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::CESMRFSEMailManager +// --------------------------------------------------------------------------- +// +inline CESMRFSEMailManager::CESMRFSEMailManager( + CMRMailboxUtils& aMRMailboxUtils ) +: iMRMailboxUtils( aMRMailboxUtils ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::§CESMRFSEMailManager +// --------------------------------------------------------------------------- +// +CESMRFSEMailManager::~CESMRFSEMailManager() + { + FUNC_LOG; + + delete iParentPart; + delete iMessage; + delete iMailBox; + + if ( iMailClient ) + { + iMailClient->Close(); + iMailClient = NULL; + } + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::NewL +// --------------------------------------------------------------------------- +// +CESMRFSEMailManager* CESMRFSEMailManager::NewL( + CMRMailboxUtils& aMRMailboxUtils ) + { + FUNC_LOG; + + CESMRFSEMailManager* self = + new (ELeave) CESMRFSEMailManager(aMRMailboxUtils); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::ConstructL() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::PrepareForSendingL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::PrepareForSendingL( + const TDesC& aMailboxOwnerAddr ) + { + FUNC_LOG; + + iMailClient = CFSMailClient::NewL(); + + TPtrC emailAddr( + ESMRHelper::AddressWithoutMailtoPrefix( aMailboxOwnerAddr ) ); + + iMailBox = SelectMailBoxL( emailAddr ); + iMessage = CreateMessageL(); + iParentPart = CreateParentPartL(); + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::PrepareForSendingreplyL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::PrepareForSendingReplyL( + const TDesC& aMailboxOwnerAddr, + const TFSMailMsgId& aMsgId, + TBool aReplyAll ) + { + FUNC_LOG; + + iMailClient = CFSMailClient::NewL(); + + TPtrC emailAddr( + ESMRHelper::AddressWithoutMailtoPrefix( aMailboxOwnerAddr ) ); + + iMailBox = SelectMailBoxL( emailAddr ); + + iMessage = iMailBox->CreateReplyMessage(aMsgId, aReplyAll ); + + iParentPart = CreateParentPartL(); + } + + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SetSenderL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::SetSenderL( + const TDesC& aAddress, + const TDesC& aCommonName ) + { + FUNC_LOG; + + CFSMailAddress* sender = CFSMailAddress::NewLC(); + + TPtrC emailAddr( + ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); + + sender->SetEmailAddress( emailAddr ); + sender->SetDisplayName( aCommonName ); + iMessage->SetSender( sender ); // takes ownership + CleanupStack::Pop( sender ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SetReplyToAddressL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::SetReplyToAddressL( + const TDesC& aAddress, + const TDesC& aCommonName ) + { + FUNC_LOG; + + CFSMailAddress* replyToAddress = CFSMailAddress::NewLC(); + + TPtrC emailAddr( + ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); + + replyToAddress->SetEmailAddress( emailAddr ); + replyToAddress->SetDisplayName( aCommonName ); + iMessage->SetReplyToAddress( replyToAddress ); // takes ownership + CleanupStack::Pop( replyToAddress ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::AppendToRecipientL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::AppendToRecipientL( + const TDesC& aAddress, + const TDesC& aCommonName ) + { + FUNC_LOG; + + CFSMailAddress* toRecipient = CFSMailAddress::NewLC(); + + TPtrC emailAddr( + ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); + + toRecipient->SetEmailAddress( emailAddr ); + toRecipient->SetDisplayName( aCommonName ); + iMessage->AppendToRecipient( toRecipient ); // takes ownership + CleanupStack::Pop( toRecipient ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::AppendCCRecipientL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::AppendCCRecipientL( + const TDesC& aAddress, + const TDesC& aCommonName ) + { + FUNC_LOG; + + CFSMailAddress* ccRecipient = CFSMailAddress::NewLC(); + + TPtrC emailAddr( + ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); + + ccRecipient->SetEmailAddress( emailAddr ); + ccRecipient->SetDisplayName( aCommonName ); + iMessage->AppendCCRecipient( ccRecipient ); // takes ownership + CleanupStack::Pop( ccRecipient ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SetSubjectL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::SetSubjectL(const TDesC& aSubject) + { + FUNC_LOG; + + iMessage->SetSubject( aSubject ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::CreateTextPlainPartL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::CreateTextPlainPartL(const TDesC& aPlainText) + { + FUNC_LOG; + + AddPlainTextPartL( aPlainText ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::CreateTextCalendarPartL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::CreateTextCalendarPartL( + TESMRMethod aCalendarMethod ) + { + FUNC_LOG; + // removing hardcoded paths + TFileName fileName(KTempFileName); + User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); + CreateTextCalendarPartL( aCalendarMethod, fileName ); + // + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::CreateTextCalendarPartL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::CreateTextCalendarPartL( + TESMRMethod aCalendarMethod, + const TDesC& aFilename ) + { + FUNC_LOG; + + TPtrC contentType; + switch ( aCalendarMethod ) + { + case EESMRMethodRequest: + { + contentType.Set(KMimeTextCalRequest()); + } + break; + + case EESMRMethodResponse: + { + contentType.Set(KMimeTextCalResponse()); + } + break; + + case EESMRMethodCancel: + { + contentType.Set(KMimeTextCalCancel()); + } + break; + + default: + __ASSERT_DEBUG( EFalse, Panic(EESMRInvalidCalMethod) ); + } + + AddMessagePartFromFileL( + contentType, + KMimeTextCalContentClass, + KNullDesC(), + KNullDesC(), + aFilename ); + + } + + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SetAttachmentL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::SetAttachmentL(const TDesC& aAttachmentFile ) + { + FUNC_LOG; + + TFSMailMsgId nullId; + CFSMailMessagePart* attachmentPart = + iMessage->AddNewAttachmentL(aAttachmentFile, nullId ); + CleanupStack::PushL( attachmentPart ); + attachmentPart->SaveL(); + iMessage->SaveMessageL(); + + CleanupStack::PopAndDestroy( attachmentPart ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SetAttachmentL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::SetAttachmentL( + RFile& aFile, + const TDesC8& aMimeType ) + { + FUNC_LOG; + + CFSMailMessagePart* attachmentPart = iMessage->AddNewAttachmentL( aFile, aMimeType ); + CleanupStack::PushL( attachmentPart ); + attachmentPart->SaveL(); + iMessage->SaveMessageL(); + + CleanupStack::PopAndDestroy( attachmentPart ); + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::StoreMessageL +// --------------------------------------------------------------------------- +// +TInt CESMRFSEMailManager::StoreMessageToDraftsFolderL() + { + FUNC_LOG; + // Stores message automatically to drafts folder + // check that msg is not in drafts folder already + TFSMailMsgId draftsFolderId = + iMailBox->GetStandardFolderId( EFSDraftsFolder ); + TFSMailMsgId msgFolderId = iMessage->GetFolderId(); + if ( draftsFolderId != msgFolderId ) + { + RArray ids; + CleanupClosePushL( ids ); + ids.Append( iMessage->GetMessageId() ); + iMailBox->MoveMessagesL( ids, msgFolderId, draftsFolderId ); + CleanupStack::PopAndDestroy(); // ids + } + + iMessage->SaveMessageL(); + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SendMessageL +// --------------------------------------------------------------------------- +// +TInt CESMRFSEMailManager::SendMessageL() + { + FUNC_LOG; + + TRAPD( ret, iMailBox->SendMessageL( *iMessage ) ); + + + return ret; + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::MailboxId +// --------------------------------------------------------------------------- +// +TFSMailMsgId CESMRFSEMailManager::MailboxId() const + { + FUNC_LOG; + return iMailBox->GetId(); + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SendMailViaSyncL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::SendMailViaSyncL( + TESMRInputParams& aParams, + MMRInfoObject& aInfoObject, + MMRInfoProcessor::TMRInfoResponseMode aResponseMode, + const TDesC& aFreeResponseText ) + { + FUNC_LOG; + + CFSMailBox* mailBox = + aParams.iMailClient->GetMailBoxByUidL( + aParams.iMailMessage->GetMailBoxId() ); + CleanupStack::PushL( mailBox ); + + if ( mailBox->IsMRInfoProcessorSet() ) + { + MMRInfoProcessor& infoProcessor( + mailBox->MRInfoProcessorL() ); + + + TRAPD(err, { + infoProcessor.ReplyToMeetingRequestL( + aParams.iMailMessage->GetMailBoxId(), + aParams.iMailMessage->GetMessageId(), + aInfoObject, + aResponseMode, + aFreeResponseText ); + } ); + + + + User::LeaveIfError( err ); + } + + CleanupStack::PopAndDestroy( mailBox ); + + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::MessageId +// --------------------------------------------------------------------------- +// +TFSMailMsgId CESMRFSEMailManager::MessageId() const + { + FUNC_LOG; + __ASSERT_DEBUG( iMessage, Panic(EESMRMessageNotExist) ); + return iMessage->GetMessageId(); + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::MessageFolderId +// --------------------------------------------------------------------------- +// +TFSMailMsgId CESMRFSEMailManager::MessageFolderId() const + { + FUNC_LOG; + __ASSERT_DEBUG( iMessage, Panic(EESMRMessageNotExist) ); + return iMessage->GetFolderId(); + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::CreateMessageL +// --------------------------------------------------------------------------- +// +CFSMailMessage* CESMRFSEMailManager::CreateMessageL() + { + FUNC_LOG; + + CFSMailMessage* msg = iMailBox->CreateMessageToSend(); + + msg->SetFlag( EFSMsgFlag_CalendarMsg ); + msg->SaveMessageL(); + + return msg; + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::CreateParentPartL +// --------------------------------------------------------------------------- +// +CFSMailMessagePart* CESMRFSEMailManager::CreateParentPartL() + { + FUNC_LOG; + __ASSERT_DEBUG( iMessage, Panic(EESMRMessageNotExist) ); + + CFSMailMessagePart* parent = NULL; + RPointerArray messageParts; + CleanupStack::PushL( + TCleanupItem( + MessagePartPointerArrayCleanup, + &messageParts ) ); + + iMessage->ChildPartsL( messageParts ); + + if( messageParts.Count() ) + { + parent = messageParts[ KFirstIndex ]; + messageParts.Remove( KFirstIndex ); + } + else + { + // Message does not contain body part --> Create it + TFSMailMsgId id; + parent = iMessage->NewChildPartL( + id, + KFSMailContentTypeMultipartAlternative ); + } + + CleanupStack::PopAndDestroy(); // messageParts + CleanupStack::PushL( parent ); + + parent->SetContentType( KFSMailContentTypeMultipartAlternative ); + parent->SaveL(); + iMessage->SaveMessageL(); + + CleanupStack::Pop( parent ); + return parent; + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::SelectMailBoxL +// --------------------------------------------------------------------------- +// +CFSMailBox* CESMRFSEMailManager::SelectMailBoxL( + const TDesC& aMailboxOwnerAddr ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iMailClient, Panic(EESMRMailClientNotExist) ); + + CFSMailBox* mailbox = NULL; + + // Loop throug all mailboxes in this plug-in + RPointerArray mailboxes; + CleanupStack::PushL( + TCleanupItem( + MailboxPointerArrayCleanup, + &mailboxes ) ); + + // With null uid we get all mailboxes + TFSMailMsgId msgId; + iMailClient->ListMailBoxes( + msgId, mailboxes ); + + TInt mailboxCount( mailboxes.Count() ); + for (TInt j(0); j < mailboxCount && !mailbox; ++j ) + { + TPtrC mailboxOwnerAddName( + mailboxes[j]->OwnMailAddress().GetEmailAddress() ); + if ( KEqualEmailAddress == mailboxOwnerAddName.CompareF(aMailboxOwnerAddr) ) + { + // Correct mailbox is found + mailbox = mailboxes[j]; + mailboxes.Remove(j); + } + } + CleanupStack::PopAndDestroy( &mailboxes ); + + __ASSERT_DEBUG( mailbox, Panic(EESMRMailboxNotFound) ); + + if ( !mailbox ) + { + DoLeaveIfErrorL( KErrNotFound ); + } + + + return mailbox; + } + +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::AddMessagePartFromFileL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::AddMessagePartFromFileL( + const TDesC& aContentType, + const TDesC& aContentClass, + const TDesC& aContentDescription, + const TDesC& aContentDisposition, + const TDesC& aFileAndPath ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iParentPart, Panic(EESMRMessageNotExist) ); + + TFSMailMsgId nullId; + + CFSMailMessagePart* messagePart = + iParentPart->AddNewAttachmentL( + aFileAndPath, + nullId, + aContentType ); + + CleanupStack::PushL( messagePart ); + + messagePart->SetMailBoxId( iMailBox->GetId() ); + messagePart->SetContentDescription( KNullDesC() ); + messagePart->SetContentType( KNullDesC() ); + messagePart->SetContentDisposition( KNullDesC() ); + messagePart->SetContentClass( KNullDesC() ); + + if ( aContentType.Length() ) + { + messagePart->SetContentType( aContentType ); + } + + if ( aContentDescription.Length() ) + { + messagePart->SetContentDescription( aContentDescription ); + } + + if ( aContentDisposition.Length() ) + { + messagePart->SetContentDisposition( aContentDisposition ); + } + + if ( aContentClass.Length() ) + { + messagePart->SetContentClass( aContentClass ); + } + + messagePart->SaveL(); + iMessage->SaveMessageL(); + + CleanupStack::PopAndDestroy( messagePart ); + + } +// --------------------------------------------------------------------------- +// CESMRFSEMailManager::AddPlainTextPartL +// --------------------------------------------------------------------------- +// +void CESMRFSEMailManager::AddPlainTextPartL( + const TDesC& aContent ) + { + FUNC_LOG; + TFSMailMsgId id; + CFSMailMessagePart* plainTextPart = + iParentPart->FindBodyPartL(KFSMailContentTypeTextPlain); + + if ( !plainTextPart ) + { + // text/plain part does not exist --> Create it to body part + plainTextPart = + iParentPart->NewChildPartL(id, KFSMailContentTypeTextPlain ); + } + + CleanupStack::PushL( plainTextPart ); + + plainTextPart->SetMailBoxId( iMailBox->GetId() ); + + TUint currentContentSize = plainTextPart->ContentSize(); + TUint contentBufferSize = currentContentSize + aContent.Length(); + + // Buffer for current content + HBufC* currentContentBuffer = HBufC::NewLC( currentContentSize ); + TPtr currentContent( currentContentBuffer->Des() ); + + // Buffer for content containing calendar information and current content + HBufC* contentBuffer = HBufC::NewLC( contentBufferSize ); + TPtr content( contentBuffer->Des() ); + + // Appending calendar information to content + content.Copy( aContent ); + if ( currentContentSize ) + { + // Appending current content if needed + plainTextPart->GetContentToBufferL( currentContent, 0 ); + content.Append( currentContent ); + } + + plainTextPart->SetContent(content); + CleanupStack::PopAndDestroy( contentBuffer ); contentBuffer = NULL; + CleanupStack::PopAndDestroy( currentContentBuffer ); currentContentBuffer = NULL; + + plainTextPart->SaveL(); + iMessage->SaveMessageL(); + + CleanupStack::PopAndDestroy( plainTextPart ); + + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrmailplaitextformatter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrmailplaitextformatter.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,432 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for plain text formatter for ES MR entries +* +*/ + +#include "emailtrace.h" +#include "cesmrmailplaitextformatter.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "cesmrcaluserutil.h" +#include "esmrhelper.h" +#include + +// Unnamed namespace for local definitions +namespace { + +// Resource file name definition +_LIT( KResourceFileName,"esmrtasks.rsc" ); + +// Definition for new line +_LIT( KNewLine,"\n" ); + +_LIT( KWhiteSpace, " " ); + +// Definition for first position +const TInt KFirstPos( 0 ); + +// Denition for amount of needed newlines +const TInt KNewLinesNeeded = 5; + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::CESMRMailPlainTextFormatter +// --------------------------------------------------------------------------- +// +inline CESMRMailPlainTextFormatter::CESMRMailPlainTextFormatter( + CMRMailboxUtils& aMailboxUtils ) : + iMailboxUtils(aMailboxUtils) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::~CESMRMailPlainTextFormatter +// --------------------------------------------------------------------------- +// +CESMRMailPlainTextFormatter::~CESMRMailPlainTextFormatter() + { + FUNC_LOG; + if ( iResourceOffset ) + { + CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); + } + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::NewL +// --------------------------------------------------------------------------- +// +CESMRMailPlainTextFormatter* CESMRMailPlainTextFormatter::NewL( + CMRMailboxUtils& aMailboxUtils ) + { + FUNC_LOG; + CESMRMailPlainTextFormatter* self = NewLC( aMailboxUtils ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::NewLC +// --------------------------------------------------------------------------- +// +CESMRMailPlainTextFormatter* CESMRMailPlainTextFormatter::NewLC( + CMRMailboxUtils& aMailboxUtils ) + { + FUNC_LOG; + CESMRMailPlainTextFormatter* self = + new (ELeave) CESMRMailPlainTextFormatter(aMailboxUtils); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRMailPlainTextFormatter::ConstructL() + { + FUNC_LOG; + CCoeEnv* coeEnv = CCoeEnv::Static();// codescanner::eikonenvstatic + + TFileName resourceFile; + ESMRHelper::LocateResourceFile( + KResourceFileName, + KDC_RESOURCE_FILES_DIR, + resourceFile, + &coeEnv->FsSession()); + + // Find the resource file for the nearest language + BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceFile ); + iResourceOffset = coeEnv->AddResourceFileL( resourceFile ); + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::Body16LC +// --------------------------------------------------------------------------- +// +HBufC* CESMRMailPlainTextFormatter::Body16LC( + CCalEntry& aEntry ) + { + FUNC_LOG; + + HBufC* details = + HBufC::NewLC( aEntry.DescriptionL().Length() + + KNewLine().Length() * KNewLinesNeeded + + KWhiteSpace().Length() * 2 ); + + TPtr detailsPtr( details->Des() ); + + detailsPtr.Append( aEntry.DescriptionL() ); + detailsPtr.Append( KNewLine ); + + return details; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::Body8LC +// --------------------------------------------------------------------------- +// +HBufC8* CESMRMailPlainTextFormatter::Body8LC( + CCalEntry& aEntry ) + { + FUNC_LOG; + HBufC* buf16 = Body16LC( aEntry ); + HBufC8* buf8 = HBufC8::NewLC( buf16->Length() ); + TPtr8 ptr8( buf8->Des() ); + + TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8( ptr8, *buf16 ); + User::LeaveIfError( err ); + CleanupStack::Pop( buf8 ); + CleanupStack::PopAndDestroy( buf16 ); + CleanupStack::PushL( buf8 ); + return buf8; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::Subject16LC +// --------------------------------------------------------------------------- +// +HBufC* CESMRMailPlainTextFormatter::Subject16LC( + CCalEntry& aEntry, + TBool aIsForwarded, + TBool aIsUpdate ) + { + FUNC_LOG; + CESMRCalUserUtil* caluserUtil = CESMRCalUserUtil::NewLC( aEntry ); + TESMRRole role = caluserUtil->PhoneOwnerRoleL(); + CleanupStack::PopAndDestroy( caluserUtil ); + + // create prefix for subject: + HBufC* prefix = SubjectLinePrefix16LC( + aEntry, + aIsForwarded, + aIsUpdate ); //if returns NULL no need to CleanupStack::Pop later + + // user's email address is attached to subject if user is + // responding to meeting request: + HBufC* responseAddress = KNullDesC().AllocLC(); + if ( !aIsForwarded ) + { + if ( EESMRRoleRequiredAttendee == role || + EESMRRoleOptionalAttendee == role || + EESMRRoleNonParticipant == role ) + { + CleanupStack::PopAndDestroy( responseAddress ); + responseAddress = NULL; + + CCalUser* phoneOwner = aEntry.PhoneOwnerL(); + responseAddress = phoneOwner->Address().AllocLC(); + } + } + + // count the subject line buffer length + TInt subjectLineLength( aEntry.SummaryL().Length() ); + + if (prefix) + { + subjectLineLength += prefix->Length(); + } + + if (responseAddress) + { + subjectLineLength += responseAddress->Length(); + } + + // create and fill the subject buffer + HBufC* subjectLine = + HBufC::NewLC( subjectLineLength ); + TPtr ptrSubject( subjectLine->Des() ); + + if (responseAddress) + { + ptrSubject.Append(*responseAddress); + } + + if (prefix) + { + ptrSubject.Copy( *prefix ); + } + + ptrSubject.Append( aEntry.SummaryL() ); + + CleanupStack::Pop( subjectLine ); + + if (prefix) + { + CleanupStack::PopAndDestroy( 2, prefix ); // responseAddress + } + else + { + CleanupStack::PopAndDestroy( responseAddress ); + } + CleanupStack::PushL( subjectLine ); + return subjectLine; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::Subject8LC +// --------------------------------------------------------------------------- +// +HBufC8* CESMRMailPlainTextFormatter::Subject8LC( + CCalEntry& aEntry, + TBool aIsForwarded, + TBool aIsUpdate ) + { + FUNC_LOG; + HBufC* buf16 = Subject16LC( aEntry, aIsForwarded, aIsUpdate ); + HBufC8* buf8 = HBufC8::NewLC( buf16->Length() ); + TPtr8 ptr8(buf8->Des() ); + + TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8( ptr8, *buf16 ); + User::LeaveIfError( err ); + CleanupStack::Pop( buf8 ); + CleanupStack::PopAndDestroy( buf16 ); + CleanupStack::PushL( buf8 ); + return buf8; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::SubjectLinePrefix16LC +// --------------------------------------------------------------------------- +// +HBufC* CESMRMailPlainTextFormatter::SubjectLinePrefix16LC( + CCalEntry& aEntry, + TBool aIsForwarded, + TBool aIsUpdate ) + { + FUNC_LOG; + HBufC* prefix = NULL; + + CESMRCalUserUtil* caluserUtil = CESMRCalUserUtil::NewLC( aEntry ); + TESMRRole role = caluserUtil->PhoneOwnerRoleL(); + CleanupStack::PopAndDestroy( caluserUtil ); + caluserUtil = NULL; + + if ( EESMRRoleOrganizer == role ) + { + CCalEntry::TMethod method = aEntry.MethodL(); + if ( CCalEntry::EMethodCancel == method ) + { + prefix = + StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_CANCELLED ); + } + else if ( CCalEntry::EMethodRequest == method && + aIsForwarded ) + { + prefix = + StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_FORWARDED ); + } + else if ( CCalEntry::EMethodRequest == method && + aIsUpdate ) + { + prefix = + StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_UPDATE ); + } + else + { + prefix = + KNullDesC().AllocLC(); + } + } + + else if ( EESMRRoleRequiredAttendee == role || + EESMRRoleOptionalAttendee == role || + EESMRRoleNonParticipant == role ) + { + if( aIsForwarded ) + { + prefix = + StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_FORWARDED ); + } + else + { + CCalAttendee* attendee = + iMailboxUtils.ThisAttendeeL( aEntry ); + if ( attendee ) + { + switch( attendee->StatusL() ) + { + case CCalAttendee::EAccepted: + prefix = + StringLoader::LoadLC( + R_QTN_MEET_REQ_PLAIN_TEXT_ACCEPTED ); + break; + case CCalAttendee::ETentative: + prefix = + StringLoader::LoadLC( + R_QTN_MEET_REQ_PLAIN_TEXT_TENTATIVE ); + break; + case CCalAttendee::EDeclined: + prefix = + StringLoader::LoadLC( + R_QTN_MEET_REQ_PLAIN_TEXT_DECLINED ); + break; + default: + prefix = + KNullDesC().AllocLC(); + break; + } + } + else + { + prefix = + KNullDesC().AllocLC(); + } + } + } + return prefix; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::UpdatedStringLC +// --------------------------------------------------------------------------- +// +HBufC* CESMRMailPlainTextFormatter::UpdatedStringLC() + { + FUNC_LOG; + HBufC* updatedString = + StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_UPDATE ); + + return updatedString; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::CanceledStringLC +// --------------------------------------------------------------------------- +// +HBufC* CESMRMailPlainTextFormatter::CanceledStringLC() + { + FUNC_LOG; + HBufC* canceledString = + StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_CANCELLED ); + + return canceledString; + } + +// --------------------------------------------------------------------------- +// CESMRMailPlainTextFormatter::ReplyStringLC +// --------------------------------------------------------------------------- +// +HBufC* CESMRMailPlainTextFormatter::ReplyStringLC( CCalEntry& aEntry ) + { + FUNC_LOG; + HBufC* replyString = NULL; + HBufC* replyStringPrefix = + StringLoader::LoadLC( R_QTN_MEET_REQ_VIEWER_SUBJECT_PREFIX_REPL ); + + TPtrC subject( aEntry.SummaryL() ); + + TInt pos = subject.Find( *replyStringPrefix ); + if ( KErrNotFound == pos || KFirstPos != pos ) + { + // There is no reply prefix already or reply prefix is not at the + // beginning --> We need to add it to description + + // No need to put into cleanupstack because calling only non leaving + // functions before exiting + replyString = HBufC::NewL( + replyStringPrefix->Length() + subject.Length() ); + + TPtr ptrReply( replyString->Des() ); + + ptrReply.Copy( *replyStringPrefix ); + ptrReply.Append( subject ); + } + else + { + replyString = subject.AllocL(); + } + + CleanupStack::PopAndDestroy( replyStringPrefix ); + CleanupStack::PushL( replyString ); + + return replyString; + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrmeetingrequestsender.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrmeetingrequestsender.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,340 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ESMR policy implementation +* +*/ + +#include "emailtrace.h" +#include "cesmrmeetingrequestsender.h" + +#include +#include +#include +#include +#include +#include +#include "mesmrmeetingrequestentry.h" +#include "cesmrcalimportexporter.h" +#include "esmrentryhelper.h" +#include "esmrhelper.h" +#include "cesmrmailplaitextformatter.h" + +// Unnamed namespace for local definitions +namespace { + +const TInt KMRBufferSize = 16 * 1024; + +_LIT8( KMethodRequest, "REQUEST" ); +_LIT8( KMethodResponse, "RESPONSE" ); +_LIT8( KMethodCancel, "CANCEL" ); +_LIT8( KNewLine, "\n" ); + +// remove hardcoded paths +//_LIT( KNCFileName, "c:\\temp\\mail.tmp" ); //codescanner::driveletters +_LIT( KNCFile, "temp\\mail.tmp" ); +// +_LIT8( KStart, "EHLO hello\n"); +_LIT8( KEnd, ".\nQUIT\n" ); + +_LIT8( KMailFromStart, "MAIL FROM:<"); +_LIT8( KRecipientTo, "RCPT TO:<"); +_LIT8( KAddressEnd, ">\n"); +_LIT8( KDataStart, "DATA\n" ); +_LIT8( KTo, "To:"); + + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Constructs file for nc application. NC application can further +// send the file to recipients. +// --------------------------------------------------------------------------- +// +void StoreToFileL( + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMailboxUtils, + const TDesC& aFreePlainText ) + { + FUNC_LOG; + HBufC8* mrBuffer = HBufC8::NewLC( KMRBufferSize ); + TPtr8 mrBufPtr( mrBuffer->Des() ); + CESMRMailPlainTextFormatter* mailPlainTextFormatter = + CESMRMailPlainTextFormatter::NewLC( aMailboxUtils ); + + mrBufPtr.Append(KStart); + + CCalEntry& entry = aEntry.Entry(); + + CCalUser* sender = entry.PhoneOwnerL(); + + if ( !sender ) + { + User::Leave( KErrArgument); + } + + mrBufPtr.Append( KMailFromStart ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( sender->Address() ) ); + mrBufPtr.Append( KAddressEnd ); + + if ( entry.MethodL() == CCalEntry::EMethodReply ) + { + CCalUser* organizer = NULL; + TRAP_IGNORE( organizer = entry.OrganizerL() ); + + mrBufPtr.Append(KRecipientTo() ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( organizer->Address() ) ); + mrBufPtr.Append(KAddressEnd()); + } + else + { + RPointerArray& attendees = entry.AttendeesL(); + TInt attendeeCount( attendees.Count() ); + for (TInt i(0); i < attendeeCount; ++i ) + { + mrBufPtr.Append(KRecipientTo() ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( attendees[i]->Address() ) ); + mrBufPtr.Append(KAddressEnd()); + } + } + + mrBufPtr.Append( KDataStart ); + + _LIT(KDateFormat,"%*E%,%D%*N %1 %2"); + _LIT( KDateStart, "Date: " ); + + TTime time; time.UniversalTime(); + TDateTime dTime = time.DateTime(); + TBuf<30> dateString; + time.FormatL(dateString, KDateFormat ); + mrBufPtr.Append( KDateStart ); + mrBufPtr.Append( dateString ); + + _LIT8( KFormat, " %d %02d:%02d:%02d +0000\n" ); + mrBufPtr.AppendFormat( KFormat, dTime.Year(), dTime.Hour(), dTime.Minute(), dTime.Second() ); + + if ( entry.MethodL() == CCalEntry::EMethodReply ) + { + // Leavescan fix + CCalUser* organizer = NULL; + TRAP_IGNORE( organizer = entry.OrganizerL() ); + + mrBufPtr.Append( KTo ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( organizer->Address() ) ); + mrBufPtr.Append( KNewLine ); + } + else + {mrBufPtr.Append( KTo ); + RPointerArray& attendees = entry.AttendeesL(); + TInt attendeeCount( attendees.Count() ); + for (TInt i(0); i < attendeeCount; ++i ) + { + + _LIT8( KComma, ","); + _LIT8( KStart, "<"); + _LIT8( KEnd, "<"); + mrBufPtr.Append( KStart ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( attendees[i]->Address() ) ); + mrBufPtr.Append( KEnd ); + mrBufPtr.Append( KComma ); + } + mrBufPtr.Append( KNewLine ); + } + + _LIT8( KReplyTo, "Reply-To: "); + mrBufPtr.Append( KReplyTo ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( sender->Address() ) ); + mrBufPtr.Append( KNewLine ); + + _LIT8( KFrom, "From: " ); + mrBufPtr.Append( KFrom ); + mrBufPtr.Append( + ESMRHelper::AddressWithoutMailtoPrefix( sender->Address() ) ); + mrBufPtr.Append( KNewLine ); + + _LIT8( KSubject, "Subject: " ); + mrBufPtr.Append( KSubject ); + HBufC8* subject = mailPlainTextFormatter->Subject8LC(aEntry); + mrBufPtr.Append( *subject ); + CleanupStack::PopAndDestroy( subject ); + mrBufPtr.Append( KNewLine ); + + _LIT8(KMimeVer, "MIME-Version: 1.0\n" ); + mrBufPtr.Append( KMimeVer ); + + _LIT8( KMailContentType, "Content-Type: multipart/alternative;\n boundary=\"EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj\"\n" ); + mrBufPtr.Append( KMailContentType ); + + _LIT8( XParams, "X-imss-version: 2.043\nX-imss-result: Passed\nX-imss-scores: Clean:45.41865 C:2 M:3 S:5 R:5\nX-imss-settings: Baseline:2 C:1 M:1 S:1 R:1 (0.1500 0.1500)\n\nThis is a MIME Message\n\n" ); + mrBufPtr.Append( XParams ); + + _LIT8( KPlainBoundary, "--EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj\nContent-Type: text/plain; charset=ISO-8859-1\nContent-Disposition: inline\nContent-Transfer-Encoding: quoted-printable\n\n" ); + mrBufPtr.Append( KPlainBoundary ); + + HBufC8* bodyText = mailPlainTextFormatter->Body8LC( aEntry ); + mrBufPtr.Append( *bodyText ); + CleanupStack::PopAndDestroy( bodyText ); + + if ( aFreePlainText.Length() ) + { + _LIT8( KFreeTextSeparatorTxt, "------------------------------------------------------------------------\n" ); + mrBufPtr.Append( KFreeTextSeparatorTxt ); + + HBufC8* freeTxt8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aFreePlainText ); + mrBufPtr.Append( *freeTxt8 ); + mrBufPtr.Append( KNewLine ); + mrBufPtr.Append( KNewLine ); + + delete freeTxt8; + } + + _LIT( KMRBoundary, "--EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj\nContent-Type: text/calendar;\n method="); + mrBufPtr.Append( KMRBoundary ); + + if ( entry.MethodL() == CCalEntry::EMethodRequest ) + { + mrBufPtr.Append( KMethodRequest ); + } + else if ( entry.MethodL() == CCalEntry::EMethodCancel ) + { + mrBufPtr.Append( KMethodCancel ); + } + else + { + mrBufPtr.Append( KMethodResponse ); + } + mrBufPtr.Append( KNewLine ); + + _LIT( KMRBoundaryEnd, " name=\"meeting.ics\"\nContent-Transfer-Encoding: 8bit\n\n" ); + mrBufPtr.Append( KMRBoundaryEnd ); + + + CESMRCalImportExporter* calExporter = CESMRCalImportExporter::NewLC(); + + HBufC8* iCal = calExporter->ExportToICal8LC( entry ); + mrBufPtr.Append( *iCal ); + + CleanupStack::PopAndDestroy( iCal ); + CleanupStack::PopAndDestroy(calExporter); + + mrBufPtr.Append( KNewLine ); + + + _LIT(KBoundaryEnd, "--EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj--\n\n\n" ); + mrBufPtr.Append( KBoundaryEnd ); + mrBufPtr.Append( KEnd); + + RFile ncFile; + RFs& fs = CCoeEnv::Static()->FsSession(); + // remove hard coded paths + //TInt err = fs.MkDirAll( KNCFileName() ); + TFileName fileName(KNCFile); + User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); + TInt err = ncFile.Replace( fs, fileName, EFileWrite ); + // + if (KErrAlreadyExists != err ) + { + User::LeaveIfError( err ); + } + + CleanupClosePushL( ncFile ); + User::LeaveIfError( ncFile.Write(mrBufPtr) ); + CleanupStack::PopAndDestroy( &ncFile ); + // mrBuffer, mailPlainTextFormatter + CleanupStack::PopAndDestroy( 2, mrBuffer ); + } + +} // namespace + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestSender::CESMRMeetingRequestSender +// --------------------------------------------------------------------------- +// +inline CESMRMeetingRequestSender::CESMRMeetingRequestSender( + CMRMailboxUtils& aMailboxUtils) : + iMailboxUtils( aMailboxUtils ) + + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestSender::~CESMRMeetingRequestSender +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRMeetingRequestSender::~CESMRMeetingRequestSender() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestSender::NewL +// --------------------------------------------------------------------------- +// +EXPORT_C CESMRMeetingRequestSender* + CESMRMeetingRequestSender::NewL( + CMRMailboxUtils& aMailboxUtils ) + { + CESMRMeetingRequestSender* self = + new (ELeave) CESMRMeetingRequestSender( aMailboxUtils ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestSender::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestSender::ConstructL() + { + FUNC_LOG; + //do nothing + } + + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestSender::CreateAndSendMeetingRequestL +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestSender::CreateAndSendMeetingRequestL( + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + StoreToFileL( aEntry, iMailboxUtils, KNullDesC() ); + } + +// --------------------------------------------------------------------------- +// CESMRMeetingRequestSender::CreateAndSendMeetingRequestL +// --------------------------------------------------------------------------- +// +void CESMRMeetingRequestSender::CreateAndSendMeetingRequestL( + MESMRMeetingRequestEntry& aEntry, + const TDesC& aFreePlainText ) + { + FUNC_LOG; + StoreToFileL( aEntry, iMailboxUtils, aFreePlainText ); + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrfsmailreplytask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrfsmailreplytask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,350 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR send MR via fs email task +* +*/ + +#include "emailtrace.h" +#include "cesmrsendmrfsmailreplytask.h" + +#include +#include +#include +#include +#include +// +#include "CFSMailMessage.h" +#include +#include +#include "FreestyleEmailUiConstants.h" +// + +#include "cesmrcaldbmgr.h" +#include "mesmrmeetingrequestentry.h" +#include "cesmrfsemailmanager.h" +#include "cesmrmailplaitextformatter.h" +#include "cesmrcalimportexporter.h" +#include "cesmrcaluserutil.h" +#include "tesmrinputparams.h" +#include "esmrhelper.h" + +// Unnamed namespace for local definitions +namespace { + +#ifdef _DEBUG + +// Literal for panics +_LIT( ESMRSendMRRespMailPanicTxt, "ESMRSendMRFSEMailTask" ); + +// Panic codes +enum TESMRSendMRFSMailTaskPanic + { + EESMRSendMRFSAttendeesMissing, + EESMRCannotBeTriggeredFromMail + }; + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Panic wrapper method +// --------------------------------------------------------------------------- +// +void Panic( TESMRSendMRFSMailTaskPanic aPanic ) + { + + User::Panic( ESMRSendMRRespMailPanicTxt, aPanic ); + } + +#endif // _DEBUG + +// --------------------------------------------------------------------------- +// Leave wrapper method +// --------------------------------------------------------------------------- +// +inline void DoLeaveIfErrorL( TInt aLeaveCode ) + { + if ( KErrNone != aLeaveCode ) + { + + User::Leave( aLeaveCode ); + } + } +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::CESMRSendMRFSMailReplyTask +// --------------------------------------------------------------------------- +// +CESMRSendMRFSMailReplyTask::CESMRSendMRFSMailReplyTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TBool aReplyAll) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), + iReplyAll(aReplyAll) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::~CESMRSendMRFSMailReplyTask +// --------------------------------------------------------------------------- +// +CESMRSendMRFSMailReplyTask::~CESMRSendMRFSMailReplyTask() + { + FUNC_LOG; + delete iEntryToSend; + delete iCaluserUtil; + delete iEmailMgr; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::NewL +// --------------------------------------------------------------------------- +// +CESMRSendMRFSMailReplyTask* CESMRSendMRFSMailReplyTask::NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TBool aReplyAll) + { + FUNC_LOG; + + CESMRSendMRFSMailReplyTask* self = + new (ELeave) CESMRSendMRFSMailReplyTask( + aCalDbMgr, + aEntry, + aMRMailboxUtils, + aReplyAll); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailReplyTask::ConstructL() + { + FUNC_LOG; + BaseConstructL(); + iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailReplyTask::ExecuteTaskL() + { + FUNC_LOG; + + iEntryToSend = ESMREntry().ValidateEntryL(); + iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); + + ConstructMailL(); + + iEmailMgr->StoreMessageToDraftsFolderL(); + + LaunchFSEmailEditorL(iReplyAll); + + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::ConstructMailL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailReplyTask::ConstructMailL() + { + FUNC_LOG; + + // create text formatter: + CESMRMailPlainTextFormatter* textFormatter = + CESMRMailPlainTextFormatter::NewLC( MailboxUtils() ); + + TESMRInputParams startupparams; + TBool isEmail = ESMREntry().StartupParameters(startupparams); + + // This command cannot be triggered from email + __ASSERT_DEBUG( !isEmail, Panic(EESMRCannotBeTriggeredFromMail) ); + + if(isEmail) + { + // This command cannot be triggered from email + User::Leave( KErrNotSupported ); + } + else + { + //launched from calendar, mail id available for mr + + // Prepare email manager for sending + CCalUser* mailboxUser = iEntryToSend->PhoneOwnerL(); + iEmailMgr->PrepareForSendingL( + ESMRHelper::AddressWithoutMailtoPrefix( + mailboxUser->Address() ) ); + + // set the email subject: + HBufC* subject = + textFormatter->ReplyStringLC( *iEntryToSend ); + + iEmailMgr->SetSubjectL(*subject); + CleanupStack::PopAndDestroy(subject); + + CCalUser* organizer = iEntryToSend->OrganizerL(); + + //Add organizer as sender + iEmailMgr->SetSenderL( + organizer->Address(), + organizer->CommonName() ); + + if(iReplyAll) + { + //Add also required and optional attendees + AddAttendeesL(); + } + } + + CleanupStack::PopAndDestroy(textFormatter); + + } + + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::AddAttendeesL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailReplyTask::AddAttendeesL() + { + FUNC_LOG; + + RArray requiredAttendees; + CleanupClosePushL( requiredAttendees ); + + RArray optionalAttendees; + CleanupClosePushL( optionalAttendees ); + + iCaluserUtil->GetAttendeesL( + requiredAttendees, + EESMRRoleRequiredAttendee ); + iCaluserUtil->GetAttendeesL( + optionalAttendees, + EESMRRoleOptionalAttendee ); + + // Add recipients and cc-recipients + TInt attendeeCount( requiredAttendees.Count() ); + + __ASSERT_DEBUG( attendeeCount, Panic(EESMRSendMRFSAttendeesMissing) ); + + if ( !attendeeCount ) + { + DoLeaveIfErrorL( KErrArgument ); + } + + for (TInt i(0); i < attendeeCount; ++i) + { + iEmailMgr->AppendToRecipientL( + requiredAttendees[i]->Address(), + requiredAttendees[i]->CommonName() ); + } + + TInt optAttendeeCount( optionalAttendees.Count() ); + for (TInt i(0); i < optAttendeeCount; ++i) + { + iEmailMgr->AppendToRecipientL( + optionalAttendees[i]->Address(), + optionalAttendees[i]->CommonName() ); + } + + CleanupStack::PopAndDestroy(2, &requiredAttendees ); + + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::ResolveUsedMailboxUserAddressLC +// --------------------------------------------------------------------------- +// +HBufC* CESMRSendMRFSMailReplyTask::ResolveUsedMailboxUserAddressLC() + { + FUNC_LOG; + + HBufC* mailboxUserAddress = NULL; + MESMRMeetingRequestEntry& mrEntry( ESMREntry()); + if ( mrEntry.IsForwardedL() ) + { + // Entry is forwarder --> Use default mailbox + CMRMailboxUtils::TMailboxInfo mbInfo; + CMRMailboxUtils& mbUtils( MailboxUtils() ); + mbUtils.GetDefaultMRMailBoxL( mbInfo ); + mailboxUserAddress = mbInfo.iEmailAddress.AllocLC(); + } + else + { + mailboxUserAddress = mrEntry.CalendarOwnerAddressL().AllocLC(); ; + } + + return mailboxUserAddress; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailReplyTask::LaunchFSEmailEditorL +// --------------------------------------------------------------------------- +// +TInt CESMRSendMRFSMailReplyTask::LaunchFSEmailEditorL(TBool aReplAll) + { + FUNC_LOG; + CCoeEnv* coe = CCoeEnv::Static(); + + CCoeAppUi* appui = coe->AppUi(); + + // fill params + TEditorLaunchParams params; + params.iActivatedExternally = ETrue; + params.iMailboxId = iEmailMgr->MailboxId(); + params.iFolderId = iEmailMgr->MessageFolderId(); + params.iMsgId = iEmailMgr->MessageId(); + + TVwsViewId viewId( + KFSEmailUiUid, + MailEditorId ); + + TUid editorCommand; + + if(aReplAll) + { + editorCommand = TUid::Uid( KEditorCmdReplyAll ); + } + else + { + editorCommand = TUid::Uid( KEditorCmdReply ); + } + + TPckgC buf( params ); + + appui->ActivateViewL( + viewId, + editorCommand, + buf ); + + return KErrNone; + } + +//EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrfsmailtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrfsmailtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,855 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR send MR via fs email task +* +*/ + + +#include "emailtrace.h" +#include "cesmrsendmrfsmailtask.h" +#include "cesmrcaldbmgr.h" +#include "mesmrmeetingrequestentry.h" +#include "cesmrfsemailmanager.h" +#include "cesmrmailplaitextformatter.h" +#include "cesmrcalimportexporter.h" +#include "cesmrcaluserutil.h" +#include "cesmrguilistquery.h" +#include "esmrhelper.h" + + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Unnamed namespace for local definitions +namespace { // codescanner::namespace + +/** + * Adds updated label into summary field. + */ +void UpdateSummaryL( + CCalEntry& aEntry, + CESMRMailPlainTextFormatter& aPlainTextFormatter ) + { + FUNC_LOG; + TPtrC currentSummary( aEntry.SummaryL() ); + + CCalEntry::TMethod method( aEntry.MethodL() ); + if ( CCalEntry::EMethodRequest == method && aEntry.SequenceNumberL() ) + { + // This is update + HBufC* updateStr = aPlainTextFormatter.UpdatedStringLC(); + HBufC* summary = HBufC::NewLC( + updateStr->Length() + currentSummary.Length() ); + + if ( currentSummary.Find(*updateStr) == KErrNotFound ) + { + TPtr summaryPtr( summary->Des() ); + summaryPtr.Append( *updateStr ); + summaryPtr.Append( currentSummary ); + aEntry.SetSummaryL( summaryPtr ); + } + CleanupStack::PopAndDestroy( summary ); + summary = NULL; + + CleanupStack::PopAndDestroy( updateStr ); + updateStr = NULL; + } + else if ( CCalEntry::EMethodCancel == method ) + { + // This is cancellation + HBufC* cancelStr = aPlainTextFormatter.CanceledStringLC(); + HBufC* summary = HBufC::NewLC( + cancelStr->Length() + currentSummary.Length() ); + + if ( currentSummary.Find(*cancelStr) == KErrNotFound ) + { + TPtr summaryPtr( summary->Des() ); + summaryPtr.Append( *cancelStr ); + summaryPtr.Append( currentSummary ); + aEntry.SetSummaryL( summaryPtr ); + } + CleanupStack::PopAndDestroy( summary ); + summary = NULL; + + CleanupStack::PopAndDestroy( cancelStr ); + cancelStr = NULL; + } + } + +/** + * Cleanup operation for RPointerArray. + * + * @param aArray Pointer to RPointerArray. + */ +void CalAttendeePointerArrayCleanup( TAny* aArray ) + { + RPointerArray* attendeeArray = + static_cast*>( aArray ); + + attendeeArray->ResetAndDestroy(); + attendeeArray->Close(); + } + +#ifdef _DEBUG + +// Literal for panics +_LIT( ESMRSendMRRespMailPanicTxt, "ESMRSendMRFSEMailTask" ); + +// Panic codes +enum TESMRSendMRFSMailTaskPanic + { + EESMRSendMRFSMailInvalidMethod, // Entry has invalid method + EESMRSendMRFSAttendeesMissing, // There are no any attendees in entry to be sent + EESMRSendMRNoEntriesToSend, // There are no entries to be sent + EESMRSendMRPhoneOwnerNotSet // Phone owner is not set + }; + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Panic wrapper method +// --------------------------------------------------------------------------- +// +void Panic( TESMRSendMRFSMailTaskPanic aPanic ) + { + User::Panic( ESMRSendMRRespMailPanicTxt, aPanic ); + } + +#endif // _DEBUG + + +// Definition for temporary calendar file +// remove hard coded paths +//_LIT( KPath, "c:\\temp\\" ); //codescanner::driveletters +//_LIT( KFileAndPath, "c:\\temp\\meeting.ics" ); //codescanner::driveletters +//_LIT( KCancellationFile, "c:\\temp\\cancel.ics" ); //codescanner::driveletters +_LIT( KFile, "temp\\meeting.ics" ); +_LIT( KCancelFile, "temp\\cancel.ics" ); +// + +// --------------------------------------------------------------------------- +// Leave wrapper method +// --------------------------------------------------------------------------- +// +inline void DoLeaveIfErrorL( TInt aLeaveCode ) + { + if ( KErrNone != aLeaveCode ) + { + + User::Leave( aLeaveCode ); + } + } +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::CESMRSendMRFSMailTask +// --------------------------------------------------------------------------- +// +CESMRSendMRFSMailTask::CESMRSendMRFSMailTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRCommand aCommand ) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), + iCommand( aCommand ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::~CESMRSendMRFSMailTask +// --------------------------------------------------------------------------- +// +CESMRSendMRFSMailTask::~CESMRSendMRFSMailTask() + { + FUNC_LOG; + iEntriesToSend.ResetAndDestroy(); + delete iCaluserUtil; + delete iEmailMgr; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::NewL +// --------------------------------------------------------------------------- +// +CESMRSendMRFSMailTask* CESMRSendMRFSMailTask::NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRCommand aCommand ) + { + FUNC_LOG; + + CESMRSendMRFSMailTask* self = + new (ELeave) CESMRSendMRFSMailTask( + aCalDbMgr, + aEntry, + aMRMailboxUtils, + aCommand ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + return self; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::ConstructL() + { + FUNC_LOG; + BaseConstructL(); + iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::ExecuteTaskL() + { + FUNC_LOG; + CCalEntry* entry = ESMREntry().ValidateEntryL(); + CleanupStack::PushL( entry ); + + iCaluserUtil = CESMRCalUserUtil::NewL( *entry ); + + CCalEntry::TMethod method( entry->MethodL() ); + + // Checking input paramters + if( !(CCalEntry::EMethodRequest == method || + CCalEntry::EMethodCancel == method) || + CCalEntry::EAppt != entry->EntryTypeL() ) + { + DoLeaveIfErrorL( KErrArgument ); + } + + // Get entries to be sent + GetEntriesToBeSentL(); + ResolveSendTypeL(); + + if ( NeedToSendInvitationL() ) + { + TInt entryCount( iEntriesToSend.Count() ); + for (TInt i(0); i < entryCount; ++i ) + { + iEntryToSend = iEntriesToSend[i]; + ConstructMailL(); + TInt ret = iEmailMgr->SendMessageL(); + User::LeaveIfError(ret); + } + } + + if ( EESMRCmdSendMRUpdate == iCommand && + NeedToSendCancellationL() ) + { + delete iEmailMgr; iEmailMgr = NULL; + iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); + + TInt entryCount( iEntriesToSend.Count() ); + for (TInt i(0); i < entryCount; ++i ) + { + // Sending cancellation to removed attendees + iEntryToSend = iEntriesToSend[i]; + iEntryToSend->SetMethodL( CCalEntry::EMethodCancel ); + + ConstructMailL(); + TInt ret = iEmailMgr->SendMessageL(); + User::LeaveIfError(ret); + } + } + + CleanupStack::PopAndDestroy( entry ); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::ConstructMailL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::ConstructMailL() + { + FUNC_LOG; + + // create text formatter: + CESMRMailPlainTextFormatter* textFormatter = + CESMRMailPlainTextFormatter::NewLC( MailboxUtils() ); + + // Prepare email manager for sending + HBufC* mbOwnerAddr = ResolveUsedMailboxUserAddressLC(); + TPtrC emailAddr( ESMRHelper::AddressWithoutMailtoPrefix( *mbOwnerAddr ) ); + iEmailMgr->PrepareForSendingL( emailAddr ); + + TBool isForwarded( ESMREntry().IsForwardedL() ); + if ( isForwarded ) + { + CCalUser* organizer = iEntryToSend->OrganizerL(); + CCalUser* forwardOrganizer = + CCalUser::NewL( + organizer->Address(), + emailAddr ); + CleanupStack::PushL( forwardOrganizer ); + forwardOrganizer->SetCommonNameL( organizer->CommonName() ); + + // Ownership is transferred to entry + iEntryToSend->SetOrganizerL( forwardOrganizer ); + CleanupStack::Pop( forwardOrganizer ); + + iEmailMgr->SetSenderL( + forwardOrganizer->Address(),forwardOrganizer->CommonName() ); + + iEmailMgr->SetReplyToAddressL( + forwardOrganizer->Address(), forwardOrganizer->CommonName() ); + + organizer = NULL; + forwardOrganizer = NULL; + } + + CleanupStack::PopAndDestroy( mbOwnerAddr ); + + // set the email subject: + HBufC* subject = NULL; + if ( CCalEntry::EMethodRequest == iEntryToSend->MethodL() ) + { + subject = textFormatter->Subject16LC( + *iEntryToSend, + ESMREntry().IsForwardedL(), + EESMRCmdSendMRUpdate == iCommand ); + } + else + { + subject = textFormatter->Subject16LC( + *iEntryToSend, + ESMREntry().IsForwardedL(), + EFalse ); + } + + iEmailMgr->SetSubjectL( *subject ); + CleanupStack::PopAndDestroy( subject ); + subject = NULL; + + AddAttendeesL(); + + // Set text/plain part: + HBufC* body = textFormatter->Body16LC( *iEntryToSend ); + iEmailMgr->CreateTextPlainPartL( *body ); + CleanupStack::PopAndDestroy(body); + body = NULL; + + // export the calendar entry in iCal format: + UpdateSummaryL( *iEntryToSend, *textFormatter ); + + TInt priority( iEntryToSend->PriorityL() ); + SetCorrectAttendeesToEntryL(); + CESMRCalImportExporter* calExporter = CESMRCalImportExporter::NewLC(); + HBufC* calendarPart = calExporter->ExportToICal16LC( *iEntryToSend ); + + // Set text/calendar part: + CESMRFSEMailManager::TESMRMethod method( + CESMRFSEMailManager::EESMRMethodRequest); + + CCalEntry::TMethod entryMethod( iEntryToSend->MethodL() ); + switch ( entryMethod ) + { + case CCalEntry::EMethodRequest: + { + method = CESMRFSEMailManager::EESMRMethodRequest; + } + break; + case CCalEntry::EMethodCancel: + { + method = CESMRFSEMailManager::EESMRMethodCancel; + } + break; + case CCalEntry::EMethodReply://fallthrough, EMethodReply not needed + default: + break; + } + + if ( CCalEntry::EMethodCancel == entryMethod ) + { + TFileName fileName(KCancelFile); + User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); + SaveICalToFileL( *calendarPart, fileName ); + iEmailMgr->CreateTextCalendarPartL(method, fileName); + } + else + { + TFileName fileName(KFile); + User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); + SaveICalToFileL( *calendarPart, fileName ); + iEmailMgr->CreateTextCalendarPartL(method, fileName); + + AddAttachmentsL(); + } + + CleanupStack::PopAndDestroy(3, textFormatter); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::SaveICalToFileL +// --------------------------------------------------------------------------- +// +TInt CESMRSendMRFSMailTask::SaveICalToFileL( const TDesC& aICal, + const TDesC& aFilename ) + { + FUNC_LOG; + //create 8 bit buffer for temp file content + TInt length = aICal.Length() * 2; + HBufC8* buffer = HBufC8::NewLC( length ); + TPtr8 des = buffer->Des(); + + // covert the 16 bit iCal to 8 bit iCal: + TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8(des, aICal); + + RFs& fs( CCoeEnv::Static()->FsSession() ); + + // ensure the path exists: + //remove hardcoded paths + //BaflUtils::EnsurePathExistsL(fs, KPath); + // + + // delete previous file + fs.Delete( aFilename ); + + // save the iCal to file system: + RFile file; + User::LeaveIfError(file.Create(fs, aFilename, EFileWrite)); + CleanupClosePushL(file); + User::LeaveIfError(file.Write(*buffer)); + + // clean up: + CleanupStack::PopAndDestroy(2, buffer); // file, fs, buffer + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::AddAttendeesL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::AddAttendeesL() + { + FUNC_LOG; + + RArray requiredAttendees; + CleanupClosePushL( requiredAttendees ); + + RArray optionalAttendees; + CleanupClosePushL( optionalAttendees ); + + GetAttendeesToBeSentL( requiredAttendees, optionalAttendees ); + + // Add recipients and cc-recipients + TInt attendeeCount( requiredAttendees.Count() ); + TInt optAttendeeCount( optionalAttendees.Count() ); + + __ASSERT_DEBUG( attendeeCount || optAttendeeCount, Panic(EESMRSendMRFSAttendeesMissing) ); + + if ( !attendeeCount && !optAttendeeCount) + { + DoLeaveIfErrorL( KErrArgument ); + } + + for (TInt i(0); i < attendeeCount; ++i) + { + TPtrC emailAddr( requiredAttendees[i]->Address() ); + + + iEmailMgr->AppendToRecipientL( + emailAddr, + requiredAttendees[i]->CommonName() ); + } + + for (TInt i(0); i < optAttendeeCount; ++i) + { + TPtrC emailAddr( optionalAttendees[i]->Address() ); + + + iEmailMgr->AppendCCRecipientL( + emailAddr, + optionalAttendees[i]->CommonName() ); + } + + CleanupStack::PopAndDestroy(2, &requiredAttendees ); + + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::ResolveUsedMailboxUserAddressLC +// --------------------------------------------------------------------------- +// +HBufC* CESMRSendMRFSMailTask::ResolveUsedMailboxUserAddressLC() + { + FUNC_LOG; + + HBufC* mailboxUserAddress = NULL; + MESMRMeetingRequestEntry& mrEntry( ESMREntry()); + if ( mrEntry.IsForwardedL() ) + { + // Entry is forwarded --> Use default mailbox + CMRMailboxUtils::TMailboxInfo mbInfo; + CMRMailboxUtils& mbUtils( MailboxUtils() ); + mbUtils.GetDefaultMRMailBoxL( mbInfo ); + mailboxUserAddress = mbInfo.iEmailAddress.AllocLC(); + } + else + { + mailboxUserAddress = mrEntry.CalendarOwnerAddressL().AllocLC(); + } + + return mailboxUserAddress; + } + + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::ResolveSendTypeL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::ResolveSendTypeL() + { + FUNC_LOG; + + if ( EESMRCmdSendMRUpdate == iCommand ) + { + RArray addedAttendees; + CleanupClosePushL( addedAttendees ); + + RArray removedAttendees; + CleanupClosePushL( removedAttendees ); + + ESMREntry().GetAddedAttendeesL( + addedAttendees, + EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); + ESMREntry().GetRemovedAttendeesL( + removedAttendees, + EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); + + if ( addedAttendees.Count() || removedAttendees.Count() ) + { + TInt sendType = CESMRGUIListQuery::ExecuteL( + CESMRGUIListQuery::EESMRSendUpdateToAllQuery ); + + if ( KErrCancel == sendType ) + { + User::Leave( KErrCancel ); + } + + iSendType = static_cast(sendType ); + } + + CleanupStack::PopAndDestroy( &removedAttendees ); + CleanupStack::PopAndDestroy( &addedAttendees ); + } + + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::NeedToSendInvitationL +// --------------------------------------------------------------------------- +// +TBool CESMRSendMRFSMailTask::NeedToSendInvitationL() + { + FUNC_LOG; + + TBool retValue( ETrue ); + + RArray addedAttendees; + CleanupClosePushL( addedAttendees ); + + if ( EESMRCmdSendMRUpdate == iCommand && + ESentToAddedAndRemoved == iSendType ) + { + ESMREntry().GetAddedAttendeesL( + addedAttendees, + EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); + + if ( !addedAttendees.Count() ) + { + retValue = EFalse; + } + } + + CleanupStack::PopAndDestroy( &addedAttendees ); + + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::NeedToSendCancellationL +// --------------------------------------------------------------------------- +// +TBool CESMRSendMRFSMailTask::NeedToSendCancellationL() + { + FUNC_LOG; + + TBool retValue( EFalse ); + + RArray removedAttendees; + CleanupClosePushL( removedAttendees ); + + if ( EESMRCmdSendMRUpdate == iCommand ) + { + ESMREntry().GetRemovedAttendeesL( + removedAttendees, + EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); + + if ( removedAttendees.Count() ) + { + retValue = ETrue; + } + } + + CleanupStack::PopAndDestroy( &removedAttendees ); + + + return retValue; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::NeedToSendCancellationL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::SetCorrectAttendeesToEntryL() + { + FUNC_LOG; + if ( EESMRCmdSendMRUpdate == iCommand ) + { + TESMRMailPlugin plugin( ESMREntry().CurrentPluginL() ); + + CCalEntry::TMethod method( iEntryToSend->MethodL() ); + + RArray requiredAttendees; + CleanupClosePushL( requiredAttendees ); + + RArray optionalAttendees; + CleanupClosePushL( optionalAttendees ); + + GetAttendeesToBeSentL( requiredAttendees, optionalAttendees ); + + RPointerArray attendees; + CleanupStack::PushL( + TCleanupItem( + CalAttendeePointerArrayCleanup, + &attendees ) ); + + + TInt attendeeCount( requiredAttendees.Count() ); + for ( TInt i(0); i < attendeeCount; ++i ) + { + // Make copy of the attendees + CCalAttendee* attendee = ESMRHelper::CopyAttendeeL(*requiredAttendees[i] ); + User::LeaveIfError( + attendees.Append( attendee ) ); + } + + TInt optionalAttendeeCount( optionalAttendees.Count() ); + for ( TInt i(0); i < optionalAttendeeCount; ++i ) + { + // Make copy of the attendees + CCalAttendee* attendee = ESMRHelper::CopyAttendeeL(*optionalAttendees[i] ); + User::LeaveIfError( + attendees.Append( attendee ) ); + } + + // Clean attendee array + while ( iEntryToSend->AttendeesL().Count() ) + { + iEntryToSend->DeleteAttendeeL( 0 ); + } + + while ( attendees.Count() ) + { + CCalAttendee* attendee = attendees[0]; + iEntryToSend->AddAttendeeL( attendee ); + attendees.Remove(0); + } + + CleanupStack::PopAndDestroy( &attendees ); + CleanupStack::PopAndDestroy( &optionalAttendees ); + CleanupStack::PopAndDestroy( &requiredAttendees ); + } + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::NeedToSendCancellationL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::GetAttendeesToBeSentL( + RArray& aRequiredAttendees, + RArray& aOptionalAttendees ) + { + FUNC_LOG; + CCalEntry::TMethod method( iEntryToSend->MethodL() ); + + if ( EESMRCmdSendMRUpdate == iCommand && + ESentToAddedAndRemoved == iSendType && + CCalEntry::EMethodRequest == method ) + { + ESMREntry().GetAddedAttendeesL( + aRequiredAttendees, + EESMRRoleRequiredAttendee ); + ESMREntry().GetAddedAttendeesL( + aOptionalAttendees, + EESMRRoleOptionalAttendee ); + } + else if (EESMRCmdSendMRUpdate == iCommand && + CCalEntry::EMethodCancel == method ) + { + ESMREntry().GetRemovedAttendeesL( + aRequiredAttendees, + EESMRRoleRequiredAttendee ); + ESMREntry().GetRemovedAttendeesL( + aOptionalAttendees, + EESMRRoleOptionalAttendee ); + } + else + { + iCaluserUtil->GetAttendeesL( + aRequiredAttendees, + EESMRRoleRequiredAttendee ); + iCaluserUtil->GetAttendeesL( + aOptionalAttendees, + EESMRRoleOptionalAttendee ); + } + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::GetEntriesToBeSentL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::GetEntriesToBeSentL() + { + FUNC_LOG; + // Clear the entry array + iEntriesToSend.ResetAndDestroy(); + + if ( EESMRCmdSendMRUpdate == iCommand ) + { + // We are sending update and we need to send all the entries + CCalEntry* mainEntry = ESMREntry().ValidateEntryL(); + CleanupStack::PushL( mainEntry ); + + if ( MESMRCalEntry::EESMRAllInSeries == ESMREntry().RecurrenceModRule() ) + { + // Update child entries sequence number + ESMREntry().UpdateChildEntriesSeqNumbersL(); + + // We are sending update to series + // Also the modifying entries need to be sent + // Otherwise the modifying entries may disappear from the + // attendees calendar. + CalDbMgr().EntryViewL( *mainEntry )->FetchL( + mainEntry->UidL(), + iEntriesToSend ); + // set the phone owner for the series + CESMRFsMailboxUtils* fsMbUtils =CESMRFsMailboxUtils::NewL( MailboxUtils() ); + CleanupStack::PushL( fsMbUtils ); + for (TInt i =0 ; i < iEntriesToSend.Count(); i++) + { + fsMbUtils->SetPhoneOwnerL( *iEntriesToSend[i] ); + } + CleanupStack::PopAndDestroy( fsMbUtils ); + fsMbUtils = NULL; + CleanupStack::PopAndDestroy( mainEntry ); + } + else + { + // Ownership transferred + TInt err = iEntriesToSend.Append( mainEntry ); + User::LeaveIfError( err ); + + CleanupStack::Pop( mainEntry ); + } + + mainEntry = NULL; + } + else + { + // We are sending either: + // a) Single entry + // b) Modified instance from series + // c) First invitation to series + // d) forwarding entry + TInt err = iEntriesToSend.Append( ESMREntry().ValidateEntryL() ); + User::LeaveIfError( err ); + } + + __ASSERT_DEBUG( iEntriesToSend.Count(), Panic(EESMRSendMRNoEntriesToSend ) ); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRFSMailTask::AddAttachmentsL +// --------------------------------------------------------------------------- +// +void CESMRSendMRFSMailTask::AddAttachmentsL() + { + FUNC_LOG; + + RFs fsSession; + User::LeaveIfError( fsSession.Connect() ); + CleanupClosePushL( fsSession ); + + User::LeaveIfError( fsSession.ShareProtected() ); + + TInt attachmentCount( iEntryToSend->AttachmentCountL() ); + + for ( TInt i(0); i < attachmentCount; ++i ) + { + CCalAttachment* attachment = iEntryToSend->AttachmentL( i ); + + if ( CCalAttachment::EFile == attachment->Type() ) + { + // Adding file attachment to MR email message + CCalAttachmentFile* fileAttachment = attachment->FileAttachment(); + + RFile file; + CleanupClosePushL( file ); + fileAttachment->FetchFileHandleL( file ); + + iEmailMgr->SetAttachmentL( + file, + attachment->MimeType() ); + + TESMRMailPlugin plugin( ESMREntry().CurrentPluginL() ); + if ( EESMRImapPop == plugin ) + { + CleanupStack::Pop( &file ); + } + else + { + CleanupStack::PopAndDestroy( &file ); + } + } + } + + CleanupStack::PopAndDestroy( &fsSession ); + } + +// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrrespfsmailtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrrespfsmailtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,359 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for sending MR response via fs email +* +*/ +#include "emailtrace.h" +#include "cesmrsendmrrespfsmailtask.h" + +#include +#include +#include +// +#include "mmrinfoprocessor.h" +// +#include +#include +#include +#include + +#include "cesmrcaldbmgr.h" +#include "mesmrmeetingrequestentry.h" +#include "cesmrmailplaitextformatter.h" +#include "cesmrfsemailmanager.h" +#include "cesmrcalimportexporter.h" +#include "tesmrinputparams.h" +#include "cesmrcaluserutil.h" +#include "esmrhelper.h" + +// Unnamed namespace for local definitions +namespace { +// Literal for plain text separator +_LIT( KPlainTextResponseTxtSeparator, + "\n----------------------------------------\n"); + + +// Literal for response iCal file +// remove hard coded paths +//_LIT( KPath, "c:\\temp\\" ); //codescanner::driveletters +//_LIT( KFileAndPath, "c:\\temp\\response.ics" ); //codescanner::driveletters +//_LIT( KPath, "temp\\" ); +_LIT( KFileName, "temp\\response.ics" ); +// + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::CESMRSendMRRespFSMailTask +// --------------------------------------------------------------------------- +// +CESMRSendMRRespFSMailTask::CESMRSendMRRespFSMailTask( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType ) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), + iCommand( aCommand ), + iResponseType( aResponseType ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::~CESMRSendMRRespFSMailTask +// --------------------------------------------------------------------------- +// +CESMRSendMRRespFSMailTask::~CESMRSendMRRespFSMailTask() + { + FUNC_LOG; + delete iCaluserUtil; + delete iEntryToSend; + delete iResponseMessage; + delete iEmailMgr; + delete iTextFormatter; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::NewL +// --------------------------------------------------------------------------- +// +CESMRSendMRRespFSMailTask* CESMRSendMRRespFSMailTask::NewL( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType, + const TDesC& aResponseMessage ) + { + FUNC_LOG; + CESMRSendMRRespFSMailTask* self = + new (ELeave) CESMRSendMRRespFSMailTask( + aCommand, + aCalDbMgr, + aEntry, + aMRMailboxUtils, + aResponseType ); + + CleanupStack::PushL(self); + self->ConstructL(aResponseMessage); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::ConstructL( + const TDesC& aResponseMessage ) + { + FUNC_LOG; + BaseConstructL(); + iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); + iTextFormatter = CESMRMailPlainTextFormatter::NewL( MailboxUtils() ); + iResponseMessage = aResponseMessage.AllocL(); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::ExecuteTaskL() + { + FUNC_LOG; + iEntryToSend = ESMREntry().ValidateEntryL(); + + // Checking input paramters + if( CCalEntry::EMethodReply != iEntryToSend->MethodL() && + EESMRCmdRemoveFromCalendar != iCommand ) + { + User::Leave( KErrArgument ); + } + + if ( ESMREntry().IsSyncObjectPresent( ) ) + { + SendMailViaSyncL(); + } + else + { + iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); + + // create mail message: + ConstructMailL(); + + TInt ret = iEmailMgr->SendMessageL(); + User::LeaveIfError(ret); + } + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::ConstructMailL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::ConstructMailL() + { + FUNC_LOG; + // Prepare email manager for sending + CCalUser *mailboxUser = ESMREntry().Entry().PhoneOwnerL(); + iEmailMgr->PrepareForSendingL( + ESMRHelper::AddressWithoutMailtoPrefix( + mailboxUser->Address() ) ); + + // set the email subject + HBufC* subject = + iTextFormatter->Subject16LC( + *iEntryToSend, + ESMREntry().IsForwardedL(), + ESMREntry().IsEntryEditedL() ); + + iEmailMgr->SetSubjectL(*subject); + CleanupStack::PopAndDestroy(subject); + subject = NULL; + + // Set the To recipient + iEmailMgr->AppendToRecipientL( + iEntryToSend->OrganizerL()->Address(), + iEntryToSend->OrganizerL()->CommonName() ); + + // Set text/plain part + AddPlainTextPartL(); + + // Set text/calendar part: + AddCalendarPartL(); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::AddPlainTextPartL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::AddPlainTextPartL() + { + FUNC_LOG; + + HBufC* plainText = iTextFormatter->Body16LC( *iEntryToSend ); + if ( iResponseMessage ) + { + TPtrC plainTextSeparator( KPlainTextResponseTxtSeparator() ); + + CleanupStack::Pop( plainText ); + + plainText = plainText->ReAlloc( + plainText->Length() + + plainTextSeparator.Length() + + iResponseMessage->Length() ); + + CleanupStack::PushL( plainText ); + + TPtr ptrPlainText( plainText->Des() ); + ptrPlainText.Append( plainTextSeparator ); + ptrPlainText.Append( *iResponseMessage ); + } + + iEmailMgr->CreateTextPlainPartL(*plainText); + CleanupStack::PopAndDestroy(plainText); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::AddCalendarPartL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::AddCalendarPartL() + { + FUNC_LOG; + SetAttendeesL(); + + CESMRCalImportExporter* calExporter = + CESMRCalImportExporter::NewLC(); + + HBufC* calendarPart = + calExporter->ExportToICal16LC( *iEntryToSend ); + + // removing hardcoded paths + TFileName fileName(KFileName); + User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); + SaveICalToFileL( *calendarPart, fileName ); + iEmailMgr->CreateTextCalendarPartL( + CESMRFSEMailManager::EESMRMethodResponse, + fileName); + // + + CleanupStack::PopAndDestroy( calendarPart ); + CleanupStack::PopAndDestroy( calExporter ); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::SendMailViaSyncL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::SendMailViaSyncL() + { + FUNC_LOG; + TESMRInputParams startupParams; + + if ( ESMREntry().StartupParameters(startupParams) ) + { + MMRInfoProcessor::TMRInfoResponseMode responseMode ( + MMRInfoProcessor::EMRInfoResponseSendAndSync ); + + if ( EESMRResponseDontSend == iResponseType ) + { + responseMode = MMRInfoProcessor::EMRInfoResponseSync; + } + else if ( EESMRCmdRemoveFromCalendar == iCommand ) + { + responseMode = MMRInfoProcessor::EMRInfoRemoveFromCal; + } + + MMRInfoObject& infoObject = ESMREntry().ValidateSyncObjectL(); + iEmailMgr->SendMailViaSyncL( + startupParams, + infoObject, + responseMode, + *iResponseMessage ); + } + else + { + User::Leave( KErrArgument ); + } + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::SaveICalToFileL +// --------------------------------------------------------------------------- +// +TInt CESMRSendMRRespFSMailTask::SaveICalToFileL( + const TDesC& aICal, + const TDesC& aFilename ) + { + FUNC_LOG; + //create 8 bit buffer for temp file content + TInt length = aICal.Length() * 2; + HBufC8* buffer = HBufC8::NewLC( length ); + TPtr8 des = buffer->Des(); + + // covert the 16 bit iCal to 8 bit iCal: + TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8(des, aICal); + + RFs& fs( CCoeEnv::Static()->FsSession() ); + + // ensure the path exists: + // remove hard coded paths + //BaflUtils::EnsurePathExistsL(fs, KPath); + // + + // delete previous file + fs.Delete( aFilename ); + + // save the iCal to file system: + RFile file; + User::LeaveIfError(file.Create(fs, aFilename, EFileWrite)); + CleanupClosePushL(file); + User::LeaveIfError(file.Write(*buffer)); + + // clean up: + CleanupStack::PopAndDestroy(2, buffer); // file, fs, buffer + + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespFSMailTask::SetAttendeesL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespFSMailTask::SetAttendeesL() + { + FUNC_LOG; + CCalAttendee* thisAttendee = + ESMRHelper::CopyAttendeeLC( + *(MailboxUtils().ThisAttendeeL( *iEntryToSend )) ); + + RPointerArray& attendeeList = iEntryToSend->AttendeesL(); + + while ( attendeeList.Count() ) + { + //remove attendees from entry that is to be forwarded + iEntryToSend->DeleteAttendeeL( 0 ); + } + + // Ownership is transferred + iEntryToSend->AddAttendeeL( thisAttendee ); + CleanupStack::Pop( thisAttendee ); + } + +//EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrrespmailtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrsendmrrespmailtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR base task +* +*/ + +#include "emailtrace.h" +#include "cesmrsendmrrespmailtask.h" + +#include +#include +#include +#include +#include "cesmrcalimportexporter.h" +#include "mesmrmeetingrequestentry.h" +#include "esmrhelper.h" +#include "cesmrlistquery.h" +#include "cesmrmeetingrequestsender.h" +#include "cesmrresponsedialog.h" + + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRSendMRRespMailTask::CESMRSendMRRespMailTask +// --------------------------------------------------------------------------- +// +CESMRSendMRRespMailTask::CESMRSendMRRespMailTask( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType ) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), + iCommand( aCommand ), + iResponseType( aResponseType ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespMailTask::~CESMRSendMRRespMailTask +// --------------------------------------------------------------------------- +// +CESMRSendMRRespMailTask::~CESMRSendMRRespMailTask() + { + FUNC_LOG; + delete iResponseMessage; + delete iResponseEntry; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespMailTask::NewL +// --------------------------------------------------------------------------- +// +CESMRSendMRRespMailTask* CESMRSendMRRespMailTask::NewL( + TESMRCommand aCommand, + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils, + TESMRResponseType aResponseType, + const TDesC& aResponseMessage ) + { + FUNC_LOG; + CESMRSendMRRespMailTask* self = + new (ELeave) CESMRSendMRRespMailTask( + aCommand, + aCalDbMgr, + aEntry, + aMRMailboxUtils, + aResponseType ); + + CleanupStack::PushL(self); + self->ConstructL( aResponseMessage ); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespMailTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespMailTask::ConstructL( + const TDesC& aResponseMessage ) + { + FUNC_LOG; + BaseConstructL(); + iResponseMessage = aResponseMessage.AllocL(); + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespMailTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespMailTask::ExecuteTaskL() + { + FUNC_LOG; + // Checking input paramters + if ( EESMRResponseMessage == iResponseType && + !iResponseMessage->Length() ) + { + User::Leave( KErrArgument ); + } + + if( CCalEntry::EMethodReply != ESMREntry().Entry().MethodL() ) + { + User::Leave( KErrArgument ); + } + + if ( EESMRResponseDontSend != iResponseType ) + { + SendResponseMessageL(); + } + } + +// --------------------------------------------------------------------------- +// CESMRSendMRRespMailTask::SendResponseMessageL +// --------------------------------------------------------------------------- +// +void CESMRSendMRRespMailTask::SendResponseMessageL() + { + FUNC_LOG; + CESMRMeetingRequestSender* sender = + CESMRMeetingRequestSender::NewL( MailboxUtils() ); + CleanupStack::PushL( sender ); + + if ( iResponseMessage ) + { + sender->CreateAndSendMeetingRequestL( + ESMREntry(), + *iResponseMessage ); + } + else + { + sender->CreateAndSendMeetingRequestL( + ESMREntry() ); + } + + CleanupStack::PopAndDestroy( sender ); + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrstoremrtask.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrstoremrtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,197 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR base task +* +*/ + +#include "emailtrace.h" +#include "cesmrstoremrtask.h" + +#include +#include +// +#include "mesmrutilstombsext.h" +// +#include "cesmrcaldbmgr.h" +#include "mesmrmeetingrequestentry.h" + +namespace { // codescanner::namespace + +#ifdef _DEBUG + +// Literal for panics +_LIT( KESMRStoreMR, "ESMRStoreMR" ); + +// Panic codes +enum TESMRStoreMRPanic + { + EESMRStoreMRNotMeetingRequest // Entry is not meeting request + }; + +// ======== LOCAL FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Panic wrapper method +// --------------------------------------------------------------------------- +// +void Panic( TESMRStoreMRPanic aPanic ) + { + User::Panic( KESMRStoreMR, aPanic ); + } + +#endif // _DEBUG + +}//namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRStoreMRTask::CESMRStoreMRTask +// --------------------------------------------------------------------------- +// +CESMRStoreMRTask::CESMRStoreMRTask( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) +: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRStoreMRTask::~CESMRStoreMRTask +// --------------------------------------------------------------------------- +// +CESMRStoreMRTask::~CESMRStoreMRTask() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRStoreMRTask::NewL +// --------------------------------------------------------------------------- +// +CESMRStoreMRTask* CESMRStoreMRTask::NewL( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) + { + FUNC_LOG; + + CESMRStoreMRTask* self = + new (ELeave) CESMRStoreMRTask( + aCalDbMgr, + aEntry, + aMRMailboxUtils ); + + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + + + return self; + } + +// --------------------------------------------------------------------------- +// CESMRStoreMRTask::ConstructL +// --------------------------------------------------------------------------- +// +void CESMRStoreMRTask::ConstructL() + { + FUNC_LOG; + BaseConstructL(); + } + +// --------------------------------------------------------------------------- +// CESMRStoreMRTask::ExecuteTaskL +// --------------------------------------------------------------------------- +// +void CESMRStoreMRTask::ExecuteTaskL() + { + FUNC_LOG; + + // Store to calendar DB + StoreEntryToDbL(); + + } + +// --------------------------------------------------------------------------- +// CESMRStoreMRTask::StoreEntryToDbL +// --------------------------------------------------------------------------- +// +void CESMRStoreMRTask::StoreEntryToDbL() + { + FUNC_LOG; + + MESMRMeetingRequestEntry& mrEntry = ESMREntry(); + CCalEntry& entry = mrEntry.Entry(); + + const CCalEntry::TType KMRType( + CCalEntry::EAppt ); + + CCalEntry::TType entryType( entry.EntryTypeL() ); + + // Check entry type +#ifdef _DEBUG + + __ASSERT_DEBUG( + KMRType == entryType, + Panic(EESMRStoreMRNotMeetingRequest) ); + +#else + + if ( KMRType != entryType ) + { + User::Leave( KErrArgument ); + } + +#endif // _DEBUG + + TBool isEdited( mrEntry.IsEntryEditedL() ); + TBool forwarded( mrEntry.IsForwardedL() ); + + if ( !forwarded ) + { + if ( isEdited ) + { + // Entry is edited --> We will update time stamp + mrEntry.UpdateTimeStampL(); + } + + // Check storing result + MESMRUtilsTombsExt::TESMRUtilsDbResult res = + CalDbMgr().StoreEntryCondL( entry, EFalse, ETrue ); + + // Check that entry can be saved + if ( MESMRUtilsTombsExt::ECheckedValidNew == res || + MESMRUtilsTombsExt::ECheckedValidUpdate == res || + isEdited ) + { + CCalEntry* validatedEntry = mrEntry.ValidateEntryL(); + CleanupStack::PushL( validatedEntry ); + + CalDbMgr().StoreEntryCondL( *validatedEntry, EFalse ); + + CleanupStack::PopAndDestroy( validatedEntry ); + + mrEntry.UpdateEntryAfterStoringL(); + } + } + + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cesmrtaskbase.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cesmrtaskbase.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for ESMR base task +* +*/ + +#include "emailtrace.h" +#include "cesmrtaskbase.h" + +#include +#include "mesmrmeetingrequestentry.h" +#include "cesmrcaldbmgr.h" + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CESMRTaskBase::CESMRTaskBase +// --------------------------------------------------------------------------- +// +CESMRTaskBase::CESMRTaskBase( + MESMRCalDbMgr& aCalDbMgr, + MESMRMeetingRequestEntry& aEntry, + CMRMailboxUtils& aMRMailboxUtils ) +: iCalDbMgr(aCalDbMgr), + iEntry(aEntry), + iMRMailboxUtils( aMRMailboxUtils ) + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTaskBase::~CESMRTaskBase +// --------------------------------------------------------------------------- +// +CESMRTaskBase::~CESMRTaskBase() + { + FUNC_LOG; + //do nothing + } + +// --------------------------------------------------------------------------- +// CESMRTaskBase::BaseConstructL +// --------------------------------------------------------------------------- +// +void CESMRTaskBase::BaseConstructL() + { + FUNC_LOG; + //do nothing + } + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/cmrtaskplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/cmrtaskplugin.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,745 @@ +/* +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for Meeting request task factory +* +*/ + +#include "emailtrace.h" +#include "cmrtaskplugin.h" + +#include "cesmrcombinedtask.h" +#include "cesmrstoremrtask.h" +#include "cesmrsendmrrespmailtask.h" +#include "cesmrdeletefromdbmrtask.h" +#include "cesmrsendmrrespfsmailtask.h" +#include "cesmrsendmrfsmailtask.h" +#include "cesmrforwardasfsmailtask.h" +#include "cesmrsendmrfsmailreplytask.h" + +#include "mesmrmeetingrequestentry.h" +#include "cesmrconfirmationquery.h" +#include "cesmrlistquery.h" +#include "cesmrresponsedialog.h" +#include "tesmrinputparams.h" +#include "esmrconfig.hrh" +#include "cesmrcaldbmgr.h" +// +#include "CFSMailCommon.h" +#include "CFSMailClient.h" +#include "CFSMailMessage.h" +#include "CFSMailBox.h" +// + + +namespace { + +#ifdef _DEBUG + +// Panic literal for ESMRTaskFactory +_LIT( KESMRTaskFactoryPanicTxt, "MRTaskPlugin" ); + +/** Panic code definitions */ +enum TESMRTaskFactoryPanic + { + EESMRTaskFactoryInvalidTask, // Trying to create invalid task + EESMRTaskFactoryIllegalTask, // Task can not be performed for given entry. + }; + + +// --------------------------------------------------------------------------- +// Panic wrapper method +// --------------------------------------------------------------------------- +// +void Panic( TESMRTaskFactoryPanic aPanic ) + { + + User::Panic( KESMRTaskFactoryPanicTxt, aPanic ); + } + +#endif // _DEBUG + +/** + * Checks whether reply mail is required by the plug-in or not. + * @param aEntry Regerence to MR entry + */ +TBool ReplyMailRequiredL( + MESMRMeetingRequestEntry& aEntry ) + { + TBool replyNeeded( EFalse ); + + TESMRInputParams esmrParams; + if ( aEntry.IsOpenedFromMail() && + aEntry.StartupParameters(esmrParams) ) + { + TFSMailMsgId mailboxId( + esmrParams.iMailMessage->GetMailBoxId() ); + + CFSMailBox* mailbox = + esmrParams.iMailClient->GetMailBoxByUidL( mailboxId ); + CleanupStack::PushL( mailbox ); + + if ( mailbox->HasCapability(EFSMBoxCapaMRRequiresReplyEmail ) ) + { + replyNeeded = ETrue; + } + CleanupStack::PopAndDestroy( mailbox ); + mailbox = NULL; + } + + return replyNeeded; + } + +// --------------------------------------------------------------------------- +// Queries response query from user. +// --------------------------------------------------------------------------- +// +HBufC* QuerySendResponseQueryFromUserLC( + TESMRCommand aCommand, + TESMRResponseType& aResponseType, + MESMRMeetingRequestEntry& aEntry ) + { + HBufC* responseMessage = NULL; + TInt ret = EESMRResponsePlain; + + TESMRAttendeeStatus status( + EESMRAttendeeStatusDecline ); + + // convert the command to status: + switch ( aCommand ) + { + case EESMRCmdAcceptMR: + { + status = EESMRAttendeeStatusAccept; + break; + } + case EESMRCmdTentativeMR: + { + status = EESMRAttendeeStatusTentative; + break; + } + case EESMRCmdDeclineMR: + { + status = EESMRAttendeeStatusDecline; + break; + } + default: + { + // never should come here. + User::Leave(KErrGeneral); + break; + } + } + + TBool replyRequired( ReplyMailRequiredL(aEntry) ); + + if ( replyRequired ) + { + ret = CESMRListQuery::ExecuteEditBeforeSendWithSendOptOnlyL( status ); + } + else + { + ret = CESMRListQuery::ExecuteEditBeforeSendL( status ); + } + + // User has selected cancel from dialog. Interrupt task execution, + // leave will be trapped in cesmecontroller (esmrviewer module) + if ( ret != KErrCancel ) + { + if ( aEntry.IsRecurrentEventL() ) + { + aEntry.SetModifyingRuleL( MESMRCalEntry::EESMRAllInSeries ); + } + } + else + { + User::Leave( KErrCancel ); + } + + aResponseType = static_cast(ret); + + // set the response status to cal entry: + aEntry.ConstructReplyL(status); + + if ( EESMRResponseMessage == aResponseType ) + { + CESMRResponseDialog* respDlg = + CESMRResponseDialog::NewL( responseMessage ); + CleanupStack::PushL( respDlg ); + + TBool dialogRetValue( respDlg->ExecuteDlgLD() ); + // Dialog has deleted itself --> Only pop from cleanup stack + CleanupStack::Pop( respDlg ); + + if ( !dialogRetValue ) + { + aEntry.Entry().SetStatusL( CCalEntry::ETentative ); + User::Leave( KErrCancel ); + } + } + if ( responseMessage ) + { + CleanupStack::PushL( responseMessage ); + } + else + { + responseMessage = KNullDesC().AllocLC(); + } + return responseMessage; + } + +} // namespace + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CMRTaskPlugin +// --------------------------------------------------------------------------- +// +inline CMRTaskPlugin::CMRTaskPlugin( MESMRCalDbMgr& aCalDbMgr ) + : iCalDbMgr( aCalDbMgr ) + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::~CMRTaskPlugin +// --------------------------------------------------------------------------- +// +CMRTaskPlugin::~CMRTaskPlugin() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::TaskFactory +// --------------------------------------------------------------------------- +// +CMRTaskPlugin* CMRTaskPlugin::NewL( TAny* aCalDbMgr ) + { + FUNC_LOG; + + MESMRCalDbMgr* calDbMgr = static_cast< MESMRCalDbMgr* >( aCalDbMgr ); + CMRTaskPlugin* self = new(ELeave) CMRTaskPlugin( *calDbMgr ); + + return self; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateTaskL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + MESMRTask* task = NULL; + + MESMRMeetingRequestEntry& mrEntry = + static_cast< MESMRMeetingRequestEntry& >( aEntry ); + + switch (aCommand) + { + case EESMRCmdAcceptMR: + case EESMRCmdTentativeMR: + case EESMRCmdDeclineMR: + task = CreateSendMRResponseViaMailTaskL( aCommand, mrEntry ); + break; + + case EESMRCmdSendMR: + case EESMRCmdSendMRUpdate: + task = CreateSendMRTaskL( aCommand, mrEntry ); + break; + + case EESMRCmdDeleteMR: + case EESMRCmdRemoveFromCalendar: + case EESMRCmdMailDelete: + task = CreateDeleteMRTaskL( aCommand, mrEntry ); + break; + + case EESMRCmdSaveMR: + task = CreateStoreMRToLocalDBTaskL( aCommand, mrEntry ); + break; + + case EESMRCmdForwardAsMeeting: + task = CreateForwardAsMeetingTaskL( aCommand, mrEntry ); + break; + + case EESMRCmdForwardAsMail: + task = CreateForwardAsMailTaskL( mrEntry ); + break; + case EESMRCmdReplyAll: + task = CreateReplyAsMailTaskL( mrEntry, ETrue ); + break; + + case EESMRCmdReply: + task = CreateReplyAsMailTaskL( mrEntry, EFalse ); + break; + + case EESMRCmdCalendarChange: + task = CreateMoveMRToCurrentDBTaskL( mrEntry ); + break; + + default: + __ASSERT_DEBUG(EFalse, Panic(EESMRTaskFactoryInvalidTask) ); + User::Leave( KErrNotSupported ); + break; + } + + + return task; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateSendMRResponseViaMailTask +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateSendMRResponseViaMailTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + + CESMRCombinedTask* task = NULL; + TESMRRole role = aEntry.RoleL(); + + TBool syncObjectPresent( aEntry.IsSyncObjectPresent() ); + TBool isStored( aEntry.IsStoredL() ); + + if ( EESMRRoleRequiredAttendee == role || + EESMRRoleOptionalAttendee == role || + EESMRRoleNonParticipant == role ) + { + task = CESMRCombinedTask::NewL( aEntry, + CESMRCombinedTask::EESMRTrap ); + + CleanupStack::PushL( task ); + + TESMRResponseType responseType( EESMRResponsePlain ); + HBufC* responseMessage = QuerySendResponseQueryFromUserLC( + aCommand, + responseType, + aEntry ); + + if ( !syncObjectPresent && EESMRCmdDeclineMR != aCommand) + { + // Entry is stored or deleted from calendar DB if + // sync object is not present + // Store MR task + AppendTaskL( *task, + CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + } + + if ( EESMRResponseDontSend != responseType || + aEntry.IsSyncObjectPresent() ) + { + // Send MR response via mail freestyle task + AppendTaskL( *task, + CESMRSendMRRespFSMailTask::NewL( + aCommand, + iCalDbMgr, + aEntry, + aEntry.MailboxUtils(), + responseType, + *responseMessage ) ); + } + CleanupStack::PopAndDestroy( responseMessage ); + + if ( !syncObjectPresent && EESMRCmdDeclineMR == aCommand && + isStored ) + { + // Entry is deleted from calendar DB if + // sync object is not present and entry exits in database + // Declined --> Delete MR from cal DB task + AppendTaskL( *task, + CESMRDeleteMRFromDbTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + } + + CleanupStack::Pop( task ); + } + else + { + // Only (opt-)attendees and non-participants can send + // responses + User::Leave( KErrNotSupported ); + } + + + return task; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateSendMRTask +// --------------------------------------------------------------------------- +// + +MESMRTask* CMRTaskPlugin::CreateSendMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + + CESMRCombinedTask* task = CESMRCombinedTask::NewL( aEntry ); + + CleanupStack::PushL( task ); + + if ( !aEntry.IsForwardedL() ) + { + // Store MR task + AppendTaskL( *task, + CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + } + + if ( !aEntry.OccursInPastL() ) + { + if ( aCommand == EESMRCmdSendMR || + aCommand == EESMRCmdSendMRUpdate ) + { + // Send MR response via mail task + AppendTaskL( *task, + CESMRSendMRFSMailTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils(), + aCommand ) ); + } + } + + CleanupStack::Pop( task ); + + + return task; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateDeleteMRTask +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateDeleteMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + + MESMRTask* task = NULL; + + if ( EESMRRoleOrganizer == aEntry.RoleL() ) + { + task = CreateOrganizerDeleteMRTaskL( aCommand, aEntry ); + } + else + { + task = CreateAttendeeDeleteMRTaskL( aCommand, aEntry ); + } + + + return task; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateStoreMRToLocalDBTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateStoreMRToLocalDBTaskL( + TESMRCommand /*aCommand*/, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + return CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ); + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateForwardAsMeetingTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateForwardAsMeetingTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + MESMRTask* task = NULL; + + // Send MR response via mail task is used for forwarding as meeting request + + if ( aCommand == EESMRCmdForwardAsMeeting ) + { + task = CESMRSendMRFSMailTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils(), + aCommand ); + } + return task; + } + + + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateForwardAsMeetingTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateForwardAsMailTaskL( + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + // Send MR response via mail task + return CESMRForwardAsFSMailTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ); + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateReplyAsMailTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateReplyAsMailTaskL( + MESMRMeetingRequestEntry& aEntry, TBool aReplyAll ) + { + FUNC_LOG; + // Send MR reply via mail task + return CESMRSendMRFSMailReplyTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils(), + aReplyAll); + + } + + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateOrganizerDeleteMRTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateOrganizerDeleteMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + + CESMRCombinedTask* task = CESMRCombinedTask::NewL( + aEntry, + CESMRCombinedTask::EESMRTrap ); + + CleanupStack::PushL( task ); + + if ( EESMRCmdDeleteMR == aCommand ) + { + // SYNC_SOLUTION requires the modified entry to be stored into + // calendar db for deletion purposes. + AppendTaskL( *task, + CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + + TUint attendeeFlags( + EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee); + if ( aEntry.AttendeeCountL( attendeeFlags ) && aEntry.IsSentL() + && !aEntry.OccursInPastL() ) + { + // if enrey doesn't need to send canellation, don't query + if( aEntry.SendCanellationAvailable()) + { + // Meeting request contains attendees --> Cancellation message + // needs to be sent + if ( CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery::EESMRSendCancellationInfoToParticipants) ) + { + AppendTaskL( *task, + CESMRSendMRFSMailTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils(), + aCommand ) ); + } + } + aEntry.SetSendCanellationAvailable( ETrue ); + } + } + + // Delete MR from cal DB task + AppendTaskL( *task, + CESMRDeleteMRFromDbTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + + CleanupStack::Pop( task ); + + + return task; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateAttendeeDeleteMRTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateAttendeeDeleteMRTaskL( + TESMRCommand aCommand, + MESMRMeetingRequestEntry& aEntry ) + { + FUNC_LOG; + + TBool pluginRequiresReplyMail( ReplyMailRequiredL(aEntry) ); + + CESMRCombinedTask* task = CESMRCombinedTask::NewL( + aEntry, + CESMRCombinedTask::EESMRTrap ); + + CleanupStack::PushL( task ); + + if ( !aEntry.IsOpenedFromMail() && !aEntry.IsSyncObjectPresent() ) + { + // When deleting from the calendar --> Store first modifying entry + // And then delete that from calendar DB. + // + // When opened from mail --> We do not need to store + // modifying entry into calendar database. + // + AppendTaskL( *task, + CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + } + + + if ( EESMRCmdDeleteMR == aCommand || + EESMRCmdMailDelete == aCommand || + (pluginRequiresReplyMail && EESMRCmdRemoveFromCalendar == aCommand ) ) + { + TBool sendDecline(EFalse); + + if ( pluginRequiresReplyMail ) + { + sendDecline = ETrue; + } + else + { + sendDecline = CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery::EESMRSendDecline ); + } + + if( sendDecline ) + { + // Send MR response via mail task. No response message is appended + // to sent email + + TESMRCommand command( EESMRCmdDeclineMR ); + + if ( pluginRequiresReplyMail && EESMRCmdRemoveFromCalendar == aCommand ) + { + command = EESMRCmdRemoveFromCalendar; + } + + AppendTaskL( *task, + CESMRSendMRRespFSMailTask::NewL( + command, + iCalDbMgr, + aEntry, + aEntry.MailboxUtils(), + EESMRResponsePlain, + KNullDesC() ) ); + } + } + + // Delete MR from cal DB task if plugin does not handle it + if ( !pluginRequiresReplyMail ) + { + AppendTaskL( *task, + CESMRDeleteMRFromDbTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + } + + CleanupStack::Pop( task ); + + + return task; + } + +// --------------------------------------------------------------------------- +// CMRTaskPlugin::CreateMoveMRToCurrentDBTaskL +// --------------------------------------------------------------------------- +// +MESMRTask* CMRTaskPlugin::CreateMoveMRToCurrentDBTaskL( + MESMRMeetingRequestEntry& aEntry ) + { + // Check first that entry can be moved + if ( aEntry.IsSyncObjectPresent() ) + { + __ASSERT_DEBUG( EFalse, Panic( EESMRTaskFactoryIllegalTask ) ); + User::Leave( KErrNotSupported ); + } + + // Create combined task + CESMRCombinedTask* task = CESMRCombinedTask::NewL( + aEntry, + CESMRCombinedTask::EESMRTrap ); + + CleanupStack::PushL( task ); + + if ( !aEntry.IsOpenedFromMail() ) + { + // When deleting from the calendar --> Store first modifying entry + // And then delete that from calendar DB. + // + // When opened from mail --> We do not need to store + // modifying entry into calendar database. + // + AppendTaskL( + *task, + CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + } + + // Delete entry from old db + AppendTaskL( + *task, + CESMRDeleteMRFromDbTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + + // Store entry to current db + AppendTaskL( + *task, + CESMRStoreMRTask::NewL( + iCalDbMgr, + aEntry, + aEntry.MailboxUtils() ) ); + + CleanupStack::Pop( task ); + return task; + } + +// EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/mrtaskplugin/src/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrtasks/mrtaskplugin/src/dllmain.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Standard Symbian OS DLL entry point function. +* +*/ + + +// Internal includes +#include "cmrtaskplugin.h" +#include "esmrinternaluid.h" + +// System includes +#include + +/// Implementation table +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY( + KMRTaskPluginImplementationUID, + CMRTaskPlugin::NewL ), + }; + +// -------------------------------------------------------------------------- +// ImplementationGroupProxy +// The one and only exported function that is the ECom entry point +// -------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy + (TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + + return ImplementationTable; + } + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrcombinedtask.cpp --- a/meetingrequest/mrtasks/src/cesmrcombinedtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/src/cesmrcombinedtask.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -18,7 +18,7 @@ #include "emailtrace.h" #include "cesmrcombinedtask.h" -#include "mesmrmeetingrequestentry.h" +#include "mesmrcalentry.h" #include // ======== MEMBER FUNCTIONS ======== @@ -28,11 +28,9 @@ // --------------------------------------------------------------------------- // CESMRCombinedTask::CESMRCombinedTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, + MESMRCalEntry& aEntry, TESMRExecutionRule aRule ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), +: iEntry( aEntry ), iExecutionRule( aRule ) { FUNC_LOG; @@ -43,29 +41,24 @@ // CESMRCombinedTask::~CESMRCombinedTask // --------------------------------------------------------------------------- // -CESMRCombinedTask::~CESMRCombinedTask() +EXPORT_C CESMRCombinedTask::~CESMRCombinedTask() { FUNC_LOG; iTasks.ResetAndDestroy(); - iTasks.Close(); } // --------------------------------------------------------------------------- // CESMRCombinedTask::NewL // --------------------------------------------------------------------------- // -CESMRCombinedTask* CESMRCombinedTask::NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, +EXPORT_C CESMRCombinedTask* CESMRCombinedTask::NewL( + MESMRCalEntry& aEntry, TESMRExecutionRule aRule ) { FUNC_LOG; CESMRCombinedTask* self = new (ELeave) CESMRCombinedTask( - aCalDbMgr, aEntry, - aMRMailboxUtils, aRule ); CleanupStack::PushL(self); @@ -81,24 +74,23 @@ void CESMRCombinedTask::ConstructL() { FUNC_LOG; - BaseConstructL(); } // --------------------------------------------------------------------------- // CESMRCombinedTask::AppendTaskL // --------------------------------------------------------------------------- // -void CESMRCombinedTask::AppendTaskL( MESMRTask* aTask ) +EXPORT_C void CESMRCombinedTask::AppendTaskL( MESMRTask* aTask ) { FUNC_LOG; - User::LeaveIfError( iTasks.Append(aTask ) ); + iTasks.AppendL( aTask ); } // --------------------------------------------------------------------------- // CESMRCombinedTask::RemoveTaskL // --------------------------------------------------------------------------- // -MESMRTask* CESMRCombinedTask::RemoveTaskL( MESMRTask* aTask ) +EXPORT_C MESMRTask* CESMRCombinedTask::RemoveTaskL( MESMRTask* aTask ) { FUNC_LOG; TInt index = iTasks.Find( aTask ); @@ -124,10 +116,9 @@ TInt err( KErrNone ); TInt taskCount( iTasks.Count() ); - MESMRMeetingRequestEntry& mrEntry( ESMREntry() ); - if ( mrEntry.IsEntryEditedL() ) + if ( iEntry.IsEntryEditedL() ) { - mrEntry.UpdateTimeStampL(); + iEntry.UpdateTimeStampL(); } for( TInt i(0); i < taskCount; ++i ) @@ -159,3 +150,13 @@ } +// --------------------------------------------------------------------------- +// AppendTaskL +// --------------------------------------------------------------------------- +// +EXPORT_C void AppendTaskL( CESMRCombinedTask& aContainer, MESMRTask* aTask ) + { + CleanupDeletePushL( aTask ); + aContainer.AppendTaskL( aTask ); + CleanupStack::Pop( aTask ); + } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrdeletefromdbmrtask.cpp --- a/meetingrequest/mrtasks/src/cesmrdeletefromdbmrtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR base task -* -*/ - -#include "emailtrace.h" -#include "cesmrdeletefromdbmrtask.h" - -#include -#include -#include -// -#include "mesmrutilstombsext.h" -// -#include "cesmrcaldbmgr.h" -#include "mesmrmeetingrequestentry.h" -#include "esmrentryhelper.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRDeleteMRFromDbTask::CESMRDeleteMRFromDbTask -// --------------------------------------------------------------------------- -// -CESMRDeleteMRFromDbTask::CESMRDeleteMRFromDbTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRDeleteMRFromDbTask::~CESMRDeleteMRFromDbTask -// --------------------------------------------------------------------------- -// -CESMRDeleteMRFromDbTask::~CESMRDeleteMRFromDbTask() - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRDeleteMRFromDbTask::NewL -// --------------------------------------------------------------------------- -// -CESMRDeleteMRFromDbTask* CESMRDeleteMRFromDbTask::NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) - { - FUNC_LOG; - CESMRDeleteMRFromDbTask* self = - new (ELeave) CESMRDeleteMRFromDbTask( - aCalDbMgr, - aEntry, - aMRMailboxUtils ); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRDeleteMRFromDbTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRDeleteMRFromDbTask::ConstructL() - { - FUNC_LOG; - BaseConstructL(); - } - -// --------------------------------------------------------------------------- -// CESMRDeleteMRFromDbTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRDeleteMRFromDbTask::ExecuteTaskL() - { - FUNC_LOG; - // Store to calendar DB - DeleteEntryFromDbL(); - } - -// --------------------------------------------------------------------------- -// CESMRDeleteMRFromDbTask::DeleteEntryFromDbL -// --------------------------------------------------------------------------- -// -void CESMRDeleteMRFromDbTask::DeleteEntryFromDbL() - { - FUNC_LOG; - - MESMRCalDbMgr& calDb = CalDbMgr(); - MESMRMeetingRequestEntry& mrEntry = ESMREntry(); - CCalEntry& entry = mrEntry.Entry(); - - if ( mrEntry.IsSyncObjectPresent() ) - { - } - else - { - CCalEntry* entryToDeleted = NULL; - - - if ( mrEntry.IsRecurrentEventL() && - (MESMRCalEntry::EESMRThisOnly == mrEntry.RecurrenceModRule()) && - mrEntry.IsOpenedFromMail() ) - { - entryToDeleted = mrEntry.RemoveInstanceFromSeriesL(); - CleanupStack::PushL( entryToDeleted ); - calDb.StoreEntryL( *entryToDeleted, ETrue ); - - } - else - { - entryToDeleted = mrEntry.ValidateEntryL(); - CleanupStack::PushL( entryToDeleted ); - // - TRAPD(err, calDb.DeleteEntryCondL( *entryToDeleted ) ); - if ( err == KErrNotFound ) - { - // If meeting request to be deleted is not found from the calendar - // Do not care about error. This is just for avoiding leave - } - // - } - - CleanupStack::PopAndDestroy( entryToDeleted ); - entryToDeleted = NULL; - } - - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrforwardasfsmailtask.cpp --- a/meetingrequest/mrtasks/src/cesmrforwardasfsmailtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for forwarding mr as email -* -*/ - -#include "emailtrace.h" -#include "cesmrforwardasfsmailtask.h" - -#include -#include -#include -#include -#include -#include -// -#include "FreestyleEmailUiConstants.h" -// -#include "tesmrinputparams.h" - -#include "cesmrcaldbmgr.h" -#include "mesmrmeetingrequestentry.h" -#include "cesmrmailplaitextformatter.h" -#include "cesmrcalimportexporter.h" -#include "cesmrfsemailmanager.h" -#include "cesmrcaluserutil.h" -#include "esmrinternaluid.h" -#include "esmrhelper.h" - -// Unnamed namespace for local definitions -namespace { - -// remove hardcoded paths -// Literal for temporary iCal meeting path -//_LIT( KTemporaryIcsPath, "c:\\temp\\" ); //codescanner::driveletters -// - -// Literal for temporary iCal meeting file -// remove hardcoded paths -//_LIT( KTemporaryIcsFullName, -// "c:\\temp\\meeting.ics" ); //codescanner::driveletters -_LIT( KTemporaryIcsName, "temp\\meeting.ics" ); -// - -#ifdef _DEBUG - -// Literal for panics -_LIT( KESMRForwardAsFSMail, "ESMRForwardAsFSMail" ); - -// Panic codes -enum TESMRForwardAsFSMailPanic - { - EESMRForwardAsFSMailCoeNull, - EESMRForwardAsFSMailAppUiNull, - EESMRForwardCannotBeTriggeredFromMail - }; - -// --------------------------------------------------------------------------- -// Raises system panic. -// --------------------------------------------------------------------------- -// -void Panic( TESMRForwardAsFSMailPanic aPanic ) - { - User::Panic( KESMRForwardAsFSMail, aPanic ); - } - -#endif // _DEBUG - -} - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRForwardAsFSMailTask::CESMRForwardAsFSMailTask -// --------------------------------------------------------------------------- -// -CESMRForwardAsFSMailTask::CESMRForwardAsFSMailTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRForwardAsFSMailTask::~CESMRForwardAsFSMailTask -// --------------------------------------------------------------------------- -// -CESMRForwardAsFSMailTask::~CESMRForwardAsFSMailTask() - { - FUNC_LOG; - delete iEntryToSend; - delete iCaluserUtil; - delete iEmailMgr; - } - -// --------------------------------------------------------------------------- -// CESMRForwardAsFSMailTask::NewL -// --------------------------------------------------------------------------- -// -CESMRForwardAsFSMailTask* CESMRForwardAsFSMailTask::NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) - { - FUNC_LOG; - CESMRForwardAsFSMailTask* self = - new (ELeave) CESMRForwardAsFSMailTask( - aCalDbMgr, - aEntry, - aMRMailboxUtils ); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRForwardAsFSMailTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRForwardAsFSMailTask::ConstructL() - { - FUNC_LOG; - BaseConstructL(); - iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); - } - -// --------------------------------------------------------------------------- -// CESMRForwardAsFSMailTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRForwardAsFSMailTask::ExecuteTaskL() - { - FUNC_LOG; - iEntryToSend = ESMREntry().ValidateEntryL(); - iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); - - TESMRInputParams startupparams; - TBool isEmail = ESMREntry().StartupParameters(startupparams); - - // This command cannot be triggered from email - __ASSERT_DEBUG( !isEmail, Panic(EESMRForwardCannotBeTriggeredFromMail) ); - - if(isEmail) - { - // This command cannot be triggered from email - User::Leave( KErrNotSupported ); - } - - // Create mail message: - ConstructMailL(); - - // Save the message to drafts folder: - iEmailMgr->StoreMessageToDraftsFolderL(); - - // Launch FS EMail Editor: - LaunchFSEmailEditorL(); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::ConstructMailL -// --------------------------------------------------------------------------- -// -void CESMRForwardAsFSMailTask::ConstructMailL() - { - FUNC_LOG; - // create text formatter: - CESMRMailPlainTextFormatter* textFormatter = - CESMRMailPlainTextFormatter::NewLC(MailboxUtils()); - - // Prepare email manager for sending - CCalUser *mailboxUser = iEntryToSend->PhoneOwnerL(); - iEmailMgr->PrepareForSendingL( - ESMRHelper::AddressWithoutMailtoPrefix(mailboxUser->Address() ) ); - - // set the email subject: - HBufC* subject = - textFormatter->Subject16LC( - *iEntryToSend, - ETrue, - EFalse ); - iEmailMgr->SetSubjectL(*subject); - CleanupStack::PopAndDestroy(subject); - subject = NULL; - - iEmailMgr->CreateTextPlainPartL( KNullDesC() ); - - CreateTemporaryMeetingFileL(); - iEmailMgr->StoreMessageToDraftsFolderL(); - - CleanupStack::PopAndDestroy( textFormatter ); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::CreateTemporaryMeetingFileL -// --------------------------------------------------------------------------- -// -void CESMRForwardAsFSMailTask::CreateTemporaryMeetingFileL() - { - FUNC_LOG; - CCoeEnv* coe = CCoeEnv::Static(); - - __ASSERT_DEBUG( coe, Panic(EESMRForwardAsFSMailCoeNull) ); - - if ( !coe ) - { - User::Leave( KErrNotSupported ); - } - - RFs& fs = coe->FsSession(); - - // Ensure that path exists - // hardcoded paths removal - /*TInt err = fs.MkDirAll( KTemporaryIcsPath ); - if ( KErrAlreadyExists != err ) - { - User::LeaveIfError( err ); - }*/ - // - - RFile calendarFile; - //hard coded paths removal - TFileName fileName(KTemporaryIcsName); - User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); - TInt err = calendarFile.Replace( - fs, - fileName, - EFileWrite ); - // - if ( KErrNone != err ) - User::LeaveIfError( err ); - - CleanupClosePushL( calendarFile ); - - CESMRCalImportExporter* calExporter = CESMRCalImportExporter::NewLC(); - HBufC8* calendarText = calExporter->ExportToICal8LC( *iEntryToSend ); - - calendarFile.Write( *calendarText ); - calendarFile.Flush(); - - // calendarText, calExporter and calendarFile - CleanupStack::PopAndDestroy( 3, & calendarFile); - iEmailMgr->SetAttachmentL( fileName );// - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::LaunchFSEmailEditorL -// --------------------------------------------------------------------------- -// -TInt CESMRForwardAsFSMailTask::LaunchFSEmailEditorL() - { - FUNC_LOG; - CCoeEnv* coe = CCoeEnv::Static(); - __ASSERT_DEBUG( coe, Panic(EESMRForwardAsFSMailCoeNull) ); - - CCoeAppUi* appui = coe->AppUi(); - __ASSERT_DEBUG( appui, Panic(EESMRForwardAsFSMailAppUiNull) ); - - // fill params - TEditorLaunchParams params; - params.iActivatedExternally = ETrue; - params.iMailboxId = iEmailMgr->MailboxId(); - params.iFolderId = iEmailMgr->MessageFolderId(); - params.iMsgId = iEmailMgr->MessageId(); - - TVwsViewId viewId( - KFSEmailUiUid, - MailEditorId ); - TUid editorCommand = TUid::Uid( KEditorCmdOpen ); - TPckgC buf( params ); - - appui->ActivateViewL( - viewId, - editorCommand, - buf ); - - return KErrNone; - } - -//EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp --- a/meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,756 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR Email Manager -* -*/ - -#include -#include - -#include "emailtrace.h" -#include "cesmrfsemailmanager.h" - -#include "cfsmailclient.h" -#include "cfsmailbox.h" -#include "cfsmailmessage.h" -#include "cfsmailmessagepart.h" -#include "mmrinfoprocessor.h" -#include "cfsmailcommon.h" -#include "cfsmailplugin.h" - -#include "tesmrinputparams.h" -#include "esmrconfig.hrh" -#include "esmrhelper.h" -#include "esmrinternaluid.h" - - -// Unnamed namespace for local definitions -namespace { - -// Definition for mime types -_LIT(KMimeTextCalRequest, "text/calendar; method=REQUEST; name=\"meeting.ics\""); -_LIT(KMimeTextCalResponse, "text/calendar; method=RESPONSE; name=\"response.ics\""); -_LIT(KMimeTextCalCancel, "text/calendar; method=CANCEL; name=\"cancel.ics\""); -_LIT(KMimeTextCalContentClass, "urn:content-classes:calendarmessage" ); - -// Definition for temporary calendar file -// hardcoded paths removal -//_LIT(KFileAndPath, "c:\\temp\\temp.ics"); //codescanner::driveletters -_LIT(KTempFileName, "temp\\temp.ics"); -// - -// Definition for email address comparison -const TInt KEqualEmailAddress(0); - -// Definition for first index -const TInt KFirstIndex(0); - -/** - * Cleanup operations for RPointerArray. - * - * @param aArray Pointer to RPointerArray. - */ -void MessagePartPointerArrayCleanup( TAny* aArray ) - { - RPointerArray* messagePartArray = - static_cast*>( aArray ); - - messagePartArray->ResetAndDestroy(); - messagePartArray->Close(); - } - -#ifdef _DEBUG - -// Definition for panic text -_LIT( KEMailManagerPanicTxt, "EMailManager" ); - -/** Enumeration for email manager panic codes */ -enum TESMREMailManagerPanic - { - EESMRMailboxNotFound = 0, - EESMRMailClientNotExist, - EESMRMessageNotExist, - EESMRInvalidCalMethod - }; - -// --------------------------------------------------------------------------- -// Panic wrapper method -// --------------------------------------------------------------------------- -// -void Panic( TESMREMailManagerPanic aPanic ) - { - - User::Panic( KEMailManagerPanicTxt, aPanic ); - } - -#endif // _DEBUG - -// --------------------------------------------------------------------------- -// Leave wrapper method -// --------------------------------------------------------------------------- -// -inline void DoLeaveIfErrorL( TInt aLeaveCode ) - { - if ( KErrNone != aLeaveCode ) - { - - User::Leave( aLeaveCode ); - } - } - -// --------------------------------------------------------------------------- -// Cleanup operation for RPointerArray. -// @param aArray Pointer to RPointerArray. -// --------------------------------------------------------------------------- -// -void MailboxPointerArrayCleanup( TAny* aArray ) - { - RPointerArray* entryArray = - static_cast*>( aArray ); - - entryArray->ResetAndDestroy(); - entryArray->Close(); - } -} // namespace - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::CESMRFSEMailManager -// --------------------------------------------------------------------------- -// -inline CESMRFSEMailManager::CESMRFSEMailManager( - CMRMailboxUtils& aMRMailboxUtils ) -: iMRMailboxUtils( aMRMailboxUtils ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::§CESMRFSEMailManager -// --------------------------------------------------------------------------- -// -CESMRFSEMailManager::~CESMRFSEMailManager() - { - FUNC_LOG; - delete iParentPart; - delete iMessage; - delete iMailBox; - if ( iMailClient ) - { - iMailClient->Close(); - iMailClient = NULL; - } - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::NewL -// --------------------------------------------------------------------------- -// -CESMRFSEMailManager* CESMRFSEMailManager::NewL( - CMRMailboxUtils& aMRMailboxUtils ) - { - FUNC_LOG; - - CESMRFSEMailManager* self = - new (ELeave) CESMRFSEMailManager(aMRMailboxUtils); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - - return self; - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::ConstructL() - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::PrepareForSendingL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::PrepareForSendingL( - const TDesC& aMailboxOwnerAddr ) - { - FUNC_LOG; - - iMailClient = CFSMailClient::NewL(); - - TPtrC emailAddr( - ESMRHelper::AddressWithoutMailtoPrefix( aMailboxOwnerAddr ) ); - - iMailBox = SelectMailBoxL( emailAddr ); - iMessage = CreateMessageL(); - iParentPart = CreateParentPartL(); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::PrepareForSendingreplyL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::PrepareForSendingReplyL( - const TDesC& aMailboxOwnerAddr, const TFSMailMsgId& aMsgId, TBool aReplyAll ) - { - FUNC_LOG; - - iMailClient = CFSMailClient::NewL(); - - TPtrC emailAddr( - ESMRHelper::AddressWithoutMailtoPrefix( aMailboxOwnerAddr ) ); - - iMailBox = SelectMailBoxL( emailAddr ); - - iMessage = iMailBox->CreateReplyMessage(aMsgId, aReplyAll ); - - iParentPart = CreateParentPartL(); - - } - - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SetSenderL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::SetSenderL( - const TDesC& aAddress, - const TDesC& aCommonName ) - { - FUNC_LOG; - - CFSMailAddress* sender = CFSMailAddress::NewLC(); - - TPtrC emailAddr( - ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); - - sender->SetEmailAddress( emailAddr ); - sender->SetDisplayName( aCommonName ); - iMessage->SetSender( sender ); // takes ownership - CleanupStack::Pop( sender ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SetReplyToAddressL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::SetReplyToAddressL( - const TDesC& aAddress, - const TDesC& aCommonName ) - { - FUNC_LOG; - - CFSMailAddress* replyToAddress = CFSMailAddress::NewLC(); - - TPtrC emailAddr( - ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); - - replyToAddress->SetEmailAddress( emailAddr ); - replyToAddress->SetDisplayName( aCommonName ); - iMessage->SetReplyToAddress( replyToAddress ); // takes ownership - CleanupStack::Pop( replyToAddress ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::AppendToRecipientL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::AppendToRecipientL( - const TDesC& aAddress, - const TDesC& aCommonName ) - { - FUNC_LOG; - - CFSMailAddress* toRecipient = CFSMailAddress::NewLC(); - - TPtrC emailAddr( - ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); - - toRecipient->SetEmailAddress( emailAddr ); - toRecipient->SetDisplayName( aCommonName ); - iMessage->AppendToRecipient( toRecipient ); // takes ownership - CleanupStack::Pop( toRecipient ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::AppendCCRecipientL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::AppendCCRecipientL( - const TDesC& aAddress, - const TDesC& aCommonName ) - { - FUNC_LOG; - - CFSMailAddress* ccRecipient = CFSMailAddress::NewLC(); - - TPtrC emailAddr( - ESMRHelper::AddressWithoutMailtoPrefix( aAddress ) ); - - ccRecipient->SetEmailAddress( emailAddr ); - ccRecipient->SetDisplayName( aCommonName ); - iMessage->AppendCCRecipient( ccRecipient ); // takes ownership - CleanupStack::Pop( ccRecipient ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SetSubjectL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::SetSubjectL(const TDesC& aSubject) - { - FUNC_LOG; - - iMessage->SetSubject( aSubject ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::CreateTextPlainPartL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::CreateTextPlainPartL(const TDesC& aPlainText) - { - FUNC_LOG; - - AddPlainTextPartL( aPlainText ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::CreateTextCalendarPartL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::CreateTextCalendarPartL( - TESMRMethod aCalendarMethod ) - { - FUNC_LOG; - // removing hardcoded paths - TFileName fileName(KTempFileName); - User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); - CreateTextCalendarPartL( aCalendarMethod, fileName ); - // - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::CreateTextCalendarPartL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::CreateTextCalendarPartL( - TESMRMethod aCalendarMethod, - const TDesC& aFilename ) - { - FUNC_LOG; - - TPtrC contentType; - switch ( aCalendarMethod ) - { - case EESMRMethodRequest: - { - contentType.Set(KMimeTextCalRequest()); - } - break; - - case EESMRMethodResponse: - { - contentType.Set(KMimeTextCalResponse()); - } - break; - - case EESMRMethodCancel: - { - contentType.Set(KMimeTextCalCancel()); - } - break; - - default: - __ASSERT_DEBUG( EFalse, Panic(EESMRInvalidCalMethod) ); - } - - AddMessagePartFromFileL( - contentType, - KMimeTextCalContentClass, - KNullDesC(), - KNullDesC(), - aFilename ); - - } - - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SetAttachmentL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::SetAttachmentL(const TDesC& aAttachmentFile ) - { - FUNC_LOG; - - TFSMailMsgId nullId; - CFSMailMessagePart* attachmentPart = - iMessage->AddNewAttachmentL(aAttachmentFile, nullId ); - CleanupStack::PushL( attachmentPart ); - attachmentPart->SaveL(); - iMessage->SaveMessageL(); - - CleanupStack::PopAndDestroy( attachmentPart ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::StoreMessageL -// --------------------------------------------------------------------------- -// -TInt CESMRFSEMailManager::StoreMessageToDraftsFolderL() - { - FUNC_LOG; - // Stores message automatically to drafts folder - // check that msg is not in drafts folder already - TFSMailMsgId draftsFolderId = - iMailBox->GetStandardFolderId( EFSDraftsFolder ); - TFSMailMsgId msgFolderId = iMessage->GetFolderId(); - if ( draftsFolderId != msgFolderId ) - { - RArray ids; - CleanupClosePushL( ids ); - ids.Append( iMessage->GetMessageId() ); - iMailBox->MoveMessagesL( ids, msgFolderId, draftsFolderId ); - CleanupStack::PopAndDestroy(); // ids - } - - iMessage->SaveMessageL(); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SendMessageL -// --------------------------------------------------------------------------- -// -TInt CESMRFSEMailManager::SendMessageL() - { - FUNC_LOG; - - TRAPD( ret, iMailBox->SendMessageL( *iMessage ) ); - - - return ret; - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::MailboxId -// --------------------------------------------------------------------------- -// -TFSMailMsgId CESMRFSEMailManager::MailboxId() const - { - FUNC_LOG; - return iMailBox->GetId(); - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SendMailViaSyncL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::SendMailViaSyncL( - TESMRInputParams& aParams, - MMRInfoObject& aInfoObject, - MMRInfoProcessor::TMRInfoResponseMode aResponseMode, - const TDesC& aFreeResponseText ) - { - FUNC_LOG; - - CFSMailBox* mailBox = - aParams.iMailClient->GetMailBoxByUidL( - aParams.iMailMessage->GetMailBoxId() ); - CleanupStack::PushL( mailBox ); - - if ( mailBox->IsMRInfoProcessorSet() ) - { - MMRInfoProcessor& infoProcessor( - mailBox->MRInfoProcessorL() ); - - - TRAPD(err, { - infoProcessor.ReplyToMeetingRequestL( - aParams.iMailMessage->GetMailBoxId(), - aParams.iMailMessage->GetMessageId(), - aInfoObject, - aResponseMode, - aFreeResponseText ); - } ); - - - - User::LeaveIfError( err ); - } - - CleanupStack::PopAndDestroy( mailBox ); - - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::MessageId -// --------------------------------------------------------------------------- -// -TFSMailMsgId CESMRFSEMailManager::MessageId() const - { - FUNC_LOG; - __ASSERT_DEBUG( iMessage, Panic(EESMRMessageNotExist) ); - return iMessage->GetMessageId(); - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::MessageFolderId -// --------------------------------------------------------------------------- -// -TFSMailMsgId CESMRFSEMailManager::MessageFolderId() const - { - FUNC_LOG; - __ASSERT_DEBUG( iMessage, Panic(EESMRMessageNotExist) ); - return iMessage->GetFolderId(); - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::CreateMessageL -// --------------------------------------------------------------------------- -// -CFSMailMessage* CESMRFSEMailManager::CreateMessageL() - { - FUNC_LOG; - - CFSMailMessage* msg = iMailBox->CreateMessageToSend(); - - msg->SetFlag( EFSMsgFlag_CalendarMsg ); - msg->SaveMessageL(); - - return msg; - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::CreateParentPartL -// --------------------------------------------------------------------------- -// -CFSMailMessagePart* CESMRFSEMailManager::CreateParentPartL() - { - FUNC_LOG; - __ASSERT_DEBUG( iMessage, Panic(EESMRMessageNotExist) ); - - CFSMailMessagePart* parent = NULL; - RPointerArray messageParts; - CleanupStack::PushL( - TCleanupItem( - MessagePartPointerArrayCleanup, - &messageParts ) ); - - iMessage->ChildPartsL( messageParts ); - - if( messageParts.Count() ) - { - parent = messageParts[ KFirstIndex ]; - messageParts.Remove( KFirstIndex ); - } - else - { - // Message does not contain body part --> Create it - TFSMailMsgId id; - parent = iMessage->NewChildPartL( - id, - KFSMailContentTypeMultipartAlternative ); - } - - CleanupStack::PopAndDestroy(); // messageParts - CleanupStack::PushL( parent ); - - parent->SetContentType( KFSMailContentTypeMultipartAlternative ); - parent->SaveL(); - iMessage->SaveMessageL(); - - CleanupStack::Pop( parent ); - return parent; - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::SelectMailBoxL -// --------------------------------------------------------------------------- -// -CFSMailBox* CESMRFSEMailManager::SelectMailBoxL( - const TDesC& aMailboxOwnerAddr ) - { - FUNC_LOG; - - __ASSERT_DEBUG( iMailClient, Panic(EESMRMailClientNotExist) ); - - CFSMailBox* mailbox = NULL; - - // Loop throug all mailboxes in this plug-in - RPointerArray mailboxes; - CleanupStack::PushL( - TCleanupItem( - MailboxPointerArrayCleanup, - &mailboxes ) ); - - // With null uid we get all mailboxes - TFSMailMsgId msgId; - iMailClient->ListMailBoxes( - msgId, mailboxes ); - - TInt mailboxCount( mailboxes.Count() ); - for (TInt j(0); j < mailboxCount && !mailbox; ++j ) - { - TPtrC mailboxOwnerAddName( - mailboxes[j]->OwnMailAddress().GetEmailAddress() ); - if ( KEqualEmailAddress == mailboxOwnerAddName.CompareF(aMailboxOwnerAddr) ) - { - // Correct mailbox is found - mailbox = mailboxes[j]; - mailboxes.Remove(j); - } - } - CleanupStack::PopAndDestroy( &mailboxes ); - - __ASSERT_DEBUG( mailbox, Panic(EESMRMailboxNotFound) ); - - if ( !mailbox ) - { - DoLeaveIfErrorL( KErrNotFound ); - } - - - return mailbox; - } - -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::AddMessagePartFromFileL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::AddMessagePartFromFileL( - const TDesC& aContentType, - const TDesC& aContentClass, - const TDesC& aContentDescription, - const TDesC& aContentDisposition, - const TDesC& aFileAndPath ) - { - FUNC_LOG; - - __ASSERT_DEBUG( iParentPart, Panic(EESMRMessageNotExist) ); - - TFSMailMsgId nullId; - - CFSMailMessagePart* messagePart = - iParentPart->AddNewAttachmentL( - aFileAndPath, - nullId, - aContentType ); - - CleanupStack::PushL( messagePart ); - - messagePart->SetMailBoxId( iMailBox->GetId() ); - messagePart->SetContentDescription( KNullDesC() ); - messagePart->SetContentType( KNullDesC() ); - messagePart->SetContentDisposition( KNullDesC() ); - messagePart->SetContentClass( KNullDesC() ); - - if ( aContentType.Length() ) - { - messagePart->SetContentType( aContentType ); - } - - if ( aContentDescription.Length() ) - { - messagePart->SetContentDescription( aContentDescription ); - } - - if ( aContentDisposition.Length() ) - { - messagePart->SetContentDisposition( aContentDisposition ); - } - - if ( aContentClass.Length() ) - { - messagePart->SetContentClass( aContentClass ); - } - - messagePart->SaveL(); - iMessage->SaveMessageL(); - - CleanupStack::PopAndDestroy( messagePart ); - - } -// --------------------------------------------------------------------------- -// CESMRFSEMailManager::AddPlainTextPartL -// --------------------------------------------------------------------------- -// -void CESMRFSEMailManager::AddPlainTextPartL( - const TDesC& aContent ) - { - FUNC_LOG; - TFSMailMsgId id; - CFSMailMessagePart* plainTextPart = - iParentPart->FindBodyPartL(KFSMailContentTypeTextPlain); - - if ( !plainTextPart ) - { - // text/plain part does not exist --> Create it to body part - plainTextPart = - iParentPart->NewChildPartL(id, KFSMailContentTypeTextPlain ); - } - - CleanupStack::PushL( plainTextPart ); - - plainTextPart->SetMailBoxId( iMailBox->GetId() ); - - TUint currentContentSize = plainTextPart->ContentSize(); - TUint contentBufferSize = currentContentSize + aContent.Length(); - - // Buffer for current content - HBufC* currentContentBuffer = HBufC::NewLC( currentContentSize ); - TPtr currentContent( currentContentBuffer->Des() ); - - // Buffer for content containing calendar information and current content - HBufC* contentBuffer = HBufC::NewLC( contentBufferSize ); - TPtr content( contentBuffer->Des() ); - - // Appending calendar information to content - content.Copy( aContent ); - if ( currentContentSize ) - { - // Appending current content if needed - plainTextPart->GetContentToBufferL( currentContent, 0 ); - content.Append( currentContent ); - } - - plainTextPart->SetContent(content); - CleanupStack::PopAndDestroy( contentBuffer ); contentBuffer = NULL; - CleanupStack::PopAndDestroy( currentContentBuffer ); currentContentBuffer = NULL; - - plainTextPart->SaveL(); - iMessage->SaveMessageL(); - - CleanupStack::PopAndDestroy( plainTextPart ); - - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrmailplaitextformatter.cpp --- a/meetingrequest/mrtasks/src/cesmrmailplaitextformatter.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,492 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for plain text formatter for ES MR entries -* -*/ - -#include "emailtrace.h" -#include "cesmrmailplaitextformatter.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include "cesmrcaluserutil.h" -#include "esmrhelper.h" -#include - -// Unnamed namespace for local definitions -namespace { - -// Resource file name definition -_LIT( KResourceFileName,"esmrtasks.rsc" ); - -// Definition for new line -_LIT( KNewLine,"\n" ); - -_LIT( KWhiteSpace, " " ); - -// Definition for first position -const TInt KFirstPos( 0 ); - -// Denition for amount of needed newlines -const TInt KNewLinesNeeded = 5; - -// Definition for time string length (13:15) -const TInt KTimeStringLength = 20; - -// Definition for date stinng length (31.12.2007) -const TInt KDateStringLength = 20; - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::CESMRMailPlainTextFormatter -// --------------------------------------------------------------------------- -// -inline CESMRMailPlainTextFormatter::CESMRMailPlainTextFormatter( - CMRMailboxUtils& aMailboxUtils ) : - iMailboxUtils(aMailboxUtils) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::~CESMRMailPlainTextFormatter -// --------------------------------------------------------------------------- -// -CESMRMailPlainTextFormatter::~CESMRMailPlainTextFormatter() - { - FUNC_LOG; - if ( iResourceOffset ) - { - CCoeEnv::Static()->DeleteResourceFile( iResourceOffset ); - } - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::NewL -// --------------------------------------------------------------------------- -// -CESMRMailPlainTextFormatter* CESMRMailPlainTextFormatter::NewL( - CMRMailboxUtils& aMailboxUtils ) - { - FUNC_LOG; - CESMRMailPlainTextFormatter* self = NewLC( aMailboxUtils ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::NewLC -// --------------------------------------------------------------------------- -// -CESMRMailPlainTextFormatter* CESMRMailPlainTextFormatter::NewLC( - CMRMailboxUtils& aMailboxUtils ) - { - FUNC_LOG; - CESMRMailPlainTextFormatter* self = - new (ELeave) CESMRMailPlainTextFormatter(aMailboxUtils); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRMailPlainTextFormatter::ConstructL() - { - FUNC_LOG; - CCoeEnv* coeEnv = CCoeEnv::Static();// codescanner::eikonenvstatic - - TFileName resourceFile; - ESMRHelper::LocateResourceFile( - KResourceFileName, - KDC_RESOURCE_FILES_DIR, - resourceFile, - &coeEnv->FsSession()); - - // Find the resource file for the nearest language - BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceFile ); - iResourceOffset = coeEnv->AddResourceFileL( resourceFile ); - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::Body16LC -// --------------------------------------------------------------------------- -// -HBufC* CESMRMailPlainTextFormatter::Body16LC( - CCalEntry& aEntry ) - { - FUNC_LOG; - HBufC* dateFormatString = StringLoader::LoadLC( R_QTN_DATE_USUAL ); - - HBufC* timeFormatString = StringLoader::LoadLC( R_QTN_TIME_USUAL ); - - TTime mrStartTime = aEntry.StartTimeL().TimeLocalL(); - TTime mrEndTime = aEntry.EndTimeL().TimeLocalL(); - - TBuf startTimeStr, endTimeStr; - TBuf startDateStr, endDateStr; - - mrStartTime.FormatL( startTimeStr, *timeFormatString ); - mrStartTime.FormatL( startDateStr, *dateFormatString ); - mrEndTime.FormatL( endTimeStr, *timeFormatString ); - mrEndTime.FormatL( endDateStr, *dateFormatString ); - - CleanupStack::PopAndDestroy( 2, dateFormatString ); - - HBufC* subject = - StringLoader::LoadLC(R_QTN_MEET_REQ_PLAIN_TEXT_SUBJECT); - - HBufC* location = - StringLoader::LoadLC(R_QTN_MEET_REQ_PLAIN_TEXT_LOCATION); - - HBufC* startTime = - StringLoader::LoadLC(R_QTN_MEET_REQ_PLAIN_TEXT_START_TIME); - - HBufC* endTime = - StringLoader::LoadLC(R_QTN_MEET_REQ_PLAIN_TEXT_END_TIME); - - HBufC* description = - StringLoader::LoadLC(R_QTN_MEET_REQ_PLAIN_TEXT_DESCRIPTION); - - HBufC* details = - HBufC::NewLC( subject->Length() + - location->Length() + - startTime->Length() + - endTime->Length() + - description->Length() + - aEntry.SummaryL().Length() + - aEntry.LocationL().Length() + - aEntry.DescriptionL().Length() + - KNewLine().Length() * KNewLinesNeeded + - KTimeStringLength * 2 + // start and end time - KDateStringLength * 2 + // start and end date - KWhiteSpace().Length() * 2 ); // start and end date times - - TPtr detailsPtr( details->Des() ); - - detailsPtr.Append( *subject ); - detailsPtr.Append( aEntry.SummaryL() ); - detailsPtr.Append( KNewLine ); - - detailsPtr.Append( *location ); - detailsPtr.Append( aEntry.LocationL() ); - detailsPtr.Append( KNewLine ); - - detailsPtr.Append( *startTime ); - detailsPtr.Append( startDateStr ); - detailsPtr.Append( KWhiteSpace ); - detailsPtr.Append( startTimeStr ); - detailsPtr.Append( KNewLine ); - - detailsPtr.Append( *endTime ); - detailsPtr.Append( endDateStr ); - detailsPtr.Append( KWhiteSpace ); - detailsPtr.Append( endTimeStr ); - detailsPtr.Append( KNewLine ); - - detailsPtr.Append( *description ); - detailsPtr.Append( aEntry.DescriptionL() ); - detailsPtr.Append( KNewLine ); - - CleanupStack::Pop( details ); - - // subject, location, startTime, endTime, description - CleanupStack::PopAndDestroy( 5, subject ); - - CleanupStack::PushL( details ); - return details; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::Body8LC -// --------------------------------------------------------------------------- -// -HBufC8* CESMRMailPlainTextFormatter::Body8LC( - CCalEntry& aEntry ) - { - FUNC_LOG; - HBufC* buf16 = Body16LC( aEntry ); - HBufC8* buf8 = HBufC8::NewLC( buf16->Length() ); - TPtr8 ptr8( buf8->Des() ); - - TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8( ptr8, *buf16 ); - User::LeaveIfError( err ); - CleanupStack::Pop( buf8 ); - CleanupStack::PopAndDestroy( buf16 ); - CleanupStack::PushL( buf8 ); - return buf8; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::Subject16LC -// --------------------------------------------------------------------------- -// -HBufC* CESMRMailPlainTextFormatter::Subject16LC( - CCalEntry& aEntry, - TBool aIsForwarded, - TBool aIsUpdate ) - { - FUNC_LOG; - CESMRCalUserUtil* caluserUtil = CESMRCalUserUtil::NewLC( aEntry ); - TESMRRole role = caluserUtil->PhoneOwnerRoleL(); - CleanupStack::PopAndDestroy( caluserUtil ); - - // create prefix for subject: - HBufC* prefix = SubjectLinePrefix16LC( - aEntry, - aIsForwarded, - aIsUpdate ); //if returns NULL no need to CleanupStack::Pop later - - // user's email address is attached to subject if user is - // responding to meeting request: - HBufC* responseAddress = KNullDesC().AllocLC(); - if ( !aIsForwarded ) - { - if ( EESMRRoleRequiredAttendee == role || - EESMRRoleOptionalAttendee == role || - EESMRRoleNonParticipant == role ) - { - CleanupStack::PopAndDestroy( responseAddress ); - responseAddress = NULL; - - CCalUser* phoneOwner = aEntry.PhoneOwnerL(); - responseAddress = phoneOwner->Address().AllocLC(); - } - } - - // count the subject line buffer length - TInt subjectLineLength( aEntry.SummaryL().Length() ); - - if (prefix) - { - subjectLineLength += prefix->Length(); - } - - if (responseAddress) - { - subjectLineLength += responseAddress->Length(); - } - - // create and fill the subject buffer - HBufC* subjectLine = - HBufC::NewLC( subjectLineLength ); - TPtr ptrSubject( subjectLine->Des() ); - - if (responseAddress) - { - ptrSubject.Append(*responseAddress); - } - - if (prefix) - { - ptrSubject.Copy( *prefix ); - } - - ptrSubject.Append( aEntry.SummaryL() ); - - CleanupStack::Pop( subjectLine ); - - if (prefix) - { - CleanupStack::PopAndDestroy( 2, prefix ); // responseAddress - } - else - { - CleanupStack::PopAndDestroy( responseAddress ); - } - CleanupStack::PushL( subjectLine ); - return subjectLine; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::Subject8LC -// --------------------------------------------------------------------------- -// -HBufC8* CESMRMailPlainTextFormatter::Subject8LC( - CCalEntry& aEntry, - TBool aIsForwarded, - TBool aIsUpdate ) - { - FUNC_LOG; - HBufC* buf16 = Subject16LC( aEntry, aIsForwarded, aIsUpdate ); - HBufC8* buf8 = HBufC8::NewLC( buf16->Length() ); - TPtr8 ptr8(buf8->Des() ); - - TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8( ptr8, *buf16 ); - User::LeaveIfError( err ); - CleanupStack::Pop( buf8 ); - CleanupStack::PopAndDestroy( buf16 ); - CleanupStack::PushL( buf8 ); - return buf8; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::SubjectLinePrefix16LC -// --------------------------------------------------------------------------- -// -HBufC* CESMRMailPlainTextFormatter::SubjectLinePrefix16LC( - CCalEntry& aEntry, - TBool aIsForwarded, - TBool aIsUpdate ) - { - FUNC_LOG; - HBufC* prefix = NULL; - - CESMRCalUserUtil* caluserUtil = CESMRCalUserUtil::NewLC( aEntry ); - TESMRRole role = caluserUtil->PhoneOwnerRoleL(); - CleanupStack::PopAndDestroy( caluserUtil ); - caluserUtil = NULL; - - if ( EESMRRoleOrganizer == role ) - { - CCalEntry::TMethod method = aEntry.MethodL(); - if ( CCalEntry::EMethodCancel == method ) - { - prefix = - StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_CANCELLED ); - } - else if ( CCalEntry::EMethodRequest == method && - (aIsUpdate || aIsForwarded) ) - { - prefix = - StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_UPDATE ); - } - else - { - prefix = - KNullDesC().AllocLC(); - } - } - - else if ( EESMRRoleRequiredAttendee == role || - EESMRRoleOptionalAttendee == role || - EESMRRoleNonParticipant == role ) - { - CCalAttendee* attendee = - iMailboxUtils.ThisAttendeeL( aEntry ); - - if ( attendee ) - { - switch( attendee->StatusL() ) - { - case CCalAttendee::EAccepted: - prefix = - StringLoader::LoadLC( - R_QTN_MEET_REQ_PLAIN_TEXT_ACCEPTED ); - break; - case CCalAttendee::ETentative: - prefix = - StringLoader::LoadLC( - R_QTN_MEET_REQ_PLAIN_TEXT_TENTATIVE ); - break; - case CCalAttendee::EDeclined: - prefix = - StringLoader::LoadLC( - R_QTN_MEET_REQ_PLAIN_TEXT_DECLINED ); - break; - default: - prefix = - KNullDesC().AllocLC(); - break; - } - } - else - { - prefix = - KNullDesC().AllocLC(); - } - } - return prefix; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::UpdatedStringLC -// --------------------------------------------------------------------------- -// -HBufC* CESMRMailPlainTextFormatter::UpdatedStringLC() - { - FUNC_LOG; - HBufC* updatedString = - StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_UPDATE ); - - return updatedString; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::CanceledStringLC -// --------------------------------------------------------------------------- -// -HBufC* CESMRMailPlainTextFormatter::CanceledStringLC() - { - FUNC_LOG; - HBufC* canceledString = - StringLoader::LoadLC( R_QTN_MEET_REQ_PLAIN_TEXT_CANCELLED ); - - return canceledString; - } - -// --------------------------------------------------------------------------- -// CESMRMailPlainTextFormatter::ReplyStringLC -// --------------------------------------------------------------------------- -// -HBufC* CESMRMailPlainTextFormatter::ReplyStringLC( CCalEntry& aEntry ) - { - FUNC_LOG; - HBufC* replyString = NULL; - HBufC* replyStringPrefix = - StringLoader::LoadLC( R_QTN_MEET_REQ_VIEWER_SUBJECT_PREFIX_REPL ); - - TPtrC subject( aEntry.SummaryL() ); - - TInt pos = subject.Find( *replyStringPrefix ); - if ( KErrNotFound == pos || KFirstPos != pos ) - { - // There is no reply prefix already or reply prefix is not at the - // beginning --> We need to add it to description - - // No need to put into cleanupstack because calling only non leaving - // functions before exiting - replyString = HBufC::NewL( - replyStringPrefix->Length() + subject.Length() ); - - TPtr ptrReply( replyString->Des() ); - - ptrReply.Copy( *replyStringPrefix ); - ptrReply.Append( subject ); - } - else - { - replyString = subject.AllocL(); - } - - CleanupStack::PopAndDestroy( replyStringPrefix ); - CleanupStack::PushL( replyString ); - - return replyString; - } - -// EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrmeetingrequestsender.cpp --- a/meetingrequest/mrtasks/src/cesmrmeetingrequestsender.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,340 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ESMR policy implementation -* -*/ - -#include "emailtrace.h" -#include "cesmrmeetingrequestsender.h" - -#include -#include -#include -#include -#include -#include -#include "mesmrmeetingrequestentry.h" -#include "cesmrcalimportexporter.h" -#include "esmrentryhelper.h" -#include "esmrhelper.h" -#include "cesmrmailplaitextformatter.h" - -// Unnamed namespace for local definitions -namespace { - -const TInt KMRBufferSize = 16 * 1024; - -_LIT8( KMethodRequest, "REQUEST" ); -_LIT8( KMethodResponse, "RESPONSE" ); -_LIT8( KMethodCancel, "CANCEL" ); -_LIT8( KNewLine, "\n" ); - -// remove hardcoded paths -//_LIT( KNCFileName, "c:\\temp\\mail.tmp" ); //codescanner::driveletters -_LIT( KNCFile, "temp\\mail.tmp" ); -// -_LIT8( KStart, "EHLO hello\n"); -_LIT8( KEnd, ".\nQUIT\n" ); - -_LIT8( KMailFromStart, "MAIL FROM:<"); -_LIT8( KRecipientTo, "RCPT TO:<"); -_LIT8( KAddressEnd, ">\n"); -_LIT8( KDataStart, "DATA\n" ); -_LIT8( KTo, "To:"); - - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Constructs file for nc application. NC application can further -// send the file to recipients. -// --------------------------------------------------------------------------- -// -void StoreToFileL( - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMailboxUtils, - const TDesC& aFreePlainText ) - { - FUNC_LOG; - HBufC8* mrBuffer = HBufC8::NewLC( KMRBufferSize ); - TPtr8 mrBufPtr( mrBuffer->Des() ); - CESMRMailPlainTextFormatter* mailPlainTextFormatter = - CESMRMailPlainTextFormatter::NewLC( aMailboxUtils ); - - mrBufPtr.Append(KStart); - - CCalEntry& entry = aEntry.Entry(); - - CCalUser* sender = entry.PhoneOwnerL(); - - if ( !sender ) - { - User::Leave( KErrArgument); - } - - mrBufPtr.Append( KMailFromStart ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( sender->Address() ) ); - mrBufPtr.Append( KAddressEnd ); - - if ( entry.MethodL() == CCalEntry::EMethodReply ) - { - CCalUser* organizer = NULL; - TRAP_IGNORE( organizer = entry.OrganizerL() ); - - mrBufPtr.Append(KRecipientTo() ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( organizer->Address() ) ); - mrBufPtr.Append(KAddressEnd()); - } - else - { - RPointerArray& attendees = entry.AttendeesL(); - TInt attendeeCount( attendees.Count() ); - for (TInt i(0); i < attendeeCount; ++i ) - { - mrBufPtr.Append(KRecipientTo() ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( attendees[i]->Address() ) ); - mrBufPtr.Append(KAddressEnd()); - } - } - - mrBufPtr.Append( KDataStart ); - - _LIT(KDateFormat,"%*E%,%D%*N %1 %2"); - _LIT( KDateStart, "Date: " ); - - TTime time; time.UniversalTime(); - TDateTime dTime = time.DateTime(); - TBuf<30> dateString; - time.FormatL(dateString, KDateFormat ); - mrBufPtr.Append( KDateStart ); - mrBufPtr.Append( dateString ); - - _LIT8( KFormat, " %d %02d:%02d:%02d +0000\n" ); - mrBufPtr.AppendFormat( KFormat, dTime.Year(), dTime.Hour(), dTime.Minute(), dTime.Second() ); - - if ( entry.MethodL() == CCalEntry::EMethodReply ) - { - // Leavescan fix - CCalUser* organizer = NULL; - TRAP_IGNORE( organizer = entry.OrganizerL() ); - - mrBufPtr.Append( KTo ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( organizer->Address() ) ); - mrBufPtr.Append( KNewLine ); - } - else - {mrBufPtr.Append( KTo ); - RPointerArray& attendees = entry.AttendeesL(); - TInt attendeeCount( attendees.Count() ); - for (TInt i(0); i < attendeeCount; ++i ) - { - - _LIT8( KComma, ","); - _LIT8( KStart, "<"); - _LIT8( KEnd, "<"); - mrBufPtr.Append( KStart ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( attendees[i]->Address() ) ); - mrBufPtr.Append( KEnd ); - mrBufPtr.Append( KComma ); - } - mrBufPtr.Append( KNewLine ); - } - - _LIT8( KReplyTo, "Reply-To: "); - mrBufPtr.Append( KReplyTo ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( sender->Address() ) ); - mrBufPtr.Append( KNewLine ); - - _LIT8( KFrom, "From: " ); - mrBufPtr.Append( KFrom ); - mrBufPtr.Append( - ESMRHelper::AddressWithoutMailtoPrefix( sender->Address() ) ); - mrBufPtr.Append( KNewLine ); - - _LIT8( KSubject, "Subject: " ); - mrBufPtr.Append( KSubject ); - HBufC8* subject = mailPlainTextFormatter->Subject8LC(aEntry); - mrBufPtr.Append( *subject ); - CleanupStack::PopAndDestroy( subject ); - mrBufPtr.Append( KNewLine ); - - _LIT8(KMimeVer, "MIME-Version: 1.0\n" ); - mrBufPtr.Append( KMimeVer ); - - _LIT8( KMailContentType, "Content-Type: multipart/alternative;\n boundary=\"EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj\"\n" ); - mrBufPtr.Append( KMailContentType ); - - _LIT8( XParams, "X-imss-version: 2.043\nX-imss-result: Passed\nX-imss-scores: Clean:45.41865 C:2 M:3 S:5 R:5\nX-imss-settings: Baseline:2 C:1 M:1 S:1 R:1 (0.1500 0.1500)\n\nThis is a MIME Message\n\n" ); - mrBufPtr.Append( XParams ); - - _LIT8( KPlainBoundary, "--EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj\nContent-Type: text/plain; charset=ISO-8859-1\nContent-Disposition: inline\nContent-Transfer-Encoding: quoted-printable\n\n" ); - mrBufPtr.Append( KPlainBoundary ); - - HBufC8* bodyText = mailPlainTextFormatter->Body8LC( aEntry ); - mrBufPtr.Append( *bodyText ); - CleanupStack::PopAndDestroy( bodyText ); - - if ( aFreePlainText.Length() ) - { - _LIT8( KFreeTextSeparatorTxt, "------------------------------------------------------------------------\n" ); - mrBufPtr.Append( KFreeTextSeparatorTxt ); - - HBufC8* freeTxt8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aFreePlainText ); - mrBufPtr.Append( *freeTxt8 ); - mrBufPtr.Append( KNewLine ); - mrBufPtr.Append( KNewLine ); - - delete freeTxt8; - } - - _LIT( KMRBoundary, "--EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj\nContent-Type: text/calendar;\n method="); - mrBufPtr.Append( KMRBoundary ); - - if ( entry.MethodL() == CCalEntry::EMethodRequest ) - { - mrBufPtr.Append( KMethodRequest ); - } - else if ( entry.MethodL() == CCalEntry::EMethodCancel ) - { - mrBufPtr.Append( KMethodCancel ); - } - else - { - mrBufPtr.Append( KMethodResponse ); - } - mrBufPtr.Append( KNewLine ); - - _LIT( KMRBoundaryEnd, " name=\"meeting.ics\"\nContent-Transfer-Encoding: 8bit\n\n" ); - mrBufPtr.Append( KMRBoundaryEnd ); - - - CESMRCalImportExporter* calExporter = CESMRCalImportExporter::NewLC(); - - HBufC8* iCal = calExporter->ExportToICal8LC( entry ); - mrBufPtr.Append( *iCal ); - - CleanupStack::PopAndDestroy( iCal ); - CleanupStack::PopAndDestroy(calExporter); - - mrBufPtr.Append( KNewLine ); - - - _LIT(KBoundaryEnd, "--EPOC32-cqFgWS+P6_g42_fH-ySFynWD'-TgP+tX+tHKMDhNp-fmZFHj--\n\n\n" ); - mrBufPtr.Append( KBoundaryEnd ); - mrBufPtr.Append( KEnd); - - RFile ncFile; - RFs& fs = CCoeEnv::Static()->FsSession(); - // remove hard coded paths - //TInt err = fs.MkDirAll( KNCFileName() ); - TFileName fileName(KNCFile); - User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); - TInt err = ncFile.Replace( fs, fileName, EFileWrite ); - // - if (KErrAlreadyExists != err ) - { - User::LeaveIfError( err ); - } - - CleanupClosePushL( ncFile ); - User::LeaveIfError( ncFile.Write(mrBufPtr) ); - CleanupStack::PopAndDestroy( &ncFile ); - // mrBuffer, mailPlainTextFormatter - CleanupStack::PopAndDestroy( 2, mrBuffer ); - } - -} // namespace - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRMeetingRequestSender::CESMRMeetingRequestSender -// --------------------------------------------------------------------------- -// -inline CESMRMeetingRequestSender::CESMRMeetingRequestSender( - CMRMailboxUtils& aMailboxUtils) : - iMailboxUtils( aMailboxUtils ) - - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRMeetingRequestSender::~CESMRMeetingRequestSender -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRMeetingRequestSender::~CESMRMeetingRequestSender() - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRMeetingRequestSender::NewL -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRMeetingRequestSender* - CESMRMeetingRequestSender::NewL( - CMRMailboxUtils& aMailboxUtils ) - { - CESMRMeetingRequestSender* self = - new (ELeave) CESMRMeetingRequestSender( aMailboxUtils ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRMeetingRequestSender::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRMeetingRequestSender::ConstructL() - { - FUNC_LOG; - //do nothing - } - - -// --------------------------------------------------------------------------- -// CESMRMeetingRequestSender::CreateAndSendMeetingRequestL -// --------------------------------------------------------------------------- -// -void CESMRMeetingRequestSender::CreateAndSendMeetingRequestL( - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - StoreToFileL( aEntry, iMailboxUtils, KNullDesC() ); - } - -// --------------------------------------------------------------------------- -// CESMRMeetingRequestSender::CreateAndSendMeetingRequestL -// --------------------------------------------------------------------------- -// -void CESMRMeetingRequestSender::CreateAndSendMeetingRequestL( - MESMRMeetingRequestEntry& aEntry, - const TDesC& aFreePlainText ) - { - FUNC_LOG; - StoreToFileL( aEntry, iMailboxUtils, aFreePlainText ); - } - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp --- a/meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,351 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR send MR via fs email task -* -*/ - -#include "emailtrace.h" -#include "cesmrsendmrfsmailreplytask.h" - -#include -#include -#include -#include -#include -// -#include "cfsmailmessage.h" -#include -#include -#include "FreestyleEmailUiConstants.h" -// - -#include "cesmrcaldbmgr.h" -#include "mesmrmeetingrequestentry.h" -#include "cesmrfsemailmanager.h" -#include "cesmrmailplaitextformatter.h" -#include "cesmrcalimportexporter.h" -#include "cesmrcaluserutil.h" -#include "tesmrinputparams.h" -#include "esmrhelper.h" - -// Unnamed namespace for local definitions -namespace { - -#ifdef _DEBUG - -// Literal for panics -_LIT( ESMRSendMRRespMailPanicTxt, "ESMRSendMRFSEMailTask" ); - -// Panic codes -enum TESMRSendMRFSMailTaskPanic - { - EESMRSendMRFSAttendeesMissing, - EESMRCannotBeTriggeredFromMail - }; - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Panic wrapper method -// --------------------------------------------------------------------------- -// -void Panic( TESMRSendMRFSMailTaskPanic aPanic ) - { - - User::Panic( ESMRSendMRRespMailPanicTxt, aPanic ); - } - -#endif // _DEBUG - -// --------------------------------------------------------------------------- -// Leave wrapper method -// --------------------------------------------------------------------------- -// -inline void DoLeaveIfErrorL( TInt aLeaveCode ) - { - if ( KErrNone != aLeaveCode ) - { - - User::Leave( aLeaveCode ); - } - } -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::CESMRSendMRFSMailReplyTask -// --------------------------------------------------------------------------- -// -CESMRSendMRFSMailReplyTask::CESMRSendMRFSMailReplyTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TBool aReplyAll) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), - iReplyAll(aReplyAll) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::~CESMRSendMRFSMailReplyTask -// --------------------------------------------------------------------------- -// -CESMRSendMRFSMailReplyTask::~CESMRSendMRFSMailReplyTask() - { - FUNC_LOG; - delete iEntryToSend; - delete iCaluserUtil; - delete iEmailMgr; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::NewL -// --------------------------------------------------------------------------- -// -CESMRSendMRFSMailReplyTask* CESMRSendMRFSMailReplyTask::NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TBool aReplyAll) - { - FUNC_LOG; - - CESMRSendMRFSMailReplyTask* self = - new (ELeave) CESMRSendMRFSMailReplyTask( - aCalDbMgr, - aEntry, - aMRMailboxUtils, - aReplyAll); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailReplyTask::ConstructL() - { - FUNC_LOG; - BaseConstructL(); - iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailReplyTask::ExecuteTaskL() - { - FUNC_LOG; - - iEntryToSend = ESMREntry().ValidateEntryL(); - iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); - - ConstructMailL(); - - iEmailMgr->StoreMessageToDraftsFolderL(); - - LaunchFSEmailEditorL(iReplyAll); - - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::ConstructMailL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailReplyTask::ConstructMailL() - { - FUNC_LOG; - - // create text formatter: - CESMRMailPlainTextFormatter* textFormatter = - CESMRMailPlainTextFormatter::NewLC( MailboxUtils() ); - - TESMRInputParams startupparams; - TBool isEmail = ESMREntry().StartupParameters(startupparams); - - // This command cannot be triggered from email - __ASSERT_DEBUG( !isEmail, Panic(EESMRCannotBeTriggeredFromMail) ); - - if(isEmail) - { - // This command cannot be triggered from email - User::Leave( KErrNotSupported ); - } - else - { - //launched from calendar, mail id available for mr - - // Prepare email manager for sending - CCalUser* mailboxUser = iEntryToSend->PhoneOwnerL(); - iEmailMgr->PrepareForSendingL( - ESMRHelper::AddressWithoutMailtoPrefix( - mailboxUser->Address() ) ); - - // set the email subject: - HBufC* subject = - textFormatter->ReplyStringLC( *iEntryToSend ); - - iEmailMgr->SetSubjectL(*subject); - CleanupStack::PopAndDestroy(subject); - - CCalUser* organizer = iEntryToSend->OrganizerL(); - - //Add organizer as sender - iEmailMgr->SetSenderL( - organizer->Address(), - organizer->CommonName() ); - - if(iReplyAll) - { - //Add also required and optional attendees - AddAttendeesL(); - } - } - - CleanupStack::PopAndDestroy(textFormatter); - - } - - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::AddAttendeesL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailReplyTask::AddAttendeesL() - { - FUNC_LOG; - - RArray requiredAttendees; - CleanupClosePushL( requiredAttendees ); - - RArray optionalAttendees; - CleanupClosePushL( optionalAttendees ); - - iCaluserUtil->GetAttendeesL( - requiredAttendees, - EESMRRoleRequiredAttendee ); - iCaluserUtil->GetAttendeesL( - optionalAttendees, - EESMRRoleOptionalAttendee ); - - // Add recipients and cc-recipients - TInt attendeeCount( requiredAttendees.Count() ); - - __ASSERT_DEBUG( attendeeCount, Panic(EESMRSendMRFSAttendeesMissing) ); - - if ( !attendeeCount ) - { - DoLeaveIfErrorL( KErrArgument ); - } - - for (TInt i(0); i < attendeeCount; ++i) - { - iEmailMgr->AppendToRecipientL( - requiredAttendees[i]->Address(), - requiredAttendees[i]->CommonName() ); - } - - TInt optAttendeeCount( optionalAttendees.Count() ); - for (TInt i(0); i < optAttendeeCount; ++i) - { - iEmailMgr->AppendToRecipientL( - optionalAttendees[i]->Address(), - optionalAttendees[i]->CommonName() ); - } - - CleanupStack::PopAndDestroy(2, &requiredAttendees ); - - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::ResolveUsedMailboxUserAddressLC -// --------------------------------------------------------------------------- -// -HBufC* CESMRSendMRFSMailReplyTask::ResolveUsedMailboxUserAddressLC() - { - FUNC_LOG; - - HBufC* mailboxUserAddress = NULL; - MESMRMeetingRequestEntry& mrEntry( ESMREntry()); - if ( mrEntry.IsForwardedL() ) - { - // Entry is forwarder --> Use default mailbox - CMRMailboxUtils::TMailboxInfo mbInfo; - CMRMailboxUtils& mbUtils( MailboxUtils() ); - mbUtils.GetDefaultMRMailBoxL( mbInfo ); - mailboxUserAddress = mbInfo.iEmailAddress.AllocLC(); - } - else - { - CCalUser *mailboxUser = iEntryToSend->PhoneOwnerL(); - mailboxUserAddress = mailboxUser->Address().AllocLC(); - } - - return mailboxUserAddress; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailReplyTask::LaunchFSEmailEditorL -// --------------------------------------------------------------------------- -// -TInt CESMRSendMRFSMailReplyTask::LaunchFSEmailEditorL(TBool aReplAll) - { - FUNC_LOG; - CCoeEnv* coe = CCoeEnv::Static(); - - CCoeAppUi* appui = coe->AppUi(); - - // fill params - TEditorLaunchParams params; - params.iActivatedExternally = ETrue; - params.iMailboxId = iEmailMgr->MailboxId(); - params.iFolderId = iEmailMgr->MessageFolderId(); - params.iMsgId = iEmailMgr->MessageId(); - - TVwsViewId viewId( - KFSEmailUiUid, - MailEditorId ); - - TUid editorCommand; - - if(aReplAll) - { - editorCommand = TUid::Uid( KEditorCmdReplyAll ); - } - else - { - editorCommand = TUid::Uid( KEditorCmdReply ); - } - - TPckgC buf( params ); - - appui->ActivateViewL( - viewId, - editorCommand, - buf ); - - return KErrNone; - } - -//EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrsendmrfsmailtask.cpp --- a/meetingrequest/mrtasks/src/cesmrsendmrfsmailtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,798 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR send MR via fs email task -* -*/ - - -#include "emailtrace.h" -#include "cesmrsendmrfsmailtask.h" -#include "cesmrcaldbmgr.h" -#include "mesmrmeetingrequestentry.h" -#include "cesmrfsemailmanager.h" -#include "cesmrmailplaitextformatter.h" -#include "cesmrcalimportexporter.h" -#include "cesmrcaluserutil.h" -#include "cesmrguilistquery.h" -#include "esmrhelper.h" - -#include -#include -#include -#include -#include -#include -#include - -// Unnamed namespace for local definitions -namespace { - -/** - * Adds updated label into summary field. - */ -void UpdateSummaryL( - CCalEntry& aEntry, - CESMRMailPlainTextFormatter& aPlainTextFormatter ) - { - FUNC_LOG; - TPtrC currentSummary( aEntry.SummaryL() ); - - CCalEntry::TMethod method( aEntry.MethodL() ); - if ( CCalEntry::EMethodRequest == method && aEntry.SequenceNumberL() ) - { - // This is update - HBufC* updateStr = aPlainTextFormatter.UpdatedStringLC(); - HBufC* summary = HBufC::NewLC( - updateStr->Length() + currentSummary.Length() ); - - if ( currentSummary.Find(*updateStr) == KErrNotFound ) - { - TPtr summaryPtr( summary->Des() ); - summaryPtr.Append( *updateStr ); - summaryPtr.Append( currentSummary ); - aEntry.SetSummaryL( summaryPtr ); - } - CleanupStack::PopAndDestroy( summary ); - summary = NULL; - - CleanupStack::PopAndDestroy( updateStr ); - updateStr = NULL; - } - else if ( CCalEntry::EMethodCancel == method ) - { - // This is cancellation - HBufC* cancelStr = aPlainTextFormatter.CanceledStringLC(); - HBufC* summary = HBufC::NewLC( - cancelStr->Length() + currentSummary.Length() ); - - if ( currentSummary.Find(*cancelStr) == KErrNotFound ) - { - TPtr summaryPtr( summary->Des() ); - summaryPtr.Append( *cancelStr ); - summaryPtr.Append( currentSummary ); - aEntry.SetSummaryL( summaryPtr ); - } - CleanupStack::PopAndDestroy( summary ); - summary = NULL; - - CleanupStack::PopAndDestroy( cancelStr ); - cancelStr = NULL; - } - } - -/** - * Cleanup operation for RPointerArray. - * - * @param aArray Pointer to RPointerArray. - */ -void CalAttendeePointerArrayCleanup( TAny* aArray ) - { - RPointerArray* attendeeArray = - static_cast*>( aArray ); - - attendeeArray->ResetAndDestroy(); - attendeeArray->Close(); - } - -#ifdef _DEBUG - -// Literal for panics -_LIT( ESMRSendMRRespMailPanicTxt, "ESMRSendMRFSEMailTask" ); - -// Panic codes -enum TESMRSendMRFSMailTaskPanic - { - EESMRSendMRFSMailInvalidMethod, - EESMRSendMRFSAttendeesMissing, - EESMRSendMRNoEntriesToSend - }; - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Panic wrapper method -// --------------------------------------------------------------------------- -// -void Panic( TESMRSendMRFSMailTaskPanic aPanic ) - { - - User::Panic( ESMRSendMRRespMailPanicTxt, aPanic ); - } - -#endif // _DEBUG - - -// Definition for temporary calendar file -// remove hard coded paths -//_LIT( KPath, "c:\\temp\\" ); //codescanner::driveletters -//_LIT( KFileAndPath, "c:\\temp\\meeting.ics" ); //codescanner::driveletters -//_LIT( KCancellationFile, "c:\\temp\\cancel.ics" ); //codescanner::driveletters -_LIT( KFile, "temp\\meeting.ics" ); -_LIT( KCancelFile, "temp\\cancel.ics" ); -// - -// --------------------------------------------------------------------------- -// Leave wrapper method -// --------------------------------------------------------------------------- -// -inline void DoLeaveIfErrorL( TInt aLeaveCode ) - { - if ( KErrNone != aLeaveCode ) - { - - User::Leave( aLeaveCode ); - } - } -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::CESMRSendMRFSMailTask -// --------------------------------------------------------------------------- -// -CESMRSendMRFSMailTask::CESMRSendMRFSMailTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRCommand aCommand ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), - iCommand( aCommand ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::~CESMRSendMRFSMailTask -// --------------------------------------------------------------------------- -// -CESMRSendMRFSMailTask::~CESMRSendMRFSMailTask() - { - FUNC_LOG; - iEntriesToSend.ResetAndDestroy(); - delete iCaluserUtil; - delete iEmailMgr; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::NewL -// --------------------------------------------------------------------------- -// -CESMRSendMRFSMailTask* CESMRSendMRFSMailTask::NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRCommand aCommand ) - { - FUNC_LOG; - - CESMRSendMRFSMailTask* self = - new (ELeave) CESMRSendMRFSMailTask( - aCalDbMgr, - aEntry, - aMRMailboxUtils, - aCommand ); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::ConstructL() - { - FUNC_LOG; - BaseConstructL(); - iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::ExecuteTaskL() - { - FUNC_LOG; - - iEntryToSend = ESMREntry().ValidateEntryL(); - - iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); - - CCalEntry::TMethod method( iEntryToSend->MethodL() ); - - // Checking input paramters - if( !(CCalEntry::EMethodRequest == method || - CCalEntry::EMethodCancel == method ) || - CCalEntry::EAppt != iEntryToSend->EntryTypeL() ) - { - DoLeaveIfErrorL( KErrArgument ); - } - - // Get entries to be sent - GetEntriesToBeSentL(); - ResolveSendTypeL(); - - if ( NeedToSendInvitationL() ) - { - TInt entryCount( iEntriesToSend.Count() ); - for (TInt i(0); i < entryCount; ++i ) - { - iEntryToSend = iEntriesToSend[i]; - ConstructMailL(); - TInt ret = iEmailMgr->SendMessageL(); - User::LeaveIfError(ret); - } - } - - if ( EESMRCmdSendMRUpdate == iCommand && - NeedToSendCancellationL() ) - { - delete iEmailMgr; iEmailMgr = NULL; - iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); - - TInt entryCount( iEntriesToSend.Count() ); - for (TInt i(0); i < entryCount; ++i ) - { - // Sending cancellation to removed attendees - iEntryToSend = iEntriesToSend[i]; - iEntryToSend->SetMethodL( CCalEntry::EMethodCancel ); - - ConstructMailL(); - TInt ret = iEmailMgr->SendMessageL(); - User::LeaveIfError(ret); - } - } - - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::ConstructMailL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::ConstructMailL() - { - FUNC_LOG; - - // create text formatter: - CESMRMailPlainTextFormatter* textFormatter = - CESMRMailPlainTextFormatter::NewLC( MailboxUtils() ); - - // Prepare email manager for sending - HBufC* mbOwnerAddr = ResolveUsedMailboxUserAddressLC(); - TPtrC emailAddr( ESMRHelper::AddressWithoutMailtoPrefix( *mbOwnerAddr ) ); - iEmailMgr->PrepareForSendingL( emailAddr ); - - TBool isForwarded( ESMREntry().IsForwardedL() ); - if ( isForwarded ) - { - CCalUser* organizer = iEntryToSend->OrganizerL(); - CCalUser* forwardOrganizer = - CCalUser::NewL( - organizer->Address(), - emailAddr ); - CleanupStack::PushL( forwardOrganizer ); - forwardOrganizer->SetCommonNameL( organizer->CommonName() ); - - // Ownership is transferred to entry - iEntryToSend->SetOrganizerL( forwardOrganizer ); - CleanupStack::Pop( forwardOrganizer ); - - iEmailMgr->SetSenderL( - forwardOrganizer->Address(),forwardOrganizer->CommonName() ); - - iEmailMgr->SetReplyToAddressL( - forwardOrganizer->Address(), forwardOrganizer->CommonName() ); - - organizer = NULL; - forwardOrganizer = NULL; - } - - CleanupStack::PopAndDestroy( mbOwnerAddr ); - - // set the email subject: - HBufC* subject = NULL; - if ( CCalEntry::EMethodRequest == iEntryToSend->MethodL() ) - { - subject = textFormatter->Subject16LC( - *iEntryToSend, - ESMREntry().IsForwardedL(), - EESMRCmdSendMRUpdate == iCommand ); - } - else - { - subject = textFormatter->Subject16LC( - *iEntryToSend, - ESMREntry().IsForwardedL(), - EFalse ); - } - - iEmailMgr->SetSubjectL( *subject ); - CleanupStack::PopAndDestroy( subject ); - subject = NULL; - - AddAttendeesL(); - - // Set text/plain part: - HBufC* body = textFormatter->Body16LC( *iEntryToSend ); - iEmailMgr->CreateTextPlainPartL( *body ); - CleanupStack::PopAndDestroy(body); - body = NULL; - - // export the calendar entry in iCal format: - UpdateSummaryL( *iEntryToSend, *textFormatter ); - - TInt priority( iEntryToSend->PriorityL() ); - SetCorrectAttendeesToEntryL(); - CESMRCalImportExporter* calExporter = CESMRCalImportExporter::NewLC(); - HBufC* calendarPart = calExporter->ExportToICal16LC( *iEntryToSend ); - - // Set text/calendar part: - CESMRFSEMailManager::TESMRMethod method( - CESMRFSEMailManager::EESMRMethodRequest); - - CCalEntry::TMethod entryMethod( iEntryToSend->MethodL() ); - switch ( entryMethod ) - { - case CCalEntry::EMethodRequest: - { - method = CESMRFSEMailManager::EESMRMethodRequest; - } - break; - case CCalEntry::EMethodCancel: - { - method = CESMRFSEMailManager::EESMRMethodCancel; - } - break; - case CCalEntry::EMethodReply://fallthrough, EMethodReply not needed - default: - break; - } - - if ( CCalEntry::EMethodCancel == entryMethod ) - { - // removing hardcoded paths - TFileName fileName(KCancelFile); - User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); - SaveICalToFileL( *calendarPart, KCancelFile ); - iEmailMgr->CreateTextCalendarPartL(method, KCancelFile); - // - } - else - { - // removing hardcoded paths - TFileName fileName(KFile); - User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); - SaveICalToFileL( *calendarPart, fileName ); - iEmailMgr->CreateTextCalendarPartL(method, fileName); - // - } - - CleanupStack::PopAndDestroy(3, textFormatter); - - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::SaveICalToFileL -// --------------------------------------------------------------------------- -// -TInt CESMRSendMRFSMailTask::SaveICalToFileL( const TDesC& aICal, - const TDesC& aFilename ) - { - FUNC_LOG; - //create 8 bit buffer for temp file content - TInt length = aICal.Length() * 2; - HBufC8* buffer = HBufC8::NewLC( length ); - TPtr8 des = buffer->Des(); - - // covert the 16 bit iCal to 8 bit iCal: - TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8(des, aICal); - - RFs& fs( CCoeEnv::Static()->FsSession() ); - - // ensure the path exists: - //remove hardcoded paths - //BaflUtils::EnsurePathExistsL(fs, KPath); - // - - // delete previous file - fs.Delete( aFilename ); - - // save the iCal to file system: - RFile file; - User::LeaveIfError(file.Create(fs, aFilename, EFileWrite)); - CleanupClosePushL(file); - User::LeaveIfError(file.Write(*buffer)); - - // clean up: - CleanupStack::PopAndDestroy(2, buffer); // file, fs, buffer - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::AddAttendeesL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::AddAttendeesL() - { - FUNC_LOG; - - RArray requiredAttendees; - CleanupClosePushL( requiredAttendees ); - - RArray optionalAttendees; - CleanupClosePushL( optionalAttendees ); - - GetAttendeesToBeSentL( requiredAttendees, optionalAttendees ); - - // Add recipients and cc-recipients - TInt attendeeCount( requiredAttendees.Count() ); - TInt optAttendeeCount( optionalAttendees.Count() ); - - __ASSERT_DEBUG( attendeeCount || optAttendeeCount, Panic(EESMRSendMRFSAttendeesMissing) ); - - if ( !attendeeCount && !optAttendeeCount) - { - DoLeaveIfErrorL( KErrArgument ); - } - - for (TInt i(0); i < attendeeCount; ++i) - { - TPtrC emailAddr( requiredAttendees[i]->Address() ); - - - iEmailMgr->AppendToRecipientL( - emailAddr, - requiredAttendees[i]->CommonName() ); - } - - for (TInt i(0); i < optAttendeeCount; ++i) - { - TPtrC emailAddr( optionalAttendees[i]->Address() ); - - - iEmailMgr->AppendCCRecipientL( - emailAddr, - optionalAttendees[i]->CommonName() ); - } - - CleanupStack::PopAndDestroy(2, &requiredAttendees ); - - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::ResolveUsedMailboxUserAddressLC -// --------------------------------------------------------------------------- -// -HBufC* CESMRSendMRFSMailTask::ResolveUsedMailboxUserAddressLC() - { - FUNC_LOG; - - HBufC* mailboxUserAddress = NULL; - MESMRMeetingRequestEntry& mrEntry( ESMREntry()); - if ( mrEntry.IsForwardedL() ) - { - // Entry is forwarded --> Use default mailbox - CMRMailboxUtils::TMailboxInfo mbInfo; - CMRMailboxUtils& mbUtils( MailboxUtils() ); - mbUtils.GetDefaultMRMailBoxL( mbInfo ); - mailboxUserAddress = mbInfo.iEmailAddress.AllocLC(); - } - else - { - CCalUser *mailboxUser = iEntryToSend->PhoneOwnerL(); - mailboxUserAddress = mailboxUser->Address().AllocLC(); - } - - return mailboxUserAddress; - } - - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::ResolveSendTypeL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::ResolveSendTypeL() - { - FUNC_LOG; - - if ( EESMRCmdSendMRUpdate == iCommand ) - { - RArray addedAttendees; - CleanupClosePushL( addedAttendees ); - - RArray removedAttendees; - CleanupClosePushL( removedAttendees ); - - ESMREntry().GetAddedAttendeesL( - addedAttendees, - EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); - ESMREntry().GetRemovedAttendeesL( - removedAttendees, - EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); - - if ( addedAttendees.Count() || removedAttendees.Count() ) - { - TInt sendType = CESMRGUIListQuery::ExecuteL( - CESMRGUIListQuery::EESMRSendUpdateToAllQuery ); - - if ( KErrCancel == sendType ) - { - User::Leave( KErrCancel ); - } - - iSendType = static_cast(sendType ); - } - - CleanupStack::PopAndDestroy( &removedAttendees ); - CleanupStack::PopAndDestroy( &addedAttendees ); - } - - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::NeedToSendInvitationL -// --------------------------------------------------------------------------- -// -TBool CESMRSendMRFSMailTask::NeedToSendInvitationL() - { - FUNC_LOG; - - TBool retValue( ETrue ); - - RArray addedAttendees; - CleanupClosePushL( addedAttendees ); - - if ( EESMRCmdSendMRUpdate == iCommand && - ESentToAddedAndRemoved == iSendType ) - { - ESMREntry().GetAddedAttendeesL( - addedAttendees, - EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); - - if ( !addedAttendees.Count() ) - { - retValue = EFalse; - } - } - - CleanupStack::PopAndDestroy( &addedAttendees ); - - - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::NeedToSendCancellationL -// --------------------------------------------------------------------------- -// -TBool CESMRSendMRFSMailTask::NeedToSendCancellationL() - { - FUNC_LOG; - - TBool retValue( EFalse ); - - RArray removedAttendees; - CleanupClosePushL( removedAttendees ); - - if ( EESMRCmdSendMRUpdate == iCommand ) - { - ESMREntry().GetRemovedAttendeesL( - removedAttendees, - EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee ); - - if ( removedAttendees.Count() ) - { - retValue = ETrue; - } - } - - CleanupStack::PopAndDestroy( &removedAttendees ); - - - return retValue; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::NeedToSendCancellationL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::SetCorrectAttendeesToEntryL() - { - FUNC_LOG; - if ( EESMRCmdSendMRUpdate == iCommand ) - { - TESMRMailPlugin plugin( ESMREntry().CurrentPluginL() ); - - CCalEntry::TMethod method( iEntryToSend->MethodL() ); - - RArray requiredAttendees; - CleanupClosePushL( requiredAttendees ); - - RArray optionalAttendees; - CleanupClosePushL( optionalAttendees ); - - GetAttendeesToBeSentL( requiredAttendees, optionalAttendees ); - - RPointerArray attendees; - CleanupStack::PushL( - TCleanupItem( - CalAttendeePointerArrayCleanup, - &attendees ) ); - - - TInt attendeeCount( requiredAttendees.Count() ); - for ( TInt i(0); i < attendeeCount; ++i ) - { - // Make copy of the attendees - CCalAttendee* attendee = ESMRHelper::CopyAttendeeL(*requiredAttendees[i] ); - User::LeaveIfError( - attendees.Append( attendee ) ); - } - - TInt optionalAttendeeCount( optionalAttendees.Count() ); - for ( TInt i(0); i < optionalAttendeeCount; ++i ) - { - // Make copy of the attendees - CCalAttendee* attendee = ESMRHelper::CopyAttendeeL(*optionalAttendees[i] ); - User::LeaveIfError( - attendees.Append( attendee ) ); - } - - // Clean attendee array - while ( iEntryToSend->AttendeesL().Count() ) - { - iEntryToSend->DeleteAttendeeL( 0 ); - } - - while ( attendees.Count() ) - { - CCalAttendee* attendee = attendees[0]; - iEntryToSend->AddAttendeeL( attendee ); - attendees.Remove(0); - } - - CleanupStack::PopAndDestroy( &attendees ); - CleanupStack::PopAndDestroy( &optionalAttendees ); - CleanupStack::PopAndDestroy( &requiredAttendees ); - } - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::NeedToSendCancellationL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::GetAttendeesToBeSentL( - RArray& aRequiredAttendees, - RArray& aOptionalAttendees ) - { - FUNC_LOG; - CCalEntry::TMethod method( iEntryToSend->MethodL() ); - - if ( EESMRCmdSendMRUpdate == iCommand && - ESentToAddedAndRemoved == iSendType && - CCalEntry::EMethodRequest == method ) - { - ESMREntry().GetAddedAttendeesL( - aRequiredAttendees, - EESMRRoleRequiredAttendee ); - ESMREntry().GetAddedAttendeesL( - aOptionalAttendees, - EESMRRoleOptionalAttendee ); - } - else if (EESMRCmdSendMRUpdate == iCommand && - CCalEntry::EMethodCancel == method ) - { - ESMREntry().GetRemovedAttendeesL( - aRequiredAttendees, - EESMRRoleRequiredAttendee ); - ESMREntry().GetRemovedAttendeesL( - aOptionalAttendees, - EESMRRoleOptionalAttendee ); - } - else - { - iCaluserUtil->GetAttendeesL( - aRequiredAttendees, - EESMRRoleRequiredAttendee ); - iCaluserUtil->GetAttendeesL( - aOptionalAttendees, - EESMRRoleOptionalAttendee ); - } - } - -// --------------------------------------------------------------------------- -// CESMRSendMRFSMailTask::GetEntriesToBeSentL -// --------------------------------------------------------------------------- -// -void CESMRSendMRFSMailTask::GetEntriesToBeSentL() - { - FUNC_LOG; - // Clear the entry array - iEntriesToSend.ResetAndDestroy(); - - if ( EESMRCmdSendMRUpdate == iCommand ) - { - // We are sending update and we need to send all the entries - CCalEntry* mainEntry = ESMREntry().ValidateEntryL(); - CleanupStack::PushL( mainEntry ); - - if ( MESMRCalEntry::EESMRAllInSeries == ESMREntry().RecurrenceModRule() ) - { - // Update child entries sequence number - ESMREntry().UpdateChildEntriesSeqNumbersL(); - - // We are sending update to series - // Also the modifying entries need to be sent - // Otherwise the modifying entries may disappear from the - // attendees calendar. - CalDbMgr().NormalDbEntryView()->FetchL( - mainEntry->UidL(), - iEntriesToSend ); - - CleanupStack::PopAndDestroy( mainEntry ); - } - else - { - // Ownership transferred - TInt err = iEntriesToSend.Append( mainEntry ); - User::LeaveIfError( err ); - - CleanupStack::Pop( mainEntry ); - } - - mainEntry = NULL; - } - else - { - // We are sending either: - // a) Single entry - // b) Modified instance from series - // c) First invitation to series - // d) forwarding entry - TInt err = iEntriesToSend.Append( ESMREntry().ValidateEntryL() ); - User::LeaveIfError( err ); - } - - __ASSERT_DEBUG( iEntriesToSend.Count(), Panic(EESMRSendMRNoEntriesToSend ) ); - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrsendmrrespfsmailtask.cpp --- a/meetingrequest/mrtasks/src/cesmrsendmrrespfsmailtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,358 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for sending MR response via fs email -* -*/ -#include "emailtrace.h" -#include "cesmrsendmrrespfsmailtask.h" - -#include -#include -#include -// -#include "mmrinfoprocessor.h" -// -#include -#include -#include -#include - -#include "cesmrcaldbmgr.h" -#include "mesmrmeetingrequestentry.h" -#include "cesmrmailplaitextformatter.h" -#include "cesmrfsemailmanager.h" -#include "cesmrcalimportexporter.h" -#include "tesmrinputparams.h" -#include "cesmrcaluserutil.h" -#include "esmrhelper.h" - -// Unnamed namespace for local definitions -namespace { -// Literal for plain text separator -_LIT( KPlainTextResponseTxtSeparator, - "\n----------------------------------------\n"); - - -// Literal for response iCal file -// remove hard coded paths -//_LIT( KPath, "c:\\temp\\" ); //codescanner::driveletters -//_LIT( KFileAndPath, "c:\\temp\\response.ics" ); //codescanner::driveletters -//_LIT( KPath, "temp\\" ); -_LIT( KFileName, "temp\\response.ics" ); -// - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::CESMRSendMRRespFSMailTask -// --------------------------------------------------------------------------- -// -CESMRSendMRRespFSMailTask::CESMRSendMRRespFSMailTask( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), - iCommand( aCommand ), - iResponseType( aResponseType ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::~CESMRSendMRRespFSMailTask -// --------------------------------------------------------------------------- -// -CESMRSendMRRespFSMailTask::~CESMRSendMRRespFSMailTask() - { - FUNC_LOG; - delete iCaluserUtil; - delete iEntryToSend; - delete iResponseMessage; - delete iEmailMgr; - delete iTextFormatter; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::NewL -// --------------------------------------------------------------------------- -// -CESMRSendMRRespFSMailTask* CESMRSendMRRespFSMailTask::NewL( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType, - const TDesC& aResponseMessage ) - { - FUNC_LOG; - CESMRSendMRRespFSMailTask* self = - new (ELeave) CESMRSendMRRespFSMailTask( - aCommand, - aCalDbMgr, - aEntry, - aMRMailboxUtils, - aResponseType ); - - CleanupStack::PushL(self); - self->ConstructL(aResponseMessage); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::ConstructL( - const TDesC& aResponseMessage ) - { - FUNC_LOG; - BaseConstructL(); - iEmailMgr = CESMRFSEMailManager::NewL( MailboxUtils() ); - iTextFormatter = CESMRMailPlainTextFormatter::NewL( MailboxUtils() ); - iResponseMessage = aResponseMessage.AllocL(); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::ExecuteTaskL() - { - FUNC_LOG; - iEntryToSend = ESMREntry().ValidateEntryL(); - - // Checking input paramters - if( CCalEntry::EMethodReply != iEntryToSend->MethodL() && - EESMRCmdRemoveFromCalendar != iCommand ) - { - User::Leave( KErrArgument ); - } - - if ( ESMREntry().IsSyncObjectPresent( ) ) - { - SendMailViaSyncL(); - } - else - { - iCaluserUtil = CESMRCalUserUtil::NewL( *iEntryToSend ); - - // create mail message: - ConstructMailL(); - - TInt ret = iEmailMgr->SendMessageL(); - User::LeaveIfError(ret); - } - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::ConstructMailL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::ConstructMailL() - { - FUNC_LOG; - // Prepare email manager for sending - CCalUser *mailboxUser = ESMREntry().Entry().PhoneOwnerL(); - iEmailMgr->PrepareForSendingL( - ESMRHelper::AddressWithoutMailtoPrefix( - mailboxUser->Address() ) ); - - // set the email subject - HBufC* subject = - iTextFormatter->Subject16LC( - *iEntryToSend, - ESMREntry().IsForwardedL(), - ESMREntry().IsEntryEditedL() ); - - iEmailMgr->SetSubjectL(*subject); - CleanupStack::PopAndDestroy(subject); - subject = NULL; - - // Set the To recipient - iEmailMgr->AppendToRecipientL( - iEntryToSend->OrganizerL()->Address(), - iEntryToSend->OrganizerL()->CommonName() ); - - // Set text/plain part - AddPlainTextPartL(); - - // Set text/calendar part: - AddCalendarPartL(); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::AddPlainTextPartL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::AddPlainTextPartL() - { - FUNC_LOG; - - HBufC* plainText = iTextFormatter->Body16LC( *iEntryToSend ); - if ( iResponseMessage ) - { - TPtrC plainTextSeparator( KPlainTextResponseTxtSeparator() ); - - plainText = plainText->ReAlloc( - plainText->Length() + - plainTextSeparator.Length() + - iResponseMessage->Length() ); - - CleanupStack::Pop( plainText ); - CleanupStack::PushL( plainText ); - - TPtr ptrPlainText( plainText->Des() ); - ptrPlainText.Append( plainTextSeparator ); - ptrPlainText.Append( *iResponseMessage ); - } - - iEmailMgr->CreateTextPlainPartL(*plainText); - CleanupStack::PopAndDestroy(plainText); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::AddCalendarPartL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::AddCalendarPartL() - { - FUNC_LOG; - SetAttendeesL(); - - CESMRCalImportExporter* calExporter = - CESMRCalImportExporter::NewLC(); - - HBufC* calendarPart = - calExporter->ExportToICal16LC( *iEntryToSend ); - - // removing hardcoded paths - TFileName fileName(KFileName); - User::LeaveIfError(ESMRHelper::CreateAndAppendPrivateDirToFileName(fileName)); - SaveICalToFileL( *calendarPart, fileName ); - iEmailMgr->CreateTextCalendarPartL( - CESMRFSEMailManager::EESMRMethodResponse, - fileName); - // - - CleanupStack::PopAndDestroy( calendarPart ); - CleanupStack::PopAndDestroy( calExporter ); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::SendMailViaSyncL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::SendMailViaSyncL() - { - FUNC_LOG; - TESMRInputParams startupParams; - - if ( ESMREntry().StartupParameters(startupParams) ) - { - MMRInfoProcessor::TMRInfoResponseMode responseMode ( - MMRInfoProcessor::EMRInfoResponseSendAndSync ); - - if ( EESMRResponseDontSend == iResponseType ) - { - responseMode = MMRInfoProcessor::EMRInfoResponseSync; - } - else if ( EESMRCmdRemoveFromCalendar == iCommand ) - { - responseMode = MMRInfoProcessor::EMRInfoRemoveFromCal; - } - - MMRInfoObject& infoObject = ESMREntry().ValidateSyncObjectL(); - iEmailMgr->SendMailViaSyncL( - startupParams, - infoObject, - responseMode, - *iResponseMessage ); - } - else - { - User::Leave( KErrArgument ); - } - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::SaveICalToFileL -// --------------------------------------------------------------------------- -// -TInt CESMRSendMRRespFSMailTask::SaveICalToFileL( - const TDesC& aICal, - const TDesC& aFilename ) - { - FUNC_LOG; - //create 8 bit buffer for temp file content - TInt length = aICal.Length() * 2; - HBufC8* buffer = HBufC8::NewLC( length ); - TPtr8 des = buffer->Des(); - - // covert the 16 bit iCal to 8 bit iCal: - TInt err = CnvUtfConverter::ConvertFromUnicodeToUtf8(des, aICal); - - RFs& fs( CCoeEnv::Static()->FsSession() ); - - // ensure the path exists: - // remove hard coded paths - //BaflUtils::EnsurePathExistsL(fs, KPath); - // - - // delete previous file - fs.Delete( aFilename ); - - // save the iCal to file system: - RFile file; - User::LeaveIfError(file.Create(fs, aFilename, EFileWrite)); - CleanupClosePushL(file); - User::LeaveIfError(file.Write(*buffer)); - - // clean up: - CleanupStack::PopAndDestroy(2, buffer); // file, fs, buffer - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespFSMailTask::SetAttendeesL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespFSMailTask::SetAttendeesL() - { - FUNC_LOG; - CCalAttendee* thisAttendee = - ESMRHelper::CopyAttendeeLC( - *(MailboxUtils().ThisAttendeeL( *iEntryToSend )) ); - - RPointerArray& attendeeList = iEntryToSend->AttendeesL(); - - while ( attendeeList.Count() ) - { - //remove attendees from entry that is to be forwarded - iEntryToSend->DeleteAttendeeL( 0 ); - } - - // Ownership is transferred - iEntryToSend->AddAttendeeL( thisAttendee ); - CleanupStack::Pop( thisAttendee ); - } - -//EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrsendmrrespmailtask.cpp --- a/meetingrequest/mrtasks/src/cesmrsendmrrespmailtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR base task -* -*/ - -#include "emailtrace.h" -#include "cesmrsendmrrespmailtask.h" - -#include -#include -#include -#include -#include "cesmrcalimportexporter.h" -#include "mesmrmeetingrequestentry.h" -#include "esmrhelper.h" -#include "cesmrlistquery.h" -#include "cesmrmeetingrequestsender.h" -#include "cesmrresponsedialog.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRSendMRRespMailTask::CESMRSendMRRespMailTask -// --------------------------------------------------------------------------- -// -CESMRSendMRRespMailTask::CESMRSendMRRespMailTask( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ), - iCommand( aCommand ), - iResponseType( aResponseType ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespMailTask::~CESMRSendMRRespMailTask -// --------------------------------------------------------------------------- -// -CESMRSendMRRespMailTask::~CESMRSendMRRespMailTask() - { - FUNC_LOG; - delete iResponseMessage; - delete iResponseEntry; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespMailTask::NewL -// --------------------------------------------------------------------------- -// -CESMRSendMRRespMailTask* CESMRSendMRRespMailTask::NewL( - TESMRCommand aCommand, - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils, - TESMRResponseType aResponseType, - const TDesC& aResponseMessage ) - { - FUNC_LOG; - CESMRSendMRRespMailTask* self = - new (ELeave) CESMRSendMRRespMailTask( - aCommand, - aCalDbMgr, - aEntry, - aMRMailboxUtils, - aResponseType ); - - CleanupStack::PushL(self); - self->ConstructL( aResponseMessage ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespMailTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespMailTask::ConstructL( - const TDesC& aResponseMessage ) - { - FUNC_LOG; - BaseConstructL(); - iResponseMessage = aResponseMessage.AllocL(); - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespMailTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespMailTask::ExecuteTaskL() - { - FUNC_LOG; - // Checking input paramters - if ( EESMRResponseMessage == iResponseType && - !iResponseMessage->Length() ) - { - User::Leave( KErrArgument ); - } - - if( CCalEntry::EMethodReply != ESMREntry().Entry().MethodL() ) - { - User::Leave( KErrArgument ); - } - - if ( EESMRResponseDontSend != iResponseType ) - { - SendResponseMessageL(); - } - } - -// --------------------------------------------------------------------------- -// CESMRSendMRRespMailTask::SendResponseMessageL -// --------------------------------------------------------------------------- -// -void CESMRSendMRRespMailTask::SendResponseMessageL() - { - FUNC_LOG; - CESMRMeetingRequestSender* sender = - CESMRMeetingRequestSender::NewL( MailboxUtils() ); - CleanupStack::PushL( sender ); - - if ( iResponseMessage ) - { - sender->CreateAndSendMeetingRequestL( - ESMREntry(), - *iResponseMessage ); - } - else - { - sender->CreateAndSendMeetingRequestL( - ESMREntry() ); - } - - CleanupStack::PopAndDestroy( sender ); - } - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrstoremrtask.cpp --- a/meetingrequest/mrtasks/src/cesmrstoremrtask.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,191 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR base task -* -*/ - -#include "emailtrace.h" -#include "cesmrstoremrtask.h" - -#include -#include -// -#include "mesmrutilstombsext.h" -// -#include "cesmrcaldbmgr.h" -#include "mesmrmeetingrequestentry.h" - -namespace { // codescanner::namespace - -#ifdef _DEBUG - -// Literal for panics -_LIT( KESMRStoreMR, "ESMRStoreMR" ); - -// Panic codes -enum TESMRStoreMRPanic - { - EESMRStoreMRNotMeetingRequest // Entry is not meeting request - }; - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Panic wrapper method -// --------------------------------------------------------------------------- -// -void Panic( TESMRStoreMRPanic aPanic ) - { - User::Panic( KESMRStoreMR, aPanic ); - } - -#endif // _DEBUG - -}//namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRStoreMRTask::CESMRStoreMRTask -// --------------------------------------------------------------------------- -// -CESMRStoreMRTask::CESMRStoreMRTask( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) -: CESMRTaskBase( aCalDbMgr, aEntry, aMRMailboxUtils ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRStoreMRTask::~CESMRStoreMRTask -// --------------------------------------------------------------------------- -// -CESMRStoreMRTask::~CESMRStoreMRTask() - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRStoreMRTask::NewL -// --------------------------------------------------------------------------- -// -CESMRStoreMRTask* CESMRStoreMRTask::NewL( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) - { - FUNC_LOG; - - CESMRStoreMRTask* self = - new (ELeave) CESMRStoreMRTask( - aCalDbMgr, - aEntry, - aMRMailboxUtils ); - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - - return self; - } - -// --------------------------------------------------------------------------- -// CESMRStoreMRTask::ConstructL -// --------------------------------------------------------------------------- -// -void CESMRStoreMRTask::ConstructL() - { - FUNC_LOG; - BaseConstructL(); - } - -// --------------------------------------------------------------------------- -// CESMRStoreMRTask::ExecuteTaskL -// --------------------------------------------------------------------------- -// -void CESMRStoreMRTask::ExecuteTaskL() - { - FUNC_LOG; - - // Store to calendar DB - StoreEntryToDbL(); - - } - -// --------------------------------------------------------------------------- -// CESMRStoreMRTask::StoreEntryToDbL -// --------------------------------------------------------------------------- -// -void CESMRStoreMRTask::StoreEntryToDbL() - { - FUNC_LOG; - - MESMRMeetingRequestEntry& mrEntry = ESMREntry(); - CCalEntry& entry = mrEntry.Entry(); - - const CCalEntry::TType KMRType( - CCalEntry::EAppt ); - - CCalEntry::TType entryType( entry.EntryTypeL() ); - - // Check entry type -#ifdef _DEBUG - - __ASSERT_DEBUG( - KMRType == entryType, - Panic(EESMRStoreMRNotMeetingRequest) ); - -#else - - if ( KMRType != entryType ) - { - User::Leave( KErrArgument ); - } - -#endif // _DEBUG - - TBool isEdited( mrEntry.IsEntryEditedL() ); - TBool forwarded( mrEntry.IsForwardedL() ); - - if ( !forwarded ) - { - // Check storing result - MESMRUtilsTombsExt::TESMRUtilsDbResult res = - CalDbMgr().StoreEntryCondL( entry, EFalse, ETrue ); - - // Check that entry can be saved - if ( MESMRUtilsTombsExt::ECheckedValidNew == res || - MESMRUtilsTombsExt::ECheckedValidUpdate == res || - isEdited ) - { - CCalEntry* validatedEntry = mrEntry.ValidateEntryL(); - CleanupStack::PushL( validatedEntry ); - - CalDbMgr().StoreEntryCondL( *validatedEntry, EFalse ); - - CleanupStack::PopAndDestroy( validatedEntry ); - - mrEntry.UpdateEntryAfterStoringL(); - } - } - - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrtaskbase.cpp --- a/meetingrequest/mrtasks/src/cesmrtaskbase.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR base task -* -*/ - -#include "emailtrace.h" -#include "cesmrtaskbase.h" - -#include -#include "mesmrmeetingrequestentry.h" -#include "cesmrcaldbmgr.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRTaskBase::CESMRTaskBase -// --------------------------------------------------------------------------- -// -CESMRTaskBase::CESMRTaskBase( - MESMRCalDbMgr& aCalDbMgr, - MESMRMeetingRequestEntry& aEntry, - CMRMailboxUtils& aMRMailboxUtils ) -: iCalDbMgr(aCalDbMgr), - iEntry(aEntry), - iMRMailboxUtils( aMRMailboxUtils ) - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRTaskBase::~CESMRTaskBase -// --------------------------------------------------------------------------- -// -CESMRTaskBase::~CESMRTaskBase() - { - FUNC_LOG; - //do nothing - } - -// --------------------------------------------------------------------------- -// CESMRTaskBase::BaseConstructL -// --------------------------------------------------------------------------- -// -void CESMRTaskBase::BaseConstructL() - { - FUNC_LOG; - //do nothing - } - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrtaskextensionimpl.cpp --- a/meetingrequest/mrtasks/src/cesmrtaskextensionimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrtasks/src/cesmrtaskextensionimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -23,7 +23,6 @@ // #include "cesmrpolicymanager.h" // -#include "cesmrentryprocessor.h" #include "mesmrmeetingrequestentry.h" #include "cesmrtaskfactory.h" #include "mesmrtask.h" @@ -34,17 +33,8 @@ // CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl // --------------------------------------------------------------------------- // -CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl( - MESMRCalDbMgr& aCalDBMgr, - CMRMailboxUtils& aMRMailboxUtils, - CESMRPolicyManager& aPolicyManager, - CESMREntryProcessor& aEntryProcessor, - MESMRTaskFactory& aTaskFactory ) -: iCalDBMgr( aCalDBMgr ), - iMRMailboxUtils( aMRMailboxUtils), - iPolicyManager( aPolicyManager ), - iEntryProcessor( aEntryProcessor), - iTaskFactory( aTaskFactory ) +CESMRTaskExtenstionImpl::CESMRTaskExtenstionImpl( MESMRTaskFactory& aTaskFactory ) + : iTaskFactory( aTaskFactory ) { FUNC_LOG; //do nothing @@ -66,20 +56,11 @@ // --------------------------------------------------------------------------- // EXPORT_C CESMRTaskExtenstionImpl* CESMRTaskExtenstionImpl::NewL( - MESMRCalDbMgr& aCalDBMgr, - CMRMailboxUtils& aMRMailboxUtils, - CESMRPolicyManager& aPolicyManager, - CESMREntryProcessor& aEntryProcessor, MESMRTaskFactory& aTaskFactory ) { FUNC_LOG; CESMRTaskExtenstionImpl* self = - new (ELeave) CESMRTaskExtenstionImpl( - aCalDBMgr, - aMRMailboxUtils, - aPolicyManager, - aEntryProcessor, - aTaskFactory ); + new (ELeave) CESMRTaskExtenstionImpl( aTaskFactory ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -102,32 +83,35 @@ // void CESMRTaskExtenstionImpl::SendAndStoreResponseL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) { FUNC_LOG; + // First do possible command conversion - if ( EESMRAcceptWithoutAttachmentCheck == aCommand ) - { - aCommand = EESMRCmdAcceptMR; - } - else if ( EESMRTentativeWithoutAttachmentCheck == aCommand ) - { - aCommand = EESMRCmdTentativeMR; - } - else if ( EESMRDeclineWithoutAttachmentCheck == aCommand ) + + switch ( aCommand ) { - aCommand = EESMRCmdDeclineMR; + case EESMRAcceptWithoutAttachmentCheck: + { + aCommand = EESMRCmdAcceptMR; + break; + } + case EESMRTentativeWithoutAttachmentCheck: + { + aCommand = EESMRCmdTentativeMR; + break; + } + case EESMRDeclineWithoutAttachmentCheck: + { + aCommand = EESMRCmdDeclineMR; + break; + } + default: + { + break; + } } - - // Check that command is valid - if ( !( EESMRCmdAcceptMR == aCommand || - EESMRCmdTentativeMR == aCommand || - EESMRCmdDeclineMR == aCommand ) ) - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } - + CreateAndExecuteTaskL( aCommand, aEntry ); } @@ -137,37 +121,10 @@ // void CESMRTaskExtenstionImpl::SendAndStoreMRL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) { FUNC_LOG; - // Check that command is valid - if ( !( EESMRCmdSendMR == aCommand || - EESMRCmdSendMRUpdate == aCommand) ) - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } - - CreateAndExecuteTaskL( aCommand, aEntry ); - } - -// --------------------------------------------------------------------------- -// CESMRTaskExtenstionImpl::SendAndStoreMRL -// --------------------------------------------------------------------------- -// -void CESMRTaskExtenstionImpl::DeleteMRFromLocalDBL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - // Check that command is valid - if ( EESMRCmdDeleteMR != aCommand ) - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } - - // Create and execute task + CreateAndExecuteTaskL( aCommand, aEntry ); } @@ -177,57 +134,39 @@ // void CESMRTaskExtenstionImpl::DeleteAndSendMRL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) { FUNC_LOG; - // Check that command is valid - if ( EESMRCmdDeleteMR == aCommand || - EESMRCmdRemoveFromCalendar == aCommand || - EESMRCmdMailDelete == aCommand ) - { - // Create And execute task - CreateAndExecuteTaskL( aCommand, aEntry ); - } - else - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } + + // Create And execute task + CreateAndExecuteTaskL( aCommand, aEntry ); } // --------------------------------------------------------------------------- -// CESMRTaskExtenstionImpl::StoreMRToLocalDBL +// CESMRTaskExtenstionImpl::StoreEntryToLocalDBL // --------------------------------------------------------------------------- // -void CESMRTaskExtenstionImpl::StoreMRToLocalDBL( +void CESMRTaskExtenstionImpl::StoreEntryToLocalDBL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) { FUNC_LOG; - if ( EESMRCmdSaveMR != aCommand ) - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } + + // Create And exexute task CreateAndExecuteTaskL( aCommand, aEntry ); } + // --------------------------------------------------------------------------- // CESMRTaskExtenstionImpl::ForwardMRAsEmailL // --------------------------------------------------------------------------- // void CESMRTaskExtenstionImpl::ForwardMRAsEmailL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) { FUNC_LOG; - // Check that command is valid - if ( EESMRCmdForwardAsMail != aCommand ) - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } - + // Create And exexute task CreateAndExecuteTaskL( aCommand, aEntry ); } @@ -238,27 +177,77 @@ // void CESMRTaskExtenstionImpl::ReplyAsEmailL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Create And exexute task + CreateAndExecuteTaskL( aCommand, aEntry ); + } + +// --------------------------------------------------------------------------- +// CESMRTaskExtenstionImpl::DeleteEntryFromLocalDBL +// --------------------------------------------------------------------------- +// +void CESMRTaskExtenstionImpl::DeleteEntryFromLocalDBL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Create And exexute task + CreateAndExecuteTaskL( aCommand, aEntry ); + } + +// --------------------------------------------------------------------------- +// CESMRTaskExtenstionImpl::MarkTodoAsDoneL +// --------------------------------------------------------------------------- +// +void CESMRTaskExtenstionImpl::MarkTodoAsDoneL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) { FUNC_LOG; - // Check that command is valid - if ( EESMRCmdReply != aCommand && EESMRCmdReplyAll != aCommand) - { - // Invalid command --> Leave - User::Leave( KErrArgument ); - } + + // Create And execute task + CreateAndExecuteTaskL( aCommand, aEntry ); + } +// --------------------------------------------------------------------------- +// CESMRTaskExtenstionImpl::MarkTodoAsNotDoneL +// --------------------------------------------------------------------------- +// +void CESMRTaskExtenstionImpl::MarkTodoAsNotDoneL( + TESMRCommand aCommand, + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + // Create And exexute task CreateAndExecuteTaskL( aCommand, aEntry ); } // --------------------------------------------------------------------------- +// CESMRTaskExtenstionImpl::MoveEntryToCurrentDBL +// --------------------------------------------------------------------------- +// +void CESMRTaskExtenstionImpl::MoveEntryToCurrentDBL( + TESMRCommand /*aCommand*/, + MESMRCalEntry& aEntry ) + { + FUNC_LOG; + + // Create And exexute task + CreateAndExecuteTaskL( EESMRCmdCalendarChange, aEntry ); + } + +// --------------------------------------------------------------------------- // CESMRTaskExtenstionImpl::CreateAndExecuteTaskL // --------------------------------------------------------------------------- // void CESMRTaskExtenstionImpl::CreateAndExecuteTaskL( TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) + MESMRCalEntry& aEntry ) { FUNC_LOG; MESMRTask* task = iTaskFactory.CreateTaskL( aCommand, aEntry ); @@ -267,7 +256,7 @@ { CleanupDeletePushL( task ); task->ExecuteTaskL(); - CleanupStack::PopAndDestroy(); // task; + CleanupStack::PopAndDestroy( task ); // task; } else { diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrtasks/src/cesmrtaskfactory.cpp --- a/meetingrequest/mrtasks/src/cesmrtaskfactory.cpp Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,685 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for ESMR task factory -* -*/ - -#include "emailtrace.h" -#include "cesmrtaskfactory.h" - -#include "cesmrcombinedtask.h" -#include "cesmrstoremrtask.h" -#include "cesmrsendmrrespmailtask.h" -#include "cesmrdeletefromdbmrtask.h" -#include "cesmrsendmrrespfsmailtask.h" -#include "cesmrsendmrfsmailtask.h" -#include "cesmrforwardasfsmailtask.h" -#include "cesmrsendmrfsmailreplytask.h" - -#include "mesmrmeetingrequestentry.h" -#include "cesmrconfirmationquery.h" -#include "cesmrlistquery.h" -#include "cesmrresponsedialog.h" -#include "tesmrinputparams.h" -#include "esmrconfig.hrh" - -// -#include "cfsmailcommon.h" -#include "cfsmailclient.h" -#include "cfsmailmessage.h" -#include "cfsmailbox.h" -// - -namespace { - -#ifdef _DEBUG - -// Panic literal for ESMRTaskFactory -_LIT( KESMRTaskFactoryPanicTxt, "ESMRTaskFactory" ); - -/** Panic code definitions */ -enum TESMRTaskFactoryPanic - { - EESMRTaskFactoryInvalidTask // Trying to create invalid task - }; - - -// --------------------------------------------------------------------------- -// Panic wrapper method -// --------------------------------------------------------------------------- -// -void Panic( TESMRTaskFactoryPanic aPanic ) - { - - User::Panic( KESMRTaskFactoryPanicTxt, aPanic ); - } - -#endif // _DEBUG - -/** - * Checks whether reply mail is required by the plug-in or not. - * @param aEntry Regerence to MR entry - */ -TBool ReplyMailRequiredL( - MESMRMeetingRequestEntry& aEntry ) - { - TBool replyNeeded( EFalse ); - - TESMRInputParams esmrParams; - if ( aEntry.IsOpenedFromMail() && - aEntry.StartupParameters(esmrParams) ) - { - TFSMailMsgId mailboxId( - esmrParams.iMailMessage->GetMailBoxId() ); - - CFSMailBox* mailbox = - esmrParams.iMailClient->GetMailBoxByUidL( mailboxId ); - CleanupStack::PushL( mailbox ); - - if ( mailbox->HasCapability(EFSMBoxCapaMRRequiresReplyEmail ) ) - { - replyNeeded = ETrue; - } - CleanupStack::PopAndDestroy( mailbox ); - mailbox = NULL; - } - - return replyNeeded; - } - -// --------------------------------------------------------------------------- -// Queries response query from user. -// --------------------------------------------------------------------------- -// -HBufC* QuerySendResponseQueryFromUserLC( - TESMRCommand aCommand, - TESMRResponseType& aResponseType, - MESMRMeetingRequestEntry& aEntry ) - { - HBufC* responseMessage = NULL; - TInt ret = EESMRResponsePlain; - - TESMRAttendeeStatus status( - EESMRAttendeeStatusDecline ); - - // convert the command to status: - switch ( aCommand ) - { - case EESMRCmdAcceptMR: - { - status = EESMRAttendeeStatusAccept; - break; - } - case EESMRCmdTentativeMR: - { - status = EESMRAttendeeStatusTentative; - break; - } - case EESMRCmdDeclineMR: - { - status = EESMRAttendeeStatusDecline; - break; - } - default: - { - // never should come here. - User::Leave(KErrGeneral); - break; - } - } - - TBool replyRequired( ReplyMailRequiredL(aEntry) ); - - if ( replyRequired ) - { - ret = CESMRListQuery::ExecuteEditBeforeSendWithSendOptOnlyL( status ); - } - else - { - ret = CESMRListQuery::ExecuteEditBeforeSendL( status ); - } - - // User has selected cancel from dialog. Interrupt task execution, - // leave will be trapped in cesmecontroller (esmrviewer module) - if ( ret == KErrCancel ) - { - User::Leave( KErrCancel ); - } - - aResponseType = static_cast(ret); - - // set the response status to cal entry: - aEntry.ConstructReplyL(status); - - if ( EESMRResponseMessage == aResponseType ) - { - CESMRResponseDialog* respDlg = - CESMRResponseDialog::NewL( responseMessage ); - CleanupStack::PushL( respDlg ); - - TBool dialogRetValue( respDlg->ExecuteDlgLD() ); - // Dialog has deleted itself --> Only pop from cleanup stack - CleanupStack::Pop( respDlg ); - - if ( !dialogRetValue ) - { - User::Leave( KErrCancel ); - } - } - if ( responseMessage ) - { - CleanupStack::PushL( responseMessage ); - } - else - { - responseMessage = KNullDesC().AllocLC(); - } - return responseMessage; - } - -} // namespace - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CESMRTaskFactory -// --------------------------------------------------------------------------- -// -inline CESMRTaskFactory::CESMRTaskFactory( - MESMRCalDbMgr& aCalDbMgr, - CMRMailboxUtils& aMRMailboxUtils ) -: iCalDbMgr( aCalDbMgr ), - iMRMailboxUtils(aMRMailboxUtils) - { - FUNC_LOG; - - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::~CESMRTaskFactory -// --------------------------------------------------------------------------- -// -CESMRTaskFactory::~CESMRTaskFactory() - { - FUNC_LOG; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::TaskFactory -// --------------------------------------------------------------------------- -// -EXPORT_C CESMRTaskFactory* CESMRTaskFactory::NewL( - MESMRCalDbMgr& aCalDbMgr, - CMRMailboxUtils& aMRMailboxUtils ) - { - FUNC_LOG; - - CESMRTaskFactory* self = - new (ELeave) CESMRTaskFactory(aCalDbMgr, aMRMailboxUtils ); - - - return self; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - - MESMRTask* task = NULL; - - switch (aCommand) - { - case EESMRCmdAcceptMR: - case EESMRCmdTentativeMR: - case EESMRCmdDeclineMR: - task = CreateSendMRResponseViaMailTaskL( aCommand, aEntry ); - break; - - case EESMRCmdSendMR: - case EESMRCmdSendMRUpdate: - task = CreateSendMRTaskL( aCommand, aEntry ); - break; - - case EESMRCmdDeleteMR: - case EESMRCmdRemoveFromCalendar: - case EESMRCmdMailDelete: - task = CreateDeleteMRTaskL( aCommand, aEntry ); - break; - - case EESMRCmdSaveMR: - task = CreateStoreMRToLocalDBTaskL( aCommand, aEntry ); - break; - - case EESMRCmdForwardAsMeeting: - task = CreateForwardAsMeetingTaskL( aCommand, aEntry ); - break; - - case EESMRCmdForwardAsMail: - task = CreateForwardAsMailTaskL( aEntry ); - break; - case EESMRCmdReplyAll: - task = CreateReplyAsMailTaskL( aEntry, ETrue ); - break; - - case EESMRCmdReply: - task = CreateReplyAsMailTaskL( aEntry, EFalse ); - break; - - default: - __ASSERT_DEBUG(EFalse, Panic(EESMRTaskFactoryInvalidTask) ); - User::Leave( KErrNotSupported ); - break; - } - - - return task; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateSendMRResponseViaMailTask -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateSendMRResponseViaMailTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - - CESMRCombinedTask* task = NULL; - TESMRRole role = aEntry.RoleL(); - - TBool syncObjectPresent( aEntry.IsSyncObjectPresent() ); - TBool isStored( aEntry.IsStoredL() ); - - if ( EESMRRoleRequiredAttendee == role || - EESMRRoleOptionalAttendee == role || - EESMRRoleNonParticipant == role ) - { - task = CESMRCombinedTask::NewL - ( iCalDbMgr, - aEntry, - iMRMailboxUtils, - CESMRCombinedTask::EESMRTrap ); - - CleanupStack::PushL( task ); - - TESMRResponseType responseType( EESMRResponsePlain ); - HBufC* responseMessage = QuerySendResponseQueryFromUserLC( - aCommand, - responseType, - aEntry ); - - if ( !syncObjectPresent && EESMRCmdDeclineMR != aCommand) - { - // Entry is stored or deleted from calendar DB if - // sync object is not present - // Store MR task - task->AppendTaskL( - CESMRStoreMRTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - } - - if ( EESMRResponseDontSend != responseType || - aEntry.IsSyncObjectPresent() ) - { - // Send MR response via mail freestyle task - task->AppendTaskL( - CESMRSendMRRespFSMailTask::NewL( - aCommand, - iCalDbMgr, - aEntry, - iMRMailboxUtils, - responseType, - *responseMessage ) ); - } - CleanupStack::PopAndDestroy( responseMessage ); - - if ( !syncObjectPresent && EESMRCmdDeclineMR == aCommand && - isStored ) - { - // Entry is deleted from calendar DB if - // sync object is not present and entry exits in database - // Declined --> Delete MR from cal DB task - task->AppendTaskL( - CESMRDeleteMRFromDbTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - } - - CleanupStack::Pop( task ); - } - else - { - // Only (opt-)attendees and non-participants can send - // responses - User::Leave( KErrNotSupported ); - } - - - return task; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateSendMRTask -// --------------------------------------------------------------------------- -// - -MESMRTask* CESMRTaskFactory::CreateSendMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - - CESMRCombinedTask* task = CESMRCombinedTask::NewL - ( iCalDbMgr, - aEntry, - iMRMailboxUtils ); - - CleanupStack::PushL( task ); - - if ( !aEntry.IsForwardedL() ) - { - // Store MR task - task->AppendTaskL( - CESMRStoreMRTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - } - - // Note: forwarding is allowed also for entries that occurred in past - if ( aEntry.IsForwardedL() || !aEntry.OccursInPastL() ) - { - if ( aCommand == EESMRCmdSendMR || - aCommand == EESMRCmdSendMRUpdate ) - { - // Send MR response via mail task - task->AppendTaskL( - CESMRSendMRFSMailTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils, - aCommand ) ); - } - } - - CleanupStack::Pop( task ); - - - return task; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateDeleteMRTask -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateDeleteMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - - MESMRTask* task = NULL; - - if ( EESMRRoleOrganizer == aEntry.RoleL() ) - { - task = CreateOrganizerDeleteMRTaskL( aCommand, aEntry ); - } - else - { - task = CreateAttendeeDeleteMRTaskL( aCommand, aEntry ); - } - - - return task; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateStoreMRToLocalDBTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateStoreMRToLocalDBTaskL( - TESMRCommand /*aCommand*/, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - return CESMRStoreMRTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ); - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateForwardAsMeetingTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateForwardAsMeetingTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - MESMRTask* task = NULL; - - // Send MR response via mail task is used for forwarding as meeting request - - if ( aCommand == EESMRCmdForwardAsMeeting ) - { - task = CESMRSendMRFSMailTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils, - aCommand ); - } - return task; - } - - - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateForwardAsMeetingTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateForwardAsMailTaskL( - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - // Send MR response via mail task - return CESMRForwardAsFSMailTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ); - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateReplyAsMailTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateReplyAsMailTaskL( - MESMRMeetingRequestEntry& aEntry, TBool aReplyAll ) - { - FUNC_LOG; - // Send MR reply via mail task - return CESMRSendMRFSMailReplyTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils, - aReplyAll); - - } - - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateOrganizerDeleteMRTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateOrganizerDeleteMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - - CESMRCombinedTask* task = CESMRCombinedTask::NewL - ( iCalDbMgr, - aEntry, - iMRMailboxUtils, - CESMRCombinedTask::EESMRTrap ); - - CleanupStack::PushL( task ); - - if ( EESMRCmdDeleteMR == aCommand ) - { - // SYNC_SOLUTION requires the modified entry to be stored into - // calendar db for deletion purposes. - task->AppendTaskL( - CESMRStoreMRTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - - TUint attendeeFlags( - EESMRRoleRequiredAttendee | EESMRRoleOptionalAttendee); - if ( aEntry.AttendeeCountL( attendeeFlags ) && aEntry.IsSentL() - && !aEntry.OccursInPastL() ) - { - // Meeting request contains attendees --> Cancellation message - // needs to be sent - if ( CESMRConfirmationQuery::ExecuteL( - CESMRConfirmationQuery::EESMRSendCancellationInfoToParticipants) ) - { - task->AppendTaskL( - CESMRSendMRFSMailTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils, - aCommand ) ); - } - } - } - - // Delete MR from cal DB task - task->AppendTaskL( - CESMRDeleteMRFromDbTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - - CleanupStack::Pop( task ); - - - return task; - } - -// --------------------------------------------------------------------------- -// CESMRTaskFactory::CreateAttendeeDeleteMRTaskL -// --------------------------------------------------------------------------- -// -MESMRTask* CESMRTaskFactory::CreateAttendeeDeleteMRTaskL( - TESMRCommand aCommand, - MESMRMeetingRequestEntry& aEntry ) - { - FUNC_LOG; - - TBool pluginRequiresReplyMail( ReplyMailRequiredL(aEntry) ); - - TBool deleteTaskCreated(EFalse); - - CESMRCombinedTask* task = CESMRCombinedTask::NewL - ( iCalDbMgr, - aEntry, - iMRMailboxUtils, - CESMRCombinedTask::EESMRTrap ); - - CleanupStack::PushL( task ); - - if ( !aEntry.IsOpenedFromMail() && !aEntry.IsSyncObjectPresent() ) - { - // When deleting from the calendar --> Store first modifying entry - // And then delete that from calendar DB. - // - // When opened from mail --> We do not need to store - // modifying entry into calendar database. - // - task->AppendTaskL( - CESMRStoreMRTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - } - - - if ( EESMRCmdDeleteMR == aCommand || - EESMRCmdMailDelete == aCommand || - (pluginRequiresReplyMail && EESMRCmdRemoveFromCalendar == aCommand ) ) - { - TBool sendDecline(EFalse); - - if ( pluginRequiresReplyMail ) - { - sendDecline = ETrue; - } - else - { - sendDecline = CESMRConfirmationQuery::ExecuteL( - CESMRConfirmationQuery::EESMRSendDecline ); - } - - if( sendDecline ) - { - // Send MR response via mail task. No response message is appended - // to sent email - - TESMRCommand command( EESMRCmdDeclineMR ); - if ( pluginRequiresReplyMail && EESMRCmdRemoveFromCalendar == aCommand ) - { - command = EESMRCmdRemoveFromCalendar; - } - - task->AppendTaskL( - CESMRSendMRRespFSMailTask::NewL( - command, - iCalDbMgr, - aEntry, - iMRMailboxUtils, - EESMRResponsePlain, - KNullDesC()) ); - } - } - - // Delete MR from cal DB task if plugin does not handle it - if ( !pluginRequiresReplyMail && !deleteTaskCreated) - { - task->AppendTaskL( - CESMRDeleteMRFromDbTask::NewL( - iCalDbMgr, - aEntry, - iMRMailboxUtils ) ); - } - - CleanupStack::Pop( task ); - - - return task; - } - -// EOF - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/data/esmrurlparserplugin.rss --- a/meetingrequest/mrurlparserplugin/data/esmrurlparserplugin.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrurlparserplugin/data/esmrurlparserplugin.rss Wed Mar 31 21:08:33 2010 +0300 @@ -18,7 +18,6 @@ #include -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber #include "esmrinternaluid.h" @@ -42,7 +41,7 @@ IMPLEMENTATION_INFO { implementation_uid = KESMRURLParserPluginImplementationUid; - version_no = KEmailEcomVersionNumber; + version_no = 1; display_name = "ESMR URL Parser Plugin";// codescanner::codereview default_data = ""; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/data/esmrurlparserplugindata.rss --- a/meetingrequest/mrurlparserplugin/data/esmrurlparserplugindata.rss Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Non localizable resource for ESMR URL Parser Plugin. -* -*/ - - -NAME URLP - -#include -#include -#include - -RESOURCE RSS_SIGNATURE { } - -RESOURCE EIK_APP_INFO { } - -//For location URL, not localized texts -RESOURCE LBUF r_qtn_location_url - { - txt = "http://www.ovi.com/maps/"; - } - -RESOURCE LBUF r_qtn_location_url_latitude - { - txt = "lat="; - } - -RESOURCE LBUF r_qtn_location_url_param_separator - { - txt = "&"; - } - -RESOURCE LBUF r_qtn_location_url_longitude - { - txt = "lon="; - } - -RESOURCE LBUF r_qtn_location_sieve_url - { - txt = "http://www.ovi.com/maps/lat=*&lon=*"; - } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/group/esmrurlparserplugin.mmp --- a/meetingrequest/mrurlparserplugin/group/esmrurlparserplugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrurlparserplugin/group/esmrurlparserplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,12 +17,10 @@ -#include +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" #include - -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" +#include TARGET esmrurlparserplugin.dll TARGETTYPE PLUGIN @@ -31,12 +29,10 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src -SOURCE cesmrurlparserpluginimpl.cpp +SOURCE cesmrurlparserpluginimpl.cpp SOURCE cesmrurlparserpluginentrypoint.cpp +SOURCE cmrurlparserextension.cpp USERINCLUDE ../inc USERINCLUDE ../../inc @@ -47,20 +43,14 @@ LIBRARY euser.lib LIBRARY ecom.lib LIBRARY eposlandmarks.lib -LIBRARY bafl.lib -LIBRARY efsrv.lib LIBRARY lbs.lib -LIBRARY cmaillogger.lib +LIBRARY CommonEngine.lib +LIBRARY calinterimapi.lib +LIBRARY inetprotutil.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE - -SOURCEPATH . -START RESOURCE ../data/esmrurlparserplugindata.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -END +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE SOURCEPATH . START RESOURCE ../data/esmrurlparserplugin.rss diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/inc/cesmrurlparserpluginimpl.h --- a/meetingrequest/mrurlparserplugin/inc/cesmrurlparserpluginimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrurlparserplugin/inc/cesmrurlparserpluginimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,21 +18,17 @@ #ifndef CESMRURLPARSERPLUGINIMPL_H #define CESMRURLPARSERPLUGINIMPL_H - -#include -#include -#include // RFs -#include // RResourceFile -#include // TResourceReader - #include "cesmrurlparserplugin.h" class CPosLandmark; +class CPosLandmarkParser; +class CPosLandmarkEncoder; +class CMRUrlParserExtension; /** * Parser class for parsing URL to landmark and vice versa - * + * */ class CESMRUrlParserPluginImpl : public CESMRUrlParserPlugin { @@ -67,7 +63,7 @@ * @return pointer to created location URL, caller takes ownership */ HBufC* CreateUrlFromLandmarkL( const CPosLandmark& aLandmark ); - + /** * Creates landmark object from location URL * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode @@ -75,52 +71,49 @@ * @param aUrl contains location URL from which landmark is created * @return pointer to created landmark object, caller takes ownership */ - CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ); - + CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ); + + /** + * Converts valid location URL to vCal GEO value. + * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode + * + * @param aUrl location URL to convert + * @return new GEO value + */ + CCalGeoValue* CreateGeoValueLC( const TDesC& aUrl ); + private: CESMRUrlParserPluginImpl(); - void ConstructL(); + CPosLandmarkParser& InitializeParserL(); - TInt DoFindLocationUrlL( const TDesC& aText, + CPosLandmarkEncoder& InitializeEncoderL(); + + void DoFindLocationUrlL( const TDesC& aText, + TInt& aPos, TPtrC& aUrl ); - TInt LocateResourceFile( - const TDesC& aResource, - const TDesC& aPath, - TFileName &aResourceFile, - RFs* aFs ); + CMRUrlParserExtension& ExtensionL(); - void InitializeL(); - - HBufC* ReadResourceStringLC( TInt aResourceId ); - - void CheckCoordinateParamL( const TDesC& aParam ); - - void GetCoordinateParamValuesL( const TDesC& aUrl, TPtrC& aLatitude, - TPtrC& aLongitude ); + CPosLandmark* CreateLandmarkFromUrlInternalL( const TDesC& aUrl ); + private: // data /** - * Tells if this instance is yet initialized + * Landmark parser. Own. */ - TBool iIsInitialized; + CPosLandmarkParser* iParser; /** - * File server session + * Landmark encoder. Own. */ - RFs iFs; + CPosLandmarkEncoder* iEncoder; /** - * Resource file + * Parser extension. Own. */ - RResourceFile iFile; - - /** - * Resource file reader - */ - TResourceReader iReader; + CMRUrlParserExtension* iExtension; }; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/inc/cmrurlparserextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrurlparserplugin/inc/cmrurlparserextension.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Parser class for parsing landmarks to url and vice versa +* +*/ + +#ifndef CMRURLPARSEREXTENSION_H +#define CMRURLPARSEREXTENSION_H + +#include "e32base.h" + +class CPosLandmark; + +/** + * Parser class for parsing URL to landmark and vice versa + * + */ +class CMRUrlParserExtension : public CBase + { + +public: + + static CMRUrlParserExtension* NewL(); + static CMRUrlParserExtension* NewLC(); + + + /** + * Destructor. + */ + virtual ~CMRUrlParserExtension(); + + /** + * Finds location URL from given text input + * + * @param aText text where URL is searched from + * @param aUrl points to founded URL after execution + * @param aPos on return URL start position. + * @leave KErrNotFound/KErrArgument or other + * unexpected Symbian wide errorcode + */ + void FindLocationUrlL( const TDesC& aText, TPtrC& aUrl, TInt& aPos ); + + /** + * Creates landmark object from location URL + * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode + * + * @param aUrl contains location URL from which landmark is created + * @return pointer to created landmark object, caller takes ownership + */ + CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ); + +private: + + CMRUrlParserExtension(); + +private: // data + + }; + + +#endif // CMRURLPARSEREXTENSION_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/inc/mesmrurlparserplugin.h --- a/meetingrequest/mrurlparserplugin/inc/mesmrurlparserplugin.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrurlparserplugin/inc/mesmrurlparserplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,6 +22,7 @@ class CPosLandmark; +class CCalGeoValue; /** * MESMRUrlParserPlugin defines the interface for Location URL Parser @@ -47,17 +48,26 @@ * @return pointer to created location URL */ virtual HBufC* CreateUrlFromLandmarkL( const CPosLandmark& aLandmark ) = 0; - + /** * Creates landmark object from location URL * * @param aUrl contains location URL from which landmark is created * @return pointer to created landmark object */ - virtual CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ) = 0; + virtual CPosLandmark* CreateLandmarkFromUrlL( const TDesC& aUrl ) = 0; + + /** + * Converts valid location URL to vCal GEO value. + * May leave with KErrNotFound/KErrArgument or other Symbian wide errorcode + * + * @param aUrl location URL to convert + * @return new GEO value + */ + virtual CCalGeoValue* CreateGeoValueLC( const TDesC& aUrl ) = 0; protected: - + /** * Destructor. */ diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/src/cesmrurlparserpluginimpl.cpp --- a/meetingrequest/mrurlparserplugin/src/cesmrurlparserpluginimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrurlparserplugin/src/cesmrurlparserpluginimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -17,64 +17,44 @@ -#include "emailtrace.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "cesmrurlparserpluginimpl.h" +#include "cmrurlparserextension.h" -#include "cesmrurlparserpluginimpl.h" -#include "esmrinternaluid.h" - +#include +#include +#include +#include +#include +#include +#include +#include -_LIT( KResourceName, "esmrurlparserplugindata.rsc" ); -_LIT( KResourceFileLocFormat, "r%02d" ); -_LIT( KResourceFormat, "rsc" ); +#include "emailtrace.h" -const TInt KCoordinateMaxLength = 10; -const TInt KNumberOfDecimals = 4; -const TUint KDecimalSeparator = '.'; - - +namespace +{ +_LIT8( KLandmarkUrlMimeType, "maps.ovi.com" ); +} // ======== MEMBER FUNCTIONS ======== - - // --------------------------------------------------------------------------- -// Non-leaving constructor +// CESMRUrlParserPluginImpl::CESMRUrlParserPluginImpl // --------------------------------------------------------------------------- // CESMRUrlParserPluginImpl::CESMRUrlParserPluginImpl() -: iIsInitialized(EFalse) { FUNC_LOG; - } - // --------------------------------------------------------------------------- -// ConstructL for leaving construction -// --------------------------------------------------------------------------- -// -void CESMRUrlParserPluginImpl::ConstructL()// codescanner::LFunctionCantLeave - { - FUNC_LOG; - - } - - -// --------------------------------------------------------------------------- -// Symbian style NewL constructor +// CESMRUrlParserPluginImpl::NewL // --------------------------------------------------------------------------- // CESMRUrlParserPluginImpl* CESMRUrlParserPluginImpl::NewL() { FUNC_LOG; + CESMRUrlParserPluginImpl* self = CESMRUrlParserPluginImpl::NewLC(); CleanupStack::Pop( self ); return self; @@ -82,41 +62,48 @@ // --------------------------------------------------------------------------- -// Symbian style NewLC constructor +// CESMRUrlParserPluginImpl::NewLC // --------------------------------------------------------------------------- // CESMRUrlParserPluginImpl* CESMRUrlParserPluginImpl::NewLC() { FUNC_LOG; + CESMRUrlParserPluginImpl* self = new( ELeave ) CESMRUrlParserPluginImpl; CleanupStack::PushL( self ); - self->ConstructL(); return self; } // --------------------------------------------------------------------------- -// Destructor +// CESMRUrlParserPluginImpl::~CESMRUrlParserPluginImpl // --------------------------------------------------------------------------- // CESMRUrlParserPluginImpl::~CESMRUrlParserPluginImpl() { FUNC_LOG; - iFile.Close(); - iFs.Close(); + + delete iParser; + delete iEncoder; + delete iExtension; + + ReleaseLandmarkResources(); } // --------------------------------------------------------------------------- +// CESMRUrlParserPluginImpl::FindLocationUrl // Finds location URL from given text input // --------------------------------------------------------------------------- // -TInt CESMRUrlParserPluginImpl::FindLocationUrl( const TDesC& aText, - TPtrC& aUrl ) +TInt CESMRUrlParserPluginImpl::FindLocationUrl( + const TDesC& aText, + TPtrC& aUrl ) { FUNC_LOG; + TInt pos(0); - TRAPD( error, pos = DoFindLocationUrlL( aText, aUrl ) ); + TRAPD( error, DoFindLocationUrlL( aText, pos, aUrl ) ); if ( error != KErrNone ) { return error; @@ -128,379 +115,216 @@ } // --------------------------------------------------------------------------- -// Finds location URL from given text input -// --------------------------------------------------------------------------- -// -TInt CESMRUrlParserPluginImpl::DoFindLocationUrlL( // codescanner::intleaves - const TDesC& aText, - TPtrC& aUrl ) - { - FUNC_LOG; - //If this parserplugin instance is not yet initialized - //init it now - if( !iIsInitialized ) - { - InitializeL(); - } - - //Read basestring from resource file - HBufC* baseString = ReadResourceStringLC(R_QTN_LOCATION_URL); - - //Seach if base string is found from aText - TInt urlLocation = aText.Find(*baseString); - CleanupStack::PopAndDestroy(baseString); - if( urlLocation < KErrNone ) - { - User::Leave(KErrNotFound); - } - - //Take out unnecessary part before URL and search if endmark (whitespace) - //is found. If endmark is not found, - //then all the rest of descriptor is part of URL - HBufC* urlAndAfterBuf = aText.Mid( urlLocation ).AllocLC(); - TInt urlAndAfterBufLength = urlAndAfterBuf->Length(); - TInt urlEndmarkLocation = KErrNotFound; - - for( TInt i = 0; i < urlAndAfterBufLength; i++) - { - if( TChar( (*urlAndAfterBuf)[i] ).IsSpace() ) - { - urlEndmarkLocation = i; - break; - } - } - - if( urlEndmarkLocation == KErrNotFound ) - { - urlEndmarkLocation = urlAndAfterBufLength; - } - - //Take out part from beginning of URL to endmark - HBufC* urlToEndMark = urlAndAfterBuf->Left( urlEndmarkLocation ).AllocLC(); - - //Now we should have only URL left, check with "sieve" that it is about in - //right format - HBufC* sieve = ReadResourceStringLC(R_QTN_LOCATION_SIEVE_URL); - TInt sievedStartPoint = urlToEndMark->Match( *sieve ); - - CleanupStack::PopAndDestroy(sieve); - CleanupStack::PopAndDestroy(urlToEndMark); - CleanupStack::PopAndDestroy(urlAndAfterBuf); - - if( sievedStartPoint == KErrNotFound ) - { - User::Leave(KErrNotFound); - } - - //Check that parameters are in right format - TPtrC latValue; - TPtrC lonValue; - - GetCoordinateParamValuesL( aText.Mid(urlLocation,urlEndmarkLocation), - latValue, lonValue ); - CheckCoordinateParamL( latValue ); - CheckCoordinateParamL( lonValue ); - - //Set aURL to correspond URL part of aText and return with url position - aUrl.Set( aText.Mid(urlLocation,urlEndmarkLocation)); - return urlLocation; - } - - -// --------------------------------------------------------------------------- +// CESMRUrlParserPluginImpl::CreateUrlFromLandmarkL // Creates location URL from landmark object // --------------------------------------------------------------------------- // -HBufC* CESMRUrlParserPluginImpl::CreateUrlFromLandmarkL( - const CPosLandmark& aLandmark ) +HBufC* CESMRUrlParserPluginImpl::CreateUrlFromLandmarkL( + const CPosLandmark& aLandmark ) { FUNC_LOG; - //If this parserplugin instance is not yet initialized - //init it now - if( !iIsInitialized ) - { - InitializeL(); - } - - //Take longitude and latitude out of landmark - TLocality position; - User::LeaveIfError( aLandmark.GetPosition( position ) ); - TReal64 latitude = position.Latitude(); - TReal64 longitude = position.Longitude(); - - //Define TReal format type - TRealFormat format( KCoordinateMaxLength ); - format.iType = KRealFormatFixed; - format.iPlaces = KNumberOfDecimals; - format.iPoint = TChar(KDecimalSeparator); + + CPosLandmarkEncoder& encoder = InitializeEncoderL(); + CBufBase* buffer = encoder.SetUseOutputBufferL(); + CleanupStack::PushL( buffer ); + encoder.AddLandmarkL( aLandmark ); + CPosLmOperation* operation = encoder.FinalizeEncodingL(); + ExecuteAndDeleteLD( operation ); - //Read strings from resourcefile - HBufC* baseUrl = ReadResourceStringLC( R_QTN_LOCATION_URL ); - HBufC* lat = ReadResourceStringLC( R_QTN_LOCATION_URL_LATITUDE ); - HBufC* separator = ReadResourceStringLC( R_QTN_LOCATION_URL_PARAM_SEPARATOR ); - HBufC* lon = ReadResourceStringLC( R_QTN_LOCATION_URL_LONGITUDE ); - - //Concatenate all strings and coordinates - HBufC* url = HBufC::NewL( baseUrl->Length() + lat->Length() + separator->Length() - + lon->Length() + format.iWidth + format.iWidth ); - TPtr pointer = url->Des(); - pointer.Append( *baseUrl ); - pointer.Append( *lat ); - pointer.AppendNum( latitude, format ); - pointer.Append( *separator ); - pointer.Append( *lon ); - pointer.AppendNum( longitude, format ); - - CleanupStack::PopAndDestroy( lon ); - CleanupStack::PopAndDestroy( separator ); - CleanupStack::PopAndDestroy( lat ); - CleanupStack::PopAndDestroy( baseUrl ); - + // Convert URL to Unicode and escape encode non-ASCII characters + HBufC* unicode = EscapeUtils::ConvertToUnicodeFromUtf8L( buffer->Ptr( 0 ) ); + CleanupStack::PushL( unicode ); + HBufC* url = EscapeUtils::EscapeEncodeL( *unicode, EscapeUtils::EEscapeNormal ); + + CleanupStack::PopAndDestroy( 2, buffer ); // unicode + //Transfer ownership of url return url; } // --------------------------------------------------------------------------- +// CESMRUrlParserPluginImpl::CreateLandmarkFromUrlL // Creates landmark object from location URL // --------------------------------------------------------------------------- // -CPosLandmark* CESMRUrlParserPluginImpl::CreateLandmarkFromUrlL( - const TDesC& aUrl ) +CPosLandmark* CESMRUrlParserPluginImpl::CreateLandmarkFromUrlL( + const TDesC& aUrl ) { FUNC_LOG; - //If this parserplugin instance is not yet initialized - //init it now - if( !iIsInitialized ) + + CPosLandmark* landmark = NULL; + + // Try to create landmark using landmark parser + TRAPD( error, landmark = CreateLandmarkFromUrlInternalL( aUrl ) ); + + if ( error ) { - InitializeL(); - } - - //Read sieve from resourcefile and check if URL matches the sieveformat - HBufC* sieve = ReadResourceStringLC( R_QTN_LOCATION_SIEVE_URL ); - TInt matchPos = User::LeaveIfError( aUrl.Match( *sieve ) ); - CleanupStack::PopAndDestroy( sieve ); - if( matchPos != 0 ) - { - //URL was found but is not int the beginning of desc - User::Leave( KErrArgument ); + // Try extension + landmark = ExtensionL().CreateLandmarkFromUrlL( aUrl ); } - //Parse actual coordinate values out of url - TPtrC latValue; - TPtrC lonValue; - GetCoordinateParamValuesL( aUrl, latValue, lonValue ); - - //Check that parameters are in right format - CheckCoordinateParamL( latValue ); - CheckCoordinateParamL( lonValue ); - - //Convert parameters to TReal values - TLex lexConverter( latValue ); - TReal64 realLatitude; - lexConverter.Val( realLatitude ); - - lexConverter.Assign( lonValue ); - TReal64 realLongitude; - lexConverter.Val( realLongitude ); - - //Create landmark with coordinatevalues - CPosLandmark* landmark = CPosLandmark::NewLC(); - TLocality position; - position.SetCoordinate( realLatitude, realLongitude ); - landmark->SetPositionL( position ); - CleanupStack::Pop( landmark ); //transfer ownership return landmark; } // ---------------------------------------------------------------------------- -// CESMRUrlParserPluginImpl::LocateResourceFile -// -// For locating resource file +// CESMRUrlParserPluginImpl::CreateGeoValueLC +// Converts URL to Calendar GEO property // ---------------------------------------------------------------------------- -// -TInt CESMRUrlParserPluginImpl::LocateResourceFile( - const TDesC& aResource, - const TDesC& aPath, - TFileName &aResourceFile, - RFs* aFs ) +// +CCalGeoValue* CESMRUrlParserPluginImpl::CreateGeoValueLC( const TDesC& aUrl ) { FUNC_LOG; - TFindFile resourceFile( *aFs ); - TInt err = resourceFile.FindByDir( - aResource, - aPath ); - - if ( KErrNone == err ) - { - aResourceFile.Copy( resourceFile.File() ); - } - else - { - const TChar KFileFormatDelim( '.' ); - TFileName locResourceFile; - - TInt pos = aResource.LocateReverse( KFileFormatDelim ); - if ( pos != KErrNotFound ) - { - locResourceFile.Copy( aResource.Mid(0, pos + 1) ); - - TInt language( User::Language() ); - locResourceFile.AppendFormat( KResourceFileLocFormat, language ); - - TFindFile resourceFile( *aFs ); - err = resourceFile.FindByDir( - locResourceFile, - aPath ); - - if ( KErrNone == err ) - { - aResourceFile.Copy( resourceFile.File() ); - aResourceFile.Replace( - aResourceFile.Length() - KResourceFormat().Length(), - KResourceFormat().Length(), - KResourceFormat() ); - } - } - } - + + // Convert URL to landmark + CPosLandmark* landmark = CreateLandmarkFromUrlL( aUrl ); + CleanupStack::PushL( landmark ); - return err; + // Get position data from landmark + TLocality position; + User::LeaveIfError( landmark->GetPosition( position ) ); + CleanupStack::PopAndDestroy( landmark ); + + // Convert position data to GEO value + CCalGeoValue* geoVal = CCalGeoValue::NewL(); + CleanupStack::PushL( geoVal ); + geoVal->SetLatLongL( position.Latitude(), position.Longitude() ); + + return geoVal; } // ---------------------------------------------------------------------------- -// CESMRUrlParserPluginImpl::InitializeL +// CESMRUrlParserPluginImpl::InitializeParserL +// ---------------------------------------------------------------------------- // -// Initializes resources -// ---------------------------------------------------------------------------- -// -void CESMRUrlParserPluginImpl::InitializeL() +CPosLandmarkParser& CESMRUrlParserPluginImpl::InitializeParserL() { FUNC_LOG; - if( iIsInitialized ) + + if ( !iParser ) { - return; + iParser = CPosLandmarkParser::NewL( KLandmarkUrlMimeType ); } - //Connect to RFs session - User::LeaveIfError( iFs.Connect( KFileServerDefaultMessageSlots ) ); - - //Find and open resource file containing URL strings - TFileName fileName; - User::LeaveIfError( LocateResourceFile( KResourceName, - KDC_RESOURCE_FILES_DIR, - fileName, - &iFs ) ); - iFile.OpenL( iFs, fileName ); - iFile.ConfirmSignatureL(); - iIsInitialized = ETrue; + + return *iParser; } // ---------------------------------------------------------------------------- -// CESMRUrlParserPluginImpl::ReadResourceStringLC -// Reads resource string from specified id +// CESMRUrlParserPluginImpl::InitializeEncoderL // ---------------------------------------------------------------------------- -// -HBufC* CESMRUrlParserPluginImpl::ReadResourceStringLC( TInt aResourceId ) +// +CPosLandmarkEncoder& CESMRUrlParserPluginImpl::InitializeEncoderL() { FUNC_LOG; - HBufC8* string = iFile.AllocReadLC(aResourceId); - iReader.SetBuffer(string); - HBufC* stringBuffer = iReader.ReadTPtrC().AllocL(); - CleanupStack::PopAndDestroy( string ); - CleanupStack::PushL( stringBuffer ); - //stringBuffer ownership is transfered - return stringBuffer; + + delete iEncoder; + iEncoder = NULL; + iEncoder = CPosLandmarkEncoder::NewL( KLandmarkUrlMimeType ); + return *iEncoder; } -// ---------------------------------------------------------------------------- -// CESMRUrlParserPluginImpl::CheckCoordinateParam +// --------------------------------------------------------------------------- +// CESMRUrlParserPluginImpl::DoFindLocationUrlL +// Finds location URL from given text input +// --------------------------------------------------------------------------- // -// Checks if coordinate parameter (lon or lat) is in correct format -// Leaves if not -// Correct form is: -// -minus sign allowed only in first position -// -only one decimalseparator sign allowed -// -only digits allowed -// -aParam length not allowed to be zero -// ---------------------------------------------------------------------------- -// -void CESMRUrlParserPluginImpl::CheckCoordinateParamL( const TDesC& aParam ) + +void CESMRUrlParserPluginImpl::DoFindLocationUrlL( + const TDesC& aText, + TInt& aPos, + TPtrC& aUrl ) { FUNC_LOG; - if( aParam.Length() == 0 ) + + aPos = KErrNotFound; + aUrl.Set( KNullDesC ); + + // Search URL from given text + CFindItemEngine* itemEngine = CFindItemEngine::NewL( + aText, + CFindItemEngine::EFindItemSearchURLBin ); + CleanupStack::PushL (itemEngine ); + + // For each found item + CFindItemEngine::SFoundItem item; + itemEngine->Item( item ); + + TInt itemCount = itemEngine->ItemCount(); + for ( TInt i = 0; i < itemCount; ++i ) { - User::Leave( KErrArgument ); - } - - //check that aParam contains only digits and only one decimalseparator - //and minus sign is first, if it exists - TChar character; - TBool decimalSeparatorFound = EFalse; - TLex lex; - lex.Assign( aParam ); - const TUint KMinusSign = '-'; - - for( TInt i = 0; i < aParam.Length(); i++) - { - character = lex.Get(); - //checks if first character is minus sign and continues if it is - if( i == 0 && (TUint)character == KMinusSign) + TPtrC url = aText.Mid( item.iStartPos, item.iLength ); + + CPosLandmark* landmark = NULL; + TRAPD( error, landmark = CreateLandmarkFromUrlL( url ); ) + delete landmark; + + if ( !error ) // Location url found { - continue; + aPos = item.iStartPos; + aUrl.Set( url ); + // Stop iteration + break; } - //check that only one decimalseparator exists - if( (TUint)character == KDecimalSeparator ) + else { - if( decimalSeparatorFound ) - { - User::Leave( KErrArgument ); - } - else - { - decimalSeparatorFound = ETrue; - } + itemEngine->NextItem( item ); } - //check that character is either digit or decimalseparator - if( !( character.IsDigit() ) && (TUint)character != KDecimalSeparator ) - { - User::Leave( KErrArgument ); - } + } + + CleanupStack::PopAndDestroy( itemEngine ); + + if ( aPos < 0 ) + { + ExtensionL().FindLocationUrlL( aText, aUrl, aPos ); } } -// ---------------------------------------------------------------------------- -// CESMRUrlParserPluginImpl::GetCoordinateParamValuesL -// Returns longitude and latitude if found correctly -// ---------------------------------------------------------------------------- -// -void CESMRUrlParserPluginImpl::GetCoordinateParamValuesL( const TDesC& aUrl, - TPtrC& aLatitude, - TPtrC& aLongitude ) +// --------------------------------------------------------------------------- +// CESMRUrlParserPluginImpl::ExtensionL +// --------------------------------------------------------------------------- +// +CMRUrlParserExtension& CESMRUrlParserPluginImpl::ExtensionL() { FUNC_LOG; - //Read latitude and longitude strings from resourcefile - HBufC* lat = ReadResourceStringLC( R_QTN_LOCATION_URL_LATITUDE ); - HBufC* lon = ReadResourceStringLC( R_QTN_LOCATION_URL_LONGITUDE ); - HBufC* separator = ReadResourceStringLC( R_QTN_LOCATION_URL_PARAM_SEPARATOR ); - - //Find out if lat and lon params and separator exists in aUrl - TInt latPos = aUrl.Find( *lat ); - TInt lonPos = aUrl.Find( *lon ); - TInt separatorPos = aUrl.Find( *separator ); - if( latPos == KErrNotFound || lonPos == KErrNotFound - || separatorPos == KErrNotFound ) + + if ( !iExtension ) { - User::Leave( KErrNotFound ); + iExtension = CMRUrlParserExtension::NewL(); } - - //takes from aUrl parts with actual coordinate data - aLatitude.Set( aUrl.Mid( latPos + lat->Length(), separatorPos - latPos - lat->Length() ) ); - aLongitude.Set( aUrl.Right( aUrl.Length() - separatorPos - 1 - lon->Length() ) ); + + return *iExtension; + } + +// --------------------------------------------------------------------------- +// CESMRUrlParserPluginImpl::CreateLandmarkFromUrlInternalL +// Creates landmark object from location URL +// --------------------------------------------------------------------------- +// +CPosLandmark* CESMRUrlParserPluginImpl::CreateLandmarkFromUrlInternalL( + const TDesC& aUrl ) + { + FUNC_LOG; - CleanupStack::PopAndDestroy( separator ); - CleanupStack::PopAndDestroy( lon ); - CleanupStack::PopAndDestroy( lat ); + // Decode URL and convert it to UTF-8 format + HBufC* decodedUrl = EscapeUtils::EscapeDecodeL( aUrl ); + CleanupStack::PushL( decodedUrl ); + HBufC8* url = EscapeUtils::ConvertFromUnicodeToUtf8L( *decodedUrl ); + CleanupStack::PopAndDestroy( decodedUrl ); + CleanupStack::PushL( url ); + + // Create landmark using correct parser + CPosLandmarkParser& parser = InitializeParserL(); + parser.SetInputBuffer( *url ); + CPosLmOperation* operation = parser.ParseContentL(); + ExecuteAndDeleteLD( operation ); + CPosLandmark* landmark = parser.LandmarkLC(); + CleanupStack::Pop( landmark ); + CleanupStack::PopAndDestroy( url ); + + //transfer ownership + return landmark; } + //EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrurlparserplugin/src/cmrurlparserextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrurlparserplugin/src/cmrurlparserextension.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Parser class extension for parsing landmarks to url and vice versa +* +*/ + + + +#include "cmrurlparserextension.h" + +#include +#include +#include +#include +#include + +#include "emailtrace.h" + +namespace +{ +// Old location base URL format +_LIT( KLocationUrl, "http://www.ovi.com/maps/" ); + +// Latitude parameter +_LIT( KUrlParamLatitude, "lat=" ); + +// Parameter separator +_LIT( KUrlParamSeparator, "&" ); + +// Longitude parameter +_LIT( KUrlParamLongitude, "lon=" ); + +// Location sieve URL +_LIT( KLocationSieveUrl, "http://www.ovi.com/maps/lat=*&lon=*" ); + +const TUint KDecimalSeparator = '.'; +const TUint KMinusSign = '-'; + +// ======== LOCAL FUNCTIONS ======== +// ---------------------------------------------------------------------------- +// CheckCoordinateParamL +// +// Checks if coordinate parameter (lon or lat) is in correct format +// Leaves if not +// Correct form is: +// -minus sign allowed only in first position +// -only one decimalseparator sign allowed +// -only digits allowed +// -aParam length not allowed to be zero +// ---------------------------------------------------------------------------- +// +void CheckCoordinateParamL( const TDesC& aParam ) + { + FUNC_LOG; + if( aParam.Length() == 0 ) + { + User::Leave( KErrArgument ); + } + + //check that aParam contains only digits and only one decimalseparator + //and minus sign is first, if it exists + TChar character; + TBool decimalSeparatorFound = EFalse; + TLex lex; + lex.Assign( aParam ); + + for( TInt i = 0; i < aParam.Length(); i++) + { + character = lex.Get(); + //checks if first character is minus sign and continues if it is + if( i == 0 && (TUint)character == KMinusSign) + { + continue; + } + + //check that only one decimal separator exists + if ( (TUint)character == KDecimalSeparator ) + { + if ( decimalSeparatorFound ) + { + User::Leave( KErrArgument ); + } + else + { + decimalSeparatorFound = ETrue; + } + } + //check that character is either digit or decimalseparator + if( !( character.IsDigit() ) && (TUint)character != KDecimalSeparator ) + { + User::Leave( KErrArgument ); + } + } + } + +// ---------------------------------------------------------------------------- +// GetCoordinateParamValuesL +// Returns longitude and latitude if found correctly +// ---------------------------------------------------------------------------- +// +void GetCoordinateParamValuesL( const TDesC& aUrl, + TPtrC& aLatitude, + TPtrC& aLongitude ) + { + FUNC_LOG; + + //Find out if lat and lon params and separator exists in aUrl + TInt latPos = aUrl.Find( KUrlParamLatitude ); + TInt lonPos = aUrl.Find( KUrlParamLongitude ); + TInt separatorPos = aUrl.Find( KUrlParamSeparator ); + + if( latPos == KErrNotFound || lonPos == KErrNotFound + || separatorPos == KErrNotFound ) + { + User::Leave( KErrNotFound ); + } + + //takes from aUrl parts with actual coordinate data + aLatitude.Set( aUrl.Mid( + latPos + KUrlParamLatitude().Length(), + separatorPos - latPos - KUrlParamLatitude().Length() ) ); + + aLongitude.Set( aUrl.Right( + aUrl.Length() - separatorPos - 1 - KUrlParamLongitude().Length() ) ); + } +} + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CMRUrlParserExtension::CMRUrlParserExtension +// --------------------------------------------------------------------------- +// +CMRUrlParserExtension::CMRUrlParserExtension() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRUrlParserExtension::NewL +// --------------------------------------------------------------------------- +// +CMRUrlParserExtension* CMRUrlParserExtension::NewL() + { + FUNC_LOG; + + CMRUrlParserExtension* self = CMRUrlParserExtension::NewLC(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CMRUrlParserExtension::NewLC +// --------------------------------------------------------------------------- +// +CMRUrlParserExtension* CMRUrlParserExtension::NewLC() + { + FUNC_LOG; + + CMRUrlParserExtension* self = new( ELeave ) CMRUrlParserExtension; + CleanupStack::PushL( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// CMRUrlParserExtension::~CMRUrlParserExtension +// --------------------------------------------------------------------------- +// +CMRUrlParserExtension::~CMRUrlParserExtension() + { + FUNC_LOG; + } + +// --------------------------------------------------------------------------- +// CMRUrlParserExtension::FindLocationUrl +// Finds location URL from given text input +// --------------------------------------------------------------------------- +// +void CMRUrlParserExtension::FindLocationUrlL( + const TDesC& aText, + TPtrC& aUrl, + TInt& aPos) + + { + FUNC_LOG; + + //Seach if base string is found from aText + TInt urlLocation = aText.FindF( KLocationUrl ); + if ( urlLocation < KErrNone ) + { + User::Leave(KErrNotFound); + } + + //Take out unnecessary part before URL and search if endmark (whitespace) + //is found. If endmark is not found, + //then all the rest of descriptor is part of URL + TPtrC urlAndAfter = aText.Mid( urlLocation ); + TInt urlAndAfterLength = urlAndAfter.Length(); + TInt urlEndmarkLocation = KErrNotFound; + + for( TInt i = 0; i < urlAndAfterLength; i++) + { + if( TChar( urlAndAfter[i] ).IsSpace() ) + { + urlEndmarkLocation = i; + break; + } + } + + if( urlEndmarkLocation == KErrNotFound ) + { + urlEndmarkLocation = urlAndAfterLength; + } + + //Take out part from beginning of URL to endmark + TPtrC urlToEndMark = urlAndAfter.Left( urlEndmarkLocation ); + + //Now we should have only URL left, check with "sieve" that it is about in + //right format + TInt sievedStartPoint = urlToEndMark.MatchF( KLocationSieveUrl ); + + if( sievedStartPoint == KErrNotFound ) + { + User::Leave(KErrNotFound); + } + + //Check that parameters are in right format + TPtrC latValue; + TPtrC lonValue; + + GetCoordinateParamValuesL( + urlToEndMark, + latValue, + lonValue ); + CheckCoordinateParamL( latValue ); + CheckCoordinateParamL( lonValue ); + + //Set aURL to correspond URL part of aText and aPos with url position + aUrl.Set( urlToEndMark ); + aPos = urlLocation; + } + +// --------------------------------------------------------------------------- +// CMRUrlParserExtension::CreateLandmarkFromUrlL +// Creates landmark object from location URL +// --------------------------------------------------------------------------- +// +CPosLandmark* CMRUrlParserExtension::CreateLandmarkFromUrlL( + const TDesC& aUrl ) + { + FUNC_LOG; + + TInt matchPos = User::LeaveIfError( aUrl.MatchF( KLocationSieveUrl ) ); + + if( matchPos != 0 ) + { + //URL was found but is not int the beginning of desc + User::Leave( KErrArgument ); + } + + //Parse actual coordinate values out of url + TPtrC latValue; + TPtrC lonValue; + GetCoordinateParamValuesL( aUrl, latValue, lonValue ); + + //Check that parameters are in right format + CheckCoordinateParamL( latValue ); + CheckCoordinateParamL( lonValue ); + + //Convert parameters to TReal values + TLex lexConverter( latValue ); + TReal64 realLatitude; + lexConverter.Val( realLatitude ); + + lexConverter.Assign( lonValue ); + TReal64 realLongitude; + lexConverter.Val( realLongitude ); + + //Create landmark with coordinatevalues + CPosLandmark* landmark = CPosLandmark::NewLC(); + TLocality position; + position.SetCoordinate( realLatitude, realLongitude ); + landmark->SetPositionL( position ); + CleanupStack::Pop( landmark ); + + //transfer ownership + return landmark; + } + +//EOF + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutils/BWINS/ESMRUtilsU.def --- a/meetingrequest/mrutils/BWINS/ESMRUtilsU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutils/BWINS/ESMRUtilsU.def Wed Mar 31 21:08:33 2010 +0300 @@ -7,4 +7,5 @@ ?NewL@CESMRUtils@@SAPAV1@AAVMMRUtilsObserver@@@Z @ 6 NONAME ; class CESMRUtils * CESMRUtils::NewL(class MMRUtilsObserver &) ?SendWithUiL@CESMRUtils@@QAEXABVCCalEntry@@J@Z @ 7 NONAME ; void CESMRUtils::SendWithUiL(class CCalEntry const &, long) ?SessionSetupL@CESMRUtils@@QAEXAAVCCalSession@@PAVCMsvSession@@@Z @ 8 NONAME ; void CESMRUtils::SessionSetupL(class CCalSession &, class CMsvSession *) + ?CreateExtensionsL@CESMRUtils@@QAEXW4TESMRCalendarEventType@@@Z @ 9 NONAME ; void CESMRUtils::CreateExtensionsL(enum TESMRCalendarEventType) diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutils/EABI/ESMRUtilsU.def --- a/meetingrequest/mrutils/EABI/ESMRUtilsU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutils/EABI/ESMRUtilsU.def Wed Mar 31 21:08:33 2010 +0300 @@ -9,4 +9,5 @@ _ZN10CESMRUtilsD1Ev @ 8 NONAME _ZN10CESMRUtilsD2Ev @ 9 NONAME _ZN10CESMRUtils13SessionSetupLER11CCalSessionP11CMsvSession @ 10 NONAME + _ZN10CESMRUtils17CreateExtensionsLE22TESMRCalendarEventType @ 11 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutils/group/esmrutils.mmp --- a/meetingrequest/mrutils/group/esmrutils.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutils/group/esmrutils.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,9 +29,6 @@ VENDORID VID_DEFAULT DEFFILE ESMRUtils.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrutils.cpp @@ -48,7 +44,6 @@ LIBRARY esmrdb.lib LIBRARY esmrtasks.lib LIBRARY esmrpolicy.lib -LIBRARY esmrentry.lib LIBRARY esmrservices.lib // System libraries @@ -56,11 +51,10 @@ LIBRARY ecom.lib LIBRARY cone.lib LIBRARY efsrv.lib -LIBRARY cmaillogger.lib +LIBRARY calinterimapi.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE - +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutils/inc/cesmrutils.h --- a/meetingrequest/mrutils/inc/cesmrutils.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutils/inc/cesmrutils.h Wed Mar 31 21:08:33 2010 +0300 @@ -21,14 +21,15 @@ // INCLUDE FILES #include -#include +#include +#include "esmrdef.h" // FORWARD DECLARATIONS class CCalEntry; class CMRMailboxUtils; class CESMRCalDbMgr; class CESMRPolicyManager; -class CESMREntryProcessor; +class CMREntryProcessor; class MESMRTaskFactory; class MESMRTaskExtension; @@ -53,6 +54,15 @@ */ IMPORT_C ~CESMRUtils(); +public: // Interface + + /** + * Creates extensions for specified entry type + */ + IMPORT_C void CreateExtensionsL( + TESMRCalendarEventType aEntryType ); + + public: // Interface is copied from CMRUtils.h /** * Deletes given aEntries from the database and possibly allows @@ -125,7 +135,7 @@ /// Own: ESMR policy manager CESMRPolicyManager* iPolicyManager; /// Own: MR Entry processor - CESMREntryProcessor* iEntryProcessor; + CMREntryProcessor* iEntryProcessor; /// Own: ES MR Task factory MESMRTaskFactory* iTaskFactory; /// Own: ES MR Task extension diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutils/inc/esmrutilsapiext.h --- a/meetingrequest/mrutils/inc/esmrutilsapiext.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutils/inc/esmrutilsapiext.h Wed Mar 31 21:08:33 2010 +0300 @@ -18,7 +18,7 @@ #ifndef ESMRUTILSAPIEXT_H #define ESMRUTILSAPIEXT_H -#include +#include /** * Extension API query function. diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutils/src/cesmrutils.cpp --- a/meetingrequest/mrutils/src/cesmrutils.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutils/src/cesmrutils.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -29,13 +29,14 @@ #include "cesmrpolicy.h" // -#include "cesmrentryprocessor.h" +#include "cmrentryprocessor.h" #include "mesmrmeetingrequestentry.h" #include "cesmrtaskfactory.h" #include "mesmrtask.h" #include "cesmrtaskextensionimpl.h" #include "esmrinternaluid.h" #include "esmrhelper.h" +#include "esmrentryhelper.h" // From System #include @@ -53,8 +54,6 @@ /// Unnamed namespace for local definitions namespace { -_LIT( KESMRPolicyResourceFile, "esmrpolicies.rsc" ); - #ifdef _DEBUG // Definition for MR UTILS panic text @@ -65,7 +64,8 @@ { EESMRUtilsEntryProcessorNull = 0, // Entry processon is NULL EESMRUtilsInvalidEntry = 1, // Invalid calendar entry, - EESMRUtilsNULLCoeEnv = 2 // CCoeEnv is NULL + EESMRUtilsNULLCoeEnv = 2, // CCoeEnv is NULL + EESMRUtilsInvalidType }; void Panic(TESMRUtilsPanicCode aPanicCode) @@ -96,13 +96,13 @@ // EXPORT_C CESMRUtils::~CESMRUtils() { - FUNC_LOG; - delete iCalDBMgr; + FUNC_LOG; delete iPolicyManager; delete iEntryProcessor; delete iMRMailboxUtils; delete iTaskFactory; delete iTaskExtension; + delete iCalDBMgr; } // ---------------------------------------------------------------------------- @@ -127,21 +127,47 @@ void CESMRUtils::ConstructL() { FUNC_LOG; - CCoeEnv* coeEnv = CCoeEnv::Static(); - __ASSERT_DEBUG( coeEnv, Panic(EESMRUtilsNULLCoeEnv) ); + + iPolicyManager = CESMRPolicyManager::NewL(); + } - TFileName mruiPolicyResource; - User::LeaveIfError( - ESMRHelper::LocateResourceFile( - KESMRPolicyResourceFile, - KDC_RESOURCE_FILES_DIR, - mruiPolicyResource, - &coeEnv->FsSession() ) ); - - iPolicyManager = CESMRPolicyManager::NewL(); - iPolicyManager->ReadPolicyFromResourceL( - mruiPolicyResource, - R_ESMR_POLICIES ); +// ---------------------------------------------------------------------------- +// CESMRUtils::CreateExtensionsL +// ---------------------------------------------------------------------------- +// +EXPORT_C void CESMRUtils::CreateExtensionsL( + TESMRCalendarEventType aEntryType ) + { + FUNC_LOG; + + CESMRTaskFactory* taskFactory = CESMRTaskFactory::NewL( + aEntryType, + *iCalDBMgr ); + CleanupStack::PushL( taskFactory ); + + CMREntryProcessor* entryProcessor = CMREntryProcessor::NewL( + aEntryType, + *iCalDBMgr ); + CleanupStack::PushL( entryProcessor ); + + MESMRTaskExtension* taskExtension = + CESMRTaskExtenstionImpl::NewL( *taskFactory ); + + __ASSERT_DEBUG( taskFactory + && entryProcessor + && taskExtension, + Panic( EESMRUtilsInvalidType) ); + + delete iTaskFactory; + iTaskFactory = taskFactory; + + delete iEntryProcessor; + iEntryProcessor = entryProcessor; + + delete iTaskExtension; + iTaskExtension = taskExtension; + + CleanupStack::Pop( 2, taskFactory ); } // ---------------------------------------------------------------------------- @@ -157,16 +183,14 @@ CleanupClosePushL( entries ); User::LeaveIfError( entries.Append( &aEntry ) ); - CESMREntryProcessor* processor = - CESMREntryProcessor::NewL( - *iMRMailboxUtils, - *iCalDBMgr ); + CreateExtensionsL( ESMREntryHelper::EventTypeL( aEntry ) ); - CleanupStack::PushL( processor ); - - processor->ProcessL( &entries ); - - MESMRMeetingRequestEntry& mrEntry = processor->ESMREntryL(); + iEntryProcessor->ProcessL( &entries ); + + MESMRMeetingRequestEntry& mrEntry = + static_cast< MESMRMeetingRequestEntry& >( + iEntryProcessor->ESMREntryL() ); + if ( mrEntry.IsRecurrentEventL() ) { mrEntry.SetModifyingRuleL( @@ -179,8 +203,7 @@ EESMRCmdDeleteMR, mrEntry ); - CleanupStack::PopAndDestroy( processor ); - CleanupStack::PopAndDestroy(); //entries + CleanupStack::PopAndDestroy( &entries ); return KErrNone; } @@ -194,16 +217,15 @@ TMsvId /*aMailbox*/ ) { FUNC_LOG; - CESMREntryProcessor* processor = - CESMREntryProcessor::NewL( - *iMRMailboxUtils, - *iCalDBMgr ); + + CreateExtensionsL( ESMREntryHelper::EventTypeL( aInstance->Entry() ) ); + + iEntryProcessor->ProcessL( *aInstance ); - CleanupStack::PushL( processor ); - - processor->ProcessL( *aInstance ); - - MESMRMeetingRequestEntry& mrEntry = processor->ESMREntryL(); + MESMRMeetingRequestEntry& mrEntry = + static_cast< MESMRMeetingRequestEntry& >( + iEntryProcessor->ESMREntryL() ); + mrEntry.SetModifyingRuleL( MESMRMeetingRequestEntry::EESMRThisOnly ); @@ -213,9 +235,6 @@ EESMRCmdDeleteMR, mrEntry ); - // prosessor and aInstance - CleanupStack::PopAndDestroy( processor ); - // aInstance is not added to CleanupStack, because calendar // already has it. delete aInstance; @@ -235,16 +254,14 @@ CleanupClosePushL( entries ); User::LeaveIfError( entries.Append( &aEntry ) ); - CESMREntryProcessor* processor = - CESMREntryProcessor::NewL( - *iMRMailboxUtils, - *iCalDBMgr ); + CreateExtensionsL( ESMREntryHelper::EventTypeL( aEntry ) ); + + iEntryProcessor->ProcessL( &entries ); - CleanupStack::PushL( processor ); - - processor->ProcessL( &entries ); - - MESMRMeetingRequestEntry& mrEntry = processor->ESMREntryL(); + //MESMRMeetingRequestEntry& = processor->ESMREntryL(); + MESMRMeetingRequestEntry& mrEntry = + static_cast< MESMRMeetingRequestEntry& >( + iEntryProcessor->ESMREntryL() ); if ( mrEntry.IsRecurrentEventL() ) { @@ -256,7 +273,6 @@ EESMRCmdForwardAsMail, mrEntry ); - CleanupStack::PopAndDestroy( processor ); CleanupStack::PopAndDestroy( &entries ); } // ---------------------------------------------------------------------------- @@ -303,20 +319,6 @@ *this ); iMRMailboxUtils = CMRMailboxUtils::NewL( aMsvSession ); - - iTaskFactory = CESMRTaskFactory::NewL( *iCalDBMgr, *iMRMailboxUtils ); - - iEntryProcessor = CESMREntryProcessor::NewL( - *iMRMailboxUtils, - *iCalDBMgr ); - - iTaskExtension = - CESMRTaskExtenstionImpl::NewL( - *iCalDBMgr, - *iMRMailboxUtils, - *iPolicyManager, - *iEntryProcessor, - *iTaskFactory ); } // ---------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutilscalplugin/data/2001E27F.rss --- a/meetingrequest/mrutilscalplugin/data/2001E27F.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutilscalplugin/data/2001E27F.rss Wed Mar 31 21:08:33 2010 +0300 @@ -18,8 +18,7 @@ // INCLUDES #include -#include -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber +#include #include "esmrinternaluid.h" // RESOURCE DEFINITIONS @@ -43,9 +42,9 @@ IMPLEMENTATION_INFO { implementation_uid = KESMRUtilsCalPluginImplUid3Fs; - version_no = KEmailEcomVersionNumber; + version_no = 1; display_name = ""; - default_data = "S60DefaultImpl"; // KMRUtilsDefaultImpl from CMRUtils.h + default_data = KESMRUtilsCalPluginDataFs; opaque_data = ""; rom_only = 0; } diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutilscalplugin/group/esmrutilscalplugin.mmp --- a/meetingrequest/mrutilscalplugin/group/esmrutilscalplugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutilscalplugin/group/esmrutilscalplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,9 +29,6 @@ VENDORID VID_DEFAULT DEFFILE ESMRUtilsCalPlugin.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE esmrutilsmain.cpp SOURCE cesmrutilsimpl.cpp @@ -40,28 +36,26 @@ USERINCLUDE . USERINCLUDE ../inc USERINCLUDE ../../inc +USERINCLUDE ../../../inc + APP_LAYER_SYSTEMINCLUDE -USERINCLUDE ../../../inc - SOURCEPATH ../data +// S60 UID update START RESOURCE 2001E27F.rss // +// S60 UID update TARGET esmrutilscalplugin.rsc END // ESMR libraries LIBRARY esmrutils.lib -LIBRARY esmrdb.lib -LIBRARY esmrtasks.lib -LIBRARY esmrservices.lib // System libraries LIBRARY euser.lib LIBRARY ecom.lib -LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of file diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutilscalplugin/inc/cesmrutilsimpl.h --- a/meetingrequest/mrutilscalplugin/inc/cesmrutilsimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutilscalplugin/inc/cesmrutilsimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -20,7 +20,7 @@ #define CESMRUTILSIMPL_H // INCLUDE FILES -#include +#include // FORWARD DECLARATIONS class CESMRUtils; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrutilscalplugin/src/cesmrutilsimpl.cpp --- a/meetingrequest/mrutilscalplugin/src/cesmrutilsimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrutilscalplugin/src/cesmrutilsimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -25,7 +25,6 @@ // From ESMRSERVICES // #include "cesmrpolicymanager.h" -#include "cesmrentryprocessor.h" #include "mesmrmeetingrequestentry.h" #include "cesmrtaskfactory.h" #include "mesmrtask.h" diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrversit2/group/esmrversit2.mmp --- a/meetingrequest/mrversit2/group/esmrversit2.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrversit2/group/esmrversit2.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,26 +16,23 @@ * */ +#include "../../inc/esmrinternaluid.h" +#include "../../../inc/emailtraceconfig.hrh" +#include #include -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" - TARGET esmrversit2.dll TARGETTYPE dll UID 0x1000008d KESMRDllUid3 -CAPABILITY CAP_GENERAL_DLL - -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../inc +CAPABILITY CAP_GENERAL_DLL //System include macro +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +// APP_LAYER_SYSTEMINCLUDE +// SOURCEPATH ../src @@ -53,10 +50,9 @@ LIBRARY euser.lib // Base LIBRARY estor.lib // Streams LIBRARY charconv.lib // Character conversion -LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#endif // ENABLE_TRACES && TRACE_INTO_FILE // End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewer/EABI/ESMRViewerU.def --- a/meetingrequest/mrviewer/EABI/ESMRViewerU.def Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewer/EABI/ESMRViewerU.def Wed Mar 31 21:08:33 2010 +0300 @@ -5,4 +5,6 @@ _ZN21CESMRViewerControllerD0Ev @ 4 NONAME _ZN21CESMRViewerControllerD1Ev @ 5 NONAME _ZN21CESMRViewerControllerD2Ev @ 6 NONAME + _ZThn16_N21CESMRViewerControllerD0Ev @ 7 NONAME + _ZThn16_N21CESMRViewerControllerD1Ev @ 8 NONAME diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewer/group/bld.inf --- a/meetingrequest/mrviewer/group/bld.inf Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewer/group/bld.inf Wed Mar 31 21:08:33 2010 +0300 @@ -26,5 +26,6 @@ PRJ_EXPORTS ../inc/cesmrviewerctrl.h |../../inc/cesmrviewerctrl.h +../inc/mmrinfoprovider.h |../../inc/mmrinfoprovider.h // EOF diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewer/group/esmrviewer.mmp --- a/meetingrequest/mrviewer/group/esmrviewer.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewer/group/esmrviewer.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,32 +29,41 @@ VENDORID VID_DEFAULT DEFFILE ESMRViewer.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE cesmrviewerctrl.cpp USERINCLUDE . ../inc USERINCLUDE ../../inc +USERINCLUDE ../../../inc APP_LAYER_SYSTEMINCLUDE -USERINCLUDE ../../../inc - +LIBRARY esmrcommon.lib LIBRARY esmrpolicy.lib LIBRARY esmrservices.lib LIBRARY esmrutils.lib -LIBRARY esmrentry.lib +LIBRARY mrguicommon.lib +LIBRARY esmrgui.lib +LIBRARY esmrtasks.lib LIBRARY euser.lib LIBRARY ecom.lib LIBRARY eikcore.lib -LIBRARY esmrgui.lib LIBRARY cone.lib -LIBRARY cmaillogger.lib +LIBRARY calinterimapi.lib +LIBRARY caleninterimutils2.lib -#ifdef TRACE_INTO_FILE +// flags are not in cmail, nor profiler +//#ifdef ESMR_ENABLE_PROFILE +//LIBRARY esmrprofile.lib +//#endif +// + +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#endif // ENABLE_TRACES && TRACE_INTO_FILE + +// Removed profiling. // End of file + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewer/inc/cesmrviewerctrl.h --- a/meetingrequest/mrviewer/inc/cesmrviewerctrl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewer/inc/cesmrviewerctrl.h Wed Mar 31 21:08:33 2010 +0300 @@ -20,9 +20,10 @@ #define CESMRVIEWERCTRL_H // INCLUDES -#include -#include +#include +#include #include +#include "mmrinfoprovider.h" // FORWARD DECLARATIONS class CCalEntry; @@ -32,9 +33,10 @@ class CMRMailboxUtils; class CActiveSchedulerWait; class CESMRUiFactory; -class CESMREntryProcessor; +class CMREntryProcessor; class MESMRTaskExtension; class CESMRPolicyManager; +class MESMRCalDbMgr; // CLASS DECLARATION @@ -45,7 +47,8 @@ NONSHARABLE_CLASS(CESMRViewerController) : public CBase, public MAgnEntryUiCallback, - public MMRUtilsObserver + public MMRUtilsObserver, + public MMRInfoProvider { public: // Constructors and destructor /** @@ -78,7 +81,11 @@ TInt aPercentageCompleted, TInt aStatus ); -private: // Constructors +protected: // From MMRInfoProvider + MMRPolicyProvider& PolicyProvider() const; + MESMRCalEntry* EntryL(); + +private: // Constructors and implementation CESMRViewerController( RPointerArray& aEntries, const MAgnEntryUi::TAgnEntryUiInParams& aParams, @@ -89,6 +96,12 @@ TInt aCommandId ); void LaunchUIL(); void LaunchCorrectOperationModeL(); + TInt ProcessDefaultCommandL( TInt aCommandId ); + TInt ProcessMeetingRequestCommandL( TInt aCommandId ); + void ChangeEntryTypeL( TInt aCommandId ); + void UpdateComparativeEntryInTypeChangeL( const CCalEntry& aOriginalEntry ); + void CancelAndDeleteMRInEntryTypeChangeL( + CCalEntry& entry, MESMRCalDbMgr& aDbMgr ); private: // Data /// Own: Operation error value @@ -108,11 +121,13 @@ /// Own: UI factory CESMRUiFactory* iGuiFactory; /// Ref: Reference to entry processor - CESMREntryProcessor* iEntryProcessor; + CMREntryProcessor* iEntryProcessor; /// Ref: Reference to task extension MESMRTaskExtension* iTaskExt; /// Ref: Reference to policy manager CESMRPolicyManager* iPolicyMgr; + /// Own: Current calendar entry to be handled + CCalEntry* iCalEntry; }; #endif // CMRHANDLER_H diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewer/inc/mmrinfoprovider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/meetingrequest/mrviewer/inc/mmrinfoprovider.h Wed Mar 31 21:08:33 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MR Info Provider interface +* +*/ + + +#ifndef MMRINFOPROVIDER_H +#define MMRINFOPROVIDER_H + +// INCLUDES + +// FORWARD DECLARATIONS +class MMRPolicyProvider; +class MESMRCalEntry; + +// CLASS DECLARATION + +/** + * MMRInfoProvider defines an accessor interface for UI to access current + * policy and entry information. + */ +class MMRInfoProvider + { +public: // Interface + + /** + * Gets the MMRPolicyProvider interface. + * + * @return policy provider + */ + virtual MMRPolicyProvider& PolicyProvider() const = 0; + + /** + * Gets the current entry. + * + * @return entry. + */ + virtual MESMRCalEntry* EntryL() = 0; + +protected: + + /** + * Protected destructor to prevent destruction of implementation + * via this interface. + */ + virtual ~MMRInfoProvider() {} + + }; + +#endif // MMRINFOPROVIDER_H + +// End of File diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewer/src/cesmrviewerctrl.cpp --- a/meetingrequest/mrviewer/src/cesmrviewerctrl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewer/src/cesmrviewerctrl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -24,26 +24,31 @@ // #include "cesmrviewerctrl.h" -#include "cesmrentryprocessor.h" +#include "cmrentryprocessor.h" #include "mesmrmeetingrequestentry.h" #include "mesmrtaskextension.h" -// +#include "esmrentryhelper.h" +#include "esmrhelper.h" #include "cesmruifactory.h" -// + #include "mesmruibase.h" #include "tesmrinputparams.h" +#include "tmroutputparams.h" #include "esmrconfig.hrh" #include "cesmrconfirmationquery.h" #include "cesmrutils.h" -#include "cesmrattachmentinfo.h" #include "cesmrcaluserutil.h" -// Removed profiling. +#include "cesmrlistquery.h" +#include "cesmrcaldbmgr.h" + +#include "cesmrtaskfactory.h" +#include "cesmrtaskextensionimpl.h" // Logging utilities // From System // -#include +#include #include "esmrutilsapiext.h" // #include @@ -53,6 +58,9 @@ // #include #include +#include +#include +#include // CONSTANTS /// Unnamed namespace for local definitions @@ -70,6 +78,8 @@ EESMRViewerCtrlProcessor, EESMRViewerCtrlTaskExt, EESMRViewerCtrlPolicyMgr, + EESMRViewerCtrlInvalidModifyingRule, + EESMRViewerCtrlInvalidEntryType }; void Panic(TMRViewerCtrlPanicCode aPanicCode) @@ -80,25 +90,140 @@ #endif /** - * Tests if entry contains attachments or not. - * @param aEntry Reference to meeting request entry. - * @return ETrue if entry contains attachments + * Maps calendar entry type to MR entry type + * @param aEntryType to be mapped to MR entry type + * @return MR event type */ -TBool ContainsAttachmentsL( - MESMRMeetingRequestEntry& aEntry ) +TESMRCalendarEventType MapType( const CCalEntry& aEntry ) { - TBool retValue( EFalse ); + TESMRCalendarEventType type( EESMREventTypeNone ); - TESMRInputParams esmrInputParams; - if ( aEntry.StartupParameters(esmrInputParams) ) + switch ( aEntry.EntryTypeL() ) { - if ( esmrInputParams.iAttachmentInfo && - esmrInputParams.iAttachmentInfo->AttachmentCount() ) + case CCalEntry::EAppt: + { + if( CCalenInterimUtils2::IsMeetingRequestL( + ( const_cast( aEntry ) ) ) ) + { + type = EESMREventTypeMeetingRequest; + } + else + { + type = EESMREventTypeAppt; + } + break; + } + case CCalEntry::ETodo: { - retValue = ETrue; + type = EESMREventTypeETodo; + break; + } + case CCalEntry::EEvent: + { + type = EESMREventTypeEEvent; + break; + } + case CCalEntry::EReminder: + { + type = EESMREventTypeEReminder; + break; + } + case CCalEntry::EAnniv: + { + type = EESMREventTypeEAnniv; + break; + } + default: + { + __ASSERT_DEBUG( EFalse, Panic( EESMRViewerCtrlInvalidEntryType ) ); } } - return retValue; + + return type; + } + +/** + * Creates calendar entry + * @param required parameters for creating an entry + * @return CCalEntry Created entry. + */ +CCalEntry* CreateEntryL( + CCalEntry::TType aType, + const TDesC8& aUid, + CCalEntry::TMethod aMethod, + CalCommon::TRecurrenceRange aRange ) + { + HBufC8* guid = aUid.AllocLC(); + CCalEntry* entry = CCalEntry::NewL( aType, guid, aMethod, aRange ); + CleanupStack::Pop( guid ); + + return entry; + } + +/** + * Converts to-do specific priority to normal priority + * @param Calendar entry, which priority is converted + * @return The converted priority + */ +TInt ConvertTodoPriorityToNormalL( const CCalEntry& entry ) + { + FUNC_LOG; + TInt priority( 0 ); + if( entry.PriorityL() == EFSCalenTodoPriorityHigh ) + { + priority = EFSCalenMRPriorityHigh; + } + + else if( entry.PriorityL() == EFSCalenTodoPriorityNormal ) + { + priority = EFSCalenMRPriorityNormal; + } + + else if( entry.PriorityL() == EFSCalenTodoPriorityLow ) + { + priority = EFSCalenMRPriorityLow; + } + + else + { + // Priority unknown, let's set it to normal then + priority = EFSCalenMRPriorityNormal; + } + + return priority; + } + +/** + * Converts normal priority to to-do specific priority + * @param Calendar entry, which priority is converted + * @return The converted priority + */ +TInt ConvertNormalPriorityToTodoL( const CCalEntry& entry ) + { + FUNC_LOG; + TInt priority( 0 ); + if( entry.PriorityL() == EFSCalenMRPriorityHigh ) + { + priority = EFSCalenTodoPriorityHigh; + } + + else if( entry.PriorityL() == EFSCalenMRPriorityNormal ) + { + priority = EFSCalenTodoPriorityNormal; + } + + else if( entry.PriorityL() == EFSCalenMRPriorityLow ) + { + priority = EFSCalenTodoPriorityLow; + } + + else + { + // Priority unknown, let's set it to normal then + priority = EFSCalenMRPriorityNormal; + } + + return priority; } } // namespace @@ -130,10 +255,11 @@ // EXPORT_C CESMRViewerController::~CESMRViewerController() { - FUNC_LOG; - delete iESMRUtils; + FUNC_LOG; delete iCtrlSyncher; delete iGuiFactory; + delete iCalEntry; + delete iESMRUtils; } // ----------------------------------------------------------------------------- @@ -176,6 +302,9 @@ iInParams.iCalSession, iInParams.iMsgSession ); + iESMRUtils->CreateExtensionsL( + ESMREntryHelper::EventTypeL( *(iEntries[0]) ) ); + iGuiFactory = CESMRUiFactory::NewL(); } @@ -201,7 +330,7 @@ User::LeaveIfError( iExecutionError ); iEntryProcessor = - static_cast( + static_cast( iESMRUtils->ExtensionL( TUid::Uid(KESMRMREntryProcessorUid) ) ); @@ -324,6 +453,24 @@ } // ----------------------------------------------------------------------------- +// CESMRViewerController::PolicyProvider +// ----------------------------------------------------------------------------- +// +MMRPolicyProvider& CESMRViewerController::PolicyProvider() const + { + return *iPolicyMgr; + } + +// ----------------------------------------------------------------------------- +// CESMRViewerController::EntryL +// ----------------------------------------------------------------------------- +// +MESMRCalEntry* CESMRViewerController::EntryL() + { + return &iEntryProcessor->ESMREntryL(); + } + +// ----------------------------------------------------------------------------- // CESMRViewerController::ProcessCommandWithResultInternalL // ----------------------------------------------------------------------------- // @@ -332,10 +479,230 @@ { FUNC_LOG; + TInt ret = ProcessDefaultCommandL( aCommandId ); + + if ( ret == KErrNotSupported ) + { + ret = ProcessMeetingRequestCommandL( aCommandId ); + } + + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRViewerController::ProcessDefaultCommandL +// ----------------------------------------------------------------------------- +// +TInt CESMRViewerController::ProcessDefaultCommandL( TInt aCommandId ) + { + FUNC_LOG; TESMRCommand command = static_cast(aCommandId); TBool needToProcessOutputParams( ETrue ); - MESMRMeetingRequestEntry& entry = iEntryProcessor->ESMREntryL(); + + MESMRCalEntry& entry = iEntryProcessor->ESMREntryL(); + TInt ret = KErrNone; + + MESMRCalDbMgr& dbMgr = entry.GetDBMgr(); + switch( aCommandId ) + { + case EESMRCmdSaveMR: // Saves Entry + case EESMRCmdCalEntryUISave: + { + // If we are editing an existing entry. + if ( entry.IsStoredL() ) + { + // If entry is type changed. + if ( entry.IsEntryTypeChangedL() ) + { + // If entry is type changed, delete the old entry first + // from db ... + + CCalEntry* lastStoredEntry = + dbMgr.FetchEntryL( + entry.Entry().UidL(), + entry.Entry().RecurrenceIdL() ); + ASSERT( lastStoredEntry ); + CleanupStack::PushL( lastStoredEntry ); + + if( CCalenInterimUtils2::IsMeetingRequestL( + *lastStoredEntry ) ) + { + // Last stored entry was MR. If MR is sent, it needs to be + // also cancelled before deleting + CancelAndDeleteMRInEntryTypeChangeL( + *lastStoredEntry,dbMgr ); + } + else + { + // Use right taskExtension + CESMRTaskFactory* taskFactory = CESMRTaskFactory::NewL( + MapType( *lastStoredEntry ), + dbMgr ); + CleanupStack::PushL( taskFactory ); + + MESMRTaskExtension* taskExtension = + CESMRTaskExtenstionImpl::NewL( *taskFactory ); + CleanupDeletePushL( taskExtension ); + + taskExtension->DeleteEntryFromLocalDBL( + EESMRCmdCalEntryUIDelete, + entry ); + + CleanupStack::PopAndDestroy( taskExtension ); + CleanupStack::PopAndDestroy( taskFactory ); + } + + // ... and then store the new (edited) entry to db. + iTaskExt->StoreEntryToLocalDBL( + command, + entry ); + + CleanupStack::PopAndDestroy( lastStoredEntry ); + } + + // If we are saving entry that previously existed in + // different db. + else if ( dbMgr.EntryViewL( entry.Entry() ) != NULL + && dbMgr.EntryViewL( entry.Entry() ) != dbMgr.EntryView() ) + { + iTaskExt->MoveEntryToCurrentDBL( command, entry ); + } + + // And if none of the above conditions apply, we are just editing + // an entry and want to save it. + else + { + iTaskExt->StoreEntryToLocalDBL( + command, + entry ); + } + } + + // Store new entry to db. + else + { + iTaskExt->StoreEntryToLocalDBL( + command, + entry ); + } + } + break; + + case EESMRCmdCalEntryUIDelete: // Deletes Entry + { + iTaskExt->DeleteEntryFromLocalDBL( + command, + entry ); + + } + break; + + case EESMRCmdEdit: // Edit MR + case EESMRCmdEditLocal: // Locally edit meeting request + case EESMRCmdCalEntryUIEdit: // Edit calendar entries + { + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeEdit ); + iPolicyMgr->PushPolicyL(); + LaunchUIL(); + + // No need to process parameters because the view is closed + // and editing view has processed to parameters + needToProcessOutputParams = EFalse; + iPolicyMgr->PopPolicy(); + + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeView ); + } + break; + + case EESMRCmdCalEntryUISend: // Send calendar entry item + case EESMRCmdCalEntryUIAddParticipants: // Add participants to meeting item + { + ASSERT( EFalse ); // TODO: implement when tasks are ready + } + break; + + case EESMRCmdEditorInitializationComplete: + { + if ( iCallback.IsCommandAvailable( EESMRCmdEditorInitializationComplete ) ) + { + iCallback.ProcessCommandL( EESMRCmdEditorInitializationComplete ); + } + break; + } + + case EMRCommandSwitchToMR: + case EMRCommandSwitchToMeeting: + case EMRCommandSwitchToMemo: + case EMRCommandSwitchToAnniversary: + case EMRCommandSwitchToTodo: + { + ChangeEntryTypeL( aCommandId ); + needToProcessOutputParams = EFalse; + } + break; + + /* + case EMRLaunchAttachmentsView: + case EMRViewAttachmentInCorrespondingApp: + { + iCallback.ProcessCommandL( command ); + } + break; +*/ + case EESMRCmdTodoMarkAsDone: + { + iTaskExt->MarkTodoAsDoneL( command, + iEntryProcessor->ESMREntryL() ); + } + break; + + case EESMRCmdTodoMarkAsNotDone: + { + iTaskExt->MarkTodoAsNotDoneL( command, + iEntryProcessor->ESMREntryL() ); + } + break; + + default: + ret = KErrNotSupported; + needToProcessOutputParams = EFalse; + break; + } + + if ( needToProcessOutputParams ) + { + iEntryProcessor->ProcessOutputParametersL( + iOutParams, + command ); + } + + + return ret; + } + +// ----------------------------------------------------------------------------- +// CESMRViewerController::ProcessMeetingRequestCommandL +// ----------------------------------------------------------------------------- +// +TInt CESMRViewerController::ProcessMeetingRequestCommandL( TInt aCommandId ) + { + FUNC_LOG; + + TESMRCommand command = static_cast(aCommandId); + TBool needToProcessOutputParams( ETrue ); + + MESMRCalEntry* tmpEntry = &iEntryProcessor->ESMREntryL(); + + ASSERT( tmpEntry->Type() == EESMREventTypeMeetingRequest ); + + if ( tmpEntry->Type() != EESMREventTypeMeetingRequest ) + { + User::Leave( KErrNotSupported ); + } + + MESMRMeetingRequestEntry& entry( *static_cast( tmpEntry ) ); + MESMRCalDbMgr& dbMgr = entry.GetDBMgr(); switch( aCommandId ) { @@ -343,6 +710,22 @@ case EESMRCmdSendMRUpdate: // Send MR update { entry.ConfirmEntryL(); + + if( entry.IsStoredL() ) + { + if( entry.IsEntryTypeChangedL() || + ( ( dbMgr.EntryViewL( entry.Entry() ) != NULL ) && + ( dbMgr.EntryViewL( entry.Entry() ) != dbMgr.EntryView() ) ) ) + { + if(!entry.IsEntryTypeChangedL()) + { + entry.SetSendCanellationAvailable( EFalse ); + } + iTaskExt->DeleteEntryFromLocalDBL( + EESMRCmdDeleteMR, + entry ); + } + } iTaskExt->SendAndStoreMRL( command, entry ); @@ -352,22 +735,11 @@ case EESMRCmdAcceptMR: // Accept received MR case EESMRCmdTentativeMR: // Tentatively accept MR case EESMRCmdDeclineMR: // Decline MR - { - if ( entry.IsRecurrentEventL() ) - { - entry.SetModifyingRuleL(MESMRCalEntry::EESMRAllInSeries); - } - - entry.ConfirmEntryL(); - iTaskExt->SendAndStoreResponseL(command,entry ); - - if ( entry.IsOpenedFromMail() ) - { - // Triggering mail delete command also - needToProcessOutputParams = EFalse; - iCallback.ProcessCommandL( EESMRCmdMailDelete ); - } + entry.ConfirmEntryL(); + iTaskExt->SendAndStoreResponseL( + command, + entry ); } break; @@ -382,14 +754,6 @@ } break; - case EESMRCmdSaveMR: // Saves MR - { - iTaskExt->StoreMRToLocalDBL( - command, - entry ); - } - break; - case EESMRCmdDeleteMR: // Deletes MR case EESMRCmdRemoveFromCalendar: // Removes MR from calendar case EESMRCmdMailDelete: // Mail specific delete command @@ -413,35 +777,24 @@ } break; - case EESMRCmdEdit: // Edit MR - case EESMRCmdEditLocal: // Locally edit meeting request - { - iEntryProcessor->SwitchToEditL(); - iPolicyMgr->PushPolicyL(); - LaunchUIL(); - - // No need to process parameters because the view is closed - // and editing view has processed to parameters - needToProcessOutputParams = EFalse; - iPolicyMgr->PopPolicy(); - iEntryProcessor->SwitchToViewL(); - } - break; case EESMRCmdViewTrack: { TESMRViewMode viewMode = iEntryProcessor->ScenarioData().iViewMode; - iEntryProcessor->SwitchToTrackL(); + // iEntryProcessor->SwitchToTrackL(); + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeTrack ); iPolicyMgr->PushPolicyL(); LaunchUIL(); //go back to original view depending on where we came from if (viewMode == EESMREditMR) { - iEntryProcessor->SwitchToEditL(); + //iEntryProcessor->SwitchToEditL(); + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeEdit ); } else { - iEntryProcessor->SwitchToViewL(); + // iEntryProcessor->SwitchToViewL(); + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeView ); } LaunchUIL(); @@ -450,11 +803,13 @@ break; case EESMRCmdForwardAsMeeting: // Forward MR as meeting { - iEntryProcessor->SwitchToForwardL(); + // iEntryProcessor->SwitchToForwardL(); + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeForward ); iPolicyMgr->PushPolicyL(); LaunchUIL(); iPolicyMgr->PopPolicy(); - iEntryProcessor->SwitchToViewL(); + // iEntryProcessor->SwitchToViewL(); + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeView ); } break; @@ -512,27 +867,16 @@ case EESMRCmdMailMoveMessageToDrafts: case EESMRCmdOpenAttachment: case EESMRCmdOpenAttachmentView: -// case EESMRCmdDownloadManager: { needToProcessOutputParams = EFalse; iCallback.ProcessCommandL( aCommandId ); } break; - - case EESMRCmdEditorInitializationComplete: - { - if ( iCallback.IsCommandAvailable( EESMRCmdEditorInitializationComplete ) ) - { - iCallback.ProcessCommandL( EESMRCmdEditorInitializationComplete ); - } - break; - } default: User::Leave( KErrNotSupported ); @@ -545,8 +889,120 @@ command ); } + return KErrNone; + } - return KErrNone; +// ----------------------------------------------------------------------------- +// CESMRViewerController::ChangeEntryTypeL +// ----------------------------------------------------------------------------- +// +void CESMRViewerController::ChangeEntryTypeL( TInt aCommandId ) + { + TESMRCalendarEventType type = EESMREventTypeNone; + + switch ( aCommandId ) + { + case EMRCommandSwitchToMR: + { + type = EESMREventTypeMeetingRequest; + break; + } + + case EMRCommandSwitchToMeeting: + { + type = EESMREventTypeAppt; + break; + } + + case EMRCommandSwitchToMemo: + { + type = EESMREventTypeEEvent; + break; + } + + case EMRCommandSwitchToAnniversary: + { + type = EESMREventTypeEAnniv; + break; + } + + case EMRCommandSwitchToTodo: + { + type = EESMREventTypeETodo; + break; + } + + default: + { + break; + } + } + + // Original entry is needed for creating new comparative entry + CCalEntry* originalEntry = + ESMRHelper::CopyEntryL( + iEntryProcessor->ESMREntryL().OriginalEntry(), + iEntryProcessor->ESMREntryL().OriginalEntry().MethodL(), + ESMRHelper::ECopyFull ); + + CleanupStack::PushL( originalEntry ); + + // Create a new entry by cloning the existing entry. + // This also does the type conversion and judges what + // entry information will be copied from the old entry + // to the new entry + CCalEntry* newEntry = + iEntryProcessor->ESMREntryL().CloneEntryLC( + MESMRCalEntry::TESMRCalEntryType( type ) ); + + iESMRUtils->CreateExtensionsL( type ); + + iEntryProcessor = + static_cast( + iESMRUtils->ExtensionL( + TUid::Uid( KESMRMREntryProcessorUid ) ) ); + + iPolicyMgr = + static_cast( + iESMRUtils->ExtensionL( + TUid::Uid( KESMRPolicyMgrUid ) ) ); + + iTaskExt = + static_cast( + iESMRUtils->ExtensionL( + TUid::Uid( KESMRTaskExtensionUid ) ) ); + + // Process entry + iEntryProcessor->ResetL(); + iEntryProcessor->ProcessL( &iInParams, *newEntry, EFalse, ETrue ); + + if ( iInParams.iEditorMode == MAgnEntryUi::EViewEntry ) + { + // If user has been viewing original entry, switch processor to editor. + iEntryProcessor->SwitchProcessorToModeL( EMRProcessorModeEdit ); + } + + // Resolve new policy + iPolicyMgr->ResolvePolicyL( iEntryProcessor->ScenarioData(), + iEntryProcessor->ESMREntryL(), + NULL ); + + if ( iCalEntry ) + { + delete iCalEntry; + } + + iCalEntry = newEntry; + CleanupStack::Pop( newEntry ); + newEntry = NULL; + + // Comparative entry needs to be updated also, otherwise + // type changed entry's saving won't function correctly + UpdateComparativeEntryInTypeChangeL( *originalEntry ); + + iEntryProcessor->ESMREntryL().SetTypeChanged( ETrue ); + + CleanupStack::PopAndDestroy( originalEntry ); } // ----------------------------------------------------------------------------- @@ -556,37 +1012,54 @@ void CESMRViewerController::LaunchUIL() { FUNC_LOG; - MESMRMeetingRequestEntry& entry = iEntryProcessor->ESMREntryL(); - iPolicyMgr->ResolvePolicyL( iEntryProcessor->ScenarioData(), - entry, + iEntryProcessor->ESMREntryL(), NULL ); // Passing NULL --> Default policy resolver is used MESMRUiBase* uibase = iGuiFactory->CreateUIL( - &iPolicyMgr->CurrentPolicy(), - entry, + *this, *this ); TInt retValue = uibase->ExecuteViewLD(); - TBool openedFromMail( entry.IsOpenedFromMail() ); - + if ( retValue == EAknCmdExit ) - { - if ( openedFromMail ) - { - // Need to communicate with FS Email how this is - // indicated to FS EMail UI application - } - else - { - CEikAppUi* appUi = - CEikonEnv::Static()->EikAppUi(); // codescanner::eikonenvstatic - // Exit application - static_cast(appUi)->ProcessCommandL(EAknCmdExit); - } - } + { + MESMRCalEntry* calEntry = &iEntryProcessor->ESMREntryL(); + + if( CCalenInterimUtils2::IsMeetingRequestL( calEntry->Entry() ) ) + { + // Cast safe, after we have identified the entry as mr + MESMRMeetingRequestEntry& mrEntry( + *static_cast< MESMRMeetingRequestEntry* >( calEntry ) ); + + if( mrEntry.IsOpenedFromMail() ) + { + CEikAppUi* appUi = + CEikonEnv::Static()->EikAppUi(); // codescanner::eikonenvstatic + // Exit application + static_cast( appUi )->ProcessCommandL( + EAknCmdExit ); + } + else + { + // Let's inform via output parameters that + // exit is desired. + TMROutputParams* outputParams = + reinterpret_cast< TMROutputParams* >( iOutParams.iSpare ); + outputParams->iCommand = EMRDialogOptionsMenuExit; + } + } + else + { + // Let's inform via output parameters that + // exit is desired. + TMROutputParams* outputParams = + reinterpret_cast< TMROutputParams* >( iOutParams.iSpare ); + outputParams->iCommand = EMRDialogOptionsMenuExit; + } + } } // ----------------------------------------------------------------------------- @@ -609,5 +1082,185 @@ } } +// ----------------------------------------------------------------------------- +// CESMRViewerController::UpdateComparativeEntryInTypeChangeL +// ----------------------------------------------------------------------------- +// +void CESMRViewerController::UpdateComparativeEntryInTypeChangeL( + const CCalEntry& aOriginalEntry ) + { + /* + * This is needed because if user creates an entry and only type changes + * the entry, but does not input any data, we cannot save the entry. + */ + + CCalEntry& esmrEntry = iEntryProcessor->ESMREntryL().Entry(); + + TESMRCalendarEventType type = MapType( aOriginalEntry ); + + // Let's create new comparative entry based on the current + // type changed entry + CCalEntry* newComparativeEntry = CreateEntryL( + iCalEntry->EntryTypeL(), + iCalEntry->UidL(), + CCalEntry::EMethodNone, + CalCommon::EThisOnly ); + + CleanupStack::PushL( newComparativeEntry ); + + newComparativeEntry->CopyFromL( *iCalEntry ); + + // New comparative entry needs still data from original entry. + // Use case: + // - User opens entry to editor + // - User changes values + // - User changes entry type + // -> We need to determine if entry values have changed from the original + newComparativeEntry->SetSummaryL( + aOriginalEntry.SummaryL() ); + newComparativeEntry->SetLocationL( + aOriginalEntry.LocationL() ); + newComparativeEntry->SetDescriptionL( + aOriginalEntry.DescriptionL() ); + newComparativeEntry->SetReplicationStatusL( + aOriginalEntry.ReplicationStatusL() ); + + // If original and new entries are both appointments, + // then also start and end times can be copied from original entry + // to comparative entry + if( aOriginalEntry.EntryTypeL() == CCalEntry::EAppt && + esmrEntry.EntryTypeL() == CCalEntry::EAppt ) + { + newComparativeEntry->SetStartAndEndTimeL( + aOriginalEntry.StartTimeL(), + aOriginalEntry.EndTimeL() ); + } + + // Time stamp must be the same as in esmrEntry + newComparativeEntry->SetDTStampL( esmrEntry.DTStampL() ); + + // If neither the original entry, nor the new entry + // are To-do's, we can also copy the priority from + // the original entry, since priority value is then compatible + // between the old and the new entry types + if( aOriginalEntry.EntryTypeL() != CCalEntry::ETodo && + iCalEntry->EntryTypeL() != CCalEntry::ETodo ) + { + newComparativeEntry->SetPriorityL( + aOriginalEntry.PriorityL() ); + } + // One of the entries, original or new, are to-do's, + // so the priority value is not compatible between them. + // we need to convert that + else + { + if( aOriginalEntry.EntryTypeL() == CCalEntry::ETodo ) + { + newComparativeEntry->SetPriorityL( + ConvertTodoPriorityToNormalL( aOriginalEntry ) ); + } + else if( iCalEntry->EntryTypeL() == CCalEntry::ETodo ) + { + newComparativeEntry->SetPriorityL( + ConvertNormalPriorityToTodoL( aOriginalEntry ) ); + } + } + + // If new entry is meeting request, let's also + // copy the same phone owner to the comparative entry + if( iCalEntry->MethodL() == CCalEntry::EMethodRequest ) + { + CCalUser* temp = esmrEntry.OrganizerL(); // Ownership not transfered + CCalUser* organizer = ESMRHelper::CopyUserL( *temp ); + + newComparativeEntry->SetOrganizerL( organizer ); + newComparativeEntry->SetPhoneOwnerL( + newComparativeEntry->OrganizerL() ); + } + + // Attachment information is also needed from original entry + if( aOriginalEntry.AttachmentCountL() == 0 ) + { + // Original entry did not have attachments, so let's + // remove possible attachments from comparative entry also + TInt count = newComparativeEntry->AttachmentCountL(); + + // Attachments need to be deleted in reversed order + for( TInt i = ( count - 1 ); i == 0; --i ) + { + newComparativeEntry->DeleteAttachmentL( + *( newComparativeEntry->AttachmentL( i ) ) ); + } + + // If original entry does have attachments, we do nothing -> + // If original entry has attachments, it has been already saved + // and now type changed, which means that it needs to be saved + // anyway. + } + + iEntryProcessor->ESMREntryL().UpdateComparativeEntry( + newComparativeEntry ); // Takes ownership + + CleanupStack::Pop( newComparativeEntry ); + } + +// ----------------------------------------------------------------------------- +// CESMRViewerController::CancelAndDeleteMRInEntryTypeChangeL +// ----------------------------------------------------------------------------- +// +void CESMRViewerController::CancelAndDeleteMRInEntryTypeChangeL( + CCalEntry& aEntry, MESMRCalDbMgr& aDbMgr ) + { + FUNC_LOG; + // We need new task factor, processor and task extension + // for this temporary MR action. + CESMRTaskFactory* taskFactory = CESMRTaskFactory::NewL( + EESMREventTypeMeetingRequest, + aDbMgr ); + CleanupStack::PushL( taskFactory ); + + CMREntryProcessor* entryProcessor = CMREntryProcessor::NewL( + EESMREventTypeMeetingRequest, + aDbMgr ); + CleanupStack::PushL( entryProcessor ); + + MESMRTaskExtension* taskExtension = + CESMRTaskExtenstionImpl::NewL( *taskFactory ); + CleanupDeletePushL( taskExtension ); + + entryProcessor->ProcessL( &iInParams, aEntry, EFalse, ETrue ); + MESMRCalEntry& entry = entryProcessor->ESMREntryL(); + + // Cast safe, because entry is always MR + MESMRMeetingRequestEntry& mrEntry( + static_cast( entry ) ); + + if ( EESMRRoleOrganizer == mrEntry.RoleL() ) + { + CCalEntry::TStatus status( mrEntry.Entry().StatusL() ); + if ( CCalEntry::ENullStatus != status ) + { + // We are changing entry type from MR to some other type + // And we have sent the MR invitation to attendees. + // We provide possibility for user to send + // cancellation message to attendees. + mrEntry.MarkMeetingCancelledL(); + + taskExtension->DeleteAndSendMRL( + EESMRCmdDeleteMR, + mrEntry ); + } + else + { + taskExtension->DeleteEntryFromLocalDBL( + EESMRCmdDeleteMR, + mrEntry ); + } + } + + CleanupStack::PopAndDestroy( taskExtension ); + CleanupStack::PopAndDestroy( entryProcessor ); + CleanupStack::PopAndDestroy( taskFactory ); + } + // End of File - diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewercalplugin/data/2001E27E.rss --- a/meetingrequest/mrviewercalplugin/data/2001E27E.rss Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewercalplugin/data/2001E27E.rss Wed Mar 31 21:08:33 2010 +0300 @@ -18,8 +18,7 @@ // INCLUDES #include -#include -#include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber +#include #include "esmrinternaluid.h" // RESOURCE DEFINITIONS @@ -42,7 +41,7 @@ IMPLEMENTATION_INFO { implementation_uid = KESMRViewerCalPluginImplUid3Fs; - version_no = KEmailEcomVersionNumber; + version_no = 1; display_name = ""; default_data = KESMRViewerCalPluginPluginDataFs; opaque_data = ""; diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewercalplugin/group/esmrviewercalplugin.mmp --- a/meetingrequest/mrviewercalplugin/group/esmrviewercalplugin.mmp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewercalplugin/group/esmrviewercalplugin.mmp Wed Mar 31 21:08:33 2010 +0300 @@ -16,9 +16,8 @@ */ -#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../inc/esmrinternaluid.h" #include "../../../inc/emailtraceconfig.hrh" -#include "../../inc/esmrinternaluid.h" #include #include @@ -30,21 +29,23 @@ VENDORID VID_DEFAULT DEFFILE ESMRViewerCalPlugin.def -VERSION KEmailBinaryVersionNumber -KEmailBinaryDemandPaging - SOURCEPATH ../src SOURCE esmrviewermain.cpp SOURCE cesmrviewersimpl.cpp +// USERINCLUDE ../inc USERINCLUDE ../../inc +USERINCLUDE ../../mrcommon/inc USERINCLUDE ../../../inc +// APP_LAYER_SYSTEMINCLUDE SOURCEPATH ../data +// S60 UID update START RESOURCE 2001E27E.rss +// S60 UID update TARGET esmrviewercalplugin.rsc END @@ -55,9 +56,11 @@ LIBRARY eikcore.lib LIBRARY esmrgui.lib LIBRARY calinterimapi.lib -LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE +#if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE ) +LIBRARY flogger.lib +#endif // ENABLE_TRACES && TRACE_INTO_FILE + // End of file + + diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewercalplugin/inc/caleneditorsplugin.h --- a/meetingrequest/mrviewercalplugin/inc/caleneditorsplugin.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewercalplugin/inc/caleneditorsplugin.h Wed Mar 31 21:08:33 2010 +0300 @@ -21,7 +21,7 @@ #include #include -#include +#include /** * Resolver for loading correct ECOM Implementation for diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewercalplugin/inc/cesmrviewersimpl.h --- a/meetingrequest/mrviewercalplugin/inc/cesmrviewersimpl.h Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewercalplugin/inc/cesmrviewersimpl.h Wed Mar 31 21:08:33 2010 +0300 @@ -20,7 +20,7 @@ #define CESMRVIEWERSIMPL_H // INCLUDES -#include +#include #include // FORWARD DECLARATIONS diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/mrviewercalplugin/src/cesmrviewersimpl.cpp --- a/meetingrequest/mrviewercalplugin/src/cesmrviewersimpl.cpp Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/mrviewercalplugin/src/cesmrviewersimpl.cpp Wed Mar 31 21:08:33 2010 +0300 @@ -29,7 +29,7 @@ // From MR Mailbox Utils #include -#include +#include // From System #include @@ -100,30 +100,11 @@ MAgnEntryUiCallback& aCallback) { FUNC_LOG; - TRAPD( err, ExecuteViewInternalL( + return ExecuteViewInternalL( aEntries, aInParams, aOutParams, - aCallback ) ); - - if ( KErrArgument == err ) - { - // ES MR VIEWER controller was unable to show the - // passed meeting request. Let's launc normal meeting viewer - // for showing the entry - - CCalenEditorsPlugin* editorsPlugin = CCalenEditorsPlugin::NewL(); - CleanupStack::PushL( editorsPlugin ); - - err = editorsPlugin->ExecuteViewL( aEntries, - aInParams, - aOutParams, - aCallback ); - - CleanupStack::PopAndDestroy( editorsPlugin ); - } - - return err; + aCallback ); } // ---------------------------------------------------------------------------- diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/rom/mrui.iby --- a/meetingrequest/rom/mrui.iby Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/rom/mrui.iby Wed Mar 31 21:08:33 2010 +0300 @@ -22,22 +22,23 @@ #include #include -// -#ifdef FF_EMAIL_FRAMEWORK -// +#if defined( FF_EMAIL_FRAMEWORK ) && defined ( FF_MEETING_REQUEST_UI ) -// Common MRUI & CalEntryUI Components: +// Common MRUI & Enhanced calendar event UI Components: file=ABI_DIR\BUILD_DIR\esmrpolicy.dll SHARED_LIB_DIR\esmrpolicy.dll file=ABI_DIR\BUILD_DIR\esmrservices.dll SHARED_LIB_DIR\esmrservices.dll file=ABI_DIR\BUILD_DIR\esmrgui.dll SHARED_LIB_DIR\esmrgui.dll file=ABI_DIR\BUILD_DIR\esmrcommon.dll SHARED_LIB_DIR\esmrcommon.dll file=ABI_DIR\BUILD_DIR\esmrdb.dll SHARED_LIB_DIR\esmrdb.dll +file=ABI_DIR\BUILD_DIR\esmrtasks.dll SHARED_LIB_DIR\esmrtasks.dll +file=ABI_DIR\BUILD_DIR\mrguicommon.dll SHARED_LIB_DIR\mrguicommon.dll ECOM_PLUGIN( esmrfieldbuilderplugin.dll, esmrfieldbuilderplugin.rsc ) +ECOM_PLUGIN( mrcmailremoteattachmentplugin.dll, mrcmailremoteattachmentplugin.rsc ) + +file=ABI_DIR\BUILD_DIR\remoteattachment.dll SHARED_LIB_DIR\remoteattachment.dll file=ABI_DIR\BUILD_DIR\esmrfieldbuildercommon.dll SHARED_LIB_DIR\esmrfieldbuildercommon.dll -// file=ABI_DIR\BUILD_DIR\esmrfieldevent.dll SHARED_LIB_DIR\esmrfieldevent.dll -// // Location integration plugin ECOM_PLUGIN( esmrlocationplugin.dll, esmrlocationplugin.rsc ) @@ -45,8 +46,6 @@ // Location URL Parser plugin ECOM_PLUGIN( esmrurlparserplugin.dll, esmrurlparserplugin.rsc ) -data=DATAZ_\RESOURCE_FILES_DIR\esmrurlparserplugindata.rsc RESOURCE_FILES_DIR\esmrurlparserplugindata.rsc - // Common Icon files: data=DATAZ_\BITMAP_DIR\esmrgui.mif BITMAP_DIR\esmrgui.mif @@ -54,42 +53,70 @@ data=DATAZ_\RESOURCE_FILES_DIR\esmrpolicies.rsc RESOURCE_FILES_DIR\esmrpolicies.rsc data=DATAZ_\RESOURCE_FILES_DIR\esmralarminfo.rsc RESOURCE_FILES_DIR\esmralarminfo.rsc -// use common feature flags -#if defined(__MEETING_REQUEST_ENABLER) && defined(FF_MEETING_REQUEST_UI) -// +// *** ECOM plugin +ECOM_PLUGIN( mrprocessorplugin.dll, mrprocessorplugin.rsc ) -// *** ECOM plugin -// remove FF_ES_CAL_MEETING_REQUEST_UI -ECOM_PLUGIN( esmrviewercalplugin.dll, esmrviewercalplugin.rsc ) -ECOM_PLUGIN( esmrutilscalplugin.dll, esmrutilscalplugin.rsc ) -// - ECOM_PLUGIN( esmricalviewer.dll, esmricalviewer.rsc ) ECOM_PLUGIN( esmragnversit2.dll, esmragnversit2.rsc ) ECOM_PLUGIN( esmrfieldbuilderpluginextension.dll, esmrfieldbuilderpluginextension.rsc ) -ECOM_PLUGIN( esmrcasplugin.dll, esmrcasplugin.rsc ) +ECOM_PLUGIN( mrtaskplugin.dll, mrtaskplugin.rsc ) +ECOM_PLUGIN( mrentryresolver.dll, mrentryresolver.rsc ) // MRUI dlls that are also part of the plugins file=ABI_DIR\BUILD_DIR\esmrentry.dll SHARED_LIB_DIR\esmrentry.dll file=ABI_DIR\BUILD_DIR\esmrutils.dll SHARED_LIB_DIR\esmrutils.dll file=ABI_DIR\BUILD_DIR\esmrviewer.dll SHARED_LIB_DIR\esmrviewer.dll -file=ABI_DIR\BUILD_DIR\esmrtasks.dll SHARED_LIB_DIR\esmrtasks.dll file=ABI_DIR\BUILD_DIR\esmrversit2.dll SHARED_LIB_DIR\esmrversit2.dll data=DATAZ_\RESOURCE_FILES_DIR\esmragnversit2strings.rsc RESOURCE_FILES_DIR\esmragnversit2strings.rsc -// Icon files +// MRMBUtilsExtension +ECOM_PLUGIN( mrmbutilsextension.dll, mrmbutilsextension.rsc ) + +// MRUI Calendar integration +#ifdef FF_CAL_MEETING_REQUEST_UI + +// MR Viewers plugin +ECOM_PLUGIN( esmrviewercalplugin.dll, esmrviewercalplugin.rsc ) + +// MR Utils plugin +ECOM_PLUGIN( esmrutilscalplugin.dll, esmrutilscalplugin.rsc ) + +// BC Plugin +ECOM_PLUGIN( mrbcplugin.dll, mrbcplugin.rsc ) + +// BC Meeting request plugin +ECOM_PLUGIN( bcmrevent.dll, bcmrevent.rsc ) +data=DATAZ_\RESOURCE_FILES_DIR\bcmreventplugin.rsc RESOURCE_FILES_DIR\bcmreventplugin.rsc + +// MR Contact action service plugin +ECOM_PLUGIN( esmrcasplugin.dll, esmrcasplugin.rsc ) data=DATAZ_\BITMAP_DIR\esmrcasplugin.mif BITMAP_DIR\esmrcasplugin.mif -#endif // __MEETING_REQUEST_ENABLER && FF_MEETING_REQUEST_UI +// Enhanced calendar event UI +#ifdef FF_ENHANCED_CALENDAR_EVENT_UI + +// BC Calendar event task plugin +ECOM_PLUGIN( mrcaleventtaskplugin.dll, mrcaleventtaskplugin.rsc ) + +// BC Calendar event policy resolver +ECOM_PLUGIN( mrcalentryresolver.dll, mrcalentryresolver.rsc ) -// +data=DATAZ_\RESOURCE_FILES_DIR\bccaleventpolicies.rsc RESOURCE_FILES_DIR\bccaleventpolicies.rsc + +// BC Calendar event entry processor +ECOM_PLUGIN( mrcaleventplugin.dll, mrcaleventplugin.rsc ) + +data=DATAZ_\RESOURCE_FILES_DIR\mrcaleventdata.rsc RESOURCE_FILES_DIR\mrcaleventdata.rsc + +#endif // FF_ENHANCED_CALENDAR_EVENT_UI + +#endif // FF_CAL_MEETING_REQUEST_UI + // Stub sis -//data=ZSYSTEM\install\mrui_stub.sis System\Install\mrui_stub.sis data=ZSYSTEM\install\meetingrequeststub.sis System\Install\meetingrequeststub.sis -// -// -#endif //FF_EMAIL_FRAMEWORK -// + +#endif // FF_EMAIL_FRAMEWORK && FF_MEETING_REQUEST_UI + #endif // MRUI_IBY diff -r 0396474f30f5 -r 4ce476e64c59 meetingrequest/rom/mruiresources.iby --- a/meetingrequest/rom/mruiresources.iby Mon Mar 15 12:39:10 2010 +0200 +++ b/meetingrequest/rom/mruiresources.iby Wed Mar 31 21:08:33 2010 +0300 @@ -22,27 +22,15 @@ #include #include -// -#ifdef FF_EMAIL_FRAMEWORK -// +#if defined( FF_EMAIL_FRAMEWORK ) && defined( FF_MEETING_REQUEST_UI ) -// Common Resources for MRUI and CalEntryUI: +// Common Resources for MRUI and Enhanced Calendar Event UI: data=DATAZ_\RESOURCE_FILES_DIR\esmrgui.rsc RESOURCE_FILES_DIR\esmrgui.rsc -// -//#if defined(__MEETING_REQUEST_ENABLER) && defined(FF_ES_MEETING_REQUEST_UI) -// - // Resource files data=DATAZ_\RESOURCE_FILES_DIR\esmrtasks.rsc RESOURCE_FILES_DIR\esmrtasks.rsc data=DATAZ_\RESOURCE_FILES_DIR\esmrcasplugindata.rsc RESOURCE_FILES_DIR\esmrcasplugindata.rsc -// -//#endif // __MEETING_REQUEST_ENABLER && FF_ES_MEETING_REQUEST_UI -// - -// -#endif //FF_EMAIL_FRAMEWORK -// +#endif // FF_EMAIL_FRAMEWORK && FF_MEETING_REQUEST_UI #endif // MRUIRESOURCES_IBY diff -r 0396474f30f5 -r 4ce476e64c59 package_definition.xml --- a/package_definition.xml Mon Mar 15 12:39:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -