# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270059289 -10800 # Node ID 796276a1bdcc15dad7b0e4a4487c2bee1c3cfc57 # Parent bef90b82da7132e924a4a3b404bff768f06be698 Revision: 201011 Kit: 201013 diff -r bef90b82da71 -r 796276a1bdcc imstutils/imconversationview/imcvuiapp/src/cimcvappview.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappview.cpp Mon Mar 15 12:39:32 2010 +0200 +++ b/imstutils/imconversationview/imcvuiapp/src/cimcvappview.cpp Wed Mar 31 21:14:49 2010 +0300 @@ -584,17 +584,13 @@ } else { - TPtrC activeRecipientId = iEngineFactory->GetActiveItemL (); - if(activeRecipientId.Length()) - { - iActiveEngine->MessageHandler().StartNewConversationL (activeRecipientId); + iActiveEngine->MessageHandler().StartNewConversationL (*iRecipientUserId); SetStatusPaneIconsL(); if (iStatusPane) { iStatusPane->BringToForegroundL(); } iViewDeactivated = EFalse; - } } IM_CV_LOGS(TXT("CIMCVAppView::HandleForegroundEventL() end") ); } diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/blue.gif Binary file instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/blue.gif has changed diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/ctc.css --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/ctc.css Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/************************************************************************ -* CSS stylesheet file generated by ctc2html v2.5 -* Copyright (c) 2006-2008 Testwell Oy -************************************************************************/ - - .head1 {font-family: verdana, arial, helvetica, sans-serif; color: #000088; - font-size: 17pt; background-color: white; font-weight: bold;} - .head2 {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 17pt; background-color: white;} - .head3 {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 10pt; background-color: white;} - .black {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 10pt; background-color: white;} - .blackDecoNo {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - text-decoration: none; font-size: 10pt; background-color: white;} - .red {font-family: verdana, arial, helvetica, sans-serif; color: #FF0000; - text-decoration: none; font-size: 10pt; background-color: white;} - .blue {font-family: verdana, arial, helvetica, sans-serif; color: #101080; - text-decoration: none; font-size: 10pt; background-color: white;} - .black_source {font-family: "courier new", courier, monospace; color: #000000; - font-size: 9pt; background-color: white;} - .red_source {font-family: "courier new", courier, monospace; color: #FF0000; - font-size: 9pt; background-color: white;} - .black_profile {font-family: "courier new", courier, monospace; color: #000000; - font-size: 9pt; background-color: #DFDFE5;} - .red_profile {font-family: "courier new", courier, monospace; color: #FF0000; - font-size: 9pt; background-color: #DFDFE5;} - a:hover {text-decoration: underline;} - table.sortable thead {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 10pt; background-color: white; - font-weight: bold; cursor: default;} - table.sortable th {border-bottom: thin solid black; padding-bottom: 0.20em; - padding-right: 0.20em;} - table.sortable td {padding-top: 0.20em; padding-right: 0.20em;} - diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/ctc.js --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/ctc.js Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// Javascript file generated by ctc2html v2.5 -// Copyright (c) 2006-2008 Testwell Oy -///////////////////////////////////////////////////////////////////////// -target=location.hash; -function load(){ -if(target=="#a1"){ -parent.index.location="indexC.html#a1"; -parent.profile.location="indexD1.html"; -} -if(target=="#a2"){ -parent.index.location="indexC.html#a2"; -parent.profile.location="indexD2.html"; -} -if(target=="#a3"){ -parent.index.location="indexC.html#a3"; -parent.profile.location="indexD3.html"; -} -if(target=="#a4"){ -parent.index.location="indexC.html#a4"; -parent.profile.location="indexD4.html"; -} -if(target=="#a5"){ -parent.index.location="indexC.html#a5"; -parent.profile.location="indexD5.html"; -} -if(target=="#a6"){ -parent.index.location="indexC.html#a6"; -parent.profile.location="indexD6.html"; -} -if(target=="#a7"){ -parent.index.location="indexC.html#a7"; -parent.profile.location="indexD7.html"; -} -if(target=="#a8"){ -parent.index.location="indexC.html#a8"; -parent.profile.location="indexD8.html"; -} -} -function load2(){ -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -} diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/index.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/index.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ - - -CTC++ Coverage Report - Files Summary - - - - - - - - -CTC++ Coverage Report - -Files Summary

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- - - - - - - - - - - - -
Symbol file(s): MON.sym (Wed Sep 30 15:27:45 2009)
Data file(s): MON.dat (Wed Sep 30 15:48:28 2009)
Listing produced at: Wed Sep 30 16:37:01 2009
Coverage view: As instrumented
 
Input listing: profile.txt
Html generated at: Wed Sep 30 16:37:09 2009
ctc2html v2.5 options: -i profile.txt 
Threshold percent: 100 %

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  File

Directory: \meco_domain\conversations\instantmessagesalert\src
46 % - 78/ 168 cimalertmanager.cpp
41 % - 20/ 49 cimalertnotifierimpl.cpp
42 % - 8/ 19 cimalertpropertyobserver.cpp
100 %   2/ 2 imalertnotifierfactory.cpp
45 % - 108/ 238 DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\src)
 
Directory: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
79 % - 11/ 14 testinstantmsgalert.cpp
86 % - 38/ 44 testinstantmsgalertblocks.cpp
84 % - 49/ 58 DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src)
 
Directory: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs
40 % - 2/ 5 s_vimpstsettingsstore.cpp
54 % - 7/ 13 s_vimpstsettingsstoreimp.cpp
50 % - 9/ 18 DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs)
 

53 % - 166/ 314 OVERALL

- - - - - - - -
Number of directories: 3
Number of monitored source files: 8
Number of functions: 76
Number of source lines: 2090
Number of measurement points: 399
TER: 53% (decision)

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexA.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexA.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - Index - - - - - - - - - - - - - diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexB1.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexB1.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - \meco_domain\conversations\instantmessagesalert\src - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #1/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\instantmessagesalert\src
-TER: 45 % ( 108/ 238)

-File: \meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
-Instrumentation mode: function-decision
-TER: 46 % ( 78/168)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 17 62 CIMAlertManager::CIMAlertManager()
50 % - 5/ 10 17 76 CIMAlertManager::ConstructL()
100 %   2/ 2 17 193 CIMAlertManager::NewL()
52 % - 15/ 29 17 209 CIMAlertManager::~CIMAlertManager()
63 % - 5/ 8 317 CIMAlertManager::PlayL()
44 % - 8/ 18 337 CIMAlertManager::DoPlayL()
60 % - 3/ 5 22 415 CIMAlertManager::Stop()
100 %   1/ 1 445 CIMAlertManager::SetVolume()
67 % - 2/ 3 457 CIMAlertManager::SetRingingType()
67 % - 2/ 3 472 CIMAlertManager::SetVibra()
67 % - 2/ 3 486 CIMAlertManager::AddObserverL()
67 % - 2/ 3 500 CIMAlertManager::RemoveObserver()
18 % - 3/ 17 516 CIMAlertManager::ProcessFileL()
18 % - 3/ 17 592 CIMAlertManager::DoSetRingingType()
42 % - 5/ 12 649 CIMAlertManager::ConvertVolume()
67 % - 2/ 3 23 684 CIMAlertManager::HandleError()
100 %   1/ 1 698 CIMAlertManager::GetToneFileNameL()
50 % - 3/ 6 715 CIMAlertManager::MapcInitComplete()
50 % - 2/ 4 771 CIMAlertManager::MapcPlayComplete()
60 % - 3/ 5 797 CIMAlertManager::HandleKeyChange()
43 % - 3/ 7 831 CIMAlertManager::HandleNotifyInt()
50 % - 3/ 6 860 CIMAlertManager::MatoPrepareComplete()
50 % - 2/ 4 916 CIMAlertManager::MatoPlayComplete()

46 % - 78/ 168   cimalertmanager.cpp

-File: \meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
-Instrumentation mode: function-decision
-TER: 41 % ( 20/ 49)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 17 35 CIMAlertNotifierImpl::CIMAlertNotifierImpl()
100 %   2/ 2 17 45 CIMAlertNotifierImpl::NewL()
100 %   1/ 1 17 53 CIMAlertNotifierImpl::~CIMAlertNotifierImpl()
50 % - 4/ 8 64 CIMAlertNotifierImpl::SetInt()
0 % - 0/ 8 90 CIMAlertNotifierImpl::GetInt()
50 % - 12/ 24 34 119 CIMAlertNotifierImpl::ListenKeyChanges()
0 % - 0/ 5 162 CIMAlertNotifierImpl::HandlePropertyNotificationEventL()

41 % - 20/ 49   cimalertnotifierimpl.cpp

-File: \meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
-Instrumentation mode: function-decision
-TER: 42 % (  8/ 19)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 37 CIMAlertPropertyObserver::CIMAlertPropertyObserver()
100 %   2/ 2 34 51 CIMAlertPropertyObserver::NewL()
67 % - 2/ 3 34 60 CIMAlertPropertyObserver::~CIMAlertPropertyObserver()
50 % - 2/ 4 34 74 CIMAlertPropertyObserver::ObservePropertyChangeL()
0 % - 0/ 3 92 CIMAlertPropertyObserver::CancelObserve()
0 % - 0/ 1 105 CIMAlertPropertyObserver::RunL()
100 %   1/ 1 34 117 CIMAlertPropertyObserver::DoCancel()
0 % - 0/ 2 127 CIMAlertPropertyObserver::Category()
0 % - 0/ 2 137 CIMAlertPropertyObserver::Key()

42 % - 8/ 19   cimalertpropertyobserver.cpp

-File: \meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
-Instrumentation mode: function-decision
-TER: 100 % (  2/  2)
-To files: Previous | -Next

- - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 17 34 IMAlertNotifierFactory::CreateNotifierL()

100 %   2/ 2   imalertnotifierfactory.cpp
 

45 % - 108/ 238   DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\src)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexB2.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexB2.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #2/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
-TER: 84 % ( 49/ 58)

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
-Instrumentation mode: function-decision
-TER: 79 % ( 11/ 14)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 17 80 Ctestinstantmsgalert::Ctestinstantmsgalert()
57 % - 4/ 7 17 91 Ctestinstantmsgalert::ConstructL()
100 %   2/ 2 17 140 Ctestinstantmsgalert::NewL()
100 %   1/ 1 17 154 Ctestinstantmsgalert::~Ctestinstantmsgalert()
100 %   1/ 1 17 170 Ctestinstantmsgalert::SendTestClassVersion()
100 %   2/ 2 17 191 LibEntryL()

79 % - 11/ 14   testinstantmsgalert.cpp

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
-Instrumentation mode: function-decision
-TER: 86 % ( 38/ 44)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 17 83 Ctestinstantmsgalert::Delete()
100 %   2/ 2 17 93 Ctestinstantmsgalert::RunMethodL()
0 % - 0/ 4 138 Ctestinstantmsgalert::ExampleL()
60 % - 3/ 5 168 Ctestinstantmsgalert::CIMAlertManager_NewL()
100 %   2/ 2 190 Ctestinstantmsgalert::CIMAlertManager_PlayL()
100 %   2/ 2 204 Ctestinstantmsgalert::CIMAlertManager_SetVolume()
100 %   2/ 2 220 Ctestinstantmsgalert::CIMAlertManager_SetRingingType()
100 %   2/ 2 235 Ctestinstantmsgalert::CIMAlertManager_SetVibra()
100 %   2/ 2 250 Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType()
100 %   2/ 2 265 Ctestinstantmsgalert::CIMAlertManager_ConvertVolume()
100 %   2/ 2 281 Ctestinstantmsgalert::CIMAlertManager_Stop()
100 %   2/ 2 296 Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete()
100 %   2/ 2 311 Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete()
100 %   2/ 2 326 Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange()
100 %   2/ 2 342 Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt()
100 %   2/ 2 356 Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete()
100 %   2/ 2 370 Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete()
100 %   2/ 2 385 Ctestinstantmsgalert::CIMAlertManager_AddObserverL()
100 %   2/ 2 401 Ctestinstantmsgalert::CIMAlertManager_RemoveObserver()
100 %   2/ 2 417 Ctestinstantmsgalert::CIMAlertManager_HandleError()

86 % - 38/ 44   testinstantmsgalertblocks.cpp
 

84 % - 49/ 58   DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexB3.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexB3.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #3/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs
-TER: 50 % ( 9/ 18)

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
-Instrumentation mode: function-decision
-TER: 40 % (  2/  5)
-To files: Previous | -Next

- - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 17 43 CVIMPSTSettingsStore::NewL()
0 % - 0/ 1 55 CVIMPSTSettingsStore::~CVIMPSTSettingsStore()
0 % - 0/ 2 65 CVIMPSTSettingsStore::NewLC()

40 % - 2/ 5   s_vimpstsettingsstore.cpp

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
-Instrumentation mode: function-decision
-TER: 54 % (  7/ 13)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 43 CVIMPSTSettingsStoreImp::InitialiseLibraryL()
0 % - 0/ 1 50 CVIMPSTSettingsStoreImp::Release()
100 %   2/ 2 17 58 CVIMPSTSettingsStoreImp::NewL()
100 %   1/ 1 17 72 CVIMPSTSettingsStoreImp::ConstructL()
100 %   1/ 1 17 81 CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp()
75 % - 3/ 4 86 CVIMPSTSettingsStoreImp::GetL()
0 % - 0/ 2 100 CVIMPSTSettingsStoreImp::SetL()

54 % - 7/ 13   s_vimpstsettingsstoreimp.cpp
 

50 % - 9/ 18   DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexC.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexC.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - Index - - - - - - - - -Index
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
\meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
   CIMAlertManager::CIMAlertManager()
   CIMAlertManager::ConstructL()
   CIMAlertManager::NewL()
   CIMAlertManager::~CIMAlertManager()
   CIMAlertManager::PlayL()
   CIMAlertManager::DoPlayL()
   CIMAlertManager::Stop()
   CIMAlertManager::SetVolume()
   CIMAlertManager::SetRingingType()
   CIMAlertManager::SetVibra()
   CIMAlertManager::AddObserverL()
   CIMAlertManager::RemoveObserver()
   CIMAlertManager::ProcessFileL()
   CIMAlertManager::DoSetRingingType()
   CIMAlertManager::ConvertVolume()
   CIMAlertManager::HandleError()
   CIMAlertManager::GetToneFileNameL()
   CIMAlertManager::MapcInitComplete()
   CIMAlertManager::MapcPlayComplete()
   CIMAlertManager::HandleKeyChange()
   CIMAlertManager::HandleNotifyInt()
   CIMAlertManager::MatoPrepareComplete()
   CIMAlertManager::MatoPlayComplete()
 
\meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
   CIMAlertNotifierImpl::CIMAlertNotifierImpl()
   CIMAlertNotifierImpl::NewL()
   CIMAlertNotifierImpl::~CIMAlertNotifierImpl()
   CIMAlertNotifierImpl::SetInt()
   CIMAlertNotifierImpl::GetInt()
   CIMAlertNotifierImpl::ListenKeyChanges()
   CIMAlertNotifierImpl::HandlePropertyNotificationEventL()
 
\meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
   CIMAlertPropertyObserver::CIMAlertPropertyObserver()
   CIMAlertPropertyObserver::NewL()
   CIMAlertPropertyObserver::~CIMAlertPropertyObserver()
   CIMAlertPropertyObserver::ObservePropertyChangeL()
   CIMAlertPropertyObserver::CancelObserve()
   CIMAlertPropertyObserver::RunL()
   CIMAlertPropertyObserver::DoCancel()
   CIMAlertPropertyObserver::Category()
   CIMAlertPropertyObserver::Key()
 
\meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
   IMAlertNotifierFactory::CreateNotifierL()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
   Ctestinstantmsgalert::Ctestinstantmsgalert()
   Ctestinstantmsgalert::ConstructL()
   Ctestinstantmsgalert::NewL()
   Ctestinstantmsgalert::~Ctestinstantmsgalert()
   Ctestinstantmsgalert::SendTestClassVersion()
   LibEntryL()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
   Ctestinstantmsgalert::Delete()
   Ctestinstantmsgalert::RunMethodL()
   Ctestinstantmsgalert::ExampleL()
   Ctestinstantmsgalert::CIMAlertManager_NewL()
   Ctestinstantmsgalert::CIMAlertManager_PlayL()
   Ctestinstantmsgalert::CIMAlertManager_SetVolume()
   Ctestinstantmsgalert::CIMAlertManager_SetRingingType()
   Ctestinstantmsgalert::CIMAlertManager_SetVibra()
   Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType()
   Ctestinstantmsgalert::CIMAlertManager_ConvertVolume()
   Ctestinstantmsgalert::CIMAlertManager_Stop()
   Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete()
   Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete()
   Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange()
   Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt()
   Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete()
   Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete()
   Ctestinstantmsgalert::CIMAlertManager_AddObserverL()
   Ctestinstantmsgalert::CIMAlertManager_RemoveObserver()
   Ctestinstantmsgalert::CIMAlertManager_HandleError()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
   CVIMPSTSettingsStore::NewL()
   CVIMPSTSettingsStore::~CVIMPSTSettingsStore()
   CVIMPSTSettingsStore::NewLC()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
   CVIMPSTSettingsStoreImp::InitialiseLibraryL()
   CVIMPSTSettingsStoreImp::Release()
   CVIMPSTSettingsStoreImp::NewL()
   CVIMPSTSettingsStoreImp::ConstructL()
   CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp()
   CVIMPSTSettingsStoreImp::GetL()
   CVIMPSTSettingsStoreImp::SetL()
diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD1.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD1.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,996 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - cimalertmanager.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #1/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
-Instrumentation mode: function-decision
-TER: 46 % ( 78/168)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ==============================================================================
  3  *  Name        : cimalertmanager.cpp
  4  *  Part of     : conversations/instantmessagesalert
  5  *  Description : This class gives interface to play IM message alert
  6  *  Version     : %version: 3 %
  7  *
  8  *  Copyright © 2009 Nokia. All rights reserved..
  9  *  This material, including documentation and any related 
  10  *  computer programs, is protected by copyright controlled by 
  11  *  Nokia Corporation. All rights are reserved. Copying, 
  12  *  including reproducing, storing, adapting or translating, any 
  13  *  or all of this material requires the prior written consent of 
  14  *  Nokia Corporation. This material also contains confidential 
  15  *  information which may not be disclosed to others without the 
  16  *  prior written consent of Nokia Corporation.
  17  * ==============================================================================
  18  */
  19 
  20 // INCLUDE FILES
  21 #include    "cimalertmanager.h"
  22 #include    "imalertdebugprint.h"      
  23 #include    "mimalertmanagerobserver.h"
  24 #include    "mimalertnotifierinterface.h"
  25 #include    "imalertnotifierfactory.h"
  26 
  27 #include    <MProfileEngine.h>
  28 #include   <pathinfo.h>
  29 #include    <mda/common/resource.h>
  30 #include    <audiopreference.h>
  31 #include    <bautils.h>
  32 #include    <hwrmvibrasdkcrkeys.h>
  33 #include    <coreapplicationuisdomainpskeys.h>
  34 #include    <ProfileEngineSDKCRKeys.h>
  35 #include    <MProfileTones.h>
  36 #include    <TProfileToneSettings.h>
  37 #include    <MProfile.h>
  38 #include    <HWRMVibra.h>
  39 
  40 //to get message tone file
  41 #include <cvimpstsettingsstore.h>
  42 
  43 
  44 // CONSTANTS
  45 const TInt KMinVolumeLevel( 1 );
  46 const TInt KMaxVolumeLevel( 10 );
  47 const TInt KToneInterval( 1000000 ); // 1 second pause between tones
  48 
  49 _LIT( KChatRngMimeType, "application/vnd.nokia.ringing-tone" );
  50 _LIT( KBeepOnceSound, "beep.rng" );
  51 _LIT( KProfileSilentTone, "No_Sound.wav" ); 
  52 
  53     
  54 // ============================ MEMBER FUNCTIONS ===============================
  55 
  56 // -----------------------------------------------------------------------------
  57 // CIMAlertManager::CIMAlertManager
  58 // C++ default constructor can NOT contain any code, that
  59 // might leave.
  60 // -----------------------------------------------------------------------------
  61 //
Top
17 17   62 CIMAlertManager::CIMAlertManager()
  63     :   iAudioPlayerStatus( EAudioPlayerNotCreated ),
  64       iTonePlayerStatus( EAudioPlayerNotCreated ),
  65         iIsPlayingDefaultIMSound( EFalse ),
  66         iCallState (EFalse)
  67     {
  68     }
  69 
  70 // ---------------------------------------------------------
  71 // CIMAlertManager::ConstructL
  72 // (other items were commented in a header).
  73 // ---------------------------------------------------------
  74 //
  75 
Top
17 17   76 void CIMAlertManager::ConstructL()
  77     {
  78     CHAT_DP_FUNC_ENTER("ConstructL");    
  79     iProfileApi = CreateProfileEngineL();
  80         
  81     User::LeaveIfError( iFs.Connect() );
  82 
  83     CHAT_DP_TXT("CMdaAudioPlayerUtility::NewL()" );
  84 
  85    iAudioPlayer = CMdaAudioPlayerUtility::NewL( *this );
  86    iAudioPlayerStatus = EAudioPlayerReady;
  87 
  88     CHAT_DP_TXT("CMdaAudioToneUtility::NewL()" );
  89    iTonePlayer = CMdaAudioToneUtility::NewL( *this );
  90    iTonePlayerStatus = EAudioPlayerReady;
  91  
  92     iProfilesRepository = CRepository::NewL( KCRUidProfileEngine );
  93     iVibraRepository = CRepository::NewL( KCRUidVibraCtrl );
  94  
  95     // Get initial settings from active profile
  96     iRingingVolumeNotifyHandler = CCenRepNotifyHandler::NewL( *this, 
  97                                               *iProfilesRepository,
  98                                               CCenRepNotifyHandler::EIntKey,
  99                                               KProEngActiveRingingVolume );
  100     iRingingVolumeNotifyHandler->StartListeningL();
  101     
  102     
  103     iRingingTypeNotifyHandler = CCenRepNotifyHandler::NewL( *this, 
  104                                               *iProfilesRepository,
  105                                               CCenRepNotifyHandler::EIntKey,
  106                                               KProEngActiveRingingType );
  107     iRingingTypeNotifyHandler->StartListeningL();
  108     
  109     
  110     iVibraNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iVibraRepository,
  111                                               CCenRepNotifyHandler::EIntKey,
  112                                               KVibraCtrlProfileVibraEnabled );
  113     iVibraNotifyHandler->StartListeningL();
  114     
  115     User::LeaveIfError( iProfilesRepository->Get( KProEngActiveRingingVolume, 
  116                                                   iRingingVolume ) );
  117                                                  
  118     User::LeaveIfError( iVibraRepository->Get( KVibraCtrlProfileVibraEnabled, 
  119                                                iVibra ) );
  120     
  121     User::LeaveIfError( iApaSession.Connect() );
  122 
  123     // register for changes in message Tone quitting
  124     iNotifierAPI = IMAlertNotifierFactory::CreateNotifierL( this );
  125     iNotifierAPI->ListenKeyChanges( MIMAlertNotifierInterface::EMSGToneQuitKey );
  126     // also register for changes in call state 
  127     iNotifierAPI->ListenKeyChanges( MIMAlertNotifierInterface::ECallState );
  128     iToneFileName = HBufC::NewL( KMaxPath );
  129 
  130     // Get path to beep once ringing tone, first check simple sound folder.
  131     TFileName beepFile = PathInfo::RomRootPath();
  132     beepFile.Append( PathInfo::SimpleSoundsPath() );
  133     beepFile.Append( KBeepOnceSound );
  134     RFile file;
  135     TInt openErr = file.Open( iFs, beepFile, EFileRead );
  136     file.Close();
  137     
17 - 138     if ( openErr == KErrNotFound || openErr == KErrPathNotFound )
  139         {
  140         // Check digital sounds folder
  141         beepFile.Zero();
  142         beepFile.Append( PathInfo::RomRootPath() );
  143         beepFile.Append( PathInfo::DigitalSoundsPath() );
  144         beepFile.Append( KBeepOnceSound );
  145         openErr = file.Open( iFs, beepFile, EFileRead );
  146         file.Close();
  147         }    
  148     
  149     CHAT_DP( D_PLAIN_LIT( "CIMAlertManager::ConstructL() openErr = %d" ), openErr );
  150     
