phonebookui/Phonebook/View/src/CPbkPocAddressSelect.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 *           Phonebook generic address selection dialog class methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include    "CPbkPocAddressSelect.h"
       
    23 #include    <avkon.hrh> // AVKON softkey codes
       
    24 #include    <avkon.rsg> // R_AVKON_SOFTKEYS_SELECT_CANCEL;
       
    25 #include    <aknnotewrappers.h>
       
    26 #include    <StringLoader.h>        // StringLoader
       
    27 #include    <PbkView.rsg>
       
    28 #include    <CPbkFieldInfo.h>
       
    29 #include    <CPbkContactItem.h>
       
    30 
       
    31 
       
    32 // ================= MEMBER FUNCTIONS =======================
       
    33 
       
    34 EXPORT_C CPbkPocAddressSelect::TParams::TParams
       
    35         (const CPbkContactItem& aContact) :
       
    36     TBaseParams(aContact, aContact.DefaultPocField())
       
    37     {    
       
    38     }
       
    39 
       
    40 EXPORT_C CPbkPocAddressSelect::CPbkPocAddressSelect()
       
    41     {
       
    42     }
       
    43 
       
    44 EXPORT_C TBool CPbkPocAddressSelect::ExecuteLD(TParams& aParams)
       
    45     {
       
    46     return CPbkAddressSelect::ExecuteLD(aParams);
       
    47     }
       
    48 
       
    49 EXPORT_C CPbkPocAddressSelect::~CPbkPocAddressSelect()
       
    50 	{
       
    51     delete iQueryTitle;
       
    52 	}
       
    53 
       
    54 EXPORT_C TBool CPbkPocAddressSelect::AddressField(const TPbkContactItemField& aField) const
       
    55     {
       
    56     // Return true for non-empty phonenumber and poc fields
       
    57     return (aField.FieldInfo().IsPocField() && !aField.IsEmptyOrAllSpaces());
       
    58     }
       
    59 
       
    60 EXPORT_C void CPbkPocAddressSelect::NoAddressesL()
       
    61     {
       
    62     HBufC* title = ContactItem().GetContactTitleOrNullL();
       
    63     if (title)
       
    64         {
       
    65         CleanupStack::PushL(title);
       
    66         HBufC* prompt = StringLoader::LoadLC(R_QTN_PHOB_NOTE_NO_POC_TO_NAME, *title);
       
    67         CAknInformationNote* noteDlg = new(ELeave) CAknInformationNote;
       
    68         noteDlg->ExecuteLD(*prompt);
       
    69         CleanupStack::PopAndDestroy(2); // prompt, title
       
    70         }
       
    71     else
       
    72         {
       
    73         CAknNoteWrapper * noteDlg = new(ELeave) CAknNoteWrapper;
       
    74         noteDlg->ExecuteLD(R_QTN_PHOB_NOTE_NO_POC);
       
    75         }
       
    76     }
       
    77 
       
    78 EXPORT_C const TDesC& CPbkPocAddressSelect::QueryTitleL()
       
    79     {
       
    80     if (!iQueryTitle)
       
    81         {
       
    82         iQueryTitle = ContactItem().GetContactTitleL();
       
    83         }
       
    84     return *iQueryTitle;
       
    85     }
       
    86 
       
    87 EXPORT_C TInt CPbkPocAddressSelect::QuerySoftkeysResource() const
       
    88     {
       
    89     return R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT;
       
    90     }
       
    91 
       
    92 
       
    93 //  End of File