|
1 /* |
|
2 * Copyright (c) 2006 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: Interface for search operations |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MCASEARCHINTERFACEPC_H |
|
20 #define MCASEARCHINTERFACEPC_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include "MCASearchObserverInterface.h" |
|
25 #include "TEnumsPC.h" |
|
26 #include "MCASearchInterface.h" |
|
27 |
|
28 #include <impsgroupprops.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MCASearchObserverInterfacePC; |
|
32 class MCASearchBackgroundObserverPC; |
|
33 class MCAServerContactsArrayPC; |
|
34 |
|
35 |
|
36 // CLASS DECLARATION |
|
37 /** |
|
38 * Search services interface for UI and Engine. |
|
39 * |
|
40 * @lib wvuiprocessng.lib |
|
41 * @since 3.2 |
|
42 */ |
|
43 class MCASearchInterfacePC: public MCASearchObserverInterface |
|
44 |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~MCASearchInterfacePC() |
|
52 { |
|
53 |
|
54 }; |
|
55 public: |
|
56 |
|
57 /** |
|
58 * To add the UI side observer for MCASearchObserverInterfacePC |
|
59 * events from the engine. |
|
60 */ |
|
61 virtual void AddObserver( MCASearchObserverInterfacePC* aObserver ) = 0; |
|
62 |
|
63 /** |
|
64 * To remove the UI side observer for MCASearchObserverInterfacePC |
|
65 * events from the engine. |
|
66 */ |
|
67 virtual void RemoveObserver() = 0; |
|
68 |
|
69 /** |
|
70 * Registers observer for background task |
|
71 * @param aBackgaBackgroundObserver pointer of instance of UI component |
|
72 * @param aTaskMask is an AND mask for task requested, |
|
73 * @param aEventMask is an AND mask for events requested, |
|
74 * @return KErrNone on success, system wide error code otherwise |
|
75 */ |
|
76 virtual TInt RegisterBackgroundObserver( |
|
77 MCASearchBackgroundObserverPC* aBackgroundObserver, |
|
78 TInt aTaskMask, |
|
79 TInt aEventMask |
|
80 ) = 0; |
|
81 /** |
|
82 * Removes the observer |
|
83 * @param aBackgroundObserver pointer of instance to remove |
|
84 */ |
|
85 virtual void UnRegisterBackgroundObserver( |
|
86 MCASearchBackgroundObserverPC* aBackgroundObserver |
|
87 ) = 0; |
|
88 |
|
89 /** |
|
90 * @param aTaskID is an id of a background task |
|
91 * @retrun status of the background task or KErrNotFound |
|
92 */ |
|
93 virtual TInt BackgroundTaskStatus( TEnumsPC::TCABackgroundTasks aTaskID ) = 0; |
|
94 |
|
95 /** |
|
96 * Builds the search pairs and sets the search requestSet values. |
|
97 * This allocates memory and copies aValue to its internal data storage. |
|
98 * @param aSearchCriteriaArray specifies list of search criterias (search keys) |
|
99 * @param aSearchStringArray specifies array of strings to be searched(search values) |
|
100 */ |
|
101 |
|
102 virtual void SetRequestL( RArray<TEnumsPC::TSearchCriteria>& aSearchCriteriaArray, |
|
103 CDesCArray& aSearchStringArray ) = 0; |
|
104 |
|
105 /** |
|
106 * @return ETrue if iSearchPairs is not null |
|
107 */ |
|
108 virtual TBool IsSearchPairsSet() = 0; |
|
109 |
|
110 /** |
|
111 * @return SearchString - string to be searched |
|
112 */ |
|
113 virtual HBufC* GetSearchStringLC() = 0; |
|
114 |
|
115 /** |
|
116 * Find any contact which id is aContactId |
|
117 * @param aContactId Contactid to recognize contact. |
|
118 * @return ETrue if contact found else EFalse |
|
119 */ |
|
120 virtual TBool FindAnyContactL( const TDesC& aContactId ) = 0; |
|
121 |
|
122 public: |
|
123 |
|
124 /** |
|
125 * @see MCASearchObserverInterface::HandleError |
|
126 */ |
|
127 virtual void HandleSearchError( TInt aErrorCode ) = 0; |
|
128 /** |
|
129 * @see MCASearchObserverInterface::HandleSearchFinished |
|
130 */ |
|
131 virtual void HandleSearchFinished( ) = 0; |
|
132 |
|
133 |
|
134 public: |
|
135 |
|
136 /** |
|
137 * Start the search. |
|
138 * @param aSearchLimit defines how many results you want. |
|
139 * @param aObserver The observer for this search operation |
|
140 * @param aSearchPairs Pairs to be searched |
|
141 * @return Error code. |
|
142 * Leaves |
|
143 * ESearchNotSupported |
|
144 */ |
|
145 virtual TInt StartSearchL( TInt aSearchLimit, |
|
146 MCASearchObserverInterfacePC* aObserver, |
|
147 CSearchPairs* aSearchPairs = NULL ) = 0; |
|
148 |
|
149 /** |
|
150 * Stops the current search. Must be called before starting new search. |
|
151 * @return Error code. |
|
152 * Leaves |
|
153 * ESearchNotSupported |
|
154 */ |
|
155 virtual TInt EndSearchL() = 0; |
|
156 |
|
157 /** |
|
158 * Continues search. This function must only be called when more results |
|
159 * are wanted. |
|
160 * @param aIndex specifies the next index where to start search. |
|
161 * @param aObserver The observer for this search operation |
|
162 * @return Error code. |
|
163 * Leaves |
|
164 * ERequestedResultsButNotAvailable |
|
165 * ESearchNotSupported |
|
166 */ |
|
167 virtual TInt SearchNextL( TInt aIndex, |
|
168 MCASearchObserverInterfacePC* aObserver ) = 0; |
|
169 |
|
170 /** |
|
171 * Gets the properties of group |
|
172 * @param The group id |
|
173 * @param aCommonProps Common group properties |
|
174 * @param aPrivateProps Private group properties |
|
175 * @return CSP error code |
|
176 */ |
|
177 virtual TEnumsPC::TImpsCSPAllErrors GetPropertiesL( const TDesC& aGroupId, |
|
178 CImpsCommonGroupProps*& aCommonProps, |
|
179 CImpsPrivateGroupProps*& aPrivateProps |
|
180 ) = 0; |
|
181 |
|
182 /** |
|
183 * To set the groupname of the group whose id is aGroupId |
|
184 * @param aGroupId: id of the group whose name has to be set |
|
185 * @param aGroupName: name of the group to be set |
|
186 */ |
|
187 |
|
188 virtual void SetGroupNameL( const TDesC& aGroupId, const TDesC& aGroupName ) = 0; |
|
189 |
|
190 /** |
|
191 * To create a group with group id aGroupId |
|
192 * @param aGroupId: id of the group to be created |
|
193 */ |
|
194 virtual void CreateGroupL( const TDesC& aGroupId ) = 0; |
|
195 |
|
196 /** |
|
197 * To save the changes made to a groups properties and make it persistent. Once this is done |
|
198 * the isFavorite property of the group will always return true. |
|
199 * @param aGroupId: id of the group which has to be saved |
|
200 */ |
|
201 virtual void SaveChangesL( const TDesC& aGroupId ) = 0; |
|
202 |
|
203 /** |
|
204 * To populate the two arrays of group names and goup ids |
|
205 * @param aGroupNames: array of the current group names |
|
206 * @param aGroupIds: array of the current group IDs |
|
207 */ |
|
208 virtual MCAServerContactsArrayPC* GetPairArrayForServerContactsArrayLC() = 0; |
|
209 |
|
210 /** |
|
211 * To set the groupname of the group whose id is aGroupId |
|
212 * @param aGroupId: id of the group which has to be searched for |
|
213 * @param bool : returns true if the group with aGroupId is found else returns false |
|
214 */ |
|
215 virtual TBool FindGroup( const TDesC& aGroupId ) = 0; |
|
216 |
|
217 |
|
218 /** |
|
219 * Delete the given group |
|
220 * @param aGroupId The group id of the group to delete |
|
221 * @param aDeleteFromNetwork Defines whether the group should |
|
222 * be deleted also from network server or not |
|
223 * @return The errorcode |
|
224 */ |
|
225 virtual TInt DeleteGroupL( const TDesC& aGroupId, TBool aDeleteFromNetwork ) = 0; |
|
226 |
|
227 |
|
228 /** |
|
229 * To get the groupname of the group whose id is aGroupId |
|
230 * @param aGroupId: of the group whose name has to be set |
|
231 * @param aHasCommonProps: Returned by reference. True if the group has common group properties |
|
232 * else return false |
|
233 * @param aImpsError: return by reference. Return the error code if any. |
|
234 */ |
|
235 virtual TPtrC GetGroupNameL( const TDesC& aWvid, TBool& aHasCommonProps, |
|
236 TEnumsPC::TImpsCSPAllErrors& aImpsError ) = 0; |
|
237 /* |
|
238 * Get the storage type of this group and check if it is a persistent grp. |
|
239 * If the group is marked as favourite, then it will be persistent |
|
240 * @return ETrue if favourite else EFalse |
|
241 */ |
|
242 virtual TBool IsFavouriteChatGroup( const TDesC& aGroupId ) const = 0; |
|
243 |
|
244 /* |
|
245 * Get the total no. of groups the user has joined too'. |
|
246 */ |
|
247 virtual TInt JoinedGroups() = 0; |
|
248 }; |
|
249 |
|
250 #endif // MCASEARCHINTERFACEPC_H |
|
251 |
|
252 // End of File |