17 - 151     if ( openErr == KErrNone )
  152         {
  153         iBeepRingingTone = beepFile.AllocL();
  154         TPtrC ptr = iBeepRingingTone->Des();
  155         CHAT_DP( D_PLAIN_LIT( "CIMAlertManager::ConstructL() iBeepRingingTone = %S" ), &ptr );
  156         }
    157     else
  158         {
  159         HandleError( openErr );
  160         }
  161 
  162     // get active ringing type, change events come to us later...
  163     iActiveProfile = iProfileApi->ActiveProfileL();
  164     const MProfileTones& profileTones = iActiveProfile->ProfileTones();
  165     const TProfileToneSettings& profileSettings = profileTones.ToneSettings();
  166     iRingingType = profileSettings.iRingingType;
  167     iActiveProfile->Release();
  168     iActiveProfile = NULL; // prevent further usage
  169     // after this, active ringing type changes are notified via the cenrep
  170     // notify handler callback through HandleNotifyInt
  171     
  172     // TRAP to catch leaves, leaves with KErrNotSupported if vibra
  173     // is not supported
17 17   174     TRAPD( err, iVibrator = CHWRMVibra::NewL() );
 - 174   catch (XLeaveException & l)
 - 174   catch (...)
17 - 175     if ( err == KErrNotSupported )
  176         {
  177         // Make sure it's NULL
  178         iVibrator = NULL;
  179         }
    180     else
  181         {
  182         // Leave with other errors e.g. KErrNoMemory
  183         User::LeaveIfError( err );
  184         }
  185     iSettingsStore = CVIMPSTSettingsStore::NewL();
  186     CHAT_DP_FUNC_DONE("ConstructL");
  187     }
  188 
  189 // ---------------------------------------------------------
  190 // CIMAlertManager::NewL
  191 // (other items were commented in a header).
  192 // ---------------------------------------------------------
Top
17   193 EXPORT_C CIMAlertManager* CIMAlertManager::NewL()
  194     {
  195     CIMAlertManager* self = new( ELeave ) CIMAlertManager();
  196 
  197     CleanupStack::PushL( self );
  198     self->ConstructL();
  199     CleanupStack::Pop( self );
  200 
17    201     return self;
  202     }
  203 
  204 
  205 // ---------------------------------------------------------
  206 // CIMAlertManager::~CIMAlertManager
  207 // (other items were commented in a header).
  208 // ---------------------------------------------------------
Top
17 17   209 CIMAlertManager::~CIMAlertManager()
  210     {
  211     CHAT_DP_FUNC_ENTER("~CIMAlertManager");
  212     Stop(); // Stops possible playback
  213 
17 - 214     if ( iActiveProfile )
  215         {
  216         iActiveProfile->Release();
  217         iActiveProfile = NULL; // prevent further usage
  218         }
  219 
17 - 220     if ( iProfileApi ) 
  221         {
  222         iProfileApi->Release();
  223         iProfileApi = NULL;
  224         }
  225 
17 - 226     if ( iVibraNotifyHandler )
  227         {
  228         iVibraNotifyHandler->StopListening();
  229         delete iVibraNotifyHandler;
  230         iVibraNotifyHandler = NULL;
  231         }
  232     
17 - 233     if ( iRingingTypeNotifyHandler )
  234         {
  235         iRingingTypeNotifyHandler->StopListening();
  236         delete iRingingTypeNotifyHandler;
  237         iRingingTypeNotifyHandler = NULL;
  238         }
  239     
  240 
17 - 241     if ( iRingingVolumeNotifyHandler )
  242         {
  243         iRingingVolumeNotifyHandler->StopListening();
  244         delete iRingingVolumeNotifyHandler;
  245         iRingingVolumeNotifyHandler = NULL;
  246         }
17 - 247     if(iProfilesRepository)
  248         {
  249         delete iProfilesRepository;
  250         iProfilesRepository = NULL;
  251         }
17 - 252     if(iVibraRepository)
  253         {
  254         delete iVibraRepository;
  255         iVibraRepository = NULL;
  256         }
  257     
  258     iApaSession.Close();
  259     
17 - 260     if(iNotifierAPI)
  261         {
  262         delete iNotifierAPI;
  263         iNotifierAPI = NULL;
  264         }
  265     
17 - 266     if(iAudioPlayer)
  267         {
  268         CHAT_DP_TXT( "delete CMdaAudioPlayerUtility" );
  269         iAudioPlayer->Close();
  270         delete iAudioPlayer;
  271         iAudioPlayer = NULL;
  272         }
17 - 273     if(iTonePlayer)
  274         {
  275         CHAT_DP_TXT( "delete CMdaAudioToneUtility" );
  276         delete iTonePlayer;
  277         iTonePlayer = NULL;
  278         }
  279     
  280     iObservers.Close();
  281 
17 - 282     if(iToneFileName)
  283         {
  284         delete iToneFileName;
  285         iToneFileName = NULL;
  286         }
  287 
17 - 288     if(iVibrator)
  289         {
  290         delete iVibrator;
  291         iVibrator = NULL;
  292         }
  293 
17 - 294     if(iBeepRingingTone)
  295         {
  296         delete iBeepRingingTone;
  297         iBeepRingingTone = NULL;
  298         }
  299 
  300     iFs.Close();
  301     
17 - 302     if(iSettingsStore)
  303         {
  304         delete iSettingsStore;
  305         iSettingsStore = NULL;
  306         }
  307     
  308     CHAT_DP_FUNC_DONE("~CIMAlertManager");
  309     }
  310 
  311 
  312 // ---------------------------------------------------------
  313 // CIMAlertManager::Play
  314 // (other items were commented in a header).
  315 // ---------------------------------------------------------
  316 //
Top
  317 EXPORT_C void CIMAlertManager::PlayL(TUint32 aServiceId)
  318     {
  319     CHAT_DP_FUNC_ENTER("Play");
- 320     if( !iCallState )
  321         {
  322         Stop();
  323         TRAPD( err, DoPlayL(aServiceId) );
   323     catch (XLeaveException & l)
 - 323     catch (...)
- 324         if( err )
  325             {
  326             HandleError( err );
  327             }
  328         }
  329     CHAT_DP_FUNC_DONE("Play");
  330     }
  331 
  332 // ---------------------------------------------------------
  333 // CIMAlertManager::DoPlayL
  334 // (other items were commented in a header).
  335 // ---------------------------------------------------------
  336 //
Top
  337 EXPORT_C void CIMAlertManager::DoPlayL(TUint32 aServiceId)
  338     {
  339     CHAT_DP_FUNC_ENTER("DoPlayL");
  340 
  341     TBuf<KMaxPath> toneFileName;
  342 
  343     // check if we're silent or not
  344     iActiveProfile = iProfileApi->ActiveProfileL();
  345     TBool isSilent = iActiveProfile->IsSilent();
  346     iActiveProfile->Release();
  347     iActiveProfile = NULL; // prevent further usage
  348 
  349     // vibrate, if it's allowed
  350     CHWRMVibra::TVibraModeState vibraModeState = iVibrator->VibraSettings();
  351     CHWRMVibra::TVibraStatus vibraStatus = iVibrator->VibraStatus();
  352    
  353     // TODO: Find from Nikhil what the behaviour should be if Vibra is already
  354     // on and you get a new message. Aare you supposed to truncate the existing
  355     // vibration and start afresh or let the existing vibration continue?
  356     if ( vibraModeState == CHWRMVibra::EVibraModeON && 
- 357          vibraStatus == CHWRMVibra::EVibraStatusStopped )
  358         {
  359         iVibrator->StartVibraL( KIMVibraDuration );
  360         }
  361 
  362     // sound ordering:
  363     //  silent: get out.
  364     //  beep once: beep, and if ok, exit.
  365     //  if beep failed, or not active: try to play sound
  366     //  for this server.
  367     //  if it failed, play default sound.
  368 
- 369     if ( isSilent ) 
  370         {
  371         // Silent profile, get out.
  372         CHAT_DP_TXT( "DoPlayL - Returning" );
 - 373         return;
  374         }
  375 
  376     TInt err = KErrNone;
  377 
- 378     if ( iRingingType == EProfileRingingTypeBeepOnce && iBeepRingingTone )
  379         {
  380         // Play beep.rng
- 381         TRAP( err, ProcessFileL( *iBeepRingingTone ) );
 - 381     catch (XLeaveException & l)
 - 381     catch (...)
  382         }
  383     
- 384     if ( err != KErrNone || iRingingType != EProfileRingingTypeBeepOnce )
  385         {
  386         err = KErrNone;
  387 
  388         // Beep once not active, or beep once failed.
  389         // Try to play the sound set for this server
  390         TBuf<KMaxPath> toneFileName;
  391       GetToneFileNameL( toneFileName, aServiceId );
  392       TParsePtr parsedPtr( toneFileName );
  393       
  394       CHAT_DP( D_CHAT_LIT(" file = [%S] "),&toneFileName);
  395 
  396       // If alert tone OFF, don't play anything
- 397         if( parsedPtr.NameAndExt().Compare( KProfileSilentTone ) != 0 )
  398             {
  399             // Not OFF
  400             TRAP( err, ProcessFileL( toneFileName ) );        
   400       catch (XLeaveException & l)
 - 400       catch (...)
  401             }
  402         }
  403 
  404     // Not ringing once, but left
  405     User::LeaveIfError( err );
  406 
  407     CHAT_DP_FUNC_DONE("DoPlayL");
  408     }
  409 
  410 // ---------------------------------------------------------
  411 // CIMAlertManager::Stop
  412 // (other items were commented in a header).
  413 // ---------------------------------------------------------
  414 //
Top
22 22   415 EXPORT_C void CIMAlertManager::Stop()
  416     {
  417     CHAT_DP_FUNC_ENTER("Stop");
  418 
22 - 419     if( iAudioPlayerStatus == EAudioPlayerPlaying )
  420         {
  421         CHAT_DP_TXT( 
  422             "Audio player is playing. CMdaAudioPlayerUtility::Stop()" );
  423         iAudioPlayer->Stop();
  424         iAudioPlayer->Close();        
  425         iAudioPlayerStatus = EAudioPlayerReady;
  426         }
  427     
22 - 428     if( iTonePlayerStatus == EAudioPlayerPlaying )
  429         {
  430         CHAT_DP_TXT( 
  431             "Tone player is playing. CMdaAudioToneUtility::CancelPlay()" );
  432         iTonePlayer->CancelPlay();        
  433         iTonePlayerStatus = EAudioPlayerReady;
  434         }    
  435    
  436     CHAT_DP_FUNC_DONE("Stop");
  437     }
  438 
  439 // ---------------------------------------------------------
  440 // CIMAlertManager::SetVolume
  441 // Set the volume at which the sound is played
  442 // (other items were commented in a header).
  443 // ---------------------------------------------------------
  444 //
Top
  445 EXPORT_C void CIMAlertManager::SetVolume( TInt aVolume )
  446     {
  447     iRingingVolumeNotifyHandler->StopListening();
  448     iRingingVolume = aVolume;
  449     }
  450 
  451 // ---------------------------------------------------------
  452 // CIMAlertManager::SetRingingType
  453 // Sets the ringing type how the sound is played
  454 // (other items were commented in a header).
  455 // ---------------------------------------------------------
  456 //
Top
  457 EXPORT_C void CIMAlertManager::SetRingingType( TProfileRingingType aRingingType )
  458     {
- 459     if(iRingingTypeNotifyHandler)
  460         {
  461         iRingingTypeNotifyHandler->StopListening();
  462         iRingingType = aRingingType;
  463         }
  464     }
  465 
  466 // ---------------------------------------------------------
  467 // CIMAlertManager::SetVibra
  468 // Sets the vibrating alert on or off
  469 // (other items were commented in a header).
  470 // ---------------------------------------------------------
  471 //
Top
  472 EXPORT_C void CIMAlertManager::SetVibra( TBool aVibra )
  473     {
- 474     if(iVibraNotifyHandler)
  475         {
  476         iVibraNotifyHandler->StopListening();
  477         iVibra = aVibra;
  478         }
  479     }
  480 
  481 // ---------------------------------------------------------
  482 // CIMAlertManager::AddObserverL
  483 // (other items were commented in a header).
  484 // ---------------------------------------------------------
  485 //
Top
  486 EXPORT_C void CIMAlertManager::AddObserverL( const MIMAlertManagerObserver* aObserver )
  487    {
  488     // make sure that aObserver does not get appended in release mode also.
- 489    if( aObserver )  
  490       {
  491          User::LeaveIfError( iObservers.Append( aObserver ) );
  492       }
  493    }
  494 
  495 // ---------------------------------------------------------
  496 // CIMAlertManager::RemoveObserver
  497 // (other items were commented in a header).
  498 // ---------------------------------------------------------
  499 //
Top
  500 EXPORT_C void CIMAlertManager::RemoveObserver( const MIMAlertManagerObserver* aObserver )
  501    {
  502    TInt index( iObservers.Find( aObserver ) );
  503 
- 504    if( index != KErrNotFound )
  505       {
  506       iObservers.Remove( index );
  507       }
  508    }
  509 
  510 // ---------------------------------------------------------
  511 // CIMAlertManager::ProcessFileL
  512 // If filename is defined, prepare the audioplayer.
  513 // (other items were commented in a header).
  514 // ---------------------------------------------------------
  515 //
Top
  516 void CIMAlertManager::ProcessFileL( const TDesC& aFileName )
  517     {
  518     CHAT_DP_FUNC_ENTER("ProcessFileL");
  519 
  520     TFileName *fileName = new (ELeave) TFileName();
  521     CleanupStack::PushL( fileName );
  522 
  523     // if filename is empty, use default sound
- 524     if ( aFileName.Length() == 0 )
  525         {
 - 526         return;
  527         }
    528     else
  529         {
  530         *fileName = aFileName;
  531         }
  532 
  533     TPtr filePtr( NULL, 0 );
- 534     if( !BaflUtils::FileExists( iFs, *fileName ) )
  535         {
  536         CHAT_DP( D_CHAT_LIT( "File does not exist ( %S )" ), &(*fileName) );
  537         User::Leave( KErrNotFound );
  538         }
  539 
  540     Stop(); // Stops possible playback 
  541 
  542     TUid dummyUid( KNullUid );
  543    TDataType dataType;
  544    
  545     User::LeaveIfError( iApaSession.AppForDocument( *fileName, dummyUid, 
  546                                                     dataType ) );
  547 
- 548     if( dataType.Des().CompareF( KChatRngMimeType ) == 0 ) 
  549         {
  550         // making sure that another initializing is not already ongoing
- 551         if( iTonePlayerStatus == EAudioPlayerReady )
  552             {
  553             CHAT_DP( D_CHAT_LIT( 
  554                 "CMdaAudioToneUtility::PrepareToPlayFileSequence( %S )" ), 
  555                 &(*fileName));
  556             iTonePlayerStatus = EAudioPlayerInitializing;
  557             iTonePlayer->PrepareToPlayFileSequence( *fileName );
  558             }
  559         }
    560     else
  561         {
  562         // making sure that another initializing is not already ongoing
- 563         if( iAudioPlayerStatus == EAudioPlayerReady )
  564             {
  565             CHAT_DP( D_CHAT_LIT(
  566                 "FileList - CMdaAudioPlayerUtility::OpenFileL( %S )" ), 
  567                 &(*fileName));
  568             iAudioPlayerStatus = EAudioPlayerInitializing;
- 569             TRAPD( err, iAudioPlayer->OpenFileL( *fileName ) );
 - 569       catch (XLeaveException & l)
 - 569       catch (...)
  570             CHAT_DP( D_CHAT_LIT(
  571                 "FileList - CMdaAudioPlayerUtility::OpenFileL err = %d" ), 
  572                 err );
- 573             if( err )
  574                 {              
  575                 iAudioPlayerStatus = EAudioPlayerReady;
  576                 User::Leave( err );
  577                 }
  578             }
  579         }    
  580 
  581     CleanupStack::PopAndDestroy( fileName );
  582     CHAT_DP_FUNC_DONE("ProcessFileL");
  583     }
  584 
  585 // ---------------------------------------------------------
  586 // CIMAlertManager::DoSetRingingType
  587 // When audioplayer is ready, set its ringing type
  588 // (other items were commented in a header).
  589 // ---------------------------------------------------------
  590 //
  591 
Top
  592 void CIMAlertManager::DoSetRingingType( TInt aRingingType )
  593     {
- 594     if( iAudioPlayerStatus == EAudioPlayerInitialized )
  595         {
    596         switch( aRingingType )
  597             {
  598          // Fall through
 - 599             case EProfileRingingTypeRingingOnce:
  600                 {
  601                 iAudioPlayer->SetRepeats( 0, 
  602                         TTimeIntervalMicroSeconds( KToneInterval ) );
 - 603                 break;
  604                 }
 - 605             case EProfileRingingTypeBeepOnce:
  606                 {
  607                 iAudioPlayer->SetRepeats( 0, 
  608                         TTimeIntervalMicroSeconds( KToneInterval ) );
 - 609                 break;
  610                 }
 - 611             default:
  612                 {
 - 613                 break;
  614                 }
  615             }
  616         }
- 617     else if( iTonePlayerStatus == EAudioPlayerInitialized )
  618         {
    619         switch( aRingingType )
  620             {
  621          // Fall through
 - 622             case EProfileRingingTypeRingingOnce:
  623                 {
  624                 iTonePlayer->SetRepeats( 0, 
  625                         TTimeIntervalMicroSeconds( KToneInterval ) );
 - 626                 break;
  627                 }
 - 628             case EProfileRingingTypeBeepOnce:
  629                 {
  630                 iTonePlayer->SetRepeats( 0, 
  631                         TTimeIntervalMicroSeconds( KToneInterval ) );
 - 632                 break;
  633                 }
 - 634             default:
  635                 {
 - 636                 break;
  637                 }
  638             }
  639         }
  640     }
  641 
  642 // ---------------------------------------------------------
  643 // CIMAlertManager::ConvertVolume
  644 // Convert volume to the scale used by hardware.
  645 // E.g. Profiles lets user select volume 1-10, but hw's scale is normally 1-9.
  646 // (other items were commented in a header).
  647 // ---------------------------------------------------------
  648 //
Top
  649 TInt CIMAlertManager::ConvertVolume( TInt aVolume )
  650     {
  651     TInt result( 0 );
  652     // if ringing type is "silent" then volume
  653     // is zero
- 654     if( iRingingType != EProfileRingingTypeSilent )
  655         {
  656         if ( iAudioPlayerStatus == EAudioPlayerInitialized ||
- 657             iAudioPlayerStatus == EAudioPlayerPlaying )
  658             {
  659             result = iAudioPlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
- 660             if ( aVolume == KMinVolumeLevel && result == 0 )
  661                 {
  662                 result = 1;
  663                 }
  664             }
  665         else if( iTonePlayerStatus == EAudioPlayerInitialized ||
- 666             iTonePlayerStatus == EAudioPlayerPlaying )
  667             {
  668             result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
- 669             if ( aVolume == KMinVolumeLevel && result == 0 )
  670                 {
  671                 result = 1;
  672                 }
  673             }
  674         }
   675     return result;
  676     }
  677 
  678 // ---------------------------------------------------------
  679 // CIMAlertManager::HandleError
  680 // Notifies all observers that playing is completed
  681 // (other items were commented in a header).
  682 // ---------------------------------------------------------
  683 //
Top
23 23   684 void CIMAlertManager::HandleError( TInt aError )
  685     {
  686     if ( ( aError == KErrNoMemory ) || 
23 - 687          ( aError == KErrDiskFull ) ) 
  688       {
  689       CActiveScheduler::Current()->Error( aError );
  690       }
  691     }
  692 
  693 // ---------------------------------------------------------
  694 // CIMAlertManager::GetToneFileNameL
  695 // (other items were commented in a header).
  696 // ---------------------------------------------------------
  697 //
Top
  698 void CIMAlertManager::GetToneFileNameL( TDes& aToneFileName ,TUint32 aServiceId)
  699    {
  700     RBuf buffer;
  701     buffer.CreateL( RProperty::KMaxPropertySize ); 
  702     CleanupClosePushL( buffer );
  703     iSettingsStore->GetL(aServiceId, EServiceToneFileName, buffer); 
  704     aToneFileName.Copy( buffer );
  705     CleanupStack::PopAndDestroy();  //buffer
  706     }
  707 
  708 // ---------------------------------------------------------
  709 // CIMAlertManager::MapcInitComplete
  710 // This method is called when the audioplayer initialisation is ready.
  711 // If file format is supported, start playing the sound file.
  712 // (other items were commented in a header).
  713 // ---------------------------------------------------------
  714 //
Top
  715 void CIMAlertManager::MapcInitComplete(
  716     TInt aError, const TTimeIntervalMicroSeconds& /* aDuration */ )
  717     {
  718     CHAT_DP( D_CHAT_LIT(
  719         "MMdaAudioPlayerCallback::MapcInitComplete() callback, error == %d" ), 
  720         aError);
  721 
- 722     if ( !aError && iAudioPlayerStatus == EAudioPlayerInitializing )
  723         {
  724         iAudioPlayerStatus = EAudioPlayerInitialized;
  725         // currently IM messages supports only this ringing type
  726         // ringing once
  727         DoSetRingingType( EProfileRingingTypeRingingOnce );
  728         CHAT_DP( D_CHAT_LIT("CMdaAudioPlayerUtility::SetVolume( %d )" ), 
  729                  iRingingVolume);
  730         
  731         iAudioPlayer->SetVolume( ConvertVolume( iRingingVolume ) );
  732         
  733         // TODO: please check the value KAudioPrefNewSpecialMessage.
  734         // WHy does it have this particular value? What is the rationale.
  735         //
  736         CHAT_DP( D_CHAT_LIT("CMdaAudioPlayerUtility::SetPriority( %d, %d )" ),
  737             KAudioPriorityRecvMsg, 
  738             TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  739             
  740         iAudioPlayer->SetPriority( KAudioPriorityRecvMsg,
  741             TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  742             
  743         CHAT_DP_TXT("CMdaAudioPlayerUtility::Play()" );
  744         iAudioPlayer->Play();
  745         iAudioPlayerStatus = EAudioPlayerPlaying;
  746         iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, 
  747                               ECoreAppUIsTonePlaying );
  748         }
    749     else
  750         {
  751         Stop();
  752         iAudioPlayerStatus = EAudioPlayerReady;
- 753         if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ))
  754             {
 - 755             return;
  756             }
    757         else
  758             {
  759             HandleError( aError );
  760             iIsPlayingDefaultIMSound = EFalse;
  761             }
  762         }
  763     }
  764 
  765 // ---------------------------------------------------------
  766 // CIMAlertManager::MapcPlayComplete
  767 // This method is called when the audioplayer has finished playing a sound
  768 // (other items were commented in a header).
  769 // ---------------------------------------------------------
  770 //
Top
  771 void CIMAlertManager::MapcPlayComplete( TInt aError )
  772     {
  773     CHAT_DP( D_CHAT_LIT(
  774         "MMdaAudioPlayerCallback::MapcPlayComplete() callback, error == %d" ), 
  775         aError);
  776     iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, ECoreAppUIsTonePlayingUninitialized );
  777     iAudioPlayer->Close();
  778     iAudioPlayerStatus = EAudioPlayerReady;
  779     
- 780     if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) )
  781         {
 - 782         return;
  783         }
    784     else
  785         {
  786         HandleError( aError );
  787         iIsPlayingDefaultIMSound = EFalse;
  788         }
  789     }
  790 
  791 // ---------------------------------------------------------
  792 // CIMAlertManager::HandleKeyChange
  793 // This method receives notifications from the shared data server
  794 // (other items were commented in a header).
  795 // ---------------------------------------------------------
  796 //
Top
  797 void CIMAlertManager::HandleKeyChange( TUpdatedKey& aUpdatedValues )
  798     {
  799     CHAT_DP_FUNC_ENTER("HandleKeyChange");
  800 
  801     /*Do not play im tone in any of the call state  except EPSCTsyCallStateNone
  802      *     (1) EPSCTsyCallStateNone 
  803      *     (2) EPSCTsyCallStateDialling 
  804      *     (3) EPSCTsyCallStateAlerting 
  805      *     (4) EPSTelephonyCallStateConnected 
  806      *     (5) EPSCTsyCallStateDisconnecting 
  807      *     (6) EPSCTsyCallStateNone
  808      * 
  809      */
- 810     if( aUpdatedValues.iValue == EPSCTsyCallStateNone)
  811         {
  812         iCallState = EFalse;
  813         }
    814     else
  815         {
  816         iCallState = ETrue;       
  817         }
- 818     if(aUpdatedValues.iValue == ECoreAppUIsStopTonePlaying )
  819         {
  820         // Message tone should be stopped
  821         CHAT_DP_TXT( "**stop playing!**" );
  822         Stop();        
  823         }
  824     CHAT_DP_FUNC_DONE("HandleKeyChange");
  825     }
  826 
  827 // ---------------------------------------------------------
  828 // CIMAlertManager::HandleNotifyInt
  829 // (other items were commented in a header).
  830 // ---------------------------------------------------------
