diff --git a/aif/MMS_Itaif.rss b/aif/MMS_Itaif.rss new file mode 100644 index 0000000..8032370 --- /dev/null +++ b/aif/MMS_Itaif.rss @@ -0,0 +1,23 @@ +/* +* ============================================================================ +* Name : MMS_Itaif.rss +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* RSS for creating the aif file for MMS_It. +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2004 +* ============================================================================ +*/ + +#include + +RESOURCE AIF_DATA + { + app_uid=0x0767A5B9; // please request a UID from Symbian + num_icons=2; + embeddability=KAppNotEmbeddable; + newfile=KAppDoesNotSupportNewFile; + } + +// End of File diff --git a/aif/context_pane_icon.bmp b/aif/context_pane_icon.bmp new file mode 100644 index 0000000..68b205f Binary files /dev/null and b/aif/context_pane_icon.bmp differ diff --git a/aif/context_pane_icon_mask.bmp b/aif/context_pane_icon_mask.bmp new file mode 100644 index 0000000..33d50ad Binary files /dev/null and b/aif/context_pane_icon_mask.bmp differ diff --git a/aif/list_icon.bmp b/aif/list_icon.bmp new file mode 100644 index 0000000..103433e Binary files /dev/null and b/aif/list_icon.bmp differ diff --git a/aif/list_icon_mask.bmp b/aif/list_icon_mask.bmp new file mode 100644 index 0000000..582f558 Binary files /dev/null and b/aif/list_icon_mask.bmp differ diff --git a/data/MMS_It.rss b/data/MMS_It.rss new file mode 100644 index 0000000..f67ffa3 --- /dev/null +++ b/data/MMS_It.rss @@ -0,0 +1,577 @@ +/* +* ============================================================================ +* Name : MMS_It.rss +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This file contains resources for the MMS_It. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// RESOURCE IDENTIFIER +NAME AWIZ // 4 letter ID + +CHARACTER_SET UTF8 + +// INCLUDES + +#include +#include "mms_it.hrh" +#include "mms_it.loc" +#include +#include +#include + +// for common dialogs +#include +#include + +// CONSTANTS +//#define ?constant ?value + + +// MACROS +//#define ?macro + + +// RESOURCE DEFINITIONS + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="MMS_It"; } + +RESOURCE EIK_APP_INFO + { + status_pane = r_mms_it_status_pane; + } + + +RESOURCE TBUF r_mms_it_help + { + buf=qtn_help; + } + +RESOURCE TBUF r_mms_it_help_about + { + buf=qtn_help_about; + } + +RESOURCE TBUF r_message_sent + { + buf=qtn_message_sent; + } + +RESOURCE TBUF r_file_not_found + { + buf=qtn_file_not_found; + } + +RESOURCE TBUF r_no_attachments + { + buf=qtn_no_attachments; + } + +RESOURCE TBUF r_attachment_not_found + { + buf=qtn_attachment_not_found; + } + +RESOURCE TBUF r_smil_attachment_not_found + { + buf=qtn_smil_attachment_not_found; + } + + +RESOURCE TBUF r_set_root + { + buf=qtn_set_root; + } + +RESOURCE TBUF r_remove_attachment + { + buf=qtn_remove_attachment ; + } + +RESOURCE TBUF r_default_mime_type + { + buf=qtn_default_mime_type ; + } + +RESOURCE TBUF r_att + { + buf=qtn_att ; + } + +RESOURCE TBUF r_nothing_attached + { + buf=qtn_nothing_attached ; + } + +RESOURCE TBUF r_no_subject + { + buf=qtn_no_subject ; + } + +RESOURCE TBUF r_no_smil + { + buf=qtn_no_smil ; + } + + +//---------------------------------------------------- +// +// r_mms_it_hotkeys +// ?description +// +//---------------------------------------------------- +// +RESOURCE HOTKEYS r_mms_it_hotkeys + { + control= + { + HOTKEY { command=EAknCmdExit; key='e'; } + }; + } + +//---------------------------------------------------- +// +// r_mms_it_view1 +// ?description +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_mms_it_view1 + { + hotkeys=r_mms_it_hotkeys; + menubar=r_mms_it_menubar_view1; + cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT; + } + +//---------------------------------------------------- +// +// r_mms_it_menubar_view1 +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_mms_it_menubar_view1 + { + titles= + { + MENU_TITLE { menu_pane=r_mms_it_app_menu; txt="App"; }, + MENU_TITLE { menu_pane=r_mms_it_view1_menu; txt="View"; } + }; + } + +//---------------------------------------------------- +// +// r_mms_it_view1_menu +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_mms_it_view1_menu + { + items= + { + }; + } + +//---------------------------------------------------- +// +// r_mms_it_view2 +// ?description +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_mms_it_view2 + { + hotkeys=r_mms_it_hotkeys; + menubar=r_mms_it_menubar_view2; + cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT; + } + +//---------------------------------------------------- +// +// r_mms_it_menubar_view2 +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_mms_it_menubar_view2 + { + titles= + { + MENU_TITLE { menu_pane=r_mms_it_app_menu; txt="App"; }, + MENU_TITLE { menu_pane=r_mms_it_view2_menu; txt="View"; } + }; + } + +//---------------------------------------------------- +// +// r_mms_it_view2_menu +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_mms_it_view2_menu + { + items= + { + MENU_ITEM { command=EShowAttachments; txt = qtn_show_attachments; }, + MENU_ITEM { command=ESend; txt = qtn_send; }, + MENU_ITEM { command=EDoNothing; txt = qtn_advanced; + cascade = r_mms_it_advanced;} + }; + } + +RESOURCE MENU_PANE r_mms_it_advanced + { + items= + { + MENU_ITEM { command=EEditSubject; txt = qtn_edit_subject; }, + MENU_ITEM { command=ERemoveSubject; txt = qtn_remove_subject; }, + MENU_ITEM { command=ESetSMILRoot; txt = qtn_set_smil_root;}, + MENU_ITEM { command=ESetDefaultSMIL; txt = qtn_set_default_smil;}, + MENU_ITEM { command=ESendwManualAddr; txt = qtn_send_w_manual_addr;} + }; + } + +//---------------------------------------------------- +// +// r_mms_it_view3 +// ?description +// +//---------------------------------------------------- +// +RESOURCE AVKON_VIEW r_mms_it_view3 + { + hotkeys=r_mms_it_hotkeys; + menubar=r_mms_it_menubar_view3; + cba=R_AVKON_SOFTKEYS_OPTIONS_BACK; + } + +//---------------------------------------------------- +// +// r_mms_it_menubar_view3 +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_mms_it_menubar_view3 + { + titles= + { + MENU_TITLE { menu_pane=r_mms_it_app_menu; txt="App"; }, + MENU_TITLE { menu_pane=r_mms_it_view3_menu; txt="View"; } + }; + } + +//---------------------------------------------------- +// +// r_mms_it_view3_menu +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_mms_it_view3_menu + { + items= + { + MENU_ITEM { command=EAddAttachment; txt = qtn_add_attachment; }, + MENU_ITEM { command=ERemoveAttachment; txt = qtn_remove_attachment;}, + MENU_ITEM { command=ERemoveAllAttachments; txt = qtn_remove_all;}, + MENU_ITEM { command=EDoNothing; txt = qtn_advanced; + cascade = r_mms_it_attach_advanced;}, + MENU_ITEM { command=EShowBody; txt = qtn_show_body; }, + MENU_ITEM { command=ESend; txt = qtn_send; } + }; + } + +RESOURCE MENU_PANE r_mms_it_attach_advanced + { + items= + { + MENU_ITEM { command=EEditMime; txt = qtn_edit_mime; }, + MENU_ITEM { command=ESetDefaultMime; txt = qtn_set_default_mime; }, + MENU_ITEM { command=EDoNothing; txt = qtn_img_mime; + cascade = r_mms_it_img_mime;}, + MENU_ITEM { command=EDoNothing; txt = qtn_snd_mime; + cascade = r_mms_it_snd_mime;}, + MENU_ITEM { command=EDoNothing; txt = qtn_vid_mime; + cascade = r_mms_it_vid_mime;}, + MENU_ITEM { command=EAddAttachmentManually; txt = qtn_add_attachment_manually; } + }; + } + +RESOURCE MENU_PANE r_mms_it_img_mime + { + items= + { + MENU_ITEM { command=EMIMEImgJpeg; txt = "image/jpeg";}, + MENU_ITEM { command=EMIMEImgPng; txt = "image/png"; }, + MENU_ITEM { command=EMIMEImgGif; txt = "image/gif"; } + }; + } + +RESOURCE MENU_PANE r_mms_it_snd_mime + { + items= + { + MENU_ITEM { command=EMIMEAudMidi; txt = "audio/midi"; }, + MENU_ITEM { command=EMIMEAudSPMidi; txt = "audio/sp-midi";}, + MENU_ITEM { command=EMIMEAudAMR; txt = "audio/amr"; }, + MENU_ITEM { command=EMIMEAudMpeg; txt = "audio/mpeg"; } + }; + } + +RESOURCE MENU_PANE r_mms_it_vid_mime + { + items= + { + MENU_ITEM { command=EMIMEVid3GPP; txt = "video/3gpp"; }, + MENU_ITEM { command=EMIMEVidMpeg; txt = "video/mpeg";} + }; + } + +//---------------------------------------------------- +// +// r_mms_it_app_menu +// ?description +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_mms_it_app_menu + { + items= + { + MENU_ITEM { command=ENewMessage; txt = qtn_new_message; }, + MENU_ITEM { command=EDisplayHelp; txt = qtn_help_about; }, + MENU_ITEM { command=EExit; txt=qtn_help_exit; } + }; + } + +RESOURCE STATUS_PANE_APP_MODEL r_mms_it_status_pane + { + panes= + { + SPANE_PANE + { + id = EEikStatusPaneUidNavi; + type = EAknCtNaviPane; + resource = r_mms_it_navi_decorator; + } + }; + } + +//---------------------------------------------------- +// +// r_mms_it_navi_decorator +// ?description +// +//---------------------------------------------------- +// +RESOURCE NAVI_DECORATOR r_mms_it_navi_decorator + { + type = ENaviDecoratorControlNone; + } + +RESOURCE DIALOG r_message_query + { + flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + control = AVKON_HEADING + { + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY + { + }; + } + }; + } + +RESOURCE DIALOG r_mms_it_tel_number_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + label = qtn_enter_recipient; + control = EDWIN + { + flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; + maxlength = 100; + width = 5; + lines = 1; + }; + }; + } + }; + + } + +RESOURCE DIALOG r_mms_it_file_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + label = qtn_enter_filename; + control = EDWIN + { + flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; + maxlength = 255; + width = 5; + lines = 1; + }; + }; + } + }; + + } + +RESOURCE DIALOG r_mms_it_mime_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + label = qtn_enter_mimetype; + control = EDWIN + { + flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable | EEikEdwinOnlyASCIIChars; + avkon_flags = EAknEditorFlagNoT9 | EAknEditorFlagLatinInputModesOnly ; + maxlength = 40; + width = 5; + lines = 1; + }; + }; + } + }; + + } + +RESOURCE DIALOG r_mms_it_subject_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + label = qtn_enter_subject; + control = EDWIN + { + flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; + maxlength = 100; + width = 5; + lines = 1; + }; + }; + } + }; + + } + +RESOURCE DIALOG r_mms_it_smil_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_OK_CANCEL; + items= + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control= AVKON_DATA_QUERY + { + layout = EDataLayout; + label = qtn_enter_smil; + control = EDWIN + { + flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; + maxlength = 255; + width = 5; + lines = 1; + }; + }; + } + }; + + } + + +RESOURCE FILESELECTIONDIALOG r_file_selection_dialog +{ + title = qtn_select_file; + /*root_path = "C:\\nokia\\"; + default_folder = "C:\\nokia\\images\\"; + filters = + { + FILTER + { + filter_type = EFilenameFilter; + filter_style = EInclusiveFilter; + filter_data = {"*.jpg", "*.gif", "*.bmp"}; + } + };*/ +} + +RESOURCE DIALOG r_mms_it_confirm_exit_dialog + { + flags = EGeneralQueryFlags; + buttons = R_AVKON_SOFTKEYS_YES_NO; + items = + { + DLG_LINE + { + type = EAknCtQuery; + id = EGeneralQuery; + control = AVKON_CONFIRMATION_QUERY + { + layout = EConfirmationQueryLayout; + label = qtn_confirm_exit; + }; + } + }; + } + +// End of File diff --git a/data/MMS_It_caption.rss b/data/MMS_It_caption.rss new file mode 100644 index 0000000..7c4697d --- /dev/null +++ b/data/MMS_It_caption.rss @@ -0,0 +1,20 @@ +/* +* ============================================================================ +* Name : MMS_It_caption.rss +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* Caption file for MMS_It. +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#include "mms_it.loc" +#include + +RESOURCE CAPTION_DATA +{ + caption=qtn_app_caption_string; + shortcaption=qtn_app_short_caption_string; +} diff --git a/doc/MMS It documentation (greek).pdf b/doc/MMS It documentation (greek).pdf new file mode 100644 index 0000000..db44caf Binary files /dev/null and b/doc/MMS It documentation (greek).pdf differ diff --git a/group/s60v1/MMS_It.mmp b/group/s60v1/MMS_It.mmp new file mode 100644 index 0000000..d4ff5ea --- /dev/null +++ b/group/s60v1/MMS_It.mmp @@ -0,0 +1,97 @@ +/* +* ============================================================================ +* Name : MMS_It.mmp +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This is the project specification file for MMS_It. +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +TARGET MMS_It.app +TARGETTYPE app +UID 0x100039CE 0x0767A5B9 // please request a UID from Symbian +TARGETPATH \system\apps\MMS_It + +MACRO SERIES_60_V1 + +SOURCEPATH ..\..\src +SOURCE MMS_ItApp.cpp +SOURCE MMS_ItAppUi.cpp +SOURCE MMS_ItDocument.cpp +SOURCE MMS_ItContainer.cpp +SOURCE MMS_ItContainer2.cpp +SOURCE MMS_ItContainer3.cpp +SOURCE MMS_ItView.cpp +SOURCE MMS_ItView2.cpp +SOURCE MMS_ItView3.cpp +SOURCE MMS_ItAttachment.cpp + +RESOURCE ..\data\MMS_It.rss +RESOURCE ..\data\MMS_It_caption.rss +LANG 01 54 + +USERINCLUDE . ..\..\inc + +SYSTEMINCLUDE . \epoc32\include + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY avkon.lib +LIBRARY msgs.lib +LIBRARY commonengine.lib +LIBRARY commondialogs.lib +LIBRARY bafl.lib +LIBRARY fbscli.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY pbkeng.lib +LIBRARY PbkView.lib + +START BITMAP MMS_It.mbm +HEADER +SOURCEPATH ..\..\img +SOURCE c24 pic.bmp +SOURCE c24 msg.bmp +SOURCE 1 msgm.bmp +SOURCE c24 sound.bmp +SOURCE 1 soundm.bmp +SOURCE c24 video.bmp +SOURCE 1 videom.bmp +SOURCE c24 img.bmp +SOURCE 1 imgm.bmp +SOURCE c24 install.bmp +SOURCE 1 installm.bmp +SOURCE c24 mod.bmp +SOURCE 1 modm.bmp +SOURCE c24 subject.bmp +SOURCE c24 smil.bmp +SOURCE c24 attach.bmp +END + +START WINS +// ?wins_specific_information +END + +START MARM +// ?marm_specific_information +END + +// Other possible keywords: +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCEPATH ?source_path +SOURCE ?color_depth ?source_bitmap_list +END +*/ +// DEFFILE ?filename + +AIF MMS_It.aif ..\..\aif MMS_Itaif.rss c8 context_pane_icon.bmp context_pane_icon_mask.bmp list_icon.bmp list_icon_mask.bmp + diff --git a/group/s60v1/bld.inf b/group/s60v1/bld.inf new file mode 100644 index 0000000..04fea6f --- /dev/null +++ b/group/s60v1/bld.inf @@ -0,0 +1,63 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This file provides the information required for building the +* whole of a MMS_It. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS ARMI ARM4 THUMB so you can ignore this if you just build these + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in \epoc32\include +// Example: +/* +\agnmodel\inc\AGMCOMON.H +*/ + +PRJ_MMPFILES +// Specify the .mmp files required for building the important component +// releasables. Note that you should specify any .mmp files for test +// programs further down the file. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released to the rest of the company +// specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +\agnmodel\group\agnmodel.mmp +#if defined(MARM) +\agnmodel\group\agsvexe.mmp +#endif +*/ + +\SYMBIAN\PROJECTS\MMS_It\group\s60v1\MMS_It.mmp + +PRJ_TESTMMPFILES +// specify the .mmp files required for building any test programs here +// +// You can specify "manual" to denote that a test should be listed in a +// generated batch file for running a group of tests +// which require user input during testing. +// You can specify "support" to denote that a file is a test support file +// and shouldn't be listed in a batch file for running a group of tests +// By default, each test will be listed in a batch file for running a group +// of tests which can be left to run without requiring watching over +// by the person running the tests, i.e. tests where no user +// input is required. The default will apply if neither "manual" +// or "support" is specified. +// Example: +/* +\agnmodel\agtest\T_ATTEND.MMP manual +*/ diff --git a/group/s60v2/MMS_It.mmp b/group/s60v2/MMS_It.mmp new file mode 100644 index 0000000..814a283 --- /dev/null +++ b/group/s60v2/MMS_It.mmp @@ -0,0 +1,97 @@ +/* +* ============================================================================ +* Name : MMS_It.mmp +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This is the project specification file for MMS_It. +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +TARGET MMS_It.app +TARGETTYPE app +UID 0x100039CE 0x0767A5B9 // please request a UID from Symbian +TARGETPATH \system\apps\MMS_It + +MACRO SERIES_60_V2 + +SOURCEPATH ..\..\src +SOURCE MMS_ItApp.cpp +SOURCE MMS_ItAppUi.cpp +SOURCE MMS_ItDocument.cpp +SOURCE MMS_ItContainer.cpp +SOURCE MMS_ItContainer2.cpp +SOURCE MMS_ItContainer3.cpp +SOURCE MMS_ItView.cpp +SOURCE MMS_ItView2.cpp +SOURCE MMS_ItView3.cpp +SOURCE MMS_ItAttachment.cpp + +RESOURCE ..\data\MMS_It.rss +RESOURCE ..\data\MMS_It_caption.rss +LANG 01 54 + +USERINCLUDE . ..\..\inc + +SYSTEMINCLUDE . \epoc32\include + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY avkon.lib +LIBRARY msgs.lib +LIBRARY commonengine.lib +LIBRARY commondialogs.lib +LIBRARY bafl.lib +LIBRARY fbscli.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY pbkeng.lib +LIBRARY PbkView.lib + +START BITMAP MMS_It.mbm +HEADER +SOURCEPATH ..\..\img +SOURCE c24 pic.bmp +SOURCE c24 msg.bmp +SOURCE 1 msgm.bmp +SOURCE c24 sound.bmp +SOURCE 1 soundm.bmp +SOURCE c24 video.bmp +SOURCE 1 videom.bmp +SOURCE c24 img.bmp +SOURCE 1 imgm.bmp +SOURCE c24 install.bmp +SOURCE 1 installm.bmp +SOURCE c24 mod.bmp +SOURCE 1 modm.bmp +SOURCE c24 subject.bmp +SOURCE c24 smil.bmp +SOURCE c24 attach.bmp +END + +START WINS +// ?wins_specific_information +END + +START MARM +// ?marm_specific_information +END + +// Other possible keywords: +/* +START BITMAP ?target +TARGETPATH ?emulated_path_on_target_machine +HEADER +SOURCEPATH ?source_path +SOURCE ?color_depth ?source_bitmap_list +END +*/ +// DEFFILE ?filename + +AIF MMS_It.aif ..\..\aif MMS_Itaif.rss c8 context_pane_icon.bmp context_pane_icon_mask.bmp list_icon.bmp list_icon_mask.bmp + diff --git a/group/s60v2/bld.inf b/group/s60v2/bld.inf new file mode 100644 index 0000000..7436a4b --- /dev/null +++ b/group/s60v2/bld.inf @@ -0,0 +1,63 @@ +/* +* ============================================================================ +* Name : bld.inf +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This file provides the information required for building the +* whole of a MMS_It. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + + +PRJ_PLATFORMS +// specify the platforms your component needs to be built for here +// defaults to WINS ARMI ARM4 THUMB so you can ignore this if you just build these + +PRJ_EXPORTS +// Specify the source file followed by its destination here +// copy will be used to copy the source file to its destination +// If there's no destination then the source file will be copied +// to the same name in \epoc32\include +// Example: +/* +\agnmodel\inc\AGMCOMON.H +*/ + +PRJ_MMPFILES +// Specify the .mmp files required for building the important component +// releasables. Note that you should specify any .mmp files for test +// programs further down the file. +// +// Specify "tidy" if the component you need to build doesn't need to be +// released to the rest of the company +// specify "ignore" if the MMP file exists but should be +// ignored. +// Example: +/* +\agnmodel\group\agnmodel.mmp +#if defined(MARM) +\agnmodel\group\agsvexe.mmp +#endif +*/ + +\SYMBIAN\PROJECTS\MMS_It\group\s60v2\MMS_It.mmp + +PRJ_TESTMMPFILES +// specify the .mmp files required for building any test programs here +// +// You can specify "manual" to denote that a test should be listed in a +// generated batch file for running a group of tests +// which require user input during testing. +// You can specify "support" to denote that a file is a test support file +// and shouldn't be listed in a batch file for running a group of tests +// By default, each test will be listed in a batch file for running a group +// of tests which can be left to run without requiring watching over +// by the person running the tests, i.e. tests where no user +// input is required. The default will apply if neither "manual" +// or "support" is specified. +// Example: +/* +\agnmodel\agtest\T_ATTEND.MMP manual +*/ diff --git a/img/attach.bmp b/img/attach.bmp new file mode 100644 index 0000000..5fe6830 Binary files /dev/null and b/img/attach.bmp differ diff --git a/img/img.bmp b/img/img.bmp new file mode 100644 index 0000000..96f0704 Binary files /dev/null and b/img/img.bmp differ diff --git a/img/imgm.bmp b/img/imgm.bmp new file mode 100644 index 0000000..c839ce7 Binary files /dev/null and b/img/imgm.bmp differ diff --git a/img/install.bmp b/img/install.bmp new file mode 100644 index 0000000..46e1fc5 Binary files /dev/null and b/img/install.bmp differ diff --git a/img/installm.bmp b/img/installm.bmp new file mode 100644 index 0000000..70d6e63 Binary files /dev/null and b/img/installm.bmp differ diff --git a/img/mod.bmp b/img/mod.bmp new file mode 100644 index 0000000..4daf715 Binary files /dev/null and b/img/mod.bmp differ diff --git a/img/modm.bmp b/img/modm.bmp new file mode 100644 index 0000000..aee879b Binary files /dev/null and b/img/modm.bmp differ diff --git a/img/msg.bmp b/img/msg.bmp new file mode 100644 index 0000000..616e508 Binary files /dev/null and b/img/msg.bmp differ diff --git a/img/msgm.bmp b/img/msgm.bmp new file mode 100644 index 0000000..7431a1f Binary files /dev/null and b/img/msgm.bmp differ diff --git a/img/pic.bmp b/img/pic.bmp new file mode 100644 index 0000000..19c52ae Binary files /dev/null and b/img/pic.bmp differ diff --git a/img/smil.bmp b/img/smil.bmp new file mode 100644 index 0000000..344d976 Binary files /dev/null and b/img/smil.bmp differ diff --git a/img/sound.bmp b/img/sound.bmp new file mode 100644 index 0000000..1e87f75 Binary files /dev/null and b/img/sound.bmp differ diff --git a/img/soundm.bmp b/img/soundm.bmp new file mode 100644 index 0000000..5e48bb6 Binary files /dev/null and b/img/soundm.bmp differ diff --git a/img/subject.bmp b/img/subject.bmp new file mode 100644 index 0000000..b06dbe5 Binary files /dev/null and b/img/subject.bmp differ diff --git a/img/video.bmp b/img/video.bmp new file mode 100644 index 0000000..2bb3047 Binary files /dev/null and b/img/video.bmp differ diff --git a/img/videom.bmp b/img/videom.bmp new file mode 100644 index 0000000..a605312 Binary files /dev/null and b/img/videom.bmp differ diff --git a/inc/MMS_ItApp.h b/inc/MMS_ItApp.h new file mode 100644 index 0000000..63e8a99 --- /dev/null +++ b/inc/MMS_ItApp.h @@ -0,0 +1,51 @@ +/* +* ============================================================================ +* Name : CMMS_ItApp from MMS_ItApp.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* Declares main application class. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITAPP_H +#define MMS_ITAPP_H + +// INCLUDES +#include + +// CONSTANTS +// UID of the application +const TUid KUidMMS_It = { 0x0767A5B9 }; // please request a UID from Symbian + +// CLASS DECLARATION + +/** +* CMMS_ItApp application class. +* Provides factory to create concrete document object. +* +*/ +class CMMS_ItApp : public CAknApplication + { + + public: // Functions from base classes + private: + + /** + * From CApaApplication, creates CMMS_ItDocument document object. + * @return A pointer to the created document object. + */ + CApaDocument* CreateDocumentL(); + + /** + * From CApaApplication, returns application's UID (KUidMMS_It). + * @return The value of KUidMMS_It. + */ + TUid AppDllUid() const; + }; + +#endif + +// End of File + diff --git a/inc/MMS_ItAppUi.h b/inc/MMS_ItAppUi.h new file mode 100644 index 0000000..c7f4f6b --- /dev/null +++ b/inc/MMS_ItAppUi.h @@ -0,0 +1,121 @@ +/* +* ============================================================================ +* Name : CMMS_ItAppUi from MMS_ItAppUi.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* Declares UI class for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITAPPUI_H +#define MMS_ITAPPUI_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include + +// MMS +#include // for MMsvSessionObserver +#include // for CMmsClientMtm + +// FORWARD DECLARATIONS +class CClientMtmRegistry; +class CMMS_ItView; +class CMMS_ItView2; +class CMMS_ItView3; +class CMMS_ItDocument; + + +// CONSTANTS +//const ?type ?constant_var = ?constant; + + +// CLASS DECLARATION + +/** +* Application UI class. +* Provides support for the following features: +* - EIKON control architecture +* - view architecture +* - status pane +* +*/ +class CMMS_ItAppUi : public CAknViewAppUi, public MMsvSessionObserver + { + public: // Constructors and destructor + + CMMS_ItAppUi(CMMS_ItDocument *aDocument); + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CMMS_ItAppUi(); + + public: // New functions + + void ShowDefaultNaviPaneL(); + + void ShowAtNaviPanelL(TPtrC message); + + public: // Functions from base classes + + /** + * From CEikAppUi, takes care of command handling. + * @param aCommand command to be handled + */ + void HandleCommandL(TInt aCommand); + + private: + + /** + * From CEikAppUi, handles key events. + * @param aKeyEvent Event to handled. + * @param aType Type of the key event. + * @return Response code (EKeyWasConsumed, EKeyWasNotConsumed). + */ + virtual TKeyResponse HandleKeyEventL( + const TKeyEvent& aKeyEvent,TEventCode aType); + + // From MEikMenuObserver + void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); + + // from MMsvSessionObserver + void HandleSessionEventL + (TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); + + void CompleteConstructL(); + + TBool SendMessageL(TBool aUsePbForAddresses = ETrue); + + private: //Data + CAknNavigationControlContainer* iNaviPane; + CAknNavigationDecorator* iNaviDecorator; + + CMMS_ItView* iView1; + CMMS_ItView2* iView2; + CMMS_ItView3* iView3; + + /*! @var iDocument The current document */ + CMMS_ItDocument* iDocument; + + + CMsvSession* iSession; // Client session on the message server + CMmsClientMtm* iMmsMtm; // Message Type Module (MMS) + CClientMtmRegistry* iMtmReg; // Mtm client registry for creating new mtms + }; + +#endif + +// End of File diff --git a/inc/MMS_ItAttachment.h b/inc/MMS_ItAttachment.h new file mode 100644 index 0000000..cf990a8 --- /dev/null +++ b/inc/MMS_ItAttachment.h @@ -0,0 +1,53 @@ +/* +* ============================================================================ +* Name : TMMS_ItAttachment from MMS_ItAttachment.h +* Part of : MMS_It +* Created : 23/10/2004 by Makidis Michael +* Description: +* Declares the attachment type of the application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITATTACHMENT_H +#define MMS_ITATTACHMENT_H + +// INCLUDES +#include + +// CONSTANTS + +// FORWARD DECLARATIONS + +// CLASS DECLARATION + +/** +* TMMS_ItAttachment class. +*/ +class TMMS_ItAttachment + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + TMMS_ItAttachment(); + + + public: + TFileName iFilename; + TBuf8<40> iMIMEType; + TBool iMIMETypeSet; + TInt iSize; + + protected: // New functions + + protected: // Functions from base classes + + private: + + }; + +#endif + +// End of File + diff --git a/inc/MMS_ItContainer.h b/inc/MMS_ItContainer.h new file mode 100644 index 0000000..d07e5d2 --- /dev/null +++ b/inc/MMS_ItContainer.h @@ -0,0 +1,100 @@ +/* +* ============================================================================ +* Name : CMMS_ItContainer from MMS_ItContainer.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* Declares container control for application. +* Copyright: Makidis Michael 2003-2004 +* ============================================================================ +*/ + +#ifndef MMS_ITCONTAINER_H +#define MMS_ITCONTAINER_H + +// INCLUDES +#include +#include // for bitmap +#include "MMS_ItAttachment.h" + + +// CLASS DECLARATION +class CMMS_ItAppUi; + +/** +* CMMS_ItContainer container control class. +* +*/ +class CMMS_ItContainer : public CCoeControl, MCoeControlObserver + { + public: // Constructors and destructor + + CMMS_ItContainer(CMMS_ItAppUi* aUI); + + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect); + + /** + * Destructor. + */ + ~CMMS_ItContainer(); + + public: // Functions from base classes + /** + * From CoeControl, OfferKeyEventL. + * Handles the key-events. + * @return If key-event is consumed, EKeyWasConsumed. Else + * EKeyWasNotConsumed. + * @param aKeyEvent Key event. + * @param aType Type of key event(EEventKey, EEventKeyUp or + * EEventKeyDown). + */ + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + /** + * From ?base_class ?member_description + */ + // event handling section + // e.g Listbox events + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); + + void LoadBitmapL(CFbsBitmap* aBitMap,const TDesC& aFileName,TInt aId,TBool aShareIfLoaded); + + public: // new functions + + private: //data + + CMMS_ItAppUi* iUI; + CFbsBitmap* iBitmap; + }; + +#endif + +// End of File diff --git a/inc/MMS_ItContainer2.h b/inc/MMS_ItContainer2.h new file mode 100644 index 0000000..94f2691 --- /dev/null +++ b/inc/MMS_ItContainer2.h @@ -0,0 +1,120 @@ +/* +* ============================================================================ +* Name : CMMS_ItContainer2 from MMS_ItContainer2.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Description: +* Declares container control for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITCONTAINER2_H +#define MMS_ITCONTAINER2_H + +// INCLUDES +#include +#include // for bitmap + +// FORWARD DECLARATIONS +class CEikLabel; // for labels +class CEikEdwin; // for editor +class CMMS_ItAppUi; +class CMMS_ItDocument; + + +// CLASS DECLARATION + +/** +* CMMS_ItContainer2 container control class. +* +*/ +class CMMS_ItContainer2 : public CCoeControl, MCoeControlObserver + { + public: // Constructors and destructor + + CMMS_ItContainer2(CMMS_ItAppUi* aUI, CMMS_ItDocument* aDocument); + + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect); + + /** + * Destructor. + */ + ~CMMS_ItContainer2(); + + public: // New functions + + void SaveMessageText(); + + void UpdateLabelsL(); + + void UpdateEditorL(); + + public: // Functions from base classes + /** + * From CoeControl, OfferKeyEventL. + * Handles the key-events. + * @return If key-event is consumed, EKeyWasConsumed. Else + * EKeyWasNotConsumed. + * @param aKeyEvent Key event. + * @param aType Type of key event(EEventKey, EEventKeyUp or + * EEventKeyDown). + */ + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + /** + * From ?base_class ?member_description + */ + // event handling section + // e.g Listbox events + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); + + void LoadBitmapL(CFbsBitmap* aBitMap,const TDesC& aFileName,TInt aId,TBool aShareIfLoaded); + + private: //data + CMMS_ItAppUi* iUI; + + /*! @var iDocument The current document */ + CMMS_ItDocument* iDocument; + + CEikLabel* iLblSubject; + CEikLabel* iLblSmil; + CEikLabel* iLblAttach; + CEikEdwin* iEdwin; + + CFbsBitmap* iPicSubject; + CFbsBitmap* iPicSmil; + CFbsBitmap* iPicAttach; + }; + +#endif + +// End of File diff --git a/inc/MMS_ItContainer3.h b/inc/MMS_ItContainer3.h new file mode 100644 index 0000000..27ec1e5 --- /dev/null +++ b/inc/MMS_ItContainer3.h @@ -0,0 +1,120 @@ +/* +* ============================================================================ +* Name : CMMS_ItContainer3 from MMS_ItContainer3.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Description: +* Declares container control for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITCONTAINER3_H +#define MMS_ITCONTAINER3_H + +// INCLUDES +#include +#include // for the listbox + +// FORWARD DECLARATIONS +class CMMS_ItAppUi; +class CMMS_ItDocument; + +// CLASS DECLARATION + +/** +* CMMS_ItContainer container control class. +* +*/ +class CMMS_ItContainer3 : public CCoeControl, MCoeControlObserver, + public MEikListBoxObserver + { + public: // Constructors and destructor + + CMMS_ItContainer3(CMMS_ItAppUi* aUI, CMMS_ItDocument* aDocument); + + /** + * EPOC default constructor. + * @param aRect Frame rectangle for container. + */ + void ConstructL(const TRect& aRect); + + /** + * Destructor. + */ + ~CMMS_ItContainer3(); + + public: // New functions + + void AddAttachmentL(); + + void AddAttachmentManuallyL(); + + void RemoveAttachmentL(); + + void RemoveAllAttachments(); + + void EditMimeType(); + + void SetMimeTypeL(TDes8& aMimeType); + + void ResetMimeTypeL(); + + void UpdateNaviPanelL(); + + public: // Functions from base classes + /** + * From CoeControl, OfferKeyEventL. + * Handles the key-events. + * @return If key-event is consumed, EKeyWasConsumed. Else + * EKeyWasNotConsumed. + * @param aKeyEvent Key event. + * @param aType Type of key event(EEventKey, EEventKeyUp or + * EEventKeyDown). + */ + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + + private: // Functions from base classes + + /** + * From CoeControl,SizeChanged. + */ + void SizeChanged(); + + /** + * From CoeControl,CountComponentControls. + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl,ComponentControl. + */ + CCoeControl* ComponentControl(TInt aIndex) const; + + /** + * From CCoeControl,Draw. + */ + void Draw(const TRect& aRect) const; + + /** + * From ?base_class ?member_description + */ + // event handling section + // e.g Listbox events + void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); + + void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/){}; + + private: //data + CAknDoubleLargeStyleListBox* iListBox; + CMMS_ItAppUi* iUI; + + /*! @var iDocument The current document */ + CMMS_ItDocument* iDocument; + }; + +#endif + +// End of File diff --git a/inc/MMS_ItDocument.h b/inc/MMS_ItDocument.h new file mode 100644 index 0000000..650b1b5 --- /dev/null +++ b/inc/MMS_ItDocument.h @@ -0,0 +1,124 @@ +/* +* ============================================================================ +* Name : CMMS_ItDocument from MMS_ItDocument.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* Declares document for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITDOCUMENT_H +#define MMS_ITDOCUMENT_H + +// INCLUDES +#include "MMS_ItAttachment.h" +#include + +#include // for CDesCArray + +// CONSTANTS + +// FORWARD DECLARATIONS +class CEikAppUi; + +// CLASS DECLARATION + +/** +* CMMS_ItDocument application class. +*/ +class CMMS_ItDocument : public CAknDocument + { + public: // Constructors and destructor + /** + * Two-phased constructor. + */ + static CMMS_ItDocument* NewL(CEikApplication& aApp); + + /** + * Destructor. + */ + virtual ~CMMS_ItDocument(); + + public: // New functions + + TBool FileExists(TFileName aFilename); + + TBool AddAttachmentL(TFileName aFilename); + + TBool RemoveAttachment(TInt aIndex); + + void ResetAttachments(); + + TInt CountAttachments(); + + TMMS_ItAttachment* GetAttachment(TInt aIndex); + + TInt GetAttachmentsSize(); + + CDesCArray* GetTextArrayForListbox(); + + void SetMimeTypeL(TInt aIndex, TDes8& aMimeType); + + void ResetMimeTypeL(TInt aIndex); + + void SetSubject(TBuf<50> aSubject); + + TBool SetSMILFilename(TFileName aFilename); + + TBool SubjectSet() {return iSubjectSet;} + + TBool SMILAttSet() {return iSmilSet;} + + TFileName GetSMILFilename() {return iSmilFilename;} + + TBuf<50> GetSubject() {return iSubject;} + + void RemoveSMILFilename(){iSmilSet = EFalse;} + + void RemoveSubject(){iSubjectSet = EFalse;} + + protected: // New functions + + protected: // Functions from base classes + + private: + + /** + * EPOC default constructor. + */ + CMMS_ItDocument(CEikApplication& aApp); + + void ConstructL(); + + private: + + /** + * From CEikDocument, create CMMS_ItAppUi "App UI" object. + */ + CEikAppUi* CreateAppUiL(); + + TInt GuessTypeFromExtL(TPtrC aExt); + + TInt GetFileSizeL(TFileName aFilename); + + private: + CArrayFixFlat* iAttachments; // the attached files + CDesCArray* iTextArray; // the attachments listbox view + TInt iSize; + + TBool iSmilSet; + TBool iSubjectSet; + + TFileName iSmilFilename; + TBuf<100> iSubject; + + public: + TBuf<1024> iMessageText; + }; + +#endif + +// End of File + diff --git a/inc/MMS_ItView.h b/inc/MMS_ItView.h new file mode 100644 index 0000000..5142738 --- /dev/null +++ b/inc/MMS_ItView.h @@ -0,0 +1,89 @@ +/* +* ============================================================================ +* Name : CMMS_ItView from MMS_ItView.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* Declares view for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITVIEW_H +#define MMS_ITVIEW_H + +// INCLUDES +#include "MMS_ItAppUi.h" +#include + + +// CONSTANTS +// UID of view +const TUid KViewId = {1}; + +// FORWARD DECLARATIONS +class CMMS_ItContainer; +class CMMS_ItDocument; + +// CLASS DECLARATION + +/** +* CMMS_ItView view class. +* +*/ +class CMMS_ItView : public CAknView + { + public: // Constructors and destructor + + CMMS_ItView(CMMS_ItAppUi* aUI); + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CMMS_ItView(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + TUid Id() const; + + /** + * From ?base_class ?member_description + */ + void HandleCommandL(TInt aCommand); + + /** + * From ?base_class ?member_description + */ + void HandleClientRectChange(); + + private: + + /** + * From AknView, ?member_description + */ + void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * From AknView, ?member_description + */ + void DoDeactivate(); + + CMMS_ItContainer* iContainer; + + public: // Data + + CMMS_ItAppUi* iUI; + }; + +#endif + +// End of File diff --git a/inc/MMS_ItView2.h b/inc/MMS_ItView2.h new file mode 100644 index 0000000..c7f9d9b --- /dev/null +++ b/inc/MMS_ItView2.h @@ -0,0 +1,93 @@ +/* +* ============================================================================ +* Name : CMMS_ItView2 from MMS_ItView2.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Description: +* Declares view for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITVIEW2_H +#define MMS_ITVIEW2_H + +// INCLUDES +#include + + +// CONSTANTS +// UID of view +const TUid KView2Id = {2}; + +// FORWARD DECLARATIONS +class CMMS_ItContainer2; +class CMMS_ItDocument; +class CMMS_ItAppUi; + +// CLASS DECLARATION + +/** +* CMMS_ItView2 view class. +* +*/ +class CMMS_ItView2 : public CAknView + { + public: // Constructors and destructor + + CMMS_ItView2(CMMS_ItDocument* aDocument, CMMS_ItAppUi* aUI); + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CMMS_ItView2(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + TUid Id() const; + + /** + * From ?base_class ?member_description + */ + void HandleCommandL(TInt aCommand); + + /** + * From ?base_class ?member_description + */ + void HandleClientRectChange(); + + void UpdateContainer(); + + private: + + /** + * From AknView, ?member_description + */ + void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * From AknView, ?member_description + */ + void DoDeactivate(); + + private: // Data + CMMS_ItContainer2* iContainer; + + /*! @var iDocument The current document */ + CMMS_ItDocument* iDocument; + + CMMS_ItAppUi* iUI; + }; + +#endif + +// End of File diff --git a/inc/MMS_ItView3.h b/inc/MMS_ItView3.h new file mode 100644 index 0000000..15dc4ed --- /dev/null +++ b/inc/MMS_ItView3.h @@ -0,0 +1,93 @@ +/* +* ============================================================================ +* Name : CMMS_ItView3 from MMS_ItView3.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Description: +* Declares view for application. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_ITVIEW3_H +#define MMS_ITVIEW3_H + +// INCLUDES +#include + + +// CONSTANTS +// UID of view +const TUid KView3Id = {3}; + +// FORWARD DECLARATIONS +class CMMS_ItContainer3; +class CMMS_ItDocument; +class CMMS_ItAppUi; + +// CLASS DECLARATION + +/** +* CMMS_ItView view class. +* +*/ +class CMMS_ItView3 : public CAknView + { + public: // Constructors and destructor + + CMMS_ItView3(CMMS_ItDocument* aDocument, CMMS_ItAppUi* aUI); + + /** + * EPOC default constructor. + */ + void ConstructL(); + + /** + * Destructor. + */ + ~CMMS_ItView3(); + + public: // Functions from base classes + + /** + * From ?base_class ?member_description + */ + TUid Id() const; + + /** + * From ?base_class ?member_description + */ + void HandleCommandL(TInt aCommand); + + /** + * From ?base_class ?member_description + */ + void HandleClientRectChange(); + + private: + + /** + * From AknView, ?member_description + */ + void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, + const TDesC8& aCustomMessage); + + /** + * From AknView, ?member_description + */ + void DoDeactivate(); + + private: // Data + + /*! @var iDocument The current document */ + CMMS_ItDocument* iDocument; + + CMMS_ItAppUi* iUI; + + CMMS_ItContainer3* iContainer; + + }; + +#endif + +// End of File diff --git a/inc/mms_it.hrh b/inc/mms_it.hrh new file mode 100644 index 0000000..5a7ba1b --- /dev/null +++ b/inc/mms_it.hrh @@ -0,0 +1,58 @@ +/* +* ============================================================================ +* Name : MMS_It resource header file mms_it.hrh +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This file contains declarations for constants of MMS_It. +* The file can be included in C++ or resource file. +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +#ifndef MMS_IT_HRH +#define MMS_IT_HRH + +enum TMMS_ItCommandIds + { + EDoNothing = 1, + ENewMessage, + EDisplayHelp, + EShowBody, + EShowAttachments, + EEditSubject, + ERemoveSubject, + ESetSMILRoot, + ESetDefaultSMIL, + EEditMime, + ESetDefaultMime, + EMIMEImgGif, + EMIMEImgJpeg, + EMIMEImgPng, + EMIMEAudMidi, + EMIMEAudSPMidi, + EMIMEAudAMR, + EMIMEAudMpeg, + EMIMEVid3GPP, + EMIMEVidMpeg, + EAddAttachment, + EAddAttachmentManually, + ERemoveAttachment, + ERemoveAllAttachments, + ESend, + ESendwManualAddr, + EExit + }; + +enum TMMS_ItTabViewId + { + EMMS_ItView1Tab = 1, + EMMS_ItView2Tab, + EMMS_ItView3Tab + }; + + + + +#endif // MMS_IT_HRH diff --git a/inc/mms_it.l01 b/inc/mms_it.l01 new file mode 100644 index 0000000..7cc1aea --- /dev/null +++ b/inc/mms_it.l01 @@ -0,0 +1,73 @@ +/* +* ============================================================================ +* Name : mms_it.l01 +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This is a localisation file for MMS_It (language: English) +* A .loc file is the one and only place where the logical strings +* to be localised are defined. +* Initial content was generated by Series 60 AppWizard. +* ------------------------------------------------------------------- +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// LOCALISATION STRINGS + +#define qtn_help "MMS It!\n Makidis Michael 2003-2005\nvenus.cslab.aueb.gr/~mikem\n\nVery special thanks to Erevodifontas.\nThanks to petran.\n\nABOUT THIS APP\nThis application tries to be an advanced MMS message editor. It allows you to send any file(s) as a MMS message's attachment, set its MIME type, set the message's subject, the message's SMIL part etc. Its intented audiance is probally developers and not end users, as it exposes several technical details of the MMS infrastructure. Some options might not work properly on some networks." + +#define qtn_select_file "Select a file:" + +#define qtn_add_attachment "Add attachment" +#define qtn_add_attachment_manually "Add att. manually" +#define qtn_remove_attachment "Remove attachment" +#define qtn_remove_all "Remove all attachments" +#define qtn_set_root "Set root attachment" + +#define qtn_enter_recipient "Enter Recipient\n(tel. no or e-mail)" +#define qtn_enter_filename "Enter full file name\n(eg. C:\\Img\\pic.jpg):" + +#define qtn_new_message "New message" +#define qtn_show_body "Edit message body" +#define qtn_show_attachments "Edit attachments" +#define qtn_send "Send message" +#define qtn_help_about "Help & About" +#define qtn_help_exit "Exit" + +#define qtn_advanced "Advanced" +#define qtn_edit_subject "Edit subject" +#define qtn_remove_subject "Remove subject" +#define qtn_set_smil_root "Edit root att. (SMIL)" +#define qtn_set_default_smil "Set default SMIL" +#define qtn_send_w_manual_addr "Send w/ man. addr." + +#define qtn_edit_mime "Edit att. MIME type" +#define qtn_set_default_mime "Restore att. MIME type" +#define qtn_img_mime "Set img att. MIME" +#define qtn_snd_mime "Set snd att. MIME" +#define qtn_vid_mime "Set vid att. MIME" +#define qtn_enter_mimetype "Enter attachment MIME type (ex. text/plain):" +#define qtn_default_mime_type "Default MIME type" + +#define qtn_att "Att." +#define qtn_nothing_attached "(nothing attached)" +#define qtn_no_subject "(no subject)" +#define qtn_no_smil "(autogenerate SMIL)" + +#define qtn_message_sent "The message was placed in the Outbox and is being sent" +#define qtn_file_not_found "The file was not found" +#define qtn_no_attachments "There are no attachments" +#define qtn_attachment_not_found "At least one of the attached files has been moved or deleted" +#define qtn_smil_attachment_not_found "The root (SMIL) attachment has been moved or deleted" + +#define qtn_enter_subject "Enter message subject:" +#define qtn_enter_smil "Enter path the root (SMIL) att. (eg.\nC:\\Dev\\msg.smil):" +#define qtn_confirm_exit "Are you sure you want to exit?" + +#define qtn_app_caption_string "MMS It!" + +#define qtn_app_short_caption_string "MMS It!" + + +// End of File diff --git a/inc/mms_it.l54 b/inc/mms_it.l54 new file mode 100644 index 0000000..7faf5cb --- /dev/null +++ b/inc/mms_it.l54 @@ -0,0 +1,73 @@ +/* +* ============================================================================ +* Name : mms_it.l54 +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Description: +* This is a localisation file for MMS_It (language: Greek) +* A .loc file is the one and only place where the logical strings +* to be localised are defined. +* Initial content was generated by Series 60 AppWizard. +* ------------------------------------------------------------------- +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// LOCALISATION STRINGS + +#define qtn_help "MMS It!\n© Μακίδης Μιχάλης 2003-05\nvenus.cslab.aueb.gr/~mikem\n\nΕιδικές ευχαριστίες στον Ερεβοδιφώντα.\nΕυχαριστίες στον petran.\n\nΠΕΡΙ ΤΗΣ ΕΦΑΡΜΟΓΗΣ\nΗ εφαρμογή αυτή είναι ένας προχωρημένος συντάκτης μηνυμάτων MMS. Μπορείτε να στείλετε οποιοδήποτε αρχείο συνημμένο σε ένα μήνυμα MMS, να ρυθμίσετε τον τύπο MIME του, το θέμα του μηνύματος, το συνημμένο με την παρουσίαση SMIL κ.ά. Απευθύνεται περισσότερο σε όσους αναπτύσσουν εφαρμογές παρά σε τελικούς χρήστες, αφού αποκαλύπτει πολλές τεχνικές λεπτομέρειες της υπηρεσίας MMS. Ίσως κάποιες ρυθμίσεις να μην λειτουργούν σωστά με κάποια δίκτυα." + +#define qtn_select_file "Επιλέξτε ένα αρχείο:" + +#define qtn_add_attachment "Προσθήκη συνημμένου" +#define qtn_add_attachment_manually "Προσθ. συν. με διαδρ." +#define qtn_remove_attachment "Αφαίρεση συνημμένου" +#define qtn_remove_all "Αφαίρ. όλων των συν." +#define qtn_set_root "Ορισμός αρχικού συν." + +#define qtn_enter_recipient "Εισάγετε παραλήπτη\n(τηλ. ή e-mail):" +#define qtn_enter_filename "Εισάγετε διαδρομή & όνομα αρχείου\n(π.χ. C:\\Img\\pic.jpg):" + +#define qtn_new_message "Νέο μήνυμα" +#define qtn_send "Αποστολή μηνύματος" +#define qtn_show_body "Επεξ. κειμένου μηνύματος" +#define qtn_show_attachments "Επεξεργ. συνημμένων" +#define qtn_help_about "Βοήθεια & Περί" +#define qtn_help_exit "Έξοδος" + +#define qtn_advanced "Για προχωρημένους" +#define qtn_edit_subject "Επεξεργασία θέματος" +#define qtn_remove_subject "Διαγραφή θέματος" +#define qtn_set_smil_root "Ριζικό συνημμ. (SMIL)" +#define qtn_set_default_smil "Επαναφ. προεπιλ. SMIL" +#define qtn_send_w_manual_addr "Αποστ. με χειρ. διευθ." + +#define qtn_edit_mime "Τύπος MIME συνημμένου" +#define qtn_set_default_mime "Επαν. προεπ. MIME τύπου συν." +#define qtn_img_mime "Επιλ. MIME συν. εικόν." +#define qtn_snd_mime "Επιλ. MIME συν. ήχου" +#define qtn_vid_mime "Επιλ. MIME συν. βίντ." +#define qtn_enter_mimetype "Εισάγετε τύπο MIME συνημμένου (π.χ. text/plain):" +#define qtn_default_mime_type "Προεπ. MIME τύπος" + +#define qtn_att "Συν." +#define qtn_nothing_attached "(κανένα συνημμένο)" +#define qtn_no_subject "(χωρίς θέμα)" +#define qtn_no_smil "(αυτόμ. δημιουργ. SMIL)" + +#define qtn_message_sent "Το μήνυμα τοποθετήθηκε στα Εξερχόμενα και αποστέλεται" +#define qtn_file_not_found "Το αρχείο δε βρέθηκε" +#define qtn_no_attachments "Δεν έχουν οριστεί συνημμένα" +#define qtn_attachment_not_found "Τουλάχιστον ένα από τα συνημμένα αρχεία έχει μετακινηθεί ή διαγραφεί" +#define qtn_smil_attachment_not_found "Το ριζικό (SMIL) συνημμένο έχει μετακινηθεί ή διαγραφεί" + +#define qtn_enter_subject "Εισάγετε θέμα μηνύματος:" +#define qtn_enter_smil "Εισάγετε διαδρομή για ριζικό συν. (SMIL) (π.χ. C:\\msg.smil):" +#define qtn_confirm_exit "Έξοδος από την εφαρμογή;" + +#define qtn_app_caption_string "MMS It!" + +#define qtn_app_short_caption_string "MMS It!" + + +// End of File diff --git a/inc/mms_it.loc b/inc/mms_it.loc new file mode 100644 index 0000000..d8d0ae8 --- /dev/null +++ b/inc/mms_it.loc @@ -0,0 +1,6 @@ +#ifdef LANGUAGE_01 +#include "mms_it.l01" +#endif +#ifdef LANGUAGE_54 +#include "mms_it.l54" +#endif \ No newline at end of file diff --git a/install/MMS_It.pkg b/install/MMS_It.pkg new file mode 100644 index 0000000..07c9812 --- /dev/null +++ b/install/MMS_It.pkg @@ -0,0 +1,34 @@ +; +; Installation file for MMS_It application +; +;Languages +&EN,EL +; +; UID is the app's UID +; Please request a UID from Symbian +; +#{"MMS It!","MMS It!"},(0x0767A5B9),1,02,0 +; +;Supports Series 60 v 0.9 +;This line indicates that this installation is for the Series 60 platform v0.9 +;This line must appear _exactly_ as shown below in the sis file +;If this line is missing or incorrect, the sis file will not be able +;to be installed on Series 60 v0.9 platforms +(0x101F6F88), 0, 0, 0, {"Series60ProductID","Series60ProductID"} +; +; License file +; +{ +"license.txt" +"licensegr.txt" +}-"",FT,TA +; +; Files to install +; +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It.r01" -"!:\system\apps\MMS_It\MMS_It.r01" +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It_caption.r01" -"!:\system\apps\MMS_It\MMS_It_caption.r01" +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It.r54" -"!:\system\apps\MMS_It\MMS_It.r54" +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It_caption.r54" -"!:\system\apps\MMS_It\MMS_It_caption.r54" +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It.aif" -"!:\system\apps\MMS_It\MMS_It.aif" +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It.mbm" -"!:\system\apps\MMS_It\MMS_It.mbm" +"\Symbian\6.1\Series60\Epoc32\release\armi\urel\MMS_It.app" -"!:\system\apps\MMS_It\MMS_It.app" diff --git a/install/MMS_It_S60V2.pkg b/install/MMS_It_S60V2.pkg new file mode 100644 index 0000000..658445c --- /dev/null +++ b/install/MMS_It_S60V2.pkg @@ -0,0 +1,34 @@ +; +; Installation file for MMS_It application +; +;Languages +&EN,EL +; +; UID is the app's UID +; Please request a UID from Symbian +; +#{"MMS It!","MMS It!"},(0x0767A5B9),1,02,0 +; +;Supports Series 60 v 2.0 +;This line indicates that this installation is for the Series 60 platform v2.0 +;This line must appear _exactly_ as shown below in the sis file +;If this line is missing or incorrect, the sis file will not be able +;to be installed on Series 60 v2.0 platforms +(0x101F7960), 0, 0, 0, {"Series60ProductID","Series60ProductID"} +; +; License file +; +{ +"license.txt" +"licensegr.txt" +}-"",FT,TA +; +; Files to install +; +"\Symbian\7.0s\Series60_v20\Epoc32\data\z\system\apps\MMS_It\MMS_It.r01" -"!:\system\apps\MMS_It\MMS_It.r01" +"\Symbian\7.0s\Series60_v20\Epoc32\data\z\system\apps\MMS_It\MMS_It_caption.r01" -"!:\system\apps\MMS_It\MMS_It_caption.r01" +"\Symbian\7.0s\Series60_v20\Epoc32\data\z\system\apps\MMS_It\MMS_It.r54" -"!:\system\apps\MMS_It\MMS_It.r54" +"\Symbian\7.0s\Series60_v20\Epoc32\data\z\system\apps\MMS_It\MMS_It_caption.r54" -"!:\system\apps\MMS_It\MMS_It_caption.r54" +"\Symbian\7.0s\Series60_v20\Epoc32\data\z\system\apps\MMS_It\MMS_It.aif" -"!:\system\apps\MMS_It\MMS_It.aif" +"\Symbian\7.0s\Series60_v20\Epoc32\data\z\system\apps\MMS_It\MMS_It.mbm" -"!:\system\apps\MMS_It\MMS_It.mbm" +"\Symbian\7.0s\Series60_v20\Epoc32\release\armi\urel\MMS_It.app" -"!:\system\apps\MMS_It\MMS_It.app" diff --git a/install/license.txt b/install/license.txt new file mode 100644 index 0000000..fc10021 --- /dev/null +++ b/install/license.txt @@ -0,0 +1,12 @@ +In order to install and use this application you must accept the following license agreement: +----- +MMS It! +Copyright (C) Makidis Michael 2003-2005 +venus.cslab.aueb.gr/~mikem +www.cs.aueb.gr + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \ No newline at end of file diff --git a/install/licensegr.txt b/install/licensegr.txt new file mode 100644 index 0000000..b73c3f4 --- /dev/null +++ b/install/licensegr.txt @@ -0,0 +1,12 @@ +Για να εγκαταστήσετε και να χρησιμοποιήσετε αυτή την εφαρμογή πρέπει να αποδεχθείτε την ακόλουθη άδεια χρήσης: +----- +MMS It! +Πνευματικά δικαιώματα (C) Μακίδης Μιχάλης 2003-2005 +venus.cslab.aueb.gr/~mikem +www.cs.aueb.gr + +Το πρόγραμμα αυτό είναι ελεύθερο λογισμικό. Μπορείτε να το αναδιανέμετε και/ή να το τροποποιήσετε σύμφωνα με τους όρους της άδειας χρήσης "GNU General Public License" όπως αυτή εκδίδεται από το Free Software Foundation (Ίδρυμα Ελεύθερου Λογισμικού), είτε της έκδοσης 2 της άδειας χρήσης, ή (κατά την αρέσκειά σας) οποιασδήποτε μεταγενέστερης έκδοσης. + +Το πρόγραμμα αυτό διανέμεται με την ελπίδα ότι θα είναι χρήσιμο, αλλά ΧΩΡΙΣ ΚΑΜΙΑ ΕΓΓΥΗΣΗ, ούτε καν την υποδηλωμένη εγγύηση της ΕΜΠΟΡΕΥΣΙΜΟΤΗΤΑΣ ή ΔΥΝΑΤΟΤΗΤΑΣ ΧΡΗΣΗΣ ΓΙΑ ΚΑΠΟΙΟ ΣΥΓΚΕΚΡΙΜΕΝΟ ΣΚΟΠΟ. Δείτε την άδεια χρήσης "GNU General Public License" για περισσότερες λεπτομέρειες. + +Πρέπει να λάβατε ένα αντίτυπο της άδειας χρήσης "GNU General Public License" μαζί με αυτό το πρόγραμμα. Αν δεν το λάβατε, γράψτε στο: Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA diff --git a/src/MMS_ItApp.cpp b/src/MMS_ItApp.cpp new file mode 100644 index 0000000..e3c9ba9 --- /dev/null +++ b/src/MMS_ItApp.cpp @@ -0,0 +1,64 @@ +/* +* ============================================================================ +* Name : CMMS_ItApp from MMS_ItApp.cpp +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItApp.h" +#include "MMS_ItDocument.h" + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CMMS_ItApp::AppDllUid() +// Returns application UID +// --------------------------------------------------------- +// +TUid CMMS_ItApp::AppDllUid() const + { + return KUidMMS_It; + } + + +// --------------------------------------------------------- +// CMMS_ItApp::CreateDocumentL() +// Creates CMMS_ItDocument object +// --------------------------------------------------------- +// +CApaDocument* CMMS_ItApp::CreateDocumentL() + { + return CMMS_ItDocument::NewL( *this ); + } + +// ================= OTHER EXPORTED FUNCTIONS ============== +// +// --------------------------------------------------------- +// NewApplication() +// Constructs CMMS_ItApp +// Returns: created application object +// --------------------------------------------------------- +// +EXPORT_C CApaApplication* NewApplication() + { + return new CMMS_ItApp; + } + +// --------------------------------------------------------- +// E32Dll(TDllReason) +// Entry point function for EPOC Apps +// Returns: KErrNone: No error +// --------------------------------------------------------- +// +GLDEF_C TInt E32Dll( TDllReason ) + { + return KErrNone; + } + +// End of File + diff --git a/src/MMS_ItAppUi.cpp b/src/MMS_ItAppUi.cpp new file mode 100644 index 0000000..41baf93 --- /dev/null +++ b/src/MMS_ItAppUi.cpp @@ -0,0 +1,481 @@ +/* +* ============================================================================ +* Name : CMMS_ItAppUi from MMS_ItAppUi.cpp +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItAppUi.h" +#include "MMS_ItView.h" +#include "MMS_ItView2.h" +#include "MMS_ItView3.h" +#include +#include "mms_it.hrh" + +#include "MMS_ItContainer.h" +#include "MMS_ItContainer2.h" +#include "MMS_ItContainer3.h" +#include "MMS_ItDocument.h" + +#include + +#include // for query dialog +#include // for StringLoader +#include // for notes + +#include // for the phone book engine +#include // for RPbkViewResourceFile +#include // for the multiple phone fetch dlg +#include // for CContactDatabase +#include // for CPbkMmsAddressSelect +#include // for CPbkContactItem + +// MMS +#include // for CClientMtmRegistry +#include // for Message type IDs +#include // for CMmsClientMtm + + + + + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItAppUi::CMMS_ItAppUi(CMMS_ItDocument *aDocument) +: iNaviDecorator(NULL), iDocument(aDocument) +{ + +} + +// +// ---------------------------------------------------------- +// CMMS_ItAppUi::ConstructL() +// ?implementation_description +// ---------------------------------------------------------- +// +void CMMS_ItAppUi::ConstructL() + { + BaseConstructL( +#ifdef SERIES_60_V2 + EAknEnableSkin +#endif + ); + + // Show tabs for main views from resources + CEikStatusPane* sp = StatusPane(); + + // Fetch pointer to the default navi pane control + iNaviPane = (CAknNavigationControlContainer*)sp->ControlL( + TUid::Uid(EEikStatusPaneUidNavi)); + + ShowDefaultNaviPaneL(); + + iView1 = new (ELeave) CMMS_ItView(this); + + CleanupStack::PushL( iView1 ); + iView1->ConstructL(); + AddViewL( iView1 ); // transfer ownership to CAknViewAppUi + CleanupStack::Pop(); // view1 + + iView2 = new (ELeave) CMMS_ItView2(iDocument, this); + + CleanupStack::PushL( iView2 ); + iView2->ConstructL(); + AddViewL( iView2 ); // transfer ownership to CAknViewAppUi + CleanupStack::Pop(); // view2 + + iView3 = new (ELeave) CMMS_ItView3(iDocument, this); + + CleanupStack::PushL( iView3 ); + iView3->ConstructL(); + AddViewL( iView3 ); // transfer ownership to CAknViewAppUi + CleanupStack::Pop(); // view3 + + SetDefaultViewL(*iView1); + + // Create CMsvSession + iSession = CMsvSession::OpenAsyncL(*this); // new session is opened asynchronously + // CompleteConstructL() is called when async finishes + + } + +void CMMS_ItAppUi::CompleteConstructL() +{ + // We get a MtmClientRegistry from our session + // this registry is used to instantiate new mtms. + iMtmReg = CClientMtmRegistry::NewL(*iSession); + iMmsMtm = (CMmsClientMtm*) iMtmReg->NewMtmL( KUidMsgTypeMultimedia ); + + // notify the user with a InfoWin (this will be shown in emulator only) + iEikonEnv->InfoMsg(_L("Server session opened.")); +} + +// ---------------------------------------------------- +// CMMS_ItAppUi::~CMMS_ItAppUi() +// Destructor +// Frees reserved resources +// ---------------------------------------------------- +// +CMMS_ItAppUi::~CMMS_ItAppUi() + { + delete iMmsMtm; + delete iMtmReg; + + delete iSession; // session must be deleted last (and constructed first) + + delete iNaviDecorator; + } + +// ------------------------------------------------------------------------------ +// CMMS_ItAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) +// This function is called by the EIKON framework just before it displays +// a menu pane. Its default implementation is empty, and by overriding it, +// the application can set the state of menu items dynamically according +// to the state of application data. +// ------------------------------------------------------------------------------ +// +void CMMS_ItAppUi::DynInitMenuPaneL( + TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) + { + } + +// ---------------------------------------------------- +// CMMS_ItAppUi::HandleKeyEventL( +// const TKeyEvent& aKeyEvent,TEventCode /*aType*/) +// ?implementation_description +// ---------------------------------------------------- +// +TKeyResponse CMMS_ItAppUi::HandleKeyEventL( + const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/) + { + return EKeyWasNotConsumed; + } + +// ---------------------------------------------------- +// CMMS_ItAppUi::HandleCommandL(TInt aCommand) +// ?implementation_description +// ---------------------------------------------------- +// +void CMMS_ItAppUi::HandleCommandL(TInt aCommand) + { + switch ( aCommand ) + { + case EAknSoftkeyExit: + case EExit: + { + CAknQueryDialog* confirmDialog = CAknQueryDialog::NewL(CAknQueryDialog::ENoTone); + if (confirmDialog->ExecuteLD(R_MMS_IT_CONFIRM_EXIT_DIALOG)) + Exit(); + break; + } + case ENewMessage: + { + // remove all components of current message + iView2->HandleCommandL(ERemoveSubject); + iView2->HandleCommandL(ESetDefaultSMIL); + iDocument->ResetAttachments(); + iDocument->iMessageText.Zero(); + + // switch to 2nd view + ActivateLocalViewL(KView2Id); + + iView2->UpdateContainer(); + break; + } + case EAknSoftkeyBack: + case EShowBody: + { + // switch to 2nd view + ActivateLocalViewL(KView2Id); + break; + } + case EShowAttachments: + { + // switch to 3nd view + ActivateLocalViewL(KView3Id); + break; + } + case ESend: + { + SendMessageL(); + break; + } + case ESendwManualAddr: + { + SendMessageL(EFalse); + break; + } + case EDisplayHelp: + { + // load the resources and display the about box + HBufC* textResource = StringLoader::LoadLC(R_MMS_IT_HELP); + HBufC* textResource2 = StringLoader::LoadLC(R_MMS_IT_HELP_ABOUT); + CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*textResource); + dlg->PrepareLC(R_MESSAGE_QUERY); + dlg->QueryHeading()->SetTextL(*textResource2); + dlg->RunLD(); + CleanupStack::PopAndDestroy(textResource2); + CleanupStack::PopAndDestroy(textResource); + break; + } + default: + break; + } + } + +void CMMS_ItAppUi::ShowDefaultNaviPaneL() +{ + CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane(); + CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)); + np->PushDefaultL (); // Set default. + delete iNaviDecorator; + iNaviDecorator = NULL; + //DrawNow(); +} + +void CMMS_ItAppUi::ShowAtNaviPanelL(TPtrC aText) +{ + CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane(); + CAknNavigationControlContainer* np= (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)); + + delete iNaviDecorator; + iNaviDecorator = NULL; + + iNaviDecorator = np->CreateNavigationLabelL(aText); + + np->PushL(*iNaviDecorator); + //DrawNow(); +} + +void CMMS_ItAppUi::HandleSessionEventL + (TMsvSessionEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) + { + switch (aEvent) + { + // This event tells us that the session has been opened + case EMsvServerReady: + CompleteConstructL(); // Construct the mtm registry & MMS mtm + break; + + default: + // All other events are ignored + break; + } + + } + +TBool CMMS_ItAppUi::SendMessageL(TBool aUsePbForAddresses) + { + + /* + * Validate attachments + */ + for(TInt i = 0; i < iDocument->CountAttachments(); i++) + { + if(!iDocument->FileExists(iDocument->GetAttachment(i)->iFilename)) + { + HBufC* textResource = StringLoader::LoadLC(R_ATTACHMENT_NOT_FOUND); + CAknErrorNote* note = new (ELeave) CAknErrorNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return EFalse; + } + } + if(iDocument->SMILAttSet() && !iDocument->FileExists(iDocument->GetSMILFilename())) + { + HBufC* textResource = StringLoader::LoadLC(R_SMIL_ATTACHMENT_NOT_FOUND); + CAknErrorNote* note = new (ELeave) CAknErrorNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return EFalse; + } + + /* + * Get the adressees from the user (gsm numbers or E-Mail addrs) + */ + if(aUsePbForAddresses) + { + //Create a new phone book engine object and connect to the default contact database + CPbkContactEngine* pbkContactEngine = CPbkContactEngine::NewL(); + CleanupStack::PushL( pbkContactEngine ); + TBool AtLeastOneAddrAdded = EFalse; + + RPbkViewResourceFile phonebookResource( *(CEikonEnv::Static()) ); + + if ( !phonebookResource.IsOpen()) + { + phonebookResource.OpenL(); + } + + // Add searching array to parameters + CContactDatabase::TContactViewFilter filterSMS(CContactDatabase::ESmsable); + CContactDatabase::TContactViewFilter filterEMail(CContactDatabase::EMailable); + CPbkMultipleEntryFetchDlg::TParams params; + params.iContactView = &pbkContactEngine->FilteredContactsViewL( filterSMS | filterEMail ); + + // Launch fetching dialog + CPbkMultipleEntryFetchDlg* fetchDlg = CPbkMultipleEntryFetchDlg::NewL( params, *pbkContactEngine ); + fetchDlg->SetMopParent( this ); + TInt okPressed = fetchDlg->ExecuteLD(); + CleanupStack::PushL( params.iMarkedEntries ); + + if ( okPressed ) + { + // Process the marked entries + TInt paramCount = params.iMarkedEntries->Count(); + // Get the selected contacts id array + for ( TInt i = 0; i < paramCount; ++i ) + { + const TContactItemId cid = ( *params.iMarkedEntries )[i]; + + // Open the selected contact using Phonebook engine, + // choose correct number (launch list query if needed) + CPbkContactItem* pbkItem = pbkContactEngine->ReadContactLC( cid ); + TPtrC recAddress; + + CPbkMmsAddressSelect* selectDlg = new (ELeave)CPbkMmsAddressSelect( ); + recAddress.Set( selectDlg->ExecuteLD(*pbkItem, pbkItem->DefaultMmsField(), ETrue) ); + + if(recAddress != KNullDesC) + { + if(AtLeastOneAddrAdded) + { + // just add the adressee + iMmsMtm->AddAddresseeL( recAddress ); + } + else // this is the first valid adressee + { + AtLeastOneAddrAdded = ETrue; + + // Set up the MSV entry + CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId ,TMsvSelectionOrdering()); + CleanupStack::PushL(entry); + + // Set context to the parent folder (Outbox) & create message + iMmsMtm->SwitchCurrentEntryL( entry->EntryId() ); + iMmsMtm->CreateMessageL( iMmsMtm->DefaultSettingsL() ); + + CleanupStack::PopAndDestroy(); // entry + + iMmsMtm->AddAddresseeL( recAddress ); + } + } + + CleanupStack::PopAndDestroy(pbkItem); + } + } + + CleanupStack::PopAndDestroy(); // iMarkedEntries + phonebookResource.Close(); // Close the phonebook view + CleanupStack::PopAndDestroy(pbkContactEngine); + + if(!okPressed || !AtLeastOneAddrAdded) return EFalse; + + } + else + { + // Get the recipient address + TBuf<100> RecipientAddress; // for recipient address (gsm number or E-Mail addr) + CAknTextQueryDialog* telNumDialog = CAknTextQueryDialog::NewL(RecipientAddress, CAknQueryDialog::ENoTone); + if (!telNumDialog->ExecuteLD(R_MMS_IT_TEL_NUMBER_DIALOG)) + return EFalse; + + // Set up the entry + CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId ,TMsvSelectionOrdering()); + CleanupStack::PushL(entry); + + // Set context to the parent folder (Outbox) & create message + iMmsMtm->SwitchCurrentEntryL( entry->EntryId() ); + iMmsMtm->CreateMessageL( iMmsMtm->DefaultSettingsL() ); + CleanupStack::PopAndDestroy(); // entry + + // Setting recipient + iMmsMtm->AddAddresseeL( RecipientAddress ); + } + + + + /* + * Setting attachments (message parts) + */ + TMsvId attachmentID; + + attachmentID = KMsvNullIndexEntryId; + iMmsMtm->CreateTextAttachmentL( attachmentID, iDocument->iMessageText ); + + for(TInt u = 0; u < iDocument->CountAttachments(); u++) + { + attachmentID = KMsvNullIndexEntryId; + if(!iDocument->SMILAttSet()) + { + iMmsMtm->CreateAttachment2L( attachmentID, iDocument->GetAttachment(u)->iFilename ); + } + else + { + iMmsMtm->CreateAttachmentL( attachmentID, iDocument->GetAttachment(u)->iFilename ); + } + if(iDocument->GetAttachment(u)->iMIMETypeSet) + { + iMmsMtm->SetAttachmentTypeL( attachmentID, iDocument->GetAttachment(u)->iMIMEType ); + } + } + + if(iDocument->SMILAttSet()) + { + attachmentID = KMsvNullIndexEntryId; + iMmsMtm->CreateAttachment2L( attachmentID, iDocument->GetSMILFilename() ); + iMmsMtm->SetMessageRootL( attachmentID ); + + } + + if(iDocument->SubjectSet()) + { + iMmsMtm->SetSubjectL ( iDocument->GetSubject() ); + + } + + /* + * Send the message + */ + // Set InPreparation to false + TMsvEntry ent = iMmsMtm->Entry().Entry(); + ent.SetInPreparation(EFalse); + ent.SetVisible(ETrue); // mark as visible, after this the message can be seen in Outbox and, after sending, in Sent folder. + iMmsMtm->Entry().ChangeL(ent); // Commit changes + + // Save changes (or else all changes made will be lost when the context is changed.) + iMmsMtm->SaveMessageL(); + + // Notify the user + HBufC* textResource = StringLoader::LoadLC(R_MESSAGE_SENT); + CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + + // Start sending the message via the Server MTM to the MMS server + CMsvOperationWait* wait = CMsvOperationWait::NewLC(); // left in CS + wait->iStatus = KRequestPending; + CMsvOperation* op = NULL; + op = iMmsMtm->SendL( wait->iStatus ); + wait->Start(); + CleanupStack::PushL( op ); + CActiveScheduler::Start(); + + // The following is to ignore the completion of other active objects. It is not + // needed if the app has a command absorbing control. + while( wait->iStatus.Int() == KRequestPending ) + { + CActiveScheduler::Start(); + } + + CleanupStack::PopAndDestroy(2); // op, wait + + return ETrue; + } + +// End of File diff --git a/src/MMS_ItAttachment.cpp b/src/MMS_ItAttachment.cpp new file mode 100644 index 0000000..889ae18 --- /dev/null +++ b/src/MMS_ItAttachment.cpp @@ -0,0 +1,23 @@ +/* +* ============================================================================ +* Name : TMMS_ItAttachment from MMS_ItAttachment.h +* Part of : MMS_It +* Created : 23/10/2004 by Makidis Michael +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItAttachment.h" + +// ================= MEMBER FUNCTIONS ======================= + +// constructor +TMMS_ItAttachment::TMMS_ItAttachment() +:iMIMETypeSet(EFalse), iSize(0) + { + } + +// End of File diff --git a/src/MMS_ItContainer.cpp b/src/MMS_ItContainer.cpp new file mode 100644 index 0000000..18e98ba --- /dev/null +++ b/src/MMS_ItContainer.cpp @@ -0,0 +1,147 @@ +/* +* ============================================================================ +* Name : CMMS_ItContainer from MMS_ItContainer.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItContainer.h" +#include "MMS_ItAppUi.h" +#include // for bitmap +#include // for StringLoader +#include // for accesing resources +#include "mms_it.hrh" // for accesing commands + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItContainer::CMMS_ItContainer(CMMS_ItAppUi* aUI) +: iUI(aUI) +{} + +// --------------------------------------------------------- +// CMMS_ItContainer::ConstructL(const TRect& aRect) +// EPOC two phased constructor +// --------------------------------------------------------- +// +void CMMS_ItContainer::ConstructL(const TRect& aRect) + { + CreateWindowL(); + + SetRect(aRect); + + ActivateL(); + + // load the bitmap + _LIT(KTxtMBMname,"MMS_It.mbm"); + iBitmap = new (ELeave) CFbsBitmap(); + LoadBitmapL(iBitmap, KTxtMBMname, EMbmMms_itPic, ETrue); + } + +// Destructor +CMMS_ItContainer::~CMMS_ItContainer() + { + delete iBitmap; + } + +// --------------------------------------------------------- +// CMMS_ItContainer::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CMMS_ItContainer::SizeChanged() + { + } + +// --------------------------------------------------------- +// CMMS_ItContainer::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CMMS_ItContainer::CountComponentControls() const + { + return 0; + } + +// --------------------------------------------------------- +// CMMS_ItContainer::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CMMS_ItContainer::ComponentControl(TInt /*aIndex*/) const + { + return NULL; + } + +// --------------------------------------------------------- +// CMMS_ItContainer::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CMMS_ItContainer::Draw(const TRect& /*aRect*/) const + { + CWindowGc& gc = SystemGc(); + gc.Clear(); + + // Bitmap + TRect rect(0,0,177,140); + gc.DrawBitmap(rect, iBitmap); + } + +// --------------------------------------------------------- +// CMMS_ItContainer::HandleControlEventL( +// CCoeControl* aControl,TCoeEvent aEventType) +// --------------------------------------------------------- +// +void CMMS_ItContainer::HandleControlEventL( + CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/) + { + // No need for control event handler code here + } + +// --------------------------------------------------------- +// CMMS_ItContainer::OfferKeyEventL(...) +// Notify key events to editors. +// --------------------------------------------------------- +// +TKeyResponse CMMS_ItContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode /*aType*/) + { + switch ( aKeyEvent.iCode ) + { + case EKeyOK: + case EKeyEnter: + { + iUI->HandleCommandL( ENewMessage ); + return EKeyWasConsumed; + } + default: + { + return EKeyWasNotConsumed; + break; + } + } + } + +// based on a Forum Nokia Discussion topic +void CMMS_ItContainer::LoadBitmapL(CFbsBitmap* aBitMap,const TDesC& aFileName,TInt aId,TBool aShareIfLoaded) + { + TFileName DefaultPath; + + // This gives complete path name to the application + DefaultPath.Copy(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName()); + + // now parse and strip of the application name + TParsePtr parse(DefaultPath); + + // Copy back only drive and path + DefaultPath.Copy(parse.DriveAndPath()); + + // Append the filename + DefaultPath.Append(aFileName); + + User::LeaveIfError(aBitMap->Load(DefaultPath, aId, aShareIfLoaded)); + } + +// End of File diff --git a/src/MMS_ItContainer2.cpp b/src/MMS_ItContainer2.cpp new file mode 100644 index 0000000..3586007 --- /dev/null +++ b/src/MMS_ItContainer2.cpp @@ -0,0 +1,287 @@ +/* +* ============================================================================ +* Name : CMMS_ItContainer2 from MMS_ItContainer2.cpp +* Part of : MMS_It +* Created : 21/11/2004 by +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItContainer2.h" +#include "MMS_ItAppUi.h" +#include "MMS_ItDocument.h" + +#include // for the resources +#include "mms_it.hrh" // for accesing commands +#include // for bitmap + +#include // for labels +#include // for CEikEdwin +#include // for StringLoader + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItContainer2::CMMS_ItContainer2(CMMS_ItAppUi* aUI, CMMS_ItDocument* aDocument) +: iUI(aUI), iDocument(aDocument) +{} + +// --------------------------------------------------------- +// CMMS_ItContainer2::ConstructL(const TRect& aRect) +// EPOC two phased constructor +// --------------------------------------------------------- +// +void CMMS_ItContainer2::ConstructL(const TRect& aRect) + { + CreateWindowL(); + + const CFont* fontUsed = iEikonEnv->DenseFont(); + + iLblSubject = new (ELeave) CEikLabel; + iLblSubject->SetContainerWindowL( *this ); + iLblSubject->SetFont( fontUsed ); + iLblSubject->SetTextL(_L("")); + + iLblSmil = new (ELeave) CEikLabel; + iLblSmil->SetContainerWindowL( *this ); + iLblSmil->SetFont( fontUsed ); + iLblSubject->SetTextL(_L("")); + + iLblAttach = new (ELeave) CEikLabel; + iLblAttach->SetContainerWindowL( *this ); + iLblAttach->SetFont( fontUsed ); + iLblSubject->SetTextL(_L("")); + + // Create the editor + iEdwin = new (ELeave) CEikEdwin; + iEdwin->SetContainerWindowL(*this); + + // Set the flags & construct + iEdwin->SetAknEditorFlags(EAknEditorFlagEnableScrollBars); + iEdwin->ConstructL( EEikEdwinWidthInPixels | + EEikEdwinNoAutoSelection | + EEikEdwinNoHorizScrolling | + EEikEdwinLineCursor + , aRect.Width(),1024,5); + + // load the bitmap + _LIT(KTxtMBMname,"MMS_It.mbm"); + iPicSubject = new (ELeave) CFbsBitmap(); + LoadBitmapL(iPicSubject, KTxtMBMname, EMbmMms_itSubject, ETrue); + iPicSmil = new (ELeave) CFbsBitmap(); + LoadBitmapL(iPicSmil, KTxtMBMname, EMbmMms_itSmil, ETrue); + iPicAttach = new (ELeave) CFbsBitmap(); + LoadBitmapL(iPicAttach, KTxtMBMname, EMbmMms_itAttach, ETrue); + + SetRect(aRect); + ActivateL(); + + iEdwin->SetFocus(ETrue); + + UpdateEditorL(); + UpdateLabelsL(); + } + +// Destructor +CMMS_ItContainer2::~CMMS_ItContainer2() + { + SaveMessageText(); + delete iLblSubject; + delete iLblSmil; + delete iLblAttach; + delete iEdwin; + + delete iPicSubject; + delete iPicSmil; + delete iPicAttach; + } + +// --------------------------------------------------------- +// CMMS_ItContainer2::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CMMS_ItContainer2::SizeChanged() + { + + iLblSubject->SetExtent( TPoint(20, 3), TSize(153, 15) ); + + iLblSmil->SetExtent( TPoint(20, 18), TSize(120, 15) ); + + iLblAttach->SetExtent( TPoint(160, 18), TSize(30, 15) ); + + iEdwin->SetExtent(TPoint(0, 33), iEdwin->MinimumSize() ); + } + +// --------------------------------------------------------- +// CMMS_ItContainer2::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CMMS_ItContainer2::CountComponentControls() const + { + return 4; // return nbr of controls inside this container + } + +// --------------------------------------------------------- +// CMMS_ItContainer2::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CMMS_ItContainer2::ComponentControl(TInt aIndex) const + { + switch ( aIndex ) + { + case 0: + return iLblSubject; + case 1: + return iLblSmil; + case 2: + return iLblAttach; + case 3: + return iEdwin; + default: + return NULL; + } + } + +// --------------------------------------------------------- +// CMMS_ItContainer2::OfferKeyEventL(...) +// Notify key events to editors. +// --------------------------------------------------------- +// +TKeyResponse CMMS_ItContainer2::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType) + { + switch ( aKeyEvent.iCode ) + { + case EKeyOK: + { + iUI->HandleCommandL( EShowAttachments ); + return EKeyWasConsumed; + } + case EKeyPhoneSend: + { + iUI->HandleCommandL( ESend ); + return EKeyWasConsumed; + } + default: + { + return iEdwin->OfferKeyEventL(aKeyEvent, aType); + break; + } + } + } + +// --------------------------------------------------------- +// CMMS_ItContainer2::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CMMS_ItContainer2::Draw(const TRect& /*aRect*/) const + { + CWindowGc& gc = SystemGc(); + gc.Clear(); + + /*gc.SetPenStyle(CGraphicsContext::ENullPen); + gc.SetBrushColor(KRgbGray); + gc.SetBrushStyle(CGraphicsContext::ESolidBrush); + gc.DrawRect(aRect);*/ + + + // Bitmaps + TInt x1 = 4; + TInt x2 = 144; + TInt y1 = 2; + TInt y2 = 17; + + TRect rect1(x1, y1, x1+13, y1+13); + gc.DrawBitmap(rect1, iPicSubject); + + TRect rect2(x1, y2, x1+13, y2+13); + gc.DrawBitmap(rect2, iPicSmil); + + TRect rect3(x2, y2, x2+13, y2+13); + gc.DrawBitmap(rect3, iPicAttach); + + gc.SetPenSize(TSize(1,1)); + gc.SetPenColor(KRgbBlack); + gc.SetPenStyle(CGraphicsContext::ESolidPen); + gc.DrawLine(TPoint(1, 32), TPoint(175, 32)); + } + +// --------------------------------------------------------- +// CMMS_ItContainer2::HandleControlEventL( +// CCoeControl* aControl,TCoeEvent aEventType) +// --------------------------------------------------------- +// +void CMMS_ItContainer2::HandleControlEventL( + CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/) + { + // TODO: Add your control event handler code here + } + +// based on a Forum Nokia Discussion topic +void CMMS_ItContainer2::LoadBitmapL(CFbsBitmap* aBitMap,const TDesC& aFileName,TInt aId,TBool aShareIfLoaded) + { + TFileName DefaultPath; + + // This gives complete path name to the application + DefaultPath.Copy(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName()); + + // now parse and strip of the application name + TParsePtr parse(DefaultPath); + + // Copy back only drive and path + DefaultPath.Copy(parse.DriveAndPath()); + + // Append the filename + DefaultPath.Append(aFileName); + + User::LeaveIfError(aBitMap->Load(DefaultPath, aId, aShareIfLoaded)); + } + +void CMMS_ItContainer2::SaveMessageText() +{ + iEdwin->GetText(iDocument->iMessageText); +} + +void CMMS_ItContainer2::UpdateLabelsL() +{ + if(iDocument->SubjectSet()) + { + iLblSubject->SetTextL(iDocument->GetSubject()); + } + else + { + HBufC* textResource = StringLoader::LoadLC(R_NO_SUBJECT); + iLblSubject->SetTextL(*textResource); + CleanupStack::PopAndDestroy(textResource); + } + + if(iDocument->SMILAttSet()) + { + TParse p; + p.Set(iDocument->GetSMILFilename(), NULL, NULL); + iLblSmil->SetTextL(p.NameAndExt()); + } + else + { + HBufC* textResource2 = StringLoader::LoadLC(R_NO_SMIL); + iLblSmil->SetTextL(*textResource2); + CleanupStack::PopAndDestroy(textResource2); + } + + // Set the labels + TBuf<4> attachments; + attachments.AppendNum(iDocument->CountAttachments()); + iLblAttach->SetTextL( attachments ); + + SizeChanged(); +} + +void CMMS_ItContainer2::UpdateEditorL() +{ + iEdwin->SetTextL(&iDocument->iMessageText); +} + +// End of File diff --git a/src/MMS_ItContainer3.cpp b/src/MMS_ItContainer3.cpp new file mode 100644 index 0000000..da68c97 --- /dev/null +++ b/src/MMS_ItContainer3.cpp @@ -0,0 +1,392 @@ +/* +* ============================================================================ +* Name : CMMS_ItContainer3 from MMS_ItContainer3.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItContainer3.h" +#include "MMS_ItAppUi.h" + +#include "MMS_ItDocument.h" +#include // for the resources +#include // for icons + +#include // for the icons +#include // for notes +#include // for queries +#include // for StringLoader +#include // for the UTF converter +#include // for file selection dialog + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItContainer3::CMMS_ItContainer3(CMMS_ItAppUi* aUI, CMMS_ItDocument* aDocument) +: iListBox(NULL), iUI(aUI), iDocument(aDocument) +{} + +// --------------------------------------------------------- +// CMMS_ItContainer3::ConstructL(const TRect& aRect) +// EPOC two phased constructor +// --------------------------------------------------------- +// +void CMMS_ItContainer3::ConstructL(const TRect& aRect) + { + CreateWindowL(); + SetRect(aRect); + ActivateL(); + + // Delete listbox object. + if ( iListBox ) + { + delete iListBox; + iListBox = NULL; + } + + // Create a new listbox + iListBox = new ( ELeave ) CAknDoubleLargeStyleListBox(); + iListBox->SetContainerWindowL( *this ); + + // Construct listbox. + if ( iListBox ) + iListBox->ConstructL( this, EAknListBoxSelectionList); + + // Load the icons + CArrayPtr* icons = new( ELeave ) CAknIconArray( 2 ); + CleanupStack::PushL(icons); + icons->AppendL( iEikonEnv->CreateIconL( _L("\\system\\apps\\MMS_IT\\MMS_It.mbm"), + EMbmMms_itMsg, + EMbmMms_itMsgm ) ); + icons->AppendL( iEikonEnv->CreateIconL( _L("\\system\\apps\\MMS_IT\\MMS_It.mbm"), + EMbmMms_itSound, + EMbmMms_itSoundm ) ); + icons->AppendL( iEikonEnv->CreateIconL( _L("\\system\\apps\\MMS_IT\\MMS_It.mbm"), + EMbmMms_itVideo, + EMbmMms_itVideom ) ); + icons->AppendL( iEikonEnv->CreateIconL( _L("\\system\\apps\\MMS_IT\\MMS_It.mbm"), + EMbmMms_itInstall, + EMbmMms_itInstallm ) ); + icons->AppendL( iEikonEnv->CreateIconL( _L("\\system\\apps\\MMS_IT\\MMS_It.mbm"), + EMbmMms_itImg, + EMbmMms_itImgm ) ); + + icons->AppendL( iEikonEnv->CreateIconL( _L("\\system\\apps\\MMS_IT\\MMS_It.mbm"), + EMbmMms_itMod, + EMbmMms_itModm ) ); + + CleanupStack::Pop(); // icons + + // Sets graphics as ListBox icons + iListBox->ItemDrawer()->FormattedCellData()->SetIconArray( icons ); + iListBox->ItemDrawer()->FormattedCellData()->SetSubCellAlignmentL(2, CGraphicsContext::ELeft); + + // Set the model... + if ( iListBox ) + { + // Sets list items + iListBox->Model()->SetItemTextArray( iDocument->GetTextArrayForListbox() ); + iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); + } + + // Create scrollbar. + if ( iListBox ) + { + iListBox->CreateScrollBarFrameL( ETrue ); + iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); + } + + // Empty listbox message + HBufC* textResource = StringLoader::LoadLC(R_NOTHING_ATTACHED); + iListBox->View()->SetListEmptyTextL(*textResource); + iListBox->DrawNow(); + CleanupStack::PopAndDestroy(textResource); + + // Display listbox + iListBox->SetListBoxObserver( this ); + SizeChanged(); + iListBox->ActivateL(); + + // update scroll bar + if (iListBox) + { + TInt pos(iListBox->View()->CurrentItemIndex()); + if (iListBox->ScrollBarFrame()) + { + iListBox->ScrollBarFrame()->MoveVertThumbTo(pos); + } + } + } + + +// Destructor +CMMS_ItContainer3::~CMMS_ItContainer3() + { + if(iListBox) delete iListBox; + } + +// --------------------------------------------------------- +// CMMS_ItContainer3::SizeChanged() +// Called by framework when the view size is changed +// --------------------------------------------------------- +// +void CMMS_ItContainer3::SizeChanged() + { + if ( iListBox ) + { + iListBox->SetRect( Rect() ); // Sets rectangle of lstbox. + } + } + +// --------------------------------------------------------- +// CMMS_ItContainer3::CountComponentControls() const +// --------------------------------------------------------- +// +TInt CMMS_ItContainer3::CountComponentControls() const + { + if(iListBox) return 1; // return nbr of controls inside this container + return 0; + } + +// --------------------------------------------------------- +// CMMS_ItContainer3::ComponentControl(TInt aIndex) const +// --------------------------------------------------------- +// +CCoeControl* CMMS_ItContainer3::ComponentControl(TInt aIndex) const + { + switch ( aIndex ) + { + case 0: + { + if(iListBox) + return iListBox; + else + return NULL; + break; + } + default: + return NULL; + } + } + +// --------------------------------------------------------- +// CMMS_ItContainer3::Draw(const TRect& aRect) const +// --------------------------------------------------------- +// +void CMMS_ItContainer3::Draw(const TRect& /*aRect*/) const + { + } + +// --------------------------------------------------------- +// CMMS_ItContainer3::HandleControlEventL( +// CCoeControl* aControl,TCoeEvent aEventType) +// --------------------------------------------------------- +// +void CMMS_ItContainer3::HandleControlEventL( + CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/) + { + // TODO: Add your control event handler code here + } + +// --------------------------------------------------------- +// CMMS_ItContainer3::OfferKeyEventL(...) +// Notify key events to editors. +// --------------------------------------------------------- +// +TKeyResponse CMMS_ItContainer3::OfferKeyEventL( + const TKeyEvent& aKeyEvent, TEventCode aType) + { + switch ( aKeyEvent.iCode ) + { + case EKeyOK: + case EKeyEnter: + { + AddAttachmentL(); + return EKeyWasConsumed; + } + case EKeyBackspace: + RemoveAttachmentL(); + return EKeyWasConsumed; + break; + default: + if ( iListBox ) + return iListBox->OfferKeyEventL( aKeyEvent, aType ); + else + return EKeyWasNotConsumed; + break; + } + } + +void CMMS_ItContainer3::AddAttachmentL() + { + // ask for file name + TFileName filename; + if(!AknCommonDialogs::RunSelectDlgLD(filename, R_FILE_SELECTION_DIALOG)) + return; + + iDocument->AddAttachmentL(filename); + + // Updates listbox. + iListBox->HandleItemAdditionL(); + iListBox->SetCurrentItemIndexAndDraw(iListBox->Model()->NumberOfItems() - 1); + + UpdateNaviPanelL(); + + iListBox->DrawNow(); + + } + +void CMMS_ItContainer3::AddAttachmentManuallyL() + { + TFileName filename; + + // ask for file name + CAknTextQueryDialog* fileDialog = CAknTextQueryDialog::NewL(filename, CAknQueryDialog::ENoTone); + if (!fileDialog->ExecuteLD(R_MMS_IT_FILE_DIALOG)) + return; + + // check that the file exists + if(!iDocument->AddAttachmentL(filename)) + { + HBufC* textResource = StringLoader::LoadLC(R_FILE_NOT_FOUND); + CAknErrorNote* note = new (ELeave) CAknErrorNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return; + } + + // Updates listbox. + iListBox->HandleItemAdditionL(); + iListBox->SetCurrentItemIndexAndDraw(iListBox->Model()->NumberOfItems() - 1); + + UpdateNaviPanelL(); + + iListBox->DrawNow(); + + } + +void CMMS_ItContainer3::RemoveAttachmentL() +{ + // check whether there are no attachments + if(iDocument->CountAttachments() == 0) + { + HBufC* textResource = StringLoader::LoadLC(R_NO_ATTACHMENTS); + CAknInformationNote* note = new (ELeave) CAknInformationNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return; + } + + TInt currentItem = iListBox->CurrentItemIndex(); + + // Actually delete the attachment (not the attached file!) + iDocument->RemoveAttachment(currentItem); + iListBox->HandleItemRemovalL(); + + UpdateNaviPanelL(); + + // Redraw + if(iDocument->CountAttachments() != 0) + { + if(currentItem >= iDocument->CountAttachments()) + { + iListBox->SetCurrentItemIndexAndDraw(iDocument->CountAttachments() -1); + } + else + { + iListBox->SetCurrentItemIndexAndDraw(currentItem); + } + + } + iListBox->DrawNow(); +} + +void CMMS_ItContainer3::RemoveAllAttachments() +{ + // remove all attachments + iDocument->ResetAttachments(); + iListBox->HandleItemRemovalL(); + + UpdateNaviPanelL(); +} + +void CMMS_ItContainer3::EditMimeType() +{ + // check whether there are no attachments + if(iDocument->CountAttachments() == 0) + { + HBufC* textResource = StringLoader::LoadLC(R_NO_ATTACHMENTS); + CAknInformationNote* note = new (ELeave) CAknInformationNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return; + } + + TBuf<40> MIMEType; + // ask for file name + CAknTextQueryDialog* mimeDialog = CAknTextQueryDialog::NewL(MIMEType, CAknQueryDialog::ENoTone); + if (!mimeDialog->ExecuteLD(R_MMS_IT_MIME_DIALOG)) + return; + + TBuf8<40> MIMEType8; + + CnvUtfConverter::ConvertFromUnicodeToUtf8(MIMEType8, MIMEType); + + SetMimeTypeL(MIMEType8); +} + +void CMMS_ItContainer3::SetMimeTypeL(TDes8& aMimeType) +{ + // check whether there are no attachments + if(iDocument->CountAttachments() == 0) + { + HBufC* textResource = StringLoader::LoadLC(R_NO_ATTACHMENTS); + CAknInformationNote* note = new (ELeave) CAknInformationNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return; + } + + TInt currentItem = iListBox->CurrentItemIndex(); + iDocument->SetMimeTypeL(currentItem, aMimeType); + iListBox->SetCurrentItemIndexAndDraw(currentItem); +} + +void CMMS_ItContainer3::ResetMimeTypeL() +{ + // check whether there are no attachments + if(iDocument->CountAttachments() == 0) + { + HBufC* textResource = StringLoader::LoadLC(R_NO_ATTACHMENTS); + CAknInformationNote* note = new (ELeave) CAknInformationNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + return; + } + + TInt currentItem = iListBox->CurrentItemIndex(); + iDocument->ResetMimeTypeL(currentItem); + iListBox->SetCurrentItemIndexAndDraw(currentItem); +} + +void CMMS_ItContainer3::UpdateNaviPanelL() +{ + // Update the navigation pane + TBuf<40> text; + + HBufC* textResource = StringLoader::LoadLC(R_ATT); + text.Append(*textResource); + CleanupStack::PopAndDestroy(textResource); + + text.Append(_L(": ")); + text.AppendNum(iDocument->GetAttachmentsSize()); + text.Append(_L(" Bytes")); + iUI->ShowAtNaviPanelL(text); +} + +// End of File diff --git a/src/MMS_ItDocument.cpp b/src/MMS_ItDocument.cpp new file mode 100644 index 0000000..b35b6a7 --- /dev/null +++ b/src/MMS_ItDocument.cpp @@ -0,0 +1,292 @@ +/* +* ============================================================================ +* Name : CMMS_ItDocument from MMS_ItDocument.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include "MMS_ItDocument.h" +#include "MMS_ItAppUi.h" +#include // for loading resources + +#include // for file exists +#include // for StringLoader +#include // for the UTF converter + +// ================= MEMBER FUNCTIONS ======================= + +// constructor +CMMS_ItDocument::CMMS_ItDocument(CEikApplication& aApp) +: CAknDocument(aApp), iTextArray(NULL), iSize(0) + { + iSmilSet = EFalse; + iSubjectSet = EFalse; + } + +// destructor +CMMS_ItDocument::~CMMS_ItDocument() + { + delete iTextArray; + delete iAttachments; + } + +// EPOC default constructor can leave. +void CMMS_ItDocument::ConstructL() + { + iTextArray = new(ELeave) CDesCArraySeg(5); + iTextArray->Reset(); + iAttachments = new(ELeave) CArrayFixFlat(3); + } + +// Two-phased constructor. +CMMS_ItDocument* CMMS_ItDocument::NewL( + CEikApplication& aApp) // CMMS_ItApp reference + { + CMMS_ItDocument* self = new (ELeave) CMMS_ItDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ---------------------------------------------------- +// CMMS_ItDocument::CreateAppUiL() +// constructs CMMS_ItAppUi +// ---------------------------------------------------- +// +CEikAppUi* CMMS_ItDocument::CreateAppUiL() + { + return new (ELeave) CMMS_ItAppUi(this); + } + +TBool CMMS_ItDocument::FileExists(TFileName aFilename) +{ + return ConeUtils::FileExists(aFilename); +} + +TInt CMMS_ItDocument::GetFileSizeL(TFileName aFilename) +{ + RFs fsSession; + TInt size; + + User::LeaveIfError(fsSession.Connect()); // open session with file server + RFile file; + file.Open(fsSession, aFilename, EFileRead | EFileShareReadersOnly); + + TInt res = file.Size(size); + + file.Close(); + fsSession.Close(); // close session with file server + + if(res < 0) return 0; + return size; +} + +TBool CMMS_ItDocument::AddAttachmentL(TFileName aFilename) +{ + if(!FileExists(aFilename)) return EFalse; + + TMMS_ItAttachment attachment; + TBuf<200> text; + + attachment.iFilename = aFilename; + TParse p; + p.Set(attachment.iFilename, NULL, NULL); + if(p.ExtPresent()) + { + text.AppendNum(GuessTypeFromExtL(p.Ext())); + text.Append(_L("\t")); + } + else + { + text.Append(_L("0\t")); + } + text.Append(p.NameAndExt()); + text.Append(_L("\t")); + + // get the file size + attachment.iSize = GetFileSizeL(attachment.iFilename); + iSize += attachment.iSize; + text.AppendNum(attachment.iSize); + text.Append(_L(" B, ")); + + HBufC* textResource = StringLoader::LoadLC(R_DEFAULT_MIME_TYPE); + text.Append(*textResource); + CleanupStack::PopAndDestroy(textResource); + + text.Append(_L("\t")); + iTextArray->AppendL(text); + + // append the attachment + iAttachments->AppendL(attachment); + + return ETrue; +} + +TBool CMMS_ItDocument::RemoveAttachment(TInt aIndex) +{ + // check whether there are no attachments + if(iAttachments->Count() == 0) + { + return EFalse; + } + + // Set the size + if(iTextArray->Count() == 1) // Deleting the only attachment + { + this->iSize = 0; + } + else + { + this->iSize -= iAttachments->At(aIndex).iSize; + } + + // Actually delete the attachment (not the attached file!) + iAttachments->Delete(aIndex); + iTextArray->Delete(aIndex); + + iAttachments->Compress(); + iTextArray->Compress(); + + return ETrue; +} + +void CMMS_ItDocument::ResetAttachments() +{ + this->iSize = 0; + + iAttachments->Reset(); + iTextArray->Reset(); + + iAttachments->Compress(); + iTextArray->Compress(); +} + +TMMS_ItAttachment* CMMS_ItDocument::GetAttachment(TInt aIndex) +{ + return &(iAttachments->At(aIndex)); +} + +TInt CMMS_ItDocument::CountAttachments() +{ + return iAttachments->Count(); +} + +TInt CMMS_ItDocument::GetAttachmentsSize() +{ + return iSize; +} + +CDesCArray* CMMS_ItDocument::GetTextArrayForListbox() +{ + return iTextArray; +} + +TInt CMMS_ItDocument::GuessTypeFromExtL(TPtrC aExt) +{ + TBuf<10> e = aExt.Left(10); + e.LowerCase(); + if(e == _L(".wav") || e == _L(".mid") || e == _L(".midi") || e == _L(".spmidi") || e == _L(".spmid") || e == _L(".rmi") || e == _L(".mp3") || e == _L(".ra") || e == _L(".wma") || e == _L(".ogg") || e == _L(".aac") || e == _L(".amr")) + return 1; + if(e == _L(".3gp") || e == _L(".3gpp") || e == _L(".rv") || e == _L(".rmvb") || e == _L(".rm") || e == _L(".wmv") || e == _L(".avi") || e == _L(".asf") || e == _L(".asx") || e == _L(".mpg") || e == _L(".mpeg") || e == _L(".mov") || e == _L(".qt") || e == _L(".3g2") || e == _L(".mp4")) + return 2; + if(e == _L(".sis") || e == _L(".jar")) + return 3; + if(e == _L(".gif") || e == _L(".jpg") || e == _L(".jpeg") || e == _L(".png") || e == _L(".bmp")) + return 4; + return 0; +} + +void CMMS_ItDocument::SetMimeTypeL(TInt aIndex, TDes8& aMimeType) +{ + // Update the attachment + iAttachments->At(aIndex).iMIMETypeSet = ETrue; + iAttachments->At(aIndex).iMIMEType = aMimeType; + + TBuf<200> text; + + TParse p; + p.Set(iAttachments->At(aIndex).iFilename, NULL, NULL); + if(p.ExtPresent()) + { + text.AppendNum(GuessTypeFromExtL(p.Ext())); + text.Append(_L("\t")); + } + else + { + text.Append(_L("0\t")); + } + text.Append(p.NameAndExt()); + text.Append(_L("\t")); + + TBuf<40> MIMEType; + CnvUtfConverter::ConvertToUnicodeFromUtf8(MIMEType, aMimeType); + + // get the file size + text.AppendNum(iAttachments->At(aIndex).iSize); + text.Append(_L(" B, ")); + text.Append(MIMEType); + text.Append(_L("\t5")); + + iTextArray->Delete(aIndex); + iTextArray->InsertL(aIndex, text); +} + +void CMMS_ItDocument::ResetMimeTypeL(TInt aIndex) +{ + // Update the attachment + iAttachments->At(aIndex).iMIMETypeSet = EFalse; + + TBuf<200> text; + + TParse p; + p.Set(iAttachments->At(aIndex).iFilename, NULL, NULL); + if(p.ExtPresent()) + { + text.AppendNum(GuessTypeFromExtL(p.Ext())); + text.Append(_L("\t")); + } + else + { + text.Append(_L("0\t")); + } + text.Append(p.NameAndExt()); + text.Append(_L("\t")); + + // get the file size + text.AppendNum(iAttachments->At(aIndex).iSize); + text.Append(_L(" B, ")); + + HBufC* textResource = StringLoader::LoadLC(R_DEFAULT_MIME_TYPE); + text.Append(*textResource); + CleanupStack::PopAndDestroy(textResource); + + text.Append(_L("\t")); + + iTextArray->Delete(aIndex); + iTextArray->InsertL(aIndex, text); +} + +void CMMS_ItDocument::SetSubject(TBuf<50> aSubject) +{ + iSubject = aSubject; + iSubjectSet = ETrue; +} + +TBool CMMS_ItDocument::SetSMILFilename(TFileName aFilename) +{ + if(!FileExists(aFilename)) return EFalse; + + iSmilFilename = aFilename; + iSmilSet = ETrue; + + return ETrue; +} + +// End of File diff --git a/src/MMS_ItView.cpp b/src/MMS_ItView.cpp new file mode 100644 index 0000000..953b129 --- /dev/null +++ b/src/MMS_ItView.cpp @@ -0,0 +1,119 @@ +/* +* ============================================================================ +* Name : CMMS_ItView from MMS_ItView.h +* Part of : MMS_It +* Created : 29/9/2003 by Makidis Michael +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include +#include +#include +#include "MMS_ItView.h" +#include "MMS_It.hrh" +#include "MMS_ItContainer.h" + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItView::CMMS_ItView(CMMS_ItAppUi* aUI) +: iUI(aUI) +{} + +// --------------------------------------------------------- +// CMMS_ItView::ConstructL(const TRect& aRect) +// EPOC two-phased constructor +// --------------------------------------------------------- +// +void CMMS_ItView::ConstructL() + { + BaseConstructL( R_MMS_IT_VIEW1 ); + } + +// --------------------------------------------------------- +// CMMS_ItView::~CMMS_ItView() +// ?implementation_description +// --------------------------------------------------------- +// +CMMS_ItView::~CMMS_ItView() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + } + +// --------------------------------------------------------- +// TUid CMMS_ItView::Id() +// ?implementation_description +// --------------------------------------------------------- +// +TUid CMMS_ItView::Id() const + { + return KViewId; + } + +// --------------------------------------------------------- +// CMMS_ItView::HandleCommandL(TInt aCommand) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView::HandleCommandL(TInt aCommand) + { + AppUi()->HandleCommandL( aCommand ); + } + +// --------------------------------------------------------- +// CMMS_ItView::HandleClientRectChange() +// --------------------------------------------------------- +// +void CMMS_ItView::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------- +// CMMS_ItView::DoActivateL(...) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + if (!iContainer) + { + iContainer = new (ELeave) CMMS_ItContainer(iUI); + iContainer->SetMopParent(this); + iContainer->ConstructL( ClientRect() ); + AppUi()->AddToStackL( *this, iContainer ); + } + iUI->ShowDefaultNaviPaneL(); + } + +// --------------------------------------------------------- +// CMMS_ItView::HandleCommandL(TInt aCommand) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView::DoDeactivate() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + iContainer = NULL; + } + +// End of File + diff --git a/src/MMS_ItView2.cpp b/src/MMS_ItView2.cpp new file mode 100644 index 0000000..03ab58d --- /dev/null +++ b/src/MMS_ItView2.cpp @@ -0,0 +1,194 @@ +/* +* ============================================================================ +* Name : CMMS_ItView2 from MMS_ItView2.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include +#include +#include +#include "MMS_ItView2.h" +#include "MMS_ItContainer2.h" +#include "mms_it.hrh" + +#include "MMS_ItDocument.h" +#include "MMS_ItAppUi.h" + +#include // for StringLoader +#include // for queries +#include // for notes + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItView2::CMMS_ItView2(CMMS_ItDocument* aDocument, CMMS_ItAppUi* aUI) +: iDocument(aDocument), iUI(aUI) +{ +} + +// --------------------------------------------------------- +// CMMS_ItView2::ConstructL(const TRect& aRect) +// EPOC two-phased constructor +// --------------------------------------------------------- +// +void CMMS_ItView2::ConstructL() + { + BaseConstructL( R_MMS_IT_VIEW2 ); + } + +// --------------------------------------------------------- +// CMMS_ItView2::~CMMS_ItView2() +// ?implementation_description +// --------------------------------------------------------- +// +CMMS_ItView2::~CMMS_ItView2() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + } + +// --------------------------------------------------------- +// TUid CMMS_ItView2::Id() +// ?implementation_description +// --------------------------------------------------------- +// +TUid CMMS_ItView2::Id() const + { + return KView2Id; + } + +// --------------------------------------------------------- +// CMMS_ItView2::HandleCommandL(TInt aCommand) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView2::HandleCommandL(TInt aCommand) + { + switch ( aCommand ) + { + case ESend: + { + if(iContainer) iContainer->SaveMessageText(); + AppUi()->HandleCommandL( aCommand ); + break; + } + case EEditSubject: + { + if(iContainer) iContainer->SaveMessageText(); + TBuf<100> subject; + if(iDocument->SubjectSet()) subject = iDocument->GetSubject(); + // ask for the subject + CAknTextQueryDialog* subjectDialog = CAknTextQueryDialog::NewL(subject, CAknQueryDialog::ENoTone); + if (subjectDialog->ExecuteLD(R_MMS_IT_SUBJECT_DIALOG)) + { + iDocument->SetSubject(subject); + UpdateContainer(); + } + break; + } + case ESetSMILRoot: + { + if(iContainer) iContainer->SaveMessageText(); + TFileName filename; + // ask for the subject + CAknTextQueryDialog* smilDialog = CAknTextQueryDialog::NewL(filename, CAknQueryDialog::ENoTone); + if (smilDialog->ExecuteLD(R_MMS_IT_SMIL_DIALOG)) + { + if(iDocument->SetSMILFilename(filename)) + { + UpdateContainer(); + } + else + { + HBufC* textResource = StringLoader::LoadLC(R_FILE_NOT_FOUND); + CAknErrorNote* note = new (ELeave) CAknErrorNote(); + note->ExecuteLD(*textResource); + CleanupStack::PopAndDestroy(textResource); + } + } + break; + } + case ERemoveSubject: + { + iDocument->RemoveSubject(); + UpdateContainer(); + break; + } + case ESetDefaultSMIL: + { + iDocument->RemoveSMILFilename(); + UpdateContainer(); + break; + } + default: + { + AppUi()->HandleCommandL( aCommand ); + break; + } + } + } + +// --------------------------------------------------------- +// CMMS_ItView2::HandleClientRectChange() +// --------------------------------------------------------- +// +void CMMS_ItView2::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------- +// CMMS_ItView2::DoActivateL(...) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView2::DoActivateL( + const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + if (!iContainer) + { + iContainer = new (ELeave) CMMS_ItContainer2(iUI, iDocument); + iContainer->SetMopParent(this); + iContainer->ConstructL( ClientRect() ); + AppUi()->AddToStackL( *this, iContainer ); + } + iUI->ShowDefaultNaviPaneL(); + } + +// --------------------------------------------------------- +// CMMS_ItView2::HandleCommandL(TInt aCommand) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView2::DoDeactivate() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + iContainer = NULL; + } + +void CMMS_ItView2::UpdateContainer() +{ + if(iContainer) iContainer->UpdateLabelsL(); + if(iContainer) iContainer->UpdateEditorL(); +} + +// End of File + diff --git a/src/MMS_ItView3.cpp b/src/MMS_ItView3.cpp new file mode 100644 index 0000000..efdf389 --- /dev/null +++ b/src/MMS_ItView3.cpp @@ -0,0 +1,216 @@ +/* +* ============================================================================ +* Name : CMMS_ItView from MMS_ItView.h +* Part of : MMS_It +* Created : 21/11/2004 by +* Implementation notes: +* Initial content was generated by Series 60 AppWizard. +* Copyright: Makidis Michael 2003-2005 +* ============================================================================ +*/ + +// INCLUDE FILES +#include +#include +#include +#include "MMS_ItView3.h" +#include "MMS_ItContainer3.h" + +#include "MMS_ItDocument.h" +#include "MMS_ItAppUi.h" +#include "mms_it.hrh" // for handling commands + +#include // for StringLoader + +// ================= MEMBER FUNCTIONS ======================= + +CMMS_ItView3::CMMS_ItView3(CMMS_ItDocument* aDocument, CMMS_ItAppUi* aUI) +: iDocument(aDocument), iUI(aUI), iContainer(NULL) +{} + +// --------------------------------------------------------- +// CMMS_ItView3::ConstructL(const TRect& aRect) +// EPOC two-phased constructor +// --------------------------------------------------------- +// +void CMMS_ItView3::ConstructL() + { + BaseConstructL( R_MMS_IT_VIEW3 ); + } + +// --------------------------------------------------------- +// CMMS_ItView3::~CMMS_ItView() +// ?implementation_description +// --------------------------------------------------------- +// +CMMS_ItView3::~CMMS_ItView3() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + } + +// --------------------------------------------------------- +// TUid CMMS_ItView3::Id() +// ?implementation_description +// --------------------------------------------------------- +// +TUid CMMS_ItView3::Id() const + { + return KView3Id; + } + +// --------------------------------------------------------- +// CMMS_ItView::HandleCommandL(TInt aCommand) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView3::HandleCommandL(TInt aCommand) + { + switch ( aCommand ) + { + case EAddAttachment: + { + iContainer->AddAttachmentL(); + break; + } + case EAddAttachmentManually: + { + iContainer->AddAttachmentManuallyL(); + break; + } + case ERemoveAttachment: + { + iContainer->RemoveAttachmentL(); + break; + } + case ERemoveAllAttachments: + { + iContainer->RemoveAllAttachments(); + break; + } + case EEditMime: + { + iContainer->EditMimeType(); + break; + } + case EMIMEImgGif: + { + TBuf8<40> mime = _L8("image/gif"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEImgJpeg: + { + TBuf8<40> mime = _L8("image/jpeg"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEImgPng: + { + TBuf8<40> mime = _L8("image/png"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEAudMidi: + { + TBuf8<40> mime = _L8("audio/midi"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEAudSPMidi: + { + TBuf8<40> mime = _L8("audio/sp-midi"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEAudAMR: + { + TBuf8<40> mime = _L8("audio/amr"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEAudMpeg: + { + TBuf8<40> mime = _L8("audio/mpeg"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEVid3GPP: + { + TBuf8<40> mime = _L8("video/3gpp"); + iContainer->SetMimeTypeL(mime); + break; + } + case EMIMEVidMpeg: + { + TBuf8<40> mime = _L8("video/mpeg"); + iContainer->SetMimeTypeL(mime); + break; + } + case ESetDefaultMime: + { + iContainer->ResetMimeTypeL(); + break; + } + default: + { + AppUi()->HandleCommandL( aCommand ); + break; + } + } + } + +// --------------------------------------------------------- +// CMMS_ItView3::HandleClientRectChange() +// --------------------------------------------------------- +// +void CMMS_ItView3::HandleClientRectChange() + { + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + } + } + +// --------------------------------------------------------- +// CMMS_ItView3::DoActivateL(...) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView3::DoActivateL( + const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/) + { + if (!iContainer) + { + iContainer = new (ELeave) CMMS_ItContainer3(iUI, iDocument); + iContainer->SetMopParent(this); + iContainer->ConstructL( ClientRect() ); + AppUi()->AddToStackL( *this, iContainer ); + } + + iContainer->UpdateNaviPanelL(); + } + +// --------------------------------------------------------- +// CMMS_ItView3::HandleCommandL(TInt aCommand) +// ?implementation_description +// --------------------------------------------------------- +// +void CMMS_ItView3::DoDeactivate() + { + if ( iContainer ) + { + AppUi()->RemoveFromViewStack( *this, iContainer ); + } + + delete iContainer; + iContainer = NULL; + } + +// End of File +