|
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: Interface for observer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _MVIMPSTPROCESSARRAY_H_ |
|
20 #define _MVIMPSTPROCESSARRAY_H_ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include "tvimpstenums.h" |
|
24 |
|
25 // FORWARD DECLARATION |
|
26 class MVIMPSTProcessArrayObserver; |
|
27 class MVPbkContactLink; |
|
28 class MVPbkStoreContact; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Interface for observer |
|
33 * |
|
34 * @lib vimpstcmdprocess.dll |
|
35 * @since 5.0 |
|
36 */ |
|
37 class MVIMPSTProcessArray |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * register for array call back |
|
42 * @param aObserver, observer to be registered for |
|
43 * @return void |
|
44 */ |
|
45 virtual void AddObserver(MVIMPSTProcessArrayObserver* aObserver) = 0 ; |
|
46 |
|
47 /** |
|
48 * unregister for array call back |
|
49 * @param aObserver: to be removed |
|
50 * @return void |
|
51 */ |
|
52 virtual void RemoveObserver() = 0; |
|
53 |
|
54 /** |
|
55 * Count: Called by UI components to get total count of array elements. |
|
56 * @return integer: Count of items on the array. |
|
57 */ |
|
58 virtual TInt Count() const = 0; // total count of array |
|
59 |
|
60 |
|
61 /** |
|
62 * @return ETrue if voip presence service is enabled,else EFalse. |
|
63 */ |
|
64 virtual TBool IsSubServiceSupportedL( TVIMPSTEnums::SubServiceType aType ) const = 0 ; |
|
65 |
|
66 /** |
|
67 * GetType: Function to get the type of list item |
|
68 * @param aIndex: index of the list item |
|
69 * @return TEnumsPC::TItem: type of the list item as EContactItem, |
|
70 * EOwnStatusItem etc |
|
71 */ |
|
72 virtual TVIMPSTEnums::TItem GetType(TInt aIndex) const = 0; |
|
73 |
|
74 /** |
|
75 * GetItemNameText: To get item name of each list item |
|
76 * @param aIndex: Index of the list item whose name is to be returned |
|
77 * @return TPtrC: Name of the list item |
|
78 */ |
|
79 virtual TPtrC GetItemNameText(TInt aIndex)=0; |
|
80 |
|
81 |
|
82 /** |
|
83 * @returns the VPBK Contact Link |
|
84 */ |
|
85 virtual MVPbkContactLink* ContactLink(TInt aIndex) = 0; |
|
86 |
|
87 |
|
88 /** |
|
89 * SetLoginState: To set the loginstate. |
|
90 * @param aLoginState: state of login |
|
91 */ |
|
92 virtual void SetLoginStateL(TVIMPSTEnums::TVIMPSTRegistrationState aLoginState) = 0; |
|
93 |
|
94 |
|
95 /** |
|
96 * SetLoginState: To set the loginstate. |
|
97 * @return TVIMPSTRegistrationState, state of login |
|
98 */ |
|
99 virtual TVIMPSTEnums::TVIMPSTRegistrationState GetLoginState() = 0; |
|
100 |
|
101 /** |
|
102 * @returns the TOnlineStatus, current status. |
|
103 */ |
|
104 virtual TVIMPSTEnums::TOnlineStatus GetOnlineStatusL(TInt aIndex) = 0; |
|
105 |
|
106 /** |
|
107 * Get the status text for the contact |
|
108 * @param aIndex: Index of contact item |
|
109 * @return reference to the status text. |
|
110 */ |
|
111 virtual const TDesC& StatusTextL(TInt aIndex ) = 0 ; |
|
112 |
|
113 /** |
|
114 * Construct an array of contact list positions in model. |
|
115 * aPositionArray is cleared before appending positions! |
|
116 * @param aPositionArray array in which to store positions |
|
117 * @return none |
|
118 */ |
|
119 virtual void MapContactListPositions(RArray<TInt>& aPositionArray ) = 0; |
|
120 /** |
|
121 * IsMsgPending: To find if there are any pending messages to |
|
122 * decide the icons for display |
|
123 * @param aIndex: index of the list item |
|
124 * @return TBool: ETrue if there are pending messages else EFalse. |
|
125 */ |
|
126 virtual TBool IsMsgPending(TInt aIndex) = 0 ; |
|
127 |
|
128 /** |
|
129 * ResetPendingMsg: To reset if there are any pending messages to |
|
130 * decide the icons for display |
|
131 * @param aIndex: index of the list item |
|
132 */ |
|
133 virtual void ResetPendingMsg(TInt aIndex) = 0; |
|
134 |
|
135 |
|
136 /** |
|
137 * Find any contact which id is aContactId |
|
138 * @param ETrue if contact already existst. |
|
139 * else EFlase. |
|
140 */ |
|
141 virtual TBool FindAnyContact( const TDesC& aContactId ) = 0; |
|
142 |
|
143 |
|
144 /** |
|
145 * check if already conversation opened |
|
146 * @param aRecipientId, the selected user id with whom conversation is started |
|
147 * @return ETrue if already exist else EFlase. |
|
148 */ |
|
149 virtual TBool IsConversationExistL(const TDesC& aRecipientId) = 0; |
|
150 |
|
151 |
|
152 /** |
|
153 * check if already conversation opened |
|
154 * @param aRecipientId, the selected user id with whom conversation is started |
|
155 * @return ETrue if already exist else EFlase. |
|
156 */ |
|
157 virtual TBool IsConversationExist(TInt aIndex) = 0 ; |
|
158 |
|
159 /** |
|
160 * Find the index of contact with contact id as aContactId |
|
161 * @param aContactId : id of contact whose index is to be found |
|
162 * @return index of contact else KErrNotFounf if not found |
|
163 */ |
|
164 virtual TInt FindContactIndexL( const TDesC& aContactId ) = 0; |
|
165 |
|
166 /** |
|
167 * GetItemNameText: To get item name of each list item |
|
168 * @param aIndex: Index of the list item whose name is to be returned |
|
169 * @return TPtrC: Name of the list item |
|
170 */ |
|
171 virtual TPtrC GetItemUserId(TInt aIndex) =0; |
|
172 |
|
173 /** |
|
174 * LoginUserNameFromSettingsL: Login user name of the own user from settings |
|
175 * owener ship is transferred to the caller |
|
176 * @return allocated HBufC: Login user name of the own user from settings |
|
177 */ |
|
178 virtual const TDesC& LoginUserIdFromStoreL() const =0; |
|
179 |
|
180 |
|
181 /** |
|
182 * |
|
183 * Return index of aContactId (considering friend request also.). |
|
184 * @param aContactId, contact id for which index to be found. |
|
185 * @return, Index of aContactId including friend request. |
|
186 */ |
|
187 virtual TInt GetSelectedItemIndex(const TDesC& aContactId) = 0; |
|
188 |
|
189 /** |
|
190 * OwnAvatarIndex: Returns the avatar index for the own item |
|
191 * This index is used to append the avatar(ICON) in the UI. |
|
192 * If index is ' 0 ', then it means no avatar is set. |
|
193 * |
|
194 * @return index of the avatar |
|
195 */ |
|
196 virtual TInt OwnAvatarIndexL( ) = 0; |
|
197 /** |
|
198 * SetOwnAvatarIndex: Sets the index for avatar for for the own item |
|
199 * |
|
200 * @param aAvatarIndex: Index to be set |
|
201 */ |
|
202 virtual void SetOwnAvatarIndexL( TInt aAvatarIndex ) = 0; |
|
203 |
|
204 /** |
|
205 * OwnAvatarContent: Returns the content of the avatar image for the own item |
|
206 * |
|
207 * If nothing returns KNullDesC8 |
|
208 * |
|
209 * @return TDesC8& content of the avatar |
|
210 */ |
|
211 virtual const TDesC8& OwnAvatarContentL( ) const = 0; |
|
212 /** |
|
213 * AvatarContent: Returns the content of the avatar image for the conatct |
|
214 * |
|
215 * If nothing returns KNullDesC8 |
|
216 * @param aContactIndex : Index of the conatct item |
|
217 * |
|
218 * @return TDesC8& content of the avatar |
|
219 */ |
|
220 virtual const TDesC8& AvatarContent(TInt aContactIndex) = 0; |
|
221 |
|
222 /** |
|
223 * SetAvatarIndex: Sets the index for avatar for for the corresponding contact item |
|
224 * |
|
225 * @param aContactIndex : Index of the conatct item |
|
226 * @param aAvatarIndex: Index to be set |
|
227 */ |
|
228 virtual void SetAvatarIndex( TInt aContactIndex, TInt aAvatarIndex )= 0; |
|
229 |
|
230 /** |
|
231 * AvatarIndex: Returns the avatar index for the corresponding contact item |
|
232 * This index is used to append the avatar(ICON) in the UI. |
|
233 * If index is ' 0 ', then it means no avatar is set. |
|
234 * |
|
235 * @param aContactIndex : Index of the conatct item |
|
236 * |
|
237 * @return index of the avatar |
|
238 */ |
|
239 virtual TInt AvatarIndex(TInt aContactIndex) = 0; |
|
240 |
|
241 /** |
|
242 * remove the item from invitation or unknown array if found |
|
243 * @param aContactId : conatct user Id |
|
244 * @return ETrue if contact is removed |
|
245 */ |
|
246 virtual TBool RemoveFromUnknonOrInvitationListL( const TDesC& aContactId , TBool aBlocked ) = 0 ; |
|
247 |
|
248 /** |
|
249 * @return, formatted string for the listbox item |
|
250 */ |
|
251 virtual TPtrC16 GetFormattedString(TInt aIndex) = 0; |
|
252 |
|
253 /** |
|
254 * Virtual destructor |
|
255 */ |
|
256 virtual ~MVIMPSTProcessArray() {}; |
|
257 |
|
258 }; |
|
259 #endif // _MVIMPSTPROCESSARRAY_H_ |
|
260 |
|
261 // End of File |