Top
  831 void CIMAlertManager::HandleNotifyInt( TUint32 aId, TInt aNewValue )
  832    {
  833     CHAT_DP_FUNC_ENTER("HandleNotifyL");
  834     CHAT_DP( D_CHAT_LIT("aKey == %d" ), aId);
  835     CHAT_DP( D_CHAT_LIT("aValue == %d" ), aNewValue);
  836     
  837 
- 838     if ( aId == KProEngActiveRingingVolume  )  // Ringing volume has changed
  839         {
  840         iRingingVolume = aNewValue;
  841         }
- 842     else if ( aId == KProEngActiveRingingType )  // Ringing type has changed
  843         {
  844         iRingingType = aNewValue;
  845         }
  846 
- 847     if ( aId == KVibraCtrlProfileVibraEnabled )  // Vibra setting has changed
  848         {
  849         iVibra = aNewValue;
  850         }
  851         
  852     CHAT_DP_FUNC_DONE("HandleNotifyL");
  853    }
  854 
  855 // ---------------------------------------------------------
  856 // CIMAlertManager::MatoPrepareComplete
  857 // (other items were commented in a header).
  858 // ---------------------------------------------------------
  859 //
Top
  860 void CIMAlertManager::MatoPrepareComplete( TInt aError )
  861     {
  862     CHAT_DP( D_CHAT_LIT(
  863         "MMdaAudioToneObserver::MatoPrepareComplete() callback, error == %d" ), 
  864         aError);
  865     
- 866     if ( !aError && iTonePlayerStatus == EAudioPlayerInitializing )
  867         {
  868         iTonePlayerStatus = EAudioPlayerInitialized;
  869         // TODO: confirm with UI spec/Nikhil if only this ringing type is
  870         // supported. If not in writing, get an entry into the UI spec done.
  871         // TODO: where is this requirement specified?
  872         
  873         // currently IM messages supports only this ringing type
  874         // ringing once
  875         DoSetRingingType( EProfileRingingTypeRingingOnce );
  876         CHAT_DP( D_CHAT_LIT("CMdaAudioToneUtility::SetVolume( %d )" ), 
  877                 ConvertVolume( iRingingVolume ));
  878         iTonePlayer->SetVolume( ConvertVolume( iRingingVolume ) );
  879 
  880 
  881         CHAT_DP( D_CHAT_LIT("CMdaAudioToneUtility::SetPriority( %d, %d )" ),
  882                 KAudioPriorityRecvMsg, 
  883                 TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  884                 
  885         iTonePlayer->SetPriority( KAudioPriorityRecvMsg,
  886             TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  887             
  888         CHAT_DP_TXT("CMdaAudioToneUtility::Play()" );
  889         iTonePlayer->Play();
  890         iTonePlayerStatus = EAudioPlayerPlaying;
  891         iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, 
  892                               ECoreAppUIsTonePlaying );
  893         }
    894     else
  895         {
  896         Stop();
  897         iTonePlayerStatus = EAudioPlayerReady;
  898         
- 899         if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) )
  900             {
 - 901             return;
  902             }
    903         else
  904             {
  905             HandleError( aError );
  906             iIsPlayingDefaultIMSound = EFalse;
  907             }
  908         }
  909     }
  910 
  911 // ---------------------------------------------------------
  912 // CIMAlertManager::MatoPlayComplete
  913 // (other items were commented in a header).
  914 // ---------------------------------------------------------
  915 //
Top
  916 void CIMAlertManager::MatoPlayComplete( TInt aError )
  917     {
  918     CHAT_DP( D_CHAT_LIT(
  919         "MMdaAudioToneObserver::MatoPlayComplete() callback, error == %d" ), 
  920         aError);
  921     iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, ECoreAppUIsTonePlayingUninitialized );
  922     iTonePlayerStatus = EAudioPlayerReady;
  923     
- 924     if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) )
  925         {
 - 926         return ;
  927         }
    928     else
  929         {
  930         HandleError( aError );
  931         iIsPlayingDefaultIMSound = EFalse;
  932         }
  933     }
  934         
  935 //  End of File  
***TER 46% (78/168) of SOURCE FILE cimalertmanager.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD2.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD2.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - cimalertnotifierimpl.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #2/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
-Instrumentation mode: function-decision
-TER: 41 % ( 20/ 49)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cimalertnotifierimpl.cpp
  4 *  Part of     : conversations/instantmessagesalert
  5 *  Description : Publish and subscribe implementation
  6 *  Version     : %version: 2 %
  7 *
  8 *  Copyright © 2009 Nokia. All rights reserved..
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia. All rights are reserved. Copying, including 
  12 *  reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include    "cimalertnotifierimpl.h"
  23 #include    "mimalertnotifierkeyobserver.h"
  24 #include    "cimalertpropertyobserver.h"
  25 #include    <e32property.h>
  26 
  27 // ============================ MEMBER FUNCTIONS ===============================
  28 
  29 // -----------------------------------------------------------------------------
  30 // CIMAlertNotifierImpl::CIMAlertNotifierImpl
  31 // C++ default constructor can NOT contain any code, that
  32 // might leave.
  33 // -----------------------------------------------------------------------------
  34 //
Top
17 17   35 CIMAlertNotifierImpl::CIMAlertNotifierImpl( MIMAlertNotifierKeyObserver* aObserver )
  36 :iObserver( aObserver )
  37     {
  38     }
  39 
  40 // -----------------------------------------------------------------------------
  41 // CIMAlertNotifierImpl::NewL
  42 // Two-phased constructor.
  43 // -----------------------------------------------------------------------------
  44 //
Top
17   45 CIMAlertNotifierImpl* CIMAlertNotifierImpl::NewL( MIMAlertNotifierKeyObserver* aObserver )
  46     {
  47     CIMAlertNotifierImpl* self = new( ELeave ) CIMAlertNotifierImpl( aObserver );
17    48     return self;
  49     }
  50 
  51     
  52 // Destructor
Top
17 17   53 CIMAlertNotifierImpl::~CIMAlertNotifierImpl()
  54     {
  55     delete iPropWatcher;
  56     delete iCallState;
  57     }
  58 
  59 // -----------------------------------------------------------------------------
  60 // CIMAlertNotifierImpl::SetInt
  61 // (other items were commented in a header).
  62 // -----------------------------------------------------------------------------
  63 //
Top
  64 TInt CIMAlertNotifierImpl::SetInt( TNotifyKey aKey, TInt aValue )
  65    {
  66    TInt err = KErrNone;
    67    switch ( aKey ) 
  68        {
   69        case EMSGToneQuitKey:   
  70            err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, aValue );
   71            break;
 - 72        case ECallState:
  73            {
  74            err = RProperty::Set( KPSUidCtsyCallInformation, KCTsyCallState, aValue );     
 - 75            break;
  76            }
 - 77        default:
  78            {
 - 79            return KErrNotFound;
  80            }
  81        }   
   82    return err;
  83    }    
  84 
  85 // -----------------------------------------------------------------------------
  86 // CIMAlertNotifierImpl::GetInt
  87 // (other items were commented in a header).
  88 // -----------------------------------------------------------------------------
  89 //
Top
- 90 TInt CIMAlertNotifierImpl::GetInt( TNotifyKey aKey, TInt& aValue )
  91     {
  92     TInt err = KErrNone;
    93     switch ( aKey ) 
  94         {
 - 95         case EMSGToneQuitKey:
  96             {
  97             err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, aValue );      
 - 98             break;
  99             }
 - 100         case ECallState:
  101             {
  102             err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, aValue );     
 - 103             break;
  104             }
 - 105         default:
  106             {
  107             err = KErrNotFound;   
 - 108             break;
  109             }
  110         }
 - 111     return err;
  112     }
  113    
  114 // -----------------------------------------------------------------------------
  115 // CIMAlertNotifierImpl::ListenKeyChanges
  116 // (other items were commented in a header).
  117 // -----------------------------------------------------------------------------
  118 //
Top
34   119 TInt CIMAlertNotifierImpl::ListenKeyChanges( TNotifyKey aKey )
  120    {
  121    TInt err = KErrNone;
    122    switch ( aKey ) 
  123       {
17    124       case EMSGToneQuitKey:
  125          {
  126          delete iPropWatcher;
  127          iPropWatcher = NULL;
17 17   128          TRAP( err, iPropWatcher = CIMAlertPropertyObserver::NewL( *this ) );
 - 128       catch (XLeaveException & l)
 - 128       catch (...)
17 - 129          if( !err )
  130              {
17 17   131              TRAP( err, iPropWatcher->ObservePropertyChangeL( 
 - 131         catch (XLeaveException & l)
 - 131         catch (...)
  132                          KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit ) );
  133              }
17    134          break;
  135          }
17    136       case ECallState:
  137           {
  138           delete iCallState;
  139           iCallState = NULL;
17 17   140           TRAP( err, iCallState = CIMAlertPropertyObserver::NewL( *this ) );
 - 140       catch (XLeaveException & l)
 - 140       catch (...)
17 - 141           if( !err )
  142               {
17 17   143               TRAP( err, iCallState->ObservePropertyChangeL( 
 - 143         catch (XLeaveException & l)
 - 143         catch (...)
  144                       KPSUidCtsyCallInformation, KCTsyCallState ) );
  145               }
17    146           break;
  147           }
 - 148       default:
  149          {
  150          err = KErrNotFound;
 - 151          break;
  152          }
  153       }
34    154    return err;
  155    }
  156 
  157 // -----------------------------------------------------------------------------
  158 // CIMAlertNotifierImpl::HandlePropertyNotificationEventL
  159 // (other items were commented in a header).
  160 // -----------------------------------------------------------------------------
  161 //
Top
- 162 void CIMAlertNotifierImpl::HandlePropertyNotificationEventL( TUid  aCategory , TUint aKey )
  163     {
  164     TInt value( 0 );
  165     TUpdatedKey key;
  166     // KPSUidCoreApplicationUIs status changed
- 167     if ( aCategory == KPSUidCoreApplicationUIs && aKey == KCoreAppUIsMessageToneQuit )
  168         {
  169         User::LeaveIfError( 
  170                 RProperty::Get( KPSUidCoreApplicationUIs, aKey, value ) );
  171         key.iUid = KPSUidCoreApplicationUIs;
  172         key.iKey = aKey;
  173         key.iValue = value;
  174         }
  175     // call status changed
- 176     if ( aCategory == KPSUidCtsyCallInformation && aKey == KCTsyCallState )
  177         {
  178         User::LeaveIfError( 
  179                 RProperty::Get( KPSUidCtsyCallInformation, aKey, value ) );
  180         key.iUid = KPSUidCtsyCallInformation;
  181         key.iKey = aKey;
  182         key.iValue = value;
  183         }
  184     iObserver->HandleKeyChange( key );
  185     }
  186 
  187 //  End of File  
***TER 41% (20/49) of SOURCE FILE cimalertnotifierimpl.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD3.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD3.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - cimalertpropertyobserver.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #3/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
-Instrumentation mode: function-decision
-TER: 42 % ( 8/ 19)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1  /*
  2 * ==============================================================================
  3 *  Name        : cimalertpropertyobserver.cpp
  4 *  Part of     : conversations/instantmessagesalert
  5 *  Description : Publish & Subscribe property change observer implementation
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright (c) 2009 Nokia. All rights reserved..
  9 *  This material, including documentation and any related
  10 *  computer programs, is protected by copyright controlled by
  11 *  Nokia Corporation. All rights are reserved. Copying,
  12 *  including reproducing, storing, adapting or translating, any
  13 *  or all of this material requires the prior written consent of
  14 *  Nokia Corporation. This material also contains confidential
  15 *  information which may not be disclosed to others without the
  16 *  prior written consent of Nokia Corporation.
  17 * ==============================================================================
  18 */
  19 
  20 // INCLUDE FILES
  21 #include "cimalertpropertyobserver.h"
  22 #include "mimalertpropertynotificationobserver.h"
  23 
  24 #include <bautils.h>
  25 #include <barsc.h>
  26 #include <e32property.h>
  27 
  28 
  29 // ============================ MEMBER FUNCTIONS ===============================
  30 
  31 // -----------------------------------------------------------------------------
  32 // CIMAlertPropertyObserver::CIMAlertPropertyObserver
  33 // C++ default constructor can NOT contain any code, that
  34 // might leave.
  35 // -----------------------------------------------------------------------------
  36 //
Top
34 34   37 CIMAlertPropertyObserver::CIMAlertPropertyObserver( 
  38                             MCAPropertyNotificationObserver& aObserver )
  39     : CActive( CActive::EPriorityLow ),
  40       iObserver( aObserver )
  41     {
  42     CActiveScheduler::Add( this );
  43     }
  44 
  45 
  46 // -----------------------------------------------------------------------------
  47 // CIMAlertPropertyObserver::NewL
  48 // Two-phased constructor.
  49 // -----------------------------------------------------------------------------
  50 //
Top
34   51 CIMAlertPropertyObserver* CIMAlertPropertyObserver::NewL( 
  52     MCAPropertyNotificationObserver& aObserver )
  53     {
  54     CIMAlertPropertyObserver* self = new( ELeave ) CIMAlertPropertyObserver( aObserver );
34    55     return self;
  56     }
  57 
  58 
  59 // Destructor
Top
34 34   60 CIMAlertPropertyObserver::~CIMAlertPropertyObserver()
  61     {
34 - 62     if( IsActive() )
  63         {
  64         Cancel();
  65         }
  66     }
  67 
  68 
  69 // -----------------------------------------------------------------------------
  70 // CIMAlertPropertyObserver::ObservePropertyChangeL
  71 // (other items were commented in a header).
  72 // -----------------------------------------------------------------------------
  73 //
Top
34 34   74 void CIMAlertPropertyObserver::ObservePropertyChangeL( TUid aCategory, TUint aKey )
  75     {
34 - 76    if( IsActive() )
  77       {
 - 78       return;
  79       }
  80     User::LeaveIfError( iProperty.Attach( aCategory, aKey ) );
  81    iKey = aKey;
  82    iCategory = aCategory;
  83     iProperty.Subscribe( iStatus );
  84     SetActive();
  85     }
  86 
  87 // -----------------------------------------------------------------------------
  88 // CIMAlertPropertyObserver::CancelObserve
  89 // (other items were commented in a header).
  90 // -----------------------------------------------------------------------------
  91 //
Top
- 92 void CIMAlertPropertyObserver::CancelObserve()
  93     {
- 94     if( IsActive() )
  95         {
  96         Cancel();
  97         }
  98    }
  99 
  100 // -----------------------------------------------------------------------------
  101 // CIMAlertPropertyObserver::RunL
  102 // (other items were commented in a header).
  103 // -----------------------------------------------------------------------------
  104 //
Top
- 105 void CIMAlertPropertyObserver::RunL()
  106     {
  107    iProperty.Subscribe( iStatus );
  108    SetActive();
  109     iObserver.HandlePropertyNotificationEventL( iCategory, iKey );      
  110     }
  111 
  112 // -----------------------------------------------------------------------------
  113 // CIMAlertPropertyObserver::DoCancel
  114 // (other items were commented in a header).
  115 // -----------------------------------------------------------------------------
  116 //
Top
34 34   117 void CIMAlertPropertyObserver::DoCancel()
  118     {
  119     iProperty.Cancel();
  120     }
  121 
  122 // -----------------------------------------------------------------------------
  123 // CIMAlertPropertyObserver::Category
  124 // (other items were commented in a header).
  125 // -----------------------------------------------------------------------------
  126 //
Top
- 127 TUid CIMAlertPropertyObserver::Category()
  128    {
 - 129    return iCategory;
  130    }
  131 
  132 // -----------------------------------------------------------------------------
  133 // CIMAlertPropertyObserver::Key
  134 // (other items were commented in a header).
  135 // -----------------------------------------------------------------------------
  136 //
Top
- 137 TUint CIMAlertPropertyObserver::Key()
  138    {
 - 139    return iKey;
  140    }
  141 
  142 //  End of File
***TER 42% (8/19) of SOURCE FILE cimalertpropertyobserver.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD4.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD4.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - imalertnotifierfactory.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #4/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 2/ 2)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : imalertnotifierfactory.cpp
  4 *  Part of     : conversations/instantmessagesalert
  5 *  Description : Publish and Subscribe factory method implementation
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright © 2009 Nokia. All rights reserved..
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia. All rights are reserved. Copying, including 
  12 *  reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include    "imalertnotifierfactory.h"
  23 #include    "mimalertnotifierinterface.h"
  24 #include    "cimalertnotifierimpl.h"
  25 
  26 
  27 // ============================ MEMBER FUNCTIONS ===============================
  28 
  29 // ---------------------------------------------------------
  30 // IMAlertNotifierFactory::CreateNotifierL
  31 // (other items were commented in a header).
  32 // ---------------------------------------------------------
  33 //
Top
17   34 EXPORT_C MIMAlertNotifierInterface* IMAlertNotifierFactory::CreateNotifierL( MIMAlertNotifierKeyObserver* aObserver )
  35    {
17    36    return CIMAlertNotifierImpl::NewL( aObserver );
  37    }
  38    
  39 //  End of File
  40 
***TER 100% (2/2) of SOURCE FILE imalertnotifierfactory.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD5.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD5.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - testinstantmsgalert.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #5/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
-Instrumentation mode: function-decision
-TER: 79 % ( 11/ 14)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 
  14 * Description: This file contains testclass implementation.
  15 *
  16 */
  17 
  18 // INCLUDE FILES
  19 #include <Stiftestinterface.h>
  20 #include "testinstantmsgalert.h"
  21 #include <SettingServerClient.h>
  22 
  23 // EXTERNAL DATA STRUCTURES
  24 //extern  ?external_data;
  25 
  26 // EXTERNAL FUNCTION PROTOTYPES  
  27 //extern ?external_function( ?arg_type,?arg_type );
  28 
  29 // CONSTANTS
  30 //const ?type ?constant_var = ?constant;
  31 
  32 // MACROS
  33 //#define ?macro ?macro_def
  34 
  35 // LOCAL CONSTANTS AND MACROS
  36 //const ?type ?constant_var = ?constant;
  37 //#define ?macro_name ?macro_def
  38 
  39 // MODULE DATA STRUCTURES
  40 //enum ?declaration
  41 //typedef ?declaration
  42 
  43 // LOCAL FUNCTION PROTOTYPES
  44 //?type ?function_name( ?arg_type, ?arg_type );
  45 
  46 // FORWARD DECLARATIONS
  47 //class ?FORWARD_CLASSNAME;
  48 
  49 // ============================= LOCAL FUNCTIONS ===============================
  50 
  51 // -----------------------------------------------------------------------------
  52 // ?function_name ?description.
  53 // ?description
  54 // Returns: ?value_1: ?description
  55 //          ?value_n: ?description_line1
  56 //                    ?description_line2
  57 // -----------------------------------------------------------------------------
  58 //
  59 /*
  60 ?type ?function_name(
  61     ?arg_type arg,  // ?description
  62     ?arg_type arg)  // ?description
  63     {
  64 
  65     ?code  // ?comment
  66 
  67     // ?comment
  68     ?code
  69     }
  70 */
  71 
  72 // ============================ MEMBER FUNCTIONS ===============================
  73 
  74 // -----------------------------------------------------------------------------
  75 // Ctestinstantmsgalert::Ctestinstantmsgalert
  76 // C++ default constructor can NOT contain any code, that
  77 // might leave.
  78 // -----------------------------------------------------------------------------
  79 //
Top
17 17   80 Ctestinstantmsgalert::Ctestinstantmsgalert( 
  81     CTestModuleIf& aTestModuleIf ):
  82         CScriptBase( aTestModuleIf )
  83     {
  84     }
  85 
  86 // -----------------------------------------------------------------------------
  87 // Ctestinstantmsgalert::ConstructL
  88 // Symbian 2nd phase constructor can leave.
  89 // -----------------------------------------------------------------------------
  90 //
Top
17 17   91 void Ctestinstantmsgalert::ConstructL()
  92     {
  93     //Read logger settings to check whether test case name is to be
  94     //appended to log file name.
  95     RSettingServer settingServer;
  96     TInt ret = settingServer.Connect();
17 - 97     if(ret != KErrNone)
  98         {
  99         User::Leave(ret);
  100         }
  101     // Struct to StifLogger settigs.
  102     TLoggerSettings loggerSettings; 
  103     // Parse StifLogger defaults from STIF initialization file.
  104     ret = settingServer.GetLoggerSettings(loggerSettings);
17 - 105     if(ret != KErrNone)
  106         {
  107         User::Leave(ret);
  108         } 
  109     // Close Setting server session
  110     settingServer.Close();
  111 
  112     TFileName logFileName;
  113     
17 - 114     if(loggerSettings.iAddTestCaseTitle)
  115         {
  116         TName title;
  117         TestModuleIf().GetTestCaseTitleL(title);
  118         logFileName.Format(KtestinstantmsgalertLogFileWithTitle, &title);
  119         }
    120     else
  121         {
  122         logFileName.Copy(KtestinstantmsgalertLogFile);
  123         }
  124     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); 
  125     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); 
  126     iLog = CStifLogger::NewL( KtestinstantmsgalertLogPath, 
  127                           logFileName,
  128                           CStifLogger::ETxt,
  129                           CStifLogger::EFile,
  130                           EFalse );
  131     
  132     SendTestClassVersion();
  133     }
  134 
  135 // -----------------------------------------------------------------------------
  136 // Ctestinstantmsgalert::NewL
  137 // Two-phased constructor.
  138 // -----------------------------------------------------------------------------
  139 //
Top
17   140 Ctestinstantmsgalert* Ctestinstantmsgalert::NewL( 
  141     CTestModuleIf& aTestModuleIf )
  142     {
  143     Ctestinstantmsgalert* self = new (ELeave) Ctestinstantmsgalert( aTestModuleIf );
  144 
  145     CleanupStack::PushL( self );
  146     self->ConstructL();
  147     CleanupStack::Pop();
  148 
17    149     return self;
  150 
  151     }
  152 
  153 // Destructor
Top
17 17   154 Ctestinstantmsgalert::~Ctestinstantmsgalert()
  155     { 
  156 
  157     // Delete resources allocated from test methods
  158     Delete();
  159 
  160     // Delete logger
  161     delete iLog; 
  162 
  163     }
  164 
  165 //-----------------------------------------------------------------------------
  166 // Ctestinstantmsgalert::SendTestClassVersion
  167 // Method used to send version of test class
  168 //-----------------------------------------------------------------------------
  169 //
Top
17 17   170 void Ctestinstantmsgalert::SendTestClassVersion()
  171    {
  172    TVersion moduleVersion;
  173    moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
  174    moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
  175    moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
  176    
  177    TFileName moduleName;
  178    moduleName = _L("testinstantmsgalert.dll");
  179 
  180    TBool newVersionOfMethod = ETrue;
  181    TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
  182    }
  183 
  184 // ========================== OTHER EXPORTED FUNCTIONS =========================
  185 
  186 // -----------------------------------------------------------------------------
  187 // LibEntryL is a polymorphic Dll entry point.
  188 // Returns: CScriptBase: New CScriptBase derived object
  189 // -----------------------------------------------------------------------------
  190 //
