37
|
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>
|
67
|
23 |
#include <ccsdefs.h>
|
37
|
24 |
|
67
|
25 |
// FORWARD DECLARATIONS
|
|
26 |
class CMmsNotificationClientMtm;
|
|
27 |
class CClientMtmRegistry;
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Class MsgStoreHandler
|
|
31 |
* Reads message information from message store.
|
|
32 |
*/
|
37
|
33 |
class MsgStoreHandler : public MMsvSessionObserver
|
|
34 |
{
|
|
35 |
public:
|
|
36 |
/**
|
|
37 |
* Constructor
|
|
38 |
*/
|
|
39 |
explicit MsgStoreHandler();
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Destructor
|
|
43 |
*/
|
|
44 |
virtual ~MsgStoreHandler();
|
|
45 |
|
|
46 |
/**
|
67
|
47 |
* Mark message as read
|
|
48 |
* @param messageId message Id
|
37
|
49 |
*/
|
67
|
50 |
void markAsRead(int msgId);
|
|
51 |
|
37
|
52 |
/**
|
67
|
53 |
* Get message's type (msgtype and msgsubtype) info
|
|
54 |
* @param messageId message Id
|
37
|
55 |
* @param msgType message type is written to this.
|
67
|
56 |
* @param msgSubType message sub type is written to this.
|
37
|
57 |
*/
|
67
|
58 |
void getMsgTypeInfo(int msgId,
|
|
59 |
int& msgType,
|
|
60 |
int& msgSubType);
|
|
61 |
|
37
|
62 |
/**
|
|
63 |
* Delete message.
|
|
64 |
* @param msgId id of the message to be deleted.
|
|
65 |
*/
|
|
66 |
void deleteMessage(int msgId);
|
|
67 |
|
38
|
68 |
/**
|
|
69 |
* is draft message.
|
|
70 |
* @param msgId id of the message to be checked.
|
|
71 |
* @return true if it is a draft message,else false
|
|
72 |
*/
|
|
73 |
bool isDraftMessage(int msgId);
|
67
|
74 |
|
|
75 |
/**
|
|
76 |
* Check if the message is locked to avoid viewing
|
|
77 |
* e.g. Outbox messages should not be opened in viewer
|
|
78 |
* @param msgId id of the message to be checked.
|
|
79 |
* @return bool, true if it is locked
|
|
80 |
*/
|
|
81 |
bool locked(int msgId);
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Checks if a message exists or not
|
|
85 |
* @param msgId, message id
|
|
86 |
* @return bool, true if message exists
|
|
87 |
*/
|
|
88 |
bool exists(int msgId);
|
|
89 |
|
|
90 |
/**
|
|
91 |
* Sets content to message id
|
|
92 |
* @param msgId, message id
|
|
93 |
* @return int, status of setting context to message id
|
|
94 |
*/
|
|
95 |
int setNotificationMessageId(int msgId);
|
|
96 |
|
|
97 |
/**
|
73
|
98 |
* Seeker method for getting sender information
|
|
99 |
* @return QString, sender address
|
|
100 |
*/
|
|
101 |
QString notificationSender();
|
|
102 |
|
|
103 |
/**
|
|
104 |
* Seeker method for getting notification time-stamp
|
|
105 |
* @return formatted string of notification time-stamp
|
|
106 |
*/
|
|
107 |
QString notificationTimeStamp();
|
|
108 |
|
|
109 |
/**
|
67
|
110 |
* Seeker method for getting mms notification's subject line
|
|
111 |
* @return QString, subject of mms notification
|
|
112 |
*/
|
|
113 |
QString notificationSubject();
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Seeker method for getting mms notification estimated msg size
|
|
117 |
* @return formatted string for msg size in KB
|
|
118 |
*/
|
|
119 |
QString notificationMsgSize();
|
38
|
120 |
|
67
|
121 |
/**
|
|
122 |
* Seeker method for getting mms notification class type
|
|
123 |
* @return Notification Class type string
|
|
124 |
*/
|
|
125 |
QString notificationClass();
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Seeker method for message status and error string
|
|
129 |
* mms notification's download state
|
|
130 |
* @param [OUT] status, msg status
|
|
131 |
* @param [OUT] statusStr, localized string of msg status
|
|
132 |
*/
|
|
133 |
void notificationStatus(int& status,
|
|
134 |
QString& statusStr);
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Seeker method getting expiry info of a notification msg
|
|
138 |
* @return formatted string of notification's expiry time
|
|
139 |
*/
|
|
140 |
QString notificationExpiryDate();
|
|
141 |
|
37
|
142 |
private:
|
|
143 |
/**
|
67
|
144 |
* @see MMsvSessionObserver
|
|
145 |
*/
|
|
146 |
void HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
|
|
147 |
TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/);
|
|
148 |
|
|
149 |
/**
|
37
|
150 |
* Does all initilaizations
|
|
151 |
*/
|
|
152 |
void InitL();
|
67
|
153 |
|
|
154 |
/**
|
|
155 |
* Location (parent dir) of the message e.g. Draft, Inbox etc
|
|
156 |
* @param aMsgId, message id
|
|
157 |
* @return TMsvId, parent directory of the message
|
|
158 |
*/
|
|
159 |
TMsvId MessageLocation( TMsvId aMsgId ) const;
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Sets content to messageId
|
|
163 |
* @param messageId, Message Id content
|
|
164 |
*/
|
|
165 |
void SetNotificationMessageIdL( TMsvId aMsgId );
|
|
166 |
|
37
|
167 |
/**
|
67
|
168 |
* Get max receive size limit (for MMS) from settings
|
|
169 |
*/
|
|
170 |
TInt MaxReceiveSizeLimitL();
|
|
171 |
|
|
172 |
/**
|
|
173 |
* Get MMS notification status.
|
|
174 |
* @param aMsvId MMS notification status.
|
37
|
175 |
*/
|
67
|
176 |
TCsMmsNotificationMsgState MmsNotificationStatus( TInt aMsvId );
|
|
177 |
|
|
178 |
/**
|
|
179 |
* verifys the current operation status
|
|
180 |
*@param aEntry, TMsvEntry
|
|
181 |
*/
|
|
182 |
TBool OperationFinished( const TMsvEntry& aEntry ) const;
|
|
183 |
|
|
184 |
/**
|
|
185 |
* verifys the current operation status
|
|
186 |
* @param aEntry, TMsvEntry
|
|
187 |
*/
|
|
188 |
TBool OperationOngoing( const TMsvEntry& aEntry ) const;
|
|
189 |
|
37
|
190 |
private:
|
|
191 |
/**
|
|
192 |
* Session
|
|
193 |
* Owned.
|
|
194 |
*/
|
67
|
195 |
CMsvSession* iMsvSession;
|
|
196 |
|
|
197 |
/**
|
|
198 |
* Notification client mtm
|
|
199 |
* Owned.
|
|
200 |
*/
|
|
201 |
CMmsNotificationClientMtm* iNotificationClient;
|
|
202 |
|
|
203 |
/**
|
|
204 |
* Mtm Registry
|
|
205 |
* Owned.
|
|
206 |
*/
|
|
207 |
CClientMtmRegistry* iMtmReg;
|
37
|
208 |
};
|
|
209 |
|
|
210 |
#endif // __MSG_STORE_HANDLER_H__
|
|
211 |
|
|
212 |
// EOF
|