|
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 "CPbkVoipAddressSelect.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 CPbkVoipAddressSelect::TParams::TParams |
|
35 (const CPbkContactItem& aContact) : |
|
36 TBaseParams(aContact, aContact.DefaultVoipField()) |
|
37 { |
|
38 } |
|
39 |
|
40 EXPORT_C CPbkVoipAddressSelect::CPbkVoipAddressSelect() |
|
41 { |
|
42 } |
|
43 |
|
44 EXPORT_C TBool CPbkVoipAddressSelect::ExecuteLD(TParams& aParams) |
|
45 { |
|
46 return CPbkAddressSelect::ExecuteLD(aParams); |
|
47 } |
|
48 |
|
49 EXPORT_C CPbkVoipAddressSelect::~CPbkVoipAddressSelect() |
|
50 { |
|
51 delete iQueryTitle; |
|
52 } |
|
53 |
|
54 EXPORT_C TBool CPbkVoipAddressSelect::AddressField(const TPbkContactItemField& aField) const |
|
55 { |
|
56 // Return true for non-empty phonenumber and voip fields |
|
57 return (aField.FieldInfo().IsVoipField() && !aField.IsEmptyOrAllSpaces()); |
|
58 } |
|
59 |
|
60 EXPORT_C void CPbkVoipAddressSelect::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_VOIP_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_VOIP); |
|
75 } |
|
76 } |
|
77 |
|
78 EXPORT_C const TDesC& CPbkVoipAddressSelect::QueryTitleL() |
|
79 { |
|
80 if (!iQueryTitle) |
|
81 { |
|
82 iQueryTitle = ContactItem().GetContactTitleL(); |
|
83 } |
|
84 return *iQueryTitle; |
|
85 } |
|
86 |
|
87 EXPORT_C TInt CPbkVoipAddressSelect::QuerySoftkeysResource() const |
|
88 { |
|
89 return R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; |
|
90 } |
|
91 |
|
92 |
|
93 // End of File |