Top
17   191 EXPORT_C CScriptBase* LibEntryL( 
  192     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
  193     {
  194 
17    195     return ( CScriptBase* ) Ctestinstantmsgalert::NewL( aTestModuleIf );
  196 
  197     }
  198 
  199 
  200 //  End of File
***TER 79% (11/14) of SOURCE FILE testinstantmsgalert.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD6.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD6.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,478 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - testinstantmsgalertblocks.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #6/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
-Instrumentation mode: function-decision
-TER: 86 % ( 38/ 44)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 
  14 * Description: This file contains testclass implementation.
  15 *
  16 */
  17 
  18 // [INCLUDE FILES] - do not remove
  19 #include <e32svr.h>
  20 #include <StifParser.h>
  21 #include <Stiftestinterface.h>
  22 #include "testinstantmsgalert.h"
  23 
  24 
  25 
  26 // EXTERNAL DATA STRUCTURES
  27 //extern  ?external_data;
  28 
  29 // EXTERNAL FUNCTION PROTOTYPES  
  30 //extern ?external_function( ?arg_type,?arg_type );
  31 
  32 // CONSTANTS
  33 //const ?type ?constant_var = ?constant;
  34 
  35 // MACROS
  36 //#define ?macro ?macro_def
  37 
  38 // LOCAL CONSTANTS AND MACROS
  39 //const ?type ?constant_var = ?constant;
  40 //#define ?macro_name ?macro_def
  41 
  42 // MODULE DATA STRUCTURES
  43 //enum ?declaration
  44 //typedef ?declaration
  45 
  46 // LOCAL FUNCTION PROTOTYPES
  47 //?type ?function_name( ?arg_type, ?arg_type );
  48 
  49 // FORWARD DECLARATIONS
  50 //class ?FORWARD_CLASSNAME;
  51 
  52 // ============================= LOCAL FUNCTIONS ===============================
  53 
  54 // -----------------------------------------------------------------------------
  55 // ?function_name ?description.
  56 // ?description
  57 // Returns: ?value_1: ?description
  58 //          ?value_n: ?description_line1
  59 //                    ?description_line2
  60 // -----------------------------------------------------------------------------
  61 //
  62 /*
  63 ?type ?function_name(
  64     ?arg_type arg,  // ?description
  65     ?arg_type arg)  // ?description
  66     {
  67 
  68     ?code  // ?comment
  69 
  70     // ?comment
  71     ?code
  72     }
  73 */
  74 
  75 // ============================ MEMBER FUNCTIONS ===============================
  76 
  77 // -----------------------------------------------------------------------------
  78 // Ctestinstantmsgalert::Delete
  79 // Delete here all resources allocated and opened from test methods. 
  80 // Called from destructor. 
  81 // -----------------------------------------------------------------------------
  82 //
Top
17 17   83 void Ctestinstantmsgalert::Delete() 
  84     {
  85 
  86     }
  87 
  88 // -----------------------------------------------------------------------------
  89 // Ctestinstantmsgalert::RunMethodL
  90 // Run specified method. Contains also table of test mothods and their names.
  91 // -----------------------------------------------------------------------------
  92 //
Top
17   93 TInt Ctestinstantmsgalert::RunMethodL( 
  94     CStifItemParser& aItem ) 
  95     {
  96 
  97     static TStifFunctionInfo const KFunctions[] =
  98         {  
  99         // Copy this line for every implemented function.
  100         // First string is the function name used in TestScripter script file.
  101         // Second is the actual implementation member function. 
  102         ENTRY( "Example", Ctestinstantmsgalert::ExampleL ),
  103         ENTRY( "CIMAlertManager_NewL", Ctestinstantmsgalert::CIMAlertManager_NewL ),
  104         ENTRY( "CIMAlertManager_PlayL", Ctestinstantmsgalert::CIMAlertManager_PlayL ),
  105         ENTRY( "CIMAlertManager_Stop", Ctestinstantmsgalert::CIMAlertManager_Stop ),
  106         ENTRY( "CIMAlertManager_SetVolume", Ctestinstantmsgalert::CIMAlertManager_SetVolume ),
  107         ENTRY( "CIMAlertManager_SetRingingType", Ctestinstantmsgalert::CIMAlertManager_SetRingingType ),
  108         ENTRY( "CIMAlertManager_SetVibra", Ctestinstantmsgalert::CIMAlertManager_SetVibra ),
  109         ENTRY( "CIMAlertManager_DoSetRingingType", Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType ),
  110         ENTRY( "CIMAlertManager_ConvertVolume", Ctestinstantmsgalert::CIMAlertManager_ConvertVolume ),
  111         ENTRY( "CIMAlertManager_MapcInitComplete", Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete ), 
  112         ENTRY( "CIMAlertManager_MapcPlayComplete", Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete ), 
  113         ENTRY( "CIMAlertManager_HandleKeyChange", Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange ), 
  114         ENTRY( "CIMAlertManager_HandleNotifyInt", Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt ), 
  115         ENTRY( "CIMAlertManager_MatoPrepareComplete", Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete ), 
  116         ENTRY( "CIMAlertManager_MatoPlayComplete", Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete ), 
  117         ENTRY( "CIMAlertManager_AddObserverL", Ctestinstantmsgalert::CIMAlertManager_AddObserverL ), 
  118         ENTRY( "CIMAlertManager_RemoveObserver", Ctestinstantmsgalert::CIMAlertManager_RemoveObserver ), 
  119         ENTRY( "CIMAlertManager_HandleError", Ctestinstantmsgalert::CIMAlertManager_HandleError ), 
  120 
  121         //ADD NEW ENTRY HERE
  122         // [test cases entries] - Do not remove
  123         };
  124 
  125     const TInt count = sizeof( KFunctions ) / 
  126                         sizeof( TStifFunctionInfo );
  127 
17    128     return RunInternalL( KFunctions, count, aItem );
  129 
  130     }
  131 
  132 // -----------------------------------------------------------------------------
  133 // Ctestinstantmsgalert::ExampleL
  134 // Example test method function.
  135 // (other items were commented in a header).
  136 // -----------------------------------------------------------------------------
  137 //
Top
- 138 TInt Ctestinstantmsgalert::ExampleL( CStifItemParser& aItem )
  139     {
  140 
  141     // Print to UI
  142     _LIT( Ktestinstantmsgalert, "testinstantmsgalert" );
  143     _LIT( KExample, "In Example" );
  144     TestModuleIf().Printf( 0, Ktestinstantmsgalert, KExample );
  145     // Print to log file
  146     iLog->Log( KExample );
  147 
  148     TInt i = 0;
  149     TPtrC string;
  150     _LIT( KParam, "Param[%i]: %S" );
- 151     while ( aItem.GetNextString ( string ) == KErrNone )
  152         {
  153         TestModuleIf().Printf( i, Ktestinstantmsgalert, 
  154                                 KParam, i, &string );
  155         i++;
  156         }
  157 
 - 158     return KErrNone;
  159 
  160     }
  161 
  162 // -----------------------------------------------------------------------------
  163 // Ctestinstantmsgalert::CIMAlertManager_NewL
  164 // Example test method function.
  165 // (other items were commented in a header).
  166 // -----------------------------------------------------------------------------
  167 //
Top
  168 TInt Ctestinstantmsgalert::CIMAlertManager_NewL( CStifItemParser& aItem )
  169     {
  170     
  171     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); 
  172     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );  
  173     CIMAlertManager* object  = CIMAlertManager::NewL();   
  174     
- 175     if(object)
  176         {
  177         delete object;
   178         return KErrNone;
  179         }
    180     else
 - 181         return KErrGeneral;
  182 
  183     }
  184 // -----------------------------------------------------------------------------
  185 // Ctestinstantmsgalert::CIMAlertManager_PlayL
  186 // Example test method function.
  187 // (other items were commented in a header).
  188 // -----------------------------------------------------------------------------
  189 //
Top
  190 TInt Ctestinstantmsgalert::CIMAlertManager_PlayL( CStifItemParser& aItem )
  191     {
  192     CIMAlertManager* object  = CIMAlertManager::NewL();   
  193     object->PlayL(5);
  194     delete object;
   195     return KErrNone;
  196 
  197     }
  198 // -----------------------------------------------------------------------------
  199 // Ctestinstantmsgalert::CIMAlertManager_SetVolume
  200 // Example test method function.
  201 // (other items were commented in a header).
  202 // -----------------------------------------------------------------------------
  203 //
Top
  204 TInt Ctestinstantmsgalert::CIMAlertManager_SetVolume( CStifItemParser& aItem )
  205     {
  206 
  207     CIMAlertManager* object  = CIMAlertManager::NewL();   
  208     object->SetVolume(5);
  209     delete object;
   210     return KErrNone;
  211 
  212 
  213     }
  214 // -----------------------------------------------------------------------------
  215 // Ctestinstantmsgalert::CIMAlertManager_SetRingingType
  216 // Example test method function.
  217 // (other items were commented in a header).
  218 // -----------------------------------------------------------------------------
  219 //
Top
  220 TInt Ctestinstantmsgalert::CIMAlertManager_SetRingingType( CStifItemParser& aItem )
  221     {
  222     
  223     CIMAlertManager* object  = CIMAlertManager::NewL();   
  224     object->SetRingingType(EProfileRingingTypeRingingOnce);
  225     delete object;
   226     return KErrNone;
  227 
  228     }
  229 // -----------------------------------------------------------------------------
  230 // Ctestinstantmsgalert::CIMAlertManager_SetVibra
  231 // Example test method function.
  232 // (other items were commented in a header).
  233 // -----------------------------------------------------------------------------
  234 //
Top
  235 TInt Ctestinstantmsgalert::CIMAlertManager_SetVibra( CStifItemParser& aItem )
  236     {
  237     
  238     CIMAlertManager* object  = CIMAlertManager::NewL();   
  239     object->SetVibra(ETrue);
  240     delete object;
   241     return KErrNone;
  242 
  243     }
  244 // -----------------------------------------------------------------------------
  245 // Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType
  246 // Example test method function.
  247 // (other items were commented in a header).
  248 // -----------------------------------------------------------------------------
  249 //
Top
  250 TInt Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType( CStifItemParser& aItem )
  251     {
  252     
  253     CIMAlertManager* object  = CIMAlertManager::NewL();   
  254     object->DoSetRingingType(EProfileRingingTypeRingingOnce);
  255     delete object;
   256     return KErrNone;
  257 
  258     }
  259 // -----------------------------------------------------------------------------
  260 // Ctestinstantmsgalert::CIMAlertManager_ConvertVolume
  261 // Example test method function.
  262 // (other items were commented in a header).
  263 // -----------------------------------------------------------------------------
  264 //
Top
  265 TInt Ctestinstantmsgalert::CIMAlertManager_ConvertVolume( CStifItemParser& aItem )
  266     {
  267     
  268     CIMAlertManager* object  = CIMAlertManager::NewL();   
  269     object->ConvertVolume(5);
  270     delete object;
   271     return KErrNone;
  272 
  273     }
  274 
  275 // -----------------------------------------------------------------------------
  276 // Ctestinstantmsgalert::CIMAlertManager_Stop
  277 // Example test method function.
  278 // (other items were commented in a header).
  279 // -----------------------------------------------------------------------------
  280 //
Top
  281 TInt Ctestinstantmsgalert::CIMAlertManager_Stop( CStifItemParser& aItem )
  282     {
  283     CIMAlertManager* object  = CIMAlertManager::NewL();   
  284     object->Stop();
  285     delete object;
   286     return KErrNone;
  287 
  288     }
  289 
  290 // -----------------------------------------------------------------------------
  291 // Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete
  292 // Example test method function.
  293 // (other items were commented in a header).
  294 // -----------------------------------------------------------------------------
  295 //
Top
  296 TInt Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete( CStifItemParser& aItem )
  297     {
  298     CIMAlertManager* object  = CIMAlertManager::NewL();   
  299     object->MapcInitComplete(KErrNone,5);
  300     delete object;
   301     return KErrNone;
  302 
  303     }
  304 
  305 // -----------------------------------------------------------------------------
  306 // Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete
  307 // Example test method function.
  308 // (other items were commented in a header).
  309 // -----------------------------------------------------------------------------
  310 //
Top
  311 TInt Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete( CStifItemParser& aItem )
  312     {
  313     CIMAlertManager* object  = CIMAlertManager::NewL();   
  314     object->MapcPlayComplete(KErrNone);
  315     delete object;
   316     return KErrNone;
  317 
  318     }
  319 
  320 // -----------------------------------------------------------------------------
  321 // Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange
  322 // Example test method function.
  323 // (other items were commented in a header).
  324 // -----------------------------------------------------------------------------
  325 //
Top
  326 TInt Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange( CStifItemParser& aItem )
  327     {
  328     CIMAlertManager* object  = CIMAlertManager::NewL();   
  329     TUpdatedKey temp;
  330     temp.iValue =  ECoreAppUIsStopTonePlaying;
  331     object->HandleKeyChange(temp);
  332     delete object;
   333     return KErrNone;
  334 
  335     }
  336 // -----------------------------------------------------------------------------
  337 // Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt
  338 // Example test method function.
  339 // (other items were commented in a header).
  340 // -----------------------------------------------------------------------------
  341 //
Top
  342 TInt Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt( CStifItemParser& aItem )
  343     {
  344     CIMAlertManager* object  = CIMAlertManager::NewL();   
  345     object->HandleNotifyInt(KProEngActiveRingingVolume,5);
  346     delete object;
   347     return KErrNone;
  348 
  349     }
  350 // -----------------------------------------------------------------------------
  351 // Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete
  352 // Example test method function.
  353 // (other items were commented in a header).
  354 // -----------------------------------------------------------------------------
  355 //
Top
  356 TInt Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete( CStifItemParser& aItem )
  357     {
  358     CIMAlertManager* object  = CIMAlertManager::NewL();   
  359     object->MatoPrepareComplete(KErrNone);
  360     delete object;
   361     return KErrNone;
  362 
  363     }
  364 // -----------------------------------------------------------------------------
  365 // Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete
  366 // Example test method function.
  367 // (other items were commented in a header).
  368 // -----------------------------------------------------------------------------
  369 //
Top
  370 TInt Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete( CStifItemParser& aItem )
  371     {
  372     CIMAlertManager* object  = CIMAlertManager::NewL();   
  373     object->MatoPlayComplete(KErrNone);
  374     delete object;
   375     return KErrNone;
  376 
  377     }
  378 
  379 // -----------------------------------------------------------------------------
  380 // Ctestinstantmsgalert::CIMAlertManager_AddObserverL
  381 // Example test method function.
  382 // (other items were commented in a header).
  383 // -----------------------------------------------------------------------------
  384 //
Top
  385 TInt Ctestinstantmsgalert::CIMAlertManager_AddObserverL( CStifItemParser& aItem )
  386     {
  387     CIMAlertManager* object  = CIMAlertManager::NewL(); 
  388     MIMAlertManagerObserver* observer = NULL;
  389     object->AddObserverL(observer);
  390     delete object;
   391     return KErrNone;
  392 
  393     }
  394 
  395 // -----------------------------------------------------------------------------
  396 // Ctestinstantmsgalert::CIMAlertManager_RemoveObserver
  397 // Example test method function.
  398 // (other items were commented in a header).
  399 // -----------------------------------------------------------------------------
  400 //
Top
  401 TInt Ctestinstantmsgalert::CIMAlertManager_RemoveObserver( CStifItemParser& aItem )
  402     {
  403     CIMAlertManager* object  = CIMAlertManager::NewL();   
  404     MIMAlertManagerObserver* observer = NULL;
  405     object->RemoveObserver(observer);
  406     delete object;
   407     return KErrNone;
  408 
  409     }
  410 
  411 // -----------------------------------------------------------------------------
  412 // Ctestinstantmsgalert::CIMAlertManager_HandleError
  413 // Example test method function.
  414 // (other items were commented in a header).
  415 // -----------------------------------------------------------------------------
  416 //
Top
  417 TInt Ctestinstantmsgalert::CIMAlertManager_HandleError( CStifItemParser& aItem )
  418     {
  419     CIMAlertManager* object  = CIMAlertManager::NewL();   
  420     MIMAlertManagerObserver* observer = NULL;
  421     object->HandleError(KErrNone);
  422     delete object;
   423     return KErrNone;
  424 
  425     }
  426 
  427 // ========================== OTHER EXPORTED FUNCTIONS =========================
  428 // None
  429 
  430 //  [End of File] - Do not remove
***TER 86% (38/44) of SOURCE FILE testinstantmsgalertblocks.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD7.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD7.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - s_vimpstsettingsstore.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #7/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
-Instrumentation mode: function-decision
-TER: 40 % ( 2/ 5)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 *
  14 * Description:  vimpst settings store definitions and repository transactions.
  15 *
  16 */
  17 
  18 
  19 //  INCLUDES
  20 #include <e32base.h>
  21 #include "s_vimpstsettingsstoreimp.h"
  22 
  23 /**
  24  *  vimpst settings API class
  25  *
  26  *  Main class of managing vimpst settings
  27  *
  28  *  @code example code of how to get/set a value to the setting item in cenrep 
  29  *  MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL();
  30  *  TInt value = 1;
  31  *  TInt err = obj->Set(serviceId, ETOUDlgOff, value );
  32  *  similarly for getting the value
  33  *  obj->Get(serviceId, ETOUDlgOff, value);
  34  *  @lib vimpstsettingsstore.lib
  35  *  @since S60 v5.0
  36  */
  37 
  38 // -----------------------------------------------------------------------------
  39 // CVIMPSTSettingsStoreFactory::NewL
  40 // Create an instance of the class CVIMPSTSettingsStoreImp 
  41 // -----------------------------------------------------------------------------
  42 //
Top
17   43 EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewL()
  44     {    
  45     MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::NewL();
  46 
17    47     return self;
  48     }
  49 
  50 // -----------------------------------------------------------------------------
  51 // CVIMPSTEngineFactory::Destructor
  52 // Release the singelton
  53 // -----------------------------------------------------------------------------
  54 //
Top
- 55 CVIMPSTSettingsStore::~CVIMPSTSettingsStore()
  56     {
  57     CVIMPSTSettingsStoreImp::Release();
  58     }
  59 // -----------------------------------------------------------------------------
  60 // CVIMPSTSettingsStoreFactory::NewLC
  61 // Create an instance of the class CVIMPSTSettingsStoreImp 
  62 // -----------------------------------------------------------------------------
  63 //
  64 
Top
- 65 EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewLC()
  66     {    
  67     MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::InitialiseLibraryL();
  68     CleanupDeletePushL ( self );
 - 69     return  self;
  70     }
  71 
  72 
  73 // End of file
***TER 40% (2/5) of SOURCE FILE s_vimpstsettingsstore.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD8.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexD8.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - s_vimpstsettingsstoreimp.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #8/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
-Instrumentation mode: function-decision
-TER: 54 % ( 7/ 13)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 *
  14 * Description:  vimpst settings store definitions and repository transactions.
  15 *
  16 */
  17 
  18 
  19 //  INCLUDES
  20 #include <e32std.h>
  21 #include "s_vimpstsettingsstoreimp.h"
  22 
  23 //dummy serviceId, assuming the service id not more than 256. for the first time
  24 //and it is assumed that this service id is for initializing the cenrep keys only.
  25 //not updated in the service table and hence will not get a TAB in phone book
  26 //const TInt KServiceIDOffset = 16;
  27 
  28 // opaque data length, see cvimpstuisapsettings.h SetOpaqueDesC16 method description.
  29 //const TInt KSapSettingsDataBufferLength = 5;
  30 // Collation level 1 to ignore case
  31 //const TInt KCollationLevel = 1;
  32 
  33 /**  Key to CIMPSSAPSettings opaque value */
  34 //_LIT( KIMToUAccepted, "KIMToUAccepted" );
  35 /**  User id separator in KIMToUAccepted list */
  36 //_LIT( KIMDot, "," );
  37 
  38 //================= MEMBER FUNCTIONS =======================
  39 // ---------------------------------------------------------
  40 // CVIMPSTSettingsStoreImp::NewL
  41 // 
  42 // ---------------------------------------------------------
Top
- 43 MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::InitialiseLibraryL( )
  44     {
  45     // no existing instance, create a new one
  46     MVIMPSTSettingsStore *settingsStoreImp = CVIMPSTSettingsStoreImp::NewL();
 - 47     return (MVIMPSTSettingsStore*)settingsStoreImp;
  48     }
  49 
Top
- 50 void CVIMPSTSettingsStoreImp::Release( )
  51     {
  52     
  53     }
  54 // ---------------------------------------------------------
  55 // CVIMPSTSettingsStoreImp::NewLC
  56 // 
  57 // ---------------------------------------------------------
Top
17   58 MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::NewL( )
  59     {
  60     CVIMPSTSettingsStoreImp* self = new (ELeave) CVIMPSTSettingsStoreImp( );
  61     CleanupStack::PushL( self );
  62     self->ConstructL( );
  63     CleanupStack::Pop( self );
17    64     return self;
  65     }
  66 
  67 // ---------------------------------------------------------
  68 // CVIMPSTSettingsStoreImp::ConstructL
  69 // 
  70 // ---------------------------------------------------------
  71 
Top
17 17   72 void CVIMPSTSettingsStoreImp::ConstructL( )
  73     {
  74    
  75     }
  76 
  77 // ---------------------------------------------------------
  78 // CVIMPSTSettingsStoreImp::Destructor
  79 // 
  80 // ---------------------------------------------------------
Top
17 17   81 CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp()
  82     {
  83    
  84     }
  85          
Top
  86 TInt CVIMPSTSettingsStoreImp::GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer )
  87     {
- 88     if(aSettingItemNAme == EServiceToneFileName)
  89         {
  90         _LIT(filename,"testtonefile");
  91         aBuffer.Copy(filename);
  92         }
   93     return KErrNone;  // return the value : error code  
  94     }
  95 // --------------------------------------------------------------------------------------------------
  96 // CVIMPSTSettingsStoreImp::SetL
  97 // 
  98 // ---------------------------------------------------------------------------------------------------
  99 
Top
- 100 TInt CVIMPSTSettingsStoreImp::SetL(TUint32 /*aServiceId*/, TSettingItemName /*aSettingItemName*/, const TDesC8& /*aBuffer*/  )
  101     {
 - 102     return KErrNone;  // return the value : error code  
  103     }
  104 // --------------------------------------------------------------------------------------------------
  105 // CVIMPSTSettingsStoreImp::GetL
  106 // 
  107 // ---------------------------------------------------------------------------------------------------
  108 
  109 
  110 
  111 //End of file
***TER 54% (7/13) of SOURCE FILE s_vimpstsettingsstoreimp.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexE.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexE.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -CTC++ Coverage Report - Source Files Not Found - - - - - - - - -The following source files were not found by ctc2html: -

- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexF.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexF.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - - -CTC++ Coverage Report - Directory Summary - - - - - - - - -CTC++ Coverage Report - -Directory Summary

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- - - - - - - - - - - - -
Symbol file(s): MON.sym (Wed Sep 30 15:27:45 2009)
Data file(s): MON.dat (Wed Sep 30 15:48:28 2009)
Listing produced at: Wed Sep 30 16:37:01 2009
Coverage view: As instrumented
 
Input listing: profile.txt
Html generated at: Wed Sep 30 16:37:09 2009
ctc2html v2.5 options: -i profile.txt 
Threshold percent: 100 %

-(Click on header to sort) - - - - - - - - - - - - - - - - - - -
TER%- Covered Not-covered All Directory
45%-108130238\meco_domain\conversations\instantmessagesalert\src
84%-49958\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
50%-9918\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs

53%-166148314OVERALL

- - - - - - - -
Number of directories: 3
Number of monitored source files: 8
Number of functions: 76
Number of source lines: 2090
Number of measurement points: 399
TER: 53% (decision)

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexG.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexG.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - Index - - - - - - - - - - - - - diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexH.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/indexH.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - Index - - - - - - - - -Index
- - - - - - - - - - - - - - - -
 
