|
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: Reads message information from message store. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MSG_STORE_HANDLER_H__ |
|
19 #define __MSG_STORE_HANDLER_H__ |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <msvapi.h> |
|
23 |
|
24 class MsgStoreHandler : public MMsvSessionObserver |
|
25 { |
|
26 public: |
|
27 /** |
|
28 * Constructor |
|
29 */ |
|
30 explicit MsgStoreHandler(); |
|
31 |
|
32 /** |
|
33 * Destructor |
|
34 */ |
|
35 virtual ~MsgStoreHandler(); |
|
36 |
|
37 public : |
|
38 /** |
|
39 * @see MMsvSessionObserver |
|
40 */ |
|
41 void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, |
|
42 TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/); |
|
43 |
|
44 public: |
|
45 /** |
|
46 * Mark message as read and get the message type |
|
47 * @param messageId message Id |
|
48 * @param msgType message type is written to this. |
|
49 * @param msgType message sub type is written to this. |
|
50 */ |
|
51 void markAsReadAndGetType(int msgId, |
|
52 int& msgType, |
|
53 int& msgSubType); |
|
54 |
|
55 /** |
|
56 * Delete message. |
|
57 * @param msgId id of the message to be deleted. |
|
58 */ |
|
59 void deleteMessage(int msgId); |
|
60 |
|
61 private: |
|
62 /** |
|
63 * Does all initilaizations |
|
64 */ |
|
65 void InitL(); |
|
66 |
|
67 /** |
|
68 * Extrcats the message type from TMsvEntry |
|
69 * @param aEntry message entry. |
|
70 * @param msgType message type is written to this. |
|
71 * @param msgType message sub type is written to this. |
|
72 */ |
|
73 void extractMsgType(const TMsvEntry& aEntry, |
|
74 int& msgType, |
|
75 int& msgSubType); |
|
76 |
|
77 private: |
|
78 /** |
|
79 * Session |
|
80 * Owned. |
|
81 */ |
|
82 CMsvSession* iMsvSession; |
|
83 }; |
|
84 |
|
85 #endif // __MSG_STORE_HANDLER_H__ |
|
86 |
|
87 // EOF |