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