\meco_domain\conversations\instantmessagesalert\src
   \meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
   \meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
   \meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
   \meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/red.gif Binary file instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/red.gif has changed diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/sorttable.js --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Branch_Coverage/sorttable.js Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,493 +0,0 @@ -/* - SortTable - version 2 - 7th April 2007 - Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ - - Instructions: - Download this file - Add to your HTML - Add class="sortable" to any table you'd like to make sortable - Click on the headers to sort - - Thanks to many, many people for contributions and suggestions. - Licenced as X11: http://www.kryogenix.org/code/browser/licence.html - This basically means: do what you want with it. -*/ - - -var stIsIE = /*@cc_on!@*/false; - -sorttable = { - init: function() { - // quit if this function has already been called - if (arguments.callee.done) return; - // flag this function so we don't do the same thing twice - arguments.callee.done = true; - // kill the timer - if (_timer) clearInterval(_timer); - - if (!document.createElement || !document.getElementsByTagName) return; - - sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; - - forEach(document.getElementsByTagName('table'), function(table) { - if (table.className.search(/\bsortable\b/) != -1) { - sorttable.makeSortable(table); - } - }); - - }, - - makeSortable: function(table) { - if (table.getElementsByTagName('thead').length == 0) { - // table doesn't have a tHead. Since it should have, create one and - // put the first table row in it. - the = document.createElement('thead'); - the.appendChild(table.rows[0]); - table.insertBefore(the,table.firstChild); - } - // Safari doesn't support table.tHead, sigh - if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - - if (table.tHead.rows.length != 1) return; // can't cope with two header rows - - // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as - // "total" rows, for example). This is B&R, since what you're supposed - // to do is put them in a tfoot. So, if there are sortbottom rows, - // for backwards compatibility, move them to tfoot (creating it if needed). - sortbottomrows = []; - for (var i=0; i5' : ' ▴'; - this.appendChild(sortrevind); - return; - } - if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { - // if we're already sorted by this column in reverse, just - // re-reverse the table, which is quicker - sorttable.reverse(this.sorttable_tbody); - this.className = this.className.replace('sorttable_sorted_reverse', - 'sorttable_sorted'); - this.removeChild(document.getElementById('sorttable_sortrevind')); - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - return; - } - - // remove sorttable_sorted classes - theadrow = this.parentNode; - forEach(theadrow.childNodes, function(cell) { - if (cell.nodeType == 1) { // an element - cell.className = cell.className.replace('sorttable_sorted_reverse',''); - cell.className = cell.className.replace('sorttable_sorted',''); - } - }); - sortfwdind = document.getElementById('sorttable_sortfwdind'); - if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } - sortrevind = document.getElementById('sorttable_sortrevind'); - if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } - - this.className += ' sorttable_sorted'; - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - - // build an array to sort. This is a Schwartzian transform thing, - // i.e., we "decorate" each row with the actual sort key, - // sort based on the sort keys, and then put the rows back in order - // which is a lot faster because you only do getInnerText once per row - row_array = []; - col = this.sorttable_columnindex; - rows = this.sorttable_tbody.rows; - for (var j=0; j 12) { - // definitely dd/mm - return sorttable.sort_ddmm; - } else if (second > 12) { - return sorttable.sort_mmdd; - } else { - // looks like a date, but we can't tell which, so assume - // that it's dd/mm (English imperialism!) and keep looking - sortfn = sorttable.sort_ddmm; - } - } - } - } - return sortfn; - }, - - getInnerText: function(node) { - // gets the text we want to use for sorting for a cell. - // strips leading and trailing whitespace. - // this is *not* a generic getInnerText function; it's special to sorttable. - // for example, you can override the cell text with a customkey attribute. - // it also gets .value for fields. - - hasInputs = (typeof node.getElementsByTagName == 'function') && - node.getElementsByTagName('input').length; - - if (node.getAttribute("sorttable_customkey") != null) { - return node.getAttribute("sorttable_customkey"); - } - else if (typeof node.textContent != 'undefined' && !hasInputs) { - return node.textContent.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.innerText != 'undefined' && !hasInputs) { - return node.innerText.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.text != 'undefined' && !hasInputs) { - return node.text.replace(/^\s+|\s+$/g, ''); - } - else { - switch (node.nodeType) { - case 3: - if (node.nodeName.toLowerCase() == 'input') { - return node.value.replace(/^\s+|\s+$/g, ''); - } - case 4: - return node.nodeValue.replace(/^\s+|\s+$/g, ''); - break; - case 1: - case 11: - var innerText = ''; - for (var i = 0; i < node.childNodes.length; i++) { - innerText += sorttable.getInnerText(node.childNodes[i]); - } - return innerText.replace(/^\s+|\s+$/g, ''); - break; - default: - return ''; - } - } - }, - - reverse: function(tbody) { - // reverse the rows in a tbody - newrows = []; - for (var i=0; i=0; i--) { - tbody.appendChild(newrows[i]); - } - delete newrows; - }, - - /* sort functions - each sort function takes two parameters, a and b - you are comparing a[0] and b[0] */ - sort_numeric: function(a,b) { - aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); - if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); - if (isNaN(bb)) bb = 0; - return aa-bb; - }, - sort_alpha: function(a,b) { - if (a[0]==b[0]) return 0; - if (a[0] 0 ) { - var q = list[i]; list[i] = list[i+1]; list[i+1] = q; - swap = true; - } - } // for - t--; - - if (!swap) break; - - for(var i = t; i > b; --i) { - if ( comp_func(list[i], list[i-1]) < 0 ) { - var q = list[i]; list[i] = list[i-1]; list[i-1] = q; - swap = true; - } - } // for - b++; - - } // while(swap) - } -} - -/* ****************************************************************** - Supporting functions: bundled here to avoid depending on a library - ****************************************************************** */ - -// Dean Edwards/Matthias Miller/John Resig - -/* for Mozilla/Opera9 */ -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", sorttable.init, false); -} - -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - document.write(" - - - - - - diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexB1.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexB1.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - \meco_domain\conversations\instantmessagesalert\src - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #1/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\instantmessagesalert\src
-TER: 85 % ( 34/ 40)

-File: \meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
-Instrumentation mode: function
-TER: 100 % ( 23/ 23)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 62 CIMAlertManager::CIMAlertManager()
100 %   1/ 1 34 76 CIMAlertManager::ConstructL()
100 %   1/ 1 34 193 CIMAlertManager::NewL()
100 %   1/ 1 34 209 CIMAlertManager::~CIMAlertManager()
100 %   1/ 1 317 CIMAlertManager::PlayL()
100 %   1/ 1 337 CIMAlertManager::DoPlayL()
100 %   1/ 1 44 415 CIMAlertManager::Stop()
100 %   1/ 1 445 CIMAlertManager::SetVolume()
100 %   1/ 1 457 CIMAlertManager::SetRingingType()
100 %   1/ 1 472 CIMAlertManager::SetVibra()
100 %   1/ 1 486 CIMAlertManager::AddObserverL()
100 %   1/ 1 500 CIMAlertManager::RemoveObserver()
100 %   1/ 1 516 CIMAlertManager::ProcessFileL()
100 %   1/ 1 592 CIMAlertManager::DoSetRingingType()
100 %   1/ 1 649 CIMAlertManager::ConvertVolume()
100 %   1/ 1 46 684 CIMAlertManager::HandleError()
100 %   1/ 1 698 CIMAlertManager::GetToneFileNameL()
100 %   1/ 1 715 CIMAlertManager::MapcInitComplete()
100 %   1/ 1 771 CIMAlertManager::MapcPlayComplete()
100 %   1/ 1 797 CIMAlertManager::HandleKeyChange()
100 %   1/ 1 831 CIMAlertManager::HandleNotifyInt()
100 %   1/ 1 860 CIMAlertManager::MatoPrepareComplete()
100 %   1/ 1 916 CIMAlertManager::MatoPlayComplete()

100 %   23/ 23   cimalertmanager.cpp

-File: \meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
-Instrumentation mode: function
-TER: 71 % (  5/  7)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 35 CIMAlertNotifierImpl::CIMAlertNotifierImpl()
100 %   1/ 1 34 45 CIMAlertNotifierImpl::NewL()
100 %   1/ 1 34 53 CIMAlertNotifierImpl::~CIMAlertNotifierImpl()
100 %   1/ 1 64 CIMAlertNotifierImpl::SetInt()
0 % - 0/ 1 90 CIMAlertNotifierImpl::GetInt()
100 %   1/ 1 68 119 CIMAlertNotifierImpl::ListenKeyChanges()
0 % - 0/ 1 162 CIMAlertNotifierImpl::HandlePropertyNotificationEventL()

71 % - 5/ 7   cimalertnotifierimpl.cpp

-File: \meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
-Instrumentation mode: function
-TER: 56 % (  5/  9)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 68 37 CIMAlertPropertyObserver::CIMAlertPropertyObserver()
100 %   1/ 1 68 51 CIMAlertPropertyObserver::NewL()
100 %   1/ 1 68 60 CIMAlertPropertyObserver::~CIMAlertPropertyObserver()
100 %   1/ 1 68 74 CIMAlertPropertyObserver::ObservePropertyChangeL()
0 % - 0/ 1 92 CIMAlertPropertyObserver::CancelObserve()
0 % - 0/ 1 105 CIMAlertPropertyObserver::RunL()
100 %   1/ 1 68 117 CIMAlertPropertyObserver::DoCancel()
0 % - 0/ 1 127 CIMAlertPropertyObserver::Category()
0 % - 0/ 1 137 CIMAlertPropertyObserver::Key()

56 % - 5/ 9   cimalertpropertyobserver.cpp

-File: \meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
-Instrumentation mode: function
-TER: 100 % (  1/  1)
-To files: Previous | -Next

- - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 34 IMAlertNotifierFactory::CreateNotifierL()

100 %   1/ 1   imalertnotifierfactory.cpp
 

85 % - 34/ 40   DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\src)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexB2.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexB2.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #2/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
-TER: 96 % ( 25/ 26)

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
-Instrumentation mode: function
-TER: 100 % (  6/  6)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 17 80 Ctestinstantmsgalert::Ctestinstantmsgalert()
100 %   1/ 1 17 91 Ctestinstantmsgalert::ConstructL()
100 %   1/ 1 17 140 Ctestinstantmsgalert::NewL()
100 %   1/ 1 17 154 Ctestinstantmsgalert::~Ctestinstantmsgalert()
100 %   1/ 1 17 170 Ctestinstantmsgalert::SendTestClassVersion()
100 %   1/ 1 17 191 LibEntryL()

100 %   6/ 6   testinstantmsgalert.cpp

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
-Instrumentation mode: function
-TER: 95 % ( 19/ 20)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 83 Ctestinstantmsgalert::Delete()
100 %   1/ 1 34 93 Ctestinstantmsgalert::RunMethodL()
0 % - 0/ 1 138 Ctestinstantmsgalert::ExampleL()
100 %   1/ 1 168 Ctestinstantmsgalert::CIMAlertManager_NewL()
100 %   1/ 1 190 Ctestinstantmsgalert::CIMAlertManager_PlayL()
100 %   1/ 1 204 Ctestinstantmsgalert::CIMAlertManager_SetVolume()
100 %   1/ 1 220 Ctestinstantmsgalert::CIMAlertManager_SetRingingType()
100 %   1/ 1 235 Ctestinstantmsgalert::CIMAlertManager_SetVibra()
100 %   1/ 1 250 Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType()
100 %   1/ 1 265 Ctestinstantmsgalert::CIMAlertManager_ConvertVolume()
100 %   1/ 1 281 Ctestinstantmsgalert::CIMAlertManager_Stop()
100 %   1/ 1 296 Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete()
100 %   1/ 1 311 Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete()
100 %   1/ 1 326 Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange()
100 %   1/ 1 342 Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt()
100 %   1/ 1 356 Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete()
100 %   1/ 1 370 Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete()
100 %   1/ 1 385 Ctestinstantmsgalert::CIMAlertManager_AddObserverL()
100 %   1/ 1 401 Ctestinstantmsgalert::CIMAlertManager_RemoveObserver()
100 %   1/ 1 417 Ctestinstantmsgalert::CIMAlertManager_HandleError()

95 % - 19/ 20   testinstantmsgalertblocks.cpp
 

96 % - 25/ 26   DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexB3.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexB3.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #3/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs
-TER: 50 % ( 5/ 10)

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
-Instrumentation mode: function
-TER: 33 % (  1/  3)
-To files: Previous | -Next

- - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 43 CVIMPSTSettingsStore::NewL()
0 % - 0/ 1 55 CVIMPSTSettingsStore::~CVIMPSTSettingsStore()
0 % - 0/ 1 65 CVIMPSTSettingsStore::NewLC()

33 % - 1/ 3   s_vimpstsettingsstore.cpp

-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
-Instrumentation mode: function
-TER: 57 % (  4/  7)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 1 43 CVIMPSTSettingsStoreImp::InitialiseLibraryL()
0 % - 0/ 1 50 CVIMPSTSettingsStoreImp::Release()
100 %   1/ 1 34 58 CVIMPSTSettingsStoreImp::NewL()
100 %   1/ 1 34 72 CVIMPSTSettingsStoreImp::ConstructL()
100 %   1/ 1 34 81 CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp()
100 %   1/ 1 86 CVIMPSTSettingsStoreImp::GetL()
0 % - 0/ 1 100 CVIMPSTSettingsStoreImp::SetL()

57 % - 4/ 7   s_vimpstsettingsstoreimp.cpp
 

50 % - 5/ 10   DIRECTORY OVERALL (\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexC.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexC.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - Index - - - - - - - - -Index
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
\meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
   CIMAlertManager::CIMAlertManager()
   CIMAlertManager::ConstructL()
   CIMAlertManager::NewL()
   CIMAlertManager::~CIMAlertManager()
   CIMAlertManager::PlayL()
   CIMAlertManager::DoPlayL()
   CIMAlertManager::Stop()
   CIMAlertManager::SetVolume()
   CIMAlertManager::SetRingingType()
   CIMAlertManager::SetVibra()
   CIMAlertManager::AddObserverL()
   CIMAlertManager::RemoveObserver()
   CIMAlertManager::ProcessFileL()
   CIMAlertManager::DoSetRingingType()
   CIMAlertManager::ConvertVolume()
   CIMAlertManager::HandleError()
   CIMAlertManager::GetToneFileNameL()
   CIMAlertManager::MapcInitComplete()
   CIMAlertManager::MapcPlayComplete()
   CIMAlertManager::HandleKeyChange()
   CIMAlertManager::HandleNotifyInt()
   CIMAlertManager::MatoPrepareComplete()
   CIMAlertManager::MatoPlayComplete()
 
\meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
   CIMAlertNotifierImpl::CIMAlertNotifierImpl()
   CIMAlertNotifierImpl::NewL()
   CIMAlertNotifierImpl::~CIMAlertNotifierImpl()
   CIMAlertNotifierImpl::SetInt()
   CIMAlertNotifierImpl::GetInt()
   CIMAlertNotifierImpl::ListenKeyChanges()
   CIMAlertNotifierImpl::HandlePropertyNotificationEventL()
 
\meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
   CIMAlertPropertyObserver::CIMAlertPropertyObserver()
   CIMAlertPropertyObserver::NewL()
   CIMAlertPropertyObserver::~CIMAlertPropertyObserver()
   CIMAlertPropertyObserver::ObservePropertyChangeL()
   CIMAlertPropertyObserver::CancelObserve()
   CIMAlertPropertyObserver::RunL()
   CIMAlertPropertyObserver::DoCancel()
   CIMAlertPropertyObserver::Category()
   CIMAlertPropertyObserver::Key()
 
\meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
   IMAlertNotifierFactory::CreateNotifierL()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
   Ctestinstantmsgalert::Ctestinstantmsgalert()
   Ctestinstantmsgalert::ConstructL()
   Ctestinstantmsgalert::NewL()
   Ctestinstantmsgalert::~Ctestinstantmsgalert()
   Ctestinstantmsgalert::SendTestClassVersion()
   LibEntryL()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
   Ctestinstantmsgalert::Delete()
   Ctestinstantmsgalert::RunMethodL()
   Ctestinstantmsgalert::ExampleL()
   Ctestinstantmsgalert::CIMAlertManager_NewL()
   Ctestinstantmsgalert::CIMAlertManager_PlayL()
   Ctestinstantmsgalert::CIMAlertManager_SetVolume()
   Ctestinstantmsgalert::CIMAlertManager_SetRingingType()
   Ctestinstantmsgalert::CIMAlertManager_SetVibra()
   Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType()
   Ctestinstantmsgalert::CIMAlertManager_ConvertVolume()
   Ctestinstantmsgalert::CIMAlertManager_Stop()
   Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete()
   Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete()
   Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange()
   Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt()
   Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete()
   Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete()
   Ctestinstantmsgalert::CIMAlertManager_AddObserverL()
   Ctestinstantmsgalert::CIMAlertManager_RemoveObserver()
   Ctestinstantmsgalert::CIMAlertManager_HandleError()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
   CVIMPSTSettingsStore::NewL()
   CVIMPSTSettingsStore::~CVIMPSTSettingsStore()
   CVIMPSTSettingsStore::NewLC()
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
   CVIMPSTSettingsStoreImp::InitialiseLibraryL()
   CVIMPSTSettingsStoreImp::Release()
   CVIMPSTSettingsStoreImp::NewL()
   CVIMPSTSettingsStoreImp::ConstructL()
   CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp()
   CVIMPSTSettingsStoreImp::GetL()
   CVIMPSTSettingsStoreImp::SetL()
diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD1.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD1.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,986 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - cimalertmanager.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #1/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
-Instrumentation mode: function
-TER: 100 % ( 23/ 23)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ==============================================================================
  3  *  Name        : cimalertmanager.cpp
  4  *  Part of     : conversations/instantmessagesalert
  5  *  Description : This class gives interface to play IM message alert
  6  *  Version     : %version: 3 %
  7  *
  8  *  Copyright © 2009 Nokia. All rights reserved..
  9  *  This material, including documentation and any related 
  10  *  computer programs, is protected by copyright controlled by 
  11  *  Nokia Corporation. All rights are reserved. Copying, 
  12  *  including reproducing, storing, adapting or translating, any 
  13  *  or all of this material requires the prior written consent of 
  14  *  Nokia Corporation. This material also contains confidential 
  15  *  information which may not be disclosed to others without the 
  16  *  prior written consent of Nokia Corporation.
  17  * ==============================================================================
  18  */
  19 
  20 // INCLUDE FILES
  21 #include    "cimalertmanager.h"
  22 #include    "imalertdebugprint.h"      
  23 #include    "mimalertmanagerobserver.h"
  24 #include    "mimalertnotifierinterface.h"
  25 #include    "imalertnotifierfactory.h"
  26 
  27 #include    <MProfileEngine.h>
  28 #include   <pathinfo.h>
  29 #include    <mda/common/resource.h>
  30 #include    <audiopreference.h>
  31 #include    <bautils.h>
  32 #include    <hwrmvibrasdkcrkeys.h>
  33 #include    <coreapplicationuisdomainpskeys.h>
  34 #include    <ProfileEngineSDKCRKeys.h>
  35 #include    <MProfileTones.h>
  36 #include    <TProfileToneSettings.h>
  37 #include    <MProfile.h>
  38 #include    <HWRMVibra.h>
  39 
  40 //to get message tone file
  41 #include <cvimpstsettingsstore.h>
  42 
  43 
  44 // CONSTANTS
  45 const TInt KMinVolumeLevel( 1 );
  46 const TInt KMaxVolumeLevel( 10 );
  47 const TInt KToneInterval( 1000000 ); // 1 second pause between tones
  48 
  49 _LIT( KChatRngMimeType, "application/vnd.nokia.ringing-tone" );
  50 _LIT( KBeepOnceSound, "beep.rng" );
  51 _LIT( KProfileSilentTone, "No_Sound.wav" ); 
  52 
  53     
  54 // ============================ MEMBER FUNCTIONS ===============================
  55 
  56 // -----------------------------------------------------------------------------
  57 // CIMAlertManager::CIMAlertManager
  58 // C++ default constructor can NOT contain any code, that
  59 // might leave.
  60 // -----------------------------------------------------------------------------
  61 //
Top
34 34   62 CIMAlertManager::CIMAlertManager()
  63     :   iAudioPlayerStatus( EAudioPlayerNotCreated ),
  64       iTonePlayerStatus( EAudioPlayerNotCreated ),
  65         iIsPlayingDefaultIMSound( EFalse ),
  66         iCallState (EFalse)
  67     {
  68     }
  69 
  70 // ---------------------------------------------------------
  71 // CIMAlertManager::ConstructL
  72 // (other items were commented in a header).
  73 // ---------------------------------------------------------
  74 //
  75 
Top
34 34   76 void CIMAlertManager::ConstructL()
  77     {
  78     CHAT_DP_FUNC_ENTER("ConstructL");    
  79     iProfileApi = CreateProfileEngineL();
  80         
  81     User::LeaveIfError( iFs.Connect() );
  82 
  83     CHAT_DP_TXT("CMdaAudioPlayerUtility::NewL()" );
  84 
  85    iAudioPlayer = CMdaAudioPlayerUtility::NewL( *this );
  86    iAudioPlayerStatus = EAudioPlayerReady;
  87 
  88     CHAT_DP_TXT("CMdaAudioToneUtility::NewL()" );
  89    iTonePlayer = CMdaAudioToneUtility::NewL( *this );
  90    iTonePlayerStatus = EAudioPlayerReady;
  91  
  92     iProfilesRepository = CRepository::NewL( KCRUidProfileEngine );
  93     iVibraRepository = CRepository::NewL( KCRUidVibraCtrl );
  94  
  95     // Get initial settings from active profile
  96     iRingingVolumeNotifyHandler = CCenRepNotifyHandler::NewL( *this, 
  97                                               *iProfilesRepository,
  98                                               CCenRepNotifyHandler::EIntKey,
  99                                               KProEngActiveRingingVolume );
  100     iRingingVolumeNotifyHandler->StartListeningL();
  101     
  102     
  103     iRingingTypeNotifyHandler = CCenRepNotifyHandler::NewL( *this, 
  104                                               *iProfilesRepository,
  105                                               CCenRepNotifyHandler::EIntKey,
  106                                               KProEngActiveRingingType );
  107     iRingingTypeNotifyHandler->StartListeningL();
  108     
  109     
  110     iVibraNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iVibraRepository,
  111                                               CCenRepNotifyHandler::EIntKey,
  112                                               KVibraCtrlProfileVibraEnabled );
  113     iVibraNotifyHandler->StartListeningL();
  114     
  115     User::LeaveIfError( iProfilesRepository->Get( KProEngActiveRingingVolume, 
  116                                                   iRingingVolume ) );
  117                                                  
  118     User::LeaveIfError( iVibraRepository->Get( KVibraCtrlProfileVibraEnabled, 
  119                                                iVibra ) );
  120     
  121     User::LeaveIfError( iApaSession.Connect() );
  122 
  123     // register for changes in message Tone quitting
  124     iNotifierAPI = IMAlertNotifierFactory::CreateNotifierL( this );
  125     iNotifierAPI->ListenKeyChanges( MIMAlertNotifierInterface::EMSGToneQuitKey );
  126     // also register for changes in call state 
  127     iNotifierAPI->ListenKeyChanges( MIMAlertNotifierInterface::ECallState );
  128     iToneFileName = HBufC::NewL( KMaxPath );
  129 
  130     // Get path to beep once ringing tone, first check simple sound folder.
  131     TFileName beepFile = PathInfo::RomRootPath();
  132     beepFile.Append( PathInfo::SimpleSoundsPath() );
  133     beepFile.Append( KBeepOnceSound );
  134     RFile file;
  135     TInt openErr = file.Open( iFs, beepFile, EFileRead );
  136     file.Close();
  137     
  138     if ( openErr == KErrNotFound || openErr == KErrPathNotFound )
  139         {
  140         // Check digital sounds folder
  141         beepFile.Zero();
  142         beepFile.Append( PathInfo::RomRootPath() );
  143         beepFile.Append( PathInfo::DigitalSoundsPath() );
  144         beepFile.Append( KBeepOnceSound );
  145         openErr = file.Open( iFs, beepFile, EFileRead );
  146         file.Close();
  147         }    
  148     
  149     CHAT_DP( D_PLAIN_LIT( "CIMAlertManager::ConstructL() openErr = %d" ), openErr );
  150     
  151     if ( openErr == KErrNone )
  152         {
  153         iBeepRingingTone = beepFile.AllocL();
  154         TPtrC ptr = iBeepRingingTone->Des();
  155         CHAT_DP( D_PLAIN_LIT( "CIMAlertManager::ConstructL() iBeepRingingTone = %S" ), &ptr );
  156         }
  157     else
  158         {
  159         HandleError( openErr );
  160         }
  161 
  162     // get active ringing type, change events come to us later...
  163     iActiveProfile = iProfileApi->ActiveProfileL();
  164     const MProfileTones& profileTones = iActiveProfile->ProfileTones();
  165     const TProfileToneSettings& profileSettings = profileTones.ToneSettings();
  166     iRingingType = profileSettings.iRingingType;
  167     iActiveProfile->Release();
  168     iActiveProfile = NULL; // prevent further usage
  169     // after this, active ringing type changes are notified via the cenrep
  170     // notify handler callback through HandleNotifyInt
  171     
  172     // TRAP to catch leaves, leaves with KErrNotSupported if vibra
  173     // is not supported
  174     TRAPD( err, iVibrator = CHWRMVibra::NewL() );
  175     if ( err == KErrNotSupported )
  176         {
  177         // Make sure it's NULL
  178         iVibrator = NULL;
  179         }
  180     else
  181         {
  182         // Leave with other errors e.g. KErrNoMemory
  183         User::LeaveIfError( err );
  184         }
  185     iSettingsStore = CVIMPSTSettingsStore::NewL();
  186     CHAT_DP_FUNC_DONE("ConstructL");
  187     }
  188 
  189 // ---------------------------------------------------------
  190 // CIMAlertManager::NewL
  191 // (other items were commented in a header).
  192 // ---------------------------------------------------------
Top
34   193 EXPORT_C CIMAlertManager* CIMAlertManager::NewL()
  194     {
  195     CIMAlertManager* self = new( ELeave ) CIMAlertManager();
  196 
  197     CleanupStack::PushL( self );
  198     self->ConstructL();
  199     CleanupStack::Pop( self );
  200 
  201     return self;
  202     }
  203 
  204 
  205 // ---------------------------------------------------------
  206 // CIMAlertManager::~CIMAlertManager
  207 // (other items were commented in a header).
  208 // ---------------------------------------------------------
Top
34 34   209 CIMAlertManager::~CIMAlertManager()
  210     {
  211     CHAT_DP_FUNC_ENTER("~CIMAlertManager");
  212     Stop(); // Stops possible playback
  213 
  214     if ( iActiveProfile )
  215         {
  216         iActiveProfile->Release();
  217         iActiveProfile = NULL; // prevent further usage
  218         }
  219 
  220     if ( iProfileApi ) 
  221         {
  222         iProfileApi->Release();
  223         iProfileApi = NULL;
  224         }
  225 
  226     if ( iVibraNotifyHandler )
  227         {
  228         iVibraNotifyHandler->StopListening();
  229         delete iVibraNotifyHandler;
  230         iVibraNotifyHandler = NULL;
  231         }
  232     
  233     if ( iRingingTypeNotifyHandler )
  234         {
  235         iRingingTypeNotifyHandler->StopListening();
  236         delete iRingingTypeNotifyHandler;
  237         iRingingTypeNotifyHandler = NULL;
  238         }
  239     
  240 
  241     if ( iRingingVolumeNotifyHandler )
  242         {
  243         iRingingVolumeNotifyHandler->StopListening();
  244         delete iRingingVolumeNotifyHandler;
  245         iRingingVolumeNotifyHandler = NULL;
  246         }
  247     if(iProfilesRepository)
  248         {
  249         delete iProfilesRepository;
  250         iProfilesRepository = NULL;
  251         }
  252     if(iVibraRepository)
  253         {
  254         delete iVibraRepository;
  255         iVibraRepository = NULL;
  256         }
  257     
  258     iApaSession.Close();
  259     
  260     if(iNotifierAPI)
  261         {
  262         delete iNotifierAPI;
  263         iNotifierAPI = NULL;
  264         }
  265     
  266     if(iAudioPlayer)
  267         {
  268         CHAT_DP_TXT( "delete CMdaAudioPlayerUtility" );
  269         iAudioPlayer->Close();
  270         delete iAudioPlayer;
  271         iAudioPlayer = NULL;
  272         }
  273     if(iTonePlayer)
  274         {
  275         CHAT_DP_TXT( "delete CMdaAudioToneUtility" );
  276         delete iTonePlayer;
  277         iTonePlayer = NULL;
  278         }
  279     
  280     iObservers.Close();
  281 
  282     if(iToneFileName)
  283         {
  284         delete iToneFileName;
  285         iToneFileName = NULL;
  286         }
  287 
  288     if(iVibrator)
  289         {
  290         delete iVibrator;
  291         iVibrator = NULL;
  292         }
  293 
  294     if(iBeepRingingTone)
  295         {
  296         delete iBeepRingingTone;
  297         iBeepRingingTone = NULL;
  298         }
  299 
  300     iFs.Close();
  301     
  302     if(iSettingsStore)
  303         {
  304         delete iSettingsStore;
  305         iSettingsStore = NULL;
  306         }
  307     
  308     CHAT_DP_FUNC_DONE("~CIMAlertManager");
  309     }
  310 
  311 
  312 // ---------------------------------------------------------
  313 // CIMAlertManager::Play
  314 // (other items were commented in a header).
  315 // ---------------------------------------------------------
  316 //
Top
  317 EXPORT_C void CIMAlertManager::PlayL(TUint32 aServiceId)
  318     {
  319     CHAT_DP_FUNC_ENTER("Play");
  320     if( !iCallState )
  321         {
  322         Stop();
  323         TRAPD( err, DoPlayL(aServiceId) );
  324         if( err )
  325             {
  326             HandleError( err );
  327             }
  328         }
  329     CHAT_DP_FUNC_DONE("Play");
  330     }
  331 
  332 // ---------------------------------------------------------
  333 // CIMAlertManager::DoPlayL
  334 // (other items were commented in a header).
  335 // ---------------------------------------------------------
  336 //
Top
  337 EXPORT_C void CIMAlertManager::DoPlayL(TUint32 aServiceId)
  338     {
  339     CHAT_DP_FUNC_ENTER("DoPlayL");
  340 
  341     TBuf<KMaxPath> toneFileName;
  342 
  343     // check if we're silent or not
  344     iActiveProfile = iProfileApi->ActiveProfileL();
  345     TBool isSilent = iActiveProfile->IsSilent();
  346     iActiveProfile->Release();
  347     iActiveProfile = NULL; // prevent further usage
  348 
  349     // vibrate, if it's allowed
  350     CHWRMVibra::TVibraModeState vibraModeState = iVibrator->VibraSettings();
  351     CHWRMVibra::TVibraStatus vibraStatus = iVibrator->VibraStatus();
  352    
  353     // TODO: Find from Nikhil what the behaviour should be if Vibra is already
  354     // on and you get a new message. Aare you supposed to truncate the existing
  355     // vibration and start afresh or let the existing vibration continue?
  356     if ( vibraModeState == CHWRMVibra::EVibraModeON && 
  357          vibraStatus == CHWRMVibra::EVibraStatusStopped )
  358         {
  359         iVibrator->StartVibraL( KIMVibraDuration );
  360         }
  361 
  362     // sound ordering:
  363     //  silent: get out.
  364     //  beep once: beep, and if ok, exit.
  365     //  if beep failed, or not active: try to play sound
  366     //  for this server.
  367     //  if it failed, play default sound.
  368 
  369     if ( isSilent ) 
  370         {
  371         // Silent profile, get out.
  372         CHAT_DP_TXT( "DoPlayL - Returning" );
  373         return;
  374         }
  375 
  376     TInt err = KErrNone;
  377 
  378     if ( iRingingType == EProfileRingingTypeBeepOnce && iBeepRingingTone )
  379         {
  380         // Play beep.rng
  381         TRAP( err, ProcessFileL( *iBeepRingingTone ) );
  382         }
  383     
  384     if ( err != KErrNone || iRingingType != EProfileRingingTypeBeepOnce )
  385         {
  386         err = KErrNone;
  387 
  388         // Beep once not active, or beep once failed.
  389         // Try to play the sound set for this server
  390         TBuf<KMaxPath> toneFileName;
  391       GetToneFileNameL( toneFileName, aServiceId );
  392       TParsePtr parsedPtr( toneFileName );
  393       
  394       CHAT_DP( D_CHAT_LIT(" file = [%S] "),&toneFileName);
  395 
  396       // If alert tone OFF, don't play anything
  397         if( parsedPtr.NameAndExt().Compare( KProfileSilentTone ) != 0 )
  398             {
  399             // Not OFF
  400             TRAP( err, ProcessFileL( toneFileName ) );        
  401             }
  402         }
  403 
  404     // Not ringing once, but left
  405     User::LeaveIfError( err );
  406 
  407     CHAT_DP_FUNC_DONE("DoPlayL");
  408     }
  409 
  410 // ---------------------------------------------------------
  411 // CIMAlertManager::Stop
  412 // (other items were commented in a header).
  413 // ---------------------------------------------------------
  414 //
Top
44 44   415 EXPORT_C void CIMAlertManager::Stop()
  416     {
  417     CHAT_DP_FUNC_ENTER("Stop");
  418 
  419     if( iAudioPlayerStatus == EAudioPlayerPlaying )
  420         {
  421         CHAT_DP_TXT( 
  422             "Audio player is playing. CMdaAudioPlayerUtility::Stop()" );
  423         iAudioPlayer->Stop();
  424         iAudioPlayer->Close();        
  425         iAudioPlayerStatus = EAudioPlayerReady;
  426         }
  427     
  428     if( iTonePlayerStatus == EAudioPlayerPlaying )
  429         {
  430         CHAT_DP_TXT( 
  431             "Tone player is playing. CMdaAudioToneUtility::CancelPlay()" );
  432         iTonePlayer->CancelPlay();        
  433         iTonePlayerStatus = EAudioPlayerReady;
  434         }    
  435    
  436     CHAT_DP_FUNC_DONE("Stop");
  437     }
  438 
  439 // ---------------------------------------------------------
  440 // CIMAlertManager::SetVolume
  441 // Set the volume at which the sound is played
  442 // (other items were commented in a header).
  443 // ---------------------------------------------------------
  444 //
Top
  445 EXPORT_C void CIMAlertManager::SetVolume( TInt aVolume )
  446     {
  447     iRingingVolumeNotifyHandler->StopListening();
  448     iRingingVolume = aVolume;
  449     }
  450 
  451 // ---------------------------------------------------------
  452 // CIMAlertManager::SetRingingType
  453 // Sets the ringing type how the sound is played
  454 // (other items were commented in a header).
  455 // ---------------------------------------------------------
  456 //
Top
  457 EXPORT_C void CIMAlertManager::SetRingingType( TProfileRingingType aRingingType )
  458     {
  459     if(iRingingTypeNotifyHandler)
  460         {
  461         iRingingTypeNotifyHandler->StopListening();
  462         iRingingType = aRingingType;
  463         }
  464     }
  465 
  466 // ---------------------------------------------------------
  467 // CIMAlertManager::SetVibra
  468 // Sets the vibrating alert on or off
  469 // (other items were commented in a header).
  470 // ---------------------------------------------------------
  471 //
Top
  472 EXPORT_C void CIMAlertManager::SetVibra( TBool aVibra )
  473     {
  474     if(iVibraNotifyHandler)
  475         {
  476         iVibraNotifyHandler->StopListening();
  477         iVibra = aVibra;
  478         }
  479     }
  480 
  481 // ---------------------------------------------------------
  482 // CIMAlertManager::AddObserverL
  483 // (other items were commented in a header).
  484 // ---------------------------------------------------------
  485 //
Top
  486 EXPORT_C void CIMAlertManager::AddObserverL( const MIMAlertManagerObserver* aObserver )
  487    {
  488     // make sure that aObserver does not get appended in release mode also.
  489    if( aObserver )  
  490       {
  491          User::LeaveIfError( iObservers.Append( aObserver ) );
  492       }
  493    }
  494 
  495 // ---------------------------------------------------------
  496 // CIMAlertManager::RemoveObserver
  497 // (other items were commented in a header).
  498 // ---------------------------------------------------------
  499 //
Top
  500 EXPORT_C void CIMAlertManager::RemoveObserver( const MIMAlertManagerObserver* aObserver )
  501    {
  502    TInt index( iObservers.Find( aObserver ) );
  503 
  504    if( index != KErrNotFound )
  505       {
  506       iObservers.Remove( index );
  507       }
  508    }
  509 
  510 // ---------------------------------------------------------
  511 // CIMAlertManager::ProcessFileL
  512 // If filename is defined, prepare the audioplayer.
  513 // (other items were commented in a header).
  514 // ---------------------------------------------------------
  515 //
Top
  516 void CIMAlertManager::ProcessFileL( const TDesC& aFileName )
  517     {
  518     CHAT_DP_FUNC_ENTER("ProcessFileL");
  519 
  520     TFileName *fileName = new (ELeave) TFileName();
  521     CleanupStack::PushL( fileName );
  522 
  523     // if filename is empty, use default sound
  524     if ( aFileName.Length() == 0 )
  525         {
  526         return;
  527         }
  528     else
  529         {
  530         *fileName = aFileName;
  531         }
  532 
  533     TPtr filePtr( NULL, 0 );
  534     if( !BaflUtils::FileExists( iFs, *fileName ) )
  535         {
  536         CHAT_DP( D_CHAT_LIT( "File does not exist ( %S )" ), &(*fileName) );
  537         User::Leave( KErrNotFound );
  538         }
  539 
  540     Stop(); // Stops possible playback 
  541 
  542     TUid dummyUid( KNullUid );
  543    TDataType dataType;
  544    
  545     User::LeaveIfError( iApaSession.AppForDocument( *fileName, dummyUid, 
  546                                                     dataType ) );
  547 
  548     if( dataType.Des().CompareF( KChatRngMimeType ) == 0 ) 
  549         {
  550         // making sure that another initializing is not already ongoing
  551         if( iTonePlayerStatus == EAudioPlayerReady )
  552             {
  553             CHAT_DP( D_CHAT_LIT( 
  554                 "CMdaAudioToneUtility::PrepareToPlayFileSequence( %S )" ), 
  555                 &(*fileName));
  556             iTonePlayerStatus = EAudioPlayerInitializing;
  557             iTonePlayer->PrepareToPlayFileSequence( *fileName );
  558             }
  559         }
  560     else
  561         {
  562         // making sure that another initializing is not already ongoing
  563         if( iAudioPlayerStatus == EAudioPlayerReady )
  564             {
  565             CHAT_DP( D_CHAT_LIT(
  566                 "FileList - CMdaAudioPlayerUtility::OpenFileL( %S )" ), 
  567                 &(*fileName));
  568             iAudioPlayerStatus = EAudioPlayerInitializing;
  569             TRAPD( err, iAudioPlayer->OpenFileL( *fileName ) );
  570             CHAT_DP( D_CHAT_LIT(
  571                 "FileList - CMdaAudioPlayerUtility::OpenFileL err = %d" ), 
  572                 err );
  573             if( err )
  574                 {              
  575                 iAudioPlayerStatus = EAudioPlayerReady;
  576                 User::Leave( err );
  577                 }
  578             }
  579         }    
  580 
  581     CleanupStack::PopAndDestroy( fileName );
  582     CHAT_DP_FUNC_DONE("ProcessFileL");
  583     }
  584 
  585 // ---------------------------------------------------------
  586 // CIMAlertManager::DoSetRingingType
  587 // When audioplayer is ready, set its ringing type
  588 // (other items were commented in a header).
  589 // ---------------------------------------------------------
  590 //
  591 
Top
  592 void CIMAlertManager::DoSetRingingType( TInt aRingingType )
  593     {
  594     if( iAudioPlayerStatus == EAudioPlayerInitialized )
  595         {
  596         switch( aRingingType )
  597             {
  598          // Fall through
  599             case EProfileRingingTypeRingingOnce:
  600                 {
  601                 iAudioPlayer->SetRepeats( 0, 
  602                         TTimeIntervalMicroSeconds( KToneInterval ) );
  603                 break;
  604                 }
  605             case EProfileRingingTypeBeepOnce:
  606                 {
  607                 iAudioPlayer->SetRepeats( 0, 
  608                         TTimeIntervalMicroSeconds( KToneInterval ) );
  609                 break;
  610                 }
  611             default:
  612                 {
  613                 break;
  614                 }
  615             }
  616         }
  617     else if( iTonePlayerStatus == EAudioPlayerInitialized )
  618         {
  619         switch( aRingingType )
  620             {
  621          // Fall through
  622             case EProfileRingingTypeRingingOnce:
  623                 {
  624                 iTonePlayer->SetRepeats( 0, 
  625                         TTimeIntervalMicroSeconds( KToneInterval ) );
  626                 break;
  627                 }
  628             case EProfileRingingTypeBeepOnce:
  629                 {
  630                 iTonePlayer->SetRepeats( 0, 
  631                         TTimeIntervalMicroSeconds( KToneInterval ) );
  632                 break;
  633                 }
  634             default:
  635                 {
  636                 break;
  637                 }
  638             }
  639         }
  640     }
  641 
  642 // ---------------------------------------------------------
  643 // CIMAlertManager::ConvertVolume
  644 // Convert volume to the scale used by hardware.
  645 // E.g. Profiles lets user select volume 1-10, but hw's scale is normally 1-9.
  646 // (other items were commented in a header).
  647 // ---------------------------------------------------------
  648 //
Top
  649 TInt CIMAlertManager::ConvertVolume( TInt aVolume )
  650     {
  651     TInt result( 0 );
  652     // if ringing type is "silent" then volume
  653     // is zero
  654     if( iRingingType != EProfileRingingTypeSilent )
  655         {
  656         if ( iAudioPlayerStatus == EAudioPlayerInitialized ||
  657             iAudioPlayerStatus == EAudioPlayerPlaying )
  658             {
  659             result = iAudioPlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
  660             if ( aVolume == KMinVolumeLevel && result == 0 )
  661                 {
  662                 result = 1;
  663                 }
  664             }
  665         else if( iTonePlayerStatus == EAudioPlayerInitialized ||
  666             iTonePlayerStatus == EAudioPlayerPlaying )
  667             {
  668             result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel;
  669             if ( aVolume == KMinVolumeLevel && result == 0 )
  670                 {
  671                 result = 1;
  672                 }
  673             }
  674         }
  675     return result;
  676     }
  677 
  678 // ---------------------------------------------------------
  679 // CIMAlertManager::HandleError
  680 // Notifies all observers that playing is completed
  681 // (other items were commented in a header).
  682 // ---------------------------------------------------------
  683 //
Top
46 46   684 void CIMAlertManager::HandleError( TInt aError )
  685     {
  686     if ( ( aError == KErrNoMemory ) || 
  687          ( aError == KErrDiskFull ) ) 
  688       {
  689       CActiveScheduler::Current()->Error( aError );
  690       }
  691     }
  692 
  693 // ---------------------------------------------------------
  694 // CIMAlertManager::GetToneFileNameL
  695 // (other items were commented in a header).
  696 // ---------------------------------------------------------
  697 //
Top
  698 void CIMAlertManager::GetToneFileNameL( TDes& aToneFileName ,TUint32 aServiceId)
  699    {
  700     RBuf buffer;
  701     buffer.CreateL( RProperty::KMaxPropertySize ); 
  702     CleanupClosePushL( buffer );
  703     iSettingsStore->GetL(aServiceId, EServiceToneFileName, buffer); 
  704     aToneFileName.Copy( buffer );
  705     CleanupStack::PopAndDestroy();  //buffer
  706     }
  707 
  708 // ---------------------------------------------------------
  709 // CIMAlertManager::MapcInitComplete
  710 // This method is called when the audioplayer initialisation is ready.
  711 // If file format is supported, start playing the sound file.
  712 // (other items were commented in a header).
  713 // ---------------------------------------------------------
  714 //
Top
  715 void CIMAlertManager::MapcInitComplete(
  716     TInt aError, const TTimeIntervalMicroSeconds& /* aDuration */ )
  717     {
  718     CHAT_DP( D_CHAT_LIT(
  719         "MMdaAudioPlayerCallback::MapcInitComplete() callback, error == %d" ), 
  720         aError);
  721 
  722     if ( !aError && iAudioPlayerStatus == EAudioPlayerInitializing )
  723         {
  724         iAudioPlayerStatus = EAudioPlayerInitialized;
  725         // currently IM messages supports only this ringing type
  726         // ringing once
  727         DoSetRingingType( EProfileRingingTypeRingingOnce );
  728         CHAT_DP( D_CHAT_LIT("CMdaAudioPlayerUtility::SetVolume( %d )" ), 
  729                  iRingingVolume);
  730         
  731         iAudioPlayer->SetVolume( ConvertVolume( iRingingVolume ) );
  732         
  733         // TODO: please check the value KAudioPrefNewSpecialMessage.
  734         // WHy does it have this particular value? What is the rationale.
  735         //
  736         CHAT_DP( D_CHAT_LIT("CMdaAudioPlayerUtility::SetPriority( %d, %d )" ),
  737             KAudioPriorityRecvMsg, 
  738             TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  739             
  740         iAudioPlayer->SetPriority( KAudioPriorityRecvMsg,
  741             TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  742             
  743         CHAT_DP_TXT("CMdaAudioPlayerUtility::Play()" );
  744         iAudioPlayer->Play();
  745         iAudioPlayerStatus = EAudioPlayerPlaying;
  746         iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, 
  747                               ECoreAppUIsTonePlaying );
  748         }
  749     else
  750         {
  751         Stop();
  752         iAudioPlayerStatus = EAudioPlayerReady;
  753         if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ))
  754             {
  755             return;
  756             }
  757         else
  758             {
  759             HandleError( aError );
  760             iIsPlayingDefaultIMSound = EFalse;
  761             }
  762         }
  763     }
  764 
  765 // ---------------------------------------------------------
  766 // CIMAlertManager::MapcPlayComplete
  767 // This method is called when the audioplayer has finished playing a sound
  768 // (other items were commented in a header).
  769 // ---------------------------------------------------------
  770 //
