satui/satapp/src/csatuiobserver.cpp
changeset 15 d7fc66ccd6fb
parent 12 ae8abd0db65c
child 27 7eb70891911c
equal deleted inserted replaced
13:e32024264ebb 15:d7fc66ccd6fb
    23 #include    <ProfileEngineSDKCRKeys.h>
    23 #include    <ProfileEngineSDKCRKeys.h>
    24 #include    <centralrepository.h>
    24 #include    <centralrepository.h>
    25 #include    <settingsinternalcrkeys.h>
    25 #include    <settingsinternalcrkeys.h>
    26 #include    <gulicon.h> //for itemsicon
    26 #include    <gulicon.h> //for itemsicon
    27 #include    <fbs.h>
    27 #include    <fbs.h>
       
    28 #include    <HbGlobal>
    28 
    29 
    29 #include    "csatuiobserver.h"
    30 #include    "csatuiobserver.h"
    30 #include    "msatuiactionimplementer.h"
    31 #include    "msatuiactionimplementer.h"
    31 #include    "csatuiiconhandler.h"
    32 #include    "csatuiiconhandler.h"
    32 #include    "tflogger.h"
    33 #include    "tflogger.h"
    83 // ----------------------------------------------------------------------------
    84 // ----------------------------------------------------------------------------
    84 //
    85 //
    85 void CSatUiObserver::ConstructL()
    86 void CSatUiObserver::ConstructL()
    86     {
    87     {
    87     TFLOGSTRING("SATAPP: CSatUiObserver::ConstructL called")
    88     TFLOGSTRING("SATAPP: CSatUiObserver::ConstructL called")
    88 
       
    89     //Register to Server as subsession
       
    90     //If Server is not up, this function call may take time
       
    91     iSatSession.ConnectL();
       
    92 
       
    93     iSat.RegisterL(iSatSession, this);
       
    94     iAdapter = iSat.Adapter();
       
    95     if (!iAdapter)
       
    96         {
       
    97         User::Leave(KErrNotFound);
       
    98         }
       
    99 
       
   100     // create icon handler
       
   101     //iIconHandler = CSatUiIconHandler::NewL();
       
   102 
       
   103     //Item icons
       
   104     //iItemIcons = new (ELeave) CAknIconArray(1);
       
   105 
       
   106     TFLOGSTRING("SATAPP: CSatUiObserver::ConstructL exit")
    89     TFLOGSTRING("SATAPP: CSatUiObserver::ConstructL exit")
   107     }
    90     }
   108 
    91 
   109 // ----------------------------------------------------------------------------
    92 // ----------------------------------------------------------------------------
   110 // CSatUiObserver::NewL
    93 // CSatUiObserver::NewL
   129 // ----------------------------------------------------------------------------
   112 // ----------------------------------------------------------------------------
   130 //
   113 //
   131 CSatUiObserver::~CSatUiObserver()
   114 CSatUiObserver::~CSatUiObserver()
   132     {
   115     {
   133     TFLOGSTRING("SATAPP: CSatUiObserver::~CSatUiObserver() called")
   116     TFLOGSTRING("SATAPP: CSatUiObserver::~CSatUiObserver() called")
   134 
       
   135     iSat.Close();
       
   136     iSatSession.Close();
       
   137 
       
   138 //    if (iItemIcons)
       
   139 //        {
       
   140 //        iItemIcons->ResetAndDestroy();
       
   141 //        delete iItemIcons;
       
   142 //        }
       
   143 
       
   144     // delete icon handler
       
   145 //    delete iIconHandler;
       
   146 //    iIconHandler = NULL;
       
   147 
       
   148     iActionImplementer = NULL;
   117     iActionImplementer = NULL;
   149     iAdapter = NULL;
   118     iAdapter = NULL;
   150 
       
   151     TFLOGSTRING("SATAPP: CSatUiObserver::~CSatUiObserver() exit")
   119     TFLOGSTRING("SATAPP: CSatUiObserver::~CSatUiObserver() exit")
   152     }
   120     }
   153 
   121 
   154 // ----------------------------------------------------------------------------
   122 // ----------------------------------------------------------------------------
   155 // CSatUiObserver::SetImplementer
   123 // CSatUiObserver::SetImplementer
   240         response = iActionImplementer->DisplayTextL(aText, aSimApplicationName,
   208         response = iActionImplementer->DisplayTextL(aText, aSimApplicationName,
   241             iconBitmapDisplayText, selfExplanatoryIcon,
   209             iconBitmapDisplayText, selfExplanatoryIcon,
   242             aSustainedText, aDuration, aWaitUserToClear);
   210             aSustainedText, aDuration, aWaitUserToClear);
   243        );
   211        );
   244 
   212 
   245     if (err != KErrNone)
   213     if ( KErrNone != err )
   246         {
   214         {
   247         response = ESatFailure;
   215         response = ESatFailure;
   248         aRequestedIconDisplayed = EFalse;
   216         aRequestedIconDisplayed = EFalse;
   249         }
   217         }
   250 
   218 
   251     if (iActionImplementer->GetEndKey())
   219     if ( iActionImplementer->GetEndKey() )
   252         {
   220         {
   253         response = ESatSessionTerminatedByUser;
   221         response = ESatSessionTerminatedByUser;
   254         iActionImplementer->SetEndKey(EFalse);
   222         iActionImplementer->SetEndKey( EFalse );
   255         }
   223         }
   256 
   224 
   257     iActionImplementer->SetCommandPending(EFalse);
   225     iActionImplementer->SetCommandPending( EFalse );
   258 
   226 
   259     TFLOGSTRING2("SATAPP: CSatUiObserver::DisplayText exit, return: %d", \
   227     TFLOGSTRING2("SATAPP: CSatUiObserver::DisplayText exit, return: %d", \
   260         response)
   228         response)
   261     return response;
   229     return response;
   262     }
   230     }
   287     if (aInput.IsAssigned())
   255     if (aInput.IsAssigned())
   288         {
   256         {
   289         input.Fill(aInput, 1);
   257         input.Fill(aInput, 1);
   290         }
   258         }
   291 
   259 
   292     if ((aCharacterSet == ESatYesNo) && (aText.Length() == 0))
   260     if ( ( ESatYesNo == aCharacterSet ) && (aText.Length() == 0) )
   293         {
   261         {
   294         TFLOGSTRING("SATAPP: CSatUiObserver::GetInkey return ESatFailure")
   262         TFLOGSTRING("SATAPP: CSatUiObserver::GetInkey return ESatFailure")
   295         return ESatFailure;
   263         return ESatFailure;
   296         }
   264         }
   297 
   265 
   341             TFLOGSTRING("SATAPP: CSatUiObserver::GetInkey other conditions")
   309             TFLOGSTRING("SATAPP: CSatUiObserver::GetInkey other conditions")
   342             response = iActionImplementer->GetInputL(
   310             response = iActionImplementer->GetInputL(
   343                 aText, aCharacterSet, input, 1, 1, EFalse, ETrue,
   311                 aText, aCharacterSet, input, 1, 1, EFalse, ETrue,
   344                 iconBitmapGetInkey, selfExplanatory, aDuration);
   312                 iconBitmapGetInkey, selfExplanatory, aDuration);
   345 
   313 
   346             if (ESatSuccess == response)
   314             if ( ESatSuccess == response && input.Length() )
   347                 {
   315                 {
   348                 if (input.Length())
   316                 aInput = input[0];
   349                     {
       
   350                     aInput = input[0];
       
   351                     }
       
   352                 }
   317                 }
   353             }
   318             }
   354        );
   319        );
   355 
   320 
   356     if (err != KErrNone)
   321     if ( KErrNone != err )
   357         {
   322         {
   358         response = ESatFailure;
   323         response = ESatFailure;
   359         }
   324         }
   360 
   325 
   361     if (iActionImplementer->GetEndKey())
   326     if (iActionImplementer->GetEndKey())
   429             aText, aCharacterSet, aInput, aMinLength, aMaxLength,
   394             aText, aCharacterSet, aInput, aMinLength, aMaxLength,
   430             aHideInput, EFalse, iconBitmapGetInput, selfExplanatory,
   395             aHideInput, EFalse, iconBitmapGetInput, selfExplanatory,
   431             duration);
   396             duration);
   432        );
   397        );
   433 
   398 
   434     if (err != KErrNone)
   399     if ( KErrNone != err )
   435         {
   400         {
   436         TFLOGSTRING2("SATAPP: CSatUiObserver::GetInput err:%d", err)
   401         TFLOGSTRING2("SATAPP: CSatUiObserver::GetInput err:%d", err)
   437         response = ESatFailure;
   402         response = ESatFailure;
   438         aRequestedIconDisplayed = EFalse;
   403         aRequestedIconDisplayed = EFalse;
   439         }
   404         }
   497         iconTitleBitmap = FetchIcon(aIconId.iIdentifier,
   462         iconTitleBitmap = FetchIcon(aIconId.iIdentifier,
   498                                      EIconSetUpMenuContext);
   463                                      EIconSetUpMenuContext);
   499         GetScalableBitmap(iconTitleBitmap, EIconSetUpMenuContext);
   464         GetScalableBitmap(iconTitleBitmap, EIconSetUpMenuContext);
   500         }
   465         }
   501 
   466 
   502 //    iItemIcons->ResetAndDestroy();
       
   503     TInt iconCount(0);
   467     TInt iconCount(0);
   504 
   468 
   505     if (aMenuIcons)
   469     if (aMenuIcons)
   506         {
   470         {
   507         iconCount = aMenuIcons->Count();
   471         iconCount = aMenuIcons->Count();
   530                 aMenuIcons->operator[](count)));
   494                 aMenuIcons->operator[](count)));
   531             CFbsBitmap* iconItemBitmap = NULL;
   495             CFbsBitmap* iconItemBitmap = NULL;
   532             iconItemBitmap = FetchIcon(itemIconId, EIconSetUpMenuItems);
   496             iconItemBitmap = FetchIcon(itemIconId, EIconSetUpMenuItems);
   533 
   497 
   534             if (!iconItemBitmap &&
   498             if (!iconItemBitmap &&
   535                 (aIconListQualifier == ESatSelfExplanatory))
   499                 (ESatSelfExplanatory == aIconListQualifier))
   536                 {
   500                 {
   537                 TFLOGSTRING("SATAPP: CSatUiObserver::SetUpMenu \
   501                 TFLOGSTRING("SATAPP: CSatUiObserver::SetUpMenu \
   538                     SelfExplanatory ")
   502                     SelfExplanatory ")
   539                 CleanupStack::PopAndDestroy(gulIcon); // gulIcon
   503                 CleanupStack::PopAndDestroy(gulIcon); // gulIcon
   540 //                iItemIcons->ResetAndDestroy();
       
   541                 continueLoop = EFalse;
   504                 continueLoop = EFalse;
   542                 }
   505                 }
   543             else
   506             else
   544                 {
   507                 {
   545                 if (!iconItemBitmap &&
   508                 if (!iconItemBitmap &&
   546                     (aIconListQualifier == ESatNotSelfExplanatory))
   509                     (ESatNotSelfExplanatory == aIconListQualifier))
   547                     {
   510                     {
   548                     TFLOGSTRING("SATAPP: CSatUiObserver::SetUpMenu \
   511                     TFLOGSTRING("SATAPP: CSatUiObserver::SetUpMenu \
   549                         not SelfExplanatory ")
   512                         not SelfExplanatory ")
   550                     iconItemBitmap = new(ELeave)CFbsBitmap();
   513                     iconItemBitmap = new(ELeave)CFbsBitmap();
   551                     }
   514                     }
   555                         other conditions ")
   518                         other conditions ")
   556                     GetScalableBitmap(iconItemBitmap, EIconSetUpMenuItems);
   519                     GetScalableBitmap(iconItemBitmap, EIconSetUpMenuItems);
   557                     }
   520                     }
   558 
   521 
   559                 gulIcon->SetBitmap(iconItemBitmap);
   522                 gulIcon->SetBitmap(iconItemBitmap);
   560 //                iItemIcons->AppendL(gulIcon);
       
   561                 CleanupStack::Pop(gulIcon);
   523                 CleanupStack::Pop(gulIcon);
   562                 }
   524                 }
   563             }
   525             }
   564         TFLOGSTRING2("SATAPP: CSatUiObserver::SetUpMenu count: %d", count)
   526         TFLOGSTRING2("SATAPP: CSatUiObserver::SetUpMenu count: %d", count)
   565         }
   527         }
   627                                      EIconSetUpMenuContext);
   589                                      EIconSetUpMenuContext);
   628         GetScalableBitmap(iconTitleBitmap, EIconSetUpMenuContext,
   590         GetScalableBitmap(iconTitleBitmap, EIconSetUpMenuContext,
   629             aRequestedIconDisplayed);
   591             aRequestedIconDisplayed);
   630         }
   592         }
   631 
   593 
   632     //iItemIcons->ResetAndDestroy();
       
   633 
       
   634     TInt iconCount(0);
   594     TInt iconCount(0);
   635 
   595 
   636     if (aMenuIcons)
   596     if (aMenuIcons)
   637         {
   597         {
   638         iconCount = aMenuIcons->Count();
   598         iconCount = aMenuIcons->Count();
   640 
   600 
   641     TFLOGSTRING2("SATAPP: CSatUiObserver::SelectItem iconCount:%d", iconCount)
   601     TFLOGSTRING2("SATAPP: CSatUiObserver::SelectItem iconCount:%d", iconCount)
   642 
   602 
   643     //if icons are available for item list
   603     //if icons are available for item list
   644     if ((aMenuItems.MdcaCount() == iconCount) &&
   604     if ((aMenuItems.MdcaCount() == iconCount) &&
   645         ((aIconListQualifier == ESatSelfExplanatory) ||
   605         ((ESatSelfExplanatory == aIconListQualifier) ||
   646         (aIconListQualifier == ESatNotSelfExplanatory)) &&
   606         (ESatNotSelfExplanatory == aIconListQualifier)) &&
   647         (iIconSupport))
   607         (iIconSupport))
   648         {
   608         {
   649         TFLOGSTRING(
   609         TFLOGSTRING(
   650             "SATAPP: CSatUiObserver::SelectItem icon available for item list")
   610             "SATAPP: CSatUiObserver::SelectItem icon available for item list")
   651 
   611 
   652         if (aIconListQualifier == ESatSelfExplanatory)
   612         if (ESatSelfExplanatory == aIconListQualifier)
   653             {
   613             {
   654             selfExplanatoryItems = ETrue;
   614             selfExplanatoryItems = ETrue;
   655             }
   615             }
   656 
   616 
   657         TBool continueLoop(ETrue);
   617         TBool continueLoop(ETrue);
   669             if (!iconItemBitmap &&
   629             if (!iconItemBitmap &&
   670                 (aIconListQualifier == ESatSelfExplanatory))
   630                 (aIconListQualifier == ESatSelfExplanatory))
   671                 {
   631                 {
   672                 TFLOGSTRING("SATAPP: CSatUiObserver::SelectItem \
   632                 TFLOGSTRING("SATAPP: CSatUiObserver::SelectItem \
   673                     SelfExplanatory ")
   633                     SelfExplanatory ")
   674                 CleanupStack::PopAndDestroy(gulIcon); // gulIcon
       
   675                 //iItemIcons->ResetAndDestroy();
       
   676                 continueLoop = EFalse;
   634                 continueLoop = EFalse;
   677                 aRequestedIconDisplayed = EFalse;
   635                 aRequestedIconDisplayed = EFalse;
   678                 }
   636                 }
   679             else
   637             else
   680                 {
   638                 {
   681                 // when icon can't be received and is set to not self
   639                 // when icon can't be received and is set to not self
   682                 // explanatory, we replace it with empty icon
   640                 // explanatory, we replace it with empty icon
   683                 if (!iconItemBitmap &&
   641                 if (!iconItemBitmap &&
   684                     (aIconListQualifier == ESatNotSelfExplanatory))
   642                     (ESatNotSelfExplanatory == aIconListQualifier))
   685                     {
   643                     {
   686                     TFLOGSTRING("SATAPP: CSatUiObserver::SelectItem \
   644                     TFLOGSTRING("SATAPP: CSatUiObserver::SelectItem \
   687                         not SelfExplanatory ")
   645                         not SelfExplanatory ")
   688                     iconItemBitmap = new(ELeave)CFbsBitmap();
   646                     iconItemBitmap = new(ELeave)CFbsBitmap();
   689                     aRequestedIconDisplayed = EFalse;
   647                     aRequestedIconDisplayed = EFalse;
   706                         aRequestIconDisplayed false ")
   664                         aRequestIconDisplayed false ")
   707                     GetScalableBitmap(iconItemBitmap, EIconSetUpMenuItems);
   665                     GetScalableBitmap(iconItemBitmap, EIconSetUpMenuItems);
   708                     }
   666                     }
   709 
   667 
   710                 gulIcon->SetBitmap(iconItemBitmap);
   668                 gulIcon->SetBitmap(iconItemBitmap);
   711                 //iItemIcons->AppendL(gulIcon);
       
   712                 CleanupStack::Pop(gulIcon);
   669                 CleanupStack::Pop(gulIcon);
   713                 }
   670                 }
   714             }
   671             }
   715         TFLOGSTRING2("SATAPP: CSatUiObserver::SelectItem count: %d", count)
   672         TFLOGSTRING2("SATAPP: CSatUiObserver::SelectItem count: %d", count)
   716         }
   673         }
   719         response = iActionImplementer->SelectItemL(aText, aMenuItems,
   676         response = iActionImplementer->SelectItemL(aText, aMenuItems,
   720             aMenuItemNextActions, aDefaultItem, aSelection, iconTitleBitmap,
   677             aMenuItemNextActions, aDefaultItem, aSelection, iconTitleBitmap,
   721             /*iItemIcons,*/ selfExplanatoryItems, aHelpIsAvailable);
   678             /*iItemIcons,*/ selfExplanatoryItems, aHelpIsAvailable);
   722        );
   679        );
   723 
   680 
   724     if (err != KErrNone)
   681     if (KErrNone != err)
   725         {
   682         {
   726         response = ESatFailure;
   683         response = ESatFailure;
   727         aRequestedIconDisplayed = EFalse;
   684         aRequestedIconDisplayed = EFalse;
   728         }
   685         }
   729 
   686 
  1047     // Check quering command
  1004     // Check quering command
  1048     switch (aCommandId)
  1005     switch (aCommandId)
  1049         {
  1006         {
  1050         case ESatOpenChannelQuery:
  1007         case ESatOpenChannelQuery:
  1051             {
  1008             {
  1052             TFLOGSTRING(" Quering OpenChannel")
  1009             TFLOGSTRING("Quering OpenChannel")
  1053             //TRAP(error, iActionImplementer->ConfirmOpenChannelL(
  1010             TRAP(error, iActionImplementer->ConfirmOpenChannelL(
  1054             //    aText, aActionAccepted, iconBitmap, selfExplanatory));
  1011                  aText, aActionAccepted, iconBitmap, selfExplanatory));
  1055             break;
  1012             break;
  1056             }
  1013             }
  1057 
  1014 
  1058         case ESatSRefreshQuery:
  1015         case ESatSRefreshQuery:
  1059             {
  1016             {
  1060             TFLOGSTRING(" Quering Refresh")
  1017             TFLOGSTRING("Quering Refresh")
  1061             //TRAP(error, iActionImplementer->ConfirmRefreshL(aActionAccepted));
  1018             //TRAP(error, iActionImplementer->ConfirmRefreshL(aActionAccepted));
  1062             break;
  1019             break;
  1063             }
  1020             }
  1064 
  1021 
  1065         case ESatSLaunchBrowserQuery:
  1022         case ESatSLaunchBrowserQuery:
  1066             {
  1023             {
  1067             TFLOGSTRING(" Quering LaunchBrowser")
  1024             TFLOGSTRING("Quering LaunchBrowser")
  1068             HBufC* textHolder = NULL;
  1025             HBufC* textHolder = NULL;
  1069 
  1026 
  1070             TRAP(error,
  1027             TRAP(error,
  1071             if (ESatAlphaIdNull != aAlphaIdStatus)
  1028             if (ESatAlphaIdNull != aAlphaIdStatus)
  1072                 {
  1029                 {
  1073                 TFLOGSTRING(" CSatUiObserver::ConfirmCommand AlphaId \
  1030                 TFLOGSTRING("CSatUiObserver::ConfirmCommand AlphaId \
  1074                     isn't null")
  1031                     isn't null")
  1075                 if (ESatAlphaIdNotProvided == aAlphaIdStatus)
  1032                 if (ESatAlphaIdNotProvided == aAlphaIdStatus)
  1076                     {
  1033                     {
  1077                     TFLOGSTRING(" CSatUiObserver::ConfirmCommand \
  1034                     TFLOGSTRING("CSatUiObserver::ConfirmCommand \
  1078                         AlphaId not provided")
  1035                         AlphaId not provided")
  1079                     // ToDo: replace the resouce with qt.
  1036                     // ToDo: replace the resouce with qt.
  1080                     //textHolder = StringLoader::LoadLC(
  1037                     //textHolder = StringLoader::LoadLC(
  1081                     //    R_QTN_SAT_CONF_LAUNCH_BROW,
  1038                     //    R_QTN_SAT_CONF_LAUNCH_BROW,
  1082                     //    iActionImplementer->CoeEnv());
  1039                     //    iActionImplementer->CoeEnv());
  1083                     }
  1040                     }
  1084                 else
  1041                 else
  1085                     {
  1042                     {
  1086                     TFLOGSTRING(" CSatUiObserver::ConfirmCommand \
  1043                     TFLOGSTRING("CSatUiObserver::ConfirmCommand \
  1087                         AlphaId provided")
  1044                         AlphaId provided")
  1088                     textHolder = HBufC::NewLC(aText.Length());
  1045                     textHolder = HBufC::NewLC(aText.Length());
  1089                     TPtr ptr = textHolder->Des();
  1046                     TPtr ptr = textHolder->Des();
  1090                     ptr.Append(aText);
  1047                     ptr.Append(aText);
  1091                     }
  1048                     }
  1101             break;
  1058             break;
  1102             }
  1059             }
  1103 
  1060 
  1104         case ESatSSendSmQuery:
  1061         case ESatSSendSmQuery:
  1105             {
  1062             {
  1106             TFLOGSTRING( " Quering SendSm" )
  1063             TFLOGSTRING( "Quering SendSm" )
  1107             TRAP( error, iActionImplementer->ConfirmSendL( aText,
  1064             TRAP( error, iActionImplementer->ConfirmSendL( aText,
  1108                   aActionAccepted, ESatUiConfirmSendSms ) );
  1065                   aActionAccepted, ESatUiConfirmSendSms ) );
  1109             break;
  1066             break;
  1110             }
  1067             }
  1111 
  1068 
  1112         case ESatSSendSsQuery:
  1069         case ESatSSendSsQuery:
  1113             {
  1070             {
  1114             TFLOGSTRING(" Quering SendSs")
  1071             TFLOGSTRING(" Quering SendSs")
  1115             //TRAP(error, iActionImplementer->ConfirmSendL(aText,
  1072             TRAP(error, iActionImplementer->ConfirmSendL(aText,
  1116             //      aActionAccepted, ESatUiConfirmSendSs));
  1073                   aActionAccepted, ESatUiConfirmSendSs));
  1117             break;
  1074             break;
  1118             }
  1075             }
  1119 
  1076 
  1120         case ESatSSendUssdQuery:
  1077         case ESatSSendUssdQuery:
  1121             {
  1078             {
  1122             TFLOGSTRING(" Quering SendUssd")
  1079             TFLOGSTRING(" Quering SendUssd")
  1123             //TRAP(error, iActionImplementer->ConfirmSendL(aText,
  1080             TRAP(error, iActionImplementer->ConfirmSendL(aText,
  1124             //      aActionAccepted, ESatUiConfirmSendUssd));
  1081                   aActionAccepted, ESatUiConfirmSendUssd));
  1125             break;
  1082             break;
  1126             }
  1083             }
  1127 
  1084 
  1128         case ESatSSetUpCallQuery:
  1085         case ESatSSetUpCallQuery:
  1129             {
  1086             {
  1150         {
  1107         {
  1151         TFLOGSTRING("SATAPP: CSatUiObserver::ConfirmCommand press endkey")
  1108         TFLOGSTRING("SATAPP: CSatUiObserver::ConfirmCommand press endkey")
  1152         aTerminatedByUser = ETrue;
  1109         aTerminatedByUser = ETrue;
  1153         aActionAccepted = EFalse;
  1110         aActionAccepted = EFalse;
  1154         iActionImplementer->SetEndKey(EFalse);
  1111         iActionImplementer->SetEndKey(EFalse);
  1155         }
       
  1156     else
       
  1157         {
       
  1158         // Meaningless else
       
  1159         }
  1112         }
  1160 
  1113 
  1161     iActionImplementer->SetCommandPending(EFalse);
  1114     iActionImplementer->SetCommandPending(EFalse);
  1162     TFLOGSTRING("SATAPP: CSatUiObserver::ConfirmCommand exiting")
  1115     TFLOGSTRING("SATAPP: CSatUiObserver::ConfirmCommand exiting")
  1163     }
  1116     }
  1174     const TSatIconId& aIconId,
  1127     const TSatIconId& aIconId,
  1175     TBool& aRequestedIconDisplayed,
  1128     TBool& aRequestedIconDisplayed,
  1176     const TSatControlResult aControlResult)
  1129     const TSatControlResult aControlResult)
  1177     {
  1130     {
  1178     TFLOGSTRING("SATAPP: CSatUiObserver::Notification calling")
  1131     TFLOGSTRING("SATAPP: CSatUiObserver::Notification calling")
       
  1132     TFLOGSTRING2("SATAPP: CSatUiObserver::Notification str=%S", &aText)
  1179     TSatUiResponse response = ESatSuccess;
  1133     TSatUiResponse response = ESatSuccess;
  1180     TInt error(KErrNone);
  1134     TInt error(KErrNone);
  1181     aRequestedIconDisplayed = EFalse;
  1135     aRequestedIconDisplayed = EFalse;
  1182     iActionImplementer->SetCommandPending(ETrue);
  1136     iActionImplementer->SetCommandPending(ETrue);
  1183 
  1137 
  1184     HBufC* textHolder = NULL;
  1138     HBufC* textHolder = NULL;
  1185 
  1139     QString resource;
  1186     // In case where command id is SendDtmf and alphaID is not provided,
  1140     // In case where command id is SendDtmf and alphaID is not provided,
  1187     // DTMF string to be sent is shown in dialog along with default text.
  1141     // DTMF string to be sent is shown in dialog along with default text.
  1188     if ((ESatSSendDtmfNotify == aCommandId) &&
  1142     if ((ESatSSendDtmfNotify == aCommandId) &&
  1189          (ESatAlphaIdNotProvided == aAlphaIdStatus))
  1143          (ESatAlphaIdNotProvided == aAlphaIdStatus)) {
  1190         {
       
  1191         TFLOGSTRING("SATAPP: CSatUiObserver::Notification SendDtmf")
  1144         TFLOGSTRING("SATAPP: CSatUiObserver::Notification SendDtmf")
  1192         TRAP(error,
  1145         DefaultAlphaId(aCommandId, aControlResult,resource);
  1193             TInt resource = DefaultAlphaIdL(aCommandId, aControlResult);
  1146         if ( resource.length()>0) 
  1194 
  1147             {
  1195             // Todo:
  1148             TFLOGSTRING("SATAPP: CSatUiObserver::Notification SendDtmf resource")
  1196             // Now that resource is defined, get default text
  1149             TRAP(error, textHolder = HBufC::NewL(resource.length()));
  1197             //textHolder = StringLoader::LoadL(
  1150             if (KErrNone == error) 
  1198             //    resource, aText)
  1151                 {
  1199            );
  1152                 textHolder->Des().Copy(reinterpret_cast<const TUint16*>
       
  1153                      (resource.utf16()));
       
  1154                 }
       
  1155             }
  1200         }
  1156         }
  1201     // Get default text, if alpha not provided or it is NULL
  1157     // Get default text, if alpha not provided or it is NULL
  1202     else if (aText.Length() == 0 && ESatAlphaIdNotNull != aAlphaIdStatus)
  1158     else if (aText.Length() == 0 && ESatAlphaIdNotNull != aAlphaIdStatus)
  1203         {
  1159         {
  1204         TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is null")
  1160         TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is null")
  1205         TRAP(error,
  1161         DefaultAlphaId(aCommandId, aControlResult,resource);
  1206             TInt resource = DefaultAlphaIdL(aCommandId, aControlResult);
  1162         if ( resource.length()>0) 
  1207             // Todo:
  1163             {
  1208             // Now that resource is defined, get default text
  1164             TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha null resource")
  1209             //textHolder = StringLoader::LoadL(
  1165             TRAP( error, textHolder = HBufC::NewL(resource.length()) );
  1210             //    resource, iActionImplementer->CoeEnv())
  1166             if (KErrNone == error) 
  1211            );
  1167                 {
       
  1168                 textHolder->Des().Copy(reinterpret_cast<const TUint16*>
       
  1169                     (resource.utf16()));
       
  1170                 }
       
  1171              }
       
  1172         TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is null out")
  1212         }
  1173         }
  1213     // else use given text
  1174     // else use given text
  1214     else
  1175     else
  1215         {
  1176         {
  1216         TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is provided")
  1177         TFLOGSTRING("SATAPP: CSatUiObserver::Notification alpha is provided")
  1218             textHolder = HBufC::NewL(aText.Length());
  1179             textHolder = HBufC::NewL(aText.Length());
  1219             TPtr ptr = textHolder->Des();
  1180             TPtr ptr = textHolder->Des();
  1220             ptr.Copy(aText);
  1181             ptr.Copy(aText);
  1221            );
  1182            );
  1222         }
  1183         }
  1223 
       
  1224     if (!textHolder)
  1184     if (!textHolder)
  1225         {
  1185         {
       
  1186          TFLOGSTRING("SATAPP: CSatUiObserver::Notification textHolder 0")
  1226         TRAP(error, textHolder = HBufC::NewL(0));
  1187         TRAP(error, textHolder = HBufC::NewL(0));
  1227         }
  1188         }
  1228 
  1189 
  1229     // No need to add textHolder into CleanupStack, since this is
  1190     // No need to add textHolder into CleanupStack, since this is
  1230     // not a leaving function
  1191     // not a leaving function
  1231 
  1192 
  1232     if ((KErrNone == error || KErrArgument == error) && textHolder)
  1193     if ((KErrNone == error) && textHolder)
  1233         {
  1194         {
  1234         TFLOGSTRING("SATAPP: CSatUiObserver::Notification none error ")
  1195         TFLOGSTRING("SATAPP: CSatUiObserver::Notification none error ")
  1235         CFbsBitmap* iconBitmap = NULL;
  1196         CFbsBitmap* iconBitmap = NULL;
  1236         TBool selfExplanatoryIcon(EFalse);
  1197         TBool selfExplanatoryIcon(EFalse);
  1237         // Fetch icon
  1198         // Fetch icon
  1242             (ESatSReceiveDataNotify != aCommandId))) &&
  1203             (ESatSReceiveDataNotify != aCommandId))) &&
  1243             (iIconSupport))
  1204             (iIconSupport))
  1244             {
  1205             {
  1245             iconBitmap = FetchIcon(aIconId.iIdentifier,
  1206             iconBitmap = FetchIcon(aIconId.iIdentifier,
  1246                 EIconNotification);
  1207                 EIconNotification);
  1247             //GetScalableBitmap(iconBitmap, EIconNotification,
       
  1248             //    aRequestedIconDisplayed);
       
  1249             }
  1208             }
  1250 
  1209 
  1251         if (ESatSelfExplanatory == aIconId.iIconQualifier)
  1210         if (ESatSelfExplanatory == aIconId.iIconQualifier)
  1252             {
  1211             {
  1253             selfExplanatoryIcon = ETrue;
  1212             selfExplanatoryIcon = ETrue;
  1300             case ESatSCallControlNotify:
  1259             case ESatSCallControlNotify:
  1301                 {
  1260                 {
  1302                 TFLOGSTRING(" Notifying CallControl")
  1261                 TFLOGSTRING(" Notifying CallControl")
  1303                 iActionImplementer->DispatchTimer(iWait);
  1262                 iActionImplementer->DispatchTimer(iWait);
  1304                 TRAP(error,
  1263                 TRAP(error,
  1305                     iActionImplementer->CallControlL(
  1264                      iActionImplementer->CallControlL(
  1306                         *textHolder, aAlphaIdStatus)
  1265                          *textHolder, aAlphaIdStatus)
  1307                    );
  1266                      );
  1308                 iActionImplementer->SetCommandPending(EFalse);
  1267                 iActionImplementer->SetCommandPending(EFalse);
  1309                 break;
  1268                 break;
  1310                 }
  1269                 }
  1311             case ESatSSendUssdNotify:   // fall through
  1270             case ESatSSendUssdNotify:   // fall through
  1312             case ESatSSendSsNotify:
  1271             case ESatSSendSsNotify:
  1345                     // Show Sms wait note
  1304                     // Show Sms wait note
  1346                     TRAP(error,
  1305                     TRAP(error,
  1347                         iActionImplementer->ShowSmsWaitNoteL(*textHolder,
  1306                         iActionImplementer->ShowSmsWaitNoteL(*textHolder,
  1348                             iconBitmap, selfExplanatoryIcon));
  1307                             iconBitmap, selfExplanatoryIcon));
  1349                     }
  1308                     }
  1350 
       
  1351                 break;
  1309                 break;
  1352                 }
  1310                 }
  1353             default:
  1311             default:
  1354                 {
  1312                 {
  1355                 TFLOGSTRING(" Unkown notification")
  1313                 TFLOGSTRING(" Unkown notification")
  1376     else
  1334     else
  1377         {
  1335         {
  1378         TFLOGSTRING("SATAPP: CSatUiObserver::Notification success")
  1336         TFLOGSTRING("SATAPP: CSatUiObserver::Notification success")
  1379         response = ESatSuccess;
  1337         response = ESatSuccess;
  1380         }
  1338         }
  1381 
       
  1382 
  1339 
  1383     TFLOGSTRING2("SATAPP: CSatUiObserver::Notification exiting, return: %d", \
  1340     TFLOGSTRING2("SATAPP: CSatUiObserver::Notification exiting, return: %d", \
  1384         response)
  1341         response)
  1385     return response;
  1342     return response;
  1386     }
  1343     }
  1458 
  1415 
  1459     TFLOGSTRING("SATAPP: CSatUiObserver::EventNotification exiting")
  1416     TFLOGSTRING("SATAPP: CSatUiObserver::EventNotification exiting")
  1460     }
  1417     }
  1461 
  1418 
  1462 // ----------------------------------------------------------------------------
  1419 // ----------------------------------------------------------------------------
  1463 // CSatUiObserver::DefaultAlphaIdL
  1420 // CSatUiObserver::DefaultAlphaId
  1464 // (other items were commented in a header).
  1421 // (other items were commented in a header).
  1465 // ----------------------------------------------------------------------------
  1422 // ----------------------------------------------------------------------------
  1466 //
  1423 //
  1467 TInt CSatUiObserver::DefaultAlphaIdL(
  1424 void CSatUiObserver::DefaultAlphaId(
  1468     const TSatSNotifyCommand aCommandId,
  1425     const TSatSNotifyCommand aCommandId,
  1469     const TSatControlResult aControlResult) const
  1426     const TSatControlResult aControlResult, QString &resource) const
  1470     {
  1427     {
  1471     TFLOGSTRING("SATAPP: CSatUiObserver::DefaultAlphaIdL calling")
  1428     TFLOGSTRING("SATAPP: CSatUiObserver::DefaultAlphaId calling")
  1472     TInt resource(0);
       
  1473 
       
  1474     switch (aCommandId)
  1429     switch (aCommandId)
  1475         {
  1430         {
  1476         case ESatSSendDataNotify: // SendData
  1431         case ESatSSendDataNotify: // SendData
  1477             {
  1432             {
  1478             TFLOGSTRING(" SendData default")
  1433             TFLOGSTRING("SendData default")
  1479             //resource = R_QTN_SAT_CONF_SEND_DATA_BIP;
  1434             resource = hbTrId("txt_sat_conf_send_data_bip");
  1480             break;
  1435             break;
  1481             }
  1436             }
  1482 
       
  1483         case ESatSReceiveDataNotify: // ReceiveData
  1437         case ESatSReceiveDataNotify: // ReceiveData
  1484             {
  1438             {
  1485             TFLOGSTRING(" ReceiveData default")
  1439             TFLOGSTRING("ReceiveData default")
  1486             //resource = R_QTN_SAT_CONF_RECEIVE_DATA_BIP;
  1440             resource = hbTrId("txt_sat_conf_receive_data_bip");
  1487             break;
  1441             break;
  1488             }
  1442             }
  1489 
       
  1490         case ESatSCloseChannelNotify: // CloseChannel
  1443         case ESatSCloseChannelNotify: // CloseChannel
  1491             {
  1444             {
  1492             TFLOGSTRING(" CloseChannel default")
  1445             TFLOGSTRING("CloseChannel default")
  1493             //resource = R_QTN_SAT_CONF_CLOSE_CHANNEL_BIP;
  1446             resource = hbTrId("txt_sat_conf_close_channel_bip");
  1494             break;
  1447             break;
  1495             }
  1448             }
  1496 
       
  1497         case ESatSMoSmControlNotify: // MoSmControl
  1449         case ESatSMoSmControlNotify: // MoSmControl
  1498             {
  1450             {
  1499             if (ESatNotAllowed == aControlResult)
  1451             if (ESatNotAllowed == aControlResult)
  1500                 {
  1452                 {
  1501                 TFLOGSTRING(" MoSmcontrol Not allowed default")
  1453                 TFLOGSTRING(" MoSmcontrol Not allowed default")
  1502                 //resource = R_QTN_SAT_MOSM_NOT_ALLOWED;
  1454                 resource = hbTrId("txt_sat_mosm_not_allowed");
  1503                 }
  1455                 }
  1504             else if (ESatAllowedWithModifications == aControlResult)
  1456             else if (ESatAllowedWithModifications == aControlResult)
  1505                 {
  1457                 {
  1506                 TFLOGSTRING(" MoSmcontrol Modified default")
  1458                 TFLOGSTRING(" MoSmcontrol Modified default")
  1507                 //resource = R_QTN_SAT_MOSM_MODIFIED;
  1459                 resource = hbTrId("txt_sat_request_modified");
  1508                 }
  1460                 }
  1509             else
  1461             else
  1510                 {
  1462                 {
  1511                 TFLOGSTRING(" MoSmcontrol No default")
  1463                 TFLOGSTRING(" MoSmcontrol No default")
  1512                 resource = 0; // Allowed, default alpha -> no info
  1464                 resource = hbTrId(""); // Allowed, default alpha -> no info
  1513                 }
  1465                 }
  1514             break;
  1466             break;
  1515             }
  1467             }
  1516 
       
  1517         case ESatSCallControlNotify: // CallControl
  1468         case ESatSCallControlNotify: // CallControl
  1518             {
  1469             {
  1519             if (ESatNotAllowed == aControlResult)
  1470             if (ESatNotAllowed == aControlResult)
  1520                 {
  1471                 {
  1521                 TFLOGSTRING(" CallControl Not allowed default")
  1472                 TFLOGSTRING("CallControl Not allowed default")
  1522                 //resource = R_QTN_SAT_CC_NOT_ALLOWED;
  1473                 resource = hbTrId("txt_sat_cc_not_allowed");
  1523                 }
  1474                 }
  1524             else if (ESatAllowedWithModifications == aControlResult)
  1475             else if (ESatAllowedWithModifications == aControlResult)
  1525                 {
  1476                 {
  1526                 TFLOGSTRING(" CallControl Modified default")
  1477                 TFLOGSTRING("CallControl Modified default")
  1527                 //resource = R_QTN_SAT_CC_MODIFIED;
  1478                 resource = hbTrId("txt_sat_cc_modified");
  1528                 }
  1479                 }
  1529             else
  1480             else
  1530                 {
  1481                 {
  1531                 TFLOGSTRING(" CallControl No default")
  1482                 TFLOGSTRING("CallControl No default")
  1532                 resource = 0; // Allowed, default alpha -> no info
  1483                 resource = hbTrId(""); // Allowed, default alpha -> no info
  1533                 }
  1484                 }
  1534             break;
  1485             break;
  1535             }
  1486             }
  1536 
       
  1537         case ESatSSendSmsNotify: // SendSm
  1487         case ESatSSendSmsNotify: // SendSm
  1538             {
  1488             {
  1539             TFLOGSTRING(" SendSms default")
  1489             TFLOGSTRING(" SendSms default")
  1540             //resource = R_QTN_SAT_SENDING_SMS;
  1490             resource = hbTrId("txt_sat_sending_sms");
  1541             break;
  1491             break;
  1542             }
  1492             }
  1543 
  1493 
  1544         case ESatSSendDtmfNotify: // SendDtmf
  1494         case ESatSSendDtmfNotify: // SendDtmf
  1545             {
  1495             {
  1546             TFLOGSTRING(" SendDTMF default")
  1496             TFLOGSTRING(" SendDTMF default")
  1547             //resource = R_QTN_SAT_NOTE_SENDING_DTMF_TEMPLATE;
  1497             resource = hbTrId("txt_sat_note_sending_dtmf_template");
  1548             break;
  1498             break;
  1549             }
  1499             }
  1550 
       
  1551         default:
  1500         default:
  1552             {
  1501             {
  1553             TFLOGSTRING2(" Unknown command id: %i", aCommandId)
  1502             TFLOGSTRING2(" Unknown command id: %i", aCommandId)
  1554             User::Leave(KErrArgument);
  1503             break;
  1555             }
  1504             }
  1556         }
  1505         }
  1557 
  1506 
  1558     TFLOGSTRING2("SATAPP: CSatUiObserver::DefaultAlphaIdL exiting, resource: \
  1507     TFLOGSTRING("SATAPP: CSatUiObserver::DefaultAlphaId exiting")
  1559         %d", resource)
       
  1560     return resource;
       
  1561     }
  1508     }
  1562 
  1509 
  1563 // ----------------------------------------------------------------------------
  1510 // ----------------------------------------------------------------------------
  1564 // CSatUiObserver::FetchIcon
  1511 // CSatUiObserver::FetchIcon
  1565 // Fetch the icon information.
  1512 // Fetch the icon information.
  1570     const enum TIconCommand /*aIconCommand*/)
  1517     const enum TIconCommand /*aIconCommand*/)
  1571     {
  1518     {
  1572     TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon called")
  1519     TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon called")
  1573 
  1520 
  1574     CFbsBitmap* iconBitmap = NULL;
  1521     CFbsBitmap* iconBitmap = NULL;
  1575 /*
       
  1576     TSize layoutSize(0, 0);
       
  1577 
       
  1578     // Set icon max size according the command
       
  1579     if (GetPopUpWindowIconSize(layoutSize, aIconCommand))
       
  1580         {
       
  1581         TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon max size")
       
  1582         // Comment out icon related code, add qt icon support future
       
  1583         TRAPD(err, iconBitmap = iIconHandler->FetchIconL(iSatSession,
       
  1584             aIconId, layoutSize.iWidth, layoutSize.iHeight, iIconSupport));
       
  1585 
       
  1586         if (err != KErrNone)
       
  1587             {
       
  1588             #if defined _DEBUG
       
  1589             _LIT(KFetchIcon, "SATAPP: CSatUiObserver::FetchIcon");
       
  1590             User::Panic(KFetchIcon, err);
       
  1591             #endif
       
  1592             }
       
  1593         }
       
  1594     else
       
  1595         {
       
  1596         TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon not supported")
       
  1597         }
       
  1598 */
       
  1599     TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon exit")
  1522     TFLOGSTRING("SATAPP: CSatUiObserver::FetchIcon exit")
  1600     return iconBitmap;
  1523     return iconBitmap;
  1601     }
  1524     }
  1602 
  1525 
  1603 // ----------------------------------------------------------------------------
  1526 // ----------------------------------------------------------------------------
  1604 // CSatUiObserver::GetPopUpWindowIconSize
  1527 // CSatUiObserver::GetPopUpWindowIconSize
  1605 // Get size for the icon in popup window.
  1528 // Get size for the icon in popup window.
  1606 // (other items were commented in a header).
  1529 // (other items were commented in a header).
  1607 // ----------------------------------------------------------------------------
  1530 // ----------------------------------------------------------------------------
  1608 //
  1531 //
  1609 TBool CSatUiObserver::GetPopUpWindowIconSize(TSize& aSize,
  1532 TBool CSatUiObserver::GetPopUpWindowIconSize(TSize& /*aSize*/,
  1610     const TIconCommand /*aIconCommand*/)
  1533     const TIconCommand /*aIconCommand*/)
  1611     {
  1534     {
  1612     TFLOGSTRING("SATAPP: CSatUiObserver::GetPopUpWindowIconSize called")
  1535     TFLOGSTRING("SATAPP: CSatUiObserver::GetPopUpWindowIconSize called")
  1613 
  1536     return ETrue;
  1614     TRect rect(TSize(0, 0));
       
  1615     TBool supported(ETrue);
       
  1616     // Comment out this code for no icon support in current qt satapp
       
  1617 /*    TAknLayoutRect opLogoLayout;
       
  1618 
       
  1619     TFLOGSTRING2("SATAPP: CSatUiObserver::GetPopUpWindowIconSize, \
       
  1620         aIconCommand: %i", aIconCommand)
       
  1621     // depending on the command, get correct layout and
       
  1622     // Calculate rectangle based on LAF specification.
       
  1623     switch (aIconCommand)
       
  1624         {
       
  1625         case EIconSetUpMenuContext:
       
  1626             {
       
  1627             opLogoLayout.LayoutRect(rect,
       
  1628                 AknLayoutScalable_Avkon::context_pane_g1().LayoutLine());
       
  1629             break;
       
  1630             }
       
  1631         case EIconSetUpMenuItems:
       
  1632             {
       
  1633             opLogoLayout.LayoutRect(rect,
       
  1634                 AknLayout::List_pane_elements__single_graphic__Line_1());
       
  1635             break;
       
  1636             }
       
  1637         case EIconDisplayText:
       
  1638             {
       
  1639             // layout borrowed from video
       
  1640             opLogoLayout.LayoutRect(rect, AknLayoutScalable_Avkon::
       
  1641                 popup_query_sat_info_window(0).LayoutLine());
       
  1642             break;
       
  1643             }
       
  1644         case EIconPlayTone:
       
  1645             {
       
  1646             opLogoLayout.LayoutRect(rect, AknLayoutScalable_Avkon::
       
  1647                 popup_note_window_g1(0).LayoutLine());
       
  1648             break;
       
  1649             }
       
  1650         case EIconConfirmCommand:   // fall through
       
  1651         case EIconGetInput:         // fall through
       
  1652         case EIconGetYesNo:         // fall through
       
  1653         case EIconGetInkey:
       
  1654             {
       
  1655             opLogoLayout.LayoutRect(rect, AknLayout::Icon(0));
       
  1656             break;
       
  1657             }
       
  1658         case EIconNotification:
       
  1659             {
       
  1660             opLogoLayout.LayoutRect(rect, AknLayout::
       
  1661                 Wait_or_progress_note_pop_up_window_elements_Line_1());
       
  1662             break;
       
  1663             }
       
  1664         default:
       
  1665             {
       
  1666             TFLOGSTRING(
       
  1667                 "SATAPP: CSatUiObserver::GetPopUpWindowIconSize not supported")
       
  1668             supported = EFalse;
       
  1669             break;
       
  1670             }
       
  1671         }
       
  1672 
       
  1673     aSize = opLogoLayout.Rect().Size();
       
  1674 
       
  1675     // Layout for title icon gives incorrect width
       
  1676     // but since it is square height can be set to width
       
  1677     if (EIconSetUpMenuContext == aIconCommand)
       
  1678         {
       
  1679         aSize.iWidth = aSize.iHeight;
       
  1680         }
       
  1681 */
       
  1682     TFLOGSTRING3("SATAPP: CSatUiObserver::GetPopUpWindowIconSize %dx%d exit",
       
  1683         aSize.iWidth, aSize.iHeight)
       
  1684     return supported;
       
  1685     }
  1537     }
  1686 
  1538 
  1687 // ----------------------------------------------------------------------------
  1539 // ----------------------------------------------------------------------------
  1688 // CSatUiObserver::GetScalableBitmap
  1540 // CSatUiObserver::GetScalableBitmap
  1689 // Creates scalable bitmap
  1541 // Creates scalable bitmap
  1693 void CSatUiObserver::GetScalableBitmapL(
  1545 void CSatUiObserver::GetScalableBitmapL(
  1694     CFbsBitmap*& /*aBitMapToConvert*/,
  1546     CFbsBitmap*& /*aBitMapToConvert*/,
  1695     const TIconCommand  /*aIconCommand*/)
  1547     const TIconCommand  /*aIconCommand*/)
  1696     {
  1548     {
  1697     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called")
  1549     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called")
  1698 /*
       
  1699     TSize layoutSize(0, 0);
       
  1700     CFbsBitmap* bitmap = NULL;
       
  1701 
       
  1702     // If scalable icon is supported in current layout then
       
  1703     // makes the scalable icon.
       
  1704     if (GetPopUpWindowIconSize(layoutSize, aIconCommand))
       
  1705         {
       
  1706         bitmap = new (ELeave) CFbsBitmap;
       
  1707         CleanupStack::PushL(bitmap);
       
  1708         // CAknIcon takes ownership of bitmaps.
       
  1709         CFbsBitmap* dupMain = new (ELeave) CFbsBitmap;
       
  1710         CleanupStack::PushL(dupMain);
       
  1711         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap duplicate original")
       
  1712         User::LeaveIfError(
       
  1713             dupMain->Duplicate(aBitMapToConvert->Handle()));
       
  1714 
       
  1715         //CAknIcon* bitmapIcon = CAknIcon::NewL();
       
  1716         // Mask is not set because skins are not used.
       
  1717         // Ownership is transferred.
       
  1718         bitmapIcon->SetBitmap(dupMain);
       
  1719         CleanupStack::Pop(dupMain);
       
  1720         CleanupStack::PushL(bitmapIcon);
       
  1721         CAknIcon* scalableIcon = AknIconUtils::CreateIconL(bitmapIcon);
       
  1722         CleanupStack::Pop(bitmapIcon);
       
  1723         CleanupStack::PushL(scalableIcon);
       
  1724 
       
  1725         // fetch the size of icon
       
  1726         TSize iconSize = dupMain->SizeInPixels();
       
  1727 
       
  1728         // At first we assume that width is scaled to layout maximum and
       
  1729         // thus height is set so that the ratio of the image remains correct
       
  1730 
       
  1731         TInt newHeight =
       
  1732             (layoutSize.iWidth * iconSize.iHeight) / iconSize.iWidth;
       
  1733 
       
  1734         // If the new height is larger than the height of the layout
       
  1735         // we scale height to maximum and set the width so that the ratio of
       
  1736         // the image remains correct
       
  1737         if (newHeight > layoutSize.iHeight)
       
  1738             {
       
  1739             TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap \
       
  1740                 larger than layout height")
       
  1741             layoutSize.iWidth =
       
  1742                 (layoutSize.iHeight * iconSize.iWidth) / iconSize.iHeight;
       
  1743             }
       
  1744         // If the new height is smaller or the same as the height of the
       
  1745         // layout, the image is scaled according to it
       
  1746         else
       
  1747             {
       
  1748             TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap \
       
  1749                 smaller than layout height")
       
  1750             layoutSize.iHeight = newHeight;
       
  1751             }
       
  1752 
       
  1753         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap resize scaled icon")
       
  1754         AknIconUtils::SetSize(scalableIcon->Bitmap(), layoutSize);
       
  1755 
       
  1756         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap duplicate scaled")
       
  1757         User::LeaveIfError(bitmap->Duplicate(
       
  1758             scalableIcon->Bitmap()->Handle()));
       
  1759 
       
  1760         CleanupStack::PopAndDestroy(scalableIcon);
       
  1761 
       
  1762         // Uses scaled icon if scalable bitmap is supported.
       
  1763         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap Show Scaled")
       
  1764         delete aBitMapToConvert;
       
  1765         aBitMapToConvert = bitmap;
       
  1766         CleanupStack::Pop(bitmap);
       
  1767         }
       
  1768 */
       
  1769     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit")
  1550     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit")
  1770     }
  1551     }
  1771 
  1552 
  1772 // ----------------------------------------------------------------------------
  1553 // ----------------------------------------------------------------------------
  1773 // CSatUiObserver::GetScalableBitmap
  1554 // CSatUiObserver::GetScalableBitmap
  1779     CFbsBitmap*& /*aBitMapToConvert*/,
  1560     CFbsBitmap*& /*aBitMapToConvert*/,
  1780     const TIconCommand  /*aIconCommand*/,
  1561     const TIconCommand  /*aIconCommand*/,
  1781     TBool& /*aRequestedIconDisplayed*/)
  1562     TBool& /*aRequestedIconDisplayed*/)
  1782     {
  1563     {
  1783     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called")
  1564     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called")
  1784 /*
       
  1785     if (aBitMapToConvert)
       
  1786         {
       
  1787         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap bitmap \
       
  1788             to convert")
       
  1789         // Scale icon
       
  1790         TRAPD(err, GetScalableBitmapL(aBitMapToConvert, aIconCommand););
       
  1791 
       
  1792         if (KErrNoMemory == err)
       
  1793             {
       
  1794             TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap memory \
       
  1795                 low")
       
  1796             // Memory low, command is done without icon
       
  1797             delete aBitMapToConvert;
       
  1798             aBitMapToConvert = NULL;
       
  1799             aRequestedIconDisplayed = EFalse;
       
  1800             }
       
  1801         else
       
  1802             {
       
  1803             TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap have \
       
  1804                 memory")
       
  1805             aRequestedIconDisplayed = ETrue;
       
  1806             }
       
  1807         }
       
  1808     else
       
  1809         {
       
  1810         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap  no bitmap")
       
  1811         // Icon not received
       
  1812         aRequestedIconDisplayed = EFalse;
       
  1813         }
       
  1814 */
       
  1815     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit")
  1565     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit")
  1816     }
  1566     }
  1817 
  1567 
  1818 // ----------------------------------------------------------------------------
  1568 // ----------------------------------------------------------------------------
  1819 // CSatUiObserver::GetScalableBitmap
  1569 // CSatUiObserver::GetScalableBitmap
  1824 void CSatUiObserver::GetScalableBitmap(
  1574 void CSatUiObserver::GetScalableBitmap(
  1825     CFbsBitmap*& /*aBitMapToConvert*/,
  1575     CFbsBitmap*& /*aBitMapToConvert*/,
  1826     const TIconCommand /*aIconCommand*/)
  1576     const TIconCommand /*aIconCommand*/)
  1827     {
  1577     {
  1828     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called")
  1578     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap called")
  1829 /*
       
  1830     if (aBitMapToConvert)
       
  1831         {
       
  1832         TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap bitmap \
       
  1833             to convert")
       
  1834         // Scale icon
       
  1835         TRAPD(err, GetScalableBitmapL(aBitMapToConvert, aIconCommand););
       
  1836 
       
  1837         if (KErrNoMemory == err)
       
  1838             {
       
  1839              TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap memory \
       
  1840                  low")
       
  1841             // Memory low, command is done without icon
       
  1842             delete aBitMapToConvert;
       
  1843             aBitMapToConvert = NULL;
       
  1844             }
       
  1845         }
       
  1846 */
       
  1847     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit")
  1579     TFLOGSTRING("SATAPP: CSatUiObserver::GetScalableBitmap exit")
  1848     }
  1580     }
  1849 
  1581 
  1850 // ----------------------------------------------------------------------------
  1582 // ----------------------------------------------------------------------------
  1851 // CSatUiObserver::ProfileState
  1583 // CSatUiObserver::ProfileState
  1876         profileId)
  1608         profileId)
  1877 
  1609 
  1878     return profileId;
  1610     return profileId;
  1879     }
  1611     }
  1880 
  1612 
       
  1613 // ----------------------------------------------------------------------------
       
  1614 // CSatUiObserver::ConnectRSatSessionL
       
  1615 //
       
  1616 // (other items were commented in a header).
       
  1617 // ----------------------------------------------------------------------------
       
  1618 //
       
  1619 void CSatUiObserver::ConnectRSatSessionL()
       
  1620     {
       
  1621     TFLOGSTRING("SATAPP: CSatUiObserver::ConnectRSatSessionL called")
       
  1622     //Register to Server as subsession
       
  1623     //If Server is not up, this function call may take time
       
  1624     iSatSession.ConnectL();
       
  1625     iSat.RegisterL(iSatSession, this);
       
  1626     iAdapter = iSat.Adapter();
       
  1627     if (!iAdapter)
       
  1628         {
       
  1629         User::Leave(KErrNotFound);
       
  1630         }
       
  1631     TFLOGSTRING("SATAPP: CSatUiObserver::ConnectRSatSessionL exit")
       
  1632     }
       
  1633 
       
  1634 // ----------------------------------------------------------------------------
       
  1635 // CSatUiObserver::DisconnectRSatSession
       
  1636 // Get the profile status
       
  1637 // (other items were commented in a header).
       
  1638 // ----------------------------------------------------------------------------
       
  1639 //
       
  1640 void CSatUiObserver::DisconnectRSatSession()
       
  1641     {
       
  1642     TFLOGSTRING("SATAPP: CSatUiObserver::DisconnectRSatSession called")
       
  1643     iSat.Close();
       
  1644     iSatSession.Close();
       
  1645     TFLOGSTRING("SATAPP: CSatUiObserver::DisconnectRSatSession exit")
       
  1646     }
       
  1647 
  1881 //  End of File
  1648 //  End of File