|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CVIEWCONTACTEXTENSION_H__ |
|
17 #define __CVIEWCONTACTEXTENSION_H__ |
|
18 |
|
19 // System includes |
|
20 #include <e32std.h> |
|
21 #include <s32mem.h> |
|
22 |
|
23 /** |
|
24 * BC Extension class for CViewContact. |
|
25 */ |
|
26 NONSHARABLE_CLASS(CViewContactExtension) : public CBase |
|
27 { |
|
28 public: |
|
29 static CViewContactExtension* NewL(TInt aLength = 0); |
|
30 ~CViewContactExtension(); |
|
31 |
|
32 public: |
|
33 inline void SetLengthZero(); |
|
34 inline const TDesC& FieldText() const; |
|
35 inline void SetFieldText(HBufC* aFieldText); |
|
36 inline void CreateEmptyFieldTextL(); |
|
37 void AppendToFieldTextL(const TDesC& aField); |
|
38 |
|
39 // |
|
40 inline TInt& HintBitField(); |
|
41 inline TInt HintBitField() const; |
|
42 inline TUid ContactTypeUid() const; |
|
43 inline void SetContactTypeUid(TUid aUid); |
|
44 private: |
|
45 CViewContactExtension(); |
|
46 void ConstructL(TInt aLength); |
|
47 |
|
48 private: |
|
49 HBufC* iFieldTextBuf; |
|
50 TInt iHintBitField; |
|
51 TUid iContactTypeUid; |
|
52 }; |
|
53 |
|
54 |
|
55 // Inlines |
|
56 inline void CViewContactExtension::SetLengthZero() |
|
57 { |
|
58 if(iFieldTextBuf) |
|
59 { |
|
60 iFieldTextBuf->Des().SetLength(0); |
|
61 } |
|
62 } |
|
63 inline const TDesC& CViewContactExtension::FieldText() const |
|
64 { |
|
65 if (iFieldTextBuf) |
|
66 return *iFieldTextBuf; |
|
67 return KNullDesC; |
|
68 } |
|
69 inline void CViewContactExtension::SetFieldText(HBufC* aFieldTextBuf) |
|
70 { |
|
71 delete iFieldTextBuf; |
|
72 iFieldTextBuf = aFieldTextBuf; |
|
73 } |
|
74 inline void CViewContactExtension::CreateEmptyFieldTextL() |
|
75 { |
|
76 HBufC* nullBuf = KNullDesC().AllocL(); |
|
77 SetFieldText(nullBuf); |
|
78 } |
|
79 inline TInt& CViewContactExtension::HintBitField() |
|
80 { |
|
81 return iHintBitField; |
|
82 } |
|
83 inline TInt CViewContactExtension::HintBitField() const |
|
84 { |
|
85 return iHintBitField; |
|
86 } |
|
87 |
|
88 inline TUid CViewContactExtension::ContactTypeUid() const |
|
89 {return iContactTypeUid;} |
|
90 |
|
91 inline void CViewContactExtension::SetContactTypeUid(TUid aUid) |
|
92 {iContactTypeUid = aUid;} |
|
93 |
|
94 #endif |