Top
  771 void CIMAlertManager::MapcPlayComplete( TInt aError )
  772     {
  773     CHAT_DP( D_CHAT_LIT(
  774         "MMdaAudioPlayerCallback::MapcPlayComplete() callback, error == %d" ), 
  775         aError);
  776     iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, ECoreAppUIsTonePlayingUninitialized );
  777     iAudioPlayer->Close();
  778     iAudioPlayerStatus = EAudioPlayerReady;
  779     
  780     if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) )
  781         {
  782         return;
  783         }
  784     else
  785         {
  786         HandleError( aError );
  787         iIsPlayingDefaultIMSound = EFalse;
  788         }
  789     }
  790 
  791 // ---------------------------------------------------------
  792 // CIMAlertManager::HandleKeyChange
  793 // This method receives notifications from the shared data server
  794 // (other items were commented in a header).
  795 // ---------------------------------------------------------
  796 //
Top
  797 void CIMAlertManager::HandleKeyChange( TUpdatedKey& aUpdatedValues )
  798     {
  799     CHAT_DP_FUNC_ENTER("HandleKeyChange");
  800 
  801     /*Do not play im tone in any of the call state  except EPSCTsyCallStateNone
  802      *     (1) EPSCTsyCallStateNone 
  803      *     (2) EPSCTsyCallStateDialling 
  804      *     (3) EPSCTsyCallStateAlerting 
  805      *     (4) EPSTelephonyCallStateConnected 
  806      *     (5) EPSCTsyCallStateDisconnecting 
  807      *     (6) EPSCTsyCallStateNone
  808      * 
  809      */
  810     if( aUpdatedValues.iValue == EPSCTsyCallStateNone)
  811         {
  812         iCallState = EFalse;
  813         }
  814     else
  815         {
  816         iCallState = ETrue;       
  817         }
  818     if(aUpdatedValues.iValue == ECoreAppUIsStopTonePlaying )
  819         {
  820         // Message tone should be stopped
  821         CHAT_DP_TXT( "**stop playing!**" );
  822         Stop();        
  823         }
  824     CHAT_DP_FUNC_DONE("HandleKeyChange");
  825     }
  826 
  827 // ---------------------------------------------------------
  828 // CIMAlertManager::HandleNotifyInt
  829 // (other items were commented in a header).
  830 // ---------------------------------------------------------
Top
  831 void CIMAlertManager::HandleNotifyInt( TUint32 aId, TInt aNewValue )
  832    {
  833     CHAT_DP_FUNC_ENTER("HandleNotifyL");
  834     CHAT_DP( D_CHAT_LIT("aKey == %d" ), aId);
  835     CHAT_DP( D_CHAT_LIT("aValue == %d" ), aNewValue);
  836     
  837 
  838     if ( aId == KProEngActiveRingingVolume  )  // Ringing volume has changed
  839         {
  840         iRingingVolume = aNewValue;
  841         }
  842     else if ( aId == KProEngActiveRingingType )  // Ringing type has changed
  843         {
  844         iRingingType = aNewValue;
  845         }
  846 
  847     if ( aId == KVibraCtrlProfileVibraEnabled )  // Vibra setting has changed
  848         {
  849         iVibra = aNewValue;
  850         }
  851         
  852     CHAT_DP_FUNC_DONE("HandleNotifyL");
  853    }
  854 
  855 // ---------------------------------------------------------
  856 // CIMAlertManager::MatoPrepareComplete
  857 // (other items were commented in a header).
  858 // ---------------------------------------------------------
  859 //
Top
  860 void CIMAlertManager::MatoPrepareComplete( TInt aError )
  861     {
  862     CHAT_DP( D_CHAT_LIT(
  863         "MMdaAudioToneObserver::MatoPrepareComplete() callback, error == %d" ), 
  864         aError);
  865     
  866     if ( !aError && iTonePlayerStatus == EAudioPlayerInitializing )
  867         {
  868         iTonePlayerStatus = EAudioPlayerInitialized;
  869         // TODO: confirm with UI spec/Nikhil if only this ringing type is
  870         // supported. If not in writing, get an entry into the UI spec done.
  871         // TODO: where is this requirement specified?
  872         
  873         // currently IM messages supports only this ringing type
  874         // ringing once
  875         DoSetRingingType( EProfileRingingTypeRingingOnce );
  876         CHAT_DP( D_CHAT_LIT("CMdaAudioToneUtility::SetVolume( %d )" ), 
  877                 ConvertVolume( iRingingVolume ));
  878         iTonePlayer->SetVolume( ConvertVolume( iRingingVolume ) );
  879 
  880 
  881         CHAT_DP( D_CHAT_LIT("CMdaAudioToneUtility::SetPriority( %d, %d )" ),
  882                 KAudioPriorityRecvMsg, 
  883                 TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  884                 
  885         iTonePlayer->SetPriority( KAudioPriorityRecvMsg,
  886             TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) );
  887             
  888         CHAT_DP_TXT("CMdaAudioToneUtility::Play()" );
  889         iTonePlayer->Play();
  890         iTonePlayerStatus = EAudioPlayerPlaying;
  891         iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, 
  892                               ECoreAppUIsTonePlaying );
  893         }
  894     else
  895         {
  896         Stop();
  897         iTonePlayerStatus = EAudioPlayerReady;
  898         
  899         if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) )
  900             {
  901             return;
  902             }
  903         else
  904             {
  905             HandleError( aError );
  906             iIsPlayingDefaultIMSound = EFalse;
  907             }
  908         }
  909     }
  910 
  911 // ---------------------------------------------------------
  912 // CIMAlertManager::MatoPlayComplete
  913 // (other items were commented in a header).
  914 // ---------------------------------------------------------
  915 //
Top
  916 void CIMAlertManager::MatoPlayComplete( TInt aError )
  917     {
  918     CHAT_DP( D_CHAT_LIT(
  919         "MMdaAudioToneObserver::MatoPlayComplete() callback, error == %d" ), 
  920         aError);
  921     iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, ECoreAppUIsTonePlayingUninitialized );
  922     iTonePlayerStatus = EAudioPlayerReady;
  923     
  924     if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) )
  925         {
  926         return ;
  927         }
  928     else
  929         {
  930         HandleError( aError );
  931         iIsPlayingDefaultIMSound = EFalse;
  932         }
  933     }
  934         
  935 //  End of File  
