|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================ 00003 * Name : IsvTelCallAppDlg.cpp 00004 * Part of : IsvTelCallApp 00005 * Interface : 00006 * Description : Functions of the CIsvTelCallAppDlg 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 <IsvTelCallApp.rsg> 00025 #include "IsvTelCallAppContainer.h" 00026 #include "IsvTelCallAppTelephonyNotify.h" 00027 #include "IsvTelCallAppTelephony.h" 00028 #include "IsvTelCallAppDlg.h" 00029 #include "IsvTelCallAppUi.h" 00030 00031 // ================= MEMBER FUNCTIONS ========================================= 00032 00033 // ---------------------------------------------------------------------------- 00034 // CIsvTelCallAppDlg::NewL() 00035 // Two-phased constructor. 00036 // ---------------------------------------------------------------------------- 00037 // 00038 CIsvTelCallAppDlg* CIsvTelCallAppDlg::NewL() 00039 { 00040 CIsvTelCallAppDlg* self = 00041 new (ELeave) CIsvTelCallAppDlg(); 00042 CleanupStack::PushL(self); 00043 self->ConstructL(); 00044 CleanupStack::Pop(); 00045 return self; 00046 } 00047 00048 // ---------------------------------------------------------------------------- 00049 // CIsvTelCallAppDlg::~CIsvTelCallAppDlg() 00050 // Destructor. 00051 // ---------------------------------------------------------------------------- 00052 // 00053 CIsvTelCallAppDlg::~CIsvTelCallAppDlg() 00054 { 00055 00056 SetMainPageTitleOnPaneL(); 00057 00058 if (iVoiceLineAsyncTelephony) 00059 { 00060 delete(iVoiceLineAsyncTelephony); 00061 } 00062 if (iCall1StatusAsyncTelephony) 00063 { 00064 delete(iCall1StatusAsyncTelephony); 00065 } 00066 if (iCall2StatusAsyncTelephony) 00067 { 00068 delete(iCall2StatusAsyncTelephony); 00069 } 00070 if (iAnswerInCallTelephony) 00071 { 00072 delete(iAnswerInCallTelephony); 00073 } 00074 00075 //Delete the CTelephony object 00076 if ( iTelephony->GetTelephonyPtr() ) 00077 { 00078 delete ( iTelephony->GetTelephonyPtr() ); 00079 } 00080 00081 //Delete the telephony pointer 00082 if ( iTelephony ) 00083 { 00084 delete iTelephony; 00085 } 00086 } 00087 00088 // ---------------------------------------------------------------------------- 00089 // CIsvTelCallAppDlg::ExecuteLD( TInt aResourceId ) 00090 // Over-riding function from base-class. It sets the page title for the first 00091 // page and then invokes the base-class function. 00092 // ---------------------------------------------------------------------------- 00093 // 00094 TInt CIsvTelCallAppDlg::ExecuteLD( TInt aResourceId ) 00095 { 00096 00097 TInt retCode; 00098 00099 //Set page title for first page 00100 SetPageTitleOnPaneL(iPageId); 00101 00102 //Call the base-class routine 00103 retCode = CAknForm::ExecuteLD( aResourceId ); 00104 00105 TryChangeFocusToL(EIsvTelCallAppDlgCtrlIdPhone1); 00106 00107 return( retCode ); 00108 } 00109 00110 // ---------------------------------------------------------------------------- 00111 // CIsvTelCallAppDlg::OfferKeyEventL() 00112 // An over-riding routine that captures the Green dial key and the Red hang-up 00113 // key from the key-pad when they are pressed with the focus being present 00114 // on the Phone-numbers in the dialog screen. 00115 // For other keys, it calls the base-class routine for handling. 00116 // ---------------------------------------------------------------------------- 00117 // 00118 TKeyResponse CIsvTelCallAppDlg::OfferKeyEventL( 00119 const TKeyEvent& aKeyEvent, 00120 TEventCode aType) 00121 { 00122 if (aType == EEventKey) 00123 { 00124 //Catch the dial button 00125 switch (aKeyEvent.iCode) 00126 { 00127 case EKeyYes: 00128 { 00129 TInt focusControlId = IdOfFocusControl(); 00130 switch (focusControlId) 00131 { 00132 case EIsvTelCallAppDlgCtrlIdPhone1: 00133 case EIsvTelCallAppDlgCtrlIdPhone2: 00134 { 00135 ProcessCommandL(EIsvTelCallAppCmdAPITestCall); 00136 return EKeyWasConsumed; 00137 } 00138 default: 00139 break; 00140 } 00141 } 00142 break; 00143 case EKeyNo: 00144 { 00145 TInt focusControlId = IdOfFocusControl(); 00146 switch (focusControlId) 00147 { 00148 case EIsvTelCallAppDlgCtrlIdPhone1: 00149 case EIsvTelCallAppDlgCtrlIdPhone2: 00150 { 00151 ProcessCommandL(EIsvTelCallAppCmdAPITestHangup); 00152 return EKeyWasConsumed; 00153 } 00154 default: 00155 break; 00156 } 00157 } 00158 break; 00159 case EKeyUpArrow: 00160 case EKeyDownArrow: 00161 { 00162 if( iIsInEditMode ) 00163 { 00164 return EKeyWasConsumed; 00165 } 00166 } 00167 break; 00168 case EKeyOK: 00169 { 00170 if(iIsInEditMode) 00171 { 00172 ProcessCommandL(EAknFormCmdSave); 00173 } 00174 else 00175 { 00176 ProcessCommandL(EAknFormCmdEdit); 00177 } 00178 return EKeyWasConsumed; 00179 } 00180 default: 00181 break; 00182 } 00183 } 00184 return CAknForm::OfferKeyEventL(aKeyEvent, aType); 00185 } 00186 00187 // ---------------------------------------------------------------------------- 00188 // CIsvTelCallAppDlg::DynInitMenuPaneL() 00189 // Different controls/dialog items/pages on the multi-page dialog require their 00190 // own context sensitive menus to be able to choose only the applicable 00191 // operations on the item. For this purpose, this function, loads menu panes 00192 // that are appropriate and applicable for the respective menu items. 00193 // ---------------------------------------------------------------------------- 00194 // 00195 void CIsvTelCallAppDlg::DynInitMenuPaneL( 00196 TInt aResourceId, 00197 CEikMenuPane* aMenuPane ) 00198 { 00199 00200 TInt pageId = ActivePageId(); 00201 TInt focusControlId = IdOfFocusControl(); 00202 00203 if (aResourceId == R_AVKON_FORM_MENUPANE) 00204 { 00205 switch (pageId) 00206 { 00207 case EIsvTelCallAppPageCtrlIdPagePhone1: 00208 { 00209 //Phone Menu 00210 switch (focusControlId) 00211 { 00212 case EIsvTelCallAppDlgCtrlIdPhone1: 00213 { 00214 //Menu for Phone-1 and Phone-2 numbers 00215 aMenuPane->AddMenuItemsL(R_PHONE_MENU_PANE,0,1); 00216 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00217 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00218 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00219 break; 00220 } 00221 case EIsvTelCallAppDlgCtrlIdDtmfSeq1: 00222 { 00223 //Menu for DTMF sequence 00224 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00225 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00226 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00227 break; 00228 } 00229 case EIsvTelCallAppDlgCtrlIdCall1Status: 00230 { 00231 aMenuPane->AddMenuItemsL( 00232 R_GENERAL_STATUS_MENU_PANE,0,1); 00233 aMenuPane->SetItemDimmed(EAknFormCmdEdit,TRUE); 00234 aMenuPane->SetItemDimmed(EAknFormCmdSave,TRUE); 00235 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00236 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00237 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00238 } 00239 default: 00240 break; 00241 } 00242 } 00243 break; 00244 case EIsvTelCallAppPageCtrlIdPagePhone2: 00245 { 00246 //Phone Menu 00247 switch (focusControlId) 00248 { 00249 case EIsvTelCallAppDlgCtrlIdPhone2: 00250 { 00251 //Menu for Phone-1 and Phone-2 numbers 00252 aMenuPane->AddMenuItemsL(R_PHONE_MENU_PANE,0,1); 00253 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00254 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00255 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00256 break; 00257 } 00258 case EIsvTelCallAppDlgCtrlIdDtmfSeq2: 00259 { 00260 //Menu for DTMF sequence 00261 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00262 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00263 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00264 break; 00265 } 00266 case EIsvTelCallAppDlgCtrlIdCall2Status: 00267 { 00268 aMenuPane->AddMenuItemsL( 00269 R_GENERAL_STATUS_MENU_PANE,0,1); 00270 aMenuPane->SetItemDimmed(EAknFormCmdEdit,TRUE); 00271 aMenuPane->SetItemDimmed(EAknFormCmdSave,TRUE); 00272 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00273 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00274 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00275 } 00276 default: 00277 break; 00278 } 00279 } 00280 break; 00281 case EIsvTelCallAppPageCtrlIdPageCallLineStatus: 00282 { 00283 aMenuPane->AddMenuItemsL( 00284 R_GENERAL_STATUS_MENU_PANE,0,1); 00285 aMenuPane->SetItemDimmed(EAknFormCmdEdit,TRUE); 00286 aMenuPane->SetItemDimmed(EAknFormCmdSave,TRUE); 00287 aMenuPane->SetItemDimmed(EAknFormCmdAdd,TRUE); 00288 aMenuPane->SetItemDimmed(EAknFormCmdLabel,TRUE); 00289 aMenuPane->SetItemDimmed(EAknFormCmdDelete,TRUE); 00290 break; 00291 } 00292 default: 00293 break; 00294 } 00295 } 00296 else 00297 { 00298 CAknForm::DynInitMenuPaneL(aResourceId, aMenuPane); 00299 } 00300 } 00301 00302 // ---------------------------------------------------------------------------- 00303 // CIsvTelCallAppDlg::ProcessCommandL() 00304 // An over-riding function that handles all commands loaded by the 00305 // DynInitMenuPaneL. For the remaining commands like Edit & Save, it invokes 00306 // the base class routine. 00307 // ---------------------------------------------------------------------------- 00308 // 00309 void CIsvTelCallAppDlg::ProcessCommandL( TInt aCommandId ) 00310 { 00311 00312 switch (aCommandId) 00313 { 00314 //////////////////////////////////////////////////////////////////// 00315 case EIsvTelCallAppCmdAPITestCall: 00316 { 00317 TInt afocusControlId = IdOfFocusControl(); 00318 MakeNewCallProcessCommandL(afocusControlId); 00319 } 00320 break; 00321 00322 //////////////////////////////////////////////////////////////////// 00323 case EIsvTelCallAppCmdAPITestHangup: 00324 { 00325 //Branch to the appropriate page and control 00326 TInt pageId = ActivePageId(); 00327 HangupProcessCommandL(pageId); 00328 } 00329 break; 00330 00331 //////////////////////////////////////////////////////////////////// 00332 case EIsvTelCallAppCmdAPITestHold: 00333 { 00334 //Branch to the appropriate page and control 00335 TInt pageId = ActivePageId(); 00336 HoldProcessCommandL(pageId); 00337 } 00338 break; 00339 00340 //////////////////////////////////////////////////////////////////// 00341 case EIsvTelCallAppCmdAPITestResume: 00342 { 00343 //Branch to the appropriate page and control 00344 TInt pageId = ActivePageId(); 00345 ResumeProcessCommandL(pageId); 00346 } 00347 break; 00348 00349 //////////////////////////////////////////////////////////////////// 00350 case EIsvTelCallAppCmdAPITestSwap: 00351 { 00352 SwapProcessCommamndL(); 00353 } 00354 break; 00355 00356 //////////////////////////////////////////////////////////////////// 00357 case EIsvTelCallAppCmdAPITestFetch: 00358 { 00359 //Branch to the appropriate page and control 00360 TInt pageId = ActivePageId(); 00361 switch (pageId) 00362 { 00363 ///////////////////////////////////////////////////////////// 00364 case EIsvTelCallAppPageCtrlIdPagePhone1: 00365 { 00366 //Fetch information for call status control. 00367 //This helps user to stay updated 00368 //all the time. These are synchronous calls 00369 GetCallStatusL(CTelephony::EISVCall1); 00370 } 00371 break; 00372 00373 ///////////////////////////////////////////////////////////// 00374 case EIsvTelCallAppPageCtrlIdPagePhone2: 00375 { 00376 //Fetch information for call status control. 00377 //This helps user to stay updated 00378 //all the time. These are synchronous calls 00379 GetCallStatusL(CTelephony::EISVCall2); 00380 } 00381 break; 00382 ///////////////////////////////////////////////////////////// 00383 case EIsvTelCallAppPageCtrlIdPageCallLineStatus: 00384 { 00385 //Fetch EIsvTelCallAppDlgCtrlIdVoiceLineStatus: 00386 iTelephony->TelApiWrapperGetVoiceLineStatusL( ); 00387 00388 //Fetch EIsvTelCallAppDlgCtrlIdDataLineStatus: 00389 iTelephony->TelApiWrapperGetDataLineStatusL( ); 00390 00391 //Fetch EIsvTelCallAppDlgCtrlIdFaxLineStatus: 00392 iTelephony->TelApiWrapperGetFaxLineStatusL( ); 00393 } 00394 break; 00395 ///////////////////////////////////////////////////////////// 00396 default: 00397 break; 00398 }//Switch pageId 00399 }//Fetch Case 00400 break; 00401 00402 //////////// ///////////////////////////////////////////////// 00403 case EIsvTelCallAppCmdAPITestSendDTMF: 00404 { 00405 TInt focusControlId = IdOfFocusControl(); 00406 SendDTMFProcessCommandL(focusControlId); 00407 } 00408 break; 00409 00410 //////////////////////////////////////////////////////////////////// 00411 case EAknFormCmdEdit: 00412 { 00413 iIsInEditMode = ETrue; 00414 } 00415 break; 00416 00417 //////////////////////////////////////////////////////////////////// 00418 default: 00419 break; 00420 } 00421 00422 //Call the base class routine 00423 CAknForm::ProcessCommandL(aCommandId); 00424 } 00425 00426 // ---------------------------------------------------------------------------- 00427 // CIsvTelCallAppDlg::PageChangedL() 00428 // Derived from base-class. It invokes the base-class function and after the 00429 // page switch is executed, it sets the appropriate title for the page. 00430 // ---------------------------------------------------------------------------- 00431 // 00432 void CIsvTelCallAppDlg::PageChangedL(TInt aPageId) 00433 { 00434 //Invoke the base class routine 00435 CAknForm::PageChangedL(aPageId); 00436 00437 //Call SetPageTitleOnPaneL to set the appropriate title on pane 00438 SetPageTitleOnPaneL(aPageId); 00439 } 00440 00441 // ---------------------------------------------------------------------------- 00442 // CIsvTelCallAppDlg::SetDlgPage() 00443 // Is called from the container class to set the start page. 00444 // ---------------------------------------------------------------------------- 00445 // 00446 void CIsvTelCallAppDlg::SetDlgPage(TInt aPageId) 00447 { 00448 iPageId = aPageId; 00449 } 00450 00451 // ---------------------------------------------------------------------------- 00452 // CIsvTelCallAppDlg::SetTitlePane() 00453 // It is called by the container class that creates this dialog, to set a 00454 // pointer to the Title pane. This is required to update the name of the 00455 // current page to on the title pane when a page change happens in the dialog. 00456 // ---------------------------------------------------------------------------- 00457 // 00458 void CIsvTelCallAppDlg::SetTitlePane(CAknTitlePane* aTitlePane) 00459 { 00460 iTitlePane = aTitlePane; 00461 } 00462 00463 // ---------------------------------------------------------------------------- 00464 // CIsvTelCallAppDlg::SetContainer() 00465 // It is called by the container class that creates this dialog, to set a 00466 // pointer to itself. The dialog class uses this pointer from some command 00467 // completion handlers to bring the view back to foreground. 00468 // ---------------------------------------------------------------------------- 00469 // 00470 void CIsvTelCallAppDlg::SetContainer(CIsvTelCallAppContainer* aContainer) 00471 { 00472 iContainer = aContainer; 00473 } 00474 00475 // ---------------------------------------------------------------------------- 00476 // CIsvTelCallAppDlg::SetPageTitleOnPaneL() 00477 // For each page, it sets the appropriate page title on the pane 00478 // ---------------------------------------------------------------------------- 00479 // 00480 void CIsvTelCallAppDlg::SetPageTitleOnPaneL(TInt aPageId) 00481 { 00482 const TInt KTitlePaneBufLength = 256; 00483 TBuf<KTitlePaneBufLength> titleText( NULL ); 00484 00485 //Select the page title 00486 switch (aPageId) 00487 { 00488 case EIsvTelCallAppPageCtrlIdPagePhone1: 00489 { 00490 iEikonEnv->ReadResource( titleText, 00491 R_ISVTELCALLAPP_TEXT_STATUS_PANE_PHONE1 ); 00492 break; 00493 } 00494 case EIsvTelCallAppPageCtrlIdPagePhone2: 00495 { 00496 iEikonEnv->ReadResource( titleText, 00497 R_ISVTELCALLAPP_TEXT_STATUS_PANE_PHONE2 ); 00498 break; 00499 } 00500 case EIsvTelCallAppPageCtrlIdPageCallLineStatus: 00501 { 00502 iEikonEnv->ReadResource(titleText, 00503 R_ISVTELCALLAPP_TEXT_STATUS_PANE_CALL_LINE_STATUS); 00504 break; 00505 } 00506 default: 00507 break; 00508 } 00509 00510 //Set the appropriate title on the pane 00511 if (iTitlePane) 00512 { 00513 iTitlePane->SetTextL( titleText ); 00514 } 00515 } 00516 00517 // ---------------------------------------------------------------------------- 00518 // CIsvTelCallAppDlg::SetMainPageTitleOnPaneL() 00519 // Sets the Application's title on the pane 00520 // ---------------------------------------------------------------------------- 00521 // 00522 void CIsvTelCallAppDlg::SetMainPageTitleOnPaneL( ) 00523 { 00524 const TInt KTitlePaneBufLength = 256; 00525 TBuf<KTitlePaneBufLength> titleText( NULL ); 00526 00527 iEikonEnv->ReadResource(titleText, 00528 R_ISVTELCALLAPP_TEXT_STATUS_PANE_MAIN_PAGE); 00529 00530 //Set the appropriate title on the pane 00531 if (iTitlePane) 00532 { 00533 iTitlePane->SetTextL( titleText ); 00534 } 00535 } 00536 00537 // ---------------------------------------------------------------------------- 00538 // CIsvTelCallAppDlg::MakeNewCallProcessCommandL() 00539 // Dials a new call by invoking the CIsvTelCallAppTelephony object 00540 // ---------------------------------------------------------------------------- 00541 // 00542 void CIsvTelCallAppDlg::MakeNewCallProcessCommandL(TInt aFocusControlId) 00543 { 00544 switch (aFocusControlId) 00545 { 00546 00547 case EIsvTelCallAppDlgCtrlIdPhone1: 00548 { 00549 if (ControlOrNull(EIsvTelCallAppDlgCtrlIdPhone1)) 00550 { 00551 GetEdwinText(iEdwinPhone1, EIsvTelCallAppDlgCtrlIdPhone1); 00552 iTelephony->TelApiWrapperMakeNewCallL(CTelephony::EISVCall1, 00553 iEdwinPhone1); 00554 } 00555 } 00556 break; 00557 00558 case EIsvTelCallAppDlgCtrlIdPhone2: 00559 { 00560 if (ControlOrNull(EIsvTelCallAppDlgCtrlIdPhone2)) 00561 { 00562 GetEdwinText(iEdwinPhone2, EIsvTelCallAppDlgCtrlIdPhone2); 00563 iTelephony->TelApiWrapperMakeNewCallL(CTelephony::EISVCall2, 00564 iEdwinPhone2); 00565 } 00566 } 00567 break; 00568 00569 default: 00570 break; 00571 } 00572 } 00573 00574 // ---------------------------------------------------------------------------- 00575 // CIsvTelCallAppDlg::HoldProcessCommandL() 00576 // Puts a call on hold by invoking the CIsvTelCallAppTelephony object 00577 // ---------------------------------------------------------------------------- 00578 // 00579 void CIsvTelCallAppDlg::HoldProcessCommandL(TInt aPageId) 00580 { 00581 switch (aPageId) 00582 { 00583 ///////////////////////////////////////////////////////////// 00584 case EIsvTelCallAppPageCtrlIdPagePhone1: 00585 //Hold Call 1 00586 { 00587 iTelephony->TelApiWrapperHoldL( CTelephony::EISVCall1 ); 00588 } 00589 break; 00590 00591 ///////////////////////////////////////////////////////////// 00592 case EIsvTelCallAppPageCtrlIdPagePhone2: 00593 //Hold Call 2 00594 { 00595 iTelephony->TelApiWrapperHoldL( CTelephony::EISVCall2 ); 00596 } 00597 break; 00598 } 00599 } 00600 00601 // ---------------------------------------------------------------------------- 00602 // CIsvTelCallAppDlg::ResumeProcessCommandL() 00603 // Resumes a call by invoking the CIsvTelCallAppTelephony object 00604 // ---------------------------------------------------------------------------- 00605 // 00606 void CIsvTelCallAppDlg::ResumeProcessCommandL(TInt aPageId) 00607 { 00608 switch (aPageId) 00609 { 00610 ///////////////////////////////////////////////////////////// 00611 case EIsvTelCallAppPageCtrlIdPagePhone1: 00612 //Resume Call 1 00613 { 00614 iTelephony->TelApiWrapperResumeL( CTelephony::EISVCall1 ); 00615 } 00616 break; 00617 00618 ///////////////////////////////////////////////////////////// 00619 case EIsvTelCallAppPageCtrlIdPagePhone2: 00620 //Resume Call 2 00621 { 00622 iTelephony->TelApiWrapperResumeL( CTelephony::EISVCall2 ); 00623 } 00624 break; 00625 } 00626 } 00627 00628 // ---------------------------------------------------------------------------- 00629 // CIsvTelCallAppDlg::HangupProcessCommandL() 00630 // Hangs-up a call by invoking the CIsvTelCallAppTelephony object 00631 // ---------------------------------------------------------------------------- 00632 // 00633 void CIsvTelCallAppDlg::HangupProcessCommandL(TInt aPageId) 00634 { 00635 switch (aPageId) 00636 { 00637 ///////////////////////////////////////////////////////////// 00638 case EIsvTelCallAppPageCtrlIdPagePhone1: 00639 //Hangup Call 1 00640 { 00641 iTelephony->TelApiWrapperHangupL( CTelephony::EISVCall1 ); 00642 } 00643 break; 00644 00645 ///////////////////////////////////////////////////////////// 00646 case EIsvTelCallAppPageCtrlIdPagePhone2: 00647 //Hangup Call 1 00648 { 00649 iTelephony->TelApiWrapperHangupL( CTelephony::EISVCall2 ); 00650 } 00651 break; 00652 } 00653 } 00654 00655 // ---------------------------------------------------------------------------- 00656 // CIsvTelCallAppDlg::SendDTMFProcessCommandL() 00657 // Sends a DTMF string on a call by invoking the CIsvTelCallAppTelephony 00658 // object 00659 // ---------------------------------------------------------------------------- 00660 // 00661 void CIsvTelCallAppDlg::SendDTMFProcessCommandL(TInt aFocusControlId) 00662 { 00663 TBuf<KMaxDTMFLength> edwinData; 00664 00665 switch (aFocusControlId) 00666 { 00667 case EIsvTelCallAppDlgCtrlIdPhone1: 00668 { 00669 GetEdwinText(edwinData, EIsvTelCallAppDlgCtrlIdDtmfSeq1); 00670 if (edwinData.Length() > KMaxDTMFLength) 00671 { 00672 TBuf<KMaxErrMsgSize> errNoteMsg; 00673 iCoeEnv->ReadResource(errNoteMsg, 00674 R_ISVTELCALLAPP_UIERR_DTMFTOOLONG); 00675 00676 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00677 errorNote->ExecuteLD(errNoteMsg); 00678 } 00679 else 00680 { 00681 iTelephony->TelApiWrapperSendDTMFL( CTelephony::EISVCall1, 00682 edwinData); 00683 } 00684 } 00685 break; 00686 00687 case EIsvTelCallAppDlgCtrlIdPhone2: 00688 { 00689 GetEdwinText(edwinData, EIsvTelCallAppDlgCtrlIdDtmfSeq2); 00690 if (edwinData.Length() > KMaxDTMFLength) 00691 { 00692 TBuf<KMaxErrMsgSize> errNoteMsg; 00693 iCoeEnv->ReadResource(errNoteMsg, 00694 R_ISVTELCALLAPP_UIERR_DTMFTOOLONG); 00695 00696 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00697 errorNote->ExecuteLD(errNoteMsg); 00698 } 00699 else 00700 { 00701 iTelephony->TelApiWrapperSendDTMFL( CTelephony::EISVCall2, 00702 edwinData); 00703 } 00704 } 00705 break; 00706 00707 default: 00708 break; 00709 } 00710 } 00711 00712 // ---------------------------------------------------------------------------- 00713 // CIsvTelCallAppDlg::SwapProcessCommamnd() 00714 // Swaps two calls by invoking the CIsvTelCallAppTelephony object 00715 // ---------------------------------------------------------------------------- 00716 // 00717 void CIsvTelCallAppDlg::SwapProcessCommamndL() 00718 { 00719 //Swap Call1 and Call2 00720 //Format the string with command & parameters 00721 iTelephony->TelApiWrapperSwapL( ); 00722 } 00723 00724 // ---------------------------------------------------------------------------- 00725 // CIsvTelCallAppDlg::GetCallDynCapsLockStatus() 00726 // Fetches the Call status, Dynamic Capabilities and Line Lock status on Page-1 00727 // ---------------------------------------------------------------------------- 00728 // 00729 void CIsvTelCallAppDlg::GetCallStatusL(const CTelephony::TCallId aCallId) 00730 { 00731 iTelephony->TelApiWrapperGetCallStatusL( aCallId ); 00732 } 00733 00734 // ---------------------------------------------------------------------------- 00735 // CIsvTelCallAppDlg::MakeNewCallApiCompleteL() 00736 // Command completion routine called from the CIsvTelCallAppTelephony class 00737 // once the request to dial a new call is complete. 00738 // It also implements the function of status auto-update by calling the 00739 // respective status update routines. 00740 // ---------------------------------------------------------------------------- 00741 // 00742 void CIsvTelCallAppDlg::MakeNewCallApiCompleteL( 00743 TInt aStatus, 00744 const CTelephony::TCallId aCallId, 00745 CTelephony::TTelNumber& aTelNum, 00746 TDesC16& aErrMsg) 00747 { 00748 if (aStatus != KErrNone) 00749 { 00750 TBuf<KMaxErrMsgSize> errorNoteMsg; 00751 errorNoteMsg.Copy(aErrMsg); 00752 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00753 errorNote->ExecuteLD(errorNoteMsg); 00754 } 00755 else 00756 { 00757 00758 //Set the Phone number to the page where the corresponding Call ID 00759 //is handled. If the first call is made on the second page ie., 00760 //Phone-2, since it is the first call, the Call ID returned is 1 00761 //and hence, in the GUI, the call will have to be set to Phone-1 00762 //page. Also the focus will have to be changed to the corresponding 00763 //page. 00764 switch ((TInt)aCallId) 00765 { 00766 case CTelephony::EISVCall1: 00767 { 00768 if ( aTelNum == iEdwinPhone2 ) 00769 { 00770 //Swap Phone1 and Phone2 00771 iEdwinPhone2.Copy(iEdwinPhone1); 00772 } 00773 iEdwinPhone1.Copy(aTelNum); 00774 00775 if (iEdwinPhone1 == iEdwinPhone2) 00776 { 00777 //Set Phone-2 to NULL 00778 _LIT(KNullStr,""); 00779 iEdwinPhone2 = KNullStr; 00780 } 00781 } 00782 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdPhone1, 00783 &iEdwinPhone1); 00784 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdPhone2, 00785 &iEdwinPhone2); 00786 TryChangeFocusToL(EIsvTelCallAppDlgCtrlIdPhone1); 00787 break; 00788 00789 case CTelephony::EISVCall2: 00790 { 00791 iEdwinPhone2.Copy(aTelNum); 00792 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdPhone2, 00793 &iEdwinPhone2); 00794 TryChangeFocusToL(EIsvTelCallAppDlgCtrlIdPhone2); 00795 } 00796 break; 00797 00798 default: 00799 break; 00800 } 00801 //Fetch status for both the call ids 00802 GetCallStatusL(CTelephony::EISVCall1); 00803 GetCallStatusL(CTelephony::EISVCall2); 00804 } 00805 //Bring back the view to foreground 00806 iContainer->BringToForeGroundL(); 00807 } 00808 00809 // ---------------------------------------------------------------------------- 00810 // CIsvTelCallAppDlg::HangupCompleteL() 00811 // Command completion routine called from the CIsvTelCallAppTelephony class 00812 // once the request to Hangup a call is complete 00813 // ---------------------------------------------------------------------------- 00814 // 00815 void CIsvTelCallAppDlg::HangupCompleteL( TInt aStatus, TDesC16& aErrMsg) 00816 { 00817 if (aStatus != KErrNone) 00818 { 00819 TBuf<KMaxErrMsgSize> errNoteMsg; 00820 errNoteMsg.Copy(aErrMsg); 00821 00822 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00823 errorNote->ExecuteLD(errNoteMsg); 00824 } 00825 else 00826 { 00827 //Fetch status for both the call ids 00828 GetCallStatusL(CTelephony::EISVCall1); 00829 GetCallStatusL(CTelephony::EISVCall2); 00830 } 00831 00832 //Bring back the view to foreground 00833 iContainer->BringToForeGroundL(); 00834 } 00835 00836 // ---------------------------------------------------------------------------- 00837 // CIsvTelCallAppDlg::HoldCompleteL() 00838 // Command completion routine called from the CIsvTelCallAppTelephony class 00839 // once the request to place a call on hold is complete 00840 // ---------------------------------------------------------------------------- 00841 // 00842 void CIsvTelCallAppDlg::HoldCompleteL( TInt aStatus, TDesC16& aErrMsg) 00843 { 00844 if (aStatus != KErrNone) 00845 { 00846 TBuf<KMaxErrMsgSize> errNoteMsg; 00847 errNoteMsg.Copy(aErrMsg); 00848 00849 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00850 errorNote->ExecuteLD(errNoteMsg); 00851 } 00852 else 00853 { 00854 //Fetch status for both the call ids 00855 GetCallStatusL(CTelephony::EISVCall1); 00856 GetCallStatusL(CTelephony::EISVCall2); 00857 } 00858 00859 //Bring back the view to foreground 00860 iContainer->BringToForeGroundL(); 00861 } 00862 00863 // ---------------------------------------------------------------------------- 00864 // CIsvTelCallAppDlg::ResumeCompleteL() 00865 // Command completion routine called from the CIsvTelCallAppTelephony class 00866 // once the request to resume a call is complete 00867 // ---------------------------------------------------------------------------- 00868 // 00869 void CIsvTelCallAppDlg::ResumeCompleteL( TInt aStatus, TDesC16& aErrMsg ) 00870 { 00871 if (aStatus != KErrNone) 00872 { 00873 TBuf<KMaxErrMsgSize> errNoteMsg; 00874 errNoteMsg.Copy(aErrMsg); 00875 00876 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00877 errorNote->ExecuteLD(errNoteMsg); 00878 } 00879 else 00880 { 00881 //Fetch status for both the call ids 00882 GetCallStatusL(CTelephony::EISVCall1); 00883 GetCallStatusL(CTelephony::EISVCall2); 00884 } 00885 00886 //Bring back the view to foreground 00887 iContainer->BringToForeGroundL(); 00888 } 00889 00890 // ---------------------------------------------------------------------------- 00891 // CIsvTelCallAppDlg::SwapCompleteL() 00892 // Command completion routine called from the CIsvTelCallAppTelephony class 00893 // once the request to swap two calls is complete 00894 // ---------------------------------------------------------------------------- 00895 // 00896 void CIsvTelCallAppDlg::SwapCompleteL( 00897 TInt aStatus, 00898 TDesC16& aErrMsg) 00899 { 00900 if (aStatus != KErrNone) 00901 { 00902 TBuf<KMaxErrMsgSize> errNoteMsg; 00903 errNoteMsg.Copy(aErrMsg); 00904 00905 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 00906 errorNote->ExecuteLD(errNoteMsg); 00907 } 00908 else 00909 { 00910 //Fetch status for both the call ids 00911 GetCallStatusL(CTelephony::EISVCall1); 00912 GetCallStatusL(CTelephony::EISVCall2); 00913 } 00914 00915 //Bring back the view to foreground 00916 iContainer->BringToForeGroundL(); 00917 } 00918 00919 // ---------------------------------------------------------------------------- 00920 // CIsvTelCallAppDlg::GetCallStatusCompleteL() 00921 // Command completion routine called from the CIsvTelCallAppTelephony class 00922 // once the request to Get Call Status is complete 00923 // ---------------------------------------------------------------------------- 00924 // 00925 void CIsvTelCallAppDlg::GetCallStatusCompleteL( 00926 TInt aStatus, 00927 const CTelephony::TCallId aCallId, 00928 CTelephony::TCallStatusV1& aCallStatus, 00929 TDesC16& aErrMsg) 00930 { 00931 00932 TBuf<EIsvTelCallAppEdwinMaxLength> callStatusStr; 00933 00934 if (aStatus != KErrNone) 00935 { 00936 callStatusStr.Copy(iErrString); 00937 } 00938 else 00939 { 00940 switch (aCallStatus.iStatus) 00941 { 00942 case CTelephony::EStatusUnknown: 00943 { 00944 callStatusStr.Copy(iUnknownStr); 00945 } 00946 break; 00947 00948 case CTelephony::EStatusIdle: 00949 { 00950 callStatusStr.Copy(iIdleStr); 00951 } 00952 break; 00953 00954 case CTelephony::EStatusDialling: 00955 { 00956 callStatusStr.Copy(iDiallingStr); 00957 } 00958 break; 00959 00960 case CTelephony::EStatusRinging: 00961 { 00962 callStatusStr.Copy(iRingingStr); 00963 } 00964 break; 00965 00966 case CTelephony::EStatusAnswering: 00967 { 00968 callStatusStr.Copy(iAnsweringStr); 00969 } 00970 break; 00971 00972 case CTelephony::EStatusConnecting: 00973 { 00974 callStatusStr.Copy(iConnectingStr); 00975 } 00976 break; 00977 00978 case CTelephony::EStatusConnected: 00979 { 00980 callStatusStr.Copy(iConnectedStr); 00981 } 00982 break; 00983 00984 case CTelephony::EStatusReconnectPending: 00985 { 00986 callStatusStr.Copy(iReconnectPendingStr); 00987 } 00988 break; 00989 00990 case CTelephony::EStatusDisconnecting: 00991 { 00992 callStatusStr.Copy(iDisconnectingStr); 00993 } 00994 break; 00995 00996 case CTelephony::EStatusHold: 00997 { 00998 callStatusStr.Copy(iHoldStr); 00999 } 01000 break; 01001 01002 case CTelephony::EStatusTransferring: 01003 { 01004 callStatusStr.Copy(iTransferringStr); 01005 } 01006 break; 01007 01008 case CTelephony::EStatusTransferAlerting: 01009 { 01010 callStatusStr.Copy(iTransferAlertingStr); 01011 } 01012 break; 01013 01014 default: 01015 { 01016 callStatusStr.Copy(iErrString); 01017 } 01018 break; 01019 } 01020 } 01021 //Update the UI 01022 switch (aCallId) 01023 { 01024 case CTelephony::EISVCall1: 01025 { 01026 if ( aStatus != KErrNone ) 01027 { 01028 iEdwinCall1Status.Copy(aErrMsg); 01029 } 01030 else 01031 { 01032 iEdwinCall1Status.Copy(callStatusStr); 01033 } 01034 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdCall1Status, 01035 &iEdwinCall1Status); 01036 } 01037 break; 01038 01039 case CTelephony::EISVCall2: 01040 { 01041 if ( aStatus != KErrNone ) 01042 { 01043 iEdwinCall2Status.Copy(aErrMsg); 01044 } 01045 else 01046 { 01047 iEdwinCall2Status.Copy(callStatusStr); 01048 } 01049 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdCall2Status, 01050 &iEdwinCall2Status); 01051 } 01052 break; 01053 01054 default: 01055 break; 01056 } 01057 } 01058 01059 // ---------------------------------------------------------------------------- 01060 // CIsvTelCallAppDlg::GetVoiceLineStatusCompleteL() 01061 // Command completion routine called from the CIsvTelCallAppTelephony class 01062 // once the request to Get Voice Line Status is complete 01063 // ---------------------------------------------------------------------------- 01064 // 01065 void CIsvTelCallAppDlg::GetVoiceLineStatusCompleteL( 01066 TInt aStatus, 01067 TDesC16& aErrMsg, 01068 CTelephony::TCallStatusV1& aCallStatus) 01069 { 01070 if (aStatus != KErrNone) 01071 { 01072 iEdwinVoiceLineStatus.Copy(aErrMsg); 01073 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdVoiceLineStatus, 01074 &iEdwinVoiceLineStatus); 01075 } 01076 else 01077 { 01078 TBuf<EIsvTelCallAppEdwinMaxLength> callStatusStr; 01079 switch (aCallStatus.iStatus) 01080 { 01081 case CTelephony::EStatusUnknown: 01082 { 01083 callStatusStr.Copy(iUnknownStr); 01084 } 01085 break; 01086 case CTelephony::EStatusIdle: 01087 { 01088 callStatusStr.Copy(iIdleStr); 01089 } 01090 break; 01091 case CTelephony::EStatusDialling: 01092 { 01093 callStatusStr.Copy(iDiallingStr); 01094 } 01095 break; 01096 case CTelephony::EStatusRinging: 01097 { 01098 callStatusStr.Copy(iRingingStr); 01099 } 01100 break; 01101 case CTelephony::EStatusAnswering: 01102 { 01103 callStatusStr.Copy(iAnsweringStr); 01104 } 01105 break; 01106 case CTelephony::EStatusConnecting: 01107 { 01108 callStatusStr.Copy(iConnectingStr); 01109 } 01110 break; 01111 case CTelephony::EStatusConnected: 01112 { 01113 callStatusStr.Copy(iConnectedStr); 01114 } 01115 break; 01116 case CTelephony::EStatusReconnectPending: 01117 { 01118 callStatusStr.Copy(iReconnectPendingStr); 01119 } 01120 break; 01121 case CTelephony::EStatusDisconnecting: 01122 { 01123 callStatusStr.Copy(iDisconnectingStr); 01124 } 01125 break; 01126 case CTelephony::EStatusHold: 01127 { 01128 callStatusStr.Copy(iHoldStr); 01129 } 01130 break; 01131 case CTelephony::EStatusTransferring: 01132 { 01133 callStatusStr.Copy(iTransferringStr); 01134 } 01135 break; 01136 case CTelephony::EStatusTransferAlerting: 01137 { 01138 callStatusStr.Copy(iTransferAlertingStr); 01139 } 01140 break; 01141 default: 01142 { 01143 callStatusStr.Copy(iErrString); 01144 } 01145 break; 01146 } 01147 01148 //Update line status to UI 01149 iEdwinVoiceLineStatus.Copy(callStatusStr); 01150 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdVoiceLineStatus, 01151 &iEdwinVoiceLineStatus); 01152 // Register the Call 1 and 2 Status Active Object 01153 iCall1StatusAsyncTelephony-> 01154 RegisterForAsyncNotification( 01155 CTelephony::EOwnedCall1StatusChange); 01156 iCall2StatusAsyncTelephony-> 01157 RegisterForAsyncNotification( 01158 CTelephony::EOwnedCall2StatusChange); 01159 01160 // Invoke Answer Incoming Call Wrapper function, 01161 // if voice line status is ringing 01162 if ( aCallStatus.iStatus == CTelephony::EStatusRinging ) 01163 { 01164 iAnswerInCallTelephony->TelApiWrapperAnswerInCallL(); 01165 } 01166 } 01167 } 01168 01169 // ---------------------------------------------------------------------------- 01170 // CIsvTelCallAppDlg::GetDataLineStatusCompleteL() 01171 // Command completion routine called from the CIsvTelCallAppTelephony class 01172 // once the request to Get Data Line Status is complete 01173 // ---------------------------------------------------------------------------- 01174 // 01175 void CIsvTelCallAppDlg::GetDataLineStatusCompleteL( 01176 TInt aStatus, 01177 TDesC16& aErrMsg, 01178 CTelephony::TCallStatusV1& aCallStatus) 01179 { 01180 if (aStatus != KErrNone) 01181 { 01182 iEdwinDataLineStatus.Copy(aErrMsg); 01183 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdDataLineStatus, 01184 &iEdwinDataLineStatus); 01185 } 01186 else 01187 { 01188 TBuf<EIsvTelCallAppEdwinMaxLength> callStatusStr; 01189 switch (aCallStatus.iStatus) 01190 { 01191 case CTelephony::EStatusUnknown: 01192 { 01193 callStatusStr.Copy(iUnknownStr); 01194 } 01195 break; 01196 case CTelephony::EStatusIdle: 01197 { 01198 callStatusStr.Copy(iIdleStr); 01199 } 01200 break; 01201 case CTelephony::EStatusDialling: 01202 { 01203 callStatusStr.Copy(iDiallingStr); 01204 } 01205 break; 01206 case CTelephony::EStatusRinging: 01207 { 01208 callStatusStr.Copy(iRingingStr); 01209 } 01210 break; 01211 case CTelephony::EStatusAnswering: 01212 { 01213 callStatusStr.Copy(iAnsweringStr); 01214 } 01215 break; 01216 case CTelephony::EStatusConnecting: 01217 { 01218 callStatusStr.Copy(iConnectingStr); 01219 } 01220 break; 01221 case CTelephony::EStatusConnected: 01222 { 01223 callStatusStr.Copy(iConnectedStr); 01224 } 01225 break; 01226 case CTelephony::EStatusReconnectPending: 01227 { 01228 callStatusStr.Copy(iReconnectPendingStr); 01229 } 01230 break; 01231 case CTelephony::EStatusDisconnecting: 01232 { 01233 callStatusStr.Copy(iDisconnectingStr); 01234 } 01235 break; 01236 case CTelephony::EStatusHold: 01237 { 01238 callStatusStr.Copy(iHoldStr); 01239 } 01240 break; 01241 case CTelephony::EStatusTransferring: 01242 { 01243 callStatusStr.Copy(iTransferringStr); 01244 } 01245 break; 01246 case CTelephony::EStatusTransferAlerting: 01247 { 01248 callStatusStr.Copy(iTransferAlertingStr); 01249 } 01250 break; 01251 default: 01252 { 01253 callStatusStr.Copy(iErrString); 01254 } 01255 break; 01256 } 01257 //Update line status to UI 01258 iEdwinDataLineStatus.Copy(callStatusStr); 01259 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdDataLineStatus, 01260 &iEdwinDataLineStatus); 01261 } 01262 } 01263 01264 // ---------------------------------------------------------------------------- 01265 // CIsvTelCallAppDlg::GetFaxLineStatusCompleteL() 01266 // Command completion routine called from the CIsvTelCallAppTelephony class 01267 // once the request to Get Fax Line Status is complete 01268 // ---------------------------------------------------------------------------- 01269 // 01270 void CIsvTelCallAppDlg::GetFaxLineStatusCompleteL( 01271 TInt aStatus, 01272 TDesC16& aErrMsg, 01273 CTelephony::TCallStatusV1& aCallStatus) 01274 { 01275 01276 if (aStatus != KErrNone) 01277 { 01278 iEdwinFaxLineStatus.Copy(aErrMsg); 01279 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdFaxLineStatus, 01280 &iEdwinFaxLineStatus); 01281 } 01282 else 01283 { 01284 TBuf<EIsvTelCallAppEdwinMaxLength> callStatusStr; 01285 switch (aCallStatus.iStatus) 01286 { 01287 case CTelephony::EStatusUnknown: 01288 { 01289 callStatusStr.Copy(iUnknownStr); 01290 } 01291 break; 01292 case CTelephony::EStatusIdle: 01293 { 01294 callStatusStr.Copy(iIdleStr); 01295 } 01296 break; 01297 case CTelephony::EStatusDialling: 01298 { 01299 callStatusStr.Copy(iDiallingStr); 01300 } 01301 break; 01302 case CTelephony::EStatusRinging: 01303 { 01304 callStatusStr.Copy(iRingingStr); 01305 } 01306 break; 01307 case CTelephony::EStatusAnswering: 01308 { 01309 callStatusStr.Copy(iAnsweringStr); 01310 } 01311 break; 01312 case CTelephony::EStatusConnecting: 01313 { 01314 callStatusStr.Copy(iConnectingStr); 01315 } 01316 break; 01317 case CTelephony::EStatusConnected: 01318 { 01319 callStatusStr.Copy(iConnectedStr); 01320 } 01321 break; 01322 case CTelephony::EStatusReconnectPending: 01323 { 01324 callStatusStr.Copy(iReconnectPendingStr); 01325 } 01326 break; 01327 case CTelephony::EStatusDisconnecting: 01328 { 01329 callStatusStr.Copy(iDisconnectingStr); 01330 } 01331 break; 01332 case CTelephony::EStatusHold: 01333 { 01334 callStatusStr.Copy(iHoldStr); 01335 } 01336 break; 01337 case CTelephony::EStatusTransferring: 01338 { 01339 callStatusStr.Copy(iTransferringStr); 01340 } 01341 break; 01342 case CTelephony::EStatusTransferAlerting: 01343 { 01344 callStatusStr.Copy(iTransferAlertingStr); 01345 } 01346 break; 01347 default: 01348 { 01349 callStatusStr.Copy(iErrString); 01350 } 01351 break; 01352 } 01353 //Update Line status to UI 01354 iEdwinFaxLineStatus.Copy(callStatusStr); 01355 SetEdwinTextL((TInt)EIsvTelCallAppDlgCtrlIdFaxLineStatus, 01356 &iEdwinFaxLineStatus); 01357 } 01358 } 01359 01360 // ---------------------------------------------------------------------------- 01361 // CIsvTelCallAppDlg::SendDTMFApiCompleteL() 01362 // Command completion routine called from the CIsvTelCallAppTelephony class 01363 // once the request to Send a DTMF string is complete 01364 // ---------------------------------------------------------------------------- 01365 // 01366 void CIsvTelCallAppDlg::SendDTMFApiCompleteL(TInt aStatus, TDesC16& aErrMsg) 01367 { 01368 01369 if (aStatus != KErrNone) 01370 { 01371 TBuf<KMaxErrMsgSize> errNoteMsg; 01372 errNoteMsg.Copy(aErrMsg); 01373 CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; 01374 errorNote->ExecuteLD(errNoteMsg); 01375 } 01376 } 01377 01378 // ---------------------------------------------------------------------------- 01379 // CIsvTelCallAppDlg::AnswerIncomingCallApiCompleteL() 01380 // Command completion routine called from the CIsvTelCallAppTelephony class 01381 // once the request to Get Id Service status is complete 01382 // ---------------------------------------------------------------------------- 01383 // 01384 void CIsvTelCallAppDlg::AnswerIncomingCallApiCompleteL( 01385 TInt aStatus, 01386 const CTelephony::TCallId aCallId, 01387 TDesC16& aErrMsg) 01388 { 01389 if (aStatus == KErrNone) 01390 { 01391 // Getting Call Status here, just to display on Dialog 01392 TInt retCode; 01393 retCode = iAnswerInCallTelephony->iTel->GetCallStatus( aCallId, 01394 iAnswerInCallTelephony->iCallStatusPckg ); 01395 01396 //Find the type of error message and store in errMsgBuffer. 01397 TBuf16<KMaxErrMsgSize> errMsgBuffer; 01398 errMsgBuffer.Copy(aErrMsg); 01399 iAnswerInCallTelephony->GeneralErrorMessage( retCode, &errMsgBuffer ); 01400 01401 GetCallStatusCompleteL( retCode, 01402 aCallId, 01403 iAnswerInCallTelephony->iCallStatus, 01404 errMsgBuffer); 01405 01406 if((TInt)aCallId == CTelephony::EISVCall1 ) 01407 { 01408 //Writing Incoming Call1 on dialog 01409 SetEdwinTextL((TInt) EIsvTelCallAppDlgCtrlIdPhone1, 01410 &iAnswerInCallPhNum1); 01411 // Registering here to update dialog fields, based on this 01412 // answered call 01413 iCall1StatusAsyncTelephony->RegisterForAsyncNotification( 01414 CTelephony::EOwnedCall1StatusChange); 01415 } 01416 else 01417 { 01418 //Writing Incoming Call2 on dialog 01419 SetEdwinTextL((TInt) EIsvTelCallAppDlgCtrlIdPhone2, 01420 &iAnswerInCallPhNum2); 01421 iCall2StatusAsyncTelephony->RegisterForAsyncNotification( 01422 CTelephony::EOwnedCall2StatusChange); 01423 } 01424 } 01425 } 01426 01427 // ---------------------------------------------------------------------------- 01428 // CIsvTelCallAppDlg::CIsvTelCallAppDlg() 01429 // Default constructor. 01430 // ---------------------------------------------------------------------------- 01431 // 01432 CIsvTelCallAppDlg::CIsvTelCallAppDlg() 01433 { 01434 } 01435 01436 // ---------------------------------------------------------------------------- 01437 // CIsvTelCallAppDlg::ConstructL() 01438 // Second-phase constructor. 01439 // ---------------------------------------------------------------------------- 01440 // 01441 void CIsvTelCallAppDlg::ConstructL() 01442 { 01443 iTitlePane = NULL; 01444 01445 iIsAnswerInCall = ETrue; 01446 01447 //Load strings from resource 01448 LoadStringsFromResource(); 01449 01450 CAknForm::ConstructL(); 01451 01452 // Create the telephony object for execution from GUI 01453 iTelephony = CIsvTelCallAppTelephony::NewL(*this); 01454 iAnswerInCallTelephony = CIsvTelCallAppTelephony::NewL(*this); 01455 iVoiceLineAsyncTelephony = CIsvTelCallAppTelephony::NewL(*this); 01456 iCall1StatusAsyncTelephony = CIsvTelCallAppTelephony::NewL(*this); 01457 iCall2StatusAsyncTelephony = CIsvTelCallAppTelephony::NewL(*this); 01458 01459 #ifdef __WINS__ 01460 01461 #else 01462 iTelephony->CreateTelephonyPtrL(); 01463 01464 iAnswerInCallTelephony->SetTelephonyPtr(iTelephony->GetTelephonyPtr()); 01465 01466 iVoiceLineAsyncTelephony->SetTelephonyPtr( 01467 iTelephony->GetTelephonyPtr()); 01468 iVoiceLineAsyncTelephony->RegisterForAsyncNotification( 01469 CTelephony::EVoiceLineStatusChange ); 01470 01471 iCall1StatusAsyncTelephony->SetTelephonyPtr( 01472 iTelephony->GetTelephonyPtr()); 01473 01474 iCall2StatusAsyncTelephony->SetTelephonyPtr( 01475 iTelephony->GetTelephonyPtr()); 01476 #endif 01477 01478 //Initilalise the delimiter string 01479 _LIT8(KSpaceStr," "); 01480 iDelimiterStr.Copy(KSpaceStr); 01481 01482 //Initialise the new line string 01483 _LIT8(KNewLineStr,"\n"); 01484 iNewLineStr.Format(KNewLineStr); 01485 } 01486 01487 // ---------------------------------------------------------------------------- 01488 // CIsvTelCallAppDlg::PostLayoutDynInitL() 01489 // An over-riding routine which Initialises values to certain default fields 01490 // Also calls the base-class routine 01491 // ---------------------------------------------------------------------------- 01492 // 01493 void CIsvTelCallAppDlg::PostLayoutDynInitL() 01494 { 01495 //Call the base class routine 01496 CAknForm::PostLayoutDynInitL(); 01497 01498 //Set edit mode to false 01499 iIsInEditMode = EFalse; 01500 } 01501 01502 // ---------------------------------------------------------------------------- 01503 // CIsvTelCallAppDlg::QuerySaveChangesL() 01504 // Show save query. If user answers "No" to this query. 01505 // return field value to the value which is before editing. 01506 // This is called Back-softkey when edit mode. 01507 // ---------------------------------------------------------------------------- 01508 // 01509 TBool CIsvTelCallAppDlg::QuerySaveChangesL() 01510 { 01511 TBool isAnsYes(CAknForm::QuerySaveChangesL()); 01512 01513 if (isAnsYes) 01514 { 01515 SaveFormDataL(); 01516 } 01517 else 01518 { 01519 // Case that answer "No" to query. 01520 DoNotSaveFormDataL(); 01521 } 01522 return isAnsYes; 01523 } 01524 01525 // ---------------------------------------------------------------------------- 01526 // CIsvTelCallAppDlg::SaveFormDataL() 01527 // Save form data. 01528 // ---------------------------------------------------------------------------- 01529 // 01530 TBool CIsvTelCallAppDlg::SaveFormDataL() 01531 { 01532 GetEdwinText(iEdwinPhone1, EIsvTelCallAppDlgCtrlIdPhone1); 01533 GetEdwinText(iEdwinPhone2, EIsvTelCallAppDlgCtrlIdPhone2); 01534 GetEdwinText(iEdwinDtmfSeq1, EIsvTelCallAppDlgCtrlIdDtmfSeq1); 01535 GetEdwinText(iEdwinDtmfSeq2, EIsvTelCallAppDlgCtrlIdDtmfSeq2); 01536 01537 //Set edit mode to false 01538 iIsInEditMode = EFalse; 01539 return ETrue; 01540 } 01541 01542 // ---------------------------------------------------------------------------- 01543 // CIsvTelCallAppDlg::DoNotSaveFormDataL() 01544 // Does not save form data. 01545 // ---------------------------------------------------------------------------- 01546 // 01547 void CIsvTelCallAppDlg::DoNotSaveFormDataL() 01548 { 01549 SetEdwinTextL(EIsvTelCallAppDlgCtrlIdPhone1, &iEdwinPhone1); 01550 SetEdwinTextL(EIsvTelCallAppDlgCtrlIdPhone2, &iEdwinPhone2); 01551 SetEdwinTextL(EIsvTelCallAppDlgCtrlIdDtmfSeq1, &iEdwinDtmfSeq1); 01552 SetEdwinTextL(EIsvTelCallAppDlgCtrlIdDtmfSeq2, &iEdwinDtmfSeq2); 01553 01554 //Set edit mode to false 01555 iIsInEditMode = EFalse; 01556 } 01557 01558 // ---------------------------------------------------------------------------- 01559 // CIsvTelCallAppDlg::LoadStringsFromResource() 01560 // Loads strings from resource 01561 // ---------------------------------------------------------------------------- 01562 // 01563 void CIsvTelCallAppDlg::LoadStringsFromResource( ) 01564 { 01565 TBuf16<KMaxCmdSize> resStr; 01566 01567 //Load general error and success strings 01568 iCoeEnv->ReadResource(resStr, 01569 R_ISVTELCALLAPP_TELSTR_ERRSTRING); 01570 iErrString.Copy(resStr); 01571 01572 iCoeEnv->ReadResource(resStr, 01573 R_ISVTELCALLAPP_TELSTR_SUCCESSSTRING); 01574 iSuccessString.Copy(resStr); 01575 01576 //Load GetCallStatus strings from resource 01577 iCoeEnv->ReadResource(resStr, 01578 R_ISVTELCALLAPP_UNKNOWN); 01579 iUnknownStr.Copy(resStr); 01580 01581 iCoeEnv->ReadResource(resStr, 01582 R_ISVTELCALLAPP_CALLSTATUS_IDLE); 01583 iIdleStr.Copy(resStr); 01584 01585 iCoeEnv->ReadResource(resStr, 01586 R_ISVTELCALLAPP_CALLSTATUS_DIALLING); 01587 iDiallingStr.Copy(resStr); 01588 01589 iCoeEnv->ReadResource(resStr, 01590 R_ISVTELCALLAPP_CALLSTATUS_RINGING); 01591 iRingingStr.Copy(resStr); 01592 01593 iCoeEnv->ReadResource(resStr, 01594 R_ISVTELCALLAPP_CALLSTATUS_ANSWERING); 01595 iAnsweringStr.Copy(resStr); 01596 01597 iCoeEnv->ReadResource(resStr, 01598 R_ISVTELCALLAPP_CALLSTATUS_CONNECTING); 01599 iConnectingStr.Copy(resStr); 01600 01601 iCoeEnv->ReadResource(resStr, 01602 R_ISVTELCALLAPP_CALLSTATUS_CONNECTED); 01603 iConnectedStr.Copy(resStr); 01604 01605 iCoeEnv->ReadResource(resStr, 01606 R_ISVTELCALLAPP_CALLSTATUS_RECONNECTPENDING); 01607 iReconnectPendingStr.Copy(resStr); 01608 01609 iCoeEnv->ReadResource(resStr, 01610 R_ISVTELCALLAPP_CALLSTATUS_DISCONNECTING); 01611 iDisconnectingStr.Copy(resStr); 01612 01613 iCoeEnv->ReadResource(resStr, 01614 R_ISVTELCALLAPP_CALLSTATUS_HOLD); 01615 iHoldStr.Copy(resStr); 01616 01617 iCoeEnv->ReadResource(resStr, 01618 R_ISVTELCALLAPP_CALLSTATUS_TRANSFERRING); 01619 iTransferringStr.Copy(resStr); 01620 01621 iCoeEnv->ReadResource(resStr, 01622 R_ISVTELCALLAPP_CALLSTATUS_TRANSFERALERTING); 01623 iTransferAlertingStr.Copy(resStr); 01624 01625 //Answer Incoming Call Phone Number 01626 iCoeEnv->ReadResource(resStr, 01627 R_ISVTELCALLAPP_TELSTR_ANSWERINCALLPHONENUM1); 01628 iAnswerInCallPhNum1.Copy(resStr); 01629 01630 iCoeEnv->ReadResource(resStr, 01631 R_ISVTELCALLAPP_TELSTR_ANSWERINCALLPHONENUM2); 01632 iAnswerInCallPhNum2.Copy(resStr); 01633 01634 iCoeEnv->ReadResource(iEmuApiNotSupported, 01635 R_ISVTELCALLAPP_ERR_EMUAPINOTSUPPORTED); 01636 01637 return; 01638 } 01639 01640 01641 01642 //End of file
|
© Nokia 2006 |