|
1 /* |
|
2 * Copyright (c) 2007 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: CS Server Mark Read Handler |
|
15 * |
|
16 */ |
|
17 #ifndef __C_CS_CONVERSATION_MARK_READ_HANDLER_H__ |
|
18 #define __C_CS_CONVERSATION_MARK_READ_HANDLER_H__ |
|
19 |
|
20 // SYSTEM INCLUDE FILES |
|
21 #include <msvapi.h> |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class CMsvSession; |
|
25 class CConversationCache; |
|
26 class CCsConversationEntry; |
|
27 class MMsvSessionObserver; |
|
28 /** |
|
29 * Mark read handler states |
|
30 */ |
|
31 enum TMarkReadHandlerState |
|
32 { |
|
33 EMarkReadIdle = 0, |
|
34 EMarkReadStart, |
|
35 EMarkReadNext, |
|
36 EMarkReadComplete |
|
37 }; |
|
38 |
|
39 /** |
|
40 * This class handles mark read of messages from messaging store. |
|
41 */ |
|
42 class CCsConversationMarkReadHandler : public CActive, public MMsvSessionObserver |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Two phase construction |
|
47 */ |
|
48 static CCsConversationMarkReadHandler* NewL(CCsConversationCache* aCache); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 virtual ~CCsConversationMarkReadHandler(); |
|
54 |
|
55 /** |
|
56 * From MMsvSessionObserver, HandleSessionEventL. |
|
57 */ |
|
58 virtual void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, |
|
59 TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) {}; |
|
60 |
|
61 /** |
|
62 * Mark a set of messages as read |
|
63 * @param aConversationId. The conversation id. |
|
64 */ |
|
65 void MarkReadL(TInt aConversationId); |
|
66 |
|
67 public: // From CActive |
|
68 void RunL(); |
|
69 void DoCancel(); |
|
70 TInt RunError(TInt aError); |
|
71 |
|
72 private: |
|
73 CCsConversationMarkReadHandler(); |
|
74 void ConstructL(CCsConversationCache* aCache); |
|
75 void IssueRequest(); |
|
76 void MarkReadOneMessageL(); |
|
77 |
|
78 private: |
|
79 /** |
|
80 * Own. Msv Session. |
|
81 */ |
|
82 CMsvSession* iSession; |
|
83 |
|
84 /** |
|
85 * State |
|
86 */ |
|
87 TMarkReadHandlerState iState; |
|
88 |
|
89 /** |
|
90 * Not own. Cache. |
|
91 */ |
|
92 CCsConversationCache* iCache; |
|
93 |
|
94 /** |
|
95 * Own. List of message entries to be mark read. |
|
96 */ |
|
97 RPointerArray<CCsConversationEntry>* iConversationEntryList; |
|
98 |
|
99 /** |
|
100 * Mark read message count |
|
101 */ |
|
102 TInt iMarkReadCount; |
|
103 }; |
|
104 |
|
105 #endif // __C_CS_CONVERSATION_DELETE_HANDLER_H__ |