phoneapp/phoneuivoipextension/src/cphonetransferdialercontroller.cpp
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 51 f39ed5e045e0
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
    20 #include <e32base.h>
    20 #include <e32base.h>
    21 
    21 
    22 #include <akntoolbar.h>
    22 #include <akntoolbar.h>
    23 #include <AknsItemID.h>
    23 #include <AknsItemID.h>
    24 #include <StringLoader.h>
    24 #include <StringLoader.h>
    25 
       
    26 
       
    27 // <-- QT PHONE START -->
       
    28 //#include <phoneui.mbg>
       
    29 #include "phoneresourceids.h"
    25 #include "phoneresourceids.h"
    30 //#include <phoneui.rsg>
       
    31 //#include <phoneuivoip.rsg>
       
    32 // <-- QT PHONE END -->
       
    33 
       
    34 #include "phoneui.pan"
    26 #include "phoneui.pan"
    35 #include "phonelogger.h"
    27 #include "phonelogger.h"
    36 // <-- QT PHONE START -->
       
    37 //#include "cphonebubblewrapper.h" // For KDC_APP_BITMAP_DIR
       
    38 #include <data_caging_path_literals.hrh>
    28 #include <data_caging_path_literals.hrh>
    39 // <-- QT PHONE END -->
       
    40 
       
    41 #include "cphonetransferdialercontroller.h"
    29 #include "cphonetransferdialercontroller.h"
    42 #include "cphonemainresourceresolver.h"
    30 #include "cphonemainresourceresolver.h"
    43 #include "phonerssvoip.h"
    31 #include "phonerssvoip.h"
    44 #include "phoneappcommands.hrh"
    32 #include "phoneappcommands.hrh"
    45 #include "phoneappvoipcommands.hrh"
    33 #include "phoneappvoipcommands.hrh"
    46 
    34 
    47 
    35 
    48 // CONSTANTS
    36 // CONSTANTS
    49 _LIT ( KPhoneMifFileName, "phoneui.mif" );
    37 _LIT ( KPhoneMifFileName, "phoneui.mif" );
    50 
    38 
    51 // Number of buttons 
       
    52 const TInt KButtonCount = 2;
       
    53 
       
    54 // <-- QT PHONE START -->
       
    55 /*
       
    56 class TPhoneDialerToolbarButton 
       
    57     {
       
    58 public:
       
    59     TInt iIconIndex;
       
    60     TInt iMaskIndex;
       
    61     TInt iCommandId;    
       
    62     };
       
    63 
       
    64 const TPhoneDialerToolbarButton bArray[KButtonCount] = 
       
    65         {  
       
    66             { EMbmPhoneuiQgn_indi_button_send_dtmf,
       
    67               EMbmPhoneuiQgn_indi_button_send_dtmf_mask,
       
    68               EPhoneCmdTransferDialerOk
       
    69             },
       
    70             { EMbmPhoneuiQgn_indi_dialer_contacts,
       
    71               EMbmPhoneuiQgn_indi_dialer_contacts_mask,
       
    72               EPhoneCmdTransferDialerSearch
       
    73             }                 
       
    74         };  
       
    75         
       
    76  */
       
    77 // <-- QT PHONE END -->
       
    78 // ================= MEMBER FUNCTIONS =======================
    39 // ================= MEMBER FUNCTIONS =======================
    79 
    40 
    80 // C++ default constructor can NOT contain any code, that
    41 // C++ default constructor can NOT contain any code, that
    81 // might leave.
    42 // might leave.
    82 //  
    43 //  
   124                 EAll, 
    85                 EAll, 
   125                 PhoneUIVoIPExtension, 
    86                 PhoneUIVoIPExtension, 
   126                 "Toolbar control count:=%d", 
    87                 "Toolbar control count:=%d", 
   127                 aToolbar.CountComponentControls());
    88                 aToolbar.CountComponentControls());
   128         iToolbar = &aToolbar;
    89         iToolbar = &aToolbar;
   129         // Create transfer specific buttons and add them to the 
       
   130         // toolbar starting from index 0
       
   131  // <-- QT PHONE START --> 
       
   132         //CAknButton* button( NULL );
       
   133   
       
   134  /*
       
   135         for( TInt i = 0; i < KButtonCount; i++ )
       
   136             {
       
   137            
       
   138             TAknsItemID skinId = SkinId( bArray[i].iIconIndex );
       
   139             // Load tooltip text.
       
   140             HBufC* tooltipText = GetTooltipTextL( bArray[i].iCommandId );  
       
   141             CleanupStack::PushL( tooltipText );
       
   142             button = CreateButtonLC(
       
   143                     bArray[i].iIconIndex, 
       
   144                     bArray[i].iMaskIndex, 
       
   145                     *tooltipText, 
       
   146                     skinId );
       
   147             // Toolbar takes ownership of the button                    
       
   148             iToolbar->AddItemL( button, EAknCtButton, bArray[i].iCommandId, 0, i );
       
   149             CleanupStack::Pop( button );
       
   150             CleanupStack::PopAndDestroy( tooltipText );
       
   151             } 
       
   152             */
       
   153  // <-- QT PHONE END -->        
       
   154         iIsInitialized = ETrue;
    90         iIsInitialized = ETrue;
   155         }
    91         }
   156    
    92    
   157     iNumberEntryIsEmpty = ETrue;
    93     iNumberEntryIsEmpty = ETrue;
   158     }
    94     }
   222 void CPhoneTransferDialerController::ShowButtons( TBool aShow )
   158 void CPhoneTransferDialerController::ShowButtons( TBool aShow )
   223     {
   159     {
   224     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   160     __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
   225         "CPhoneTransferDialerController::ShowButtons()");
   161         "CPhoneTransferDialerController::ShowButtons()");
   226     __ASSERT_DEBUG( iToolbar, Panic( EPhoneCtrlInvariant ) );
   162     __ASSERT_DEBUG( iToolbar, Panic( EPhoneCtrlInvariant ) );
   227     for( TInt i = 0; i < KButtonCount; i++ )
       
   228         {
       
   229 // <-- QT PHONE START -->   
       
   230         //iToolbar->HideItem( bArray[ i ].iCommandId, !aShow, EFalse );
       
   231         }
       
   232     if ( aShow )
   163     if ( aShow )
   233         {
   164         {
   234         iToolbar->SetItemDimmed( EPhoneCmdTransferDialerOk, ETrue, EFalse ); 
   165         iToolbar->SetItemDimmed( EPhoneCmdTransferDialerOk, ETrue, EFalse ); 
   235         iToolbar->SetItemDimmed( EPhoneCmdTransferDialerSearch, EFalse, EFalse ); 
   166         iToolbar->SetItemDimmed( EPhoneCmdTransferDialerSearch, EFalse, EFalse ); 
   236         iToolbar->SetItemDimmed( EPhoneDialerCmdClear, ETrue, EFalse ); 
   167         iToolbar->SetItemDimmed( EPhoneDialerCmdClear, ETrue, EFalse ); 
   237         }
   168         }
   238     
       
   239     //iToolbar->DrawDeferred();
       
   240 // <-- QT PHONE END --> 
       
   241     }
   169     }
   242 
   170 
   243 // ---------------------------------------------------------------------------
   171 // ---------------------------------------------------------------------------
   244 // PhoneTransferDialerController::CreateButtonLC
   172 // PhoneTransferDialerController::CreateButtonLC
   245 // ---------------------------------------------------------------------------
   173 // ---------------------------------------------------------------------------
   312 // ---------------------------------------------------------------------------
   240 // ---------------------------------------------------------------------------
   313 //    
   241 //    
   314 TAknsItemID CPhoneTransferDialerController::SkinId( TInt /*aIconIndex*/ ) const
   242 TAknsItemID CPhoneTransferDialerController::SkinId( TInt /*aIconIndex*/ ) const
   315     {
   243     {
   316     TAknsItemID skinId;
   244     TAknsItemID skinId;
   317  // <-- QT PHONE START -->
   245     skinId = KAknsIIDNone; 
   318  /*
       
   319     switch ( aIconIndex )
       
   320         {
       
   321         
       
   322         case EMbmPhoneuiQgn_indi_button_send_dtmf:
       
   323             skinId = KAknsIIDQgnIndiButtonSendDtmf;
       
   324             break;
       
   325         case EMbmPhoneuiQgn_indi_dialer_contacts:
       
   326             skinId = KAknsIIDQgnIndiDialerContacts;
       
   327             break;                     
       
   328         default:
       
   329             skinId = KAknsIIDNone;        
       
   330             break;            
       
   331         }
       
   332   */
       
   333   skinId = KAknsIIDNone; 
       
   334 // <-- QT PHONE END -->     
       
   335     return skinId;  
   246     return skinId;  
   336     }
   247     }