|
1 /* |
|
2 * Copyright (c) 2007 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: Implementation of the MNcsEmailAddressObject |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_NCSEMAILADDRESSOBJECT_H |
|
20 #define C_NCSEMAILADDRESSOBJECT_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32def.h> |
|
25 |
|
26 /** |
|
27 * The CNcsEmailAddressObject class |
|
28 */ |
|
29 NONSHARABLE_CLASS( CNcsEmailAddressObject ) : public CBase |
|
30 { |
|
31 public: // Constructors and destructor |
|
32 |
|
33 static CNcsEmailAddressObject* NewL( TBool aUserAdded ); |
|
34 static CNcsEmailAddressObject* NewL( const CNcsEmailAddressObject& aAddress ); |
|
35 static CNcsEmailAddressObject* NewL( |
|
36 const TDesC& aDisplayName, |
|
37 const TDesC& aEmailAddress ); |
|
38 |
|
39 ~CNcsEmailAddressObject(); |
|
40 |
|
41 private: // Constructors |
|
42 |
|
43 CNcsEmailAddressObject( TBool aUserAdded ); |
|
44 CNcsEmailAddressObject( const CNcsEmailAddressObject& aAddress ); |
|
45 void ConstructL(); |
|
46 void ConstructL( const CNcsEmailAddressObject& aAddress ); |
|
47 void ConstructL( |
|
48 const TDesC& aDisplayName, |
|
49 const TDesC& aEmailAddress ); |
|
50 |
|
51 public: // new functions |
|
52 |
|
53 // inlines |
|
54 inline TBool IsUserAdded() const; |
|
55 inline const TDesC& EmailAddress() const; |
|
56 inline const TDesC& DisplayName() const; |
|
57 |
|
58 /** |
|
59 * Display full means that both name and email address must be shown. |
|
60 * |
|
61 * This is the case for example when contact has multiple email |
|
62 * addresses. |
|
63 */ |
|
64 inline void SetDisplayFull( TBool aDisplayFull ); |
|
65 inline TBool DisplayFull() const; |
|
66 |
|
67 void SetEmailAddressL( const TDesC& aEmailAddress ); |
|
68 void SetDisplayNameL ( const TDesC& aGivenName, const TDesC& aFamilyName); |
|
69 void SetDisplayNameL( const TDesC& aName ); |
|
70 const TDesC& FormattedAddressL(); |
|
71 |
|
72 private: // new functions |
|
73 |
|
74 void GenerateFormattedAddressL(); |
|
75 |
|
76 private: // Data |
|
77 |
|
78 //Own: |
|
79 HBufC* iEmailAddress; |
|
80 HBufC* iDisplayName; |
|
81 HBufC* iFormattedAddress; |
|
82 TBool iDirtyFlag; |
|
83 TBool iUserAdded; |
|
84 TBool iDisplayFull; |
|
85 }; |
|
86 |
|
87 #include "ncsemailaddressobject.inl" |
|
88 |
|
89 #endif // C_NCSEMAILADDRESSOBJECT_H |
|
90 |
|
91 // End of file |