|
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: class declaration for accessing the cache |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CIMCACHEACCESSOR_H__ |
|
21 #define __CIMCACHEACCESSOR_H__ |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "mimcacheaccessor.h" |
|
25 #include "cimcacheclient.h" |
|
26 |
|
27 class MIMCacheEventHandler; |
|
28 |
|
29 /** |
|
30 * write right class declaration |
|
31 */ |
|
32 |
|
33 NONSHARABLE_CLASS( CIMCacheAccessor ): public CBase, |
|
34 public MIMCacheAccessor |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * @param aServiceId, service id to used |
|
40 * @param aUserId, user id who is conversing |
|
41 */ |
|
42 static CIMCacheAccessor* NewL(TInt aServiceId, |
|
43 const TDesC& aUserId ); |
|
44 /** |
|
45 * virtual destructor. |
|
46 */ |
|
47 virtual ~CIMCacheAccessor(); |
|
48 |
|
49 |
|
50 private: |
|
51 |
|
52 /** |
|
53 * ConstructL. |
|
54 * @param aUserId, user id who is conversing |
|
55 */ |
|
56 |
|
57 void ConstructL( const TDesC& aUserId ); |
|
58 |
|
59 /** |
|
60 * default constructor. |
|
61 * @param aServiceId, service id to used |
|
62 */ |
|
63 CIMCacheAccessor(TInt aServiceId); |
|
64 |
|
65 |
|
66 private: // from MIMCacheAccessor |
|
67 |
|
68 /** |
|
69 * Register to observer instantmessagingcache data updates |
|
70 * @param aObserver the observer interface |
|
71 */ |
|
72 void RegisterObserverL( MIMCacheEventHandler& aObserver ); |
|
73 |
|
74 /** |
|
75 * Unregister a instantmessagingcache data update observer |
|
76 * @param aObserver the observer interface |
|
77 */ |
|
78 void UnRegisterObserver( MIMCacheEventHandler& aObserver); |
|
79 |
|
80 |
|
81 /** |
|
82 * to get the unread message count from server |
|
83 * @param aOwnUserId , logged in user id |
|
84 * @return number of unread msg count |
|
85 */ |
|
86 TInt GetUnreadMessageCountL(const TDesC& aBuddyId ); |
|
87 |
|
88 /** |
|
89 * to get the all unread message count from server |
|
90 * @param , aOwnUserId logged in user id |
|
91 * @return number of all unread msg count |
|
92 */ |
|
93 TInt GetAllUnreadMessageCountL(); |
|
94 |
|
95 /** |
|
96 * check if already conversation opened |
|
97 * @param aServiceId, serviceid to use |
|
98 * @param aOwnUserId, own user id |
|
99 * @param aRecipientId, the selected user id with whom conversation is started |
|
100 * @return ETrue if already exist else EFlase. |
|
101 */ |
|
102 TBool IsConversationExistL( const TDesC& aBuddyId ) ; |
|
103 |
|
104 /** |
|
105 * closes conversation and commit operation |
|
106 * @param aServiceId service id. |
|
107 * @param aOwnId own user id. |
|
108 * @param aRecipientId recipient's user id. |
|
109 */ |
|
110 void CloseConversationL( const TDesC& aBuddyId ); |
|
111 |
|
112 |
|
113 /** |
|
114 * get the chat list corresponding to service |
|
115 * @param aServiceId service id |
|
116 * @return Array of chats |
|
117 */ |
|
118 RArray<SIMCacheChatItem> GetChatListL( const TInt aServiceId ); |
|
119 |
|
120 private : |
|
121 /** |
|
122 * default constructor. |
|
123 * @param aServiceId, service id to used |
|
124 */ |
|
125 void InternalizeChatListL( RArray<SIMCacheChatItem>& aChatArray, TPtr8 aChatListBuffer, TBool& aMore ); |
|
126 |
|
127 public : // new api |
|
128 |
|
129 /** |
|
130 * return the serviceid |
|
131 */ |
|
132 TInt ServiceId() const ; |
|
133 |
|
134 private: // data |
|
135 |
|
136 // owned , user id |
|
137 HBufC* iUserId; |
|
138 |
|
139 // not owned , client |
|
140 CIMCacheClient iClient; |
|
141 |
|
142 // owned, service id |
|
143 TInt iServiceId; |
|
144 |
|
145 }; |
|
146 |
|
147 #endif // __CIMCACHEUPDATER_H__ |
|
148 |
|
149 |
|
150 // END OF FILE |
|
151 |