1 /* |
|
2 * Copyright (c) 2006, 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: s_enginecontmgtextfeatures.cpp |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CVPBKCONTACTLINKSTUB_H |
|
19 #define CVPBKCONTACTLINKSTUB_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <MVPbkContactLink.h> |
|
23 #include <CVPbkContactLinkArray.h> |
|
24 |
|
25 // CLASS DECLARATIONS |
|
26 |
|
27 /** |
|
28 * Virtual Phonebook Contact link. |
|
29 * An object that uniquely identifies a single Contact and its ContactStore. |
|
30 */ |
|
31 class CVPbkContactLinkStub : public MVPbkContactLink |
|
32 { |
|
33 public: // destructor |
|
34 /** |
|
35 * Destructor. |
|
36 */ |
|
37 |
|
38 public: // interface |
|
39 static MVPbkContactLink* NewL(); |
|
40 /** |
|
41 * Returns the contact store which this link belongs to. |
|
42 * @return Contact store associated with this link. |
|
43 */ |
|
44 MVPbkContactStore& ContactStore() const ; |
|
45 |
|
46 /** |
|
47 * Returns ETrue if this link refers to the same contact than |
|
48 * aOther, EFalse otherwise. |
|
49 * @param aOther Contact to check equality for. |
|
50 * @return ETrue if this link refers to the same contact than |
|
51 * aOther, EFalse otherwise. |
|
52 */ |
|
53 TBool IsSame(const MVPbkContactLink& aOther) const ; |
|
54 |
|
55 /** |
|
56 * Checks if this link refers to the contact aContact. |
|
57 * @param aContact Contact to check. |
|
58 * @return ETrue if this link refers to aContact, EFalse otherwise. |
|
59 */ |
|
60 TBool RefersTo(const MVPbkBaseContact& aContact) const ; |
|
61 |
|
62 /** |
|
63 * Returns persistent streaming interface for this object, or NULL |
|
64 * if persistent streaming is not supported. |
|
65 * @return Persistent streaming object or NULL if not supported. |
|
66 */ |
|
67 const MVPbkStreamable* Streamable() const ; |
|
68 |
|
69 /** |
|
70 * Returns a packing interface for this link. |
|
71 * @see CVPbkContactLinkArray |
|
72 * @internal |
|
73 * @return Link packing object. |
|
74 */ |
|
75 const MVPbkContactLinkPacking& Packing() const ; |
|
76 |
|
77 /** |
|
78 * Returns a clone of this contact link. |
|
79 * @return Contact link copy. |
|
80 */ |
|
81 MVPbkContactLink* CloneLC() const ; |
|
82 |
|
83 // INLINE FUNCTIONS |
|
84 inline HBufC8* CVPbkContactLinkStub::PackLC() |
|
85 { |
|
86 |
|
87 CVPbkContactLinkArray* array = CVPbkContactLinkArray::NewLC(); |
|
88 MVPbkContactLink* clone = CloneLC(); |
|
89 array->AppendL(clone); |
|
90 CleanupStack::Pop(); // clone |
|
91 HBufC8* packed = array->PackLC(); |
|
92 CleanupStack::Pop(); // packed |
|
93 CleanupStack::PopAndDestroy(); // array |
|
94 CleanupStack::PushL(packed); |
|
95 return packed; |
|
96 } |
|
97 |
|
98 }; |
|
99 |
|
100 |
|
101 |
|
102 #endif // CVPBKCONTACTLINKSTUB_H |
|
103 |
|
104 // End of File |
|