***TER 100% (23/23) of SOURCE FILE cimalertmanager.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD2.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD2.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - cimalertnotifierimpl.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #2/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
-Instrumentation mode: function
-TER: 71 % ( 5/ 7)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cimalertnotifierimpl.cpp
  4 *  Part of     : conversations/instantmessagesalert
  5 *  Description : Publish and subscribe implementation
  6 *  Version     : %version: 2 %
  7 *
  8 *  Copyright © 2009 Nokia. All rights reserved..
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia. All rights are reserved. Copying, including 
  12 *  reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include    "cimalertnotifierimpl.h"
  23 #include    "mimalertnotifierkeyobserver.h"
  24 #include    "cimalertpropertyobserver.h"
  25 #include    <e32property.h>
  26 
  27 // ============================ MEMBER FUNCTIONS ===============================
  28 
  29 // -----------------------------------------------------------------------------
  30 // CIMAlertNotifierImpl::CIMAlertNotifierImpl
  31 // C++ default constructor can NOT contain any code, that
  32 // might leave.
  33 // -----------------------------------------------------------------------------
  34 //
Top
34 34   35 CIMAlertNotifierImpl::CIMAlertNotifierImpl( MIMAlertNotifierKeyObserver* aObserver )
  36 :iObserver( aObserver )
  37     {
  38     }
  39 
  40 // -----------------------------------------------------------------------------
  41 // CIMAlertNotifierImpl::NewL
  42 // Two-phased constructor.
  43 // -----------------------------------------------------------------------------
  44 //
Top
34   45 CIMAlertNotifierImpl* CIMAlertNotifierImpl::NewL( MIMAlertNotifierKeyObserver* aObserver )
  46     {
  47     CIMAlertNotifierImpl* self = new( ELeave ) CIMAlertNotifierImpl( aObserver );
  48     return self;
  49     }
  50 
  51     
  52 // Destructor
Top
34 34   53 CIMAlertNotifierImpl::~CIMAlertNotifierImpl()
  54     {
  55     delete iPropWatcher;
  56     delete iCallState;
  57     }
  58 
  59 // -----------------------------------------------------------------------------
  60 // CIMAlertNotifierImpl::SetInt
  61 // (other items were commented in a header).
  62 // -----------------------------------------------------------------------------
  63 //
Top
  64 TInt CIMAlertNotifierImpl::SetInt( TNotifyKey aKey, TInt aValue )
  65    {
  66    TInt err = KErrNone;
  67    switch ( aKey ) 
  68        {
  69        case EMSGToneQuitKey:   
  70            err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, aValue );
  71            break;
  72        case ECallState:
  73            {
  74            err = RProperty::Set( KPSUidCtsyCallInformation, KCTsyCallState, aValue );     
  75            break;
  76            }
  77        default:
  78            {
  79            return KErrNotFound;
  80            }
  81        }   
  82    return err;
  83    }    
  84 
  85 // -----------------------------------------------------------------------------
  86 // CIMAlertNotifierImpl::GetInt
  87 // (other items were commented in a header).
  88 // -----------------------------------------------------------------------------
  89 //
Top
- 90 TInt CIMAlertNotifierImpl::GetInt( TNotifyKey aKey, TInt& aValue )
  91     {
  92     TInt err = KErrNone;
  93     switch ( aKey ) 
  94         {
  95         case EMSGToneQuitKey:
  96             {
  97             err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, aValue );      
  98             break;
  99             }
  100         case ECallState:
  101             {
  102             err = RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallState, aValue );     
  103             break;
  104             }
  105         default:
  106             {
  107             err = KErrNotFound;   
  108             break;
  109             }
  110         }
  111     return err;
  112     }
  113    
  114 // -----------------------------------------------------------------------------
  115 // CIMAlertNotifierImpl::ListenKeyChanges
  116 // (other items were commented in a header).
  117 // -----------------------------------------------------------------------------
  118 //
Top
68   119 TInt CIMAlertNotifierImpl::ListenKeyChanges( TNotifyKey aKey )
  120    {
  121    TInt err = KErrNone;
  122    switch ( aKey ) 
  123       {
  124       case EMSGToneQuitKey:
  125          {
  126          delete iPropWatcher;
  127          iPropWatcher = NULL;
  128          TRAP( err, iPropWatcher = CIMAlertPropertyObserver::NewL( *this ) );
  129          if( !err )
  130              {
  131              TRAP( err, iPropWatcher->ObservePropertyChangeL( 
  132                          KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit ) );
  133              }
  134          break;
  135          }
  136       case ECallState:
  137           {
  138           delete iCallState;
  139           iCallState = NULL;
  140           TRAP( err, iCallState = CIMAlertPropertyObserver::NewL( *this ) );
  141           if( !err )
  142               {
  143               TRAP( err, iCallState->ObservePropertyChangeL( 
  144                       KPSUidCtsyCallInformation, KCTsyCallState ) );
  145               }
  146           break;
  147           }
  148       default:
  149          {
  150          err = KErrNotFound;
  151          break;
  152          }
  153       }
  154    return err;
  155    }
  156 
  157 // -----------------------------------------------------------------------------
  158 // CIMAlertNotifierImpl::HandlePropertyNotificationEventL
  159 // (other items were commented in a header).
  160 // -----------------------------------------------------------------------------
  161 //
Top
- 162 void CIMAlertNotifierImpl::HandlePropertyNotificationEventL( TUid  aCategory , TUint aKey )
  163     {
  164     TInt value( 0 );
  165     TUpdatedKey key;
  166     // KPSUidCoreApplicationUIs status changed
  167     if ( aCategory == KPSUidCoreApplicationUIs && aKey == KCoreAppUIsMessageToneQuit )
  168         {
  169         User::LeaveIfError( 
  170                 RProperty::Get( KPSUidCoreApplicationUIs, aKey, value ) );
  171         key.iUid = KPSUidCoreApplicationUIs;
  172         key.iKey = aKey;
  173         key.iValue = value;
  174         }
  175     // call status changed
  176     if ( aCategory == KPSUidCtsyCallInformation && aKey == KCTsyCallState )
  177         {
  178         User::LeaveIfError( 
  179                 RProperty::Get( KPSUidCtsyCallInformation, aKey, value ) );
  180         key.iUid = KPSUidCtsyCallInformation;
  181         key.iKey = aKey;
  182         key.iValue = value;
  183         }
  184     iObserver->HandleKeyChange( key );
  185     }
  186 
  187 //  End of File  
***TER 71% (5/7) of SOURCE FILE cimalertnotifierimpl.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD3.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD3.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - cimalertpropertyobserver.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #3/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
-Instrumentation mode: function
-TER: 56 % ( 5/ 9)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1  /*
  2 * ==============================================================================
  3 *  Name        : cimalertpropertyobserver.cpp
  4 *  Part of     : conversations/instantmessagesalert
  5 *  Description : Publish & Subscribe property change observer implementation
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright (c) 2009 Nokia. All rights reserved..
  9 *  This material, including documentation and any related
  10 *  computer programs, is protected by copyright controlled by
  11 *  Nokia Corporation. All rights are reserved. Copying,
  12 *  including reproducing, storing, adapting or translating, any
  13 *  or all of this material requires the prior written consent of
  14 *  Nokia Corporation. This material also contains confidential
  15 *  information which may not be disclosed to others without the
  16 *  prior written consent of Nokia Corporation.
  17 * ==============================================================================
  18 */
  19 
  20 // INCLUDE FILES
  21 #include "cimalertpropertyobserver.h"
  22 #include "mimalertpropertynotificationobserver.h"
  23 
  24 #include <bautils.h>
  25 #include <barsc.h>
  26 #include <e32property.h>
  27 
  28 
  29 // ============================ MEMBER FUNCTIONS ===============================
  30 
  31 // -----------------------------------------------------------------------------
  32 // CIMAlertPropertyObserver::CIMAlertPropertyObserver
  33 // C++ default constructor can NOT contain any code, that
  34 // might leave.
  35 // -----------------------------------------------------------------------------
  36 //
Top
68 68   37 CIMAlertPropertyObserver::CIMAlertPropertyObserver( 
  38                             MCAPropertyNotificationObserver& aObserver )
  39     : CActive( CActive::EPriorityLow ),
  40       iObserver( aObserver )
  41     {
  42     CActiveScheduler::Add( this );
  43     }
  44 
  45 
  46 // -----------------------------------------------------------------------------
  47 // CIMAlertPropertyObserver::NewL
  48 // Two-phased constructor.
  49 // -----------------------------------------------------------------------------
  50 //
Top
68   51 CIMAlertPropertyObserver* CIMAlertPropertyObserver::NewL( 
  52     MCAPropertyNotificationObserver& aObserver )
  53     {
  54     CIMAlertPropertyObserver* self = new( ELeave ) CIMAlertPropertyObserver( aObserver );
  55     return self;
  56     }
  57 
  58 
  59 // Destructor
Top
68 68   60 CIMAlertPropertyObserver::~CIMAlertPropertyObserver()
  61     {
  62     if( IsActive() )
  63         {
  64         Cancel();
  65         }
  66     }
  67 
  68 
  69 // -----------------------------------------------------------------------------
  70 // CIMAlertPropertyObserver::ObservePropertyChangeL
  71 // (other items were commented in a header).
  72 // -----------------------------------------------------------------------------
  73 //
Top
68 68   74 void CIMAlertPropertyObserver::ObservePropertyChangeL( TUid aCategory, TUint aKey )
  75     {
  76    if( IsActive() )
  77       {
  78       return;
  79       }
  80     User::LeaveIfError( iProperty.Attach( aCategory, aKey ) );
  81    iKey = aKey;
  82    iCategory = aCategory;
  83     iProperty.Subscribe( iStatus );
  84     SetActive();
  85     }
  86 
  87 // -----------------------------------------------------------------------------
  88 // CIMAlertPropertyObserver::CancelObserve
  89 // (other items were commented in a header).
  90 // -----------------------------------------------------------------------------
  91 //
Top
- 92 void CIMAlertPropertyObserver::CancelObserve()
  93     {
  94     if( IsActive() )
  95         {
  96         Cancel();
  97         }
  98    }
  99 
  100 // -----------------------------------------------------------------------------
  101 // CIMAlertPropertyObserver::RunL
  102 // (other items were commented in a header).
  103 // -----------------------------------------------------------------------------
  104 //
Top
- 105 void CIMAlertPropertyObserver::RunL()
  106     {
  107    iProperty.Subscribe( iStatus );
  108    SetActive();
  109     iObserver.HandlePropertyNotificationEventL( iCategory, iKey );      
  110     }
  111 
  112 // -----------------------------------------------------------------------------
  113 // CIMAlertPropertyObserver::DoCancel
  114 // (other items were commented in a header).
  115 // -----------------------------------------------------------------------------
  116 //
Top
68 68   117 void CIMAlertPropertyObserver::DoCancel()
  118     {
  119     iProperty.Cancel();
  120     }
  121 
  122 // -----------------------------------------------------------------------------
  123 // CIMAlertPropertyObserver::Category
  124 // (other items were commented in a header).
  125 // -----------------------------------------------------------------------------
  126 //
Top
- 127 TUid CIMAlertPropertyObserver::Category()
  128    {
  129    return iCategory;
  130    }
  131 
  132 // -----------------------------------------------------------------------------
  133 // CIMAlertPropertyObserver::Key
  134 // (other items were commented in a header).
  135 // -----------------------------------------------------------------------------
  136 //
Top
- 137 TUint CIMAlertPropertyObserver::Key()
  138    {
  139    return iKey;
  140    }
  141 
  142 //  End of File
***TER 56% (5/9) of SOURCE FILE cimalertpropertyobserver.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD4.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD4.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - imalertnotifierfactory.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #4/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
-Instrumentation mode: function
-TER: 100 % ( 1/ 1)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : imalertnotifierfactory.cpp
  4 *  Part of     : conversations/instantmessagesalert
  5 *  Description : Publish and Subscribe factory method implementation
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright © 2009 Nokia. All rights reserved..
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia. All rights are reserved. Copying, including 
  12 *  reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include    "imalertnotifierfactory.h"
  23 #include    "mimalertnotifierinterface.h"
  24 #include    "cimalertnotifierimpl.h"
  25 
  26 
  27 // ============================ MEMBER FUNCTIONS ===============================
  28 
  29 // ---------------------------------------------------------
  30 // IMAlertNotifierFactory::CreateNotifierL
  31 // (other items were commented in a header).
  32 // ---------------------------------------------------------
  33 //
Top
34   34 EXPORT_C MIMAlertNotifierInterface* IMAlertNotifierFactory::CreateNotifierL( MIMAlertNotifierKeyObserver* aObserver )
  35    {
  36    return CIMAlertNotifierImpl::NewL( aObserver );
  37    }
  38    
  39 //  End of File
  40 
***TER 100% (1/1) of SOURCE FILE imalertnotifierfactory.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD5.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD5.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - testinstantmsgalert.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #5/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
-Instrumentation mode: function
-TER: 100 % ( 6/ 6)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 
  14 * Description: This file contains testclass implementation.
  15 *
  16 */
  17 
  18 // INCLUDE FILES
  19 #include <Stiftestinterface.h>
  20 #include "testinstantmsgalert.h"
  21 #include <SettingServerClient.h>
  22 
  23 // EXTERNAL DATA STRUCTURES
  24 //extern  ?external_data;
  25 
  26 // EXTERNAL FUNCTION PROTOTYPES  
  27 //extern ?external_function( ?arg_type,?arg_type );
  28 
  29 // CONSTANTS
  30 //const ?type ?constant_var = ?constant;
  31 
  32 // MACROS
  33 //#define ?macro ?macro_def
  34 
  35 // LOCAL CONSTANTS AND MACROS
  36 //const ?type ?constant_var = ?constant;
  37 //#define ?macro_name ?macro_def
  38 
  39 // MODULE DATA STRUCTURES
  40 //enum ?declaration
  41 //typedef ?declaration
  42 
  43 // LOCAL FUNCTION PROTOTYPES
  44 //?type ?function_name( ?arg_type, ?arg_type );
  45 
  46 // FORWARD DECLARATIONS
  47 //class ?FORWARD_CLASSNAME;
  48 
  49 // ============================= LOCAL FUNCTIONS ===============================
  50 
  51 // -----------------------------------------------------------------------------
  52 // ?function_name ?description.
  53 // ?description
  54 // Returns: ?value_1: ?description
  55 //          ?value_n: ?description_line1
  56 //                    ?description_line2
  57 // -----------------------------------------------------------------------------
  58 //
  59 /*
  60 ?type ?function_name(
  61     ?arg_type arg,  // ?description
  62     ?arg_type arg)  // ?description
  63     {
  64 
  65     ?code  // ?comment
  66 
  67     // ?comment
  68     ?code
  69     }
  70 */
  71 
  72 // ============================ MEMBER FUNCTIONS ===============================
  73 
  74 // -----------------------------------------------------------------------------
  75 // Ctestinstantmsgalert::Ctestinstantmsgalert
  76 // C++ default constructor can NOT contain any code, that
  77 // might leave.
  78 // -----------------------------------------------------------------------------
  79 //
Top
17 17   80 Ctestinstantmsgalert::Ctestinstantmsgalert( 
  81     CTestModuleIf& aTestModuleIf ):
  82         CScriptBase( aTestModuleIf )
  83     {
  84     }
  85 
  86 // -----------------------------------------------------------------------------
  87 // Ctestinstantmsgalert::ConstructL
  88 // Symbian 2nd phase constructor can leave.
  89 // -----------------------------------------------------------------------------
  90 //
Top
17 17   91 void Ctestinstantmsgalert::ConstructL()
  92     {
  93     //Read logger settings to check whether test case name is to be
  94     //appended to log file name.
  95     RSettingServer settingServer;
  96     TInt ret = settingServer.Connect();
  97     if(ret != KErrNone)
  98         {
  99         User::Leave(ret);
  100         }
  101     // Struct to StifLogger settigs.
  102     TLoggerSettings loggerSettings; 
  103     // Parse StifLogger defaults from STIF initialization file.
  104     ret = settingServer.GetLoggerSettings(loggerSettings);
  105     if(ret != KErrNone)
  106         {
  107         User::Leave(ret);
  108         } 
  109     // Close Setting server session
  110     settingServer.Close();
  111 
  112     TFileName logFileName;
  113     
  114     if(loggerSettings.iAddTestCaseTitle)
  115         {
  116         TName title;
  117         TestModuleIf().GetTestCaseTitleL(title);
  118         logFileName.Format(KtestinstantmsgalertLogFileWithTitle, &title);
  119         }
  120     else
  121         {
  122         logFileName.Copy(KtestinstantmsgalertLogFile);
  123         }
  124     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); 
  125     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); 
  126     iLog = CStifLogger::NewL( KtestinstantmsgalertLogPath, 
  127                           logFileName,
  128                           CStifLogger::ETxt,
  129                           CStifLogger::EFile,
  130                           EFalse );
  131     
  132     SendTestClassVersion();
  133     }
  134 
  135 // -----------------------------------------------------------------------------
  136 // Ctestinstantmsgalert::NewL
  137 // Two-phased constructor.
  138 // -----------------------------------------------------------------------------
  139 //
Top
17   140 Ctestinstantmsgalert* Ctestinstantmsgalert::NewL( 
  141     CTestModuleIf& aTestModuleIf )
  142     {
  143     Ctestinstantmsgalert* self = new (ELeave) Ctestinstantmsgalert( aTestModuleIf );
  144 
  145     CleanupStack::PushL( self );
  146     self->ConstructL();
  147     CleanupStack::Pop();
  148 
  149     return self;
  150 
  151     }
  152 
  153 // Destructor
Top
17 17   154 Ctestinstantmsgalert::~Ctestinstantmsgalert()
  155     { 
  156 
  157     // Delete resources allocated from test methods
  158     Delete();
  159 
  160     // Delete logger
  161     delete iLog; 
  162 
  163     }
  164 
  165 //-----------------------------------------------------------------------------
  166 // Ctestinstantmsgalert::SendTestClassVersion
  167 // Method used to send version of test class
  168 //-----------------------------------------------------------------------------
  169 //
Top
17 17   170 void Ctestinstantmsgalert::SendTestClassVersion()
  171    {
  172    TVersion moduleVersion;
  173    moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
  174    moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
  175    moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
  176    
  177    TFileName moduleName;
  178    moduleName = _L("testinstantmsgalert.dll");
  179 
  180    TBool newVersionOfMethod = ETrue;
  181    TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
  182    }
  183 
  184 // ========================== OTHER EXPORTED FUNCTIONS =========================
  185 
  186 // -----------------------------------------------------------------------------
  187 // LibEntryL is a polymorphic Dll entry point.
  188 // Returns: CScriptBase: New CScriptBase derived object
  189 // -----------------------------------------------------------------------------
  190 //
Top
17   191 EXPORT_C CScriptBase* LibEntryL( 
  192     CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
  193     {
  194 
  195     return ( CScriptBase* ) Ctestinstantmsgalert::NewL( aTestModuleIf );
  196 
  197     }
  198 
  199 
  200 //  End of File
***TER 100% (6/6) of SOURCE FILE testinstantmsgalert.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD6.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD6.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,478 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - testinstantmsgalertblocks.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #6/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
-Instrumentation mode: function
-TER: 95 % ( 19/ 20)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 
  14 * Description: This file contains testclass implementation.
  15 *
  16 */
  17 
  18 // [INCLUDE FILES] - do not remove
  19 #include <e32svr.h>
  20 #include <StifParser.h>
  21 #include <Stiftestinterface.h>
  22 #include "testinstantmsgalert.h"
  23 
  24 
  25 
  26 // EXTERNAL DATA STRUCTURES
  27 //extern  ?external_data;
  28 
  29 // EXTERNAL FUNCTION PROTOTYPES  
  30 //extern ?external_function( ?arg_type,?arg_type );
  31 
  32 // CONSTANTS
  33 //const ?type ?constant_var = ?constant;
  34 
  35 // MACROS
  36 //#define ?macro ?macro_def
  37 
  38 // LOCAL CONSTANTS AND MACROS
  39 //const ?type ?constant_var = ?constant;
  40 //#define ?macro_name ?macro_def
  41 
  42 // MODULE DATA STRUCTURES
  43 //enum ?declaration
  44 //typedef ?declaration
  45 
  46 // LOCAL FUNCTION PROTOTYPES
  47 //?type ?function_name( ?arg_type, ?arg_type );
  48 
  49 // FORWARD DECLARATIONS
  50 //class ?FORWARD_CLASSNAME;
  51 
  52 // ============================= LOCAL FUNCTIONS ===============================
  53 
  54 // -----------------------------------------------------------------------------
  55 // ?function_name ?description.
  56 // ?description
  57 // Returns: ?value_1: ?description
  58 //          ?value_n: ?description_line1
  59 //                    ?description_line2
  60 // -----------------------------------------------------------------------------
  61 //
  62 /*
  63 ?type ?function_name(
  64     ?arg_type arg,  // ?description
  65     ?arg_type arg)  // ?description
  66     {
  67 
  68     ?code  // ?comment
  69 
  70     // ?comment
  71     ?code
  72     }
  73 */
  74 
  75 // ============================ MEMBER FUNCTIONS ===============================
  76 
  77 // -----------------------------------------------------------------------------
  78 // Ctestinstantmsgalert::Delete
  79 // Delete here all resources allocated and opened from test methods. 
  80 // Called from destructor. 
  81 // -----------------------------------------------------------------------------
  82 //
Top
34 34   83 void Ctestinstantmsgalert::Delete() 
  84     {
  85 
  86     }
  87 
  88 // -----------------------------------------------------------------------------
  89 // Ctestinstantmsgalert::RunMethodL
  90 // Run specified method. Contains also table of test mothods and their names.
  91 // -----------------------------------------------------------------------------
  92 //
Top
34   93 TInt Ctestinstantmsgalert::RunMethodL( 
  94     CStifItemParser& aItem ) 
  95     {
  96 
  97     static TStifFunctionInfo const KFunctions[] =
  98         {  
  99         // Copy this line for every implemented function.
  100         // First string is the function name used in TestScripter script file.
  101         // Second is the actual implementation member function. 
  102         ENTRY( "Example", Ctestinstantmsgalert::ExampleL ),
  103         ENTRY( "CIMAlertManager_NewL", Ctestinstantmsgalert::CIMAlertManager_NewL ),
  104         ENTRY( "CIMAlertManager_PlayL", Ctestinstantmsgalert::CIMAlertManager_PlayL ),
  105         ENTRY( "CIMAlertManager_Stop", Ctestinstantmsgalert::CIMAlertManager_Stop ),
  106         ENTRY( "CIMAlertManager_SetVolume", Ctestinstantmsgalert::CIMAlertManager_SetVolume ),
  107         ENTRY( "CIMAlertManager_SetRingingType", Ctestinstantmsgalert::CIMAlertManager_SetRingingType ),
  108         ENTRY( "CIMAlertManager_SetVibra", Ctestinstantmsgalert::CIMAlertManager_SetVibra ),
  109         ENTRY( "CIMAlertManager_DoSetRingingType", Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType ),
  110         ENTRY( "CIMAlertManager_ConvertVolume", Ctestinstantmsgalert::CIMAlertManager_ConvertVolume ),
  111         ENTRY( "CIMAlertManager_MapcInitComplete", Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete ), 
  112         ENTRY( "CIMAlertManager_MapcPlayComplete", Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete ), 
  113         ENTRY( "CIMAlertManager_HandleKeyChange", Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange ), 
  114         ENTRY( "CIMAlertManager_HandleNotifyInt", Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt ), 
  115         ENTRY( "CIMAlertManager_MatoPrepareComplete", Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete ), 
  116         ENTRY( "CIMAlertManager_MatoPlayComplete", Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete ), 
  117         ENTRY( "CIMAlertManager_AddObserverL", Ctestinstantmsgalert::CIMAlertManager_AddObserverL ), 
  118         ENTRY( "CIMAlertManager_RemoveObserver", Ctestinstantmsgalert::CIMAlertManager_RemoveObserver ), 
  119         ENTRY( "CIMAlertManager_HandleError", Ctestinstantmsgalert::CIMAlertManager_HandleError ), 
  120 
  121         //ADD NEW ENTRY HERE
  122         // [test cases entries] - Do not remove
  123         };
  124 
  125     const TInt count = sizeof( KFunctions ) / 
  126                         sizeof( TStifFunctionInfo );
  127 
  128     return RunInternalL( KFunctions, count, aItem );
  129 
  130     }
  131 
  132 // -----------------------------------------------------------------------------
  133 // Ctestinstantmsgalert::ExampleL
  134 // Example test method function.
  135 // (other items were commented in a header).
  136 // -----------------------------------------------------------------------------
  137 //
Top
- 138 TInt Ctestinstantmsgalert::ExampleL( CStifItemParser& aItem )
  139     {
  140 
  141     // Print to UI
  142     _LIT( Ktestinstantmsgalert, "testinstantmsgalert" );
  143     _LIT( KExample, "In Example" );
  144     TestModuleIf().Printf( 0, Ktestinstantmsgalert, KExample );
  145     // Print to log file
  146     iLog->Log( KExample );
  147 
  148     TInt i = 0;
  149     TPtrC string;
  150     _LIT( KParam, "Param[%i]: %S" );
  151     while ( aItem.GetNextString ( string ) == KErrNone )
  152         {
  153         TestModuleIf().Printf( i, Ktestinstantmsgalert, 
  154                                 KParam, i, &string );
  155         i++;
  156         }
  157 
  158     return KErrNone;
  159 
  160     }
  161 
  162 // -----------------------------------------------------------------------------
  163 // Ctestinstantmsgalert::CIMAlertManager_NewL
  164 // Example test method function.
  165 // (other items were commented in a header).
  166 // -----------------------------------------------------------------------------
  167 //
Top
  168 TInt Ctestinstantmsgalert::CIMAlertManager_NewL( CStifItemParser& aItem )
  169     {
  170     
  171     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); 
  172     TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles );  
  173     CIMAlertManager* object  = CIMAlertManager::NewL();   
  174     
  175     if(object)
  176         {
  177         delete object;
  178         return KErrNone;
  179         }
  180     else
  181         return KErrGeneral;
  182 
  183     }
  184 // -----------------------------------------------------------------------------
  185 // Ctestinstantmsgalert::CIMAlertManager_PlayL
  186 // Example test method function.
  187 // (other items were commented in a header).
  188 // -----------------------------------------------------------------------------
  189 //
