|
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: Definition of the class CPbkxRclProtocolResultImpl. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBKXRCLPROTOCOLRESULTIMPL_H |
|
20 #define CPBKXRCLPROTOCOLRESULTIMPL_H |
|
21 |
|
22 #include "cpbkxremotecontactlookupprotocolresult.h" |
|
23 |
|
24 /** |
|
25 * Class that holds remote contact search results. |
|
26 * |
|
27 * @lib pbkxengine.lib |
|
28 * @since S60 3.1 |
|
29 */ |
|
30 class CPbkxRclProtocolResultImpl : public CPbkxRemoteContactLookupProtocolResult |
|
31 { |
|
32 public: // constructors and destructor |
|
33 |
|
34 /** |
|
35 * Two-phased constructor. |
|
36 * |
|
37 * @param aIsComplete Flag indicating whether result is complete or not. |
|
38 * @param aContactItem Result contact item. |
|
39 * @param aExtraProtocolData Extra protocol specific data. |
|
40 * @return Create object. |
|
41 */ |
|
42 static CPbkxRclProtocolResultImpl* NewL( |
|
43 TBool aIsComplete, |
|
44 CContactItem& aContactItem, |
|
45 const TDesC& aExtraProtocolData ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * |
|
50 * Leaves pointer to the created object on cleanupstack. |
|
51 * |
|
52 * @param aIsComplete Flag indicating whether result is complete or not. |
|
53 * @param aContactItem Result contact item. |
|
54 * @param aExtraProtocolData Extra protocol specific data. |
|
55 * @return Create object. |
|
56 */ |
|
57 static CPbkxRclProtocolResultImpl* NewLC( |
|
58 TBool aIsComplete, |
|
59 CContactItem& aContactItem, |
|
60 const TDesC& aExtraProtocolData ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CPbkxRclProtocolResultImpl(); |
|
66 |
|
67 public: // methods from CPbkxRemoteContactLookupProtocolResult |
|
68 |
|
69 /** |
|
70 * Is the search result complete or do we need a second phase? |
|
71 * |
|
72 * @return ETrue if the search result is complete. |
|
73 */ |
|
74 virtual TBool IsComplete() const; |
|
75 |
|
76 /** |
|
77 * Sets result as complete. |
|
78 * |
|
79 * This means that result now contains all possible fields and no more |
|
80 * fields can be retrieved. |
|
81 */ |
|
82 virtual void Complete(); |
|
83 |
|
84 /** |
|
85 * Returns extra protocol data need for mapping contact item to protocol |
|
86 * level entries. |
|
87 * |
|
88 * @return extra protocol data |
|
89 */ |
|
90 virtual const TDesC& ExtraProtocolData() const; |
|
91 |
|
92 /** |
|
93 * Returns contact item. |
|
94 * |
|
95 * @return contact item |
|
96 */ |
|
97 virtual CContactItem& ContactItem(); |
|
98 |
|
99 private: // constructor |
|
100 |
|
101 /** |
|
102 * Constructor. |
|
103 * |
|
104 * @param aIsComplete Flag indicating whether result is complete or not. |
|
105 * @param aContactItem Result contact item. |
|
106 */ |
|
107 CPbkxRclProtocolResultImpl( TBool aIsComplete, CContactItem& aContactItem ); |
|
108 |
|
109 /** |
|
110 * Second-phase constructor. |
|
111 * |
|
112 * @param aExtraProtocolData Extra protocol data. |
|
113 */ |
|
114 void ConstructL( const TDesC& aExtraProtocolData ); |
|
115 |
|
116 private: // data |
|
117 |
|
118 // Flag indicating whether result is complete or not. |
|
119 // If result is not complete, second-phase search is needed. |
|
120 TBool iIsComplete; |
|
121 |
|
122 // Result contact item. Not owned. |
|
123 CContactItem* iContactItem; |
|
124 |
|
125 // Extra protocol data. |
|
126 RBuf iExtraProtocolData; |
|
127 |
|
128 }; |
|
129 |
|
130 #endif |