|
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: M-Class that capsulates single service API's |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MVIMPSTENGINE_H |
|
20 #define MVIMPSTENGINE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "tvimpstenums.h" |
|
25 |
|
26 |
|
27 //FORWARD DECLARATION |
|
28 class MVIMPSTEngineSearchMgrExtention; |
|
29 class MVIMPSTEngineServiceStateEventObserver; |
|
30 class MVIMPSTEngineSubService; |
|
31 class MVIMPSTEngineExtentionFeatures; |
|
32 class MVIMPSTEnginePresenceSubService; |
|
33 class MVIMPSTEngineBlockedListFetchEventObserver; |
|
34 |
|
35 //CLASS DECLARATION |
|
36 /** |
|
37 * |
|
38 * This class list the M-Class for Engine API's |
|
39 * |
|
40 * @lib vimpstengine.lib |
|
41 * @since S60 5.0 |
|
42 */ |
|
43 //Class declaration |
|
44 class MVIMPSTEngine |
|
45 { |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * Gets the Service Id |
|
51 * @return TUint32 Service Id |
|
52 */ |
|
53 virtual TUint32 ServiceId() const = 0 ; |
|
54 |
|
55 |
|
56 /** |
|
57 * Returns the Service State - Cumulative Service State of the SubServices |
|
58 * @return TVIMPSTRegistrationState, current service state. |
|
59 */ |
|
60 virtual TVIMPSTEnums::TVIMPSTRegistrationState ServiceState() const = 0; |
|
61 |
|
62 |
|
63 /** |
|
64 * Gets the Brand Information for the current service |
|
65 * @param aBrandLanguage - Holds the BrandLanguage |
|
66 * @param aBrandVersion - Holds the Version to be used |
|
67 * @param aBrandId - Holds the brandId |
|
68 * caller should allocate memory for all params and send the same to this API |
|
69 * The result will be available in the InParams otself. |
|
70 * @return TInt Error code |
|
71 */ |
|
72 virtual TInt GetBrandInfoL(TLanguage& aBrandLanguage, |
|
73 TInt& aBrandVersion, TDes8& aBrandId) const = 0; |
|
74 |
|
75 |
|
76 |
|
77 /** |
|
78 * Returns a SubService is Supported or not |
|
79 * Components intertested in knowing whether a SubService is Supported or not can use this API |
|
80 * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h |
|
81 * @return TBool, ETrue if the SubService is Supported in this Service, else returns EFalse |
|
82 */ |
|
83 virtual TBool IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType) const = 0; |
|
84 |
|
85 |
|
86 /** |
|
87 * Returns TBool whether a SubService is Enabled or not |
|
88 * Components intertested in knowing whether a SubService is Enabled or not can use this API |
|
89 * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h |
|
90 * @return TBool, ETrue if the SubService is Enabled in this Service, else returns EFalse |
|
91 */ |
|
92 virtual TBool IsSubServiceEnabled(TVIMPSTEnums::SubServiceType aType) const = 0; |
|
93 |
|
94 /** |
|
95 * Gets the StoreName for given service |
|
96 * @param aContactStoreId, Virtual store id. |
|
97 * The caller of the this function has to assign required memory for aContactStoreId |
|
98 * aContactStoreId will be filled with the Virtual Store Id by this API |
|
99 */ |
|
100 virtual void ContactStoreIdL( |
|
101 TDes& aContactStoreId ) const = 0; |
|
102 |
|
103 /** |
|
104 * returns the Service Name |
|
105 * @return TDesC&, reference to service name. Ownership is not transferred. |
|
106 */ |
|
107 virtual const TDesC& ServiceName() const = 0; |
|
108 |
|
109 /** |
|
110 * Register Session Observer. |
|
111 * @aObserver, observer ot be registered. |
|
112 */ |
|
113 virtual void RegisterServiceSessionObserverL |
|
114 (MVIMPSTEngineServiceStateEventObserver* aObserver) = 0; |
|
115 |
|
116 /** |
|
117 * UnRegisters Session Observer |
|
118 * @aObserver, observer ot be Unregistered. |
|
119 */ |
|
120 virtual void UnRegisterServiceSessionObserver |
|
121 (MVIMPSTEngineServiceStateEventObserver* aObserver) = 0; |
|
122 |
|
123 |
|
124 /** |
|
125 * intialize storage |
|
126 */ |
|
127 virtual void IntializeStorageL() = 0; |
|
128 |
|
129 /** |
|
130 * unintialize storage |
|
131 */ |
|
132 virtual void UnIntializeStorage() = 0; |
|
133 |
|
134 |
|
135 /** |
|
136 * Get the Ptr to the SubService given the Type of the SubService |
|
137 * This API returns a Generalised SubService Class MVIMPSTEngineSubService |
|
138 * Ownership of the SubService is not Transferred to the Caller |
|
139 * The Caller can use this (MVIMPSTEngineSubService*) ptr to typecast to appropriate SubService Interface |
|
140 * Usage : MVIMPSTEngineIMSubService* imSubService = |
|
141 * dynamic_cast<MVIMPSTEngineIMSubService*> |
|
142 * (iEngine.SubService(TVIMPSTEnums::EIM)); |
|
143 * |
|
144 * if(imSubService) |
|
145 * { |
|
146 * imSubService->CloseConversationL( iContactId ); |
|
147 * } |
|
148 * @param aType - SubService Type (TVIMPSTEnums::SubServiceType) defined in tvimpstenums.h |
|
149 * @return - Ptr to the SubService - Value can even be NULL |
|
150 */ |
|
151 virtual MVIMPSTEngineSubService* SubService(TVIMPSTEnums::SubServiceType aType) const= 0; |
|
152 |
|
153 |
|
154 /** |
|
155 * Get the Ptr to the ExtentionFeatures given the Type of the Extention Features |
|
156 * This API returns a Generalised ExtentionFeatures Class MVIMPSTEngineExtentionFeatures |
|
157 * Ownership of the ExtentionFeatures is not Transferred to the Caller |
|
158 * The Caller can use this (MVIMPSTEngineExtentionFeatures*) ptr to typecast to appropriate SubService Interface |
|
159 * Usage : MVIMPSTEngineSearchMgrExtention* searchMgr = |
|
160 * dynamic_cast<MVIMPSTEngineSearchMgrExtention*> |
|
161 * (iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch)); |
|
162 * |
|
163 * |
|
164 * if (searchMgr) |
|
165 * { |
|
166 * iError = searchMgr->SearchContactsL( iKeyDataArray ); |
|
167 * } |
|
168 * @param aType - Extention Feature Type (TVIMPSTEnums::ExtentionType) defined in tvimpstenums.h |
|
169 * @return - Ptr to the ExtentionFeatures - Value can even be NULL |
|
170 */ |
|
171 virtual MVIMPSTEngineExtentionFeatures* ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const = 0; |
|
172 |
|
173 /** |
|
174 * gets the UserName for the Service |
|
175 * @return HBufC* - Ownership is transferred to the caller |
|
176 * This API allocates memory for the UserName and transfers the Ownership to the Caller |
|
177 */ |
|
178 virtual HBufC* GetOwnUserIdFromCChOrStorageL() const = 0; |
|
179 |
|
180 |
|
181 /** |
|
182 * API used to login to the Service |
|
183 */ |
|
184 virtual TInt Login() = 0; |
|
185 |
|
186 /** |
|
187 * API used to Logout to the Service |
|
188 */ |
|
189 virtual void LogoutL() = 0; |
|
190 /** |
|
191 * |
|
192 * @return True if password is present in the settings else returns false |
|
193 * |
|
194 */ |
|
195 virtual TBool IsPasswordAvailableL() = 0; |
|
196 |
|
197 /** |
|
198 * Gets the default domain name for given service |
|
199 * @param aDefaultDomainName, Domain Name. |
|
200 * The caller of the this function has to assign required memory for aDefaultDomainName |
|
201 * aDefaultDomainName will be filled with the deafault domain name by this API |
|
202 */ |
|
203 virtual void DefaultDomainNameL( TDes& aDefaultDomainName ) const = 0; |
|
204 |
|
205 |
|
206 /** |
|
207 * Change Connection |
|
208 * Shows CCHUI dialog for changing the Network Connection for this service |
|
209 * ECchUiDialogTypeChangeConnection |
|
210 * @return Error Code |
|
211 */ |
|
212 virtual TInt ChangeConnectionL() = 0; |
|
213 |
|
214 /** |
|
215 * IsBlockSupportedL |
|
216 * @returns ETrue if block/unblock is supported |
|
217 * else EFalse |
|
218 */ |
|
219 virtual TBool IsBlockSupportedL() = 0; |
|
220 |
|
221 /** |
|
222 * Inform storage that data base need to be deleted. |
|
223 */ |
|
224 virtual void DeleteDataBaseL() = 0; |
|
225 |
|
226 /** |
|
227 * used for returning MVIMPSTEnginePresenceSubService pointer. |
|
228 * @return MVIMPSTEnginePresenceSubService istance pointer |
|
229 */ |
|
230 virtual MVIMPSTEnginePresenceSubService* GetPreseceSubService() = 0; |
|
231 |
|
232 /** |
|
233 *Fetch the blocked list from server.. |
|
234 */ |
|
235 virtual void FetchBlockedListL() = 0; |
|
236 |
|
237 |
|
238 |
|
239 /** |
|
240 * See MVIMPSTEngine |
|
241 * |
|
242 */ |
|
243 virtual void RetriveContextIfCChEnabledL() = 0 ; |
|
244 |
|
245 |
|
246 /** |
|
247 * set function |
|
248 * |
|
249 */ |
|
250 virtual void SetOwnUserIdIfChangedL(const TDesC& aUserId ) = 0 ; |
|
251 |
|
252 /** |
|
253 *@param aOb,pointer of MVIMPSTEngineBlockedListFetchEventObserver, |
|
254 * Notify that fetch of blocked list has been completed.. |
|
255 */ |
|
256 virtual void RegisterBlockedListObserver( |
|
257 MVIMPSTEngineBlockedListFetchEventObserver* aOb) = 0; |
|
258 /** |
|
259 * Destructor |
|
260 */ |
|
261 virtual ~MVIMPSTEngine() |
|
262 {} |
|
263 |
|
264 |
|
265 }; |
|
266 |
|
267 #endif //MVIMPSTENGINE_H |
|
268 |
|
269 |