|
1 /* |
|
2 * Copyright (c) 2005 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 * Helper class for recipient/phonebook handling |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __POSTCARDRECIPIENTWRAPPER_H |
|
22 #define __POSTCARDRECIPIENTWRAPPER_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // MACROS |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CPostcardAppUi; |
|
32 class CPostcardContact; |
|
33 class CPostcardDocument; |
|
34 |
|
35 // DATA TYPES |
|
36 |
|
37 // FUNCTION PROTOTYPES |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * CPostcardRecipientWrapper |
|
43 * |
|
44 * @lib postcard.exe |
|
45 * @since 3.0 |
|
46 */ |
|
47 class CPostcardRecipientWrapper : public CBase |
|
48 { |
|
49 public: // New methods |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 ~CPostcardRecipientWrapper(); |
|
55 |
|
56 /** |
|
57 * C++ constructor |
|
58 * @param |
|
59 */ |
|
60 CPostcardRecipientWrapper( |
|
61 CPostcardDocument& aDocument, |
|
62 CPostcardAppUi& aAppUi, |
|
63 CPostcardContact& aContact |
|
64 ); |
|
65 |
|
66 /** |
|
67 * Factory function to create this object |
|
68 * @param aApp |
|
69 */ |
|
70 static CPostcardRecipientWrapper* NewL( |
|
71 CPostcardDocument& aDocument, |
|
72 CPostcardAppUi& aAppUi, |
|
73 CPostcardContact& aContact |
|
74 ); |
|
75 |
|
76 /** |
|
77 * The only real public function. |
|
78 * The function is given a contact item id as a parameter. |
|
79 * If the contact item has only one location of addresses filled |
|
80 * (default, home, work), that is returned in aLocation. |
|
81 * If more than 1 are filled, user is shown a query dialog where user |
|
82 * can choose which address location (s)he wants to use. This location is |
|
83 * returned in aLocation. |
|
84 * @param aId IN the id of the contact item in question |
|
85 * @param aLocation OUT the location user chose |
|
86 * @return TBool aLocation is valid only if function returns ETRue |
|
87 * if user chose cancel in the dialog -> EFalse is returned |
|
88 */ |
|
89 TBool AskLocationL( CPostcardContact::TLocation& aLocation ); |
|
90 |
|
91 private: // Own methods |
|
92 |
|
93 /** |
|
94 * Formats the address strings suitable for CAknSingleHeadingPopupMenuStyleListBox. |
|
95 */ |
|
96 HBufC* GetFormattedStringL( CPostcardContact::TLocation aAddressLocation ); |
|
97 |
|
98 /** |
|
99 * 2nd phase Constructor. |
|
100 */ |
|
101 void ConstructL( ); |
|
102 |
|
103 private: // data |
|
104 |
|
105 CPostcardDocument& iDocument; |
|
106 CPostcardAppUi& iAppUi; |
|
107 CPostcardContact& iContact; |
|
108 }; |
|
109 |
|
110 #endif // __POSTCARDRECIPIENTWRAPPER_H |