Top
  190 TInt Ctestinstantmsgalert::CIMAlertManager_PlayL( CStifItemParser& aItem )
  191     {
  192     CIMAlertManager* object  = CIMAlertManager::NewL();   
  193     object->PlayL(5);
  194     delete object;
  195     return KErrNone;
  196 
  197     }
  198 // -----------------------------------------------------------------------------
  199 // Ctestinstantmsgalert::CIMAlertManager_SetVolume
  200 // Example test method function.
  201 // (other items were commented in a header).
  202 // -----------------------------------------------------------------------------
  203 //
Top
  204 TInt Ctestinstantmsgalert::CIMAlertManager_SetVolume( CStifItemParser& aItem )
  205     {
  206 
  207     CIMAlertManager* object  = CIMAlertManager::NewL();   
  208     object->SetVolume(5);
  209     delete object;
  210     return KErrNone;
  211 
  212 
  213     }
  214 // -----------------------------------------------------------------------------
  215 // Ctestinstantmsgalert::CIMAlertManager_SetRingingType
  216 // Example test method function.
  217 // (other items were commented in a header).
  218 // -----------------------------------------------------------------------------
  219 //
Top
  220 TInt Ctestinstantmsgalert::CIMAlertManager_SetRingingType( CStifItemParser& aItem )
  221     {
  222     
  223     CIMAlertManager* object  = CIMAlertManager::NewL();   
  224     object->SetRingingType(EProfileRingingTypeRingingOnce);
  225     delete object;
  226     return KErrNone;
  227 
  228     }
  229 // -----------------------------------------------------------------------------
  230 // Ctestinstantmsgalert::CIMAlertManager_SetVibra
  231 // Example test method function.
  232 // (other items were commented in a header).
  233 // -----------------------------------------------------------------------------
  234 //
Top
  235 TInt Ctestinstantmsgalert::CIMAlertManager_SetVibra( CStifItemParser& aItem )
  236     {
  237     
  238     CIMAlertManager* object  = CIMAlertManager::NewL();   
  239     object->SetVibra(ETrue);
  240     delete object;
  241     return KErrNone;
  242 
  243     }
  244 // -----------------------------------------------------------------------------
  245 // Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType
  246 // Example test method function.
  247 // (other items were commented in a header).
  248 // -----------------------------------------------------------------------------
  249 //
Top
  250 TInt Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType( CStifItemParser& aItem )
  251     {
  252     
  253     CIMAlertManager* object  = CIMAlertManager::NewL();   
  254     object->DoSetRingingType(EProfileRingingTypeRingingOnce);
  255     delete object;
  256     return KErrNone;
  257 
  258     }
  259 // -----------------------------------------------------------------------------
  260 // Ctestinstantmsgalert::CIMAlertManager_ConvertVolume
  261 // Example test method function.
  262 // (other items were commented in a header).
  263 // -----------------------------------------------------------------------------
  264 //
Top
  265 TInt Ctestinstantmsgalert::CIMAlertManager_ConvertVolume( CStifItemParser& aItem )
  266     {
  267     
  268     CIMAlertManager* object  = CIMAlertManager::NewL();   
  269     object->ConvertVolume(5);
  270     delete object;
  271     return KErrNone;
  272 
  273     }
  274 
  275 // -----------------------------------------------------------------------------
  276 // Ctestinstantmsgalert::CIMAlertManager_Stop
  277 // Example test method function.
  278 // (other items were commented in a header).
  279 // -----------------------------------------------------------------------------
  280 //
Top
  281 TInt Ctestinstantmsgalert::CIMAlertManager_Stop( CStifItemParser& aItem )
  282     {
  283     CIMAlertManager* object  = CIMAlertManager::NewL();   
  284     object->Stop();
  285     delete object;
  286     return KErrNone;
  287 
  288     }
  289 
  290 // -----------------------------------------------------------------------------
  291 // Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete
  292 // Example test method function.
  293 // (other items were commented in a header).
  294 // -----------------------------------------------------------------------------
  295 //
Top
  296 TInt Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete( CStifItemParser& aItem )
  297     {
  298     CIMAlertManager* object  = CIMAlertManager::NewL();   
  299     object->MapcInitComplete(KErrNone,5);
  300     delete object;
  301     return KErrNone;
  302 
  303     }
  304 
  305 // -----------------------------------------------------------------------------
  306 // Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete
  307 // Example test method function.
  308 // (other items were commented in a header).
  309 // -----------------------------------------------------------------------------
  310 //
Top
  311 TInt Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete( CStifItemParser& aItem )
  312     {
  313     CIMAlertManager* object  = CIMAlertManager::NewL();   
  314     object->MapcPlayComplete(KErrNone);
  315     delete object;
  316     return KErrNone;
  317 
  318     }
  319 
  320 // -----------------------------------------------------------------------------
  321 // Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange
  322 // Example test method function.
  323 // (other items were commented in a header).
  324 // -----------------------------------------------------------------------------
  325 //
Top
  326 TInt Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange( CStifItemParser& aItem )
  327     {
  328     CIMAlertManager* object  = CIMAlertManager::NewL();   
  329     TUpdatedKey temp;
  330     temp.iValue =  ECoreAppUIsStopTonePlaying;
  331     object->HandleKeyChange(temp);
  332     delete object;
  333     return KErrNone;
  334 
  335     }
  336 // -----------------------------------------------------------------------------
  337 // Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt
  338 // Example test method function.
  339 // (other items were commented in a header).
  340 // -----------------------------------------------------------------------------
  341 //
Top
  342 TInt Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt( CStifItemParser& aItem )
  343     {
  344     CIMAlertManager* object  = CIMAlertManager::NewL();   
  345     object->HandleNotifyInt(KProEngActiveRingingVolume,5);
  346     delete object;
  347     return KErrNone;
  348 
  349     }
  350 // -----------------------------------------------------------------------------
  351 // Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete
  352 // Example test method function.
  353 // (other items were commented in a header).
  354 // -----------------------------------------------------------------------------
  355 //
Top
  356 TInt Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete( CStifItemParser& aItem )
  357     {
  358     CIMAlertManager* object  = CIMAlertManager::NewL();   
  359     object->MatoPrepareComplete(KErrNone);
  360     delete object;
  361     return KErrNone;
  362 
  363     }
  364 // -----------------------------------------------------------------------------
  365 // Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete
  366 // Example test method function.
  367 // (other items were commented in a header).
  368 // -----------------------------------------------------------------------------
  369 //
Top
  370 TInt Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete( CStifItemParser& aItem )
  371     {
  372     CIMAlertManager* object  = CIMAlertManager::NewL();   
  373     object->MatoPlayComplete(KErrNone);
  374     delete object;
  375     return KErrNone;
  376 
  377     }
  378 
  379 // -----------------------------------------------------------------------------
  380 // Ctestinstantmsgalert::CIMAlertManager_AddObserverL
  381 // Example test method function.
  382 // (other items were commented in a header).
  383 // -----------------------------------------------------------------------------
  384 //
Top
  385 TInt Ctestinstantmsgalert::CIMAlertManager_AddObserverL( CStifItemParser& aItem )
  386     {
  387     CIMAlertManager* object  = CIMAlertManager::NewL(); 
  388     MIMAlertManagerObserver* observer = NULL;
  389     object->AddObserverL(observer);
  390     delete object;
  391     return KErrNone;
  392 
  393     }
  394 
  395 // -----------------------------------------------------------------------------
  396 // Ctestinstantmsgalert::CIMAlertManager_RemoveObserver
  397 // Example test method function.
  398 // (other items were commented in a header).
  399 // -----------------------------------------------------------------------------
  400 //
Top
  401 TInt Ctestinstantmsgalert::CIMAlertManager_RemoveObserver( CStifItemParser& aItem )
  402     {
  403     CIMAlertManager* object  = CIMAlertManager::NewL();   
  404     MIMAlertManagerObserver* observer = NULL;
  405     object->RemoveObserver(observer);
  406     delete object;
  407     return KErrNone;
  408 
  409     }
  410 
  411 // -----------------------------------------------------------------------------
  412 // Ctestinstantmsgalert::CIMAlertManager_HandleError
  413 // Example test method function.
  414 // (other items were commented in a header).
  415 // -----------------------------------------------------------------------------
  416 //
Top
  417 TInt Ctestinstantmsgalert::CIMAlertManager_HandleError( CStifItemParser& aItem )
  418     {
  419     CIMAlertManager* object  = CIMAlertManager::NewL();   
  420     MIMAlertManagerObserver* observer = NULL;
  421     object->HandleError(KErrNone);
  422     delete object;
  423     return KErrNone;
  424 
  425     }
  426 
  427 // ========================== OTHER EXPORTED FUNCTIONS =========================
  428 // None
  429 
  430 //  [End of File] - Do not remove
***TER 95% (19/20) of SOURCE FILE testinstantmsgalertblocks.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD7.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD7.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - s_vimpstsettingsstore.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #7/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
-Instrumentation mode: function
-TER: 33 % ( 1/ 3)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 *
  14 * Description:  vimpst settings store definitions and repository transactions.
  15 *
  16 */
  17 
  18 
  19 //  INCLUDES
  20 #include <e32base.h>
  21 #include "s_vimpstsettingsstoreimp.h"
  22 
  23 /**
  24  *  vimpst settings API class
  25  *
  26  *  Main class of managing vimpst settings
  27  *
  28  *  @code example code of how to get/set a value to the setting item in cenrep 
  29  *  MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL();
  30  *  TInt value = 1;
  31  *  TInt err = obj->Set(serviceId, ETOUDlgOff, value );
  32  *  similarly for getting the value
  33  *  obj->Get(serviceId, ETOUDlgOff, value);
  34  *  @lib vimpstsettingsstore.lib
  35  *  @since S60 v5.0
  36  */
  37 
  38 // -----------------------------------------------------------------------------
  39 // CVIMPSTSettingsStoreFactory::NewL
  40 // Create an instance of the class CVIMPSTSettingsStoreImp 
  41 // -----------------------------------------------------------------------------
  42 //
Top
34   43 EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewL()
  44     {    
  45     MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::NewL();
  46 
  47     return self;
  48     }
  49 
  50 // -----------------------------------------------------------------------------
  51 // CVIMPSTEngineFactory::Destructor
  52 // Release the singelton
  53 // -----------------------------------------------------------------------------
  54 //
Top
- 55 CVIMPSTSettingsStore::~CVIMPSTSettingsStore()
  56     {
  57     CVIMPSTSettingsStoreImp::Release();
  58     }
  59 // -----------------------------------------------------------------------------
  60 // CVIMPSTSettingsStoreFactory::NewLC
  61 // Create an instance of the class CVIMPSTSettingsStoreImp 
  62 // -----------------------------------------------------------------------------
  63 //
  64 
Top
- 65 EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewLC()
  66     {    
  67     MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::InitialiseLibraryL();
  68     CleanupDeletePushL ( self );
  69     return  self;
  70     }
  71 
  72 
  73 // End of file
***TER 33% (1/3) of SOURCE FILE s_vimpstsettingsstore.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD8.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexD8.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ - - -CTC++ Coverage Report - Execution Profile - s_vimpstsettingsstoreimp.cpp - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #8/8

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
-Instrumentation mode: function
-TER: 57 % ( 4/ 7)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
  3 * All rights reserved.
  4 * This component and the accompanying materials are made available
  5 * under the terms of the License "Eclipse Public License v1.0"
  6 * which accompanies this distribution, and is available
  7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8 *
  9 * Initial Contributors:
  10 * Nokia Corporation - initial contribution.
  11 *
  12 * Contributors:
  13 *
  14 * Description:  vimpst settings store definitions and repository transactions.
  15 *
  16 */
  17 
  18 
  19 //  INCLUDES
  20 #include <e32std.h>
  21 #include "s_vimpstsettingsstoreimp.h"
  22 
  23 //dummy serviceId, assuming the service id not more than 256. for the first time
  24 //and it is assumed that this service id is for initializing the cenrep keys only.
  25 //not updated in the service table and hence will not get a TAB in phone book
  26 //const TInt KServiceIDOffset = 16;
  27 
  28 // opaque data length, see cvimpstuisapsettings.h SetOpaqueDesC16 method description.
  29 //const TInt KSapSettingsDataBufferLength = 5;
  30 // Collation level 1 to ignore case
  31 //const TInt KCollationLevel = 1;
  32 
  33 /**  Key to CIMPSSAPSettings opaque value */
  34 //_LIT( KIMToUAccepted, "KIMToUAccepted" );
  35 /**  User id separator in KIMToUAccepted list */
  36 //_LIT( KIMDot, "," );
  37 
  38 //================= MEMBER FUNCTIONS =======================
  39 // ---------------------------------------------------------
  40 // CVIMPSTSettingsStoreImp::NewL
  41 // 
  42 // ---------------------------------------------------------
Top
- 43 MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::InitialiseLibraryL( )
  44     {
  45     // no existing instance, create a new one
  46     MVIMPSTSettingsStore *settingsStoreImp = CVIMPSTSettingsStoreImp::NewL();
  47     return (MVIMPSTSettingsStore*)settingsStoreImp;
  48     }
  49 
Top
- 50 void CVIMPSTSettingsStoreImp::Release( )
  51     {
  52     
  53     }
  54 // ---------------------------------------------------------
  55 // CVIMPSTSettingsStoreImp::NewLC
  56 // 
  57 // ---------------------------------------------------------
Top
34   58 MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::NewL( )
  59     {
  60     CVIMPSTSettingsStoreImp* self = new (ELeave) CVIMPSTSettingsStoreImp( );
  61     CleanupStack::PushL( self );
  62     self->ConstructL( );
  63     CleanupStack::Pop( self );
  64     return self;
  65     }
  66 
  67 // ---------------------------------------------------------
  68 // CVIMPSTSettingsStoreImp::ConstructL
  69 // 
  70 // ---------------------------------------------------------
  71 
Top
34 34   72 void CVIMPSTSettingsStoreImp::ConstructL( )
  73     {
  74    
  75     }
  76 
  77 // ---------------------------------------------------------
  78 // CVIMPSTSettingsStoreImp::Destructor
  79 // 
  80 // ---------------------------------------------------------
Top
34 34   81 CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp()
  82     {
  83    
  84     }
  85          
Top
  86 TInt CVIMPSTSettingsStoreImp::GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer )
  87     {
  88     if(aSettingItemNAme == EServiceToneFileName)
  89         {
  90         _LIT(filename,"testtonefile");
  91         aBuffer.Copy(filename);
  92         }
  93     return KErrNone;  // return the value : error code  
  94     }
  95 // --------------------------------------------------------------------------------------------------
  96 // CVIMPSTSettingsStoreImp::SetL
  97 // 
  98 // ---------------------------------------------------------------------------------------------------
  99 
Top
- 100 TInt CVIMPSTSettingsStoreImp::SetL(TUint32 /*aServiceId*/, TSettingItemName /*aSettingItemName*/, const TDesC8& /*aBuffer*/  )
  101     {
  102     return KErrNone;  // return the value : error code  
  103     }
  104 // --------------------------------------------------------------------------------------------------
  105 // CVIMPSTSettingsStoreImp::GetL
  106 // 
  107 // ---------------------------------------------------------------------------------------------------
  108 
  109 
  110 
  111 //End of file
***TER 57% (4/7) of SOURCE FILE s_vimpstsettingsstoreimp.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexE.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexE.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -CTC++ Coverage Report - Source Files Not Found - - - - - - - - -The following source files were not found by ctc2html: -

- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexF.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexF.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - - -CTC++ Coverage Report - Directory Summary - - - - - - - - -CTC++ Coverage Report - -Directory Summary

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- - - - - - - - - - - - -
Symbol file(s): MON.sym (Wed Sep 30 15:10:17 2009)
Data file(s): MON.dat (Wed Sep 30 15:23:35 2009)
Listing produced at: Wed Sep 30 15:24:39 2009
Coverage view: As instrumented
 
Input listing: profile.txt
Html generated at: Wed Sep 30 15:25:00 2009
ctc2html v2.5 options: -i profile.txt 
Threshold percent: 100 %

-(Click on header to sort) - - - - - - - - - - - - - - - - - - -
TER%- Covered Not-covered All Directory
85%-34640\meco_domain\conversations\instantmessagesalert\src
96%-25126\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
50%-5510\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs

84%-641276OVERALL

- - - - - - - -
Number of directories: 3
Number of monitored source files: 8
Number of functions: 76
Number of source lines: 2090
Number of measurement points: 152
TER: 84% (function)

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexG.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexG.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - Index - - - - - - - - - - - - - diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexH.html --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/indexH.html Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - -CTC++ Coverage Report - Functions Summary - Index - - - - - - - - -Index
- - - - - - - - - - - - - - - -
 
\meco_domain\conversations\instantmessagesalert\src
   \meco_domain\conversations\instantmessagesalert\src\cimalertmanager.cpp
   \meco_domain\conversations\instantmessagesalert\src\cimalertnotifierimpl.cpp
   \meco_domain\conversations\instantmessagesalert\src\cimalertpropertyobserver.cpp
   \meco_domain\conversations\instantmessagesalert\src\imalertnotifierfactory.cpp
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalert.cpp
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\testinstantmsgalertblocks.cpp
 
\meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstore.cpp
   \meco_domain\conversations\instantmessagesalert\tsrc\testinstantmsgalert\src\stubs\s_vimpstsettingsstoreimp.cpp
diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/red.gif Binary file instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/red.gif has changed diff -r bef90b82da71 -r 796276a1bdcc instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/sorttable.js --- a/instantmessagesalert/tsrc/testinstantmsgalert/data/Function_Coverage/sorttable.js Mon Mar 15 12:39:32 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,493 +0,0 @@ -/* - SortTable - version 2 - 7th April 2007 - Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ - - Instructions: - Download this file - Add to your HTML - Add class="sortable" to any table you'd like to make sortable - Click on the headers to sort - - Thanks to many, many people for contributions and suggestions. - Licenced as X11: http://www.kryogenix.org/code/browser/licence.html - This basically means: do what you want with it. -*/ - - -var stIsIE = /*@cc_on!@*/false; - -sorttable = { - init: function() { - // quit if this function has already been called - if (arguments.callee.done) return; - // flag this function so we don't do the same thing twice - arguments.callee.done = true; - // kill the timer - if (_timer) clearInterval(_timer); - - if (!document.createElement || !document.getElementsByTagName) return; - - sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; - - forEach(document.getElementsByTagName('table'), function(table) { - if (table.className.search(/\bsortable\b/) != -1) { - sorttable.makeSortable(table); - } - }); - - }, - - makeSortable: function(table) { - if (table.getElementsByTagName('thead').length == 0) { - // table doesn't have a tHead. Since it should have, create one and - // put the first table row in it. - the = document.createElement('thead'); - the.appendChild(table.rows[0]); - table.insertBefore(the,table.firstChild); - } - // Safari doesn't support table.tHead, sigh - if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - - if (table.tHead.rows.length != 1) return; // can't cope with two header rows - - // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as - // "total" rows, for example). This is B&R, since what you're supposed - // to do is put them in a tfoot. So, if there are sortbottom rows, - // for backwards compatibility, move them to tfoot (creating it if needed). - sortbottomrows = []; - for (var i=0; i5' : ' ▴'; - this.appendChild(sortrevind); - return; - } - if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { - // if we're already sorted by this column in reverse, just - // re-reverse the table, which is quicker - sorttable.reverse(this.sorttable_tbody); - this.className = this.className.replace('sorttable_sorted_reverse', - 'sorttable_sorted'); - this.removeChild(document.getElementById('sorttable_sortrevind')); - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - return; - } - - // remove sorttable_sorted classes - theadrow = this.parentNode; - forEach(theadrow.childNodes, function(cell) { - if (cell.nodeType == 1) { // an element - cell.className = cell.className.replace('sorttable_sorted_reverse',''); - cell.className = cell.className.replace('sorttable_sorted',''); - } - }); - sortfwdind = document.getElementById('sorttable_sortfwdind'); - if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } - sortrevind = document.getElementById('sorttable_sortrevind'); - if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } - - this.className += ' sorttable_sorted'; - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - - // build an array to sort. This is a Schwartzian transform thing, - // i.e., we "decorate" each row with the actual sort key, - // sort based on the sort keys, and then put the rows back in order - // which is a lot faster because you only do getInnerText once per row - row_array = []; - col = this.sorttable_columnindex; - rows = this.sorttable_tbody.rows; - for (var j=0; j 12) { - // definitely dd/mm - return sorttable.sort_ddmm; - } else if (second > 12) { - return sorttable.sort_mmdd; - } else { - // looks like a date, but we can't tell which, so assume - // that it's dd/mm (English imperialism!) and keep looking - sortfn = sorttable.sort_ddmm; - } - } - } - } - return sortfn; - }, - - getInnerText: function(node) { - // gets the text we want to use for sorting for a cell. - // strips leading and trailing whitespace. - // this is *not* a generic getInnerText function; it's special to sorttable. - // for example, you can override the cell text with a customkey attribute. - // it also gets .value for fields. - - hasInputs = (typeof node.getElementsByTagName == 'function') && - node.getElementsByTagName('input').length; - - if (node.getAttribute("sorttable_customkey") != null) { - return node.getAttribute("sorttable_customkey"); - } - else if (typeof node.textContent != 'undefined' && !hasInputs) { - return node.textContent.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.innerText != 'undefined' && !hasInputs) { - return node.innerText.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.text != 'undefined' && !hasInputs) { - return node.text.replace(/^\s+|\s+$/g, ''); - } - else { - switch (node.nodeType) { - case 3: - if (node.nodeName.toLowerCase() == 'input') { - return node.value.replace(/^\s+|\s+$/g, ''); - } - case 4: - return node.nodeValue.replace(/^\s+|\s+$/g, ''); - break; - case 1: - case 11: - var innerText = ''; - for (var i = 0; i < node.childNodes.length; i++) { - innerText += sorttable.getInnerText(node.childNodes[i]); - } - return innerText.replace(/^\s+|\s+$/g, ''); - break; - default: - return ''; - } - } - }, - - reverse: function(tbody) { - // reverse the rows in a tbody - newrows = []; - for (var i=0; i=0; i--) { - tbody.appendChild(newrows[i]); - } - delete newrows; - }, - - /* sort functions - each sort function takes two parameters, a and b - you are comparing a[0] and b[0] */ - sort_numeric: function(a,b) { - aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); - if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); - if (isNaN(bb)) bb = 0; - return aa-bb; - }, - sort_alpha: function(a,b) { - if (a[0]==b[0]) return 0; - if (a[0] 0 ) { - var q = list[i]; list[i] = list[i+1]; list[i+1] = q; - swap = true; - } - } // for - t--; - - if (!swap) break; - - for(var i = t; i > b; --i) { - if ( comp_func(list[i], list[i-1]) < 0 ) { - var q = list[i]; list[i] = list[i-1]; list[i-1] = q; - swap = true; - } - } // for - b++; - - } // while(swap) - } -} - -/* ****************************************************************** - Supporting functions: bundled here to avoid depending on a library - ****************************************************************** */ - -// Dean Edwards/Matthias Miller/John Resig - -/* for Mozilla/Opera9 */ -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", sorttable.init, false); -} - -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - document.write("