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