|
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 /** |
|
62 * is draft message. |
|
63 * @param msgId id of the message to be checked. |
|
64 * @return true if it is a draft message,else false |
|
65 */ |
|
66 bool isDraftMessage(int msgId); |
|
67 |
|
68 private: |
|
69 /** |
|
70 * Does all initilaizations |
|
71 */ |
|
72 void InitL(); |
|
73 |
|
74 /** |
|
75 * Extrcats the message type from TMsvEntry |
|
76 * @param aEntry message entry. |
|
77 * @param msgType message type is written to this. |
|
78 * @param msgType message sub type is written to this. |
|
79 */ |
|
80 void extractMsgType(const TMsvEntry& aEntry, |
|
81 int& msgType, |
|
82 int& msgSubType); |
|
83 |
|
84 private: |
|
85 /** |
|
86 * Session |
|
87 * Owned. |
|
88 */ |
|
89 CMsvSession* iMsvSession; |
|
90 }; |
|
91 |
|
92 #endif // __MSG_STORE_HANDLER_H__ |
|
93 |
|
94 // EOF |