|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : IsvTelInfoAppDlg.cpp 00004 * Part of : IsvTelInfoApp 00005 * Interface : 00006 * Description : Functions of the CIsvTelInfoAppDlg class 00007 * Version : 00008 * 00009 * Copyright (c) 2005-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 // INCLUDE FILES 00017 #include <eikmenub.h> 00018 #include <eikcapc.h> 00019 #include <avkon.hrh> 00020 #include <avkon.rsg> 00021 #include <aknnotewrappers.h> 00022 #include <akntitle.h> 00023 #include <etel3rdparty.h> 00024 #include <IsvTelInfoApp.rsg> 00025 #include "IsvTelInfoAppContainer.h" 00026 #include "IsvTelInfoAppTelephonyNotify.h" 00027 #include "IsvTelInfoAppTelephony.h" 00028 #include "IsvTelInfoAppDlg.h" 00029 #include "IsvTelInfoAppUi.h" 00030 00031 // ================= MEMBER FUNCTIONS ========================================= 00032 00033 // ---------------------------------------------------------------------------- 00034 // CIsvTelInfoAppDlg::NewL() 00035 // Two-phased constructor. 00036 // ---------------------------------------------------------------------------- 00037 // 00038 CIsvTelInfoAppDlg* CIsvTelInfoAppDlg::NewL() 00039 { 00040 CIsvTelInfoAppDlg* self = 00041 new (ELeave) CIsvTelInfoAppDlg(); 00042 CleanupStack::PushL(self); 00043 self->ConstructL(); 00044 CleanupStack::Pop(); 00045 return self; 00046 } 00047 00048 // ---------------------------------------------------------------------------- 00049 // CIsvTelInfoAppDlg::~CIsvTelInfoAppDlg() 00050 // Destructor. 00051 // ---------------------------------------------------------------------------- 00052 // 00053 CIsvTelInfoAppDlg::~CIsvTelInfoAppDlg() 00054 { 00055 00056 SetMainPageTitleOnPaneL(); 00057 00058 if ( !iIsStoreForm ) 00059 { 00060 if ( iTelephony ) 00061 { 00062 delete iTelephony; 00063 } 00064 } 00065 } 00066 00067 // ---------------------------------------------------------------------------- 00068 // CIsvTelInfoAppDlg::ExecuteLD( TInt aResourceId ) 00069 // Over-riding function from base-class. It sets the page title for the first 00070 // page and then invokes the base-class function. 00071 // ---------------------------------------------------------------------------- 00072 // 00073 TInt CIsvTelInfoAppDlg::ExecuteLD( TInt aResourceId ) 00074 { 00075 if ( iIsStoreForm ) 00076 { 00077 User::Leave(KErrGeneral); 00078 return KErrGeneral; 00079 } 00080 else 00081 { 00082 TInt retCode; 00083 00084 //Set page title for first page 00085 SetPageTitleOnPaneL(iPageId); 00086 00087 //Call the base-class routine 00088 // Launches the dialog having resource ID aResourceId 00089 retCode = CAknForm::ExecuteLD( aResourceId ); 00090 00091 TryChangeFocusToL(EIsvTelInfoAppDlgCtrlIdPhoneMfr); 00092 00093 return(retCode); 00094 } 00095 } 00096 00097 // ---------------------------------------------------------------------------- 00098 // CIsvTelInfoAppDlg::OfferKeyEventL() 00099 // An over-riding routine that captures the Green dial key and the Red hang-up 00100 // key from the key-pad when they are pressed with the focus being present 00101 // on the Phone-numbers in the dialog screen. 00102 // For other keys, it calls the base-class routine for handling. 00103 // ---------------------------------------------------------------------------- 00104 // 00105 TKeyResponse CIsvTelInfoAppDlg::OfferKeyEventL( 00106 const TKeyEvent& aKeyEvent, 00107 TEventCode aType) 00108 { 00109 if (aType == EEventKey) 00110 { 00111 //Catch the dial button 00112 switch (aKeyEvent.iCode) 00113 { 00114 case EKeyYes: 00115 case EKeyNo: 00116 { 00117 return EKeyWasConsumed; 00118 } 00119 case EKeyUpArrow: 00120 case EKeyDownArrow: 00121 { 00122 if( iIsInEditMode ) 00123 { 00124 return EKeyWasConsumed; 00125 } 00126 } 00127 break; 00128 default: 00129 break; 00130 }//switch 00131 }//if 00132 return CAknForm::OfferKeyEventL(aKeyEvent, aType); 00133 } 00134 00135 // ---------------------------------------------------------------------------- 00136 // CIsvTelInfoAppDlg::DynInitMenuPaneL() 00137 // Different controls/dialog items/pages on the multi-page dialog require their 00138 // own context sensitive menus to be able to choose only the applicable 00139 // operations on the item. For this purpose, this function, loads menu panes 00140 // that are appropriate and applicable for the respective menu items. 00141 // ---------------------------------------------------------------------------- 00142 // 00143 void CIsvTelInfoAppDlg::DynInitMenuPaneL( 00144 TInt aResourceId, 00145 CEikMenuPane* aMenuPane ) 00146 { 00147 00148 TInt pageId = ActivePageId(); 00149 00150 if (aResourceId == R_AVKON_FORM_MENUPANE) 00151 { 00152 aMenuPane->AddMenuItemsL( 00153 R_GENERAL_STATUS_MENU_PANE,0,1); 00154 aMenuPane->SetItemDimmed(EAknFormCmdEdit,TRUE); 00155 aMenuPane->SetItemDimmed(EAknFormCmdSave,TRUE); 00156 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00157 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00158 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00159 } 00160 else 00161 { 00162 CAknForm::DynInitMenuPaneL(aResourceId, aMenuPane); 00163 } 00164 } 00165 00166 // ---------------------------------------------------------------------------- 00167 // CIsvTelInfoAppDlg::ProcessCommandL() 00168 // An over-riding function that handles all commands loaded by the 00169 // DynInitMenuPaneL. For the remaining commands like Edit & Save, it invokes 00170 // the base class routine. 00171 // ---------------------------------------------------------------------------- 00172 // 00173 void CIsvTelInfoAppDlg::ProcessCommandL( TInt aCommandId ) 00174 { 00175 TInt pageId = ActivePageId(); 00176 switch (pageId) 00177 { 00178 ///////////////////////////////////////////////////////////// 00179 case EIsvTelInfoAppPageCtrlIdPagePhoneInfo: 00180 { 00181 iTelephony->TelApiWrapperGetPhoneIdL( ); 00182 iTelephony->TelApiWrapperGetSubscriberIdL( ); 00183 }//case 00184 break; 00185 ///////////////////////////////////////////////////////////// 00186 case EIsvTelInfoAppPageCtrlIdPageNwBarringStatus: 00187 { 00188 iTelephony->TelApiWrapperGetBarringStatusL( 00189 CTelephony::EBarAllIncoming ); 00190 iTelephony->TelApiWrapperGetBarringStatusL( 00191 CTelephony::EBarAllOutgoing ); 00192 iTelephony->TelApiWrapperGetBarringStatusL( 00193 CTelephony::EBarIncomingRoaming ); 00194 iTelephony->TelApiWrapperGetBarringStatusL( 00195 CTelephony::EBarOutgoingInternational ); 00196 iTelephony->TelApiWrapperGetBarringStatusL( 00197 CTelephony::EBarOutgoingInternationalExHC ); 00198 }//case 00199 break; 00200 ///////////////////////////////////////////////////////////// 00201 case EIsvTelInfoAppPageCtrlIdPageMisc: 00202 { 00203 iTelephony->TelApiWrapperGetWaitingStatusL( ); 00204 iTelephony->TelApiWrapperGetNwRegistrationStatusL( ); 00205 iTelephony->TelApiWrapperGetIdentityStatusL( 00206 CTelephony::EIdServiceCallerPresentation ); 00207 iTelephony->TelApiWrapperGetIdentityStatusL( 00208 CTelephony::EIdServiceCallerRestriction ); 00209 }//case 00210 break; 00211 //////////////////////////////////////////////////////////////////// 00212 case EAknFormCmdEdit: 00213 { 00214 iIsInEditMode = ETrue; 00215 } 00216 break; 00217 00218 default: 00219 break; 00220 }//pageId switch 00221 //Call the base class routine 00222 CAknForm::ProcessCommandL(aCommandId); 00223 } 00224 00225 // ---------------------------------------------------------------------------- 00226 // CIsvTelInfoAppDlg::PageChangedL() 00227 // Derived from base-class. It invokes the base-class function and after the 00228 // page switch is executed, it sets the appropriate title for the page. 00229 // ---------------------------------------------------------------------------- 00230 // 00231 void CIsvTelInfoAppDlg::PageChangedL(TInt aPageId) 00232 { 00233 //Invoke the base class routine 00234 CAknForm::PageChangedL(aPageId); 00235 00236 //Call SetPageTitleOnPaneL to set the appropriate title on pane 00237 SetPageTitleOnPaneL(aPageId); 00238 } 00239 00240 // ---------------------------------------------------------------------------- 00241 // CIsvTelInfoAppDlg::SetDlgPageL() 00242 // Is called from the container class to set the start page. 00243 // ---------------------------------------------------------------------------- 00244 // 00245 void CIsvTelInfoAppDlg::SetDlgPage(TInt aPageId) 00246 { 00247 iPageId = aPageId; 00248 } 00249 00250 // ---------------------------------------------------------------------------- 00251 // CIsvTelInfoAppDlg::SetTitlePane() 00252 // It is called by the container class that creates this dialog, to set a 00253 // pointer to the Title pane. This is required to update the name of the 00254 // current page to on the title pane when a page change happens in the dialog. 00255 // ---------------------------------------------------------------------------- 00256 // 00257 void CIsvTelInfoAppDlg::SetTitlePane(CAknTitlePane* aTitlePane) 00258 { 00259 iTitlePane = aTitlePane; 00260 } 00261 00262 // ---------------------------------------------------------------------------- 00263 // CIsvTelInfoAppDlg::SetContainer() 00264 // It is called by the container class that creates this dialog, to set a 00265 // pointer to itself. The dialog class uses this pointer from some command 00266 // completion handlers to bring the view back to foreground. 00267 // ---------------------------------------------------------------------------- 00268 // 00269 void CIsvTelInfoAppDlg::SetContainer(CIsvTelInfoAppContainer* aContainer) 00270 { 00271 iContainer = aContainer; 00272 } 00273 00274 // ---------------------------------------------------------------------------- 00275 // CIsvTelInfoAppDlg::SetPageTitleOnPaneL() 00276 // For each page, it sets the appropriate page title on the pane 00277 // ---------------------------------------------------------------------------- 00278 // 00279 void CIsvTelInfoAppDlg::SetPageTitleOnPaneL(TInt aPageId) 00280 { 00281 const TInt KTitlePaneBufLength = 256; 00282 TBuf<KTitlePaneBufLength> titleText( NULL ); 00283 00284 //Select the page title 00285 switch (aPageId) 00286 { 00287 case EIsvTelInfoAppPageCtrlIdPagePhoneInfo: 00288 { 00289 iEikonEnv->ReadResource( titleText, 00290 R_ISVTELINFOAPP_TEXT_STATUS_PANE_PAGE_PHONEINFO); 00291 } 00292 break; 00293 case EIsvTelInfoAppPageCtrlIdPageNwBarringStatus: 00294 { 00295 iEikonEnv->ReadResource( titleText, 00296 R_ISVTELINFOAPP_TEXT_STATUS_PANE_PAGE_BARRINGSTATUS ); 00297 } 00298 break; 00299 case EIsvTelInfoAppPageCtrlIdPageMisc: 00300 { 00301 iEikonEnv->ReadResource(titleText, 00302 R_ISVTELINFOAPP_TEXT_STATUS_PANE_PAGE_MISC); 00303 } 00304 break; 00305 default: 00306 break; 00307 } 00308 00309 //Set the appropriate title on the pane 00310 if (iTitlePane) 00311 { 00312 iTitlePane->SetTextL( titleText ); 00313 } 00314 } 00315 00316 // ---------------------------------------------------------------------------- 00317 // CIsvTelInfoAppDlg::SetMainPageTitleOnPaneL() 00318 // Sets the Application's title on the pane 00319 // ---------------------------------------------------------------------------- 00320 // 00321 void CIsvTelInfoAppDlg::SetMainPageTitleOnPaneL( ) 00322 { 00323 const TInt KTitlePaneBufLength = 256; 00324 TBuf<KTitlePaneBufLength> titleText( NULL ); 00325 00326 iEikonEnv->ReadResource(titleText, 00327 R_ISVTELINFOAPP_TEXT_STATUS_PANE_MAIN_PAGE); 00328 00329 //Set the appropriate title on the pane 00330 if (iTitlePane) 00331 { 00332 iTitlePane->SetTextL( titleText ); 00333 } 00334 } 00335 00336 // ---------------------------------------------------------------------------- 00337 // CIsvTelInfoAppDlg::GetPhoneIdApiCompleteL() 00338 // Command completion routine called from the CIsvTelInfoAppTelephony class 00339 // once the request to Get Phone ID is complete 00340 // ---------------------------------------------------------------------------- 00341 // 00342 void CIsvTelInfoAppDlg::GetPhoneIdApiCompleteL(TInt aStatus, 00343 CTelephony::TPhoneIdV1 aPhoneId, TDesC16& aErrMsg) 00344 { 00345 if (aStatus != KErrNone) 00346 { 00347 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdPhoneMfr, 00348 &aErrMsg); 00349 00350 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdPhoneModel, 00351 &aErrMsg); 00352 00353 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdPhoneSerNum, 00354 &aErrMsg); 00355 } 00356 else 00357 { 00358 //Update Phone Mfr to UI 00359 iEdwinPhoneMfr.Copy(aPhoneId.iManufacturer); 00360 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdPhoneMfr, 00361 &iEdwinPhoneMfr); 00362 00363 //Update Phone Model to UI 00364 iEdwinPhoneModel.Copy(aPhoneId.iModel); 00365 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdPhoneModel, 00366 &iEdwinPhoneModel); 00367 00368 //Update Phone Ser num to UI 00369 iEdwinPhoneSerNum.Copy(aPhoneId.iSerialNumber); 00370 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdPhoneSerNum, 00371 &iEdwinPhoneSerNum); 00372 } 00373 } 00374 00375 // ---------------------------------------------------------------------------- 00376 // CIsvTelInfoAppDlg::GetSubscriberIdApiCompleteL() 00377 // Command completion routine called from the CIsvTelInfoAppTelephony class 00378 // once the request to Get Subscriber ID is complete 00379 // ---------------------------------------------------------------------------- 00380 // 00381 void CIsvTelInfoAppDlg::GetSubscriberIdApiCompleteL(TInt aStatus, 00382 CTelephony::TSubscriberIdV1 aSubscriberId, TDesC16& aErrMsg) 00383 { 00384 if (aStatus != KErrNone) 00385 { 00386 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdSubscriberId, 00387 &aErrMsg); 00388 } 00389 else 00390 { 00391 //Update the subscriber id to UI 00392 iEdwinSubscriberId.Copy(aSubscriberId.iSubscriberId); 00393 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdSubscriberId, 00394 &iEdwinSubscriberId); 00395 } 00396 } 00397 00398 // ---------------------------------------------------------------------------- 00399 // CIsvTelInfoAppDlg::GetBarringStatusApiCompleteL() 00400 // Command completion routine called from the CIsvTelInfoAppTelephony class 00401 // once the request to Get Barring status is complete 00402 // ---------------------------------------------------------------------------- 00403 // 00404 void CIsvTelInfoAppDlg::GetBarringStatusApiCompleteL( 00405 TInt aStatus, 00406 CTelephony::TCallBarringCondition aBarringCondition, 00407 CTelephony::TCallBarringSupplServicesV1 aCallBarringServices, 00408 TDesC16& aErrMsg) 00409 { 00410 if (aStatus != KErrNone) 00411 { 00412 SetEdwinTextL((TInt) 00413 EIsvTelInfoAppDlgCtrlIdBarringAllIncoming, &aErrMsg); 00414 00415 SetEdwinTextL( 00416 (TInt) EIsvTelInfoAppDlgCtrlIdBarringIncomingRoaming, &aErrMsg); 00417 00418 SetEdwinTextL((TInt) 00419 EIsvTelInfoAppDlgCtrlIdBarringAllOutgoing, &aErrMsg); 00420 00421 SetEdwinTextL((TInt) 00422 EIsvTelInfoAppDlgCtrlIdBarringOutgoingInternational, &aErrMsg); 00423 00424 SetEdwinTextL((TInt) 00425 EIsvTelInfoAppDlgCtrlIdBarringOutgoingInternationalExHC, 00426 &aErrMsg); 00427 00428 return; 00429 } 00430 else 00431 { 00432 TBuf<EIsvTelInfoAppEdwinMaxLength> barringStatusStr; 00433 switch (aCallBarringServices.iCallBarring) 00434 { 00435 case CTelephony::EStatusActive: 00436 { 00437 barringStatusStr.Copy(iBarStatusActive); 00438 } 00439 break; 00440 case CTelephony::ENotActive: 00441 { 00442 barringStatusStr.Copy(iBarStatusNotActive); 00443 } 00444 break; 00445 case CTelephony::ENotProvisioned: 00446 { 00447 barringStatusStr.Copy(iBarStatusNotProvisioned); 00448 } 00449 break; 00450 case CTelephony::ENotAvailable: 00451 { 00452 barringStatusStr.Copy(iBarStatusNotAvailable); 00453 } 00454 break; 00455 case CTelephony::EUnknown: 00456 { 00457 barringStatusStr.Copy(iBarStatusUnknown); 00458 } 00459 break; 00460 default: 00461 { 00462 barringStatusStr.Copy(iErrString); 00463 } 00464 break; 00465 } 00466 00467 iEdwinBarringStatus.Copy(barringStatusStr); 00468 00469 switch (aBarringCondition) 00470 { 00471 case CTelephony::EBarAllIncoming: 00472 { 00473 SetEdwinTextL((TInt) 00474 EIsvTelInfoAppDlgCtrlIdBarringAllIncoming, 00475 &iEdwinBarringStatus); 00476 } 00477 break; 00478 case CTelephony::EBarIncomingRoaming: 00479 { 00480 SetEdwinTextL( 00481 (TInt) EIsvTelInfoAppDlgCtrlIdBarringIncomingRoaming, 00482 &iEdwinBarringStatus); 00483 } 00484 break; 00485 case CTelephony::EBarAllOutgoing: 00486 { 00487 SetEdwinTextL((TInt) 00488 EIsvTelInfoAppDlgCtrlIdBarringAllOutgoing, 00489 &iEdwinBarringStatus); 00490 } 00491 break; 00492 case CTelephony::EBarOutgoingInternational: 00493 { 00494 SetEdwinTextL((TInt) 00495 EIsvTelInfoAppDlgCtrlIdBarringOutgoingInternational, 00496 &iEdwinBarringStatus); 00497 } 00498 break; 00499 case CTelephony::EBarOutgoingInternationalExHC: 00500 { 00501 SetEdwinTextL((TInt) 00502 EIsvTelInfoAppDlgCtrlIdBarringOutgoingInternationalExHC, 00503 &iEdwinBarringStatus); 00504 } 00505 break; 00506 default: 00507 break; 00508 } 00509 } 00510 } 00511 00512 // ---------------------------------------------------------------------------- 00513 // CIsvTelInfoAppDlg::GetWaitingStatusApiCompleteL() 00514 // Command completion routine called from the CIsvTelInfoAppTelephony class 00515 // once the request to Get call waiting status is complete 00516 // ---------------------------------------------------------------------------- 00517 // 00518 void CIsvTelInfoAppDlg::GetWaitingStatusApiCompleteL(TInt aStatus, 00519 CTelephony::TCallWaitingSupplServicesV1 aCallWaitingServices, 00520 TDesC16& aErrMsg) 00521 { 00522 if (aStatus != KErrNone) 00523 { 00524 SetEdwinTextL((TInt) EIsvTelInfoAppDlgCtrlIdWaiting, 00525 &aErrMsg); 00526 return; 00527 } 00528 else 00529 { 00530 TBuf<EIsvTelInfoAppEdwinMaxLength> waitingStatusStr; 00531 switch (aCallWaitingServices.iCallWaiting) 00532 { 00533 case CTelephony::EStatusActive: 00534 { 00535 waitingStatusStr.Copy(iWaitStatusActive); 00536 } 00537 break; 00538 case CTelephony::ENotActive: 00539 { 00540 waitingStatusStr.Copy(iWaitStatusNotActive); 00541 } 00542 break; 00543 case CTelephony::ENotProvisioned: 00544 { 00545 waitingStatusStr.Copy(iWaitStatusNotProvisioned); 00546 } 00547 break; 00548 case CTelephony::ENotAvailable: 00549 { 00550 waitingStatusStr.Copy(iWaitStatusNotAvailable); 00551 } 00552 break; 00553 case CTelephony::EUnknown: 00554 { 00555 waitingStatusStr.Copy(iWaitStatusUnknown); 00556 } 00557 break; 00558 default: 00559 { 00560 waitingStatusStr.Copy(iErrString); 00561 } 00562 break; 00563 } 00564 iEdwinWaiting.Copy(waitingStatusStr); 00565 SetEdwinTextL((TInt) EIsvTelInfoAppDlgCtrlIdWaiting, 00566 &iEdwinWaiting); 00567 } 00568 } 00569 00570 // ---------------------------------------------------------------------------- 00571 // CIsvTelInfoAppDlg::GetIdentityServiceStatusApiCompleteL() 00572 // Command completion routine called from the CIsvTelInfoAppTelephony class 00573 // once the request to Get Id Service status is complete 00574 // ---------------------------------------------------------------------------- 00575 // 00576 void CIsvTelInfoAppDlg::GetIdentityServiceStatusApiCompleteL( 00577 TInt aStatus, 00578 CTelephony::TIdentityService aIdentityServiceType, 00579 CTelephony::TIdentityServiceV1 aIdentityService, 00580 TDesC16& aErrMsg) 00581 { 00582 if (aStatus != KErrNone) 00583 { 00584 SetEdwinTextL((TInt) EIsvTelInfoAppDlgCtrlIdIdPresentation, 00585 &aErrMsg); 00586 00587 SetEdwinTextL((TInt) EIsvTelInfoAppDlgCtrlIdIdRestriction, 00588 &aErrMsg); 00589 return; 00590 } 00591 else 00592 { 00593 TBuf<EIsvTelInfoAppEdwinMaxLength> identityServiceStatusStr; 00594 switch (aIdentityService.iIdentityStatus) 00595 { 00596 case CTelephony::EIdServiceActivePermanent: 00597 { 00598 identityServiceStatusStr.Copy(iIdStatusActivePerm); 00599 } 00600 break; 00601 00602 case CTelephony::EIdServiceActiveDefaultRestricted: 00603 { 00604 identityServiceStatusStr.Copy( 00605 iIdStatusDefaultRestricted); 00606 } 00607 break; 00608 00609 case CTelephony::EIdServiceActiveDefaultAllowed: 00610 { 00611 identityServiceStatusStr.Copy(iIdStatusDefaultAllowed); 00612 } 00613 break; 00614 00615 case CTelephony::EIdServiceNotProvisioned: 00616 { 00617 identityServiceStatusStr.Copy(iIdStatusNotProvisioned); 00618 } 00619 break; 00620 00621 case CTelephony::EIdServiceUnknown: 00622 { 00623 identityServiceStatusStr.Copy(iIdStatusUnknown); 00624 } 00625 break; 00626 00627 default: 00628 { 00629 identityServiceStatusStr.Copy(iErrString); 00630 } 00631 break; 00632 } 00633 00634 iEdwinIdentity.Copy(identityServiceStatusStr); 00635 00636 switch (aIdentityServiceType) 00637 { 00638 case CTelephony::EIdServiceCallerPresentation: 00639 { 00640 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdIdPresentation, 00641 &iEdwinIdentity); 00642 } 00643 break; 00644 00645 case CTelephony::EIdServiceCallerRestriction: 00646 { 00647 SetEdwinTextL((TInt) EIsvTelInfoAppDlgCtrlIdIdRestriction, 00648 &iEdwinIdentity); 00649 } 00650 break; 00651 00652 default: 00653 break; 00654 } 00655 } 00656 } 00657 00658 // ---------------------------------------------------------------------------- 00659 // CIsvTelInfoAppDlg::GetNwRegistrationStatusApiCompleteL() 00660 // Command completion routine called from the CIsvTelInfoAppTelephony class 00661 // once the request to Get Network Registration Information is complete 00662 // ---------------------------------------------------------------------------- 00663 // 00664 void CIsvTelInfoAppDlg::GetNwRegistrationStatusApiCompleteL(TInt aStatus, 00665 CTelephony::TNetworkRegistrationV1 aNwRegistrationStatus, TDesC16& aErrMsg) 00666 { 00667 if (aStatus != KErrNone) 00668 { 00669 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdNwRegistration, 00670 &aErrMsg); 00671 } 00672 else 00673 { 00674 switch (aNwRegistrationStatus.iRegStatus) 00675 { 00676 case CTelephony::ERegistrationUnknown : 00677 { 00678 iEdwinNwRegistration.Copy(iNwRegUnknown); 00679 } 00680 break; 00681 00682 case CTelephony::ENotRegisteredNoService: 00683 { 00684 iEdwinNwRegistration.Copy(iNwRegNoRegNoSrvc); 00685 } 00686 break; 00687 00688 case CTelephony::ENotRegisteredEmergencyOnly: 00689 { 00690 iEdwinNwRegistration.Copy(iNwRegNoRegEmergSrvc); 00691 } 00692 break; 00693 00694 case CTelephony::ENotRegisteredSearching: 00695 { 00696 iEdwinNwRegistration.Copy(iNwRegNoRegSearching); 00697 } 00698 break; 00699 00700 case CTelephony::ERegisteredBusy: 00701 { 00702 iEdwinNwRegistration.Copy(iNwRegBusy); 00703 } 00704 break; 00705 00706 case CTelephony::ERegisteredOnHomeNetwork: 00707 { 00708 iEdwinNwRegistration.Copy(iNwRegHome); 00709 } 00710 break; 00711 00712 case CTelephony::ERegistrationDenied: 00713 { 00714 iEdwinNwRegistration.Copy(iNwRegDenied); 00715 } 00716 break; 00717 00718 case CTelephony::ERegisteredRoaming: 00719 { 00720 iEdwinNwRegistration.Copy(iNwRegRoaming); 00721 } 00722 break; 00723 00724 default: 00725 { 00726 iEdwinNwRegistration.Copy(iErrString); 00727 } 00728 break; 00729 } 00730 00731 //Update Nw Regstrn status to UI 00732 SetEdwinTextL((TInt)EIsvTelInfoAppDlgCtrlIdNwRegistration, 00733 &iEdwinNwRegistration); 00734 } 00735 } 00736 00737 // ---------------------------------------------------------------------------- 00738 // CIsvTelInfoAppDlg::CIsvTelInfoAppDlg() 00739 // Default constructor. 00740 // ---------------------------------------------------------------------------- 00741 // 00742 CIsvTelInfoAppDlg::CIsvTelInfoAppDlg() 00743 { 00744 } 00745 00746 // ---------------------------------------------------------------------------- 00747 // CIsvTelInfoAppDlg::ConstructL() 00748 // Second-phase constructor. 00749 // ---------------------------------------------------------------------------- 00750 // 00751 void CIsvTelInfoAppDlg::ConstructL() 00752 { 00753 iTitlePane = NULL; 00754 00755 if(!iIsStoreForm) 00756 { 00757 CAknForm::ConstructL(); 00758 // Create the telephony object for execution from GUI 00759 iTelephony = CIsvTelInfoAppTelephony::NewL(*this); 00760 } 00761 //Load strings from resource 00762 LoadStringsFromResource(); 00763 } 00764 00765 // ---------------------------------------------------------------------------- 00766 // CIsvTelInfoAppDlg::PostLayoutDynInitL() 00767 // An over-riding routine which Initialises values to certain default fields 00768 // Also calls the base-class routine 00769 // ---------------------------------------------------------------------------- 00770 // 00771 void CIsvTelInfoAppDlg::PostLayoutDynInitL() 00772 { 00773 //Call the base class routine 00774 CAknForm::PostLayoutDynInitL(); 00775 00776 //Set edit mode to false 00777 iIsInEditMode = EFalse; 00778 } 00779 00780 // ---------------------------------------------------------------------------- 00781 // CIsvTelInfoAppDlg::LoadStringsFromResource() 00782 // Loads strings from resource 00783 // ---------------------------------------------------------------------------- 00784 // 00785 void CIsvTelInfoAppDlg::LoadStringsFromResource( ) 00786 { 00787 TBuf16<KMaxCmdSize> resStr; 00788 00789 //Load barring status strings from resource 00790 iCoeEnv->ReadResource(resStr, 00791 R_ISVTELINFOAPP_STATUS_ACTIVE); 00792 iBarStatusActive.Copy(resStr); 00793 00794 iCoeEnv->ReadResource(resStr, 00795 R_ISVTELINFOAPP_STATUS_NOTACTIVE); 00796 iBarStatusNotActive.Copy(resStr); 00797 00798 iCoeEnv->ReadResource(resStr, 00799 R_ISVTELINFOAPP_STATUS_NOTPROVISIONED); 00800 iBarStatusNotProvisioned.Copy(resStr); 00801 00802 iCoeEnv->ReadResource(resStr, 00803 R_ISVTELINFOAPP_STATUS_NOTAVAILABLE); 00804 iBarStatusNotAvailable.Copy(resStr); 00805 00806 iCoeEnv->ReadResource(resStr, 00807 R_ISVTELINFOAPP_STATUS_UNKNOWN); 00808 iBarStatusUnknown.Copy(resStr); 00809 00810 // Network Registration 00811 iCoeEnv->ReadResource(resStr, 00812 R_ISVTELINFOAPP_NWREG_UNKNOWN); 00813 iNwRegUnknown.Copy(resStr); 00814 00815 iCoeEnv->ReadResource(resStr, 00816 R_ISVTELINFOAPP_NWREG_NOREGNOSRVC); 00817 iNwRegNoRegNoSrvc.Copy(resStr); 00818 00819 iCoeEnv->ReadResource(resStr, 00820 R_ISVTELINFOAPP_NWREG_NOREGEMERGSRVC); 00821 iNwRegNoRegEmergSrvc.Copy(resStr); 00822 00823 iCoeEnv->ReadResource(resStr, 00824 R_ISVTELINFOAPP_NWREG_NOREGSEARCHING); 00825 iNwRegNoRegSearching.Copy(resStr); 00826 00827 iCoeEnv->ReadResource(resStr, 00828 R_ISVTELINFOAPP_NWREG_REGBUSY); 00829 iNwRegBusy.Copy(resStr); 00830 00831 iCoeEnv->ReadResource(resStr, 00832 R_ISVTELINFOAPP_NWREG_REGHOME); 00833 iNwRegHome.Copy(resStr); 00834 00835 iCoeEnv->ReadResource(resStr, 00836 R_ISVTELINFOAPP_NWREG_REGDENIED); 00837 iNwRegDenied.Copy(resStr); 00838 00839 iCoeEnv->ReadResource(resStr, 00840 R_ISVTELINFOAPP_NWREG_REGROAMING); 00841 iNwRegRoaming.Copy(resStr); 00842 00843 //Load waiting status strings from resource 00844 iCoeEnv->ReadResource(resStr, 00845 R_ISVTELINFOAPP_STATUS_ACTIVE); 00846 iWaitStatusActive.Copy(resStr); 00847 00848 iCoeEnv->ReadResource(resStr, 00849 R_ISVTELINFOAPP_STATUS_NOTACTIVE); 00850 iWaitStatusNotActive.Copy(resStr); 00851 00852 iCoeEnv->ReadResource(resStr, 00853 R_ISVTELINFOAPP_STATUS_NOTPROVISIONED); 00854 iWaitStatusNotProvisioned.Copy(resStr); 00855 00856 iCoeEnv->ReadResource(resStr, 00857 R_ISVTELINFOAPP_STATUS_NOTAVAILABLE); 00858 iWaitStatusNotAvailable.Copy(resStr); 00859 00860 iCoeEnv->ReadResource(resStr, 00861 R_ISVTELINFOAPP_STATUS_UNKNOWN); 00862 iWaitStatusUnknown.Copy(resStr); 00863 00864 //Load identity service strings from resource 00865 iCoeEnv->ReadResource(resStr, 00866 R_ISVTELINFOAPP_IDSTATUS_ACTIVEPERM); 00867 iIdStatusActivePerm.Copy(resStr); 00868 00869 iCoeEnv->ReadResource(resStr, 00870 R_ISVTELINFOAPP_IDSTATUS_DEFAULTRESTRICTED); 00871 iIdStatusDefaultRestricted.Copy(resStr); 00872 00873 iCoeEnv->ReadResource(resStr, 00874 R_ISVTELINFOAPP_IDSTATUS_DEFAULTALLOWED); 00875 iIdStatusDefaultAllowed.Copy(resStr); 00876 00877 iCoeEnv->ReadResource(resStr, 00878 R_ISVTELINFOAPP_IDSTATUS_NOTPROVISIONED); 00879 iIdStatusNotProvisioned.Copy(resStr); 00880 00881 iCoeEnv->ReadResource(resStr, 00882 R_ISVTELINFOAPP_IDSTATUS_UNKNOWN); 00883 iIdStatusUnknown.Copy(resStr); 00884 00885 //Load general error and success strings 00886 iCoeEnv->ReadResource(resStr, 00887 R_ISVTELINFOAPP_TELSTR_ERRSTRING); 00888 iErrString.Copy(resStr); 00889 00890 iCoeEnv->ReadResource(resStr, 00891 R_ISVTELINFOAPP_TELSTR_SUCCESSSTRING); 00892 iSuccessString.Copy(resStr); 00893 00894 return; 00895 } 00896 00897 //End of file
|
© Nokia 2006 |