phonebookui/Phonebook/View/src/CPbkPhoneNumberSelect.cpp
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *       Provides methods for phonebook call number selection dialog.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include    "CPbkPhoneNumberSelect.h"
       
    23 #include    <avkon.hrh>         // AVKON softkey codes
       
    24 #include    <aknnotewrappers.h> // AVKON Notes
       
    25 #include    <StringLoader.h>    // StringLoader
       
    26 #include    <PbkView.rsg>               // PbkView resources
       
    27 #include    <CPbkContactItem.h>
       
    28 
       
    29 
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 EXPORT_C CPbkPhoneNumberSelect::CPbkPhoneNumberSelect()
       
    33     {
       
    34     // CBase::operator new(TLeave) resets member data
       
    35     }
       
    36 
       
    37 EXPORT_C CPbkPhoneNumberSelect::TParams::TParams
       
    38         (const CPbkContactItem& aContact) :
       
    39         TBaseParams(aContact,
       
    40         aContact.DefaultPhoneNumberField() )
       
    41     {
       
    42     }
       
    43 
       
    44 EXPORT_C TBool CPbkPhoneNumberSelect::ExecuteLD(TParams& aParams)
       
    45     {
       
    46     return CPbkAddressSelect::ExecuteLD(aParams);
       
    47     }
       
    48 
       
    49 EXPORT_C CPbkPhoneNumberSelect::~CPbkPhoneNumberSelect()
       
    50 	{
       
    51     delete iQueryTitle;
       
    52 	}
       
    53 
       
    54 /**
       
    55  * Makes phone number query return selection if Call key is pressed.
       
    56  */ 
       
    57 EXPORT_C TKeyResponse CPbkPhoneNumberSelect::PbkControlKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
       
    58     {
       
    59     if (aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend)
       
    60         {
       
    61         // Event is Send key, tell field selection dialog to accept current selection
       
    62         AttemptExitL(ETrue);
       
    63         return EKeyWasConsumed;
       
    64         }
       
    65     return EKeyWasNotConsumed;
       
    66     }
       
    67 
       
    68 EXPORT_C const TDesC& CPbkPhoneNumberSelect::QueryTitleL()
       
    69     {
       
    70     if (!iQueryTitle)
       
    71         {
       
    72         HBufC* title = ContactItem().GetContactTitleL();
       
    73         CleanupStack::PushL(title);
       
    74         iQueryTitle = StringLoader::LoadL(R_QTN_PHOB_QTL_CALL_TO_NAME, *title);
       
    75         CleanupStack::PopAndDestroy(title);
       
    76         }
       
    77     return *iQueryTitle;
       
    78     }
       
    79 
       
    80 EXPORT_C TInt CPbkPhoneNumberSelect::QuerySoftkeysResource() const
       
    81     {
       
    82     return R_PBK_SOFTKEYS_CALL_CANCEL;
       
    83     }
       
    84 
       
    85 
       
    86 //  End of File