|
1 /* |
|
2 * Copyright (c) 2008 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: Contact list container implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MVIMPSTSTORAGECONTACTLIST_H |
|
21 #define MVIMPSTSTORAGECONTACTLIST_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "tvimpstenums.h" |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MVIMPSTStorageContact; |
|
30 class MVPbkContactLink; |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Contact list data interface |
|
35 * |
|
36 * @lib vimpststorage.dll |
|
37 * @since 5.0 |
|
38 */ |
|
39 class MVIMPSTStorageContactList |
|
40 { |
|
41 public: // Definitions |
|
42 /** |
|
43 * An Enum |
|
44 * to define the sync state of the contact list. |
|
45 * not used. |
|
46 */ |
|
47 enum TSynchroniseState |
|
48 { |
|
49 ESynchroniseNotDone, /* sync not done */ |
|
50 ESynchroniseDone, /* sync done */ |
|
51 ESynchroniseFailed /* sync failed. */ |
|
52 }; |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * List id of contact list |
|
58 * @return TDesC& List id of contact list. |
|
59 */ |
|
60 virtual const TDesC& ListId() const = 0; |
|
61 |
|
62 /** |
|
63 * Displayname of contact list |
|
64 * @return TPtrC Display name of list. |
|
65 * If displayname is not set, Id part of list id is returned. |
|
66 */ |
|
67 virtual TPtrC DisplayName() const = 0; |
|
68 |
|
69 |
|
70 /** |
|
71 * Count of items in list |
|
72 * @return count of contacts. |
|
73 */ |
|
74 virtual TInt Count() const = 0; |
|
75 |
|
76 /** |
|
77 * Get list item by index from list. |
|
78 * @param aIndex. Index of item. |
|
79 * @return MVIMPSTStorageContact& Contact in index. |
|
80 */ |
|
81 virtual MVIMPSTStorageContact& operator[]( TInt aIndex ) const = 0; |
|
82 |
|
83 /** |
|
84 * Get Filtered list item by index from list |
|
85 * @param aIndex. Index of Filtered item. |
|
86 * @param aFilter. Filters the contacts according to this filter. |
|
87 * @return MVIMPSTStorageContact& contact in index upon the filter. |
|
88 */ |
|
89 virtual MVIMPSTStorageContact& FilteredContact( |
|
90 TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const = 0; |
|
91 |
|
92 /** |
|
93 * Count of non-blocked items in list |
|
94 * @return TInt count of non-blocked contacts |
|
95 */ |
|
96 virtual TInt FilteredCount( TVIMPSTEnums::TFilterType aFilter ) const = 0; |
|
97 |
|
98 /** |
|
99 * Sort the contact list |
|
100 */ |
|
101 virtual void Sort()= 0; |
|
102 |
|
103 /** |
|
104 * Find index of contact in list. |
|
105 * @param aContact. Contact item to be found. |
|
106 * @param aFilter. Filters the contacts according to this filter. |
|
107 * @return TInt index of contact or KErrNotFound, if contact is not found. |
|
108 */ |
|
109 virtual TInt FindIndexOfContact( |
|
110 const MVIMPSTStorageContact* aContact, |
|
111 TVIMPSTEnums::TFilterType aFilter = |
|
112 TVIMPSTEnums::EFilterAll ) const = 0; |
|
113 |
|
114 /* |
|
115 * Checks if the contact should be shown according to the filter |
|
116 * @param aContact Contact to check |
|
117 * @param aFilter Tells which contacts should be shown |
|
118 * @return TBool ETrue if contact should be shown according |
|
119 * to the given filter. EFalse otherwise. |
|
120 */ |
|
121 virtual TBool FilterAllowsContact( const MVIMPSTStorageContact* aContact, |
|
122 TVIMPSTEnums::TFilterType aFilter ) const = 0; |
|
123 |
|
124 /** |
|
125 * Resorts the contacts in the list according the presence updation. |
|
126 * @param aContact contact id whose presence has been updated. |
|
127 */ |
|
128 virtual void ResortContact( MVIMPSTStorageContact* aContact ) = 0; |
|
129 |
|
130 |
|
131 /** |
|
132 * add contact to list |
|
133 * @param aContact. Contact item to be added. |
|
134 * @param index of index |
|
135 */ |
|
136 virtual TInt AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex ) = 0 ; |
|
137 |
|
138 |
|
139 /** |
|
140 * Remove contact from list |
|
141 * @param aContactLink. Contact Link of the item to be removed. |
|
142 */ |
|
143 virtual TInt RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index ) = 0 ; |
|
144 |
|
145 protected: // Constructors and destructor |
|
146 |
|
147 /** |
|
148 * Destructor. |
|
149 */ |
|
150 ~MVIMPSTStorageContactList(){}; |
|
151 }; |
|
152 |
|
153 |
|
154 #endif // MVIMPSTSTORAGECONTACTLIST_H |
|
155 |
|
156 // End of File |